summaryrefslogtreecommitdiffhomepage
path: root/libs/iwinfo
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2009-08-11 13:56:16 +0000
committerJo-Philipp Wich <jow@openwrt.org>2009-08-11 13:56:16 +0000
commit444e39b0936f26ddfed35b13d095de2c41ec611a (patch)
tree24523fc65e952b37eef29949f177c87b1a83e54a /libs/iwinfo
parent9d1cfdd35993fae618cdfe3b7a8d88b362d74cdd (diff)
libs/iwinfo: implement *_get_mbssid_support() check
Diffstat (limited to 'libs/iwinfo')
-rw-r--r--libs/iwinfo/src/include/broadcom.h17
-rw-r--r--libs/iwinfo/src/iwinfo_lualib.c6
-rw-r--r--libs/iwinfo/src/iwinfo_madwifi.c6
-rw-r--r--libs/iwinfo/src/iwinfo_madwifi.h1
-rw-r--r--libs/iwinfo/src/iwinfo_wext.c6
-rw-r--r--libs/iwinfo/src/iwinfo_wext.h1
-rw-r--r--libs/iwinfo/src/iwinfo_wl.c17
-rw-r--r--libs/iwinfo/src/iwinfo_wl.h1
8 files changed, 55 insertions, 0 deletions
diff --git a/libs/iwinfo/src/include/broadcom.h b/libs/iwinfo/src/include/broadcom.h
index ad3b5ddb1..ae7ae531d 100644
--- a/libs/iwinfo/src/include/broadcom.h
+++ b/libs/iwinfo/src/include/broadcom.h
@@ -33,6 +33,7 @@
#define WLC_GET_SSID 25
#define WLC_GET_CHANNEL 29
#define WLC_GET_PASSIVE 48
+#define WLC_GET_REVINFO 98
#define WLC_GET_AP 117
#define WLC_GET_RSSI 127
#define WLC_GET_WSEC 133
@@ -73,4 +74,20 @@ typedef struct wl_ioctl {
uint32_t needed; /* bytes needed (optional) */
} wl_ioctl_t;
+/* Revision info */
+typedef struct wlc_rev_info {
+ uint vendorid; /* PCI vendor id */
+ uint deviceid; /* device id of chip */
+ uint radiorev; /* radio revision */
+ uint chiprev; /* chip revision */
+ uint corerev; /* core revision */
+ uint boardid; /* board identifier (usu. PCI sub-device id) */
+ uint boardvendor; /* board vendor (usu. PCI sub-vendor id) */
+ uint boardrev; /* board revision */
+ uint driverrev; /* driver version */
+ uint ucoderev; /* microcode version */
+ uint bus; /* bus type */
+ uint chipnum; /* chip number */
+} wlc_rev_info_t;
+
#endif
diff --git a/libs/iwinfo/src/iwinfo_lualib.c b/libs/iwinfo/src/iwinfo_lualib.c
index 0b007c6af..66c735bb1 100644
--- a/libs/iwinfo/src/iwinfo_lualib.c
+++ b/libs/iwinfo/src/iwinfo_lualib.c
@@ -83,6 +83,7 @@ LUA_WRAP_INT(wl,signal)
LUA_WRAP_INT(wl,noise)
LUA_WRAP_INT(wl,quality)
LUA_WRAP_INT(wl,quality_max)
+LUA_WRAP_INT(wl,mbssid_support)
LUA_WRAP_STRING(wl,mode)
LUA_WRAP_STRING(wl,ssid)
LUA_WRAP_STRING(wl,bssid)
@@ -97,6 +98,7 @@ LUA_WRAP_INT(madwifi,signal)
LUA_WRAP_INT(madwifi,noise)
LUA_WRAP_INT(madwifi,quality)
LUA_WRAP_INT(madwifi,quality_max)
+LUA_WRAP_INT(madwifi,mbssid_support)
LUA_WRAP_STRING(madwifi,mode)
LUA_WRAP_STRING(madwifi,ssid)
LUA_WRAP_STRING(madwifi,bssid)
@@ -111,6 +113,7 @@ LUA_WRAP_INT(wext,signal)
LUA_WRAP_INT(wext,noise)
LUA_WRAP_INT(wext,quality)
LUA_WRAP_INT(wext,quality_max)
+LUA_WRAP_INT(wext,mbssid_support)
LUA_WRAP_STRING(wext,mode)
LUA_WRAP_STRING(wext,ssid)
LUA_WRAP_STRING(wext,bssid)
@@ -131,6 +134,7 @@ static const luaL_reg R_wl[] = {
LUA_REG(wl,bssid),
LUA_REG(wl,enctype),
LUA_REG(wl,assoclist),
+ LUA_REG(wl,mbssid_support),
{ NULL, NULL }
};
@@ -148,6 +152,7 @@ static const luaL_reg R_madwifi[] = {
LUA_REG(madwifi,bssid),
LUA_REG(madwifi,enctype),
LUA_REG(madwifi,assoclist),
+ LUA_REG(madwifi,mbssid_support),
{ NULL, NULL }
};
@@ -165,6 +170,7 @@ static const luaL_reg R_wext[] = {
LUA_REG(wext,bssid),
LUA_REG(wext,enctype),
LUA_REG(wext,assoclist),
+ LUA_REG(wext,mbssid_support),
{ NULL, NULL }
};
diff --git a/libs/iwinfo/src/iwinfo_madwifi.c b/libs/iwinfo/src/iwinfo_madwifi.c
index 7869b34c7..17db10b3f 100644
--- a/libs/iwinfo/src/iwinfo_madwifi.c
+++ b/libs/iwinfo/src/iwinfo_madwifi.c
@@ -398,4 +398,10 @@ int madwifi_get_assoclist(const char *ifname, char *buf, int *len)
return -1;
}
+int madwifi_get_mbssid_support(const char *ifname, int *buf)
+{
+ /* We assume that multi bssid is always possible */
+ *buf = 1;
+ return 0;
+}
diff --git a/libs/iwinfo/src/iwinfo_madwifi.h b/libs/iwinfo/src/iwinfo_madwifi.h
index 57a273c0d..15fe72f8a 100644
--- a/libs/iwinfo/src/iwinfo_madwifi.h
+++ b/libs/iwinfo/src/iwinfo_madwifi.h
@@ -35,5 +35,6 @@ int madwifi_get_quality(const char *ifname, int *buf);
int madwifi_get_quality_max(const char *ifname, int *buf);
int madwifi_get_enctype(const char *ifname, char *buf);
int madwifi_get_assoclist(const char *ifname, char *buf, int *len);
+int madwifi_get_mbssid_support(const char *ifname, int *buf);
#endif
diff --git a/libs/iwinfo/src/iwinfo_wext.c b/libs/iwinfo/src/iwinfo_wext.c
index 76062ba0a..859bb1f1d 100644
--- a/libs/iwinfo/src/iwinfo_wext.c
+++ b/libs/iwinfo/src/iwinfo_wext.c
@@ -297,3 +297,9 @@ int wext_get_assoclist(const char *ifname, char *buf, int *len)
return -1;
}
+int wext_get_mbssid_support(const char *ifname, int *buf)
+{
+ /* No multi bssid support atm */
+ return -1;
+}
+
diff --git a/libs/iwinfo/src/iwinfo_wext.h b/libs/iwinfo/src/iwinfo_wext.h
index bd0a66f1e..7ff6cfb7d 100644
--- a/libs/iwinfo/src/iwinfo_wext.h
+++ b/libs/iwinfo/src/iwinfo_wext.h
@@ -35,5 +35,6 @@ int wext_get_quality(const char *ifname, int *buf);
int wext_get_quality_max(const char *ifname, int *buf);
int wext_get_enctype(const char *ifname, char *buf);
int wext_get_assoclist(const char *ifname, char *buf, int *len);
+int wext_get_mbssid_support(const char *ifname, int *buf);
#endif
diff --git a/libs/iwinfo/src/iwinfo_wl.c b/libs/iwinfo/src/iwinfo_wl.c
index a29cf84ee..4247353f5 100644
--- a/libs/iwinfo/src/iwinfo_wl.c
+++ b/libs/iwinfo/src/iwinfo_wl.c
@@ -366,3 +366,20 @@ int wl_get_assoclist(const char *ifname, char *buf, int *len)
return -1;
}
+int wl_get_mbssid_support(const char *ifname, int *buf)
+{
+ wlc_rev_info_t revinfo;
+
+ /* Multi bssid support only works on corerev >= 9 */
+ if( !wl_ioctl(ifname, WLC_GET_REVINFO, &revinfo, sizeof(revinfo)) )
+ {
+ if( revinfo.corerev >= 9 )
+ {
+ *buf = 1;
+ return 0;
+ }
+ }
+
+ return -1;
+}
+
diff --git a/libs/iwinfo/src/iwinfo_wl.h b/libs/iwinfo/src/iwinfo_wl.h
index 5df893994..8ae791758 100644
--- a/libs/iwinfo/src/iwinfo_wl.h
+++ b/libs/iwinfo/src/iwinfo_wl.h
@@ -35,5 +35,6 @@ int wl_get_quality(const char *ifname, int *buf);
int wl_get_quality_max(const char *ifname, int *buf);
int wl_get_enctype(const char *ifname, char *buf);
int wl_get_assoclist(const char *ifname, char *buf, int *len);
+int wl_get_mbssid_support(const char *ifname, int *buf);
#endif