From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH v4 2/8] netdev: define netdev settings in netdev.h
Date: Fri, 23 Aug 2024 15:23:33 -0700 [thread overview]
Message-ID: <20240823222339.328006-2-prestwoj@gmail.com> (raw)
In-Reply-To: <20240823222339.328006-1-prestwoj@gmail.com>
Following knownnetworks, this moves the settings into a header file
which is easier to maintain/read.
---
src/netdev.c | 8 ++++----
src/netdev.h | 5 +++++
2 files changed, 9 insertions(+), 4 deletions(-)
v4:
* Fix typos
diff --git a/src/netdev.c b/src/netdev.c
index 494e46a5..e0121095 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -6264,16 +6264,16 @@ static int netdev_init(void)
goto fail_netlink;
}
- if (!l_settings_get_int(settings, "General", "RoamThreshold",
+ if (!l_settings_get_int(settings, NETDEV_ROAM_THRESHOLD,
&LOW_SIGNAL_THRESHOLD))
LOW_SIGNAL_THRESHOLD = -70;
- if (!l_settings_get_int(settings, "General", "RoamThreshold5G",
+ if (!l_settings_get_int(settings, NETDEV_ROAM_THRESHOLD_5G,
&LOW_SIGNAL_THRESHOLD_5GHZ))
LOW_SIGNAL_THRESHOLD_5GHZ = -76;
- rand_addr_str = l_settings_get_value(settings, "General",
- "AddressRandomization");
+ rand_addr_str = l_settings_get_value(settings,
+ NETDEV_ADDRESS_RANDOMIZATION);
if (rand_addr_str && !strcmp(rand_addr_str, "network"))
mac_per_ssid = true;
diff --git a/src/netdev.h b/src/netdev.h
index db0440d0..c48b2c38 100644
--- a/src/netdev.h
+++ b/src/netdev.h
@@ -29,6 +29,11 @@ struct eapol_sm;
struct mmpdu_header;
struct diagnostic_station_info;
+#define GENERAL "General"
+#define NETDEV_ADDRESS_RANDOMIZATION GENERAL, "AddressRandomization"
+#define NETDEV_ROAM_THRESHOLD GENERAL, "RoamThreshold"
+#define NETDEV_ROAM_THRESHOLD_5G GENERAL, "RoamThreshold5G"
+
enum netdev_result {
NETDEV_RESULT_OK,
NETDEV_RESULT_AUTHENTICATION_FAILED,
--
2.34.1
next prev parent reply other threads:[~2024-08-23 22:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-23 22:23 [PATCH v4 1/8] doc: Document station Affinities property James Prestwood
2024-08-23 22:23 ` James Prestwood [this message]
2024-08-28 2:44 ` [PATCH v4 2/8] netdev: define netdev settings in netdev.h Denis Kenzior
2024-08-23 22:23 ` [PATCH v4 3/8] netdev: store signal threshold in netdev object, not globally James Prestwood
2024-08-23 22:23 ` [PATCH v4 4/8] netdev: add critical signal threshold level James Prestwood
2024-08-23 22:23 ` [PATCH v4 5/8] station: add Affinities DBus property James Prestwood
2024-08-28 2:57 ` Denis Kenzior
2024-08-23 22:23 ` [PATCH v4 6/8] station: Use Affinities property to change roaming threshold James Prestwood
2024-08-23 22:23 ` [PATCH v4 7/8] auto-t: add affinities property for station, and extended_service_set James Prestwood
2024-08-23 22:23 ` [PATCH v4 8/8] auto-t: add tests for Affinities behavior James Prestwood
2024-08-28 2:39 ` [PATCH v4 1/8] doc: Document station Affinities property Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240823222339.328006-2-prestwoj@gmail.com \
--to=prestwoj@gmail.com \
--cc=iwd@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox