qcacmn: Add vdev-mlme caps MASK for restrict_offchannel

Adds new vdev-mlme caps mask WLAN_VDEV_C_RESTRICT_OFFCHAN for
tracking restrict offchannel setting.
When this bit is set any operations which can cause the AP/GO
to leave the operating channel are avoided.

Also reads vdev-mlme caps:WLAN_VDEV_C_RESTRICT_OFFCHAN in function
policy_mgr_is_dnsc_set() to determine if Do_Not_Switch_Channel
is enabled.
Moves declaration of policy_mgr_is_dnsc_set() to
wlan_policy_mgr_api.h so that it can be used outside of policy manager.

Change-Id: I53013af5f4c72917f862630e63333951ec75ce8c
CRs-Fixed: 2050999
This commit is contained in:
Ajit Pal Singh
2017-05-24 11:58:09 +05:30
committed by snandini
parent 83eddc57a1
commit 8c63d04d3b
4 changed files with 30 additions and 16 deletions

View File

@@ -210,6 +210,8 @@
#define WLAN_VDEV_C_WME_TKIPMIC 0x00000080 #define WLAN_VDEV_C_WME_TKIPMIC 0x00000080
/* CAPABILITY: bg scanning */ /* CAPABILITY: bg scanning */
#define WLAN_VDEV_C_BGSCAN 0x00000100 #define WLAN_VDEV_C_BGSCAN 0x00000100
/* CAPABILITY: Restrict offchannel */
#define WLAN_VDEV_C_RESTRICT_OFFCHAN 0x00000200
/* Invalid VDEV identifier */ /* Invalid VDEV identifier */
#define WLAN_INVALID_VDEV_ID 255 #define WLAN_INVALID_VDEV_ID 255

View File

@@ -1895,4 +1895,15 @@ QDF_STATUS policy_mgr_is_chan_ok_for_dnbs(struct wlan_objmgr_psoc *psoc,
*/ */
uint32_t policy_mgr_get_hw_dbs_nss(struct wlan_objmgr_psoc *psoc, uint32_t policy_mgr_get_hw_dbs_nss(struct wlan_objmgr_psoc *psoc,
struct dbs_nss *nss_dbs); struct dbs_nss *nss_dbs);
/**
* policy_mgr_is_dnsc_set - Check if user has set
* "Do_Not_Switch_Channel" for the vdev passed
* @vdev: vdev pointer
*
* Get "Do_Not_Switch_Channel" setting for the vdev passed.
*
* Return: true for success, else false
*/
bool policy_mgr_is_dnsc_set(struct wlan_objmgr_vdev *vdev);
#endif /* __WLAN_POLICY_MGR_API_H */ #endif /* __WLAN_POLICY_MGR_API_H */

View File

@@ -2408,12 +2408,25 @@ bool policy_mgr_is_hw_mode_change_after_vdev_up(struct wlan_objmgr_psoc *psoc)
return flag; return flag;
} }
bool policy_mgr_vdev_mlme_is_dnsc_set(struct wlan_objmgr_vdev *vdev) bool policy_mgr_is_dnsc_set(struct wlan_objmgr_vdev *vdev)
{ {
/* TODO : Check Dont_Switch_Channel status from vdev mlme caps*/ bool roffchan;
if (!vdev) {
policy_mgr_err("Invalid parameter");
return false; return false;
} }
wlan_vdev_obj_lock(vdev);
roffchan = wlan_vdev_mlme_cap_get(vdev, WLAN_VDEV_C_RESTRICT_OFFCHAN);
wlan_vdev_obj_unlock(vdev);
policy_mgr_debug("Restrict offchannel:%s",
roffchan ? "set" : "clear");
return roffchan;
}
QDF_STATUS policy_mgr_is_chan_ok_for_dnbs(struct wlan_objmgr_psoc *psoc, QDF_STATUS policy_mgr_is_chan_ok_for_dnbs(struct wlan_objmgr_psoc *psoc,
uint8_t channel, bool *ok) uint8_t channel, bool *ok)
{ {
@@ -2456,7 +2469,7 @@ QDF_STATUS policy_mgr_is_chan_ok_for_dnbs(struct wlan_objmgr_psoc *psoc,
* return true. * return true.
*/ */
/* TODO: To be enhanced for SBS */ /* TODO: To be enhanced for SBS */
if (policy_mgr_vdev_mlme_is_dnsc_set(vdev)) { if (policy_mgr_is_dnsc_set(vdev)) {
if (operating_channel == channel) if (operating_channel == channel)
*ok = true; *ok = true;
else if (WLAN_REG_IS_SAME_BAND_CHANNELS(operating_channel, else if (WLAN_REG_IS_SAME_BAND_CHANNELS(operating_channel,

View File

@@ -414,16 +414,4 @@ bool policy_mgr_get_sap_conn_info(struct wlan_objmgr_psoc *psoc,
bool policy_mgr_get_mode_specific_conn_info(struct wlan_objmgr_psoc *psoc, bool policy_mgr_get_mode_specific_conn_info(struct wlan_objmgr_psoc *psoc,
uint8_t *channel, uint8_t *vdev_id, uint8_t *channel, uint8_t *vdev_id,
enum policy_mgr_con_mode mode); enum policy_mgr_con_mode mode);
/**
* policy_mgr_vdev_mlme_is_dnsc_set - Check if user has set
* "Do_Not_Switch_Channel" for this vdev
* @vdev: vdev pointer
*
* Get "Do_Not_Switch_Channel" setting for this vdev
*
* Return: true for success, else false
*/
bool policy_mgr_vdev_mlme_is_dnsc_set(struct wlan_objmgr_vdev *vdev);
#endif #endif