git: 2c26756366c4 - stable/13 - LinuxKPI: implement _IOC_TYPE and _IOC_NR macros in linux/ioctl.h

From: Vladimir Kondratyev <wulf_at_FreeBSD.org>
Date: Wed, 13 Oct 2021 09:19:09 UTC
The branch stable/13 has been updated by wulf:

URL: https://cgit.FreeBSD.org/src/commit/?id=2c26756366c407354535b00dc0a2cde6f34e991f

commit 2c26756366c407354535b00dc0a2cde6f34e991f
Author:     Vladimir Kondratyev <wulf@FreeBSD.org>
AuthorDate: 2021-09-29 20:12:47 +0000
Commit:     Vladimir Kondratyev <wulf@FreeBSD.org>
CommitDate: 2021-10-13 08:59:25 +0000

    LinuxKPI: implement _IOC_TYPE and _IOC_NR macros in linux/ioctl.h
    
    They are used by drm-kmod
    
    Reviewed by:    emaste, hselasky, manu
    Differential revision:  https://reviews.freebsd.org/D31674
    
    (cherry picked from commit b58c916f115d9d40f91397a1b406891f36c39fad)
---
 sys/compat/linuxkpi/common/include/linux/ioctl.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/ioctl.h b/sys/compat/linuxkpi/common/include/linux/ioctl.h
index fdedf9c4a179..fcdb5c547e73 100644
--- a/sys/compat/linuxkpi/common/include/linux/ioctl.h
+++ b/sys/compat/linuxkpi/common/include/linux/ioctl.h
@@ -33,6 +33,8 @@
 
 #include <sys/ioccom.h>
 
-#define	_IOC_SIZE(cmd) IOCPARM_LEN(cmd)
+#define	_IOC_SIZE(cmd)	IOCPARM_LEN(cmd)
+#define	_IOC_TYPE(cmd)	IOCGROUP(cmd)
+#define	_IOC_NR(cmd)	((cmd) & 0xff)
 
 #endif	/* _LINUX_IOCTL_H_ */