Loading drivers/net/wireless/b43/b43.h +4 −0 Original line number Diff line number Diff line Loading @@ -691,6 +691,10 @@ struct b43_wl { struct mutex mutex; spinlock_t irq_lock; /* R/W lock for data transmission. * Transmissions on 2+ queues can run concurrently, but somebody else * might sync with TX by write_lock_irqsave()'ing. */ rwlock_t tx_lock; /* Lock for LEDs access. */ spinlock_t leds_lock; /* Lock for SHM access. */ Loading drivers/net/wireless/b43/main.c +29 −14 Original line number Diff line number Diff line Loading @@ -729,6 +729,7 @@ static void b43_synchronize_irq(struct b43_wldev *dev) */ void b43_dummy_transmission(struct b43_wldev *dev) { struct b43_wl *wl = dev->wl; struct b43_phy *phy = &dev->phy; unsigned int i, max_loop; u16 value; Loading @@ -755,6 +756,9 @@ void b43_dummy_transmission(struct b43_wldev *dev) return; } spin_lock_irq(&wl->irq_lock); write_lock(&wl->tx_lock); for (i = 0; i < 5; i++) b43_ram_write(dev, i * 4, buffer[i]); Loading Loading @@ -795,6 +799,9 @@ void b43_dummy_transmission(struct b43_wldev *dev) } if (phy->radio_ver == 0x2050 && phy->radio_rev <= 0x5) b43_radio_write16(dev, 0x0051, 0x0037); write_unlock(&wl->tx_lock); spin_unlock_irq(&wl->irq_lock); } static void key_write(struct b43_wldev *dev, Loading Loading @@ -2840,24 +2847,31 @@ static int b43_op_tx(struct ieee80211_hw *hw, { struct b43_wl *wl = hw_to_b43_wl(hw); struct b43_wldev *dev = wl->current_dev; int err = -ENODEV; unsigned long flags; int err; if (unlikely(skb->len < 2 + 2 + 6)) { /* Too short, this can't be a valid frame. */ return -EINVAL; dev_kfree_skb_any(skb); return NETDEV_TX_OK; } B43_WARN_ON(skb_shinfo(skb)->nr_frags); if (unlikely(!dev)) goto out; if (unlikely(b43_status(dev) < B43_STAT_STARTED)) goto out; /* TX is done without a global lock. */ return NETDEV_TX_BUSY; /* Transmissions on seperate queues can run concurrently. */ read_lock_irqsave(&wl->tx_lock, flags); err = -ENODEV; if (likely(b43_status(dev) >= B43_STAT_STARTED)) { if (b43_using_pio_transfers(dev)) err = b43_pio_tx(dev, skb, ctl); else err = b43_dma_tx(dev, skb, ctl); out: } read_unlock_irqrestore(&wl->tx_lock, flags); if (unlikely(err)) return NETDEV_TX_BUSY; return NETDEV_TX_OK; Loading Loading @@ -3476,7 +3490,9 @@ static void b43_wireless_core_stop(struct b43_wldev *dev) spin_unlock_irqrestore(&wl->irq_lock, flags); b43_synchronize_irq(dev); write_lock_irqsave(&wl->tx_lock, flags); b43_set_status(dev, B43_STAT_INITIALIZED); write_unlock_irqrestore(&wl->tx_lock, flags); b43_pio_stop(dev); mutex_unlock(&wl->mutex); Loading @@ -3485,8 +3501,6 @@ static void b43_wireless_core_stop(struct b43_wldev *dev) cancel_delayed_work_sync(&dev->periodic_work); mutex_lock(&wl->mutex); ieee80211_stop_queues(wl->hw); //FIXME this could cause a deadlock, as mac80211 seems buggy. b43_mac_suspend(dev); free_irq(dev->dev->irq, dev); b43dbg(wl, "Wireless interface stopped\n"); Loading Loading @@ -4498,6 +4512,7 @@ static int b43_wireless_init(struct ssb_device *dev) memset(wl, 0, sizeof(*wl)); wl->hw = hw; spin_lock_init(&wl->irq_lock); rwlock_init(&wl->tx_lock); spin_lock_init(&wl->leds_lock); spin_lock_init(&wl->shm_lock); mutex_init(&wl->mutex); Loading drivers/net/wireless/iwlwifi/iwl-3945.h +0 −1 Original line number Diff line number Diff line Loading @@ -742,7 +742,6 @@ struct iwl3945_priv { u8 direct_ssid_len; u8 direct_ssid[IW_ESSID_MAX_SIZE]; struct iwl3945_scan_cmd *scan; u8 only_active_channel; /* spinlock */ spinlock_t lock; /* protect general shared data */ Loading drivers/net/wireless/iwlwifi/iwl-4965.h +0 −1 Original line number Diff line number Diff line Loading @@ -996,7 +996,6 @@ struct iwl_priv { u8 direct_ssid_len; u8 direct_ssid[IW_ESSID_MAX_SIZE]; struct iwl4965_scan_cmd *scan; u8 only_active_channel; /* spinlock */ spinlock_t lock; /* protect general shared data */ Loading drivers/net/wireless/iwlwifi/iwl3945-base.c +8 −21 Original line number Diff line number Diff line Loading @@ -4968,17 +4968,6 @@ static int iwl3945_get_channels_for_scan(struct iwl3945_priv *priv, if (channels[i].flags & IEEE80211_CHAN_DISABLED) continue; if (channels[i].hw_value == le16_to_cpu(priv->active_rxon.channel)) { if (iwl3945_is_associated(priv)) { IWL_DEBUG_SCAN ("Skipping current channel %d\n", le16_to_cpu(priv->active_rxon.channel)); continue; } } else if (priv->only_active_channel) continue; scan_ch->channel = channels[i].hw_value; ch_info = iwl3945_get_channel_info(priv, band, scan_ch->channel); Loading Loading @@ -6303,12 +6292,17 @@ static void iwl3945_bg_request_scan(struct work_struct *data) priv->direct_ssid, priv->direct_ssid_len); direct_mask = 1; } else if (!iwl3945_is_associated(priv) && priv->essid_len) { IWL_DEBUG_SCAN ("Kicking off one direct scan for '%s' when not associated\n", iwl3945_escape_essid(priv->essid, priv->essid_len)); scan->direct_scan[0].id = WLAN_EID_SSID; scan->direct_scan[0].len = priv->essid_len; memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len); direct_mask = 1; } else } else { IWL_DEBUG_SCAN("Kicking off one indirect scan.\n"); direct_mask = 0; } /* We don't build a direct scan probe request; the uCode will do * that based on the direct_mask added to each channel entry */ Loading Loading @@ -6346,23 +6340,18 @@ static void iwl3945_bg_request_scan(struct work_struct *data) if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) scan->filter_flags = RXON_FILTER_PROMISC_MSK; if (direct_mask) { IWL_DEBUG_SCAN ("Initiating direct scan for %s.\n", iwl3945_escape_essid(priv->essid, priv->essid_len)); if (direct_mask) scan->channel_count = iwl3945_get_channels_for_scan( priv, band, 1, /* active */ direct_mask, (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]); } else { IWL_DEBUG_SCAN("Initiating indirect scan.\n"); else scan->channel_count = iwl3945_get_channels_for_scan( priv, band, 0, /* passive */ direct_mask, (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]); } cmd.len += le16_to_cpu(scan->tx_cmd.len) + scan->channel_count * sizeof(struct iwl3945_scan_channel); Loading Loading @@ -7314,8 +7303,6 @@ static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw) return; } priv->only_active_channel = 0; iwl3945_set_rate(priv); mutex_unlock(&priv->mutex); Loading Loading
drivers/net/wireless/b43/b43.h +4 −0 Original line number Diff line number Diff line Loading @@ -691,6 +691,10 @@ struct b43_wl { struct mutex mutex; spinlock_t irq_lock; /* R/W lock for data transmission. * Transmissions on 2+ queues can run concurrently, but somebody else * might sync with TX by write_lock_irqsave()'ing. */ rwlock_t tx_lock; /* Lock for LEDs access. */ spinlock_t leds_lock; /* Lock for SHM access. */ Loading
drivers/net/wireless/b43/main.c +29 −14 Original line number Diff line number Diff line Loading @@ -729,6 +729,7 @@ static void b43_synchronize_irq(struct b43_wldev *dev) */ void b43_dummy_transmission(struct b43_wldev *dev) { struct b43_wl *wl = dev->wl; struct b43_phy *phy = &dev->phy; unsigned int i, max_loop; u16 value; Loading @@ -755,6 +756,9 @@ void b43_dummy_transmission(struct b43_wldev *dev) return; } spin_lock_irq(&wl->irq_lock); write_lock(&wl->tx_lock); for (i = 0; i < 5; i++) b43_ram_write(dev, i * 4, buffer[i]); Loading Loading @@ -795,6 +799,9 @@ void b43_dummy_transmission(struct b43_wldev *dev) } if (phy->radio_ver == 0x2050 && phy->radio_rev <= 0x5) b43_radio_write16(dev, 0x0051, 0x0037); write_unlock(&wl->tx_lock); spin_unlock_irq(&wl->irq_lock); } static void key_write(struct b43_wldev *dev, Loading Loading @@ -2840,24 +2847,31 @@ static int b43_op_tx(struct ieee80211_hw *hw, { struct b43_wl *wl = hw_to_b43_wl(hw); struct b43_wldev *dev = wl->current_dev; int err = -ENODEV; unsigned long flags; int err; if (unlikely(skb->len < 2 + 2 + 6)) { /* Too short, this can't be a valid frame. */ return -EINVAL; dev_kfree_skb_any(skb); return NETDEV_TX_OK; } B43_WARN_ON(skb_shinfo(skb)->nr_frags); if (unlikely(!dev)) goto out; if (unlikely(b43_status(dev) < B43_STAT_STARTED)) goto out; /* TX is done without a global lock. */ return NETDEV_TX_BUSY; /* Transmissions on seperate queues can run concurrently. */ read_lock_irqsave(&wl->tx_lock, flags); err = -ENODEV; if (likely(b43_status(dev) >= B43_STAT_STARTED)) { if (b43_using_pio_transfers(dev)) err = b43_pio_tx(dev, skb, ctl); else err = b43_dma_tx(dev, skb, ctl); out: } read_unlock_irqrestore(&wl->tx_lock, flags); if (unlikely(err)) return NETDEV_TX_BUSY; return NETDEV_TX_OK; Loading Loading @@ -3476,7 +3490,9 @@ static void b43_wireless_core_stop(struct b43_wldev *dev) spin_unlock_irqrestore(&wl->irq_lock, flags); b43_synchronize_irq(dev); write_lock_irqsave(&wl->tx_lock, flags); b43_set_status(dev, B43_STAT_INITIALIZED); write_unlock_irqrestore(&wl->tx_lock, flags); b43_pio_stop(dev); mutex_unlock(&wl->mutex); Loading @@ -3485,8 +3501,6 @@ static void b43_wireless_core_stop(struct b43_wldev *dev) cancel_delayed_work_sync(&dev->periodic_work); mutex_lock(&wl->mutex); ieee80211_stop_queues(wl->hw); //FIXME this could cause a deadlock, as mac80211 seems buggy. b43_mac_suspend(dev); free_irq(dev->dev->irq, dev); b43dbg(wl, "Wireless interface stopped\n"); Loading Loading @@ -4498,6 +4512,7 @@ static int b43_wireless_init(struct ssb_device *dev) memset(wl, 0, sizeof(*wl)); wl->hw = hw; spin_lock_init(&wl->irq_lock); rwlock_init(&wl->tx_lock); spin_lock_init(&wl->leds_lock); spin_lock_init(&wl->shm_lock); mutex_init(&wl->mutex); Loading
drivers/net/wireless/iwlwifi/iwl-3945.h +0 −1 Original line number Diff line number Diff line Loading @@ -742,7 +742,6 @@ struct iwl3945_priv { u8 direct_ssid_len; u8 direct_ssid[IW_ESSID_MAX_SIZE]; struct iwl3945_scan_cmd *scan; u8 only_active_channel; /* spinlock */ spinlock_t lock; /* protect general shared data */ Loading
drivers/net/wireless/iwlwifi/iwl-4965.h +0 −1 Original line number Diff line number Diff line Loading @@ -996,7 +996,6 @@ struct iwl_priv { u8 direct_ssid_len; u8 direct_ssid[IW_ESSID_MAX_SIZE]; struct iwl4965_scan_cmd *scan; u8 only_active_channel; /* spinlock */ spinlock_t lock; /* protect general shared data */ Loading
drivers/net/wireless/iwlwifi/iwl3945-base.c +8 −21 Original line number Diff line number Diff line Loading @@ -4968,17 +4968,6 @@ static int iwl3945_get_channels_for_scan(struct iwl3945_priv *priv, if (channels[i].flags & IEEE80211_CHAN_DISABLED) continue; if (channels[i].hw_value == le16_to_cpu(priv->active_rxon.channel)) { if (iwl3945_is_associated(priv)) { IWL_DEBUG_SCAN ("Skipping current channel %d\n", le16_to_cpu(priv->active_rxon.channel)); continue; } } else if (priv->only_active_channel) continue; scan_ch->channel = channels[i].hw_value; ch_info = iwl3945_get_channel_info(priv, band, scan_ch->channel); Loading Loading @@ -6303,12 +6292,17 @@ static void iwl3945_bg_request_scan(struct work_struct *data) priv->direct_ssid, priv->direct_ssid_len); direct_mask = 1; } else if (!iwl3945_is_associated(priv) && priv->essid_len) { IWL_DEBUG_SCAN ("Kicking off one direct scan for '%s' when not associated\n", iwl3945_escape_essid(priv->essid, priv->essid_len)); scan->direct_scan[0].id = WLAN_EID_SSID; scan->direct_scan[0].len = priv->essid_len; memcpy(scan->direct_scan[0].ssid, priv->essid, priv->essid_len); direct_mask = 1; } else } else { IWL_DEBUG_SCAN("Kicking off one indirect scan.\n"); direct_mask = 0; } /* We don't build a direct scan probe request; the uCode will do * that based on the direct_mask added to each channel entry */ Loading Loading @@ -6346,23 +6340,18 @@ static void iwl3945_bg_request_scan(struct work_struct *data) if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) scan->filter_flags = RXON_FILTER_PROMISC_MSK; if (direct_mask) { IWL_DEBUG_SCAN ("Initiating direct scan for %s.\n", iwl3945_escape_essid(priv->essid, priv->essid_len)); if (direct_mask) scan->channel_count = iwl3945_get_channels_for_scan( priv, band, 1, /* active */ direct_mask, (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]); } else { IWL_DEBUG_SCAN("Initiating indirect scan.\n"); else scan->channel_count = iwl3945_get_channels_for_scan( priv, band, 0, /* passive */ direct_mask, (void *)&scan->data[le16_to_cpu(scan->tx_cmd.len)]); } cmd.len += le16_to_cpu(scan->tx_cmd.len) + scan->channel_count * sizeof(struct iwl3945_scan_channel); Loading Loading @@ -7314,8 +7303,6 @@ static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw) return; } priv->only_active_channel = 0; iwl3945_set_rate(priv); mutex_unlock(&priv->mutex); Loading