diff options
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 53 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-shared.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-ucode.c | 64 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-wifi.h | 2 |
4 files changed, 67 insertions, 55 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index e8fed167f97e..5e476a80bd8c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -1142,9 +1142,11 @@ static void iwl_debug_config(struct iwl_priv *priv) | |||
1142 | #endif | 1142 | #endif |
1143 | } | 1143 | } |
1144 | 1144 | ||
1145 | int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops, | 1145 | int iwl_op_mode_dvm_start(struct iwl_bus *bus, |
1146 | struct iwl_cfg *cfg) | 1146 | const struct iwl_trans_ops *trans_ops, |
1147 | struct iwl_cfg *cfg) | ||
1147 | { | 1148 | { |
1149 | struct iwl_fw *fw = &nic(bus)->fw; | ||
1148 | int err = 0; | 1150 | int err = 0; |
1149 | struct iwl_priv *priv; | 1151 | struct iwl_priv *priv; |
1150 | struct ieee80211_hw *hw; | 1152 | struct ieee80211_hw *hw; |
@@ -1172,7 +1174,6 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops, | |||
1172 | iwl_debug_config(priv); | 1174 | iwl_debug_config(priv); |
1173 | 1175 | ||
1174 | IWL_DEBUG_INFO(priv, "*** LOAD DRIVER ***\n"); | 1176 | IWL_DEBUG_INFO(priv, "*** LOAD DRIVER ***\n"); |
1175 | cfg(priv) = cfg; | ||
1176 | 1177 | ||
1177 | /* is antenna coupling more than 35dB ? */ | 1178 | /* is antenna coupling more than 35dB ? */ |
1178 | priv->bt_ant_couple_ok = | 1179 | priv->bt_ant_couple_ok = |
@@ -1260,12 +1261,44 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops, | |||
1260 | iwl_power_initialize(priv); | 1261 | iwl_power_initialize(priv); |
1261 | iwl_tt_initialize(priv); | 1262 | iwl_tt_initialize(priv); |
1262 | 1263 | ||
1263 | init_completion(&nic(priv)->request_firmware_complete); | 1264 | snprintf(priv->hw->wiphy->fw_version, |
1265 | sizeof(priv->hw->wiphy->fw_version), | ||
1266 | "%s", fw->fw_version); | ||
1267 | |||
1268 | priv->new_scan_threshold_behaviour = | ||
1269 | !!(fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_NEWSCAN); | ||
1264 | 1270 | ||
1265 | err = iwl_request_firmware(nic(priv), true); | 1271 | if (fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_PAN) { |
1272 | priv->sta_key_max_num = STA_KEY_MAX_NUM_PAN; | ||
1273 | priv->shrd->cmd_queue = IWL_IPAN_CMD_QUEUE_NUM; | ||
1274 | } else { | ||
1275 | priv->sta_key_max_num = STA_KEY_MAX_NUM; | ||
1276 | priv->shrd->cmd_queue = IWL_DEFAULT_CMD_QUEUE_NUM; | ||
1277 | } | ||
1278 | |||
1279 | priv->phy_calib_chain_noise_reset_cmd = | ||
1280 | fw->ucode_capa.standard_phy_calibration_size; | ||
1281 | priv->phy_calib_chain_noise_gain_cmd = | ||
1282 | fw->ucode_capa.standard_phy_calibration_size + 1; | ||
1283 | |||
1284 | /* initialize all valid contexts */ | ||
1285 | iwl_init_context(priv, fw->ucode_capa.flags); | ||
1286 | |||
1287 | /************************************************** | ||
1288 | * This is still part of probe() in a sense... | ||
1289 | * | ||
1290 | * 9. Setup and register with mac80211 and debugfs | ||
1291 | **************************************************/ | ||
1292 | err = iwlagn_mac_setup_register(priv, &fw->ucode_capa); | ||
1266 | if (err) | 1293 | if (err) |
1267 | goto out_destroy_workqueue; | 1294 | goto out_destroy_workqueue; |
1268 | 1295 | ||
1296 | err = iwl_dbgfs_register(priv, DRV_NAME); | ||
1297 | if (err) | ||
1298 | IWL_ERR(priv, | ||
1299 | "failed to create debugfs files. Ignoring error: %d\n", | ||
1300 | err); | ||
1301 | |||
1269 | return 0; | 1302 | return 0; |
1270 | 1303 | ||
1271 | out_destroy_workqueue: | 1304 | out_destroy_workqueue: |
@@ -1281,6 +1314,16 @@ out: | |||
1281 | return err; | 1314 | return err; |
1282 | } | 1315 | } |
1283 | 1316 | ||
1317 | int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops, | ||
1318 | struct iwl_cfg *cfg) | ||
1319 | { | ||
1320 | bus->shrd->cfg = cfg; | ||
1321 | |||
1322 | init_completion(&nic(bus)->request_firmware_complete); | ||
1323 | |||
1324 | return iwl_request_firmware(nic(bus), true); | ||
1325 | } | ||
1326 | |||
1284 | void __devexit iwl_remove(struct iwl_priv * priv) | 1327 | void __devexit iwl_remove(struct iwl_priv * priv) |
1285 | { | 1328 | { |
1286 | wait_for_completion(&nic(priv)->request_firmware_complete); | 1329 | wait_for_completion(&nic(priv)->request_firmware_complete); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-shared.h b/drivers/net/wireless/iwlwifi/iwl-shared.h index f810b41db9df..cf593b086149 100644 --- a/drivers/net/wireless/iwlwifi/iwl-shared.h +++ b/drivers/net/wireless/iwlwifi/iwl-shared.h | |||
@@ -532,6 +532,9 @@ enum iwl_rxon_context_id { | |||
532 | NUM_IWL_RXON_CTX | 532 | NUM_IWL_RXON_CTX |
533 | }; | 533 | }; |
534 | 534 | ||
535 | int iwl_op_mode_dvm_start(struct iwl_bus *bus, | ||
536 | const struct iwl_trans_ops *trans_ops, | ||
537 | struct iwl_cfg *cfg); | ||
535 | int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops, | 538 | int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops, |
536 | struct iwl_cfg *cfg); | 539 | struct iwl_cfg *cfg); |
537 | void __devexit iwl_remove(struct iwl_priv * priv); | 540 | void __devexit iwl_remove(struct iwl_priv * priv); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-ucode.c b/drivers/net/wireless/iwlwifi/iwl-ucode.c index ea757098654d..99f89b27f42c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-ucode.c +++ b/drivers/net/wireless/iwlwifi/iwl-ucode.c | |||
@@ -687,7 +687,6 @@ int iwl_run_init_ucode(struct iwl_trans *trans) | |||
687 | 687 | ||
688 | static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context); | 688 | static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context); |
689 | 689 | ||
690 | #define UCODE_EXPERIMENTAL_INDEX 100 | ||
691 | #define UCODE_EXPERIMENTAL_TAG "exp" | 690 | #define UCODE_EXPERIMENTAL_TAG "exp" |
692 | 691 | ||
693 | int __must_check iwl_request_firmware(struct iwl_nic *nic, bool first) | 692 | int __must_check iwl_request_firmware(struct iwl_nic *nic, bool first) |
@@ -1047,7 +1046,6 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context) | |||
1047 | struct iwl_nic *nic = context; | 1046 | struct iwl_nic *nic = context; |
1048 | struct iwl_cfg *cfg = cfg(nic); | 1047 | struct iwl_cfg *cfg = cfg(nic); |
1049 | struct iwl_fw *fw = &nic->fw; | 1048 | struct iwl_fw *fw = &nic->fw; |
1050 | struct iwl_priv *priv = priv(nic); /* temporary */ | ||
1051 | struct iwl_ucode_header *ucode; | 1049 | struct iwl_ucode_header *ucode; |
1052 | int err; | 1050 | int err; |
1053 | struct iwlagn_firmware_pieces pieces; | 1051 | struct iwlagn_firmware_pieces pieces; |
@@ -1127,10 +1125,6 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context) | |||
1127 | 1125 | ||
1128 | IWL_INFO(nic, "loaded firmware version %s", nic->fw.fw_version); | 1126 | IWL_INFO(nic, "loaded firmware version %s", nic->fw.fw_version); |
1129 | 1127 | ||
1130 | snprintf(priv->hw->wiphy->fw_version, | ||
1131 | sizeof(priv->hw->wiphy->fw_version), | ||
1132 | "%s", nic->fw.fw_version); | ||
1133 | |||
1134 | /* | 1128 | /* |
1135 | * For any of the failures below (before allocating pci memory) | 1129 | * For any of the failures below (before allocating pci memory) |
1136 | * we will try to load a version with a smaller API -- maybe the | 1130 | * we will try to load a version with a smaller API -- maybe the |
@@ -1235,27 +1229,6 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context) | |||
1235 | #ifndef CONFIG_IWLWIFI_P2P | 1229 | #ifndef CONFIG_IWLWIFI_P2P |
1236 | fw->ucode_capa.flags &= ~IWL_UCODE_TLV_FLAGS_PAN; | 1230 | fw->ucode_capa.flags &= ~IWL_UCODE_TLV_FLAGS_PAN; |
1237 | #endif | 1231 | #endif |
1238 | |||
1239 | priv->new_scan_threshold_behaviour = | ||
1240 | !!(fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_NEWSCAN); | ||
1241 | |||
1242 | if (!(cfg->sku & EEPROM_SKU_CAP_IPAN_ENABLE)) | ||
1243 | fw->ucode_capa.flags &= ~IWL_UCODE_TLV_FLAGS_PAN; | ||
1244 | |||
1245 | /* | ||
1246 | * if not PAN, then don't support P2P -- might be a uCode | ||
1247 | * packaging bug or due to the eeprom check above | ||
1248 | */ | ||
1249 | if (!(fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_PAN)) | ||
1250 | fw->ucode_capa.flags &= ~IWL_UCODE_TLV_FLAGS_P2P; | ||
1251 | |||
1252 | if (fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_PAN) { | ||
1253 | priv->sta_key_max_num = STA_KEY_MAX_NUM_PAN; | ||
1254 | nic->shrd->cmd_queue = IWL_IPAN_CMD_QUEUE_NUM; | ||
1255 | } else { | ||
1256 | priv->sta_key_max_num = STA_KEY_MAX_NUM; | ||
1257 | nic->shrd->cmd_queue = IWL_DEFAULT_CMD_QUEUE_NUM; | ||
1258 | } | ||
1259 | /* | 1232 | /* |
1260 | * figure out the offset of chain noise reset and gain commands | 1233 | * figure out the offset of chain noise reset and gain commands |
1261 | * base on the size of standard phy calibration commands table size | 1234 | * base on the size of standard phy calibration commands table size |
@@ -1265,47 +1238,38 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context) | |||
1265 | fw->ucode_capa.standard_phy_calibration_size = | 1238 | fw->ucode_capa.standard_phy_calibration_size = |
1266 | IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE; | 1239 | IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE; |
1267 | 1240 | ||
1268 | priv->phy_calib_chain_noise_reset_cmd = | 1241 | if (!(cfg->sku & EEPROM_SKU_CAP_IPAN_ENABLE)) |
1269 | fw->ucode_capa.standard_phy_calibration_size; | 1242 | fw->ucode_capa.flags &= ~IWL_UCODE_TLV_FLAGS_PAN; |
1270 | priv->phy_calib_chain_noise_gain_cmd = | ||
1271 | fw->ucode_capa.standard_phy_calibration_size + 1; | ||
1272 | |||
1273 | /* initialize all valid contexts */ | ||
1274 | iwl_init_context(priv, fw->ucode_capa.flags); | ||
1275 | |||
1276 | /************************************************** | ||
1277 | * This is still part of probe() in a sense... | ||
1278 | * | ||
1279 | * 9. Setup and register with mac80211 and debugfs | ||
1280 | **************************************************/ | ||
1281 | err = iwlagn_mac_setup_register(priv, &fw->ucode_capa); | ||
1282 | if (err) | ||
1283 | goto out_unbind; | ||
1284 | 1243 | ||
1285 | err = iwl_dbgfs_register(priv, DRV_NAME); | 1244 | /* |
1286 | if (err) | 1245 | * if not PAN, then don't support P2P -- might be a uCode |
1287 | IWL_ERR(nic, | 1246 | * packaging bug or due to the eeprom check above |
1288 | "failed to create debugfs files. Ignoring error: %d\n", | 1247 | */ |
1289 | err); | 1248 | if (!(fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_PAN)) |
1249 | fw->ucode_capa.flags &= ~IWL_UCODE_TLV_FLAGS_P2P; | ||
1290 | 1250 | ||
1291 | /* We have our copies now, allow OS release its copies */ | 1251 | /* We have our copies now, allow OS release its copies */ |
1292 | release_firmware(ucode_raw); | 1252 | release_firmware(ucode_raw); |
1293 | complete(&nic->request_firmware_complete); | 1253 | complete(&nic->request_firmware_complete); |
1254 | |||
1255 | if (iwl_op_mode_dvm_start(bus(nic), trans(nic)->ops, cfg)) | ||
1256 | goto out_unbind; | ||
1257 | |||
1294 | return; | 1258 | return; |
1295 | 1259 | ||
1296 | try_again: | 1260 | try_again: |
1297 | /* try next, if any */ | 1261 | /* try next, if any */ |
1262 | release_firmware(ucode_raw); | ||
1298 | if (iwl_request_firmware(nic, false)) | 1263 | if (iwl_request_firmware(nic, false)) |
1299 | goto out_unbind; | 1264 | goto out_unbind; |
1300 | release_firmware(ucode_raw); | ||
1301 | return; | 1265 | return; |
1302 | 1266 | ||
1303 | err_pci_alloc: | 1267 | err_pci_alloc: |
1304 | IWL_ERR(nic, "failed to allocate pci memory\n"); | 1268 | IWL_ERR(nic, "failed to allocate pci memory\n"); |
1305 | iwl_dealloc_ucode(nic); | 1269 | iwl_dealloc_ucode(nic); |
1270 | release_firmware(ucode_raw); | ||
1306 | out_unbind: | 1271 | out_unbind: |
1307 | complete(&nic->request_firmware_complete); | 1272 | complete(&nic->request_firmware_complete); |
1308 | device_release_driver(trans(nic)->dev); | 1273 | device_release_driver(trans(nic)->dev); |
1309 | release_firmware(ucode_raw); | ||
1310 | } | 1274 | } |
1311 | 1275 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-wifi.h b/drivers/net/wireless/iwlwifi/iwl-wifi.h index 84172f6de4bb..a78120e89fe1 100644 --- a/drivers/net/wireless/iwlwifi/iwl-wifi.h +++ b/drivers/net/wireless/iwlwifi/iwl-wifi.h | |||
@@ -66,6 +66,8 @@ | |||
66 | #include "iwl-shared.h" | 66 | #include "iwl-shared.h" |
67 | #include "iwl-ucode.h" | 67 | #include "iwl-ucode.h" |
68 | 68 | ||
69 | #define UCODE_EXPERIMENTAL_INDEX 100 | ||
70 | |||
69 | /** | 71 | /** |
70 | * struct iwl_nic - nic common data | 72 | * struct iwl_nic - nic common data |
71 | * @fw: the iwl_fw structure | 73 | * @fw: the iwl_fw structure |