aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless/wl12xx/wl1251_main.c
diff options
context:
space:
mode:
authorKalle Valo <kalle.valo@nokia.com>2009-08-07 13:34:12 +0300
committerJohn W. Linville <linville@tuxdriver.com>2009-08-14 09:13:39 -0400
commite2fd4611d50a1cd13a370f84b672a5f29472ee09 (patch)
tree2195d420e6cbdc73acbbd3be182aa56aa4c0484c /drivers/net/wireless/wl12xx/wl1251_main.c
parent46e947b9c382f67f84cffec3bf068d6d23695058 (diff)
wl1251: use beacon interval and dtim period provided by mac80211
wl1251 was using hardcoded beacon intervals and dtim periods, use the ones provided by mac80211 instead. Signed-off-by: Kalle Valo <kalle.valo@nokia.com> Reviewed-by: Vidhya Govindan <vidhya.govindan@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1251_main.c')
-rw-r--r--drivers/net/wireless/wl12xx/wl1251_main.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1251_main.c b/drivers/net/wireless/wl12xx/wl1251_main.c
index 47b82faac69..70142334541 100644
--- a/drivers/net/wireless/wl12xx/wl1251_main.c
+++ b/drivers/net/wireless/wl12xx/wl1251_main.c
@@ -324,8 +324,8 @@ static void wl1251_filter_work(struct work_struct *work)
if (ret < 0)
goto out;
- /* FIXME: replace the magic numbers with proper definitions */
- ret = wl1251_cmd_join(wl, wl->bss_type, 100, 1, false);
+ ret = wl1251_cmd_join(wl, wl->bss_type, wl->beacon_int,
+ wl->dtim_period, false);
if (ret < 0)
goto out_sleep;
@@ -564,8 +564,8 @@ static int wl1251_op_config(struct ieee80211_hw *hw, u32 changed)
goto out;
if (channel != wl->channel) {
- /* FIXME: use beacon interval provided by mac80211 */
- ret = wl1251_cmd_join(wl, wl->bss_type, 100, 1, false);
+ ret = wl1251_cmd_join(wl, wl->bss_type, wl->beacon_int,
+ wl->dtim_period, false);
if (ret < 0)
goto out_sleep;
@@ -1057,6 +1057,11 @@ static void wl1251_op_bss_info_changed(struct ieee80211_hw *hw,
if (changed & BSS_CHANGED_ASSOC) {
if (bss_conf->assoc) {
+ wl->beacon_int = bss_conf->beacon_int;
+ wl->dtim_period = bss_conf->dtim_period;
+
+ /* FIXME: call join */
+
wl->aid = bss_conf->aid;
ret = wl1251_build_ps_poll(wl, wl->aid);
@@ -1074,6 +1079,10 @@ static void wl1251_op_bss_info_changed(struct ieee80211_hw *hw,
if (ret < 0)
goto out_sleep;
}
+ } else {
+ /* use defaults when not associated */
+ wl->beacon_int = WL1251_DEFAULT_BEACON_INT;
+ wl->dtim_period = WL1251_DEFAULT_DTIM_PERIOD;
}
}
if (changed & BSS_CHANGED_ERP_SLOT) {
@@ -1113,7 +1122,9 @@ static void wl1251_op_bss_info_changed(struct ieee80211_hw *hw,
goto out;
if (wl->bss_type != BSS_TYPE_IBSS) {
- ret = wl1251_cmd_join(wl, wl->bss_type, 100, 5, true);
+ ret = wl1251_cmd_join(wl, wl->bss_type,
+ wl->beacon_int,
+ wl->dtim_period, true);
if (ret < 0)
goto out_sleep;
wl1251_warning("Set ctsprotect failed %d", ret);
@@ -1139,7 +1150,8 @@ static void wl1251_op_bss_info_changed(struct ieee80211_hw *hw,
if (ret < 0)
goto out;
- ret = wl1251_cmd_join(wl, wl->bss_type, 100, 1, false);
+ ret = wl1251_cmd_join(wl, wl->bss_type, wl->beacon_int,
+ wl->dtim_period, false);
if (ret < 0)
goto out;
@@ -1329,6 +1341,8 @@ struct ieee80211_hw *wl1251_alloc_hw(void)
wl->psm_requested = false;
wl->tx_queue_stopped = false;
wl->power_level = WL1251_DEFAULT_POWER_LEVEL;
+ wl->beacon_int = WL1251_DEFAULT_BEACON_INT;
+ wl->dtim_period = WL1251_DEFAULT_DTIM_PERIOD;
for (i = 0; i < FW_TX_CMPLT_BLOCK_SIZE; i++)
wl->tx_frames[i] = NULL;