diff --git a/core/dp/htt/htt.c b/core/dp/htt/htt.c index ed114ac44c..8b6afd1f9b 100644 --- a/core/dp/htt/htt.c +++ b/core/dp/htt/htt.c @@ -195,6 +195,8 @@ htt_pdev_alloc(ol_txrx_pdev_handle txrx_pdev, #ifndef AR6004_HW if (htt_htc_attach(pdev)) goto fail2; + if (hif_ce_fastpath_cb_register(htt_t2h_msg_handler_fast, pdev)) + qdf_print("failed to register fastpath callback\n"); #endif return pdev; @@ -397,10 +399,6 @@ int htt_htc_attach(struct htt_pdev_t *pdev) HTC_SERVICE_CONNECT_RESP response; A_STATUS status; - if (QDF_STATUS_SUCCESS != - hif_ce_fastpath_cb_register(htt_t2h_msg_handler_fast, pdev)) - qdf_print("failed to register fastpath callback\n"); - qdf_mem_set(&connect, sizeof(connect), 0); qdf_mem_set(&response, sizeof(response), 0); diff --git a/core/dp/htt/htt_internal.h b/core/dp/htt/htt_internal.h index 9e4628b86b..5b8b167260 100644 --- a/core/dp/htt/htt_internal.h +++ b/core/dp/htt/htt_internal.h @@ -431,8 +431,16 @@ void htt_rx_detach(struct htt_pdev_t *pdev); int htt_htc_attach(struct htt_pdev_t *pdev); void htt_t2h_msg_handler(void *context, HTC_PACKET *pkt); -int htt_t2h_msg_handler_fast(void *htt_pdev, qdf_nbuf_t *cmpl_msdus, - uint32_t num_cmpls); +#ifdef WLAN_FEATURE_FASTPATH +void htt_t2h_msg_handler_fast(void *htt_pdev, qdf_nbuf_t *cmpl_msdus, + uint32_t num_cmpls); +#else +static inline void htt_t2h_msg_handler_fast(void *htt_pdev, + qdf_nbuf_t *cmpl_msdus, + uint32_t num_cmpls) +{ +} +#endif void htt_h2t_send_complete(void *context, HTC_PACKET *pkt); diff --git a/core/dp/htt/htt_t2h.c b/core/dp/htt/htt_t2h.c index 3efa3f76cf..63fbe2eab7 100644 --- a/core/dp/htt/htt_t2h.c +++ b/core/dp/htt/htt_t2h.c @@ -44,7 +44,6 @@ #include #include /* htt_tx_status */ -#include #include /* HTT_TX_SCHED, etc. */ #include #include @@ -133,8 +132,8 @@ static void htt_rx_frag_set_last_msdu(struct htt_pdev_t *pdev, qdf_nbuf_t msg) } /* Target to host Msg/event handler for low priority messages*/ -void htt_t2h_lp_msg_handler(void *context, qdf_nbuf_t htt_t2h_msg, bool - free_msg_buf) +void htt_t2h_lp_msg_handler(void *context, qdf_nbuf_t htt_t2h_msg, + bool free_msg_buf) { struct htt_pdev_t *pdev = (struct htt_pdev_t *)context; uint32_t *msg_word; @@ -698,10 +697,11 @@ void htt_t2h_msg_handler(void *context, HTC_PACKET *pkt) QDF_NBUF_CB_PADDR(_buf) -= (HTC_HEADER_LEN + \ HTC_HDR_ALIGNMENT_PADDING); \ qdf_nbuf_init_fast((_buf)); \ - OS_SYNC_SINGLE_FOR_DEVICE(dev, (QDF_NBUF_CB_PADDR(_buf)), \ - (skb_end_pointer(_buf) - \ - (_buf)->data) , \ - PCI_DMA_FROMDEVICE); \ + qdf_mem_dma_sync_single_for_device(dev, \ + (QDF_NBUF_CB_PADDR(_buf)), \ + (skb_end_pointer(_buf) - \ + (_buf)->data) , \ + PCI_DMA_FROMDEVICE); \ } while (0) /** @@ -710,11 +710,10 @@ void htt_t2h_msg_handler(void *context, HTC_PACKET *pkt) * @cmpl_msdus: netbuf completions * @num_cmpls: number of completions to be handled * - * Return: Number of completions handled + * Return: None */ -int -htt_t2h_msg_handler_fast(void *context, qdf_nbuf_t *cmpl_msdus, - uint32_t num_cmpls) +void htt_t2h_msg_handler_fast(void *context, qdf_nbuf_t *cmpl_msdus, + uint32_t num_cmpls) { struct htt_pdev_t *pdev = (struct htt_pdev_t *)context; qdf_nbuf_t htt_t2h_msg; @@ -722,7 +721,6 @@ htt_t2h_msg_handler_fast(void *context, qdf_nbuf_t *cmpl_msdus, uint32_t i; enum htt_t2h_msg_type msg_type; uint32_t msg_len; - uint32_t num_htt_tx_cmpls = 0; for (i = 0; i < num_cmpls; i++) { htt_t2h_msg = cmpl_msdus[i]; @@ -807,7 +805,6 @@ htt_t2h_msg_handler_fast(void *context, qdf_nbuf_t *cmpl_msdus, ol_tx_completion_handler(pdev->txrx_pdev, num_msdus, status, msg_word + 1); - num_htt_tx_cmpls += SLOTS_PER_TX; break; } case HTT_T2H_MSG_TYPE_RX_PN_IND: @@ -866,7 +863,6 @@ htt_t2h_msg_handler_fast(void *context, qdf_nbuf_t *cmpl_msdus, } ol_tx_inspect_handler(pdev->txrx_pdev, num_msdus, msg_word + 1); - num_htt_tx_cmpls += SLOTS_PER_TX; break; } case HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND: @@ -915,16 +911,9 @@ htt_t2h_msg_handler_fast(void *context, qdf_nbuf_t *cmpl_msdus, }; /* Re-initialize the indication buffer */ - HTT_T2H_MSG_BUF_REINIT(htt_t2h_msg, pdev->osdev->dev); + HTT_T2H_MSG_BUF_REINIT(htt_t2h_msg, pdev->osdev); qdf_nbuf_set_pktlen(htt_t2h_msg, 0); } - return num_htt_tx_cmpls; -} -#else -int htt_t2h_msg_handler_fast(void *context, qdf_nbuf_t *cmpl_msdus, - uint32_t num_cmpls) -{ - return 0; } #endif /* WLAN_FEATURE_FASTPATH */ diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 60270235ff..ae1e9d0010 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -5609,8 +5609,6 @@ int hdd_wlan_startup(struct device *dev, void *hif_sc) if (IS_ERR(hdd_ctx)) return PTR_ERR(hdd_ctx); - hif_update_fastpath_recv_bufs_cnt(hif_sc); - if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) { ret = hdd_enable_ftm(hdd_ctx); diff --git a/uapi/linux/osapi_linux.h b/uapi/linux/osapi_linux.h index a62b96d3f6..21f8ff629a 100644 --- a/uapi/linux/osapi_linux.h +++ b/uapi/linux/osapi_linux.h @@ -231,6 +231,7 @@ void a_netbuf_queue_init(A_NETBUF_QUEUE_T *q); #include "ath_carr_pltfrm.h" #endif /* QCA_PARTNER_PLATFORM */ +#define SLOTS_PER_DATAPATH_TX 2 #else /* __KERNEL__ */ #ifdef __GNUC__