diff --git a/dp/wifi3.0/dp_htt.c b/dp/wifi3.0/dp_htt.c index 1ee13f394615..c6daacdd8ee7 100644 --- a/dp/wifi3.0/dp_htt.c +++ b/dp/wifi3.0/dp_htt.c @@ -2139,6 +2139,20 @@ static void dp_htt_t2h_msg_handler(void *context, HTC_PACKET *pkt) pdev_id); break; } + case HTT_T2H_MSG_TYPE_PKTLOG: + { + uint8_t pdev_id; + uint32_t *pl_hdr; + QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_INFO, + "received HTT_T2H_MSG_TYPE_PKTLOG\n"); + pdev_id = HTT_T2H_PKTLOG_MAC_ID_GET(*msg_word); + pdev_id = DP_HW2SW_MACID(pdev_id); + pl_hdr = (msg_word + 1); + dp_wdi_event_handler(WDI_EVENT_OFFLOAD_ALL, soc->dp_soc, + pl_hdr, HTT_INVALID_PEER, WDI_NO_VAL, + pdev_id); + break; + } #endif #endif case HTT_T2H_MSG_TYPE_VERSION_CONF: @@ -2230,6 +2244,33 @@ dp_htt_h2t_full(void *context, HTC_PACKET *pkt) return HTC_SEND_FULL_KEEP; } +/* + * dp_htt_hif_t2h_hp_callback() - HIF callback for high priority T2H messages + * @context: Opaque context (HTT SOC handle) + * @nbuf: nbuf containing T2H message + * @pipe_id: HIF pipe ID + * + * Return: QDF_STATUS + * + * TODO: Temporary change to bypass HTC connection for this new HIF pipe, which + * will be used for packet log and other high-priority HTT messsages. Proper + * HTC connection to be added later once required FW changes are available + */ +static QDF_STATUS +dp_htt_hif_t2h_hp_callback (void *context, qdf_nbuf_t nbuf, uint8_t pipe_id) +{ + A_STATUS rc = QDF_STATUS_SUCCESS; + HTC_PACKET htc_pkt; + + qdf_assert_always(pipe_id == DP_HTT_T2H_HP_PIPE); + qdf_mem_zero(&htc_pkt, sizeof(htc_pkt)); + htc_pkt.Status = QDF_STATUS_SUCCESS; + htc_pkt.pPktContext = (void *)nbuf; + dp_htt_t2h_msg_handler(context, &htc_pkt); + + return rc; +} + /* * htt_htc_soc_attach() - Register SOC level HTT instance with HTC * @htt_soc: HTT SOC handle @@ -2279,6 +2320,9 @@ htt_htc_soc_attach(struct htt_soc *soc) soc->htc_endpoint = response.Endpoint; + dp_hif_update_pipe_callback(soc->dp_soc, (void *)soc, + dp_htt_hif_t2h_hp_callback, DP_HTT_T2H_HP_PIPE); + return 0; /* success */ } diff --git a/dp/wifi3.0/dp_internal.h b/dp/wifi3.0/dp_internal.h index a14c600e0936..2bb53c71d042 100644 --- a/dp/wifi3.0/dp_internal.h +++ b/dp/wifi3.0/dp_internal.h @@ -229,6 +229,7 @@ while (0) #define DP_TX_HIST_STATS_PER_PDEV() #endif +#define DP_HTT_T2H_HP_PIPE 5 extern int dp_peer_find_attach(struct dp_soc *soc); @@ -322,6 +323,22 @@ int dp_wdi_event_attach(struct dp_pdev *txrx_pdev); int dp_wdi_event_detach(struct dp_pdev *txrx_pdev); int dp_set_pktlog_wifi3(struct dp_pdev *pdev, uint32_t event, bool enable); +static inline void dp_hif_update_pipe_callback(void *soc, void *cb_context, + QDF_STATUS (*callback)(void *, qdf_nbuf_t, uint8_t), uint8_t pipe_id) +{ + struct hif_msg_callbacks hif_pipe_callbacks; + struct dp_soc *dp_soc = (struct dp_soc *)soc; + + /* TODO: Temporary change to bypass HTC connection for this new + * HIF pipe, which will be used for packet log and other high- + * priority HTT messsages. Proper HTC connection to be added + * later once required FW changes are available + */ + hif_pipe_callbacks.rxCompletionHandler = callback; + hif_pipe_callbacks.Context = cb_context; + hif_update_pipe_callback(dp_soc->hif_handle, + DP_HTT_T2H_HP_PIPE, &hif_pipe_callbacks); +} #else static inline int dp_wdi_event_unsub(struct cdp_pdev *txrx_pdev_handle, void *event_cb_sub_handle, @@ -363,6 +380,10 @@ static inline QDF_STATUS dp_h2t_cfg_stats_msg_send(struct dp_pdev *pdev, { return 0; } +static inline void dp_hif_update_pipe_callback(void *soc, void *cb_context, + QDF_STATUS (*callback)(void *, qdf_nbuf_t, uint8_t), uint8_t pipe_id) +{ +} #endif /* CONFIG_WIN */ #ifdef QCA_LL_TX_FLOW_CONTROL_V2 void dp_tx_dump_flow_pool_info(void *soc);