summaryrefslogtreecommitdiffhomepage
path: root/libs/iwinfo/src/iwinfo_wl.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2009-08-26 01:35:42 +0000
committerJo-Philipp Wich <jow@openwrt.org>2009-08-26 01:35:42 +0000
commite66ab6bd2ca3bf51f6951e9b293b7742cd1a86a1 (patch)
tree384997dc672bc641fcb72f669254243043d6513c /libs/iwinfo/src/iwinfo_wl.c
parent3b42dc16889bc10889e9f8cd56e0ab93b105086b (diff)
libs/iwinfo: return bitrate in kilobits to properly handle .5 rates
Diffstat (limited to 'libs/iwinfo/src/iwinfo_wl.c')
-rw-r--r--libs/iwinfo/src/iwinfo_wl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/iwinfo/src/iwinfo_wl.c b/libs/iwinfo/src/iwinfo_wl.c
index 8387b9f4c8..8519dbc561 100644
--- a/libs/iwinfo/src/iwinfo_wl.c
+++ b/libs/iwinfo/src/iwinfo_wl.c
@@ -139,7 +139,7 @@ int wl_get_bitrate(const char *ifname, int *buf)
int rate = 0;
if( !(ret = wl_ioctl(ifname, WLC_GET_RATE, &rate, sizeof(rate))) && (rate > 0))
- *buf = rate / 2;
+ *buf = ((rate / 2) * 1000) + ((rate & 1) ? 500 : 0);
return ret;
}