qcacmn: Add support to update mlme info in scan db
Add missing support to update mlme related info in scan db Change-Id: Ib69a07012536b9b423992f5f4199925febabcb91 CRs-Fixed: 2086351
This commit is contained in:

zatwierdzone przez
snandini

rodzic
0d276aab16
commit
c3fcb680f1
@@ -355,6 +355,21 @@ static QDF_STATUS scm_add_scan_entry(struct scan_dbs *scan_db,
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* scm_update_mlme_info() - update mlme info
|
||||
* @src: source scan entry
|
||||
* @dest: destination scan entry
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
static inline void
|
||||
scm_update_mlme_info(struct scan_cache_entry *src,
|
||||
struct scan_cache_entry *dest)
|
||||
{
|
||||
qdf_mem_copy(&dest->mlme_info, &src->mlme_info,
|
||||
sizeof(struct mlme_info));
|
||||
}
|
||||
|
||||
/**
|
||||
* scm_delete_duplicate_entry() - remove duplicate node entry
|
||||
* @scan_db: scan database
|
||||
@@ -433,6 +448,9 @@ static void scm_delete_duplicate_entry(struct scan_dbs *scan_db,
|
||||
/* copy wsn ie from scan_entry to scan_params*/
|
||||
scm_update_alt_wcn_ie(scan_entry, scan_params);
|
||||
|
||||
/* copy mlme info from scan_entry to scan_params*/
|
||||
scm_update_mlme_info(scan_entry, scan_params);
|
||||
|
||||
/* Mark delete the duplicate node */
|
||||
scm_scan_entry_put_ref(scan_db, scan_node, true);
|
||||
}
|
||||
@@ -1132,3 +1150,47 @@ QDF_STATUS scm_db_deinit(struct wlan_objmgr_psoc *psoc)
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS scm_update_scan_mlme_info(struct wlan_objmgr_pdev *pdev,
|
||||
struct scan_cache_entry *entry)
|
||||
{
|
||||
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;
|
||||
|
||||
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(entry->bssid.bytes);
|
||||
|
||||
cur_node = scm_get_next_node(scan_db,
|
||||
&scan_db->scan_hash_tbl[hash_idx], NULL);
|
||||
|
||||
while (cur_node) {
|
||||
if (util_is_scan_entry_match(entry,
|
||||
cur_node->entry)) {
|
||||
/* Acquire db lock to prevent simultaneous update */
|
||||
qdf_spin_lock_bh(&scan_db->scan_db_lock);
|
||||
scm_update_mlme_info(entry, cur_node->entry);
|
||||
qdf_spin_unlock_bh(&scan_db->scan_db_lock);
|
||||
scm_scan_entry_put_ref(scan_db,
|
||||
cur_node, true);
|
||||
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;
|
||||
}
|
||||
|
@@ -105,13 +105,15 @@ QDF_STATUS scm_purge_scan_results(qdf_list_t *scan_result);
|
||||
|
||||
/**
|
||||
* scm_update_scan_mlme_info() - updates scan entry with mlme data
|
||||
* @mlme_info: mlme info to be updated in scan db
|
||||
* @pdev: pdev object
|
||||
* @scan_entry: source scan entry to read mlme info
|
||||
*
|
||||
* This function updates scan db with mlme data
|
||||
* This function updates scan db with scan_entry->mlme_info
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS scm_update_scan_mlme_info(struct mlme_update_info *mlme_info);
|
||||
QDF_STATUS scm_update_scan_mlme_info(struct wlan_objmgr_pdev *pdev,
|
||||
struct scan_cache_entry *scan_entry);
|
||||
|
||||
/**
|
||||
* scm_flush_results() - flush scan entries matching the filter
|
||||
|
@@ -669,19 +669,6 @@ struct scan_cancel_request {
|
||||
struct scan_cancel_param cancel_req;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct mlme_update_info - meta information required to
|
||||
* update mlme info in scan entry
|
||||
* @vdev: vdev object
|
||||
* @bss: bss identifier
|
||||
* @mlme_info: mlme info to update
|
||||
*/
|
||||
struct mlme_update_info {
|
||||
struct wlan_objmgr_vdev *vdev;
|
||||
struct bss_info bss;
|
||||
struct mlme_info mlme_info;
|
||||
};
|
||||
|
||||
/**
|
||||
* enum scan_event_type - scan event types
|
||||
* @SCAN_EVENT_TYPE_STARTED: scan started
|
||||
|
@@ -1316,5 +1316,15 @@ util_scan_entry_fils_indication(struct scan_cache_entry *scan_entry)
|
||||
qdf_time_t
|
||||
util_get_last_scan_time(struct wlan_objmgr_vdev *vdev);
|
||||
|
||||
/**
|
||||
* util_scan_entry_update_mlme_info() - function to update mlme info
|
||||
* @scan_entry: scan entry object
|
||||
*
|
||||
* API, function to update mlme info in scan DB
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
util_scan_entry_update_mlme_info(struct wlan_objmgr_pdev *pdev,
|
||||
struct scan_cache_entry *scan_entry);
|
||||
#endif
|
||||
|
||||
|
@@ -119,7 +119,7 @@ bool util_is_scan_entry_match(
|
||||
|
||||
if (entry1->cap_info.wlan_caps.ess &&
|
||||
!qdf_mem_cmp(entry1->bssid.bytes,
|
||||
entry1->bssid.bytes, QDF_MAC_ADDR_SIZE) &&
|
||||
entry2->bssid.bytes, QDF_MAC_ADDR_SIZE) &&
|
||||
scm_chan_to_band(
|
||||
entry1->channel.chan_idx) ==
|
||||
scm_chan_to_band(entry2->channel.chan_idx)) {
|
||||
@@ -140,7 +140,7 @@ bool util_is_scan_entry_match(
|
||||
} else if (!entry1->cap_info.wlan_caps.ibss &&
|
||||
!entry1->cap_info.wlan_caps.ess &&
|
||||
!qdf_mem_cmp(entry1->bssid.bytes,
|
||||
entry1->bssid.bytes, QDF_MAC_ADDR_SIZE)) {
|
||||
entry2->bssid.bytes, QDF_MAC_ADDR_SIZE)) {
|
||||
/* In case of P2P devices, ess and ibss will be set to zero */
|
||||
return true;
|
||||
}
|
||||
@@ -674,3 +674,16 @@ util_scan_unpack_beacon_frame(uint8_t *frame,
|
||||
/* TODO calculate channel struct */
|
||||
return scan_entry;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
util_scan_entry_update_mlme_info(struct wlan_objmgr_pdev *pdev,
|
||||
struct scan_cache_entry *scan_entry)
|
||||
{
|
||||
|
||||
if (!pdev || !scan_entry) {
|
||||
scm_err("pdev 0x%p, scan_entry: 0x%p", pdev, scan_entry);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
return scm_update_scan_mlme_info(pdev, scan_entry);
|
||||
}
|
||||
|
Reference in New Issue
Block a user