mirror of
https://github.com/apache/nuttx.git
synced 2026-05-29 20:56:47 +08:00
ioctl: add SIOCGIWNAME support
some tools use this command to distinguish which device returned via getifaddrs() are wireless network device. Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
@@ -625,7 +625,20 @@ static int netdev_wifr_ioctl(FAR struct socket *psock, int cmd,
|
|||||||
/* Get the wireless device associated with the IOCTL command */
|
/* Get the wireless device associated with the IOCTL command */
|
||||||
|
|
||||||
dev = netdev_findbyname(req->ifr_name);
|
dev = netdev_findbyname(req->ifr_name);
|
||||||
if (dev != NULL)
|
if (cmd == SIOCGIWNAME)
|
||||||
|
{
|
||||||
|
if (dev == NULL)
|
||||||
|
{
|
||||||
|
ret = -ENODEV;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
strcpy((FAR char *)&req->u, "IEEE 802.11");
|
||||||
|
ret = OK;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dev != NULL && ret == -ENOTTY)
|
||||||
{
|
{
|
||||||
/* Just forward the IOCTL to the wireless driver */
|
/* Just forward the IOCTL to the wireless driver */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user