mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
qcacld-3.0: Fix DFS channel flag check when prevent/allow suspend
wlan_reg_get_channel_state does not return CHANNEL_STATE_DFS for DFS channel if this channel is in NOL. Use wlan_reg_chan_has_dfs_attribute to fix this issue. With above fix, new issue is exposed. hdd_ctx->sap_dfs_ref_cnt is used as a flag, If hdd_hostapd_channel_allow_suspend is called after hdd_hostapd_channel_prevent_suspend, whatever the new channel state is, if the old channel is going to release dfs lock, then dfs lock is released. Generally we should handle the old channel then handle the new channel, so exchange the order of hdd_hostapd_channel_prevent_suspend and hdd_hostapd_channel_allow_suspend when doing channel switch. Change-Id: I9bbeeb5ac23f3c2eaf694f64e0fea433dcc34740 CRs-Fixed: 2543642
This commit is contained in:
parent
91e06d1763
commit
eb87bc97d8
1 changed files with 12 additions and 11 deletions
|
|
@ -326,8 +326,7 @@ static void hdd_hostapd_channel_allow_suspend(struct hdd_adapter *adapter,
|
|||
if (hostapd_state->bss_state == BSS_STOP)
|
||||
return;
|
||||
|
||||
if (wlan_reg_get_channel_state(hdd_ctx->pdev, channel) !=
|
||||
CHANNEL_STATE_DFS)
|
||||
if (!wlan_reg_chan_has_dfs_attribute(hdd_ctx->pdev, channel))
|
||||
return;
|
||||
|
||||
/* Release wakelock when no more DFS channels are used */
|
||||
|
|
@ -359,14 +358,12 @@ static void hdd_hostapd_channel_prevent_suspend(struct hdd_adapter *adapter,
|
|||
hdd_debug("bss_state: %d, channel: %d, dfs_ref_cnt: %d",
|
||||
hostapd_state->bss_state, channel,
|
||||
atomic_read(&hdd_ctx->sap_dfs_ref_cnt));
|
||||
|
||||
/* Return if BSS is already started && wakelock is acquired */
|
||||
if ((hostapd_state->bss_state == BSS_START) &&
|
||||
(atomic_read(&hdd_ctx->sap_dfs_ref_cnt) >= 1))
|
||||
return;
|
||||
|
||||
if (wlan_reg_get_channel_state(hdd_ctx->pdev, channel) !=
|
||||
CHANNEL_STATE_DFS)
|
||||
if (!wlan_reg_chan_has_dfs_attribute(hdd_ctx->pdev, channel))
|
||||
return;
|
||||
|
||||
/* Acquire wakelock if we have at least one DFS channel in use */
|
||||
|
|
@ -2497,14 +2494,18 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
|
|||
case eSAP_CHANNEL_CHANGE_EVENT:
|
||||
hdd_debug("Received eSAP_CHANNEL_CHANGE_EVENT event");
|
||||
if (hostapd_state->bss_state != BSS_STOP) {
|
||||
/* Prevent suspend for new channel */
|
||||
hdd_hostapd_channel_prevent_suspend(adapter,
|
||||
wlan_reg_freq_to_chan(hdd_ctx->pdev,
|
||||
sap_event->sapevt.sap_ch_selected.pri_ch_freq));
|
||||
/* Allow suspend for old channel */
|
||||
hdd_hostapd_channel_allow_suspend(adapter,
|
||||
wlan_reg_freq_to_chan(hdd_ctx->pdev,
|
||||
hdd_hostapd_channel_allow_suspend(
|
||||
adapter,
|
||||
wlan_reg_freq_to_chan(
|
||||
hdd_ctx->pdev,
|
||||
ap_ctx->operating_chan_freq));
|
||||
/* Prevent suspend for new channel */
|
||||
hdd_hostapd_channel_prevent_suspend(
|
||||
adapter,
|
||||
wlan_reg_freq_to_chan(
|
||||
hdd_ctx->pdev,
|
||||
sap_event->sapevt.sap_ch_selected.pri_ch_freq));
|
||||
}
|
||||
/* SME/PE is already updated for new operation
|
||||
* channel. So update HDD layer also here. This
|
||||
|
|
|
|||
Loading…
Reference in a new issue