diff options
author | Kalle Valo <kalle.valo@nokia.com> | 2009-08-07 06:34:12 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-14 09:13:39 -0400 |
commit | e2fd4611d50a1cd13a370f84b672a5f29472ee09 (patch) | |
tree | 2195d420e6cbdc73acbbd3be182aa56aa4c0484c /drivers | |
parent | 46e947b9c382f67f84cffec3bf068d6d23695058 (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')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1251.h | 6 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1251_cmd.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1251_main.c | 26 |
3 files changed, 30 insertions, 7 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1251.h b/drivers/net/wireless/wl12xx/wl1251.h index 44c5001beeda..86d2abea4e1e 100644 --- a/drivers/net/wireless/wl12xx/wl1251.h +++ b/drivers/net/wireless/wl12xx/wl1251.h | |||
@@ -360,6 +360,9 @@ struct wl1251 { | |||
360 | /* PSM mode requested */ | 360 | /* PSM mode requested */ |
361 | bool psm_requested; | 361 | bool psm_requested; |
362 | 362 | ||
363 | u16 beacon_int; | ||
364 | u8 dtim_period; | ||
365 | |||
363 | /* in dBm */ | 366 | /* in dBm */ |
364 | int power_level; | 367 | int power_level; |
365 | 368 | ||
@@ -392,6 +395,9 @@ void wl1251_disable_interrupts(struct wl1251 *wl); | |||
392 | 395 | ||
393 | #define WL1251_TX_QUEUE_MAX_LENGTH 20 | 396 | #define WL1251_TX_QUEUE_MAX_LENGTH 20 |
394 | 397 | ||
398 | #define WL1251_DEFAULT_BEACON_INT 100 | ||
399 | #define WL1251_DEFAULT_DTIM_PERIOD 1 | ||
400 | |||
395 | #define CHIP_ID_1251_PG10 (0x7010101) | 401 | #define CHIP_ID_1251_PG10 (0x7010101) |
396 | #define CHIP_ID_1251_PG11 (0x7020101) | 402 | #define CHIP_ID_1251_PG11 (0x7020101) |
397 | #define CHIP_ID_1251_PG12 (0x7030101) | 403 | #define CHIP_ID_1251_PG12 (0x7030101) |
diff --git a/drivers/net/wireless/wl12xx/wl1251_cmd.c b/drivers/net/wireless/wl12xx/wl1251_cmd.c index 50daa9bda4ae..9cd46ce88e51 100644 --- a/drivers/net/wireless/wl12xx/wl1251_cmd.c +++ b/drivers/net/wireless/wl12xx/wl1251_cmd.c | |||
@@ -273,7 +273,10 @@ int wl1251_cmd_join(struct wl1251 *wl, u8 bss_type, u16 beacon_interval, | |||
273 | if (ret < 0) | 273 | if (ret < 0) |
274 | goto out; | 274 | goto out; |
275 | 275 | ||
276 | wl1251_debug(DEBUG_CMD, "cmd join"); | 276 | wl1251_debug(DEBUG_CMD, "cmd join%s %d %d%s", |
277 | bss_type == BSS_TYPE_IBSS ? " ibss" : "", | ||
278 | beacon_interval, dtim_interval, | ||
279 | wait ? " wait" : ""); | ||
277 | 280 | ||
278 | /* Reverse order BSSID */ | 281 | /* Reverse order BSSID */ |
279 | bssid = (u8 *) &join->bssid_lsb; | 282 | bssid = (u8 *) &join->bssid_lsb; |
diff --git a/drivers/net/wireless/wl12xx/wl1251_main.c b/drivers/net/wireless/wl12xx/wl1251_main.c index 47b82faac697..701423345414 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) | |||
324 | if (ret < 0) | 324 | if (ret < 0) |
325 | goto out; | 325 | goto out; |
326 | 326 | ||
327 | /* FIXME: replace the magic numbers with proper definitions */ | 327 | ret = wl1251_cmd_join(wl, wl->bss_type, wl->beacon_int, |
328 | ret = wl1251_cmd_join(wl, wl->bss_type, 100, 1, false); | 328 | wl->dtim_period, false); |
329 | if (ret < 0) | 329 | if (ret < 0) |
330 | goto out_sleep; | 330 | goto out_sleep; |
331 | 331 | ||
@@ -564,8 +564,8 @@ static int wl1251_op_config(struct ieee80211_hw *hw, u32 changed) | |||
564 | goto out; | 564 | goto out; |
565 | 565 | ||
566 | if (channel != wl->channel) { | 566 | if (channel != wl->channel) { |
567 | /* FIXME: use beacon interval provided by mac80211 */ | 567 | ret = wl1251_cmd_join(wl, wl->bss_type, wl->beacon_int, |
568 | ret = wl1251_cmd_join(wl, wl->bss_type, 100, 1, false); | 568 | wl->dtim_period, false); |
569 | if (ret < 0) | 569 | if (ret < 0) |
570 | goto out_sleep; | 570 | goto out_sleep; |
571 | 571 | ||
@@ -1057,6 +1057,11 @@ static void wl1251_op_bss_info_changed(struct ieee80211_hw *hw, | |||
1057 | 1057 | ||
1058 | if (changed & BSS_CHANGED_ASSOC) { | 1058 | if (changed & BSS_CHANGED_ASSOC) { |
1059 | if (bss_conf->assoc) { | 1059 | if (bss_conf->assoc) { |
1060 | wl->beacon_int = bss_conf->beacon_int; | ||
1061 | wl->dtim_period = bss_conf->dtim_period; | ||
1062 | |||
1063 | /* FIXME: call join */ | ||
1064 | |||
1060 | wl->aid = bss_conf->aid; | 1065 | wl->aid = bss_conf->aid; |
1061 | 1066 | ||
1062 | ret = wl1251_build_ps_poll(wl, wl->aid); | 1067 | ret = wl1251_build_ps_poll(wl, wl->aid); |
@@ -1074,6 +1079,10 @@ static void wl1251_op_bss_info_changed(struct ieee80211_hw *hw, | |||
1074 | if (ret < 0) | 1079 | if (ret < 0) |
1075 | goto out_sleep; | 1080 | goto out_sleep; |
1076 | } | 1081 | } |
1082 | } else { | ||
1083 | /* use defaults when not associated */ | ||
1084 | wl->beacon_int = WL1251_DEFAULT_BEACON_INT; | ||
1085 | wl->dtim_period = WL1251_DEFAULT_DTIM_PERIOD; | ||
1077 | } | 1086 | } |
1078 | } | 1087 | } |
1079 | if (changed & BSS_CHANGED_ERP_SLOT) { | 1088 | if (changed & BSS_CHANGED_ERP_SLOT) { |
@@ -1113,7 +1122,9 @@ static void wl1251_op_bss_info_changed(struct ieee80211_hw *hw, | |||
1113 | goto out; | 1122 | goto out; |
1114 | 1123 | ||
1115 | if (wl->bss_type != BSS_TYPE_IBSS) { | 1124 | if (wl->bss_type != BSS_TYPE_IBSS) { |
1116 | ret = wl1251_cmd_join(wl, wl->bss_type, 100, 5, true); | 1125 | ret = wl1251_cmd_join(wl, wl->bss_type, |
1126 | wl->beacon_int, | ||
1127 | wl->dtim_period, true); | ||
1117 | if (ret < 0) | 1128 | if (ret < 0) |
1118 | goto out_sleep; | 1129 | goto out_sleep; |
1119 | wl1251_warning("Set ctsprotect failed %d", ret); | 1130 | wl1251_warning("Set ctsprotect failed %d", ret); |
@@ -1139,7 +1150,8 @@ static void wl1251_op_bss_info_changed(struct ieee80211_hw *hw, | |||
1139 | if (ret < 0) | 1150 | if (ret < 0) |
1140 | goto out; | 1151 | goto out; |
1141 | 1152 | ||
1142 | ret = wl1251_cmd_join(wl, wl->bss_type, 100, 1, false); | 1153 | ret = wl1251_cmd_join(wl, wl->bss_type, wl->beacon_int, |
1154 | wl->dtim_period, false); | ||
1143 | 1155 | ||
1144 | if (ret < 0) | 1156 | if (ret < 0) |
1145 | goto out; | 1157 | goto out; |
@@ -1329,6 +1341,8 @@ struct ieee80211_hw *wl1251_alloc_hw(void) | |||
1329 | wl->psm_requested = false; | 1341 | wl->psm_requested = false; |
1330 | wl->tx_queue_stopped = false; | 1342 | wl->tx_queue_stopped = false; |
1331 | wl->power_level = WL1251_DEFAULT_POWER_LEVEL; | 1343 | wl->power_level = WL1251_DEFAULT_POWER_LEVEL; |
1344 | wl->beacon_int = WL1251_DEFAULT_BEACON_INT; | ||
1345 | wl->dtim_period = WL1251_DEFAULT_DTIM_PERIOD; | ||
1332 | 1346 | ||
1333 | for (i = 0; i < FW_TX_CMPLT_BLOCK_SIZE; i++) | 1347 | for (i = 0; i < FW_TX_CMPLT_BLOCK_SIZE; i++) |
1334 | wl->tx_frames[i] = NULL; | 1348 | wl->tx_frames[i] = NULL; |