qcacld-3.0: Avoid calling wlan_hdd_set_mon_chan for STA mode

As part of Ie9ffc701d93ed1c050375dd56151b7a0da69cdce the STA mode
channel change was added in disconnected state for spectral scan
test at CV2X platform.

Now with iwpriv wlan0 setMonChan on STA mode, a monitor mode
pe_session is created in PE/LIM which take ref count with
WLAN_LEGACY_MAC_ID. As the interface is STA type this session
is not deleted when vdev is deleted. This lead to vdev ref leak.

This code is broken and is no longer in use and cause vdev
ref leak when executed. Thus revert
Ie9ffc701d93ed1c050375dd56151b7a0da69cdce.

Also move the lim session create to hdd_set_mon_rx_cb during
vdev create, as it is deleted during vdev delete.

Change-Id: Ib60aa2bd2746a8cd17f20efa7506c18784a42630
CRs-Fixed: 2557160
This commit is contained in:
Abhishek Singh 2019-11-01 11:39:38 +05:30 committed by nshrivas
parent 32354389fb
commit 9fee518fe3
13 changed files with 13 additions and 148 deletions

View File

@ -352,8 +352,6 @@ static void mlme_init_generic_cfg(struct wlan_objmgr_psoc *psoc,
cfg_get(psoc, CFG_ENABLE_BEACON_RECEPTION_STATS);
gen->enable_remove_time_stamp_sync_cmd =
cfg_get(psoc, CFG_REMOVE_TIME_STAMP_SYNC_CMD);
gen->enable_change_channel_bandwidth =
cfg_get(psoc, CFG_CHANGE_CHANNEL_BANDWIDTH);
gen->disable_4way_hs_offload =
cfg_get(psoc, CFG_DISABLE_4WAY_HS_OFFLOAD);
}

View File

@ -595,36 +595,6 @@
1, \
"Enable to remove time stamp sync cmd")
/*
* <ini>
* gEnableChangeChannelBandWidth Enable/Disable change
* channel&bandwidth in the mission mode
* @Min: 0
* @Max: 1
* @Default: 0
*
* 0 not allow change channel&bandwidth by setMonChan
* 1 allow change channel&bandwidth by setMonChan
*
* Related: None
*
* Supported Feature: STA
*
* Usage: External
*
* </ini>
*/
#ifdef FEATURE_MONITOR_MODE_SUPPORT
#define CFG_CHANGE_CHANNEL_BANDWIDTH_DEFAULT true
#else
#define CFG_CHANGE_CHANNEL_BANDWIDTH_DEFAULT false
#endif
#define CFG_CHANGE_CHANNEL_BANDWIDTH CFG_INI_BOOL( \
"gEnableChangeChannelBandWidth", \
CFG_CHANGE_CHANNEL_BANDWIDTH_DEFAULT, \
"enable change channel bw")
/*
* <ini>
* disable_4way_hs_offload - Enable/Disable 4 way handshake offload to firmware
@ -674,6 +644,5 @@
CFG(CFG_ITO_REPEAT_COUNT) \
CFG(CFG_ENABLE_BEACON_RECEPTION_STATS) \
CFG(CFG_REMOVE_TIME_STAMP_SYNC_CMD) \
CFG(CFG_CHANGE_CHANNEL_BANDWIDTH)
#endif /* __CFG_MLME_GENERIC_H */

View File

@ -2036,16 +2036,6 @@ QDF_STATUS wlan_mlme_ibss_power_save_setup(struct wlan_objmgr_psoc *psoc,
QDF_STATUS
wlan_mlme_set_11d_enabled(struct wlan_objmgr_psoc *psoc, bool value);
/**
* wlan_mlme_is_change_channel_bandwidth_enabled() - get the
* enable_change_channel_bandwidth flag
* @psoc: psoc context
*
* Return: true if enabled
*/
bool
wlan_mlme_is_change_channel_bandwidth_enabled(struct wlan_objmgr_psoc *psoc);
/**
* wlan_mlme_get_sta_miracast_mcc_rest_time() - Get STA/MIRACAST MCC rest time
*

View File

@ -1140,7 +1140,6 @@ struct wlan_mlme_generic {
bool enable_beacon_reception_stats;
bool enable_remove_time_stamp_sync_cmd;
bool data_stall_recovery_fw_support;
bool enable_change_channel_bandwidth;
bool disable_4way_hs_offload;
bool as_enabled;
};

View File

@ -2609,19 +2609,6 @@ ucfg_mlme_set_11d_enabled(struct wlan_objmgr_psoc *psoc, bool value)
return wlan_mlme_set_11d_enabled(psoc, value);
}
/**
* ucfg_mlme_is_change_channel_bandwidth_enabled() - ucfg api to get the
* enable_change_channel_bandwidth flag
* @psoc: psoc context
*
* Return: true if enabled
*/
static inline bool
ucfg_mlme_is_change_channel_bandwidth_enabled(struct wlan_objmgr_psoc *psoc)
{
return wlan_mlme_is_change_channel_bandwidth_enabled(psoc);
}
/**
* ucfg_mlme_get_opr_rate_set() - Get operational rate set
* @psoc: pointer to psoc object

View File

@ -2618,18 +2618,6 @@ wlan_mlme_set_11d_enabled(struct wlan_objmgr_psoc *psoc, bool value)
return QDF_STATUS_SUCCESS;
}
bool
wlan_mlme_is_change_channel_bandwidth_enabled(struct wlan_objmgr_psoc *psoc)
{
struct wlan_mlme_psoc_ext_obj *mlme_obj;
mlme_obj = mlme_get_psoc_ext_obj(psoc);
if (!mlme_obj)
return cfg_default(CFG_CHANGE_CHANNEL_BANDWIDTH);
return mlme_obj->cfg.gen.enable_change_channel_bandwidth;
}
QDF_STATUS
wlan_mlme_cfg_set_vht_chan_width(struct wlan_objmgr_psoc *psoc, uint8_t value)
{

View File

@ -17524,10 +17524,6 @@ void hdd_select_cbmode(struct hdd_adapter *adapter, uint32_t oper_freq,
{
uint32_t sec_ch_freq = 0;
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
struct hdd_station_ctx *station_ctx =
WLAN_HDD_GET_STATION_CTX_PTR(adapter);
eConnectionState connstate;
bool cbmode_select = false;
/*
* CDS api expects secondary channel for calculating
@ -17545,16 +17541,7 @@ void hdd_select_cbmode(struct hdd_adapter *adapter, uint32_t oper_freq,
wlan_reg_set_channel_params_for_freq(hdd_ctx->pdev, oper_freq,
sec_ch_freq, ch_params);
if (adapter->device_mode == QDF_STA_MODE &&
ucfg_mlme_is_change_channel_bandwidth_enabled(hdd_ctx->psoc)) {
connstate = station_ctx->conn_info.conn_state;
if (!(eConnectionState_Associated == connstate ||
eConnectionState_Connecting == connstate)) {
cbmode_select = true;
}
}
if (cds_get_conparam() == QDF_GLOBAL_MONITOR_MODE || cbmode_select)
if (cds_get_conparam() == QDF_GLOBAL_MONITOR_MODE)
hdd_mon_select_cbmode(adapter, oper_freq, ch_params);
}

View File

@ -6847,25 +6847,14 @@ int wlan_hdd_set_mon_chan(struct hdd_adapter *adapter, uint32_t chan,
struct hdd_station_ctx *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
struct hdd_mon_set_ch_info *ch_info = &sta_ctx->ch_info;
QDF_STATUS status;
mac_handle_t mac_handle = hdd_ctx->mac_handle;
struct qdf_mac_addr bssid;
struct csr_roam_profile roam_profile;
struct ch_params ch_params;
eConnectionState connstate;
if (hdd_get_conparam() != QDF_GLOBAL_MONITOR_MODE &&
adapter->device_mode != QDF_STA_MODE) {
hdd_err("Not supported, device is not in monitor mode or sta mission mode");
if (hdd_get_conparam() != QDF_GLOBAL_MONITOR_MODE) {
hdd_err("Not supported, device is not in monitor mode");
return -EINVAL;
}
if (adapter->device_mode == QDF_STA_MODE &&
ucfg_mlme_is_change_channel_bandwidth_enabled(hdd_ctx->psoc)) {
connstate = sta_ctx->conn_info.conn_state;
if (eConnectionState_Associated == connstate ||
eConnectionState_Connecting == connstate) {
return -EINVAL;
}
}
/* Validate Channel */
if (!WLAN_REG_IS_24GHZ_CH(chan) && !WLAN_REG_IS_5GHZ_CH(chan)) {
@ -6901,17 +6890,7 @@ int wlan_hdd_set_mon_chan(struct hdd_adapter *adapter, uint32_t chan,
roam_profile.ch_params.ch_width = bandwidth;
hdd_select_cbmode(adapter, wlan_chan_to_freq(chan),
&roam_profile.ch_params);
if (ucfg_mlme_is_change_channel_bandwidth_enabled(hdd_ctx->psoc) &&
(!sme_find_session_by_bssid(mac_handle, adapter->mac_addr.bytes))) {
status = sme_create_mon_session(mac_handle,
adapter->mac_addr.bytes,
adapter->vdev_id);
if (status != QDF_STATUS_SUCCESS) {
hdd_err("Status: %d Failed to create session.",
status);
return qdf_status_to_os_return(status);
}
}
qdf_mem_copy(bssid.bytes, adapter->mac_addr.bytes,
QDF_MAC_ADDR_SIZE);

View File

@ -2709,6 +2709,7 @@ void hdd_print_netdev_txq_status(struct net_device *dev)
int hdd_set_mon_rx_cb(struct net_device *dev)
{
struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
int ret;
QDF_STATUS qdf_status;
struct ol_txrx_desc_type sta_desc = {0};
@ -2734,6 +2735,14 @@ int hdd_set_mon_rx_cb(struct net_device *dev)
goto exit;
}
qdf_status = sme_create_mon_session(hdd_ctx->mac_handle,
adapter->mac_addr.bytes,
adapter->vdev_id);
if (QDF_STATUS_SUCCESS != qdf_status) {
hdd_err("sme_create_mon_session() failed to register. Status= %d [0x%08X]",
qdf_status, qdf_status);
}
exit:
ret = qdf_status_to_os_return(qdf_status);
return ret;

View File

@ -1103,7 +1103,6 @@ static inline void csr_roaming_report_diag_event(
{}
#endif
bool csr_find_session_by_bssid(struct mac_context *mac_ctx, uint8_t *bssid);
QDF_STATUS csr_get_channels_and_power(struct mac_context *mac);
bool csr_nonscan_active_ll_is_list_empty(

View File

@ -3536,16 +3536,6 @@ static inline int sme_add_key_krk(mac_handle_t mac_handle, uint8_t session_id,
}
#endif
/**
* sme_find_session_by_bssid() - checks whether has session
* with given bssid
* @mac_handle: Opaque handle to the global MAC context
* @bssid: bssid
* Return: true - if has the session
* false - if not has the session
*/
bool sme_find_session_by_bssid(mac_handle_t mac_handle, uint8_t *bssid);
/**
* sme_get_roam_scan_stats() - Send roam scan stats cmd to wma
* @mac_handle: handle returned by mac_open

View File

@ -15324,16 +15324,6 @@ uint8_t sme_get_mcs_idx(uint16_t raw_rate, enum tx_rate_info rate_flags,
nss, dcm, guard_interval, mcs_rate_flags);
}
bool sme_find_session_by_bssid(mac_handle_t mac_handle, uint8_t *bssid)
{
struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle);
bool ret;
ret = csr_find_session_by_bssid(mac_ctx, bssid);
return ret;
}
#ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
QDF_STATUS sme_get_sta_cxn_info(mac_handle_t mac_handle, uint32_t session_id,
char *buf, uint32_t buf_sz)

View File

@ -20903,26 +20903,6 @@ csr_find_session_by_type(struct mac_context *mac_ctx, enum QDF_OPMODE type)
}
return session_id;
}
/**
* csr_find_session_by_bssid() - This function will find given bssid from
* all sessions.
* @mac_ctx: pointer to mac context.
* @bssid: session bssid
* Return: false or true.
**/
bool
csr_find_session_by_bssid(struct mac_context *mac_ctx, uint8_t *bssid)
{
struct pe_session *session_entry;
uint8_t session_id; /* PE session_id */
session_entry = pe_find_session_by_bssid(mac_ctx,
bssid, &session_id);
if (session_entry)
return true;
else
return false;
}
/**
* csr_is_conn_allow_2g_band() - This function will check if station's conn