ath10k: update data path to support QCA99X0
v3 cover ath10k: update data path to support QCA99X0
This patch series update ath10k HTT Tx/Rx path to support QCA99X0 chip and make it able to run data traffic on both of Tx and Rx path.
v2: fixed a type mismatch warning in htt_tx.c
v3: fixed checkpatch warnings
Peter Oh (3):
ath10k: update tx path to support QCA99X0
ath10k: redefine rx_ppdu_end_common structure to cover qca99x0
ath10k: add support for qca99x0 Rx descriptors
drivers/net/wireless/ath/ath10k/htt.h | 13 ++- drivers/net/wireless/ath/ath10k/htt_rx.c | 24 ++-- drivers/net/wireless/ath/ath10k/htt_tx.c | 31 ++++-- drivers/net/wireless/ath/ath10k/rx_desc.h | 175 ++++++++++++++++++++++++++++-- 4 files changed, 214 insertions(+), 29 deletions(-)
Signature · 1 line
1.9.1
PATCH v3 1/3 ath10k: update tx path to support QCA99X0
Since QCA99X0 uses fragmentation descriptor differently from other ones on tx path, we need to handle it separately.
QCA99X0 is using 48 bits for address and 16 bits for length out of 2 dword and each values have to be programmed by frag desc base addr + msdu id, so that hardware can retrieve corresponding frag data.
--- drivers/net/wireless/ath/ath10k/htt.h | 13 +++++++++++-- drivers/net/wireless/ath/ath10k/htt_tx.c | 31 +++++++++++++++++++++++-------- 2 files changed, 34 insertions(+), 10 deletions(-)
drivers/net/wireless/ath/ath10k/htt.h +11 -2
@@ -83,8 +83,17 @@ struct htt_ver_req {* around the mask + shift defs. */ struct htt_data_tx_desc_frag { -__le32 paddr; -__le32 len; +union { +struct double_word_addr { +__le32 paddr; +__le32 len; + } __packed dword_addr; +struct triple_word_addr { +__le32 paddr_lo; +__le16 paddr_hi; +__le16 len_16; + } __packed tword_addr; + } __packed; } __packed;struct htt_msdu_ext_desc {
drivers/net/wireless/ath/ath10k/htt_tx.c +23 -8
@@ -63,7 +63,8 @@ int ath10k_htt_tx_alloc_msdu_id(struct ath10k_htt *htt, struct sk_buff *skb)lockdep_assert_held (&htt->tx_lock); - ret =idr_alloc (&htt->pending_tx, skb,0 ,0x10000 ,GFP_ATOMIC ); + ret =idr_alloc (&htt->pending_tx, skb,0 , + htt->max_num_pending_tx,GFP_ATOMIC );ath10k_dbg (ar,ATH10K_DBG_HTT ,"htt tx alloc msdu_id %d\n" , ret);
@@ -259,6 +260,7 @@ int ath10k_htt_send_frag_desc_bank_cfg(struct ath10k_htt *htt) cmd->frag_desc_bank_cfg.desc_size =sizeof (struct htt_msdu_ext_desc ); cmd->frag_desc_bank_cfg.bank_base_addrs[0 ] =__cpu_to_le32 (htt->frag_desc.paddr); + cmd->frag_desc_bank_cfg.bank_id[0 ].bank_min_id =0 ; cmd->frag_desc_bank_cfg.bank_id[0 ].bank_max_id =__cpu_to_le16 (htt->max_num_pending_tx -1 );
@@ -537,16 +539,29 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu) flags0 |=HTT_DATA_TX_DESC_FLAGS0_MAC_HDR_PRESENT ;/* pass through */ case ATH10K_HW_TXRX_ETHERNET : - frags = skb_cb->htt.txbuf->frags; +if (ar->hw_params.continuous_frag_desc) { + frags = (struct htt_data_tx_desc_frag *) + &htt->frag_desc.vaddr[msdu_id].frags; + frags[0 ].tword_addr.paddr_lo = +__cpu_to_le32 (skb_cb->paddr); + frags[0 ].tword_addr.paddr_hi =0 ; + frags[0 ].tword_addr.len_16 =__cpu_to_le16 (msdu->len); + frags[1 ].tword_addr.paddr_lo =0 ; + frags[1 ].tword_addr.paddr_hi =0 ; - frags[0 ].paddr =__cpu_to_le32 (skb_cb->paddr); - frags[0 ].len =__cpu_to_le32 (msdu->len); - frags[1 ].paddr =0 ; - frags[1 ].len =0 ; + frags_paddr = htt->frag_desc.paddr + + (sizeof (struct htt_msdu_ext_desc ) * msdu_id); + }else { + frags = skb_cb->htt.txbuf->frags; + frags[0 ].dword_addr.paddr = +__cpu_to_le32 (skb_cb->paddr); + frags[0 ].dword_addr.len =__cpu_to_le32 (msdu->len); + frags[1 ].dword_addr.paddr =0 ; + frags[1 ].dword_addr.len =0 ; + frags_paddr = skb_cb->htt.txbuf_paddr; + } flags0 |=SM (skb_cb->txmode,HTT_DATA_TX_DESC_FLAGS0_PKT_TYPE ); - - frags_paddr = skb_cb->htt.txbuf_paddr;break ;case ATH10K_HW_TXRX_MGMT : flags0 |= SM(ATH10K_HW_TXRX_MGMT,
Signature · 1 line
1.9.1
PATCH v3 2/3 ath10k: redefine rx_ppdu_end_common structure to cover qca99x0
In reply to Peter Ohrx_ppdu_end_common structure is valid for both of qca998x and qca6174, but not for qca99x0 since it has new additional members. Hence update the common structure to cover qca99x0 as well.
--- drivers/net/wireless/ath/ath10k/rx_desc.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath10k/rx_desc.h +8 -4
@@ -891,13 +891,13 @@ struct rx_ppdu_end_common {__le32 evm_p15;__le32 tsf_timestamp;__le32 wb_timestamp; -u8 locationing_timestamp; -u8 phy_err_code; -__le16 flags;/* %RX_PPDU_END_FLAGS_ */ -__le32 info0;/* %RX_PPDU_END_INFO0_ */ } __packed;struct rx_ppdu_end_qca988x { +u8 locationing_timestamp; +u8 phy_err_code; +__le16 flags;/* %RX_PPDU_END_FLAGS_ */ +__le32 info0;/* %RX_PPDU_END_INFO0_ */ __le16 bb_length;__le16 info1;/* %RX_PPDU_END_INFO1_ */ } __packed;
@@ -909,6 +909,10 @@ struct rx_ppdu_end_qca988x {#define RX_PPDU_END_RTT_NORMAL_MODE BIT(31)struct rx_ppdu_end_qca6174 { +u8 locationing_timestamp; +u8 phy_err_code; +__le16 flags;/* %RX_PPDU_END_FLAGS_ */ +__le32 info0;/* %RX_PPDU_END_INFO0_ */ __le32 rtt;/* %RX_PPDU_END_RTT_ */ __le16 bb_length;__le16 info1;/* %RX_PPDU_END_INFO1_ */
Signature · 1 line
1.9.1
PATCH v3 3/3 ath10k: add support for qca99x0 Rx descriptors
In reply to Peter OhQCA99X0 chip has an extra 4 bytes in rx_msdu_start, 20 bytes in rx_msdu_end and 20 bytes in rx_ppdu_end structure which are used in htt_rx_desc and HTT Rx ring offset setup. This is necessary for correct Rx for QCA99X0 or Rx descriptors will be overwritten and corrupted.
With this patch QCA988X and QCA6174 will have extra 44 bytes padding in Rx descriptor layout which is harmless.
--- drivers/net/wireless/ath/ath10k/htt_rx.c | 24 ++--- drivers/net/wireless/ath/ath10k/rx_desc.h | 163 +++++++++++++++++++++++++++++- 2 files changed, 172 insertions(+), 15 deletions(-)
drivers/net/wireless/ath/ath10k/htt_rx.c +12 -12
@@ -368,7 +368,7 @@ static int ath10k_htt_rx_amsdu_pop(struct ath10k_htt *htt, msdu_len_invalid = !!(__le32_to_cpu (rx_desc->attention.flags) & (RX_ATTENTION_FLAGS_MPDU_LENGTH_ERR |RX_ATTENTION_FLAGS_MSDU_LENGTH_ERR )); - msdu_len =MS (__le32_to_cpu (rx_desc->msdu_start.info0), + msdu_len =MS (__le32_to_cpu (rx_desc->msdu_start.common.info0),RX_MSDU_START_INFO0_MSDU_LENGTH ); msdu_chained = rx_desc->frag_info.ring2_more_count;
@@ -394,7 +394,7 @@ static int ath10k_htt_rx_amsdu_pop(struct ath10k_htt *htt, msdu_chaining =1 ; } - last_msdu =__le32_to_cpu (rx_desc->msdu_end.info0) & + last_msdu =__le32_to_cpu (rx_desc->msdu_end.common.info0) &RX_MSDU_END_INFO0_LAST_MSDU ; trace_ath10k_htt_rx_desc(ar, &rx_desc->attention,
@@ -740,7 +740,7 @@ ath10k_htt_rx_h_peer_channel(struct ath10k *ar, struct htt_rx_desc *rxd) __cpu_to_le32(RX_ATTENTION_FLAGS_PEER_IDX_INVALID))return NULL ; -if (!(rxd->msdu_end.info0 & +if (!(rxd->msdu_end.common.info0 &__cpu_to_le32 (RX_MSDU_END_INFO0_FIRST_MSDU )))return NULL ;
@@ -991,9 +991,9 @@ static void ath10k_htt_rx_h_undecap_raw(struct ath10k *ar,bool is_last; rxd = (void *)msdu->data -sizeof (*rxd); - is_first = !!(rxd->msdu_end.info0 & + is_first = !!(rxd->msdu_end.common.info0 &__cpu_to_le32 (RX_MSDU_END_INFO0_FIRST_MSDU )); - is_last = !!(rxd->msdu_end.info0 & + is_last = !!(rxd->msdu_end.common.info0 &__cpu_to_le32 (RX_MSDU_END_INFO0_LAST_MSDU ));/* Delivered decapped frame:
@@ -1104,9 +1104,9 @@ static void *ath10k_htt_rx_h_find_rfc1042(struct ath10k *ar, rxd = (void *)msdu->data -sizeof (*rxd); hdr = (void *)rxd->rx_hdr_status; - is_first = !!(rxd->msdu_end.info0 & + is_first = !!(rxd->msdu_end.common.info0 &__cpu_to_le32 (RX_MSDU_END_INFO0_FIRST_MSDU )); - is_last = !!(rxd->msdu_end.info0 & + is_last = !!(rxd->msdu_end.common.info0 &__cpu_to_le32 (RX_MSDU_END_INFO0_LAST_MSDU )); is_amsdu = !(is_first && is_last);
@@ -1214,7 +1214,7 @@ static void ath10k_htt_rx_h_undecap(struct ath10k *ar,*/ rxd = (void *)msdu->data -sizeof (*rxd); - decap =MS (__le32_to_cpu (rxd->msdu_start.info1), + decap =MS (__le32_to_cpu (rxd->msdu_start.common.info1),RX_MSDU_START_INFO1_DECAP_FORMAT );switch (decap) {
@@ -1244,7 +1244,7 @@ static int ath10k_htt_rx_get_csum_state(struct sk_buff *skb) rxd = (void *)skb->data -sizeof (*rxd); flags =__le32_to_cpu (rxd->attention.flags); - info =__le32_to_cpu (rxd->msdu_start.info1); + info =__le32_to_cpu (rxd->msdu_start.common.info1); is_ip4 = !!(info &RX_MSDU_START_INFO1_IPV4_PROTO ); is_ip6 = !!(info &RX_MSDU_START_INFO1_IPV6_PROTO );
@@ -1437,7 +1437,7 @@ static void ath10k_htt_rx_h_unchain(struct ath10k *ar, first =skb_peek (amsdu); rxd = (void *)first->data -sizeof (*rxd); - decap =MS (__le32_to_cpu (rxd->msdu_start.info1), + decap =MS (__le32_to_cpu (rxd->msdu_start.common.info1),RX_MSDU_START_INFO1_DECAP_FORMAT );if (!chained)
@@ -1757,14 +1757,14 @@ static int ath10k_htt_rx_extract_amsdu(struct sk_buff_head *list,__skb_queue_tail (amsdu, msdu); rxd = (void *)msdu->data -sizeof (*rxd); -if (rxd->msdu_end.info0 & +if (rxd->msdu_end.common.info0 &__cpu_to_le32 (RX_MSDU_END_INFO0_LAST_MSDU ))break ; } msdu =skb_peek_tail (amsdu); rxd = (void *)msdu->data -sizeof (*rxd); -if (!(rxd->msdu_end.info0 & +if (!(rxd->msdu_end.common.info0 &__cpu_to_le32 (RX_MSDU_END_INFO0_LAST_MSDU ))) {skb_queue_splice_init (amsdu, list);return -EAGAIN ;
drivers/net/wireless/ath/ath10k/rx_desc.h +160 -3
209 lines not on this page · raw message
Signature · 1 line
1.9.1
Quoted 11 lines · Peter Oh
This patch series update ath10k HTT Tx/Rx path to support QCA99X0 chip and make it able to run data traffic on both of Tx and Rx path.
v2: fixed a type mismatch warning in
htt_tx.c
v3: fixed checkpatch warningsPeter Oh (3):
ath10k: update tx path to support QCA99X0
ath10k: redefinerx_ppdu_end_commonstructure to cover qca99x0
ath10k: add support for qca99x0 Rx descriptors
Thanks, all three applied.
Signature · 1 line
Kalle Valo