libs/iwinfo: implement *_get_mbssid_support() check
This commit is contained in:
parent
9d1cfdd359
commit
444e39b093
8 changed files with 55 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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 }
|
||||
};
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue