]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
iwlwifi: make the BC table layout configurable
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Wed, 5 Dec 2012 13:07:54 +0000 (15:07 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 3 Jan 2013 14:24:37 +0000 (15:24 +0100)
This is needed for newer NICs.

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/internal.h
drivers/net/wireless/iwlwifi/pcie/trans.c
drivers/net/wireless/iwlwifi/pcie/tx.c

index b76532e238c166f9c5095ac1ab5564c1e56a8aa0..15b4700d2a2f3ef89d7a965507d8902faab2aa81 100644 (file)
@@ -321,6 +321,8 @@ static inline struct page *rxb_steal_page(struct iwl_rx_cmd_buffer *r)
  * @n_no_reclaim_cmds: # of commands in list
  * @rx_buf_size_8k: 8 kB RX buffer size needed for A-MSDUs,
  *     if unset 4k will be the RX buffer size
+ * @bc_table_dword: set to true if the BC table expects the byte count to be
+ *     in DWORD (as opposed to bytes)
  * @queue_watchdog_timeout: time (in ms) after which queues
  *     are considered stuck and will trigger device restart
  * @command_names: array of command names, must be 256 entries
@@ -335,6 +337,7 @@ struct iwl_trans_config {
        int n_no_reclaim_cmds;
 
        bool rx_buf_size_8k;
+       bool bc_table_dword;
        unsigned int queue_watchdog_timeout;
        const char **command_names;
 };
index d91d2e8c62f53e687a7eb4ae513a36035c495e78..15f79754b67bafd18492bf18a403c26c094e47b8 100644 (file)
@@ -234,6 +234,7 @@ struct iwl_txq {
  * @status - transport specific status flags
  * @cmd_queue - command queue number
  * @rx_buf_size_8k: 8 kB RX buffer size
+ * @bc_table_dword: true if the BC table expects DWORD (as opposed to bytes)
  * @rx_page_order: page order for receive buffer size
  * @wd_timeout: queue watchdog timeout (jiffies)
  */
@@ -279,6 +280,7 @@ struct iwl_trans_pcie {
        u8 no_reclaim_cmds[MAX_NO_RECLAIM_CMDS];
 
        bool rx_buf_size_8k;
+       bool bc_table_dword;
        u32 rx_page_order;
 
        const char **command_names;
index 35708b959ad6e563a38d29f1bd75c51e87c9c2c8..ab179ce36de5c55bbebbbee1be5dcc0913e42910 100644 (file)
@@ -703,6 +703,7 @@ static void iwl_trans_pcie_configure(struct iwl_trans *trans,
                msecs_to_jiffies(trans_cfg->queue_watchdog_timeout);
 
        trans_pcie->command_names = trans_cfg->command_names;
+       trans_pcie->bc_table_dword = trans_cfg->bc_table_dword;
 }
 
 void iwl_trans_pcie_free(struct iwl_trans *trans)
index 6c5b867c353ae83cd79404bece14d83989cba6a8..7af8f0b55d2d826765741c620936b947577f2f6f 100644 (file)
@@ -237,7 +237,10 @@ static void iwl_pcie_txq_update_byte_cnt_tbl(struct iwl_trans *trans,
                break;
        }
 
-       bc_ent = cpu_to_le16((len & 0xFFF) | (sta_id << 12));
+       if (trans_pcie->bc_table_dword)
+               len = DIV_ROUND_UP(len, 4);
+
+       bc_ent = cpu_to_le16(len | (sta_id << 12));
 
        scd_bc_tbl[txq_id].tfd_offset[write_ptr] = bc_ent;