libs/iwinfo: implement *_get_mbssid_support() check
authorJo-Philipp Wich <jow@openwrt.org>
Tue, 11 Aug 2009 13:56:16 +0000 (13:56 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Tue, 11 Aug 2009 13:56:16 +0000 (13:56 +0000)
libs/iwinfo/src/include/broadcom.h
libs/iwinfo/src/iwinfo_lualib.c
libs/iwinfo/src/iwinfo_madwifi.c
libs/iwinfo/src/iwinfo_madwifi.h
libs/iwinfo/src/iwinfo_wext.c
libs/iwinfo/src/iwinfo_wext.h
libs/iwinfo/src/iwinfo_wl.c
libs/iwinfo/src/iwinfo_wl.h

index ad3b5dd..ae7ae53 100644 (file)
@@ -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
index 0b007c6..66c735b 100644 (file)
@@ -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 }
 };
 
index 7869b34..17db10b 100644 (file)
@@ -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;
+}
 
index 57a273c..15fe72f 100644 (file)
@@ -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
index 76062ba..859bb1f 100644 (file)
@@ -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;
+}
+
index bd0a66f..7ff6cfb 100644 (file)
@@ -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
index a29cf84..4247353 100644 (file)
@@ -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;
+}
+
index 5df8939..8ae7917 100644 (file)
@@ -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