qcacld-3.0: Don't add monitor mode if no interface is up
Check if any interface is up and if no interface is up do not add monitor mode. Change-Id: I2e1218a14881f597885334c0a195758ed35c5e5b CRs-Fixed: 2644285
This commit is contained in:

committed by
nshrivas

parent
5dedd644e6
commit
53fff0890d
@@ -4154,7 +4154,6 @@ bool wlan_hdd_check_mon_concurrency(void);
|
||||
* wlan_hdd_add_monitor_check() - check for monitor intf and add if needed
|
||||
* @hdd_ctx: pointer to hdd context
|
||||
* @adapter: output pointer to hold created monitor adapter
|
||||
* @type: type of the interface
|
||||
* @name: name of the interface
|
||||
* @rtnl_held: True if RTNL lock is held
|
||||
* @name_assign_type: the name of assign type of the netdev
|
||||
@@ -4164,8 +4163,8 @@ bool wlan_hdd_check_mon_concurrency(void);
|
||||
*/
|
||||
int wlan_hdd_add_monitor_check(struct hdd_context *hdd_ctx,
|
||||
struct hdd_adapter **adapter,
|
||||
enum nl80211_iftype type, const char *name,
|
||||
bool rtnl_held, unsigned char name_assign_type);
|
||||
const char *name, bool rtnl_held,
|
||||
unsigned char name_assign_type);
|
||||
|
||||
/**
|
||||
* wlan_hdd_del_monitor() - delete monitor interface
|
||||
@@ -4195,8 +4194,8 @@ bool wlan_hdd_check_mon_concurrency(void)
|
||||
static inline
|
||||
int wlan_hdd_add_monitor_check(struct hdd_context *hdd_ctx,
|
||||
struct hdd_adapter **adapter,
|
||||
enum nl80211_iftype type, const char *name,
|
||||
bool rtnl_held, unsigned char name_assign_type)
|
||||
const char *name, bool rtnl_held,
|
||||
unsigned char name_assign_type)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@@ -16652,7 +16652,6 @@ void wlan_hdd_del_monitor(struct hdd_context *hdd_ctx,
|
||||
* wlan_hdd_add_monitor_check() - check for monitor intf and add if needed
|
||||
* @hdd_ctx: pointer to hdd context
|
||||
* @adapter: output pointer to hold created monitor adapter
|
||||
* @type: type of the interface
|
||||
* @name: name of the interface
|
||||
* @rtnl_held: True if RTNL lock is held
|
||||
* @name_assign_type: the name of assign type of the netdev
|
||||
@@ -16663,25 +16662,23 @@ void wlan_hdd_del_monitor(struct hdd_context *hdd_ctx,
|
||||
int
|
||||
wlan_hdd_add_monitor_check(struct hdd_context *hdd_ctx,
|
||||
struct hdd_adapter **adapter,
|
||||
enum nl80211_iftype type, const char *name,
|
||||
bool rtnl_held, unsigned char name_assign_type)
|
||||
const char *name, bool rtnl_held,
|
||||
unsigned char name_assign_type)
|
||||
{
|
||||
struct hdd_adapter *sta_adapter;
|
||||
struct hdd_adapter *mon_adapter;
|
||||
uint32_t mode;
|
||||
uint8_t num_open_session = 0;
|
||||
|
||||
if (!ucfg_pkt_capture_get_mode(hdd_ctx->psoc))
|
||||
return 0;
|
||||
/* if no interface is up do not add monitor mode */
|
||||
if (!hdd_is_any_interface_open(hdd_ctx))
|
||||
return -EINVAL;
|
||||
|
||||
/*
|
||||
* If add interface request is for monitor mode, then it can run in
|
||||
* parallel with only one station interface.
|
||||
* If there is no existing station interface return error
|
||||
*/
|
||||
if (type != NL80211_IFTYPE_MONITOR)
|
||||
return 0;
|
||||
|
||||
if (QDF_STATUS_SUCCESS != policy_mgr_mode_specific_num_open_sessions(
|
||||
hdd_ctx->psoc,
|
||||
QDF_MONITOR_MODE,
|
||||
|
@@ -51,6 +51,7 @@
|
||||
#include "wlan_p2p_cfg_api.h"
|
||||
#include "wlan_policy_mgr_ucfg.h"
|
||||
#include "nan_ucfg_api.h"
|
||||
#include "wlan_pkt_capture_ucfg_api.h"
|
||||
|
||||
/* Ms to Time Unit Micro Sec */
|
||||
#define MS_TO_TU_MUS(x) ((x) * 1024)
|
||||
@@ -722,13 +723,17 @@ struct wireless_dev *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy,
|
||||
}
|
||||
|
||||
adapter = NULL;
|
||||
ret = wlan_hdd_add_monitor_check(hdd_ctx, &adapter, type, name,
|
||||
true, name_assign_type);
|
||||
if (ret)
|
||||
return ERR_PTR(-EINVAL);
|
||||
if (adapter) {
|
||||
hdd_exit();
|
||||
return adapter->dev->ieee80211_ptr;
|
||||
if ((ucfg_pkt_capture_get_mode(hdd_ctx->psoc)) &&
|
||||
(type == NL80211_IFTYPE_MONITOR)) {
|
||||
ret = wlan_hdd_add_monitor_check(hdd_ctx, &adapter, name,
|
||||
true, name_assign_type);
|
||||
if (ret)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
if (adapter) {
|
||||
hdd_exit();
|
||||
return adapter->dev->ieee80211_ptr;
|
||||
}
|
||||
}
|
||||
|
||||
if (mode == QDF_SAP_MODE) {
|
||||
|
Reference in New Issue
Block a user