[PATCH] ACS: decide offload by hw_mode without special cmd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Neo Jou <neojou@xxxxxxxxx>

Would like to propose that not to limit to use special vendor
command/data to decide to do ACS offload, but by "hw_mode=any"
as the general case for all the drivers.

There is a special config, "hw_mode=any", for the case when the
driver supports offloaded ACS, but it also needs the driver to
report the special vendor data, QCA_NL80211_VENDOR_SUBCMD_DO_ACS,
and to support the vendor command,
    OUI-QCA + QCA_NL80211_VENDOR_SUBCMD_GET_FEATURE
to get the feature report
    QCA_WLAN_VENDOR_FEATURE_SUPPORT_HW_MODE_ANY
which are only for QCA driver.

The setting, "hw_mode=any", in conf file, seems already be
able to be used to decide if to offload ACS to the driver or not.
So would like to propose the patch as the first step for the
general approach of ACS offload.

With the patch, in the case like "hw_mode=a or g", we can still
do ACS computing in hostapd, and offload ACS to the driver when
"hw_mode=any", without special vendor data/command support.

This patch can be the first step for the general approach for ACS
offload. Furthermore, for the case, "hw_mode=any", we only need to
think a general approach to do as one vendor command,
    OUI-QCA + QCA_NL80211_VENDOR_SUBCMD_DO_ACS
does, as the second step, without those special vendor command/data
as above.

Signed-off-by: Neo Jou <neojou@xxxxxxxxx>
---
 src/ap/acs.c         | 3 ++-
 src/ap/hw_features.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/ap/acs.c b/src/ap/acs.c
index 232afa8..80fd32b 100644
--- a/src/ap/acs.c
+++ b/src/ap/acs.c
@@ -971,7 +971,8 @@ enum hostapd_chan_status acs_init(struct hostapd_iface *iface)
 {
 	wpa_printf(MSG_INFO, "ACS: Automatic channel selection started, this may take a bit");
 
-	if (iface->drv_flags & WPA_DRIVER_FLAGS_ACS_OFFLOAD) {
+	if ((iface->drv_flags & WPA_DRIVER_FLAGS_ACS_OFFLOAD) ||
+	    (iface->conf->hw_mode == HOSTAPD_MODE_IEEE80211ANY)) {
 		wpa_printf(MSG_INFO, "ACS: Offloading to driver");
 		if (hostapd_drv_do_acs(iface->bss[0]))
 			return HOSTAPD_CHAN_INVALID;
diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
index ba10752..4f250b7 100644
--- a/src/ap/hw_features.c
+++ b/src/ap/hw_features.c
@@ -1031,7 +1031,8 @@ int hostapd_select_hw_mode(struct hostapd_iface *iface)
 		}
 	}
 
-	if (iface->current_mode == NULL) {
+	if ((iface->current_mode == NULL) &&
+	    (iface->conf->hw_mode != HOSTAPD_MODE_IEEE80211ANY)) {
 		if (!(iface->drv_flags & WPA_DRIVER_FLAGS_ACS_OFFLOAD) ||
 		    !(iface->drv_flags & WPA_DRIVER_FLAGS_SUPPORT_HW_MODE_ANY))
 		{
-- 
2.7.4


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux