From 062fb036ec9d4c0deb4b9b7637870a25640d4ba0 Mon Sep 17 00:00:00 2001 From: Arunk Khandavalli Date: Wed, 4 Oct 2017 12:18:15 +0530 Subject: [PATCH] qcacld-3.0: Add SSR support for monitor mode Presently SSR is not supported in the monitor mode, in the debug builds the device enters bad state when the SSR is triggered in the monitor mode. Make changes to support SSR in monitor mode. Change-Id: Iee88a0c1aca1b093607cea20ee1957be55a33598 CRs-Fixed: 2034240 --- core/hdd/inc/wlan_hdd_main.h | 2 ++ core/hdd/inc/wlan_hdd_wext.h | 10 ++++++++++ core/hdd/src/wlan_hdd_main.c | 7 ++++++- core/hdd/src/wlan_hdd_power.c | 4 ++++ core/hdd/src/wlan_hdd_tx_rx.c | 4 ---- core/hdd/src/wlan_hdd_wext.c | 12 +++--------- 6 files changed, 25 insertions(+), 14 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 84b943796ab0..1e9b5c8a2ffc 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1325,6 +1325,8 @@ struct hdd_adapter { bool con_status; bool dad; uint8_t active_ac; + uint32_t mon_chan; + uint32_t mon_bandwidth; }; #define WLAN_HDD_GET_STATION_CTX_PTR(pAdapter) (&(pAdapter)->sessionCtx.station) diff --git a/core/hdd/inc/wlan_hdd_wext.h b/core/hdd/inc/wlan_hdd_wext.h index aea2bd6396d9..96098c4202c2 100644 --- a/core/hdd/inc/wlan_hdd_wext.h +++ b/core/hdd/inc/wlan_hdd_wext.h @@ -464,4 +464,14 @@ int wlan_hdd_get_peer_info(struct hdd_adapter *adapter, struct qdf_mac_addr macaddress, struct sir_peer_info_ext *peer_info_ext); +/** + * wlan_hdd_set_mon_chan() - Set capture channel on the monitor mode interface. + * @adapter: Handle to adapter + * @chan: Monitor mode channel + * @bandwidth: Capture channel bandwidth + * + * Return: 0 on success else error code. + */ +int wlan_hdd_set_mon_chan(struct hdd_adapter *adapter, uint32_t chan, + uint32_t bandwidth); #endif /* __WEXT_IW_H__ */ diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index f9615b42cb70..a3f00efe9a45 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -5154,7 +5154,12 @@ QDF_STATUS hdd_start_all_adapters(struct hdd_context *hdd_ctx) GFP_KERNEL); #endif break; - + case QDF_MONITOR_MODE: + hdd_init_station_mode(adapter); + hdd_set_mon_rx_cb(adapter->dev); + wlan_hdd_set_mon_chan(adapter, adapter->mon_chan, + adapter->mon_bandwidth); + break; default: break; } diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 31c3713a8a28..40d6206a79d4 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -1385,8 +1385,12 @@ QDF_STATUS hdd_wlan_re_init(void) pAdapter = hdd_get_adapter(hdd_ctx, QDF_SAP_MODE); if (!pAdapter) { pAdapter = hdd_get_adapter(hdd_ctx, QDF_IBSS_MODE); + if (!pAdapter) { + pAdapter = hdd_get_adapter(hdd_ctx, + QDF_MONITOR_MODE); if (!pAdapter) hdd_err("Failed to get Adapter!"); + } } } diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c index 0ff9d9671668..084012cc0e4c 100644 --- a/core/hdd/src/wlan_hdd_tx_rx.c +++ b/core/hdd/src/wlan_hdd_tx_rx.c @@ -1693,10 +1693,6 @@ int hdd_set_mon_rx_cb(struct net_device *dev) void *soc = cds_get_context(QDF_MODULE_ID_SOC); void *pdev = cds_get_context(QDF_MODULE_ID_TXRX); - ret = wlan_hdd_validate_context(hdd_ctx); - if (0 != ret) - return ret; - qdf_mem_zero(&txrx_ops, sizeof(txrx_ops)); txrx_ops.rx.rx = hdd_mon_rx_packet_cbk; hdd_monitor_set_rx_monitor_cb(&txrx_ops, hdd_rx_monitor_callback); diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 1870b9e49c58..d7ea5d7fd860 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -12907,15 +12907,7 @@ static int iw_set_band_config(struct net_device *dev, return ret; } -/** - * wlan_hdd_set_mon_chan() - Set capture channel on the monitor mode interface. - * @adapter: Handle to adapter - * @chan: Monitor mode channel - * @bandwidth: Capture channel bandwidth - * - * Return: 0 on success else error code. - */ -static int wlan_hdd_set_mon_chan(struct hdd_adapter *adapter, uint32_t chan, +int wlan_hdd_set_mon_chan(struct hdd_adapter *adapter, uint32_t chan, uint32_t bandwidth) { struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); @@ -12957,6 +12949,8 @@ static int wlan_hdd_set_mon_chan(struct hdd_adapter *adapter, uint32_t chan, status); } + adapter->mon_chan = chan; + adapter->mon_bandwidth = bandwidth; return qdf_status_to_os_return(status); }