diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-helpers.h')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-helpers.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-helpers.h b/drivers/net/wireless/iwlwifi/iwl-helpers.h index 8993cca81b40..a443472bea62 100644 --- a/drivers/net/wireless/iwlwifi/iwl-helpers.h +++ b/drivers/net/wireless/iwlwifi/iwl-helpers.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /****************************************************************************** | 1 | /****************************************************************************** |
2 | * | 2 | * |
3 | * Copyright(c) 2003 - 2007 Intel Corporation. All rights reserved. | 3 | * Copyright(c) 2003 - 2008 Intel Corporation. All rights reserved. |
4 | * | 4 | * |
5 | * Portions of this file are derived from the ipw3945 project, as well | 5 | * Portions of this file are derived from the ipw3945 project, as well |
6 | * as portions of the ieee80211 subsystem header files. | 6 | * as portions of the ieee80211 subsystem header files. |
@@ -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 | */ | ||
262 | static 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 | */ | ||
272 | static 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 */ |
258 | static inline void iwl_free_fw_desc(struct pci_dev *pci_dev, | 278 | static inline void iwl_free_fw_desc(struct pci_dev *pci_dev, |
259 | struct fw_desc *desc) | 279 | struct fw_desc *desc) |