aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-trans.h
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2012-06-21 04:53:44 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-06-25 03:37:58 -0400
commitb04db9ac4f7641332e0133b2fd8f82e6e4553947 (patch)
tree4d4b0fc6009f865fa3866c9062d2ae76e8e13ada /drivers/net/wireless/iwlwifi/iwl-trans.h
parente75dac921d88ac1fa1ad08686ab242556f8b888b (diff)
iwlwifi: configure the queues from the op_mode
Since the op_mode defines the queue mapping, let it do it completely through the API functions. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-trans.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans.h27
1 files changed, 17 insertions, 10 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h
index 00efde8e5536..867d8e194da4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/iwlwifi/iwl-trans.h
@@ -290,16 +290,17 @@ static inline struct page *rxb_steal_page(struct iwl_rx_cmd_buffer *r)
290 * currently supports 290 * currently supports
291 */ 291 */
292#define IWL_MAX_HW_QUEUES 32 292#define IWL_MAX_HW_QUEUES 32
293#define IWL_INVALID_STATION 255
294#define IWL_MAX_TID_COUNT 8
295#define IWL_FRAME_LIMIT 64
293 296
294/** 297/**
295 * struct iwl_trans_config - transport configuration 298 * struct iwl_trans_config - transport configuration
296 * 299 *
297 * @op_mode: pointer to the upper layer. 300 * @op_mode: pointer to the upper layer.
298 * @queue_to_fifo: queue to FIFO mapping to set up by
299 * default
300 * @n_queue_to_fifo: number of queues to set up
301 * @cmd_queue: the index of the command queue. 301 * @cmd_queue: the index of the command queue.
302 * Must be set before start_fw. 302 * Must be set before start_fw.
303 * @cmd_fifo: the fifo for host commands
303 * @no_reclaim_cmds: Some devices erroneously don't set the 304 * @no_reclaim_cmds: Some devices erroneously don't set the
304 * SEQ_RX_FRAME bit on some notifications, this is the 305 * SEQ_RX_FRAME bit on some notifications, this is the
305 * list of such notifications to filter. Max length is 306 * list of such notifications to filter. Max length is
@@ -314,10 +315,9 @@ static inline struct page *rxb_steal_page(struct iwl_rx_cmd_buffer *r)
314 */ 315 */
315struct iwl_trans_config { 316struct iwl_trans_config {
316 struct iwl_op_mode *op_mode; 317 struct iwl_op_mode *op_mode;
317 const u8 *queue_to_fifo;
318 u8 n_queue_to_fifo;
319 318
320 u8 cmd_queue; 319 u8 cmd_queue;
320 u8 cmd_fifo;
321 const u8 *no_reclaim_cmds; 321 const u8 *no_reclaim_cmds;
322 int n_no_reclaim_cmds; 322 int n_no_reclaim_cmds;
323 323
@@ -355,9 +355,9 @@ struct iwl_trans;
355 * Must be atomic 355 * Must be atomic
356 * @reclaim: free packet until ssn. Returns a list of freed packets. 356 * @reclaim: free packet until ssn. Returns a list of freed packets.
357 * Must be atomic 357 * Must be atomic
358 * @txq_enable: setup a tx queue for AMPDU - will be called once the HW is 358 * @txq_enable: setup a queue. To setup an AC queue, use the
359 * ready and a successful ADDBA response has been received. 359 * iwl_trans_ac_txq_enable wrapper. fw_alive must have been called before
360 * May sleep 360 * this one. The op_mode must not configure the HCMD queue. May sleep.
361 * @txq_disable: de-configure a Tx queue to send AMPDUs 361 * @txq_disable: de-configure a Tx queue to send AMPDUs
362 * Must be atomic 362 * Must be atomic
363 * @wait_tx_queue_empty: wait until all tx queues are empty 363 * @wait_tx_queue_empty: wait until all tx queues are empty
@@ -497,9 +497,9 @@ static inline void iwl_trans_fw_alive(struct iwl_trans *trans)
497{ 497{
498 might_sleep(); 498 might_sleep();
499 499
500 trans->ops->fw_alive(trans);
501
502 trans->state = IWL_TRANS_FW_ALIVE; 500 trans->state = IWL_TRANS_FW_ALIVE;
501
502 trans->ops->fw_alive(trans);
503} 503}
504 504
505static inline int iwl_trans_start_fw(struct iwl_trans *trans, 505static inline int iwl_trans_start_fw(struct iwl_trans *trans,
@@ -593,6 +593,13 @@ static inline void iwl_trans_txq_enable(struct iwl_trans *trans, int queue,
593 frame_limit, ssn); 593 frame_limit, ssn);
594} 594}
595 595
596static inline void iwl_trans_ac_txq_enable(struct iwl_trans *trans, int queue,
597 int fifo)
598{
599 iwl_trans_txq_enable(trans, queue, fifo, IWL_INVALID_STATION,
600 IWL_MAX_TID_COUNT, IWL_FRAME_LIMIT, 0);
601}
602
596static inline int iwl_trans_wait_tx_queue_empty(struct iwl_trans *trans) 603static inline int iwl_trans_wait_tx_queue_empty(struct iwl_trans *trans)
597{ 604{
598 WARN_ONCE(trans->state != IWL_TRANS_FW_ALIVE, 605 WARN_ONCE(trans->state != IWL_TRANS_FW_ALIVE,