diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/ath9k.h')
| -rw-r--r-- | drivers/net/wireless/ath/ath9k/ath9k.h | 64 |
1 files changed, 26 insertions, 38 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index 0963071e8f90..2c31f5142eda 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
| @@ -57,6 +57,8 @@ struct ath_node; | |||
| 57 | 57 | ||
| 58 | #define A_MAX(a, b) ((a) > (b) ? (a) : (b)) | 58 | #define A_MAX(a, b) ((a) > (b) ? (a) : (b)) |
| 59 | 59 | ||
| 60 | #define ATH9K_PM_QOS_DEFAULT_VALUE 55 | ||
| 61 | |||
| 60 | #define TSF_TO_TU(_h,_l) \ | 62 | #define TSF_TO_TU(_h,_l) \ |
| 61 | ((((u32)(_h)) << 22) | (((u32)(_l)) >> 10)) | 63 | ((((u32)(_h)) << 22) | (((u32)(_l)) >> 10)) |
| 62 | 64 | ||
| @@ -87,33 +89,19 @@ struct ath_config { | |||
| 87 | /** | 89 | /** |
| 88 | * enum buffer_type - Buffer type flags | 90 | * enum buffer_type - Buffer type flags |
| 89 | * | 91 | * |
| 90 | * @BUF_HT: Send this buffer using HT capabilities | ||
| 91 | * @BUF_AMPDU: This buffer is an ampdu, as part of an aggregate (during TX) | 92 | * @BUF_AMPDU: This buffer is an ampdu, as part of an aggregate (during TX) |
| 92 | * @BUF_AGGR: Indicates whether the buffer can be aggregated | 93 | * @BUF_AGGR: Indicates whether the buffer can be aggregated |
| 93 | * (used in aggregation scheduling) | 94 | * (used in aggregation scheduling) |
| 94 | * @BUF_RETRY: Indicates whether the buffer is retried | ||
| 95 | * @BUF_XRETRY: To denote excessive retries of the buffer | 95 | * @BUF_XRETRY: To denote excessive retries of the buffer |
| 96 | */ | 96 | */ |
| 97 | enum buffer_type { | 97 | enum buffer_type { |
| 98 | BUF_HT = BIT(1), | ||
| 99 | BUF_AMPDU = BIT(2), | 98 | BUF_AMPDU = BIT(2), |
| 100 | BUF_AGGR = BIT(3), | 99 | BUF_AGGR = BIT(3), |
| 101 | BUF_RETRY = BIT(4), | ||
| 102 | BUF_XRETRY = BIT(5), | 100 | BUF_XRETRY = BIT(5), |
| 103 | }; | 101 | }; |
| 104 | 102 | ||
| 105 | #define bf_nframes bf_state.bfs_nframes | ||
| 106 | #define bf_al bf_state.bfs_al | ||
| 107 | #define bf_frmlen bf_state.bfs_frmlen | ||
| 108 | #define bf_retries bf_state.bfs_retries | ||
| 109 | #define bf_seqno bf_state.bfs_seqno | ||
| 110 | #define bf_tidno bf_state.bfs_tidno | ||
| 111 | #define bf_keyix bf_state.bfs_keyix | ||
| 112 | #define bf_keytype bf_state.bfs_keytype | ||
| 113 | #define bf_isht(bf) (bf->bf_state.bf_type & BUF_HT) | ||
| 114 | #define bf_isampdu(bf) (bf->bf_state.bf_type & BUF_AMPDU) | 103 | #define bf_isampdu(bf) (bf->bf_state.bf_type & BUF_AMPDU) |
| 115 | #define bf_isaggr(bf) (bf->bf_state.bf_type & BUF_AGGR) | 104 | #define bf_isaggr(bf) (bf->bf_state.bf_type & BUF_AGGR) |
| 116 | #define bf_isretried(bf) (bf->bf_state.bf_type & BUF_RETRY) | ||
| 117 | #define bf_isxretried(bf) (bf->bf_state.bf_type & BUF_XRETRY) | 105 | #define bf_isxretried(bf) (bf->bf_state.bf_type & BUF_XRETRY) |
| 118 | 106 | ||
| 119 | #define ATH_TXSTATUS_RING_SIZE 64 | 107 | #define ATH_TXSTATUS_RING_SIZE 64 |
| @@ -178,8 +166,8 @@ void ath_descdma_cleanup(struct ath_softc *sc, struct ath_descdma *dd, | |||
| 178 | 166 | ||
| 179 | /* returns delimiter padding required given the packet length */ | 167 | /* returns delimiter padding required given the packet length */ |
| 180 | #define ATH_AGGR_GET_NDELIM(_len) \ | 168 | #define ATH_AGGR_GET_NDELIM(_len) \ |
| 181 | (((((_len) + ATH_AGGR_DELIM_SZ) < ATH_AGGR_MINPLEN) ? \ | 169 | (((_len) >= ATH_AGGR_MINPLEN) ? 0 : \ |
| 182 | (ATH_AGGR_MINPLEN - (_len) - ATH_AGGR_DELIM_SZ) : 0) >> 2) | 170 | DIV_ROUND_UP(ATH_AGGR_MINPLEN - (_len), ATH_AGGR_DELIM_SZ)) |
| 183 | 171 | ||
| 184 | #define BAW_WITHIN(_start, _bawsz, _seqno) \ | 172 | #define BAW_WITHIN(_start, _bawsz, _seqno) \ |
| 185 | ((((_seqno) - (_start)) & 4095) < (_bawsz)) | 173 | ((((_seqno) - (_start)) & 4095) < (_bawsz)) |
| @@ -196,12 +184,12 @@ enum ATH_AGGR_STATUS { | |||
| 196 | 184 | ||
| 197 | #define ATH_TXFIFO_DEPTH 8 | 185 | #define ATH_TXFIFO_DEPTH 8 |
| 198 | struct ath_txq { | 186 | struct ath_txq { |
| 199 | int axq_class; | ||
| 200 | u32 axq_qnum; | 187 | u32 axq_qnum; |
| 201 | u32 *axq_link; | 188 | u32 *axq_link; |
| 202 | struct list_head axq_q; | 189 | struct list_head axq_q; |
| 203 | spinlock_t axq_lock; | 190 | spinlock_t axq_lock; |
| 204 | u32 axq_depth; | 191 | u32 axq_depth; |
| 192 | u32 axq_ampdu_depth; | ||
| 205 | bool stopped; | 193 | bool stopped; |
| 206 | bool axq_tx_inprogress; | 194 | bool axq_tx_inprogress; |
| 207 | struct list_head axq_acq; | 195 | struct list_head axq_acq; |
| @@ -209,27 +197,28 @@ struct ath_txq { | |||
| 209 | struct list_head txq_fifo_pending; | 197 | struct list_head txq_fifo_pending; |
| 210 | u8 txq_headidx; | 198 | u8 txq_headidx; |
| 211 | u8 txq_tailidx; | 199 | u8 txq_tailidx; |
| 200 | int pending_frames; | ||
| 212 | }; | 201 | }; |
| 213 | 202 | ||
| 214 | struct ath_atx_ac { | 203 | struct ath_atx_ac { |
| 204 | struct ath_txq *txq; | ||
| 215 | int sched; | 205 | int sched; |
| 216 | int qnum; | ||
| 217 | struct list_head list; | 206 | struct list_head list; |
| 218 | struct list_head tid_q; | 207 | struct list_head tid_q; |
| 219 | }; | 208 | }; |
| 220 | 209 | ||
| 210 | struct ath_frame_info { | ||
| 211 | int framelen; | ||
| 212 | u32 keyix; | ||
| 213 | enum ath9k_key_type keytype; | ||
| 214 | u8 retries; | ||
| 215 | u16 seqno; | ||
| 216 | }; | ||
| 217 | |||
| 221 | struct ath_buf_state { | 218 | struct ath_buf_state { |
| 222 | int bfs_nframes; | ||
| 223 | u16 bfs_al; | ||
| 224 | u16 bfs_frmlen; | ||
| 225 | int bfs_seqno; | ||
| 226 | int bfs_tidno; | ||
| 227 | int bfs_retries; | ||
| 228 | u8 bf_type; | 219 | u8 bf_type; |
| 229 | u8 bfs_paprd; | 220 | u8 bfs_paprd; |
| 230 | unsigned long bfs_paprd_timestamp; | 221 | enum ath9k_internal_frame_type bfs_ftype; |
| 231 | u32 bfs_keyix; | ||
| 232 | enum ath9k_key_type bfs_keytype; | ||
| 233 | }; | 222 | }; |
| 234 | 223 | ||
| 235 | struct ath_buf { | 224 | struct ath_buf { |
| @@ -242,7 +231,6 @@ struct ath_buf { | |||
| 242 | dma_addr_t bf_daddr; /* physical addr of desc */ | 231 | dma_addr_t bf_daddr; /* physical addr of desc */ |
| 243 | dma_addr_t bf_buf_addr; /* physical addr of data buffer, for DMA */ | 232 | dma_addr_t bf_buf_addr; /* physical addr of data buffer, for DMA */ |
| 244 | bool bf_stale; | 233 | bool bf_stale; |
| 245 | bool bf_tx_aborted; | ||
| 246 | u16 bf_flags; | 234 | u16 bf_flags; |
| 247 | struct ath_buf_state bf_state; | 235 | struct ath_buf_state bf_state; |
| 248 | struct ath_wiphy *aphy; | 236 | struct ath_wiphy *aphy; |
| @@ -271,7 +259,6 @@ struct ath_node { | |||
| 271 | struct ath_atx_ac ac[WME_NUM_AC]; | 259 | struct ath_atx_ac ac[WME_NUM_AC]; |
| 272 | u16 maxampdu; | 260 | u16 maxampdu; |
| 273 | u8 mpdudensity; | 261 | u8 mpdudensity; |
| 274 | int last_rssi; | ||
| 275 | }; | 262 | }; |
| 276 | 263 | ||
| 277 | #define AGGR_CLEANUP BIT(1) | 264 | #define AGGR_CLEANUP BIT(1) |
| @@ -280,6 +267,7 @@ struct ath_node { | |||
| 280 | 267 | ||
| 281 | struct ath_tx_control { | 268 | struct ath_tx_control { |
| 282 | struct ath_txq *txq; | 269 | struct ath_txq *txq; |
| 270 | struct ath_node *an; | ||
| 283 | int if_id; | 271 | int if_id; |
| 284 | enum ath9k_internal_frame_type frame_type; | 272 | enum ath9k_internal_frame_type frame_type; |
| 285 | u8 paprd; | 273 | u8 paprd; |
| @@ -292,12 +280,11 @@ struct ath_tx_control { | |||
| 292 | struct ath_tx { | 280 | struct ath_tx { |
| 293 | u16 seq_no; | 281 | u16 seq_no; |
| 294 | u32 txqsetup; | 282 | u32 txqsetup; |
| 295 | int hwq_map[WME_NUM_AC]; | ||
| 296 | spinlock_t txbuflock; | 283 | spinlock_t txbuflock; |
| 297 | struct list_head txbuf; | 284 | struct list_head txbuf; |
| 298 | struct ath_txq txq[ATH9K_NUM_TX_QUEUES]; | 285 | struct ath_txq txq[ATH9K_NUM_TX_QUEUES]; |
| 299 | struct ath_descdma txdma; | 286 | struct ath_descdma txdma; |
| 300 | int pending_frames[WME_NUM_AC]; | 287 | struct ath_txq *txq_map[WME_NUM_AC]; |
| 301 | }; | 288 | }; |
| 302 | 289 | ||
| 303 | struct ath_rx_edma { | 290 | struct ath_rx_edma { |
| @@ -311,7 +298,6 @@ struct ath_rx { | |||
| 311 | u8 rxotherant; | 298 | u8 rxotherant; |
| 312 | u32 *rxlink; | 299 | u32 *rxlink; |
| 313 | unsigned int rxfilter; | 300 | unsigned int rxfilter; |
| 314 | spinlock_t pcu_lock; | ||
| 315 | spinlock_t rxbuflock; | 301 | spinlock_t rxbuflock; |
| 316 | struct list_head rxbuf; | 302 | struct list_head rxbuf; |
| 317 | struct ath_descdma rxdma; | 303 | struct ath_descdma rxdma; |
| @@ -328,7 +314,6 @@ void ath_rx_cleanup(struct ath_softc *sc); | |||
| 328 | int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp); | 314 | int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp); |
| 329 | struct ath_txq *ath_txq_setup(struct ath_softc *sc, int qtype, int subtype); | 315 | struct ath_txq *ath_txq_setup(struct ath_softc *sc, int qtype, int subtype); |
| 330 | void ath_tx_cleanupq(struct ath_softc *sc, struct ath_txq *txq); | 316 | void ath_tx_cleanupq(struct ath_softc *sc, struct ath_txq *txq); |
| 331 | int ath_tx_setup(struct ath_softc *sc, int haltype); | ||
| 332 | bool ath_drain_all_txq(struct ath_softc *sc, bool retry_tx); | 317 | bool ath_drain_all_txq(struct ath_softc *sc, bool retry_tx); |
| 333 | void ath_draintxq(struct ath_softc *sc, | 318 | void ath_draintxq(struct ath_softc *sc, |
| 334 | struct ath_txq *txq, bool retry_tx); | 319 | struct ath_txq *txq, bool retry_tx); |
| @@ -343,7 +328,6 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
| 343 | struct ath_tx_control *txctl); | 328 | struct ath_tx_control *txctl); |
| 344 | void ath_tx_tasklet(struct ath_softc *sc); | 329 | void ath_tx_tasklet(struct ath_softc *sc); |
| 345 | void ath_tx_edma_tasklet(struct ath_softc *sc); | 330 | void ath_tx_edma_tasklet(struct ath_softc *sc); |
| 346 | void ath_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb); | ||
| 347 | int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta, | 331 | int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta, |
| 348 | u16 tid, u16 *ssn); | 332 | u16 tid, u16 *ssn); |
| 349 | void ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid); | 333 | void ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid); |
| @@ -564,6 +548,7 @@ struct ath_ant_comb { | |||
| 564 | #define SC_OP_BT_PRIORITY_DETECTED BIT(12) | 548 | #define SC_OP_BT_PRIORITY_DETECTED BIT(12) |
| 565 | #define SC_OP_BT_SCAN BIT(13) | 549 | #define SC_OP_BT_SCAN BIT(13) |
| 566 | #define SC_OP_ANI_RUN BIT(14) | 550 | #define SC_OP_ANI_RUN BIT(14) |
| 551 | #define SC_OP_ENABLE_APM BIT(15) | ||
| 567 | 552 | ||
| 568 | /* Powersave flags */ | 553 | /* Powersave flags */ |
| 569 | #define PS_WAIT_FOR_BEACON BIT(0) | 554 | #define PS_WAIT_FOR_BEACON BIT(0) |
| @@ -601,13 +586,14 @@ struct ath_softc { | |||
| 601 | struct ath_hw *sc_ah; | 586 | struct ath_hw *sc_ah; |
| 602 | void __iomem *mem; | 587 | void __iomem *mem; |
| 603 | int irq; | 588 | int irq; |
| 604 | spinlock_t sc_resetlock; | ||
| 605 | spinlock_t sc_serial_rw; | 589 | spinlock_t sc_serial_rw; |
| 606 | spinlock_t sc_pm_lock; | 590 | spinlock_t sc_pm_lock; |
| 591 | spinlock_t sc_pcu_lock; | ||
| 607 | struct mutex mutex; | 592 | struct mutex mutex; |
| 608 | struct work_struct paprd_work; | 593 | struct work_struct paprd_work; |
| 609 | struct work_struct hw_check_work; | 594 | struct work_struct hw_check_work; |
| 610 | struct completion paprd_complete; | 595 | struct completion paprd_complete; |
| 596 | bool paprd_pending; | ||
| 611 | 597 | ||
| 612 | u32 intrstatus; | 598 | u32 intrstatus; |
| 613 | u32 sc_flags; /* SC_OP_* */ | 599 | u32 sc_flags; /* SC_OP_* */ |
| @@ -665,11 +651,11 @@ struct ath_wiphy { | |||
| 665 | bool idle; | 651 | bool idle; |
| 666 | int chan_idx; | 652 | int chan_idx; |
| 667 | int chan_is_ht; | 653 | int chan_is_ht; |
| 654 | int last_rssi; | ||
| 668 | }; | 655 | }; |
| 669 | 656 | ||
| 670 | void ath9k_tasklet(unsigned long data); | 657 | void ath9k_tasklet(unsigned long data); |
| 671 | int ath_reset(struct ath_softc *sc, bool retry_tx); | 658 | int ath_reset(struct ath_softc *sc, bool retry_tx); |
| 672 | int ath_get_mac80211_qnum(u32 queue, struct ath_softc *sc); | ||
| 673 | int ath_cabq_update(struct ath_softc *); | 659 | int ath_cabq_update(struct ath_softc *); |
| 674 | 660 | ||
| 675 | static inline void ath_read_cachesize(struct ath_common *common, int *csz) | 661 | static inline void ath_read_cachesize(struct ath_common *common, int *csz) |
| @@ -680,6 +666,7 @@ static inline void ath_read_cachesize(struct ath_common *common, int *csz) | |||
| 680 | extern struct ieee80211_ops ath9k_ops; | 666 | extern struct ieee80211_ops ath9k_ops; |
| 681 | extern int modparam_nohwcrypt; | 667 | extern int modparam_nohwcrypt; |
| 682 | extern int led_blink; | 668 | extern int led_blink; |
| 669 | extern int ath9k_pm_qos_value; | ||
| 683 | 670 | ||
| 684 | irqreturn_t ath_isr(int irq, void *dev); | 671 | irqreturn_t ath_isr(int irq, void *dev); |
| 685 | int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid, | 672 | int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid, |
| @@ -688,7 +675,6 @@ void ath9k_deinit_device(struct ath_softc *sc); | |||
| 688 | void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw); | 675 | void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw); |
| 689 | void ath9k_update_ichannel(struct ath_softc *sc, struct ieee80211_hw *hw, | 676 | void ath9k_update_ichannel(struct ath_softc *sc, struct ieee80211_hw *hw, |
| 690 | struct ath9k_channel *ichan); | 677 | struct ath9k_channel *ichan); |
| 691 | void ath_update_chainmask(struct ath_softc *sc, int is_ht); | ||
| 692 | int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw, | 678 | int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw, |
| 693 | struct ath9k_channel *hchan); | 679 | struct ath9k_channel *hchan); |
| 694 | 680 | ||
| @@ -715,10 +701,12 @@ static inline void ath_ahb_exit(void) {}; | |||
| 715 | void ath9k_ps_wakeup(struct ath_softc *sc); | 701 | void ath9k_ps_wakeup(struct ath_softc *sc); |
| 716 | void ath9k_ps_restore(struct ath_softc *sc); | 702 | void ath9k_ps_restore(struct ath_softc *sc); |
| 717 | 703 | ||
| 704 | u8 ath_txchainmask_reduction(struct ath_softc *sc, u8 chainmask, u32 rate); | ||
| 705 | |||
| 718 | void ath9k_set_bssid_mask(struct ieee80211_hw *hw, struct ieee80211_vif *vif); | 706 | void ath9k_set_bssid_mask(struct ieee80211_hw *hw, struct ieee80211_vif *vif); |
| 719 | int ath9k_wiphy_add(struct ath_softc *sc); | 707 | int ath9k_wiphy_add(struct ath_softc *sc); |
| 720 | int ath9k_wiphy_del(struct ath_wiphy *aphy); | 708 | int ath9k_wiphy_del(struct ath_wiphy *aphy); |
| 721 | void ath9k_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb); | 709 | void ath9k_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb, int ftype); |
| 722 | int ath9k_wiphy_pause(struct ath_wiphy *aphy); | 710 | int ath9k_wiphy_pause(struct ath_wiphy *aphy); |
| 723 | int ath9k_wiphy_unpause(struct ath_wiphy *aphy); | 711 | int ath9k_wiphy_unpause(struct ath_wiphy *aphy); |
| 724 | int ath9k_wiphy_select(struct ath_wiphy *aphy); | 712 | int ath9k_wiphy_select(struct ath_wiphy *aphy); |
