aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-01-17 03:07:55 +0000
committerFelix Fietkau <nbd@openwrt.org>2010-01-17 03:07:55 +0000
commitefad6bd31702b52738e2d376b61092cda510d732 (patch)
treeb2d3a354b881e6da25c8694df55cd888de57e4ca
parentc011667b624d233bd4cbb4d8c1663025dba0ce6b (diff)
downloadupstream-efad6bd31702b52738e2d376b61092cda510d732.tar.gz
upstream-efad6bd31702b52738e2d376b61092cda510d732.tar.bz2
upstream-efad6bd31702b52738e2d376b61092cda510d732.zip
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
-rw-r--r--package/iw/patches/110-freq.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/package/iw/patches/110-freq.patch b/package/iw/patches/110-freq.patch
new file mode 100644
index 0000000000..9a00a65e3f
--- /dev/null
+++ b/package/iw/patches/110-freq.patch
@@ -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++;