diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2008-01-14 20:46:15 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:09:55 -0500 |
commit | 6a218f6f3b1679c3f12c487131f0be5b2841bfbe (patch) | |
tree | 1955018fa158bb02ce99be2dd3a4335c3d62b0f2 /drivers | |
parent | 440d42c30cb86eb1b6dbc0d84b9b52e2476fa5e3 (diff) |
iwlwifi: move iwl4965_get_dma_hi_address function to iwl-helpers.h
This patch moves iwl4965_get_dma_hi_address function to iwl-headers.h
as iwl_get_dma_hi_address. This function will be used in more chipsets
than only 4965.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-helpers.h | 5 |
2 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index b913c6b921bc..a94578889e17 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -2797,11 +2797,6 @@ int iwl4965_hw_tx_queue_init(struct iwl4965_priv *priv, struct iwl4965_tx_queue | |||
2797 | return 0; | 2797 | return 0; |
2798 | } | 2798 | } |
2799 | 2799 | ||
2800 | static inline u8 iwl4965_get_dma_hi_address(dma_addr_t addr) | ||
2801 | { | ||
2802 | return sizeof(addr) > sizeof(u32) ? (addr >> 16) >> 16 : 0; | ||
2803 | } | ||
2804 | |||
2805 | int iwl4965_hw_txq_attach_buf_to_tfd(struct iwl4965_priv *priv, void *ptr, | 2800 | int iwl4965_hw_txq_attach_buf_to_tfd(struct iwl4965_priv *priv, void *ptr, |
2806 | dma_addr_t addr, u16 len) | 2801 | dma_addr_t addr, u16 len) |
2807 | { | 2802 | { |
@@ -2822,7 +2817,7 @@ int iwl4965_hw_txq_attach_buf_to_tfd(struct iwl4965_priv *priv, void *ptr, | |||
2822 | if (!is_odd) { | 2817 | if (!is_odd) { |
2823 | tfd->pa[index].tb1_addr = cpu_to_le32(addr); | 2818 | tfd->pa[index].tb1_addr = cpu_to_le32(addr); |
2824 | IWL_SET_BITS(tfd->pa[index], tb1_addr_hi, | 2819 | IWL_SET_BITS(tfd->pa[index], tb1_addr_hi, |
2825 | iwl4965_get_dma_hi_address(addr)); | 2820 | iwl_get_dma_hi_address(addr)); |
2826 | IWL_SET_BITS(tfd->pa[index], tb1_len, len); | 2821 | IWL_SET_BITS(tfd->pa[index], tb1_len, len); |
2827 | } else { | 2822 | } else { |
2828 | IWL_SET_BITS(tfd->pa[index], tb2_addr_lo16, | 2823 | IWL_SET_BITS(tfd->pa[index], tb2_addr_lo16, |
@@ -3289,7 +3284,7 @@ int iwl4965_tx_cmd(struct iwl4965_priv *priv, struct iwl4965_cmd *out_cmd, | |||
3289 | scratch_phys = txcmd_phys + sizeof(struct iwl4965_cmd_header) + | 3284 | scratch_phys = txcmd_phys + sizeof(struct iwl4965_cmd_header) + |
3290 | offsetof(struct iwl4965_tx_cmd, scratch); | 3285 | offsetof(struct iwl4965_tx_cmd, scratch); |
3291 | tx->dram_lsb_ptr = cpu_to_le32(scratch_phys); | 3286 | tx->dram_lsb_ptr = cpu_to_le32(scratch_phys); |
3292 | tx->dram_msb_ptr = iwl4965_get_dma_hi_address(scratch_phys); | 3287 | tx->dram_msb_ptr = iwl_get_dma_hi_address(scratch_phys); |
3293 | 3288 | ||
3294 | /* Hard coded to start at the highest retry fallback position | 3289 | /* Hard coded to start at the highest retry fallback position |
3295 | * until the 4965 specific rate control algorithm is tied in */ | 3290 | * until the 4965 specific rate control algorithm is tied in */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-helpers.h b/drivers/net/wireless/iwlwifi/iwl-helpers.h index e2a8d95ad9cd..5228834758b1 100644 --- a/drivers/net/wireless/iwlwifi/iwl-helpers.h +++ b/drivers/net/wireless/iwlwifi/iwl-helpers.h | |||
@@ -252,4 +252,9 @@ static inline unsigned long elapsed_jiffies(unsigned long start, | |||
252 | return end + (MAX_JIFFY_OFFSET - start); | 252 | return end + (MAX_JIFFY_OFFSET - start); |
253 | } | 253 | } |
254 | 254 | ||
255 | static inline u8 iwl_get_dma_hi_address(dma_addr_t addr) | ||
256 | { | ||
257 | return sizeof(addr) > sizeof(u32) ? (addr >> 16) >> 16 : 0; | ||
258 | } | ||
259 | |||
255 | #endif /* __iwl_helpers_h__ */ | 260 | #endif /* __iwl_helpers_h__ */ |