qcacmn: Enable Pktlog Support
Retrieve pktlog handle through cdp api. Register proper callbacks for handling WMI responses from fw. Change-Id: Iaa3dca5ba95e41d09c99f6d0bef12880ef8f72c0 CRs-Fixed: 2185217
This commit is contained in:

committed by
snandini

parent
3beed81ef5
commit
78e6478d29
@@ -612,6 +612,7 @@ static inline int
|
||||
cdp_wdi_event_sub(ol_txrx_soc_handle soc,
|
||||
struct cdp_pdev *pdev, void *event_cb_sub, uint32_t event)
|
||||
{
|
||||
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s invalid instance", __func__);
|
||||
@@ -645,6 +646,7 @@ static inline int
|
||||
cdp_wdi_event_unsub(ol_txrx_soc_handle soc,
|
||||
struct cdp_pdev *pdev, void *event_cb_sub, uint32_t event)
|
||||
{
|
||||
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s invalid instance", __func__);
|
||||
@@ -715,35 +717,6 @@ static inline int cdp_set_mgmt_tx_power(ol_txrx_soc_handle soc,
|
||||
subtype, tx_power);
|
||||
return 0;
|
||||
}
|
||||
/**
|
||||
* @brief WDI event handler
|
||||
* @details
|
||||
* This function handles in the events posted by the packet logger.
|
||||
* This function shall only be called if there was a successful prior call
|
||||
* to event_sub() on the same wdi_event_subscribe object.
|
||||
*
|
||||
* @param soc - pointer to the soc
|
||||
* @param pdev - the data physical device object
|
||||
* @param event - which event is being handled
|
||||
* @param event - data for the event
|
||||
* @return - int
|
||||
*/
|
||||
static inline A_STATUS
|
||||
cdp_wdi_event_handler(ol_txrx_soc_handle soc,
|
||||
struct cdp_pdev *pdev, uint32_t event, void *evt_data)
|
||||
{
|
||||
if (!soc || !soc->ops || !soc->ops->ctrl_ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
|
||||
"%s invalid instance", __func__);
|
||||
return A_ERROR;
|
||||
}
|
||||
|
||||
if (soc->ops->ctrl_ops->txrx_wdi_event_handler)
|
||||
return soc->ops->ctrl_ops->txrx_wdi_event_handler
|
||||
(pdev, event, evt_data);
|
||||
|
||||
return A_OK;
|
||||
}
|
||||
|
||||
static inline void *
|
||||
cdp_get_pldev(ol_txrx_soc_handle soc,
|
||||
|
@@ -507,8 +507,6 @@ struct cdp_ctrl_ops {
|
||||
|
||||
void (*txrx_set_pdev_param)(struct cdp_pdev *pdev,
|
||||
enum cdp_pdev_param_type type, uint8_t val);
|
||||
int (*txrx_wdi_event_handler)(struct cdp_pdev *pdev,
|
||||
uint32_t event, void *evt_data);
|
||||
void * (*txrx_get_pldev)(struct cdp_pdev *pdev);
|
||||
|
||||
#ifdef ATH_SUPPORT_NAC_RSSI
|
||||
|
@@ -233,10 +233,11 @@ qdf_sysctl_decl(ath_sysctl_pktlog_enable, ctl, write, filp, buffer, lenp, ppos)
|
||||
if (write) {
|
||||
ret = QDF_SYSCTL_PROC_DOINTVEC(ctl, write, filp, buffer,
|
||||
lenp, ppos);
|
||||
if (ret == 0)
|
||||
if (ret == 0) {
|
||||
ret = pl_dev->pl_funcs->pktlog_enable(
|
||||
(struct hif_opaque_softc *)scn, enable,
|
||||
cds_is_packet_log_enabled(), 0, 1);
|
||||
}
|
||||
else
|
||||
QDF_TRACE(QDF_MODULE_ID_SYS, QDF_TRACE_LEVEL_DEBUG,
|
||||
"Line:%d %s:proc_dointvec failed reason %d",
|
||||
|
@@ -616,7 +616,6 @@ static int __pktlog_enable(struct hif_opaque_softc *scn, int32_t log_state,
|
||||
|
||||
pl_dev->tgt_pktlog_alloced = true;
|
||||
}
|
||||
|
||||
if (log_state != 0) {
|
||||
/* WDI subscribe */
|
||||
if (!pl_dev->is_pktlog_cb_subscribed) {
|
||||
@@ -871,11 +870,6 @@ void pktlog_process_fw_msg(uint32_t *buff)
|
||||
uint32_t *pl_hdr;
|
||||
uint32_t log_type;
|
||||
struct cdp_pdev *pdev = get_txrx_context();
|
||||
#ifdef CONFIG_MCL
|
||||
void *soc = cds_get_context(QDF_MODULE_ID_SOC);
|
||||
#else
|
||||
/*TODO: WIN implementation to get soc */
|
||||
#endif
|
||||
|
||||
if (!pdev) {
|
||||
qdf_print("%s: txrx_pdev is NULL", __func__);
|
||||
@@ -892,20 +886,20 @@ void pktlog_process_fw_msg(uint32_t *buff)
|
||||
|| (log_type == PKTLOG_TYPE_TX_MSDU_ID)
|
||||
|| (log_type == PKTLOG_TYPE_TX_FRM_HDR)
|
||||
|| (log_type == PKTLOG_TYPE_TX_VIRT_ADDR))
|
||||
cdp_wdi_event_handler(soc, pdev,
|
||||
WDI_EVENT_TX_STATUS, pl_hdr);
|
||||
wdi_event_handler(WDI_EVENT_TX_STATUS,
|
||||
pdev, pl_hdr);
|
||||
else if (log_type == PKTLOG_TYPE_RC_FIND)
|
||||
cdp_wdi_event_handler(soc, pdev,
|
||||
WDI_EVENT_RATE_FIND, pl_hdr);
|
||||
wdi_event_handler(WDI_EVENT_RATE_FIND,
|
||||
pdev, pl_hdr);
|
||||
else if (log_type == PKTLOG_TYPE_RC_UPDATE)
|
||||
cdp_wdi_event_handler(soc, pdev,
|
||||
WDI_EVENT_RATE_UPDATE, pl_hdr);
|
||||
wdi_event_handler(WDI_EVENT_RATE_UPDATE,
|
||||
pdev, pl_hdr);
|
||||
else if (log_type == PKTLOG_TYPE_RX_STAT)
|
||||
cdp_wdi_event_handler(soc, pdev,
|
||||
WDI_EVENT_RX_DESC, pl_hdr);
|
||||
wdi_event_handler(WDI_EVENT_RX_DESC,
|
||||
pdev, pl_hdr);
|
||||
else if (log_type == PKTLOG_TYPE_SW_EVENT)
|
||||
cdp_wdi_event_handler(soc, pdev,
|
||||
WDI_EVENT_SW_EVENT, pl_hdr);
|
||||
wdi_event_handler(WDI_EVENT_SW_EVENT,
|
||||
pdev, pl_hdr);
|
||||
}
|
||||
|
||||
#if defined(QCA_WIFI_3_0_ADRASTEA)
|
||||
|
Reference in New Issue
Block a user