aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-09-10 18:01:57 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-09-15 16:48:22 -0400
commit96dd22ac06b0dbfb069fdf530c72046a941e9694 (patch)
tree4dbf19921a1d4add0ca03a0ff1d7db37c4ecb8be /net/mac80211/mlme.c
parentccd7b36286f8c42b3fa95c5a8d402162ffab41df (diff)
mac80211: inform driver of basic rateset
Drivers need to know the basic rateset to be able to configure the ACK/CTS programming in hardware correctly. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c40
1 files changed, 9 insertions, 31 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 5b748447eb7d..55bc60713937 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -710,6 +710,12 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
710 ieee80211_led_assoc(local, 1); 710 ieee80211_led_assoc(local, 1);
711 711
712 sdata->bss_conf.assoc = 1; 712 sdata->bss_conf.assoc = 1;
713 /*
714 * For now just always ask the driver to update the basic rateset
715 * when we have associated, we aren't checking whether it actually
716 * changed or not.
717 */
718 changed |= BSS_CHANGED_BASIC_RATES;
713 ieee80211_bss_info_change_notify(sdata, changed); 719 ieee80211_bss_info_change_notify(sdata, changed);
714 720
715 netif_tx_start_all_queues(sdata->dev); 721 netif_tx_start_all_queues(sdata->dev);
@@ -1296,7 +1302,7 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
1296 } 1302 }
1297 1303
1298 sta->supp_rates[local->hw.conf.channel->band] = rates; 1304 sta->supp_rates[local->hw.conf.channel->band] = rates;
1299 sdata->basic_rates = basic_rates; 1305 sdata->bss_conf.basic_rates = basic_rates;
1300 1306
1301 /* cf. IEEE 802.11 9.2.12 */ 1307 /* cf. IEEE 802.11 9.2.12 */
1302 if (local->hw.conf.channel->band == IEEE80211_BAND_2GHZ && 1308 if (local->hw.conf.channel->band == IEEE80211_BAND_2GHZ &&
@@ -1453,34 +1459,6 @@ static int ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
1453 return res; 1459 return res;
1454} 1460}
1455 1461
1456static u64 ieee80211_sta_get_mandatory_rates(struct ieee80211_local *local,
1457 enum ieee80211_band band)
1458{
1459 struct ieee80211_supported_band *sband;
1460 struct ieee80211_rate *bitrates;
1461 u64 mandatory_rates;
1462 enum ieee80211_rate_flags mandatory_flag;
1463 int i;
1464
1465 sband = local->hw.wiphy->bands[band];
1466 if (!sband) {
1467 WARN_ON(1);
1468 sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
1469 }
1470
1471 if (band == IEEE80211_BAND_2GHZ)
1472 mandatory_flag = IEEE80211_RATE_MANDATORY_B;
1473 else
1474 mandatory_flag = IEEE80211_RATE_MANDATORY_A;
1475
1476 bitrates = sband->bitrates;
1477 mandatory_rates = 0;
1478 for (i = 0; i < sband->n_bitrates; i++)
1479 if (bitrates[i].flags & mandatory_flag)
1480 mandatory_rates |= BIT(i);
1481 return mandatory_rates;
1482}
1483
1484static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, 1462static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
1485 struct ieee80211_mgmt *mgmt, 1463 struct ieee80211_mgmt *mgmt,
1486 size_t len, 1464 size_t len,
@@ -1522,7 +1500,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
1522 prev_rates = sta->supp_rates[band]; 1500 prev_rates = sta->supp_rates[band];
1523 /* make sure mandatory rates are always added */ 1501 /* make sure mandatory rates are always added */
1524 sta->supp_rates[band] = supp_rates | 1502 sta->supp_rates[band] = supp_rates |
1525 ieee80211_sta_get_mandatory_rates(local, band); 1503 ieee80211_mandatory_rates(local, band);
1526 1504
1527#ifdef CONFIG_MAC80211_IBSS_DEBUG 1505#ifdef CONFIG_MAC80211_IBSS_DEBUG
1528 if (sta->supp_rates[band] != prev_rates) 1506 if (sta->supp_rates[band] != prev_rates)
@@ -2361,7 +2339,7 @@ struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata,
2361 2339
2362 /* make sure mandatory rates are always added */ 2340 /* make sure mandatory rates are always added */
2363 sta->supp_rates[band] = supp_rates | 2341 sta->supp_rates[band] = supp_rates |
2364 ieee80211_sta_get_mandatory_rates(local, band); 2342 ieee80211_mandatory_rates(local, band);
2365 2343
2366 rate_control_rate_init(sta, local); 2344 rate_control_rate_init(sta, local);
2367 2345