wext: Add very basic status command support
Just to make the test framework happy, it uses the driver status command to obtain the interface MAC address. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
ee3f9f3837
commit
d306df7919
1 changed files with 28 additions and 0 deletions
|
@ -2353,6 +2353,33 @@ static int wpa_driver_wext_signal_poll(void *priv, struct wpa_signal_info *si)
|
|||
}
|
||||
|
||||
|
||||
static int wpa_driver_wext_status(void *priv, char *buf, size_t buflen)
|
||||
{
|
||||
struct wpa_driver_wext_data *drv = priv;
|
||||
int res;
|
||||
char *pos, *end;
|
||||
unsigned char addr[ETH_ALEN];
|
||||
|
||||
pos = buf;
|
||||
end = buf + buflen;
|
||||
|
||||
if (linux_get_ifhwaddr(drv->ioctl_sock, drv->ifname, addr))
|
||||
return -1;
|
||||
|
||||
res = os_snprintf(pos, end - pos,
|
||||
"ifindex=%d\n"
|
||||
"ifname=%s\n"
|
||||
"addr=" MACSTR "\n",
|
||||
drv->ifindex,
|
||||
drv->ifname,
|
||||
MAC2STR(addr));
|
||||
if (res < 0 || res >= end - pos)
|
||||
return pos - buf;
|
||||
pos += res;
|
||||
|
||||
return pos - buf;
|
||||
}
|
||||
|
||||
const struct wpa_driver_ops wpa_driver_wext_ops = {
|
||||
.name = "wext",
|
||||
.desc = "Linux wireless extensions (generic)",
|
||||
|
@ -2373,4 +2400,5 @@ const struct wpa_driver_ops wpa_driver_wext_ops = {
|
|||
.set_operstate = wpa_driver_wext_set_operstate,
|
||||
.get_radio_name = wext_get_radio_name,
|
||||
.signal_poll = wpa_driver_wext_signal_poll,
|
||||
.status = wpa_driver_wext_status,
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue