aboutsummaryrefslogtreecommitdiffstats
path: root/package/iwinfo/src/iwinfo_cli.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-02-23 13:16:09 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-02-23 13:16:09 +0000
commit76bb0f3309862e021d454783a957306b63613a9a (patch)
treec23c154a552ba0fd7f2e2d2a2eff3ea72dc7708d /package/iwinfo/src/iwinfo_cli.c
parentb1af9a779fda99262632d69c085aea16e17ac809 (diff)
downloadupstream-76bb0f3309862e021d454783a957306b63613a9a.tar.gz
upstream-76bb0f3309862e021d454783a957306b63613a9a.tar.bz2
upstream-76bb0f3309862e021d454783a957306b63613a9a.zip
iwinfo: replace internal constant mode strings with enums
SVN-Revision: 30692
Diffstat (limited to 'package/iwinfo/src/iwinfo_cli.c')
-rw-r--r--package/iwinfo/src/iwinfo_cli.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/package/iwinfo/src/iwinfo_cli.c b/package/iwinfo/src/iwinfo_cli.c
index 186cce1433..0fdb21ec67 100644
--- a/package/iwinfo/src/iwinfo_cli.c
+++ b/package/iwinfo/src/iwinfo_cli.c
@@ -391,10 +391,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 +575,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),