aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2012-04-18 10:28:17 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2012-04-18 10:29:43 -0400
commit68e8dfdadb424fd76ca81eeb399c3228adc5cea2 (patch)
treee8b641240ec3cdf61aa218d2c9d7e9c340683f69 /drivers/net/wireless/iwlwifi/iwl-agn.c
parent9130bab137844d9ad3db6ab524de299cd2b9e39d (diff)
iwlwifi: op_mode holds its pointer to the transport
Instead of using the shared area that we be killed. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c70
1 files changed, 35 insertions, 35 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 7db39866bdc4..81c1cd7fdc9e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -348,14 +348,14 @@ static void iwl_print_cont_event_trace(struct iwl_priv *priv, u32 base,
348 ptr = base + (4 * sizeof(u32)) + (start_idx * 3 * sizeof(u32)); 348 ptr = base + (4 * sizeof(u32)) + (start_idx * 3 * sizeof(u32));
349 349
350 /* Make sure device is powered up for SRAM reads */ 350 /* Make sure device is powered up for SRAM reads */
351 spin_lock_irqsave(&trans(priv)->reg_lock, reg_flags); 351 spin_lock_irqsave(&priv->trans->reg_lock, reg_flags);
352 if (unlikely(!iwl_grab_nic_access(trans(priv)))) { 352 if (unlikely(!iwl_grab_nic_access(priv->trans))) {
353 spin_unlock_irqrestore(&trans(priv)->reg_lock, reg_flags); 353 spin_unlock_irqrestore(&priv->trans->reg_lock, reg_flags);
354 return; 354 return;
355 } 355 }
356 356
357 /* Set starting address; reads will auto-increment */ 357 /* Set starting address; reads will auto-increment */
358 iwl_write32(trans(priv), HBUS_TARG_MEM_RADDR, ptr); 358 iwl_write32(priv->trans, HBUS_TARG_MEM_RADDR, ptr);
359 359
360 /* 360 /*
361 * Refuse to read more than would have fit into the log from 361 * Refuse to read more than would have fit into the log from
@@ -371,20 +371,20 @@ static void iwl_print_cont_event_trace(struct iwl_priv *priv, u32 base,
371 * place event id # at far right for easier visual parsing. 371 * place event id # at far right for easier visual parsing.
372 */ 372 */
373 for (i = 0; i < num_events; i++) { 373 for (i = 0; i < num_events; i++) {
374 ev = iwl_read32(trans(priv), HBUS_TARG_MEM_RDAT); 374 ev = iwl_read32(priv->trans, HBUS_TARG_MEM_RDAT);
375 time = iwl_read32(trans(priv), HBUS_TARG_MEM_RDAT); 375 time = iwl_read32(priv->trans, HBUS_TARG_MEM_RDAT);
376 if (mode == 0) { 376 if (mode == 0) {
377 trace_iwlwifi_dev_ucode_cont_event( 377 trace_iwlwifi_dev_ucode_cont_event(
378 trans(priv)->dev, 0, time, ev); 378 priv->trans->dev, 0, time, ev);
379 } else { 379 } else {
380 data = iwl_read32(trans(priv), HBUS_TARG_MEM_RDAT); 380 data = iwl_read32(priv->trans, HBUS_TARG_MEM_RDAT);
381 trace_iwlwifi_dev_ucode_cont_event( 381 trace_iwlwifi_dev_ucode_cont_event(
382 trans(priv)->dev, time, data, ev); 382 priv->trans->dev, time, data, ev);
383 } 383 }
384 } 384 }
385 /* Allow device to power down */ 385 /* Allow device to power down */
386 iwl_release_nic_access(trans(priv)); 386 iwl_release_nic_access(priv->trans);
387 spin_unlock_irqrestore(&trans(priv)->reg_lock, reg_flags); 387 spin_unlock_irqrestore(&priv->trans->reg_lock, reg_flags);
388} 388}
389 389
390static void iwl_continuous_event_trace(struct iwl_priv *priv) 390static void iwl_continuous_event_trace(struct iwl_priv *priv)
@@ -403,8 +403,7 @@ static void iwl_continuous_event_trace(struct iwl_priv *priv)
403 403
404 base = priv->device_pointers.log_event_table; 404 base = priv->device_pointers.log_event_table;
405 if (iwlagn_hw_valid_rtc_data_addr(base)) { 405 if (iwlagn_hw_valid_rtc_data_addr(base)) {
406 iwl_read_targ_mem_words(trans(priv), base, &read, sizeof(read)); 406 iwl_read_targ_mem_words(priv->trans, base, &read, sizeof(read));
407
408 capacity = read.capacity; 407 capacity = read.capacity;
409 mode = read.mode; 408 mode = read.mode;
410 num_wraps = read.wrap_counter; 409 num_wraps = read.wrap_counter;
@@ -444,7 +443,7 @@ static void iwl_continuous_event_trace(struct iwl_priv *priv)
444 else 443 else
445 priv->event_log.wraps_once_count++; 444 priv->event_log.wraps_once_count++;
446 445
447 trace_iwlwifi_dev_ucode_wrap_event(trans(priv)->dev, 446 trace_iwlwifi_dev_ucode_wrap_event(priv->trans->dev,
448 num_wraps - priv->event_log.num_wraps, 447 num_wraps - priv->event_log.num_wraps,
449 next_entry, priv->event_log.next_entry); 448 next_entry, priv->event_log.next_entry);
450 449
@@ -670,7 +669,7 @@ void iwl_rf_kill_ct_config(struct iwl_priv *priv)
670 struct iwl_ct_kill_throttling_config adv_cmd; 669 struct iwl_ct_kill_throttling_config adv_cmd;
671 int ret = 0; 670 int ret = 0;
672 671
673 iwl_write32(trans(priv), CSR_UCODE_DRV_GP1_CLR, 672 iwl_write32(priv->trans, CSR_UCODE_DRV_GP1_CLR,
674 CSR_UCODE_DRV_GP1_REG_BIT_CT_KILL_EXIT); 673 CSR_UCODE_DRV_GP1_REG_BIT_CT_KILL_EXIT);
675 674
676 priv->thermal_throttle.ct_kill_toggle = false; 675 priv->thermal_throttle.ct_kill_toggle = false;
@@ -949,7 +948,7 @@ void iwl_down(struct iwl_priv *priv)
949 ieee80211_stop_queues(priv->hw); 948 ieee80211_stop_queues(priv->hw);
950 949
951 priv->ucode_loaded = false; 950 priv->ucode_loaded = false;
952 iwl_trans_stop_device(trans(priv)); 951 iwl_trans_stop_device(priv->trans);
953 952
954 /* Clear out all status bits but a few that are stable across reset */ 953 /* Clear out all status bits but a few that are stable across reset */
955 priv->status &= test_bit(STATUS_RF_KILL_HW, &priv->status) << 954 priv->status &= test_bit(STATUS_RF_KILL_HW, &priv->status) <<
@@ -1325,7 +1324,7 @@ static int iwl_init_geos(struct iwl_priv *priv)
1325 priv->hw_params.sku & EEPROM_SKU_CAP_BAND_52GHZ) { 1324 priv->hw_params.sku & EEPROM_SKU_CAP_BAND_52GHZ) {
1326 IWL_INFO(priv, "Incorrectly detected BG card as ABG. " 1325 IWL_INFO(priv, "Incorrectly detected BG card as ABG. "
1327 "Please send your %s to maintainer.\n", 1326 "Please send your %s to maintainer.\n",
1328 trans(priv)->hw_id_str); 1327 priv->trans->hw_id_str);
1329 priv->hw_params.sku &= ~EEPROM_SKU_CAP_BAND_52GHZ; 1328 priv->hw_params.sku &= ~EEPROM_SKU_CAP_BAND_52GHZ;
1330 } 1329 }
1331 1330
@@ -1441,32 +1440,32 @@ void iwl_set_hw_params(struct iwl_priv *priv)
1441 1440
1442void iwl_debug_config(struct iwl_priv *priv) 1441void iwl_debug_config(struct iwl_priv *priv)
1443{ 1442{
1444 dev_printk(KERN_INFO, trans(priv)->dev, "CONFIG_IWLWIFI_DEBUG " 1443 dev_printk(KERN_INFO, priv->trans->dev, "CONFIG_IWLWIFI_DEBUG "
1445#ifdef CONFIG_IWLWIFI_DEBUG 1444#ifdef CONFIG_IWLWIFI_DEBUG
1446 "enabled\n"); 1445 "enabled\n");
1447#else 1446#else
1448 "disabled\n"); 1447 "disabled\n");
1449#endif 1448#endif
1450 dev_printk(KERN_INFO, trans(priv)->dev, "CONFIG_IWLWIFI_DEBUGFS " 1449 dev_printk(KERN_INFO, priv->trans->dev, "CONFIG_IWLWIFI_DEBUGFS "
1451#ifdef CONFIG_IWLWIFI_DEBUGFS 1450#ifdef CONFIG_IWLWIFI_DEBUGFS
1452 "enabled\n"); 1451 "enabled\n");
1453#else 1452#else
1454 "disabled\n"); 1453 "disabled\n");
1455#endif 1454#endif
1456 dev_printk(KERN_INFO, trans(priv)->dev, "CONFIG_IWLWIFI_DEVICE_TRACING " 1455 dev_printk(KERN_INFO, priv->trans->dev, "CONFIG_IWLWIFI_DEVICE_TRACING "
1457#ifdef CONFIG_IWLWIFI_DEVICE_TRACING 1456#ifdef CONFIG_IWLWIFI_DEVICE_TRACING
1458 "enabled\n"); 1457 "enabled\n");
1459#else 1458#else
1460 "disabled\n"); 1459 "disabled\n");
1461#endif 1460#endif
1462 1461
1463 dev_printk(KERN_INFO, trans(priv)->dev, "CONFIG_IWLWIFI_DEVICE_TESTMODE " 1462 dev_printk(KERN_INFO, priv->trans->dev, "CONFIG_IWLWIFI_DEVICE_TESTMODE "
1464#ifdef CONFIG_IWLWIFI_DEVICE_TESTMODE 1463#ifdef CONFIG_IWLWIFI_DEVICE_TESTMODE
1465 "enabled\n"); 1464 "enabled\n");
1466#else 1465#else
1467 "disabled\n"); 1466 "disabled\n");
1468#endif 1467#endif
1469 dev_printk(KERN_INFO, trans(priv)->dev, "CONFIG_IWLWIFI_P2P " 1468 dev_printk(KERN_INFO, priv->trans->dev, "CONFIG_IWLWIFI_P2P "
1470#ifdef CONFIG_IWLWIFI_P2P 1469#ifdef CONFIG_IWLWIFI_P2P
1471 "enabled\n"); 1470 "enabled\n");
1472#else 1471#else
@@ -1509,6 +1508,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
1509 op_mode->ops = &iwl_dvm_ops; 1508 op_mode->ops = &iwl_dvm_ops;
1510 priv = IWL_OP_MODE_GET_DVM(op_mode); 1509 priv = IWL_OP_MODE_GET_DVM(op_mode);
1511 priv->shrd = trans->shrd; 1510 priv->shrd = trans->shrd;
1511 priv->trans = trans;
1512 priv->fw = fw; 1512 priv->fw = fw;
1513 1513
1514 switch (cfg(priv)->device_family) { 1514 switch (cfg(priv)->device_family) {
@@ -1587,11 +1587,11 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
1587 } 1587 }
1588 1588
1589 /* Configure transport layer */ 1589 /* Configure transport layer */
1590 iwl_trans_configure(trans(priv), &trans_cfg); 1590 iwl_trans_configure(priv->trans, &trans_cfg);
1591 1591
1592 /* At this point both hw and priv are allocated. */ 1592 /* At this point both hw and priv are allocated. */
1593 1593
1594 SET_IEEE80211_DEV(priv->hw, trans(priv)->dev); 1594 SET_IEEE80211_DEV(priv->hw, priv->trans->dev);
1595 1595
1596 /* show what debugging capabilities we have */ 1596 /* show what debugging capabilities we have */
1597 iwl_debug_config(priv); 1597 iwl_debug_config(priv);
@@ -1615,25 +1615,25 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
1615 /* these spin locks will be used in apm_ops.init and EEPROM access 1615 /* these spin locks will be used in apm_ops.init and EEPROM access
1616 * we should init now 1616 * we should init now
1617 */ 1617 */
1618 spin_lock_init(&trans(priv)->reg_lock); 1618 spin_lock_init(&priv->trans->reg_lock);
1619 spin_lock_init(&priv->statistics.lock); 1619 spin_lock_init(&priv->statistics.lock);
1620 1620
1621 /*********************** 1621 /***********************
1622 * 2. Read REV register 1622 * 2. Read REV register
1623 ***********************/ 1623 ***********************/
1624 IWL_INFO(priv, "Detected %s, REV=0x%X\n", 1624 IWL_INFO(priv, "Detected %s, REV=0x%X\n",
1625 cfg(priv)->name, trans(priv)->hw_rev); 1625 cfg(priv)->name, priv->trans->hw_rev);
1626 1626
1627 if (iwl_trans_start_hw(trans(priv))) 1627 if (iwl_trans_start_hw(priv->trans))
1628 goto out_free_traffic_mem; 1628 goto out_free_traffic_mem;
1629 1629
1630 /* Read the EEPROM */ 1630 /* Read the EEPROM */
1631 if (iwl_eeprom_init(priv, trans(priv)->hw_rev)) { 1631 if (iwl_eeprom_init(priv, priv->trans->hw_rev)) {
1632 IWL_ERR(priv, "Unable to init EEPROM\n"); 1632 IWL_ERR(priv, "Unable to init EEPROM\n");
1633 goto out_free_traffic_mem; 1633 goto out_free_traffic_mem;
1634 } 1634 }
1635 /* Reset chip to save power until we load uCode during "up". */ 1635 /* Reset chip to save power until we load uCode during "up". */
1636 iwl_trans_stop_hw(trans(priv)); 1636 iwl_trans_stop_hw(priv->trans);
1637 1637
1638 if (iwl_eeprom_check_version(priv)) 1638 if (iwl_eeprom_check_version(priv))
1639 goto out_free_eeprom; 1639 goto out_free_eeprom;
@@ -1676,7 +1676,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
1676 n_q_to_ac = ARRAY_SIZE(iwlagn_bss_queue_to_ac); 1676 n_q_to_ac = ARRAY_SIZE(iwlagn_bss_queue_to_ac);
1677 1677
1678 /* Configure transport layer again*/ 1678 /* Configure transport layer again*/
1679 iwl_trans_configure(trans(priv), &trans_cfg); 1679 iwl_trans_configure(priv->trans, &trans_cfg);
1680 } 1680 }
1681 1681
1682 /******************* 1682 /*******************
@@ -1768,7 +1768,7 @@ void iwl_op_mode_dvm_stop(struct iwl_op_mode *op_mode)
1768 1768
1769 /*This will stop the queues, move the device to low power state */ 1769 /*This will stop the queues, move the device to low power state */
1770 priv->ucode_loaded = false; 1770 priv->ucode_loaded = false;
1771 iwl_trans_stop_device(trans(priv)); 1771 iwl_trans_stop_device(priv->trans);
1772 1772
1773 iwl_eeprom_free(priv); 1773 iwl_eeprom_free(priv);
1774 1774
@@ -1860,7 +1860,7 @@ static const char *desc_lookup(u32 num)
1860 1860
1861static void iwl_dump_nic_error_log(struct iwl_priv *priv) 1861static void iwl_dump_nic_error_log(struct iwl_priv *priv)
1862{ 1862{
1863 struct iwl_trans *trans = trans(priv); 1863 struct iwl_trans *trans = priv->trans;
1864 u32 base; 1864 u32 base;
1865 struct iwl_error_event_table table; 1865 struct iwl_error_event_table table;
1866 1866
@@ -1950,7 +1950,7 @@ static int iwl_print_event_log(struct iwl_priv *priv, u32 start_idx,
1950 u32 ev, time, data; /* event log data */ 1950 u32 ev, time, data; /* event log data */
1951 unsigned long reg_flags; 1951 unsigned long reg_flags;
1952 1952
1953 struct iwl_trans *trans = trans(priv); 1953 struct iwl_trans *trans = priv->trans;
1954 1954
1955 if (num_events == 0) 1955 if (num_events == 0)
1956 return pos; 1956 return pos;
@@ -2068,7 +2068,7 @@ int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log,
2068 u32 logsize; 2068 u32 logsize;
2069 int pos = 0; 2069 int pos = 0;
2070 size_t bufsz = 0; 2070 size_t bufsz = 0;
2071 struct iwl_trans *trans = trans(priv); 2071 struct iwl_trans *trans = priv->trans;
2072 2072
2073 base = priv->device_pointers.log_event_table; 2073 base = priv->device_pointers.log_event_table;
2074 if (priv->cur_ucode == IWL_UCODE_INIT) { 2074 if (priv->cur_ucode == IWL_UCODE_INIT) {
@@ -2184,7 +2184,7 @@ static void iwlagn_fw_error(struct iwl_priv *priv, bool ondemand)
2184 * commands by clearing the ready bit */ 2184 * commands by clearing the ready bit */
2185 clear_bit(STATUS_READY, &priv->status); 2185 clear_bit(STATUS_READY, &priv->status);
2186 2186
2187 wake_up(&trans(priv)->wait_command_queue); 2187 wake_up(&priv->trans->wait_command_queue);
2188 2188
2189 if (!ondemand) { 2189 if (!ondemand) {
2190 /* 2190 /*