developer | 66e89bc | 2024-04-23 14:50:01 +0800 | [diff] [blame] | 1 | From 3d12a39b10565a10bec40b53cf6e69b60115a35f Mon Sep 17 00:00:00 2001 |
| 2 | From: Harshitha Prem <quic_hprem@quicinc.com> |
| 3 | Date: Thu, 28 Mar 2024 23:46:49 +0530 |
| 4 | Subject: [PATCH 019/104] hostapd: MLO: display link details in status command |
| 5 | |
| 6 | Currently, link id and number of link details of a MLD AP interface is not |
| 7 | displayed in status command of hostapd_cli. |
| 8 | |
| 9 | Add changes to display the link id and number of link details. |
| 10 | |
| 11 | The details would be seen as below for a MLD AP interface: |
| 12 | |
| 13 | $ hostapd_cli -i wlan0 status | grep link |
| 14 | num_links=1 |
| 15 | link_id=0 |
| 16 | link_addr=AA:BB:CC:DD:EE:FF |
| 17 | |
| 18 | $ hostapd_cli -i wlan1 status | grep link |
| 19 | num_links=2 |
| 20 | link_id=0 |
| 21 | link_addr=AA:BB:CC:DD:EE:FF |
| 22 | partner_link_id=1 |
| 23 | partner_link_addr=AA:BB:CC:DD:EE:AA |
| 24 | |
| 25 | The above details would not be displayed for non-MLD AP interfaces. |
| 26 | |
| 27 | Signed-off-by: Harshitha Prem <quic_hprem@quicinc.com> |
| 28 | Co-developed-by: Manish Dharanenthiran <quic_mdharane@quicinc.com> |
| 29 | Signed-off-by: Manish Dharanenthiran <quic_mdharane@quicinc.com> |
| 30 | Signed-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 | |
| 35 | diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c |
| 36 | index 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 | -- |
| 83 | 2.39.2 |
| 84 | |