All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: linux-wireless@vger.kernel.org
Cc: johannes@sipsolutions.net
Subject: Re: [PATCH] mac80211: ensure association req uses configured ratemask.
Date: Wed, 23 Sep 2015 16:10:02 -0700	[thread overview]
Message-ID: <5603314A.4010505@candelatech.com> (raw)
In-Reply-To: <1442619806-29917-1-git-send-email-greearb@candelatech.com>

On 09/18/2015 04:43 PM, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
>
> When sending the association request, pay attention to the
> legacy rates configured by the user, and do not advertise support
> for any that are not configured.
>
> This makes the assoc request packet look more correct when
> making modern hardware act like a /b mode station, for instance.
>
> Signed-off-by: Ben Greear <greearb@candelatech.com>

>   	assoc_data->capability = req->bss->capability;
> -	assoc_data->supp_rates = bss->supp_rates;
> -	assoc_data->supp_rates_len = bss->supp_rates_len;
> +	if (sdata->cfg_bitrate_mask_set) {
> +		int band = req->bss->channel->band;
> +		u32 msk = sdata->cfg_bitrate_mask.control[band].legacy;
> +		u8 all_rates[12] = {0x82, 0x84, 0x8b, 0x96,
> +				    12, 18, 24, 36, 48, 72, 96, 108};
> +		int i;
> +		int q = 0;
> +
> +		for (i = 0; i < 12; i++) {
> +			int j;
> +
> +			if (!(msk & (1 << i)))
> +				break;
> +
> +			for (j = 0; j < bss->supp_rates_len; j++) {
> +				if (bss->supp_rates[j] == all_rates[i]) {
> +					assoc_data->supp_rates[q] =
> +						all_rates[i];
> +					q++;
> +					break;
> +				}
> +			}
> +		}
> +		assoc_data->supp_rates_len = q;


This logic is buggy in at least two ways...I'll re-post after I
get this working better.

Thanks,
Ben



-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


      reply	other threads:[~2015-09-23 23:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-18 23:43 [PATCH] mac80211: ensure association req uses configured ratemask greearb
2015-09-23 23:10 ` Ben Greear [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=5603314A.4010505@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=johannes@sipsolutions.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.