aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-helpers.h
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-01-14 20:46:20 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:09:58 -0500
commit98c92211462bb78fe0e869b43e1662e549e35fed (patch)
tree0cfed83c186d801cb06e9d3aac4c7a3014e302f8 /drivers/net/wireless/iwlwifi/iwl-helpers.h
parente655b9f03f41c7a84fb74d6619abf844d7f2ab65 (diff)
iwlwifi: move uCode helper functions to iwl-helpers.h
This patch adds iwl_free_fw_desc ucode helper function. It also moves ucode helper functions to iwl-helpers.h. 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/net/wireless/iwlwifi/iwl-helpers.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-helpers.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-helpers.h b/drivers/net/wireless/iwlwifi/iwl-helpers.h
index 5228834758b1..cd2eb1848310 100644
--- a/drivers/net/wireless/iwlwifi/iwl-helpers.h
+++ b/drivers/net/wireless/iwlwifi/iwl-helpers.h
@@ -257,4 +257,22 @@ static inline u8 iwl_get_dma_hi_address(dma_addr_t addr)
257 return sizeof(addr) > sizeof(u32) ? (addr >> 16) >> 16 : 0; 257 return sizeof(addr) > sizeof(u32) ? (addr >> 16) >> 16 : 0;
258} 258}
259 259
260/* TODO: Move fw_desc functions to iwl-pci.ko */
261static inline void iwl_free_fw_desc(struct pci_dev *pci_dev,
262 struct fw_desc *desc)
263{
264 if (desc->v_addr)
265 pci_free_consistent(pci_dev, desc->len,
266 desc->v_addr, desc->p_addr);
267 desc->v_addr = NULL;
268 desc->len = 0;
269}
270
271static inline int iwl_alloc_fw_desc(struct pci_dev *pci_dev,
272 struct fw_desc *desc)
273{
274 desc->v_addr = pci_alloc_consistent(pci_dev, desc->len, &desc->p_addr);
275 return (desc->v_addr != NULL) ? 0 : -ENOMEM;
276}
277
260#endif /* __iwl_helpers_h__ */ 278#endif /* __iwl_helpers_h__ */