blob: 77f3ddd316e30e95d7eb31f49e69bf4ac0bdbb2e [file] [log] [blame]
developer66e89bc2024-04-23 14:50:01 +08001From 3d12a39b10565a10bec40b53cf6e69b60115a35f Mon Sep 17 00:00:00 2001
2From: Harshitha Prem <quic_hprem@quicinc.com>
3Date: Thu, 28 Mar 2024 23:46:49 +0530
4Subject: [PATCH 019/104] hostapd: MLO: display link details in status command
5
6Currently, link id and number of link details of a MLD AP interface is not
7displayed in status command of hostapd_cli.
8
9Add changes to display the link id and number of link details.
10
11The details would be seen as below for a MLD AP interface:
12
13$ hostapd_cli -i wlan0 status | grep link
14num_links=1
15link_id=0
16link_addr=AA:BB:CC:DD:EE:FF
17
18$ hostapd_cli -i wlan1 status | grep link
19num_links=2
20link_id=0
21link_addr=AA:BB:CC:DD:EE:FF
22partner_link_id=1
23partner_link_addr=AA:BB:CC:DD:EE:AA
24
25The above details would not be displayed for non-MLD AP interfaces.
26
27Signed-off-by: Harshitha Prem <quic_hprem@quicinc.com>
28Co-developed-by: Manish Dharanenthiran <quic_mdharane@quicinc.com>
29Signed-off-by: Manish Dharanenthiran <quic_mdharane@quicinc.com>
30Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
31---
32 src/ap/ctrl_iface_ap.c | 36 ++++++++++++++++++++++++++++++++++++
33 1 file changed, 36 insertions(+)
34
35diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c
36index 272317774..2cfef4bd4 100644
37--- a/src/ap/ctrl_iface_ap.c
38+++ b/src/ap/ctrl_iface_ap.c
39@@ -887,6 +887,42 @@ int hostapd_ctrl_iface_status(struct hostapd_data *hapd, char *buf,
40 return len;
41 len += ret;
42 }
43+
44+ if (hapd->conf->mld_ap) {
45+ struct hostapd_data *link_bss;
46+
47+ ret = os_snprintf(buf + len, buflen - len,
48+ "num_links=%d\n",
49+ hapd->mld->num_links);
50+ if (os_snprintf_error(buflen - len, ret))
51+ return len;
52+ len += ret;
53+
54+ /* self bss */
55+ ret = os_snprintf(buf + len, buflen - len,
56+ "link_id=%d\n"
57+ "link_addr=" MACSTR "\n",
58+ hapd->mld_link_id,
59+ MAC2STR(hapd->own_addr));
60+ if (os_snprintf_error(buflen - len, ret))
61+ return len;
62+ len += ret;
63+
64+ /* partner bss */
65+ for_each_mld_link(link_bss, hapd) {
66+ if (link_bss == hapd)
67+ continue;
68+
69+ ret = os_snprintf(buf + len, buflen - len,
70+ "partner_link_id=%d\n"
71+ "partner_link_addr=" MACSTR "\n",
72+ link_bss->mld_link_id,
73+ MAC2STR(link_bss->own_addr));
74+ if (os_snprintf_error(buflen - len, ret))
75+ return len;
76+ len += ret;
77+ }
78+ }
79 }
80 #endif /* CONFIG_IEEE80211BE */
81
82--
832.39.2
84