merge: branch 'bg/wifi-6ghz'

wifi: add support for new "6GHz" band

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2318
This commit is contained in:
Beniamino Galvani 2025-12-19 14:05:09 +00:00
commit 6d819e0375
34 changed files with 3010 additions and 2235 deletions

3
NEWS
View file

@ -26,6 +26,9 @@ USE AT YOUR OWN RISK. NOT RECOMMENDED FOR PRODUCTION USE!
* The support for Wireless Extensions is deprecated and will be
removed in a future release. Wireless Extensions are now disabled by
default.
* The "band" property of Wi-fi connections now accepts the "6GHz"
value.
* Show the Wi-Fi band of APs in the scan results from nmcli.
=============================================
NetworkManager-1.56

View file

@ -1718,6 +1718,7 @@
<group choice='req'>
<arg choice='plain'>a</arg>
<arg choice='plain'>bg</arg>
<arg choice='plain'>6GHz</arg>
</group>
</arg>
<arg><option>channel</option> <replaceable>channel</replaceable></arg>

View file

@ -3257,8 +3257,10 @@ act_stage1_prepare(NMDevice *device, NMDeviceStateReason *out_failure_reason)
static void
ensure_hotspot_frequency(NMDeviceWifi *self, NMSettingWireless *s_wifi, NMWifiAP *ap)
{
guint32 a_freqs[] = {5180, 5200, 5220, 5745, 5765, 5785, 5805, 0};
guint32 bg_freqs[] = {2412, 2437, 2462, 2472, 0};
guint32 freqs_a[] = {5180, 5200, 5220, 5745, 5765, 5785, 5805, 0};
guint32 freqs_bg[] = {2412, 2437, 2462, 2472, 0};
guint32 freqs_6ghz[] =
{5955, 5975, 5995, 6015, 6035, 6055, 6075, 6095, 6755, 6775, 6795, 6815, 0};
guint32 *rnd_freqs;
guint rnd_freqs_len;
NMDevice *device = NM_DEVICE(self);
@ -3269,7 +3271,7 @@ ensure_hotspot_frequency(NMDeviceWifi *self, NMSettingWireless *s_wifi, NMWifiAP
guint l;
nm_assert(ap);
nm_assert(NM_IN_STRSET(band, NULL, "a", "bg"));
nm_assert(NM_IN_STRSET(band, NULL, "a", "bg", "6GHz"));
if (nm_wifi_ap_get_freq(ap))
return;
@ -3303,11 +3305,14 @@ ensure_hotspot_frequency(NMDeviceWifi *self, NMSettingWireless *s_wifi, NMWifiAP
}
if (nm_streq0(band, "a")) {
rnd_freqs = a_freqs;
rnd_freqs_len = G_N_ELEMENTS(a_freqs) - 1;
rnd_freqs = freqs_a;
rnd_freqs_len = G_N_ELEMENTS(freqs_a) - 1;
} else if (nm_streq0(band, "6GHz")) {
rnd_freqs = freqs_6ghz;
rnd_freqs_len = G_N_ELEMENTS(freqs_6ghz) - 1;
} else {
rnd_freqs = bg_freqs;
rnd_freqs_len = G_N_ELEMENTS(bg_freqs) - 1;
rnd_freqs = freqs_bg;
rnd_freqs_len = G_N_ELEMENTS(freqs_bg) - 1;
}
/* shuffle the frequencies (inplace). The idea is to choose

View file

@ -574,16 +574,6 @@ nm_wifi_ap_to_string(const NMWifiAP *self, char *str_buf, gulong buf_len, gint64
return str_buf;
}
static guint
freq_to_band(guint32 freq)
{
if (freq >= 4915 && freq <= 5825)
return 5;
else if (freq >= 2412 && freq <= 2484)
return 2;
return 0;
}
gboolean
nm_wifi_ap_check_compatible(NMWifiAP *self, NMConnection *connection)
{
@ -631,12 +621,12 @@ nm_wifi_ap_check_compatible(NMWifiAP *self, NMConnection *connection)
band = nm_setting_wireless_get_band(s_wireless);
if (band) {
guint ap_band = freq_to_band(priv->freq);
const char *ap_band = nm_wifi_freq_to_band_prop(priv->freq);
if (!strcmp(band, "a") && ap_band != 5)
return FALSE;
else if (!strcmp(band, "bg") && ap_band != 2)
if (!nm_streq(band, ap_band))
return FALSE;
return TRUE;
}
channel = nm_setting_wireless_get_channel(s_wireless);

View file

@ -639,7 +639,7 @@ nm_wifi_utils_complete_connection(GBytes *ap_ssid,
chan_valid = FALSE;
}
band = nm_utils_wifi_freq_to_band(ap_freq);
band = nm_wifi_freq_to_band_prop(ap_freq);
if (band) {
g_object_set(s_wifi, NM_SETTING_WIRELESS_BAND, band, NULL);
} else {
@ -1929,3 +1929,19 @@ nm_wifi_utils_wfd_info_eq(const NMIwdWfdInfo *a, const NMIwdWfdInfo *b)
return a->source == b->source && a->sink == b->sink && a->port == b->port
&& a->has_audio == b->has_audio && a->has_uibc == b->has_uibc && a->has_cp == b->has_cp;
}
const char *
nm_wifi_freq_to_band_prop(guint32 freq)
{
switch (nm_utils_wifi_freq_to_band(freq)) {
case NM_WIFI_BAND_2_4_GHZ:
return "bg";
case NM_WIFI_BAND_5_GHZ:
return "a";
case NM_WIFI_BAND_6_GHZ:
return "6GHz";
default:
case NM_WIFI_BAND_UNKNOWN:
return NULL;
}
}

View file

@ -56,4 +56,6 @@ bool nm_wifi_utils_parse_wfd_ies(GBytes *ies, NMIwdWfdInfo *out_wfd);
GBytes *nm_wifi_utils_build_wfd_ies(const NMIwdWfdInfo *wfd);
bool nm_wifi_utils_wfd_info_eq(const NMIwdWfdInfo *a, const NMIwdWfdInfo *b);
const char *nm_wifi_freq_to_band_prop(guint32 freq);
#endif /* __NM_WIFI_UTILS_H__ */

View file

@ -4401,7 +4401,7 @@ make_wireless_setting(shvarFile *ifcfg, GError **error)
NMSettingWireless *s_wireless;
const char *cvalue;
char *value = NULL;
gint64 chan = 0;
guint64 chan = 0;
NMSettingMacRandomization mac_randomization;
NMSettingWirelessPowersave powersave = NM_SETTING_WIRELESS_POWERSAVE_DEFAULT;
NMTernary ternary;
@ -4502,7 +4502,7 @@ make_wireless_setting(shvarFile *ifcfg, GError **error)
value = svGetValueStr_cp(ifcfg, "CHANNEL");
if (value) {
chan = _nm_utils_ascii_str_to_int64(value, 10, 1, 196, 0);
chan = _nm_utils_ascii_str_to_int64(value, 10, 1, _NM_WIFI_CHANNEL_MAX, 0);
if (chan == 0) {
g_set_error(error,
NM_SETTINGS_ERROR,
@ -4518,44 +4518,47 @@ make_wireless_setting(shvarFile *ifcfg, GError **error)
value = svGetValueStr_cp(ifcfg, "BAND");
if (value) {
if (!strcmp(value, "a")) {
if (chan && chan <= 14) {
g_set_error(error,
NM_SETTINGS_ERROR,
NM_SETTINGS_ERROR_INVALID_CONNECTION,
"Band '%s' invalid for channel %u",
value,
(guint32) chan);
g_free(value);
goto error;
}
} else if (!strcmp(value, "bg")) {
if (chan && chan > 14) {
g_set_error(error,
NM_SETTINGS_ERROR,
NM_SETTINGS_ERROR_INVALID_CONNECTION,
"Band '%s' invalid for channel %u",
value,
(guint32) chan);
g_free(value);
goto error;
}
} else {
if (!NM_IN_STRSET(value, "a", "bg", "6GHz")) {
g_set_error(error,
NM_SETTINGS_ERROR,
NM_SETTINGS_ERROR_INVALID_CONNECTION,
"Invalid wireless band '%s'",
"Band '%s' invalid",
value);
g_free(value);
goto error;
}
if (chan) {
if (!nm_utils_wifi_is_channel_valid(chan, value)) {
g_set_error(error,
NM_SETTINGS_ERROR,
NM_SETTINGS_ERROR_INVALID_CONNECTION,
"Band '%s' invalid for channel %u",
value,
(guint32) chan);
g_free(value);
goto error;
}
}
g_object_set(s_wireless, NM_SETTING_WIRELESS_BAND, value, NULL);
g_free(value);
} else if (chan > 0) {
if (chan > 14)
if (chan > _NM_WIFI_CHANNEL_MAX_5GHZ) {
g_set_error(error,
NM_SETTINGS_ERROR,
NM_SETTINGS_ERROR_INVALID_CONNECTION,
"Setting channel without band is ambiguous and deprecated. Not supported "
"for 6GHz.");
g_free(value);
goto error;
} else if (chan > _NM_WIFI_CHANNEL_MAX_2GHZ) {
PARSE_WARNING(
"Setting channel without band is ambiguous and deprecated. Assuming band 'a'.");
g_object_set(s_wireless, NM_SETTING_WIRELESS_BAND, "a", NULL);
else
} else {
g_object_set(s_wireless, NM_SETTING_WIRELESS_BAND, "bg", NULL);
}
}
value = svGetValueStr_cp(ifcfg, "MTU");

View file

@ -849,7 +849,7 @@ write_wireless_setting(NMConnection *connection,
GBytes *ssid;
const guint8 *ssid_data;
gsize ssid_len;
const char *mode, *bssid;
const char *mode, *bssid, *band;
const char *device_mac, *cloned_mac;
guint32 mtu, chan, i;
gboolean adhoc = FALSE, hex_ssid = FALSE;
@ -968,9 +968,11 @@ write_wireless_setting(NMConnection *connection,
chan = nm_setting_wireless_get_channel(s_wireless);
if (chan) {
svSetValueInt64(ifcfg, "CHANNEL", chan);
} else {
/* Band only set if channel is not, since channel implies band */
svSetValueStr(ifcfg, "BAND", nm_setting_wireless_get_band(s_wireless));
}
band = nm_setting_wireless_get_band(s_wireless);
if (band) {
svSetValueStr(ifcfg, "BAND", band);
}
bssid = nm_setting_wireless_get_bssid(s_wireless);

View file

@ -1,6 +1,7 @@
ESSID=MySSID
MODE=Ap
CHANNEL=196
CHANNEL=52
BAND=a
MAC_ADDRESS_RANDOMIZATION=default
AP_ISOLATION=yes
TYPE=Wireless

View file

@ -0,0 +1,18 @@
ESSID="Test SSID"
MODE=Managed
BAND=6GHz
MAC_ADDRESS_RANDOMIZATION=default
TYPE=Wireless
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=default
NAME="Test Write Wi-Fi Band 6GHz"
UUID=${UUID}
ONBOOT=yes

View file

@ -13,6 +13,6 @@ IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=default
NAME="Test Write Wi-Fi Band A"
NAME="Test Write Wi-Fi Band A - 5GHz"
UUID=${UUID}
ONBOOT=yes

View file

@ -0,0 +1,13 @@
TYPE=Wireless
DEVICE=eth2
HWADDR=00:16:41:11:22:33
NM_CONTROLLED=yes
BOOTPROTO=dhcp
ESSID=blahblah
BAND=6GHz
MODE=Managed
RATE=auto
ONBOOT=yes
USERCTL=yes
PEERDNS=yes
IPV6INIT=no

View file

@ -0,0 +1,9 @@
TYPE=Wireless
DEVICE=eth2
HWADDR=00:16:41:11:22:33
BOOTPROTO=dhcp
ESSID=blahblah
CHANNEL=14
BAND=6GHz
MODE=Managed

View file

@ -3991,7 +3991,7 @@ test_write_wifi_band_a(void)
s_con = _nm_connection_new_setting(connection, NM_TYPE_SETTING_CONNECTION);
g_object_set(s_con,
NM_SETTING_CONNECTION_ID,
"Test Write Wi-Fi Band A",
"Test Write Wi-Fi Band A - 5GHz",
NM_SETTING_CONNECTION_UUID,
nm_uuid_generate_random_str_a(),
NM_SETTING_CONNECTION_TYPE,
@ -4012,7 +4012,7 @@ test_write_wifi_band_a(void)
_writer_new_connec_exp(connection,
TEST_SCRATCH_DIR,
TEST_IFCFG_DIR "/ifcfg-Test_Write_WiFi_Band_A.cexpected",
TEST_IFCFG_DIR "/ifcfg-Test_Write_WiFi_Band_a.cexpected",
&testfile);
f = _svOpenFile(testfile);
@ -4024,6 +4024,77 @@ test_write_wifi_band_a(void)
nmtst_assert_connection_equals(connection, TRUE, reread, FALSE);
}
static void
test_read_wifi_band_6ghz(void)
{
gs_unref_object NMConnection *connection = NULL;
NMSettingConnection *s_con;
NMSettingWireless *s_wifi;
connection = _connection_from_file(TEST_IFCFG_DIR "/ifcfg-test-wifi-band-6ghz",
NULL,
TYPE_WIRELESS,
NULL);
s_con = nmtst_connection_assert_setting(connection, NM_TYPE_SETTING_CONNECTION);
g_assert_cmpstr(nm_setting_connection_get_connection_type(s_con),
==,
NM_SETTING_WIRELESS_SETTING_NAME);
s_wifi = nmtst_connection_assert_setting(connection, NM_TYPE_SETTING_WIRELESS);
g_assert_cmpstr(nm_setting_wireless_get_band(s_wifi), ==, "6GHz");
}
static void
test_write_wifi_band_6ghz(void)
{
nmtst_auto_unlinkfile char *testfile = NULL;
gs_unref_object NMConnection *connection = NULL;
gs_unref_object NMConnection *reread = NULL;
NMSettingConnection *s_con;
NMSettingWireless *s_wifi;
shvarFile *f;
gs_unref_bytes GBytes *ssid =
nmtst_gbytes_from_arr(0x54, 0x65, 0x73, 0x74, 0x20, 0x53, 0x53, 0x49, 0x44);
connection = nm_simple_connection_new();
s_con = _nm_connection_new_setting(connection, NM_TYPE_SETTING_CONNECTION);
g_object_set(s_con,
NM_SETTING_CONNECTION_ID,
"Test Write Wi-Fi Band 6GHz",
NM_SETTING_CONNECTION_UUID,
nm_uuid_generate_random_str_a(),
NM_SETTING_CONNECTION_TYPE,
NM_SETTING_WIRELESS_SETTING_NAME,
NULL);
s_wifi = _nm_connection_new_setting(connection, NM_TYPE_SETTING_WIRELESS);
g_object_set(s_wifi,
NM_SETTING_WIRELESS_SSID,
ssid,
NM_SETTING_WIRELESS_MODE,
"infrastructure",
NM_SETTING_WIRELESS_BAND,
"6GHz",
NULL);
nmtst_assert_connection_verifies(connection);
_writer_new_connec_exp(connection,
TEST_SCRATCH_DIR,
TEST_IFCFG_DIR "/ifcfg-Test_Write_WiFi_Band_6ghz.cexpected",
&testfile);
f = _svOpenFile(testfile);
_svGetValue_check(f, "BAND", "6GHz");
svCloseFile(f);
reread = _connection_from_file(testfile, NULL, TYPE_WIRELESS, NULL);
nmtst_assert_connection_equals(connection, TRUE, reread, FALSE);
}
static void
test_write_wifi_ap_mode(void)
{
@ -4055,7 +4126,7 @@ test_write_wifi_ap_mode(void)
NM_SETTING_WIRELESS_BAND,
"a",
NM_SETTING_WIRELESS_CHANNEL,
(guint) 196,
(guint) 52,
NM_SETTING_WIRELESS_AP_ISOLATION,
NM_TERNARY_TRUE,
NULL);
@ -4072,6 +4143,18 @@ test_write_wifi_ap_mode(void)
nmtst_assert_connection_equals(connection, TRUE, reread, FALSE);
}
static void
test_read_wifi_band_6ghz_channel_mismatch(void)
{
gs_free_error GError *error = NULL;
_connection_from_file_fail(TEST_IFCFG_DIR "/ifcfg-test-wifi-band-6ghz-channel-mismatch",
NULL,
TYPE_WIRELESS,
&error);
g_assert_error(error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION);
}
static void
test_read_wifi_band_a_channel_mismatch(void)
{
@ -10680,6 +10763,9 @@ main(int argc, char **argv)
test_read_wifi_band_a_channel_mismatch);
g_test_add_func(TPATH "wifi/read-band-bg-channel-mismatch",
test_read_wifi_band_bg_channel_mismatch);
g_test_add_func(TPATH "wifi/read-band-6ghz", test_read_wifi_band_6ghz);
g_test_add_func(TPATH "wifi/read-band-6ghz-channel-mismatch",
test_read_wifi_band_6ghz_channel_mismatch);
g_test_add_func(TPATH "wifi/read-hidden", test_read_wifi_hidden);
nmtst_add_test_func(TPATH "wifi/read-mac-random-always",
@ -10852,6 +10938,7 @@ main(int argc, char **argv)
test_write_wifi_wpa_then_wep_with_perms);
g_test_add_func(TPATH "wifi/write-hidden", test_write_wifi_hidden);
g_test_add_func(TPATH "wifi/write-band-a", test_write_wifi_band_a);
g_test_add_func(TPATH "wifi/write-band-6ghz", test_write_wifi_band_6ghz);
g_test_add_func(TPATH "wifi/write-ap-mode", test_write_wifi_ap_mode);
g_test_add_func(TPATH "s390/read-qeth-static", test_read_wired_qeth_static);

View file

@ -363,14 +363,24 @@ nm_supplicant_config_get_blobs(NMSupplicantConfig *self)
}
static const char *
wifi_freqs_to_string(gboolean bg_band)
wifi_freqs_to_string(const char *band)
{
static const char *str_2ghz = NULL;
static const char *str_5ghz = NULL;
static const char *str_6ghz = NULL;
const char **f_p;
const char *f;
f_p = bg_band ? &str_2ghz : &str_5ghz;
if (nm_streq0(band, "a"))
f_p = &str_5ghz;
else if (nm_streq0(band, "bg"))
f_p = &str_2ghz;
else if (nm_streq0(band, "6GHz"))
f_p = &str_6ghz;
else {
nm_assert_not_reached();
return NULL;
}
again:
f = g_atomic_pointer_get(f_p);
@ -380,7 +390,13 @@ again:
const guint *freqs;
int i;
freqs = bg_band ? nm_utils_wifi_2ghz_freqs() : nm_utils_wifi_5ghz_freqs();
if (f_p == &str_2ghz)
freqs = nm_utils_wifi_2ghz_freqs();
else if (f_p == &str_5ghz)
freqs = nm_utils_wifi_5ghz_freqs();
else
freqs = nm_utils_wifi_6ghz_freqs();
for (i = 0; freqs[i]; i++) {
if (i > 0)
nm_str_buf_append_c(&strbuf, ' ');
@ -521,22 +537,49 @@ get_ap_params(guint freq,
case NM_SETTING_WIRELESS_CHANNEL_WIDTH_80MHZ:
{
guint channel;
if (freq < 5000) {
/* the setting is not valid */
nm_assert_not_reached();
return;
}
guint center_channel = 0;
/* Determine the center channel according to the table at
* https://en.wikipedia.org/wiki/List_of_WLAN_channels */
channel = (freq - 5000) / 5;
channel = ((channel / 4 - 1) / 4) * 16 + 10;
*out_ht40 = 1;
*out_max_oper_chwidth = 1;
*out_center_freq = 5000 + 5 * channel;
if (freq > 5950) {
/* 6 GHz */
channel = (freq - 5950) / 5;
channel = ((channel - 1) / 16) * 16 + 7;
*out_ht40 = 1;
*out_max_oper_chwidth = 1;
*out_center_freq = 5950 + 5 * channel;
} else {
/* 5 GHz */
if (freq < 5000) {
/* the setting is not valid */
nm_assert_not_reached();
return;
}
channel = (freq - 5000) / 5;
if (channel >= 36 && channel <= 48)
center_channel = 42;
else if (channel >= 52 && channel <= 64)
center_channel = 58;
else if (channel >= 100 && channel <= 112)
center_channel = 106;
else if (channel >= 116 && channel <= 128)
center_channel = 122;
else if (channel >= 132 && channel <= 144)
center_channel = 138;
else if (channel >= 149 && channel <= 161)
center_channel = 155;
else if (channel >= 165 && channel <= 177)
center_channel = 171;
if (center_channel) {
*out_ht40 = 1;
*out_max_oper_chwidth = 1;
*out_center_freq = 5000 + 5 * center_channel;
}
}
return;
}
@ -683,10 +726,7 @@ nm_supplicant_config_add_setting_wireless(NMSupplicantConfig *self,
} else {
const char *freqs = NULL;
if (nm_streq(band, "a"))
freqs = wifi_freqs_to_string(FALSE);
else if (nm_streq(band, "bg"))
freqs = wifi_freqs_to_string(TRUE);
freqs = wifi_freqs_to_string(band);
if (freqs
&& !nm_supplicant_config_add_option(self,

View file

@ -6,6 +6,7 @@
#include "src/core/nm-default-daemon.h"
#include "nm-supplicant-settings-verify.h"
#include "libnm-core-aux-intern/nm-libnm-core-utils.h"
#include <stdio.h>
#include <stdlib.h>
@ -71,7 +72,7 @@ static const struct Opt opt_table[] = {
OPT_BYTES("engine_id", 0),
OPT_INT("fragment_size", 1, 2000),
OPT_KEYWORD("freq_list", NULL),
OPT_INT("frequency", 2412, 5825),
OPT_INT("frequency", _NM_WIFI_FREQ_MIN, _NM_WIFI_FREQ_MAX),
OPT_KEYWORD("group", NM_MAKE_STRV("CCMP", "TKIP", "WEP104", "WEP40", "GCMP-256", )),
OPT_INT("ht40", 0, 1),
OPT_BYTES("identity", 0),

View file

@ -2093,3 +2093,10 @@ global:
nm_utils_copy_cert_as_user;
nm_vpn_plugin_info_supports_safe_private_file_access;
} libnm_1_54_0;
libnm_1_58_0 {
global:
nm_utils_wifi_6ghz_freqs;
nm_utils_wifi_freq_to_band;
nm_wifi_band_get_type;
} libnm_1_56_0;

View file

@ -18,6 +18,7 @@
#include "nm-dbus-interface.h"
#include "nm-object-private.h"
#include "libnm-core-aux-intern/nm-libnm-core-utils.h"
/*****************************************************************************/
@ -338,11 +339,14 @@ nm_access_point_connection_valid(NMAccessPoint *ap, NMConnection *connection)
ap_freq = nm_access_point_get_frequency(ap);
if (ap_freq) {
setting_band = nm_setting_wireless_get_band(s_wifi);
if (g_strcmp0(setting_band, "a") == 0) {
if (ap_freq < 4915 || ap_freq > 5825)
if (nm_streq0(setting_band, "a")) {
if (ap_freq < _NM_WIFI_FREQ_MIN_5GHZ || ap_freq > _NM_WIFI_FREQ_MAX_5GHZ)
return FALSE;
} else if (g_strcmp0(setting_band, "bg") == 0) {
if (ap_freq < 2412 || ap_freq > 2484)
} else if (nm_streq0(setting_band, "bg")) {
if (ap_freq < _NM_WIFI_FREQ_MIN_2GHZ || ap_freq > _NM_WIFI_FREQ_MAX_2GHZ)
return FALSE;
} else if (nm_streq0(setting_band, "6Ghz")) {
if (ap_freq < _NM_WIFI_FREQ_MIN_6GHZ || ap_freq > _NM_WIFI_FREQ_MAX_6GHZ)
return FALSE;
}

View file

@ -299,7 +299,7 @@ test_wifi_ap_added_removed(void)
ret = g_dbus_proxy_call_sync(sinfo->proxy,
"AddWifiAp",
g_variant_new("(sss)", "wlan0", "test-ap", expected_bssid),
g_variant_new("(sssu)", "wlan0", "test-ap", expected_bssid, 2412),
G_DBUS_CALL_FLAGS_NO_AUTO_START,
3000,
NULL,

View file

@ -342,4 +342,23 @@ const char *nm_dns_uri_normalize(int addr_family, const char *str, char **out_fr
gboolean nm_setting_ovs_other_config_check_key(const char *key, GError **error);
gboolean nm_setting_ovs_other_config_check_val(const char *val, GError **error);
/*****************************************************************************/
/* Wi-Fi frequencies range for each band */
#define _NM_WIFI_FREQ_MIN_2GHZ 2412
#define _NM_WIFI_FREQ_MAX_2GHZ 2484
#define _NM_WIFI_FREQ_MIN_5GHZ 4915
#define _NM_WIFI_FREQ_MAX_5GHZ 5885
#define _NM_WIFI_FREQ_MIN_6GHZ 5955
#define _NM_WIFI_FREQ_MAX_6GHZ 7115
#define _NM_WIFI_FREQ_MIN _NM_WIFI_FREQ_MIN_2GHZ
#define _NM_WIFI_FREQ_MAX _NM_WIFI_FREQ_MAX_6GHZ
/* Max Wi-Fi channel for each band */
#define _NM_WIFI_CHANNEL_MAX_2GHZ 14
#define _NM_WIFI_CHANNEL_MAX_5GHZ 177
#define _NM_WIFI_CHANNEL_MAX_6GHZ 233
#define _NM_WIFI_CHANNEL_MAX _NM_WIFI_CHANNEL_MAX_6GHZ
#endif /* __NM_LIBNM_SHARED_UTILS_H__ */

View file

@ -1086,7 +1086,7 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
NM_SETTING_WIRELESS_MODE_AP,
NM_SETTING_WIRELESS_MODE_MESH,
NULL};
const char *valid_bands[] = {"a", "bg", NULL};
const char *valid_bands[] = {"a", "bg", "6GHz", NULL};
guint i;
gsize length;
GError *local = NULL;
@ -1363,11 +1363,11 @@ verify(NMSetting *setting, NMConnection *connection, GError **error)
}
if (priv->channel_width == NM_SETTING_WIRELESS_CHANNEL_WIDTH_80MHZ
&& !nm_streq0(priv->band, "a")) {
&& !NM_IN_STRSET(priv->band, "a", "6GHz")) {
g_set_error_literal(error,
NM_CONNECTION_ERROR,
NM_CONNECTION_ERROR_INVALID_PROPERTY,
_("80MHz channels are only supported in the 5GHz band"));
_("80MHz channels are only supported in the 'a' and '6GHz' bands"));
g_prefix_error(error,
"%s.%s: ",
NM_SETTING_WIRELESS_SETTING_NAME,
@ -1636,17 +1636,18 @@ nm_setting_wireless_class_init(NMSettingWirelessClass *klass)
/**
* NMSettingWireless:band:
*
* 802.11 frequency band of the network. One of "a" for 5GHz 802.11a or
* "bg" for 2.4GHz 802.11. This will lock associations to the Wi-Fi network
* to the specific band, i.e. if "a" is specified, the device will not
* associate with the same network in the 2.4GHz band even if the network's
* settings are compatible. This setting depends on specific driver
* capability and may not work with all drivers.
* 802.11 frequency band of the network. One of "a" for 5GHz,
* "bg" for 2.4GHz or "6GHz". This will lock associations to the
* Wi-Fi network to the specific band, i.e. if "a" is specified,
* the device will not associate with the same network in the
* 2.4GHz (bg) or 6GHz bands even if the network's settings are
* compatible. This setting depends on specific driver capability
* and may not work with all drivers.
**/
/* ---ifcfg-rh---
* property: band
* variable: BAND(+)
* values: a, bg
* values: a, bg, 6GHz
* description: BAND alone is honored, but CHANNEL overrides BAND since it
* implies a band.
* example: BAND=bg
@ -1673,8 +1674,6 @@ nm_setting_wireless_class_init(NMSettingWirelessClass *klass)
* property: channel
* variable: CHANNEL
* description: Channel used for the Wi-Fi communication.
* Channels greater than 14 mean "a" band, otherwise the
* band is "bg".
* example: CHANNEL=6
* ---end---
*/

View file

@ -25,6 +25,7 @@
#include "libnm-glib-aux/nm-time-utils.h"
#include "libnm-glib-aux/nm-secret-utils.h"
#include "libnm-core-aux-intern/nm-common-macros.h"
#include "libnm-core-aux-intern/nm-libnm-core-utils.h"
#include "nm-utils-private.h"
#include "nm-setting-private.h"
#include "nm-setting-bond.h"
@ -3697,25 +3698,8 @@ struct cf_pair {
guint32 freq;
};
static const struct cf_pair a_table[] = {
/* A band */
{7, 5035}, {8, 5040}, {9, 5045}, {11, 5055}, {12, 5060}, {16, 5080}, {34, 5170},
{36, 5180}, {38, 5190}, {40, 5200}, {42, 5210}, {44, 5220}, {46, 5230}, {48, 5240},
{50, 5250}, {52, 5260}, {56, 5280}, {58, 5290}, {60, 5300}, {64, 5320}, {100, 5500},
{104, 5520}, {108, 5540}, {112, 5560}, {116, 5580}, {120, 5600}, {124, 5620}, {128, 5640},
{132, 5660}, {136, 5680}, {140, 5700}, {149, 5745}, {152, 5760}, {153, 5765}, {157, 5785},
{160, 5800}, {161, 5805}, {165, 5825}, {183, 4915}, {184, 4920}, {185, 4925}, {187, 4935},
{188, 4945}, {192, 4960}, {196, 4980}, {0, 0}};
static const guint a_table_freqs[G_N_ELEMENTS(a_table)] = {
/* A band */
5035, 5040, 5045, 5055, 5060, 5080, 5170, 5180, 5190, 5200, 5210, 5220, 5230, 5240, 5250, 5260,
5280, 5290, 5300, 5320, 5500, 5520, 5540, 5560, 5580, 5600, 5620, 5640, 5660, 5680, 5700, 5745,
5760, 5765, 5785, 5800, 5805, 5825, 4915, 4920, 4925, 4935, 4945, 4960, 4980, 0,
};
static const struct cf_pair bg_table[] = {
/* B/G band */
static const struct cf_pair table_2ghz[] = {
/* 2.4GHz band */
{1, 2412},
{2, 2417},
{3, 2422},
@ -3732,8 +3716,8 @@ static const struct cf_pair bg_table[] = {
{14, 2484},
{0, 0}};
static const guint bg_table_freqs[G_N_ELEMENTS(bg_table)] = {
/* B/G band */
static const guint table_2ghz_freqs[G_N_ELEMENTS(table_2ghz)] = {
/* 2.4GHz band */
2412,
2417,
2422,
@ -3751,6 +3735,44 @@ static const guint bg_table_freqs[G_N_ELEMENTS(bg_table)] = {
0,
};
static const struct cf_pair table_5ghz[] = {
/* 5GHz band */
/* NOTE: 5030-5090 MHz have been reallocated and can no longer be used */
{34, 5170}, {36, 5180}, {38, 5190}, {40, 5200}, {42, 5210}, {44, 5220}, {46, 5230},
{48, 5240}, {50, 5250}, {52, 5260}, {56, 5280}, {58, 5290}, {60, 5300}, {64, 5320},
{100, 5500}, {104, 5520}, {108, 5540}, {112, 5560}, {116, 5580}, {120, 5600}, {124, 5620},
{128, 5640}, {132, 5660}, {136, 5680}, {140, 5700}, {149, 5745}, {152, 5760}, {153, 5765},
{157, 5785}, {160, 5800}, {161, 5805}, {165, 5825}, {169, 5845}, {173, 5865}, {177, 5885},
{183, 4915}, {184, 4920}, {185, 4925}, {187, 4935}, {188, 4940}, {189, 4945}, {192, 4960},
{196, 4980}, {0, 0}};
static const guint table_5ghz_freqs[G_N_ELEMENTS(table_5ghz)] = {
/* 5GHz band */
5170, 5180, 5190, 5200, 5210, 5220, 5230, 5240, 5250, 5260, 5280, 5290, 5300, 5320, 5500,
5520, 5540, 5560, 5580, 5600, 5620, 5640, 5660, 5680, 5700, 5745, 5760, 5765, 5785, 5800,
5805, 5825, 5845, 5865, 5885, 4915, 4920, 4925, 4935, 4940, 4945, 4960, 4980, 0,
};
static const struct cf_pair table_6ghz[] = {
/* 6GHz band */
{1, 5955}, {5, 5975}, {9, 5995}, {13, 6015}, {17, 6035}, {21, 6055}, {25, 6075},
{29, 6095}, {33, 6115}, {37, 6135}, {41, 6155}, {45, 6175}, {49, 6195}, {53, 6215},
{57, 6235}, {61, 6255}, {65, 6275}, {69, 6295}, {73, 6315}, {77, 6335}, {81, 6355},
{85, 6375}, {89, 6395}, {93, 6415}, {97, 6435}, {101, 6455}, {105, 6475}, {109, 6495},
{113, 6515}, {117, 6535}, {121, 6555}, {125, 6575}, {129, 6595}, {133, 6615}, {137, 6635},
{141, 6655}, {145, 6675}, {149, 6695}, {153, 6715}, {157, 6735}, {161, 6755}, {169, 6775},
{173, 6815}, {177, 6835}, {181, 6855}, {185, 6875}, {189, 6895}, {193, 6915}, {197, 6935},
{201, 6955}, {205, 6975}, {209, 6995}, {213, 7015}, {217, 7035}, {221, 7055}, {225, 7075},
{229, 7095}, {233, 7115}, {0, 0}};
static const guint table_6ghz_freqs[G_N_ELEMENTS(table_6ghz)] = {
/* 6GHz band */
5955, 5975, 5995, 6015, 6035, 6055, 6075, 6095, 6115, 6135, 6155, 6175, 6195, 6215, 6235,
6255, 6275, 6295, 6315, 6335, 6355, 6375, 6395, 6415, 6435, 6455, 6475, 6495, 6515, 6535,
6555, 6575, 6595, 6615, 6635, 6655, 6675, 6695, 6715, 6735, 6755, 6775, 6815, 6835, 6855,
6875, 6895, 6915, 6935, 6955, 6975, 6995, 7015, 7035, 7055, 7075, 7095, 7115, 0,
};
/**
* nm_utils_wifi_freq_to_channel:
* @freq: frequency
@ -3764,40 +3786,51 @@ nm_utils_wifi_freq_to_channel(guint32 freq)
{
int i = 0;
if (freq > 4900) {
while (a_table[i].freq && (a_table[i].freq != freq))
if (freq >= _NM_WIFI_FREQ_MIN_6GHZ) {
while (table_6ghz[i].freq && (table_6ghz[i].freq != freq))
i++;
return a_table[i].chan;
return table_6ghz[i].chan;
}
while (bg_table[i].freq && (bg_table[i].freq != freq))
if (freq >= _NM_WIFI_FREQ_MIN_5GHZ) {
while (table_5ghz[i].freq && (table_5ghz[i].freq != freq))
i++;
return table_5ghz[i].chan;
}
while (table_2ghz[i].freq && (table_2ghz[i].freq != freq))
i++;
return bg_table[i].chan;
return table_2ghz[i].chan;
}
/**
* nm_utils_wifi_freq_to_band:
* @freq: frequency
*
* Utility function to translate a Wi-Fi frequency to its corresponding band.
* Translates a Wi-Fi frequency to its corresponding band.
*
* Returns: the band containing the frequency or NULL if freq is invalid
* Returns: the band containing the frequency or %NM_WIFI_BAND_UNKNOWN if
* the frequency does not belong to a known band.
*
* Since: 1.58
**/
const char *
NMWifiBand
nm_utils_wifi_freq_to_band(guint32 freq)
{
if (freq >= 4915 && freq <= 5825)
return "a";
else if (freq >= 2412 && freq <= 2484)
return "bg";
if (freq >= _NM_WIFI_FREQ_MIN_2GHZ && freq <= _NM_WIFI_FREQ_MAX_2GHZ)
return NM_WIFI_BAND_2_4_GHZ;
else if (freq >= _NM_WIFI_FREQ_MIN_5GHZ && freq <= _NM_WIFI_FREQ_MAX_5GHZ)
return NM_WIFI_BAND_5_GHZ;
else if (freq >= _NM_WIFI_FREQ_MIN_6GHZ && freq <= _NM_WIFI_FREQ_MAX_6GHZ)
return NM_WIFI_BAND_6_GHZ;
return NULL;
return NM_WIFI_BAND_UNKNOWN;
}
/**
* nm_utils_wifi_channel_to_freq:
* @channel: channel
* @band: frequency band for wireless ("a" or "bg")
* @band: frequency band for wireless ("a", "bg", "6GHz")
*
* Utility function to translate a Wi-Fi channel to its corresponding frequency.
*
@ -3812,18 +3845,26 @@ nm_utils_wifi_channel_to_freq(guint32 channel, const char *band)
g_return_val_if_fail(band, 0);
if (nm_streq(band, "a")) {
for (i = 0; a_table[i].chan; i++) {
if (a_table[i].chan == channel)
return a_table[i].freq;
if (nm_streq0(band, "a")) {
for (i = 0; table_5ghz[i].chan; i++) {
if (table_5ghz[i].chan == channel)
return table_5ghz[i].freq;
}
return ((guint32) -1);
}
if (nm_streq(band, "bg")) {
for (i = 0; bg_table[i].chan; i++) {
if (bg_table[i].chan == channel)
return bg_table[i].freq;
if (nm_streq0(band, "bg")) {
for (i = 0; table_2ghz[i].chan; i++) {
if (table_2ghz[i].chan == channel)
return table_2ghz[i].freq;
}
return ((guint32) -1);
}
if (nm_streq0(band, "6GHz")) {
for (i = 0; table_6ghz[i].chan; i++) {
if (table_6ghz[i].chan == channel)
return table_6ghz[i].freq;
}
return ((guint32) -1);
}
@ -3835,7 +3876,7 @@ nm_utils_wifi_channel_to_freq(guint32 channel, const char *band)
* nm_utils_wifi_find_next_channel:
* @channel: current channel
* @direction: whether going downward (0 or less) or upward (1 or more)
* @band: frequency band for wireless ("a" or "bg")
* @band: frequency band for wireless ("a", "bg", "6GHz")
*
* Utility function to find out next/previous Wi-Fi channel for a channel.
*
@ -3844,22 +3885,29 @@ nm_utils_wifi_channel_to_freq(guint32 channel, const char *band)
guint32
nm_utils_wifi_find_next_channel(guint32 channel, int direction, char *band)
{
size_t a_size = G_N_ELEMENTS(a_table);
size_t bg_size = G_N_ELEMENTS(bg_table);
size_t size_2ghz = G_N_ELEMENTS(table_2ghz);
size_t size_5ghz = G_N_ELEMENTS(table_5ghz);
size_t size_6ghz = G_N_ELEMENTS(table_6ghz);
const struct cf_pair *pair;
if (nm_streq(band, "a")) {
if (channel < a_table[0].chan)
return a_table[0].chan;
if (channel > a_table[a_size - 2].chan)
return a_table[a_size - 2].chan;
pair = &a_table[0];
} else if (nm_streq(band, "bg")) {
if (channel < bg_table[0].chan)
return bg_table[0].chan;
if (channel > bg_table[bg_size - 2].chan)
return bg_table[bg_size - 2].chan;
pair = &bg_table[0];
if (nm_streq0(band, "a")) {
if (channel < table_5ghz[0].chan)
return table_5ghz[0].chan;
if (channel > table_5ghz[size_5ghz - 2].chan)
return table_5ghz[size_5ghz - 2].chan;
pair = &table_5ghz[0];
} else if (nm_streq0(band, "bg")) {
if (channel < table_2ghz[0].chan)
return table_2ghz[0].chan;
if (channel > table_2ghz[size_2ghz - 2].chan)
return table_2ghz[size_2ghz - 2].chan;
pair = &table_2ghz[0];
} else if (nm_streq0(band, "6GHz")) {
if (channel < table_6ghz[0].chan)
return table_6ghz[0].chan;
if (channel > table_6ghz[size_6ghz - 2].chan)
return table_6ghz[size_6ghz - 2].chan;
pair = &table_6ghz[0];
} else
g_return_val_if_reached(0);
@ -3880,7 +3928,7 @@ nm_utils_wifi_find_next_channel(guint32 channel, int direction, char *band)
/**
* nm_utils_wifi_is_channel_valid:
* @channel: channel
* @band: frequency band for wireless ("a" or "bg")
* @band: frequency band for wireless ("a", "bg", "6GHz")
*
* Utility function to verify Wi-Fi channel validity.
*
@ -3930,8 +3978,8 @@ nm_utils_wifi_is_channel_valid(guint32 channel, const char *band)
const guint *
nm_utils_wifi_2ghz_freqs(void)
{
_nm_assert_wifi_freqs(bg_table, bg_table_freqs);
return bg_table_freqs;
_nm_assert_wifi_freqs(table_2ghz, table_2ghz_freqs);
return table_2ghz_freqs;
}
/**
@ -3946,8 +3994,24 @@ nm_utils_wifi_2ghz_freqs(void)
const guint *
nm_utils_wifi_5ghz_freqs(void)
{
_nm_assert_wifi_freqs(a_table, a_table_freqs);
return a_table_freqs;
_nm_assert_wifi_freqs(table_5ghz, table_5ghz_freqs);
return table_5ghz_freqs;
}
/**
* nm_utils_wifi_6ghz_freqs:
*
* Utility function to return 6 GHz Wi-Fi frequencies (802.11ax/be, Wi-Fi 6E).
*
* Returns: zero-terminated array of frequencies numbers (in MHz)
*
* Since: 1.58
**/
const guint *
nm_utils_wifi_6ghz_freqs(void)
{
_nm_assert_wifi_freqs(table_6ghz, table_6ghz_freqs);
return table_6ghz_freqs;
}
/**

View file

@ -11140,7 +11140,7 @@ _do_wifi_ghz_freqs(const guint *freqs, const char *band)
int j;
int i;
g_assert(NM_IN_STRSET(band, "a", "bg"));
g_assert(NM_IN_STRSET(band, "a", "bg", "6GHz"));
g_assert(freqs);
g_assert(freqs[0] != 0);
@ -11178,6 +11178,7 @@ test_nm_utils_wifi_ghz_freqs(void)
{
_do_wifi_ghz_freqs(nm_utils_wifi_2ghz_freqs(), "bg");
_do_wifi_ghz_freqs(nm_utils_wifi_5ghz_freqs(), "a");
_do_wifi_ghz_freqs(nm_utils_wifi_6ghz_freqs(), "6GHz");
}
/*****************************************************************************/

View file

@ -1135,8 +1135,6 @@ gboolean nm_utils_base64secret_normalize(const char *base64_key,
gboolean nm_utils_connection_is_adhoc_wpa(NMConnection *connection);
const char *nm_utils_wifi_freq_to_band(guint32 freq);
gboolean _nm_utils_iaid_verify(const char *str, gint64 *out_value);
gboolean

View file

@ -135,14 +135,36 @@ const char *nm_utils_file_search_in_paths(const char *prog
gpointer user_data,
GError **error);
guint32 nm_utils_wifi_freq_to_channel(guint32 freq);
guint32 nm_utils_wifi_channel_to_freq(guint32 channel, const char *band);
guint32 nm_utils_wifi_find_next_channel(guint32 channel, int direction, char *band);
gboolean nm_utils_wifi_is_channel_valid(guint32 channel, const char *band);
/**
* NMWifiBand:
* @NM_WIFI_BAND_UNKNOWN: the band is unknown
* @NM_WIFI_BAND_2_4_GHZ: the 2.4 GHz band
* @NM_WIFI_BAND_5_GHZ: the 5 GHz band
* @NM_WIFI_BAND_6_GHZ: the 6 GHz band
*
* Describes a Wi-Fi radio frequency band.
*
* Since: 1.58
*/
typedef enum {
NM_WIFI_BAND_UNKNOWN,
NM_WIFI_BAND_2_4_GHZ,
NM_WIFI_BAND_5_GHZ,
NM_WIFI_BAND_6_GHZ,
} NMWifiBand;
guint32 nm_utils_wifi_freq_to_channel(guint32 freq);
NM_AVAILABLE_IN_1_58
NMWifiBand nm_utils_wifi_freq_to_band(guint32 freq);
guint32 nm_utils_wifi_channel_to_freq(guint32 channel, const char *band);
guint32 nm_utils_wifi_find_next_channel(guint32 channel, int direction, char *band);
gboolean nm_utils_wifi_is_channel_valid(guint32 channel, const char *band);
NM_AVAILABLE_IN_1_2
const guint *nm_utils_wifi_2ghz_freqs(void);
NM_AVAILABLE_IN_1_2
const guint *nm_utils_wifi_5ghz_freqs(void);
NM_AVAILABLE_IN_1_58
const guint *nm_utils_wifi_6ghz_freqs(void);
const char *nm_utils_wifi_strength_bars(guint8 strength);

View file

@ -4292,7 +4292,8 @@ _set_fcn_wireless_channel(ARGS_SET_FCN)
}
if (!nm_utils_wifi_is_channel_valid(chan_int, "a")
&& !nm_utils_wifi_is_channel_valid(chan_int, "bg")) {
&& !nm_utils_wifi_is_channel_valid(chan_int, "bg")
&& !nm_utils_wifi_is_channel_valid(chan_int, "6GHz")) {
nm_utils_error_set(error,
NM_UTILS_ERROR_UNKNOWN,
_("'%ld' is not a valid channel"),
@ -8530,7 +8531,7 @@ static const NMMetaPropertyInfo *const property_infos_WIRELESS[] = {
PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_BAND,
.property_type = &_pt_gobject_string,
.property_typ_data = DEFINE_PROPERTY_TYP_DATA (
.values_static = NM_MAKE_STRV ("a", "bg"),
.values_static = NM_MAKE_STRV ("a", "bg", "6GHz"),
),
),
PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRELESS_CHANNEL,

View file

@ -452,7 +452,7 @@
#define DESCRIBE_DOC_NM_SETTING_WIREGUARD_PRIVATE_KEY N_("The 256 bit private-key in base64 encoding.")
#define DESCRIBE_DOC_NM_SETTING_WIREGUARD_PRIVATE_KEY_FLAGS N_("Flags indicating how to handle the \"private-key\" property.")
#define DESCRIBE_DOC_NM_SETTING_WIRELESS_AP_ISOLATION N_("Configures AP isolation, which prevents communication between wireless devices connected to this AP. This property can be set to a value different from \"default\" (-1) only when the interface is configured in AP mode. If set to \"true\" (1), devices are not able to communicate with each other. This increases security because it protects devices against attacks from other clients in the network. At the same time, it prevents devices to access resources on the same wireless networks as file shares, printers, etc. If set to \"false\" (0), devices can talk to each other. When set to \"default\" (-1), the global default is used; in case the global default is unspecified it is assumed to be \"false\" (0).")
#define DESCRIBE_DOC_NM_SETTING_WIRELESS_BAND N_("802.11 frequency band of the network. One of \"a\" for 5GHz 802.11a or \"bg\" for 2.4GHz 802.11. This will lock associations to the Wi-Fi network to the specific band, i.e. if \"a\" is specified, the device will not associate with the same network in the 2.4GHz band even if the network's settings are compatible. This setting depends on specific driver capability and may not work with all drivers.")
#define DESCRIBE_DOC_NM_SETTING_WIRELESS_BAND N_("802.11 frequency band of the network. One of \"a\" for 5GHz, \"bg\" for 2.4GHz or \"6GHz\". This will lock associations to the Wi-Fi network to the specific band, i.e. if \"a\" is specified, the device will not associate with the same network in the 2.4GHz (bg) or 6GHz bands even if the network's settings are compatible. This setting depends on specific driver capability and may not work with all drivers.")
#define DESCRIBE_DOC_NM_SETTING_WIRELESS_BSSID N_("If specified, directs the device to only associate with the given access point. This capability is highly driver dependent and not supported by all devices. Note: this property does not control the BSSID used when creating an Ad-Hoc network and is unlikely to in the future. Locking a client profile to a certain BSSID will prevent roaming and also disable background scanning. That can be useful, if there is only one access point for the SSID.")
#define DESCRIBE_DOC_NM_SETTING_WIRELESS_CHANNEL N_("Wireless channel to use for the Wi-Fi connection. The device will only join (or create for Ad-Hoc networks) a Wi-Fi network on the specified channel. Because channel numbers overlap between bands, this property also requires the \"band\" property to be set.")
#define DESCRIBE_DOC_NM_SETTING_WIRELESS_CHANNEL_WIDTH N_("Specifies width of the wireless channel in Access Point (AP) mode. When set to \"auto\" (0) (the default), the channel width is automatically determined. At the moment, this means that the safest (smallest) width is chosen. If the value is not \"auto\" (0), then the 'channel' property must also be set. When using the 2.4GHz band, the width can be at most 40MHz. This property can be set to a value different from \"auto\" (0) only when the interface is configured in AP mode.")

View file

@ -732,21 +732,22 @@ const NmcMetaGenericInfo *const nmc_fields_dev_wifi_list[] = {
NMC_META_GENERIC("BSSID"), /* 3 */
NMC_META_GENERIC("MODE"), /* 4 */
NMC_META_GENERIC("CHAN"), /* 5 */
NMC_META_GENERIC("FREQ"), /* 6 */
NMC_META_GENERIC("RATE"), /* 7 */
NMC_META_GENERIC("BANDWIDTH"), /* 8 */
NMC_META_GENERIC("SIGNAL"), /* 9 */
NMC_META_GENERIC("BARS"), /* 10 */
NMC_META_GENERIC("SECURITY"), /* 11 */
NMC_META_GENERIC("WPA-FLAGS"), /* 12 */
NMC_META_GENERIC("RSN-FLAGS"), /* 13 */
NMC_META_GENERIC("DEVICE"), /* 14 */
NMC_META_GENERIC("ACTIVE"), /* 15 */
NMC_META_GENERIC("IN-USE"), /* 16 */
NMC_META_GENERIC("DBUS-PATH"), /* 17 */
NMC_META_GENERIC("BAND"), /* 6 */
NMC_META_GENERIC("FREQ"), /* 7 */
NMC_META_GENERIC("RATE"), /* 8 */
NMC_META_GENERIC("BANDWIDTH"), /* 9 */
NMC_META_GENERIC("SIGNAL"), /* 10 */
NMC_META_GENERIC("BARS"), /* 11 */
NMC_META_GENERIC("SECURITY"), /* 12 */
NMC_META_GENERIC("WPA-FLAGS"), /* 13 */
NMC_META_GENERIC("RSN-FLAGS"), /* 14 */
NMC_META_GENERIC("DEVICE"), /* 15 */
NMC_META_GENERIC("ACTIVE"), /* 16 */
NMC_META_GENERIC("IN-USE"), /* 17 */
NMC_META_GENERIC("DBUS-PATH"), /* 18 */
NULL,
};
#define NMC_FIELDS_DEV_WIFI_LIST_COMMON "IN-USE,BSSID,SSID,MODE,CHAN,RATE,SIGNAL,BARS,SECURITY"
#define NMC_FIELDS_DEV_WIFI_LIST_COMMON "IN-USE,BSSID,SSID,MODE,BAND,CHAN,RATE,SIGNAL,BARS,SECURITY"
#define NMC_FIELDS_DEV_WIFI_LIST_FOR_DEV_LIST "NAME," NMC_FIELDS_DEV_WIFI_LIST_COMMON
const NmcMetaGenericInfo *const nmc_fields_dev_wimax_list[] = {
@ -866,7 +867,7 @@ usage(void)
"<ifname>]\n"
" [bssid <BSSID>] [name <name>] [private yes|no] [hidden "
"yes|no]\n\n"
" wifi hotspot [ifname <ifname>] [con-name <name>] [ssid <SSID>] [band a|bg] "
" wifi hotspot [ifname <ifname>] [con-name <name>] [ssid <SSID>] [band a|bg|6GHz] "
"[channel <channel>] [password <password>]\n\n"
" wifi rescan [ifname <ifname>] [[ssid <SSID to scan>] ...]\n\n"
" wifi show-password [ifname <ifname>]\n\n"
@ -1021,7 +1022,7 @@ usage_device_wifi(void)
"It is also assumed that IP configuration is obtained via DHCP.\n"
"\n"
"ARGUMENTS := hotspot [ifname <ifname>] [con-name <name>] [ssid <SSID>]\n"
" [band a|bg] [channel <channel>] [password <password>]\n"
" [band a|bg|6GHz] [channel <channel>] [password <password>]\n"
"\n"
"Create a Wi-Fi hotspot. Use 'connection down' or 'device disconnect'\n"
"to stop the hotspot.\n"
@ -1323,6 +1324,7 @@ fill_output_access_point(NMAccessPoint *ap, const APInfo *info)
const char *bssid;
NM80211Mode mode;
char *channel_str;
const char *band_str;
char *freq_str;
char *ssid_str = NULL;
char *ssid_hex_str = NULL;
@ -1367,6 +1369,22 @@ fill_output_access_point(NMAccessPoint *ap, const APInfo *info)
rsn_flags_str = ap_wpa_rsn_flags_to_string(rsn_flags, NM_META_ACCESSOR_GET_TYPE_PRETTY);
sig_bars = nmc_wifi_strength_bars(strength);
switch (nm_utils_wifi_freq_to_band(freq)) {
case NM_WIFI_BAND_2_4_GHZ:
band_str = _("2.4 GHz");
break;
case NM_WIFI_BAND_5_GHZ:
band_str = _("5 GHz");
break;
case NM_WIFI_BAND_6_GHZ:
band_str = _("6 GHz");
break;
default:
case NM_WIFI_BAND_UNKNOWN:
band_str = "";
break;
}
security_str = g_string_new(NULL);
if (_ap_is_wep(ap)) {
@ -1415,18 +1433,19 @@ fill_output_access_point(NMAccessPoint *ap, const APInfo *info)
: mode == NM_802_11_MODE_MESH ? _("Mesh")
: _("N/A"));
set_val_str(arr, 5, channel_str);
set_val_str(arr, 6, freq_str);
set_val_str(arr, 7, bitrate_str);
set_val_str(arr, 8, bandwidth_str);
set_val_str(arr, 9, strength_str);
set_val_strc(arr, 10, sig_bars);
set_val_str(arr, 11, g_string_free(security_str, FALSE));
set_val_str(arr, 12, wpa_flags_str);
set_val_str(arr, 13, rsn_flags_str);
set_val_strc(arr, 14, info->device);
set_val_strc(arr, 15, active ? _("yes") : _("no"));
set_val_strc(arr, 16, active ? "*" : " ");
set_val_strc(arr, 17, nm_object_get_path(NM_OBJECT(ap)));
set_val_strc(arr, 6, band_str);
set_val_str(arr, 7, freq_str);
set_val_str(arr, 8, bitrate_str);
set_val_str(arr, 9, bandwidth_str);
set_val_str(arr, 10, strength_str);
set_val_strc(arr, 11, sig_bars);
set_val_str(arr, 12, g_string_free(security_str, FALSE));
set_val_str(arr, 13, wpa_flags_str);
set_val_str(arr, 14, rsn_flags_str);
set_val_strc(arr, 15, info->device);
set_val_strc(arr, 16, active ? _("yes") : _("no"));
set_val_strc(arr, 17, active ? "*" : " ");
set_val_strc(arr, 18, nm_object_get_path(NM_OBJECT(ap)));
/* Set colors */
color = wifi_signal_to_color(strength);
@ -4443,10 +4462,11 @@ do_device_wifi_hotspot(const NMCCommand *cmd, NmCli *nmc, int argc, const char *
}
band = *argv;
if (argc == 1 && nmc->complete)
nmc_complete_strings(band, "a", "bg");
if (strcmp(band, "a") && strcmp(band, "bg")) {
nmc_complete_strings(band, "a", "bg", "6GHz");
if (!NM_IN_STRSET(band, "a", "bg", "6GHz")) {
g_string_printf(nmc->return_text,
_("Error: band argument value '%s' is invalid; use 'a' or 'bg'."),
_("Error: band argument value '%s' is invalid; use 'a', 'bg' "
"or '6GHz'."),
band);
nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
return;
@ -4494,7 +4514,7 @@ do_device_wifi_hotspot(const NMCCommand *cmd, NmCli *nmc, int argc, const char *
nmc->return_value = NMC_RESULT_ERROR_USER_INPUT;
return;
}
if (!nmc_string_to_uint(channel, TRUE, 1, 5825, &value)
if (!nmc_string_to_uint(channel, TRUE, 1, G_MAXUINT32, &value)
|| !nm_utils_wifi_is_channel_valid(value, band)) {
g_string_printf(nmc->return_text,
_("Error: channel '%s' not valid for band '%s'."),

View file

@ -33,9 +33,9 @@
format="string"
values="infrastructure, adhoc, ap, mesh" />
<property name="band"
nmcli-description="802.11 frequency band of the network. One of &quot;a&quot; for 5GHz 802.11a or &quot;bg&quot; for 2.4GHz 802.11. This will lock associations to the Wi-Fi network to the specific band, i.e. if &quot;a&quot; is specified, the device will not associate with the same network in the 2.4GHz band even if the network&apos;s settings are compatible. This setting depends on specific driver capability and may not work with all drivers."
nmcli-description="802.11 frequency band of the network. One of &quot;a&quot; for 5GHz, &quot;bg&quot; for 2.4GHz or &quot;6GHz&quot;. This will lock associations to the Wi-Fi network to the specific band, i.e. if &quot;a&quot; is specified, the device will not associate with the same network in the 2.4GHz (bg) or 6GHz bands even if the network&apos;s settings are compatible. This setting depends on specific driver capability and may not work with all drivers."
format="string"
values="a, bg" />
values="a, bg, 6GHz" />
<property name="channel"
nmcli-description="Wireless channel to use for the Wi-Fi connection. The device will only join (or create for Ad-Hoc networks) a Wi-Fi network on the specified channel. Because channel numbers overlap between bands, this property also requires the &quot;band&quot; property to be set."
format="integer"

View file

@ -54,10 +54,9 @@ static NmtNewtPopupEntry wifi_mode[] = {{NC_("Wi-Fi", "Client"), NM_SETTING_WIRE
{NULL, NULL}};
static NmtNewtPopupEntry wifi_band[] = {{NC_("Wi-Fi", "Automatic"), NULL},
/* 802.11a Wi-Fi network */
{N_("A (5 GHz)"), "a"},
/* 802.11b / 802.11g Wi-Fi network */
{N_("B/G (2.4 GHz)"), "bg"},
{N_("5 GHz"), "a"},
{N_("2.4 GHz"), "bg"},
{N_("6 GHz"), "6GHz"},
{NULL, NULL}};
static struct {

View file

@ -136,18 +136,19 @@ Strony podręcznika nmcli(1) i nmcli-examples(7) zawierają pełne informacje
o użyciu.
<<<
size: 1423
size: 1566
location: src/tests/client/test-client.py:test_002()/7
cmd: $NMCLI -f AP -mode multiline d show wlan0
lang: C
returncode: 0
stdout: 1271 bytes
stdout: 1414 bytes
>>>
AP[1].IN-USE:
AP[1].BSSID: 60:B3:25:25:E2:C8
AP[1].SSID: wlan0-ap-3
AP[1].MODE: Infra
AP[1].CHAN: 1
AP[1].BAND: 6 GHz
AP[1].CHAN: 129
AP[1].RATE: 54 Mbit/s
AP[1].SIGNAL: 55
AP[1].BARS: **
@ -156,7 +157,8 @@ AP[2].IN-USE:
AP[2].BSSID: 90:B1:5F:9E:E0:E3
AP[2].SSID: wlan0-ap-1
AP[2].MODE: Infra
AP[2].CHAN: 1
AP[2].BAND: 2.4 GHz
AP[2].CHAN: 6
AP[2].RATE: 54 Mbit/s
AP[2].SIGNAL: 44
AP[2].BARS: **
@ -165,25 +167,27 @@ AP[3].IN-USE:
AP[3].BSSID: 61:66:D2:E7:44:A2
AP[3].SSID: wlan0-ap-2
AP[3].MODE: Infra
AP[3].CHAN: 1
AP[3].BAND: 5 GHz
AP[3].CHAN: 44
AP[3].RATE: 54 Mbit/s
AP[3].SIGNAL: 34
AP[3].BARS: **
AP[3].SECURITY: WPA1 WPA2
<<<
size: 1460
size: 1603
location: src/tests/client/test-client.py:test_002()/8
cmd: $NMCLI -f AP -mode multiline d show wlan0
lang: pl_PL.UTF-8
returncode: 0
stdout: 1298 bytes
stdout: 1441 bytes
>>>
AP[1].IN-USE:
AP[1].BSSID: 60:B3:25:25:E2:C8
AP[1].SSID: wlan0-ap-3
AP[1].MODE: Infrastruktura
AP[1].CHAN: 1
AP[1].BAND: 6 GHz
AP[1].CHAN: 129
AP[1].RATE: 54Mb/s
AP[1].SIGNAL: 55
AP[1].BARS: **
@ -192,7 +196,8 @@ AP[2].IN-USE:
AP[2].BSSID: 90:B1:5F:9E:E0:E3
AP[2].SSID: wlan0-ap-1
AP[2].MODE: Infrastruktura
AP[2].CHAN: 1
AP[2].BAND: 2.4 GHz
AP[2].CHAN: 6
AP[2].RATE: 54Mb/s
AP[2].SIGNAL: 44
AP[2].BARS: **
@ -201,19 +206,20 @@ AP[3].IN-USE:
AP[3].BSSID: 61:66:D2:E7:44:A2
AP[3].SSID: wlan0-ap-2
AP[3].MODE: Infrastruktura
AP[3].CHAN: 1
AP[3].BAND: 5 GHz
AP[3].CHAN: 44
AP[3].RATE: 54Mb/s
AP[3].SIGNAL: 34
AP[3].BARS: **
AP[3].SECURITY: WPA1 WPA2
<<<
size: 1877
size: 2020
location: src/tests/client/test-client.py:test_002()/9
cmd: $NMCLI -f AP -mode multiline -p d show wlan0
lang: C
returncode: 0
stdout: 1722 bytes
stdout: 1865 bytes
>>>
===============================================================================
Device details (wlan0)
@ -222,7 +228,8 @@ AP[1].IN-USE:
AP[1].BSSID: 60:B3:25:25:E2:C8
AP[1].SSID: wlan0-ap-3
AP[1].MODE: Infra
AP[1].CHAN: 1
AP[1].BAND: 6 GHz
AP[1].CHAN: 129
AP[1].RATE: 54 Mbit/s
AP[1].SIGNAL: 55
AP[1].BARS: **
@ -232,7 +239,8 @@ AP[2].IN-USE:
AP[2].BSSID: 90:B1:5F:9E:E0:E3
AP[2].SSID: wlan0-ap-1
AP[2].MODE: Infra
AP[2].CHAN: 1
AP[2].BAND: 2.4 GHz
AP[2].CHAN: 6
AP[2].RATE: 54 Mbit/s
AP[2].SIGNAL: 44
AP[2].BARS: **
@ -242,7 +250,8 @@ AP[3].IN-USE:
AP[3].BSSID: 61:66:D2:E7:44:A2
AP[3].SSID: wlan0-ap-2
AP[3].MODE: Infra
AP[3].CHAN: 1
AP[3].BAND: 5 GHz
AP[3].CHAN: 44
AP[3].RATE: 54 Mbit/s
AP[3].SIGNAL: 34
AP[3].BARS: **
@ -250,12 +259,12 @@ AP[3].SECURITY: WPA1 WPA2
-------------------------------------------------------------------------------
<<<
size: 1922
size: 2065
location: src/tests/client/test-client.py:test_002()/10
cmd: $NMCLI -f AP -mode multiline -p d show wlan0
lang: pl_PL.UTF-8
returncode: 0
stdout: 1756 bytes
stdout: 1899 bytes
>>>
===============================================================================
Informacje o urządzeniu (wlan0)
@ -264,7 +273,8 @@ AP[1].IN-USE:
AP[1].BSSID: 60:B3:25:25:E2:C8
AP[1].SSID: wlan0-ap-3
AP[1].MODE: Infrastruktura
AP[1].CHAN: 1
AP[1].BAND: 6 GHz
AP[1].CHAN: 129
AP[1].RATE: 54Mb/s
AP[1].SIGNAL: 55
AP[1].BARS: **
@ -274,7 +284,8 @@ AP[2].IN-USE:
AP[2].BSSID: 90:B1:5F:9E:E0:E3
AP[2].SSID: wlan0-ap-1
AP[2].MODE: Infrastruktura
AP[2].CHAN: 1
AP[2].BAND: 2.4 GHz
AP[2].CHAN: 6
AP[2].RATE: 54Mb/s
AP[2].SIGNAL: 44
AP[2].BARS: **
@ -284,7 +295,8 @@ AP[3].IN-USE:
AP[3].BSSID: 61:66:D2:E7:44:A2
AP[3].SSID: wlan0-ap-2
AP[3].MODE: Infrastruktura
AP[3].CHAN: 1
AP[3].BAND: 5 GHz
AP[3].CHAN: 44
AP[3].RATE: 54Mb/s
AP[3].SIGNAL: 34
AP[3].BARS: **
@ -292,18 +304,19 @@ AP[3].SECURITY: WPA1 WPA2
-------------------------------------------------------------------------------
<<<
size: 670
size: 726
location: src/tests/client/test-client.py:test_002()/11
cmd: $NMCLI -f AP -mode multiline -t d show wlan0
lang: C
returncode: 0
stdout: 515 bytes
stdout: 571 bytes
>>>
AP[1].IN-USE:
AP[1].BSSID:60:B3:25:25:E2:C8
AP[1].SSID:wlan0-ap-3
AP[1].MODE:Infra
AP[1].CHAN:1
AP[1].BAND:6 GHz
AP[1].CHAN:129
AP[1].RATE:54 Mbit/s
AP[1].SIGNAL:55
AP[1].BARS:**
@ -312,7 +325,8 @@ AP[2].IN-USE:
AP[2].BSSID:90:B1:5F:9E:E0:E3
AP[2].SSID:wlan0-ap-1
AP[2].MODE:Infra
AP[2].CHAN:1
AP[2].BAND:2.4 GHz
AP[2].CHAN:6
AP[2].RATE:54 Mbit/s
AP[2].SIGNAL:44
AP[2].BARS:**
@ -321,25 +335,27 @@ AP[3].IN-USE:
AP[3].BSSID:61:66:D2:E7:44:A2
AP[3].SSID:wlan0-ap-2
AP[3].MODE:Infra
AP[3].CHAN:1
AP[3].BAND:5 GHz
AP[3].CHAN:44
AP[3].RATE:54 Mbit/s
AP[3].SIGNAL:34
AP[3].BARS:**
AP[3].SECURITY:WPA1 WPA2
<<<
size: 707
size: 763
location: src/tests/client/test-client.py:test_002()/12
cmd: $NMCLI -f AP -mode multiline -t d show wlan0
lang: pl_PL.UTF-8
returncode: 0
stdout: 542 bytes
stdout: 598 bytes
>>>
AP[1].IN-USE:
AP[1].BSSID:60:B3:25:25:E2:C8
AP[1].SSID:wlan0-ap-3
AP[1].MODE:Infrastruktura
AP[1].CHAN:1
AP[1].BAND:6 GHz
AP[1].CHAN:129
AP[1].RATE:54Mb/s
AP[1].SIGNAL:55
AP[1].BARS:**
@ -348,7 +364,8 @@ AP[2].IN-USE:
AP[2].BSSID:90:B1:5F:9E:E0:E3
AP[2].SSID:wlan0-ap-1
AP[2].MODE:Infrastruktura
AP[2].CHAN:1
AP[2].BAND:2.4 GHz
AP[2].CHAN:6
AP[2].RATE:54Mb/s
AP[2].SIGNAL:44
AP[2].BARS:**
@ -357,131 +374,132 @@ AP[3].IN-USE:
AP[3].BSSID:61:66:D2:E7:44:A2
AP[3].SSID:wlan0-ap-2
AP[3].MODE:Infrastruktura
AP[3].CHAN:1
AP[3].BAND:5 GHz
AP[3].CHAN:44
AP[3].RATE:54Mb/s
AP[3].SIGNAL:34
AP[3].BARS:**
AP[3].SECURITY:WPA1 WPA2
<<<
size: 530
size: 566
location: src/tests/client/test-client.py:test_002()/13
cmd: $NMCLI -f AP -mode tabular d show wlan0
lang: C
returncode: 0
stdout: 380 bytes
stdout: 416 bytes
>>>
NAME IN-USE BSSID SSID MODE CHAN RATE SIGNAL BARS SECURITY
AP[1] 60:B3:25:25:E2:C8 wlan0-ap-3 Infra 1 54 Mbit/s 55 ** WPA3
AP[2] 90:B1:5F:9E:E0:E3 wlan0-ap-1 Infra 1 54 Mbit/s 44 ** WPA1
AP[3] 61:66:D2:E7:44:A2 wlan0-ap-2 Infra 1 54 Mbit/s 34 ** WPA1 WPA2
NAME IN-USE BSSID SSID MODE BAND CHAN RATE SIGNAL BARS SECURITY
AP[1] 60:B3:25:25:E2:C8 wlan0-ap-3 Infra 6 GHz 129 54 Mbit/s 55 ** WPA3
AP[2] 90:B1:5F:9E:E0:E3 wlan0-ap-1 Infra 2.4 GHz 6 54 Mbit/s 44 ** WPA1
AP[3] 61:66:D2:E7:44:A2 wlan0-ap-2 Infra 5 GHz 44 54 Mbit/s 34 ** WPA1 WPA2
<<<
size: 574
size: 610
location: src/tests/client/test-client.py:test_002()/14
cmd: $NMCLI -f AP -mode tabular d show wlan0
lang: pl_PL.UTF-8
returncode: 0
stdout: 414 bytes
stdout: 450 bytes
>>>
NAME IN-USE BSSID SSID MODE CHAN RATE SIGNAL BARS SECURITY
AP[1] 60:B3:25:25:E2:C8 wlan0-ap-3 Infrastruktura 1 54Mb/s 55 ** WPA3
AP[2] 90:B1:5F:9E:E0:E3 wlan0-ap-1 Infrastruktura 1 54Mb/s 44 ** WPA1
AP[3] 61:66:D2:E7:44:A2 wlan0-ap-2 Infrastruktura 1 54Mb/s 34 ** WPA1 WPA2
NAME IN-USE BSSID SSID MODE BAND CHAN RATE SIGNAL BARS SECURITY
AP[1] 60:B3:25:25:E2:C8 wlan0-ap-3 Infrastruktura 6 GHz 129 54Mb/s 55 ** WPA3
AP[2] 90:B1:5F:9E:E0:E3 wlan0-ap-1 Infrastruktura 2.4 GHz 6 54Mb/s 44 ** WPA1
AP[3] 61:66:D2:E7:44:A2 wlan0-ap-2 Infrastruktura 5 GHz 44 54Mb/s 34 ** WPA1 WPA2
<<<
size: 708
size: 753
location: src/tests/client/test-client.py:test_002()/15
cmd: $NMCLI -f AP -mode tabular -p d show wlan0
lang: C
returncode: 0
stdout: 555 bytes
stdout: 600 bytes
>>>
==========================
Device details (wlan0)
==========================
NAME IN-USE BSSID SSID MODE CHAN RATE SIGNAL BARS SECURITY
-----------------------------------------------------------------------------------------------
AP[1] 60:B3:25:25:E2:C8 wlan0-ap-3 Infra 1 54 Mbit/s 55 ** WPA3
AP[2] 90:B1:5F:9E:E0:E3 wlan0-ap-1 Infra 1 54 Mbit/s 44 ** WPA1
AP[3] 61:66:D2:E7:44:A2 wlan0-ap-2 Infra 1 54 Mbit/s 34 ** WPA1 WPA2
NAME IN-USE BSSID SSID MODE BAND CHAN RATE SIGNAL BARS SECURITY
--------------------------------------------------------------------------------------------------------
AP[1] 60:B3:25:25:E2:C8 wlan0-ap-3 Infra 6 GHz 129 54 Mbit/s 55 ** WPA3
AP[2] 90:B1:5F:9E:E0:E3 wlan0-ap-1 Infra 2.4 GHz 6 54 Mbit/s 44 ** WPA1
AP[3] 61:66:D2:E7:44:A2 wlan0-ap-2 Infra 5 GHz 44 54 Mbit/s 34 ** WPA1 WPA2
<<<
size: 788
size: 833
location: src/tests/client/test-client.py:test_002()/16
cmd: $NMCLI -f AP -mode tabular -p d show wlan0
lang: pl_PL.UTF-8
returncode: 0
stdout: 625 bytes
stdout: 670 bytes
>>>
===================================
Informacje o urządzeniu (wlan0)
===================================
NAME IN-USE BSSID SSID MODE CHAN RATE SIGNAL BARS SECURITY
------------------------------------------------------------------------------------------------------
AP[1] 60:B3:25:25:E2:C8 wlan0-ap-3 Infrastruktura 1 54Mb/s 55 ** WPA3
AP[2] 90:B1:5F:9E:E0:E3 wlan0-ap-1 Infrastruktura 1 54Mb/s 44 ** WPA1
AP[3] 61:66:D2:E7:44:A2 wlan0-ap-2 Infrastruktura 1 54Mb/s 34 ** WPA1 WPA2
NAME IN-USE BSSID SSID MODE BAND CHAN RATE SIGNAL BARS SECURITY
---------------------------------------------------------------------------------------------------------------
AP[1] 60:B3:25:25:E2:C8 wlan0-ap-3 Infrastruktura 6 GHz 129 54Mb/s 55 ** WPA3
AP[2] 90:B1:5F:9E:E0:E3 wlan0-ap-1 Infrastruktura 2.4 GHz 6 54Mb/s 44 ** WPA1
AP[3] 61:66:D2:E7:44:A2 wlan0-ap-2 Infrastruktura 5 GHz 44 54Mb/s 34 ** WPA1 WPA2
<<<
size: 377
size: 400
location: src/tests/client/test-client.py:test_002()/17
cmd: $NMCLI -f AP -mode tabular -t d show wlan0
lang: C
returncode: 0
stdout: 224 bytes
stdout: 247 bytes
>>>
AP[1]: :60\:B3\:25\:25\:E2\:C8:wlan0-ap-3:Infra:1:54 Mbit/s:55:** :WPA3
AP[2]: :90\:B1\:5F\:9E\:E0\:E3:wlan0-ap-1:Infra:1:54 Mbit/s:44:** :WPA1
AP[3]: :61\:66\:D2\:E7\:44\:A2:wlan0-ap-2:Infra:1:54 Mbit/s:34:** :WPA1 WPA2
AP[1]: :60\:B3\:25\:25\:E2\:C8:wlan0-ap-3:Infra:6 GHz:129:54 Mbit/s:55:** :WPA3
AP[2]: :90\:B1\:5F\:9E\:E0\:E3:wlan0-ap-1:Infra:2.4 GHz:6:54 Mbit/s:44:** :WPA1
AP[3]: :61\:66\:D2\:E7\:44\:A2:wlan0-ap-2:Infra:5 GHz:44:54 Mbit/s:34:** :WPA1 WPA2
<<<
size: 414
size: 437
location: src/tests/client/test-client.py:test_002()/18
cmd: $NMCLI -f AP -mode tabular -t d show wlan0
lang: pl_PL.UTF-8
returncode: 0
stdout: 251 bytes
stdout: 274 bytes
>>>
AP[1]: :60\:B3\:25\:25\:E2\:C8:wlan0-ap-3:Infrastruktura:1:54Mb/s:55:** :WPA3
AP[2]: :90\:B1\:5F\:9E\:E0\:E3:wlan0-ap-1:Infrastruktura:1:54Mb/s:44:** :WPA1
AP[3]: :61\:66\:D2\:E7\:44\:A2:wlan0-ap-2:Infrastruktura:1:54Mb/s:34:** :WPA1 WPA2
AP[1]: :60\:B3\:25\:25\:E2\:C8:wlan0-ap-3:Infrastruktura:6 GHz:129:54Mb/s:55:** :WPA3
AP[2]: :90\:B1\:5F\:9E\:E0\:E3:wlan0-ap-1:Infrastruktura:2.4 GHz:6:54Mb/s:44:** :WPA1
AP[3]: :61\:66\:D2\:E7\:44\:A2:wlan0-ap-2:Infrastruktura:5 GHz:44:54Mb/s:34:** :WPA1 WPA2
<<<
size: 2049
size: 2109
location: src/tests/client/test-client.py:test_002()/19
cmd: $NMCLI -f ALL d wifi
lang: C
returncode: 0
stdout: 1917 bytes
stdout: 1977 bytes
>>>
NAME SSID SSID-HEX BSSID MODE CHAN FREQ RATE BANDWIDTH SIGNAL BARS SECURITY WPA-FLAGS RSN-FLAGS DEVICE ACTIVE IN-USE DBUS-PATH
AP[1] wlan0-ap-3 776C616E302D61702D33 60:B3:25:25:E2:C8 Infra 1 2412 MHz 54 Mbit/s 40 MHz 55 ** WPA3 (none) pair_tkip pair_ccmp group_tkip group_ccmp sae wlan0 no /org/freedesktop/NetworkManager/AccessPoint/3
AP[2] wlan0-ap-1 776C616E302D61702D31 90:B1:5F:9E:E0:E3 Infra 1 2412 MHz 54 Mbit/s 40 MHz 44 ** WPA1 pair_tkip pair_ccmp group_tkip group_ccmp psk (none) wlan0 no /org/freedesktop/NetworkManager/AccessPoint/1
AP[3] wlan0-ap-2 776C616E302D61702D32 61:66:D2:E7:44:A2 Infra 1 2412 MHz 54 Mbit/s 40 MHz 34 ** WPA1 WPA2 pair_tkip pair_ccmp group_tkip group_ccmp psk pair_tkip pair_ccmp group_tkip group_ccmp psk wlan0 no /org/freedesktop/NetworkManager/AccessPoint/2
NAME SSID SSID-HEX BSSID MODE CHAN BAND FREQ RATE BANDWIDTH SIGNAL BARS SECURITY WPA-FLAGS RSN-FLAGS DEVICE ACTIVE IN-USE DBUS-PATH
AP[1] wlan0-ap-3 776C616E302D61702D33 60:B3:25:25:E2:C8 Infra 129 6 GHz 6595 MHz 54 Mbit/s 40 MHz 55 ** WPA3 (none) pair_tkip pair_ccmp group_tkip group_ccmp sae wlan0 no /org/freedesktop/NetworkManager/AccessPoint/3
AP[2] wlan0-ap-1 776C616E302D61702D31 90:B1:5F:9E:E0:E3 Infra 6 2.4 GHz 2437 MHz 54 Mbit/s 40 MHz 44 ** WPA1 pair_tkip pair_ccmp group_tkip group_ccmp psk (none) wlan0 no /org/freedesktop/NetworkManager/AccessPoint/1
AP[3] wlan0-ap-2 776C616E302D61702D32 61:66:D2:E7:44:A2 Infra 44 5 GHz 5220 MHz 54 Mbit/s 40 MHz 34 ** WPA1 WPA2 pair_tkip pair_ccmp group_tkip group_ccmp psk pair_tkip pair_ccmp group_tkip group_ccmp psk wlan0 no /org/freedesktop/NetworkManager/AccessPoint/2
NAME SSID SSID-HEX BSSID MODE CHAN FREQ RATE BANDWIDTH SIGNAL BARS SECURITY WPA-FLAGS RSN-FLAGS DEVICE ACTIVE IN-USE DBUS-PATH
AP[1] wlan1-ap-4 776C616E312D61702D34 EE:52:8B:49:A1:96 Infra 1 2412 MHz 54 Mbit/s 40 MHz 38 ** WPA1 WPA2 pair_tkip pair_ccmp group_tkip group_ccmp psk pair_tkip pair_ccmp group_tkip group_ccmp psk wlan1 no /org/freedesktop/NetworkManager/AccessPoint/4
NAME SSID SSID-HEX BSSID MODE CHAN BAND FREQ RATE BANDWIDTH SIGNAL BARS SECURITY WPA-FLAGS RSN-FLAGS DEVICE ACTIVE IN-USE DBUS-PATH
AP[1] wlan1-ap-4 776C616E312D61702D34 EE:52:8B:49:A1:96 Infra 1 2.4 GHz 2412 MHz 54 Mbit/s 40 MHz 38 ** WPA1 WPA2 pair_tkip pair_ccmp group_tkip group_ccmp psk pair_tkip pair_ccmp group_tkip group_ccmp psk wlan1 no /org/freedesktop/NetworkManager/AccessPoint/4
NAME SSID SSID-HEX BSSID MODE CHAN FREQ RATE BANDWIDTH SIGNAL BARS SECURITY WPA-FLAGS RSN-FLAGS DEVICE ACTIVE IN-USE DBUS-PATH
NAME SSID SSID-HEX BSSID MODE CHAN BAND FREQ RATE BANDWIDTH SIGNAL BARS SECURITY WPA-FLAGS RSN-FLAGS DEVICE ACTIVE IN-USE DBUS-PATH
<<<
size: 2125
size: 2185
location: src/tests/client/test-client.py:test_002()/20
cmd: $NMCLI -f ALL d wifi
lang: pl_PL.UTF-8
returncode: 0
stdout: 1983 bytes
stdout: 2043 bytes
>>>
NAME SSID SSID-HEX BSSID MODE CHAN FREQ RATE BANDWIDTH SIGNAL BARS SECURITY WPA-FLAGS RSN-FLAGS DEVICE ACTIVE IN-USE DBUS-PATH
AP[1] wlan0-ap-3 776C616E302D61702D33 60:B3:25:25:E2:C8 Infrastruktura 1 2412MHz 54Mb/s 40MHz 55 ** WPA3 (brak) pair_tkip pair_ccmp group_tkip group_ccmp sae wlan0 nie /org/freedesktop/NetworkManager/AccessPoint/3
AP[2] wlan0-ap-1 776C616E302D61702D31 90:B1:5F:9E:E0:E3 Infrastruktura 1 2412MHz 54Mb/s 40MHz 44 ** WPA1 pair_tkip pair_ccmp group_tkip group_ccmp psk (brak) wlan0 nie /org/freedesktop/NetworkManager/AccessPoint/1
AP[3] wlan0-ap-2 776C616E302D61702D32 61:66:D2:E7:44:A2 Infrastruktura 1 2412MHz 54Mb/s 40MHz 34 ** WPA1 WPA2 pair_tkip pair_ccmp group_tkip group_ccmp psk pair_tkip pair_ccmp group_tkip group_ccmp psk wlan0 nie /org/freedesktop/NetworkManager/AccessPoint/2
NAME SSID SSID-HEX BSSID MODE CHAN BAND FREQ RATE BANDWIDTH SIGNAL BARS SECURITY WPA-FLAGS RSN-FLAGS DEVICE ACTIVE IN-USE DBUS-PATH
AP[1] wlan0-ap-3 776C616E302D61702D33 60:B3:25:25:E2:C8 Infrastruktura 129 6 GHz 6595MHz 54Mb/s 40MHz 55 ** WPA3 (brak) pair_tkip pair_ccmp group_tkip group_ccmp sae wlan0 nie /org/freedesktop/NetworkManager/AccessPoint/3
AP[2] wlan0-ap-1 776C616E302D61702D31 90:B1:5F:9E:E0:E3 Infrastruktura 6 2.4 GHz 2437MHz 54Mb/s 40MHz 44 ** WPA1 pair_tkip pair_ccmp group_tkip group_ccmp psk (brak) wlan0 nie /org/freedesktop/NetworkManager/AccessPoint/1
AP[3] wlan0-ap-2 776C616E302D61702D32 61:66:D2:E7:44:A2 Infrastruktura 44 5 GHz 5220MHz 54Mb/s 40MHz 34 ** WPA1 WPA2 pair_tkip pair_ccmp group_tkip group_ccmp psk pair_tkip pair_ccmp group_tkip group_ccmp psk wlan0 nie /org/freedesktop/NetworkManager/AccessPoint/2
NAME SSID SSID-HEX BSSID MODE CHAN FREQ RATE BANDWIDTH SIGNAL BARS SECURITY WPA-FLAGS RSN-FLAGS DEVICE ACTIVE IN-USE DBUS-PATH
AP[1] wlan1-ap-4 776C616E312D61702D34 EE:52:8B:49:A1:96 Infrastruktura 1 2412MHz 54Mb/s 40MHz 38 ** WPA1 WPA2 pair_tkip pair_ccmp group_tkip group_ccmp psk pair_tkip pair_ccmp group_tkip group_ccmp psk wlan1 nie /org/freedesktop/NetworkManager/AccessPoint/4
NAME SSID SSID-HEX BSSID MODE CHAN BAND FREQ RATE BANDWIDTH SIGNAL BARS SECURITY WPA-FLAGS RSN-FLAGS DEVICE ACTIVE IN-USE DBUS-PATH
AP[1] wlan1-ap-4 776C616E312D61702D34 EE:52:8B:49:A1:96 Infrastruktura 1 2.4 GHz 2412MHz 54Mb/s 40MHz 38 ** WPA1 WPA2 pair_tkip pair_ccmp group_tkip group_ccmp psk pair_tkip pair_ccmp group_tkip group_ccmp psk wlan1 nie /org/freedesktop/NetworkManager/AccessPoint/4
NAME SSID SSID-HEX BSSID MODE CHAN FREQ RATE BANDWIDTH SIGNAL BARS SECURITY WPA-FLAGS RSN-FLAGS DEVICE ACTIVE IN-USE DBUS-PATH
NAME SSID SSID-HEX BSSID MODE CHAN BAND FREQ RATE BANDWIDTH SIGNAL BARS SECURITY WPA-FLAGS RSN-FLAGS DEVICE ACTIVE IN-USE DBUS-PATH
<<<
size: 245

File diff suppressed because it is too large Load diff

View file

@ -1547,9 +1547,9 @@ class TestNmcli(unittest.TestCase):
# does not enforce the ifnames are unique.
self.ctx.srv.op_AddObj("WifiDevice", ident="wlan1/x", iface="wlan1")
self.ctx.srv.op_AddObj("WifiAp", device="wlan0", rsnf=0x0)
self.ctx.srv.op_AddObj("WifiAp", device="wlan0", rsnf=0x0, freq=2437)
self.ctx.srv.op_AddObj("WifiAp", device="wlan0")
self.ctx.srv.op_AddObj("WifiAp", device="wlan0", freq=5220)
NM_AP_FLAGS = getattr(NM, "80211ApSecurityFlags")
rsnf = 0x0
@ -1558,7 +1558,7 @@ class TestNmcli(unittest.TestCase):
rsnf = rsnf | NM_AP_FLAGS.GROUP_TKIP
rsnf = rsnf | NM_AP_FLAGS.GROUP_CCMP
rsnf = rsnf | NM_AP_FLAGS.KEY_MGMT_SAE
self.ctx.srv.op_AddObj("WifiAp", device="wlan0", wpaf=0x0, rsnf=rsnf)
self.ctx.srv.op_AddObj("WifiAp", device="wlan0", wpaf=0x0, rsnf=rsnf, freq=6595)
self.ctx.srv.op_AddObj("WifiAp", device="wlan1")

View file

@ -2069,10 +2069,10 @@ class NetworkManager(ExportedObj):
d = self.find_device_first(path=path, require=TestError)
self.remove_device(d)
@dbus.service.method(IFACE_TEST, in_signature="sss", out_signature="o")
def AddWifiAp(self, ident, ssid, bssid):
@dbus.service.method(IFACE_TEST, in_signature="sssu", out_signature="o")
def AddWifiAp(self, ident, ssid, bssid, freq):
d = self.find_device_first(ident=ident, require=TestError)
ap = WifiAp(ssid, bssid)
ap = WifiAp(ssid, bssid=bssid, freq=freq)
return ExportedObj.to_path(d.add_ap(ap))
@dbus.service.method(IFACE_TEST, in_signature="so", out_signature="")