]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: print tx power per link for MLD
authorAaradhana Sahu <quic_aarasahu@quicinc.com>
Mon, 25 Nov 2024 10:09:13 +0000 (15:39 +0530)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 6 Dec 2024 09:50:31 +0000 (10:50 +0100)
Add support to print tx power per link for an ML interface

Sample output:
phy#0
        Interface wlp88s0
                ifindex 5
                wdev 0x1
                addr 00:03:7f:01:54:92
                ssid tx_power_123
                type AP
                multicast TXQ:
                        qsz-byt qsz-pkt flows   drops   marks   overlmt hashcol tx-bytes        tx-packets
                        0       0       0       0       0       0       0       0               0
                MLD with links:
                 - link ID  0 link addr 00:03:7f:01:54:92
                   channel 36 (5180 MHz), width: 80 MHz, center1: 5210 MHz
                   txpower 30.00 dBm

Signed-off-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>
Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Link: https://patch.msgid.link/20241125100913.261319-1-quic_ramess@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
interface.c

index bb1a1d30385cddcbf9a295cb14f6be1ac608dc41..0d4ff042c7a65f4179783d8a904619ae11a1ba0a 100644 (file)
@@ -490,6 +490,11 @@ static int print_iface_handler(struct nl_msg *msg, void *arg)
                                printf("\n%s\t   ", indent);
                                print_channel(tb);
                        }
+                       if (tb[NL80211_ATTR_WIPHY_TX_POWER_LEVEL]) {
+                               int32_t txp = nla_get_u32(tb[NL80211_ATTR_WIPHY_TX_POWER_LEVEL]);
+
+                               printf("\n%s\t   txpower %d.%.2d dBm", indent, txp / 100, txp % 100);
+                       }
                        printf("\n");
                }
        }