qcacmn: Restrict dwell time only if SAP/GO is connected

Currently, in case of SAP/GO present active dwell time of scan req
on STA iface is restricted. This can result in less scan time but
STA can miss some AP's. So, decrease dwell time only if some client
is connected to SAP or GO.

Change-Id: I46fb76792941b7c79f541b8b358d02bb944f0086
CRs-Fixed: 2436910
This commit is contained in:
Bala Venkatesh
2019-04-07 22:39:08 +05:30
committed by nshrivas
parent a7bfb9b1b4
commit d0838f8a9c
3 changed files with 86 additions and 9 deletions

View File

@@ -44,6 +44,16 @@ struct wlan_vdev_ch_check_filter {
};
#endif
/**
* struct wlan_peer_count- vdev connected peer count
* @opmode: QDF mode
* @peer_count: peer count
**/
struct wlan_op_mode_peer_count {
enum QDF_OPMODE opmode;
uint16_t peer_count;
};
/**
* wlan_chan_to_freq() - converts channel to frequency
* @chan: channel number
@@ -297,4 +307,16 @@ QDF_STATUS wlan_util_is_pdev_restart_progress(struct wlan_objmgr_pdev *pdev,
*/
QDF_STATUS wlan_util_is_pdev_scan_allowed(struct wlan_objmgr_pdev *pdev,
wlan_objmgr_ref_dbgid dbg_id);
/**
* wlan_util_get_mode_specific_peer_coun - This api gives vdev mode specific
* peer count`
* @pdev: PDEV object
* @mode: Operation mode.
*
* Return: int- peer count
*/
uint16_t wlan_util_get_peer_count_for_mode(struct wlan_objmgr_pdev *pdev,
enum QDF_OPMODE mode);
#endif /* _WLAN_UTILITY_H_ */

View File

@@ -510,3 +510,46 @@ wlan_util_stats_get_rssi(bool db2dbm_enabled, int32_t bcn_snr, int32_t dat_snr,
*rssi = snr + TGT_NOISE_FLOOR_DBM;
}
}
/**
* wlan_util_get_mode_specific_peer_count - This api gives vdev mode specific
* peer count`
* @pdev: PDEV object
* @object: vdev object
* @arg: argument passed by caller
*
* Return: void
*/
static void
wlan_util_get_mode_specific_peer_count(struct wlan_objmgr_pdev *pdev,
void *object, void *arg)
{
struct wlan_objmgr_vdev *vdev = object;
uint16_t temp_count = 0;
struct wlan_op_mode_peer_count *count = arg;
wlan_vdev_obj_lock(vdev);
if (wlan_vdev_mlme_get_opmode(vdev) == count->opmode) {
temp_count = wlan_vdev_get_peer_count(vdev);
/* Decrement the self peer count */
if (temp_count > 1)
count->peer_count += (temp_count - 1);
}
wlan_vdev_obj_unlock(vdev);
}
uint16_t wlan_util_get_peer_count_for_mode(struct wlan_objmgr_pdev *pdev,
enum QDF_OPMODE mode)
{
struct wlan_op_mode_peer_count count;
count.opmode = mode;
count.peer_count = 0;
wlan_objmgr_pdev_iterate_obj_list(pdev,
WLAN_VDEV_OP,
wlan_util_get_mode_specific_peer_count,
&count, 0, WLAN_OBJMGR_ID);
return count.peer_count;
}