iwlwifi: provide RX page order
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Wed, 23 Jan 2013 08:59:29 +0000 (10:59 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 24 Jan 2013 12:36:32 +0000 (13:36 +0100)
When the pages are to be used by front-end, it may need
to know the page order, provide it.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/iwlwifi/iwl-trans.h
drivers/net/wireless/iwlwifi/pcie/rx.c

index fca5fec4ea6d9404b41b6d843cd946b00e43900a..ce878b9dda8cc7d317566b7c122909b52085bf6f 100644 (file)
@@ -274,6 +274,7 @@ struct iwl_rx_cmd_buffer {
        struct page *_page;
        int _offset;
        bool _page_stolen;
+       u32 _rx_page_order;
        unsigned int truesize;
 };
 
@@ -294,6 +295,11 @@ static inline struct page *rxb_steal_page(struct iwl_rx_cmd_buffer *r)
        return r->_page;
 }
 
+static inline void iwl_free_rxb(struct iwl_rx_cmd_buffer *r)
+{
+       __free_pages(r->_page, r->_rx_page_order);
+}
+
 #define MAX_NO_RECLAIM_CMDS    6
 
 #define IWL_MASK(lo, hi) ((1 << (hi)) | ((1 << (hi)) - (1 << (lo))))
index b694d13fa3082cf36be3a5a1d639f224361f6ae6..a2f3517799418fb8707c800823303fac7496c155 100644 (file)
@@ -594,6 +594,7 @@ static void iwl_pcie_rx_handle_rb(struct iwl_trans *trans,
                int index, cmd_index, err, len;
                struct iwl_rx_cmd_buffer rxcb = {
                        ._offset = offset,
+                       ._rx_page_order = trans_pcie->rx_page_order,
                        ._page = rxb->page,
                        ._page_stolen = false,
                        .truesize = max_len,