On 09/18/2015 04:43 PM, [email protected] wrote:
From: Ben Greear <[email protected]>

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 <[email protected]>

        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 <[email protected]>
Candela Technologies Inc  http://www.candelatech.com

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to