From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [RFC 3/5] station: add additional station_debug_event's
Date: Wed, 14 Feb 2024 11:37:41 -0800 [thread overview]
Message-ID: <20240214193743.963349-4-prestwoj@gmail.com> (raw)
In-Reply-To: <20240214193743.963349-1-prestwoj@gmail.com>
Add events/notifications for roaming, connecting and disconnecting
information.
---
src/station.c | 27 +++++++++++++++++++++++----
1 file changed, 23 insertions(+), 4 deletions(-)
diff --git a/src/station.c b/src/station.c
index a097174e..7d6a8023 100644
--- a/src/station.c
+++ b/src/station.c
@@ -2389,8 +2389,11 @@ disassociate:
station_disassociated(station);
break;
default:
- if (ret > 0)
+ if (ret > 0) {
+ station_debug_event(station, "ft-roam-failed",
+ "status: %d", ret);
goto try_next;
+ }
station_roam_failed(station);
break;
@@ -2462,8 +2465,11 @@ static bool station_try_next_transition(struct station *station,
struct handshake_state *new_hs;
struct ie_rsn_info cur_rsne, target_rsne;
- l_debug("%u, target %s", netdev_get_ifindex(station->netdev),
- util_address_to_string(bss->addr));
+ station_debug_event(station, "roaming-info", "bss: "MAC", "
+ "signal: %d, load: %d/255",
+ MAC_STR(bss->addr),
+ bss->signal_strength / 100,
+ bss->utilization);
/* Reset AP roam flag, at this point the roaming behaves the same */
station->ap_directed_roaming = false;
@@ -3164,6 +3170,9 @@ static bool station_retry_owe_default_group(struct station *station)
static bool station_retry_with_reason(struct station *station,
uint16_t reason_code)
{
+ station_debug_event(station, "connect-failed", "reason: %u",
+ reason_code);
+
/*
* We don't want to cause a retry and blacklist if the password was
* incorrect. Otherwise we would just continue to fail.
@@ -3214,6 +3223,9 @@ static bool station_retry_with_status(struct station *station,
else
blacklist_add_bss(station->connected_bss->addr);
+ station_debug_event(station, "connect-failed", "status: %u",
+ status_code);
+
return station_try_next_bss(station);
}
@@ -3374,6 +3386,8 @@ static void station_disconnect_event(struct station *station, void *event_data)
case STATION_STATE_FT_ROAMING:
case STATION_STATE_FW_ROAMING:
case STATION_STATE_NETCONFIG:
+ station_debug_event(station, "disconnected-info", "reason: %u",
+ l_get_u16(event_data));
station_disassociated(station);
return;
default:
@@ -3513,7 +3527,12 @@ int __station_connect_network(struct station *station, struct network *network,
return r;
}
- l_debug("connecting to BSS "MAC, MAC_STR(bss->addr));
+ station_debug_event(station, "connecting-info", "ssid: %s, bss: "MAC", "
+ "signal: %d, load: %d/255",
+ network_get_ssid(network),
+ MAC_STR(bss->addr),
+ bss->signal_strength / 100,
+ bss->utilization);
station->connected_bss = bss;
station->connected_network = network;
--
2.34.1
next prev parent reply other threads:[~2024-02-14 19:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-14 19:37 [RFC 0/5] Using l_notice for low level IWD state information James Prestwood
2024-02-14 19:37 ` [RFC 1/5] main: add runtime flag for setting the logger James Prestwood
2024-02-14 19:37 ` [RFC 2/5] station: use l_notice for station_debug_event, allow arguments James Prestwood
2024-02-14 19:46 ` Marcel Holtmann
2024-02-14 20:02 ` James Prestwood
2024-02-14 20:11 ` Marcel Holtmann
2024-02-14 19:37 ` James Prestwood [this message]
2024-02-14 19:37 ` [RFC 4/5] netdev: add notice events for connection timeouts James Prestwood
2024-02-14 19:37 ` [RFC 5/5] doc: document use of l_log APIs James Prestwood
2024-02-14 19:49 ` Marcel Holtmann
2024-02-14 19:55 ` James Prestwood
2024-02-14 20:12 ` Marcel Holtmann
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=20240214193743.963349-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