]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/wireless/iwlwifi/iwl-scan.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes...
[linux-2.6-omap-h63xx.git] / drivers / net / wireless / iwlwifi / iwl-scan.c
index debdbd94dda8c62c31d46c5a042f88387ca06c97..c89365e2ca58e3f4c5d142e9f9d11ed75d7642cc 100644 (file)
@@ -843,7 +843,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
 
                /* Force use of chains B and C (0x6) for scan Rx for 4965
                 * Avoid A (0x1) because of its off-channel reception on A-band.
-                * MIMO is not used here, but value is required */
+                */
                if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) == CSR_HW_REV_TYPE_4965)
                        rx_chain = 0x6;
        } else {
@@ -851,6 +851,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
                goto done;
        }
 
+       /* MIMO is not used here, but value is required */
        scan->rx_chain = RXON_RX_CHAIN_DRIVER_FORCE_MSK |
                                cpu_to_le16((0x7 << RXON_RX_CHAIN_VALID_POS) |
                                (rx_chain << RXON_RX_CHAIN_FORCE_SEL_POS) |
@@ -895,6 +896,13 @@ static void iwl_bg_request_scan(struct work_struct *data)
        return;
 
  done:
+       /* Cannot perform scan. Make sure we clear scanning
+       * bits from status so next scan request can be performed.
+       * If we don't clear scanning status bit here all next scan
+       * will fail
+       */
+       clear_bit(STATUS_SCAN_HW, &priv->status);
+       clear_bit(STATUS_SCANNING, &priv->status);
        /* inform mac80211 scan aborted */
        queue_work(priv->workqueue, &priv->scan_completed);
        mutex_unlock(&priv->mutex);
@@ -915,10 +923,29 @@ static void iwl_bg_abort_scan(struct work_struct *work)
        mutex_unlock(&priv->mutex);
 }
 
+static void iwl_bg_scan_completed(struct work_struct *work)
+{
+       struct iwl_priv *priv =
+           container_of(work, struct iwl_priv, scan_completed);
+
+       IWL_DEBUG_SCAN("SCAN complete scan\n");
+
+       if (test_bit(STATUS_EXIT_PENDING, &priv->status))
+               return;
+
+       ieee80211_scan_completed(priv->hw);
+
+       /* Since setting the TXPOWER may have been deferred while
+        * performing the scan, fire one off */
+       mutex_lock(&priv->mutex);
+       iwl_set_tx_power(priv, priv->tx_power_user_lmt, true);
+       mutex_unlock(&priv->mutex);
+}
+
+
 void iwl_setup_scan_deferred_work(struct iwl_priv *priv)
 {
-       /*  FIXME: move here when resolved PENDING
-        *  INIT_WORK(&priv->scan_completed, iwl_bg_scan_completed); */
+       INIT_WORK(&priv->scan_completed, iwl_bg_scan_completed);
        INIT_WORK(&priv->request_scan, iwl_bg_request_scan);
        INIT_WORK(&priv->abort_scan, iwl_bg_abort_scan);
        INIT_DELAYED_WORK(&priv->scan_check, iwl_bg_scan_check);