diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-08-19 04:03:00 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-08-19 04:03:00 +0000 |
commit | 91ceab5b19a7b8c8b748a27e7bd8cb2cd4a44132 (patch) | |
tree | a235584c68a24630f0aca3fe80b014b7f8aef3f5 /libs/iwinfo/src/iwinfo_wl.c | |
parent | 8e31e6bed28d3c154f7fd101d5907359a4d3eabd (diff) |
libs/iwinfo: implement *_get_txpwrlist() to obtain valid tx power levels
Diffstat (limited to 'libs/iwinfo/src/iwinfo_wl.c')
-rw-r--r-- | libs/iwinfo/src/iwinfo_wl.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libs/iwinfo/src/iwinfo_wl.c b/libs/iwinfo/src/iwinfo_wl.c index 4247353f5b..2c3126a839 100644 --- a/libs/iwinfo/src/iwinfo_wl.c +++ b/libs/iwinfo/src/iwinfo_wl.c @@ -366,6 +366,24 @@ int wl_get_assoclist(const char *ifname, char *buf, int *len) return -1; } +int wl_get_txpwrlist(const char *ifname, char *buf, int *len) +{ + struct iwinfo_txpwrlist_entry entry; + uint8_t dbm[8] = { 0, 6, 8, 10, 12, 14, 16, 18 }; + uint8_t mw[8] = { 1, 3, 6, 10, 15, 25, 39, 63 }; + int i; + + for( i = 0; i < 8; i++ ) + { + entry.dbm = dbm[i]; + entry.mw = mw[i]; + memcpy(&buf[i*sizeof(entry)], &entry, sizeof(entry)); + } + + *len = 8 * sizeof(entry); + return 0; +} + int wl_get_mbssid_support(const char *ifname, int *buf) { wlc_rev_info_t revinfo; |