diff options
author | Don Fry <donald.h.fry@intel.com> | 2012-02-06 20:06:07 -0500 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2012-02-17 13:56:33 -0500 |
commit | 4a986777a53d5fe8fd92ef30e0e8eedd0ff800b1 (patch) | |
tree | 72328763ebe76c24589f7916647b2c291702b83d | |
parent | 06e03f8ce91b71c6ce4134c8bf9ed801aed0382c (diff) |
iwlwifi: save ucode capabilities in iwl_fw
The capabilities parsed from the ucode file are never saved. Save
them in the iwl_fw structure.
Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.h | 8 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-mac80211.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-ucode.c | 38 |
4 files changed, 22 insertions, 29 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h index 8a170b7f1e17..79894aca9644 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.h +++ b/drivers/net/wireless/iwlwifi/iwl-agn.h | |||
@@ -65,11 +65,7 @@ | |||
65 | 65 | ||
66 | #include "iwl-dev.h" | 66 | #include "iwl-dev.h" |
67 | 67 | ||
68 | struct iwlagn_ucode_capabilities { | 68 | struct iwl_ucode_capabilities; |
69 | u32 max_probe_length; | ||
70 | u32 standard_phy_calibration_size; | ||
71 | u32 flags; | ||
72 | }; | ||
73 | 69 | ||
74 | extern struct ieee80211_ops iwlagn_hw_ops; | 70 | extern struct ieee80211_ops iwlagn_hw_ops; |
75 | 71 | ||
@@ -88,7 +84,7 @@ void iwlagn_prepare_restart(struct iwl_priv *priv); | |||
88 | /* MAC80211 */ | 84 | /* MAC80211 */ |
89 | struct ieee80211_hw *iwl_alloc_all(void); | 85 | struct ieee80211_hw *iwl_alloc_all(void); |
90 | int iwlagn_mac_setup_register(struct iwl_priv *priv, | 86 | int iwlagn_mac_setup_register(struct iwl_priv *priv, |
91 | struct iwlagn_ucode_capabilities *capa); | 87 | struct iwl_ucode_capabilities *capa); |
92 | void iwlagn_mac_unregister(struct iwl_priv *priv); | 88 | void iwlagn_mac_unregister(struct iwl_priv *priv); |
93 | 89 | ||
94 | /* RXON */ | 90 | /* RXON */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-mac80211.c b/drivers/net/wireless/iwlwifi/iwl-mac80211.c index 90d8081426f6..9c29234221fd 100644 --- a/drivers/net/wireless/iwlwifi/iwl-mac80211.c +++ b/drivers/net/wireless/iwlwifi/iwl-mac80211.c | |||
@@ -136,7 +136,7 @@ iwlagn_iface_combinations_p2p[] = { | |||
136 | * other mac80211 functions grouped here. | 136 | * other mac80211 functions grouped here. |
137 | */ | 137 | */ |
138 | int iwlagn_mac_setup_register(struct iwl_priv *priv, | 138 | int iwlagn_mac_setup_register(struct iwl_priv *priv, |
139 | struct iwlagn_ucode_capabilities *capa) | 139 | struct iwl_ucode_capabilities *capa) |
140 | { | 140 | { |
141 | int ret; | 141 | int ret; |
142 | struct ieee80211_hw *hw = priv->hw; | 142 | struct ieee80211_hw *hw = priv->hw; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h index 20b50a0e0a86..cc7a3cfb5f24 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans.h | |||
@@ -321,9 +321,6 @@ enum iwl_trans_state { | |||
321 | * Set during transport allocation. | 321 | * Set during transport allocation. |
322 | * @hw_id_str: a string with info about HW ID. Set during transport allocation. | 322 | * @hw_id_str: a string with info about HW ID. Set during transport allocation. |
323 | * @ucode_write_complete: indicates that the ucode has been copied. | 323 | * @ucode_write_complete: indicates that the ucode has been copied. |
324 | * @ucode_rt: run time ucode image | ||
325 | * @ucode_init: init ucode image | ||
326 | * @ucode_wowlan: wake on wireless ucode image (optional) | ||
327 | * @nvm_device_type: indicates OTP or eeprom | 324 | * @nvm_device_type: indicates OTP or eeprom |
328 | * @pm_support: set to true in start_hw if link pm is supported | 325 | * @pm_support: set to true in start_hw if link pm is supported |
329 | * @calib_results: list head for init calibration results | 326 | * @calib_results: list head for init calibration results |
diff --git a/drivers/net/wireless/iwlwifi/iwl-ucode.c b/drivers/net/wireless/iwlwifi/iwl-ucode.c index 01768f709a76..9e21fc15c5f8 100644 --- a/drivers/net/wireless/iwlwifi/iwl-ucode.c +++ b/drivers/net/wireless/iwlwifi/iwl-ucode.c | |||
@@ -805,7 +805,7 @@ static int iwl_parse_v1_v2_firmware(struct iwl_nic *nic, | |||
805 | static int iwl_parse_tlv_firmware(struct iwl_nic *nic, | 805 | static int iwl_parse_tlv_firmware(struct iwl_nic *nic, |
806 | const struct firmware *ucode_raw, | 806 | const struct firmware *ucode_raw, |
807 | struct iwlagn_firmware_pieces *pieces, | 807 | struct iwlagn_firmware_pieces *pieces, |
808 | struct iwlagn_ucode_capabilities *capa) | 808 | struct iwl_ucode_capabilities *capa) |
809 | { | 809 | { |
810 | struct iwl_tlv_ucode_header *ucode = (void *)ucode_raw->data; | 810 | struct iwl_tlv_ucode_header *ucode = (void *)ucode_raw->data; |
811 | struct iwl_ucode_tlv *tlv; | 811 | struct iwl_ucode_tlv *tlv; |
@@ -1012,6 +1012,7 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context) | |||
1012 | { | 1012 | { |
1013 | struct iwl_nic *nic = context; | 1013 | struct iwl_nic *nic = context; |
1014 | struct iwl_cfg *cfg = cfg(nic); | 1014 | struct iwl_cfg *cfg = cfg(nic); |
1015 | struct iwl_fw *fw = &nic->fw; | ||
1015 | struct iwl_priv *priv = priv(nic); /* temporary */ | 1016 | struct iwl_priv *priv = priv(nic); /* temporary */ |
1016 | struct iwl_ucode_header *ucode; | 1017 | struct iwl_ucode_header *ucode; |
1017 | int err; | 1018 | int err; |
@@ -1022,11 +1023,10 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context) | |||
1022 | u32 api_ver; | 1023 | u32 api_ver; |
1023 | char buildstr[25]; | 1024 | char buildstr[25]; |
1024 | u32 build; | 1025 | u32 build; |
1025 | struct iwlagn_ucode_capabilities ucode_capa = { | 1026 | |
1026 | .max_probe_length = 200, | 1027 | fw->ucode_capa.max_probe_length = 200; |
1027 | .standard_phy_calibration_size = | 1028 | fw->ucode_capa.standard_phy_calibration_size = |
1028 | IWL_DEFAULT_STANDARD_PHY_CALIBRATE_TBL_SIZE, | 1029 | IWL_DEFAULT_STANDARD_PHY_CALIBRATE_TBL_SIZE; |
1029 | }; | ||
1030 | 1030 | ||
1031 | if (!api_ok) | 1031 | if (!api_ok) |
1032 | api_ok = api_max; | 1032 | api_ok = api_max; |
@@ -1057,7 +1057,7 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context) | |||
1057 | err = iwl_parse_v1_v2_firmware(nic, ucode_raw, &pieces); | 1057 | err = iwl_parse_v1_v2_firmware(nic, ucode_raw, &pieces); |
1058 | else | 1058 | else |
1059 | err = iwl_parse_tlv_firmware(nic, ucode_raw, &pieces, | 1059 | err = iwl_parse_tlv_firmware(nic, ucode_raw, &pieces, |
1060 | &ucode_capa); | 1060 | &fw->ucode_capa); |
1061 | 1061 | ||
1062 | if (err) | 1062 | if (err) |
1063 | goto try_again; | 1063 | goto try_again; |
@@ -1219,23 +1219,23 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context) | |||
1219 | cfg->base_params->max_event_log_size; | 1219 | cfg->base_params->max_event_log_size; |
1220 | nic->inst_errlog_ptr = pieces.inst_errlog_ptr; | 1220 | nic->inst_errlog_ptr = pieces.inst_errlog_ptr; |
1221 | #ifndef CONFIG_IWLWIFI_P2P | 1221 | #ifndef CONFIG_IWLWIFI_P2P |
1222 | ucode_capa.flags &= ~IWL_UCODE_TLV_FLAGS_PAN; | 1222 | fw->ucode_capa.flags &= ~IWL_UCODE_TLV_FLAGS_PAN; |
1223 | #endif | 1223 | #endif |
1224 | 1224 | ||
1225 | priv->new_scan_threshold_behaviour = | 1225 | priv->new_scan_threshold_behaviour = |
1226 | !!(ucode_capa.flags & IWL_UCODE_TLV_FLAGS_NEWSCAN); | 1226 | !!(fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_NEWSCAN); |
1227 | 1227 | ||
1228 | if (!(cfg->sku & EEPROM_SKU_CAP_IPAN_ENABLE)) | 1228 | if (!(cfg->sku & EEPROM_SKU_CAP_IPAN_ENABLE)) |
1229 | ucode_capa.flags &= ~IWL_UCODE_TLV_FLAGS_PAN; | 1229 | fw->ucode_capa.flags &= ~IWL_UCODE_TLV_FLAGS_PAN; |
1230 | 1230 | ||
1231 | /* | 1231 | /* |
1232 | * if not PAN, then don't support P2P -- might be a uCode | 1232 | * if not PAN, then don't support P2P -- might be a uCode |
1233 | * packaging bug or due to the eeprom check above | 1233 | * packaging bug or due to the eeprom check above |
1234 | */ | 1234 | */ |
1235 | if (!(ucode_capa.flags & IWL_UCODE_TLV_FLAGS_PAN)) | 1235 | if (!(fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_PAN)) |
1236 | ucode_capa.flags &= ~IWL_UCODE_TLV_FLAGS_P2P; | 1236 | fw->ucode_capa.flags &= ~IWL_UCODE_TLV_FLAGS_P2P; |
1237 | 1237 | ||
1238 | if (ucode_capa.flags & IWL_UCODE_TLV_FLAGS_PAN) { | 1238 | if (fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_PAN) { |
1239 | priv->sta_key_max_num = STA_KEY_MAX_NUM_PAN; | 1239 | priv->sta_key_max_num = STA_KEY_MAX_NUM_PAN; |
1240 | nic->shrd->cmd_queue = IWL_IPAN_CMD_QUEUE_NUM; | 1240 | nic->shrd->cmd_queue = IWL_IPAN_CMD_QUEUE_NUM; |
1241 | } else { | 1241 | } else { |
@@ -1246,25 +1246,25 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context) | |||
1246 | * figure out the offset of chain noise reset and gain commands | 1246 | * figure out the offset of chain noise reset and gain commands |
1247 | * base on the size of standard phy calibration commands table size | 1247 | * base on the size of standard phy calibration commands table size |
1248 | */ | 1248 | */ |
1249 | if (ucode_capa.standard_phy_calibration_size > | 1249 | if (fw->ucode_capa.standard_phy_calibration_size > |
1250 | IWL_MAX_PHY_CALIBRATE_TBL_SIZE) | 1250 | IWL_MAX_PHY_CALIBRATE_TBL_SIZE) |
1251 | ucode_capa.standard_phy_calibration_size = | 1251 | fw->ucode_capa.standard_phy_calibration_size = |
1252 | IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE; | 1252 | IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE; |
1253 | 1253 | ||
1254 | priv->phy_calib_chain_noise_reset_cmd = | 1254 | priv->phy_calib_chain_noise_reset_cmd = |
1255 | ucode_capa.standard_phy_calibration_size; | 1255 | fw->ucode_capa.standard_phy_calibration_size; |
1256 | priv->phy_calib_chain_noise_gain_cmd = | 1256 | priv->phy_calib_chain_noise_gain_cmd = |
1257 | ucode_capa.standard_phy_calibration_size + 1; | 1257 | fw->ucode_capa.standard_phy_calibration_size + 1; |
1258 | 1258 | ||
1259 | /* initialize all valid contexts */ | 1259 | /* initialize all valid contexts */ |
1260 | iwl_init_context(priv, ucode_capa.flags); | 1260 | iwl_init_context(priv, fw->ucode_capa.flags); |
1261 | 1261 | ||
1262 | /************************************************** | 1262 | /************************************************** |
1263 | * This is still part of probe() in a sense... | 1263 | * This is still part of probe() in a sense... |
1264 | * | 1264 | * |
1265 | * 9. Setup and register with mac80211 and debugfs | 1265 | * 9. Setup and register with mac80211 and debugfs |
1266 | **************************************************/ | 1266 | **************************************************/ |
1267 | err = iwlagn_mac_setup_register(priv, &ucode_capa); | 1267 | err = iwlagn_mac_setup_register(priv, &fw->ucode_capa); |
1268 | if (err) | 1268 | if (err) |
1269 | goto out_unbind; | 1269 | goto out_unbind; |
1270 | 1270 | ||