Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions net/netdev/netdev_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,11 +394,11 @@ static int netdev_bluetooth_ioctl(FAR struct socket *psock, int cmd,
{
FAR struct net_driver_s *dev;
FAR char *ifname;
int ret = -EINVAL;
int ret = -ENOTTY;

if (arg != 0ul)
if (_BLUETOOTHIOCVALID(cmd))
{
if (_BLUETOOTHIOCVALID(cmd))
if (arg != 0ul)
{
/* Get the name of the Bluetooth device to receive the IOCTL
* command
Expand All @@ -411,9 +411,9 @@ static int netdev_bluetooth_ioctl(FAR struct socket *psock, int cmd,
}
else
{
/* Not a Bluetooth IOCTL command */
/* Argument is invalid */

return -ENOTTY;
return -EINVAL;
}

/* Find the device with this name */
Expand Down Expand Up @@ -459,9 +459,9 @@ static int netdev_iee802154_ioctl(FAR struct socket *psock, int cmd,
FAR char *ifname;
int ret = -ENOTTY;

if (arg != 0ul)
if (_MAC802154IOCVALID(cmd))
{
if (_MAC802154IOCVALID(cmd))
if (arg != 0ul)
{
/* Get the IEEE802.15.4 MAC device to receive the radio IOCTL
* command
Expand All @@ -474,9 +474,9 @@ static int netdev_iee802154_ioctl(FAR struct socket *psock, int cmd,
}
else
{
/* Not an EEE802.15.4 MAC IOCTL command */
/* Argument is invalid */

return -ENOTTY;
return -EINVAL;
}

/* Find the device with this name */
Expand Down Expand Up @@ -520,9 +520,9 @@ static int netdev_pktradio_ioctl(FAR struct socket *psock, int cmd,
FAR char *ifname;
int ret = -ENOTTY;

if (arg != 0ul)
if (_PKRADIOIOCVALID(cmd))
{
if (_PKRADIOIOCVALID(cmd))
if (arg != 0ul)
{
/* Get the packet radio device to receive the radio IOCTL
* command
Expand All @@ -535,10 +535,9 @@ static int netdev_pktradio_ioctl(FAR struct socket *psock, int cmd,
}
else
{
/* Not a packet radio IOCTL command */
/* Argument is invalid */

nwarn("WARNING: Not a packet radio IOCTL command: %d\n", cmd);
return -ENOTTY;
return -EINVAL;
}

/* Find the device with this name */
Expand Down
Loading