Date: Fri, 18 Aug 2000 14:26:50 +0900 From: FUJITA Kazutoshi <fujita@soum.co.jp> To: freebsd-hackers@freebsd.org Subject: 'group' in ioctl() Message-ID: <20000818142650A.fujita@soum.co.jp>
next in thread | raw e-mail | index | archive | help
Hi, hackers. I have been given the task of writing a PCI device driver for a special card on 4.0-RELEASE. But I'm novice in device driver programming. In writing ioctl routine, I have to decide ioctl command code. So I saw some other device driver source code and system header files, I found some macros in <sys/ioccom.h>. #define _IOC(inout,group,num,len) \ ((unsigned long)(inout | ((len & IOCPARM_MASK) << 16) | ((group) << 8) | (num))) #define _IO(g,n) _IOC(IOC_VOID, (g), (n), 0) #define _IOR(g,n,t) _IOC(IOC_OUT, (g), (n), sizeof(t)) #define _IOW(g,n,t) _IOC(IOC_IN, (g), (n), sizeof(t)) /* this should be _IORW, but stdio got there first */ #define _IOWR(g,n,t) _IOC(IOC_INOUT, (g), (n), sizeof(t)) What 'group' should I use ? Regards, To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000818142650A.fujita>