diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2012-12-05 08:07:54 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-01-03 09:24:37 -0500 |
commit | 046db346386661906dffa33f5ed3dfcdccfddc0b (patch) | |
tree | 8e1b469dfc599e8d0618ca7382cff34bb8f7b812 | |
parent | a49f0d1ea3ec94fc7cf33a7c36a16343b74bd565 (diff) |
iwlwifi: make the BC table layout configurable
This is needed for newer NICs.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/pcie/internal.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/pcie/trans.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/pcie/tx.c | 5 |
4 files changed, 10 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h index b76532e238c1..15b4700d2a2f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans.h | |||
@@ -321,6 +321,8 @@ static inline struct page *rxb_steal_page(struct iwl_rx_cmd_buffer *r) | |||
321 | * @n_no_reclaim_cmds: # of commands in list | 321 | * @n_no_reclaim_cmds: # of commands in list |
322 | * @rx_buf_size_8k: 8 kB RX buffer size needed for A-MSDUs, | 322 | * @rx_buf_size_8k: 8 kB RX buffer size needed for A-MSDUs, |
323 | * if unset 4k will be the RX buffer size | 323 | * if unset 4k will be the RX buffer size |
324 | * @bc_table_dword: set to true if the BC table expects the byte count to be | ||
325 | * in DWORD (as opposed to bytes) | ||
324 | * @queue_watchdog_timeout: time (in ms) after which queues | 326 | * @queue_watchdog_timeout: time (in ms) after which queues |
325 | * are considered stuck and will trigger device restart | 327 | * are considered stuck and will trigger device restart |
326 | * @command_names: array of command names, must be 256 entries | 328 | * @command_names: array of command names, must be 256 entries |
@@ -335,6 +337,7 @@ struct iwl_trans_config { | |||
335 | int n_no_reclaim_cmds; | 337 | int n_no_reclaim_cmds; |
336 | 338 | ||
337 | bool rx_buf_size_8k; | 339 | bool rx_buf_size_8k; |
340 | bool bc_table_dword; | ||
338 | unsigned int queue_watchdog_timeout; | 341 | unsigned int queue_watchdog_timeout; |
339 | const char **command_names; | 342 | const char **command_names; |
340 | }; | 343 | }; |
diff --git a/drivers/net/wireless/iwlwifi/pcie/internal.h b/drivers/net/wireless/iwlwifi/pcie/internal.h index d91d2e8c62f5..15f79754b67b 100644 --- a/drivers/net/wireless/iwlwifi/pcie/internal.h +++ b/drivers/net/wireless/iwlwifi/pcie/internal.h | |||
@@ -234,6 +234,7 @@ struct iwl_txq { | |||
234 | * @status - transport specific status flags | 234 | * @status - transport specific status flags |
235 | * @cmd_queue - command queue number | 235 | * @cmd_queue - command queue number |
236 | * @rx_buf_size_8k: 8 kB RX buffer size | 236 | * @rx_buf_size_8k: 8 kB RX buffer size |
237 | * @bc_table_dword: true if the BC table expects DWORD (as opposed to bytes) | ||
237 | * @rx_page_order: page order for receive buffer size | 238 | * @rx_page_order: page order for receive buffer size |
238 | * @wd_timeout: queue watchdog timeout (jiffies) | 239 | * @wd_timeout: queue watchdog timeout (jiffies) |
239 | */ | 240 | */ |
@@ -279,6 +280,7 @@ struct iwl_trans_pcie { | |||
279 | u8 no_reclaim_cmds[MAX_NO_RECLAIM_CMDS]; | 280 | u8 no_reclaim_cmds[MAX_NO_RECLAIM_CMDS]; |
280 | 281 | ||
281 | bool rx_buf_size_8k; | 282 | bool rx_buf_size_8k; |
283 | bool bc_table_dword; | ||
282 | u32 rx_page_order; | 284 | u32 rx_page_order; |
283 | 285 | ||
284 | const char **command_names; | 286 | const char **command_names; |
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c index 35708b959ad6..ab179ce36de5 100644 --- a/drivers/net/wireless/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/iwlwifi/pcie/trans.c | |||
@@ -703,6 +703,7 @@ static void iwl_trans_pcie_configure(struct iwl_trans *trans, | |||
703 | msecs_to_jiffies(trans_cfg->queue_watchdog_timeout); | 703 | msecs_to_jiffies(trans_cfg->queue_watchdog_timeout); |
704 | 704 | ||
705 | trans_pcie->command_names = trans_cfg->command_names; | 705 | trans_pcie->command_names = trans_cfg->command_names; |
706 | trans_pcie->bc_table_dword = trans_cfg->bc_table_dword; | ||
706 | } | 707 | } |
707 | 708 | ||
708 | void iwl_trans_pcie_free(struct iwl_trans *trans) | 709 | void iwl_trans_pcie_free(struct iwl_trans *trans) |
diff --git a/drivers/net/wireless/iwlwifi/pcie/tx.c b/drivers/net/wireless/iwlwifi/pcie/tx.c index 6c5b867c353a..7af8f0b55d2d 100644 --- a/drivers/net/wireless/iwlwifi/pcie/tx.c +++ b/drivers/net/wireless/iwlwifi/pcie/tx.c | |||
@@ -237,7 +237,10 @@ static void iwl_pcie_txq_update_byte_cnt_tbl(struct iwl_trans *trans, | |||
237 | break; | 237 | break; |
238 | } | 238 | } |
239 | 239 | ||
240 | bc_ent = cpu_to_le16((len & 0xFFF) | (sta_id << 12)); | 240 | if (trans_pcie->bc_table_dword) |
241 | len = DIV_ROUND_UP(len, 4); | ||
242 | |||
243 | bc_ent = cpu_to_le16(len | (sta_id << 12)); | ||
241 | 244 | ||
242 | scd_bc_tbl[txq_id].tfd_offset[write_ptr] = bc_ent; | 245 | scd_bc_tbl[txq_id].tfd_offset[write_ptr] = bc_ent; |
243 | 246 | ||