diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2010-07-11 06:24:47 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-07-12 16:05:33 -0400 |
commit | d8147f9d9ed6abfa105234a21f05af4a4839eb80 (patch) | |
tree | 5e00a39ec607af756696ded2bcb01b7c1f8f0725 /drivers/net/wireless/rt2x00 | |
parent | 27df2a9ce9ea6a77b9959cf5cc03ee85324aced9 (diff) |
rt2x00: Disable link tuning while scanning
While scanning the link tuner must be disabled. Otherwise
it will interfere with receiving all beacons for each channel
due to changing sensitivity levels.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2400pci.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500pci.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500usb.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800lib.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00link.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00mac.c | 24 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt61pci.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt73usb.c | 2 |
9 files changed, 47 insertions, 4 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c index 5d5047fa0a26..d5f1fabe9faf 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/rt2x00/rt2400pci.c | |||
@@ -1567,6 +1567,8 @@ static const struct ieee80211_ops rt2400pci_mac80211_ops = { | |||
1567 | .config = rt2x00mac_config, | 1567 | .config = rt2x00mac_config, |
1568 | .configure_filter = rt2x00mac_configure_filter, | 1568 | .configure_filter = rt2x00mac_configure_filter, |
1569 | .set_tim = rt2x00mac_set_tim, | 1569 | .set_tim = rt2x00mac_set_tim, |
1570 | .sw_scan_start = rt2x00mac_sw_scan_start, | ||
1571 | .sw_scan_complete = rt2x00mac_sw_scan_complete, | ||
1570 | .get_stats = rt2x00mac_get_stats, | 1572 | .get_stats = rt2x00mac_get_stats, |
1571 | .bss_info_changed = rt2x00mac_bss_info_changed, | 1573 | .bss_info_changed = rt2x00mac_bss_info_changed, |
1572 | .conf_tx = rt2400pci_conf_tx, | 1574 | .conf_tx = rt2400pci_conf_tx, |
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c index 1d4758ac1311..096d6dbc8305 100644 --- a/drivers/net/wireless/rt2x00/rt2500pci.c +++ b/drivers/net/wireless/rt2x00/rt2500pci.c | |||
@@ -1864,6 +1864,8 @@ static const struct ieee80211_ops rt2500pci_mac80211_ops = { | |||
1864 | .config = rt2x00mac_config, | 1864 | .config = rt2x00mac_config, |
1865 | .configure_filter = rt2x00mac_configure_filter, | 1865 | .configure_filter = rt2x00mac_configure_filter, |
1866 | .set_tim = rt2x00mac_set_tim, | 1866 | .set_tim = rt2x00mac_set_tim, |
1867 | .sw_scan_start = rt2x00mac_sw_scan_start, | ||
1868 | .sw_scan_complete = rt2x00mac_sw_scan_complete, | ||
1867 | .get_stats = rt2x00mac_get_stats, | 1869 | .get_stats = rt2x00mac_get_stats, |
1868 | .bss_info_changed = rt2x00mac_bss_info_changed, | 1870 | .bss_info_changed = rt2x00mac_bss_info_changed, |
1869 | .conf_tx = rt2x00mac_conf_tx, | 1871 | .conf_tx = rt2x00mac_conf_tx, |
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index 6e48a15af4c5..0b7888d43f37 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/rt2x00/rt2500usb.c | |||
@@ -1755,6 +1755,8 @@ static const struct ieee80211_ops rt2500usb_mac80211_ops = { | |||
1755 | .configure_filter = rt2x00mac_configure_filter, | 1755 | .configure_filter = rt2x00mac_configure_filter, |
1756 | .set_tim = rt2x00mac_set_tim, | 1756 | .set_tim = rt2x00mac_set_tim, |
1757 | .set_key = rt2x00mac_set_key, | 1757 | .set_key = rt2x00mac_set_key, |
1758 | .sw_scan_start = rt2x00mac_sw_scan_start, | ||
1759 | .sw_scan_complete = rt2x00mac_sw_scan_complete, | ||
1758 | .get_stats = rt2x00mac_get_stats, | 1760 | .get_stats = rt2x00mac_get_stats, |
1759 | .bss_info_changed = rt2x00mac_bss_info_changed, | 1761 | .bss_info_changed = rt2x00mac_bss_info_changed, |
1760 | .conf_tx = rt2x00mac_conf_tx, | 1762 | .conf_tx = rt2x00mac_conf_tx, |
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index 255d089e87ea..bcf50fc79215 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c | |||
@@ -2896,6 +2896,8 @@ const struct ieee80211_ops rt2800_mac80211_ops = { | |||
2896 | .configure_filter = rt2x00mac_configure_filter, | 2896 | .configure_filter = rt2x00mac_configure_filter, |
2897 | .set_tim = rt2x00mac_set_tim, | 2897 | .set_tim = rt2x00mac_set_tim, |
2898 | .set_key = rt2x00mac_set_key, | 2898 | .set_key = rt2x00mac_set_key, |
2899 | .sw_scan_start = rt2x00mac_sw_scan_start, | ||
2900 | .sw_scan_complete = rt2x00mac_sw_scan_complete, | ||
2899 | .get_stats = rt2x00mac_get_stats, | 2901 | .get_stats = rt2x00mac_get_stats, |
2900 | .get_tkip_seq = rt2800_get_tkip_seq, | 2902 | .get_tkip_seq = rt2800_get_tkip_seq, |
2901 | .set_rts_threshold = rt2800_set_rts_threshold, | 2903 | .set_rts_threshold = rt2800_set_rts_threshold, |
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index 42f466163278..bf5e3f37e705 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h | |||
@@ -628,6 +628,7 @@ enum rt2x00_flags { | |||
628 | DEVICE_STATE_INITIALIZED, | 628 | DEVICE_STATE_INITIALIZED, |
629 | DEVICE_STATE_STARTED, | 629 | DEVICE_STATE_STARTED, |
630 | DEVICE_STATE_ENABLED_RADIO, | 630 | DEVICE_STATE_ENABLED_RADIO, |
631 | DEVICE_STATE_SCANNING, | ||
631 | 632 | ||
632 | /* | 633 | /* |
633 | * Driver requirements | 634 | * Driver requirements |
@@ -1081,6 +1082,8 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
1081 | #else | 1082 | #else |
1082 | #define rt2x00mac_set_key NULL | 1083 | #define rt2x00mac_set_key NULL |
1083 | #endif /* CONFIG_RT2X00_LIB_CRYPTO */ | 1084 | #endif /* CONFIG_RT2X00_LIB_CRYPTO */ |
1085 | void rt2x00mac_sw_scan_start(struct ieee80211_hw *hw); | ||
1086 | void rt2x00mac_sw_scan_complete(struct ieee80211_hw *hw); | ||
1084 | int rt2x00mac_get_stats(struct ieee80211_hw *hw, | 1087 | int rt2x00mac_get_stats(struct ieee80211_hw *hw, |
1085 | struct ieee80211_low_level_stats *stats); | 1088 | struct ieee80211_low_level_stats *stats); |
1086 | void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw, | 1089 | void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw, |
diff --git a/drivers/net/wireless/rt2x00/rt2x00link.c b/drivers/net/wireless/rt2x00/rt2x00link.c index 801925bb157f..14f1d5126289 100644 --- a/drivers/net/wireless/rt2x00/rt2x00link.c +++ b/drivers/net/wireless/rt2x00/rt2x00link.c | |||
@@ -278,6 +278,15 @@ void rt2x00link_start_tuner(struct rt2x00_dev *rt2x00dev) | |||
278 | if (!rt2x00dev->intf_sta_count) | 278 | if (!rt2x00dev->intf_sta_count) |
279 | return; | 279 | return; |
280 | 280 | ||
281 | /** | ||
282 | * While scanning, link tuning is disabled. By default | ||
283 | * the most sensitive settings will be used to make sure | ||
284 | * that all beacons and probe responses will be recieved | ||
285 | * during the scan. | ||
286 | */ | ||
287 | if (test_bit(DEVICE_STATE_SCANNING, &rt2x00dev->flags)) | ||
288 | return; | ||
289 | |||
281 | rt2x00link_reset_tuner(rt2x00dev, false); | 290 | rt2x00link_reset_tuner(rt2x00dev, false); |
282 | 291 | ||
283 | if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) | 292 | if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) |
@@ -338,7 +347,8 @@ static void rt2x00link_tuner(struct work_struct *work) | |||
338 | * When the radio is shutting down we should | 347 | * When the radio is shutting down we should |
339 | * immediately cease all link tuning. | 348 | * immediately cease all link tuning. |
340 | */ | 349 | */ |
341 | if (!test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) | 350 | if (!test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags) || |
351 | test_bit(DEVICE_STATE_SCANNING, &rt2x00dev->flags)) | ||
342 | return; | 352 | return; |
343 | 353 | ||
344 | /* | 354 | /* |
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c index 3b838c0bf59f..bbce496bc182 100644 --- a/drivers/net/wireless/rt2x00/rt2x00mac.c +++ b/drivers/net/wireless/rt2x00/rt2x00mac.c | |||
@@ -347,9 +347,11 @@ int rt2x00mac_config(struct ieee80211_hw *hw, u32 changed) | |||
347 | /* | 347 | /* |
348 | * Some configuration parameters (e.g. channel and antenna values) can | 348 | * Some configuration parameters (e.g. channel and antenna values) can |
349 | * only be set when the radio is enabled, but do require the RX to | 349 | * only be set when the radio is enabled, but do require the RX to |
350 | * be off. | 350 | * be off. During this period we should keep link tuning enabled, |
351 | * if for any reason the link tuner must be reset, this will be | ||
352 | * handled by rt2x00lib_config(). | ||
351 | */ | 353 | */ |
352 | rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF); | 354 | rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF_LINK); |
353 | 355 | ||
354 | /* | 356 | /* |
355 | * When we've just turned on the radio, we want to reprogram | 357 | * When we've just turned on the radio, we want to reprogram |
@@ -367,7 +369,7 @@ int rt2x00mac_config(struct ieee80211_hw *hw, u32 changed) | |||
367 | rt2x00lib_config_antenna(rt2x00dev, rt2x00dev->default_ant); | 369 | rt2x00lib_config_antenna(rt2x00dev, rt2x00dev->default_ant); |
368 | 370 | ||
369 | /* Turn RX back on */ | 371 | /* Turn RX back on */ |
370 | rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON); | 372 | rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON_LINK); |
371 | 373 | ||
372 | return 0; | 374 | return 0; |
373 | } | 375 | } |
@@ -540,6 +542,22 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
540 | EXPORT_SYMBOL_GPL(rt2x00mac_set_key); | 542 | EXPORT_SYMBOL_GPL(rt2x00mac_set_key); |
541 | #endif /* CONFIG_RT2X00_LIB_CRYPTO */ | 543 | #endif /* CONFIG_RT2X00_LIB_CRYPTO */ |
542 | 544 | ||
545 | void rt2x00mac_sw_scan_start(struct ieee80211_hw *hw) | ||
546 | { | ||
547 | struct rt2x00_dev *rt2x00dev = hw->priv; | ||
548 | __set_bit(DEVICE_STATE_SCANNING, &rt2x00dev->flags); | ||
549 | rt2x00link_stop_tuner(rt2x00dev); | ||
550 | } | ||
551 | EXPORT_SYMBOL_GPL(rt2x00mac_sw_scan_start); | ||
552 | |||
553 | void rt2x00mac_sw_scan_complete(struct ieee80211_hw *hw) | ||
554 | { | ||
555 | struct rt2x00_dev *rt2x00dev = hw->priv; | ||
556 | __clear_bit(DEVICE_STATE_SCANNING, &rt2x00dev->flags); | ||
557 | rt2x00link_start_tuner(rt2x00dev); | ||
558 | } | ||
559 | EXPORT_SYMBOL_GPL(rt2x00mac_sw_scan_complete); | ||
560 | |||
543 | int rt2x00mac_get_stats(struct ieee80211_hw *hw, | 561 | int rt2x00mac_get_stats(struct ieee80211_hw *hw, |
544 | struct ieee80211_low_level_stats *stats) | 562 | struct ieee80211_low_level_stats *stats) |
545 | { | 563 | { |
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index ee84536fb9f0..fe7bce7c05de 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -2784,6 +2784,8 @@ static const struct ieee80211_ops rt61pci_mac80211_ops = { | |||
2784 | .configure_filter = rt2x00mac_configure_filter, | 2784 | .configure_filter = rt2x00mac_configure_filter, |
2785 | .set_tim = rt2x00mac_set_tim, | 2785 | .set_tim = rt2x00mac_set_tim, |
2786 | .set_key = rt2x00mac_set_key, | 2786 | .set_key = rt2x00mac_set_key, |
2787 | .sw_scan_start = rt2x00mac_sw_scan_start, | ||
2788 | .sw_scan_complete = rt2x00mac_sw_scan_complete, | ||
2787 | .get_stats = rt2x00mac_get_stats, | 2789 | .get_stats = rt2x00mac_get_stats, |
2788 | .bss_info_changed = rt2x00mac_bss_info_changed, | 2790 | .bss_info_changed = rt2x00mac_bss_info_changed, |
2789 | .conf_tx = rt61pci_conf_tx, | 2791 | .conf_tx = rt61pci_conf_tx, |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index 156f5d366013..9ea6a672d4e2 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -2229,6 +2229,8 @@ static const struct ieee80211_ops rt73usb_mac80211_ops = { | |||
2229 | .configure_filter = rt2x00mac_configure_filter, | 2229 | .configure_filter = rt2x00mac_configure_filter, |
2230 | .set_tim = rt2x00mac_set_tim, | 2230 | .set_tim = rt2x00mac_set_tim, |
2231 | .set_key = rt2x00mac_set_key, | 2231 | .set_key = rt2x00mac_set_key, |
2232 | .sw_scan_start = rt2x00mac_sw_scan_start, | ||
2233 | .sw_scan_complete = rt2x00mac_sw_scan_complete, | ||
2232 | .get_stats = rt2x00mac_get_stats, | 2234 | .get_stats = rt2x00mac_get_stats, |
2233 | .bss_info_changed = rt2x00mac_bss_info_changed, | 2235 | .bss_info_changed = rt2x00mac_bss_info_changed, |
2234 | .conf_tx = rt73usb_conf_tx, | 2236 | .conf_tx = rt73usb_conf_tx, |