aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-02-21 11:31:06 -0500
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2012-02-27 16:25:06 -0500
commita78be210d53b24cc3437d4362912c510b895a8eb (patch)
tree3b8e30a6df0a44a876a719c3f76d8977f471d831 /drivers/net/wireless
parente211b2427a61e92e5a6bdd629bc2c2e6114c2dc1 (diff)
iwlwifi: move uCode flags handling to op_mode
The uCode flags modification is op_mode dependent since the P2P config is an op-mode config. This also fixes P2P enabling: due to the uCode loading code shuffle moving the SKU check before the EEPROM was read it was always false and would always disable PAN/P2P. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c23
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-ucode.c14
2 files changed, 21 insertions, 16 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 5e476a80bd8c..d70dd6fff4f5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1151,6 +1151,7 @@ int iwl_op_mode_dvm_start(struct iwl_bus *bus,
1151 struct iwl_priv *priv; 1151 struct iwl_priv *priv;
1152 struct ieee80211_hw *hw; 1152 struct ieee80211_hw *hw;
1153 u16 num_mac; 1153 u16 num_mac;
1154 u32 ucode_flags;
1154 1155
1155 /************************ 1156 /************************
1156 * 1. Allocating HW data 1157 * 1. Allocating HW data
@@ -1242,6 +1243,22 @@ int iwl_op_mode_dvm_start(struct iwl_bus *bus,
1242 ************************/ 1243 ************************/
1243 iwl_set_hw_params(priv); 1244 iwl_set_hw_params(priv);
1244 1245
1246 ucode_flags = fw->ucode_capa.flags;
1247
1248#ifndef CONFIG_IWLWIFI_P2P
1249 ucode_flags &= ~IWL_UCODE_TLV_FLAGS_PAN;
1250#endif
1251 if (!(hw_params(priv).sku & EEPROM_SKU_CAP_IPAN_ENABLE))
1252 ucode_flags &= ~IWL_UCODE_TLV_FLAGS_PAN;
1253
1254 /*
1255 * if not PAN, then don't support P2P -- might be a uCode
1256 * packaging bug or due to the eeprom check above
1257 */
1258 if (!(ucode_flags & IWL_UCODE_TLV_FLAGS_PAN))
1259 ucode_flags &= ~IWL_UCODE_TLV_FLAGS_P2P;
1260
1261
1245 /******************* 1262 /*******************
1246 * 6. Setup priv 1263 * 6. Setup priv
1247 *******************/ 1264 *******************/
@@ -1266,9 +1283,9 @@ int iwl_op_mode_dvm_start(struct iwl_bus *bus,
1266 "%s", fw->fw_version); 1283 "%s", fw->fw_version);
1267 1284
1268 priv->new_scan_threshold_behaviour = 1285 priv->new_scan_threshold_behaviour =
1269 !!(fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_NEWSCAN); 1286 !!(ucode_flags & IWL_UCODE_TLV_FLAGS_NEWSCAN);
1270 1287
1271 if (fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_PAN) { 1288 if (ucode_flags & IWL_UCODE_TLV_FLAGS_PAN) {
1272 priv->sta_key_max_num = STA_KEY_MAX_NUM_PAN; 1289 priv->sta_key_max_num = STA_KEY_MAX_NUM_PAN;
1273 priv->shrd->cmd_queue = IWL_IPAN_CMD_QUEUE_NUM; 1290 priv->shrd->cmd_queue = IWL_IPAN_CMD_QUEUE_NUM;
1274 } else { 1291 } else {
@@ -1282,7 +1299,7 @@ int iwl_op_mode_dvm_start(struct iwl_bus *bus,
1282 fw->ucode_capa.standard_phy_calibration_size + 1; 1299 fw->ucode_capa.standard_phy_calibration_size + 1;
1283 1300
1284 /* initialize all valid contexts */ 1301 /* initialize all valid contexts */
1285 iwl_init_context(priv, fw->ucode_capa.flags); 1302 iwl_init_context(priv, ucode_flags);
1286 1303
1287 /************************************************** 1304 /**************************************************
1288 * This is still part of probe() in a sense... 1305 * This is still part of probe() in a sense...
diff --git a/drivers/net/wireless/iwlwifi/iwl-ucode.c b/drivers/net/wireless/iwlwifi/iwl-ucode.c
index 99f89b27f42c..3645bf3d61c6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-ucode.c
+++ b/drivers/net/wireless/iwlwifi/iwl-ucode.c
@@ -1226,9 +1226,7 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
1226 nic->inst_evtlog_size = 1226 nic->inst_evtlog_size =
1227 cfg->base_params->max_event_log_size; 1227 cfg->base_params->max_event_log_size;
1228 nic->inst_errlog_ptr = pieces.inst_errlog_ptr; 1228 nic->inst_errlog_ptr = pieces.inst_errlog_ptr;
1229#ifndef CONFIG_IWLWIFI_P2P 1229
1230 fw->ucode_capa.flags &= ~IWL_UCODE_TLV_FLAGS_PAN;
1231#endif
1232 /* 1230 /*
1233 * figure out the offset of chain noise reset and gain commands 1231 * figure out the offset of chain noise reset and gain commands
1234 * base on the size of standard phy calibration commands table size 1232 * base on the size of standard phy calibration commands table size
@@ -1238,16 +1236,6 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
1238 fw->ucode_capa.standard_phy_calibration_size = 1236 fw->ucode_capa.standard_phy_calibration_size =
1239 IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE; 1237 IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE;
1240 1238
1241 if (!(cfg->sku & EEPROM_SKU_CAP_IPAN_ENABLE))
1242 fw->ucode_capa.flags &= ~IWL_UCODE_TLV_FLAGS_PAN;
1243
1244 /*
1245 * if not PAN, then don't support P2P -- might be a uCode
1246 * packaging bug or due to the eeprom check above
1247 */
1248 if (!(fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_PAN))
1249 fw->ucode_capa.flags &= ~IWL_UCODE_TLV_FLAGS_P2P;
1250
1251 /* We have our copies now, allow OS release its copies */ 1239 /* We have our copies now, allow OS release its copies */
1252 release_firmware(ucode_raw); 1240 release_firmware(ucode_raw);
1253 complete(&nic->request_firmware_complete); 1241 complete(&nic->request_firmware_complete);