summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/iwlwifi/iwl-helpers.h
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-01-14 17:46:20 -0800
committerDavid S. Miller <davem@davemloft.net>2008-01-28 15:09:58 -0800
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)
return sizeof(addr) > sizeof(u32) ? (addr >> 16) >> 16 : 0;
}
+/* TODO: Move fw_desc functions to iwl-pci.ko */
+static inline void iwl_free_fw_desc(struct pci_dev *pci_dev,
+ struct fw_desc *desc)
+{
+ if (desc->v_addr)
+ pci_free_consistent(pci_dev, desc->len,
+ desc->v_addr, desc->p_addr);
+ desc->v_addr = NULL;
+ desc->len = 0;
+}
+
+static inline int iwl_alloc_fw_desc(struct pci_dev *pci_dev,
+ struct fw_desc *desc)
+{
+ desc->v_addr = pci_alloc_consistent(pci_dev, desc->len, &desc->p_addr);
+ return (desc->v_addr != NULL) ? 0 : -ENOMEM;
+}
+
#endif /* __iwl_helpers_h__ */