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 /drivers/net/wireless/iwlwifi/iwl-ucode.c | |
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>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-ucode.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-ucode.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-ucode.c b/drivers/net/wireless/iwlwifi/iwl-ucode.c index 01768f709a7..9e21fc15c5f 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 | ||