]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/net/wireless/ath/ath9k/main.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
[mv-sheeva.git] / drivers / net / wireless / ath / ath9k / main.c
index 4c0831ff6e921f3f00594223287cfa1596bf6459..0429dda0961fcea24309d045a0af2655de053c25 100644 (file)
@@ -279,7 +279,7 @@ void ath_paprd_calibrate(struct work_struct *work)
        hdr = (struct ieee80211_hdr *)skb->data;
        ftype = IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC;
        hdr->frame_control = cpu_to_le16(ftype);
-       hdr->duration_id = 10;
+       hdr->duration_id = cpu_to_le16(10);
        memcpy(hdr->addr1, hw->wiphy->perm_addr, ETH_ALEN);
        memcpy(hdr->addr2, hw->wiphy->perm_addr, ETH_ALEN);
        memcpy(hdr->addr3, hw->wiphy->perm_addr, ETH_ALEN);
@@ -857,9 +857,14 @@ void ath_radio_disable(struct ath_softc *sc, struct ieee80211_hw *hw)
        ath9k_ps_wakeup(sc);
        ieee80211_stop_queues(hw);
 
-       /* Disable LED */
-       ath9k_hw_set_gpio(ah, ah->led_pin, 1);
-       ath9k_hw_cfg_gpio_input(ah, ah->led_pin);
+       /*
+        * Keep the LED on when the radio is disabled
+        * during idle unassociated state.
+        */
+       if (!sc->ps_idle) {
+               ath9k_hw_set_gpio(ah, ah->led_pin, 1);
+               ath9k_hw_cfg_gpio_input(ah, ah->led_pin);
+       }
 
        /* Disable interrupts */
        ath9k_hw_set_interrupts(ah, 0);
@@ -1264,6 +1269,7 @@ static void ath9k_stop(struct ieee80211_hw *hw)
        struct ath_softc *sc = aphy->sc;
        struct ath_hw *ah = sc->sc_ah;
        struct ath_common *common = ath9k_hw_common(ah);
+       int i;
 
        mutex_lock(&sc->mutex);
 
@@ -1276,7 +1282,12 @@ static void ath9k_stop(struct ieee80211_hw *hw)
        cancel_work_sync(&sc->paprd_work);
        cancel_work_sync(&sc->hw_check_work);
 
-       if (!sc->num_sec_wiphy) {
+       for (i = 0; i < sc->num_sec_wiphy; i++) {
+               if (sc->sec_wiphy[i])
+                       break;
+       }
+
+       if (i == sc->num_sec_wiphy) {
                cancel_delayed_work_sync(&sc->wiphy_work);
                cancel_work_sync(&sc->chan_work);
        }
@@ -1983,11 +1994,12 @@ static void ath9k_sw_scan_start(struct ieee80211_hw *hw)
 
        mutex_lock(&sc->mutex);
        if (ath9k_wiphy_scanning(sc)) {
-               printk(KERN_DEBUG "ath9k: Two wiphys trying to scan at the "
-                      "same time\n");
                /*
-                * Do not allow the concurrent scanning state for now. This
-                * could be improved with scanning control moved into ath9k.
+                * There is a race here in mac80211 but fixing it requires
+                * we revisit how we handle the scan complete callback.
+                * After mac80211 fixes we will not have configured hardware
+                * to the home channel nor would we have configured the RX
+                * filter yet.
                 */
                mutex_unlock(&sc->mutex);
                return;
@@ -2003,6 +2015,10 @@ static void ath9k_sw_scan_start(struct ieee80211_hw *hw)
        mutex_unlock(&sc->mutex);
 }
 
+/*
+ * XXX: this requires a revisit after the driver
+ * scan_complete gets moved to another place/removed in mac80211.
+ */
 static void ath9k_sw_scan_complete(struct ieee80211_hw *hw)
 {
        struct ath_wiphy *aphy = hw->priv;