]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add ACS support for 60 GHz channel bonding
authorNoam Shaked <nshaked@codeaurora.org>
Tue, 24 Mar 2020 00:19:36 +0000 (17:19 -0700)
committerJouni Malinen <j@w1.fi>
Tue, 24 Mar 2020 20:15:32 +0000 (22:15 +0200)
hostapd will trigger EDMG auto channel selection by setting
QCA_WLAN_VENDOR_ATTR_ACS_EDMG_ENABLED. The 60 GHz driver will be
called to start an auto channel selection and will return the
primary channel and the EDMG channel.

Signed-off-by: Noam Shaked <nshaked@codeaurora.org>
src/ap/ap_drv_ops.c
src/ap/drv_callbacks.c
src/drivers/driver.h
src/drivers/driver_nl80211.c
src/drivers/driver_nl80211_event.c

index 0f5e829ffb7200b2a281713f1c80c7ae8e45c4c6..1aa2ab038476c6a50b205f133dd912c28ba48b5a 100644 (file)
@@ -938,6 +938,7 @@ int hostapd_drv_do_acs(struct hostapd_data *hapd)
        }
 
        params.freq_list = freq_list;
+       params.edmg_enabled = hapd->iface->conf->enable_edmg;
 
        params.ht_enabled = !!(hapd->iface->conf->ieee80211n);
        params.ht40_enabled = !!(hapd->iface->conf->ht_capab &
index 2091385cdedcf42f532bf9f61fac1fc97edde42a..98729f42355c1240fb14fc5c3b6559052fa53dfe 100644 (file)
@@ -1008,6 +1008,8 @@ void hostapd_acs_channel_selected(struct hostapd_data *hapd,
                goto out;
        }
 
+       hapd->iconf->edmg_channel = acs_res->edmg_channel;
+
        if (hapd->iface->conf->ieee80211ac || hapd->iface->conf->ieee80211ax) {
                /* set defaults for backwards compatibility */
                hostapd_set_oper_centr_freq_seg1_idx(hapd->iconf, 0);
index 78a3387daab7849fc84eef77cd232acb00412ead..39c7f9cb922e5e1152369baf2769520826b54873 100644 (file)
@@ -2329,6 +2329,9 @@ struct drv_acs_params {
 
        /* ACS frequency list info */
        const int *freq_list;
+
+       /* Indicates whether EDMG is enabled */
+       int edmg_enabled;
 };
 
 struct wpa_bss_trans_info {
@@ -5724,6 +5727,7 @@ union wpa_event_data {
         * struct acs_selected_channels - Data for EVENT_ACS_CHANNEL_SELECTED
         * @pri_freq: Selected primary frequency
         * @sec_freq: Selected secondary frequency
+        * @edmg_channel: Selected EDMG channel
         * @vht_seg0_center_ch: VHT mode Segment0 center channel
         *      The value is the index of the channel center frequency for
         *      20 MHz, 40 MHz, and 80 MHz channels. The value is the center
@@ -5742,6 +5746,7 @@ union wpa_event_data {
        struct acs_selected_channels {
                unsigned int pri_freq;
                unsigned int sec_freq;
+               u8 edmg_channel;
                u8 vht_seg0_center_ch;
                u8 vht_seg1_center_ch;
                u16 ch_width;
index c071cc0e02c35b96c121c553f0627755c0e16002..5f2b5651c4c35701b2ca0f17af3b2f98194a2db5 100644 (file)
@@ -10436,16 +10436,18 @@ static int wpa_driver_do_acs(void *priv, struct drv_acs_params *params)
            nla_put_u16(msg, QCA_WLAN_VENDOR_ATTR_ACS_CHWIDTH,
                        params->ch_width) ||
            add_acs_ch_list(msg, params->freq_list) ||
-           add_acs_freq_list(msg, params->freq_list)) {
+           add_acs_freq_list(msg, params->freq_list) ||
+           (params->edmg_enabled &&
+            nla_put_flag(msg, QCA_WLAN_VENDOR_ATTR_ACS_EDMG_ENABLED))) {
                nlmsg_free(msg);
                return -ENOBUFS;
        }
        nla_nest_end(msg, data);
 
        wpa_printf(MSG_DEBUG,
-                  "nl80211: ACS Params: HW_MODE: %d HT: %d HT40: %d VHT: %d BW: %d",
+                  "nl80211: ACS Params: HW_MODE: %d HT: %d HT40: %d VHT: %d BW: %d EDMG: %d",
                   params->hw_mode, params->ht_enabled, params->ht40_enabled,
-                  params->vht_enabled, params->ch_width);
+                  params->vht_enabled, params->ch_width, params->edmg_enabled);
 
        ret = send_and_recv_msgs(drv, msg, NULL, NULL);
        if (ret) {
index 49d81d785ebb81ce1bb830e4477d7820891d130b..d4ca2eb29b816ba53a124672f66a94a9caf75d6e 100644 (file)
@@ -1855,6 +1855,9 @@ static void qca_nl80211_acs_select_ch(struct wpa_driver_nl80211_data *drv,
                                     event.acs_selected_channels.hw_mode);
        }
 
+       if (tb[QCA_WLAN_VENDOR_ATTR_ACS_EDMG_CHANNEL])
+               event.acs_selected_channels.edmg_channel =
+                       nla_get_u8(tb[QCA_WLAN_VENDOR_ATTR_ACS_EDMG_CHANNEL]);
        if (tb[QCA_WLAN_VENDOR_ATTR_ACS_VHT_SEG0_CENTER_CHANNEL])
                event.acs_selected_channels.vht_seg0_center_ch =
                        nla_get_u8(tb[QCA_WLAN_VENDOR_ATTR_ACS_VHT_SEG0_CENTER_CHANNEL]);
@@ -1865,13 +1868,14 @@ static void qca_nl80211_acs_select_ch(struct wpa_driver_nl80211_data *drv,
                event.acs_selected_channels.ch_width =
                        nla_get_u16(tb[QCA_WLAN_VENDOR_ATTR_ACS_CHWIDTH]);
        wpa_printf(MSG_INFO,
-                  "nl80211: ACS Results: PFreq: %d SFreq: %d BW: %d VHT0: %d VHT1: %d HW_MODE: %d",
+                  "nl80211: ACS Results: PFreq: %d SFreq: %d BW: %d VHT0: %d VHT1: %d HW_MODE: %d EDMGCH: %d",
                   event.acs_selected_channels.pri_freq,
                   event.acs_selected_channels.sec_freq,
                   event.acs_selected_channels.ch_width,
                   event.acs_selected_channels.vht_seg0_center_ch,
                   event.acs_selected_channels.vht_seg1_center_ch,
-                  event.acs_selected_channels.hw_mode);
+                  event.acs_selected_channels.hw_mode,
+                  event.acs_selected_channels.edmg_channel);
 
        /* Ignore ACS channel list check for backwards compatibility */