summaryrefslogtreecommitdiff
path: root/package/iwinfo/src/iwinfo_wext.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_wext.c
parentb1af9a779fda99262632d69c085aea16e17ac809 (diff)
downloadmtk-20170518-76bb0f3309862e021d454783a957306b63613a9a.zip
mtk-20170518-76bb0f3309862e021d454783a957306b63613a9a.tar.gz
mtk-20170518-76bb0f3309862e021d454783a957306b63613a9a.tar.bz2
iwinfo: replace internal constant mode strings with enums
SVN-Revision: 30692
Diffstat (limited to 'package/iwinfo/src/iwinfo_wext.c')
-rw-r--r--package/iwinfo/src/iwinfo_wext.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/package/iwinfo/src/iwinfo_wext.c b/package/iwinfo/src/iwinfo_wext.c
index c74785f..cf3dccc 100644
--- a/package/iwinfo/src/iwinfo_wext.c
+++ b/package/iwinfo/src/iwinfo_wext.c
@@ -70,7 +70,7 @@ void wext_close(void)
/* Nop */
}
-int wext_get_mode(const char *ifname, char *buf)
+int wext_get_mode(const char *ifname, int *buf)
{
struct iwreq wrq;
@@ -78,36 +78,25 @@ int wext_get_mode(const char *ifname, char *buf)
{
switch(wrq.u.mode)
{
- case 0:
- sprintf(buf, "Auto");
- break;
-
case 1:
- sprintf(buf, "Ad-Hoc");
+ *buf = IWINFO_OPMODE_ADHOC;
break;
case 2:
- sprintf(buf, "Client");
+ *buf = IWINFO_OPMODE_CLIENT;
break;
case 3:
- sprintf(buf, "Master");
- break;
-
- case 4:
- sprintf(buf, "Repeater");
- break;
-
- case 5:
- sprintf(buf, "Secondary");
+ *buf = IWINFO_OPMODE_MASTER;
break;
case 6:
- sprintf(buf, "Monitor");
+ *buf = IWINFO_OPMODE_MONITOR;
break;
default:
- sprintf(buf, "Unknown");
+ *buf = IWINFO_OPMODE_UNKNOWN;
+ break;
}
return 0;