FINAL CALL: device driver megapatch in 8-10 hours.
M. Warner Losh
imp at bsdimp.com
Sat Feb 21 11:41:55 PST 2004
In message: <32558.1077361668 at critter.freebsd.dk>
Poul-Henning Kamp <phk at phk.freebsd.dk> 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 <dev/firewire/fwmem.h>
#include <dev/firewire/iec68113.h>
-#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
More information about the freebsd-current
mailing list