diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-03-05 11:24:39 -0800 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-03-06 15:16:12 -0500 |
commit | 48a2d66f58d2bf1818acf5ff7ed9897a9977a96e (patch) | |
tree | 9154cf363233d28c97b584df19052e0f8e5ab577 /drivers/net/wireless/iwlwifi/iwl-shared.h | |
parent | 65b94a4abfd55b3304be25ffed9832455d41e1dd (diff) |
iwlwifi: don't pass iwl_rx_mem_buffer to upper layers
struct iwl_rx_mem_buffer implementation details
(DMA address, list pointers) that the upper
layers don't need. Introduce iwl_rx_cmd_buffer
that is passed upstream and only contains the
needed data (the page). Additionally, access
this data only via accessor functions, allowing
us to change the implementation in the future.
These accessors are rxb_addr() (as before) and
rxb_steal_page() to take ownership of the data.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-shared.h')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-shared.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-shared.h b/drivers/net/wireless/iwlwifi/iwl-shared.h index 53244d88f1a..ed1811d4355 100644 --- a/drivers/net/wireless/iwlwifi/iwl-shared.h +++ b/drivers/net/wireless/iwlwifi/iwl-shared.h @@ -433,13 +433,21 @@ static inline int iwl_queue_dec_wrap(int index, int n_bd) return --index & (n_bd - 1); } -struct iwl_rx_mem_buffer { - dma_addr_t page_dma; - struct page *page; - struct list_head list; +struct iwl_rx_cmd_buffer { + struct page *_page; }; -#define rxb_addr(r) page_address(r->page) +static inline void *rxb_addr(struct iwl_rx_cmd_buffer *r) +{ + return page_address(r->_page); +} + +static inline struct page *rxb_steal_page(struct iwl_rx_cmd_buffer *r) +{ + struct page *p = r->_page; + r->_page = NULL; + return p; +} /* * mac80211 queues, ACs, hardware queues, FIFOs. |