Forráskód Böngészése

qcacld-3.0: Enable Napier monitor mode configuration

Host is required to send HTT messages to firmware to configure
and enable monitor mode. The HTT message requests the firmware
to subscribe the TLVs, packet types and also monitor mode type.

CRs-Fixed: 2071621
Change-Id: If2da5de01f3a7eb594e25b421bc17f97498c8a92
Ravi Joshi 7 éve
szülő
commit
4f095955f4

+ 5 - 0
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 <net/cnss_nl.h>
@@ -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;
 }
 

+ 23 - 0
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);
+}

+ 8 - 2
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 */