From patchwork Fri Dec 9 18:23:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13070076 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A7E0263D2 for ; Fri, 9 Dec 2022 18:23:52 +0000 (UTC) Received: by mail-pl1-f182.google.com with SMTP id d3so5719219plr.10 for ; Fri, 09 Dec 2022 10:23:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=wFdDBkNcJ7FMvuxzZpwR36JLJ6QHLaWElsNYLEHpDg4=; b=g21smc7hCVsbqwB9DppwsfrofSGx4Lg6rO+9Vay9qfcsNkQNigmkFX9KuNHnoyWRhT XddWRnhnucTbMxqjUvtBGe+ZBsnHRKNjWWXkguH4UbHkrb3qANplkryH1m4ZT2wdf6u7 ZxhlE7IUs1blaQql4E1FwcUssgwqSxigMUqaKtwwMehmr+kfWjUlSNf1UVCA/dtqvdz2 M89TEv8wIpiyKQCXNUQlpLHIUkyoz8x13sgz/gkYoDlX4dyqRVMFTcQ3VQx4zm23nuai fEGlqG9Ed03AaOf44xBSnrxgGRcrTvquBtRLcCV49rXnE+n/IHmikwOH4VBhewiHKP9Z ++Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wFdDBkNcJ7FMvuxzZpwR36JLJ6QHLaWElsNYLEHpDg4=; b=wo5QYTeQ1F3NUze/Krgr27lQloNkScpCbrKbnrmtg99yibJpcfHHF9Y/fLPSVuCTc1 5Mj+zqVfhq1S7tOEALgon42QtjvimVI5OJrkSkp16iXTHI9Ygs7iKWu21wJrAyhVoIWT 3pobh4o7FMnBN+ixU6hHzXmRmhoOgKf5IdssKmGnn90/bhXVrISoV2Pfw5RVckQ8co/Q nICwTXnXt1Y6tvJXxFdW8MRbAynpqB2TZrHJaypbvQto+tKHRNoUXDcz+aN9a+ZgvEs6 aQkj+A+kxEYYDcH5kkMzNSTcA9MrKlo4Csty+bQ9v6hz73jdsfpZ6sPchBeDfs2k4NH4 orFw== X-Gm-Message-State: ANoB5pmWuiOJqzfSHiwWR6zgigCqmY0yf44YzQbNsnnuk+ZgAEAEIm00 K6+hPvjtdlnNwot9zNt8pKskYw2AzI0= X-Google-Smtp-Source: AA0mqf44PnXExEJDfm3LasT79A7NewTos2XgVTzBqANhq4VImRN46HXMvsXUVWfgX4hk19gNW7EFKQ== X-Received: by 2002:a17:903:2349:b0:189:9311:d1fc with SMTP id c9-20020a170903234900b001899311d1fcmr7976179plh.9.1670610231972; Fri, 09 Dec 2022 10:23:51 -0800 (PST) Received: from jprestwo-xps.none ([50.39.160.234]) by smtp.gmail.com with ESMTPSA id q14-20020a170902a3ce00b001897de9bae3sm1635790plb.204.2022.12.09.10.23.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 10:23:51 -0800 (PST) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 1/4] wiphy: use enum band_freq with rates getter Date: Fri, 9 Dec 2022 10:23:44 -0800 Message-Id: <20221209182347.838602-1-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 wiphy_get_supported_rates expected an enum defined in the nl80211 header but the argument type was an unsigned int, not exactly intuitive to anyone using the API. Since the nl80211 enum value was only used in a switch statement it could just as well be IWD's internal enum band_freq. This also allows modules which do not reference nl80211.h to use wiphy_get_supported_rates(). --- src/scan.c | 2 +- src/wiphy.c | 9 +++++---- src/wiphy.h | 4 +++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/scan.c b/src/scan.c index ef222f66..5d2f2957 100644 --- a/src/scan.c +++ b/src/scan.c @@ -426,7 +426,7 @@ static struct l_genl_msg *scan_build_cmd(struct scan_context *sc, * rates we don't want to advertise support for 802.11b rates. */ if (L_WARN_ON(!(supported = wiphy_get_supported_rates(sc->wiphy, - NL80211_BAND_2GHZ, + BAND_FREQ_2_4_GHZ, &num_supported)))) goto done; diff --git a/src/wiphy.c b/src/wiphy.c index 10514572..37e0cdb8 100644 --- a/src/wiphy.c +++ b/src/wiphy.c @@ -788,19 +788,20 @@ bool wiphy_supports_iftype(struct wiphy *wiphy, uint32_t iftype) return wiphy->supported_iftypes & (1 << (iftype - 1)); } -const uint8_t *wiphy_get_supported_rates(struct wiphy *wiphy, unsigned int band, +const uint8_t *wiphy_get_supported_rates(struct wiphy *wiphy, + enum band_freq band, unsigned int *out_num) { struct band *bandp; switch (band) { - case NL80211_BAND_2GHZ: + case BAND_FREQ_2_4_GHZ: bandp = wiphy->band_2g; break; - case NL80211_BAND_5GHZ: + case BAND_FREQ_5_GHZ: bandp = wiphy->band_5g; break; - case NL80211_BAND_6GHZ: + case BAND_FREQ_6_GHZ: bandp = wiphy->band_6g; break; default: diff --git a/src/wiphy.h b/src/wiphy.h index f8de7e0e..410105dd 100644 --- a/src/wiphy.h +++ b/src/wiphy.h @@ -29,6 +29,7 @@ struct scan_freq_set; struct wiphy_radio_work_item; struct ie_rsn_info; enum security; +enum band_freq; typedef bool (*wiphy_radio_work_func_t)(struct wiphy_radio_work_item *item); typedef void (*wiphy_radio_work_destroy_func_t)( @@ -112,7 +113,8 @@ uint8_t wiphy_get_max_num_ssids_per_scan(struct wiphy *wiphy); uint16_t wiphy_get_max_scan_ie_len(struct wiphy *wiphy); uint32_t wiphy_get_max_roc_duration(struct wiphy *wiphy); bool wiphy_supports_iftype(struct wiphy *wiphy, uint32_t iftype); -const uint8_t *wiphy_get_supported_rates(struct wiphy *wiphy, unsigned int band, +const uint8_t *wiphy_get_supported_rates(struct wiphy *wiphy, + enum band_freq band, unsigned int *out_num); bool wiphy_supports_adhoc_rsn(struct wiphy *wiphy); bool wiphy_can_offchannel_tx(struct wiphy *wiphy); From patchwork Fri Dec 9 18:23:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13070077 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 868E863DB for ; Fri, 9 Dec 2022 18:23:53 +0000 (UTC) Received: by mail-pl1-f175.google.com with SMTP id d7so5722395pll.9 for ; Fri, 09 Dec 2022 10:23:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HJE45BuRWMwDZ94EP8rqad4sHF/ci/oKjbJW/z5Fg78=; b=Sjk6hOzH5ackMn3L+rUglhuKz5jKS9/B+9hHlS5VKIP84fH3YTvgtaAvr4nkw+A/YZ VlZbP8sU1tRUcycP83vmw649Vtp/9e+oSuwqw+F/VaBK40egLdqnK4LuJbIEyADAXfMb cxmViyE9GwCvUYLmwfw6r7KmNpUiztdEw76LThKqaecT9qNdIFZon/1gFXSEDaNd19Dy 4Hm6dGlVC4+GV7o29JEeq9Kq6JcsFU/pSgvuyQd4bm9Gql9DJ9CrYKw2XlNz6WQMKyYg MBPXc85A+392wyioySW+pnn3NRwBIe8yHc7EFQbbeK2aaXJFoOycnz6szt7Gi5Ih5XST d/lQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HJE45BuRWMwDZ94EP8rqad4sHF/ci/oKjbJW/z5Fg78=; b=jOZ30fYPOtjpHjBZOQ4tEfDzkIxjh56KZ8n/jlma7NGcWCpjnkyQMTE9l7YFNyyCT2 Y9SBzMT1F8zbFjOfxXe6Q0CFBzJv6iPtNcaE1klS3ZhW8QQGSZPWakqLDThb7IKp/h5t jY91XdinrLbHA27Md8BurS6weF6ZFZLSZUYph6d9pdZ/q+q5eNKErJ/ooNQxmMA5bGBC HhhMuESQpioVcHXh7C5YD/Dyxcpta3FYzK1S9/JV4DUkK6x4oAw81gQuapxMxEyTB6LX 1dLsR7psUmi47RTz4b80ig51BLWfw8eI74uLQRk736eN339698nvrvhdDAf/3avJ1K7+ 39PA== X-Gm-Message-State: ANoB5pn07XqUZ6rnncjSkLyDvyJrJHK56QXQj7BufXxvzbmWb6NiWsrM pSwJf/I7Gk2WDO3M8O+4wC+VMWu1C2s= X-Google-Smtp-Source: AA0mqf6kYSxX+blHkO9NKqMfJtkUn3udRkfqguy283tVcsI8vyR+g6KpWJCSAFqq2Da4dZj9Qs680A== X-Received: by 2002:a17:903:1302:b0:189:7e2f:d64c with SMTP id iy2-20020a170903130200b001897e2fd64cmr6377956plb.55.1670610232870; Fri, 09 Dec 2022 10:23:52 -0800 (PST) Received: from jprestwo-xps.none ([50.39.160.234]) by smtp.gmail.com with ESMTPSA id q14-20020a170902a3ce00b001897de9bae3sm1635790plb.204.2022.12.09.10.23.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 10:23:52 -0800 (PST) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 2/4] ap: add support for 5GHz frequencies in AP mode Date: Fri, 9 Dec 2022 10:23:45 -0800 Message-Id: <20221209182347.838602-2-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20221209182347.838602-1-prestwoj@gmail.com> References: <20221209182347.838602-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This enables IWD to use 5GHz frequencies in AP mode. Only profile based AP's can use this feature since additional information is needed. A new profile key [General].Band was added which is optional and expects a string, either "2.4GHz" or "5GHz". The existing Channel key can then be used to specify any 5GHz channel. It should be noted that the system will probably need a regulatory domain set in order for 5GHz to be allowed in AP mode. This is due to world roaming (00) restricting any/all 5GHz frequencies. This can be accomplished by setting main.conf [General].Country=CC to the country this AP will operate in. --- src/ap.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 65 insertions(+), 8 deletions(-) diff --git a/src/ap.c b/src/ap.c index 69412174..72951320 100644 --- a/src/ap.c +++ b/src/ap.c @@ -70,6 +70,7 @@ struct ap_state { char ssid[33]; char passphrase[64]; uint8_t psk[32]; + enum band_freq band; uint8_t channel; uint8_t *authorized_macs; unsigned int authorized_macs_num; @@ -985,7 +986,7 @@ static uint32_t ap_send_mgmt_frame(struct ap_state *ap, frame_xchg_cb_t callback, void *user_data) { - uint32_t ch_freq = band_channel_to_freq(ap->channel, BAND_FREQ_2_4_GHZ); + uint32_t ch_freq = band_channel_to_freq(ap->channel, ap->band); uint64_t wdev_id = netdev_get_wdev_id(ap->netdev); struct iovec iov[2]; @@ -2408,7 +2409,7 @@ static struct l_genl_msg *ap_build_cmd_start_ap(struct ap_state *ap) uint32_t nl_akm = CRYPTO_AKM_PSK; uint32_t wpa_version = NL80211_WPA_VERSION_2; uint32_t auth_type = NL80211_AUTHTYPE_OPEN_SYSTEM; - uint32_t ch_freq = band_channel_to_freq(ap->channel, BAND_FREQ_2_4_GHZ); + uint32_t ch_freq = band_channel_to_freq(ap->channel, ap->band); uint32_t ch_width = NL80211_CHAN_WIDTH_20; unsigned int i; @@ -3170,6 +3171,42 @@ static char **ap_ciphers_to_strv(uint16_t ciphers) return list; } +static bool ap_validate_band_channel(struct ap_state *ap) +{ + struct wiphy *wiphy = netdev_get_wiphy(ap->netdev); + const struct scan_freq_set *supported; + const struct scan_freq_set *disabled; + uint32_t freq; + + if (!(wiphy_get_supported_bands(wiphy) & ap->band)) { + l_error("AP hardware does not support band"); + return -EINVAL; + } + + freq = band_channel_to_freq(ap->channel, ap->band); + if (!freq) { + l_error("AP invalid band (%s) and channel (%u) combination", + (ap->band & BAND_FREQ_5_GHZ) ? "5Ghz" : "2.4GHz", + ap->channel); + return false; + } + + supported = wiphy_get_supported_freqs(wiphy); + disabled = wiphy_get_disabled_freqs(wiphy); + + if (!scan_freq_set_contains(supported, freq)) { + l_error("AP hardware does not support frequency %u", freq); + return false; + } + + if (scan_freq_set_contains(disabled, freq)) { + l_error("AP hardware has frequency %u disabled", freq); + return false; + } + + return true; +} + static int ap_load_config(struct ap_state *ap, const struct l_settings *config, bool *out_cck_rates) { @@ -3214,17 +3251,31 @@ static int ap_load_config(struct ap_state *ap, const struct l_settings *config, unsigned int uintval; if (!l_settings_get_uint(config, "General", "Channel", - &uintval) || - !band_channel_to_freq(uintval, - BAND_FREQ_2_4_GHZ)) { + &uintval)) { l_error("AP Channel value unsupported"); return -EINVAL; } ap->channel = uintval; - } else + + /* + * 6GHz is not supported so we can use only a channel number to + * distinguish between 2.4 and 5GHz. + */ + if (ap->channel >= 36) + ap->band = BAND_FREQ_5_GHZ; + else + ap->band = BAND_FREQ_2_4_GHZ; + } else { /* TODO: Start a Get Survey to decide the channel */ ap->channel = 6; + ap->band = BAND_FREQ_2_4_GHZ; + } + + if (!ap_validate_band_channel(ap)) { + l_error("AP Band and Channel combination invalid"); + return -EINVAL; + } strval = l_settings_get_string(config, "WSC", "DeviceName"); if (strval) { @@ -3290,7 +3341,13 @@ static int ap_load_config(struct ap_state *ap, const struct l_settings *config, l_strfreev(strvval); } - if (l_settings_get_value(config, "General", "NoCCKRates")) { + /* + * Since 5GHz won't ever support only CCK rates we can ignore this + * setting on that band. + */ + if (ap->band & BAND_FREQ_5_GHZ) + *out_cck_rates = false; + else if (l_settings_get_value(config, "General", "NoCCKRates")) { bool boolval; if (!l_settings_get_bool(config, "General", "NoCCKRates", @@ -4080,7 +4137,7 @@ static bool ap_dbus_property_get_freq(struct l_dbus *dbus, if (!ap_if->ap || !ap_if->ap->started) return false; - freq = band_channel_to_freq(ap_if->ap->channel, BAND_FREQ_2_4_GHZ); + freq = band_channel_to_freq(ap_if->ap->channel, ap_if->ap->band); l_dbus_message_builder_append_basic(builder, 'u', &freq); From patchwork Fri Dec 9 18:23:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13070078 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B08C163D2 for ; Fri, 9 Dec 2022 18:23:54 +0000 (UTC) Received: by mail-pl1-f170.google.com with SMTP id g10so5718692plo.11 for ; Fri, 09 Dec 2022 10:23:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aquXlOQ3CwSHuYRsco0TqVmnv7BMfzk8TjLyZdgx50g=; b=RwOIU++uQJLfJKswnfeXpYlRcBLkfgSsgrOjahDy27He0rG/BBl37AWr/LGTpju6Ct LyovoMSFZQkhu+x6NWC0IEvuUlCSvIiA6pCeOudNifybZx6a+hV5OZobd77TPOdad8N8 kI9AZZ1MnC2IReje/jMM6gzo8HgZvkrYB4c0WHOvEKxZpO33zDUPsbLNfeByb3cDBNtV jiTRiFaUBQKmiG6HGuMR02QrAdUmOUmx0OWTJ51JKyYhlNiL+1Qd6qHvC03BGFPfMLPo kPDCj1DKpspgdAPDo7xuCySWcQ4PfLWP6VZUkO8GrpH94dyx5XacG7X0ONJkK+27Cwd9 DafA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aquXlOQ3CwSHuYRsco0TqVmnv7BMfzk8TjLyZdgx50g=; b=s5GQnZDvvz9ecTJjTbLWzUGq/1sMu8tvSfWNsv60z5JLbFS9bQvBV7JZGzI7j2pzp0 bEvhCgb/bh8jO4qBAnSjrs2/3mRu4X6bFAMlPnuVXbFfWMh77IeUnPTgi/EFe9qW4Qa+ s9N1gdlNA30AOG7ZuSqN5fC/GPCdfwp+pp6na/3VeRL2mJAGfzYJp9cf3p0DE6Ata8yr vFvidyqDY9MQwkTp39vdgHaFCWEbBDOOtlej3o7Us98QW1N37I4ztReh5TEwPrq4WIb4 guv0FtatY6KUNHl3HFAL8vnx73CuXGdRe1UavhmjIDGKiRrHlz6FXHIEF5S5BRDpYXNY 1r6Q== X-Gm-Message-State: ANoB5pmzBH448ZhFVwSzd4EHQEnZZzFRilt4Q0GIaWh9AuogHDjWY/VO dofxm8tl6wF8A0ZTEyxziewnNRGaJ+k= X-Google-Smtp-Source: AA0mqf4+35kQcTraUPF28tVYrgku58ML+sQl3znpGvmQEhSusGVdw95yUFGvetW7dN8e80RCjModCw== X-Received: by 2002:a17:902:dad1:b0:189:8513:f6f9 with SMTP id q17-20020a170902dad100b001898513f6f9mr8563477plx.18.1670610233892; Fri, 09 Dec 2022 10:23:53 -0800 (PST) Received: from jprestwo-xps.none ([50.39.160.234]) by smtp.gmail.com with ESMTPSA id q14-20020a170902a3ce00b001897de9bae3sm1635790plb.204.2022.12.09.10.23.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 10:23:53 -0800 (PST) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 3/4] ap: select rates from hardware capabilities Date: Fri, 9 Dec 2022 10:23:46 -0800 Message-Id: <20221209182347.838602-3-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20221209182347.838602-1-prestwoj@gmail.com> References: <20221209182347.838602-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Rather than a list of static rates, choose what the hardware advertises. For the case of CCK rates only include rates 11mbps or lower. --- src/ap.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/ap.c b/src/ap.c index 72951320..77fdc561 100644 --- a/src/ap.c +++ b/src/ap.c @@ -3438,6 +3438,9 @@ struct ap_state *ap_start(struct netdev *netdev, struct l_settings *config, uint64_t wdev_id = netdev_get_wdev_id(netdev); int err; bool cck_rates = true; + const uint8_t *rates; + unsigned int num_rates; + unsigned int i; if (L_WARN_ON(!config)) { if (err_out) @@ -3463,22 +3466,17 @@ struct ap_state *ap_start(struct netdev *netdev, struct l_settings *config, wsc_uuid_from_addr(netdev_get_address(netdev), ap->wsc_uuid_r); + rates = wiphy_get_supported_rates(wiphy, ap->band, &num_rates); + if (!rates) + goto error; + ap->rates = l_uintset_new(200); - /* TODO: Pick from actual supported rates */ - if (!cck_rates) { - l_uintset_put(ap->rates, 12); /* 6 Mbps*/ - l_uintset_put(ap->rates, 18); /* 9 Mbps*/ - l_uintset_put(ap->rates, 24); /* 12 Mbps*/ - l_uintset_put(ap->rates, 36); /* 18 Mbps*/ - l_uintset_put(ap->rates, 48); /* 24 Mbps*/ - l_uintset_put(ap->rates, 72); /* 36 Mbps*/ - l_uintset_put(ap->rates, 96); /* 48 Mbps*/ - l_uintset_put(ap->rates, 108); /* 54 Mbps*/ - } else { - l_uintset_put(ap->rates, 2); /* 1 Mbps*/ - l_uintset_put(ap->rates, 11); /* 5.5 Mbps*/ - l_uintset_put(ap->rates, 22); /* 11 Mbps*/ + for (i = 0; i < num_rates; i++) { + if (cck_rates && rates[i] > 22) + continue; + + l_uintset_put(ap->rates, rates[i]); } if (!frame_watch_add(wdev_id, 0, 0x0000 | From patchwork Fri Dec 9 18:23:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13070079 Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF76263DB for ; Fri, 9 Dec 2022 18:23:55 +0000 (UTC) Received: by mail-pj1-f44.google.com with SMTP id o1-20020a17090a678100b00219cf69e5f0so8979430pjj.2 for ; Fri, 09 Dec 2022 10:23:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JqeYpa7sv4P1GZ4qZMuySNH9P1etBW2vI4Y9N6iOExA=; b=IOO8SD6qelMHxeT3Xu04EwM+DZ45M8X6y1r3oxptOZ6V7NkwWo2QquiN+GenuYDynK 5f0hWLPpSsez1i8egIR2e1wGWauN7Zn+dnEkjxg9OzxqFVtDuVYdj2etNWD1mG+w+MpC WAjqN+7YaynA+BD8tcmKtVGaI/fz1gGHuSDuNbZYb/eZF4+FkcwrGSkVGgnrTpK7A2YT mKb4WZCG+gj3kkpS5sXtsfLLpjDW+WveNQSK3b5eACb9c0dzXZP1MZpdVtzzsgcajyq2 8GtbXrxphsHN3yIrVLWCpAMhu4OIWLLoNHkJj0DJPBH7EMBEYe2A4Bgf4niXXmRMN4dm 8ZpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JqeYpa7sv4P1GZ4qZMuySNH9P1etBW2vI4Y9N6iOExA=; b=0lCyYrehT1aZ4ACVOYCoRBkBRAUMKBOwLloWu8jGqlX6UW4C3QiNGc6NKGZc416VBo lMkgyvpkN49keUxCOm1GCbYFEDCcmOB3zaQkD9a48vlBy/a6EkBl7zWvcvCzW0kZgFpk llxdjKPh1K/EZJeyJOO6JYPzzPPdHHOD6s1xR2xN1V/+uiFR69eIQuETCTRMClQVW3PV 2PmDjkm9YVYWW4rU5wlMOZyRXNEOQOHEb5VKPWf3wxd2ysH/+CRTniF9PSfhG+UOhgmx bibA19KFr/+NjlNJlnKW57I/71CfI5FbCAQKNt3AojANNxIMt7jcKBnZAiVcYAnCzwE8 Cxzw== X-Gm-Message-State: ANoB5pmJbl2H5xWakKEtXFr1ZkHnbPITXJ3JiTe0XvuJ2JHKnlJzFw3k Ww9ZYFivKNwswZLYm/nuRTrSoqeeRP8= X-Google-Smtp-Source: AA0mqf4cRXvsNFPevmAQaU9pDZoBDqvGJ+WKeAY+wXxFYw+siRMGKc+XybhXxoy0rcIee1qi57W+pA== X-Received: by 2002:a17:902:70c2:b0:189:adf5:da2b with SMTP id l2-20020a17090270c200b00189adf5da2bmr6706773plt.58.1670610235183; Fri, 09 Dec 2022 10:23:55 -0800 (PST) Received: from jprestwo-xps.none ([50.39.160.234]) by smtp.gmail.com with ESMTPSA id q14-20020a170902a3ce00b001897de9bae3sm1635790plb.204.2022.12.09.10.23.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 10:23:54 -0800 (PST) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 4/4] doc: document new AP profile key: [General].Band Date: Fri, 9 Dec 2022 10:23:47 -0800 Message-Id: <20221209182347.838602-4-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20221209182347.838602-1-prestwoj@gmail.com> References: <20221209182347.838602-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- src/iwd.ap.rst | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/iwd.ap.rst b/src/iwd.ap.rst index 7b8844e7..823aba99 100644 --- a/src/iwd.ap.rst +++ b/src/iwd.ap.rst @@ -55,8 +55,17 @@ The group ``[General]`` contains general AP configuration. * - Channel - Channel number - Optional channel number for the access point to operate on. Only the - 2.4GHz-band channels are currently allowed. + Optional channel number for the access point to operate on. If omitted + the channel will be chosen automatically. Channels greater than or equal + to 36 will select the 5GHz band for the AP to operate on. + + Note: Due to regulatory requirements the linux kernel does not allow or + strictly limits 5GHz use in AP mode while in world roaming. These + frequencies become available once the country is set, either via IWD's + main.conf option ``[General].Country`` (see ``man iwd.config``) or + externally (e.g. iw reg set ). If you are having trouble using 5GHz + ensure the country is set, and that the desired frequency/channel is + unrestricted. Network Authentication Settings -------------------------------