]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/wireless/iwlwifi/iwl-scan.c
iwlwifi: add wrappers for command sending
[karo-tx-linux.git] / drivers / net / wireless / iwlwifi / iwl-scan.c
index 7f2e3a1c80efeaea0ae6b7828cd05f6866c19173..dcba74883307f64fd29691ed9c57f161ab14763a 100644 (file)
@@ -69,15 +69,14 @@ static int iwl_send_scan_abort(struct iwl_priv *priv)
        if (!test_bit(STATUS_READY, &priv->shrd->status) ||
            !test_bit(STATUS_GEO_CONFIGURED, &priv->shrd->status) ||
            !test_bit(STATUS_SCAN_HW, &priv->shrd->status) ||
-           test_bit(STATUS_FW_ERROR, &priv->shrd->status) ||
-           test_bit(STATUS_EXIT_PENDING, &priv->shrd->status))
+           test_bit(STATUS_FW_ERROR, &priv->shrd->status))
                return -EIO;
 
-       ret = iwl_trans_send_cmd(trans(priv), &cmd);
+       ret = iwl_dvm_send_cmd(priv, &cmd);
        if (ret)
                return ret;
 
-       pkt = (struct iwl_rx_packet *)cmd.reply_page;
+       pkt = cmd.resp_pkt;
        if (pkt->u.status != CAN_ABORT_STATUS) {
                /* The scan abort will return 1 for success or
                 * 2 for "failure".  A failure condition can be
@@ -89,7 +88,7 @@ static int iwl_send_scan_abort(struct iwl_priv *priv)
                ret = -EIO;
        }
 
-       iwl_free_pages(priv->shrd, cmd.reply_page);
+       iwl_free_resp(&cmd);
        return ret;
 }
 
@@ -218,7 +217,7 @@ static void iwl_do_scan_abort(struct iwl_priv *priv)
 int iwl_scan_cancel(struct iwl_priv *priv)
 {
        IWL_DEBUG_SCAN(priv, "Queuing abort scan\n");
-       queue_work(priv->shrd->workqueue, &priv->abort_scan);
+       queue_work(priv->workqueue, &priv->abort_scan);
        return 0;
 }
 
@@ -261,7 +260,7 @@ void iwl_scan_cancel_timeout(struct iwl_priv *priv, unsigned long ms)
 
 /* Service response to REPLY_SCAN_CMD (0x80) */
 static int iwl_rx_reply_scan(struct iwl_priv *priv,
-                             struct iwl_rx_mem_buffer *rxb,
+                             struct iwl_rx_cmd_buffer *rxb,
                              struct iwl_device_cmd *cmd)
 {
 #ifdef CONFIG_IWLWIFI_DEBUG
@@ -276,7 +275,7 @@ static int iwl_rx_reply_scan(struct iwl_priv *priv,
 
 /* Service SCAN_START_NOTIFICATION (0x82) */
 static int iwl_rx_scan_start_notif(struct iwl_priv *priv,
-                                   struct iwl_rx_mem_buffer *rxb,
+                                   struct iwl_rx_cmd_buffer *rxb,
                                    struct iwl_device_cmd *cmd)
 {
        struct iwl_rx_packet *pkt = rxb_addr(rxb);
@@ -303,7 +302,7 @@ static int iwl_rx_scan_start_notif(struct iwl_priv *priv,
 
 /* Service SCAN_RESULTS_NOTIFICATION (0x83) */
 static int iwl_rx_scan_results_notif(struct iwl_priv *priv,
-                                     struct iwl_rx_mem_buffer *rxb,
+                                     struct iwl_rx_cmd_buffer *rxb,
                                      struct iwl_device_cmd *cmd)
 {
 #ifdef CONFIG_IWLWIFI_DEBUG
@@ -329,7 +328,7 @@ static int iwl_rx_scan_results_notif(struct iwl_priv *priv,
 
 /* Service SCAN_COMPLETE_NOTIFICATION (0x84) */
 static int iwl_rx_scan_complete_notif(struct iwl_priv *priv,
-                                      struct iwl_rx_mem_buffer *rxb,
+                                      struct iwl_rx_cmd_buffer *rxb,
                                       struct iwl_device_cmd *cmd)
 {
        struct iwl_rx_packet *pkt = rxb_addr(rxb);
@@ -354,7 +353,7 @@ static int iwl_rx_scan_complete_notif(struct iwl_priv *priv,
         */
        set_bit(STATUS_SCAN_COMPLETE, &priv->shrd->status);
        clear_bit(STATUS_SCAN_HW, &priv->shrd->status);
-       queue_work(priv->shrd->workqueue, &priv->scan_completed);
+       queue_work(priv->workqueue, &priv->scan_completed);
 
        if (priv->iw_mode != NL80211_IFTYPE_ADHOC &&
            iwl_advanced_bt_coexist(priv) &&
@@ -374,7 +373,7 @@ static int iwl_rx_scan_complete_notif(struct iwl_priv *priv,
                                IWL_BT_COEX_TRAFFIC_LOAD_NONE;
                }
                priv->bt_status = scan_notif->bt_status;
-               queue_work(priv->shrd->workqueue,
+               queue_work(priv->workqueue,
                           &priv->bt_traffic_change_work);
        }
        return 0;
@@ -888,7 +887,7 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
        if (ret)
                return ret;
 
-       ret = iwl_trans_send_cmd(trans(priv), &cmd);
+       ret = iwl_dvm_send_cmd(priv, &cmd);
        if (ret) {
                clear_bit(STATUS_SCAN_HW, &priv->shrd->status);
                iwlagn_set_pan_params(priv);
@@ -950,7 +949,7 @@ int __must_check iwl_scan_initiate(struct iwl_priv *priv,
                return ret;
        }
 
-       queue_delayed_work(priv->shrd->workqueue, &priv->scan_check,
+       queue_delayed_work(priv->workqueue, &priv->scan_check,
                           IWL_SCAN_CHECK_WATCHDOG);
 
        return 0;
@@ -963,7 +962,7 @@ int __must_check iwl_scan_initiate(struct iwl_priv *priv,
  */
 void iwl_internal_short_hw_scan(struct iwl_priv *priv)
 {
-       queue_work(priv->shrd->workqueue, &priv->start_internal_scan);
+       queue_work(priv->workqueue, &priv->start_internal_scan);
 }
 
 static void iwl_bg_start_internal_scan(struct work_struct *work)