Fix some errors in IOCTL decoding macros

This commit is contained in:
Gregory Nutt
2017-08-02 14:28:17 -06:00
parent 1ae9748170
commit 0579825b69
3 changed files with 9 additions and 6 deletions
+2 -2
View File
@@ -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))
+6 -4
View File
@@ -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 !!! */
+1
View File
@@ -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;
}