diff options
author | Juuso Oikarinen <juuso.oikarinen@nokia.com> | 2009-10-08 21:56:25 +0300 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-27 16:47:50 -0400 |
commit | d94cd297e58b55bb272fdfd51ff0de7acbc1941b (patch) | |
tree | 84b809c8ff5a24514c1c9f77983f2ec38ecfa9dd /drivers/net/wireless/wl12xx/wl1271_main.c | |
parent | 8a5a37a6c492f7c9602aa72ef19f69c926cdca15 (diff) | |
download | lwn-d94cd297e58b55bb272fdfd51ff0de7acbc1941b.tar.gz lwn-d94cd297e58b55bb272fdfd51ff0de7acbc1941b.zip |
wl1271: Update join usage
Update the usage of join's, including using actual beacon interval and
dtim from AP, and configuring a basic rate set from AP.
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_main.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_main.c | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c index b9b1c2013744..6e35fcf37e4f 100644 --- a/drivers/net/wireless/wl12xx/wl1271_main.c +++ b/drivers/net/wireless/wl12xx/wl1271_main.c @@ -394,8 +394,7 @@ static void wl1271_filter_work(struct work_struct *work) if (ret < 0) goto out; - /* FIXME: replace the magic numbers with proper definitions */ - ret = wl1271_cmd_join(wl, wl->bss_type, 1, 100, 0); + ret = wl1271_cmd_join(wl); if (ret < 0) goto out_sleep; @@ -672,8 +671,7 @@ static int wl1271_op_config_interface(struct ieee80211_hw *hw, memcpy(wl->ssid, conf->ssid, wl->ssid_len); if (wl->bss_type != BSS_TYPE_IBSS) { - /* FIXME: replace the magic numbers with proper definitions */ - ret = wl1271_cmd_join(wl, wl->bss_type, 5, 100, 1); + ret = wl1271_cmd_join(wl); if (ret < 0) goto out_sleep; } @@ -696,8 +694,7 @@ static int wl1271_op_config_interface(struct ieee80211_hw *hw, if (ret < 0) goto out_sleep; - /* FIXME: replace the magic numbers with proper definitions */ - ret = wl1271_cmd_join(wl, wl->bss_type, 1, 100, 0); + ret = wl1271_cmd_join(wl); if (ret < 0) goto out_sleep; @@ -738,8 +735,7 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed) u8 old_channel = wl->channel; wl->channel = channel; - /* FIXME: use beacon interval provided by mac80211 */ - ret = wl1271_cmd_join(wl, wl->bss_type, 1, 100, 0); + ret = wl1271_cmd_join(wl); if (ret < 0) { wl->channel = old_channel; goto out_sleep; @@ -1016,8 +1012,17 @@ static void wl1271_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; wl->aid = bss_conf->aid; + ret = wl1271_cmd_join(wl); + if (ret < 0) { + wl1271_warning("Association configuration " + "failed %d", ret); + goto out_sleep; + } + ret = wl1271_cmd_build_ps_poll(wl, wl->aid); if (ret < 0) goto out_sleep; @@ -1033,7 +1038,14 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw, if (ret < 0) goto out_sleep; } + } else { + /* use defaults when not associated */ + wl->beacon_int = WL1271_DEFAULT_BEACON_INT; + wl->dtim_period = WL1271_DEFAULT_DTIM_PERIOD; + wl->basic_rate_set = WL1271_DEFAULT_BASIC_RATE_SET; + wl->aid = 0; } + } if (changed & BSS_CHANGED_ERP_SLOT) { @@ -1066,13 +1078,20 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw, } if (changed & BSS_CHANGED_BASIC_RATES) { - u32 enabled_rates = wl1271_enabled_rates_get( + wl->basic_rate_set = wl1271_enabled_rates_get( wl, bss_conf->basic_rates); - ret = wl1271_acx_rate_policies(wl, enabled_rates); + ret = wl1271_acx_rate_policies(wl, wl->basic_rate_set); + if (ret < 0) { wl1271_warning("Set rate policies failed %d", ret); goto out_sleep; } + ret = wl1271_cmd_join(wl); + if (ret < 0) { + wl1271_warning("Join with new basic rate " + "set failed %d", ret); + goto out_sleep; + } } out_sleep: @@ -1269,6 +1288,9 @@ static int __devinit wl1271_probe(struct spi_device *spi) wl->psm_requested = false; wl->tx_queue_stopped = false; wl->power_level = WL1271_DEFAULT_POWER_LEVEL; + wl->beacon_int = WL1271_DEFAULT_BEACON_INT; + wl->dtim_period = WL1271_DEFAULT_DTIM_PERIOD; + wl->basic_rate_set = WL1271_DEFAULT_BASIC_RATE_SET; wl->band = IEEE80211_BAND_2GHZ; /* We use the default power on sleep time until we know which chip |