mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
qcacmn: Add support to drop beacon if channel mismatch
Add support to drop beacon, probe response frames if frame receipt channel and channel mentioned in IEs dont match. Change-Id: Ib545f125dc53ccfb21abf6bdcb94a327ecde5a0a CRs-Fixed: 2149224
This commit is contained in:
parent
8b221806ac
commit
5e47d43331
5 changed files with 100 additions and 37 deletions
|
|
@ -694,6 +694,20 @@ QDF_STATUS scm_handle_bcn_probe(struct scheduler_msg *msg)
|
|||
|
||||
scan_entry = scan_node->entry;
|
||||
|
||||
if (scan_obj->drop_bcn_on_chan_mismatch &&
|
||||
scan_entry->channel_mismatch) {
|
||||
scm_debug("Channel mismatch: Received %s from BSSID: %pM "
|
||||
"tsf_delta = %u Seq Num: %x ssid:%.*s, rssi: %d",
|
||||
(bcn->frm_type == MGMT_SUBTYPE_PROBE_RESP) ?
|
||||
"Probe Rsp" : "Beacon", scan_entry->bssid.bytes,
|
||||
scan_entry->tsf_delta, scan_entry->seq_num,
|
||||
scan_entry->ssid.length, scan_entry->ssid.ssid,
|
||||
scan_entry->rssi_raw);
|
||||
util_scan_free_cache_entry(scan_entry);
|
||||
qdf_mem_free(scan_node);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (scan_obj->cb.update_beacon)
|
||||
scan_obj->cb.update_beacon(pdev, scan_entry);
|
||||
|
||||
|
|
|
|||
|
|
@ -436,6 +436,7 @@ struct scan_cb {
|
|||
* @bt_a2dp_enabled: if bt a2dp is enabled
|
||||
* @miracast_enabled: miracast enabled
|
||||
* @disable_timeout: command timeout disabled
|
||||
* @drop_bcn_on_chan_mismatch: drop bcn if channel mismatch
|
||||
* @scan_start_request_buff: buffer used to pass
|
||||
* scan config to event handlers
|
||||
*/
|
||||
|
|
@ -455,6 +456,7 @@ struct wlan_scan_obj {
|
|||
bool bt_a2dp_enabled;
|
||||
bool miracast_enabled;
|
||||
bool disable_timeout;
|
||||
bool drop_bcn_on_chan_mismatch;
|
||||
struct scan_start_request scan_start_request_buff;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1329,4 +1329,15 @@ typedef void (*update_beacon_cb) (struct wlan_objmgr_pdev *pdev,
|
|||
*/
|
||||
typedef QDF_STATUS (*scan_iterator_func) (void *arg,
|
||||
struct scan_cache_entry *scan_entry);
|
||||
|
||||
/**
|
||||
* enum scan_priority - scan priority definitions
|
||||
* @SCAN_CFG_DISABLE_SCAN_COMMAND_TIMEOUT: disable scan command timeout
|
||||
* @SCAN_CFG_DROP_BCN_ON_CHANNEL_MISMATCH: config to drop beacon/probe
|
||||
* response frames if received channel and IE channels do not match
|
||||
*/
|
||||
enum scan_config {
|
||||
SCAN_CFG_DISABLE_SCAN_COMMAND_TIMEOUT,
|
||||
SCAN_CFG_DROP_BCN_ON_CHANNEL_MISMATCH,
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -200,23 +200,28 @@ QDF_STATUS ucfg_scan_set_miracast(
|
|||
struct wlan_objmgr_psoc *psoc, bool enable);
|
||||
|
||||
/**
|
||||
* ucfg_scan_set_disable_timeout() - Public API to disable/enable scan timeout
|
||||
* @psoc: psoc on which scan timeout need to be disabled
|
||||
* @disable: disable scan timeout if true else enable scan timeout
|
||||
* ucfg_scan_set_global_config() - Public API to set global scan config
|
||||
* @psoc: psoc context
|
||||
* @config: config to set
|
||||
* @val: new config value
|
||||
*
|
||||
* Return: QDF_STATUS.
|
||||
*/
|
||||
QDF_STATUS
|
||||
ucfg_scan_set_disable_timeout(struct wlan_objmgr_psoc *psoc, bool disable);
|
||||
ucfg_scan_set_global_config(struct wlan_objmgr_psoc *psoc,
|
||||
enum scan_config config, uint32_t val);
|
||||
|
||||
/**
|
||||
* ucfg_scan_get_disable_timeout() - Public API to get if scan timeout
|
||||
* is enabled or disabled
|
||||
* @psoc: psoc on which scan timeout status need to be checked
|
||||
* ucfg_scan_get_global_config() - Public API to get global scan config
|
||||
* @psoc: psoc context
|
||||
* @config: config to set
|
||||
* @val: uint32* to hold returned config value
|
||||
*
|
||||
* Return: true if timeout is diaabled else false.
|
||||
* Return: QDF_STATUS.
|
||||
*/
|
||||
bool ucfg_scan_get_disable_timeout(struct wlan_objmgr_psoc *psoc);
|
||||
QDF_STATUS
|
||||
ucfg_scan_get_global_config(struct wlan_objmgr_psoc *psoc,
|
||||
enum scan_config config, uint32_t *val);
|
||||
|
||||
/**
|
||||
* ucfg_scan_set_wide_band_scan() - Public API to disable/enable wide band scan
|
||||
|
|
|
|||
|
|
@ -949,34 +949,6 @@ QDF_STATUS ucfg_scan_set_miracast(
|
|||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
ucfg_scan_set_disable_timeout(struct wlan_objmgr_psoc *psoc, bool disable)
|
||||
{
|
||||
struct wlan_scan_obj *scan_obj;
|
||||
|
||||
scan_obj = wlan_psoc_get_scan_obj(psoc);
|
||||
if (!scan_obj) {
|
||||
scm_err("Failed to get scan object");
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
scan_obj->disable_timeout = disable;
|
||||
scm_debug("set disable_timeout to %d", scan_obj->disable_timeout);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
bool ucfg_scan_get_disable_timeout(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct wlan_scan_obj *scan_obj;
|
||||
|
||||
scan_obj = wlan_psoc_get_scan_obj(psoc);
|
||||
if (!scan_obj) {
|
||||
scm_err("Failed to get scan object");
|
||||
return false;
|
||||
}
|
||||
return scan_obj->disable_timeout;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
ucfg_scan_set_wide_band_scan(struct wlan_objmgr_pdev *pdev, bool enable)
|
||||
{
|
||||
|
|
@ -1309,6 +1281,7 @@ static QDF_STATUS
|
|||
wlan_scan_global_init(struct wlan_scan_obj *scan_obj)
|
||||
{
|
||||
scan_obj->enable_scan = true;
|
||||
scan_obj->drop_bcn_on_chan_mismatch = true;
|
||||
scan_obj->disable_timeout = false;
|
||||
scan_obj->scan_def.active_dwell = SCAN_ACTIVE_DWELL_TIME;
|
||||
scan_obj->scan_def.passive_dwell = SCAN_PASSIVE_DWELL_TIME;
|
||||
|
|
@ -2147,3 +2120,61 @@ bool ucfg_scan_get_bt_activity(struct wlan_objmgr_psoc *psoc)
|
|||
|
||||
return scan_obj->bt_a2dp_enabled;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
ucfg_scan_set_global_config(struct wlan_objmgr_psoc *psoc,
|
||||
enum scan_config config, uint32_t val)
|
||||
{
|
||||
struct wlan_scan_obj *scan_obj;
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
|
||||
scan_obj = wlan_psoc_get_scan_obj(psoc);
|
||||
if (!scan_obj) {
|
||||
scm_err("Failed to get scan object config:%d, val:%d",
|
||||
config, val);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
switch (config) {
|
||||
case SCAN_CFG_DISABLE_SCAN_COMMAND_TIMEOUT:
|
||||
scan_obj->disable_timeout = !!val;
|
||||
break;
|
||||
case SCAN_CFG_DROP_BCN_ON_CHANNEL_MISMATCH:
|
||||
scan_obj->drop_bcn_on_chan_mismatch = !!val;
|
||||
break;
|
||||
|
||||
default:
|
||||
status = QDF_STATUS_E_INVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
ucfg_scan_get_global_config(struct wlan_objmgr_psoc *psoc,
|
||||
enum scan_config config, uint32_t *val)
|
||||
{
|
||||
struct wlan_scan_obj *scan_obj;
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
|
||||
scan_obj = wlan_psoc_get_scan_obj(psoc);
|
||||
if (!scan_obj || !val) {
|
||||
scm_err("scan object:%pK config:%d, val:0x%pK",
|
||||
scan_obj, config, val);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
switch (config) {
|
||||
case SCAN_CFG_DISABLE_SCAN_COMMAND_TIMEOUT:
|
||||
*val = scan_obj->disable_timeout;
|
||||
break;
|
||||
case SCAN_CFG_DROP_BCN_ON_CHANNEL_MISMATCH:
|
||||
*val = scan_obj->drop_bcn_on_chan_mismatch;
|
||||
break;
|
||||
|
||||
default:
|
||||
status = QDF_STATUS_E_INVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue