qcacmn: Never ageout connected AP scan entry

Connected AP scan entry is aged out if beacon
is not recieved within scan age out time.

Update mlme information of the connected AP/BSSID
scan entry so that scan age out hanlder will not
age it out even though the last beacon recieved
time is greater than the configured scan age out value.

Change-Id: I14c68c28459080623ca62c0bad9052e38d7fb348
CRs-Fixed: 2183379
This commit is contained in:
Sandeep Puligilla 2018-02-28 00:27:10 -08:00 • committed by nshrivas
commit e062e82352
5 changed files with 87 additions and 5 deletions

View file

@ -312,6 +312,12 @@ static void scm_check_and_age_out(struct scan_dbs *scan_db,
}
}
static bool scm_bss_is_connected(struct scan_cache_entry *entry)
{
if (entry->mlme_info.assoc_state == SCAN_ENTRY_CON_STATE_ASSOC)
return true;
return false;
}
void scm_age_out_entries(struct wlan_objmgr_psoc *psoc,
struct scan_dbs *scan_db)
{
@ -330,7 +336,8 @@ void scm_age_out_entries(struct wlan_objmgr_psoc *psoc,
cur_node = scm_get_next_node(scan_db,
&scan_db->scan_hash_tbl[i], NULL);
while (cur_node) {
scm_check_and_age_out(scan_db, cur_node,
if (!scm_bss_is_connected(cur_node->entry))
scm_check_and_age_out(scan_db, cur_node,
def_param->scan_cache_aging_time);
next_node = scm_get_next_node(scan_db,
&scan_db->scan_hash_tbl[i], cur_node);
@ -1397,3 +1404,49 @@ QDF_STATUS scm_update_scan_mlme_info(struct wlan_objmgr_pdev *pdev,
return QDF_STATUS_E_INVAL;
}
QDF_STATUS scm_scan_update_mlme_by_bssinfo(struct wlan_objmgr_pdev *pdev,
struct bss_info *bss_info, struct mlme_info *mlme)
{
uint8_t hash_idx;
struct scan_dbs *scan_db;
struct scan_cache_node *cur_node;
struct scan_cache_node *next_node = NULL;
struct wlan_objmgr_psoc *psoc;
struct scan_cache_entry *entry;
psoc = wlan_pdev_get_psoc(pdev);
if (!psoc) {
scm_err("psoc is NULL");
return QDF_STATUS_E_INVAL;
}
scan_db = wlan_pdev_get_scan_db(psoc, pdev);
if (!scan_db) {
scm_err("scan_db is NULL");
return QDF_STATUS_E_INVAL;
}
hash_idx = SCAN_GET_HASH(bss_info->bssid.bytes);
cur_node = scm_get_next_node(scan_db,
&scan_db->scan_hash_tbl[hash_idx], NULL);
while (cur_node) {
entry = cur_node->entry;
if (qdf_is_macaddr_equal(&bss_info->bssid, &entry->bssid) &&
(util_is_ssid_match(&bss_info->ssid, &entry->ssid)) &&
(bss_info->chan == entry->channel.chan_idx)) {
/* Acquire db lock to prevent simultaneous update */
qdf_spin_lock_bh(&scan_db->scan_db_lock);
qdf_mem_copy(&entry->mlme_info, mlme,
sizeof(struct mlme_info));
scm_scan_entry_put_ref(scan_db,
cur_node, false);
qdf_spin_unlock_bh(&scan_db->scan_db_lock);
return QDF_STATUS_SUCCESS;
}
next_node = scm_get_next_node(scan_db,
&scan_db->scan_hash_tbl[hash_idx], cur_node);
cur_node = next_node;
}
return QDF_STATUS_E_INVAL;
}

View file

@ -195,4 +195,16 @@ QDF_STATUS scm_db_deinit(struct wlan_objmgr_psoc *psoc);
*/
void scm_validate_scoring_config(
struct scoring_config *score_cfg);
/**
* scm_scan_update_mlme_by_bssinfo() - updates scan entry with mlme data
* @pdev: pdev object
* @bss_info: BSS information
*
* This function updates scan db with scan_entry->mlme_info
*
* Return: QDF_STATUS
*/
QDF_STATUS scm_scan_update_mlme_by_bssinfo(struct wlan_objmgr_pdev *pdev,
struct bss_info *bss_info, struct mlme_info *mlme);
#endif

View file

@ -198,6 +198,12 @@ struct ie_list {
uint8_t *mbo_oce;
};
enum scan_entry_connection_state {
SCAN_ENTRY_CON_STATE_NONE,
SCAN_ENTRY_CON_STATE_AUTH,
SCAN_ENTRY_CON_STATE_ASSOC
};
/**
* struct mlme_info - mlme specific info
* temporarily maintained in scan cache for backward compatibility.

View file

@ -331,10 +331,10 @@ ucfg_scan_db_iterate(struct wlan_objmgr_pdev *pdev,
scan_iterator_func func, void *arg);
/**
* ucfg_scan_update_mlme_info() - The Public API to update mlme
* ucfg_scan_update_mlme_by_bssinfo() - The Public API to update mlme
* info in the scan entry
* @vdev: vdev object
* @bss: bss info to find the matching scan entry
* @pdev: pdev object
* @bssid: bssid info to find the matching scan entry
* @mlme_info: mlme info to be updated.
*
* The Public API to update mlme info in the scan entry.
@ -343,7 +343,8 @@ ucfg_scan_db_iterate(struct wlan_objmgr_pdev *pdev,
* Return: 0 for success or error code.
*/
QDF_STATUS
ucfg_scan_update_mlme_info(struct wlan_objmgr_vdev *vdev, struct bss_info *bss,
ucfg_scan_update_mlme_by_bssinfo(struct wlan_objmgr_pdev *pdev,
struct bss_info *bss_info,
struct mlme_info *mlme_info);
/**

View file

@ -2166,6 +2166,16 @@ ucfg_scan_set_global_config(struct wlan_objmgr_psoc *psoc,
return status;
}
QDF_STATUS ucfg_scan_update_mlme_by_bssinfo(struct wlan_objmgr_pdev *pdev,
struct bss_info *bss_info, struct mlme_info *mlme)
{
QDF_STATUS status;
status = scm_scan_update_mlme_by_bssinfo(pdev, bss_info, mlme);
return status;
}
QDF_STATUS
ucfg_scan_get_global_config(struct wlan_objmgr_psoc *psoc,
enum scan_config config, uint32_t *val)