diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2012-01-03 09:56:15 -0500 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2012-02-02 17:35:45 -0500 |
commit | 1042db2af183b96cdce5972014d85e8bca0634ad (patch) | |
tree | a2180c74bd080da8ae6cb9ab9b8d3494ee50e6cc /drivers/net/wireless/iwlwifi/iwl-agn.c | |
parent | 0390549571cb614ac5cd3327b63f95155a75c673 (diff) |
iwlwifi: give trans to all the read / write functions
From now on, the transport layer in charge of providing access to the
device. So change all the driver to give a pointer to the transport
to all the low level functions that actually access the device.
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.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 1a4ba9de99b0..f79791500a9c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -328,14 +328,14 @@ static void iwl_print_cont_event_trace(struct iwl_priv *priv, u32 base, | |||
328 | ptr = base + (4 * sizeof(u32)) + (start_idx * 3 * sizeof(u32)); | 328 | ptr = base + (4 * sizeof(u32)) + (start_idx * 3 * sizeof(u32)); |
329 | 329 | ||
330 | /* Make sure device is powered up for SRAM reads */ | 330 | /* Make sure device is powered up for SRAM reads */ |
331 | spin_lock_irqsave(&bus(priv)->reg_lock, reg_flags); | 331 | spin_lock_irqsave(&trans(priv)->reg_lock, reg_flags); |
332 | if (iwl_grab_nic_access(bus(priv))) { | 332 | if (iwl_grab_nic_access(trans(priv))) { |
333 | spin_unlock_irqrestore(&bus(priv)->reg_lock, reg_flags); | 333 | spin_unlock_irqrestore(&trans(priv)->reg_lock, reg_flags); |
334 | return; | 334 | return; |
335 | } | 335 | } |
336 | 336 | ||
337 | /* Set starting address; reads will auto-increment */ | 337 | /* Set starting address; reads will auto-increment */ |
338 | iwl_write32(bus(priv), HBUS_TARG_MEM_RADDR, ptr); | 338 | iwl_write32(trans(priv), HBUS_TARG_MEM_RADDR, ptr); |
339 | rmb(); | 339 | rmb(); |
340 | 340 | ||
341 | /* | 341 | /* |
@@ -352,19 +352,19 @@ static void iwl_print_cont_event_trace(struct iwl_priv *priv, u32 base, | |||
352 | * place event id # at far right for easier visual parsing. | 352 | * place event id # at far right for easier visual parsing. |
353 | */ | 353 | */ |
354 | for (i = 0; i < num_events; i++) { | 354 | for (i = 0; i < num_events; i++) { |
355 | ev = iwl_read32(bus(priv), HBUS_TARG_MEM_RDAT); | 355 | ev = iwl_read32(trans(priv), HBUS_TARG_MEM_RDAT); |
356 | time = iwl_read32(bus(priv), HBUS_TARG_MEM_RDAT); | 356 | time = iwl_read32(trans(priv), HBUS_TARG_MEM_RDAT); |
357 | if (mode == 0) { | 357 | if (mode == 0) { |
358 | trace_iwlwifi_dev_ucode_cont_event(priv, 0, time, ev); | 358 | trace_iwlwifi_dev_ucode_cont_event(priv, 0, time, ev); |
359 | } else { | 359 | } else { |
360 | data = iwl_read32(bus(priv), HBUS_TARG_MEM_RDAT); | 360 | data = iwl_read32(trans(priv), HBUS_TARG_MEM_RDAT); |
361 | trace_iwlwifi_dev_ucode_cont_event(priv, time, | 361 | trace_iwlwifi_dev_ucode_cont_event(priv, time, |
362 | data, ev); | 362 | data, ev); |
363 | } | 363 | } |
364 | } | 364 | } |
365 | /* Allow device to power down */ | 365 | /* Allow device to power down */ |
366 | iwl_release_nic_access(bus(priv)); | 366 | iwl_release_nic_access(trans(priv)); |
367 | spin_unlock_irqrestore(&bus(priv)->reg_lock, reg_flags); | 367 | spin_unlock_irqrestore(&trans(priv)->reg_lock, reg_flags); |
368 | } | 368 | } |
369 | 369 | ||
370 | static void iwl_continuous_event_trace(struct iwl_priv *priv) | 370 | static void iwl_continuous_event_trace(struct iwl_priv *priv) |
@@ -383,7 +383,7 @@ static void iwl_continuous_event_trace(struct iwl_priv *priv) | |||
383 | 383 | ||
384 | base = priv->shrd->device_pointers.log_event_table; | 384 | base = priv->shrd->device_pointers.log_event_table; |
385 | if (iwlagn_hw_valid_rtc_data_addr(base)) { | 385 | if (iwlagn_hw_valid_rtc_data_addr(base)) { |
386 | iwl_read_targ_mem_words(bus(priv), base, &read, sizeof(read)); | 386 | iwl_read_targ_mem_words(trans(priv), base, &read, sizeof(read)); |
387 | 387 | ||
388 | capacity = read.capacity; | 388 | capacity = read.capacity; |
389 | mode = read.mode; | 389 | mode = read.mode; |
@@ -583,7 +583,7 @@ static int __must_check iwl_request_firmware(struct iwl_priv *priv, bool first) | |||
583 | priv->firmware_name); | 583 | priv->firmware_name); |
584 | 584 | ||
585 | return request_firmware_nowait(THIS_MODULE, 1, priv->firmware_name, | 585 | return request_firmware_nowait(THIS_MODULE, 1, priv->firmware_name, |
586 | bus(priv)->dev, | 586 | trans(priv)->dev, |
587 | GFP_KERNEL, priv, iwl_ucode_callback); | 587 | GFP_KERNEL, priv, iwl_ucode_callback); |
588 | } | 588 | } |
589 | 589 | ||
@@ -1158,7 +1158,7 @@ static void iwl_rf_kill_ct_config(struct iwl_priv *priv) | |||
1158 | int ret = 0; | 1158 | int ret = 0; |
1159 | 1159 | ||
1160 | spin_lock_irqsave(&priv->shrd->lock, flags); | 1160 | spin_lock_irqsave(&priv->shrd->lock, flags); |
1161 | iwl_write32(bus(priv), CSR_UCODE_DRV_GP1_CLR, | 1161 | iwl_write32(trans(priv), CSR_UCODE_DRV_GP1_CLR, |
1162 | CSR_UCODE_DRV_GP1_REG_BIT_CT_KILL_EXIT); | 1162 | CSR_UCODE_DRV_GP1_REG_BIT_CT_KILL_EXIT); |
1163 | spin_unlock_irqrestore(&priv->shrd->lock, flags); | 1163 | spin_unlock_irqrestore(&priv->shrd->lock, flags); |
1164 | priv->thermal_throttle.ct_kill_toggle = false; | 1164 | priv->thermal_throttle.ct_kill_toggle = false; |
@@ -1693,7 +1693,7 @@ static void iwl_uninit_drv(struct iwl_priv *priv) | |||
1693 | 1693 | ||
1694 | static u32 iwl_hw_detect(struct iwl_priv *priv) | 1694 | static u32 iwl_hw_detect(struct iwl_priv *priv) |
1695 | { | 1695 | { |
1696 | return iwl_read32(bus(priv), CSR_HW_REV); | 1696 | return iwl_read32(trans(priv), CSR_HW_REV); |
1697 | } | 1697 | } |
1698 | 1698 | ||
1699 | /* Size of one Rx buffer in host DRAM */ | 1699 | /* Size of one Rx buffer in host DRAM */ |
@@ -1727,32 +1727,32 @@ static int iwl_set_hw_params(struct iwl_priv *priv) | |||
1727 | 1727 | ||
1728 | static void iwl_debug_config(struct iwl_priv *priv) | 1728 | static void iwl_debug_config(struct iwl_priv *priv) |
1729 | { | 1729 | { |
1730 | dev_printk(KERN_INFO, bus(priv)->dev, "CONFIG_IWLWIFI_DEBUG " | 1730 | dev_printk(KERN_INFO, trans(priv)->dev, "CONFIG_IWLWIFI_DEBUG " |
1731 | #ifdef CONFIG_IWLWIFI_DEBUG | 1731 | #ifdef CONFIG_IWLWIFI_DEBUG |
1732 | "enabled\n"); | 1732 | "enabled\n"); |
1733 | #else | 1733 | #else |
1734 | "disabled\n"); | 1734 | "disabled\n"); |
1735 | #endif | 1735 | #endif |
1736 | dev_printk(KERN_INFO, bus(priv)->dev, "CONFIG_IWLWIFI_DEBUGFS " | 1736 | dev_printk(KERN_INFO, trans(priv)->dev, "CONFIG_IWLWIFI_DEBUGFS " |
1737 | #ifdef CONFIG_IWLWIFI_DEBUGFS | 1737 | #ifdef CONFIG_IWLWIFI_DEBUGFS |
1738 | "enabled\n"); | 1738 | "enabled\n"); |
1739 | #else | 1739 | #else |
1740 | "disabled\n"); | 1740 | "disabled\n"); |
1741 | #endif | 1741 | #endif |
1742 | dev_printk(KERN_INFO, bus(priv)->dev, "CONFIG_IWLWIFI_DEVICE_TRACING " | 1742 | dev_printk(KERN_INFO, trans(priv)->dev, "CONFIG_IWLWIFI_DEVICE_TRACING " |
1743 | #ifdef CONFIG_IWLWIFI_DEVICE_TRACING | 1743 | #ifdef CONFIG_IWLWIFI_DEVICE_TRACING |
1744 | "enabled\n"); | 1744 | "enabled\n"); |
1745 | #else | 1745 | #else |
1746 | "disabled\n"); | 1746 | "disabled\n"); |
1747 | #endif | 1747 | #endif |
1748 | 1748 | ||
1749 | dev_printk(KERN_INFO, bus(priv)->dev, "CONFIG_IWLWIFI_DEVICE_TESTMODE " | 1749 | dev_printk(KERN_INFO, trans(priv)->dev, "CONFIG_IWLWIFI_DEVICE_TESTMODE " |
1750 | #ifdef CONFIG_IWLWIFI_DEVICE_TESTMODE | 1750 | #ifdef CONFIG_IWLWIFI_DEVICE_TESTMODE |
1751 | "enabled\n"); | 1751 | "enabled\n"); |
1752 | #else | 1752 | #else |
1753 | "disabled\n"); | 1753 | "disabled\n"); |
1754 | #endif | 1754 | #endif |
1755 | dev_printk(KERN_INFO, bus(priv)->dev, "CONFIG_IWLWIFI_P2P " | 1755 | dev_printk(KERN_INFO, trans(priv)->dev, "CONFIG_IWLWIFI_P2P " |
1756 | #ifdef CONFIG_IWLWIFI_P2P | 1756 | #ifdef CONFIG_IWLWIFI_P2P |
1757 | "enabled\n"); | 1757 | "enabled\n"); |
1758 | #else | 1758 | #else |
@@ -1810,7 +1810,7 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops, | |||
1810 | /* these spin locks will be used in apm_ops.init and EEPROM access | 1810 | /* these spin locks will be used in apm_ops.init and EEPROM access |
1811 | * we should init now | 1811 | * we should init now |
1812 | */ | 1812 | */ |
1813 | spin_lock_init(&bus(priv)->reg_lock); | 1813 | spin_lock_init(&trans(priv)->reg_lock); |
1814 | spin_lock_init(&priv->shrd->lock); | 1814 | spin_lock_init(&priv->shrd->lock); |
1815 | 1815 | ||
1816 | /* | 1816 | /* |
@@ -1818,7 +1818,7 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops, | |||
1818 | * strange state ... like being left stranded by a primary kernel | 1818 | * strange state ... like being left stranded by a primary kernel |
1819 | * and this is now the kdump kernel trying to start up | 1819 | * and this is now the kdump kernel trying to start up |
1820 | */ | 1820 | */ |
1821 | iwl_write32(bus(priv), CSR_RESET, CSR_RESET_REG_FLAG_NEVO_RESET); | 1821 | iwl_write32(trans(priv), CSR_RESET, CSR_RESET_REG_FLAG_NEVO_RESET); |
1822 | 1822 | ||
1823 | /*********************** | 1823 | /*********************** |
1824 | * 3. Read REV register | 1824 | * 3. Read REV register |
@@ -1903,7 +1903,7 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops, | |||
1903 | iwl_enable_rfkill_int(priv); | 1903 | iwl_enable_rfkill_int(priv); |
1904 | 1904 | ||
1905 | /* If platform's RF_KILL switch is NOT set to KILL */ | 1905 | /* If platform's RF_KILL switch is NOT set to KILL */ |
1906 | if (iwl_read32(bus(priv), | 1906 | if (iwl_read32(trans(priv), |
1907 | CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW) | 1907 | CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW) |
1908 | clear_bit(STATUS_RF_KILL_HW, &priv->shrd->status); | 1908 | clear_bit(STATUS_RF_KILL_HW, &priv->shrd->status); |
1909 | else | 1909 | else |