From 5c4cae6addd3e7693e671b5447d981695a2565da Mon Sep 17 00:00:00 2001 From: Eliad Peller Date: Sun, 30 Oct 2011 15:41:59 +0200 Subject: [PATCH] --- yaml --- r: 275671 b: refs/heads/rpi-4.1.y c: 3432f9233704a66e6067944339a311744243707d h: refs/heads/rpi-4.1.y i: 275669: 7cdd531aac5afa512b3ec95097f2a4efdf267dd6 275667: 06264b2ceda06799b7531581ad008fe0149ef9d1 275663: b9613289919b17065b0e7da6f5c8d2051dbb840f --- [refs] | 2 +- trunk/net/mac80211/mlme.c | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index e3d6b24a277549..06211523371f61 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/rpi-4.1.y: ae8e46723f803057daff392bdc93332be2f0ec98 +refs/heads/rpi-4.1.y: 3432f9233704a66e6067944339a311744243707d diff --git a/trunk/net/mac80211/mlme.c b/trunk/net/mac80211/mlme.c index 17258feaab9b8f..d3b408cda08dee 100644 --- a/trunk/net/mac80211/mlme.c +++ b/trunk/net/mac80211/mlme.c @@ -1485,6 +1485,7 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk, int i, j, err; bool have_higher_than_11mbit = false; u16 ap_ht_cap_flags; + int min_rate = INT_MAX, min_rate_index = -1; /* AssocResp and ReassocResp have identical structure */ @@ -1551,6 +1552,10 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk, rates |= BIT(j); if (is_basic) basic_rates |= BIT(j); + if (rate < min_rate) { + min_rate = rate; + min_rate_index = j; + } break; } } @@ -1568,11 +1573,25 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk, rates |= BIT(j); if (is_basic) basic_rates |= BIT(j); + if (rate < min_rate) { + min_rate = rate; + min_rate_index = j; + } break; } } } + /* + * some buggy APs don't advertise basic_rates. use the lowest + * supported rate instead. + */ + if (unlikely(!basic_rates) && min_rate_index >= 0) { + printk(KERN_DEBUG "%s: No basic rates in AssocResp. " + "Using min supported rate instead.\n", sdata->name); + basic_rates = BIT(min_rate_index); + } + sta->sta.supp_rates[wk->chan->band] = rates; sdata->vif.bss_conf.basic_rates = basic_rates;