diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 620fb416167e..b578d179903a 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -120,6 +120,7 @@ #include "os_if_nan.h" #include "nan_public_structs.h" #include "wlan_reg_ucfg_api.h" +#include "wlan_hdd_rx_monitor.h" #ifdef CNSS_GENL #include @@ -1701,6 +1702,10 @@ static int __hdd_mon_open(struct net_device *dev) ENTER_DEV(dev); hdd_mon_mode_ether_setup(dev); ret = hdd_set_mon_rx_cb(dev); + + if (!ret) + ret = hdd_enable_monitor_mode(dev); + return ret; } diff --git a/core/hdd/src/wlan_hdd_rx_monitor.c b/core/hdd/src/wlan_hdd_rx_monitor.c index 8fcbe6fae029..7ba03960d481 100644 --- a/core/hdd/src/wlan_hdd_rx_monitor.c +++ b/core/hdd/src/wlan_hdd_rx_monitor.c @@ -118,3 +118,26 @@ void hdd_monitor_set_rx_monitor_cb(struct ol_txrx_ops *txrx, { txrx->rx.mon = rx_monitor_cb; } + +/** + * hdd_enable_monitor_mode() - Enable monitor mode + * @dev: Pointer to the net_device structure + * + * This function invokes cdp interface API to enable + * monitor mode configuration on the hardware. In this + * case sends HTT messages to FW to setup hardware rings + * + * Return: 0 for success; non-zero for failure + */ +int hdd_enable_monitor_mode(struct net_device *dev) +{ + void *soc = cds_get_context(QDF_MODULE_ID_SOC); + void *pdev = cds_get_context(QDF_MODULE_ID_TXRX); + hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev); + + ENTER_DEV(dev); + + return cdp_set_monitor_mode(soc, + (struct cdp_vdev *)cdp_get_vdev_from_vdev_id(soc, + (struct cdp_pdev *)pdev, adapter->sessionId), false); +} diff --git a/core/hdd/src/wlan_hdd_rx_monitor.h b/core/hdd/src/wlan_hdd_rx_monitor.h index 161b8a14bbd1..415b52325109 100644 --- a/core/hdd/src/wlan_hdd_rx_monitor.h +++ b/core/hdd/src/wlan_hdd_rx_monitor.h @@ -37,12 +37,18 @@ void hdd_monitor_set_rx_monitor_cb(struct ol_txrx_ops *txrx, void hdd_rx_monitor_callback(ol_osif_vdev_handle vdev, qdf_nbuf_t mpdu, void *rx_status); + +int hdd_enable_monitor_mode(struct net_device *dev); #else -static void hdd_monitor_set_rx_monitor_cb(struct ol_txrx_ops *txrx, +static inline void hdd_monitor_set_rx_monitor_cb(struct ol_txrx_ops *txrx, ol_txrx_rx_mon_fp rx_monitor_cb){ } -static void hdd_rx_monitor_callback(ol_osif_vdev_handle vdev, +static inline void hdd_rx_monitor_callback(ol_osif_vdev_handle vdev, qdf_nbuf_t mpdu, void *rx_status){ } +static inline int hdd_enable_monitor_mode(struct net_device *dev) +{ + return -ENOSYS; +} #endif /* CONFIG_LITHIUM */ #endif /* __WLAN_HDD_RX_MONITOR_H */