mirror of
https://github.com/apache/nuttx.git
synced 2026-05-22 05:42:05 +08:00
Fix some errors in IOCTL decoding macros
This commit is contained in:
@@ -98,8 +98,8 @@
|
||||
/* Macros used to manage ioctl commands */
|
||||
|
||||
#define _IOC_MASK (0x00ff)
|
||||
#define _IOC_TYPE(cmd) ((cmd)&~_IOC_MASK)
|
||||
#define _IOC_NR(cmd) ((cmd)&_IOC_MASK)
|
||||
#define _IOC_TYPE(cmd) ((cmd) & ~_IOC_MASK)
|
||||
#define _IOC_NR(cmd) ((cmd) & _IOC_MASK)
|
||||
|
||||
#define _IOC(type,nr) ((type)|(nr))
|
||||
|
||||
|
||||
@@ -166,15 +166,17 @@
|
||||
|
||||
#define WL_802154FIRST (WL_NETFIRST + WL_NNETCMDS)
|
||||
#define WL_N802154CMDS (3)
|
||||
#define WL_ISPKTRADIOCMD(cmd) ((cmd) >= WL_802154FIRST && \
|
||||
(cmd) < (WL_802154FIRST + WL_N802154CMDS))
|
||||
#define WL_IS802154CMD(cmd) (_WLIOCVALID(cmd) && \
|
||||
_IOC_NR(cmd) >= WL_802154FIRST && \
|
||||
_IOC_NR(cmd) < (WL_802154FIRST + WL_N802154CMDS))
|
||||
|
||||
/* Reserved for network packet radio network devices */
|
||||
|
||||
#define WL_PKTRADIOFIRST (WL_802154FIRST + WL_N802154CMDS)
|
||||
#define WL_NPKTRADIOCMDS (3)
|
||||
#define WL_ISPKTRADIOCMD(cmd) ((cmd) >= WL_PKTRADIOFIRST && \
|
||||
(cmd) < (WL_PKTRADIOFIRST + WL_NPKTRADIOCMDS))
|
||||
#define WL_ISPKTRADIOCMD(cmd) (_WLIOCVALID(cmd) && \
|
||||
_IOC_NR(cmd) >= WL_PKTRADIOFIRST && \
|
||||
_IOC_NR(cmd) < (WL_PKTRADIOFIRST + WL_NPKTRADIOCMDS))
|
||||
|
||||
/* ------------------------------- WIRELESS EVENTS ------------------------------- */
|
||||
/* Those are *NOT* ioctls, do not issue request on them !!! */
|
||||
|
||||
@@ -440,6 +440,7 @@ static int netdev_pktradio_ioctl(FAR struct socket *psock, int cmd,
|
||||
{
|
||||
/* Not a packet radio IOCTL command */
|
||||
|
||||
nwarn("WARNING: Not a packet radio IOCTL command: %d\n", cmd);
|
||||
return -ENOTTY;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user