63 #ifndef __iwl_trans_h__
64 #define __iwl_trans_h__
116 #define SEQ_TO_SN(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4)
117 #define SN_TO_SEQ(ssn) (((ssn) << 4) & IEEE80211_SCTL_SEQ)
118 #define MAX_SN ((IEEE80211_SCTL_SEQ) >> 4)
119 #define SEQ_TO_QUEUE(s) (((s) >> 8) & 0x1f)
120 #define QUEUE_TO_SEQ(q) (((q) & 0x1f) << 8)
121 #define SEQ_TO_INDEX(s) ((s) & 0xff)
122 #define INDEX_TO_SEQ(i) ((i) & 0xff)
123 #define SEQ_RX_FRAME cpu_to_le16(0x8000)
158 #define IWL_CMD_FAILED_MSK 0x40
161 #define FH_RSCSR_FRAME_SIZE_MSK 0x00003FFF
162 #define FH_RSCSR_FRAME_INVALID 0x55550000
163 #define FH_RSCSR_FRAME_ALIGN 0x40
203 #define DEF_CMD_PAYLOAD_SIZE 320
217 #define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl_device_cmd))
219 #define IWL_MAX_CMD_TFDS 2
290 #define MAX_NO_RECLAIM_CMDS 6
292 #define IWL_MASK(lo, hi) ((1 << (hi)) | ((1 << (hi)) - (1 << (lo))))
298 #define IWL_MAX_HW_QUEUES 32
299 #define IWL_INVALID_STATION 255
300 #define IWL_MAX_TID_COUNT 8
301 #define IWL_FRAME_LIMIT 64
401 int sta_id,
int tid,
int frame_limit,
u16 ssn);
406 #ifdef CONFIG_PM_SLEEP
473 char trans_specific[0]
__aligned(
sizeof(
void *));
485 trans->
ops->configure(trans, trans_cfg);
488 static inline int iwl_trans_start_hw(
struct iwl_trans *trans)
492 return trans->
ops->start_hw(trans);
495 static inline void iwl_trans_stop_hw(
struct iwl_trans *trans,
496 bool op_mode_leaving)
500 trans->
ops->stop_hw(trans, op_mode_leaving);
505 static inline void iwl_trans_fw_alive(
struct iwl_trans *trans)
511 trans->
ops->fw_alive(trans);
514 static inline int iwl_trans_start_fw(
struct iwl_trans *trans,
519 return trans->
ops->start_fw(trans, fw);
522 static inline void iwl_trans_stop_device(
struct iwl_trans *trans)
526 trans->
ops->stop_device(trans);
531 static inline void iwl_trans_wowlan_suspend(
struct iwl_trans *trans)
534 trans->
ops->wowlan_suspend(trans);
537 static inline int iwl_trans_send_cmd(
struct iwl_trans *trans,
541 "%s bad state = %d", __func__, trans->
state);
543 return trans->
ops->send_cmd(trans, cmd);
547 iwl_trans_alloc_tx_cmd(
struct iwl_trans *trans)
558 static inline void iwl_trans_free_tx_cmd(
struct iwl_trans *trans,
570 "%s bad state = %d", __func__, trans->
state);
572 return trans->
ops->tx(trans, skb, dev_cmd, queue);
575 static inline void iwl_trans_reclaim(
struct iwl_trans *trans,
int queue,
579 "%s bad state = %d", __func__, trans->
state);
581 trans->
ops->reclaim(trans, queue, ssn, skbs);
584 static inline void iwl_trans_txq_disable(
struct iwl_trans *trans,
int queue)
587 "%s bad state = %d", __func__, trans->
state);
589 trans->
ops->txq_disable(trans, queue);
592 static inline void iwl_trans_txq_enable(
struct iwl_trans *trans,
int queue,
593 int fifo,
int sta_id,
int tid,
594 int frame_limit,
u16 ssn)
599 "%s bad state = %d", __func__, trans->
state);
601 trans->
ops->txq_enable(trans, queue, fifo, sta_id, tid,
605 static inline void iwl_trans_ac_txq_enable(
struct iwl_trans *trans,
int queue,
612 static inline int iwl_trans_wait_tx_queue_empty(
struct iwl_trans *trans)
615 "%s bad state = %d", __func__, trans->
state);
617 return trans->
ops->wait_tx_queue_empty(trans);
620 static inline int iwl_trans_dbgfs_register(
struct iwl_trans *trans,
623 return trans->
ops->dbgfs_register(trans, dir);
626 #ifdef CONFIG_PM_SLEEP
627 static inline int iwl_trans_suspend(
struct iwl_trans *trans)
629 return trans->
ops->suspend(trans);
632 static inline int iwl_trans_resume(
struct iwl_trans *trans)
634 return trans->
ops->resume(trans);
640 trans->
ops->write8(trans, ofs, val);
643 static inline void iwl_trans_write32(
struct iwl_trans *trans,
u32 ofs,
u32 val)
645 trans->
ops->write32(trans, ofs, val);
650 return trans->
ops->read32(trans, ofs);
653 static inline void iwl_trans_set_pmi(
struct iwl_trans *trans,
bool state)
655 trans->
ops->set_pmi(trans, state);