mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2025-03-03 22:18:20 +02:00
iw: print the current operating frequency in the phy info
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19179 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
b3eea0e9a1
commit
40f5a41eae
30
package/iw/patches/110-freq.patch
Normal file
30
package/iw/patches/110-freq.patch
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
--- a/info.c
|
||||||
|
+++ b/info.c
|
||||||
|
@@ -62,6 +62,27 @@ static int print_phy_handler(struct nl_m
|
||||||
|
if (tb_msg[NL80211_ATTR_WIPHY_NAME])
|
||||||
|
printf("Wiphy %s\n", nla_get_string(tb_msg[NL80211_ATTR_WIPHY_NAME]));
|
||||||
|
|
||||||
|
+ if (tb_msg[NL80211_ATTR_WIPHY_FREQ]) {
|
||||||
|
+ const char *mode;
|
||||||
|
+
|
||||||
|
+ if (tb_msg[NL80211_ATTR_WIPHY_CHANNEL_TYPE])
|
||||||
|
+ switch(nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_CHANNEL_TYPE])) {
|
||||||
|
+ case NL80211_CHAN_HT20:
|
||||||
|
+ mode = "HT20";
|
||||||
|
+ break;
|
||||||
|
+ case NL80211_CHAN_HT40PLUS:
|
||||||
|
+ mode = "HT40+";
|
||||||
|
+ break;
|
||||||
|
+ case NL80211_CHAN_HT40MINUS:
|
||||||
|
+ mode = "HT40-";
|
||||||
|
+ break;
|
||||||
|
+ default:
|
||||||
|
+ mode = "";
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ printf("\tCurrent frequency: %d MHz %s\n", nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_FREQ]), mode);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
nla_for_each_nested(nl_band, tb_msg[NL80211_ATTR_WIPHY_BANDS], rem_band) {
|
||||||
|
printf("\tBand %d:\n", bandidx);
|
||||||
|
bandidx++;
|
Loading…
x
Reference in New Issue
Block a user