From owner-freebsd-hackers Thu Aug 17 22:27: 1 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from gate.soum.co.jp (gate.soum.co.jp [202.221.40.2]) by hub.freebsd.org (Postfix) with ESMTP id 6380C37B423 for ; Thu, 17 Aug 2000 22:26:57 -0700 (PDT) Received: from force.soum.co.jp (force.soum.co.jp [192.168.2.1]) by gate.soum.co.jp (8.8.8/3.6W98062220) with ESMTP id OAA11003 for ; Fri, 18 Aug 2000 14:26:52 +0900 (JST) Received: from vanilla.soum.co.jp (vanilla.soum.co.jp [192.168.2.63]) by force.soum.co.jp (8.9.3/3.7W-2000050209) with ESMTP id OAA21059; Fri, 18 Aug 2000 14:26:51 +0900 (JST) Received: from localhost (localhost.soum.co.jp [127.0.0.1]) by vanilla.soum.co.jp (8.9.3/3.7Wpl2-200003222344) with ESMTP id OAA16962; Fri, 18 Aug 2000 14:26:50 +0900 (JST) (envelope-from fujita@soum.co.jp) To: freebsd-hackers@freebsd.org Subject: 'group' in ioctl() From: FUJITA Kazutoshi X-Mailer: Mew version 1.94.1 on Emacs 20.7 / Mule 4.0 =?iso-2022-jp?B?KBskQjJWMWMbKEIp?= Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20000818142650A.fujita@soum.co.jp> Date: Fri, 18 Aug 2000 14:26:50 +0900 X-Dispatcher: imput version 20000228(IM140) Lines: 22 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 . #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