aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/iwmc3200wifi/fw.c19
-rw-r--r--drivers/net/wireless/iwmc3200wifi/iwm.h3
-rw-r--r--drivers/net/wireless/iwmc3200wifi/lmac.h4
-rw-r--r--drivers/net/wireless/iwmc3200wifi/main.c6
4 files changed, 17 insertions, 15 deletions
diff --git a/drivers/net/wireless/iwmc3200wifi/fw.c b/drivers/net/wireless/iwmc3200wifi/fw.c
index ec1a15a5a0e4..c58f614ce6d8 100644
--- a/drivers/net/wireless/iwmc3200wifi/fw.c
+++ b/drivers/net/wireless/iwmc3200wifi/fw.c
@@ -275,6 +275,7 @@ static int iwm_load_lmac(struct iwm_priv *iwm, const char *img_name)
275 */ 275 */
276int iwm_load_fw(struct iwm_priv *iwm) 276int iwm_load_fw(struct iwm_priv *iwm)
277{ 277{
278 unsigned long init_calib_map, periodic_calib_map;
278 int ret; 279 int ret;
279 280
280 /* We first start downloading the UMAC */ 281 /* We first start downloading the UMAC */
@@ -315,23 +316,25 @@ int iwm_load_fw(struct iwm_priv *iwm)
315 return ret; 316 return ret;
316 } 317 }
317 318
319 init_calib_map = iwm->conf.calib_map & IWM_CALIB_MAP_INIT_MSK;
320 periodic_calib_map = IWM_CALIB_MAP_PER_LMAC(iwm->conf.calib_map);
321
318#ifdef CONFIG_IWM_B0_HW_SUPPORT 322#ifdef CONFIG_IWM_B0_HW_SUPPORT
319 if (iwm->conf.hw_b0) { 323 if (iwm->conf.hw_b0) {
320 clear_bit(PHY_CALIBRATE_RX_IQ_CMD, &iwm->conf.init_calib_map); 324 clear_bit(PHY_CALIBRATE_RX_IQ_CMD, &init_calib_map);
321 clear_bit(PHY_CALIBRATE_RX_IQ_CMD, 325 clear_bit(PHY_CALIBRATE_RX_IQ_CMD, &periodic_calib_map);
322 &iwm->conf.periodic_calib_map);
323 } 326 }
324#endif 327#endif
325 /* Read RX IQ calibration result from EEPROM */ 328 /* Read RX IQ calibration result from EEPROM */
326 if (test_bit(PHY_CALIBRATE_RX_IQ_CMD, &iwm->conf.init_calib_map)) { 329 if (test_bit(PHY_CALIBRATE_RX_IQ_CMD, &init_calib_map)) {
327 iwm_store_rxiq_calib_result(iwm); 330 iwm_store_rxiq_calib_result(iwm);
328 set_bit(PHY_CALIBRATE_RX_IQ_CMD, &iwm->calib_done_map); 331 set_bit(PHY_CALIBRATE_RX_IQ_CMD, &iwm->calib_done_map);
329 } 332 }
330 333
331 iwm_send_prio_table(iwm); 334 iwm_send_prio_table(iwm);
332 iwm_send_init_calib_cfg(iwm, iwm->conf.init_calib_map); 335 iwm_send_init_calib_cfg(iwm, init_calib_map);
333 336
334 while (iwm->calib_done_map != iwm->conf.init_calib_map) { 337 while (iwm->calib_done_map != init_calib_map) {
335 ret = iwm_notif_handle(iwm, CALIBRATION_RES_NOTIFICATION, 338 ret = iwm_notif_handle(iwm, CALIBRATION_RES_NOTIFICATION,
336 IWM_SRC_LMAC, WAIT_NOTIF_TIMEOUT); 339 IWM_SRC_LMAC, WAIT_NOTIF_TIMEOUT);
337 if (ret) { 340 if (ret) {
@@ -340,7 +343,7 @@ int iwm_load_fw(struct iwm_priv *iwm)
340 } 343 }
341 IWM_DBG_FW(iwm, DBG, "Got calibration result. calib_done_map: " 344 IWM_DBG_FW(iwm, DBG, "Got calibration result. calib_done_map: "
342 "0x%lx, requested calibrations: 0x%lx\n", 345 "0x%lx, requested calibrations: 0x%lx\n",
343 iwm->calib_done_map, iwm->conf.init_calib_map); 346 iwm->calib_done_map, init_calib_map);
344 } 347 }
345 348
346 /* Handle LMAC CALIBRATION_COMPLETE notification */ 349 /* Handle LMAC CALIBRATION_COMPLETE notification */
@@ -378,7 +381,7 @@ int iwm_load_fw(struct iwm_priv *iwm)
378 381
379 iwm_send_prio_table(iwm); 382 iwm_send_prio_table(iwm);
380 iwm_send_calib_results(iwm); 383 iwm_send_calib_results(iwm);
381 iwm_send_periodic_calib_cfg(iwm, iwm->conf.periodic_calib_map); 384 iwm_send_periodic_calib_cfg(iwm, periodic_calib_map);
382 385
383 return 0; 386 return 0;
384 387
diff --git a/drivers/net/wireless/iwmc3200wifi/iwm.h b/drivers/net/wireless/iwmc3200wifi/iwm.h
index 4da57f737f27..1bad78f81350 100644
--- a/drivers/net/wireless/iwmc3200wifi/iwm.h
+++ b/drivers/net/wireless/iwmc3200wifi/iwm.h
@@ -65,8 +65,7 @@
65 65
66struct iwm_conf { 66struct iwm_conf {
67 u32 sdio_ior_timeout; 67 u32 sdio_ior_timeout;
68 unsigned long init_calib_map; 68 unsigned long calib_map;
69 unsigned long periodic_calib_map;
70 bool reset_on_fatal_err; 69 bool reset_on_fatal_err;
71 bool auto_connect; 70 bool auto_connect;
72 bool wimax_not_present; 71 bool wimax_not_present;
diff --git a/drivers/net/wireless/iwmc3200wifi/lmac.h b/drivers/net/wireless/iwmc3200wifi/lmac.h
index db2e5eea1895..19213e165f5f 100644
--- a/drivers/net/wireless/iwmc3200wifi/lmac.h
+++ b/drivers/net/wireless/iwmc3200wifi/lmac.h
@@ -396,6 +396,10 @@ enum {
396 CALIBRATION_CMD_NUM, 396 CALIBRATION_CMD_NUM,
397}; 397};
398 398
399#define IWM_CALIB_MAP_INIT_MSK 0xFFFF
400#define IWM_CALIB_MAP_PER_LMAC(m) ((m & 0xFF0000) >> 16)
401#define IWM_CALIB_MAP_PER_UMAC(m) ((m & 0xFF000000) >> 24)
402
399struct iwm_lmac_calib_hdr { 403struct iwm_lmac_calib_hdr {
400 u8 opcode; 404 u8 opcode;
401 u8 first_grp; 405 u8 first_grp;
diff --git a/drivers/net/wireless/iwmc3200wifi/main.c b/drivers/net/wireless/iwmc3200wifi/main.c
index 930056b013f3..4fedb45d62b3 100644
--- a/drivers/net/wireless/iwmc3200wifi/main.c
+++ b/drivers/net/wireless/iwmc3200wifi/main.c
@@ -53,11 +53,7 @@
53static struct iwm_conf def_iwm_conf = { 53static struct iwm_conf def_iwm_conf = {
54 54
55 .sdio_ior_timeout = 5000, 55 .sdio_ior_timeout = 5000,
56 .init_calib_map = BIT(PHY_CALIBRATE_DC_CMD) | 56 .calib_map = BIT(PHY_CALIBRATE_DC_CMD) |
57 BIT(PHY_CALIBRATE_LO_CMD) |
58 BIT(PHY_CALIBRATE_TX_IQ_CMD) |
59 BIT(PHY_CALIBRATE_RX_IQ_CMD),
60 .periodic_calib_map = BIT(PHY_CALIBRATE_DC_CMD) |
61 BIT(PHY_CALIBRATE_LO_CMD) | 57 BIT(PHY_CALIBRATE_LO_CMD) |
62 BIT(PHY_CALIBRATE_TX_IQ_CMD) | 58 BIT(PHY_CALIBRATE_TX_IQ_CMD) |
63 BIT(PHY_CALIBRATE_RX_IQ_CMD) | 59 BIT(PHY_CALIBRATE_RX_IQ_CMD) |