libs/iwinfo: return bitrate in kilobits to properly handle .5 rates
[project/luci.git] / libs / iwinfo / src / iwinfo_wl.c
index 2c3126a..8519dbc 100644 (file)
@@ -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;
 }
@@ -384,6 +384,11 @@ int wl_get_txpwrlist(const char *ifname, char *buf, int *len)
        return 0;
 }
 
+int wl_get_scanlist(const char *ifname, char *buf, int *len)
+{
+       return wext_get_scanlist(ifname, buf, len);
+}
+
 int wl_get_mbssid_support(const char *ifname, int *buf)
 {
        wlc_rev_info_t revinfo;