linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: greearb@candelatech.com, linux-wireless@vger.kernel.org
Subject: Re: [PATCH] mac80211:  Take bitrates into account when building IEs.
Date: Thu, 08 Oct 2015 11:25:37 +0200	[thread overview]
Message-ID: <1444296337.2131.9.camel@sipsolutions.net> (raw)
In-Reply-To: <1442610145-8759-1-git-send-email-greearb@candelatech.com>

On Fri, 2015-09-18 at 14:02 -0700, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
> 
> If a user restricts the rateset for some reason, then the
> probe requests should not advertise rates that are not
> selected by the user.
> 
> To implement this, we save the requested bitrates at
> the mac80211 level and take it into account when building
> the IEs.
> 
> This allows one to create a more realistic /b mode
> station on modern hardware, for instance.  Good for
> testing, and likely good for other things as well.
> 
> Signed-off-by: Ben Greear <greearb@candelatech.com>
> ---
>  include/net/mac80211.h     |  4 ++
>  net/mac80211/cfg.c         |  3 ++
>  net/mac80211/ieee80211_i.h | 15 ++++++-
>  net/mac80211/scan.c        | 26 ++++++++++++-
>  net/mac80211/util.c        | 97 ++++++++++++++++++++++++++++++++++++++++++----
>  5 files changed, 135 insertions(+), 10 deletions(-)
> 
> diff --git a/include/net/mac80211.h b/include/net/mac80211.h
> index d52914b..be069bd 100644
> --- a/include/net/mac80211.h
> +++ b/include/net/mac80211.h
> @@ -1838,10 +1838,14 @@ struct ieee80211_hw {
>   * struct ieee80211_scan_request - hw scan request
>   *
>   * @ies: pointers different parts of IEs (in req.ie)
> + * @disable_ht: Ensure nothing related to HT is in the probe request?
> + * @disable_vht: Ensure nothing related to VHT is in the probe request?

what's with the question marks? :)

I don't really see why it should be in this struct - the driver
shouldn't have to access it even for hardware scan?

> +++ b/net/mac80211/cfg.c
> @@ -2466,6 +2466,9 @@ static int ieee80211_set_bitrate_mask(struct wiphy *wiphy,
>  > 	> if (!ieee80211_sdata_running(sdata))
>  > 	> 	> return -ENETDOWN;
>  
> +> 	> memcpy(&sdata->cfg_bitrate_mask, mask, sizeof(*mask));
> +> 	> sdata->cfg_bitrate_mask_set = true;


I'm not entirely convinced of this ...

The documentation for @NL80211_CMD_SET_TX_BITRATE_MASK doesn't really
state this - it clearly states it's for TX only. Settings it up this
way now might be rather confusing.

Consider P2P for example, the bitrate mask might be set w/o CCK, but
perhaps other networks can be found?

> +> 	> /* Store bitrate mask configured from user-space */
> +> 	> struct cfg80211_bitrate_mask cfg_bitrate_mask;
> +> 	> bool cfg_bitrate_mask_set; /* Has user set the mask? */

I'm also not really happy with such stateful API in general. If you set
this, and forget to reset it ...

Obviously that's already the case for the TX bitrates, but it's
typically used in pretty restricted situations.

Perhaps, for the use case you're considering, it would make more sense
to be able to in general change the device capabilities in some way?

johannes

  reply	other threads:[~2015-10-08  9:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-18 21:02 [PATCH] mac80211: Take bitrates into account when building IEs greearb
2015-10-08  9:25 ` Johannes Berg [this message]
2015-10-09 16:14   ` Ben Greear

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=1444296337.2131.9.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=greearb@candelatech.com \
    --cc=linux-wireless@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).