aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-05-01 19:04:59 -0400
committerDavid S. Miller <davem@davemloft.net>2008-05-01 19:04:59 -0400
commitfb65f180e02dde224af256b43d3ab2c28b9689d7 (patch)
tree72b66091be51f3f16c2f9aae75be386a9fccc620 /drivers
parentab59859de1946a098b091308380179e92dc7683b (diff)
parent61c2b682b8391f13b67e2d95990a0aba34697d9c (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/linville/wireless-2.6
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/b43/b43.h4
-rw-r--r--drivers/net/wireless/b43/main.c43
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.h1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.h1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c29
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c26
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00leds.c15
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00lib.h6
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c2
14 files changed, 77 insertions, 64 deletions
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
index eff2a158a411..37783cdd301a 100644
--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
@@ -691,6 +691,10 @@ struct b43_wl {
691 691
692 struct mutex mutex; 692 struct mutex mutex;
693 spinlock_t irq_lock; 693 spinlock_t irq_lock;
694 /* R/W lock for data transmission.
695 * Transmissions on 2+ queues can run concurrently, but somebody else
696 * might sync with TX by write_lock_irqsave()'ing. */
697 rwlock_t tx_lock;
694 /* Lock for LEDs access. */ 698 /* Lock for LEDs access. */
695 spinlock_t leds_lock; 699 spinlock_t leds_lock;
696 /* Lock for SHM access. */ 700 /* Lock for SHM access. */
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 6c7db9a1a466..8fdba9415c04 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -729,6 +729,7 @@ static void b43_synchronize_irq(struct b43_wldev *dev)
729 */ 729 */
730void b43_dummy_transmission(struct b43_wldev *dev) 730void b43_dummy_transmission(struct b43_wldev *dev)
731{ 731{
732 struct b43_wl *wl = dev->wl;
732 struct b43_phy *phy = &dev->phy; 733 struct b43_phy *phy = &dev->phy;
733 unsigned int i, max_loop; 734 unsigned int i, max_loop;
734 u16 value; 735 u16 value;
@@ -755,6 +756,9 @@ void b43_dummy_transmission(struct b43_wldev *dev)
755 return; 756 return;
756 } 757 }
757 758
759 spin_lock_irq(&wl->irq_lock);
760 write_lock(&wl->tx_lock);
761
758 for (i = 0; i < 5; i++) 762 for (i = 0; i < 5; i++)
759 b43_ram_write(dev, i * 4, buffer[i]); 763 b43_ram_write(dev, i * 4, buffer[i]);
760 764
@@ -795,6 +799,9 @@ void b43_dummy_transmission(struct b43_wldev *dev)
795 } 799 }
796 if (phy->radio_ver == 0x2050 && phy->radio_rev <= 0x5) 800 if (phy->radio_ver == 0x2050 && phy->radio_rev <= 0x5)
797 b43_radio_write16(dev, 0x0051, 0x0037); 801 b43_radio_write16(dev, 0x0051, 0x0037);
802
803 write_unlock(&wl->tx_lock);
804 spin_unlock_irq(&wl->irq_lock);
798} 805}
799 806
800static void key_write(struct b43_wldev *dev, 807static void key_write(struct b43_wldev *dev,
@@ -2840,24 +2847,31 @@ static int b43_op_tx(struct ieee80211_hw *hw,
2840{ 2847{
2841 struct b43_wl *wl = hw_to_b43_wl(hw); 2848 struct b43_wl *wl = hw_to_b43_wl(hw);
2842 struct b43_wldev *dev = wl->current_dev; 2849 struct b43_wldev *dev = wl->current_dev;
2843 int err = -ENODEV; 2850 unsigned long flags;
2851 int err;
2844 2852
2845 if (unlikely(skb->len < 2 + 2 + 6)) { 2853 if (unlikely(skb->len < 2 + 2 + 6)) {
2846 /* Too short, this can't be a valid frame. */ 2854 /* Too short, this can't be a valid frame. */
2847 return -EINVAL; 2855 dev_kfree_skb_any(skb);
2856 return NETDEV_TX_OK;
2848 } 2857 }
2849 B43_WARN_ON(skb_shinfo(skb)->nr_frags); 2858 B43_WARN_ON(skb_shinfo(skb)->nr_frags);
2850
2851 if (unlikely(!dev)) 2859 if (unlikely(!dev))
2852 goto out; 2860 return NETDEV_TX_BUSY;
2853 if (unlikely(b43_status(dev) < B43_STAT_STARTED)) 2861
2854 goto out; 2862 /* Transmissions on seperate queues can run concurrently. */
2855 /* TX is done without a global lock. */ 2863 read_lock_irqsave(&wl->tx_lock, flags);
2856 if (b43_using_pio_transfers(dev)) 2864
2857 err = b43_pio_tx(dev, skb, ctl); 2865 err = -ENODEV;
2858 else 2866 if (likely(b43_status(dev) >= B43_STAT_STARTED)) {
2859 err = b43_dma_tx(dev, skb, ctl); 2867 if (b43_using_pio_transfers(dev))
2860out: 2868 err = b43_pio_tx(dev, skb, ctl);
2869 else
2870 err = b43_dma_tx(dev, skb, ctl);
2871 }
2872
2873 read_unlock_irqrestore(&wl->tx_lock, flags);
2874
2861 if (unlikely(err)) 2875 if (unlikely(err))
2862 return NETDEV_TX_BUSY; 2876 return NETDEV_TX_BUSY;
2863 return NETDEV_TX_OK; 2877 return NETDEV_TX_OK;
@@ -3476,7 +3490,9 @@ static void b43_wireless_core_stop(struct b43_wldev *dev)
3476 spin_unlock_irqrestore(&wl->irq_lock, flags); 3490 spin_unlock_irqrestore(&wl->irq_lock, flags);
3477 b43_synchronize_irq(dev); 3491 b43_synchronize_irq(dev);
3478 3492
3493 write_lock_irqsave(&wl->tx_lock, flags);
3479 b43_set_status(dev, B43_STAT_INITIALIZED); 3494 b43_set_status(dev, B43_STAT_INITIALIZED);
3495 write_unlock_irqrestore(&wl->tx_lock, flags);
3480 3496
3481 b43_pio_stop(dev); 3497 b43_pio_stop(dev);
3482 mutex_unlock(&wl->mutex); 3498 mutex_unlock(&wl->mutex);
@@ -3485,8 +3501,6 @@ static void b43_wireless_core_stop(struct b43_wldev *dev)
3485 cancel_delayed_work_sync(&dev->periodic_work); 3501 cancel_delayed_work_sync(&dev->periodic_work);
3486 mutex_lock(&wl->mutex); 3502 mutex_lock(&wl->mutex);
3487 3503
3488 ieee80211_stop_queues(wl->hw); //FIXME this could cause a deadlock, as mac80211 seems buggy.
3489
3490 b43_mac_suspend(dev); 3504 b43_mac_suspend(dev);
3491 free_irq(dev->dev->irq, dev); 3505 free_irq(dev->dev->irq, dev);
3492 b43dbg(wl, "Wireless interface stopped\n"); 3506 b43dbg(wl, "Wireless interface stopped\n");
@@ -4498,6 +4512,7 @@ static int b43_wireless_init(struct ssb_device *dev)
4498 memset(wl, 0, sizeof(*wl)); 4512 memset(wl, 0, sizeof(*wl));
4499 wl->hw = hw; 4513 wl->hw = hw;
4500 spin_lock_init(&wl->irq_lock); 4514 spin_lock_init(&wl->irq_lock);
4515 rwlock_init(&wl->tx_lock);
4501 spin_lock_init(&wl->leds_lock); 4516 spin_lock_init(&wl->leds_lock);
4502 spin_lock_init(&wl->shm_lock); 4517 spin_lock_init(&wl->shm_lock);
4503 mutex_init(&wl->mutex); 4518 mutex_init(&wl->mutex);
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.h b/drivers/net/wireless/iwlwifi/iwl-3945.h
index 45c1c5533bf0..c7695a215a39 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.h
@@ -742,7 +742,6 @@ struct iwl3945_priv {
742 u8 direct_ssid_len; 742 u8 direct_ssid_len;
743 u8 direct_ssid[IW_ESSID_MAX_SIZE]; 743 u8 direct_ssid[IW_ESSID_MAX_SIZE];
744 struct iwl3945_scan_cmd *scan; 744 struct iwl3945_scan_cmd *scan;
745 u8 only_active_channel;
746 745
747 /* spinlock */ 746 /* spinlock */
748 spinlock_t lock; /* protect general shared data */ 747 spinlock_t lock; /* protect general shared data */
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.h b/drivers/net/wireless/iwlwifi/iwl-4965.h
index 9ed13cb0a2a9..581b98556c86 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.h
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.h
@@ -996,7 +996,6 @@ struct iwl_priv {
996 u8 direct_ssid_len; 996 u8 direct_ssid_len;
997 u8 direct_ssid[IW_ESSID_MAX_SIZE]; 997 u8 direct_ssid[IW_ESSID_MAX_SIZE];
998 struct iwl4965_scan_cmd *scan; 998 struct iwl4965_scan_cmd *scan;
999 u8 only_active_channel;
1000 999
1001 /* spinlock */ 1000 /* spinlock */
1002 spinlock_t lock; /* protect general shared data */ 1001 spinlock_t lock; /* protect general shared data */
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index a1a0b3c581f1..13925b627e3b 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -4968,17 +4968,6 @@ static int iwl3945_get_channels_for_scan(struct iwl3945_priv *priv,
4968 if (channels[i].flags & IEEE80211_CHAN_DISABLED) 4968 if (channels[i].flags & IEEE80211_CHAN_DISABLED)
4969 continue; 4969 continue;
4970 4970
4971 if (channels[i].hw_value ==
4972 le16_to_cpu(priv->active_rxon.channel)) {
4973 if (iwl3945_is_associated(priv)) {
4974 IWL_DEBUG_SCAN
4975 ("Skipping current channel %d\n",
4976 le16_to_cpu(priv->active_rxon.channel));
4977 continue;
4978 }
4979 } else if (priv->only_active_channel)
4980 continue;
4981
4982 scan_ch->channel = channels[i].hw_value; 4971 scan_ch->channel = channels[i].hw_value;
4983 4972
4984 ch_info = iwl3945_get_channel_info(priv, band, scan_ch->channel); 4973 ch_info = iwl3945_get_channel_info(priv, band, scan_ch->channel);
@@ -6303,12 +6292,17 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
6303 priv->direct_ssid, priv->direct_ssid_len); 6292 priv->direct_ssid, priv->direct_ssid_len);
6304 direct_mask = 1; 6293 direct_mask = 1;
6305 } else if (!iwl3945_is_associated(priv) && priv->essid_len) { 6294 } else if (!iwl3945_is_associated(priv) && priv->essid_len) {
6295 IWL_DEBUG_SCAN
6296 ("Kicking off one direct scan for '%s' when not associated\n",
6297 iwl3945_escape_essid(priv->essid, priv->essid_len));
6306 scan->direct_scan[0].id = WLAN_EID_SSID; 6298 scan->direct_scan[0].id = WLAN_EID_SSID;
6307 scan->direct_scan[0].len = priv->essid_len; 6299 scan->direct_scan[0].len = priv->essid_len;
6308 memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len); 6300 memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len);
6309 direct_mask = 1; 6301 direct_mask = 1;
6310 } else 6302 } else {
6303 IWL_DEBUG_SCAN("Kicking off one indirect scan.\n");
6311 direct_mask = 0; 6304 direct_mask = 0;
6305 }
6312 6306
6313 /* We don't build a direct scan probe request; the uCode will do 6307 /* We don't build a direct scan probe request; the uCode will do
6314 * that based on the direct_mask added to each channel entry */ 6308 * that based on the direct_mask added to each channel entry */
@@ -6346,23 +6340,18 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
6346 if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) 6340 if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR)
6347 scan->filter_flags = RXON_FILTER_PROMISC_MSK; 6341 scan->filter_flags = RXON_FILTER_PROMISC_MSK;
6348 6342
6349 if (direct_mask) { 6343 if (direct_mask)
6350 IWL_DEBUG_SCAN
6351 ("Initiating direct scan for %s.\n",
6352 iwl3945_escape_essid(priv->essid, priv->essid_len));
6353 scan->channel_count = 6344 scan->channel_count =
6354 iwl3945_get_channels_for_scan( 6345 iwl3945_get_channels_for_scan(
6355 priv, band, 1, /* active */ 6346 priv, band, 1, /* active */
6356 direct_mask, 6347 direct_mask,
6357 (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]); 6348 (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]);
6358 } else { 6349 else
6359 IWL_DEBUG_SCAN("Initiating indirect scan.\n");
6360 scan->channel_count = 6350 scan->channel_count =
6361 iwl3945_get_channels_for_scan( 6351 iwl3945_get_channels_for_scan(
6362 priv, band, 0, /* passive */ 6352 priv, band, 0, /* passive */
6363 direct_mask, 6353 direct_mask,
6364 (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]); 6354 (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]);
6365 }
6366 6355
6367 cmd.len += le16_to_cpu(scan->tx_cmd.len) + 6356 cmd.len += le16_to_cpu(scan->tx_cmd.len) +
6368 scan->channel_count * sizeof(struct iwl3945_scan_channel); 6357 scan->channel_count * sizeof(struct iwl3945_scan_channel);
@@ -7314,8 +7303,6 @@ static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw)
7314 return; 7303 return;
7315 } 7304 }
7316 7305
7317 priv->only_active_channel = 0;
7318
7319 iwl3945_set_rate(priv); 7306 iwl3945_set_rate(priv);
7320 7307
7321 mutex_unlock(&priv->mutex); 7308 mutex_unlock(&priv->mutex);
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index d0bbcaaeb94c..883b42f7e998 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -4633,17 +4633,6 @@ static int iwl4965_get_channels_for_scan(struct iwl_priv *priv,
4633 if (channels[i].flags & IEEE80211_CHAN_DISABLED) 4633 if (channels[i].flags & IEEE80211_CHAN_DISABLED)
4634 continue; 4634 continue;
4635 4635
4636 if (ieee80211_frequency_to_channel(channels[i].center_freq) ==
4637 le16_to_cpu(priv->active_rxon.channel)) {
4638 if (iwl_is_associated(priv)) {
4639 IWL_DEBUG_SCAN
4640 ("Skipping current channel %d\n",
4641 le16_to_cpu(priv->active_rxon.channel));
4642 continue;
4643 }
4644 } else if (priv->only_active_channel)
4645 continue;
4646
4647 scan_ch->channel = ieee80211_frequency_to_channel(channels[i].center_freq); 4636 scan_ch->channel = ieee80211_frequency_to_channel(channels[i].center_freq);
4648 4637
4649 ch_info = iwl_get_channel_info(priv, band, 4638 ch_info = iwl_get_channel_info(priv, band,
@@ -5824,11 +5813,15 @@ static void iwl4965_bg_request_scan(struct work_struct *data)
5824 priv->direct_ssid, priv->direct_ssid_len); 5813 priv->direct_ssid, priv->direct_ssid_len);
5825 direct_mask = 1; 5814 direct_mask = 1;
5826 } else if (!iwl_is_associated(priv) && priv->essid_len) { 5815 } else if (!iwl_is_associated(priv) && priv->essid_len) {
5816 IWL_DEBUG_SCAN
5817 ("Kicking off one direct scan for '%s' when not associated\n",
5818 iwl4965_escape_essid(priv->essid, priv->essid_len));
5827 scan->direct_scan[0].id = WLAN_EID_SSID; 5819 scan->direct_scan[0].id = WLAN_EID_SSID;
5828 scan->direct_scan[0].len = priv->essid_len; 5820 scan->direct_scan[0].len = priv->essid_len;
5829 memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len); 5821 memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len);
5830 direct_mask = 1; 5822 direct_mask = 1;
5831 } else { 5823 } else {
5824 IWL_DEBUG_SCAN("Kicking off one indirect scan.\n");
5832 direct_mask = 0; 5825 direct_mask = 0;
5833 } 5826 }
5834 5827
@@ -5881,23 +5874,18 @@ static void iwl4965_bg_request_scan(struct work_struct *data)
5881 if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) 5874 if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR)
5882 scan->filter_flags = RXON_FILTER_PROMISC_MSK; 5875 scan->filter_flags = RXON_FILTER_PROMISC_MSK;
5883 5876
5884 if (direct_mask) { 5877 if (direct_mask)
5885 IWL_DEBUG_SCAN
5886 ("Initiating direct scan for %s.\n",
5887 iwl4965_escape_essid(priv->essid, priv->essid_len));
5888 scan->channel_count = 5878 scan->channel_count =
5889 iwl4965_get_channels_for_scan( 5879 iwl4965_get_channels_for_scan(
5890 priv, band, 1, /* active */ 5880 priv, band, 1, /* active */
5891 direct_mask, 5881 direct_mask,
5892 (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]); 5882 (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]);
5893 } else { 5883 else
5894 IWL_DEBUG_SCAN("Initiating indirect scan.\n");
5895 scan->channel_count = 5884 scan->channel_count =
5896 iwl4965_get_channels_for_scan( 5885 iwl4965_get_channels_for_scan(
5897 priv, band, 0, /* passive */ 5886 priv, band, 0, /* passive */
5898 direct_mask, 5887 direct_mask,
5899 (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]); 5888 (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]);
5900 }
5901 5889
5902 cmd.len += le16_to_cpu(scan->tx_cmd.len) + 5890 cmd.len += le16_to_cpu(scan->tx_cmd.len) +
5903 scan->channel_count * sizeof(struct iwl4965_scan_channel); 5891 scan->channel_count * sizeof(struct iwl4965_scan_channel);
@@ -7061,8 +7049,6 @@ static void iwl4965_mac_reset_tsf(struct ieee80211_hw *hw)
7061 return; 7049 return;
7062 } 7050 }
7063 7051
7064 priv->only_active_channel = 0;
7065
7066 iwl4965_set_rate(priv); 7052 iwl4965_set_rate(priv);
7067 7053
7068 mutex_unlock(&priv->mutex); 7054 mutex_unlock(&priv->mutex);
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index b41187af1306..560b9c73c0b9 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -363,7 +363,7 @@ static void rt2400pci_config_erp(struct rt2x00_dev *rt2x00dev,
363 rt2x00pci_register_write(rt2x00dev, TXCSR1, reg); 363 rt2x00pci_register_write(rt2x00dev, TXCSR1, reg);
364 364
365 rt2x00pci_register_read(rt2x00dev, ARCSR2, &reg); 365 rt2x00pci_register_read(rt2x00dev, ARCSR2, &reg);
366 rt2x00_set_field32(&reg, ARCSR2_SIGNAL, 0x00 | preamble_mask); 366 rt2x00_set_field32(&reg, ARCSR2_SIGNAL, 0x00);
367 rt2x00_set_field32(&reg, ARCSR2_SERVICE, 0x04); 367 rt2x00_set_field32(&reg, ARCSR2_SERVICE, 0x04);
368 rt2x00_set_field32(&reg, ARCSR2_LENGTH, get_duration(ACK_SIZE, 10)); 368 rt2x00_set_field32(&reg, ARCSR2_LENGTH, get_duration(ACK_SIZE, 10));
369 rt2x00pci_register_write(rt2x00dev, ARCSR2, reg); 369 rt2x00pci_register_write(rt2x00dev, ARCSR2, reg);
@@ -1308,7 +1308,7 @@ static int rt2400pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
1308 1308
1309 if (value == LED_MODE_TXRX_ACTIVITY) { 1309 if (value == LED_MODE_TXRX_ACTIVITY) {
1310 rt2x00dev->led_qual.rt2x00dev = rt2x00dev; 1310 rt2x00dev->led_qual.rt2x00dev = rt2x00dev;
1311 rt2x00dev->led_radio.type = LED_TYPE_ACTIVITY; 1311 rt2x00dev->led_qual.type = LED_TYPE_ACTIVITY;
1312 rt2x00dev->led_qual.led_dev.brightness_set = 1312 rt2x00dev->led_qual.led_dev.brightness_set =
1313 rt2400pci_brightness_set; 1313 rt2400pci_brightness_set;
1314 rt2x00dev->led_qual.led_dev.blink_set = 1314 rt2x00dev->led_qual.led_dev.blink_set =
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index 5ade097ed45e..a5ed54b69262 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -370,7 +370,7 @@ static void rt2500pci_config_erp(struct rt2x00_dev *rt2x00dev,
370 rt2x00pci_register_write(rt2x00dev, TXCSR1, reg); 370 rt2x00pci_register_write(rt2x00dev, TXCSR1, reg);
371 371
372 rt2x00pci_register_read(rt2x00dev, ARCSR2, &reg); 372 rt2x00pci_register_read(rt2x00dev, ARCSR2, &reg);
373 rt2x00_set_field32(&reg, ARCSR2_SIGNAL, 0x00 | preamble_mask); 373 rt2x00_set_field32(&reg, ARCSR2_SIGNAL, 0x00);
374 rt2x00_set_field32(&reg, ARCSR2_SERVICE, 0x04); 374 rt2x00_set_field32(&reg, ARCSR2_SERVICE, 0x04);
375 rt2x00_set_field32(&reg, ARCSR2_LENGTH, get_duration(ACK_SIZE, 10)); 375 rt2x00_set_field32(&reg, ARCSR2_LENGTH, get_duration(ACK_SIZE, 10));
376 rt2x00pci_register_write(rt2x00dev, ARCSR2, reg); 376 rt2x00pci_register_write(rt2x00dev, ARCSR2, reg);
@@ -1485,7 +1485,7 @@ static int rt2500pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
1485 1485
1486 if (value == LED_MODE_TXRX_ACTIVITY) { 1486 if (value == LED_MODE_TXRX_ACTIVITY) {
1487 rt2x00dev->led_qual.rt2x00dev = rt2x00dev; 1487 rt2x00dev->led_qual.rt2x00dev = rt2x00dev;
1488 rt2x00dev->led_radio.type = LED_TYPE_ACTIVITY; 1488 rt2x00dev->led_qual.type = LED_TYPE_ACTIVITY;
1489 rt2x00dev->led_qual.led_dev.brightness_set = 1489 rt2x00dev->led_qual.led_dev.brightness_set =
1490 rt2500pci_brightness_set; 1490 rt2500pci_brightness_set;
1491 rt2x00dev->led_qual.led_dev.blink_set = 1491 rt2x00dev->led_qual.led_dev.blink_set =
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 6bb07b339325..fdbd0ef2be4b 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1394,7 +1394,7 @@ static int rt2500usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
1394 1394
1395 if (value == LED_MODE_TXRX_ACTIVITY) { 1395 if (value == LED_MODE_TXRX_ACTIVITY) {
1396 rt2x00dev->led_qual.rt2x00dev = rt2x00dev; 1396 rt2x00dev->led_qual.rt2x00dev = rt2x00dev;
1397 rt2x00dev->led_radio.type = LED_TYPE_ACTIVITY; 1397 rt2x00dev->led_qual.type = LED_TYPE_ACTIVITY;
1398 rt2x00dev->led_qual.led_dev.brightness_set = 1398 rt2x00dev->led_qual.led_dev.brightness_set =
1399 rt2500usb_brightness_set; 1399 rt2500usb_brightness_set;
1400 rt2x00dev->led_qual.led_dev.blink_set = 1400 rt2x00dev->led_qual.led_dev.blink_set =
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index f8fe7a139a8a..8d8657fb64dd 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -114,6 +114,7 @@ int rt2x00lib_enable_radio(struct rt2x00_dev *rt2x00dev)
114 return status; 114 return status;
115 115
116 rt2x00leds_led_radio(rt2x00dev, true); 116 rt2x00leds_led_radio(rt2x00dev, true);
117 rt2x00led_led_activity(rt2x00dev, true);
117 118
118 __set_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags); 119 __set_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags);
119 120
@@ -157,6 +158,7 @@ void rt2x00lib_disable_radio(struct rt2x00_dev *rt2x00dev)
157 * Disable radio. 158 * Disable radio.
158 */ 159 */
159 rt2x00dev->ops->lib->set_device_state(rt2x00dev, STATE_RADIO_OFF); 160 rt2x00dev->ops->lib->set_device_state(rt2x00dev, STATE_RADIO_OFF);
161 rt2x00led_led_activity(rt2x00dev, false);
160 rt2x00leds_led_radio(rt2x00dev, false); 162 rt2x00leds_led_radio(rt2x00dev, false);
161} 163}
162 164
diff --git a/drivers/net/wireless/rt2x00/rt2x00leds.c b/drivers/net/wireless/rt2x00/rt2x00leds.c
index 40c1f5c1b805..b362a1cf3f8d 100644
--- a/drivers/net/wireless/rt2x00/rt2x00leds.c
+++ b/drivers/net/wireless/rt2x00/rt2x00leds.c
@@ -72,6 +72,21 @@ void rt2x00leds_led_quality(struct rt2x00_dev *rt2x00dev, int rssi)
72 } 72 }
73} 73}
74 74
75void rt2x00led_led_activity(struct rt2x00_dev *rt2x00dev, bool enabled)
76{
77 struct rt2x00_led *led = &rt2x00dev->led_qual;
78 unsigned int brightness;
79
80 if ((led->type != LED_TYPE_ACTIVITY) || !(led->flags & LED_REGISTERED))
81 return;
82
83 brightness = enabled ? LED_FULL : LED_OFF;
84 if (brightness != led->led_dev.brightness) {
85 led->led_dev.brightness_set(&led->led_dev, brightness);
86 led->led_dev.brightness = brightness;
87 }
88}
89
75void rt2x00leds_led_assoc(struct rt2x00_dev *rt2x00dev, bool enabled) 90void rt2x00leds_led_assoc(struct rt2x00_dev *rt2x00dev, bool enabled)
76{ 91{
77 struct rt2x00_led *led = &rt2x00dev->led_assoc; 92 struct rt2x00_led *led = &rt2x00dev->led_assoc;
diff --git a/drivers/net/wireless/rt2x00/rt2x00lib.h b/drivers/net/wireless/rt2x00/rt2x00lib.h
index 5be32fffc74c..41ee02cd2825 100644
--- a/drivers/net/wireless/rt2x00/rt2x00lib.h
+++ b/drivers/net/wireless/rt2x00/rt2x00lib.h
@@ -185,6 +185,7 @@ static inline void rt2x00rfkill_resume(struct rt2x00_dev *rt2x00dev)
185 */ 185 */
186#ifdef CONFIG_RT2X00_LIB_LEDS 186#ifdef CONFIG_RT2X00_LIB_LEDS
187void rt2x00leds_led_quality(struct rt2x00_dev *rt2x00dev, int rssi); 187void rt2x00leds_led_quality(struct rt2x00_dev *rt2x00dev, int rssi);
188void rt2x00led_led_activity(struct rt2x00_dev *rt2x00dev, bool enabled);
188void rt2x00leds_led_assoc(struct rt2x00_dev *rt2x00dev, bool enabled); 189void rt2x00leds_led_assoc(struct rt2x00_dev *rt2x00dev, bool enabled);
189void rt2x00leds_led_radio(struct rt2x00_dev *rt2x00dev, bool enabled); 190void rt2x00leds_led_radio(struct rt2x00_dev *rt2x00dev, bool enabled);
190void rt2x00leds_register(struct rt2x00_dev *rt2x00dev); 191void rt2x00leds_register(struct rt2x00_dev *rt2x00dev);
@@ -197,6 +198,11 @@ static inline void rt2x00leds_led_quality(struct rt2x00_dev *rt2x00dev,
197{ 198{
198} 199}
199 200
201static inline void rt2x00led_led_activity(struct rt2x00_dev *rt2x00dev,
202 bool enabled)
203{
204}
205
200static inline void rt2x00leds_led_assoc(struct rt2x00_dev *rt2x00dev, 206static inline void rt2x00leds_led_assoc(struct rt2x00_dev *rt2x00dev,
201 bool enabled) 207 bool enabled)
202{ 208{
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 468a31c8c113..ae12dcdd3c24 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2087,7 +2087,7 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
2087 2087
2088 if (value == LED_MODE_SIGNAL_STRENGTH) { 2088 if (value == LED_MODE_SIGNAL_STRENGTH) {
2089 rt2x00dev->led_qual.rt2x00dev = rt2x00dev; 2089 rt2x00dev->led_qual.rt2x00dev = rt2x00dev;
2090 rt2x00dev->led_radio.type = LED_TYPE_QUALITY; 2090 rt2x00dev->led_qual.type = LED_TYPE_QUALITY;
2091 rt2x00dev->led_qual.led_dev.brightness_set = 2091 rt2x00dev->led_qual.led_dev.brightness_set =
2092 rt61pci_brightness_set; 2092 rt61pci_brightness_set;
2093 rt2x00dev->led_qual.led_dev.blink_set = 2093 rt2x00dev->led_qual.led_dev.blink_set =
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index a9efe25f1ea7..da19a3a91f4d 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -1647,7 +1647,7 @@ static int rt73usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
1647 1647
1648 if (value == LED_MODE_SIGNAL_STRENGTH) { 1648 if (value == LED_MODE_SIGNAL_STRENGTH) {
1649 rt2x00dev->led_qual.rt2x00dev = rt2x00dev; 1649 rt2x00dev->led_qual.rt2x00dev = rt2x00dev;
1650 rt2x00dev->led_radio.type = LED_TYPE_QUALITY; 1650 rt2x00dev->led_qual.type = LED_TYPE_QUALITY;
1651 rt2x00dev->led_qual.led_dev.brightness_set = 1651 rt2x00dev->led_qual.led_dev.brightness_set =
1652 rt73usb_brightness_set; 1652 rt73usb_brightness_set;
1653 rt2x00dev->led_qual.led_dev.blink_set = 1653 rt2x00dev->led_qual.led_dev.blink_set =