From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH 4/9] netdev: add netdev_get_critical_signal_threshold
Date: Tue, 13 Aug 2024 08:56:33 -0700 [thread overview]
Message-ID: <20240813155638.74987-4-prestwoj@gmail.com> (raw)
In-Reply-To: <20240813155638.74987-1-prestwoj@gmail.com>
This is set via a main.conf option but to avoid duplicated settings
parsing in station add a getter API.
---
src/netdev.c | 6 ++++++
src/netdev.h | 1 +
2 files changed, 7 insertions(+)
diff --git a/src/netdev.c b/src/netdev.c
index 94766552..c7d0d880 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -3713,6 +3713,12 @@ int netdev_raise_signal_threshold(struct netdev *netdev)
LOW_SIGNAL_THRESHOLD_5GHZ);
}
+int netdev_get_critical_signal_threshold(struct netdev *netdev)
+{
+ return netdev->frequency > 4000 ? CRITICAL_SIGNAL_THRESHOLD_5GHZ :
+ CRITICAL_SIGNAL_THRESHOLD;
+}
+
static bool netdev_connection_work_ready(struct wiphy_radio_work_item *item)
{
struct netdev *netdev = l_container_of(item, struct netdev, work);
diff --git a/src/netdev.h b/src/netdev.h
index 3a772256..f89aa572 100644
--- a/src/netdev.h
+++ b/src/netdev.h
@@ -199,6 +199,7 @@ int netdev_set_rssi_report_levels(struct netdev *netdev, const int8_t *levels,
size_t levels_num);
int netdev_lower_signal_threshold(struct netdev *netdev);
int netdev_raise_signal_threshold(struct netdev *netdev);
+int netdev_get_critical_signal_threshold(struct netdev *netdev);
int netdev_get_station(struct netdev *netdev, const uint8_t *mac,
netdev_get_station_cb_t cb, void *user_data,
--
2.34.1
next prev parent reply other threads:[~2024-08-13 15:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-13 15:56 [PATCH 1/9] doc: Document station Affinities property James Prestwood
2024-08-13 15:56 ` [PATCH 2/9] netdev: store signal threshold in netdev object, not globally James Prestwood
2024-08-13 15:56 ` [PATCH 3/9] netdev: add critical signal threshold level James Prestwood
2024-08-13 15:56 ` James Prestwood [this message]
2024-08-13 15:56 ` [PATCH 5/9] station: emit property changed for ConnectedAccessPoint James Prestwood
2024-08-13 15:56 ` [PATCH 6/9] station: add Affinities DBus property James Prestwood
2024-08-13 15:56 ` [PATCH 7/9] station: Use Affinities property for roaming/ranking decisions James Prestwood
2024-08-13 15:56 ` [PATCH 8/9] auto-t: add affinities property for station, and extended_service_set James Prestwood
2024-08-13 15:56 ` [PATCH 9/9] auto-t: add tests for Affinities behavior James Prestwood
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=20240813155638.74987-4-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