From 91ceab5b19a7b8c8b748a27e7bd8cb2cd4a44132 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 19 Aug 2009 04:03:00 +0000 Subject: libs/iwinfo: implement *_get_txpwrlist() to obtain valid tx power levels --- libs/iwinfo/src/iwinfo_wl.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'libs/iwinfo/src/iwinfo_wl.c') 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; -- cgit v1.2.3