diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2011-12-04 20:37:01 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2011-12-04 20:37:01 +0000 |
commit | 3a5a1c6ef967861ecd61ffa531398add09bbce15 (patch) | |
tree | 454302aa37566a7b2a7f06ddba356f9e221038d1 /package/iwinfo/src/iwinfo_wl.c | |
parent | 4c0321a6aa425bc90a505ff797118ac9be972676 (diff) | |
download | upstream-3a5a1c6ef967861ecd61ffa531398add09bbce15.tar.gz upstream-3a5a1c6ef967861ecd61ffa531398add09bbce15.tar.bz2 upstream-3a5a1c6ef967861ecd61ffa531398add09bbce15.zip |
[package] iwinfo: expose txpower and frequency offset information
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@29425 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/iwinfo/src/iwinfo_wl.c')
-rw-r--r-- | package/iwinfo/src/iwinfo_wl.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/package/iwinfo/src/iwinfo_wl.c b/package/iwinfo/src/iwinfo_wl.c index 76984de336..7b39a9b863 100644 --- a/package/iwinfo/src/iwinfo_wl.c +++ b/package/iwinfo/src/iwinfo_wl.c @@ -585,3 +585,28 @@ int wl_get_hardware_name(const char *ifname, char *buf) return 0; } + +int wl_get_txpower_offset(const char *ifname, int *buf) +{ + FILE *p; + char off[8]; + + *buf = 0; + + if ((p = popen("/usr/sbin/nvram get opo", "r")) != NULL) + { + if (fread(off, 1, sizeof(off), p)) + *buf = strtoul(off, NULL, 16); + + pclose(p); + } + + return 0; +} + +int wl_get_frequency_offset(const char *ifname, int *buf) +{ + /* Stub */ + *buf = 0; + return -1; +} |