aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-helpers.h
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-03-06 20:36:53 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-03-07 16:03:01 -0500
commitc54b679ddcd91604fd0d144cd793a0ddbd0ae03d (patch)
tree3ebbedc13d2a64a1c6491ac29c5c3a18e934bc6b /drivers/net/wireless/iwlwifi/iwl-helpers.h
parent34cf6ff6dd42cbc61fd652f893dcf71eed6052a5 (diff)
iwlwifi: queue functions cleanup
This patch moves 1. iwl_queue_inc_wrap and int iwl_queue_dec_wrap into iwl-helpers.h these two functions are identical to common for both iwl3956 and iwl4965 2. renames x2_queue_used to iwl3945_x2_queue_used 3. exports iwl3945_queue_space out of iwl3964-base.c Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-helpers.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-helpers.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-helpers.h b/drivers/net/wireless/iwlwifi/iwl-helpers.h
index 8993cca81b40..736b88881b03 100644
--- a/drivers/net/wireless/iwlwifi/iwl-helpers.h
+++ b/drivers/net/wireless/iwlwifi/iwl-helpers.h
@@ -254,6 +254,26 @@ static inline u8 iwl_get_dma_hi_address(dma_addr_t addr)
254 return sizeof(addr) > sizeof(u32) ? (addr >> 16) >> 16 : 0; 254 return sizeof(addr) > sizeof(u32) ? (addr >> 16) >> 16 : 0;
255} 255}
256 256
257/**
258 * iwl_queue_inc_wrap - increment queue index, wrap back to beginning
259 * @index -- current index
260 * @n_bd -- total number of entries in queue (must be power of 2)
261 */
262static inline int iwl_queue_inc_wrap(int index, int n_bd)
263{
264 return ++index & (n_bd - 1);
265}
266
267/**
268 * iwl_queue_dec_wrap - decrement queue index, wrap back to end
269 * @index -- current index
270 * @n_bd -- total number of entries in queue (must be power of 2)
271 */
272static inline int iwl_queue_dec_wrap(int index, int n_bd)
273{
274 return --index & (n_bd - 1);
275}
276
257/* TODO: Move fw_desc functions to iwl-pci.ko */ 277/* TODO: Move fw_desc functions to iwl-pci.ko */
258static inline void iwl_free_fw_desc(struct pci_dev *pci_dev, 278static inline void iwl_free_fw_desc(struct pci_dev *pci_dev,
259 struct fw_desc *desc) 279 struct fw_desc *desc)