qcacmn: Adding cdp interface for wdi events

Adding subscribe and unsubscribe functions for wdi events in
cdp layer to enable for legacy alone and disable for lithium
data path.

Change-Id: Ibdf449393d0cb59c4c46c712c7a72695e086ab6c
This commit is contained in:
Nandha Kishore Easwaran
2017-04-17 16:52:46 +05:30
committed by snandini
parent a973e13df7
commit 2668994354
2 changed files with 68 additions and 0 deletions

View File

@@ -341,4 +341,66 @@ cdp_peer_set_nawds(ol_txrx_soc_handle soc,
(peer, value);
return;
}
/**
* @brief Subscribe to a specified WDI event.
* @details
* This function adds the provided wdi_event_subscribe object to a list of
* subscribers for the specified WDI event.
* When the event in question happens, each subscriber for the event will
* have their callback function invoked.
* The order in which callback functions from multiple subscribers are
* invoked is unspecified.
*
* @param soc - pointer to the soc
* @param pdev - the data physical device object
* @param event_cb_sub - the callback and context for the event subscriber
* @param event - which event's notifications are being subscribed to
* @return - int
*/
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 || !soc->ops->ctrl_ops) {
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
"%s invalid instance", __func__);
return 0;
}
if (soc->ops->ctrl_ops->txrx_wdi_event_sub)
return soc->ops->ctrl_ops->txrx_wdi_event_sub
(pdev, event_cb_sub, event);
return 0;
}
/**
* @brief Unsubscribe from a specified WDI event.
* @details
* This function removes the provided event subscription object from the
* list of subscribers for its event.
* 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_cb_sub - the callback and context for the event subscriber
* @param event - which event's notifications are being subscribed to
* @return - int
*/
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 || !soc->ops->ctrl_ops) {
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
"%s invalid instance", __func__);
return 0;
}
if (soc->ops->ctrl_ops->txrx_wdi_event_unsub)
return soc->ops->ctrl_ops->txrx_wdi_event_unsub
(pdev, event_cb_sub, event);
return 0;
}
#endif