diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/htt.h')
-rw-r--r-- | drivers/net/wireless/ath/ath10k/htt.h | 87 |
1 files changed, 82 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/ath10k/htt.h b/drivers/net/wireless/ath/ath10k/htt.h index 1bd5545af903..874bf44ff7a2 100644 --- a/drivers/net/wireless/ath/ath10k/htt.h +++ b/drivers/net/wireless/ath/ath10k/htt.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/bug.h> | 21 | #include <linux/bug.h> |
22 | #include <linux/interrupt.h> | 22 | #include <linux/interrupt.h> |
23 | #include <linux/dmapool.h> | 23 | #include <linux/dmapool.h> |
24 | #include <linux/hashtable.h> | ||
24 | #include <net/mac80211.h> | 25 | #include <net/mac80211.h> |
25 | 26 | ||
26 | #include "htc.h" | 27 | #include "htc.h" |
@@ -286,7 +287,19 @@ enum htt_t2h_msg_type { | |||
286 | HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, | 287 | HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, |
287 | HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd, | 288 | HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd, |
288 | HTT_T2H_MSG_TYPE_MGMT_TX_COMPLETION = 0xe, | 289 | HTT_T2H_MSG_TYPE_MGMT_TX_COMPLETION = 0xe, |
290 | HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf, | ||
291 | HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10, | ||
292 | HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11, | ||
293 | HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12, | ||
294 | /* 0x13 reservd */ | ||
295 | HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14, | ||
296 | |||
297 | /* FIXME: Do not depend on this event id. Numbering of this event id is | ||
298 | * broken across different firmware revisions and HTT version fails to | ||
299 | * indicate this. | ||
300 | */ | ||
289 | HTT_T2H_MSG_TYPE_TEST, | 301 | HTT_T2H_MSG_TYPE_TEST, |
302 | |||
290 | /* keep this last */ | 303 | /* keep this last */ |
291 | HTT_T2H_NUM_MSGS | 304 | HTT_T2H_NUM_MSGS |
292 | }; | 305 | }; |
@@ -655,6 +668,53 @@ struct htt_rx_fragment_indication { | |||
655 | #define HTT_RX_FRAG_IND_INFO1_FLUSH_SEQ_NUM_END_MASK 0x00000FC0 | 668 | #define HTT_RX_FRAG_IND_INFO1_FLUSH_SEQ_NUM_END_MASK 0x00000FC0 |
656 | #define HTT_RX_FRAG_IND_INFO1_FLUSH_SEQ_NUM_END_LSB 6 | 669 | #define HTT_RX_FRAG_IND_INFO1_FLUSH_SEQ_NUM_END_LSB 6 |
657 | 670 | ||
671 | struct htt_rx_pn_ind { | ||
672 | __le16 peer_id; | ||
673 | u8 tid; | ||
674 | u8 seqno_start; | ||
675 | u8 seqno_end; | ||
676 | u8 pn_ie_count; | ||
677 | u8 reserved; | ||
678 | u8 pn_ies[0]; | ||
679 | } __packed; | ||
680 | |||
681 | struct htt_rx_offload_msdu { | ||
682 | __le16 msdu_len; | ||
683 | __le16 peer_id; | ||
684 | u8 vdev_id; | ||
685 | u8 tid; | ||
686 | u8 fw_desc; | ||
687 | u8 payload[0]; | ||
688 | } __packed; | ||
689 | |||
690 | struct htt_rx_offload_ind { | ||
691 | u8 reserved; | ||
692 | __le16 msdu_count; | ||
693 | } __packed; | ||
694 | |||
695 | struct htt_rx_in_ord_msdu_desc { | ||
696 | __le32 msdu_paddr; | ||
697 | __le16 msdu_len; | ||
698 | u8 fw_desc; | ||
699 | u8 reserved; | ||
700 | } __packed; | ||
701 | |||
702 | struct htt_rx_in_ord_ind { | ||
703 | u8 info; | ||
704 | __le16 peer_id; | ||
705 | u8 vdev_id; | ||
706 | u8 reserved; | ||
707 | __le16 msdu_count; | ||
708 | struct htt_rx_in_ord_msdu_desc msdu_descs[0]; | ||
709 | } __packed; | ||
710 | |||
711 | #define HTT_RX_IN_ORD_IND_INFO_TID_MASK 0x0000001f | ||
712 | #define HTT_RX_IN_ORD_IND_INFO_TID_LSB 0 | ||
713 | #define HTT_RX_IN_ORD_IND_INFO_OFFLOAD_MASK 0x00000020 | ||
714 | #define HTT_RX_IN_ORD_IND_INFO_OFFLOAD_LSB 5 | ||
715 | #define HTT_RX_IN_ORD_IND_INFO_FRAG_MASK 0x00000040 | ||
716 | #define HTT_RX_IN_ORD_IND_INFO_FRAG_LSB 6 | ||
717 | |||
658 | /* | 718 | /* |
659 | * target -> host test message definition | 719 | * target -> host test message definition |
660 | * | 720 | * |
@@ -1150,6 +1210,9 @@ struct htt_resp { | |||
1150 | struct htt_rx_test rx_test; | 1210 | struct htt_rx_test rx_test; |
1151 | struct htt_pktlog_msg pktlog_msg; | 1211 | struct htt_pktlog_msg pktlog_msg; |
1152 | struct htt_stats_conf stats_conf; | 1212 | struct htt_stats_conf stats_conf; |
1213 | struct htt_rx_pn_ind rx_pn_ind; | ||
1214 | struct htt_rx_offload_ind rx_offload_ind; | ||
1215 | struct htt_rx_in_ord_ind rx_in_ord_ind; | ||
1153 | }; | 1216 | }; |
1154 | } __packed; | 1217 | } __packed; |
1155 | 1218 | ||
@@ -1182,7 +1245,6 @@ struct ath10k_htt { | |||
1182 | struct ath10k *ar; | 1245 | struct ath10k *ar; |
1183 | enum ath10k_htc_ep_id eid; | 1246 | enum ath10k_htc_ep_id eid; |
1184 | 1247 | ||
1185 | int max_throughput_mbps; | ||
1186 | u8 target_version_major; | 1248 | u8 target_version_major; |
1187 | u8 target_version_minor; | 1249 | u8 target_version_minor; |
1188 | struct completion target_version_received; | 1250 | struct completion target_version_received; |
@@ -1198,6 +1260,20 @@ struct ath10k_htt { | |||
1198 | * filled. | 1260 | * filled. |
1199 | */ | 1261 | */ |
1200 | struct sk_buff **netbufs_ring; | 1262 | struct sk_buff **netbufs_ring; |
1263 | |||
1264 | /* This is used only with firmware supporting IN_ORD_IND. | ||
1265 | * | ||
1266 | * With Full Rx Reorder the HTT Rx Ring is more of a temporary | ||
1267 | * buffer ring from which buffer addresses are copied by the | ||
1268 | * firmware to MAC Rx ring. Firmware then delivers IN_ORD_IND | ||
1269 | * pointing to specific (re-ordered) buffers. | ||
1270 | * | ||
1271 | * FIXME: With kernel generic hashing functions there's a lot | ||
1272 | * of hash collisions for sk_buffs. | ||
1273 | */ | ||
1274 | bool in_ord_rx; | ||
1275 | DECLARE_HASHTABLE(skb_table, 4); | ||
1276 | |||
1201 | /* | 1277 | /* |
1202 | * Ring of buffer addresses - | 1278 | * Ring of buffer addresses - |
1203 | * This ring holds the "physical" device address of the | 1279 | * This ring holds the "physical" device address of the |
@@ -1252,12 +1328,11 @@ struct ath10k_htt { | |||
1252 | 1328 | ||
1253 | unsigned int prefetch_len; | 1329 | unsigned int prefetch_len; |
1254 | 1330 | ||
1255 | /* Protects access to %pending_tx, %used_msdu_ids */ | 1331 | /* Protects access to pending_tx, num_pending_tx */ |
1256 | spinlock_t tx_lock; | 1332 | spinlock_t tx_lock; |
1257 | int max_num_pending_tx; | 1333 | int max_num_pending_tx; |
1258 | int num_pending_tx; | 1334 | int num_pending_tx; |
1259 | struct sk_buff **pending_tx; | 1335 | struct idr pending_tx; |
1260 | unsigned long *used_msdu_ids; /* bitmap */ | ||
1261 | wait_queue_head_t empty_tx_wq; | 1336 | wait_queue_head_t empty_tx_wq; |
1262 | struct dma_pool *tx_pool; | 1337 | struct dma_pool *tx_pool; |
1263 | 1338 | ||
@@ -1271,6 +1346,7 @@ struct ath10k_htt { | |||
1271 | struct tasklet_struct txrx_compl_task; | 1346 | struct tasklet_struct txrx_compl_task; |
1272 | struct sk_buff_head tx_compl_q; | 1347 | struct sk_buff_head tx_compl_q; |
1273 | struct sk_buff_head rx_compl_q; | 1348 | struct sk_buff_head rx_compl_q; |
1349 | struct sk_buff_head rx_in_ord_compl_q; | ||
1274 | 1350 | ||
1275 | /* rx_status template */ | 1351 | /* rx_status template */ |
1276 | struct ieee80211_rx_status rx_status; | 1352 | struct ieee80211_rx_status rx_status; |
@@ -1334,6 +1410,7 @@ int ath10k_htt_tx_alloc(struct ath10k_htt *htt); | |||
1334 | void ath10k_htt_tx_free(struct ath10k_htt *htt); | 1410 | void ath10k_htt_tx_free(struct ath10k_htt *htt); |
1335 | 1411 | ||
1336 | int ath10k_htt_rx_alloc(struct ath10k_htt *htt); | 1412 | int ath10k_htt_rx_alloc(struct ath10k_htt *htt); |
1413 | int ath10k_htt_rx_ring_refill(struct ath10k *ar); | ||
1337 | void ath10k_htt_rx_free(struct ath10k_htt *htt); | 1414 | void ath10k_htt_rx_free(struct ath10k_htt *htt); |
1338 | 1415 | ||
1339 | void ath10k_htt_htc_tx_complete(struct ath10k *ar, struct sk_buff *skb); | 1416 | void ath10k_htt_htc_tx_complete(struct ath10k *ar, struct sk_buff *skb); |
@@ -1346,7 +1423,7 @@ int ath10k_htt_h2t_aggr_cfg_msg(struct ath10k_htt *htt, | |||
1346 | u8 max_subfrms_amsdu); | 1423 | u8 max_subfrms_amsdu); |
1347 | 1424 | ||
1348 | void __ath10k_htt_tx_dec_pending(struct ath10k_htt *htt); | 1425 | void __ath10k_htt_tx_dec_pending(struct ath10k_htt *htt); |
1349 | int ath10k_htt_tx_alloc_msdu_id(struct ath10k_htt *htt); | 1426 | int ath10k_htt_tx_alloc_msdu_id(struct ath10k_htt *htt, struct sk_buff *skb); |
1350 | void ath10k_htt_tx_free_msdu_id(struct ath10k_htt *htt, u16 msdu_id); | 1427 | void ath10k_htt_tx_free_msdu_id(struct ath10k_htt *htt, u16 msdu_id); |
1351 | int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *); | 1428 | int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *); |
1352 | int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *); | 1429 | int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *); |