On Thu, Oct 30, 2008 at 4:41 PM, Johannes Berg <johannes@xxxxxxxxxxxxxxxx> wrote: > On Thu, 2008-10-30 at 16:39 +0200, Tomas Winkler wrote: >> On Thu, Oct 30, 2008 at 4:24 PM, Johannes Berg >> <johannes@xxxxxxxxxxxxxxxx> wrote: >> > On Thu, 2008-10-30 at 15:23 +0200, Tomas Winkler wrote: >> >> On Wed, Oct 29, 2008 at 7:14 PM, Johannes Berg >> >> <johannes@xxxxxxxxxxxxxxxx> wrote: >> >> > This fixes the basic rate bitmap calculation in mac80211. >> >> > >> >> > Signed-off-by: Johannes Berg <johannes@xxxxxxxxxxxxxxxx> >> >> > Cc: stable@xxxxxxxxxx [2.6.25, 2.6.26, 2.6.27] >> >> > --- >> >> > Is this appropriate for stable? It's a trivial and obvious fix, and can >> >> > throw off the duration calculation, but it's likely nobody will ever >> >> > really notice... >> >> >> >> You would should fail association if one of the basic rates is not >> >> supported by the station >> > >> > No, this has nothing to do with association, it's just setting the >> > internal variable about which rates are basic in the BSS. >> >> I understand that but What your patch is doing it is preventing >> of setting basic rates for ratest that are not sported by the driver, >> but according >> the spec it is not permissible that driver will not support one of the >> basic rates. > > I don't understand. My patch is simply fixing the basic rate bitmap > calculation. If we don't support all basic rates then the AP shall have > denied the association, or we probably didn't even ask it. > > The current code there is just wrong, it will always set _all_ rates in > the basic rate bitmap rather than just those that really are basic > rates. Oh, I now I got it out of index. What about coding it in more readable way? for (i = 0; i < elems.supp_rates_len; i++) { int rate = (elems.supp_rates[i] & 0x7f) * 5; bool is_basic = !!(elems.supp_rates[i] & 0x80); if (rate > 110) have_higher_than_11mbit = true; for (j = 0; j < sband->n_bitrates; j++) { if (sband->bitrates[j].bitrate == rate) { rates |= BIT(j); if (is_basic) basic_rates |= BIT(j); break; } } } Tomas -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html