aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1271_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_main.c')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_main.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index cc5c3285deac..b9b1c2013744 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -583,6 +583,7 @@ static void wl1271_op_stop(struct ieee80211_hw *hw)
583 wl->ssid_len = 0; 583 wl->ssid_len = 0;
584 wl->listen_int = 1; 584 wl->listen_int = 1;
585 wl->bss_type = MAX_BSS_TYPE; 585 wl->bss_type = MAX_BSS_TYPE;
586 wl->band = IEEE80211_BAND_2GHZ;
586 587
587 wl->rx_counter = 0; 588 wl->rx_counter = 0;
588 wl->elp = false; 589 wl->elp = false;
@@ -727,6 +728,8 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
727 728
728 mutex_lock(&wl->mutex); 729 mutex_lock(&wl->mutex);
729 730
731 wl->band = conf->channel->band;
732
730 ret = wl1271_ps_elp_wakeup(wl, false); 733 ret = wl1271_ps_elp_wakeup(wl, false);
731 if (ret < 0) 734 if (ret < 0)
732 goto out; 735 goto out;
@@ -978,6 +981,22 @@ out:
978 return ret; 981 return ret;
979} 982}
980 983
984static u32 wl1271_enabled_rates_get(struct wl1271 *wl, u64 basic_rate_set)
985{
986 struct ieee80211_supported_band *band;
987 u32 enabled_rates = 0;
988 int bit;
989
990 band = wl->hw->wiphy->bands[wl->band];
991 for (bit = 0; bit < band->n_bitrates; bit++) {
992 if (basic_rate_set & 0x1)
993 enabled_rates |= band->bitrates[bit].hw_value;
994 basic_rate_set >>= 1;
995 }
996
997 return enabled_rates;
998}
999
981static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw, 1000static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
982 struct ieee80211_vif *vif, 1001 struct ieee80211_vif *vif,
983 struct ieee80211_bss_conf *bss_conf, 1002 struct ieee80211_bss_conf *bss_conf,
@@ -1016,6 +1035,7 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
1016 } 1035 }
1017 } 1036 }
1018 } 1037 }
1038
1019 if (changed & BSS_CHANGED_ERP_SLOT) { 1039 if (changed & BSS_CHANGED_ERP_SLOT) {
1020 if (bss_conf->use_short_slot) 1040 if (bss_conf->use_short_slot)
1021 ret = wl1271_acx_slot(wl, SLOT_TIME_SHORT); 1041 ret = wl1271_acx_slot(wl, SLOT_TIME_SHORT);
@@ -1045,6 +1065,16 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
1045 } 1065 }
1046 } 1066 }
1047 1067
1068 if (changed & BSS_CHANGED_BASIC_RATES) {
1069 u32 enabled_rates = wl1271_enabled_rates_get(
1070 wl, bss_conf->basic_rates);
1071 ret = wl1271_acx_rate_policies(wl, enabled_rates);
1072 if (ret < 0) {
1073 wl1271_warning("Set rate policies failed %d", ret);
1074 goto out_sleep;
1075 }
1076 }
1077
1048out_sleep: 1078out_sleep:
1049 wl1271_ps_elp_sleep(wl); 1079 wl1271_ps_elp_sleep(wl);
1050 1080
@@ -1239,6 +1269,7 @@ static int __devinit wl1271_probe(struct spi_device *spi)
1239 wl->psm_requested = false; 1269 wl->psm_requested = false;
1240 wl->tx_queue_stopped = false; 1270 wl->tx_queue_stopped = false;
1241 wl->power_level = WL1271_DEFAULT_POWER_LEVEL; 1271 wl->power_level = WL1271_DEFAULT_POWER_LEVEL;
1272 wl->band = IEEE80211_BAND_2GHZ;
1242 1273
1243 /* We use the default power on sleep time until we know which chip 1274 /* We use the default power on sleep time until we know which chip
1244 * we're using */ 1275 * we're using */