bcm63xx: add initial support for bcm6368 boards
[openwrt.git] / package / iwinfo / src / iwinfo_cli.c
index 186cce1..7ec5aef 100644 (file)
@@ -134,7 +134,8 @@ static char * format_rate(int rate)
        if (rate <= 0)
                snprintf(buf, sizeof(buf), "unknown");
        else
-               snprintf(buf, sizeof(buf), "%.1f MBit/s", ((float)rate / 1000.0));
+               snprintf(buf, sizeof(buf), "%d.%d MBit/s",
+                       rate / 1000, (rate % 1000) / 100);
 
        return buf;
 }
@@ -391,10 +392,13 @@ static char * print_bssid(const struct iwinfo_ops *iw, const char *ifname)
 
 static char * print_mode(const struct iwinfo_ops *iw, const char *ifname)
 {
+       int mode;
        static char buf[128];
 
-       if (iw->mode(ifname, buf))
-               snprintf(buf, sizeof(buf), "unknown");
+       if (iw->mode(ifname, &mode))
+               mode = IWINFO_OPMODE_UNKNOWN;
+
+       snprintf(buf, sizeof(buf), "%s", IWINFO_OPMODE_NAMES[mode]);
 
        return buf;
 }
@@ -572,7 +576,7 @@ static void print_scanlist(const struct iwinfo_ops *iw, const char *ifname)
                printf("          ESSID: %s\n",
                        format_ssid(e->ssid));
                printf("          Mode: %s  Channel: %s\n",
-                       e->mode ? (char *)e->mode : "unknown",
+                       IWINFO_OPMODE_NAMES[e->mode],
                        format_channel(e->channel));
                printf("          Signal: %s  Quality: %s/%s\n",
                        format_signal(e->signal - 0x100),
This page took 0.022513 seconds and 4 git commands to generate.