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 ad3b5ddb1134afdc3e0a87a9c0d857fb6e62bc29..ae7ae531dc3e09c655a50dfc720089b9df557f9c 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 0b007c6aff9ec05c983e0437a1d28f003d82bf67..66c735bb1794c453111efad9a65371ad13307e0f 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 7869b34c7b7b6eee9cff801e2a5be59d5790baf2..17db10b3fa5b1e4d59aad416d2836218479a8f9a 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 57a273c0d435b839d8a0e9040c2a60f1df934c50..15fe72f8aa8aadf6562ab197adf1387703f1573d 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 76062ba0a449f2ecb3da9a9904aef947bc8db52c..859bb1f1dab0976b90b01a00345c97bf47b3c951 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 bd0a66f1e8a65cb7a5cb85a48585964d154733aa..7ff6cfb7d205266656b42d92bfbd01c4b9b61fc6 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 a29cf84ee84b5a7b01514162598b76e1c18922c9..4247353f5bf24f51f895eae6ae9748fc2ca0a10e 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 5df8939943e288058e60b2e99c0dc33818ad2798..8ae79175849aea7813af1a2227d8aa4b79fb04e6 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