From 5fe81f014afb4616fe7bfd23f946210d90aaa25d Mon Sep 17 00:00:00 2001 From: hangtian Date: Tue, 23 Oct 2018 17:53:46 +0800 Subject: [PATCH] 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 --- core/hdd/src/wlan_hdd_hostapd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 75219761a702..dca2dbe16355 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -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.