qcacld-3.0: Update chandef if choosing new channel for softap

Currently if hostapd choose channel 149, enable ieee80211d, and
select country_code JP. Driver will choose random channel after regd
updated to JP got from firmware. Since 149 is invalid for JP
country_code, driver choose random channel in JP channel list.
Driver indicate cfg80211 chandef is changed in hdd_chan_change_notify.
However, if we don't update cfg80211_ap_settings.chandef in
cfg80211_ops.start_ap, cfg80211 will copy old chandef back to
wdev->chandef after cfg80211_ops.start_ap.  Then reg_wdev_chan_valid
will return false and cfg80211_leave leads to stop
AP in reg_leave_invalid_chans.

Change-Id: I3f89da46b4172fdea2774703f32b9cbabff41eeb
CRs-Fixed: 2315627
This commit is contained in:
hangtian 2018-10-23 17:53:46 +08:00 • committed by nshrivas
commit 5fe81f014a

View file

@ -5611,6 +5611,7 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
bool sta_sap_scc_on_dfs_chan;
uint16_t sta_cnt;
bool val;
struct wireless_dev *wdev = dev->ieee80211_ptr;
hdd_enter();
@ -5862,6 +5863,9 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
goto err_start_bss;
}
if (wdev->chandef.chan->center_freq !=
params->chandef.chan->center_freq)
params->chandef = wdev->chandef;
/*
* If Do_Not_Break_Stream enabled send avoid channel list
* to application.