diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2011-12-04 22:04:00 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2011-12-04 22:04:00 +0000 |
commit | 6b2568151dade7e96f149535bacc4a49387ee3ca (patch) | |
tree | bf8ab54174e25bf559b5f45b147b932361d3f0d8 /package/iwinfo/src | |
parent | 3a5a1c6ef967861ecd61ffa531398add09bbce15 (diff) | |
download | master-187ad058-6b2568151dade7e96f149535bacc4a49387ee3ca.tar.gz master-187ad058-6b2568151dade7e96f149535bacc4a49387ee3ca.tar.bz2 master-187ad058-6b2568151dade7e96f149535bacc4a49387ee3ca.zip |
[package] iwinfo: factor tx power offset into power level listing
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@29430 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/iwinfo/src')
-rw-r--r-- | package/iwinfo/src/iwinfo_cli.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/package/iwinfo/src/iwinfo_cli.c b/package/iwinfo/src/iwinfo_cli.c index d5be084bdb..4f8f5612c7 100644 --- a/package/iwinfo/src/iwinfo_cli.c +++ b/package/iwinfo/src/iwinfo_cli.c @@ -553,7 +553,7 @@ static void print_scanlist(const struct iwinfo_ops *iw, const char *ifname) static void print_txpwrlist(const struct iwinfo_ops *iw, const char *ifname) { - int len, pwr, i; + int len, pwr, off, i; char buf[IWINFO_BUFSIZE]; struct iwinfo_txpwrlist_entry *e; @@ -566,14 +566,17 @@ static void print_txpwrlist(const struct iwinfo_ops *iw, const char *ifname) if (iw->txpower(ifname, &pwr)) pwr = -1; + if (iw->txpower_offset(ifname, &off)) + off = 0; + for (i = 0; i < len; i += sizeof(struct iwinfo_txpwrlist_entry)) { e = (struct iwinfo_txpwrlist_entry *) &buf[i]; printf("%s%3d dBm (%4d mW)\n", (pwr == e->dbm) ? "*" : " ", - e->dbm, - e->mw); + e->dbm + off, + iwinfo_dbm2mw(e->dbm + off)); } } |