diff --git a/core/dp/htt/htt.c b/core/dp/htt/htt.c index 857b25cd4a34..4664a42fcbea 100644 --- a/core/dp/htt/htt.c +++ b/core/dp/htt/htt.c @@ -813,3 +813,23 @@ htt_ipa_uc_set_doorbell_paddr(htt_pdev_handle pdev, return 0; } #endif /* IPA_OFFLOAD */ + +/** + * htt_mark_first_wakeup_packet() - set flag to indicate that + * fw is compatible for marking first packet after wow wakeup + * @pdev: pointer to htt pdev + * @value: 1 for enabled/ 0 for disabled + * + * Return: None + */ +void htt_mark_first_wakeup_packet(htt_pdev_handle pdev, + uint8_t value) +{ + if (!pdev) { + qdf_print("%s: htt pdev is NULL", __func__); + return; + } + + pdev->cfg.is_first_wakeup_packet = value; +} + diff --git a/core/dp/htt/htt_rx.c b/core/dp/htt/htt_rx.c index 1c36f39dad32..161b27505a68 100644 --- a/core/dp/htt/htt_rx.c +++ b/core/dp/htt/htt_rx.c @@ -1448,6 +1448,16 @@ htt_rx_offload_paddr_msdu_pop_ll(htt_pdev_handle pdev, #else qdf_nbuf_unmap(pdev->osdev, buf, QDF_DMA_FROM_DEVICE); #endif + + if (pdev->cfg.is_first_wakeup_packet) { + if (HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(*(curr_msdu + 1)) & + FW_MSDU_INFO_FIRST_WAKEUP_M) { + qdf_nbuf_mark_wakeup_frame(buf); + qdf_print("%s: First packet after WOW Wakeup rcvd\n", + __func__); + } + } + msdu_hdr = (uint32_t *) qdf_nbuf_data(buf); /* First dword */ @@ -2041,13 +2051,6 @@ htt_rx_amsdu_rx_in_order_pop_ll(htt_pdev_handle pdev, HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(*(msg_word + NEXT_FIELD_OFFSET_IN32)); #undef NEXT_FIELD_OFFSET_IN32 - if (HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(*(msg_word + 1)) & - FW_MSDU_INFO_FIRST_WAKEUP_M) { - qdf_print("%s: first packet after WOW wakeup\n", - __func__); - qdf_nbuf_mark_wakeup_frame(msdu); - } - msdu_count--; if (qdf_unlikely((*((u_int8_t *) &rx_desc->fw_desc.u.val)) & diff --git a/core/dp/htt/htt_types.h b/core/dp/htt/htt_types.h index 074b4b039f96..65c4777f59c2 100644 --- a/core/dp/htt/htt_types.h +++ b/core/dp/htt/htt_types.h @@ -252,6 +252,7 @@ struct htt_pdev_t { int is_full_reorder_offload; int default_tx_comp_req; int ce_classify_enabled; + uint8_t is_first_wakeup_packet; } cfg; struct { uint8_t major; diff --git a/core/dp/ol/inc/ol_htt_api.h b/core/dp/ol/inc/ol_htt_api.h index e97ffb55826a..21da2649125c 100644 --- a/core/dp/ol/inc/ol_htt_api.h +++ b/core/dp/ol/inc/ol_htt_api.h @@ -383,5 +383,6 @@ static inline void htt_clear_bundle_stats(struct htt_pdev_t *pdev) } #endif +void htt_mark_first_wakeup_packet(htt_pdev_handle pdev, uint8_t value); #endif /* _OL_HTT_API__H_ */ diff --git a/core/dp/ol/inc/ol_txrx_ctrl_api.h b/core/dp/ol/inc/ol_txrx_ctrl_api.h index 602d31a7b82c..a5dbcacbf3ec 100644 --- a/core/dp/ol/inc/ol_txrx_ctrl_api.h +++ b/core/dp/ol/inc/ol_txrx_ctrl_api.h @@ -668,4 +668,6 @@ static inline int ol_tx_delete_flow_pool(struct ol_tx_flow_pool_t *pool, } #endif +void ol_tx_mark_first_wakeup_packet(uint8_t value); + #endif /* _OL_TXRX_CTRL_API__H_ */ diff --git a/core/dp/txrx/ol_txrx.c b/core/dp/txrx/ol_txrx.c index 0592b158fa3f..e4f6c5554100 100644 --- a/core/dp/txrx/ol_txrx.c +++ b/core/dp/txrx/ol_txrx.c @@ -169,6 +169,26 @@ ol_txrx_update_last_real_peer( } #endif +/** + * ol_tx_mark_first_wakeup_packet() - set flag to indicate that + * fw is compatible for marking first packet after wow wakeup + * @value: 1 for enabled/ 0 for disabled + * + * Return: None + */ +void ol_tx_mark_first_wakeup_packet(uint8_t value) +{ + struct ol_txrx_pdev_t *pdev = cds_get_context(QDF_MODULE_ID_TXRX); + + if (!pdev) { + TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, + "%s: pdev is NULL\n", __func__); + return; + } + + htt_mark_first_wakeup_packet(pdev->htt_pdev, value); +} + u_int16_t ol_tx_desc_pool_size_hl(ol_pdev_handle ctrl_pdev) { diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index acf41e9ed1ef..6146ac63c76c 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -4393,6 +4393,10 @@ int wma_rx_service_ready_event(void *handle, uint8_t *cmd_param_info, return -EINVAL; } + ol_tx_mark_first_wakeup_packet( + WMI_SERVICE_IS_ENABLED(wma_handle->wmi_service_bitmap, + WMI_SERVICE_MARK_FIRST_WAKEUP_PACKET)); + wma_handle->nan_datapath_enabled = WMI_SERVICE_IS_ENABLED(wma_handle->wmi_service_bitmap, WMI_SERVICE_NAN_DATA);