aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/wl12xx/main.c')
-rw-r--r--drivers/net/wireless/wl12xx/main.c32
1 files changed, 7 insertions, 25 deletions
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 9785b4c43c8..67f6db4354f 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -434,7 +434,7 @@ static int wl1271_plt_init(struct wl1271 *wl)
434 if (ret < 0) 434 if (ret < 0)
435 return ret; 435 return ret;
436 436
437 ret = wl1271_init_templates_config(wl); 437 ret = wl1271_sta_init_templates_config(wl);
438 if (ret < 0) 438 if (ret < 0)
439 return ret; 439 return ret;
440 440
@@ -1363,24 +1363,6 @@ static void wl1271_set_band_rate(struct wl1271 *wl)
1363 wl->basic_rate_set = wl->conf.tx.basic_rate_5; 1363 wl->basic_rate_set = wl->conf.tx.basic_rate_5;
1364} 1364}
1365 1365
1366static u32 wl1271_min_rate_get(struct wl1271 *wl)
1367{
1368 int i;
1369 u32 rate = 0;
1370
1371 if (!wl->basic_rate_set) {
1372 WARN_ON(1);
1373 wl->basic_rate_set = wl->conf.tx.basic_rate;
1374 }
1375
1376 for (i = 0; !rate; i++) {
1377 if ((wl->basic_rate_set >> i) & 0x1)
1378 rate = 1 << i;
1379 }
1380
1381 return rate;
1382}
1383
1384static int wl1271_handle_idle(struct wl1271 *wl, bool idle) 1366static int wl1271_handle_idle(struct wl1271 *wl, bool idle)
1385{ 1367{
1386 int ret; 1368 int ret;
@@ -1391,7 +1373,7 @@ static int wl1271_handle_idle(struct wl1271 *wl, bool idle)
1391 if (ret < 0) 1373 if (ret < 0)
1392 goto out; 1374 goto out;
1393 } 1375 }
1394 wl->rate_set = wl1271_min_rate_get(wl); 1376 wl->rate_set = wl1271_tx_min_rate_get(wl);
1395 wl->sta_rate_set = 0; 1377 wl->sta_rate_set = 0;
1396 ret = wl1271_acx_sta_rate_policies(wl); 1378 ret = wl1271_acx_sta_rate_policies(wl);
1397 if (ret < 0) 1379 if (ret < 0)
@@ -1467,7 +1449,7 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
1467 if (!test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags)) 1449 if (!test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags))
1468 wl1271_set_band_rate(wl); 1450 wl1271_set_band_rate(wl);
1469 1451
1470 wl->basic_rate = wl1271_min_rate_get(wl); 1452 wl->basic_rate = wl1271_tx_min_rate_get(wl);
1471 ret = wl1271_acx_sta_rate_policies(wl); 1453 ret = wl1271_acx_sta_rate_policies(wl);
1472 if (ret < 0) 1454 if (ret < 0)
1473 wl1271_warning("rate policy for update channel " 1455 wl1271_warning("rate policy for update channel "
@@ -1927,7 +1909,7 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
1927 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_BEACON, 1909 ret = wl1271_cmd_template_set(wl, CMD_TEMPL_BEACON,
1928 beacon->data, 1910 beacon->data,
1929 beacon->len, 0, 1911 beacon->len, 0,
1930 wl1271_min_rate_get(wl)); 1912 wl1271_tx_min_rate_get(wl));
1931 1913
1932 if (ret < 0) { 1914 if (ret < 0) {
1933 dev_kfree_skb(beacon); 1915 dev_kfree_skb(beacon);
@@ -1943,7 +1925,7 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
1943 CMD_TEMPL_PROBE_RESPONSE, 1925 CMD_TEMPL_PROBE_RESPONSE,
1944 beacon->data, 1926 beacon->data,
1945 beacon->len, 0, 1927 beacon->len, 0,
1946 wl1271_min_rate_get(wl)); 1928 wl1271_tx_min_rate_get(wl));
1947 dev_kfree_skb(beacon); 1929 dev_kfree_skb(beacon);
1948 if (ret < 0) 1930 if (ret < 0)
1949 goto out_sleep; 1931 goto out_sleep;
@@ -2016,7 +1998,7 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
2016 rates = bss_conf->basic_rates; 1998 rates = bss_conf->basic_rates;
2017 wl->basic_rate_set = wl1271_tx_enabled_rates_get(wl, 1999 wl->basic_rate_set = wl1271_tx_enabled_rates_get(wl,
2018 rates); 2000 rates);
2019 wl->basic_rate = wl1271_min_rate_get(wl); 2001 wl->basic_rate = wl1271_tx_min_rate_get(wl);
2020 ret = wl1271_acx_sta_rate_policies(wl); 2002 ret = wl1271_acx_sta_rate_policies(wl);
2021 if (ret < 0) 2003 if (ret < 0)
2022 goto out_sleep; 2004 goto out_sleep;
@@ -2070,7 +2052,7 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
2070 2052
2071 /* revert back to minimum rates for the current band */ 2053 /* revert back to minimum rates for the current band */
2072 wl1271_set_band_rate(wl); 2054 wl1271_set_band_rate(wl);
2073 wl->basic_rate = wl1271_min_rate_get(wl); 2055 wl->basic_rate = wl1271_tx_min_rate_get(wl);
2074 ret = wl1271_acx_sta_rate_policies(wl); 2056 ret = wl1271_acx_sta_rate_policies(wl);
2075 if (ret < 0) 2057 if (ret < 0)
2076 goto out_sleep; 2058 goto out_sleep;