qcacmn: Redefine conditions to skip CAC

Find out if a VAP is going through restart transition and skip CAC.
All other cases, do not skip CAC based on subset logic.
Also, if the channel is non-DFS, do not do CAC.

CRs-Fixed: 2945741
Change-Id: I5a9de47a879eb8d294dfed126a77970c52b2b546
This commit is contained in:
Priyadarshnee Srinivasan
2021-06-16 11:46:08 +05:30
committed by Madan Koyyalamudi
parent b9eedc9d3b
commit 70279dce34
4 changed files with 35 additions and 7 deletions

View File

@@ -2157,13 +2157,16 @@ void dfs_stacac_stop(struct wlan_dfs *dfs);
* @continue_current_cac: If AP can start CAC then this variable indicates * @continue_current_cac: If AP can start CAC then this variable indicates
* whether to continue with the current CAC or restart the CAC. This variable * whether to continue with the current CAC or restart the CAC. This variable
* is valid only if this function returns true. * is valid only if this function returns true.
* @is_vap_restart: Flag to indicate if vap is restarted/started.
* True: VAP restart. False: VAP start
* *
* Return: true if AP requires CAC or can continue current CAC, else false. * Return: true if AP requires CAC or can continue current CAC, else false.
*/ */
bool dfs_is_cac_required(struct wlan_dfs *dfs, bool dfs_is_cac_required(struct wlan_dfs *dfs,
struct dfs_channel *cur_chan, struct dfs_channel *cur_chan,
struct dfs_channel *prev_chan, struct dfs_channel *prev_chan,
bool *continue_current_cac); bool *continue_current_cac,
bool is_vap_restart);
/** /**
* dfs_cac_stop() - Clear the AP CAC timer. * dfs_cac_stop() - Clear the AP CAC timer.
@@ -2245,7 +2248,8 @@ static inline
bool dfs_is_cac_required(struct wlan_dfs *dfs, bool dfs_is_cac_required(struct wlan_dfs *dfs,
struct dfs_channel *cur_chan, struct dfs_channel *cur_chan,
struct dfs_channel *prev_chan, struct dfs_channel *prev_chan,
bool *continue_current_cac) bool *continue_current_cac,
bool is_vap_restart)
{ {
return false; return false;
} }

View File

@@ -402,10 +402,16 @@ dfs_is_new_chan_subset_of_old_chan(struct wlan_dfs *dfs,
bool dfs_is_cac_required(struct wlan_dfs *dfs, bool dfs_is_cac_required(struct wlan_dfs *dfs,
struct dfs_channel *cur_chan, struct dfs_channel *cur_chan,
struct dfs_channel *prev_chan, struct dfs_channel *prev_chan,
bool *continue_current_cac) bool *continue_current_cac,
bool is_vap_restart)
{ {
struct dfs_channel *cac_started_chan = &dfs->dfs_cac_started_chan; struct dfs_channel *cac_started_chan = &dfs->dfs_cac_started_chan;
if (!WLAN_IS_PRIMARY_OR_SECONDARY_CHAN_DFS(cur_chan)) {
dfs_debug(dfs, WLAN_DEBUG_DFS, "Skip CAC on non-DFS channel");
return false;
}
if (dfs->dfs_ignore_dfs || dfs->dfs_cac_valid || dfs->dfs_ignore_cac) { if (dfs->dfs_ignore_dfs || dfs->dfs_cac_valid || dfs->dfs_ignore_cac) {
dfs_debug(dfs, WLAN_DEBUG_DFS, dfs_debug(dfs, WLAN_DEBUG_DFS,
"Skip CAC, ignore_dfs = %d cac_valid = %d ignore_cac = %d", "Skip CAC, ignore_dfs = %d cac_valid = %d ignore_cac = %d",
@@ -453,6 +459,19 @@ bool dfs_is_cac_required(struct wlan_dfs *dfs,
dfs_cancel_cac_timer(dfs); dfs_cancel_cac_timer(dfs);
} }
} else { /* CAC timer is not running. */ } else { /* CAC timer is not running. */
/* If channel change happens via VAP DOWN/UP on subset channels,
* (eg: from 52 HT80 to 64 HT80) CAC done information
* (of 52 HT80) based on subset logic
* (as 52 and 64 HT80 are subsets of each other)
* is not expected to be preserved as VAP has come up
* from DOWN state. Hence do not skip CAC on 64 HT80.
* is_vap_restart flag is used as an identifer to indicate if
* vap has come up from a DOWN state or UP state (vap restart).
*/
if (!is_vap_restart) {
dfs_debug(dfs, WLAN_DEBUG_DFS, "CAC is needed");
return true;
}
if (dfs_is_new_chan_subset_of_old_chan(dfs, if (dfs_is_new_chan_subset_of_old_chan(dfs,
cur_chan, cur_chan,
prev_chan)) { prev_chan)) {

View File

@@ -857,6 +857,8 @@ bool utils_dfs_is_cac_required(struct wlan_objmgr_pdev *pdev,
* @continue_current_cac: If AP can start CAC then this variable indicates * @continue_current_cac: If AP can start CAC then this variable indicates
* whether to continue with the current CAC or restart the CAC. This variable * whether to continue with the current CAC or restart the CAC. This variable
* is valid only if this function returns true. * is valid only if this function returns true.
* @is_vap_restart: Flag to indicate if vap is restarted/started.
* True: VAP restart. False: VAP start
* *
* This API checks if the dfs_curchan is a subset of the dfs_prevchan. * This API checks if the dfs_curchan is a subset of the dfs_prevchan.
* dfs_curchan and dfs_prevchan are updated after start response by * dfs_curchan and dfs_prevchan are updated after start response by
@@ -866,7 +868,8 @@ bool utils_dfs_is_cac_required(struct wlan_objmgr_pdev *pdev,
*/ */
bool bool
utils_dfs_is_cac_required_on_dfs_curchan(struct wlan_objmgr_pdev *pdev, utils_dfs_is_cac_required_on_dfs_curchan(struct wlan_objmgr_pdev *pdev,
bool *continue_current_cac); bool *continue_current_cac,
bool is_vap_restart);
/** utils_dfs_is_precac_done() - Check if precac has been done in chosen channel /** utils_dfs_is_precac_done() - Check if precac has been done in chosen channel
* @pdev: Pointer to DFS pdev object. * @pdev: Pointer to DFS pdev object.

View File

@@ -305,12 +305,13 @@ bool utils_dfs_is_cac_required(struct wlan_objmgr_pdev *pdev,
return dfs_is_cac_required(dfs, return dfs_is_cac_required(dfs,
&cur_channel, &cur_channel,
&prev_channel, &prev_channel,
continue_current_cac); continue_current_cac, true);
} }
bool bool
utils_dfs_is_cac_required_on_dfs_curchan(struct wlan_objmgr_pdev *pdev, utils_dfs_is_cac_required_on_dfs_curchan(struct wlan_objmgr_pdev *pdev,
bool *continue_current_cac) bool *continue_current_cac,
bool is_vap_restart)
{ {
struct wlan_dfs *dfs; struct wlan_dfs *dfs;
@@ -321,7 +322,8 @@ utils_dfs_is_cac_required_on_dfs_curchan(struct wlan_objmgr_pdev *pdev,
return dfs_is_cac_required(dfs, return dfs_is_cac_required(dfs,
dfs->dfs_curchan, dfs->dfs_curchan,
dfs->dfs_prevchan, dfs->dfs_prevchan,
continue_current_cac); continue_current_cac,
is_vap_restart);
} }
QDF_STATUS utils_dfs_stacac_stop(struct wlan_objmgr_pdev *pdev) QDF_STATUS utils_dfs_stacac_stop(struct wlan_objmgr_pdev *pdev)