Linux wireless drivers development
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: nbd@nbd.name, linux-wireless@vger.kernel.org,
	lorenzo.bianconi@redhat.com
Subject: Re: [PATCH] wifi: mt76: mt7921: introduce mt7921_get_mac80211_ops utility routine
Date: Mon, 6 Mar 2023 23:16:48 +0100	[thread overview]
Message-ID: <ZAZmUCBl+8LaoiAq@lore-desk> (raw)
In-Reply-To: <41b51fcc9e1ba560fbdad76d818d31167d73c265.camel@sipsolutions.net>

[-- Attachment #1: Type: text/plain, Size: 931 bytes --]

> 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

      reply	other threads:[~2023-03-06 22:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-06 17:50 [PATCH] wifi: mt76: mt7921: introduce mt7921_get_mac80211_ops utility routine Lorenzo Bianconi
2023-03-06 20:49 ` Johannes Berg
2023-03-06 22:16   ` Lorenzo Bianconi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZAZmUCBl+8LaoiAq@lore-desk \
    --to=lorenzo@kernel.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=nbd@nbd.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox