aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-ucode.c
diff options
context:
space:
mode:
authorDon Fry <donald.h.fry@intel.com>2012-02-06 18:51:15 -0500
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2012-02-17 13:27:44 -0500
commitd359667767e845d86f60a4ea6374ccb6b8fe0ce5 (patch)
tree3160d7bf70917b8c32eee32fbff53703281df041 /drivers/net/wireless/iwlwifi/iwl-ucode.c
parentb1c23d9ec3afb85bd299e4f3859dce555fd55c8a (diff)
iwlwifi: move ucode_ver to iwl_nic
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>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-ucode.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-ucode.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-ucode.c b/drivers/net/wireless/iwlwifi/iwl-ucode.c
index 11b659ab261d..ca3cd8a9046f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-ucode.c
+++ b/drivers/net/wireless/iwlwifi/iwl-ucode.c
@@ -738,12 +738,13 @@ static int iwlagn_load_legacy_firmware(struct iwl_priv *priv,
738 const struct firmware *ucode_raw, 738 const struct firmware *ucode_raw,
739 struct iwlagn_firmware_pieces *pieces) 739 struct iwlagn_firmware_pieces *pieces)
740{ 740{
741 struct iwl_nic *nic = nic(priv);
741 struct iwl_ucode_header *ucode = (void *)ucode_raw->data; 742 struct iwl_ucode_header *ucode = (void *)ucode_raw->data;
742 u32 api_ver, hdr_size; 743 u32 api_ver, hdr_size;
743 const u8 *src; 744 const u8 *src;
744 745
745 priv->ucode_ver = le32_to_cpu(ucode->ver); 746 nic->fw.ucode_ver = le32_to_cpu(ucode->ver);
746 api_ver = IWL_UCODE_API(priv->ucode_ver); 747 api_ver = IWL_UCODE_API(nic->fw.ucode_ver);
747 748
748 switch (api_ver) { 749 switch (api_ver) {
749 default: 750 default:
@@ -804,6 +805,7 @@ static int iwlagn_load_firmware(struct iwl_priv *priv,
804 struct iwlagn_firmware_pieces *pieces, 805 struct iwlagn_firmware_pieces *pieces,
805 struct iwlagn_ucode_capabilities *capa) 806 struct iwlagn_ucode_capabilities *capa)
806{ 807{
808 struct iwl_nic *nic = nic(priv);
807 struct iwl_tlv_ucode_header *ucode = (void *)ucode_raw->data; 809 struct iwl_tlv_ucode_header *ucode = (void *)ucode_raw->data;
808 struct iwl_ucode_tlv *tlv; 810 struct iwl_ucode_tlv *tlv;
809 size_t len = ucode_raw->size; 811 size_t len = ucode_raw->size;
@@ -843,7 +845,7 @@ static int iwlagn_load_firmware(struct iwl_priv *priv,
843 "uCode alternative %d not available, choosing %d\n", 845 "uCode alternative %d not available, choosing %d\n",
844 tmp, wanted_alternative); 846 tmp, wanted_alternative);
845 847
846 priv->ucode_ver = le32_to_cpu(ucode->ver); 848 nic->fw.ucode_ver = le32_to_cpu(ucode->ver);
847 pieces->build = le32_to_cpu(ucode->build); 849 pieces->build = le32_to_cpu(ucode->build);
848 data = ucode->data; 850 data = ucode->data;
849 851
@@ -1008,6 +1010,7 @@ static int iwlagn_load_firmware(struct iwl_priv *priv,
1008static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context) 1010static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
1009{ 1011{
1010 struct iwl_priv *priv = context; 1012 struct iwl_priv *priv = context;
1013 struct iwl_nic *nic = nic(priv);
1011 struct iwl_ucode_header *ucode; 1014 struct iwl_ucode_header *ucode;
1012 int err; 1015 int err;
1013 struct iwlagn_firmware_pieces pieces; 1016 struct iwlagn_firmware_pieces pieces;
@@ -1057,7 +1060,7 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
1057 if (err) 1060 if (err)
1058 goto try_again; 1061 goto try_again;
1059 1062
1060 api_ver = IWL_UCODE_API(priv->ucode_ver); 1063 api_ver = IWL_UCODE_API(nic->fw.ucode_ver);
1061 build = pieces.build; 1064 build = pieces.build;
1062 1065
1063 /* 1066 /*
@@ -1097,19 +1100,19 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
1097 buildstr[0] = '\0'; 1100 buildstr[0] = '\0';
1098 1101
1099 IWL_INFO(priv, "loaded firmware version %u.%u.%u.%u%s\n", 1102 IWL_INFO(priv, "loaded firmware version %u.%u.%u.%u%s\n",
1100 IWL_UCODE_MAJOR(priv->ucode_ver), 1103 IWL_UCODE_MAJOR(nic->fw.ucode_ver),
1101 IWL_UCODE_MINOR(priv->ucode_ver), 1104 IWL_UCODE_MINOR(nic->fw.ucode_ver),
1102 IWL_UCODE_API(priv->ucode_ver), 1105 IWL_UCODE_API(nic->fw.ucode_ver),
1103 IWL_UCODE_SERIAL(priv->ucode_ver), 1106 IWL_UCODE_SERIAL(nic->fw.ucode_ver),
1104 buildstr); 1107 buildstr);
1105 1108
1106 snprintf(priv->hw->wiphy->fw_version, 1109 snprintf(priv->hw->wiphy->fw_version,
1107 sizeof(priv->hw->wiphy->fw_version), 1110 sizeof(priv->hw->wiphy->fw_version),
1108 "%u.%u.%u.%u%s", 1111 "%u.%u.%u.%u%s",
1109 IWL_UCODE_MAJOR(priv->ucode_ver), 1112 IWL_UCODE_MAJOR(nic->fw.ucode_ver),
1110 IWL_UCODE_MINOR(priv->ucode_ver), 1113 IWL_UCODE_MINOR(nic->fw.ucode_ver),
1111 IWL_UCODE_API(priv->ucode_ver), 1114 IWL_UCODE_API(nic->fw.ucode_ver),
1112 IWL_UCODE_SERIAL(priv->ucode_ver), 1115 IWL_UCODE_SERIAL(nic->fw.ucode_ver),
1113 buildstr); 1116 buildstr);
1114 1117
1115 /* 1118 /*
@@ -1119,7 +1122,7 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
1119 */ 1122 */
1120 1123
1121 IWL_DEBUG_INFO(priv, "f/w package hdr ucode version raw = 0x%x\n", 1124 IWL_DEBUG_INFO(priv, "f/w package hdr ucode version raw = 0x%x\n",
1122 priv->ucode_ver); 1125 nic->fw.ucode_ver);
1123 IWL_DEBUG_INFO(priv, "f/w package hdr runtime inst size = %Zd\n", 1126 IWL_DEBUG_INFO(priv, "f/w package hdr runtime inst size = %Zd\n",
1124 pieces.inst_size); 1127 pieces.inst_size);
1125 IWL_DEBUG_INFO(priv, "f/w package hdr runtime data size = %Zd\n", 1128 IWL_DEBUG_INFO(priv, "f/w package hdr runtime data size = %Zd\n",