diff options
author | Eliad Peller <eliad@wizery.com> | 2011-10-30 09:41:59 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-11-07 13:19:13 -0500 |
commit | 3432f9233704a66e6067944339a311744243707d (patch) | |
tree | eca01496a63c79f4d6468df7f9dcec2e8a9fb22d /net/mac80211 | |
parent | ae8e46723f803057daff392bdc93332be2f0ec98 (diff) |
mac80211: use min rate as basic rate for buggy APs
Some buggy APs (and even P2P_GO) don't advertise their
basic rates in the association response.
In such case, use the min supported rate as the
basic rate.
Reported-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/mlme.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 17258feaab9b..d3b408cda08d 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -1485,6 +1485,7 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk, | |||
1485 | int i, j, err; | 1485 | int i, j, err; |
1486 | bool have_higher_than_11mbit = false; | 1486 | bool have_higher_than_11mbit = false; |
1487 | u16 ap_ht_cap_flags; | 1487 | u16 ap_ht_cap_flags; |
1488 | int min_rate = INT_MAX, min_rate_index = -1; | ||
1488 | 1489 | ||
1489 | /* AssocResp and ReassocResp have identical structure */ | 1490 | /* AssocResp and ReassocResp have identical structure */ |
1490 | 1491 | ||
@@ -1551,6 +1552,10 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk, | |||
1551 | rates |= BIT(j); | 1552 | rates |= BIT(j); |
1552 | if (is_basic) | 1553 | if (is_basic) |
1553 | basic_rates |= BIT(j); | 1554 | basic_rates |= BIT(j); |
1555 | if (rate < min_rate) { | ||
1556 | min_rate = rate; | ||
1557 | min_rate_index = j; | ||
1558 | } | ||
1554 | break; | 1559 | break; |
1555 | } | 1560 | } |
1556 | } | 1561 | } |
@@ -1568,11 +1573,25 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk, | |||
1568 | rates |= BIT(j); | 1573 | rates |= BIT(j); |
1569 | if (is_basic) | 1574 | if (is_basic) |
1570 | basic_rates |= BIT(j); | 1575 | basic_rates |= BIT(j); |
1576 | if (rate < min_rate) { | ||
1577 | min_rate = rate; | ||
1578 | min_rate_index = j; | ||
1579 | } | ||
1571 | break; | 1580 | break; |
1572 | } | 1581 | } |
1573 | } | 1582 | } |
1574 | } | 1583 | } |
1575 | 1584 | ||
1585 | /* | ||
1586 | * some buggy APs don't advertise basic_rates. use the lowest | ||
1587 | * supported rate instead. | ||
1588 | */ | ||
1589 | if (unlikely(!basic_rates) && min_rate_index >= 0) { | ||
1590 | printk(KERN_DEBUG "%s: No basic rates in AssocResp. " | ||
1591 | "Using min supported rate instead.\n", sdata->name); | ||
1592 | basic_rates = BIT(min_rate_index); | ||
1593 | } | ||
1594 | |||
1576 | sta->sta.supp_rates[wk->chan->band] = rates; | 1595 | sta->sta.supp_rates[wk->chan->band] = rates; |
1577 | sdata->vif.bss_conf.basic_rates = basic_rates; | 1596 | sdata->vif.bss_conf.basic_rates = basic_rates; |
1578 | 1597 | ||