iwlwifi: remove iwl-wifi.h
[pandora-kernel.git] / drivers / net / wireless / iwlwifi / iwl-testmode.c
index 23eea06..c1ecf0f 100644 (file)
@@ -70,7 +70,6 @@
 #include <net/mac80211.h>
 #include <net/netlink.h>
 
-#include "iwl-wifi.h"
 #include "iwl-dev.h"
 #include "iwl-core.h"
 #include "iwl-debug.h"
@@ -131,7 +130,7 @@ struct nla_policy iwl_testmode_gnl_msg_policy[IWL_TM_ATTR_MAX] = {
  * See the struct iwl_rx_packet in iwl-commands.h for the format of the
  * received events from the device
  */
-static inline int get_event_length(struct iwl_rx_mem_buffer *rxb)
+static inline int get_event_length(struct iwl_rx_cmd_buffer *rxb)
 {
        struct iwl_rx_packet *pkt = rxb_addr(rxb);
        if (pkt)
@@ -162,7 +161,7 @@ static inline int get_event_length(struct iwl_rx_mem_buffer *rxb)
  */
 
 static void iwl_testmode_ucode_rx_pkt(struct iwl_priv *priv,
-                               struct iwl_rx_mem_buffer *rxb)
+                                     struct iwl_rx_cmd_buffer *rxb)
 {
        struct ieee80211_hw *hw = priv->hw;
        struct sk_buff *skb;
@@ -292,7 +291,7 @@ static int iwl_testmode_ucode(struct ieee80211_hw *hw, struct nlattr **tb)
                return ret;
 
        /* Handling return of SKB to the user */
-       pkt = (struct iwl_rx_packet *)cmd.reply_page;
+       pkt = cmd.resp_pkt;
        if (!pkt) {
                IWL_ERR(priv, "HCMD received a null response packet\n");
                return ret;
@@ -309,7 +308,7 @@ static int iwl_testmode_ucode(struct ieee80211_hw *hw, struct nlattr **tb)
 
        /* The reply is in a page, that we cannot send to user space. */
        memcpy(reply_buf, &(pkt->hdr), reply_len);
-       iwl_free_pages(priv->shrd, cmd.reply_page);
+       iwl_free_resp(&cmd);
 
        NLA_PUT_U32(skb, IWL_TM_ATTR_COMMAND, IWL_TM_CMD_DEV2APP_UCODE_RX_PKT);
        NLA_PUT(skb, IWL_TM_ATTR_UCODE_RX_PKT, reply_len, reply_buf);
@@ -422,7 +421,7 @@ static int iwl_testmode_cfg_init_calib(struct iwl_priv *priv)
        iwl_init_notification_wait(priv->shrd, &calib_wait,
                                      CALIBRATION_COMPLETE_NOTIFICATION,
                                      NULL, NULL);
-       ret = iwl_init_alive_start(trans(priv));
+       ret = iwl_init_alive_start(priv);
        if (ret) {
                IWL_ERR(priv, "Fail init calibration: %d\n", ret);
                goto cfg_init_calib_error;
@@ -484,7 +483,7 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)
                break;
 
        case IWL_TM_CMD_APP2DEV_LOAD_INIT_FW:
-               status = iwl_load_ucode_wait_alive(trans, IWL_UCODE_INIT);
+               status = iwl_load_ucode_wait_alive(priv, IWL_UCODE_INIT);
                if (status)
                        IWL_ERR(priv, "Error loading init ucode: %d\n", status);
                break;
@@ -495,7 +494,7 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)
                break;
 
        case IWL_TM_CMD_APP2DEV_LOAD_RUNTIME_FW:
-               status = iwl_load_ucode_wait_alive(trans, IWL_UCODE_REGULAR);
+               status = iwl_load_ucode_wait_alive(priv, IWL_UCODE_REGULAR);
                if (status) {
                        IWL_ERR(priv,
                                "Error loading runtime ucode: %d\n", status);
@@ -510,7 +509,7 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)
        case IWL_TM_CMD_APP2DEV_LOAD_WOWLAN_FW:
                iwl_scan_cancel_timeout(priv, 200);
                iwl_trans_stop_device(trans);
-               status = iwl_load_ucode_wait_alive(trans, IWL_UCODE_WOWLAN);
+               status = iwl_load_ucode_wait_alive(priv, IWL_UCODE_WOWLAN);
                if (status) {
                        IWL_ERR(priv,
                                "Error loading WOWLAN ucode: %d\n", status);
@@ -553,7 +552,7 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)
 
        case IWL_TM_CMD_APP2DEV_GET_FW_VERSION:
                IWL_INFO(priv, "uCode version raw: 0x%x\n",
-                        nic(priv)->fw.ucode_ver);
+                        priv->fw->ucode_ver);
 
                skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, 20);
                if (!skb) {
@@ -561,7 +560,7 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)
                        return -ENOMEM;
                }
                NLA_PUT_U32(skb, IWL_TM_ATTR_FW_VERSION,
-                           nic(priv)->fw.ucode_ver);
+                           priv->fw->ucode_ver);
                status = cfg80211_testmode_reply(skb);
                if (status < 0)
                        IWL_ERR(priv, "Error sending msg : %d\n", status);
@@ -590,16 +589,16 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)
                }
                switch (priv->shrd->ucode_type) {
                case IWL_UCODE_REGULAR:
-                       inst_size = nic(priv)->fw.ucode_rt.code.len;
-                       data_size = nic(priv)->fw.ucode_rt.data.len;
+                       inst_size = priv->fw->ucode_rt.code.len;
+                       data_size = priv->fw->ucode_rt.data.len;
                        break;
                case IWL_UCODE_INIT:
-                       inst_size = nic(priv)->fw.ucode_init.code.len;
-                       data_size = nic(priv)->fw.ucode_init.data.len;
+                       inst_size = priv->fw->ucode_init.code.len;
+                       data_size = priv->fw->ucode_init.data.len;
                        break;
                case IWL_UCODE_WOWLAN:
-                       inst_size = nic(priv)->fw.ucode_wowlan.code.len;
-                       data_size = nic(priv)->fw.ucode_wowlan.data.len;
+                       inst_size = priv->fw->ucode_wowlan.code.len;
+                       data_size = priv->fw->ucode_wowlan.data.len;
                        break;
                case IWL_UCODE_NONE:
                        IWL_ERR(priv, "No uCode has not been loaded\n");