]> git.karo-electronics.de Git - linux-beck.git/commitdiff
iwlwifi: move ucode_ver to iwl_nic
authorDon Fry <donald.h.fry@intel.com>
Mon, 6 Feb 2012 23:51:15 +0000 (15:51 -0800)
committerWey-Yi Guy <wey-yi.w.guy@intel.com>
Fri, 17 Feb 2012 18:27:44 +0000 (10:27 -0800)
Delete ucode_ver from iwl_priv and use iwl_nic instead.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
drivers/net/wireless/iwlwifi/iwl-agn-lib.c
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl-dev.h
drivers/net/wireless/iwlwifi/iwl-testmode.c
drivers/net/wireless/iwlwifi/iwl-ucode.c

index 30b99b9abf7ffe523a9bbb5191887a436da4ff73..c368433f8bc8dc1203d1cd43f05cbf5e269e7cee 100644 (file)
@@ -77,7 +77,7 @@ int iwlagn_send_tx_power(struct iwl_priv *priv)
        tx_power_cmd.flags = IWLAGN_TX_POWER_NO_CLOSED;
        tx_power_cmd.srv_chan_lmt = IWLAGN_TX_POWER_AUTO;
 
-       if (IWL_UCODE_API(priv->ucode_ver) == 1)
+       if (IWL_UCODE_API(nic(priv)->fw.ucode_ver) == 1)
                tx_ant_cfg_cmd = REPLY_TX_POWER_DBM_CMD_V1;
        else
                tx_ant_cfg_cmd = REPLY_TX_POWER_DBM_CMD;
index 1cf99a586ec9626324758d9402258943139e88dd..9e902f7e9d35182fd6621369c2b668a1d4d6161d 100644 (file)
@@ -618,7 +618,7 @@ static int iwlagn_send_tx_ant_config(struct iwl_priv *priv, u8 valid_tx_ant)
          .valid = cpu_to_le32(valid_tx_ant),
        };
 
-       if (IWL_UCODE_API(priv->ucode_ver) > 1) {
+       if (IWL_UCODE_API(nic(priv)->fw.ucode_ver) > 1) {
                IWL_DEBUG_HC(priv, "select valid tx ant: %u\n", valid_tx_ant);
                return iwl_trans_send_cmd_pdu(trans(priv),
                                        TX_ANT_CONFIGURATION_CMD,
index db37877eed7737a73ce46d0076ce7fc1e59570e9..f3dc67c8b3eb22954aeaf5f33a020eab8dfdb2e3 100644 (file)
@@ -789,9 +789,6 @@ struct iwl_priv {
 
        /* uCode images, save to reload in case of failure */
        int fw_index;                   /* firmware we're trying to load */
-       u32 ucode_ver;                  /* version of ucode, copy of
-                                          iwl_ucode.ver */
-
        char firmware_name[25];
 
        struct iwl_rxon_context contexts[NUM_IWL_RXON_CTX];
index e54a1dd7014aa3e0b5e5e397ea8ac154420dd112..963cc6c89a460e31223c3747a7d4700dc68b3354 100644 (file)
@@ -553,14 +553,16 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)
                break;
 
        case IWL_TM_CMD_APP2DEV_GET_FW_VERSION:
-               IWL_INFO(priv, "uCode version raw: 0x%x\n", priv->ucode_ver);
+               IWL_INFO(priv, "uCode version raw: 0x%x\n",
+                        nic(priv)->fw.ucode_ver);
 
                skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, 20);
                if (!skb) {
                        IWL_ERR(priv, "Memory allocation fail\n");
                        return -ENOMEM;
                }
-               NLA_PUT_U32(skb, IWL_TM_ATTR_FW_VERSION, priv->ucode_ver);
+               NLA_PUT_U32(skb, IWL_TM_ATTR_FW_VERSION,
+                           nic(priv)->fw.ucode_ver);
                status = cfg80211_testmode_reply(skb);
                if (status < 0)
                        IWL_ERR(priv, "Error sending msg : %d\n", status);
index 11b659ab261d5bbb4cecc4e9fe3bf9950cfe7d41..ca3cd8a9046f0ffd3e74d1bb9cb9fe042a67181d 100644 (file)
@@ -738,12 +738,13 @@ static int iwlagn_load_legacy_firmware(struct iwl_priv *priv,
                                       const struct firmware *ucode_raw,
                                       struct iwlagn_firmware_pieces *pieces)
 {
+       struct iwl_nic *nic = nic(priv);
        struct iwl_ucode_header *ucode = (void *)ucode_raw->data;
        u32 api_ver, hdr_size;
        const u8 *src;
 
-       priv->ucode_ver = le32_to_cpu(ucode->ver);
-       api_ver = IWL_UCODE_API(priv->ucode_ver);
+       nic->fw.ucode_ver = le32_to_cpu(ucode->ver);
+       api_ver = IWL_UCODE_API(nic->fw.ucode_ver);
 
        switch (api_ver) {
        default:
@@ -804,6 +805,7 @@ static int iwlagn_load_firmware(struct iwl_priv *priv,
                                struct iwlagn_firmware_pieces *pieces,
                                struct iwlagn_ucode_capabilities *capa)
 {
+       struct iwl_nic *nic = nic(priv);
        struct iwl_tlv_ucode_header *ucode = (void *)ucode_raw->data;
        struct iwl_ucode_tlv *tlv;
        size_t len = ucode_raw->size;
@@ -843,7 +845,7 @@ static int iwlagn_load_firmware(struct iwl_priv *priv,
                         "uCode alternative %d not available, choosing %d\n",
                         tmp, wanted_alternative);
 
-       priv->ucode_ver = le32_to_cpu(ucode->ver);
+       nic->fw.ucode_ver = le32_to_cpu(ucode->ver);
        pieces->build = le32_to_cpu(ucode->build);
        data = ucode->data;
 
@@ -1008,6 +1010,7 @@ static int iwlagn_load_firmware(struct iwl_priv *priv,
 static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
 {
        struct iwl_priv *priv = context;
+       struct iwl_nic *nic = nic(priv);
        struct iwl_ucode_header *ucode;
        int err;
        struct iwlagn_firmware_pieces pieces;
@@ -1057,7 +1060,7 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
        if (err)
                goto try_again;
 
-       api_ver = IWL_UCODE_API(priv->ucode_ver);
+       api_ver = IWL_UCODE_API(nic->fw.ucode_ver);
        build = pieces.build;
 
        /*
@@ -1097,19 +1100,19 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
                buildstr[0] = '\0';
 
        IWL_INFO(priv, "loaded firmware version %u.%u.%u.%u%s\n",
-                IWL_UCODE_MAJOR(priv->ucode_ver),
-                IWL_UCODE_MINOR(priv->ucode_ver),
-                IWL_UCODE_API(priv->ucode_ver),
-                IWL_UCODE_SERIAL(priv->ucode_ver),
+                IWL_UCODE_MAJOR(nic->fw.ucode_ver),
+                IWL_UCODE_MINOR(nic->fw.ucode_ver),
+                IWL_UCODE_API(nic->fw.ucode_ver),
+                IWL_UCODE_SERIAL(nic->fw.ucode_ver),
                 buildstr);
 
        snprintf(priv->hw->wiphy->fw_version,
                 sizeof(priv->hw->wiphy->fw_version),
                 "%u.%u.%u.%u%s",
-                IWL_UCODE_MAJOR(priv->ucode_ver),
-                IWL_UCODE_MINOR(priv->ucode_ver),
-                IWL_UCODE_API(priv->ucode_ver),
-                IWL_UCODE_SERIAL(priv->ucode_ver),
+                IWL_UCODE_MAJOR(nic->fw.ucode_ver),
+                IWL_UCODE_MINOR(nic->fw.ucode_ver),
+                IWL_UCODE_API(nic->fw.ucode_ver),
+                IWL_UCODE_SERIAL(nic->fw.ucode_ver),
                 buildstr);
 
        /*
@@ -1119,7 +1122,7 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
         */
 
        IWL_DEBUG_INFO(priv, "f/w package hdr ucode version raw = 0x%x\n",
-                      priv->ucode_ver);
+                      nic->fw.ucode_ver);
        IWL_DEBUG_INFO(priv, "f/w package hdr runtime inst size = %Zd\n",
                       pieces.inst_size);
        IWL_DEBUG_INFO(priv, "f/w package hdr runtime data size = %Zd\n",