From owner-freebsd-current@FreeBSD.ORG Sat Feb 21 11:41:54 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EED4816A4CE for ; Sat, 21 Feb 2004 11:41:54 -0800 (PST) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 45AC943D1D for ; Sat, 21 Feb 2004 11:41:54 -0800 (PST) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.10/8.12.9) with ESMTP id i1LJeskj001477; Sat, 21 Feb 2004 12:40:54 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sat, 21 Feb 2004 12:40:38 -0700 (MST) Message-Id: <20040221.124038.72236093.imp@bsdimp.com> To: phk@phk.freebsd.dk From: "M. Warner Losh" In-Reply-To: <32558.1077361668@critter.freebsd.dk> References: <32558.1077361668@critter.freebsd.dk> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: current@freebsd.org Subject: Re: FINAL CALL: device driver megapatch in 8-10 hours. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2004 19:41:55 -0000 In message: <32558.1077361668@critter.freebsd.dk> Poul-Henning Kamp writes: : http://phk.freebsd.dk/patch/sysN.patch : : Now would be a really good time to look at it... Index: dev/cx/if_cx.c =================================================================== RCS file: /home/ncvs/src/sys/dev/cx/if_cx.c,v retrieving revision 1.3 diff -u -r1.3 if_cx.c --- dev/cx/if_cx.c 14 Feb 2004 21:00:23 -0000 1.3 +++ dev/cx/if_cx.c 15 Feb 2004 19:04:52 -0000 @@ -2514,6 +2514,7 @@ #if __FreeBSD_version < 400000 struct isa_driver cxdriver = { cx_probe, cx_attach, "cx" }; static struct cdevsw cx_cdevsw = { + .d_version = D_VERSION, cx_open, cx_close, cx_read, cx_write, cx_ioctl, cx_stop, noreset, cx_devtotty, ttpoll, nommap, NULL, "cx", @@ -2521,6 +2522,7 @@ }; #elif __FreeBSD_version < 500000 static struct cdevsw cx_cdevsw = { + .d_version = D_VERSION, cx_open, cx_close, cx_read, cx_write, cx_ioctl, ttypoll, nommap, nostrategy, "cx", CDEV_MAJOR, nodump, nopsize, @@ -2528,6 +2530,7 @@ }; #elif __FreeBSD_version == 500000 static struct cdevsw cx_cdevsw = { + .d_version = D_VERSION, cx_open, cx_close, cx_read, cx_write, cx_ioctl, ttypoll, nommap, nostrategy, "cx", CDEV_MAJOR, nodump, nopsize, @@ -2535,6 +2538,7 @@ }; #elif __FreeBSD_version <= 501000 static struct cdevsw cx_cdevsw = { + .d_version = D_VERSION, .d_open = cx_open, .d_close = cx_close, .d_read = cx_read, @@ -2550,15 +2554,15 @@ }; #else /* __FreeBSD_version > 501000 */ static struct cdevsw cx_cdevsw = { + .d_version = D_VERSION, .d_open = cx_open, .d_close = cx_close, .d_read = cx_read, .d_write = cx_write, .d_ioctl = cx_ioctl, - .d_poll = ttypoll, .d_name = "cx", .d_maj = CDEV_MAJOR, - .d_flags = D_TTY, + .d_flags = D_TTY | D_NEEDGIANT, }; #endif The first three are likely wrong. if_cx is maintained outside the tree for the most part, so it supports more versions than we normally have in the tree. Index: dev/firewire/fwdev.c =================================================================== RCS file: /home/ncvs/src/sys/dev/firewire/fwdev.c,v retrieving revision 1.36 diff -u -r1.36 fwdev.c --- dev/firewire/fwdev.c 22 Jan 2004 14:41:17 -0000 1.36 +++ dev/firewire/fwdev.c 15 Feb 2004 19:04:52 -0000 @@ -62,7 +62,6 @@ #include #include -#define CDEV_MAJOR 127 #define FWNODE_INVAL 0xffff static d_open_t fw_open; @@ -74,8 +73,8 @@ static d_mmap_t fw_mmap; static d_strategy_t fw_strategy; -struct cdevsw firewire_cdevsw = -{ +struct cdevsw firewire_cdevsw = { + .d_version = D_VERSION, #if __FreeBSD_version >= 500104 .d_open = fw_open, .d_close = fw_close, @@ -86,8 +85,7 @@ .d_mmap = fw_mmap, .d_strategy = fw_strategy, .d_name = "fw", - .d_maj = CDEV_MAJOR, - .d_flags = D_MEM + .d_flags = D_MEM | D_NEEDGIANT #else This also gets the .d_version wrong for the versions of FreeBSD this driver supports. Index: dev/usb/ulpt.c =================================================================== RCS file: /home/ncvs/src/sys/dev/usb/ulpt.c,v retrieving revision 1.59 diff -u -r1.59 ulpt.c --- dev/usb/ulpt.c 28 Sep 2003 20:48:13 -0000 1.59 +++ dev/usb/ulpt.c 15 Feb 2004 19:04:55 -0000 @@ -134,6 +134,7 @@ dev_type_ioctl(ulptioctl); const struct cdevsw ulpt_cdevsw = { + .d_version = D_VERSION, ulptopen, ulptclose, noread, ulptwrite, ulptioctl, nostop, notty, nopoll, nommap, nokqfilter, }; @@ -145,15 +146,15 @@ Static d_write_t ulptwrite; Static d_ioctl_t ulptioctl; -#define ULPT_CDEV_MAJOR 113 Static struct cdevsw ulpt_cdevsw = { + .d_version = D_VERSION, + .d_flags = D_NEEDGIANT, .d_open = ulptopen, .d_close = ulptclose, .d_write = ulptwrite, .d_ioctl = ulptioctl, .d_name = "ulpt", - .d_maj = ULPT_CDEV_MAJOR, #if __FreeBSD_version < 500014 .d_bmaj -1 #endif Again with the bogus version in the first hunk of this. otherwise things look good. Warner