Search Linux Wireless

Re: [PATCH] wifi: mt76: mt7921: introduce mt7921_get_mac80211_ops utility routine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On Mon, 2023-03-06 at 18:50 +0100, Lorenzo Bianconi wrote:
> > 
> > +struct ieee80211_ops *
> > +mt7921_get_mac80211_ops(struct device *dev, void *drv_data, u8 *fw_features)
> > +{
> > +	struct ieee80211_ops *ops;
> > +
> > +	ops = devm_kmemdup(dev, &mt7921_ops, sizeof(mt7921_ops), GFP_KERNEL);
> 
> It's kind of nice to have static const ops so they can't be a target for
> overwriting and function pointer injection, maybe just declare two
> copies with a macro or so, with and without chanctx, and return the
> appropriate one? It won't even use more memory unless you never run a
> device w/o chanctx ops.

In the current status quo I think it is fine but it does not scale if in the
future we want to add some new fw features that require changing ieee80211_ops
pointer. Honestly I do not know if it is something we should consider nowadays.
What do you think?

Regards,
Lorenzo

> 
> johannes
> 

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux