aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1271_main.c
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2009-10-08 14:56:25 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-27 16:47:50 -0400
commitd94cd297e58b55bb272fdfd51ff0de7acbc1941b (patch)
tree84b809c8ff5a24514c1c9f77983f2ec38ecfa9dd /drivers/net/wireless/wl12xx/wl1271_main.c
parent8a5a37a6c492f7c9602aa72ef19f69c926cdca15 (diff)
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.c42
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)
394 if (ret < 0) 394 if (ret < 0)
395 goto out; 395 goto out;
396 396
397 /* FIXME: replace the magic numbers with proper definitions */ 397 ret = wl1271_cmd_join(wl);
398 ret = wl1271_cmd_join(wl, wl->bss_type, 1, 100, 0);
399 if (ret < 0) 398 if (ret < 0)
400 goto out_sleep; 399 goto out_sleep;
401 400
@@ -672,8 +671,7 @@ static int wl1271_op_config_interface(struct ieee80211_hw *hw,
672 memcpy(wl->ssid, conf->ssid, wl->ssid_len); 671 memcpy(wl->ssid, conf->ssid, wl->ssid_len);
673 672
674 if (wl->bss_type != BSS_TYPE_IBSS) { 673 if (wl->bss_type != BSS_TYPE_IBSS) {
675 /* FIXME: replace the magic numbers with proper definitions */ 674 ret = wl1271_cmd_join(wl);
676 ret = wl1271_cmd_join(wl, wl->bss_type, 5, 100, 1);
677 if (ret < 0) 675 if (ret < 0)
678 goto out_sleep; 676 goto out_sleep;
679 } 677 }
@@ -696,8 +694,7 @@ static int wl1271_op_config_interface(struct ieee80211_hw *hw,
696 if (ret < 0) 694 if (ret < 0)
697 goto out_sleep; 695 goto out_sleep;
698 696
699 /* FIXME: replace the magic numbers with proper definitions */ 697 ret = wl1271_cmd_join(wl);
700 ret = wl1271_cmd_join(wl, wl->bss_type, 1, 100, 0);
701 698
702 if (ret < 0) 699 if (ret < 0)
703 goto out_sleep; 700 goto out_sleep;
@@ -738,8 +735,7 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
738 u8 old_channel = wl->channel; 735 u8 old_channel = wl->channel;
739 wl->channel = channel; 736 wl->channel = channel;
740 737
741 /* FIXME: use beacon interval provided by mac80211 */ 738 ret = wl1271_cmd_join(wl);
742 ret = wl1271_cmd_join(wl, wl->bss_type, 1, 100, 0);
743 if (ret < 0) { 739 if (ret < 0) {
744 wl->channel = old_channel; 740 wl->channel = old_channel;
745 goto out_sleep; 741 goto out_sleep;
@@ -1016,8 +1012,17 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
1016 1012
1017 if (changed & BSS_CHANGED_ASSOC) { 1013 if (changed & BSS_CHANGED_ASSOC) {
1018 if (bss_conf->assoc) { 1014 if (bss_conf->assoc) {
1015 wl->beacon_int = bss_conf->beacon_int;
1016 wl->dtim_period = bss_conf->dtim_period;
1019 wl->aid = bss_conf->aid; 1017 wl->aid = bss_conf->aid;
1020 1018
1019 ret = wl1271_cmd_join(wl);
1020 if (ret < 0) {
1021 wl1271_warning("Association configuration "
1022 "failed %d", ret);
1023 goto out_sleep;
1024 }
1025
1021 ret = wl1271_cmd_build_ps_poll(wl, wl->aid); 1026 ret = wl1271_cmd_build_ps_poll(wl, wl->aid);
1022 if (ret < 0) 1027 if (ret < 0)
1023 goto out_sleep; 1028 goto out_sleep;
@@ -1033,7 +1038,14 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
1033 if (ret < 0) 1038 if (ret < 0)
1034 goto out_sleep; 1039 goto out_sleep;
1035 } 1040 }
1041 } else {
1042 /* use defaults when not associated */
1043 wl->beacon_int = WL1271_DEFAULT_BEACON_INT;
1044 wl->dtim_period = WL1271_DEFAULT_DTIM_PERIOD;
1045 wl->basic_rate_set = WL1271_DEFAULT_BASIC_RATE_SET;
1046 wl->aid = 0;
1036 } 1047 }
1048
1037 } 1049 }
1038 1050
1039 if (changed & BSS_CHANGED_ERP_SLOT) { 1051 if (changed & BSS_CHANGED_ERP_SLOT) {
@@ -1066,13 +1078,20 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
1066 } 1078 }
1067 1079
1068 if (changed & BSS_CHANGED_BASIC_RATES) { 1080 if (changed & BSS_CHANGED_BASIC_RATES) {
1069 u32 enabled_rates = wl1271_enabled_rates_get( 1081 wl->basic_rate_set = wl1271_enabled_rates_get(
1070 wl, bss_conf->basic_rates); 1082 wl, bss_conf->basic_rates);
1071 ret = wl1271_acx_rate_policies(wl, enabled_rates); 1083 ret = wl1271_acx_rate_policies(wl, wl->basic_rate_set);
1084
1072 if (ret < 0) { 1085 if (ret < 0) {
1073 wl1271_warning("Set rate policies failed %d", ret); 1086 wl1271_warning("Set rate policies failed %d", ret);
1074 goto out_sleep; 1087 goto out_sleep;
1075 } 1088 }
1089 ret = wl1271_cmd_join(wl);
1090 if (ret < 0) {
1091 wl1271_warning("Join with new basic rate "
1092 "set failed %d", ret);
1093 goto out_sleep;
1094 }
1076 } 1095 }
1077 1096
1078out_sleep: 1097out_sleep:
@@ -1269,6 +1288,9 @@ static int __devinit wl1271_probe(struct spi_device *spi)
1269 wl->psm_requested = false; 1288 wl->psm_requested = false;
1270 wl->tx_queue_stopped = false; 1289 wl->tx_queue_stopped = false;
1271 wl->power_level = WL1271_DEFAULT_POWER_LEVEL; 1290 wl->power_level = WL1271_DEFAULT_POWER_LEVEL;
1291 wl->beacon_int = WL1271_DEFAULT_BEACON_INT;
1292 wl->dtim_period = WL1271_DEFAULT_DTIM_PERIOD;
1293 wl->basic_rate_set = WL1271_DEFAULT_BASIC_RATE_SET;
1272 wl->band = IEEE80211_BAND_2GHZ; 1294 wl->band = IEEE80211_BAND_2GHZ;
1273 1295
1274 /* We use the default power on sleep time until we know which chip 1296 /* We use the default power on sleep time until we know which chip