summaryrefslogtreecommitdiffhomepage
path: root/libs/iwinfo/src/iwinfo_madwifi.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2009-08-09 14:24:43 +0000
committerJo-Philipp Wich <jow@openwrt.org>2009-08-09 14:24:43 +0000
commit2a9a87e89172c147c1dc222f67221f825755e9aa (patch)
treedd26bfe841ea6ff2d0a78d8e8e080fae4f277cc5 /libs/iwinfo/src/iwinfo_madwifi.c
parent398c125336f035a9a5a23b476f597b2e22fb672a (diff)
libs/iwinfo: implement *_get_frequency() - operating freq in mhz
Diffstat (limited to 'libs/iwinfo/src/iwinfo_madwifi.c')
-rw-r--r--libs/iwinfo/src/iwinfo_madwifi.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/iwinfo/src/iwinfo_madwifi.c b/libs/iwinfo/src/iwinfo_madwifi.c
index 85b5857c7c..7869b34c7b 100644
--- a/libs/iwinfo/src/iwinfo_madwifi.c
+++ b/libs/iwinfo/src/iwinfo_madwifi.c
@@ -127,6 +127,19 @@ int madwifi_get_channel(const char *ifname, int *buf)
return -1;
}
+int madwifi_get_frequency(const char *ifname, int *buf)
+{
+ struct iwreq wrq;
+
+ if( madwifi_ioctl(&wrq, ifname, SIOCGIWFREQ, NULL, 0) >= 0 )
+ {
+ *buf = (uint16_t)(wrq.u.freq.m / 100000);
+ return 0;
+ }
+
+ return -1;
+}
+
int madwifi_get_bitrate(const char *ifname, int *buf)
{
unsigned int mode, len, rate, rate_count;