## Automatically generated incremental diff ## From: linux-2.5.68-bk5 ## To: linux-2.5.68-bk6 ## Robot: $Id: make-incremental-diff,v 1.11 2002/02/20 02:59:33 hpa Exp $ diff -urN linux-2.5.68-bk5/Makefile linux-2.5.68-bk6/Makefile --- linux-2.5.68-bk5/Makefile 2003-04-25 04:34:06.000000000 -0700 +++ linux-2.5.68-bk6/Makefile 2003-04-25 04:34:13.000000000 -0700 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 5 SUBLEVEL = 68 -EXTRAVERSION = -bk5 +EXTRAVERSION = -bk6 # *DOCUMENTATION* # To see a list of typical targets execute "make help" diff -urN linux-2.5.68-bk5/arch/alpha/kernel/srmcons.c linux-2.5.68-bk6/arch/alpha/kernel/srmcons.c --- linux-2.5.68-bk5/arch/alpha/kernel/srmcons.c 2003-04-19 19:50:48.000000000 -0700 +++ linux-2.5.68-bk6/arch/alpha/kernel/srmcons.c 2003-04-25 04:34:13.000000000 -0700 @@ -318,11 +318,11 @@ spin_unlock_irqrestore(&srmcons_callback_lock, flags); } -static kdev_t -srm_console_device(struct console *co) +static struct tty_driver * +srm_console_device(struct console *co, int *index) { - return mk_kdev(srmcons_driver.major, - srmcons_driver.minor_start + co->index); + *index = co->index; + return &srmcons_driver; } static int __init diff -urN linux-2.5.68-bk5/arch/i386/Kconfig linux-2.5.68-bk6/arch/i386/Kconfig --- linux-2.5.68-bk5/arch/i386/Kconfig 2003-04-25 04:34:06.000000000 -0700 +++ linux-2.5.68-bk6/arch/i386/Kconfig 2003-04-25 04:34:13.000000000 -0700 @@ -345,7 +345,7 @@ config X86_INTEL_USERCOPY bool - depends on MPENTIUM4 || MPENTIUMIII || MPENTIUMII || M586MMX + depends on MPENTIUM4 || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK7 default y config X86_USE_PPRO_CHECKSUM diff -urN linux-2.5.68-bk5/arch/i386/kernel/cpu/mcheck/k7.c linux-2.5.68-bk6/arch/i386/kernel/cpu/mcheck/k7.c --- linux-2.5.68-bk5/arch/i386/kernel/cpu/mcheck/k7.c 2003-04-19 19:49:57.000000000 -0700 +++ linux-2.5.68-bk6/arch/i386/kernel/cpu/mcheck/k7.c 2003-04-25 04:34:13.000000000 -0700 @@ -82,9 +82,6 @@ nr_mce_banks = l & 0xff; for (i=0; iindex); + extern struct tty_driver hp_serial_driver; + *index = c->index; + return &hp_serial_driver; } diff -urN linux-2.5.68-bk5/arch/ia64/hp/sim/simserial.c linux-2.5.68-bk6/arch/ia64/hp/sim/simserial.c --- linux-2.5.68-bk5/arch/ia64/hp/sim/simserial.c 2003-04-25 04:34:06.000000000 -0700 +++ linux-2.5.68-bk6/arch/ia64/hp/sim/simserial.c 2003-04-25 04:34:13.000000000 -0700 @@ -103,7 +103,7 @@ { 0, 0} }; -static struct tty_driver serial_driver, callout_driver; +static struct tty_driver hp_serial_driver, callout_driver; static int serial_refcount; static struct async_struct *IRQ_ports[NR_IRQS]; @@ -1028,43 +1028,43 @@ /* Initialize the tty_driver structure */ - memset(&serial_driver, 0, sizeof(struct tty_driver)); - serial_driver.magic = TTY_DRIVER_MAGIC; - serial_driver.driver_name = "simserial"; - serial_driver.name = "ttyS"; - serial_driver.major = TTY_MAJOR; - serial_driver.minor_start = 64; - serial_driver.num = 1; - serial_driver.type = TTY_DRIVER_TYPE_SERIAL; - serial_driver.subtype = SERIAL_TYPE_NORMAL; - serial_driver.init_termios = tty_std_termios; - serial_driver.init_termios.c_cflag = + memset(&hp_serial_driver, 0, sizeof(struct tty_driver)); + hp_serial_driver.magic = TTY_DRIVER_MAGIC; + hp_serial_driver.driver_name = "simserial"; + hp_serial_driver.name = "ttyS"; + hp_serial_driver.major = TTY_MAJOR; + hp_serial_driver.minor_start = 64; + hp_serial_driver.num = 1; + hp_serial_driver.type = TTY_DRIVER_TYPE_SERIAL; + hp_serial_driver.subtype = SERIAL_TYPE_NORMAL; + hp_serial_driver.init_termios = tty_std_termios; + hp_serial_driver.init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL; - serial_driver.flags = TTY_DRIVER_REAL_RAW; - serial_driver.refcount = &serial_refcount; - serial_driver.table = serial_table; - serial_driver.termios = serial_termios; - serial_driver.termios_locked = serial_termios_locked; - - serial_driver.open = rs_open; - serial_driver.close = rs_close; - serial_driver.write = rs_write; - serial_driver.put_char = rs_put_char; - serial_driver.flush_chars = rs_flush_chars; - serial_driver.write_room = rs_write_room; - serial_driver.chars_in_buffer = rs_chars_in_buffer; - serial_driver.flush_buffer = rs_flush_buffer; - serial_driver.ioctl = rs_ioctl; - serial_driver.throttle = rs_throttle; - serial_driver.unthrottle = rs_unthrottle; - serial_driver.send_xchar = rs_send_xchar; - serial_driver.set_termios = rs_set_termios; - serial_driver.stop = rs_stop; - serial_driver.start = rs_start; - serial_driver.hangup = rs_hangup; - serial_driver.break_ctl = rs_break; - serial_driver.wait_until_sent = rs_wait_until_sent; - serial_driver.read_proc = rs_read_proc; + hp_serial_driver.flags = TTY_DRIVER_REAL_RAW; + hp_serial_driver.refcount = &serial_refcount; + hp_serial_driver.table = serial_table; + hp_serial_driver.termios = serial_termios; + hp_serial_driver.termios_locked = serial_termios_locked; + + hp_serial_driver.open = rs_open; + hp_serial_driver.close = rs_close; + hp_serial_driver.write = rs_write; + hp_serial_driver.put_char = rs_put_char; + hp_serial_driver.flush_chars = rs_flush_chars; + hp_serial_driver.write_room = rs_write_room; + hp_serial_driver.chars_in_buffer = rs_chars_in_buffer; + hp_serial_driver.flush_buffer = rs_flush_buffer; + hp_serial_driver.ioctl = rs_ioctl; + hp_serial_driver.throttle = rs_throttle; + hp_serial_driver.unthrottle = rs_unthrottle; + hp_serial_driver.send_xchar = rs_send_xchar; + hp_serial_driver.set_termios = rs_set_termios; + hp_serial_driver.stop = rs_stop; + hp_serial_driver.start = rs_start; + hp_serial_driver.hangup = rs_hangup; + hp_serial_driver.break_ctl = rs_break; + hp_serial_driver.wait_until_sent = rs_wait_until_sent; + hp_serial_driver.read_proc = rs_read_proc; /* * Let's have a little bit of fun ! @@ -1087,14 +1087,14 @@ * The callout device is just like normal device except for * major number and the subtype code. */ - callout_driver = serial_driver; + callout_driver = hp_serial_driver; callout_driver.name = "cua"; callout_driver.major = TTYAUX_MAJOR; callout_driver.subtype = SERIAL_TYPE_CALLOUT; callout_driver.read_proc = 0; callout_driver.proc_entry = 0; - if (tty_register_driver(&serial_driver)) + if (tty_register_driver(&hp_serial_driver)) panic("Couldn't register simserial driver\n"); if (tty_register_driver(&callout_driver)) diff -urN linux-2.5.68-bk5/arch/ia64/kernel/perfmon.c linux-2.5.68-bk6/arch/ia64/kernel/perfmon.c --- linux-2.5.68-bk5/arch/ia64/kernel/perfmon.c 2003-04-25 04:34:06.000000000 -0700 +++ linux-2.5.68-bk6/arch/ia64/kernel/perfmon.c 2003-04-25 04:34:13.000000000 -0700 @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include diff -urN linux-2.5.68-bk5/arch/m68k/sun3x/prom.c linux-2.5.68-bk6/arch/m68k/sun3x/prom.c --- linux-2.5.68-bk5/arch/m68k/sun3x/prom.c 2003-04-19 19:49:21.000000000 -0700 +++ linux-2.5.68-bk6/arch/m68k/sun3x/prom.c 2003-04-25 04:34:13.000000000 -0700 @@ -90,16 +90,10 @@ /* debug console - write-only */ static struct console sun3x_debug = { - "debug", - sun3x_prom_write, /* write */ - NULL, /* read */ - NULL, /* device */ - NULL, /* unblank */ - NULL, /* setup */ - CON_PRINTBUFFER, - -1, - 0, - NULL + .name = "debug", + .write = sun3x_prom_write, + .flags = CON_PRINTBUFFER, + .index = -1, }; void sun3x_prom_init(void) diff -urN linux-2.5.68-bk5/arch/mips/au1000/common/serial.c linux-2.5.68-bk6/arch/mips/au1000/common/serial.c --- linux-2.5.68-bk5/arch/mips/au1000/common/serial.c 2003-04-25 04:34:06.000000000 -0700 +++ linux-2.5.68-bk6/arch/mips/au1000/common/serial.c 2003-04-25 04:34:13.000000000 -0700 @@ -2915,9 +2915,10 @@ serial_out(info, UART_IER, ier); } -static kdev_t serial_console_device(struct console *c) +static struct tty_driver *serial_console_device(struct console *c, int *index) { - return MKDEV(TTY_MAJOR, 64 + c->index); + *index = c->index - SERIAL_DEV_OFFSET; + return &serial_driver; } /* diff -urN linux-2.5.68-bk5/arch/mips/baget/vacserial.c linux-2.5.68-bk6/arch/mips/baget/vacserial.c --- linux-2.5.68-bk5/arch/mips/baget/vacserial.c 2003-04-25 04:34:06.000000000 -0700 +++ linux-2.5.68-bk6/arch/mips/baget/vacserial.c 2003-04-25 04:34:13.000000000 -0700 @@ -2621,9 +2621,10 @@ serial_outp(&scr_info, VAC_UART_INT_MASK, ier); } -static kdev_t serial_console_device(struct console *c) +static struct tty_driver *serial_console_device(struct console *c, int *index) { - return MKDEV(TTY_MAJOR, 64 + c->index); + *index = c->index; + return &serial_driver; } /* diff -urN linux-2.5.68-bk5/arch/mips/kernel/gdb-stub.c linux-2.5.68-bk6/arch/mips/kernel/gdb-stub.c --- linux-2.5.68-bk5/arch/mips/kernel/gdb-stub.c 2003-04-19 19:51:13.000000000 -0700 +++ linux-2.5.68-bk6/arch/mips/kernel/gdb-stub.c 2003-04-25 04:34:13.000000000 -0700 @@ -942,11 +942,6 @@ } } -static kdev_t gdb_console_dev(struct console *con) -{ - return MKDEV(1, 3); /* /dev/null */ -} - static void gdb_console_write(struct console *con, const char *s, unsigned n) { gdb_puts(s); @@ -955,7 +950,6 @@ static struct console gdb_console = { .name = "gdb", .write = gdb_console_write, - .device = gdb_console_dev, .flags = CON_PRINTBUFFER, .index = -1 }; diff -urN linux-2.5.68-bk5/arch/ppc/4xx_io/serial_sicc.c linux-2.5.68-bk6/arch/ppc/4xx_io/serial_sicc.c --- linux-2.5.68-bk5/arch/ppc/4xx_io/serial_sicc.c 2003-04-25 04:34:06.000000000 -0700 +++ linux-2.5.68-bk6/arch/ppc/4xx_io/serial_sicc.c 2003-04-25 04:34:13.000000000 -0700 @@ -1990,12 +1990,12 @@ return c; } -static kdev_t siccuart_console_device(struct console *c) +static struct tty_driver *siccuart_console_device(struct console *c, int *index) { - return MKDEV(SERIAL_SICC_MAJOR, SERIAL_SICC_MINOR + c->index); + *index = c->index; + return &siccnormal_driver; } - static int __init siccuart_console_setup(struct console *co, char *options) { struct SICC_port *port; diff -urN linux-2.5.68-bk5/arch/ppc/8260_io/uart.c linux-2.5.68-bk6/arch/ppc/8260_io/uart.c --- linux-2.5.68-bk5/arch/ppc/8260_io/uart.c 2003-04-25 04:34:06.000000000 -0700 +++ linux-2.5.68-bk6/arch/ppc/8260_io/uart.c 2003-04-25 04:34:13.000000000 -0700 @@ -2449,7 +2449,8 @@ static kdev_t serial_console_device(struct console *c) { - return mk_kdev(TTY_MAJOR, 64 + c->index); + *index = c->index; + return &serial_driver; } diff -urN linux-2.5.68-bk5/arch/ppc/8xx_io/uart.c linux-2.5.68-bk6/arch/ppc/8xx_io/uart.c --- linux-2.5.68-bk5/arch/ppc/8xx_io/uart.c 2003-04-25 04:34:06.000000000 -0700 +++ linux-2.5.68-bk6/arch/ppc/8xx_io/uart.c 2003-04-25 04:34:13.000000000 -0700 @@ -91,7 +91,7 @@ static void serial_console_write(struct console *c, const char *s, unsigned count); -static kdev_t serial_console_device(struct console *c); +static struct tty_driver *serial_console_device(struct console *c, int *index) #if defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) static unsigned long break_pressed; /* break, really ... */ @@ -2513,9 +2513,10 @@ } #endif -static kdev_t serial_console_device(struct console *c) +static struct tty_driver *serial_console_device(struct console *c, int *index) { - return MKDEV(TTY_MAJOR, 64 + c->index); + *index = c->index; + return &serial_driver; } /* diff -urN linux-2.5.68-bk5/arch/ppc/platforms/chrp_setup.c linux-2.5.68-bk6/arch/ppc/platforms/chrp_setup.c --- linux-2.5.68-bk5/arch/ppc/platforms/chrp_setup.c 2003-04-25 04:34:06.000000000 -0700 +++ linux-2.5.68-bk6/arch/ppc/platforms/chrp_setup.c 2003-04-25 04:34:13.000000000 -0700 @@ -67,7 +67,7 @@ extern unsigned long pmac_find_end_of_memory(void); extern int of_show_percpuinfo(struct seq_file *, int); -extern kdev_t boot_dev; +extern dev_t boot_dev; extern PTE *Hash, *Hash_end; extern unsigned long Hash_size, Hash_mask; diff -urN linux-2.5.68-bk5/arch/ppc/platforms/pmac_setup.c linux-2.5.68-bk6/arch/ppc/platforms/pmac_setup.c --- linux-2.5.68-bk5/arch/ppc/platforms/pmac_setup.c 2003-04-25 04:34:07.000000000 -0700 +++ linux-2.5.68-bk6/arch/ppc/platforms/pmac_setup.c 2003-04-25 04:34:13.000000000 -0700 @@ -364,7 +364,7 @@ void *boot_host; int boot_target; int boot_part; -extern kdev_t boot_dev; +extern dev_t boot_dev; #ifdef CONFIG_SCSI void __init @@ -398,18 +398,18 @@ #endif #if defined(CONFIG_BLK_DEV_IDE) && defined(CONFIG_BLK_DEV_IDE_PMAC) -kdev_t __init +dev_t __init find_ide_boot(void) { char *p; int n; - kdev_t __init pmac_find_ide_boot(char *bootdevice, int n); + dev_t __init pmac_find_ide_boot(char *bootdevice, int n); if (bootdevice == NULL) - return NODEV; + return 0; p = strrchr(bootdevice, '/'); if (p == NULL) - return NODEV; + return 0; n = p - bootdevice; return pmac_find_ide_boot(bootdevice, n); @@ -436,7 +436,7 @@ /* can't be __init - can be called whenever a disk is first accessed */ void __pmac -note_bootable_part(kdev_t dev, int part, int goodness) +note_bootable_part(dev_t dev, int part, int goodness) { static int found_boot = 0; char *p; @@ -454,9 +454,9 @@ find_boot_device(); found_boot = 1; } - if (kdev_same(boot_dev, NODEV) || kdev_same(dev, boot_dev)) { - ROOT_DEV = MKDEV(major(dev), minor(dev) + part); - boot_dev = NODEV; + if (!boot_dev || dev == boot_dev) { + ROOT_DEV = dev + part; + boot_dev = 0; current_root_goodness = goodness; } } diff -urN linux-2.5.68-bk5/arch/ppc/platforms/prep_setup.c linux-2.5.68-bk6/arch/ppc/platforms/prep_setup.c --- linux-2.5.68-bk5/arch/ppc/platforms/prep_setup.c 2003-04-25 04:34:07.000000000 -0700 +++ linux-2.5.68-bk6/arch/ppc/platforms/prep_setup.c 2003-04-25 04:34:13.000000000 -0700 @@ -91,7 +91,7 @@ #define cached_A1 (((char *)(ppc_cached_irq_mask))[2]) /* for the mac fs */ -kdev_t boot_dev; +dev_t boot_dev; #ifdef CONFIG_SOUND_CS4232 long ppc_cs4232_dma, ppc_cs4232_dma2; diff -urN linux-2.5.68-bk5/arch/ppc64/kernel/chrp_setup.c linux-2.5.68-bk6/arch/ppc64/kernel/chrp_setup.c --- linux-2.5.68-bk5/arch/ppc64/kernel/chrp_setup.c 2003-04-25 04:34:07.000000000 -0700 +++ linux-2.5.68-bk6/arch/ppc64/kernel/chrp_setup.c 2003-04-25 04:34:13.000000000 -0700 @@ -79,7 +79,7 @@ extern void SystemReset_FWNMI(void), MachineCheck_FWNMI(void); /* from head.S */ int fwnmi_active; /* TRUE if an FWNMI handler is present */ -kdev_t boot_dev; +dev_t boot_dev; unsigned long virtPython0Facilities = 0; // python0 facility area (memory mapped io) (64-bit format) VIRTUAL address. extern unsigned long loops_per_jiffy; diff -urN linux-2.5.68-bk5/arch/sh/kernel/setup.c linux-2.5.68-bk6/arch/sh/kernel/setup.c --- linux-2.5.68-bk5/arch/sh/kernel/setup.c 2003-04-25 04:34:07.000000000 -0700 +++ linux-2.5.68-bk6/arch/sh/kernel/setup.c 2003-04-25 04:34:13.000000000 -0700 @@ -139,12 +139,6 @@ sh_bios_console_write(s, count); } -static kdev_t sh_console_device(struct console *c) -{ - /* /dev/null */ - return mk_kdev(MEM_MAJOR, 3); -} - /* * Setup initial baud/bits/parity. We do two things here: * - construct a cflag setting for the first rs_open() @@ -171,7 +165,6 @@ static struct console sh_console = { .name = "bios", .write = sh_console_write, - .device = sh_console_device, .setup = sh_console_setup, .flags = CON_PRINTBUFFER, .index = -1, diff -urN linux-2.5.68-bk5/arch/um/drivers/stdio_console.c linux-2.5.68-bk6/arch/um/drivers/stdio_console.c --- linux-2.5.68-bk5/arch/um/drivers/stdio_console.c 2003-04-19 19:48:56.000000000 -0700 +++ linux-2.5.68-bk6/arch/um/drivers/stdio_console.c 2003-04-25 04:34:13.000000000 -0700 @@ -199,9 +199,10 @@ .set_termios = set_termios }; -static kdev_t console_device(struct console *c) +static struct tty_driver *console_device(struct console *c, int *index) { - return mk_kdev(TTY_MAJOR, c->index); + *index = c->index; + return &console_driver; } static int console_setup(struct console *co, char *options) diff -urN linux-2.5.68-bk5/arch/v850/kernel/memcons.c linux-2.5.68-bk6/arch/v850/kernel/memcons.c --- linux-2.5.68-bk5/arch/v850/kernel/memcons.c 2003-04-19 19:51:08.000000000 -0700 +++ linux-2.5.68-bk6/arch/v850/kernel/memcons.c 2003-04-25 04:34:13.000000000 -0700 @@ -58,9 +58,11 @@ len -= write (buf, len); } -static kdev_t memcons_device (struct console *co) +extern struct tty_driver tty_driver; +static struct tty_driver *memcons_device (struct console *co, int *index) { - return MKDEV (TTY_MAJOR, 64 + co->index); + *index = co->index; + return &tty_driver; } static struct console memcons = diff -urN linux-2.5.68-bk5/arch/v850/kernel/simcons.c linux-2.5.68-bk6/arch/v850/kernel/simcons.c --- linux-2.5.68-bk5/arch/v850/kernel/simcons.c 2003-04-19 19:50:35.000000000 -0700 +++ linux-2.5.68-bk6/arch/v850/kernel/simcons.c 2003-04-25 04:34:13.000000000 -0700 @@ -35,9 +35,11 @@ return V850_SIM_SYSCALL (read, 0, buf, len); } -static kdev_t simcons_device (struct console *c) +extern struct tty_driver tty_driver; +static struct tty_driver *simcons_device (struct console *c, int *index) { - return mk_kdev (TTY_MAJOR, 64 + c->index); + *index = c->index; + return &tty_driver; } static struct console simcons = diff -urN linux-2.5.68-bk5/drivers/acorn/block/fd1772.c linux-2.5.68-bk6/drivers/acorn/block/fd1772.c --- linux-2.5.68-bk5/drivers/acorn/block/fd1772.c 2003-04-19 19:49:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/acorn/block/fd1772.c 2003-04-25 04:34:13.000000000 -0700 @@ -1474,9 +1474,6 @@ fd_device[drive] = type; - if (old_dev && old_dev != type) - invalidate_buffers(mk_kdev(MAJOR_NR, drive + (old_dev<<2))); - if (filp->f_flags & O_NDELAY) return 0; diff -urN linux-2.5.68-bk5/drivers/atm/ambassador.c linux-2.5.68-bk6/drivers/atm/ambassador.c --- linux-2.5.68-bk5/drivers/atm/ambassador.c 2003-04-19 19:48:51.000000000 -0700 +++ linux-2.5.68-bk6/drivers/atm/ambassador.c 2003-04-25 04:34:13.000000000 -0700 @@ -868,7 +868,8 @@ /********** interrupt handling **********/ -static void interrupt_handler (int irq, void * dev_id, struct pt_regs * pt_regs) { +static irqreturn_t interrupt_handler(int irq, void *dev_id, + struct pt_regs *pt_regs) { amb_dev * dev = amb_devs; (void) pt_regs; @@ -876,7 +877,7 @@ if (!dev_id) { PRINTD (DBG_IRQ|DBG_ERR, "irq with NULL dev_id: %d", irq); - return; + return IRQ_NONE; } // Did one of our cards generate the interrupt? while (dev) { @@ -889,12 +890,12 @@ // the card generates an IRQ at startup - should not happen again if (!dev) { PRINTD (DBG_IRQ, "irq for unknown device: %d", irq); - return; + return IRQ_NONE; } // impossible - unless we have memory corruption of dev or kernel if (irq != dev->irq) { PRINTD (DBG_IRQ|DBG_ERR, "irq mismatch: %d", irq); - return; + return IRQ_NONE; } { @@ -903,7 +904,7 @@ // for us or someone else sharing the same interrupt if (!interrupt) { PRINTD (DBG_IRQ, "irq not for me: %d", irq); - return; + return IRQ_NONE; } // definitely for us @@ -934,7 +935,7 @@ } PRINTD (DBG_IRQ|DBG_FLOW, "interrupt_handler done: %p", dev_id); - return; + return IRQ_HANDLED; } /********** don't panic... yeah, right **********/ diff -urN linux-2.5.68-bk5/drivers/atm/eni.c linux-2.5.68-bk6/drivers/atm/eni.c --- linux-2.5.68-bk5/drivers/atm/eni.c 2003-04-19 19:48:55.000000000 -0700 +++ linux-2.5.68-bk6/drivers/atm/eni.c 2003-04-25 04:34:13.000000000 -0700 @@ -1483,7 +1483,7 @@ } -static void eni_int(int irq,void *dev_id,struct pt_regs *regs) +static irqreturn_t eni_int(int irq,void *dev_id,struct pt_regs *regs) { struct atm_dev *dev; struct eni_dev *eni_dev; @@ -1515,6 +1515,7 @@ eni_dev->events |= reason; spin_unlock(&eni_dev->lock); tasklet_schedule(&eni_dev->task); + return IRQ_HANDLED; } diff -urN linux-2.5.68-bk5/drivers/atm/firestream.c linux-2.5.68-bk6/drivers/atm/firestream.c --- linux-2.5.68-bk5/drivers/atm/firestream.c 2003-04-19 19:48:51.000000000 -0700 +++ linux-2.5.68-bk6/drivers/atm/firestream.c 2003-04-25 04:34:13.000000000 -0700 @@ -1562,14 +1562,15 @@ -static void fs_irq (int irq, void *dev_id, struct pt_regs * pt_regs) +static irqreturn_t fs_irq (int irq, void *dev_id, struct pt_regs * pt_regs) { int i; u32 status; struct fs_dev *dev = dev_id; status = read_fs (dev, ISR); - if (!status) return; + if (!status) + return IRQ_NONE; func_enter (); @@ -1649,6 +1650,7 @@ } func_exit (); + return IRQ_HANDLED; } diff -urN linux-2.5.68-bk5/drivers/atm/fore200e.c linux-2.5.68-bk6/drivers/atm/fore200e.c --- linux-2.5.68-bk5/drivers/atm/fore200e.c 2003-04-19 19:51:16.000000000 -0700 +++ linux-2.5.68-bk6/drivers/atm/fore200e.c 2003-04-25 04:34:13.000000000 -0700 @@ -1227,7 +1227,7 @@ } -static void +static irqreturn_t fore200e_interrupt(int irq, void* dev, struct pt_regs* regs) { struct fore200e* fore200e = FORE200E_DEV((struct atm_dev*)dev); @@ -1235,13 +1235,14 @@ if (fore200e->bus->irq_check(fore200e) == 0) { DPRINTK(3, "unexpected interrupt on device %c\n", fore200e->name[9]); - return; + return IRQ_NONE; } DPRINTK(3, "valid interrupt on device %c\n", fore200e->name[9]); tasklet_schedule(&fore200e->tasklet); fore200e->bus->irq_ack(fore200e); + return IRQ_HANDLED; } diff -urN linux-2.5.68-bk5/drivers/atm/horizon.c linux-2.5.68-bk6/drivers/atm/horizon.c --- linux-2.5.68-bk5/drivers/atm/horizon.c 2003-04-19 19:48:46.000000000 -0700 +++ linux-2.5.68-bk6/drivers/atm/horizon.c 2003-04-25 04:34:13.000000000 -0700 @@ -1398,7 +1398,8 @@ /********** interrupt handler **********/ -static void interrupt_handler (int irq, void * dev_id, struct pt_regs * pt_regs) { +static irqreturn_t interrupt_handler(int irq, void *dev_id, + struct pt_regs *pt_regs) { hrz_dev * dev = hrz_devs; u32 int_source; unsigned int irq_ok; @@ -1408,7 +1409,7 @@ if (!dev_id) { PRINTD (DBG_IRQ|DBG_ERR, "irq with NULL dev_id: %d", irq); - return; + return IRQ_NONE; } // Did one of our cards generate the interrupt? while (dev) { @@ -1418,11 +1419,11 @@ } if (!dev) { PRINTD (DBG_IRQ, "irq not for me: %d", irq); - return; + return IRQ_NONE; } if (irq != dev->irq) { PRINTD (DBG_IRQ|DBG_ERR, "irq mismatch: %d", irq); - return; + return IRQ_NONE; } // definitely for us @@ -1468,6 +1469,9 @@ } PRINTD (DBG_IRQ|DBG_FLOW, "interrupt_handler done: %p", dev_id); + if (irq_ok) + return IRQ_HANDLED; + return IRQ_NONE; } /********** housekeeping **********/ diff -urN linux-2.5.68-bk5/drivers/atm/idt77252.c linux-2.5.68-bk6/drivers/atm/idt77252.c --- linux-2.5.68-bk5/drivers/atm/idt77252.c 2003-04-19 19:49:26.000000000 -0700 +++ linux-2.5.68-bk6/drivers/atm/idt77252.c 2003-04-25 04:34:13.000000000 -0700 @@ -134,8 +134,6 @@ int flags); static int idt77252_proc_read(struct atm_dev *dev, loff_t * pos, char *page); -static void idt77252_interrupt(int irq, void *dev_id, - struct pt_regs *regs); static void idt77252_softint(void *dev_id); @@ -2812,7 +2810,7 @@ #endif } -static void +static irqreturn_t idt77252_interrupt(int irq, void *dev_id, struct pt_regs *ptregs) { struct idt77252_dev *card = dev_id; @@ -2820,7 +2818,7 @@ stat = readl(SAR_REG_STAT) & 0xffff; if (!stat) /* no interrupt for us */ - return; + return IRQ_NONE; if (test_and_set_bit(IDT77252_BIT_INTERRUPT, &card->flags)) { printk("%s: Re-entering irq_handler()\n", card->name); @@ -2901,6 +2899,7 @@ out: clear_bit(IDT77252_BIT_INTERRUPT, &card->flags); + return IRQ_HANDLED; } static void diff -urN linux-2.5.68-bk5/drivers/atm/iphase.c linux-2.5.68-bk6/drivers/atm/iphase.c --- linux-2.5.68-bk5/drivers/atm/iphase.c 2003-04-19 19:51:12.000000000 -0700 +++ linux-2.5.68-bk6/drivers/atm/iphase.c 2003-04-25 04:34:13.000000000 -0700 @@ -2197,16 +2197,18 @@ return -ENOMEM; } -static void ia_int(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t ia_int(int irq, void *dev_id, struct pt_regs *regs) { struct atm_dev *dev; IADEV *iadev; unsigned int status; + int handled = 0; dev = dev_id; iadev = INPH_IA_DEV(dev); while( (status = readl(iadev->reg+IPHASE5575_BUS_STATUS_REG) & 0x7f)) { + handled = 1; IF_EVENT(printk("ia_int: status = 0x%x\n", status);) if (status & STAT_REASSINT) { @@ -2236,7 +2238,8 @@ if (status & STAT_FEINT) IaFrontEndIntr(iadev); } - } + } + return IRQ_RETVAL(handled); } diff -urN linux-2.5.68-bk5/drivers/atm/lanai.c linux-2.5.68-bk6/drivers/atm/lanai.c --- linux-2.5.68-bk5/drivers/atm/lanai.c 2003-04-19 19:48:56.000000000 -0700 +++ linux-2.5.68-bk6/drivers/atm/lanai.c 2003-04-25 04:34:13.000000000 -0700 @@ -2047,10 +2047,12 @@ reg_write(lanai, ack, IntAck_Reg); } -static void lanai_int(int irq, void *devid, struct pt_regs *regs) +static irqreturn_t lanai_int(int irq, void *devid, struct pt_regs *regs) { struct lanai_dev *lanai = (struct lanai_dev *) devid; u32 reason; + int handled = 0; + (void) irq; (void) regs; /* unused variables */ #ifdef USE_POWERDOWN if (lanai->conf1 & CONFIG1_POWERDOWN) { @@ -2062,8 +2064,11 @@ conf2_write(lanai); } #endif - while ((reason = intr_pending(lanai)) != 0) + while ((reason = intr_pending(lanai)) != 0) { + handled = 1; lanai_int_1(lanai, reason); + } + return IRQ_RETVAL(handled); } /* TODO - it would be nice if we could use the "delayed interrupt" system diff -urN linux-2.5.68-bk5/drivers/atm/nicstar.c linux-2.5.68-bk6/drivers/atm/nicstar.c --- linux-2.5.68-bk5/drivers/atm/nicstar.c 2003-04-19 19:48:55.000000000 -0700 +++ linux-2.5.68-bk6/drivers/atm/nicstar.c 2003-04-25 04:34:13.000000000 -0700 @@ -220,7 +220,7 @@ static void free_scq(scq_info *scq, struct atm_vcc *vcc); static void push_rxbufs(ns_dev *card, u32 type, u32 handle1, u32 addr1, u32 handle2, u32 addr2); -static void ns_irq_handler(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t ns_irq_handler(int irq, void *dev_id, struct pt_regs *regs); static int ns_open(struct atm_vcc *vcc, short vpi, int vci); static void ns_close(struct atm_vcc *vcc); static void fill_tst(ns_dev *card, int n, vc_map *vc); @@ -1186,7 +1186,7 @@ -static void ns_irq_handler(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t ns_irq_handler(int irq, void *dev_id, struct pt_regs *regs) { u32 stat_r; ns_dev *card; @@ -1366,6 +1366,7 @@ spin_unlock_irqrestore(&card->int_lock, flags); PRINTK("nicstar%d: end of interrupt service\n", card->index); + return IRQ_HANDLED; } diff -urN linux-2.5.68-bk5/drivers/atm/zatm.c linux-2.5.68-bk6/drivers/atm/zatm.c --- linux-2.5.68-bk5/drivers/atm/zatm.c 2003-04-19 19:48:55.000000000 -0700 +++ linux-2.5.68-bk6/drivers/atm/zatm.c 2003-04-25 04:34:13.000000000 -0700 @@ -1214,15 +1214,17 @@ /*------------------------------- interrupts --------------------------------*/ -static void zatm_int(int irq,void *dev_id,struct pt_regs *regs) +static irqreturn_t zatm_int(int irq,void *dev_id,struct pt_regs *regs) { struct atm_dev *dev; struct zatm_dev *zatm_dev; u32 reason; + int handled = 0; dev = dev_id; zatm_dev = ZATM_DEV(dev); while ((reason = zin(GSR))) { + handled = 1; EVENT("reason 0x%x\n",reason,0); if (reason & uPD98401_INT_PI) { EVENT("PHY int\n",0,0); @@ -1285,6 +1287,7 @@ } /* @@@ handle RCRn */ } + return IRQ_RETVAL(handled); } diff -urN linux-2.5.68-bk5/drivers/block/amiflop.c linux-2.5.68-bk6/drivers/block/amiflop.c --- linux-2.5.68-bk5/drivers/block/amiflop.c 2003-04-19 19:49:26.000000000 -0700 +++ linux-2.5.68-bk6/drivers/block/amiflop.c 2003-04-25 04:34:13.000000000 -0700 @@ -1496,7 +1496,7 @@ break; case FDFMTEND: floppy_off(drive); - invalidate_device(inode->i_rdev, 0); + invalidate_bdev(inode->i_bdev, 0); break; case FDGETPRM: memset((void *)&getprm, 0, sizeof (getprm)); @@ -1604,9 +1604,6 @@ #endif local_irq_restore(flags); - if (old_dev != system) - invalidate_buffers(mk_kdev(FLOPPY_MAJOR, drive + (system << 2))); - unit[drive].dtype=&data_types[system]; unit[drive].blocks=unit[drive].type->heads*unit[drive].type->tracks* data_types[system].sects*unit[drive].type->sect_mult; diff -urN linux-2.5.68-bk5/drivers/block/ataflop.c linux-2.5.68-bk6/drivers/block/ataflop.c --- linux-2.5.68-bk5/drivers/block/ataflop.c 2003-04-19 19:48:52.000000000 -0700 +++ linux-2.5.68-bk6/drivers/block/ataflop.c 2003-04-25 04:34:13.000000000 -0700 @@ -364,7 +364,7 @@ static __inline__ int get_head_settle_flag( void ); static void floppy_irq (int irq, void *dummy, struct pt_regs *fp); static void fd_error( void ); -static int do_format(kdev_t drive, struct atari_format_descr *desc); +static int do_format(int drive, int type, struct atari_format_descr *desc); static void do_fd_action( int drive ); static void fd_calibrate( void ); static void fd_calibrate_done( int status ); @@ -656,12 +656,11 @@ p += n; \ } while(0) -static int do_format(kdev_t device, struct atari_format_descr *desc) +static int do_format(int drive, int type, struct atari_format_descr *desc) { unsigned char *p; int sect, nsect; unsigned long flags; - int type, drive = minor(device) & 3; DPRINT(("do_format( dr=%d tr=%d he=%d offs=%d )\n", drive, desc->track, desc->head, desc->sect_offset )); @@ -673,7 +672,6 @@ atari_turnon_irq( IRQ_MFP_FDC ); /* should be already, just to be sure */ local_irq_restore(flags); - type = minor(device) >> 2; if (type) { if (--type >= NUM_DISK_MINORS || minor2disktype[type].drive_types > DriveType) { @@ -1690,7 +1688,7 @@ return -EBUSY; if (copy_from_user(&fmt_desc, (void *) param, sizeof(fmt_desc))) return -EFAULT; - return do_format(device, &fmt_desc); + return do_format(drive, type, &fmt_desc); case FDCLRPRM: UDT = NULL; /* MSch: invalidate default_params */ @@ -1864,9 +1862,6 @@ fd_device[drive] = type; - if (old_dev && old_dev != type) - invalidate_buffers(mk_kdev(FLOPPY_MAJOR, drive + (type<<2))); - if (filp->f_flags & O_NDELAY) return 0; diff -urN linux-2.5.68-bk5/drivers/block/floppy.c linux-2.5.68-bk6/drivers/block/floppy.c --- linux-2.5.68-bk5/drivers/block/floppy.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/block/floppy.c 2003-04-25 04:34:13.000000000 -0700 @@ -283,12 +283,6 @@ static unsigned long fake_change; static int initialising=1; -static inline int TYPE(kdev_t x) { - return (minor(x)>>2) & 0x1f; -} -static inline int DRIVE(kdev_t x) { - return (minor(x)&0x03) | ((minor(x)&0x80) >> 5); -} #define ITYPE(x) (((x)>>2) & 0x1f) #define TOMINOR(x) ((x & 3) | ((x & 4) << 5)) #define UNIT(x) ((x) & 0x03) /* drive on fdc */ @@ -415,6 +409,8 @@ static struct floppy_write_errors write_errors[N_DRIVE]; static struct timer_list motor_off_timer[N_DRIVE]; static struct gendisk *disks[N_DRIVE]; +static struct block_device *opened_bdev[N_DRIVE]; +static DECLARE_MUTEX(open_lock); static struct floppy_raw_cmd *raw_cmd, default_raw_cmd; /* @@ -3332,25 +3328,21 @@ if (type){ if (!capable(CAP_SYS_ADMIN)) return -EPERM; + down(&open_lock); LOCK_FDC(drive,1); - for (cnt = 0; cnt < N_DRIVE; cnt++){ - if (ITYPE(drive_state[cnt].fd_device) == type && - drive_state[cnt].fd_ref) - set_bit(drive, &fake_change); - } floppy_type[type] = *g; floppy_type[type].name="user format"; for (cnt = type << 2; cnt < (type << 2) + 4; cnt++) floppy_sizes[cnt]= floppy_sizes[cnt+0x80]= floppy_type[type].size+1; process_fd_request(); - for (cnt = 0; cnt < N_DRIVE; cnt++){ - if (ITYPE(drive_state[cnt].fd_device) == type && - drive_state[cnt].fd_ref) - __check_disk_change( - MKDEV(FLOPPY_MAJOR, - drive_state[cnt].fd_device)); + for (cnt = 0; cnt < N_DRIVE; cnt++) { + struct block_device *bdev = opened_bdev[cnt]; + if (!bdev || ITYPE(drive_state[cnt].fd_device) != type) + continue; + __invalidate_device(bdev, 0); } + up(&open_lock); } else { LOCK_FDC(drive,1); if (cmd != FDDEFPRM) @@ -3448,8 +3440,8 @@ #define OUT(c,x) case c: outparam = (const char *) (x); break #define IN(c,x,tag) case c: *(x) = inparam. tag ; return 0 - int i,drive,type; - kdev_t device; + int drive = (long)inode->i_bdev->bd_disk->private_data; + int i, type = ITYPE(UDRS->fd_device); int ret; int size; union inparam { @@ -3460,9 +3452,6 @@ } inparam; /* parameters coming from user space */ const char *outparam; /* parameters passed back to user space */ - device = inode->i_rdev; - type = TYPE(device); - drive = DRIVE(device); /* convert compatibility eject ioctls into floppy eject ioctl. * We do this in order to provide a means to eject floppy disks before @@ -3675,15 +3664,19 @@ static int floppy_release(struct inode * inode, struct file * filp) { - int drive = DRIVE(inode->i_rdev); + int drive = (long)inode->i_bdev->bd_disk->private_data; + down(&open_lock); if (UDRS->fd_ref < 0) UDRS->fd_ref=0; else if (!UDRS->fd_ref--) { DPRINT("floppy_release with fd_ref == 0"); UDRS->fd_ref = 0; } + if (!UDRS->fd_ref) + opened_bdev[drive] = NULL; floppy_release_irq_and_dma(); + up(&open_lock); return 0; } @@ -3692,28 +3685,19 @@ * /dev/PS0 etc), and disallows simultaneous access to the same * drive with different device numbers. */ -#define RETERR(x) do{floppy_release(inode,filp); return -(x);}while(0) - static int floppy_open(struct inode * inode, struct file * filp) { - int drive; + int drive = (long)inode->i_bdev->bd_disk->private_data; int old_dev; int try; + int res = -EBUSY; char *tmp; filp->private_data = (void*) 0; - - drive = DRIVE(inode->i_rdev); - if (drive >= N_DRIVE || - !(allowed_drive_mask & (1 << drive)) || - fdc_state[FDC(drive)].version == FDC_NONE) - return -ENXIO; - - if (TYPE(inode->i_rdev) >= NUMBER(floppy_type)) - return -ENXIO; + down(&open_lock); old_dev = UDRS->fd_device; - if (UDRS->fd_ref && old_dev != minor(inode->i_rdev)) - return -EBUSY; + if (opened_bdev[drive] && opened_bdev[drive] != inode->i_bdev) + goto out2; if (!UDRS->fd_ref && (UDP->flags & FD_BROKEN_DCL)){ USETF(FD_DISK_CHANGED); @@ -3722,16 +3706,20 @@ if (UDRS->fd_ref == -1 || (UDRS->fd_ref && (filp->f_flags & O_EXCL))) - return -EBUSY; + goto out2; if (floppy_grab_irq_and_dma()) - return -EBUSY; + goto out2; if (filp->f_flags & O_EXCL) UDRS->fd_ref = -1; else UDRS->fd_ref++; + opened_bdev[drive] = inode->i_bdev; + + res = -ENXIO; + if (!floppy_track_buffer){ /* if opening an ED drive, reserve a big buffer, * else reserve a small one */ @@ -3751,7 +3739,7 @@ } if (!tmp && !floppy_track_buffer) { DPRINT("Unable to allocate DMA memory\n"); - RETERR(ENXIO); + goto out; } if (floppy_track_buffer) { if (tmp) @@ -3768,8 +3756,6 @@ if (old_dev != -1 && old_dev != minor(inode->i_rdev)) { if (buffer_drive == drive) buffer_track = -1; - /* umm, invalidate_buffers() in ->open?? --hch */ - invalidate_buffers(mk_kdev(FLOPPY_MAJOR,old_dev)); } /* Allow ioctls if we have write-permissions even if read-only open. @@ -3782,18 +3768,30 @@ if (UFDCS->rawcmd == 1) UFDCS->rawcmd = 2; - if (filp->f_flags & O_NDELAY) - return 0; - if (filp->f_mode & 3) { - UDRS->last_checked = 0; - check_disk_change(inode->i_bdev); - if (UTESTF(FD_DISK_CHANGED)) - RETERR(ENXIO); + if (!filp->f_flags & O_NDELAY) { + if (filp->f_mode & 3) { + UDRS->last_checked = 0; + check_disk_change(inode->i_bdev); + if (UTESTF(FD_DISK_CHANGED)) + goto out; + } + res = -EROFS; + if ((filp->f_mode & 2) && !(UTESTF(FD_DISK_WRITABLE))) + goto out; } - if ((filp->f_mode & 2) && !(UTESTF(FD_DISK_WRITABLE))) - RETERR(EROFS); + up(&open_lock); return 0; -#undef RETERR +out: + if (UDRS->fd_ref < 0) + UDRS->fd_ref=0; + else + UDRS->fd_ref--; + if (!UDRS->fd_ref) + opened_bdev[drive] = NULL; + floppy_release_irq_and_dma(); +out2: + up(&open_lock); + return res; } /* @@ -4216,6 +4214,8 @@ !(allowed_drive_mask & (1 << drive)) || fdc_state[FDC(drive)].version == FDC_NONE) return NULL; + if (((*part >> 2) & 0x1f) >= NUMBER(floppy_type)) + return NULL; *part = 0; return get_disk(disks[drive]); } diff -urN linux-2.5.68-bk5/drivers/block/floppy98.c linux-2.5.68-bk6/drivers/block/floppy98.c --- linux-2.5.68-bk5/drivers/block/floppy98.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/block/floppy98.c 2003-04-25 04:34:13.000000000 -0700 @@ -318,12 +318,6 @@ static unsigned long fake_change; static int initialising=1; -static inline int TYPE(kdev_t x) { - return (minor(x)>>2) & 0x1f; -} -static inline int DRIVE(kdev_t x) { - return (minor(x)&0x03) | ((minor(x)&0x80) >> 5); -} #define ITYPE(x) (((x)>>2) & 0x1f) #define TOMINOR(x) ((x & 3) | ((x & 4) << 5)) #define UNIT(x) ((x) & 0x03) /* drive on fdc */ @@ -450,6 +444,8 @@ static struct floppy_write_errors write_errors[N_DRIVE]; static struct timer_list motor_off_timer[N_DRIVE]; static struct gendisk *disks[N_DRIVE]; +static struct block_device *opened_bdev[N_DRIVE]; +static DECLARE_MUTEX(open_lock); static struct floppy_raw_cmd *raw_cmd, default_raw_cmd; /* @@ -3384,25 +3380,21 @@ if (type){ if (!capable(CAP_SYS_ADMIN)) return -EPERM; + down(&open_lock); LOCK_FDC(drive,1); - for (cnt = 0; cnt < N_DRIVE; cnt++){ - if (ITYPE(drive_state[cnt].fd_device) == type && - drive_state[cnt].fd_ref) - set_bit(drive, &fake_change); - } floppy_type[type] = *g; floppy_type[type].name="user format"; for (cnt = type << 2; cnt < (type << 2) + 4; cnt++) floppy_sizes[cnt]= floppy_sizes[cnt+0x80]= floppy_type[type].size+1; process_fd_request(); - for (cnt = 0; cnt < N_DRIVE; cnt++){ - if (ITYPE(drive_state[cnt].fd_device) == type && - drive_state[cnt].fd_ref) - __check_disk_change( - MKDEV(FLOPPY_MAJOR, - drive_state[cnt].fd_device)); + for (cnt = 0; cnt < N_DRIVE; cnt++) { + struct block_device *bdev = opened_bdev[cnt]; + if (!bdev || ITYPE(drive_state[cnt].fd_device) != type) + continue; + __invalidate_device(bdev, 0); } + up(&open_lock); } else { LOCK_FDC(drive,1); if (cmd != FDDEFPRM) @@ -3500,8 +3492,8 @@ #define OUT(c,x) case c: outparam = (const char *) (x); break #define IN(c,x,tag) case c: *(x) = inparam. tag ; return 0 - int i,drive,type; - kdev_t device; + int drive = (long)inode->i_bdev->bd_disk->private_data; + int i, type = ITYPE(UDRS->fd_device); int ret; int size; union inparam { @@ -3512,10 +3504,6 @@ } inparam; /* parameters coming from user space */ const char *outparam; /* parameters passed back to user space */ - device = inode->i_rdev; - type = TYPE(device); - drive = DRIVE(device); - /* convert compatibility eject ioctls into floppy eject ioctl. * We do this in order to provide a means to eject floppy disks before * installing the new fdutils package */ @@ -3750,15 +3738,19 @@ static int floppy_release(struct inode * inode, struct file * filp) { - int drive = DRIVE(inode->i_rdev); + int drive = (long)inode->i_bdev->bd_disk->private_data; + down(&open_lock); if (UDRS->fd_ref < 0) UDRS->fd_ref=0; else if (!UDRS->fd_ref--) { DPRINT("floppy_release with fd_ref == 0"); UDRS->fd_ref = 0; } + if (!UDRS->fd_ref) + opened_bdev[drive] = NULL; floppy_release_irq_and_dma(); + up(&open_lock); return 0; } @@ -3771,9 +3763,10 @@ static int floppy_open(struct inode * inode, struct file * filp) { - int drive; + int drive = (long)inode->i_bdev->bd_disk->private_data; int old_dev; int try; + int res = -EBUSY; char *tmp; #ifdef PC9800_DEBUG_FLOPPY @@ -3781,7 +3774,6 @@ #endif filp->private_data = (void*) 0; - drive = DRIVE(inode->i_rdev); #ifdef PC9800_DEBUG_FLOPPY printk("floppy open: drive=%d, current_drive=%d, UDP->cmos=%d\n" "floppy open: FDCS={spec1=%d, spec2=%d, dtr=%d, version=%d, dor=%d, address=%lu}\n", @@ -3796,16 +3788,10 @@ } #endif /* PC9800_DEBUG_FLOPPY */ - if (drive >= N_DRIVE || - !(allowed_drive_mask & (1 << drive)) || - fdc_state[FDC(drive)].version == FDC_NONE) - return -ENXIO; - - if (TYPE(inode->i_rdev) >= NUMBER(floppy_type)) - return -ENXIO; + down(&open_lock); old_dev = UDRS->fd_device; - if (UDRS->fd_ref && old_dev != minor(inode->i_rdev)) - return -EBUSY; + if (opened_bdev[drive] && opened_bdev[drive] != inode->i_bdev) + goto out2; if (!UDRS->fd_ref && (UDP->flags & FD_BROKEN_DCL)){ USETF(FD_DISK_CHANGED); @@ -3814,16 +3800,20 @@ if (UDRS->fd_ref == -1 || (UDRS->fd_ref && (filp->f_flags & O_EXCL))) - return -EBUSY; + goto out2; if (floppy_grab_irq_and_dma()) - return -EBUSY; + goto out2; if (filp->f_flags & O_EXCL) UDRS->fd_ref = -1; else UDRS->fd_ref++; + opened_bdev[drive] = inode->i_bdev; + + res = -ENXIO; + if (!floppy_track_buffer){ /* if opening an ED drive, reserve a big buffer, * else reserve a small one */ @@ -3843,7 +3833,7 @@ } if (!tmp && !floppy_track_buffer) { DPRINT("Unable to allocate DMA memory\n"); - RETERR(ENXIO); + goto out; } if (floppy_track_buffer) { if (tmp) @@ -3860,8 +3850,6 @@ if (old_dev != -1 && old_dev != minor(inode->i_rdev)) { if (buffer_drive == drive) buffer_track = -1; - /* umm, invalidate_buffers() in ->open?? --hch */ - invalidate_buffers(mk_kdev(FLOPPY_MAJOR,old_dev)); } #ifdef PC9800_DEBUG_FLOPPY @@ -3883,22 +3871,33 @@ printk("floppy open: floppy.c:%d passed\n", __LINE__); #endif - if (filp->f_flags & O_NDELAY) - return 0; - if (filp->f_mode & 3) { - UDRS->last_checked = 0; - check_disk_change(inode->i_bdev); - if (UTESTF(FD_DISK_CHANGED)) - RETERR(ENXIO); - } - if ((filp->f_mode & 2) && !(UTESTF(FD_DISK_WRITABLE))) - RETERR(EROFS); + if (!(filp->f_flags & O_NDELAY)) { + if (filp->f_mode & 3) { + UDRS->last_checked = 0; + check_disk_change(inode->i_bdev); + if (UTESTF(FD_DISK_CHANGED)) + goto out; + } + res = -EROFS; + if ((filp->f_mode & 2) && !(UTESTF(FD_DISK_WRITABLE))) + goto out; #ifdef PC9800_DEBUG_FLOPPY - printk("floppy open: end normally\n"); + printk("floppy open: end normally\n"); #endif - + } + up(&open_lock); return 0; -#undef RETERR +out: + if (UDRS->fd_ref < 0) + UDRS->fd_ref=0; + else + UDRS->fd_ref--; + if (!UDRS->fd_ref) + opened_bdev[drive] = NULL; + floppy_release_irq_and_dma(); +out2: + up(&open_lock); + return res; } /* @@ -4254,6 +4253,8 @@ !(allowed_drive_mask & (1 << drive)) || fdc_state[FDC(drive)].version == FDC_NONE) return NULL; + if (((*part>>2) & 0x1f) >= NUMBER(floppy_type)) + return NULL; return get_disk(disks[drive]); } diff -urN linux-2.5.68-bk5/drivers/block/ll_rw_blk.c linux-2.5.68-bk6/drivers/block/ll_rw_blk.c --- linux-2.5.68-bk5/drivers/block/ll_rw_blk.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/block/ll_rw_blk.c 2003-04-25 04:34:13.000000000 -0700 @@ -2196,6 +2196,21 @@ } } +void blk_rq_bio_prep(request_queue_t *q, struct request *rq, struct bio *bio) +{ + /* first three bits are identical in rq->flags and bio->bi_rw */ + rq->flags |= (bio->bi_rw & 7); + + rq->nr_phys_segments = bio_phys_segments(q, bio); + rq->nr_hw_segments = bio_hw_segments(q, bio); + rq->current_nr_sectors = bio_cur_sectors(bio); + rq->hard_cur_sectors = rq->current_nr_sectors; + rq->hard_nr_sectors = rq->nr_sectors = bio_sectors(bio); + rq->buffer = bio_data(bio); + + rq->bio = rq->biotail = bio; +} + int __init blk_dev_init(void) { int total_ram = nr_free_pages() << (PAGE_SHIFT - 10); @@ -2285,3 +2300,5 @@ EXPORT_SYMBOL(__blk_stop_queue); EXPORT_SYMBOL(blk_run_queue); EXPORT_SYMBOL(blk_run_queues); + +EXPORT_SYMBOL(blk_rq_bio_prep); diff -urN linux-2.5.68-bk5/drivers/block/paride/pcd.c linux-2.5.68-bk6/drivers/block/paride/pcd.c --- linux-2.5.68-bk5/drivers/block/paride/pcd.c 2003-04-19 19:51:12.000000000 -0700 +++ linux-2.5.68-bk6/drivers/block/paride/pcd.c 2003-04-25 04:34:13.000000000 -0700 @@ -761,7 +761,7 @@ static inline void next_request(int success) { - long saved_flags; + unsigned long saved_flags; spin_lock_irqsave(&pcd_lock, saved_flags); end_request(pcd_req, success); diff -urN linux-2.5.68-bk5/drivers/block/paride/pd.c linux-2.5.68-bk6/drivers/block/paride/pd.c --- linux-2.5.68-bk5/drivers/block/paride/pd.c 2003-04-19 19:50:36.000000000 -0700 +++ linux-2.5.68-bk6/drivers/block/paride/pd.c 2003-04-25 04:34:13.000000000 -0700 @@ -757,7 +757,7 @@ static int pd_next_buf(void) { - long saved_flags; + unsigned long saved_flags; pd_count--; pd_run--; @@ -777,7 +777,7 @@ static inline void next_request(int success) { - long saved_flags; + unsigned long saved_flags; spin_lock_irqsave(&pd_lock, saved_flags); end_request(pd_req, success); diff -urN linux-2.5.68-bk5/drivers/block/paride/pf.c linux-2.5.68-bk6/drivers/block/paride/pf.c --- linux-2.5.68-bk5/drivers/block/paride/pf.c 2003-04-19 19:50:07.000000000 -0700 +++ linux-2.5.68-bk6/drivers/block/paride/pf.c 2003-04-25 04:34:13.000000000 -0700 @@ -812,7 +812,7 @@ static int pf_next_buf(void) { - long saved_flags; + unsigned long saved_flags; pf_count--; pf_run--; @@ -832,7 +832,8 @@ static inline void next_request(int success) { - long saved_flags; + unsigned long saved_flags; + spin_lock_irqsave(&pf_spin_lock, saved_flags); end_request(pf_req, success); pf_busy = 0; diff -urN linux-2.5.68-bk5/drivers/block/paride/pt.c linux-2.5.68-bk6/drivers/block/paride/pt.c --- linux-2.5.68-bk5/drivers/block/paride/pt.c 2003-04-19 19:48:56.000000000 -0700 +++ linux-2.5.68-bk6/drivers/block/paride/pt.c 2003-04-25 04:34:13.000000000 -0700 @@ -661,8 +661,6 @@ int unit; struct mtop mtop; - if (!inode || kdev_none(inode->i_rdev)) - return -EINVAL; unit = DEVICE_NR(inode->i_rdev); if (unit >= PT_UNITS) return -EINVAL; diff -urN linux-2.5.68-bk5/drivers/block/ps2esdi.c linux-2.5.68-bk6/drivers/block/ps2esdi.c --- linux-2.5.68-bk5/drivers/block/ps2esdi.c 2003-04-19 19:48:46.000000000 -0700 +++ linux-2.5.68-bk6/drivers/block/ps2esdi.c 2003-04-25 04:34:13.000000000 -0700 @@ -77,7 +77,7 @@ static void ps2esdi_prep_dma(char *buffer, u_short length, u_char dma_xmode); -static void ps2esdi_interrupt_handler(int irq, void *dev_id, +static irqreturn_t ps2esdi_interrupt_handler(int irq, void *dev_id, struct pt_regs *regs); static void (*current_int_handler) (u_int) = NULL; static void ps2esdi_normal_interrupt_handler(u_int); @@ -613,18 +613,21 @@ static int ps2esdi_out_cmd_blk(u_short * cmd_blk) { - int i, j; + int i; + unsigned long jif; u_char status; /* enable interrupts */ outb(CTRL_ENABLE_INTR, ESDI_CONTROL); /* do not write to the controller, if it is busy */ - for (i = jiffies + ESDI_STAT_TIMEOUT; time_after(i, jiffies) && (inb(ESDI_STATUS) & - STATUS_BUSY);); + for (jif = jiffies + ESDI_STAT_TIMEOUT; + time_after(jif, jiffies) && + (inb(ESDI_STATUS) & STATUS_BUSY); ) + ; #if 0 - printk("%s: i(1)=%d\n", DEVICE_NAME, i); + printk("%s: i(1)=%ld\n", DEVICE_NAME, jif); #endif /* if device is still busy - then just time out */ @@ -642,8 +645,8 @@ /* one by one send each word out */ for (i = (((*cmd_blk) >> 14) + 1) << 1; i; i--) { status = inb(ESDI_STATUS); - for (j = jiffies + ESDI_STAT_TIMEOUT; - time_after(j, jiffies) && (status & STATUS_BUSY) && + for (jif = jiffies + ESDI_STAT_TIMEOUT; + time_after(jif, jiffies) && (status & STATUS_BUSY) && (status & STATUS_CMD_INF); status = inb(ESDI_STATUS)); if ((status & (STATUS_BUSY | STATUS_CMD_INF)) == STATUS_BUSY) { #if 0 @@ -681,7 +684,7 @@ -static void ps2esdi_interrupt_handler(int irq, void *dev_id, +static irqreturn_t ps2esdi_interrupt_handler(int irq, void *dev_id, struct pt_regs *regs) { u_int int_ret_code; @@ -695,8 +698,9 @@ } else printk("%s: help ! No interrupt handler.\n", DEVICE_NAME); } else { - return; + return IRQ_NONE; } + return IRQ_HANDLED; } static void ps2esdi_initial_reset_int_handler(u_int int_ret_code) diff -urN linux-2.5.68-bk5/drivers/block/scsi_ioctl.c linux-2.5.68-bk6/drivers/block/scsi_ioctl.c --- linux-2.5.68-bk5/drivers/block/scsi_ioctl.c 2003-04-19 19:51:16.000000000 -0700 +++ linux-2.5.68-bk6/drivers/block/scsi_ioctl.c 2003-04-25 04:34:13.000000000 -0700 @@ -183,9 +183,11 @@ } uaddr = (unsigned long) hdr.dxferp; - if (writing && !access_ok(VERIFY_WRITE, uaddr, bytes)) + /* writing to device -> reading from vm */ + if (writing && !access_ok(VERIFY_READ, uaddr, bytes)) return -EFAULT; - else if (reading && !access_ok(VERIFY_READ, uaddr, bytes)) + /* reading from device -> writing to vm */ + else if (reading && !access_ok(VERIFY_WRITE, uaddr, bytes)) return -EFAULT; /* @@ -193,18 +195,6 @@ * be a write to vm. */ bio = bio_map_user(bdev, uaddr, hdr.dxfer_len, reading); - if (bio) { - if (writing) - bio->bi_rw |= (1 << BIO_RW); - - nr_sectors = (bio->bi_size + 511) >> 9; - - if (bio->bi_size < hdr.dxfer_len) { - bio_endio(bio, bio->bi_size, 0); - bio_unmap_user(bio, 0); - bio = NULL; - } - } /* * if bio setup failed, fall back to slow approach @@ -243,21 +233,10 @@ rq->hard_nr_sectors = rq->nr_sectors = nr_sectors; rq->hard_cur_sectors = rq->current_nr_sectors = nr_sectors; - if (bio) { - /* - * subtle -- if bio_map_user() ended up bouncing a bio, it - * would normally disappear when its bi_end_io is run. - * however, we need it for the unmap, so grab an extra - * reference to it - */ - bio_get(bio); + rq->bio = rq->biotail = bio; - rq->nr_phys_segments = bio_phys_segments(q, bio); - rq->nr_hw_segments = bio_hw_segments(q, bio); - rq->current_nr_sectors = bio_cur_sectors(bio); - rq->hard_cur_sectors = rq->current_nr_sectors; - rq->buffer = bio_data(bio); - } + if (bio) + blk_rq_bio_prep(q, rq, bio); rq->data_len = hdr.dxfer_len; rq->data = buffer; @@ -268,8 +247,6 @@ if (!rq->timeout) rq->timeout = BLK_DEFAULT_TIMEOUT; - rq->bio = rq->biotail = bio; - start_time = jiffies; /* ignore return value. All information is passed back to caller @@ -277,11 +254,9 @@ * N.B. a non-zero SCSI status is _not_ necessarily an error. */ blk_do_rq(q, bdev, rq); - - if (bio) { + + if (bio) bio_unmap_user(bio, reading); - bio_put(bio); - } /* write to all output members */ hdr.status = rq->errors; diff -urN linux-2.5.68-bk5/drivers/block/xd.c linux-2.5.68-bk6/drivers/block/xd.c --- linux-2.5.68-bk5/drivers/block/xd.c 2003-04-19 19:50:38.000000000 -0700 +++ linux-2.5.68-bk6/drivers/block/xd.c 2003-04-25 04:34:13.000000000 -0700 @@ -446,17 +446,20 @@ } /* xd_interrupt_handler: interrupt service routine */ -static void xd_interrupt_handler(int irq, void *dev_id, struct pt_regs * regs) +static irqreturn_t xd_interrupt_handler(int irq, void *dev_id, + struct pt_regs *regs) { if (inb(XD_STATUS) & STAT_INTERRUPT) { /* check if it was our device */ #ifdef DEBUG_OTHER printk("xd_interrupt_handler: interrupt detected\n"); #endif /* DEBUG_OTHER */ outb(0,XD_CONTROL); /* acknowledge interrupt */ - wake_up(&xd_wait_int); /* and wake up sleeping processes */ + wake_up(&xd_wait_int); /* and wake up sleeping processes */ + return IRQ_HANDLED; } else printk("xd: unexpected interrupt\n"); + return IRQ_NONE; } /* xd_setup_dma: set up the DMA controller for a data transfer */ diff -urN linux-2.5.68-bk5/drivers/block/xd.h linux-2.5.68-bk6/drivers/block/xd.h --- linux-2.5.68-bk5/drivers/block/xd.h 2003-04-19 19:50:42.000000000 -0700 +++ linux-2.5.68-bk6/drivers/block/xd.h 2003-04-25 04:34:13.000000000 -0700 @@ -13,6 +13,8 @@ * Also thanks to: Salvador Abreu, Dave Thaler, Risto Kankkunen and Wim Van Dorst. */ +#include + /* XT hard disk controller registers */ #define XD_DATA (xd_iobase + 0x00) /* data RW register */ #define XD_RESET (xd_iobase + 0x01) /* reset WO register */ @@ -107,7 +109,8 @@ static int xd_readwrite (u_char operation,XD_INFO *disk,char *buffer,u_int block,u_int count); static void xd_recalibrate (u_char drive); -static void xd_interrupt_handler (int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t xd_interrupt_handler(int irq, void *dev_id, + struct pt_regs *regs); static u_char xd_setup_dma (u_char opcode,u_char *buffer,u_int count); static u_char *xd_build (u_char *cmdblk,u_char command,u_char drive,u_char head,u_short cylinder,u_char sector,u_char count,u_char control); static void xd_watchdog (unsigned long unused); diff -urN linux-2.5.68-bk5/drivers/cdrom/cdu31a.c linux-2.5.68-bk6/drivers/cdrom/cdu31a.c --- linux-2.5.68-bk5/drivers/cdrom/cdu31a.c 2003-04-19 19:50:10.000000000 -0700 +++ linux-2.5.68-bk6/drivers/cdrom/cdu31a.c 2003-04-25 04:34:13.000000000 -0700 @@ -451,7 +451,7 @@ */ static int scd_reset(struct cdrom_device_info *cdi) { - int retry_count; + unsigned long retry_count; reset_drive(); @@ -511,7 +511,7 @@ outb(cmd, sony_cd_cmd_reg); } -static void cdu31a_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t cdu31a_interrupt(int irq, void *dev_id, struct pt_regs *regs) { unsigned char val; @@ -545,6 +545,7 @@ printk ("CDU31A: Got an interrupt but nothing was waiting\n"); } + return IRQ_HANDLED; } /* @@ -712,7 +713,7 @@ { unsigned char res_reg[12]; unsigned int res_size; - unsigned int retry_count; + unsigned long retry_count; printk("cdu31a: Resetting drive on error\n"); @@ -772,7 +773,7 @@ { unsigned char a, b; int i; - unsigned int retry_count; + unsigned long retry_count; while (handle_sony_cd_attention()); @@ -900,7 +901,7 @@ unsigned int num_params, unsigned char *result_buffer, unsigned int *result_size) { - unsigned int retry_count; + unsigned long retry_count; int num_retries; int recursive_call; unsigned long flags; @@ -1148,7 +1149,7 @@ { unsigned char params[6]; unsigned int read_size; - unsigned int retry_count; + unsigned long retry_count; #if DEBUG @@ -1339,7 +1340,7 @@ unsigned int nblocks, unsigned char res_reg[], int *res_size) { - unsigned int retry_count; + unsigned long retry_count; unsigned int bytesleft; unsigned int offset; unsigned int skip; @@ -2372,7 +2373,7 @@ static void read_audio_data(char *buffer, unsigned char res_reg[], int *res_size) { - unsigned int retry_count; + unsigned long retry_count; int result_read; @@ -3206,7 +3207,7 @@ get_drive_configuration(unsigned short base_io, unsigned char res_reg[], unsigned int *res_size) { - int retry_count; + unsigned long retry_count; /* Set the base address */ diff -urN linux-2.5.68-bk5/drivers/cdrom/cm206.c linux-2.5.68-bk6/drivers/cdrom/cm206.c --- linux-2.5.68-bk5/drivers/cdrom/cm206.c 2003-04-19 19:50:48.000000000 -0700 +++ linux-2.5.68-bk6/drivers/cdrom/cm206.c 2003-04-25 04:34:13.000000000 -0700 @@ -360,8 +360,7 @@ as there seems so reason for this to happen. */ -static void cm206_interrupt(int sig, void *dev_id, struct pt_regs *regs) -/* you rang? */ +static irqreturn_t cm206_interrupt(int sig, void *dev_id, struct pt_regs *regs) { volatile ush fool; cd->intr_ds = inw(r_data_status); /* resets data_ready, data_error, @@ -436,6 +435,7 @@ || cd->fifo_overflowed)) tasklet_schedule(&cm206_tasklet); /* issue a stop read command */ stats(interrupt); + return IRQ_HANDLED; } /* we have put the address of the wait queue in who */ diff -urN linux-2.5.68-bk5/drivers/cdrom/mcd.c linux-2.5.68-bk6/drivers/cdrom/mcd.c --- linux-2.5.68-bk5/drivers/cdrom/mcd.c 2003-04-19 19:50:02.000000000 -0700 +++ linux-2.5.68-bk6/drivers/cdrom/mcd.c 2003-04-25 04:34:13.000000000 -0700 @@ -623,7 +623,7 @@ * Just take the interrupt and clear out the status reg. */ -static void mcd_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t mcd_interrupt(int irq, void *dev_id, struct pt_regs *regs) { int st; @@ -635,6 +635,7 @@ if ((st & 0xFF) != 0xFF) mcd_error = st ? st & 0xFF : -1; } + return IRQ_HANDLED; } diff -urN linux-2.5.68-bk5/drivers/cdrom/mcdx.c linux-2.5.68-bk6/drivers/cdrom/mcdx.c --- linux-2.5.68-bk5/drivers/cdrom/mcdx.c 2003-04-19 19:49:26.000000000 -0700 +++ linux-2.5.68-bk6/drivers/cdrom/mcdx.c 2003-04-25 04:34:13.000000000 -0700 @@ -260,9 +260,6 @@ addresses, such as mcdx_open and mcdx_close in the structure mcdx_dops. */ -/* ??? exported by the mcdx_sigaction struct */ -static void mcdx_intr(int, void *, struct pt_regs *); - /* exported by file_ops */ static int mcdx_open(struct cdrom_device_info *cdi, int purpose); static void mcdx_close(struct cdrom_device_info *cdi); @@ -854,7 +851,7 @@ } } -static void mcdx_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t mcdx_intr(int irq, void *dev_id, struct pt_regs *regs) { struct s_drive_stuff *stuffp; unsigned char b; @@ -863,7 +860,7 @@ if (stuffp == NULL) { xwarn("mcdx: no device for intr %d\n", irq); - return; + return IRQ_NONE; } #ifdef AK2 if (!stuffp->busy && stuffp->pending) @@ -895,6 +892,7 @@ stuffp->busy = 0; wake_up_interruptible(&stuffp->busyq); + return IRQ_HANDLED; } diff -urN linux-2.5.68-bk5/drivers/cdrom/sonycd535.c linux-2.5.68-bk6/drivers/cdrom/sonycd535.c --- linux-2.5.68-bk5/drivers/cdrom/sonycd535.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/cdrom/sonycd535.c 2003-04-25 04:34:13.000000000 -0700 @@ -317,15 +317,17 @@ #endif } -static void +static irqreturn_t cdu535_interrupt(int irq, void *dev_id, struct pt_regs *regs) { disable_interrupts(); - if (waitqueue_active(&cdu535_irq_wait)) + if (waitqueue_active(&cdu535_irq_wait)) { wake_up(&cdu535_irq_wait); - else - printk(CDU535_MESSAGE_NAME - ": Got an interrupt but nothing was waiting\n"); + return IRQ_HANDLED; + } + printk(CDU535_MESSAGE_NAME + ": Got an interrupt but nothing was waiting\n"); + return IRQ_NONE; } diff -urN linux-2.5.68-bk5/drivers/char/amiserial.c linux-2.5.68-bk6/drivers/char/amiserial.c --- linux-2.5.68-bk5/drivers/char/amiserial.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/amiserial.c 2003-04-25 04:34:13.000000000 -0700 @@ -2288,9 +2288,10 @@ custom.intena = IF_SETCLR | (intena & IF_TBE); } -static kdev_t serial_console_device(struct console *c) +static struct tty_driver *serial_console_device(struct console *c, int *index) { - return mk_kdev(TTY_MAJOR, 64); + *index = 0; + return &serial_driver; } static struct console sercons = { diff -urN linux-2.5.68-bk5/drivers/char/cyclades.c linux-2.5.68-bk6/drivers/char/cyclades.c --- linux-2.5.68-bk5/drivers/char/cyclades.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/cyclades.c 2003-04-25 04:34:13.000000000 -0700 @@ -1090,7 +1090,7 @@ whenever the card wants its hand held--chars received, out buffer empty, modem change, etc. */ -static void +static irqreturn_t cyy_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct tty_struct *tty; @@ -1113,7 +1113,7 @@ #ifdef CY_DEBUG_INTERRUPTS printk("cyy_interrupt: spurious interrupt %d\n\r", irq); #endif - return; /* spurious interrupt */ + return IRQ_NONE; /* spurious interrupt */ } card_base_addr = (unsigned char *)cinfo->base_addr; @@ -1500,6 +1500,7 @@ cy_writeb((u_long)card_base_addr + (Cy_ClrIntr<card_lock); + return IRQ_HANDLED; } /* cyy_interrupt */ /***********************************************************/ @@ -1881,7 +1882,7 @@ } #ifdef CONFIG_CYZ_INTR -static void +static irqreturn_t cyz_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct cyclades_card *cinfo; @@ -1890,20 +1891,20 @@ #ifdef CY_DEBUG_INTERRUPTS printk("cyz_interrupt: spurious interrupt %d\n\r", irq); #endif - return; /* spurious interrupt */ + return IRQ_NONE; /* spurious interrupt */ } if (!ISZLOADED(*cinfo)) { #ifdef CY_DEBUG_INTERRUPTS printk("cyz_interrupt: board not yet loaded (IRQ%d).\n\r", irq); #endif - return; + return IRQ_NONE; } /* Handle the interrupts */ cyz_handle_cmd(cinfo); - return; + return IRQ_HANDLED; } /* cyz_interrupt */ static void diff -urN linux-2.5.68-bk5/drivers/char/drm/drmP.h linux-2.5.68-bk6/drivers/char/drm/drmP.h --- linux-2.5.68-bk5/drivers/char/drm/drmP.h 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/drm/drmP.h 2003-04-25 04:34:13.000000000 -0700 @@ -48,7 +48,6 @@ #include #include #include -#include #include #include #include /* For (un)lock_kernel */ diff -urN linux-2.5.68-bk5/drivers/char/drm/drm_memory.h linux-2.5.68-bk6/drivers/char/drm/drm_memory.h --- linux-2.5.68-bk5/drivers/char/drm/drm_memory.h 2003-04-19 19:48:53.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/drm/drm_memory.h 2003-04-25 04:34:13.000000000 -0700 @@ -31,7 +31,6 @@ #include #include "drmP.h" -#include typedef struct drm_mem_stats { const char *name; @@ -251,7 +250,7 @@ for (addr = address, sz = bytes; sz > 0; addr += PAGE_SIZE, sz -= PAGE_SIZE) { - mem_map_reserve(virt_to_page(addr)); + SetPageReserved(virt_to_page(addr)); } return address; @@ -272,7 +271,7 @@ for (addr = address, sz = bytes; sz > 0; addr += PAGE_SIZE, sz -= PAGE_SIZE) { - mem_map_unreserve(virt_to_page(addr)); + ClearPageReserved(virt_to_page(addr)); } free_pages(address, order); } diff -urN linux-2.5.68-bk5/drivers/char/dz.c linux-2.5.68-bk6/drivers/char/dz.c --- linux-2.5.68-bk5/drivers/char/dz.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/dz.c 2003-04-25 04:34:13.000000000 -0700 @@ -1502,9 +1502,10 @@ } } -static kdev_t dz_console_device(struct console *c) +static struct tty_driver *dz_console_device(struct console *c, int *index) { - return mk_kdev(TTY_MAJOR, 64 + c->index); + *index = c->index; + return &serial_driver; } static int __init dz_console_setup(struct console *co, char *options) diff -urN linux-2.5.68-bk5/drivers/char/esp.c linux-2.5.68-bk6/drivers/char/esp.c --- linux-2.5.68-bk5/drivers/char/esp.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/esp.c 2003-04-25 04:34:13.000000000 -0700 @@ -653,7 +653,8 @@ /* * This is the serial driver's interrupt routine */ -static void rs_interrupt_single(int irq, void *dev_id, struct pt_regs * regs) +static irqreturn_t rs_interrupt_single(int irq, void *dev_id, + struct pt_regs *regs) { struct esp_struct * info; unsigned err_status; @@ -670,7 +671,7 @@ if (!info->tty) { sti(); - return; + return IRQ_NONE; } if (scratch & 0x04) { /* error */ @@ -753,6 +754,7 @@ printk("end.\n"); #endif sti(); + return IRQ_HANDLED; } /* diff -urN linux-2.5.68-bk5/drivers/char/ftape/lowlevel/fdc-io.c linux-2.5.68-bk6/drivers/char/ftape/lowlevel/fdc-io.c --- linux-2.5.68-bk5/drivers/char/ftape/lowlevel/fdc-io.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/ftape/lowlevel/fdc-io.c 2003-04-25 04:34:13.000000000 -0700 @@ -1311,7 +1311,6 @@ } else { TRACE(ft_t_bug, "Unexpected ftape interrupt"); } - TRACE_EXIT; return IRQ_RETVAL(handled); } diff -urN linux-2.5.68-bk5/drivers/char/ftape/lowlevel/ftape-buffer.c linux-2.5.68-bk6/drivers/char/ftape/lowlevel/ftape-buffer.c --- linux-2.5.68-bk5/drivers/char/ftape/lowlevel/ftape-buffer.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/ftape/lowlevel/ftape-buffer.c 2003-04-25 04:34:13.000000000 -0700 @@ -27,7 +27,6 @@ #include #include #include -#include #include #include diff -urN linux-2.5.68-bk5/drivers/char/ftape/lowlevel/ftape-ctl.c linux-2.5.68-bk6/drivers/char/ftape/lowlevel/ftape-ctl.c --- linux-2.5.68-bk5/drivers/char/ftape/lowlevel/ftape-ctl.c 2003-04-19 19:51:13.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/ftape/lowlevel/ftape-ctl.c 2003-04-25 04:34:13.000000000 -0700 @@ -29,7 +29,6 @@ #include #include #include -#include #include #include diff -urN linux-2.5.68-bk5/drivers/char/ftape/zftape/zftape-init.c linux-2.5.68-bk6/drivers/char/ftape/zftape/zftape-init.c --- linux-2.5.68-bk5/drivers/char/ftape/zftape/zftape-init.c 2003-04-19 19:49:10.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/ftape/zftape/zftape-init.c 2003-04-25 04:34:13.000000000 -0700 @@ -33,7 +33,6 @@ #include #endif #include -#include #include #include diff -urN linux-2.5.68-bk5/drivers/char/hvc_console.c linux-2.5.68-bk6/drivers/char/hvc_console.c --- linux-2.5.68-bk5/drivers/char/hvc_console.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/hvc_console.c 2003-04-25 04:34:13.000000000 -0700 @@ -324,9 +324,10 @@ } } -static kdev_t hvc_console_device(struct console *c) +static struct tty_driver *hvc_console_device(struct console *c, int *index) { - return mk_kdev(HVC_MAJOR, HVC_MINOR + c->index); + *index = c->index; + return &hvc_driver; } static int __init hvc_console_setup(struct console *co, char *options) diff -urN linux-2.5.68-bk5/drivers/char/ip2main.c linux-2.5.68-bk6/drivers/char/ip2main.c --- linux-2.5.68-bk5/drivers/char/ip2main.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/ip2main.c 2003-04-25 04:34:13.000000000 -0700 @@ -274,7 +274,7 @@ static void set_irq(int, int); static void ip2_interrupt_bh(i2eBordStrPtr pB); -static void ip2_interrupt(int irq, void *dev_id, struct pt_regs * regs); +static irqreturn_t ip2_interrupt(int irq, void *dev_id, struct pt_regs * regs); static void ip2_poll(unsigned long arg); static inline void service_all_boards(void); static void do_input(void *p); @@ -1339,11 +1339,12 @@ /* */ /* */ /******************************************************************************/ -static void +static irqreturn_t ip2_interrupt(int irq, void *dev_id, struct pt_regs * regs) { int i; i2eBordStrPtr pB; + int handled = 0; ip2trace (ITRC_NO_PORT, ITRC_INTR, 99, 1, irq ); @@ -1355,6 +1356,7 @@ // IRQ = 0 for polled boards, we won't poll "IRQ" boards if ( pB && (pB->i2eUsingIrq == irq) ) { + handled = 1; #ifdef USE_IQI if (NO_MAIL_HERE != ( pB->i2eStartMail = iiGetMail(pB))) { @@ -1379,6 +1381,7 @@ ++irq_counter; ip2trace (ITRC_NO_PORT, ITRC_INTR, ITRC_RETURN, 0 ); + return IRQ_RETVAL(handled); } /******************************************************************************/ diff -urN linux-2.5.68-bk5/drivers/char/isicom.c linux-2.5.68-bk6/drivers/char/isicom.c --- linux-2.5.68-bk5/drivers/char/isicom.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/isicom.c 2003-04-25 04:34:13.000000000 -0700 @@ -509,7 +509,8 @@ } /* main interrupt handler routine */ -static void isicom_interrupt(int irq, void * dev_id, struct pt_regs * regs) +static irqreturn_t isicom_interrupt(int irq, void *dev_id, + struct pt_regs *regs) { struct isi_board * card; struct isi_port * port; @@ -534,7 +535,7 @@ if (!card || !(card->status & FIRMWARE_LOADED)) { /* printk(KERN_DEBUG "ISICOM: interrupt: not handling irq%d!.\n", irq);*/ - return; + return IRQ_NONE; } base = card->base; @@ -561,7 +562,7 @@ ClearInterrupt(base); else outw(0x0000, base+0x04); /* enable interrupts */ - return; + return IRQ_HANDLED; } port = card->ports + channel; if (!(port->flags & ASYNC_INITIALIZED)) { @@ -569,7 +570,7 @@ ClearInterrupt(base); else outw(0x0000, base+0x04); /* enable interrupts */ - return; + return IRQ_HANDLED; } tty = port->tty; @@ -702,7 +703,7 @@ ClearInterrupt(base); else outw(0x0000, base+0x04); /* enable interrupts */ - return; + return IRQ_HANDLED; } /* called with interrupts disabled */ diff -urN linux-2.5.68-bk5/drivers/char/lp.c linux-2.5.68-bk6/drivers/char/lp.c --- linux-2.5.68-bk5/drivers/char/lp.c 2003-04-19 19:48:49.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/lp.c 2003-04-25 04:34:13.000000000 -0700 @@ -733,15 +733,9 @@ parport_release (dev); } -static kdev_t lp_console_device (struct console *c) -{ - return mk_kdev(LP_MAJOR, CONSOLE_LP); -} - static struct console lpcons = { .name = "lp", .write = lp_console_write, - .device = lp_console_device, .flags = CON_PRINTBUFFER, }; diff -urN linux-2.5.68-bk5/drivers/char/lp_old98.c linux-2.5.68-bk6/drivers/char/lp_old98.c --- linux-2.5.68-bk5/drivers/char/lp_old98.c 2003-04-19 19:48:57.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/lp_old98.c 2003-04-25 04:34:13.000000000 -0700 @@ -441,15 +441,9 @@ } } -static kdev_t lp_old98_console_device(struct console *console) -{ - return mk_kdev(LP_MAJOR, 0); -} - static struct console lp_old98_console = { .name = "lp_old98", .write = lp_old98_console_write, - .device = lp_old98_console_device, .flags = CON_PRINTBUFFER, .index = -1, }; diff -urN linux-2.5.68-bk5/drivers/char/mxser.c linux-2.5.68-bk6/drivers/char/mxser.c --- linux-2.5.68-bk5/drivers/char/mxser.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/mxser.c 2003-04-25 04:34:13.000000000 -0700 @@ -348,7 +348,7 @@ static void mxser_stop(struct tty_struct *); static void mxser_start(struct tty_struct *); static void mxser_hangup(struct tty_struct *); -static void mxser_interrupt(int, void *, struct pt_regs *); +static irqreturn_t mxser_interrupt(int, void *, struct pt_regs *); static inline void mxser_receive_chars(struct mxser_struct *, int *); static inline void mxser_transmit_chars(struct mxser_struct *); static inline void mxser_check_modem_status(struct mxser_struct *, int); @@ -1362,13 +1362,14 @@ /* * This is the serial driver's generic interrupt routine */ -static void mxser_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t mxser_interrupt(int irq, void *dev_id, struct pt_regs *regs) { int status, i; struct mxser_struct *info; struct mxser_struct *port; int max, irqbits, bits, msr; int pass_counter = 0; + int handled = 0; port = 0; for (i = 0; i < MXSER_BOARDS; i++) { @@ -1379,15 +1380,16 @@ } if (i == MXSER_BOARDS) - return; + return IRQ_NONE; if (port == 0) - return; + return IRQ_NONE; max = mxser_numports[mxsercfg[i].board_type]; while (1) { irqbits = inb(port->vector) & port->vectormask; if (irqbits == port->vectormask) break; + handled = 1; for (i = 0, bits = 1; i < max; i++, irqbits |= bits, bits <<= 1) { if (irqbits == port->vectormask) break; @@ -1417,6 +1419,7 @@ break; /* Prevent infinite loops */ } } + return IRQ_RETVAL(handled); } static inline void mxser_receive_chars(struct mxser_struct *info, diff -urN linux-2.5.68-bk5/drivers/char/rio/rio_linux.c linux-2.5.68-bk6/drivers/char/rio/rio_linux.c --- linux-2.5.68-bk5/drivers/char/rio/rio_linux.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/rio/rio_linux.c 2003-04-25 04:34:13.000000000 -0700 @@ -445,7 +445,7 @@ } -static void rio_interrupt (int irq, void *ptr, struct pt_regs *regs) +static irqreturn_t rio_interrupt (int irq, void *ptr, struct pt_regs *regs) { struct Host *HostP; func_enter (); @@ -506,7 +506,7 @@ if (test_and_set_bit (RIO_BOARD_INTR_LOCK, &HostP->locks)) { printk (KERN_ERR "Recursive interrupt! (host %d/irq%d)\n", (int) ptr, HostP->Ivec); - return; + return IRQ_HANDLED; } RIOServiceHost(p, HostP, irq); @@ -518,6 +518,7 @@ rio_dprintk (RIO_DEBUG_IFLOW, "rio: exit rio_interrupt (%d/%d)\n", irq, HostP->Ivec); func_exit (); + return IRQ_HANDLED; } diff -urN linux-2.5.68-bk5/drivers/char/riscom8.c linux-2.5.68-bk6/drivers/char/riscom8.c --- linux-2.5.68-bk5/drivers/char/riscom8.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/riscom8.c 2003-04-25 04:34:13.000000000 -0700 @@ -590,23 +590,24 @@ } /* The main interrupt processing routine */ -static void rc_interrupt(int irq, void * dev_id, struct pt_regs * regs) +static irqreturn_t rc_interrupt(int irq, void * dev_id, struct pt_regs * regs) { unsigned char status; unsigned char ack; struct riscom_board *bp; unsigned long loop = 0; - + int handled = 0; + bp = IRQ_to_board[irq]; if (!bp || !(bp->flags & RC_BOARD_ACTIVE)) { - return; + return IRQ_NONE; } while ((++loop < 16) && ((status = ~(rc_in(bp, RC_BSR))) & (RC_BSR_TOUT | RC_BSR_TINT | RC_BSR_MINT | RC_BSR_RINT))) { - + handled = 1; if (status & RC_BSR_TOUT) printk(KERN_WARNING "rc%d: Got timeout. Hardware " "error?\n", board_No(bp)); @@ -648,6 +649,7 @@ rc_out(bp, CD180_EOIR, 0); /* Mark end of interrupt */ rc_out(bp, RC_CTOUT, 0); /* Clear timeout flag */ } + return IRQ_RETVAL(handled); } /* diff -urN linux-2.5.68-bk5/drivers/char/serial167.c linux-2.5.68-bk6/drivers/char/serial167.c --- linux-2.5.68-bk5/drivers/char/serial167.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/serial167.c 2003-04-25 04:34:13.000000000 -0700 @@ -2814,9 +2814,10 @@ local_irq_restore(flags); } -static kdev_t serial167_console_device(struct console *c) +static struct tty_driver *serial167_console_device(struct console *c, int *index) { - return mk_kdev(TTY_MAJOR, 64 + c->index); + *index = c->index; + return &cy_serial_driver; } diff -urN linux-2.5.68-bk5/drivers/char/serial_tx3912.c linux-2.5.68-bk6/drivers/char/serial_tx3912.c --- linux-2.5.68-bk5/drivers/char/serial_tx3912.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/serial_tx3912.c 2003-04-25 04:34:13.000000000 -0700 @@ -1004,9 +1004,10 @@ } } -static kdev_t serial_console_device(struct console *c) +static struct tty_driver *serial_console_device(struct console *c, int *index) { - return mk_kdev(TTY_MAJOR, 64 + c->index); + *index = c->index; + return &rs_driver; } static __init int serial_console_setup(struct console *co, char *options) diff -urN linux-2.5.68-bk5/drivers/char/sh-sci.c linux-2.5.68-bk6/drivers/char/sh-sci.c --- linux-2.5.68-bk5/drivers/char/sh-sci.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/sh-sci.c 2003-04-25 04:34:13.000000000 -0700 @@ -1179,9 +1179,10 @@ put_string(sercons_port, s, count); } -static kdev_t serial_console_device(struct console *c) +static struct tty_driver *serial_console_device(struct console *c, int *index) { - return mk_kdev(SCI_MAJOR, SCI_MINOR_START + c->index); + *index = c->index; + return &sci_driver; } /* diff -urN linux-2.5.68-bk5/drivers/char/specialix.c linux-2.5.68-bk6/drivers/char/specialix.c --- linux-2.5.68-bk5/drivers/char/specialix.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/specialix.c 2003-04-25 04:34:13.000000000 -0700 @@ -204,7 +204,7 @@ #ifdef SPECIALIX_TIMER static struct timer_list missed_irq_timer; -static void sx_interrupt(int irq, void * dev_id, struct pt_regs * regs); +static irqreturn_t sx_interrupt(int irq, void * dev_id, struct pt_regs * regs); #endif @@ -876,7 +876,7 @@ /* The main interrupt processing routine */ -static void sx_interrupt(int irq, void * dev_id, struct pt_regs * regs) +static irqreturn_t sx_interrupt(int irq, void *dev_id, struct pt_regs *regs) { unsigned char status; unsigned char ack; @@ -890,7 +890,7 @@ #ifdef SPECIALIX_DEBUG printk (KERN_DEBUG "sx: False interrupt. irq %d.\n", irq); #endif - return; + return IRQ_NONE; } saved_reg = bp->reg; @@ -933,6 +933,7 @@ } bp->reg = saved_reg; outb (bp->reg, bp->base + SX_ADDR_REG); + return IRQ_HANDLED; } diff -urN linux-2.5.68-bk5/drivers/char/stallion.c linux-2.5.68-bk6/drivers/char/stallion.c --- linux-2.5.68-bk5/drivers/char/stallion.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/stallion.c 2003-04-25 04:34:13.000000000 -0700 @@ -530,7 +530,6 @@ static int stl_getbrdstruct(unsigned long arg); static int stl_waitcarrier(stlport_t *portp, struct file *filp); static void stl_delay(int len); -static void stl_intr(int irq, void *dev_id, struct pt_regs *regs); static void stl_eiointr(stlbrd_t *brdp); static void stl_echatintr(stlbrd_t *brdp); static void stl_echmcaintr(stlbrd_t *brdp); @@ -2085,10 +2084,11 @@ * calls off to the approrpriate board interrupt handlers. */ -static void stl_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t stl_intr(int irq, void *dev_id, struct pt_regs *regs) { stlbrd_t *brdp; int i; + int handled = 0; #if DEBUG printk("stl_intr(irq=%d,regs=%x)\n", irq, (int) regs); @@ -2099,8 +2099,10 @@ continue; if (brdp->state == 0) continue; + handled = 1; (* brdp->isr)(brdp); } + return IRQ_RETVAL(handled); } /*****************************************************************************/ diff -urN linux-2.5.68-bk5/drivers/char/sx.c linux-2.5.68-bk6/drivers/char/sx.c --- linux-2.5.68-bk5/drivers/char/sx.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/sx.c 2003-04-25 04:34:13.000000000 -0700 @@ -1202,7 +1202,7 @@ * Small, elegant, clear. */ -static void sx_interrupt (int irq, void *ptr, struct pt_regs *regs) +static irqreturn_t sx_interrupt (int irq, void *ptr, struct pt_regs *regs) { struct sx_board *board = ptr; struct sx_port *port; @@ -1269,12 +1269,14 @@ } } - if (!sx_initialized) return; - if (!(board->flags & SX_BOARD_INITIALIZED)) return; + if (!sx_initialized) + return IRQ_HANDLED; + if (!(board->flags & SX_BOARD_INITIALIZED)) + return IRQ_HANDLED; if (test_and_set_bit (SX_BOARD_INTR_LOCK, &board->locks)) { printk (KERN_ERR "Recursive interrupt! (%d)\n", board->irq); - return; + return IRQ_HANDLED; } for (i=0;inports;i++) { @@ -1298,6 +1300,7 @@ sx_dprintk (SX_DEBUG_FLOW, "sx: exit sx_interrupt (%d/%d)\n", irq, board->irq); /* func_exit (); */ + return IRQ_HANDLED; } diff -urN linux-2.5.68-bk5/drivers/char/synclink.c linux-2.5.68-bk6/drivers/char/synclink.c --- linux-2.5.68-bk5/drivers/char/synclink.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/synclink.c 2003-04-25 04:34:13.000000000 -0700 @@ -1704,7 +1704,7 @@ * * Return Value: None */ -static void mgsl_interrupt(int irq, void *dev_id, struct pt_regs * regs) +static irqreturn_t mgsl_interrupt(int irq, void *dev_id, struct pt_regs * regs) { struct mgsl_struct * info; u16 UscVector; @@ -1716,7 +1716,7 @@ info = (struct mgsl_struct *)dev_id; if (!info) - return; + return IRQ_NONE; spin_lock(&info->irq_spinlock); @@ -1766,7 +1766,7 @@ if ( debug_level >= DEBUG_LEVEL_ISR ) printk("%s(%d):mgsl_interrupt(%d)exit.\n", __FILE__,__LINE__,irq); - + return IRQ_HANDLED; } /* end of mgsl_interrupt() */ /* startup() diff -urN linux-2.5.68-bk5/drivers/char/synclinkmp.c linux-2.5.68-bk6/drivers/char/synclinkmp.c --- linux-2.5.68-bk5/drivers/char/synclinkmp.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/synclinkmp.c 2003-04-25 04:34:13.000000000 -0700 @@ -652,7 +652,6 @@ static void isr_txdmaok(SLMP_INFO *info); static void isr_txdmaerror(SLMP_INFO *info); static void isr_io_pin(SLMP_INFO *info, u16 status); -static void synclinkmp_interrupt(int irq, void *dev_id, struct pt_regs * regs); static int alloc_dma_bufs(SLMP_INFO *info); static void free_dma_bufs(SLMP_INFO *info); @@ -2446,7 +2445,8 @@ * dev_id device ID supplied during interrupt registration * regs interrupted processor context */ -static void synclinkmp_interrupt(int irq, void *dev_id, struct pt_regs * regs) +static irqreturn_t synclinkmp_interrupt(int irq, void *dev_id, + struct pt_regs *regs) { SLMP_INFO * info; unsigned char status, status0, status1=0; @@ -2462,7 +2462,7 @@ info = (SLMP_INFO *)dev_id; if (!info) - return; + return IRQ_NONE; spin_lock(&info->lock); @@ -2564,6 +2564,7 @@ if ( debug_level >= DEBUG_LEVEL_ISR ) printk("%s(%d):synclinkmp_interrupt(%d)exit.\n", __FILE__,__LINE__,irq); + return IRQ_HANDLED; } /* Initialize and start device. diff -urN linux-2.5.68-bk5/drivers/char/tpqic02.c linux-2.5.68-bk6/drivers/char/tpqic02.c --- linux-2.5.68-bk5/drivers/char/tpqic02.c 2003-04-19 19:49:29.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/tpqic02.c 2003-04-25 04:34:13.000000000 -0700 @@ -509,7 +509,7 @@ static int wait_for_ready(time_t timeout) { int stat; - time_t spin_t; + unsigned long spin_t; /* Wait for ready or exception, without driving the loadavg up too much. * In most cases, the tape drive already has READY asserted, @@ -1604,7 +1604,7 @@ * When we are finished, set flags to indicate end, disable timer. * NOTE: This *must* be fast! */ -static void qic02_tape_interrupt(int irq, void *dev_id, +static irqreturn_t qic02_tape_interrupt(int irq, void *dev_id, struct pt_regs *regs) { int stat, r, i; @@ -1622,7 +1622,7 @@ if (((stat & (AR_STAT_DMADONE)) == 0) && ((stat & (QIC02_STAT_EXCEPTION)) != 0)) { TIMERCONT; - return; /* "Linux with IRQ sharing" */ + return IRQ_NONE;/* "Linux with IRQ sharing" */ } } @@ -1642,7 +1642,7 @@ dma_mode = 0; /* wake up rw() */ status_expect_int = NO; wake_up(&qic02_tape_transfer); - return; + return IRQ_HANDLED; } /* return if tape controller not ready, or * if dma channel hasn't finished last byte yet. @@ -1668,7 +1668,7 @@ release_dma_lock(flags); if (r) - return; + return IRQ_HANDLED; /* finish DMA cycle */ @@ -1688,6 +1688,7 @@ } else { printk(TPQIC02_NAME ": Unexpected interrupt, stat == %x\n", inb(QIC02_STAT_PORT)); } + return IRQ_HANDLED; } /* qic02_tape_interrupt */ diff -urN linux-2.5.68-bk5/drivers/char/tty_io.c linux-2.5.68-bk6/drivers/char/tty_io.c --- linux-2.5.68-bk5/drivers/char/tty_io.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/tty_io.c 2003-04-25 04:34:13.000000000 -0700 @@ -1315,26 +1315,36 @@ if (IS_TTY_DEV(device)) { if (!current->tty) return -ENXIO; - device = to_kdev_t(current->tty->device); + driver = current->tty->driver; + index = current->tty->index; filp->f_flags |= O_NONBLOCK; /* Don't let /dev/tty block */ /* noctty = 1; */ + goto got_driver; } #ifdef CONFIG_VT if (IS_CONSOLE_DEV(device)) { extern int fg_console; - device = mk_kdev(TTY_MAJOR, fg_console + 1); + extern struct tty_driver console_driver; + driver = &console_driver; + index = fg_console; noctty = 1; + goto got_driver; } #endif if (IS_SYSCONS_DEV(device)) { struct console *c = console_drivers; - while(c && !c->device) - c = c->next; - if (!c) - return -ENODEV; - device = c->device(c); - filp->f_flags |= O_NONBLOCK; /* Don't let /dev/console block */ - noctty = 1; + for (c = console_drivers; c; c = c->next) { + if (!c->device) + continue; + driver = c->device(c, &index); + if (!driver) + continue; + /* Don't let /dev/console block */ + filp->f_flags |= O_NONBLOCK; + noctty = 1; + goto got_driver; + } + return -ENODEV; } if (IS_PTMX_DEV(device)) { @@ -1357,7 +1367,7 @@ driver = get_tty_driver(kdev_t_to_nr(device), &index); if (!driver) return -ENODEV; - +got_driver: retval = init_dev(driver, index, &tty); if (retval) return retval; @@ -1700,8 +1710,8 @@ break; } - set &= TIOCM_DTR|TIOCM_RTS|TIOCM_OUT1|TIOCM_OUT2; - clear &= TIOCM_DTR|TIOCM_RTS|TIOCM_OUT1|TIOCM_OUT2; + set &= TIOCM_DTR|TIOCM_RTS|TIOCM_OUT1|TIOCM_OUT2|TIOCM_LOOP; + clear &= TIOCM_DTR|TIOCM_RTS|TIOCM_OUT1|TIOCM_OUT2|TIOCM_LOOP; retval = tty->driver->tiocmset(tty, file, set, clear); } diff -urN linux-2.5.68-bk5/drivers/char/vme_scc.c linux-2.5.68-bk6/drivers/char/vme_scc.c --- linux-2.5.68-bk5/drivers/char/vme_scc.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/vme_scc.c 2003-04-25 04:34:13.000000000 -0700 @@ -1069,9 +1069,10 @@ local_irq_restore(flags); } -static kdev_t scc_console_device(struct console *c) +static struct tty_driver *scc_console_device(struct console *c, int *index) { - return mk_kdev(TTY_MAJOR, SCC_MINOR_BASE + c->index); + *index = c->index; + return &scc_driver; } diff -urN linux-2.5.68-bk5/drivers/char/vt.c linux-2.5.68-bk6/drivers/char/vt.c --- linux-2.5.68-bk5/drivers/char/vt.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/vt.c 2003-04-25 04:34:13.000000000 -0700 @@ -2180,9 +2180,12 @@ clear_bit(0, &printing); } -static kdev_t vt_console_device(struct console *c) +struct tty_driver console_driver; + +static struct tty_driver *vt_console_device(struct console *c, int *index) { - return mk_kdev(TTY_MAJOR, c->index ? c->index : fg_console + 1); + *index = c->index ? c->index-1 : fg_console; + return &console_driver; } struct console vt_console_driver = { @@ -2455,7 +2458,6 @@ * the appropriate escape-sequence. */ -struct tty_driver console_driver; static int console_refcount; static int __init con_init(void) diff -urN linux-2.5.68-bk5/drivers/char/watchdog/acquirewdt.c linux-2.5.68-bk6/drivers/char/watchdog/acquirewdt.c --- linux-2.5.68-bk5/drivers/char/watchdog/acquirewdt.c 2003-04-19 19:50:03.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/watchdog/acquirewdt.c 2003-04-25 04:34:13.000000000 -0700 @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include diff -urN linux-2.5.68-bk5/drivers/char/watchdog/advantechwdt.c linux-2.5.68-bk6/drivers/char/watchdog/advantechwdt.c --- linux-2.5.68-bk5/drivers/char/watchdog/advantechwdt.c 2003-04-19 19:49:10.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/watchdog/advantechwdt.c 2003-04-25 04:34:13.000000000 -0700 @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include diff -urN linux-2.5.68-bk5/drivers/char/watchdog/eurotechwdt.c linux-2.5.68-bk6/drivers/char/watchdog/eurotechwdt.c --- linux-2.5.68-bk5/drivers/char/watchdog/eurotechwdt.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/watchdog/eurotechwdt.c 2003-04-25 04:34:13.000000000 -0700 @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include diff -urN linux-2.5.68-bk5/drivers/char/watchdog/ib700wdt.c linux-2.5.68-bk6/drivers/char/watchdog/ib700wdt.c --- linux-2.5.68-bk5/drivers/char/watchdog/ib700wdt.c 2003-04-19 19:50:50.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/watchdog/ib700wdt.c 2003-04-25 04:34:13.000000000 -0700 @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include diff -urN linux-2.5.68-bk5/drivers/char/watchdog/machzwd.c linux-2.5.68-bk6/drivers/char/watchdog/machzwd.c --- linux-2.5.68-bk5/drivers/char/watchdog/machzwd.c 2003-04-19 19:48:53.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/watchdog/machzwd.c 2003-04-25 04:34:13.000000000 -0700 @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include diff -urN linux-2.5.68-bk5/drivers/char/watchdog/mixcomwd.c linux-2.5.68-bk6/drivers/char/watchdog/mixcomwd.c --- linux-2.5.68-bk5/drivers/char/watchdog/mixcomwd.c 2003-04-19 19:48:56.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/watchdog/mixcomwd.c 2003-04-25 04:34:13.000000000 -0700 @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include diff -urN linux-2.5.68-bk5/drivers/char/watchdog/pcwd.c linux-2.5.68-bk6/drivers/char/watchdog/pcwd.c --- linux-2.5.68-bk5/drivers/char/watchdog/pcwd.c 2003-04-19 19:48:50.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/watchdog/pcwd.c 2003-04-25 04:34:13.000000000 -0700 @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include diff -urN linux-2.5.68-bk5/drivers/char/watchdog/sbc60xxwdt.c linux-2.5.68-bk6/drivers/char/watchdog/sbc60xxwdt.c --- linux-2.5.68-bk5/drivers/char/watchdog/sbc60xxwdt.c 2003-04-19 19:50:10.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/watchdog/sbc60xxwdt.c 2003-04-25 04:34:13.000000000 -0700 @@ -61,6 +61,7 @@ #include #include #include +#include #include #include #include diff -urN linux-2.5.68-bk5/drivers/char/watchdog/sc520_wdt.c linux-2.5.68-bk6/drivers/char/watchdog/sc520_wdt.c --- linux-2.5.68-bk5/drivers/char/watchdog/sc520_wdt.c 2003-04-19 19:49:26.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/watchdog/sc520_wdt.c 2003-04-25 04:34:13.000000000 -0700 @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include diff -urN linux-2.5.68-bk5/drivers/char/watchdog/softdog.c linux-2.5.68-bk6/drivers/char/watchdog/softdog.c --- linux-2.5.68-bk5/drivers/char/watchdog/softdog.c 2003-04-19 19:49:20.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/watchdog/softdog.c 2003-04-25 04:34:13.000000000 -0700 @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include diff -urN linux-2.5.68-bk5/drivers/char/watchdog/w83877f_wdt.c linux-2.5.68-bk6/drivers/char/watchdog/w83877f_wdt.c --- linux-2.5.68-bk5/drivers/char/watchdog/w83877f_wdt.c 2003-04-19 19:50:04.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/watchdog/w83877f_wdt.c 2003-04-25 04:34:13.000000000 -0700 @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include diff -urN linux-2.5.68-bk5/drivers/char/watchdog/wafer5823wdt.c linux-2.5.68-bk6/drivers/char/watchdog/wafer5823wdt.c --- linux-2.5.68-bk5/drivers/char/watchdog/wafer5823wdt.c 2003-04-19 19:51:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/watchdog/wafer5823wdt.c 2003-04-25 04:34:13.000000000 -0700 @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include diff -urN linux-2.5.68-bk5/drivers/char/watchdog/wdt.c linux-2.5.68-bk6/drivers/char/watchdog/wdt.c --- linux-2.5.68-bk5/drivers/char/watchdog/wdt.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/char/watchdog/wdt.c 2003-04-25 04:34:13.000000000 -0700 @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include diff -urN linux-2.5.68-bk5/drivers/i2c/busses/i2c-viapro.c linux-2.5.68-bk6/drivers/i2c/busses/i2c-viapro.c --- linux-2.5.68-bk5/drivers/i2c/busses/i2c-viapro.c 2003-04-19 19:50:30.000000000 -0700 +++ linux-2.5.68-bk6/drivers/i2c/busses/i2c-viapro.c 2003-04-25 04:34:13.000000000 -0700 @@ -42,23 +42,24 @@ #include #include -#define SMBBA1 0x90 -#define SMBBA2 0x80 -#define SMBBA3 0xD0 +#define SMBBA1 0x90 +#define SMBBA2 0x80 +#define SMBBA3 0xD0 /* SMBus address offsets */ -#define SMBHSTSTS (0 + vt596_smba) -#define SMBHSLVSTS (1 + vt596_smba) -#define SMBHSTCNT (2 + vt596_smba) -#define SMBHSTCMD (3 + vt596_smba) -#define SMBHSTADD (4 + vt596_smba) -#define SMBHSTDAT0 (5 + vt596_smba) -#define SMBHSTDAT1 (6 + vt596_smba) -#define SMBBLKDAT (7 + vt596_smba) -#define SMBSLVCNT (8 + vt596_smba) -#define SMBSHDWCMD (9 + vt596_smba) -#define SMBSLVEVT (0xA + vt596_smba) -#define SMBSLVDAT (0xC + vt596_smba) +static unsigned short vt596_smba; +#define SMBHSTSTS (vt596_smba + 0) +#define SMBHSLVSTS (vt596_smba + 1) +#define SMBHSTCNT (vt596_smba + 2) +#define SMBHSTCMD (vt596_smba + 3) +#define SMBHSTADD (vt596_smba + 4) +#define SMBHSTDAT0 (vt596_smba + 5) +#define SMBHSTDAT1 (vt596_smba + 6) +#define SMBBLKDAT (vt596_smba + 7) +#define SMBSLVCNT (vt596_smba + 8) +#define SMBSHDWCMD (vt596_smba + 9) +#define SMBSLVEVT (vt596_smba + 0xA) +#define SMBSLVDAT (vt596_smba + 0xC) /* PCI Address Constants */ @@ -68,14 +69,14 @@ static unsigned short smb_cf_hstcfg = 0xD2; #define SMBHSTCFG (smb_cf_hstcfg) -#define SMBSLVC (SMBHSTCFG+1) -#define SMBSHDW1 (SMBHSTCFG+2) -#define SMBSHDW2 (SMBHSTCFG+3) -#define SMBREV (SMBHSTCFG+4) +#define SMBSLVC (smb_cf_hstcfg + 1) +#define SMBSHDW1 (smb_cf_hstcfg + 2) +#define SMBSHDW2 (smb_cf_hstcfg + 3) +#define SMBREV (smb_cf_hstcfg + 4) /* Other settings */ -#define MAX_TIMEOUT 500 -#define ENABLE_INT9 0 +#define MAX_TIMEOUT 500 +#define ENABLE_INT9 0 /* VT82C596 constants */ #define VT596_QUICK 0x00 @@ -84,144 +85,33 @@ #define VT596_WORD_DATA 0x0C #define VT596_BLOCK_DATA 0x14 -/* insmod parameters */ /* If force is set to anything different from 0, we forcibly enable the VT596. DANGEROUS! */ -static int force = 0; +static int force; MODULE_PARM(force, "i"); MODULE_PARM_DESC(force, "Forcibly enable the SMBus. DANGEROUS!"); /* If force_addr is set to anything different from 0, we forcibly enable the VT596 at the given address. VERY DANGEROUS! */ -static int force_addr = 0; +static int force_addr; MODULE_PARM(force_addr, "i"); MODULE_PARM_DESC(force_addr, "Forcibly enable the SMBus at the given address. " "EXTREMELY DANGEROUS!"); -static void vt596_do_pause(unsigned int amount); -static int vt596_transaction(void); -s32 vt596_access(struct i2c_adapter * adap, u16 addr, unsigned short flags, - char read_write, u8 command, int size, union i2c_smbus_data * data); -u32 vt596_func(struct i2c_adapter *adapter); - -static struct i2c_algorithm smbus_algorithm = { - .name = "Non-I2C SMBus adapter", - .id = I2C_ALGO_SMBUS, - .smbus_xfer = vt596_access, - .functionality = vt596_func, -}; - -static struct i2c_adapter vt596_adapter = { - .owner = THIS_MODULE, - .id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_VIA2, - .algo = &smbus_algorithm, - .dev = { - .name = "unset", - }, -}; - - - - -static unsigned short vt596_smba = 0; - - -/* Detect whether a compatible device can be found, and initialize it. */ -int vt596_setup(struct pci_dev *VT596_dev, struct pci_device_id const *id) -{ - unsigned char temp; - - dev_info(&VT596_dev->dev, "Found Via %s device\n", VT596_dev->dev.name); - - /* Determine the address of the SMBus areas */ - if (force_addr) { - vt596_smba = force_addr & 0xfff0; - force = 0; - } else { - if ((pci_read_config_word(VT596_dev, id->driver_data, &vt596_smba)) - || !(vt596_smba & 0x1)) { - /* try 2nd address and config reg. for 596 */ - if((id->device == PCI_DEVICE_ID_VIA_82C596_3) && - (!pci_read_config_word(VT596_dev, SMBBA2, &vt596_smba)) && - (vt596_smba & 0x1)) { - smb_cf_hstcfg = 0x84; - } else { - /* no matches at all */ - dev_err(&VT596_dev->dev, "Cannot configure " - "SMBus I/O Base address\n"); - return(-ENODEV); - } - } - vt596_smba &= 0xfff0; - if(vt596_smba == 0) { - dev_err(&VT596_dev->dev, "SMBus base address " - "uninitialized - upgrade BIOS or use " - "force_addr=0xaddr\n"); - return -ENODEV; - } - } - - if (!request_region(vt596_smba, 8, "viapro-smbus")) { - dev_err(&VT596_dev->dev, "SMBus region 0x%x already in use!\n", - vt596_smba); - return(-ENODEV); - } - - pci_read_config_byte(VT596_dev, SMBHSTCFG, &temp); - /* If force_addr is set, we program the new address here. Just to make - sure, we disable the VT596 first. */ - if (force_addr) { - pci_write_config_byte(VT596_dev, SMBHSTCFG, temp & 0xfe); - pci_write_config_word(VT596_dev, id->driver_data, vt596_smba); - pci_write_config_byte(VT596_dev, SMBHSTCFG, temp | 0x01); - dev_warn(&VT596_dev->dev, "WARNING: SMBus interface set to new " - "address 0x%04x!\n", vt596_smba); - } else if ((temp & 1) == 0) { - if (force) { - /* NOTE: This assumes I/O space and other allocations - * WERE done by the Bios! Don't complain if your - * hardware does weird things after enabling this. - * :') Check for Bios updates before resorting to - * this. - */ - pci_write_config_byte(VT596_dev, SMBHSTCFG, - temp | 1); - dev_info(&VT596_dev->dev, "Enabling SMBus device\n"); - } else { - dev_err(&VT596_dev->dev, "SMBUS: Error: Host SMBus " - "controller not enabled! - upgrade BIOS or " - "use force=1\n"); - return(-ENODEV); - } - } - - if ((temp & 0x0E) == 8) - dev_dbg(&VT596_dev->dev, "using Interrupt 9 for SMBus.\n"); - else if ((temp & 0x0E) == 0) - dev_dbg(&VT596_dev->dev, "using Interrupt SMI# for SMBus.\n"); - else - dev_dbg(&VT596_dev->dev, "Illegal Interrupt configuration " - "(or code out of date)!\n"); - - pci_read_config_byte(VT596_dev, SMBREV, &temp); - dev_dbg(&VT596_dev->dev, "SMBREV = 0x%X\n", temp); - dev_dbg(&VT596_dev->dev, "VT596_smba = 0x%X\n", vt596_smba); - - return(0); -} +static struct i2c_adapter vt596_adapter; /* Internally used pause function */ -void vt596_do_pause(unsigned int amount) +static void vt596_do_pause(unsigned int amount) { current->state = TASK_INTERRUPTIBLE; schedule_timeout(amount); } /* Another internally used function */ -int vt596_transaction(void) +static int vt596_transaction(void) { int temp; int result = 0; @@ -296,15 +186,16 @@ } /* Return -1 on error. */ -s32 vt596_access(struct i2c_adapter *adap, u16 addr, unsigned short flags, - char read_write, u8 command, int size, - union i2c_smbus_data * data) +static s32 vt596_access(struct i2c_adapter *adap, u16 addr, + unsigned short flags, char read_write, u8 command, + int size, union i2c_smbus_data *data) { int i, len; switch (size) { case I2C_SMBUS_PROC_CALL: - dev_info(&vt596_adapter.dev, "I2C_SMBUS_PROC_CALL not supported!\n"); + dev_info(&vt596_adapter.dev, + "I2C_SMBUS_PROC_CALL not supported!\n"); return -1; case I2C_SMBUS_QUICK: outb_p(((addr & 0x7f) << 1) | (read_write & 0x01), @@ -363,7 +254,6 @@ if ((read_write == I2C_SMBUS_WRITE) || (size == VT596_QUICK)) return 0; - switch (size) { case VT596_BYTE: /* Where is the result put? I assume here it is in @@ -388,15 +278,127 @@ return 0; } - -u32 vt596_func(struct i2c_adapter *adapter) +static u32 vt596_func(struct i2c_adapter *adapter) { return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_BLOCK_DATA; } +static struct i2c_algorithm smbus_algorithm = { + .name = "Non-I2C SMBus adapter", + .id = I2C_ALGO_SMBUS, + .smbus_xfer = vt596_access, + .functionality = vt596_func, +}; + +static struct i2c_adapter vt596_adapter = { + .owner = THIS_MODULE, + .id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_VIA2, + .algo = &smbus_algorithm, + .dev = { + .name = "unset", + }, +}; + +static int __devinit vt596_probe(struct pci_dev *pdev, + const struct pci_device_id *id) +{ + unsigned char temp; + int error = -ENODEV; + + /* Determine the address of the SMBus areas */ + if (force_addr) { + vt596_smba = force_addr & 0xfff0; + force = 0; + goto found; + } + + if ((pci_read_config_word(pdev, id->driver_data, &vt596_smba)) || + !(vt596_smba & 0x1)) { + /* try 2nd address and config reg. for 596 */ + if (id->device == PCI_DEVICE_ID_VIA_82C596_3 && + !pci_read_config_word(pdev, SMBBA2, &vt596_smba) && + (vt596_smba & 0x1)) { + smb_cf_hstcfg = 0x84; + } else { + /* no matches at all */ + dev_err(&pdev->dev, "Cannot configure " + "SMBus I/O Base address\n"); + return -ENODEV; + } + } + vt596_smba &= 0xfff0; + if (vt596_smba == 0) { + dev_err(&pdev->dev, "SMBus base address " + "uninitialized - upgrade BIOS or use " + "force_addr=0xaddr\n"); + return -ENODEV; + } + + found: + if (!request_region(vt596_smba, 8, "viapro-smbus")) { + dev_err(&pdev->dev, "SMBus region 0x%x already in use!\n", + vt596_smba); + return -ENODEV; + } + + pci_read_config_byte(pdev, SMBHSTCFG, &temp); + /* If force_addr is set, we program the new address here. Just to make + sure, we disable the VT596 first. */ + if (force_addr) { + pci_write_config_byte(pdev, SMBHSTCFG, temp & 0xfe); + pci_write_config_word(pdev, id->driver_data, vt596_smba); + pci_write_config_byte(pdev, SMBHSTCFG, temp | 0x01); + dev_warn(&pdev->dev, "WARNING: SMBus interface set to new " + "address 0x%04x!\n", vt596_smba); + } else if ((temp & 1) == 0) { + if (force) { + /* NOTE: This assumes I/O space and other allocations + * WERE done by the Bios! Don't complain if your + * hardware does weird things after enabling this. + * :') Check for Bios updates before resorting to + * this. + */ + pci_write_config_byte(pdev, SMBHSTCFG, temp | 1); + dev_info(&pdev->dev, "Enabling SMBus device\n"); + } else { + dev_err(&pdev->dev, "SMBUS: Error: Host SMBus " + "controller not enabled! - upgrade BIOS or " + "use force=1\n"); + goto release_region; + } + } + + if ((temp & 0x0E) == 8) + dev_dbg(&pdev->dev, "using Interrupt 9 for SMBus.\n"); + else if ((temp & 0x0E) == 0) + dev_dbg(&pdev->dev, "using Interrupt SMI# for SMBus.\n"); + else + dev_dbg(&pdev->dev, "Illegal Interrupt configuration " + "(or code out of date)!\n"); + + pci_read_config_byte(pdev, SMBREV, &temp); + dev_dbg(&pdev->dev, "SMBREV = 0x%X\n", temp); + dev_dbg(&pdev->dev, "VT596_smba = 0x%X\n", vt596_smba); + + vt596_adapter.dev.parent = &pdev->dev; + snprintf(vt596_adapter.dev.name, DEVICE_NAME_SIZE, + "SMBus Via Pro adapter at %04x", vt596_smba); + + return i2c_add_adapter(&vt596_adapter); + + release_region: + release_region(vt596_smba, 8); + return error; +} + +static void __devexit vt596_remove(struct pci_dev *pdev) +{ + i2c_del_adapter(&vt596_adapter); + release_region(vt596_smba, 8); +} static struct pci_device_id vt596_ids[] __devinitdata = { { @@ -451,29 +453,6 @@ { 0, } }; -static int __devinit vt596_probe(struct pci_dev *dev, const struct pci_device_id *id) -{ - int retval; - - retval = vt596_setup(dev, id); - if (retval) - return retval; - - vt596_adapter.dev.parent = &dev->dev; - - snprintf(vt596_adapter.dev.name, DEVICE_NAME_SIZE, - "SMBus Via Pro adapter at %04x", vt596_smba); - - retval = i2c_add_adapter(&vt596_adapter); - - return retval; -} - -static void __devexit vt596_remove(struct pci_dev *dev) -{ - i2c_del_adapter(&vt596_adapter); -} - static struct pci_driver vt596_driver = { .name = "vt596 smbus", .id_table = vt596_ids, @@ -490,14 +469,12 @@ static void __exit i2c_vt596_exit(void) { pci_unregister_driver(&vt596_driver); - release_region(vt596_smba, 8); } - - -MODULE_AUTHOR("Frodo Looijaard and Philip Edelbrock "); +MODULE_AUTHOR( + "Frodo Looijaard and " + "Philip Edelbrock "); MODULE_DESCRIPTION("vt82c596 SMBus driver"); - MODULE_LICENSE("GPL"); module_init(i2c_vt596_init); diff -urN linux-2.5.68-bk5/drivers/i2c/chips/Kconfig linux-2.5.68-bk6/drivers/i2c/chips/Kconfig --- linux-2.5.68-bk5/drivers/i2c/chips/Kconfig 2003-04-19 19:49:56.000000000 -0700 +++ linux-2.5.68-bk6/drivers/i2c/chips/Kconfig 2003-04-25 04:34:13.000000000 -0700 @@ -22,6 +22,16 @@ in the lm_sensors package, which you can download at http://www.lm-sensors.nu +config SENSORS_IT87 + tristate " National Semiconductors IT87 and compatibles" + depends on I2C && EXPERIMENTAL + help + The module will be called it87. + + You will also need the latest user-space utilties: you can find them + in the lm_sensors package, which you can download at + http://www.lm-sensors.nu + config SENSORS_LM75 tristate " National Semiconductors LM75 and compatibles" depends on I2C && EXPERIMENTAL @@ -66,8 +76,8 @@ config I2C_SENSOR tristate - default y if SENSORS_ADM1021=y || SENSORS_LM75=y || SENSORS_VIA686A=y || SENSORS_W83781D=y - default m if SENSORS_ADM1021=m || SENSORS_LM75=m || SENSORS_VIA686A=m || SENSORS_W83781D=m + default y if SENSORS_ADM1021=y || SENSORS_IT87=y || SENSORS_LM75=y || SENSORS_VIA686A=y || SENSORS_W83781D=y + default m if SENSORS_ADM1021=m || SENSORS_IT87=m || SENSORS_LM75=m || SENSORS_VIA686A=m || SENSORS_W83781D=m default n endmenu diff -urN linux-2.5.68-bk5/drivers/i2c/chips/Makefile linux-2.5.68-bk6/drivers/i2c/chips/Makefile --- linux-2.5.68-bk5/drivers/i2c/chips/Makefile 2003-04-19 19:48:46.000000000 -0700 +++ linux-2.5.68-bk6/drivers/i2c/chips/Makefile 2003-04-25 04:34:13.000000000 -0700 @@ -3,6 +3,7 @@ # obj-$(CONFIG_SENSORS_ADM1021) += adm1021.o +obj-$(CONFIG_SENSORS_IT87) += it87.o obj-$(CONFIG_SENSORS_LM75) += lm75.o obj-$(CONFIG_SENSORS_VIA686A) += via686a.o obj-$(CONFIG_SENSORS_W83781D) += w83781d.o diff -urN linux-2.5.68-bk5/drivers/i2c/chips/adm1021.c linux-2.5.68-bk6/drivers/i2c/chips/adm1021.c --- linux-2.5.68-bk5/drivers/i2c/chips/adm1021.c 2003-04-19 19:48:49.000000000 -0700 +++ linux-2.5.68-bk6/drivers/i2c/chips/adm1021.c 2003-04-25 04:34:13.000000000 -0700 @@ -39,12 +39,12 @@ #define ADM1021_ALARM_RTEMP_NA 0x04 /* Addresses to scan */ -static unsigned short normal_i2c[] = { SENSORS_I2C_END }; +static unsigned short normal_i2c[] = { I2C_CLIENT_END }; static unsigned short normal_i2c_range[] = { 0x18, 0x1a, 0x29, 0x2b, - 0x4c, 0x4e, SENSORS_I2C_END + 0x4c, 0x4e, I2C_CLIENT_END }; -static unsigned int normal_isa[] = { SENSORS_ISA_END }; -static unsigned int normal_isa_range[] = { SENSORS_ISA_END }; +static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END }; +static unsigned int normal_isa_range[] = { I2C_CLIENT_ISA_END }; /* Insmod parameters */ SENSORS_INSMOD_8(adm1021, adm1023, max1617, max1617a, thmc10, lm84, gl523sm, mc1066); @@ -416,128 +416,6 @@ up(&data->update_lock); } - -/* FIXME, remove these four functions, they are here to verify the sysfs - * conversion is correct, or not */ -__attribute__((unused)) -static void adm1021_temp(struct i2c_client *client, int operation, - int ctl_name, int *nrels_mag, long *results) -{ - struct adm1021_data *data = i2c_get_clientdata(client); - - if (operation == SENSORS_PROC_REAL_INFO) - *nrels_mag = 0; - else if (operation == SENSORS_PROC_REAL_READ) { - adm1021_update_client(client); - results[0] = TEMP_FROM_REG(data->temp_max); - results[1] = TEMP_FROM_REG(data->temp_hyst); - results[2] = TEMP_FROM_REG(data->temp_input); - *nrels_mag = 3; - } else if (operation == SENSORS_PROC_REAL_WRITE) { - if (*nrels_mag >= 1) { - data->temp_max = TEMP_TO_REG(results[0]); - adm1021_write_value(client, ADM1021_REG_TOS_W, - data->temp_max); - } - if (*nrels_mag >= 2) { - data->temp_hyst = TEMP_TO_REG(results[1]); - adm1021_write_value(client, ADM1021_REG_THYST_W, - data->temp_hyst); - } - } -} - -__attribute__((unused)) -static void adm1021_remote_temp(struct i2c_client *client, int operation, - int ctl_name, int *nrels_mag, long *results) -{ - struct adm1021_data *data = i2c_get_clientdata(client); - int prec = 0; - - if (operation == SENSORS_PROC_REAL_INFO) - if (data->type == adm1023) { *nrels_mag = 3; } - else { *nrels_mag = 0; } - else if (operation == SENSORS_PROC_REAL_READ) { - adm1021_update_client(client); - results[0] = TEMP_FROM_REG(data->remote_temp_max); - results[1] = TEMP_FROM_REG(data->remote_temp_hyst); - results[2] = TEMP_FROM_REG(data->remote_temp_input); - if (data->type == adm1023) { - results[0] = results[0]*1000 + ((data->remote_temp_os_prec >> 5) * 125); - results[1] = results[1]*1000 + ((data->remote_temp_hyst_prec >> 5) * 125); - results[2] = (TEMP_FROM_REG(data->remote_temp_offset)*1000) + ((data->remote_temp_offset_prec >> 5) * 125); - results[3] = (TEMP_FROM_REG(data->remote_temp_input)*1000) + ((data->remote_temp_prec >> 5) * 125); - *nrels_mag = 4; - } else { - *nrels_mag = 3; - } - } else if (operation == SENSORS_PROC_REAL_WRITE) { - if (*nrels_mag >= 1) { - if (data->type == adm1023) { - prec = ((results[0]-((results[0]/1000)*1000))/125)<<5; - adm1021_write_value(client, ADM1021_REG_REM_TOS_PREC, prec); - results[0] = results[0]/1000; - data->remote_temp_os_prec=prec; - } - data->remote_temp_max = TEMP_TO_REG(results[0]); - adm1021_write_value(client, ADM1021_REG_REMOTE_TOS_W, data->remote_temp_max); - } - if (*nrels_mag >= 2) { - if (data->type == adm1023) { - prec = ((results[1]-((results[1]/1000)*1000))/125)<<5; - adm1021_write_value(client, ADM1021_REG_REM_THYST_PREC, prec); - results[1] = results[1]/1000; - data->remote_temp_hyst_prec=prec; - } - data->remote_temp_hyst = TEMP_TO_REG(results[1]); - adm1021_write_value(client, ADM1021_REG_REMOTE_THYST_W, data->remote_temp_hyst); - } - if (*nrels_mag >= 3) { - if (data->type == adm1023) { - prec = ((results[2]-((results[2]/1000)*1000))/125)<<5; - adm1021_write_value(client, ADM1021_REG_REM_OFFSET_PREC, prec); - results[2]=results[2]/1000; - data->remote_temp_offset_prec=prec; - data->remote_temp_offset=results[2]; - adm1021_write_value(client, ADM1021_REG_REM_OFFSET, data->remote_temp_offset); - } - } - } -} - -__attribute__((unused)) -static void adm1021_die_code(struct i2c_client *client, int operation, - int ctl_name, int *nrels_mag, long *results) -{ - struct adm1021_data *data = i2c_get_clientdata(client); - - if (operation == SENSORS_PROC_REAL_INFO) - *nrels_mag = 0; - else if (operation == SENSORS_PROC_REAL_READ) { - adm1021_update_client(client); - results[0] = data->die_code; - *nrels_mag = 1; - } else if (operation == SENSORS_PROC_REAL_WRITE) { - /* Can't write to it */ - } -} - -__attribute__((unused)) -static void adm1021_alarms(struct i2c_client *client, int operation, - int ctl_name, int *nrels_mag, long *results) -{ - struct adm1021_data *data = i2c_get_clientdata(client); - if (operation == SENSORS_PROC_REAL_INFO) - *nrels_mag = 0; - else if (operation == SENSORS_PROC_REAL_READ) { - adm1021_update_client(client); - results[0] = data->alarms; - *nrels_mag = 1; - } else if (operation == SENSORS_PROC_REAL_WRITE) { - /* Can't write to it */ - } -} - static int __init sensors_adm1021_init(void) { return i2c_add_driver(&adm1021_driver); diff -urN linux-2.5.68-bk5/drivers/i2c/chips/it87.c linux-2.5.68-bk6/drivers/i2c/chips/it87.c --- linux-2.5.68-bk5/drivers/i2c/chips/it87.c 1969-12-31 16:00:00.000000000 -0800 +++ linux-2.5.68-bk6/drivers/i2c/chips/it87.c 2003-04-25 04:34:13.000000000 -0700 @@ -0,0 +1,924 @@ +/* + it87.c - Part of lm_sensors, Linux kernel modules for hardware + monitoring. + + Supports: IT8705F Super I/O chip w/LPC interface + IT8712F Super I/O chup w/LPC interface & SMbus + Sis950 A clone of the IT8705F + + Copyright (c) 2001 Chris Gauthron + Largely inspired by lm78.c of the same package + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +/* + djg@pdp8.net David Gesswein 7/18/01 + Modified to fix bug with not all alarms enabled. + Added ability to read battery voltage and select temperature sensor + type at module load time. +*/ + +#include +#include +#include +#include +#include +#include + + +/* Addresses to scan */ +static unsigned short normal_i2c[] = { I2C_CLIENT_END }; +static unsigned short normal_i2c_range[] = { 0x20, 0x2f, I2C_CLIENT_END }; +static unsigned int normal_isa[] = { 0x0290, I2C_CLIENT_ISA_END }; +static unsigned int normal_isa_range[] = { I2C_CLIENT_ISA_END }; + +/* Insmod parameters */ +SENSORS_INSMOD_4(it87, it8705, it8712, sis950); + + +/* Update battery voltage after every reading if true */ +static int update_vbat = 0; + + +/* Enable Temp1 as thermal resistor */ +/* Enable Temp2 as thermal diode */ +/* Enable Temp3 as thermal resistor */ +static int temp_type = 0x2a; + +/* Many IT87 constants specified below */ + +/* Length of ISA address segment */ +#define IT87_EXTENT 8 + +/* Where are the ISA address/data registers relative to the base address */ +#define IT87_ADDR_REG_OFFSET 5 +#define IT87_DATA_REG_OFFSET 6 + +/*----- The IT87 registers -----*/ + +#define IT87_REG_CONFIG 0x00 + +#define IT87_REG_ALARM1 0x01 +#define IT87_REG_ALARM2 0x02 +#define IT87_REG_ALARM3 0x03 + +#define IT87_REG_VID 0x0a +#define IT87_REG_FAN_DIV 0x0b + +/* Monitors: 9 voltage (0 to 7, battery), 3 temp (1 to 3), 3 fan (1 to 3) */ + +#define IT87_REG_FAN(nr) (0x0c + (nr)) +#define IT87_REG_FAN_MIN(nr) (0x0f + (nr)) +#define IT87_REG_FAN_CTRL 0x13 + +#define IT87_REG_VIN(nr) (0x20 + (nr)) +#define IT87_REG_TEMP(nr) (0x28 + (nr)) + +#define IT87_REG_VIN_MAX(nr) (0x30 + (nr) * 2) +#define IT87_REG_VIN_MIN(nr) (0x31 + (nr) * 2) +#define IT87_REG_TEMP_HIGH(nr) (0x3e + (nr) * 2) +#define IT87_REG_TEMP_LOW(nr) (0x3f + (nr) * 2) + +#define IT87_REG_I2C_ADDR 0x48 + +#define IT87_REG_VIN_ENABLE 0x50 +#define IT87_REG_TEMP_ENABLE 0x51 + +#define IT87_REG_CHIPID 0x58 + +static inline u8 IN_TO_REG(long val, int inNum) +{ + /* to avoid floating point, we multiply everything by 100. + val is guaranteed to be positive, so we can achieve the effect of + rounding by (...*10+5)/10. Note that the *10 is hidden in the + /250 (which should really be /2500). + At the end, we need to /100 because we *100 everything and we need + to /10 because of the rounding thing, so we /1000. */ + if (inNum <= 1) + return (u8) + SENSORS_LIMIT(((val * 210240 - 13300) / 250 + 5) / 1000, + 0, 255); + else if (inNum == 2) + return (u8) + SENSORS_LIMIT(((val * 157370 - 13300) / 250 + 5) / 1000, + 0, 255); + else if (inNum == 3) + return (u8) + SENSORS_LIMIT(((val * 101080 - 13300) / 250 + 5) / 1000, + 0, 255); + else + return (u8) SENSORS_LIMIT(((val * 41714 - 13300) / 250 + 5) + / 1000, 0, 255); +} + +static inline long IN_FROM_REG(u8 val, int inNum) +{ + /* to avoid floating point, we multiply everything by 100. + val is guaranteed to be positive, so we can achieve the effect of + rounding by adding 0.5. Or, to avoid fp math, we do (...*10+5)/10. + We need to scale with *100 anyway, so no need to /100 at the end. */ + if (inNum <= 1) + return (long) (((250000 * val + 13300) / 210240 * 10 + 5) /10); + else if (inNum == 2) + return (long) (((250000 * val + 13300) / 157370 * 10 + 5) /10); + else if (inNum == 3) + return (long) (((250000 * val + 13300) / 101080 * 10 + 5) /10); + else + return (long) (((250000 * val + 13300) / 41714 * 10 + 5) /10); +} + +static inline u8 FAN_TO_REG(long rpm, int div) +{ + if (rpm == 0) + return 255; + rpm = SENSORS_LIMIT(rpm, 1, 1000000); + return SENSORS_LIMIT((1350000 + rpm * div / 2) / (rpm * div), 1, + 254); +} + +#define FAN_FROM_REG(val,div) ((val)==0?-1:(val)==255?0:1350000/((val)*(div))) + +#define TEMP_TO_REG(val) (SENSORS_LIMIT(((val)<0?(((val)-5)/10):\ + ((val)+5)/10),0,255)) +#define TEMP_FROM_REG(val) (((val)>0x80?(val)-0x100:(val))*10) + +#define VID_FROM_REG(val) ((val)==0x1f?0:(val)>=0x10?510-(val)*10:\ + 205-(val)*5) +#define ALARMS_FROM_REG(val) (val) + +#define DIV_TO_REG(val) ((val)==8?3:(val)==4?2:(val)==1?0:1) +#define DIV_FROM_REG(val) (1 << (val)) + +/* Initial limits. Use the config file to set better limits. */ +#define IT87_INIT_IN_0 170 +#define IT87_INIT_IN_1 250 +#define IT87_INIT_IN_2 (330 / 2) +#define IT87_INIT_IN_3 (((500) * 100)/168) +#define IT87_INIT_IN_4 (((1200) * 10)/38) +#define IT87_INIT_IN_5 (((1200) * 10)/72) +#define IT87_INIT_IN_6 (((500) * 10)/56) +#define IT87_INIT_IN_7 (((500) * 100)/168) + +#define IT87_INIT_IN_PERCENTAGE 10 + +#define IT87_INIT_IN_MIN_0 \ + (IT87_INIT_IN_0 - IT87_INIT_IN_0 * IT87_INIT_IN_PERCENTAGE / 100) +#define IT87_INIT_IN_MAX_0 \ + (IT87_INIT_IN_0 + IT87_INIT_IN_0 * IT87_INIT_IN_PERCENTAGE / 100) +#define IT87_INIT_IN_MIN_1 \ + (IT87_INIT_IN_1 - IT87_INIT_IN_1 * IT87_INIT_IN_PERCENTAGE / 100) +#define IT87_INIT_IN_MAX_1 \ + (IT87_INIT_IN_1 + IT87_INIT_IN_1 * IT87_INIT_IN_PERCENTAGE / 100) +#define IT87_INIT_IN_MIN_2 \ + (IT87_INIT_IN_2 - IT87_INIT_IN_2 * IT87_INIT_IN_PERCENTAGE / 100) +#define IT87_INIT_IN_MAX_2 \ + (IT87_INIT_IN_2 + IT87_INIT_IN_2 * IT87_INIT_IN_PERCENTAGE / 100) +#define IT87_INIT_IN_MIN_3 \ + (IT87_INIT_IN_3 - IT87_INIT_IN_3 * IT87_INIT_IN_PERCENTAGE / 100) +#define IT87_INIT_IN_MAX_3 \ + (IT87_INIT_IN_3 + IT87_INIT_IN_3 * IT87_INIT_IN_PERCENTAGE / 100) +#define IT87_INIT_IN_MIN_4 \ + (IT87_INIT_IN_4 - IT87_INIT_IN_4 * IT87_INIT_IN_PERCENTAGE / 100) +#define IT87_INIT_IN_MAX_4 \ + (IT87_INIT_IN_4 + IT87_INIT_IN_4 * IT87_INIT_IN_PERCENTAGE / 100) +#define IT87_INIT_IN_MIN_5 \ + (IT87_INIT_IN_5 - IT87_INIT_IN_5 * IT87_INIT_IN_PERCENTAGE / 100) +#define IT87_INIT_IN_MAX_5 \ + (IT87_INIT_IN_5 + IT87_INIT_IN_5 * IT87_INIT_IN_PERCENTAGE / 100) +#define IT87_INIT_IN_MIN_6 \ + (IT87_INIT_IN_6 - IT87_INIT_IN_6 * IT87_INIT_IN_PERCENTAGE / 100) +#define IT87_INIT_IN_MAX_6 \ + (IT87_INIT_IN_6 + IT87_INIT_IN_6 * IT87_INIT_IN_PERCENTAGE / 100) +#define IT87_INIT_IN_MIN_7 \ + (IT87_INIT_IN_7 - IT87_INIT_IN_7 * IT87_INIT_IN_PERCENTAGE / 100) +#define IT87_INIT_IN_MAX_7 \ + (IT87_INIT_IN_7 + IT87_INIT_IN_7 * IT87_INIT_IN_PERCENTAGE / 100) + +#define IT87_INIT_FAN_MIN_1 3000 +#define IT87_INIT_FAN_MIN_2 3000 +#define IT87_INIT_FAN_MIN_3 3000 + +#define IT87_INIT_TEMP_HIGH_1 600 +#define IT87_INIT_TEMP_LOW_1 200 +#define IT87_INIT_TEMP_HIGH_2 600 +#define IT87_INIT_TEMP_LOW_2 200 +#define IT87_INIT_TEMP_HIGH_3 600 +#define IT87_INIT_TEMP_LOW_3 200 + +/* For each registered IT87, we need to keep some data in memory. That + data is pointed to by it87_list[NR]->data. The structure itself is + dynamically allocated, at the same time when a new it87 client is + allocated. */ +struct it87_data { + struct semaphore lock; + enum chips type; + + struct semaphore update_lock; + char valid; /* !=0 if following fields are valid */ + unsigned long last_updated; /* In jiffies */ + + u8 in[9]; /* Register value */ + u8 in_max[9]; /* Register value */ + u8 in_min[9]; /* Register value */ + u8 fan[3]; /* Register value */ + u8 fan_min[3]; /* Register value */ + u8 temp[3]; /* Register value */ + u8 temp_high[3]; /* Register value */ + u8 temp_low[3]; /* Register value */ + u8 fan_div[3]; /* Register encoding, shifted right */ + u8 vid; /* Register encoding, combined */ + u32 alarms; /* Register encoding, combined */ +}; + + +static int it87_attach_adapter(struct i2c_adapter *adapter); +static int it87_detect(struct i2c_adapter *adapter, int address, int kind); +static int it87_detach_client(struct i2c_client *client); + +static int it87_read_value(struct i2c_client *client, u8 register); +static int it87_write_value(struct i2c_client *client, u8 register, + u8 value); +static void it87_update_client(struct i2c_client *client); +static void it87_init_client(struct i2c_client *client); + + +static struct i2c_driver it87_driver = { + .owner = THIS_MODULE, + .name = "IT87xx", + .id = I2C_DRIVERID_IT87, + .flags = I2C_DF_NOTIFY, + .attach_adapter = it87_attach_adapter, + .detach_client = it87_detach_client, +}; + +static int it87_id = 0; + +static ssize_t show_in(struct device *dev, char *buf, int nr) +{ + struct i2c_client *client = to_i2c_client(dev); + struct it87_data *data = i2c_get_clientdata(client); + it87_update_client(client); + return sprintf(buf, "%ld\n", IN_FROM_REG(data->in[nr], nr)*10 ); +} + +static ssize_t show_in_min(struct device *dev, char *buf, int nr) +{ + struct i2c_client *client = to_i2c_client(dev); + struct it87_data *data = i2c_get_clientdata(client); + it87_update_client(client); + return sprintf(buf, "%ld\n", IN_FROM_REG(data->in_min[nr], nr)*10 ); +} + +static ssize_t show_in_max(struct device *dev, char *buf, int nr) +{ + struct i2c_client *client = to_i2c_client(dev); + struct it87_data *data = i2c_get_clientdata(client); + it87_update_client(client); + return sprintf(buf, "%ld\n", IN_FROM_REG(data->in_max[nr], nr)*10 ); +} + +static ssize_t set_in_min(struct device *dev, const char *buf, + size_t count, int nr) +{ + struct i2c_client *client = to_i2c_client(dev); + struct it87_data *data = i2c_get_clientdata(client); + unsigned long val = simple_strtoul(buf, NULL, 10)/10; + data->in_min[nr] = IN_TO_REG(val,nr); + it87_write_value(client, IT87_REG_VIN_MIN(nr), + data->in_min[nr]); + return count; +} +static ssize_t set_in_max(struct device *dev, const char *buf, + size_t count, int nr) +{ + struct i2c_client *client = to_i2c_client(dev); + struct it87_data *data = i2c_get_clientdata(client); + unsigned long val = simple_strtoul(buf, NULL, 10)/10; + data->in_max[nr] = IN_TO_REG(val,nr); + it87_write_value(client, IT87_REG_VIN_MAX(nr), + data->in_max[nr]); + return count; +} + +#define show_in_offset(offset) \ +static ssize_t \ + show_in##offset (struct device *dev, char *buf) \ +{ \ + return show_in(dev, buf, 0x##offset); \ +} \ +static ssize_t \ + show_in##offset##_min (struct device *dev, char *buf) \ +{ \ + return show_in_min(dev, buf, 0x##offset); \ +} \ +static ssize_t \ + show_in##offset##_max (struct device *dev, char *buf) \ +{ \ + return show_in_max(dev, buf, 0x##offset); \ +} \ +static ssize_t set_in##offset##_min (struct device *dev, \ + const char *buf, size_t count) \ +{ \ + return set_in_min(dev, buf, count, 0x##offset); \ +} \ +static ssize_t set_in##offset##_max (struct device *dev, \ + const char *buf, size_t count) \ +{ \ + return set_in_max(dev, buf, count, 0x##offset); \ +} \ +static DEVICE_ATTR(in_input##offset, S_IRUGO, show_in##offset, NULL) \ +static DEVICE_ATTR(in_min##offset, S_IRUGO | S_IWUSR, \ + show_in##offset##_min, set_in##offset##_min) \ +static DEVICE_ATTR(in_max##offset, S_IRUGO | S_IWUSR, \ + show_in##offset##_max, set_in##offset##_max) + +show_in_offset(0); +show_in_offset(1); +show_in_offset(2); +show_in_offset(3); +show_in_offset(4); + +/* 3 temperatures */ +static ssize_t show_temp(struct device *dev, char *buf, int nr) +{ + struct i2c_client *client = to_i2c_client(dev); + struct it87_data *data = i2c_get_clientdata(client); + it87_update_client(client); + return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[nr])*10 ); +} +/* more like overshoot temperature */ +static ssize_t show_temp_max(struct device *dev, char *buf, int nr) +{ + struct i2c_client *client = to_i2c_client(dev); + struct it87_data *data = i2c_get_clientdata(client); + it87_update_client(client); + return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_high[nr])*10); +} +/* more like hysteresis temperature */ +static ssize_t show_temp_min(struct device *dev, char *buf, int nr) +{ + struct i2c_client *client = to_i2c_client(dev); + struct it87_data *data = i2c_get_clientdata(client); + it87_update_client(client); + return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_low[nr])*10); +} +static ssize_t set_temp_max(struct device *dev, const char *buf, + size_t count, int nr) +{ + struct i2c_client *client = to_i2c_client(dev); + struct it87_data *data = i2c_get_clientdata(client); + int val = simple_strtol(buf, NULL, 10)/10; + data->temp_high[nr] = TEMP_TO_REG(val); + it87_write_value(client, IT87_REG_TEMP_HIGH(nr), data->temp_high[nr]); + return count; +} +static ssize_t set_temp_min(struct device *dev, const char *buf, + size_t count, int nr) +{ + struct i2c_client *client = to_i2c_client(dev); + struct it87_data *data = i2c_get_clientdata(client); + int val = simple_strtol(buf, NULL, 10)/10; + data->temp_low[nr] = TEMP_TO_REG(val); + it87_write_value(client, IT87_REG_TEMP_LOW(nr), data->temp_low[nr]); + return count; +} +#define show_temp_offset(offset) \ +static ssize_t show_temp_##offset (struct device *dev, char *buf) \ +{ \ + return show_temp(dev, buf, 0x##offset - 1); \ +} \ +static ssize_t \ +show_temp_##offset##_max (struct device *dev, char *buf) \ +{ \ + return show_temp_max(dev, buf, 0x##offset - 1); \ +} \ +static ssize_t \ +show_temp_##offset##_min (struct device *dev, char *buf) \ +{ \ + return show_temp_min(dev, buf, 0x##offset - 1); \ +} \ +static ssize_t set_temp_##offset##_max (struct device *dev, \ + const char *buf, size_t count) \ +{ \ + return set_temp_max(dev, buf, count, 0x##offset - 1); \ +} \ +static ssize_t set_temp_##offset##_min (struct device *dev, \ + const char *buf, size_t count) \ +{ \ + return set_temp_min(dev, buf, count, 0x##offset - 1); \ +} \ +static DEVICE_ATTR(temp_input##offset, S_IRUGO, show_temp_##offset, NULL) \ +static DEVICE_ATTR(temp_max##offset, S_IRUGO | S_IWUSR, \ + show_temp_##offset##_max, set_temp_##offset##_max) \ +static DEVICE_ATTR(temp_min##offset, S_IRUGO | S_IWUSR, \ + show_temp_##offset##_min, set_temp_##offset##_min) + +show_temp_offset(1); +show_temp_offset(2); +show_temp_offset(3); + +/* 2 Fans */ +static ssize_t show_fan(struct device *dev, char *buf, int nr) +{ + struct i2c_client *client = to_i2c_client(dev); + struct it87_data *data = i2c_get_clientdata(client); + it87_update_client(client); + return sprintf(buf,"%d\n", FAN_FROM_REG(data->fan[nr], + DIV_FROM_REG(data->fan_div[nr])) ); +} +static ssize_t show_fan_min(struct device *dev, char *buf, int nr) +{ + struct i2c_client *client = to_i2c_client(dev); + struct it87_data *data = i2c_get_clientdata(client); + it87_update_client(client); + return sprintf(buf,"%d\n", + FAN_FROM_REG(data->fan_min[nr], DIV_FROM_REG(data->fan_div[nr])) ); +} +static ssize_t show_fan_div(struct device *dev, char *buf, int nr) +{ + struct i2c_client *client = to_i2c_client(dev); + struct it87_data *data = i2c_get_clientdata(client); + it87_update_client(client); + return sprintf(buf,"%d\n", DIV_FROM_REG(data->fan_div[nr]) ); +} +static ssize_t set_fan_min(struct device *dev, const char *buf, + size_t count, int nr) +{ + struct i2c_client *client = to_i2c_client(dev); + struct it87_data *data = i2c_get_clientdata(client); + int val = simple_strtol(buf, NULL, 10); + data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr])); + it87_write_value(client, IT87_REG_FAN_MIN(nr+1), data->fan_min[nr]); + return count; +} +static ssize_t set_fan_div(struct device *dev, const char *buf, + size_t count, int nr) +{ + struct i2c_client *client = to_i2c_client(dev); + struct it87_data *data = i2c_get_clientdata(client); + int val = simple_strtol(buf, NULL, 10); + int old = it87_read_value(client, IT87_REG_FAN_DIV); + data->fan_div[nr] = DIV_TO_REG(val); + old = (old & 0x0f) | (data->fan_div[1] << 6) | (data->fan_div[0] << 4); + it87_write_value(client, IT87_REG_FAN_DIV, old); + return count; +} + +#define show_fan_offset(offset) \ +static ssize_t show_fan_##offset (struct device *dev, char *buf) \ +{ \ + return show_fan(dev, buf, 0x##offset - 1); \ +} \ +static ssize_t show_fan_##offset##_min (struct device *dev, char *buf) \ +{ \ + return show_fan_min(dev, buf, 0x##offset - 1); \ +} \ +static ssize_t show_fan_##offset##_div (struct device *dev, char *buf) \ +{ \ + return show_fan_div(dev, buf, 0x##offset - 1); \ +} \ +static ssize_t set_fan_##offset##_min (struct device *dev, \ + const char *buf, size_t count) \ +{ \ + return set_fan_min(dev, buf, count, 0x##offset - 1); \ +} \ +static ssize_t set_fan_##offset##_div (struct device *dev, \ + const char *buf, size_t count) \ +{ \ + return set_fan_div(dev, buf, count, 0x##offset - 1); \ +} \ +static DEVICE_ATTR(fan_input##offset, S_IRUGO, show_fan_##offset, NULL) \ +static DEVICE_ATTR(fan_min##offset, S_IRUGO | S_IWUSR, \ + show_fan_##offset##_min, set_fan_##offset##_min) \ +static DEVICE_ATTR(fan_div##offset, S_IRUGO | S_IWUSR, \ + show_fan_##offset##_div, set_fan_##offset##_div) + +show_fan_offset(1); +show_fan_offset(2); + +/* Alarm */ +static ssize_t show_alarm(struct device *dev, char *buf) +{ + struct i2c_client *client = to_i2c_client(dev); + struct it87_data *data = i2c_get_clientdata(client); + it87_update_client(client); + return sprintf(buf,"%d\n", ALARMS_FROM_REG(data->alarms)); +} +static DEVICE_ATTR(alarm, S_IRUGO | S_IWUSR, show_alarm, NULL); + +/* This function is called when: + * it87_driver is inserted (when this module is loaded), for each + available adapter + * when a new adapter is inserted (and it87_driver is still present) */ +static int it87_attach_adapter(struct i2c_adapter *adapter) +{ + return i2c_detect(adapter, &addr_data, it87_detect); +} + +/* This function is called by i2c_detect */ +int it87_detect(struct i2c_adapter *adapter, int address, int kind) +{ + int i; + struct i2c_client *new_client = NULL; + struct it87_data *data; + int err = 0; + const char *name = ""; + const char *client_name = ""; + int is_isa = i2c_is_isa_adapter(adapter); + + if (!is_isa && + !i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) + goto ERROR0; + + /* Reserve the ISA region */ + if (is_isa) + if (!request_region(address, IT87_EXTENT, name)) + goto ERROR0; + + /* Probe whether there is anything available on this address. Already + done for SMBus clients */ + if (kind < 0) { + if (is_isa) { + +#define REALLY_SLOW_IO + /* We need the timeouts for at least some IT87-like chips. But only + if we read 'undefined' registers. */ + i = inb_p(address + 1); + if (inb_p(address + 2) != i) + goto ERROR1; + if (inb_p(address + 3) != i) + goto ERROR1; + if (inb_p(address + 7) != i) + goto ERROR1; +#undef REALLY_SLOW_IO + + /* Let's just hope nothing breaks here */ + i = inb_p(address + 5) & 0x7f; + outb_p(~i & 0x7f, address + 5); + if ((inb_p(address + 5) & 0x7f) != (~i & 0x7f)) { + outb_p(i, address + 5); + return 0; + } + } + } + + /* OK. For now, we presume we have a valid client. We now create the + client structure, even though we cannot fill it completely yet. + But it allows us to access it87_{read,write}_value. */ + + if (!(new_client = kmalloc((sizeof(struct i2c_client)) + + sizeof(struct it87_data), + GFP_KERNEL))) { + err = -ENOMEM; + goto ERROR1; + } + + data = (struct it87_data *) (new_client + 1); + if (is_isa) + init_MUTEX(&data->lock); + i2c_set_clientdata(new_client, data); + new_client->addr = address; + new_client->adapter = adapter; + new_client->driver = &it87_driver; + new_client->flags = 0; + + /* Now, we do the remaining detection. */ + + if (kind < 0) { + if (it87_read_value(new_client, IT87_REG_CONFIG) & 0x80) + goto ERROR1; + if (!is_isa + && (it87_read_value(new_client, IT87_REG_I2C_ADDR) != + address)) goto ERROR1; + } + + /* Determine the chip type. */ + if (kind <= 0) { + i = it87_read_value(new_client, IT87_REG_CHIPID); + if (i == 0x90) { + kind = it87; + } + else { + if (kind == 0) + printk + ("it87.o: Ignoring 'force' parameter for unknown chip at " + "adapter %d, address 0x%02x\n", + i2c_adapter_id(adapter), address); + goto ERROR1; + } + } + + if (kind == it87) { + name = "it87"; + client_name = "IT87 chip"; + } /* else if (kind == it8712) { + name = "it8712"; + client_name = "IT87-J chip"; + } */ else { + dev_dbg(&adapter->dev, "Internal error: unknown kind (%d)?!?", + kind); + goto ERROR1; + } + + /* Fill in the remaining client fields and put it into the global list */ + strncpy(new_client->dev.name, name, DEVICE_NAME_SIZE); + + data->type = kind; + + new_client->id = it87_id++; + data->valid = 0; + init_MUTEX(&data->update_lock); + + /* Tell the I2C layer a new client has arrived */ + if ((err = i2c_attach_client(new_client))) + goto ERROR1; + + /* register sysfs hooks */ + device_create_file(&new_client->dev, &dev_attr_in_input0); + device_create_file(&new_client->dev, &dev_attr_in_input1); + device_create_file(&new_client->dev, &dev_attr_in_input2); + device_create_file(&new_client->dev, &dev_attr_in_input3); + device_create_file(&new_client->dev, &dev_attr_in_input4); + device_create_file(&new_client->dev, &dev_attr_in_min0); + device_create_file(&new_client->dev, &dev_attr_in_min1); + device_create_file(&new_client->dev, &dev_attr_in_min2); + device_create_file(&new_client->dev, &dev_attr_in_min3); + device_create_file(&new_client->dev, &dev_attr_in_min4); + device_create_file(&new_client->dev, &dev_attr_in_max0); + device_create_file(&new_client->dev, &dev_attr_in_max1); + device_create_file(&new_client->dev, &dev_attr_in_max2); + device_create_file(&new_client->dev, &dev_attr_in_max3); + device_create_file(&new_client->dev, &dev_attr_in_max4); + device_create_file(&new_client->dev, &dev_attr_temp_input1); + device_create_file(&new_client->dev, &dev_attr_temp_input2); + device_create_file(&new_client->dev, &dev_attr_temp_input3); + device_create_file(&new_client->dev, &dev_attr_temp_max1); + device_create_file(&new_client->dev, &dev_attr_temp_max2); + device_create_file(&new_client->dev, &dev_attr_temp_max3); + device_create_file(&new_client->dev, &dev_attr_temp_min1); + device_create_file(&new_client->dev, &dev_attr_temp_min2); + device_create_file(&new_client->dev, &dev_attr_temp_min3); + device_create_file(&new_client->dev, &dev_attr_fan_input1); + device_create_file(&new_client->dev, &dev_attr_fan_input2); + device_create_file(&new_client->dev, &dev_attr_fan_min1); + device_create_file(&new_client->dev, &dev_attr_fan_min2); + device_create_file(&new_client->dev, &dev_attr_fan_div1); + device_create_file(&new_client->dev, &dev_attr_fan_div2); + device_create_file(&new_client->dev, &dev_attr_alarm); + + /* Initialize the IT87 chip */ + it87_init_client(new_client); + return 0; + +ERROR1: + kfree(new_client); + + if (is_isa) + release_region(address, IT87_EXTENT); +ERROR0: + return err; +} + +static int it87_detach_client(struct i2c_client *client) +{ + int err; + + if ((err = i2c_detach_client(client))) { + dev_err(&client->dev, + "Client deregistration failed, client not detached.\n"); + return err; + } + + if(i2c_is_isa_client(client)) + release_region(client->addr, IT87_EXTENT); + kfree(client); + + return 0; +} + +/* The SMBus locks itself, but ISA access must be locked explicitely! + We don't want to lock the whole ISA bus, so we lock each client + separately. + We ignore the IT87 BUSY flag at this moment - it could lead to deadlocks, + would slow down the IT87 access and should not be necessary. + There are some ugly typecasts here, but the good new is - they should + nowhere else be necessary! */ +static int it87_read_value(struct i2c_client *client, u8 reg) +{ + struct it87_data *data = i2c_get_clientdata(client); + + int res; + if (i2c_is_isa_client(client)) { + down(&data->lock); + outb_p(reg, client->addr + IT87_ADDR_REG_OFFSET); + res = inb_p(client->addr + IT87_DATA_REG_OFFSET); + up(&data->lock); + return res; + } else + return i2c_smbus_read_byte_data(client, reg); +} + +/* The SMBus locks itself, but ISA access muse be locked explicitely! + We don't want to lock the whole ISA bus, so we lock each client + separately. + We ignore the IT87 BUSY flag at this moment - it could lead to deadlocks, + would slow down the IT87 access and should not be necessary. + There are some ugly typecasts here, but the good new is - they should + nowhere else be necessary! */ +static int it87_write_value(struct i2c_client *client, u8 reg, u8 value) +{ + struct it87_data *data = i2c_get_clientdata(client); + + if (i2c_is_isa_client(client)) { + down(&data->lock); + outb_p(reg, client->addr + IT87_ADDR_REG_OFFSET); + outb_p(value, client->addr + IT87_DATA_REG_OFFSET); + up(&data->lock); + return 0; + } else + return i2c_smbus_write_byte_data(client, reg, value); +} + +/* Called when we have found a new IT87. It should set limits, etc. */ +static void it87_init_client(struct i2c_client *client) +{ + /* Reset all except Watchdog values and last conversion values + This sets fan-divs to 2, among others */ + it87_write_value(client, IT87_REG_CONFIG, 0x80); + it87_write_value(client, IT87_REG_VIN_MIN(0), + IN_TO_REG(IT87_INIT_IN_MIN_0, 0)); + it87_write_value(client, IT87_REG_VIN_MAX(0), + IN_TO_REG(IT87_INIT_IN_MAX_0, 0)); + it87_write_value(client, IT87_REG_VIN_MIN(1), + IN_TO_REG(IT87_INIT_IN_MIN_1, 1)); + it87_write_value(client, IT87_REG_VIN_MAX(1), + IN_TO_REG(IT87_INIT_IN_MAX_1, 1)); + it87_write_value(client, IT87_REG_VIN_MIN(2), + IN_TO_REG(IT87_INIT_IN_MIN_2, 2)); + it87_write_value(client, IT87_REG_VIN_MAX(2), + IN_TO_REG(IT87_INIT_IN_MAX_2, 2)); + it87_write_value(client, IT87_REG_VIN_MIN(3), + IN_TO_REG(IT87_INIT_IN_MIN_3, 3)); + it87_write_value(client, IT87_REG_VIN_MAX(3), + IN_TO_REG(IT87_INIT_IN_MAX_3, 3)); + it87_write_value(client, IT87_REG_VIN_MIN(4), + IN_TO_REG(IT87_INIT_IN_MIN_4, 4)); + it87_write_value(client, IT87_REG_VIN_MAX(4), + IN_TO_REG(IT87_INIT_IN_MAX_4, 4)); + it87_write_value(client, IT87_REG_VIN_MIN(5), + IN_TO_REG(IT87_INIT_IN_MIN_5, 5)); + it87_write_value(client, IT87_REG_VIN_MAX(5), + IN_TO_REG(IT87_INIT_IN_MAX_5, 5)); + it87_write_value(client, IT87_REG_VIN_MIN(6), + IN_TO_REG(IT87_INIT_IN_MIN_6, 6)); + it87_write_value(client, IT87_REG_VIN_MAX(6), + IN_TO_REG(IT87_INIT_IN_MAX_6, 6)); + it87_write_value(client, IT87_REG_VIN_MIN(7), + IN_TO_REG(IT87_INIT_IN_MIN_7, 7)); + it87_write_value(client, IT87_REG_VIN_MAX(7), + IN_TO_REG(IT87_INIT_IN_MAX_7, 7)); + /* Note: Battery voltage does not have limit registers */ + it87_write_value(client, IT87_REG_FAN_MIN(1), + FAN_TO_REG(IT87_INIT_FAN_MIN_1, 2)); + it87_write_value(client, IT87_REG_FAN_MIN(2), + FAN_TO_REG(IT87_INIT_FAN_MIN_2, 2)); + it87_write_value(client, IT87_REG_FAN_MIN(3), + FAN_TO_REG(IT87_INIT_FAN_MIN_3, 2)); + it87_write_value(client, IT87_REG_TEMP_HIGH(1), + TEMP_TO_REG(IT87_INIT_TEMP_HIGH_1)); + it87_write_value(client, IT87_REG_TEMP_LOW(1), + TEMP_TO_REG(IT87_INIT_TEMP_LOW_1)); + it87_write_value(client, IT87_REG_TEMP_HIGH(2), + TEMP_TO_REG(IT87_INIT_TEMP_HIGH_2)); + it87_write_value(client, IT87_REG_TEMP_LOW(2), + TEMP_TO_REG(IT87_INIT_TEMP_LOW_2)); + it87_write_value(client, IT87_REG_TEMP_HIGH(3), + TEMP_TO_REG(IT87_INIT_TEMP_HIGH_3)); + it87_write_value(client, IT87_REG_TEMP_LOW(3), + TEMP_TO_REG(IT87_INIT_TEMP_LOW_3)); + + /* Enable voltage monitors */ + it87_write_value(client, IT87_REG_VIN_ENABLE, 0xff); + + /* Enable Temp1-Temp3 */ + it87_write_value(client, IT87_REG_TEMP_ENABLE, + (it87_read_value(client, IT87_REG_TEMP_ENABLE) & 0xc0) + | (temp_type & 0x3f)); + + /* Enable fans */ + it87_write_value(client, IT87_REG_FAN_CTRL, + (it87_read_value(client, IT87_REG_FAN_CTRL) & 0x8f) + | 0x70); + + /* Start monitoring */ + it87_write_value(client, IT87_REG_CONFIG, + (it87_read_value(client, IT87_REG_CONFIG) & 0xb7) + | (update_vbat ? 0x41 : 0x01)); +} + +static void it87_update_client(struct i2c_client *client) +{ + struct it87_data *data = i2c_get_clientdata(client); + int i; + + down(&data->update_lock); + + if ((jiffies - data->last_updated > HZ + HZ / 2) || + (jiffies < data->last_updated) || !data->valid) { + + if (update_vbat) { + /* Cleared after each update, so reenable. Value + returned by this read will be previous value */ + it87_write_value(client, IT87_REG_CONFIG, + it87_read_value(client, IT87_REG_CONFIG) | 0x40); + } + for (i = 0; i <= 7; i++) { + data->in[i] = + it87_read_value(client, IT87_REG_VIN(i)); + data->in_min[i] = + it87_read_value(client, IT87_REG_VIN_MIN(i)); + data->in_max[i] = + it87_read_value(client, IT87_REG_VIN_MAX(i)); + } + data->in[8] = + it87_read_value(client, IT87_REG_VIN(8)); + /* Temperature sensor doesn't have limit registers, set + to min and max value */ + data->in_min[8] = 0; + data->in_max[8] = 255; + + for (i = 1; i <= 3; i++) { + data->fan[i - 1] = + it87_read_value(client, IT87_REG_FAN(i)); + data->fan_min[i - 1] = + it87_read_value(client, IT87_REG_FAN_MIN(i)); + } + for (i = 1; i <= 3; i++) { + data->temp[i - 1] = + it87_read_value(client, IT87_REG_TEMP(i)); + data->temp_high[i - 1] = + it87_read_value(client, IT87_REG_TEMP_HIGH(i)); + data->temp_low[i - 1] = + it87_read_value(client, IT87_REG_TEMP_LOW(i)); + } + + /* The 8705 does not have VID capability */ + /*if (data->type == it8712) { + data->vid = it87_read_value(client, IT87_REG_VID); + data->vid &= 0x1f; + } + else */ { + data->vid = 0x1f; + } + + i = it87_read_value(client, IT87_REG_FAN_DIV); + data->fan_div[0] = i & 0x07; + data->fan_div[1] = (i >> 3) & 0x07; + data->fan_div[2] = 1; + + data->alarms = + it87_read_value(client, IT87_REG_ALARM1) | + (it87_read_value(client, IT87_REG_ALARM2) << 8) | + (it87_read_value(client, IT87_REG_ALARM3) << 16); + + data->last_updated = jiffies; + data->valid = 1; + } + + up(&data->update_lock); +} + +static int __init sm_it87_init(void) +{ + return i2c_add_driver(&it87_driver); +} + +static void __exit sm_it87_exit(void) +{ + i2c_del_driver(&it87_driver); +} + + +MODULE_AUTHOR("Chris Gauthron "); +MODULE_DESCRIPTION("IT8705F, IT8712F, Sis950 driver"); +MODULE_PARM(update_vbat, "i"); +MODULE_PARM_DESC(update_vbat, "Update vbat if set else return powerup value"); +MODULE_PARM(temp_type, "i"); +MODULE_PARM_DESC(temp_type, "Temperature sensor type, normally leave unset"); +MODULE_LICENSE("GPL"); + +module_init(sm_it87_init); +module_exit(sm_it87_exit); diff -urN linux-2.5.68-bk5/drivers/i2c/chips/lm75.c linux-2.5.68-bk6/drivers/i2c/chips/lm75.c --- linux-2.5.68-bk5/drivers/i2c/chips/lm75.c 2003-04-19 19:48:46.000000000 -0700 +++ linux-2.5.68-bk6/drivers/i2c/chips/lm75.c 2003-04-25 04:34:13.000000000 -0700 @@ -28,10 +28,10 @@ /* Addresses to scan */ -static unsigned short normal_i2c[] = { SENSORS_I2C_END }; -static unsigned short normal_i2c_range[] = { 0x48, 0x4f, SENSORS_I2C_END }; -static unsigned int normal_isa[] = { SENSORS_ISA_END }; -static unsigned int normal_isa_range[] = { SENSORS_ISA_END }; +static unsigned short normal_i2c[] = { I2C_CLIENT_END }; +static unsigned short normal_i2c_range[] = { 0x48, 0x4f, I2C_CLIENT_END }; +static unsigned int normal_isa[] = { I2C_CLIENT_ISA_END }; +static unsigned int normal_isa_range[] = { I2C_CLIENT_ISA_END }; /* Insmod parameters */ SENSORS_INSMOD_1(lm75); diff -urN linux-2.5.68-bk5/drivers/i2c/chips/via686a.c linux-2.5.68-bk6/drivers/i2c/chips/via686a.c --- linux-2.5.68-bk5/drivers/i2c/chips/via686a.c 2003-04-19 19:48:51.000000000 -0700 +++ linux-2.5.68-bk6/drivers/i2c/chips/via686a.c 2003-04-25 04:34:13.000000000 -0700 @@ -51,10 +51,10 @@ /* Addresses to scan. Note that we can't determine the ISA address until we have initialized our module */ -static unsigned short normal_i2c[] = { SENSORS_I2C_END }; -static unsigned short normal_i2c_range[] = { SENSORS_I2C_END }; -static unsigned int normal_isa[] = { 0x0000, SENSORS_ISA_END }; -static unsigned int normal_isa_range[] = { SENSORS_ISA_END }; +static unsigned short normal_i2c[] = { I2C_CLIENT_END }; +static unsigned short normal_i2c_range[] = { I2C_CLIENT_END }; +static unsigned int normal_isa[] = { 0x0000, I2C_CLIENT_ISA_END }; +static unsigned int normal_isa_range[] = { I2C_CLIENT_ISA_END }; /* Insmod parameters */ SENSORS_INSMOD_1(via686a); diff -urN linux-2.5.68-bk5/drivers/i2c/chips/w83781d.c linux-2.5.68-bk6/drivers/i2c/chips/w83781d.c --- linux-2.5.68-bk5/drivers/i2c/chips/w83781d.c 2003-04-19 19:48:46.000000000 -0700 +++ linux-2.5.68-bk6/drivers/i2c/chips/w83781d.c 2003-04-25 04:34:13.000000000 -0700 @@ -46,14 +46,14 @@ #define W83781D_RT 1 /* Addresses to scan */ -static unsigned short normal_i2c[] = { SENSORS_I2C_END }; -static unsigned short normal_i2c_range[] = { 0x20, 0x2f, SENSORS_I2C_END }; -static unsigned int normal_isa[] = { 0x0290, SENSORS_ISA_END }; -static unsigned int normal_isa_range[] = { SENSORS_ISA_END }; +static unsigned short normal_i2c[] = { I2C_CLIENT_END }; +static unsigned short normal_i2c_range[] = { 0x20, 0x2f, I2C_CLIENT_END }; +static unsigned int normal_isa[] = { 0x0290, I2C_CLIENT_ISA_END }; +static unsigned int normal_isa_range[] = { I2C_CLIENT_ISA_END }; /* Insmod parameters */ SENSORS_INSMOD_6(w83781d, w83782d, w83783s, w83627hf, as99127f, w83697hf); -SENSORS_MODULE_PARM(force_subclients, "List of subclient addresses: " +I2C_CLIENT_MODULE_PARM(force_subclients, "List of subclient addresses: " "{bus, clientaddr, subclientaddr1, subclientaddr2}"); static int init = 1; diff -urN linux-2.5.68-bk5/drivers/i2c/i2c-core.c linux-2.5.68-bk6/drivers/i2c/i2c-core.c --- linux-2.5.68-bk5/drivers/i2c/i2c-core.c 2003-04-19 19:48:52.000000000 -0700 +++ linux-2.5.68-bk6/drivers/i2c/i2c-core.c 2003-04-25 04:34:13.000000000 -0700 @@ -618,8 +618,8 @@ * ---------------------------------------------------- */ int i2c_probe(struct i2c_adapter *adapter, - struct i2c_client_address_data *address_data, - i2c_client_found_addr_proc *found_proc) + struct i2c_client_address_data *address_data, + int (*found_proc) (struct i2c_adapter *, int, int)) { int addr,i,found,err; int adap_id = i2c_adapter_id(adapter); @@ -644,7 +644,7 @@ (addr == address_data->force[i+1])) { DEB2(printk(KERN_DEBUG "i2c-core.o: found force parameter for adapter %d, addr %04x\n", adap_id,addr)); - if ((err = found_proc(adapter,addr,0,0))) + if ((err = found_proc(adapter,addr,0))) return err; found = 1; } @@ -732,7 +732,7 @@ /* OK, so we really should examine this address. First check whether there is some client here at all! */ if (i2c_smbus_xfer(adapter,addr,0,0,0,I2C_SMBUS_QUICK,NULL) >= 0) - if ((err = found_proc(adapter,addr,0,-1))) + if ((err = found_proc(adapter,addr,-1))) return err; } return 0; diff -urN linux-2.5.68-bk5/drivers/i2c/i2c-sensor.c linux-2.5.68-bk6/drivers/i2c/i2c-sensor.c --- linux-2.5.68-bk5/drivers/i2c/i2c-sensor.c 2003-04-19 19:49:34.000000000 -0700 +++ linux-2.5.68-bk6/drivers/i2c/i2c-sensor.c 2003-04-25 04:34:13.000000000 -0700 @@ -35,14 +35,14 @@ /* Very inefficient for ISA detects, and won't work for 10-bit addresses! */ int i2c_detect(struct i2c_adapter *adapter, - struct i2c_address_data *address_data, - i2c_found_addr_proc * found_proc) + struct i2c_address_data *address_data, + int (*found_proc) (struct i2c_adapter *, int, int)) { int addr, i, found, j, err; struct i2c_force_data *this_force; int is_isa = i2c_is_isa_adapter(adapter); int adapter_id = - is_isa ? SENSORS_ISA_BUS : i2c_adapter_id(adapter); + is_isa ? ANY_I2C_ISA_BUS : i2c_adapter_id(adapter); /* Forget it if we can't probe using SMBUS_QUICK */ if ((!is_isa) && @@ -59,9 +59,9 @@ detection at all */ found = 0; for (i = 0; !found && (this_force = address_data->forces + i, this_force->force); i++) { - for (j = 0; !found && (this_force->force[j] != SENSORS_I2C_END); j += 2) { + for (j = 0; !found && (this_force->force[j] != I2C_CLIENT_END); j += 2) { if ( ((adapter_id == this_force->force[j]) || - ((this_force->force[j] == SENSORS_ANY_I2C_BUS) && !is_isa)) && + ((this_force->force[j] == ANY_I2C_BUS) && !is_isa)) && (addr == this_force->force[j + 1]) ) { dev_dbg(&adapter->dev, "found force parameter for adapter %d, addr %04x\n", adapter_id, addr); if ((err = found_proc(adapter, addr, this_force->kind))) @@ -75,18 +75,18 @@ /* If this address is in one of the ignores, we can forget about it right now */ - for (i = 0; !found && (address_data->ignore[i] != SENSORS_I2C_END); i += 2) { + for (i = 0; !found && (address_data->ignore[i] != I2C_CLIENT_END); i += 2) { if ( ((adapter_id == address_data->ignore[i]) || - ((address_data->ignore[i] == SENSORS_ANY_I2C_BUS) && + ((address_data->ignore[i] == ANY_I2C_BUS) && !is_isa)) && (addr == address_data->ignore[i + 1])) { dev_dbg(&adapter->dev, "found ignore parameter for adapter %d, addr %04x\n", adapter_id, addr); found = 1; } } - for (i = 0; !found && (address_data->ignore_range[i] != SENSORS_I2C_END); i += 3) { + for (i = 0; !found && (address_data->ignore_range[i] != I2C_CLIENT_END); i += 3) { if ( ((adapter_id == address_data->ignore_range[i]) || - ((address_data-> ignore_range[i] == SENSORS_ANY_I2C_BUS) & + ((address_data-> ignore_range[i] == ANY_I2C_BUS) & !is_isa)) && (addr >= address_data->ignore_range[i + 1]) && (addr <= address_data->ignore_range[i + 2])) { @@ -100,13 +100,13 @@ /* Now, we will do a detection, but only if it is in the normal or probe entries */ if (is_isa) { - for (i = 0; !found && (address_data->normal_isa[i] != SENSORS_ISA_END); i += 1) { + for (i = 0; !found && (address_data->normal_isa[i] != I2C_CLIENT_ISA_END); i += 1) { if (addr == address_data->normal_isa[i]) { dev_dbg(&adapter->dev, "found normal isa entry for adapter %d, addr %04x\n", adapter_id, addr); found = 1; } } - for (i = 0; !found && (address_data->normal_isa_range[i] != SENSORS_ISA_END); i += 3) { + for (i = 0; !found && (address_data->normal_isa_range[i] != I2C_CLIENT_ISA_END); i += 3) { if ((addr >= address_data->normal_isa_range[i]) && (addr <= address_data->normal_isa_range[i + 1]) && ((addr - address_data->normal_isa_range[i]) % address_data->normal_isa_range[i + 2] == 0)) { @@ -115,13 +115,13 @@ } } } else { - for (i = 0; !found && (address_data->normal_i2c[i] != SENSORS_I2C_END); i += 1) { + for (i = 0; !found && (address_data->normal_i2c[i] != I2C_CLIENT_END); i += 1) { if (addr == address_data->normal_i2c[i]) { found = 1; dev_dbg(&adapter->dev, "found normal i2c entry for adapter %d, addr %02x", adapter_id, addr); } } - for (i = 0; !found && (address_data->normal_i2c_range[i] != SENSORS_I2C_END); i += 2) { + for (i = 0; !found && (address_data->normal_i2c_range[i] != I2C_CLIENT_END); i += 2) { if ((addr >= address_data->normal_i2c_range[i]) && (addr <= address_data->normal_i2c_range[i + 1])) { dev_dbg(&adapter->dev, "found normal i2c_range entry for adapter %d, addr %04x\n", adapter_id, addr); @@ -131,19 +131,19 @@ } for (i = 0; - !found && (address_data->probe[i] != SENSORS_I2C_END); + !found && (address_data->probe[i] != I2C_CLIENT_END); i += 2) { if (((adapter_id == address_data->probe[i]) || ((address_data-> - probe[i] == SENSORS_ANY_I2C_BUS) & !is_isa)) + probe[i] == ANY_I2C_BUS) & !is_isa)) && (addr == address_data->probe[i + 1])) { dev_dbg(&adapter->dev, "found probe parameter for adapter %d, addr %04x\n", adapter_id, addr); found = 1; } } - for (i = 0; !found && (address_data->probe_range[i] != SENSORS_I2C_END); i += 3) { + for (i = 0; !found && (address_data->probe_range[i] != I2C_CLIENT_END); i += 3) { if ( ((adapter_id == address_data->probe_range[i]) || - ((address_data->probe_range[i] == SENSORS_ANY_I2C_BUS) & !is_isa)) && + ((address_data->probe_range[i] == ANY_I2C_BUS) & !is_isa)) && (addr >= address_data->probe_range[i + 1]) && (addr <= address_data->probe_range[i + 2])) { found = 1; @@ -163,20 +163,8 @@ return 0; } -static int __init i2c_sensor_init(void) -{ - return 0; -} - -static void __exit i2c_sensor_exit(void) -{ -} - EXPORT_SYMBOL(i2c_detect); MODULE_AUTHOR("Frodo Looijaard "); MODULE_DESCRIPTION("i2c-sensor driver"); MODULE_LICENSE("GPL"); - -module_init(i2c_sensor_init); -module_exit(i2c_sensor_exit); diff -urN linux-2.5.68-bk5/drivers/ide/ide-probe.c linux-2.5.68-bk6/drivers/ide/ide-probe.c --- linux-2.5.68-bk5/drivers/ide/ide-probe.c 2003-04-19 19:49:57.000000000 -0700 +++ linux-2.5.68-bk6/drivers/ide/ide-probe.c 2003-04-25 04:34:13.000000000 -0700 @@ -1214,7 +1214,7 @@ spin_unlock_irq(&ide_lock); out_up: up(&ide_cfg_sem); - return 0; + return 1; } static int ata_lock(dev_t dev, void *data) diff -urN linux-2.5.68-bk5/drivers/ide/ide-tape.c linux-2.5.68-bk6/drivers/ide/ide-tape.c --- linux-2.5.68-bk5/drivers/ide/ide-tape.c 2003-04-19 19:49:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/ide/ide-tape.c 2003-04-25 04:34:13.000000000 -0700 @@ -1404,7 +1404,7 @@ */ static void idetape_onstream_mode_sense_tape_parameter_page(ide_drive_t *drive, int debug); static int idetape_chrdev_release (struct inode *inode, struct file *filp); -static void idetape_write_release (struct inode *inode); +static void idetape_write_release (ide_drive_t *drive, unsigned int minor); /* * Too bad. The drive wants to send us data which we are not ready to accept. @@ -4292,18 +4292,6 @@ set_bit(IDETAPE_IGNORE_DSC, &tape->flags); } -/* - * Character device interface functions - */ -static ide_drive_t *get_drive_ptr (kdev_t i_rdev) -{ - unsigned int i = minor(i_rdev) & ~0xc0; - - if (i >= MAX_HWIFS * MAX_DRIVES) - return NULL; - return (idetape_chrdevs[i].drive); -} - static int idetape_onstream_space_over_filemarks_backward (ide_drive_t *drive,short mt_op,int mt_count) { idetape_tape_t *tape = drive->driver_data; @@ -4591,7 +4579,7 @@ size_t count, loff_t *ppos) { struct inode *inode = file->f_dentry->d_inode; - ide_drive_t *drive = get_drive_ptr(inode->i_rdev); + ide_drive_t *drive = file->private_data; idetape_tape_t *tape = drive->driver_data; ssize_t bytes_read,temp, actually_read = 0, rc; @@ -4819,8 +4807,9 @@ size_t count, loff_t *ppos) { struct inode *inode = file->f_dentry->d_inode; - ide_drive_t *drive = get_drive_ptr(inode->i_rdev); + ide_drive_t *drive = file->private_data; idetape_tape_t *tape = drive->driver_data; + unsigned int minor = minor(inode->i_rdev); ssize_t retval, actually_written = 0; int position; @@ -4852,7 +4841,7 @@ "EOM early warning"); #endif if (tape->chrdev_direction == idetape_direction_write) - idetape_write_release(inode); + idetape_write_release(drive, minor); return -ENOSPC; } } @@ -5293,7 +5282,7 @@ */ static int idetape_chrdev_ioctl (struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { - ide_drive_t *drive = get_drive_ptr(inode->i_rdev); + ide_drive_t *drive = file->private_data; idetape_tape_t *tape = drive->driver_data; struct mtop mtop; struct mtget mtget; @@ -5465,17 +5454,18 @@ */ static int idetape_chrdev_open (struct inode *inode, struct file *filp) { + unsigned int minor = minor(inode->i_rdev), i = minor & ~0xc0; ide_drive_t *drive; idetape_tape_t *tape; idetape_pc_t pc; - unsigned int minor = minor(inode->i_rdev); #if IDETAPE_DEBUG_LOG printk(KERN_INFO "ide-tape: Reached idetape_chrdev_open\n"); #endif /* IDETAPE_DEBUG_LOG */ - if ((drive = get_drive_ptr(inode->i_rdev)) == NULL) + if (i >= MAX_HWIFS * MAX_DRIVES) return -ENXIO; + drive = idetape_chrdevs[i].drive; tape = drive->driver_data; if (test_and_set_bit(IDETAPE_BUSY, &tape->flags)) @@ -5519,11 +5509,9 @@ return 0; } -static void idetape_write_release (struct inode *inode) +static void idetape_write_release (ide_drive_t *drive, unsigned int minor) { - ide_drive_t *drive = get_drive_ptr(inode->i_rdev); idetape_tape_t *tape = drive->driver_data; - unsigned int minor = minor(inode->i_rdev); idetape_empty_write_pipeline(drive); tape->merge_stage = __idetape_kmalloc_stage(tape, 1, 0); @@ -5537,8 +5525,6 @@ idetape_flush_tape_buffers(drive); idetape_write_header(drive, minor >= 128); idetape_flush_tape_buffers(drive); - - return; } /* @@ -5546,7 +5532,7 @@ */ static int idetape_chrdev_release (struct inode *inode, struct file *filp) { - ide_drive_t *drive = get_drive_ptr(inode->i_rdev); + ide_drive_t *drive = file->private_data; idetape_tape_t *tape; idetape_pc_t pc; unsigned int minor = minor(inode->i_rdev); @@ -5558,9 +5544,8 @@ printk(KERN_INFO "ide-tape: Reached idetape_chrdev_release\n"); #endif /* IDETAPE_DEBUG_LOG */ - if (tape->chrdev_direction == idetape_direction_write) { - idetape_write_release(inode); - } + if (tape->chrdev_direction == idetape_direction_write) + idetape_write_release(drive, minor); if (tape->chrdev_direction == idetape_direction_read) { if (minor < 128) idetape_discard_read_pipeline(drive, 1); @@ -6270,7 +6255,6 @@ static int idetape_attach (ide_drive_t *drive) { idetape_tape_t *tape; - char devfs_name[64]; int minor; if (!strstr("ide-tape", drive->driver_req)) @@ -6306,17 +6290,14 @@ idetape_setup(drive, tape, minor); idetape_chrdevs[minor].drive = drive; - sprintf(devfs_name, "%s/mt", drive->devfs_name); - tape->de_r = devfs_register (NULL, devfs_name, 0, - HWIF(drive)->major, minor, + devfs_mk_cdev(MKDEV(HWIF(drive)->major, minor) S_IFCHR | S_IRUGO | S_IWUGO, - &idetape_fops, NULL); - - sprintf(devfs_name, "%s/mtn", drive->devfs_name); - tape->de_n = devfs_register (NULL, devfs_name, 0, - HWIF(drive)->major, minor + 128, + &idetape_fops, NULL, + "%s/mt", drive->devfs_name); + devfs_mk_cdev(MKDEV(HWIF(drive)->major, minor + 128), S_IFCHR | S_IRUGO | S_IWUGO, - &idetape_fops, NULL); + &idetape_fops, NULL, + "%s/mtn", drive->devfs_name); drive->disk->number = devfs_register_tape(drive->devfs_name); drive->disk->fops = &idetape_block_ops; diff -urN linux-2.5.68-bk5/drivers/ide/legacy/hd.c linux-2.5.68-bk6/drivers/ide/legacy/hd.c --- linux-2.5.68-bk5/drivers/ide/legacy/hd.c 2003-04-19 19:48:46.000000000 -0700 +++ linux-2.5.68-bk6/drivers/ide/legacy/hd.c 2003-04-25 04:34:13.000000000 -0700 @@ -679,7 +679,7 @@ * be forgotten about... */ -static void hd_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t hd_interrupt(int irq, void *dev_id, struct pt_regs *regs) { void (*handler)(void) = do_hd; @@ -689,6 +689,7 @@ handler = unexpected_hd_interrupt; handler(); local_irq_enable(); + return IRQ_HANDLED; } static struct block_device_operations hd_fops = { diff -urN linux-2.5.68-bk5/drivers/ide/legacy/pdc4030.c linux-2.5.68-bk6/drivers/ide/legacy/pdc4030.c --- linux-2.5.68-bk5/drivers/ide/legacy/pdc4030.c 2003-04-19 19:49:31.000000000 -0700 +++ linux-2.5.68-bk6/drivers/ide/legacy/pdc4030.c 2003-04-25 04:34:13.000000000 -0700 @@ -113,7 +113,7 @@ */ int pdc4030_cmd(ide_drive_t *drive, u8 cmd) { - u32 timeout; + unsigned long timeout; u8 status_val; promise_selectproc(drive); /* redundant? */ diff -urN linux-2.5.68-bk5/drivers/ide/ppc/pmac.c linux-2.5.68-bk6/drivers/ide/ppc/pmac.c --- linux-2.5.68-bk5/drivers/ide/ppc/pmac.c 2003-04-19 19:48:51.000000000 -0700 +++ linux-2.5.68-bk6/drivers/ide/ppc/pmac.c 2003-04-25 04:34:13.000000000 -0700 @@ -702,7 +702,7 @@ static int ide_majors[] __pmacdata = { 3, 22, 33, 34, 56, 57 }; -kdev_t __init +dev_t __init pmac_find_ide_boot(char *bootdevice, int n) { int i; @@ -717,7 +717,7 @@ name = pmac_ide[i].node->full_name; if (memcmp(name, bootdevice, n) == 0 && name[n] == 0) { /* XXX should cope with the 2nd drive as well... */ - return mk_kdev(ide_majors[i], 0); + return MKDEV(ide_majors[i], 0); } } diff -urN linux-2.5.68-bk5/drivers/ieee1394/dv1394.c linux-2.5.68-bk6/drivers/ieee1394/dv1394.c --- linux-2.5.68-bk5/drivers/ieee1394/dv1394.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/ieee1394/dv1394.c 2003-04-25 04:34:13.000000000 -0700 @@ -108,7 +108,6 @@ #include #include #include -#include #include #include #include diff -urN linux-2.5.68-bk5/drivers/ieee1394/ohci1394.c linux-2.5.68-bk6/drivers/ieee1394/ohci1394.c --- linux-2.5.68-bk5/drivers/ieee1394/ohci1394.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/ieee1394/ohci1394.c 2003-04-25 04:34:13.000000000 -0700 @@ -108,7 +108,6 @@ #include #include #include -#include #include #include diff -urN linux-2.5.68-bk5/drivers/ieee1394/video1394.c linux-2.5.68-bk6/drivers/ieee1394/video1394.c --- linux-2.5.68-bk5/drivers/ieee1394/video1394.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/ieee1394/video1394.c 2003-04-25 04:34:13.000000000 -0700 @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include diff -urN linux-2.5.68-bk5/drivers/input/mouse/pc110pad.c linux-2.5.68-bk6/drivers/input/mouse/pc110pad.c --- linux-2.5.68-bk5/drivers/input/mouse/pc110pad.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/input/mouse/pc110pad.c 2003-04-25 04:34:13.000000000 -0700 @@ -71,7 +71,8 @@ pc110pad_data[pc110pad_count++] = value; - if (pc110pad_count < 3) return; + if (pc110pad_count < 3) + return IRQ_HANDLED; input_regs(&pc110pad_dev, regs); input_report_key(&pc110pad_dev, BTN_TOUCH, diff -urN linux-2.5.68-bk5/drivers/input/serio/parkbd.c linux-2.5.68-bk6/drivers/input/serio/parkbd.c --- linux-2.5.68-bk5/drivers/input/serio/parkbd.c 2003-04-19 19:48:49.000000000 -0700 +++ linux-2.5.68-bk6/drivers/input/serio/parkbd.c 2003-04-25 04:34:13.000000000 -0700 @@ -43,14 +43,14 @@ #define PARKBD_CLOCK 0x01 /* Strobe & Ack */ #define PARKBD_DATA 0x02 /* AutoFd & Busy */ -static int parkbd = 0; +static int parkbd; static int parkbd_mode = SERIO_8042; -static int parkbd_buffer = 0; -static int parkbd_counter = 0; -static int parkbd_last = 0; -static int parkbd_writing = 0; -static unsigned long parkbd_start = 0; +static int parkbd_buffer; +static int parkbd_counter; +static unsigned long parkbd_last; +static int parkbd_writing; +static unsigned long parkbd_start; static struct pardevice *parkbd_dev; diff -urN linux-2.5.68-bk5/drivers/isdn/capi/capi.c linux-2.5.68-bk6/drivers/isdn/capi/capi.c --- linux-2.5.68-bk5/drivers/isdn/capi/capi.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/isdn/capi/capi.c 2003-04-25 04:34:13.000000000 -0700 @@ -278,7 +278,6 @@ struct capincci *np, **pp; #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE struct capiminor *mp = 0; - kdev_t kdev; #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */ np = kmalloc(sizeof(*np), GFP_ATOMIC); @@ -297,8 +296,7 @@ printk(KERN_DEBUG "set mp->nccip\n"); #endif #if defined(CONFIG_ISDN_CAPI_CAPIFS) || defined(CONFIG_ISDN_CAPI_CAPIFS_MODULE) - kdev = mk_kdev(capi_ttymajor, mp->minor); - capifs_new_ncci(0, mp->minor, kdev); + capifs_new_ncci(0, mp->minor, MKDEV(capi_ttymajor, mp->minor)); #endif } #endif /* CONFIG_ISDN_CAPI_MIDDLEWARE */ diff -urN linux-2.5.68-bk5/drivers/isdn/capi/capidrv.c linux-2.5.68-bk6/drivers/isdn/capi/capidrv.c --- linux-2.5.68-bk5/drivers/isdn/capi/capidrv.c 2003-04-19 19:49:21.000000000 -0700 +++ linux-2.5.68-bk6/drivers/isdn/capi/capidrv.c 2003-04-25 04:34:13.000000000 -0700 @@ -1985,7 +1985,7 @@ static int capidrv_addcontr(u16 contr, struct capi_profile *profp) { capidrv_contr *card; - long flags; + unsigned long flags; isdn_ctrl cmd; char id[20]; int i; diff -urN linux-2.5.68-bk5/drivers/isdn/capi/capifs.c linux-2.5.68-bk6/drivers/isdn/capi/capifs.c --- linux-2.5.68-bk5/drivers/isdn/capi/capifs.c 2003-04-19 19:48:56.000000000 -0700 +++ linux-2.5.68-bk6/drivers/isdn/capi/capifs.c 2003-04-25 04:34:13.000000000 -0700 @@ -9,24 +9,12 @@ * */ -#include #include -#include -#include -#include -#include -#include +#include +#include #include -#include #include -#include -#include -#include -#include #include -#include -#include -#include MODULE_DESCRIPTION("CAPI4Linux: /dev/capi/ filesystem"); MODULE_AUTHOR("Carsten Paeth"); @@ -34,209 +22,33 @@ static char *revision = "$Revision: 1.14.6.8 $"; -struct capifs_ncci { - struct inode *inode; - char used; - char type; - unsigned int num; - kdev_t kdev; -}; - -struct capifs_sb_info { - u32 magic; - struct super_block *next; - struct super_block **back; +struct options { int setuid; int setgid; uid_t uid; gid_t gid; umode_t mode; - - unsigned int max_ncci; - struct capifs_ncci *nccis; }; +static struct options options = {.mode = 0600}; #define CAPIFS_SUPER_MAGIC (('C'<<8)|'N') -#define CAPIFS_SBI_MAGIC (('C'<<24)|('A'<<16)|('P'<<8)|'I') - -static inline struct capifs_sb_info *SBI(struct super_block *sb) -{ - return (struct capifs_sb_info *)(sb->s_fs_info); -} /* ------------------------------------------------------------------ */ -static int capifs_root_readdir(struct file *,void *,filldir_t); -static struct dentry *capifs_root_lookup(struct inode *,struct dentry *); -static int capifs_revalidate(struct dentry *, int); -static struct inode *capifs_new_inode(struct super_block *sb); - -static struct file_operations capifs_root_operations = { - .read = generic_read_dir, - .readdir = capifs_root_readdir, -}; - -struct inode_operations capifs_root_inode_operations = { - .lookup = capifs_root_lookup, -}; - -static struct dentry_operations capifs_dentry_operations = { - .d_revalidate = capifs_revalidate, -}; - -/* - * /dev/capi/%d - * /dev/capi/r%d - */ - -static int capifs_root_readdir(struct file *filp, void *dirent, filldir_t filldir) -{ - struct inode * inode = filp->f_dentry->d_inode; - struct capifs_sb_info * sbi = SBI(filp->f_dentry->d_inode->i_sb); - off_t nr; - char numbuf[32]; - - lock_kernel(); - - nr = filp->f_pos; - - switch(nr) - { - case 0: - if (filldir(dirent, ".", 1, nr, inode->i_ino, DT_DIR) < 0) - goto out; - filp->f_pos = ++nr; - /* fall through */ - case 1: - if (filldir(dirent, "..", 2, nr, inode->i_ino, DT_DIR) < 0) - goto out; - filp->f_pos = ++nr; - /* fall through */ - default: - while (nr < sbi->max_ncci) { - int n = nr - 2; - struct capifs_ncci *np = &sbi->nccis[n]; - if (np->inode && np->used) { - char *p = numbuf; - if (np->type) *p++ = np->type; - sprintf(p, "%u", np->num); - if ( filldir(dirent, numbuf, strlen(numbuf), nr, nr, DT_UNKNOWN) < 0 ) - goto out; - } - filp->f_pos = ++nr; - } - break; - } - -out: - unlock_kernel(); - return 0; -} - -/* - * Revalidate is called on every cache lookup. We use it to check that - * the ncci really does still exist. Never revalidate negative dentries; - * for simplicity (fix later?) - */ -static int capifs_revalidate(struct dentry * dentry, int flags) -{ - struct capifs_sb_info *sbi; - - if ( !dentry->d_inode ) - return 0; - - sbi = SBI(dentry->d_inode->i_sb); - - return ( sbi->nccis[dentry->d_inode->i_ino - 2].inode == dentry->d_inode ); -} - -static struct dentry *capifs_root_lookup(struct inode * dir, struct dentry * dentry) -{ - struct capifs_sb_info *sbi = SBI(dir->i_sb); - struct capifs_ncci *np; - unsigned int i; - char numbuf[32]; - char *p, *tmp; - unsigned int num; - char type = 0; - - dentry->d_inode = NULL; /* Assume failure */ - dentry->d_op = &capifs_dentry_operations; - - if (dentry->d_name.len >= sizeof(numbuf) ) - return NULL; - strncpy(numbuf, dentry->d_name.name, dentry->d_name.len); - numbuf[dentry->d_name.len] = 0; - p = numbuf; - if (!isdigit(*p)) type = *p++; - tmp = p; - num = (unsigned int)simple_strtoul(p, &tmp, 10); - if (tmp == p || *tmp) - return NULL; - - lock_kernel(); - for (i = 0, np = sbi->nccis ; i < sbi->max_ncci; i++, np++) { - if (np->used && np->num == num && np->type == type) - break; - } - unlock_kernel(); - - if ( i >= sbi->max_ncci ) - return NULL; - - dentry->d_inode = np->inode; - if ( dentry->d_inode ) - atomic_inc(&dentry->d_inode->i_count); - - d_add(dentry, dentry->d_inode); - - return NULL; -} - -/* ------------------------------------------------------------------ */ - -static struct super_block *mounts = NULL; - -static void capifs_put_super(struct super_block *sb) -{ - struct capifs_sb_info *sbi = SBI(sb); - struct inode *inode; - int i; - - for ( i = 0 ; i < sbi->max_ncci ; i++ ) { - if ( (inode = sbi->nccis[i].inode) ) { - if (atomic_read(&inode->i_count) != 1 ) - printk("capifs_put_super: badness: entry %d count %d\n", - i, (unsigned)atomic_read(&inode->i_count)); - inode->i_nlink--; - iput(inode); - } - } - - *sbi->back = sbi->next; - if ( sbi->next ) - SBI(sbi->next)->back = sbi->back; - - kfree(sbi->nccis); - kfree(sbi); -} - -static struct super_operations capifs_sops = { - .put_super = capifs_put_super, - .statfs = simple_statfs, -}; -static int capifs_parse_options(char *options, struct capifs_sb_info *sbi) +static int capifs_parse_options(char *s, struct options *p) { int setuid = 0; int setgid = 0; uid_t uid = 0; gid_t gid = 0; umode_t mode = 0600; - unsigned int maxncci = 512; char *this_char, *value; - while ((this_char = strsep(&options,",")) != NULL) { + if (!s) + return 0; + + while ((this_char = strsep(&s, ",")) != NULL) { if (!*this_char) continue; if ((value = strchr(this_char,'=')) != NULL) @@ -264,110 +76,74 @@ if (*value) return 1; } - else if (!strcmp(this_char,"maxncci")) { - if (!value || !*value) - return 1; - maxncci = simple_strtoul(value,&value,8); - if (*value) - return 1; - } - else - return 1; } - sbi->setuid = setuid; - sbi->setgid = setgid; - sbi->uid = uid; - sbi->gid = gid; - sbi->mode = mode & ~S_IFMT; - sbi->max_ncci = maxncci; + p->setuid = setuid; + p->setgid = setgid; + p->uid = uid; + p->gid = gid; + p->mode = mode & ~S_IFMT; return 0; } -static int capifs_fill_super(struct super_block *s, void *data, int silent) +static int capifs_remount(struct super_block *s, int *flags, char *data) { - struct inode * root_inode; - struct dentry * root; - struct capifs_sb_info *sbi; - - sbi = (struct capifs_sb_info *) kmalloc(sizeof(struct capifs_sb_info), GFP_KERNEL); - if ( !sbi ) - goto fail; - - memset(sbi, 0, sizeof(struct capifs_sb_info)); - sbi->magic = CAPIFS_SBI_MAGIC; - - if ( capifs_parse_options(data,sbi) ) { - kfree(sbi); + struct options new; + if (capifs_parse_options(data, &new)) { printk("capifs: called with bogus options\n"); - goto fail; + return -EINVAL; } + options = new; + return 0; +} + - sbi->nccis = kmalloc(sizeof(struct capifs_ncci) * sbi->max_ncci, GFP_KERNEL); - if ( !sbi->nccis ) { - kfree(sbi); - goto fail; +static struct super_operations capifs_sops = +{ + .statfs = simple_statfs, + .remount_fs = capifs_remount, +}; + +static int capifs_fill_super(struct super_block *s, void *data, int silent) +{ + struct inode * inode; + + if (capifs_parse_options(data, &options)) { + printk("capifs: called with bogus options\n"); + return -EINVAL; } - memset(sbi->nccis, 0, sizeof(struct capifs_ncci) * sbi->max_ncci); - s->s_fs_info = (void *) sbi; s->s_blocksize = 1024; s->s_blocksize_bits = 10; s->s_magic = CAPIFS_SUPER_MAGIC; s->s_op = &capifs_sops; - /* - * Get the root inode and dentry, but defer checking for errors. - */ - root_inode = capifs_new_inode(s); - if (root_inode) { - root_inode->i_ino = 1; - root_inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR; - root_inode->i_op = &capifs_root_inode_operations; - root_inode->i_fop = &capifs_root_operations; - root_inode->i_nlink = 2; - } - root = d_alloc_root(root_inode); + inode = new_inode(s); + if (!inode) + return -ENOMEM; + inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; + inode->i_blocks = 0; + inode->i_blksize = 1024; + inode->i_uid = inode->i_gid = 0; + inode->i_ino = 1; + inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR; + inode->i_op = &simple_dir_inode_operations; + inode->i_fop = &simple_dir_operations; + inode->i_nlink = 2; + s->s_root = d_alloc_root(inode); - if (!root) { + if (!s->s_root) { printk("capifs: get root dentry failed\n"); - /* - * iput() can block, so we clear the super block first. - */ - iput(root_inode); - kfree(sbi->nccis); - kfree(sbi); - goto fail; + iput(inode); + return -ENOMEM; } - - s->s_root = root; - - sbi->next = mounts; - if ( sbi->next ) - SBI(sbi->next)->back = &(sbi->next); - sbi->back = &mounts; - mounts = s; return 0; -fail: - return -EINVAL; -} - -static struct inode *capifs_new_inode(struct super_block *sb) -{ - struct inode *inode = new_inode(sb); - if (inode) { - inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; - inode->i_blocks = 0; - inode->i_blksize = 1024; - inode->i_uid = inode->i_gid = 0; - } - return inode; } static struct super_block *capifs_get_sb(struct file_system_type *fs_type, int flags, char *dev_name, void *data) { - return get_sb_nodev(fs_type, flags, data, capifs_fill_super); + return get_sb_single(fs_type, flags, data, capifs_fill_super); } static struct file_system_type capifs_fs_type = { @@ -377,62 +153,99 @@ .kill_sb = kill_anon_super, }; -void capifs_new_ncci(char type, unsigned int num, kdev_t device) +static spinlock_t entries_lock = SPIN_LOCK_UNLOCKED; +static struct vfsmount *capifs_mnt; +static int entry_count = 0; + +static struct vfsmount *grab_instance(void) +{ + struct vfsmount *mnt = NULL; + spin_lock(&entries_lock); + if (!capifs_mnt) { + spin_unlock(&entries_lock); + mnt = kern_mount(&capifs_fs_type); + if (IS_ERR(mnt)) + return NULL; + spin_lock(&entries_lock); + if (!capifs_mnt) + capifs_mnt = mnt; + } + mntget(capifs_mnt); + entry_count++; + spin_unlock(&entries_lock); + mntput(mnt); + return capifs_mnt; +} + +static void drop_instance(void) +{ + struct vfsmount *mnt; + spin_lock(&entries_lock); + mnt = capifs_mnt; + if (!--entry_count) + capifs_mnt = NULL; + spin_unlock(&entries_lock); + mntput(mnt); +} + +static struct dentry *get_node(int type, int num) +{ + char s[10]; + int len; + struct dentry *root = capifs_mnt->mnt_root; + if (type) + len = sprintf(s, "%d", num); + else + len = sprintf(s, "%c%d", type, num); + down(&root->d_inode->i_sem); + return lookup_one_len(s, root, len); +} + +void capifs_new_ncci(char type, unsigned int num, dev_t device) { struct super_block *sb; - struct capifs_sb_info *sbi; - struct capifs_ncci *np; - ino_t ino; - - for ( sb = mounts ; sb ; sb = sbi->next ) { - sbi = SBI(sb); - - for (ino = 0, np = sbi->nccis ; ino < sbi->max_ncci; ino++, np++) { - if (np->used == 0) { - np->used = 1; - np->type = type; - np->num = num; - np->kdev = device; - break; - } - } - if ( ino >= sbi->max_ncci ) - continue; + struct dentry *dentry; + struct inode *inode; - if ((np->inode = capifs_new_inode(sb)) != NULL) { - struct inode *inode = np->inode; - inode->i_uid = sbi->setuid ? sbi->uid : current->fsuid; - inode->i_gid = sbi->setgid ? sbi->gid : current->fsgid; - inode->i_nlink = 1; - inode->i_ino = ino + 2; - init_special_inode(inode, sbi->mode|S_IFCHR, kdev_t_to_nr(np->kdev)); - } + if (!grab_instance()) + return; + sb = capifs_mnt->mnt_sb; + inode = new_inode(sb); + if (inode) { + inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; + inode->i_blocks = 0; + inode->i_blksize = 1024; + inode->i_uid = options.setuid ? options.uid : current->fsuid; + inode->i_gid = options.setgid ? options.gid : current->fsgid; + inode->i_nlink = 1; + init_special_inode(inode, S_IFCHR | options.mode, device); + dentry = get_node(type, num); + if (!IS_ERR(dentry) && !dentry->d_inode) { + grab_instance(); + d_instantiate(dentry, inode); + } else + iput(inode); + up(&sb->s_root->d_inode->i_sem); } + drop_instance(); } void capifs_free_ncci(char type, unsigned int num) { - struct super_block *sb; - struct capifs_sb_info *sbi; - struct inode *inode; - struct capifs_ncci *np; - ino_t ino; - - for ( sb = mounts ; sb ; sb = sbi->next ) { - sbi = SBI(sb); - - for (ino = 0, np = sbi->nccis ; ino < sbi->max_ncci; ino++, np++) { - if (!np->used || np->type != type || np->num != num) - continue; - if (np->inode) { - inode = np->inode; - np->inode = 0; - np->used = 0; + if (grab_instance()) { + struct dentry *dentry = get_node(type, num); + if (!IS_ERR(dentry)) { + struct inode *inode = dentry->d_inode; + if (inode) { inode->i_nlink--; - iput(inode); - break; + d_delete(dentry); + dput(dentry); + drop_instance(); } + dput(dentry); } + up(&capifs_mnt->mnt_root->d_inode->i_sem); + drop_instance(); } } @@ -442,8 +255,6 @@ char *p; int err; - MOD_INC_USE_COUNT; - if ((p = strchr(revision, ':')) != 0 && p[1]) { strncpy(rev, p + 2, sizeof(rev)); rev[sizeof(rev)-1] = 0; @@ -453,12 +264,8 @@ strcpy(rev, "1.0"); err = register_filesystem(&capifs_fs_type); - if (err) { - MOD_DEC_USE_COUNT; - return err; - } - printk(KERN_NOTICE "capifs: Rev %s\n", rev); - MOD_DEC_USE_COUNT; + if (!err) + printk(KERN_NOTICE "capifs: Rev %s\n", rev); return 0; } diff -urN linux-2.5.68-bk5/drivers/isdn/capi/capifs.h linux-2.5.68-bk6/drivers/isdn/capi/capifs.h --- linux-2.5.68-bk5/drivers/isdn/capi/capifs.h 2003-04-19 19:48:51.000000000 -0700 +++ linux-2.5.68-bk6/drivers/isdn/capi/capifs.h 2003-04-25 04:34:13.000000000 -0700 @@ -7,5 +7,5 @@ * */ -void capifs_new_ncci(char type, unsigned int num, kdev_t device); +void capifs_new_ncci(char type, unsigned int num, dev_t device); void capifs_free_ncci(char type, unsigned int num); diff -urN linux-2.5.68-bk5/drivers/isdn/hardware/eicon/diva.c linux-2.5.68-bk6/drivers/isdn/hardware/eicon/diva.c --- linux-2.5.68-bk5/drivers/isdn/hardware/eicon/diva.c 2003-04-19 19:50:35.000000000 -0700 +++ linux-2.5.68-bk6/drivers/isdn/hardware/eicon/diva.c 2003-04-25 04:34:13.000000000 -0700 @@ -509,22 +509,23 @@ } -void diva_os_irq_wrapper(int irq, void *context, struct pt_regs *regs) +irqreturn_t diva_os_irq_wrapper(int irq, void *context, struct pt_regs *regs) { diva_os_xdi_adapter_t *a = (diva_os_xdi_adapter_t *) context; diva_xdi_clear_interrupts_proc_t clear_int_proc; if (!a || !a->xdi_adapter.diva_isr_handler) { - return; + return IRQ_NONE; } if ((clear_int_proc = a->clear_interrupts_proc)) { (*clear_int_proc) (a); a->clear_interrupts_proc = 0; - return; + return IRQ_HANDLED; } (*(a->xdi_adapter.diva_isr_handler)) (&a->xdi_adapter); + return IRQ_HANDLED; } static void diva_init_request_array(void) diff -urN linux-2.5.68-bk5/drivers/isdn/hardware/eicon/divasmain.c linux-2.5.68-bk6/drivers/isdn/hardware/eicon/divasmain.c --- linux-2.5.68-bk5/drivers/isdn/hardware/eicon/divasmain.c 2003-04-19 19:48:51.000000000 -0700 +++ linux-2.5.68-bk6/drivers/isdn/hardware/eicon/divasmain.c 2003-04-25 04:34:13.000000000 -0700 @@ -61,7 +61,7 @@ static char *DRIVERLNAME = "divas"; char *DRIVERRELEASE = "2.0"; -extern void diva_os_irq_wrapper(int irq, void *context, +extern irqreturn_t diva_os_irq_wrapper(int irq, void *context, struct pt_regs *regs); extern int create_divas_proc(void); extern void remove_divas_proc(void); diff -urN linux-2.5.68-bk5/drivers/isdn/hisax/isurf.c linux-2.5.68-bk6/drivers/isdn/hisax/isurf.c --- linux-2.5.68-bk5/drivers/isdn/hisax/isurf.c 2003-04-19 19:49:54.000000000 -0700 +++ linux-2.5.68-bk6/drivers/isdn/hisax/isurf.c 2003-04-25 04:34:13.000000000 -0700 @@ -94,7 +94,7 @@ .write_reg = WriteISAR, }; -static void +static irqreturn_t isurf_interrupt(int intno, void *dev_id, struct pt_regs *regs) { struct IsdnCardState *cs = dev_id; @@ -130,6 +130,7 @@ writeb(0, cs->hw.isurf.isac + ISAC_MASK);mb(); writeb(ISAR_IRQMSK, cs->hw.isurf.isar + ISAR_IRQBIT); mb(); spin_unlock(&cs->lock); + return IRQ_HANDLED; } static void diff -urN linux-2.5.68-bk5/drivers/macintosh/macserial.c linux-2.5.68-bk6/drivers/macintosh/macserial.c --- linux-2.5.68-bk5/drivers/macintosh/macserial.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/macintosh/macserial.c 2003-04-25 04:34:13.000000000 -0700 @@ -2835,9 +2835,11 @@ /* Don't disable the transmitter. */ } -static kdev_t serial_console_device(struct console *c) +extern struct tty_driver serial_driver; +static struct tty_driver *serial_console_device(struct console *c, int *index) { - return mk_kdev(TTY_MAJOR, 64 + c->index); + *index = c->index; + return &serial_driver; } /* diff -urN linux-2.5.68-bk5/drivers/media/video/adv7175.c linux-2.5.68-bk6/drivers/media/video/adv7175.c --- linux-2.5.68-bk5/drivers/media/video/adv7175.c 2003-04-19 19:50:50.000000000 -0700 +++ linux-2.5.68-bk6/drivers/media/video/adv7175.c 2003-04-25 04:34:13.000000000 -0700 @@ -39,7 +39,6 @@ #include #include #include -#include #include #include @@ -164,7 +163,8 @@ { struct adv7175 *encoder; struct i2c_client *client; - int rv, i, x_common=39; /* x is number entries init_common - 1 */ + int rv = 0; + int i, x_common=39; /* x is number entries init_common - 1 */ printk(KERN_INFO "adv717x: video chip found.\n"); client=kmalloc(sizeof(*client), GFP_KERNEL); diff -urN linux-2.5.68-bk5/drivers/media/video/bt856.c linux-2.5.68-bk6/drivers/media/video/bt856.c --- linux-2.5.68-bk5/drivers/media/video/bt856.c 2003-04-19 19:48:48.000000000 -0700 +++ linux-2.5.68-bk6/drivers/media/video/bt856.c 2003-04-25 04:34:13.000000000 -0700 @@ -41,7 +41,6 @@ #include #include #include -#include #include #include diff -urN linux-2.5.68-bk5/drivers/media/video/bttv-vbi.c linux-2.5.68-bk6/drivers/media/video/bttv-vbi.c --- linux-2.5.68-bk5/drivers/media/video/bttv-vbi.c 2003-04-19 19:50:06.000000000 -0700 +++ linux-2.5.68-bk6/drivers/media/video/bttv-vbi.c 2003-04-25 04:34:13.000000000 -0700 @@ -62,7 +62,8 @@ return 0; } -static int vbi_buffer_setup(struct file *file, int *count, int *size) +static int vbi_buffer_setup(struct file *file, + unsigned int *count, unsigned int *size) { struct bttv_fh *fh = file->private_data; struct bttv *btv = fh->btv; diff -urN linux-2.5.68-bk5/drivers/media/video/cpia.c linux-2.5.68-bk6/drivers/media/video/cpia.c --- linux-2.5.68-bk5/drivers/media/video/cpia.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/media/video/cpia.c 2003-04-25 04:34:13.000000000 -0700 @@ -39,7 +39,6 @@ #include #include #include -#include #ifdef CONFIG_KMOD #include diff -urN linux-2.5.68-bk5/drivers/media/video/meye.c linux-2.5.68-bk6/drivers/media/video/meye.c --- linux-2.5.68-bk5/drivers/media/video/meye.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/media/video/meye.c 2003-04-25 04:34:13.000000000 -0700 @@ -35,7 +35,6 @@ #include #include #include -#include #include #include diff -urN linux-2.5.68-bk5/drivers/media/video/msp3400.c linux-2.5.68-bk6/drivers/media/video/msp3400.c --- linux-2.5.68-bk5/drivers/media/video/msp3400.c 2003-04-19 19:50:02.000000000 -0700 +++ linux-2.5.68-bk6/drivers/media/video/msp3400.c 2003-04-25 04:34:13.000000000 -0700 @@ -1208,8 +1208,7 @@ /* ----------------------------------------------------------------------- */ -static int msp_attach(struct i2c_adapter *adap, int addr, - unsigned short flags, int kind); +static int msp_attach(struct i2c_adapter *adap, int addr, int kind); static int msp_detach(struct i2c_client *client); static int msp_probe(struct i2c_adapter *adap); static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg); @@ -1233,8 +1232,7 @@ }, }; -static int msp_attach(struct i2c_adapter *adap, int addr, - unsigned short flags, int kind) +static int msp_attach(struct i2c_adapter *adap, int addr, int kind) { DECLARE_MUTEX_LOCKED(sem); struct msp3400c *msp; diff -urN linux-2.5.68-bk5/drivers/media/video/mxb.c linux-2.5.68-bk6/drivers/media/video/mxb.c --- linux-2.5.68-bk5/drivers/media/video/mxb.c 2003-04-19 19:48:50.000000000 -0700 +++ linux-2.5.68-bk6/drivers/media/video/mxb.c 2003-04-25 04:34:13.000000000 -0700 @@ -177,6 +177,9 @@ int cur_mute; /* current mute status */ }; +static +struct saa7146_extension extension; + static int mxb_vbi_bypass(struct saa7146_dev* dev) { struct mxb* mxb = (struct mxb*)dev->ext_priv; @@ -269,6 +272,95 @@ return 0; } +/* some init data for the saa7740, the so-called 'sound arena module'. + there are no specs available, so we simply use some init values */ +static struct { + int length; + char data[9]; +} mxb_saa7740_init[] = { + { 3, { 0x80, 0x00, 0x00 } },{ 3, { 0x80, 0x89, 0x00 } }, + { 3, { 0x80, 0xb0, 0x0a } },{ 3, { 0x00, 0x00, 0x00 } }, + { 3, { 0x49, 0x00, 0x00 } },{ 3, { 0x4a, 0x00, 0x00 } }, + { 3, { 0x4b, 0x00, 0x00 } },{ 3, { 0x4c, 0x00, 0x00 } }, + { 3, { 0x4d, 0x00, 0x00 } },{ 3, { 0x4e, 0x00, 0x00 } }, + { 3, { 0x4f, 0x00, 0x00 } },{ 3, { 0x50, 0x00, 0x00 } }, + { 3, { 0x51, 0x00, 0x00 } },{ 3, { 0x52, 0x00, 0x00 } }, + { 3, { 0x53, 0x00, 0x00 } },{ 3, { 0x54, 0x00, 0x00 } }, + { 3, { 0x55, 0x00, 0x00 } },{ 3, { 0x56, 0x00, 0x00 } }, + { 3, { 0x57, 0x00, 0x00 } },{ 3, { 0x58, 0x00, 0x00 } }, + { 3, { 0x59, 0x00, 0x00 } },{ 3, { 0x5a, 0x00, 0x00 } }, + { 3, { 0x5b, 0x00, 0x00 } },{ 3, { 0x5c, 0x00, 0x00 } }, + { 3, { 0x5d, 0x00, 0x00 } },{ 3, { 0x5e, 0x00, 0x00 } }, + { 3, { 0x5f, 0x00, 0x00 } },{ 3, { 0x60, 0x00, 0x00 } }, + { 3, { 0x61, 0x00, 0x00 } },{ 3, { 0x62, 0x00, 0x00 } }, + { 3, { 0x63, 0x00, 0x00 } },{ 3, { 0x64, 0x00, 0x00 } }, + { 3, { 0x65, 0x00, 0x00 } },{ 3, { 0x66, 0x00, 0x00 } }, + { 3, { 0x67, 0x00, 0x00 } },{ 3, { 0x68, 0x00, 0x00 } }, + { 3, { 0x69, 0x00, 0x00 } },{ 3, { 0x6a, 0x00, 0x00 } }, + { 3, { 0x6b, 0x00, 0x00 } },{ 3, { 0x6c, 0x00, 0x00 } }, + { 3, { 0x6d, 0x00, 0x00 } },{ 3, { 0x6e, 0x00, 0x00 } }, + { 3, { 0x6f, 0x00, 0x00 } },{ 3, { 0x70, 0x00, 0x00 } }, + { 3, { 0x71, 0x00, 0x00 } },{ 3, { 0x72, 0x00, 0x00 } }, + { 3, { 0x73, 0x00, 0x00 } },{ 3, { 0x74, 0x00, 0x00 } }, + { 3, { 0x75, 0x00, 0x00 } },{ 3, { 0x76, 0x00, 0x00 } }, + { 3, { 0x77, 0x00, 0x00 } },{ 3, { 0x41, 0x00, 0x42 } }, + { 3, { 0x42, 0x10, 0x42 } },{ 3, { 0x43, 0x20, 0x42 } }, + { 3, { 0x44, 0x30, 0x42 } },{ 3, { 0x45, 0x00, 0x01 } }, + { 3, { 0x46, 0x00, 0x01 } },{ 3, { 0x47, 0x00, 0x01 } }, + { 3, { 0x48, 0x00, 0x01 } }, + { 9, { 0x01, 0x03, 0xc5, 0x5c, 0x7a, 0x85, 0x01, 0x00, 0x54 } }, + { 9, { 0x21, 0x03, 0xc5, 0x5c, 0x7a, 0x85, 0x01, 0x00, 0x54 } }, + { 9, { 0x09, 0x0b, 0xb4, 0x6b, 0x74, 0x85, 0x95, 0x00, 0x34 } }, + { 9, { 0x29, 0x0b, 0xb4, 0x6b, 0x74, 0x85, 0x95, 0x00, 0x34 } }, + { 9, { 0x11, 0x17, 0x43, 0x62, 0x68, 0x89, 0xd1, 0xff, 0xb0 } }, + { 9, { 0x31, 0x17, 0x43, 0x62, 0x68, 0x89, 0xd1, 0xff, 0xb0 } }, + { 9, { 0x19, 0x20, 0x62, 0x51, 0x5a, 0x95, 0x19, 0x01, 0x50 } }, + { 9, { 0x39, 0x20, 0x62, 0x51, 0x5a, 0x95, 0x19, 0x01, 0x50 } }, + { 9, { 0x05, 0x3e, 0xd2, 0x69, 0x4e, 0x9a, 0x51, 0x00, 0xf0 } }, + { 9, { 0x25, 0x3e, 0xd2, 0x69, 0x4e, 0x9a, 0x51, 0x00, 0xf0 } }, + { 9, { 0x0d, 0x3d, 0xa1, 0x40, 0x7d, 0x9f, 0x29, 0xfe, 0x14 } }, + { 9, { 0x2d, 0x3d, 0xa1, 0x40, 0x7d, 0x9f, 0x29, 0xfe, 0x14 } }, + { 9, { 0x15, 0x73, 0xa1, 0x50, 0x5d, 0xa6, 0xf5, 0xfe, 0x38 } }, + { 9, { 0x35, 0x73, 0xa1, 0x50, 0x5d, 0xa6, 0xf5, 0xfe, 0x38 } }, + { 9, { 0x1d, 0xed, 0xd0, 0x68, 0x29, 0xb4, 0xe1, 0x00, 0xb8 } }, + { 9, { 0x3d, 0xed, 0xd0, 0x68, 0x29, 0xb4, 0xe1, 0x00, 0xb8 } }, + { 3, { 0x80, 0xb3, 0x0a } }, + {-1, { 0} } +}; + +static unsigned char mxb_saa7111_init[25] = { + 0x00, + + 0x00, /* 00 - ID byte */ + 0x00, /* 01 - reserved */ + + /*front end */ + 0xd8, /* 02 - FUSE=x, GUDL=x, MODE=x */ + 0x23, /* 03 - HLNRS=0, VBSL=1, WPOFF=0, HOLDG=0, GAFIX=0, GAI1=256, GAI2=256 */ + 0x00, /* 04 - GAI1=256 */ + 0x00, /* 05 - GAI2=256 */ + + /* decoder */ + 0xf0, /* 06 - HSB at xx(50Hz) / xx(60Hz) pixels after end of last line */ + 0x30, /* 07 - HSS at xx(50Hz) / xx(60Hz) pixels after end of last line */ + 0xa8, /* 08 - AUFD=x, FSEL=x, EXFIL=x, VTRC=x, HPLL=x, VNOI=x */ + 0x02, /* 09 - BYPS=x, PREF=x, BPSS=x, VBLB=x, UPTCV=x, APER=x */ + 0x80, /* 0a - BRIG=128 */ + 0x47, /* 0b - CONT=1.109 */ + 0x40, /* 0c - SATN=1.0 */ + 0x00, /* 0d - HUE=0 */ + 0x01, /* 0e - CDTO=0, CSTD=0, DCCF=0, FCTC=0, CHBW=1 */ + 0x00, /* 0f - reserved */ + 0xd0, /* 10 - OFTS=x, HDEL=x, VRLN=x, YDEL=x */ + 0x8c, /* 11 - GPSW=x, CM99=x, FECO=x, COMPO=x, OEYC=1, OEHV=1, VIPB=0, COLO=0 */ + 0x80, /* 12 - xx output control 2 */ + 0x30, /* 13 - xx output control 3 */ + 0x00, /* 14 - reserved */ + 0x15, /* 15 - VBI */ + 0x04, /* 16 - VBI */ + 0x00, /* 17 - VBI */ +}; + /* bring hardware to a sane state. this has to be done, just in case someone wants to capture from this device before it has been properly initialized. the capture engine would badly fail, because no valid signal arrives on the @@ -277,100 +369,13 @@ { struct mxb* mxb = (struct mxb*)dev->ext_priv; - struct { - int length; - char data[9]; - } saa7740_init[] = { - { 3, { 0x80, 0x00, 0x00 } },{ 3, { 0x80, 0x89, 0x00 } }, - { 3, { 0x80, 0xb0, 0x0a } },{ 3, { 0x00, 0x00, 0x00 } }, - { 3, { 0x49, 0x00, 0x00 } },{ 3, { 0x4a, 0x00, 0x00 } }, - { 3, { 0x4b, 0x00, 0x00 } },{ 3, { 0x4c, 0x00, 0x00 } }, - { 3, { 0x4d, 0x00, 0x00 } },{ 3, { 0x4e, 0x00, 0x00 } }, - { 3, { 0x4f, 0x00, 0x00 } },{ 3, { 0x50, 0x00, 0x00 } }, - { 3, { 0x51, 0x00, 0x00 } },{ 3, { 0x52, 0x00, 0x00 } }, - { 3, { 0x53, 0x00, 0x00 } },{ 3, { 0x54, 0x00, 0x00 } }, - { 3, { 0x55, 0x00, 0x00 } },{ 3, { 0x56, 0x00, 0x00 } }, - { 3, { 0x57, 0x00, 0x00 } },{ 3, { 0x58, 0x00, 0x00 } }, - { 3, { 0x59, 0x00, 0x00 } },{ 3, { 0x5a, 0x00, 0x00 } }, - { 3, { 0x5b, 0x00, 0x00 } },{ 3, { 0x5c, 0x00, 0x00 } }, - { 3, { 0x5d, 0x00, 0x00 } },{ 3, { 0x5e, 0x00, 0x00 } }, - { 3, { 0x5f, 0x00, 0x00 } },{ 3, { 0x60, 0x00, 0x00 } }, - { 3, { 0x61, 0x00, 0x00 } },{ 3, { 0x62, 0x00, 0x00 } }, - { 3, { 0x63, 0x00, 0x00 } },{ 3, { 0x64, 0x00, 0x00 } }, - { 3, { 0x65, 0x00, 0x00 } },{ 3, { 0x66, 0x00, 0x00 } }, - { 3, { 0x67, 0x00, 0x00 } },{ 3, { 0x68, 0x00, 0x00 } }, - { 3, { 0x69, 0x00, 0x00 } },{ 3, { 0x6a, 0x00, 0x00 } }, - { 3, { 0x6b, 0x00, 0x00 } },{ 3, { 0x6c, 0x00, 0x00 } }, - { 3, { 0x6d, 0x00, 0x00 } },{ 3, { 0x6e, 0x00, 0x00 } }, - { 3, { 0x6f, 0x00, 0x00 } },{ 3, { 0x70, 0x00, 0x00 } }, - { 3, { 0x71, 0x00, 0x00 } },{ 3, { 0x72, 0x00, 0x00 } }, - { 3, { 0x73, 0x00, 0x00 } },{ 3, { 0x74, 0x00, 0x00 } }, - { 3, { 0x75, 0x00, 0x00 } },{ 3, { 0x76, 0x00, 0x00 } }, - { 3, { 0x77, 0x00, 0x00 } },{ 3, { 0x41, 0x00, 0x42 } }, - { 3, { 0x42, 0x10, 0x42 } },{ 3, { 0x43, 0x20, 0x42 } }, - { 3, { 0x44, 0x30, 0x42 } },{ 3, { 0x45, 0x00, 0x01 } }, - { 3, { 0x46, 0x00, 0x01 } },{ 3, { 0x47, 0x00, 0x01 } }, - { 3, { 0x48, 0x00, 0x01 } }, - { 9, { 0x01, 0x03, 0xc5, 0x5c, 0x7a, 0x85, 0x01, 0x00, 0x54 } }, - { 9, { 0x21, 0x03, 0xc5, 0x5c, 0x7a, 0x85, 0x01, 0x00, 0x54 } }, - { 9, { 0x09, 0x0b, 0xb4, 0x6b, 0x74, 0x85, 0x95, 0x00, 0x34 } }, - { 9, { 0x29, 0x0b, 0xb4, 0x6b, 0x74, 0x85, 0x95, 0x00, 0x34 } }, - { 9, { 0x11, 0x17, 0x43, 0x62, 0x68, 0x89, 0xd1, 0xff, 0xb0 } }, - { 9, { 0x31, 0x17, 0x43, 0x62, 0x68, 0x89, 0xd1, 0xff, 0xb0 } }, - { 9, { 0x19, 0x20, 0x62, 0x51, 0x5a, 0x95, 0x19, 0x01, 0x50 } }, - { 9, { 0x39, 0x20, 0x62, 0x51, 0x5a, 0x95, 0x19, 0x01, 0x50 } }, - { 9, { 0x05, 0x3e, 0xd2, 0x69, 0x4e, 0x9a, 0x51, 0x00, 0xf0 } }, - { 9, { 0x25, 0x3e, 0xd2, 0x69, 0x4e, 0x9a, 0x51, 0x00, 0xf0 } }, - { 9, { 0x0d, 0x3d, 0xa1, 0x40, 0x7d, 0x9f, 0x29, 0xfe, 0x14 } }, - { 9, { 0x2d, 0x3d, 0xa1, 0x40, 0x7d, 0x9f, 0x29, 0xfe, 0x14 } }, - { 9, { 0x15, 0x73, 0xa1, 0x50, 0x5d, 0xa6, 0xf5, 0xfe, 0x38 } }, - { 9, { 0x35, 0x73, 0xa1, 0x50, 0x5d, 0xa6, 0xf5, 0xfe, 0x38 } }, - { 9, { 0x1d, 0xed, 0xd0, 0x68, 0x29, 0xb4, 0xe1, 0x00, 0xb8 } }, - { 9, { 0x3d, 0xed, 0xd0, 0x68, 0x29, 0xb4, 0xe1, 0x00, 0xb8 } }, - { 3, { 0x80, 0xb3, 0x0a } }, - {-1, { 0} } - }; - - unsigned char init[25] = { - 0x00, - - 0x00, /* 00 - ID byte */ - 0x00, /* 01 - reserved */ - - /*front end */ - 0xd8, /* 02 - FUSE=x, GUDL=x, MODE=x */ - 0x23, /* 03 - HLNRS=0, VBSL=1, WPOFF=0, HOLDG=0, GAFIX=0, GAI1=256, GAI2=256 */ - 0x00, /* 04 - GAI1=256 */ - 0x00, /* 05 - GAI2=256 */ - - /* decoder */ - 0xf0, /* 06 - HSB at xx(50Hz) / xx(60Hz) pixels after end of last line */ - 0x30, /* 07 - HSS at xx(50Hz) / xx(60Hz) pixels after end of last line */ - 0xa8, /* 08 - AUFD=x, FSEL=x, EXFIL=x, VTRC=x, HPLL=x, VNOI=x */ - 0x02, /* 09 - BYPS=x, PREF=x, BPSS=x, VBLB=x, UPTCV=x, APER=x */ - 0x80, /* 0a - BRIG=128 */ - 0x47, /* 0b - CONT=1.109 */ - 0x40, /* 0c - SATN=1.0 */ - 0x00, /* 0d - HUE=0 */ - 0x01, /* 0e - CDTO=0, CSTD=0, DCCF=0, FCTC=0, CHBW=1 */ - 0x00, /* 0f - reserved */ - 0xd0, /* 10 - OFTS=x, HDEL=x, VRLN=x, YDEL=x */ - 0x8c, /* 11 - GPSW=x, CM99=x, FECO=x, COMPO=x, OEYC=1, OEHV=1, VIPB=0, COLO=0 */ - 0x80, /* 12 - xx output control 2 */ - 0x30, /* 13 - xx output control 3 */ - 0x00, /* 14 - reserved */ - 0x15, /* 15 - VBI */ - 0x04, /* 16 - VBI */ - 0x00, /* 17 - VBI */ - }; - struct i2c_msg msg; int i = 0, err = 0; struct tea6415c_multiplex vm; /* write configuration to saa7111a */ - i = i2c_master_send(mxb->saa7111a, init, sizeof(init)); + i = i2c_master_send(mxb->saa7111a, mxb_saa7111_init, sizeof(mxb_saa7111_init)); if (i < 0) { printk("failed to initialize saa7111a. this should never happen.\n"); } @@ -420,16 +425,22 @@ engineered. */ msg.addr = 0x1b; msg.flags = 0; - msg.len = saa7740_init[0].length; - msg.buf = &saa7740_init[0].data[0]; + msg.len = mxb_saa7740_init[0].length; + msg.buf = &mxb_saa7740_init[0].data[0]; if( 1 == (err = i2c_transfer(&mxb->i2c_adapter, &msg, 1))) { + /* the sound arena module is a pos, that's probably the reason + philips refuses to hand out a datasheet for the saa7740... + it seems to screw up the i2c bus, so we disable fast irq + based i2c transactions here and rely on the slow and safe + polling method ... */ + extension.flags &= ~SAA7146_USE_I2C_IRQ; for(i = 1;;i++) { - msg.len = saa7740_init[i].length; - if( -1 == msg.len ) { + msg.len = mxb_saa7740_init[i].length; + if (msg.len == -1U) { break; } - msg.buf = &saa7740_init[i].data[0]; + msg.buf = &mxb_saa7740_init[i].data[0]; if( 1 != (err = i2c_transfer(&mxb->i2c_adapter, &msg, 1))) { DEB_D(("failed to initialize 'sound arena module'.\n")); goto err; @@ -1003,9 +1014,6 @@ }; static -struct saa7146_extension extension; - -static struct saa7146_pci_extension_data mxb = { .ext_priv = "Multimedia eXtension Board", .ext = &extension, @@ -1024,6 +1032,8 @@ } }; +MODULE_DEVICE_TABLE(pci, pci_tbl); + static struct saa7146_ext_vv vv_data = { .inputs = MXB_INPUTS, diff -urN linux-2.5.68-bk5/drivers/media/video/planb.c linux-2.5.68-bk6/drivers/media/video/planb.c --- linux-2.5.68-bk5/drivers/media/video/planb.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/media/video/planb.c 2003-04-25 04:34:13.000000000 -0700 @@ -40,7 +40,6 @@ #include #include #include -#include #include #include #include diff -urN linux-2.5.68-bk5/drivers/media/video/saa5249.c linux-2.5.68-bk6/drivers/media/video/saa5249.c --- linux-2.5.68-bk5/drivers/media/video/saa5249.c 2003-04-19 19:50:34.000000000 -0700 +++ linux-2.5.68-bk6/drivers/media/video/saa5249.c 2003-04-25 04:34:13.000000000 -0700 @@ -149,7 +149,7 @@ static struct i2c_client client_template; -static int saa5249_attach(struct i2c_adapter *adap, int addr, unsigned short flags, int kind) +static int saa5249_attach(struct i2c_adapter *adap, int addr, int kind) { int pgbuf; int err; diff -urN linux-2.5.68-bk5/drivers/media/video/saa7111.c linux-2.5.68-bk6/drivers/media/video/saa7111.c --- linux-2.5.68-bk5/drivers/media/video/saa7111.c 2003-04-19 19:49:14.000000000 -0700 +++ linux-2.5.68-bk6/drivers/media/video/saa7111.c 2003-04-25 04:34:13.000000000 -0700 @@ -66,7 +66,7 @@ /* ----------------------------------------------------------------------- */ -static int saa7111_attach(struct i2c_adapter *adap, int addr, unsigned short flags, int kind) +static int saa7111_attach(struct i2c_adapter *adap, int addr, int kind) { int i; struct saa7111 *decoder; diff -urN linux-2.5.68-bk5/drivers/media/video/saa7134/saa7134-core.c linux-2.5.68-bk6/drivers/media/video/saa7134/saa7134-core.c --- linux-2.5.68-bk5/drivers/media/video/saa7134/saa7134-core.c 2003-04-19 19:48:58.000000000 -0700 +++ linux-2.5.68-bk6/drivers/media/video/saa7134/saa7134-core.c 2003-04-25 04:34:13.000000000 -0700 @@ -532,7 +532,7 @@ printk("\n"); } -static void saa7134_irq(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t saa7134_irq(int irq, void *dev_id, struct pt_regs *regs) { struct saa7134_dev *dev = (struct saa7134_dev*) dev_id; unsigned long report,status; @@ -546,7 +546,7 @@ if (irq_debug > 1) printk(KERN_DEBUG "%s/irq: no (more) work\n", dev->name); - return; + goto out; } if (irq_debug) print_irqstatus(dev,loop,report,status); @@ -582,6 +582,8 @@ saa_writel(SAA7134_IRQ1,0); saa_writel(SAA7134_IRQ2,0); } +out: + return IRQ_HANDLED; } /* ------------------------------------------------------------------ */ diff -urN linux-2.5.68-bk5/drivers/media/video/saa7134/saa7134-ts.c linux-2.5.68-bk6/drivers/media/video/saa7134/saa7134-ts.c --- linux-2.5.68-bk5/drivers/media/video/saa7134/saa7134-ts.c 2003-04-19 19:48:49.000000000 -0700 +++ linux-2.5.68-bk6/drivers/media/video/saa7134/saa7134-ts.c 2003-04-25 04:34:13.000000000 -0700 @@ -127,7 +127,7 @@ } static int -buffer_setup(struct file *file, int *count, int *size) +buffer_setup(struct file *file, unsigned int *count, unsigned int *size) { *size = TS_PACKET_SIZE * TS_NR_PACKETS; if (0 == *count) diff -urN linux-2.5.68-bk5/drivers/media/video/saa7134/saa7134-video.c linux-2.5.68-bk6/drivers/media/video/saa7134/saa7134-video.c --- linux-2.5.68-bk5/drivers/media/video/saa7134/saa7134-video.c 2003-04-19 19:48:53.000000000 -0700 +++ linux-2.5.68-bk6/drivers/media/video/saa7134/saa7134-video.c 2003-04-25 04:34:13.000000000 -0700 @@ -882,7 +882,7 @@ } static int -buffer_setup(struct file *file, int *count, int *size) +buffer_setup(struct file *file, unsigned int *count, unsigned int *size) { struct saa7134_fh *fh = file->private_data; diff -urN linux-2.5.68-bk5/drivers/media/video/saa7185.c linux-2.5.68-bk6/drivers/media/video/saa7185.c --- linux-2.5.68-bk5/drivers/media/video/saa7185.c 2003-04-19 19:48:49.000000000 -0700 +++ linux-2.5.68-bk6/drivers/media/video/saa7185.c 2003-04-25 04:34:13.000000000 -0700 @@ -37,7 +37,6 @@ #include #include #include -#include #include #include diff -urN linux-2.5.68-bk5/drivers/media/video/stradis.c linux-2.5.68-bk6/drivers/media/video/stradis.c --- linux-2.5.68-bk5/drivers/media/video/stradis.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/media/video/stradis.c 2003-04-25 04:34:13.000000000 -0700 @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include diff -urN linux-2.5.68-bk5/drivers/media/video/tda7432.c linux-2.5.68-bk6/drivers/media/video/tda7432.c --- linux-2.5.68-bk5/drivers/media/video/tda7432.c 2003-04-19 19:50:30.000000000 -0700 +++ linux-2.5.68-bk6/drivers/media/video/tda7432.c 2003-04-25 04:34:13.000000000 -0700 @@ -312,8 +312,7 @@ * i2c interface functions * * *********************** */ -static int tda7432_attach(struct i2c_adapter *adap, int addr, - unsigned short flags, int kind) +static int tda7432_attach(struct i2c_adapter *adap, int addr, int kind) { struct tda7432 *t; struct i2c_client *client; diff -urN linux-2.5.68-bk5/drivers/media/video/tda9840.c linux-2.5.68-bk6/drivers/media/video/tda9840.c --- linux-2.5.68-bk5/drivers/media/video/tda9840.c 2003-04-19 19:50:29.000000000 -0700 +++ linux-2.5.68-bk6/drivers/media/video/tda9840.c 2003-04-25 04:34:13.000000000 -0700 @@ -178,7 +178,7 @@ return 0; } -static int tda9840_detect(struct i2c_adapter *adapter, int address, unsigned short flags, int kind) +static int tda9840_detect(struct i2c_adapter *adapter, int address, int kind) { struct i2c_client *client; int result = 0; diff -urN linux-2.5.68-bk5/drivers/media/video/tda9875.c linux-2.5.68-bk6/drivers/media/video/tda9875.c --- linux-2.5.68-bk5/drivers/media/video/tda9875.c 2003-04-19 19:49:21.000000000 -0700 +++ linux-2.5.68-bk6/drivers/media/video/tda9875.c 2003-04-25 04:34:13.000000000 -0700 @@ -240,8 +240,7 @@ return(0); } -static int tda9875_attach(struct i2c_adapter *adap, int addr, - unsigned short flags, int kind) +static int tda9875_attach(struct i2c_adapter *adap, int addr, int kind) { struct tda9875 *t; struct i2c_client *client; diff -urN linux-2.5.68-bk5/drivers/media/video/tda9887.c linux-2.5.68-bk6/drivers/media/video/tda9887.c --- linux-2.5.68-bk5/drivers/media/video/tda9887.c 2003-04-19 19:48:46.000000000 -0700 +++ linux-2.5.68-bk6/drivers/media/video/tda9887.c 2003-04-25 04:34:13.000000000 -0700 @@ -345,8 +345,7 @@ /* ---------------------------------------------------------------------- */ -static int tda9887_attach(struct i2c_adapter *adap, int addr, - unsigned short flags, int kind) +static int tda9887_attach(struct i2c_adapter *adap, int addr, int kind) { struct tda9887 *t; diff -urN linux-2.5.68-bk5/drivers/media/video/tea6415c.c linux-2.5.68-bk6/drivers/media/video/tea6415c.c --- linux-2.5.68-bk5/drivers/media/video/tea6415c.c 2003-04-19 19:50:33.000000000 -0700 +++ linux-2.5.68-bk6/drivers/media/video/tea6415c.c 2003-04-25 04:34:13.000000000 -0700 @@ -55,7 +55,7 @@ static int tea6415c_id = 0; /* this function is called by i2c_probe */ -static int tea6415c_detect(struct i2c_adapter *adapter, int address, unsigned short flags, int kind) +static int tea6415c_detect(struct i2c_adapter *adapter, int address, int kind) { struct i2c_client *client = 0; int err = 0; diff -urN linux-2.5.68-bk5/drivers/media/video/tea6420.c linux-2.5.68-bk6/drivers/media/video/tea6420.c --- linux-2.5.68-bk5/drivers/media/video/tea6420.c 2003-04-19 19:49:30.000000000 -0700 +++ linux-2.5.68-bk6/drivers/media/video/tea6420.c 2003-04-25 04:34:13.000000000 -0700 @@ -95,7 +95,7 @@ } /* this function is called by i2c_probe */ -static int tea6420_detect(struct i2c_adapter *adapter, int address, unsigned short flags, int kind) +static int tea6420_detect(struct i2c_adapter *adapter, int address, int kind) { struct i2c_client *client; int err = 0, i = 0; diff -urN linux-2.5.68-bk5/drivers/media/video/tuner-3036.c linux-2.5.68-bk6/drivers/media/video/tuner-3036.c --- linux-2.5.68-bk5/drivers/media/video/tuner-3036.c 2003-04-19 19:49:20.000000000 -0700 +++ linux-2.5.68-bk6/drivers/media/video/tuner-3036.c 2003-04-25 04:34:13.000000000 -0700 @@ -114,8 +114,7 @@ /* ---------------------------------------------------------------------- */ static int -tuner_attach(struct i2c_adapter *adap, int addr, - unsigned short flags, int kind) +tuner_attach(struct i2c_adapter *adap, int addr, int kind) { static unsigned char buffer[] = { 0x29, 0x32, 0x2a, 0, 0x2b, 0 }; diff -urN linux-2.5.68-bk5/drivers/media/video/tuner.c linux-2.5.68-bk6/drivers/media/video/tuner.c --- linux-2.5.68-bk5/drivers/media/video/tuner.c 2003-04-19 19:50:43.000000000 -0700 +++ linux-2.5.68-bk6/drivers/media/video/tuner.c 2003-04-25 04:34:13.000000000 -0700 @@ -776,8 +776,7 @@ /* ---------------------------------------------------------------------- */ -static int tuner_attach(struct i2c_adapter *adap, int addr, - unsigned short flags, int kind) +static int tuner_attach(struct i2c_adapter *adap, int addr, int kind) { struct tuner *t; struct i2c_client *client; diff -urN linux-2.5.68-bk5/drivers/media/video/tvaudio.c linux-2.5.68-bk6/drivers/media/video/tvaudio.c --- linux-2.5.68-bk5/drivers/media/video/tvaudio.c 2003-04-19 19:48:58.000000000 -0700 +++ linux-2.5.68-bk6/drivers/media/video/tvaudio.c 2003-04-25 04:34:13.000000000 -0700 @@ -1326,8 +1326,7 @@ /* ---------------------------------------------------------------------- */ /* i2c registration */ -static int chip_attach(struct i2c_adapter *adap, int addr, - unsigned short flags, int kind) +static int chip_attach(struct i2c_adapter *adap, int addr, int kind) { struct CHIPSTATE *chip; struct CHIPDESC *desc; diff -urN linux-2.5.68-bk5/drivers/media/video/w9966.c linux-2.5.68-bk6/drivers/media/video/w9966.c --- linux-2.5.68-bk5/drivers/media/video/w9966.c 2003-04-19 19:48:55.000000000 -0700 +++ linux-2.5.68-bk6/drivers/media/video/w9966.c 2003-04-25 04:34:13.000000000 -0700 @@ -157,7 +157,9 @@ static int w9966_rReg(struct w9966_dev* cam, int reg); static int w9966_wReg(struct w9966_dev* cam, int reg, int data); +#if 0 static int w9966_rReg_i2c(struct w9966_dev* cam, int reg); +#endif static int w9966_wReg_i2c(struct w9966_dev* cam, int reg, int data); static int w9966_findlen(int near, int size, int maxlen); static int w9966_calcscale(int size, int min, int max, int* beg, int* end, unsigned char* factor); @@ -171,7 +173,9 @@ static inline int w9966_i2c_getsda(struct w9966_dev* cam); static inline int w9966_i2c_getscl(struct w9966_dev* cam); static int w9966_i2c_wbyte(struct w9966_dev* cam, int data); +#if 0 static int w9966_i2c_rbyte(struct w9966_dev* cam); +#endif static int w9966_v4l_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); @@ -555,7 +559,8 @@ // Expects a claimed pdev. -1 on error static inline int w9966_i2c_setscl(struct w9966_dev* cam, int state) { - int timeout; + unsigned long timeout; + if (state) cam->i2c_state |= W9966_I2C_W_CLOCK; else @@ -616,6 +621,7 @@ // Read a data byte with ack from the i2c-bus // Expects a claimed pdev. -1 on error +#if 0 static int w9966_i2c_rbyte(struct w9966_dev* cam) { unsigned char data = 0x00; @@ -635,9 +641,11 @@ } return data; } +#endif // Read a register from the i2c device. // Expects claimed pdev. -1 on error +#if 0 static int w9966_rReg_i2c(struct w9966_dev* cam, int reg) { int data; @@ -671,6 +679,7 @@ return data; } +#endif // Write a register to the i2c device. // Expects claimed pdev. -1 on error diff -urN linux-2.5.68-bk5/drivers/media/video/zr36067.c linux-2.5.68-bk6/drivers/media/video/zr36067.c --- linux-2.5.68-bk5/drivers/media/video/zr36067.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/media/video/zr36067.c 2003-04-25 04:34:13.000000000 -0700 @@ -59,7 +59,6 @@ #include #include #include -#include #include #include @@ -2781,12 +2780,13 @@ } } -static void zoran_irq(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t zoran_irq(int irq, void *dev_id, struct pt_regs *regs) { u32 stat, astat; int count; struct zoran *zr; unsigned long flags; + int handled = 0; zr = (struct zoran *) dev_id; count = 0; @@ -2805,7 +2805,7 @@ } zr->last_isr = stat; spin_unlock_irqrestore(&zr->lock, flags); - return; + return IRQ_HANDLED; } spin_lock_irqsave(&zr->lock, flags); @@ -2816,6 +2816,7 @@ if (!astat) { break; } + handled = 1; if (astat & cardvsync[zr->card]) { // SW if (zr->codec_mode == BUZ_MODE_MOTION_DECOMPRESS @@ -3009,6 +3010,7 @@ zr->last_isr = stat; } spin_unlock_irqrestore(&zr->lock, flags); + return IRQ_RETVAL(handled); } /* Check a zoran_params struct for correctness, insert default params */ diff -urN linux-2.5.68-bk5/drivers/media/video/zr36120_mem.c linux-2.5.68-bk6/drivers/media/video/zr36120_mem.c --- linux-2.5.68-bk5/drivers/media/video/zr36120_mem.c 2003-04-25 04:34:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/media/video/zr36120_mem.c 2003-04-25 04:34:13.000000000 -0700 @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include diff -urN linux-2.5.68-bk5/drivers/message/i2o/i2o_core.c linux-2.5.68-bk6/drivers/message/i2o/i2o_core.c --- linux-2.5.68-bk5/drivers/message/i2o/i2o_core.c 2003-04-19 19:50:04.000000000 -0700 +++ linux-2.5.68-bk6/drivers/message/i2o/i2o_core.c 2003-04-25 04:34:13.000000000 -0700 @@ -3463,10 +3463,11 @@ * to be rather simple. We keep the controller pointer in the cookie. */ -static void i2o_pci_interrupt(int irq, void *dev_id, struct pt_regs *r) +static irqreturn_t i2o_pci_interrupt(int irq, void *dev_id, struct pt_regs *r) { struct i2o_controller *c = dev_id; i2o_run_queue(c); + return IRQ_HANDLED; } /** diff -urN linux-2.5.68-bk5/drivers/mtd/chips/sharp.c linux-2.5.68-bk6/drivers/mtd/chips/sharp.c --- linux-2.5.68-bk5/drivers/mtd/chips/sharp.c 2003-04-19 19:49:57.000000000 -0700 +++ linux-2.5.68-bk6/drivers/mtd/chips/sharp.c 2003-04-25 04:34:13.000000000 -0700 @@ -431,7 +431,7 @@ unsigned long adr) { int ret; - int timeo; + unsigned long timeo; int status; DECLARE_WAITQUEUE(wait, current); diff -urN linux-2.5.68-bk5/drivers/net/appletalk/ltpc.c linux-2.5.68-bk6/drivers/net/appletalk/ltpc.c --- linux-2.5.68-bk5/drivers/net/appletalk/ltpc.c 2003-04-19 19:48:57.000000000 -0700 +++ linux-2.5.68-bk6/drivers/net/appletalk/ltpc.c 2003-04-25 04:34:14.000000000 -0700 @@ -1295,7 +1295,7 @@ static void __exit ltpc_cleanup(void) { - long timeout; + unsigned long timeout; ltpc_timer.data = 0; /* signal the poll routine that we're done */ diff -urN linux-2.5.68-bk5/drivers/net/tokenring/ibmtr.c linux-2.5.68-bk6/drivers/net/tokenring/ibmtr.c --- linux-2.5.68-bk5/drivers/net/tokenring/ibmtr.c 2003-04-19 19:50:06.000000000 -0700 +++ linux-2.5.68-bk6/drivers/net/tokenring/ibmtr.c 2003-04-25 04:34:14.000000000 -0700 @@ -246,7 +246,8 @@ void *chanid; int found_turbo=0; unsigned char *tchanid, ctemp; - int i,j; + int i, j; + unsigned long jif; void *ram_mapped ; if (turbo_searched == 1) return; @@ -276,7 +277,7 @@ writeb(0x00, ram_mapped+0x1E01+i); } writeb(0x00, ram_mapped+0x1E01); - for(i=jiffies+TR_BUSY_INTERVAL; time_before_eq(jiffies,i);); + for(jif=jiffies+TR_BUSY_INTERVAL; time_before_eq(jiffies,jif);); intf_tbl=ntohs(readw(ram_mapped+ACA_OFFSET+ACA_RW+WRBR_EVEN)); if (intf_tbl) { #if IBMTR_DEBUG_MESSAGES @@ -291,7 +292,7 @@ turbo_io[index]=ntohs(readw(ram_mapped+intf_tbl+4)); turbo_irq[index]=readb(ram_mapped+intf_tbl+3); outb(0, turbo_io[index] + ADAPTRESET); - for(i=jiffies+TR_RST_TIME;time_before_eq(jiffies,i);); + for(jif=jiffies+TR_RST_TIME;time_before_eq(jiffies,jif);); outb(0, turbo_io[index] + ADAPTRESETREL); index++; continue; diff -urN linux-2.5.68-bk5/drivers/net/tokenring/tms380tr.c linux-2.5.68-bk6/drivers/net/tokenring/tms380tr.c --- linux-2.5.68-bk5/drivers/net/tokenring/tms380tr.c 2003-04-19 19:49:57.000000000 -0700 +++ linux-2.5.68-bk6/drivers/net/tokenring/tms380tr.c 2003-04-25 04:34:14.000000000 -0700 @@ -152,7 +152,6 @@ static void tms380tr_init_ipb(struct net_local *tp); static void tms380tr_init_net_local(struct net_device *dev); static void tms380tr_init_opb(struct net_device *dev); -void tms380tr_interrupt(int irq, void *dev_id, struct pt_regs *regs); /* "M" */ /* "O" */ int tms380tr_open(struct net_device *dev); @@ -780,15 +779,16 @@ /* * The typical workload of the driver: Handle the network interface interrupts. */ -void tms380tr_interrupt(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t tms380tr_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = dev_id; struct net_local *tp; unsigned short irq_type; + int handled = 0; if(dev == NULL) { printk(KERN_INFO "%s: irq %d for unknown device.\n", dev->name, irq); - return; + return IRQ_NONE; } tp = (struct net_local *)dev->priv; @@ -796,6 +796,7 @@ irq_type = SIFREADW(SIFSTS); while(irq_type & STS_SYSTEM_IRQ) { + handled = 1; irq_type &= STS_IRQ_MASK; if(!tms380tr_chk_ssb(tp, irq_type)) { @@ -870,7 +871,7 @@ irq_type = SIFREADW(SIFSTS); } - return; + return IRQ_RETVAL(handled); } /* diff -urN linux-2.5.68-bk5/drivers/net/tokenring/tms380tr.h linux-2.5.68-bk6/drivers/net/tokenring/tms380tr.h --- linux-2.5.68-bk5/drivers/net/tokenring/tms380tr.h 2003-04-19 19:50:42.000000000 -0700 +++ linux-2.5.68-bk6/drivers/net/tokenring/tms380tr.h 2003-04-25 04:34:14.000000000 -0700 @@ -11,10 +11,12 @@ #ifdef __KERNEL__ +#include + /* module prototypes */ int tms380tr_open(struct net_device *dev); int tms380tr_close(struct net_device *dev); -void tms380tr_interrupt(int irq, void *dev_id, struct pt_regs *regs); +irqreturn_t tms380tr_interrupt(int irq, void *dev_id, struct pt_regs *regs); int tmsdev_init(struct net_device *dev, unsigned long dmalimit, struct pci_dev *pdev); void tmsdev_term(struct net_device *dev); diff -urN linux-2.5.68-bk5/drivers/net/wan/c101.c linux-2.5.68-bk6/drivers/net/wan/c101.c --- linux-2.5.68-bk5/drivers/net/wan/c101.c 2003-04-19 19:50:34.000000000 -0700 +++ linux-2.5.68-bk6/drivers/net/wan/c101.c 2003-04-25 04:34:14.000000000 -0700 @@ -155,11 +155,12 @@ { hdlc_device *hdlc = dev_to_hdlc(dev); port_t *port = hdlc_to_port(hdlc); + int result; if (!try_module_get(THIS_MODULE)) return -EFAULT; /* rmmod in progress */ - int result = hdlc_open(hdlc); + result = hdlc_open(hdlc); if (result) { return result; module_put(THIS_MODULE); diff -urN linux-2.5.68-bk5/drivers/net/wan/cycx_x25.c linux-2.5.68-bk6/drivers/net/wan/cycx_x25.c --- linux-2.5.68-bk5/drivers/net/wan/cycx_x25.c 2003-04-19 19:48:53.000000000 -0700 +++ linux-2.5.68-bk6/drivers/net/wan/cycx_x25.c 2003-04-25 04:34:14.000000000 -0700 @@ -1347,7 +1347,7 @@ { x25_channel_t *chan = dev->priv; cycx_t *card = chan->card; - long flags; + unsigned long flags; char *string_state = NULL; spin_lock_irqsave(&card->lock, flags); diff -urN linux-2.5.68-bk5/drivers/net/wan/farsync.c linux-2.5.68-bk6/drivers/net/wan/farsync.c --- linux-2.5.68-bk5/drivers/net/wan/farsync.c 2003-04-19 19:50:29.000000000 -0700 +++ linux-2.5.68-bk6/drivers/net/wan/farsync.c 2003-04-25 04:34:14.000000000 -0700 @@ -772,7 +772,7 @@ * The interrupt service routine * Dev_id is our fst_card_info pointer */ -static void +static irqreturn_t fst_intr ( int irq, void *dev_id, struct pt_regs *regs ) { struct fst_card_info *card; @@ -785,7 +785,7 @@ if (( card = dev_id ) == NULL ) { dbg ( DBG_INTR,"intr: spurious %d\n", irq ); - return; + return IRQ_NONE; } dbg ( DBG_INTR,"intr: %d %p\n", irq, card ); @@ -882,6 +882,7 @@ } spin_unlock ( &card->card_lock ); + return IRQ_HANDLED; } diff -urN linux-2.5.68-bk5/drivers/net/wan/hd6457x.c linux-2.5.68-bk6/drivers/net/wan/hd6457x.c --- linux-2.5.68-bk5/drivers/net/wan/hd6457x.c 2003-04-19 19:48:54.000000000 -0700 +++ linux-2.5.68-bk6/drivers/net/wan/hd6457x.c 2003-04-25 04:34:14.000000000 -0700 @@ -408,17 +408,19 @@ -static void sca_intr(int irq, void* dev_id, struct pt_regs *regs) +static irqreturn_t sca_intr(int irq, void* dev_id, struct pt_regs *regs) { card_t *card = dev_id; int i; u8 stat; + int handled = 0; #ifndef ALL_PAGES_ALWAYS_MAPPED u8 page = sca_get_page(card); #endif while((stat = sca_intr_status(card)) != 0) { + handled = 1; for (i = 0; i < 2; i++) { port_t *port = get_port(card, i); if (port) { @@ -437,6 +439,7 @@ #ifndef ALL_PAGES_ALWAYS_MAPPED openwin(card, page); /* Restore original page */ #endif + return IRQ_RETVAL(handled); } diff -urN linux-2.5.68-bk5/drivers/net/wan/n2.c linux-2.5.68-bk6/drivers/net/wan/n2.c --- linux-2.5.68-bk5/drivers/net/wan/n2.c 2003-04-19 19:48:55.000000000 -0700 +++ linux-2.5.68-bk6/drivers/net/wan/n2.c 2003-04-25 04:34:14.000000000 -0700 @@ -216,12 +216,13 @@ port_t *port = hdlc_to_port(hdlc); int io = port->card->io; u8 mcr = inb(io + N2_MCR) | (port->phy_node ? TX422_PORT1:TX422_PORT0); + int result; if (!try_module_get(THIS_MODULE)) return -EFAULT; /* rmmod in progress */ - int result = hdlc_open(hdlc); + result = hdlc_open(hdlc); if (result) { return result; module_put(THIS_MODULE); diff -urN linux-2.5.68-bk5/drivers/net/wan/z85230.c linux-2.5.68-bk6/drivers/net/wan/z85230.c --- linux-2.5.68-bk5/drivers/net/wan/z85230.c 2003-04-19 19:48:49.000000000 -0700 +++ linux-2.5.68-bk6/drivers/net/wan/z85230.c 2003-04-25 04:34:14.000000000 -0700 @@ -718,7 +718,7 @@ * channel). c->lock for both channels points to dev->lock */ -void z8530_interrupt(int irq, void *dev_id, struct pt_regs *regs) +irqreturn_t z8530_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct z8530_dev *dev=dev_id; u8 intr; @@ -729,7 +729,7 @@ if(locker) { printk(KERN_ERR "IRQ re-enter\n"); - return; + return IRQ_NONE; } locker=1; @@ -775,6 +775,7 @@ printk(KERN_ERR "%s: interrupt jammed - abort(0x%X)!\n", dev->name, intr); /* Ok all done */ locker=0; + return IRQ_HANDLED; } EXPORT_SYMBOL(z8530_interrupt); diff -urN linux-2.5.68-bk5/drivers/net/wan/z85230.h linux-2.5.68-bk6/drivers/net/wan/z85230.h --- linux-2.5.68-bk5/drivers/net/wan/z85230.h 2003-04-19 19:50:30.000000000 -0700 +++ linux-2.5.68-bk6/drivers/net/wan/z85230.h 2003-04-25 04:34:14.000000000 -0700 @@ -9,6 +9,7 @@ #define _Z8530_H #include +#include /* Conversion routines to/from brg time constants from/to bits * per second. @@ -399,7 +400,7 @@ extern u8 z8530_dead_port[]; extern u8 z8530_hdlc_kilostream_85230[]; extern u8 z8530_hdlc_kilostream[]; -extern void z8530_interrupt(int, void *, struct pt_regs *); +extern irqreturn_t z8530_interrupt(int, void *, struct pt_regs *); extern void z8530_describe(struct z8530_dev *, char *mapping, unsigned long io); extern int z8530_init(struct z8530_dev *); extern int z8530_shutdown(struct z8530_dev *); diff -urN linux-2.5.68-bk5/drivers/net/wireless/strip.c linux-2.5.68-bk6/drivers/net/wireless/strip.c --- linux-2.5.68-bk5/drivers/net/wireless/strip.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/net/wireless/strip.c 2003-04-25 04:34:14.000000000 -0700 @@ -1048,8 +1048,10 @@ if (table->num_nodes) ptr += sprintf(ptr, "\n %s\n", title); for (i = 0; i < table->num_nodes; i++) { + MetricomNode node; + spin_lock_irqsave(&strip_lock, flags); - MetricomNode node = table->node[i]; + node = table->node[i]; spin_unlock_irqrestore(&strip_lock, flags); ptr += sprintf(ptr, " %s\n", node.c); } diff -urN linux-2.5.68-bk5/drivers/pci/Makefile linux-2.5.68-bk6/drivers/pci/Makefile --- linux-2.5.68-bk5/drivers/pci/Makefile 2003-04-19 19:50:49.000000000 -0700 +++ linux-2.5.68-bk6/drivers/pci/Makefile 2003-04-25 04:34:14.000000000 -0700 @@ -20,6 +20,7 @@ obj-$(CONFIG_PARISC) += setup-bus.o obj-$(CONFIG_SUPERH) += setup-bus.o setup-irq.o obj-$(CONFIG_PPC32) += setup-irq.o +obj-$(CONFIG_PPC64) += setup-bus.o obj-$(CONFIG_DDB5476) += setup-bus.o obj-$(CONFIG_SGI_IP27) += setup-irq.o obj-$(CONFIG_X86_VISWS) += setup-irq.o diff -urN linux-2.5.68-bk5/drivers/s390/char/con3215.c linux-2.5.68-bk6/drivers/s390/char/con3215.c --- linux-2.5.68-bk5/drivers/s390/char/con3215.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/s390/char/con3215.c 2003-04-25 04:34:14.000000000 -0700 @@ -840,10 +840,10 @@ } } -static kdev_t -con3215_device(struct console *c) +static struct tty_driver *con3215_device(struct console *c, int *index) { - return mk_kdev(TTY_MAJOR, c->index + 64 ); + *index = c->index; + return &tty3215_driver; } /* diff -urN linux-2.5.68-bk5/drivers/s390/char/tuball.c linux-2.5.68-bk6/drivers/s390/char/tuball.c --- linux-2.5.68-bk5/drivers/s390/char/tuball.c 2003-04-19 19:50:39.000000000 -0700 +++ linux-2.5.68-bk6/drivers/s390/char/tuball.c 2003-04-25 04:34:14.000000000 -0700 @@ -82,7 +82,7 @@ * Can't have this driver a module & support console at the same time */ #ifdef CONFIG_TN3270_CONSOLE -static kdev_t tub3270_con_device(struct console *); +static struct tty_driver *tub3270_con_device(struct console *, int *); static void tub3270_con_unblank(void); static void tub3270_con_write(struct console *, const char *, unsigned int); @@ -144,10 +144,11 @@ #endif -static kdev_t -tub3270_con_device(struct console *conp) +static struct tty_driver *tub3270_con_device(struct console *conp, int *index) { - return tub_mkdev(IBM_TTY3270_MAJOR, conp->index + 1); + *index = conp->index + 1; + extern struct tty_driver tty3270_driver; + return &tty3270_driver; } static void diff -urN linux-2.5.68-bk5/drivers/scsi/3w-xxxx.c linux-2.5.68-bk6/drivers/scsi/3w-xxxx.c --- linux-2.5.68-bk5/drivers/scsi/3w-xxxx.c 2003-04-19 19:51:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/3w-xxxx.c 2003-04-25 04:34:14.000000000 -0700 @@ -213,7 +213,6 @@ static int tw_chrdev_release(struct inode *inode, struct file *file); static int tw_copy_info(TW_Info *info, char *fmt, ...); static void tw_copy_mem_info(TW_Info *info, char *data, int len); -static void tw_interrupt(int irq, void *dev_instance, struct pt_regs *regs); static int tw_halt(struct notifier_block *nb, ulong event, void *buf); static int tw_map_scsi_sg_data(struct pci_dev *pdev, Scsi_Cmnd *cmd); static u32 tw_map_scsi_single_data(struct pci_dev *pdev, Scsi_Cmnd *cmd); @@ -1471,7 +1470,8 @@ } /* End tw_initialize_units() */ /* This function is the interrupt service routine */ -static void tw_interrupt(int irq, void *dev_instance, struct pt_regs *regs) +static irqreturn_t tw_interrupt(int irq, void *dev_instance, + struct pt_regs *regs) { int request_id; u32 status_reg_addr, status_reg_value; @@ -1481,12 +1481,13 @@ int error = 0, retval = 0; unsigned long flags = 0; TW_Command *command_packet; + int handled = 0; dprintk(KERN_WARNING "3w-xxxx: tw_interrupt()\n"); /* See if we are already running on another processor */ if (test_and_set_bit(TW_IN_INTR, &tw_dev->flags)) - return; + return IRQ_NONE; /* Get the host lock for io completions */ spin_lock_irqsave(tw_dev->host->host_lock, flags); @@ -1494,6 +1495,7 @@ /* See if the interrupt matches this instance */ if (tw_dev->tw_pci_dev->irq == irq) { + handled = 1; /* Make sure io isn't queueing */ spin_lock(&tw_dev->tw_lock); @@ -1683,6 +1685,7 @@ spin_unlock_irqrestore(tw_dev->host->host_lock, flags); clear_bit(TW_IN_INTR, &tw_dev->flags); + return IRQ_RETVAL(handled); } /* End tw_interrupt() */ /* This function handles ioctls from userspace to the driver */ diff -urN linux-2.5.68-bk5/drivers/scsi/53c700.c linux-2.5.68-bk6/drivers/scsi/53c700.c --- linux-2.5.68-bk5/drivers/scsi/53c700.c 2003-04-19 19:48:52.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/53c700.c 2003-04-25 04:34:14.000000000 -0700 @@ -1432,7 +1432,7 @@ return 1; } -void +irqreturn_t NCR_700_intr(int irq, void *dev_id, struct pt_regs *regs) { struct Scsi_Host *host = (struct Scsi_Host *)dev_id; @@ -1442,6 +1442,7 @@ __u32 resume_offset = 0; __u8 pun = 0xff, lun = 0xff; unsigned long flags; + int handled = 0; /* Use the host lock to serialise acess to the 53c700 * hardware. Note: In future, we may need to take the queue @@ -1457,6 +1458,7 @@ Scsi_Cmnd *SCp = hostdata->cmd; enum NCR_700_Host_State state; + handled = 1; state = hostdata->state; SCp = hostdata->cmd; @@ -1697,6 +1699,7 @@ } out_unlock: spin_unlock_irqrestore(host->host_lock, flags); + return IRQ_RETVAL(handled); } /* FIXME: Need to put some proc information in and plumb it diff -urN linux-2.5.68-bk5/drivers/scsi/53c700.h linux-2.5.68-bk6/drivers/scsi/53c700.h --- linux-2.5.68-bk5/drivers/scsi/53c700.h 2003-04-19 19:48:50.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/53c700.h 2003-04-25 04:34:14.000000000 -0700 @@ -8,6 +8,8 @@ #ifndef _53C700_H #define _53C700_H +#include + #include /* Turn on for general debugging---too verbose for normal use */ @@ -52,7 +54,7 @@ /* These are the externally used routines */ struct Scsi_Host *NCR_700_detect(Scsi_Host_Template *, struct NCR_700_Host_Parameters *); int NCR_700_release(struct Scsi_Host *host); -void NCR_700_intr(int, void *, struct pt_regs *); +irqreturn_t NCR_700_intr(int, void *, struct pt_regs *); enum NCR_700_Host_State { diff -urN linux-2.5.68-bk5/drivers/scsi/53c7xx.c linux-2.5.68-bk6/drivers/scsi/53c7xx.c --- linux-2.5.68-bk5/drivers/scsi/53c7xx.c 2003-04-19 19:51:23.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/53c7xx.c 2003-04-25 04:34:14.000000000 -0700 @@ -6056,7 +6056,7 @@ (struct NCR53c7x0_hostdata *) host->hostdata[0]; struct NCR53c7x0_cmd *cmd, *tmp; shutdown (host); - if (host->irq != IRQ_NONE) + if (host->irq != SCSI_IRQ_NONE) { int irq_count; struct Scsi_Host *tmp; diff -urN linux-2.5.68-bk5/drivers/scsi/53c7xx.h linux-2.5.68-bk6/drivers/scsi/53c7xx.h --- linux-2.5.68-bk5/drivers/scsi/53c7xx.h 2003-04-19 19:48:48.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/53c7xx.h 2003-04-25 04:34:14.000000000 -0700 @@ -1450,7 +1450,7 @@ }; -#define IRQ_NONE 255 +#define SCSI_IRQ_NONE 255 #define DMA_NONE 255 #define IRQ_AUTO 254 #define DMA_AUTO 254 diff -urN linux-2.5.68-bk5/drivers/scsi/BusLogic.c linux-2.5.68-bk6/drivers/scsi/BusLogic.c --- linux-2.5.68-bk5/drivers/scsi/BusLogic.c 2003-04-19 19:51:11.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/BusLogic.c 2003-04-25 04:34:14.000000000 -0700 @@ -3339,7 +3339,7 @@ Adapters. */ -static void BusLogic_InterruptHandler(int IRQ_Channel, +static irqreturn_t BusLogic_InterruptHandler(int IRQ_Channel, void *DeviceIdentifier, Registers_T *InterruptRegisters) { @@ -3420,6 +3420,7 @@ Release exclusive access to Host Adapter. */ BusLogic_ReleaseHostAdapterLockIH(HostAdapter, &ProcessorFlags); + return IRQ_HANDLED; } @@ -4261,7 +4262,7 @@ PartitionTable_T *FirstPartitionEntry = (PartitionTable_T *) buf; PartitionTable_T *PartitionEntry = FirstPartitionEntry; int SavedCylinders = DiskParameters->Cylinders, PartitionNumber; - unsigned char PartitionEntryEndHead, PartitionEntryEndSector; + unsigned char PartitionEntryEndHead=0, PartitionEntryEndSector=0; for (PartitionNumber = 0; PartitionNumber < 4; PartitionNumber++) { PartitionEntryEndHead = PartitionEntry->end_head; diff -urN linux-2.5.68-bk5/drivers/scsi/BusLogic.h linux-2.5.68-bk6/drivers/scsi/BusLogic.h --- linux-2.5.68-bk5/drivers/scsi/BusLogic.h 2003-04-19 19:49:25.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/BusLogic.h 2003-04-25 04:34:14.000000000 -0700 @@ -1763,7 +1763,7 @@ */ static void BusLogic_QueueCompletedCCB(BusLogic_CCB_T *); -static void BusLogic_InterruptHandler(int, void *, Registers_T *); +static irqreturn_t BusLogic_InterruptHandler(int, void *, Registers_T *); static int BusLogic_ResetHostAdapter(BusLogic_HostAdapter_T *, SCSI_Command_T *, unsigned int); static void BusLogic_Message(BusLogic_MessageLevel_T, char *, diff -urN linux-2.5.68-bk5/drivers/scsi/NCR5380.c linux-2.5.68-bk6/drivers/scsi/NCR5380.c --- linux-2.5.68-bk5/drivers/scsi/NCR5380.c 2003-04-19 19:48:56.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/NCR5380.c 2003-04-25 04:34:14.000000000 -0700 @@ -677,9 +677,11 @@ * used by the IRQ probe code. */ -static void __init probe_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t __init probe_intr(int irq, void *dev_id, + struct pt_regs *regs) { probe_irq = irq; + return IRQ_HANDLED; } /** @@ -706,7 +708,7 @@ trying_irqs |= mask; timeout = jiffies + (250 * HZ / 1000); - probe_irq = IRQ_NONE; + probe_irq = SCSI_IRQ_NONE; /* * A interrupt is triggered whenever BSY = false, SEL = true @@ -723,7 +725,7 @@ NCR5380_write(OUTPUT_DATA_REG, hostdata->id_mask); NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_DATA | ICR_ASSERT_SEL); - while (probe_irq == IRQ_NONE && time_before(jiffies, timeout)) + while (probe_irq == SCSI_IRQ_NONE && time_before(jiffies, timeout)) { set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout(1); @@ -892,7 +894,7 @@ SPRINTF("\nBase Addr: 0x%05lX ", (long) instance->base); SPRINTF("io_port: %04x ", (int) instance->io_port); - if (instance->irq == IRQ_NONE) + if (instance->irq == SCSI_IRQ_NONE) SPRINTF("IRQ: None.\n"); else SPRINTF("IRQ: %d.\n", instance->irq); @@ -1191,7 +1193,7 @@ Scsi_Cmnd *tmp, *prev; struct Scsi_Host *instance; int done; - unsigned long flags; + unsigned long flags = 0; /* * We run (with interrupts disabled) until we're sure that none of @@ -1207,7 +1209,7 @@ instance = hostdata->host; - if(instance->irq != IRQ_NONE) + if(instance->irq != SCSI_IRQ_NONE) spin_lock_irqsave(instance->host_lock, flags); do { @@ -1308,7 +1310,7 @@ break; } while (!done); - if(instance->irq != IRQ_NONE) + if(instance->irq != SCSI_IRQ_NONE) spin_unlock_irqrestore(instance->host_lock, flags); } @@ -1327,13 +1329,14 @@ * Locks: takes the needed instance locks */ -static void NCR5380_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t NCR5380_intr(int irq, void *dev_id, struct pt_regs *regs) { NCR5380_local_declare(); struct Scsi_Host *instance; int done; unsigned char basr; struct NCR5380_hostdata *hostdata; + int handled = 0; dprintk(NDEBUG_INTR, ("scsi : NCR5380 irq %d triggered\n", irq)); @@ -1345,6 +1348,7 @@ { instance = hostdata->host; if (instance->irq == irq) { + handled = 1; spin_lock_irq(instance->host_lock); /* Look for pending interrupts */ NCR5380_setup(instance); @@ -1402,6 +1406,7 @@ } /* if (instance->irq == irq) */ } } while (!done); + return IRQ_RETVAL(handled); } #endif @@ -1481,7 +1486,7 @@ NCR5380_setup(instance); if (hostdata->selecting) { - if(instance->irq != IRQ_NONE) + if(instance->irq != SCSI_IRQ_NONE) spin_unlock_irq(instance->host_lock); goto part2; /* RvC: sorry prof. Dijkstra, but it keeps the rest of the code nearly the same */ @@ -1506,14 +1511,14 @@ NCR5380_write(OUTPUT_DATA_REG, hostdata->id_mask); NCR5380_write(MODE_REG, MR_ARBITRATE); - if(instance->irq != IRQ_NONE) + if(instance->irq != SCSI_IRQ_NONE) spin_unlock_irq(instance->host_lock); /* We can be relaxed here, interrupts are on, we are in workqueue context, the birds are singing in the trees */ err = NCR5380_poll_politely(instance, INITIATOR_COMMAND_REG, ICR_ARBITRATION_PROGRESS, ICR_ARBITRATION_PROGRESS, 5*HZ); - if(instance->irq != IRQ_NONE) + if(instance->irq != SCSI_IRQ_NONE) spin_lock_irq(instance->host_lock); if (err < 0) { @@ -1649,7 +1654,7 @@ waiting period */ if ((NCR5380_read(STATUS_REG) & (SR_SEL | SR_IO)) == (SR_SEL | SR_IO)) { NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); - if(instance->irq != IRQ_NONE) + if(instance->irq != SCSI_IRQ_NONE) spin_lock_irq(instance->host_lock); NCR5380_reselect(instance); printk("scsi%d : reselection after won arbitration?\n", instance->host_no); @@ -1676,7 +1681,7 @@ NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask); return -1; } - if(instance->irq != IRQ_NONE) + if(instance->irq != SCSI_IRQ_NONE) spin_lock_irq(instance->host_lock); cmd->result = DID_BAD_TARGET << 16; collect_stats(hostdata, cmd); @@ -1714,9 +1719,9 @@ } dprintk(NDEBUG_SELECTION, ("scsi%d : target %d selected, going into MESSAGE OUT phase.\n", instance->host_no, cmd->device->id)); - tmp[0] = IDENTIFY(((instance->irq == IRQ_NONE) ? 0 : 1), cmd->device->lun); + tmp[0] = IDENTIFY(((instance->irq == SCSI_IRQ_NONE) ? 0 : 1), cmd->device->lun); - if(instance->irq != IRQ_NONE) + if(instance->irq != SCSI_IRQ_NONE) spin_lock_irq(instance->host_lock); len = 1; @@ -1738,7 +1743,7 @@ /* Selection failed */ failed: - if(instance->irq != IRQ_NONE) + if(instance->irq != SCSI_IRQ_NONE) spin_lock_irq(instance->host_lock); return -1; diff -urN linux-2.5.68-bk5/drivers/scsi/NCR5380.h linux-2.5.68-bk6/drivers/scsi/NCR5380.h --- linux-2.5.68-bk5/drivers/scsi/NCR5380.h 2003-04-19 19:49:52.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/NCR5380.h 2003-04-25 04:34:14.000000000 -0700 @@ -28,6 +28,8 @@ #ifndef NCR5380_H #define NCR5380_H +#include + #define NCR5380_PUBLIC_RELEASE 7 #define NCR53C400_PUBLIC_RELEASE 2 @@ -233,7 +235,7 @@ * Scsi_Host structure */ -#define IRQ_NONE 255 +#define SCSI_IRQ_NONE 255 #define DMA_NONE 255 #define IRQ_AUTO 254 #define DMA_AUTO 254 @@ -295,7 +297,7 @@ static int NCR5380_init(struct Scsi_Host *instance, int flags); static void NCR5380_information_transfer(struct Scsi_Host *instance); #ifndef DONT_USE_INTR -static void NCR5380_intr(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t NCR5380_intr(int irq, void *dev_id, struct pt_regs *regs); #endif static void NCR5380_main(void *ptr); static void NCR5380_print_options(struct Scsi_Host *instance); diff -urN linux-2.5.68-bk5/drivers/scsi/NCR53C9x.c linux-2.5.68-bk6/drivers/scsi/NCR53C9x.c --- linux-2.5.68-bk5/drivers/scsi/NCR53C9x.c 2003-04-19 19:48:55.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/NCR53C9x.c 2003-04-25 04:34:14.000000000 -0700 @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -96,7 +97,7 @@ struct NCR_ESP *espchain = 0; int nesps = 0, esps_in_use = 0, esps_running = 0; -void esp_intr(int irq, void *dev_id, struct pt_regs *pregs); +irqreturn_t esp_intr(int irq, void *dev_id, struct pt_regs *pregs); /* Debugging routines */ struct esp_cmdstrings { @@ -3559,7 +3560,7 @@ } #ifndef CONFIG_SMP -void esp_intr(int irq, void *dev_id, struct pt_regs *pregs) +irqreturn_t esp_intr(int irq, void *dev_id, struct pt_regs *pregs) { struct NCR_ESP *esp; unsigned long flags; @@ -3592,10 +3593,11 @@ if(again) goto repeat; spin_unlock_irqrestore(dev->host_lock, flags); + return IRQ_HANDLED; } #else /* For SMP we only service one ESP on the list list at our IRQ level! */ -void esp_intr(int irq, void *dev_id, struct pt_regs *pregs) +irqreturn_t esp_intr(int irq, void *dev_id, struct pt_regs *pregs) { struct NCR_ESP *esp; unsigned long flags; @@ -3620,6 +3622,7 @@ } out: spin_unlock_irqrestore(dev->host_lock, flags); + return IRQ_HANDLED; } #endif diff -urN linux-2.5.68-bk5/drivers/scsi/NCR53C9x.h linux-2.5.68-bk6/drivers/scsi/NCR53C9x.h --- linux-2.5.68-bk5/drivers/scsi/NCR53C9x.h 2003-04-19 19:48:57.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/NCR53C9x.h 2003-04-25 04:34:14.000000000 -0700 @@ -14,6 +14,7 @@ #define NCR53C9X_H #include +#include /* djweis for mac driver */ #if defined(CONFIG_MAC) @@ -657,7 +658,7 @@ extern void esp_deallocate(struct NCR_ESP *); extern void esp_release(void); extern void esp_initialize(struct NCR_ESP *); -extern void esp_intr(int, void *, struct pt_regs *); +extern irqreturn_t esp_intr(int, void *, struct pt_regs *); extern const char *esp_info(struct Scsi_Host *); extern int esp_queue(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *)); extern int esp_command(Scsi_Cmnd *); diff -urN linux-2.5.68-bk5/drivers/scsi/NCR53c406a.c linux-2.5.68-bk6/drivers/scsi/NCR53c406a.c --- linux-2.5.68-bk5/drivers/scsi/NCR53c406a.c 2003-04-19 19:49:28.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/NCR53c406a.c 2003-04-25 04:34:14.000000000 -0700 @@ -169,7 +169,7 @@ /* Static function prototypes */ static void NCR53c406a_intr(int, void *, struct pt_regs *); -static void do_NCR53c406a_intr(int, void *, struct pt_regs *); +static irqreturn_t do_NCR53c406a_intr(int, void *, struct pt_regs *); static void internal_done(Scsi_Cmnd *); static void wait_intr(void); static void chip_init(void); @@ -658,7 +658,7 @@ static void wait_intr(void) { - int i = jiffies + WATCHDOG; + unsigned long i = jiffies + WATCHDOG; while (time_after(i, jiffies) && !(inb(STAT_REG) & 0xe0)) { /* wait for a pseudo-interrupt */ cpu_relax(); @@ -773,7 +773,8 @@ return 0; } -static void do_NCR53c406a_intr(int unused, void *dev_id, struct pt_regs *regs) +static irqreturn_t do_NCR53c406a_intr(int unused, void *dev_id, + struct pt_regs *regs) { unsigned long flags; struct Scsi_Host *dev = dev_id; @@ -781,6 +782,7 @@ spin_lock_irqsave(dev->host_lock, flags); NCR53c406a_intr(0, dev_id, regs); spin_unlock_irqrestore(dev->host_lock, flags); + return IRQ_HANDLED; } static void NCR53c406a_intr(int unused, void *dev_id, struct pt_regs *regs) @@ -970,7 +972,7 @@ static int irq_probe(void) { int irqs, irq; - int i; + unsigned long i; inb(INT_REG); /* clear the interrupt register */ irqs = probe_irq_on(); diff -urN linux-2.5.68-bk5/drivers/scsi/aacraid/linit.c linux-2.5.68-bk6/drivers/scsi/aacraid/linit.c --- linux-2.5.68-bk5/drivers/scsi/aacraid/linit.c 2003-04-19 19:49:10.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/aacraid/linit.c 2003-04-25 04:34:14.000000000 -0700 @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include "scsi.h" diff -urN linux-2.5.68-bk5/drivers/scsi/aacraid/rx.c linux-2.5.68-bk6/drivers/scsi/aacraid/rx.c --- linux-2.5.68-bk5/drivers/scsi/aacraid/rx.c 2003-04-19 19:51:22.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/aacraid/rx.c 2003-04-25 04:34:14.000000000 -0700 @@ -39,13 +39,14 @@ #include #include #include +#include #include #include "scsi.h" #include "hosts.h" #include "aacraid.h" -static void aac_rx_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t aac_rx_intr(int irq, void *dev_id, struct pt_regs *regs) { struct aac_dev *dev = dev_id; unsigned long bellbits; @@ -81,7 +82,9 @@ rx_writel(dev, MUnit.ODR, DoorBellAdapterNormCmdNotFull); rx_writel(dev, MUnit.ODR, DoorBellAdapterNormRespNotFull); } + return IRQ_HANDLED; } + return IRQ_NONE; } /** diff -urN linux-2.5.68-bk5/drivers/scsi/aacraid/sa.c linux-2.5.68-bk6/drivers/scsi/aacraid/sa.c --- linux-2.5.68-bk5/drivers/scsi/aacraid/sa.c 2003-04-19 19:49:58.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/aacraid/sa.c 2003-04-25 04:34:14.000000000 -0700 @@ -39,13 +39,14 @@ #include #include #include +#include #include #include "scsi.h" #include "hosts.h" #include "aacraid.h" -static void aac_sa_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t aac_sa_intr(int irq, void *dev_id, struct pt_regs *regs) { struct aac_dev *dev = dev_id; unsigned short intstat, mask; @@ -75,7 +76,9 @@ } else if (intstat & DOORBELL_4) { // dev -> Host Normal Response Not Full sa_writew(dev, DoorbellClrReg_p, DOORBELL_4); } + return IRQ_HANDLED; } + return IRQ_NONE; } /** diff -urN linux-2.5.68-bk5/drivers/scsi/advansys.c linux-2.5.68-bk6/drivers/scsi/advansys.c --- linux-2.5.68-bk5/drivers/scsi/advansys.c 2003-04-19 19:48:57.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/advansys.c 2003-04-25 04:34:14.000000000 -0700 @@ -4208,7 +4208,7 @@ * advansys.h contains function prototypes for functions global to Linux. */ -STATIC void advansys_interrupt(int, void *, struct pt_regs *); +STATIC irqreturn_t advansys_interrupt(int, void *, struct pt_regs *); STATIC int advansys_slave_configure(Scsi_Device *); STATIC void asc_scsi_done_list(Scsi_Cmnd *, int from_isr); STATIC int asc_execute_scsi_cmnd(Scsi_Cmnd *); @@ -6246,7 +6246,7 @@ * to the AdvanSys driver which is for a device sharing an interrupt with * an AdvanSys adapter. */ -STATIC void +STATIC irqreturn_t advansys_interrupt(int irq, void *dev_id, struct pt_regs *regs) { ulong flags; @@ -6336,7 +6336,7 @@ asc_scsi_done_list(done_scp, 1); ASC_DBG(1, "advansys_interrupt: end\n"); - return; + return IRQ_HANDLED; } /* @@ -8370,7 +8370,6 @@ int totlen; int len; int chip_scsi_id; - int i; boardp = ASC_BOARDP(shp); diff -urN linux-2.5.68-bk5/drivers/scsi/aha152x.c linux-2.5.68-bk6/drivers/scsi/aha152x.c --- linux-2.5.68-bk5/drivers/scsi/aha152x.c 2003-04-19 19:48:49.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/aha152x.c 2003-04-25 04:34:14.000000000 -0700 @@ -646,7 +646,7 @@ }; /* setup & interrupt */ -static void intr(int irq, void *dev_id, struct pt_regs *); +static irqreturn_t intr(int irq, void *dev_id, struct pt_regs *); static void reset_ports(struct Scsi_Host *shpnt); static void aha152x_error(struct Scsi_Host *shpnt, char *msg); static void done(struct Scsi_Host *shpnt, int error); @@ -936,18 +936,19 @@ return 0; } -static void swintr(int irqno, void *dev_id, struct pt_regs *regs) +static irqreturn_t swintr(int irqno, void *dev_id, struct pt_regs *regs) { struct Scsi_Host *shpnt = lookup_irq(irqno); if (!shpnt) { printk(KERN_ERR "aha152x%d: catched software interrupt %d for unknown controller.\n", HOSTNO, irqno); - return; + return IRQ_NONE; } HOSTDATA(shpnt)->swint++; SETPORT(DMACNTRL0, INTEN); + return IRQ_HANDLED; } #ifdef __ISAPNP__ @@ -1873,13 +1874,13 @@ * */ -static void intr(int irqno, void *dev_id, struct pt_regs *regs) +static irqreturn_t intr(int irqno, void *dev_id, struct pt_regs *regs) { struct Scsi_Host *shpnt = lookup_irq(irqno); if (!shpnt) { printk(KERN_ERR "aha152x: catched interrupt %d for unknown controller.\n", irqno); - return; + return IRQ_NONE; } /* no more interrupts from the controller, while we're busy. @@ -1899,6 +1900,7 @@ HOSTDATA(shpnt)->service++; INIT_WORK(&aha152x_tq, (void *) run, NULL); schedule_work(&aha152x_tq); + return IRQ_HANDLED; } /* diff -urN linux-2.5.68-bk5/drivers/scsi/aha1542.c linux-2.5.68-bk6/drivers/scsi/aha1542.c --- linux-2.5.68-bk5/drivers/scsi/aha1542.c 2003-04-19 19:49:51.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/aha1542.c 2003-04-25 04:34:14.000000000 -0700 @@ -176,7 +176,8 @@ static void setup_mailboxes(int base_io, struct Scsi_Host *shpnt); static int aha1542_restart(struct Scsi_Host *shost); static void aha1542_intr_handle(struct Scsi_Host *shost, void *dev_id, struct pt_regs *regs); -static void do_aha1542_intr_handle(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t do_aha1542_intr_handle(int irq, void *dev_id, + struct pt_regs *regs); #define aha1542_intr_reset(base) outb(IRST, CONTROL(base)) @@ -416,7 +417,8 @@ } /* A quick wrapper for do_aha1542_intr_handle to grab the spin lock */ -static void do_aha1542_intr_handle(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t do_aha1542_intr_handle(int irq, void *dev_id, + struct pt_regs *regs) { unsigned long flags; struct Scsi_Host *shost; @@ -428,6 +430,7 @@ spin_lock_irqsave(shost->host_lock, flags); aha1542_intr_handle(shost, dev_id, regs); spin_unlock_irqrestore(shost->host_lock, flags); + return IRQ_HANDLED; } /* A "high" level interrupt handler */ diff -urN linux-2.5.68-bk5/drivers/scsi/aha1740.c linux-2.5.68-bk6/drivers/scsi/aha1740.c --- linux-2.5.68-bk5/drivers/scsi/aha1740.c 2003-04-19 19:48:56.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/aha1740.c 2003-04-25 04:34:14.000000000 -0700 @@ -220,7 +220,8 @@ } /* A "high" level interrupt handler */ -static void aha1740_intr_handle(int irq, void *dev_id, struct pt_regs * regs) +static irqreturn_t aha1740_intr_handle(int irq, void *dev_id, + struct pt_regs *regs) { struct Scsi_Host *host = aha_host[irq - 9]; void (*my_done)(Scsi_Cmnd *); @@ -230,6 +231,7 @@ Scsi_Cmnd *SCtmp; unsigned int base; unsigned long flags; + int handled = 0; if (!host) panic("aha1740.c: Irq from unknown host!\n"); @@ -239,6 +241,7 @@ while(inb(G2STAT(base)) & G2STAT_INTPEND) { + handled = 1; DEB(printk("aha1740_intr top of loop.\n")); adapstat = inb(G2INTST(base)); ecbptr = (struct ecb *) isa_bus_to_virt(inl(MBOXIN0(base))); @@ -309,6 +312,7 @@ } spin_unlock_irqrestore(host->host_lock, flags); + return IRQ_RETVAL(handled); } static int aha1740_queuecommand(Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *)) diff -urN linux-2.5.68-bk5/drivers/scsi/atp870u.c linux-2.5.68-bk6/drivers/scsi/atp870u.c --- linux-2.5.68-bk5/drivers/scsi/atp870u.c 2003-04-19 19:49:11.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/atp870u.c 2003-04-25 04:34:14.000000000 -0700 @@ -86,7 +86,8 @@ static void send_s870(struct Scsi_Host *); -static void atp870u_intr_handle(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t atp870u_intr_handle(int irq, void *dev_id, + struct pt_regs *regs) { unsigned long flags; unsigned short int tmpcip, id; @@ -108,7 +109,7 @@ j = inb(tmport); if ((j & 0x80) == 0) { dev->in_int = 0; - return; + return IRQ_NONE; } tmpcip = dev->pciport; @@ -175,13 +176,13 @@ * Done */ dev->in_int = 0; - return; + goto out; } if (i == 0x40) { dev->last_cmd |= 0x40; dev->in_int = 0; - return; + goto out; } if (i == 0x21) { @@ -202,7 +203,7 @@ tmport += 0x08; outb(0x08, tmport); dev->in_int = 0; - return; + goto out; } if ((i == 0x80) || (i == 0x8f)) { lun = 0; @@ -228,7 +229,7 @@ tmport += 0x04; outb(0x08, tmport); dev->in_int = 0; - return; + goto out; } else { outb(0x46, tmport); dev->id[target_id].dirctu = 0x00; @@ -239,7 +240,7 @@ tmport += 0x03; outb(0x08, tmport); dev->in_int = 0; - return; + goto out; } } if (dev->last_cmd != 0xff) { @@ -313,7 +314,7 @@ tmport = workportu + 0x18; outb(0x08, tmport); dev->in_int = 0; - return; + goto out; } prd = dev->id[target_id].prd_posu; while (adrcntu != 0) { @@ -352,12 +353,12 @@ outb(0x08, tmport); outb(0x01, tmpcip); dev->in_int = 0; - return; + goto out; } outb(0x08, tmport); outb(0x09, tmpcip); dev->in_int = 0; - return; + goto out; } /* @@ -417,7 +418,7 @@ send_s870(host); } dev->in_int = 0; - return; + goto out; } if ((dev->last_cmd & 0xf0) != 0x40) { dev->last_cmd = 0xff; @@ -440,7 +441,7 @@ outb(0x08, tmport); outb(0x09, tmpcip); dev->in_int = 0; - return; + goto out; } if (i == 0x08) { tmpcip = tmpcip + 4; @@ -458,7 +459,7 @@ outb(0x08, tmport); outb(0x01, tmpcip); dev->in_int = 0; - return; + goto out; } tmport -= 0x07; if (i == 0x0a) { @@ -474,14 +475,15 @@ tmport += 0x03; outb(0x08, tmport); dev->in_int = 0; - return; + goto out; } else { // tmport = workportu + 0x17; // inb(tmport); // dev->working = 0; dev->in_int = 0; - return; } +out: + return IRQ_HANDLED; } static int atp870u_queuecommand(Scsi_Cmnd * req_p, void (*done) (Scsi_Cmnd *)) diff -urN linux-2.5.68-bk5/drivers/scsi/cpqfcTSinit.c linux-2.5.68-bk6/drivers/scsi/cpqfcTSinit.c --- linux-2.5.68-bk5/drivers/scsi/cpqfcTSinit.c 2003-04-19 19:48:50.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/cpqfcTSinit.c 2003-04-25 04:34:14.000000000 -0700 @@ -1716,7 +1716,7 @@ -void cpqfcTS_intr_handler( int irq, +irqreturn_t cpqfcTS_intr_handler( int irq, void *dev_id, struct pt_regs *regs) { @@ -1726,7 +1726,8 @@ CPQFCHBA *cpqfcHBA = (CPQFCHBA *)HostAdapter->hostdata; int MoreMessages = 1; // assume we have something to do UCHAR IntPending; - + int handled = 0; + ENTER("intr_handler"); spin_lock_irqsave( HostAdapter->host_lock, flags); // is this our INT? @@ -1737,7 +1738,7 @@ #define INFINITE_IMQ_BREAK 10000 if( IntPending ) { - + handled = 1; // mask our HBA interrupts until we handle it... writeb( 0, cpqfcHBA->fcChip.Registers.INTEN.address); @@ -1791,6 +1792,7 @@ } spin_unlock_irqrestore( HostAdapter->host_lock, flags); LEAVE("intr_handler"); + return IRQ_RETVAL(handled); } diff -urN linux-2.5.68-bk5/drivers/scsi/cpqfcTSstructs.h linux-2.5.68-bk6/drivers/scsi/cpqfcTSstructs.h --- linux-2.5.68-bk5/drivers/scsi/cpqfcTSstructs.h 2003-04-19 19:49:20.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/cpqfcTSstructs.h 2003-04-25 04:34:14.000000000 -0700 @@ -21,6 +21,7 @@ #define CPQFCTSSTRUCTS_H #include // timer declaration in our host data +#include #include #include "cpqfcTSioctl.h" @@ -861,7 +862,7 @@ // Linux interrupt handler -void cpqfcTS_intr_handler( int irq,void *dev_id,struct pt_regs *regs); +irqreturn_t cpqfcTS_intr_handler( int irq,void *dev_id,struct pt_regs *regs); void cpqfcTSheartbeat( unsigned long ptr ); diff -urN linux-2.5.68-bk5/drivers/scsi/dmx3191d.c linux-2.5.68-bk6/drivers/scsi/dmx3191d.c --- linux-2.5.68-bk5/drivers/scsi/dmx3191d.c 2003-04-19 19:49:57.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/dmx3191d.c 2003-04-25 04:34:14.000000000 -0700 @@ -96,7 +96,7 @@ printk(KERN_WARNING "dmx3191: IRQ %d not available - switching to polled mode.\n", pdev->irq); /* Steam powered scsi controllers run without an IRQ anyway */ - instance->irq = IRQ_NONE; + instance->irq = SCSI_IRQ_NONE; } boards++; @@ -113,7 +113,7 @@ static int dmx3191d_release_resources(struct Scsi_Host *instance) { release_region(instance->io_port, DMX3191D_REGION); - if(instance->irq!=IRQ_NONE) + if(instance->irq!=SCSI_IRQ_NONE) free_irq(instance->irq, instance); return 0; diff -urN linux-2.5.68-bk5/drivers/scsi/dtc.c linux-2.5.68-bk6/drivers/scsi/dtc.c --- linux-2.5.68-bk5/drivers/scsi/dtc.c 2003-04-19 19:50:30.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/dtc.c 2003-04-25 04:34:14.000000000 -0700 @@ -269,27 +269,27 @@ #ifndef DONT_USE_INTR /* With interrupts enabled, it will sometimes hang when doing heavy * reads. So better not enable them until I finger it out. */ - if (instance->irq != IRQ_NONE) + if (instance->irq != SCSI_IRQ_NONE) if (request_irq(instance->irq, dtc_intr, SA_INTERRUPT, "dtc", instance)) { printk(KERN_ERR "scsi%d : IRQ%d not free, interrupts disabled\n", instance->host_no, instance->irq); - instance->irq = IRQ_NONE; + instance->irq = SCSI_IRQ_NONE; } - if (instance->irq == IRQ_NONE) { + if (instance->irq == SCSI_IRQ_NONE) { printk(KERN_WARNING "scsi%d : interrupts not enabled. for better interactive performance,\n", instance->host_no); printk(KERN_WARNING "scsi%d : please jumper the board for a free IRQ.\n", instance->host_no); } #else - if (instance->irq != IRQ_NONE) + if (instance->irq != SCSI_IRQ_NONE) printk(KERN_WARNING "scsi%d : interrupts not used. Might as well not jumper it.\n", instance->host_no); - instance->irq = IRQ_NONE; + instance->irq = SCSI_IRQ_NONE; #endif #if defined(DTCDEBUG) && (DTCDEBUG & DTCDEBUG_INIT) printk("scsi%d : irq = %d\n", instance->host_no, instance->irq); #endif printk(KERN_INFO "scsi%d : at 0x%05X", instance->host_no, (int) instance->base); - if (instance->irq == IRQ_NONE) + if (instance->irq == SCSI_IRQ_NONE) printk(" interrupts disabled"); else printk(" irq %d", instance->irq); @@ -361,7 +361,7 @@ i = 0; NCR5380_read(RESET_PARITY_INTERRUPT_REG); NCR5380_write(MODE_REG, MR_ENABLE_EOP_INTR | MR_DMA_MODE); - if (instance->irq == IRQ_NONE) + if (instance->irq == SCSI_IRQ_NONE) NCR5380_write(DTC_CONTROL_REG, CSR_DIR_READ); else NCR5380_write(DTC_CONTROL_REG, CSR_DIR_READ | CSR_INT_BASE); @@ -412,7 +412,7 @@ NCR5380_read(RESET_PARITY_INTERRUPT_REG); NCR5380_write(MODE_REG, MR_ENABLE_EOP_INTR | MR_DMA_MODE); /* set direction (write) */ - if (instance->irq == IRQ_NONE) + if (instance->irq == SCSI_IRQ_NONE) NCR5380_write(DTC_CONTROL_REG, 0); else NCR5380_write(DTC_CONTROL_REG, CSR_5380_INTR); diff -urN linux-2.5.68-bk5/drivers/scsi/eata.c linux-2.5.68-bk6/drivers/scsi/eata.c --- linux-2.5.68-bk5/drivers/scsi/eata.c 2003-04-19 19:50:44.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/eata.c 2003-04-25 04:34:14.000000000 -0700 @@ -815,7 +815,7 @@ /* But transfer orientation from the 16 bit data register is Little Endian */ #define REG2H(x) le16_to_cpu(x) -static void do_interrupt_handler(int, void *, struct pt_regs *); +static irqreturn_t do_interrupt_handler(int, void *, struct pt_regs *); static void flush_dev(Scsi_Device *, unsigned long, unsigned int, unsigned int); static int do_trace = FALSE; static int setup_done = FALSE; @@ -2332,16 +2332,19 @@ return; } -static void do_interrupt_handler(int irq, void *shap, struct pt_regs *regs) { +static irqreturn_t do_interrupt_handler(int irq, void *shap, + struct pt_regs *regs) { unsigned int j; unsigned long spin_flags; /* Check if the interrupt must be processed by this handler */ - if ((j = (unsigned int)((char *)shap - sha)) >= num_boards) return; + if ((j = (unsigned int)((char *)shap - sha)) >= num_boards) + return IRQ_NONE; spin_lock_irqsave(sh[j]->host_lock, spin_flags); ihdlr(irq, j); spin_unlock_irqrestore(sh[j]->host_lock, spin_flags); + return IRQ_HANDLED; } static int eata2x_release(struct Scsi_Host *shpnt) { diff -urN linux-2.5.68-bk5/drivers/scsi/eata_pio.c linux-2.5.68-bk6/drivers/scsi/eata_pio.c --- linux-2.5.68-bk5/drivers/scsi/eata_pio.c 2003-04-19 19:50:06.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/eata_pio.c 2003-04-25 04:34:14.000000000 -0700 @@ -213,7 +213,8 @@ static void eata_pio_int_handler(int irq, void *dev_id, struct pt_regs *regs); -static void do_eata_pio_int_handler(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t do_eata_pio_int_handler(int irq, void *dev_id, + struct pt_regs *regs) { unsigned long flags; struct Scsi_Host *dev = dev_id; @@ -221,6 +222,7 @@ spin_lock_irqsave(dev->host_lock, flags); eata_pio_int_handler(irq, dev_id, regs); spin_unlock_irqrestore(dev->host_lock, flags); + return IRQ_HANDLED; } static void eata_pio_int_handler(int irq, void *dev_id, struct pt_regs *regs) diff -urN linux-2.5.68-bk5/drivers/scsi/fd_mcs.c linux-2.5.68-bk6/drivers/scsi/fd_mcs.c --- linux-2.5.68-bk5/drivers/scsi/fd_mcs.c 2003-04-19 19:49:10.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/fd_mcs.c 2003-04-25 04:34:14.000000000 -0700 @@ -283,7 +283,7 @@ #define FD_BRDS sizeof(fd_mcs_adapters)/sizeof(struct fd_mcs_adapters_struct) -static void fd_mcs_intr(int irq, void *dev_id, struct pt_regs *regs); +static irqreturn_t fd_mcs_intr(int irq, void *dev_id, struct pt_regs *regs); static unsigned long addresses[] = { 0xc8000, 0xca000, 0xce000, 0xde000 }; static unsigned short ports[] = { 0x140, 0x150, 0x160, 0x170 }; @@ -679,7 +679,7 @@ } /* only my_done needs to be protected */ -static void fd_mcs_intr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t fd_mcs_intr(int irq, void *dev_id, struct pt_regs *regs) { unsigned long flags; int status; @@ -699,7 +699,7 @@ /* return if some other device on this IRQ caused the interrupt */ if (!shpnt) { - return; + return IRQ_NONE; } INTR_Processed++; @@ -711,7 +711,7 @@ #if DEBUG_ABORT printk("Interrupt after abort, ignoring\n"); #endif - /* return; */ + /* return IRQ_HANDLED; */ } #if DEBUG_RACE ++in_interrupt_flag; @@ -726,7 +726,7 @@ spin_lock_irqsave(shpnt->host_lock, flags); my_done(shpnt, DID_BUS_BUSY << 16); spin_unlock_irqrestore(shpnt->host_lock, flags); - return; + return IRQ_HANDLED; } current_SC->SCp.phase = in_selection; @@ -752,7 +752,7 @@ spin_lock_irqsave(shpnt->host_lock, flags); my_done(shpnt, DID_NO_CONNECT << 16); spin_unlock_irqrestore(shpnt->host_lock, flags); - return; + return IRQ_HANDLED; } else { #if EVERY_ACCESS printk(" AltSel "); @@ -767,7 +767,7 @@ #if DEBUG_RACE in_interrupt_flag = 0; #endif - return; + return IRQ_HANDLED; } /* current_SC->SCp.phase == in_other: this is the body of the routine */ @@ -1117,7 +1117,7 @@ #if DEBUG_RACE in_interrupt_flag = 0; #endif - return; + return IRQ_HANDLED; } static int fd_mcs_release(struct Scsi_Host *shpnt) diff -urN linux-2.5.68-bk5/drivers/scsi/fdomain.c linux-2.5.68-bk6/drivers/scsi/fdomain.c --- linux-2.5.68-bk5/drivers/scsi/fdomain.c 2003-04-19 19:50:29.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/fdomain.c 2003-04-25 04:34:14.000000000 -0700 @@ -418,7 +418,7 @@ static int FIFO_Size = 0x2000; /* 8k FIFO for pre-tmc18c30 chips */ -static void do_fdomain_16x0_intr( int irq, void *dev_id, +static irqreturn_t do_fdomain_16x0_intr( int irq, void *dev_id, struct pt_regs * regs ); int fdomain_16x0_bus_reset(Scsi_Cmnd *SCpnt); @@ -1201,7 +1201,8 @@ #endif } -static void do_fdomain_16x0_intr( int irq, void *dev_id, struct pt_regs * regs ) +static irqreturn_t do_fdomain_16x0_intr(int irq, void *dev_id, + struct pt_regs * regs ) { unsigned long flags; int status; @@ -1216,7 +1217,7 @@ /* Check for other IRQ sources */ if((inb(TMC_Status_port)&0x01)==0) - return; + return IRQ_NONE; /* It is our IRQ */ outb( 0x00, Interrupt_Cntl_port ); @@ -1227,7 +1228,7 @@ printk( "Spurious interrupt, in_command = %d, current_SC = %x\n", in_command, current_SC ); #endif - return; + return IRQ_NONE; } /* Abort calls my_done, so we do nothing here. */ @@ -1236,7 +1237,7 @@ printk( "scsi: Interrupt after abort, ignoring\n" ); #endif /* - return; */ + return IRQ_HANDLED; */ } #if DEBUG_RACE @@ -1252,7 +1253,7 @@ spin_lock_irqsave(current_SC->device->host->host_lock, flags); my_done( DID_BUS_BUSY << 16 ); spin_unlock_irqrestore(current_SC->device->host->host_lock, flags); - return; + return IRQ_HANDLED; } current_SC->SCp.phase = in_selection; @@ -1266,7 +1267,7 @@ #if DEBUG_RACE in_interrupt_flag = 0; #endif - return; + return IRQ_HANDLED; } else if (current_SC->SCp.phase & in_selection) { status = inb( SCSI_Status_port ); if (!(status & 0x01)) { @@ -1278,7 +1279,7 @@ spin_lock_irqsave(current_SC->device->host->host_lock, flags); my_done( DID_NO_CONNECT << 16 ); spin_unlock_irqrestore(current_SC->device->host->host_lock, flags); - return; + return IRQ_HANDLED; } else { #if EVERY_ACCESS printk( " AltSel " ); @@ -1293,7 +1294,7 @@ #if DEBUG_RACE in_interrupt_flag = 0; #endif - return; + return IRQ_HANDLED; } /* current_SC->SCp.phase == in_other: this is the body of the routine */ @@ -1492,7 +1493,7 @@ #if DEBUG_RACE in_interrupt_flag = 0; #endif - return; + return IRQ_HANDLED; } static int fdomain_16x0_queue( Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *)) diff -urN linux-2.5.68-bk5/drivers/scsi/g_NCR5380.c linux-2.5.68-bk6/drivers/scsi/g_NCR5380.c --- linux-2.5.68-bk5/drivers/scsi/g_NCR5380.c 2003-04-19 19:48:53.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/g_NCR5380.c 2003-04-25 04:34:14.000000000 -0700 @@ -115,6 +115,7 @@ #include #include #include +#include #define NCR_NOT_SET 0 static int ncr_irq = NCR_NOT_SET; @@ -336,7 +337,7 @@ if (pnp_irq_valid(dev, 0)) overrides[count].irq = pnp_irq(dev, 0); else - overrides[count].irq = IRQ_NONE; + overrides[count].irq = SCSI_IRQ_NONE; if (pnp_dma_valid(dev, 0)) overrides[count].dma = pnp_dma(dev, 0); else @@ -433,19 +434,19 @@ else instance->irq = NCR5380_probe_irq(instance, 0xffff); - if (instance->irq != IRQ_NONE) + if (instance->irq != SCSI_IRQ_NONE) if (request_irq(instance->irq, generic_NCR5380_intr, SA_INTERRUPT, "NCR5380", NULL)) { printk(KERN_WARNING "scsi%d : IRQ%d not free, interrupts disabled\n", instance->host_no, instance->irq); - instance->irq = IRQ_NONE; + instance->irq = SCSI_IRQ_NONE; } - if (instance->irq == IRQ_NONE) { + if (instance->irq == SCSI_IRQ_NONE) { printk(KERN_INFO "scsi%d : interrupts not enabled. for better interactive performance,\n", instance->host_no); printk(KERN_INFO "scsi%d : please jumper the board for a free IRQ.\n", instance->host_no); } printk(KERN_INFO "scsi%d : at " STRVAL(NCR5380_map_name) " 0x%x", instance->host_no, (unsigned int) instance->NCR5380_instance_name); - if (instance->irq == IRQ_NONE) + if (instance->irq == SCSI_IRQ_NONE) printk(" interrupts disabled"); else printk(" irq %d", instance->irq); @@ -492,7 +493,7 @@ release_mem_region(instance->NCR5380_instance_name, NCR5380_region_size); #endif - if (instance->irq != IRQ_NONE) + if (instance->irq != SCSI_IRQ_NONE) free_irq(instance->irq, NULL); return 0; @@ -804,7 +805,7 @@ PRINTP("NO NCR53C400 driver extensions\n"); #endif PRINTP("Using %s mapping at %s 0x%lx, " ANDP STRVAL(NCR5380_map_config) ANDP STRVAL(NCR5380_map_name) ANDP scsi_ptr->NCR5380_instance_name); - if (scsi_ptr->irq == IRQ_NONE) + if (scsi_ptr->irq == SCSI_IRQ_NONE) PRINTP("no interrupt\n"); else PRINTP("on interrupt %d\n" ANDP scsi_ptr->irq); diff -urN linux-2.5.68-bk5/drivers/scsi/gdth.c linux-2.5.68-bk6/drivers/scsi/gdth.c --- linux-2.5.68-bk5/drivers/scsi/gdth.c 2003-04-19 19:50:03.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/gdth.c 2003-04-25 04:34:14.000000000 -0700 @@ -372,11 +372,7 @@ static void gdth_delay(int milliseconds); static void gdth_eval_mapping(ulong32 size, int *cyls, int *heads, int *secs); -#if LINUX_VERSION_CODE >= 0x010346 -static void gdth_interrupt(int irq,void *dev_id,struct pt_regs *regs); -#else -static void gdth_interrupt(int irq,struct pt_regs *regs); -#endif +static irqreturn_t gdth_interrupt(int irq, void *dev_id, struct pt_regs *regs); static int gdth_sync_event(int hanum,int service,unchar index,Scsi_Cmnd *scp); static int gdth_async_event(int hanum); static void gdth_log_event(gdth_evt_data *dvr, char *buffer); @@ -1925,11 +1921,7 @@ gdth_from_wait = TRUE; do { -#if LINUX_VERSION_CODE >= 0x010346 gdth_interrupt((int)ha->irq,ha,NULL); -#else - gdth_interrupt((int)ha->irq,NULL); -#endif if (wait_hanum==hanum && wait_index==index) { answer_found = TRUE; break; @@ -3362,11 +3354,7 @@ /* SCSI interface functions */ -#if LINUX_VERSION_CODE >= 0x010346 -static void gdth_interrupt(int irq,void *dev_id,struct pt_regs *regs) -#else -static void gdth_interrupt(int irq,struct pt_regs *regs) -#endif +static irqreturn_t gdth_interrupt(int irq,void *dev_id,struct pt_regs *regs) { register gdth_ha_str *ha; gdt6m_dpram_str *dp6m_ptr; @@ -3383,7 +3371,7 @@ /* if polling and not from gdth_wait() -> return */ if (gdth_polling) { if (!gdth_from_wait) { - return; + return IRQ_HANDLED; } } @@ -3396,7 +3384,7 @@ /* spurious interrupt */ if (!gdth_polling) GDTH_UNLOCK_HA((gdth_ha_str *)dev_id,flags); - return; + return IRQ_HANDLED; } #ifdef GDTH_STATISTICS @@ -3492,7 +3480,7 @@ TRACE2(("gdth_interrupt() unknown controller type\n")); if (!gdth_polling) GDTH_UNLOCK_HA((gdth_ha_str *)dev_id,flags); - return; + return IRQ_HANDLED; } TRACE(("gdth_interrupt() index %d stat %d info %d\n", @@ -3509,7 +3497,7 @@ if (!gdth_polling) GDTH_UNLOCK_HA((gdth_ha_str *)dev_id,flags); gdth_next(hanum); - return; + return IRQ_HANDLED; } if (IStatus == SPEZINDEX) { @@ -3519,7 +3507,7 @@ gdth_store_event(ha, ES_DRIVER, 4, &ha->dvr); if (!gdth_polling) GDTH_UNLOCK_HA((gdth_ha_str *)dev_id,flags); - return; + return IRQ_HANDLED; } scp = ha->cmd_tab[IStatus-2].cmnd; Service = ha->cmd_tab[IStatus-2].service; @@ -3532,13 +3520,13 @@ gdth_store_event(ha, ES_DRIVER, 1, &ha->dvr); if (!gdth_polling) GDTH_UNLOCK_HA((gdth_ha_str *)dev_id,flags); - return; + return IRQ_HANDLED; } if (scp == INTERNAL_CMND) { TRACE(("gdth_interrupt() answer to internal command\n")); if (!gdth_polling) GDTH_UNLOCK_HA((gdth_ha_str *)dev_id,flags); - return; + return IRQ_HANDLED; } TRACE(("gdth_interrupt() sync. status\n")); @@ -3563,6 +3551,7 @@ #endif } gdth_next(hanum); + return IRQ_HANDLED; } static int gdth_sync_event(int hanum,int service,unchar index,Scsi_Cmnd *scp) diff -urN linux-2.5.68-bk5/drivers/scsi/ibmmca.c linux-2.5.68-bk6/drivers/scsi/ibmmca.c --- linux-2.5.68-bk5/drivers/scsi/ibmmca.c 2003-04-19 19:48:51.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/ibmmca.c 2003-04-25 04:34:14.000000000 -0700 @@ -477,7 +477,6 @@ static char ibm_ansi_order = 0; #endif -static void interrupt_handler(int, void *, struct pt_regs *); static void issue_cmd(int, unsigned long, unsigned char); static void internal_done(Scsi_Cmnd * cmd); static void check_devices(int, int); @@ -501,7 +500,8 @@ static int ldn_access_load(int, int); static int ldn_access_total_read_write(int); -static void interrupt_handler(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t interrupt_handler(int irq, void *dev_id, + struct pt_regs *regs) { int host_index, ihost_index; unsigned int intr_reg; @@ -517,7 +517,7 @@ /* return if some other device on this IRQ caused the interrupt */ if (!hosts[host_index]) { spin_unlock(dev->host_lock); - return; + return IRQ_NONE; } /* the reset-function already did all the job, even ints got @@ -525,7 +525,7 @@ if ((reset_status(host_index) == IM_RESET_NOT_IN_PROGRESS_NO_INT) || (reset_status(host_index) == IM_RESET_FINISHED_OK_NO_INT)) { reset_status(host_index) = IM_RESET_NOT_IN_PROGRESS; spin_unlock(dev->host_lock); - return; + return IRQ_HANDLED; } /*must wait for attention reg not busy, then send EOI to subsystem */ @@ -612,7 +612,7 @@ reset_status(ihost_index) = IM_RESET_FINISHED_OK; last_scsi_command(ihost_index)[ldn] = NO_SCSI; spin_unlock(dev->host_lock); - return; + return IRQ_HANDLED; } /* handling of commands coming from upper level of scsi driver */ if (last_scsi_type(ihost_index)[ldn] == IM_IMM_CMD) { @@ -632,7 +632,7 @@ last_scsi_command(ihost_index)[ldn] = NO_SCSI; last_scsi_type(ihost_index)[ldn] = 0; spin_unlock(dev->host_lock); - return; + return IRQ_HANDLED; } else if (last_scsi_command(ihost_index)[ldn] == IM_ABORT_IMM_CMD) { /* react on SCSI abort command */ #ifdef IM_DEBUG_PROBE @@ -652,7 +652,7 @@ if (cmd->scsi_done) (cmd->scsi_done) (cmd); /* should be the internal_done */ spin_unlock(dev->host_lock); - return; + return IRQ_HANDLED; } else { disk_rw_in_progress = 0; PS2_DISK_LED_OFF(); @@ -660,7 +660,7 @@ stat_result(ihost_index) = cmd_result; last_scsi_command(ihost_index)[ldn] = NO_SCSI; spin_unlock(dev->host_lock); - return; + return IRQ_HANDLED; } } last_scsi_command(ihost_index)[ldn] = NO_SCSI; @@ -671,7 +671,7 @@ if (cmd) { if ((cmd->target == TIMEOUT_PUN) && (cmd->device->lun == TIMEOUT_LUN)) { printk("IBM MCA SCSI: Ignoring interrupt from pun=%x, lun=%x.\n", cmd->target, cmd->device->lun); - return; + return IRQ_HANDLED; } } #endif @@ -679,7 +679,7 @@ if (!cmd) { spin_unlock(dev->host_lock); - return; + return IRQ_HANDLED; } #ifdef IM_DEBUG_INT @@ -710,7 +710,7 @@ if (cmd->scsi_done) (cmd->scsi_done) (cmd); spin_unlock(dev->host_lock); - return; + return IRQ_HANDLED; } static void issue_cmd(int host_index, unsigned long cmd_reg, unsigned char attn_reg) diff -urN linux-2.5.68-bk5/drivers/scsi/in2000.c linux-2.5.68-bk6/drivers/scsi/in2000.c --- linux-2.5.68-bk5/drivers/scsi/in2000.c 2003-04-19 19:50:30.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/in2000.c 2003-04-25 04:34:14.000000000 -0700 @@ -832,7 +832,7 @@ * but it _does_ need to be able to compile and run in an SMP kernel.) */ -static void in2000_intr(int irqnum, void *dev_id, struct pt_regs *ptregs) +static irqreturn_t in2000_intr(int irqnum, void *dev_id, struct pt_regs *ptregs) { struct Scsi_Host *instance = dev_id; struct IN2000_hostdata *hostdata; @@ -986,7 +986,7 @@ /* release the SMP spin_lock and restore irq state */ spin_unlock_irqrestore(instance->host_lock, flags); - return; + return IRQ_HANDLED; } /* This interrupt was triggered by the WD33c93 chip. The fifo interrupt @@ -1004,7 +1004,7 @@ /* release the SMP spin_lock and restore irq state */ spin_unlock_irqrestore(instance->host_lock, flags); - return; + return IRQ_HANDLED; } DB(DB_INTR, printk("{%02x:%02x-", asr, sr)) @@ -1416,7 +1416,7 @@ /* release the SMP spin_lock and restore irq state */ spin_unlock_irqrestore(instance->host_lock, flags); - return; + return IRQ_HANDLED; } DB(DB_INTR, printk("UNEXP_DISC-%ld", cmd->pid)) hostdata->connected = NULL; @@ -1589,7 +1589,7 @@ /* release the SMP spin_lock and restore irq state */ spin_unlock_irqrestore(instance->host_lock, flags); - + return IRQ_HANDLED; } @@ -1910,7 +1910,7 @@ unsigned short base; uchar switches; uchar hrev; - int flags; + unsigned long flags; int val; char buf[32]; diff -urN linux-2.5.68-bk5/drivers/scsi/ini9100u.c linux-2.5.68-bk6/drivers/scsi/ini9100u.c --- linux-2.5.68-bk5/drivers/scsi/ini9100u.c 2003-04-19 19:48:56.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/ini9100u.c 2003-04-25 04:34:14.000000000 -0700 @@ -166,14 +166,14 @@ static char *setup_str = (char *) NULL; -static void i91u_intr0(int irq, void *dev_id, struct pt_regs *); -static void i91u_intr1(int irq, void *dev_id, struct pt_regs *); -static void i91u_intr2(int irq, void *dev_id, struct pt_regs *); -static void i91u_intr3(int irq, void *dev_id, struct pt_regs *); -static void i91u_intr4(int irq, void *dev_id, struct pt_regs *); -static void i91u_intr5(int irq, void *dev_id, struct pt_regs *); -static void i91u_intr6(int irq, void *dev_id, struct pt_regs *); -static void i91u_intr7(int irq, void *dev_id, struct pt_regs *); +static irqreturn_t i91u_intr0(int irq, void *dev_id, struct pt_regs *); +static irqreturn_t i91u_intr1(int irq, void *dev_id, struct pt_regs *); +static irqreturn_t i91u_intr2(int irq, void *dev_id, struct pt_regs *); +static irqreturn_t i91u_intr3(int irq, void *dev_id, struct pt_regs *); +static irqreturn_t i91u_intr4(int irq, void *dev_id, struct pt_regs *); +static irqreturn_t i91u_intr5(int irq, void *dev_id, struct pt_regs *); +static irqreturn_t i91u_intr6(int irq, void *dev_id, struct pt_regs *); +static irqreturn_t i91u_intr7(int irq, void *dev_id, struct pt_regs *); static void i91u_panic(char *msg); @@ -697,124 +697,132 @@ /* * Interrupts handler (main routine of the driver) */ -static void i91u_intr0(int irqno, void *dev_id, struct pt_regs *regs) +static irqreturn_t i91u_intr0(int irqno, void *dev_id, struct pt_regs *regs) { unsigned long flags; struct Scsi_Host *dev = dev_id; if (tul_hcs[0].HCS_Intr != irqno) - return; + return IRQ_NONE; spin_lock_irqsave(dev->host_lock, flags); tul_isr(&tul_hcs[0]); spin_unlock_irqrestore(dev->host_lock, flags); + return IRQ_HANDLED; } -static void i91u_intr1(int irqno, void *dev_id, struct pt_regs *regs) +static irqreturn_t i91u_intr1(int irqno, void *dev_id, struct pt_regs *regs) { unsigned long flags; struct Scsi_Host *dev = dev_id; if (tul_hcs[1].HCS_Intr != irqno) - return; + return IRQ_NONE; spin_lock_irqsave(dev->host_lock, flags); tul_isr(&tul_hcs[1]); spin_unlock_irqrestore(dev->host_lock, flags); + return IRQ_HANDLED; } -static void i91u_intr2(int irqno, void *dev_id, struct pt_regs *regs) +static irqreturn_t i91u_intr2(int irqno, void *dev_id, struct pt_regs *regs) { unsigned long flags; struct Scsi_Host *dev = dev_id; if (tul_hcs[2].HCS_Intr != irqno) - return; + return IRQ_NONE; spin_lock_irqsave(dev->host_lock, flags); tul_isr(&tul_hcs[2]); spin_unlock_irqrestore(dev->host_lock, flags); + return IRQ_HANDLED; } -static void i91u_intr3(int irqno, void *dev_id, struct pt_regs *regs) +static irqreturn_t i91u_intr3(int irqno, void *dev_id, struct pt_regs *regs) { unsigned long flags; struct Scsi_Host *dev = dev_id; if (tul_hcs[3].HCS_Intr != irqno) - return; + return IRQ_NONE; spin_lock_irqsave(dev->host_lock, flags); tul_isr(&tul_hcs[3]); spin_unlock_irqrestore(dev->host_lock, flags); + return IRQ_HANDLED; } -static void i91u_intr4(int irqno, void *dev_id, struct pt_regs *regs) +static irqreturn_t i91u_intr4(int irqno, void *dev_id, struct pt_regs *regs) { unsigned long flags; struct Scsi_Host *dev = dev_id; if (tul_hcs[4].HCS_Intr != irqno) - return; + return IRQ_NONE; spin_lock_irqsave(dev->host_lock, flags); tul_isr(&tul_hcs[4]); spin_unlock_irqrestore(dev->host_lock, flags); + return IRQ_HANDLED; } -static void i91u_intr5(int irqno, void *dev_id, struct pt_regs *regs) +static irqreturn_t i91u_intr5(int irqno, void *dev_id, struct pt_regs *regs) { unsigned long flags; struct Scsi_Host *dev = dev_id; if (tul_hcs[5].HCS_Intr != irqno) - return; + return IRQ_NONE; spin_lock_irqsave(dev->host_lock, flags); tul_isr(&tul_hcs[5]); spin_unlock_irqrestore(dev->host_lock, flags); + return IRQ_HANDLED; } - -static void i91u_intr6(int irqno, void *dev_id, struct pt_regs *regs) + +static irqreturn_t i91u_intr6(int irqno, void *dev_id, struct pt_regs *regs) { unsigned long flags; struct Scsi_Host *dev = dev_id; if (tul_hcs[6].HCS_Intr != irqno) - return; + return IRQ_NONE; spin_lock_irqsave(dev->host_lock, flags); tul_isr(&tul_hcs[6]); spin_unlock_irqrestore(dev->host_lock, flags); + return IRQ_HANDLED; } -static void i91u_intr7(int irqno, void *dev_id, struct pt_regs *regs) +static irqreturn_t i91u_intr7(int irqno, void *dev_id, struct pt_regs *regs) { unsigned long flags; struct Scsi_Host *dev = dev_id; if (tul_hcs[7].HCS_Intr != irqno) - return; + return IRQ_NONE; spin_lock_irqsave(dev->host_lock, flags); tul_isr(&tul_hcs[7]); spin_unlock_irqrestore(dev->host_lock, flags); + return IRQ_HANDLED; } /* diff -urN linux-2.5.68-bk5/drivers/scsi/inia100.c linux-2.5.68-bk6/drivers/scsi/inia100.c --- linux-2.5.68-bk5/drivers/scsi/inia100.c 2003-04-19 19:48:57.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/inia100.c 2003-04-25 04:34:14.000000000 -0700 @@ -108,7 +108,7 @@ #define NUMBER(arr) (sizeof(arr) / sizeof(arr[0])) static char *setup_str = (char *) NULL; -static void inia100_intr(int, void *, struct pt_regs *); +static irqreturn_t inia100_intr(int, void *, struct pt_regs *); static void inia100_panic(char *msg); /* ---- EXTERNAL FUNCTIONS ---- */ @@ -659,7 +659,7 @@ /* * Interrupt handler (main routine of the driver) */ -static void inia100_intr(int irqno, void *devid, struct pt_regs *regs) +static irqreturn_t inia100_intr(int irqno, void *devid, struct pt_regs *regs) { struct Scsi_Host *host = (struct Scsi_Host *)devid; ORC_HCS *pHcb; @@ -669,6 +669,7 @@ spin_lock_irqsave(host->host_lock, flags); orc_interrupt(pHcb); spin_unlock_irqrestore(host->host_lock, flags); + return IRQ_HANDLED; } /* diff -urN linux-2.5.68-bk5/drivers/scsi/ips.c linux-2.5.68-bk6/drivers/scsi/ips.c --- linux-2.5.68-bk5/drivers/scsi/ips.c 2003-04-19 19:48:48.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/ips.c 2003-04-25 04:34:14.000000000 -0700 @@ -375,7 +375,7 @@ int ips_eh_reset(Scsi_Cmnd *); int ips_queue(Scsi_Cmnd *, void (*) (Scsi_Cmnd *)); const char * ips_info(struct Scsi_Host *); -void do_ipsintr(int, void *, struct pt_regs *); +irqreturn_t do_ipsintr(int, void *, struct pt_regs *); static int ips_hainit(ips_ha_t *); static int ips_map_status(ips_ha_t *, ips_scb_t *, ips_stat_t *); static int ips_send_wait(ips_ha_t *, ips_scb_t *, int, int); @@ -1264,7 +1264,7 @@ /* Wrapper for the interrupt handler */ /* */ /****************************************************************************/ -void +irqreturn_t do_ipsintr(int irq, void *dev_id, struct pt_regs *regs) { ips_ha_t *ha; unsigned long cpu_flags; @@ -1274,19 +1274,19 @@ ha = (ips_ha_t *) dev_id; if (!ha) - return; + return IRQ_NONE; host = ips_sh[ha->host_num]; /* interrupt during initialization */ if(!host){ (*ha->func.intr)(ha); - return; + return IRQ_HANDLED; } IPS_LOCK_SAVE(host->host_lock, cpu_flags); if (!ha->active) { IPS_UNLOCK_RESTORE(host->host_lock, cpu_flags); - return; + return IRQ_HANDLED; } (*ha->func.intr)(ha); @@ -1295,6 +1295,7 @@ /* start the next command */ ips_next(ha, IPS_INTR_ON); + return IRQ_HANDLED; } /****************************************************************************/ diff -urN linux-2.5.68-bk5/drivers/scsi/mac_scsi.c linux-2.5.68-bk6/drivers/scsi/mac_scsi.c --- linux-2.5.68-bk5/drivers/scsi/mac_scsi.c 2003-04-19 19:48:50.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/mac_scsi.c 2003-04-25 04:34:14.000000000 -0700 @@ -253,16 +253,16 @@ ((struct NCR5380_hostdata *)instance->hostdata)->ctrl = 0; - if (instance->irq != IRQ_NONE) + if (instance->irq != SCSI_IRQ_NONE) if (request_irq(instance->irq, NCR5380_intr, IRQ_FLG_SLOW, "ncr5380", NCR5380_intr)) { printk(KERN_WARNING "scsi%d: IRQ%d not free, interrupts disabled\n", instance->host_no, instance->irq); - instance->irq = IRQ_NONE; + instance->irq = SCSI_IRQ_NONE; } printk(KERN_INFO "scsi%d: generic 5380 at port %lX irq", instance->host_no, instance->io_port); - if (instance->irq == IRQ_NONE) + if (instance->irq == SCSI_IRQ_NONE) printk (KERN_INFO "s disabled"); else printk (KERN_INFO " %d", instance->irq); @@ -277,7 +277,7 @@ int macscsi_release (struct Scsi_Host *shpnt) { - if (shpnt->irq != IRQ_NONE) + if (shpnt->irq != SCSI_IRQ_NONE) free_irq (shpnt->irq, NCR5380_intr); return 0; diff -urN linux-2.5.68-bk5/drivers/scsi/megaraid.c linux-2.5.68-bk6/drivers/scsi/megaraid.c --- linux-2.5.68-bk5/drivers/scsi/megaraid.c 2003-04-19 19:48:46.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/megaraid.c 2003-04-25 04:34:14.000000000 -0700 @@ -2056,7 +2056,7 @@ /*-------------------------------------------------------------------- * Interrupt service routine *--------------------------------------------------------------------*/ -static void megaraid_isr (int irq, void *devp, struct pt_regs *regs) +static irqreturn_t megaraid_isr (int irq, void *devp, struct pt_regs *regs) { IO_LOCK_T; mega_host_config * megaCfg; @@ -2067,11 +2067,13 @@ u_char qCnt, qStatus; u_char completed[MAX_FIRMWARE_STATUS]; Scsi_Cmnd *SCpnt; + int handled = 0; megaCfg = (mega_host_config *) devp; mbox = (mega_mailbox *) tmpBox; if (megaCfg->host->irq == irq) { + handled = 1; if (megaCfg->flag & IN_ISR) { TRACE (("ISR called reentrantly!!\n")); printk ("ISR called reentrantly!!\n"); @@ -2088,14 +2090,14 @@ if (dword != 0x10001234) { /* Spurious interrupt */ megaCfg->flag &= ~IN_ISR; - return; + goto out; } } else { byte = READ_PORT (megaCfg->host->io_port, INTR_PORT); if ((byte & VALID_INTR_BYTE) == 0) { /* Spurious interrupt */ megaCfg->flag &= ~IN_ISR; - return; + goto out; } WRITE_PORT (megaCfg->host->io_port, INTR_PORT, byte); } @@ -2225,7 +2227,8 @@ IO_UNLOCK(megaCfg->host); } - +out: + return IRQ_RETVAL(handled); } /*==================================================*/ diff -urN linux-2.5.68-bk5/drivers/scsi/nsp32.c linux-2.5.68-bk6/drivers/scsi/nsp32.c --- linux-2.5.68-bk5/drivers/scsi/nsp32.c 2003-04-19 19:49:10.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/nsp32.c 2003-04-25 04:34:14.000000000 -0700 @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -291,8 +292,8 @@ static int __init init_nsp32(void); static void __exit exit_nsp32(void); -static void nsp32_message(char *, int, char *, char *, ...); -static void nsp32_dmessage(char *, int, int, char *, ...); +static void nsp32_message(const char *, int, char *, char *, ...); +static void nsp32_dmessage(const char *, int, int, char *, ...); static void nsp32_build_identify(nsp32_hw_data *, Scsi_Cmnd *); static void nsp32_build_sdtr(nsp32_hw_data *, unsigned char, unsigned char); static void nsp32_build_nop(nsp32_hw_data *); @@ -318,7 +319,6 @@ static void nsp32_sack_assert(nsp32_hw_data *); static void nsp32_sack_negate(nsp32_hw_data *); static void nsp32_do_bus_reset(nsp32_hw_data *); -static void do_nsp32_isr(int, void *, struct pt_regs *); static int nsp32_getprom_param(nsp32_hw_data *); static int nsp32_getprom_new(nsp32_hw_data *); @@ -398,7 +398,7 @@ #define NSP32_DEBUG_BUF_LEN 100 -static void nsp32_message(char *func, int line, char *type, char *fmt, ...) +static void nsp32_message(const char *func, int line, char *type, char *fmt, ...) { va_list args; char buf[NSP32_DEBUG_BUF_LEN]; @@ -414,7 +414,7 @@ #endif } -static void nsp32_dmessage(char *func, int line, int mask, char *fmt, ...) +static void nsp32_dmessage(const char *func, int line, int mask, char *fmt, ...) { va_list args; char buf[NSP32_DEBUG_BUF_LEN]; @@ -1263,7 +1263,7 @@ /* interrupt routine */ -static void do_nsp32_isr(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t do_nsp32_isr(int irq, void *dev_id, struct pt_regs *regs) { nsp32_hw_data *data = dev_id; unsigned int base = data->BaseAddress; @@ -1272,6 +1272,7 @@ unsigned char busmon, busphase; unsigned long flags; int ret; + int handled = 0; #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) struct Scsi_Host *host = data->Host; @@ -1291,6 +1292,7 @@ nsp32_msg(KERN_INFO, "spurious interrupt: irq other 0x%x", irq_stat); goto out2; } + handled = 1; nsp32_write2(base, IRQ_CONTROL, IRQ_CONTROL_ALL_IRQ_MASK); busmon = nsp32_read1(base, SCSI_BUS_MONITOR); @@ -1547,7 +1549,7 @@ nsp32_dbg(NSP32_DEBUG_INTR, "exit"); - return; + return IRQ_RETVAL(handled); } #undef SPRINTF diff -urN linux-2.5.68-bk5/drivers/scsi/nsp32.h linux-2.5.68-bk6/drivers/scsi/nsp32.h --- linux-2.5.68-bk5/drivers/scsi/nsp32.h 2003-04-19 19:48:46.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/nsp32.h 2003-04-25 04:34:14.000000000 -0700 @@ -425,5 +425,5 @@ #define BUSPHASE_STATUS ( BUSMON_STATUS & BUSMON_PHASE_MASK ) #define BUSPHASE_SELECT ( BUSMON_SEL | BUSMON_IO ) -#endif _NSP32_H +#endif /* _NSP32_H */ /* end */ diff -urN linux-2.5.68-bk5/drivers/scsi/nsp32_io.h linux-2.5.68-bk6/drivers/scsi/nsp32_io.h --- linux-2.5.68-bk5/drivers/scsi/nsp32_io.h 2003-04-19 19:51:11.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/nsp32_io.h 2003-04-25 04:34:14.000000000 -0700 @@ -265,5 +265,5 @@ nsp32_multi_write4(base, FIFO_DATA_LOW, buf, count); } -#endif _NSP32_IO_H +#endif /* _NSP32_IO_H */ /* end */ diff -urN linux-2.5.68-bk5/drivers/scsi/pas16.c linux-2.5.68-bk6/drivers/scsi/pas16.c --- linux-2.5.68-bk5/drivers/scsi/pas16.c 2003-04-19 19:48:49.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/pas16.c 2003-04-25 04:34:14.000000000 -0700 @@ -103,11 +103,11 @@ * interrupts. Ie, for a board at the default 0x388 base port, * boot: linux pas16=0x388,255 * - * IRQ_NONE (255) should be specified for no interrupt, + * SCSI_IRQ_NONE (255) should be specified for no interrupt, * IRQ_AUTO (254) to autoprobe for an IRQ line if overridden * on the command line. * - * (IRQ_AUTO == 254, IRQ_NONE == 255 in NCR5380.h) + * (IRQ_AUTO == 254, SCSI_IRQ_NONE == 255 in NCR5380.h) */ #include @@ -451,14 +451,14 @@ else instance->irq = NCR5380_probe_irq(instance, PAS16_IRQS); - if (instance->irq != IRQ_NONE) + if (instance->irq != SCSI_IRQ_NONE) if (request_irq(instance->irq, pas16_intr, SA_INTERRUPT, "pas16", instance)) { printk("scsi%d : IRQ%d not free, interrupts disabled\n", instance->host_no, instance->irq); - instance->irq = IRQ_NONE; + instance->irq = SCSI_IRQ_NONE; } - if (instance->irq == IRQ_NONE) { + if (instance->irq == SCSI_IRQ_NONE) { printk("scsi%d : interrupts not enabled. for better interactive performance,\n", instance->host_no); printk("scsi%d : please jumper the board for a free IRQ.\n", instance->host_no); /* Disable 5380 interrupts, leave drive params the same */ @@ -472,7 +472,7 @@ printk("scsi%d : at 0x%04x", instance->host_no, (int) instance->io_port); - if (instance->irq == IRQ_NONE) + if (instance->irq == SCSI_IRQ_NONE) printk (" interrupts disabled"); else printk (" irq %d", instance->irq); diff -urN linux-2.5.68-bk5/drivers/scsi/pci2000.c linux-2.5.68-bk6/drivers/scsi/pci2000.c --- linux-2.5.68-bk5/drivers/scsi/pci2000.c 2003-04-19 19:50:07.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/pci2000.c 2003-04-25 04:34:14.000000000 -0700 @@ -262,7 +262,7 @@ * Returns: TRUE if drive is not ready in time. * ****************************************************************/ -static void Irq_Handler (int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t Irq_Handler (int irq, void *dev_id, struct pt_regs *regs) { struct Scsi_Host *shost = NULL; // Pointer to host data block PADAPTER2000 padapter; // Pointer to adapter control structure @@ -275,7 +275,7 @@ int bus; int z; unsigned long flags; - + int handled = 0; DEB(printk ("\npci2000 received interrupt ")); for ( z = 0; z < NumAdapters; z++ ) // scan for interrupt to process @@ -297,6 +297,7 @@ goto out; } + handled = 1; spin_lock_irqsave(shost->host_lock, flags); padapter = HOSTDATA(shost); @@ -391,7 +392,8 @@ irq_return: spin_unlock_irqrestore(shost->host_lock, flags); -out:; +out: + return IRQ_RETVAL(handled); } /**************************************************************** * Name: Pci2000_QueueCommand diff -urN linux-2.5.68-bk5/drivers/scsi/pci2220i.c linux-2.5.68-bk6/drivers/scsi/pci2220i.c --- linux-2.5.68-bk5/drivers/scsi/pci2220i.c 2003-04-19 19:48:49.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/pci2220i.c 2003-04-25 04:34:14.000000000 -0700 @@ -1586,7 +1586,7 @@ * Returns: TRUE if drive is not ready in time. * ****************************************************************/ -static void Irq_Handler (int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t Irq_Handler (int irq, void *dev_id, struct pt_regs *regs) { struct Scsi_Host *shost = NULL; // Pointer to host data block PADAPTER2220I padapter; // Pointer to adapter control structure @@ -1600,6 +1600,7 @@ int z; ULONG zl; unsigned long flags; + int handled = 0; // DEB (printk ("\npci2220i received interrupt\n")); @@ -1621,6 +1622,7 @@ goto out; } + handled = 1; spin_lock_irqsave(shost->host_lock, flags); padapter = HOSTDATA(shost); pdev = padapter->pdev; @@ -2025,8 +2027,10 @@ OpDone (padapter, zl); irq_return: spin_unlock_irqrestore(shost->host_lock, flags); -out:; - } +out: + return IRQ_RETVAL(handled); +} + /**************************************************************** * Name: Pci2220i_QueueCommand * diff -urN linux-2.5.68-bk5/drivers/scsi/psi240i.c linux-2.5.68-bk6/drivers/scsi/psi240i.c --- linux-2.5.68-bk5/drivers/scsi/psi240i.c 2003-04-19 19:50:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/psi240i.c 2003-04-25 04:34:14.000000000 -0700 @@ -367,15 +367,18 @@ SCpnt->result = DecodeError (shost, status); SCpnt->scsi_done (SCpnt); } -static void do_Irq_Handler (int irq, void *dev_id, struct pt_regs *regs) - { + +static irqreturn_t do_Irq_Handler (int irq, void *dev_id, struct pt_regs *regs) +{ unsigned long flags; struct Scsi_Host *dev = dev_id; spin_lock_irqsave(dev->host_lock, flags); Irq_Handler(irq, dev_id, regs); spin_unlock_irqrestore(dev->host_lock, flags); - } + return IRQ_HANDLED; +} + /**************************************************************** * Name: Psi240i_QueueCommand * diff -urN linux-2.5.68-bk5/drivers/scsi/qlogicfas.c linux-2.5.68-bk6/drivers/scsi/qlogicfas.c --- linux-2.5.68-bk5/drivers/scsi/qlogicfas.c 2003-04-19 19:51:19.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/qlogicfas.c 2003-04-25 04:34:14.000000000 -0700 @@ -288,7 +288,9 @@ static int ql_wai(void) { - int i, k; + int k; + unsigned long i; + k = 0; i = jiffies + WATCHDOG; while (time_before(jiffies, i) && !qabort && !((k = inb(qbase + 4)) & 0xe0)) { @@ -359,7 +361,8 @@ static unsigned int ql_pcmd(Scsi_Cmnd * cmd) { - unsigned int i, j, k; + unsigned int i, j; + unsigned long k; unsigned int result; /* ultimate return result */ unsigned int status; /* scsi returned status */ unsigned int message; /* scsi returned message */ @@ -526,7 +529,7 @@ (icmd->scsi_done) (icmd); } -static void do_ql_ihandl(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t do_ql_ihandl(int irq, void *dev_id, struct pt_regs *regs) { unsigned long flags; struct Scsi_Host *host = dev_id; @@ -534,6 +537,7 @@ spin_lock_irqsave(host->host_lock, flags); ql_ihandl(irq, dev_id, regs); spin_unlock_irqrestore(host->host_lock, flags); + return IRQ_HANDLED; } #endif diff -urN linux-2.5.68-bk5/drivers/scsi/seagate.c linux-2.5.68-bk6/drivers/scsi/seagate.c --- linux-2.5.68-bk5/drivers/scsi/seagate.c 2003-04-19 19:49:21.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/seagate.c 2003-04-25 04:34:14.000000000 -0700 @@ -333,7 +333,7 @@ static int hostno = -1; static void seagate_reconnect_intr (int, void *, struct pt_regs *); -static void do_seagate_reconnect_intr (int, void *, struct pt_regs *); +static irqreturn_t do_seagate_reconnect_intr (int, void *, struct pt_regs *); #ifdef FAST static int fast = 1; @@ -621,7 +621,8 @@ * asserting SEL. */ -static void do_seagate_reconnect_intr (int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t do_seagate_reconnect_intr(int irq, void *dev_id, + struct pt_regs *regs) { unsigned long flags; struct Scsi_Host *dev = dev_id; @@ -629,6 +630,7 @@ spin_lock_irqsave (dev->host_lock, flags); seagate_reconnect_intr (irq, dev_id, regs); spin_unlock_irqrestore (dev->host_lock, flags); + return IRQ_HANDLED; } static void seagate_reconnect_intr (int irq, void *dev_id, struct pt_regs *regs) diff -urN linux-2.5.68-bk5/drivers/scsi/sun3_scsi.c linux-2.5.68-bk6/drivers/scsi/sun3_scsi.c --- linux-2.5.68-bk5/drivers/scsi/sun3_scsi.c 2003-04-19 19:48:50.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/sun3_scsi.c 2003-04-25 04:34:14.000000000 -0700 @@ -273,7 +273,7 @@ #ifndef REAL_DMA printk("scsi%d: IRQ%d not free, interrupts disabled\n", instance->host_no, instance->irq); - instance->irq = IRQ_NONE; + instance->irq = SCSI_IRQ_NONE; #else printk("scsi%d: IRQ%d not free, bailing out\n", instance->host_no, instance->irq); @@ -282,7 +282,7 @@ } printk("scsi%d: Sun3 5380 at port %lX irq", instance->host_no, instance->io_port); - if (instance->irq == IRQ_NONE) + if (instance->irq == SCSI_IRQ_NONE) printk ("s disabled"); else printk (" %d", instance->irq); @@ -311,7 +311,7 @@ #ifdef MODULE int sun3scsi_release (struct Scsi_Host *shpnt) { - if (shpnt->irq != IRQ_NONE) + if (shpnt->irq != SCSI_IRQ_NONE) free_irq (shpnt->irq, NULL); iounmap((void *)sun3_scsi_regp); diff -urN linux-2.5.68-bk5/drivers/scsi/sun3_scsi_vme.c linux-2.5.68-bk6/drivers/scsi/sun3_scsi_vme.c --- linux-2.5.68-bk5/drivers/scsi/sun3_scsi_vme.c 2003-04-19 19:51:23.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/sun3_scsi_vme.c 2003-04-25 04:34:14.000000000 -0700 @@ -235,7 +235,7 @@ #ifndef REAL_DMA printk("scsi%d: IRQ%d not free, interrupts disabled\n", instance->host_no, instance->irq); - instance->irq = IRQ_NONE; + instance->irq = SCSI_IRQ_NONE; #else printk("scsi%d: IRQ%d not free, bailing out\n", instance->host_no, instance->irq); @@ -244,7 +244,7 @@ } printk("scsi%d: Sun3 5380 VME at port %lX irq", instance->host_no, instance->io_port); - if (instance->irq == IRQ_NONE) + if (instance->irq == SCSI_IRQ_NONE) printk ("s disabled"); else printk (" %d", instance->irq); @@ -280,7 +280,7 @@ #ifdef MODULE int sun3scsi_release (struct Scsi_Host *shpnt) { - if (shpnt->irq != IRQ_NONE) + if (shpnt->irq != SCSI_IRQ_NONE) free_irq (shpnt->irq, NULL); iounmap(sun3_scsi_regp); diff -urN linux-2.5.68-bk5/drivers/scsi/sym53c416.c linux-2.5.68-bk6/drivers/scsi/sym53c416.c --- linux-2.5.68-bk5/drivers/scsi/sym53c416.c 2003-04-19 19:48:52.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/sym53c416.c 2003-04-25 04:34:14.000000000 -0700 @@ -248,7 +248,7 @@ unsigned int orig_len = len; unsigned long flags = 0; unsigned int bytes_left; - int i; + unsigned long i; int timeout = READ_TIMEOUT; /* Do transfer */ @@ -290,7 +290,7 @@ unsigned int orig_len = len; unsigned long flags = 0; unsigned int bufferfree; - unsigned int i; + unsigned long i; unsigned int timeout = WRITE_TIMEOUT; /* Do transfer */ @@ -327,7 +327,8 @@ return orig_len - len; } -static void sym53c416_intr_handle(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t sym53c416_intr_handle(int irq, void *dev_id, + struct pt_regs *regs) { struct Scsi_Host *dev = dev_id; int base = 0; @@ -348,7 +349,7 @@ if(!base) { printk(KERN_ERR "sym53c416: No host adapter defined for interrupt %d\n", irq); - return; + return IRQ_NONE; } /* Now we have the base address and we can start handling the interrupt */ @@ -367,7 +368,7 @@ spin_lock_irqsave(dev->host_lock, flags); current_command->scsi_done(current_command); spin_unlock_irqrestore(dev->host_lock, flags); - return; + goto out; } if(int_reg & ILCMD) /* Illegal Command */ { @@ -377,7 +378,7 @@ spin_lock_irqsave(dev->host_lock, flags); current_command->scsi_done(current_command); spin_unlock_irqrestore(dev->host_lock, flags); - return; + goto out; } if(status_reg & GE) /* Gross Error */ { @@ -387,7 +388,7 @@ spin_lock_irqsave(dev->host_lock, flags); current_command->scsi_done(current_command); spin_unlock_irqrestore(dev->host_lock, flags); - return; + goto out; } if(status_reg & PE) /* Parity Error */ { @@ -397,7 +398,7 @@ spin_lock_irqsave(dev->host_lock, flags); current_command->scsi_done(current_command); spin_unlock_irqrestore(dev->host_lock, flags); - return; + goto out; } if(pio_int_reg & (CE | OUE)) { @@ -407,7 +408,7 @@ spin_lock_irqsave(dev->host_lock, flags); current_command->scsi_done(current_command); spin_unlock_irqrestore(dev->host_lock, flags); - return; + goto out; } if(int_reg & DIS) /* Disconnect */ { @@ -419,7 +420,7 @@ spin_lock_irqsave(dev->host_lock, flags); current_command->scsi_done(current_command); spin_unlock_irqrestore(dev->host_lock, flags); - return; + goto out; } /* Now we handle SCSI phases */ @@ -518,6 +519,8 @@ break; } } +out: + return IRQ_HANDLED; } static void sym53c416_init(int base, int scsi_id) @@ -537,7 +540,8 @@ static int sym53c416_probeirq(int base, int scsi_id) { - int irq, irqs, i; + int irq, irqs; + unsigned long i; /* Clear interrupt register */ inb(base + INT_REG); diff -urN linux-2.5.68-bk5/drivers/scsi/t128.c linux-2.5.68-bk6/drivers/scsi/t128.c --- linux-2.5.68-bk5/drivers/scsi/t128.c 2003-04-19 19:50:48.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/t128.c 2003-04-25 04:34:14.000000000 -0700 @@ -248,14 +248,14 @@ else instance->irq = NCR5380_probe_irq(instance, T128_IRQS); - if (instance->irq != IRQ_NONE) + if (instance->irq != SCSI_IRQ_NONE) if (request_irq(instance->irq, t128_intr, SA_INTERRUPT, "t128", instance)) { printk("scsi%d : IRQ%d not free, interrupts disabled\n", instance->host_no, instance->irq); - instance->irq = IRQ_NONE; + instance->irq = SCSI_IRQ_NONE; } - if (instance->irq == IRQ_NONE) { + if (instance->irq == SCSI_IRQ_NONE) { printk("scsi%d : interrupts not enabled. for better interactive performance,\n", instance->host_no); printk("scsi%d : please jumper the board for a free IRQ.\n", instance->host_no); } @@ -265,7 +265,7 @@ #endif printk("scsi%d : at 0x%08lx", instance->host_no, instance->base); - if (instance->irq == IRQ_NONE) + if (instance->irq == SCSI_IRQ_NONE) printk (" interrupts disabled"); else printk (" irq %d", instance->irq); diff -urN linux-2.5.68-bk5/drivers/scsi/tmscsim.c linux-2.5.68-bk6/drivers/scsi/tmscsim.c --- linux-2.5.68-bk5/drivers/scsi/tmscsim.c 2003-04-19 19:51:23.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/tmscsim.c 2003-04-25 04:34:14.000000000 -0700 @@ -3045,7 +3045,7 @@ /* TO DO: We should check for outstanding commands first. */ dc390_shutdown (host); - if (host->irq != IRQ_NONE) + if (host->irq != SCSI_IRQ_NONE) { DEBUG0(printk(KERN_INFO "DC390: Free IRQ %i\n",host->irq);) free_irq (host->irq, pACB); diff -urN linux-2.5.68-bk5/drivers/scsi/tmscsim.h linux-2.5.68-bk6/drivers/scsi/tmscsim.h --- linux-2.5.68-bk5/drivers/scsi/tmscsim.h 2003-04-19 19:50:48.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/tmscsim.h 2003-04-25 04:34:14.000000000 -0700 @@ -11,7 +11,7 @@ #include #include -#define IRQ_NONE 255 +#define SCSI_IRQ_NONE 255 #define MAX_ADAPTER_NUM 4 #define MAX_SG_LIST_BUF 16 /* Not used */ diff -urN linux-2.5.68-bk5/drivers/scsi/u14-34f.c linux-2.5.68-bk6/drivers/scsi/u14-34f.c --- linux-2.5.68-bk5/drivers/scsi/u14-34f.c 2003-04-19 19:48:57.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/u14-34f.c 2003-04-25 04:34:14.000000000 -0700 @@ -604,7 +604,7 @@ #define H2DEV(x) cpu_to_le32(x) #define DEV2H(x) le32_to_cpu(x) -static void do_interrupt_handler(int, void *, struct pt_regs *); +static irqreturn_t do_interrupt_handler(int, void *, struct pt_regs *); static void flush_dev(Scsi_Device *, unsigned long, unsigned int, unsigned int); static int do_trace = FALSE; static int setup_done = FALSE; @@ -1890,7 +1890,9 @@ return; } -static void do_interrupt_handler(int irq, void *shap, struct pt_regs *regs) { +static irqreturn_t do_interrupt_handler(int irq, void *shap, + struct pt_regs *regs) +{ unsigned int j; unsigned long spin_flags; @@ -1900,6 +1902,7 @@ spin_lock_irqsave(sh[j]->host_lock, spin_flags); ihdlr(irq, j); spin_unlock_irqrestore(sh[j]->host_lock, spin_flags); + return IRQ_HANDLED; } static int u14_34f_release(struct Scsi_Host *shpnt) { diff -urN linux-2.5.68-bk5/drivers/scsi/ultrastor.c linux-2.5.68-bk6/drivers/scsi/ultrastor.c --- linux-2.5.68-bk5/drivers/scsi/ultrastor.c 2003-04-19 19:49:51.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/ultrastor.c 2003-04-25 04:34:14.000000000 -0700 @@ -288,7 +288,7 @@ #endif static void ultrastor_interrupt(int, void *, struct pt_regs *); -static void do_ultrastor_interrupt(int, void *, struct pt_regs *); +static irqreturn_t do_ultrastor_interrupt(int, void *, struct pt_regs *); static inline void build_sg_list(struct mscp *, Scsi_Cmnd *SCpnt); @@ -1160,7 +1160,8 @@ #endif } -static void do_ultrastor_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t do_ultrastor_interrupt(int irq, void *dev_id, + struct pt_regs *regs) { unsigned long flags; struct Scsi_Host *dev = dev_id; @@ -1168,6 +1169,7 @@ spin_lock_irqsave(dev->host_lock, flags); ultrastor_interrupt(irq, dev_id, regs); spin_unlock_irqrestore(dev->host_lock, flags); + return IRQ_HANDLED; } MODULE_LICENSE("GPL"); diff -urN linux-2.5.68-bk5/drivers/scsi/wd7000.c linux-2.5.68-bk6/drivers/scsi/wd7000.c --- linux-2.5.68-bk5/drivers/scsi/wd7000.c 2003-04-19 19:51:13.000000000 -0700 +++ linux-2.5.68-bk6/drivers/scsi/wd7000.c 2003-04-25 04:34:14.000000000 -0700 @@ -1121,7 +1121,8 @@ dprintk("wd7000_intr_handle: return from interrupt handler\n"); } -static void do_wd7000_intr_handle(int irq, void *dev_id, struct pt_regs *regs) +static irqreturn_t do_wd7000_intr_handle(int irq, void *dev_id, + struct pt_regs *regs) { unsigned long flags; struct Scsi_Host *host = dev_id; @@ -1129,6 +1130,7 @@ spin_lock_irqsave(host->host_lock, flags); wd7000_intr_handle(irq, dev_id, regs); spin_unlock_irqrestore(host->host_lock, flags); + return IRQ_HANDLED; } diff -urN linux-2.5.68-bk5/drivers/serial/21285.c linux-2.5.68-bk6/drivers/serial/21285.c --- linux-2.5.68-bk5/drivers/serial/21285.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/serial/21285.c 2003-04-25 04:34:14.000000000 -0700 @@ -414,11 +414,6 @@ } } -static kdev_t serial21285_console_device(struct console *c) -{ - return mk_kdev(SERIAL_21285_MAJOR, SERIAL_21285_MINOR); -} - static void __init serial21285_get_options(struct uart_port *port, int *baud, int *parity, int *bits) @@ -479,15 +474,17 @@ return uart_set_options(port, co, baud, parity, bits, flow); } +extern struct uart_driver serial21285_reg; #ifdef CONFIG_SERIAL_21285_OLD static struct console serial21285_old_cons = { .name = SERIAL_21285_OLD_NAME, .write = serial21285_console_write, - .device = serial21285_console_device, + .device = uart_console_device, .setup = serial21285_console_setup, .flags = CON_PRINTBUFFER, .index = -1, + .data = &serial21285_reg, }; #endif @@ -495,10 +492,11 @@ { .name = SERIAL_21285_NAME, .write = serial21285_console_write, - .device = serial21285_console_device, + .device = uart_console_device, .setup = serial21285_console_setup, .flags = CON_PRINTBUFFER, .index = -1, + .data = &serial21285_reg, }; static int __init rs285_console_init(void) diff -urN linux-2.5.68-bk5/drivers/serial/68328serial.c linux-2.5.68-bk6/drivers/serial/68328serial.c --- linux-2.5.68-bk5/drivers/serial/68328serial.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/serial/68328serial.c 2003-04-25 04:34:14.000000000 -0700 @@ -1662,9 +1662,10 @@ } -static kdev_t m68328_console_device(struct console *c) +static struct tty_driver *m68328_console_device(struct console *c, int *index) { - return mk_kdev(TTY_MAJOR, 64 + c->index); + *index = c->index; + return &serial_driver; } diff -urN linux-2.5.68-bk5/drivers/serial/68360serial.c linux-2.5.68-bk6/drivers/serial/68360serial.c --- linux-2.5.68-bk5/drivers/serial/68360serial.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/serial/68360serial.c 2003-04-25 04:34:14.000000000 -0700 @@ -2521,9 +2521,10 @@ } #endif -static kdev_t serial_console_device(struct console *c) +static struct tty_struct *serial_console_device(struct console *c, int *index) { - return MKDEV(TTY_MAJOR, 64 + c->index); + *index = c->index; + return &serial_driver; } diff -urN linux-2.5.68-bk5/drivers/serial/8250.c linux-2.5.68-bk6/drivers/serial/8250.c --- linux-2.5.68-bk5/drivers/serial/8250.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/serial/8250.c 2003-04-25 04:34:14.000000000 -0700 @@ -1944,11 +1944,6 @@ serial_out(up, UART_IER, ier); } -static kdev_t serial8250_console_device(struct console *co) -{ - return mk_kdev(TTY_MAJOR, 64 + co->index); -} - static int __init serial8250_console_setup(struct console *co, char *options) { struct uart_port *port; @@ -1977,13 +1972,15 @@ return uart_set_options(port, co, baud, parity, bits, flow); } +extern struct uart_driver serial8250_reg; static struct console serial8250_console = { .name = "ttyS", .write = serial8250_console_write, - .device = serial8250_console_device, + .device = uart_console_device, .setup = serial8250_console_setup, .flags = CON_PRINTBUFFER, .index = -1, + .data = &serial8250_reg, }; static int __init serial8250_console_init(void) diff -urN linux-2.5.68-bk5/drivers/serial/amba.c linux-2.5.68-bk6/drivers/serial/amba.c --- linux-2.5.68-bk5/drivers/serial/amba.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/serial/amba.c 2003-04-25 04:34:14.000000000 -0700 @@ -640,11 +640,6 @@ UART_PUT_CR(port, old_cr); } -static kdev_t ambauart_console_device(struct console *co) -{ - return mk_kdev(SERIAL_AMBA_MAJOR, SERIAL_AMBA_MINOR + co->index); -} - static void __init ambauart_console_get_options(struct uart_port *port, int *baud, int *parity, int *bits) @@ -696,13 +691,15 @@ return uart_set_options(port, co, baud, parity, bits, flow); } +extern struct uart_driver amba_reg; static struct console amba_console = { .name = "ttyAM", .write = ambauart_console_write, - .device = ambauart_console_device, + .device = uart_console_device, .setup = ambauart_console_setup, .flags = CON_PRINTBUFFER, .index = -1, + .data = &amba_reg, }; static int __init ambauart_console_init(void) diff -urN linux-2.5.68-bk5/drivers/serial/anakin.c linux-2.5.68-bk6/drivers/serial/anakin.c --- linux-2.5.68-bk5/drivers/serial/anakin.c 2003-04-19 19:48:55.000000000 -0700 +++ linux-2.5.68-bk6/drivers/serial/anakin.c 2003-04-25 04:34:14.000000000 -0700 @@ -444,12 +444,6 @@ } } -static kdev_t -anakin_console_device(struct console *co) -{ - return mk_kdev(SERIAL_ANAKIN_MAJOR, SERIAL_ANAKIN_MINOR + co->index); -} - /* * Read the current UART setup. */ @@ -493,10 +487,11 @@ return uart_set_options(port, co, baud, parity, bits); } +extern struct uart_driver anakin_reg; static struct console anakin_console = { .name = SERIAL_ANAKIN_NAME, .write = anakin_console_write, - .device = anakin_console_device, + .device = uart_console_device, .setup = anakin_console_setup, .flags = CON_PRINTBUFFER, .index = -1, @@ -514,7 +509,7 @@ #define ANAKIN_CONSOLE NULL #endif -static struct uart_register anakin_reg = { +static struct uart_driver anakin_reg = { .driver_name = SERIAL_ANAKIN_NAME, .dev_name = SERIAL_ANAKIN_NAME, .major = SERIAL_ANAKIN_MAJOR, diff -urN linux-2.5.68-bk5/drivers/serial/clps711x.c linux-2.5.68-bk6/drivers/serial/clps711x.c --- linux-2.5.68-bk5/drivers/serial/clps711x.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/serial/clps711x.c 2003-04-25 04:34:14.000000000 -0700 @@ -503,11 +503,6 @@ clps_writel(syscon, SYSCON(port)); } -static kdev_t clps711xuart_console_device(struct console *co) -{ - return mk_kdev(SERIAL_CLPS711X_MAJOR, SERIAL_CLPS711X_MINOR + co->index); -} - static void __init clps711xuart_console_get_options(struct uart_port *port, int *baud, int *parity, int *bits) @@ -558,13 +553,15 @@ return uart_set_options(port, co, baud, parity, bits, flow); } +extern struct uart_driver clps711x_reg; static struct console clps711x_console = { .name = "ttyCL", .write = clps711xuart_console_write, - .device = clps711xuart_console_device, + .device = uart_console_device, .setup = clps711xuart_console_setup, .flags = CON_PRINTBUFFER, .index = -1, + .data = &clps711x_reg, }; static int __init clps711xuart_console_init(void) diff -urN linux-2.5.68-bk5/drivers/serial/core.c linux-2.5.68-bk6/drivers/serial/core.c --- linux-2.5.68-bk5/drivers/serial/core.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/serial/core.c 2003-04-25 04:34:14.000000000 -0700 @@ -2187,13 +2187,21 @@ */ void uart_unregister_driver(struct uart_driver *drv) { - tty_unregister_driver(drv->tty_driver); - + struct tty_driver *p = drv->tty_driver; + drv->tty_driver = NULL; + tty_unregister_driver(p); kfree(drv->state); kfree(drv->tty_driver->termios); kfree(drv->tty_driver); } +struct tty_driver *uart_console_device(struct console *co, int *index) +{ + struct uart_driver *p = co->data; + *index = co->index; + return p->tty_driver; +} + /** * uart_add_one_port - attach a driver-defined port structure * @drv: pointer to the uart low level driver structure for this port diff -urN linux-2.5.68-bk5/drivers/serial/mcfserial.c linux-2.5.68-bk6/drivers/serial/mcfserial.c --- linux-2.5.68-bk5/drivers/serial/mcfserial.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/serial/mcfserial.c 2003-04-25 04:34:14.000000000 -0700 @@ -1785,9 +1785,10 @@ } -static kdev_t mcfrs_console_device(struct console *c) +static struct tty_driver *mcfrs_console_device(struct console *c, int *index) { - return mk_kdev(TTY_MAJOR, 64 + c->index); + *index = c->index; + return &mcfrs_serial_driver; } diff -urN linux-2.5.68-bk5/drivers/serial/nb85e_uart.c linux-2.5.68-bk6/drivers/serial/nb85e_uart.c --- linux-2.5.68-bk5/drivers/serial/nb85e_uart.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/serial/nb85e_uart.c 2003-04-25 04:34:14.000000000 -0700 @@ -272,19 +272,16 @@ } } -static kdev_t nb85e_uart_cons_device (struct console *c) -{ - return mk_kdev (TTY_MAJOR, NB85E_UART_MINOR_BASE + c->index); -} - +extern struct uart_driver nb85e_uart_driver; static struct console nb85e_uart_cons = { .name = "ttyS", .write = nb85e_uart_cons_write, - .device = nb85e_uart_cons_device, + .device = uart_console_device, .flags = CON_PRINTBUFFER, .cflag = NB85E_UART_INIT_CFLAGS, .index = -1, + .data = &nb85e_uart_driver, }; void nb85e_uart_cons_init (unsigned chan) diff -urN linux-2.5.68-bk5/drivers/serial/sa1100.c linux-2.5.68-bk6/drivers/serial/sa1100.c --- linux-2.5.68-bk5/drivers/serial/sa1100.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/serial/sa1100.c 2003-04-25 04:34:14.000000000 -0700 @@ -760,11 +760,6 @@ UART_PUT_UTCR3(sport, old_utcr3); } -static kdev_t sa1100_console_device(struct console *co) -{ - return mk_kdev(SERIAL_SA1100_MAJOR, MINOR_START + co->index); -} - /* * If the port was already initialised (eg, by a boot loader), * try to determine the current setup. @@ -827,13 +822,15 @@ return uart_set_options(&sport->port, co, baud, parity, bits, flow); } +extern struct uart_driver sa1100_reg; static struct console sa1100_console = { .name = "ttySA", .write = sa1100_console_write, - .device = sa1100_console_device, + .device = uart_console_device, .setup = sa1100_console_setup, .flags = CON_PRINTBUFFER, .index = -1, + .data = sa1100_reg, }; static int __init sa1100_rs_console_init(void) diff -urN linux-2.5.68-bk5/drivers/serial/serial98.c linux-2.5.68-bk6/drivers/serial/serial98.c --- linux-2.5.68-bk5/drivers/serial/serial98.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/serial/serial98.c 2003-04-25 04:34:14.000000000 -0700 @@ -136,16 +136,17 @@ #ifdef CONFIG_SERIAL98_CONSOLE static void serial98_console_write(struct console *co, const char *s, unsigned int count); -static kdev_t serial98_console_device(struct console *co); static int __init serial98_console_setup(struct console *co, char *options); +extern struct uart_driver serial98_reg; static struct console serial98_console = { .name = "ttyS", .write = serial98_console_write, - .device = serial98_console_device, + .device = uart_console_device, .setup = serial98_console_setup, .flags = CON_PRINTBUFFER, .index = -1, + .data = &serial98_reg, }; #define SERIAL98_CONSOLE &serial98_console @@ -994,11 +995,6 @@ outb(ier2, IER2_8251F); } -static kdev_t serial98_console_device(struct console *co) -{ - return mk_kdev(TTY_MAJOR, 64 + co->index); -} - static int __init serial98_console_setup(struct console *co, char *options) { struct uart_port *port; diff -urN linux-2.5.68-bk5/drivers/serial/sunsab.c linux-2.5.68-bk6/drivers/serial/sunsab.c --- linux-2.5.68-bk5/drivers/serial/sunsab.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/serial/sunsab.c 2003-04-25 04:34:14.000000000 -0700 @@ -863,11 +863,6 @@ sunsab_tec_wait(up); } -static kdev_t sunsab_console_device(struct console *con) -{ - return mk_kdev(sunsab_reg.major, sunsab_reg.minor + con->index); -} - static int sunsab_console_setup(struct console *con, char *options) { struct uart_sunsab_port *up = &sunsab_ports[con->index]; @@ -928,10 +923,11 @@ static struct console sunsab_console = { .name = "ttyS", .write = sunsab_console_write, - .device = sunsab_console_device, + .device = uart_console_device, .setup = sunsab_console_setup, .flags = CON_PRINTBUFFER, .index = -1, + .data = &sunsab_reg, }; static void __init sunsab_console_init(void) diff -urN linux-2.5.68-bk5/drivers/serial/sunsu.c linux-2.5.68-bk6/drivers/serial/sunsu.c --- linux-2.5.68-bk5/drivers/serial/sunsu.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/serial/sunsu.c 2003-04-25 04:34:14.000000000 -0700 @@ -1422,11 +1422,6 @@ serial_out(up, UART_IER, ier); } -static kdev_t sunsu_console_device(struct console *co) -{ - return mk_kdev(sunsu_reg.major, sunsu_reg.minor + co->index); -} - /* * Setup initial baud/bits/parity. We do two things here: * - construct a cflag setting for the first su_open() @@ -1467,10 +1462,11 @@ static struct console sunsu_cons = { .name = "ttyS", .write = sunsu_console_write, - .device = sunsu_console_device, + .device = uart_console_device, .setup = sunsu_console_setup, .flags = CON_PRINTBUFFER, .index = -1, + .data = &sunsu_reg, }; /* diff -urN linux-2.5.68-bk5/drivers/serial/sunzilog.c linux-2.5.68-bk6/drivers/serial/sunzilog.c --- linux-2.5.68-bk5/drivers/serial/sunzilog.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/serial/sunzilog.c 2003-04-25 04:34:14.000000000 -0700 @@ -1352,11 +1352,6 @@ spin_unlock_irqrestore(&up->port.lock, flags); } -static kdev_t sunzilog_console_device(struct console *con) -{ - return mk_kdev(sunzilog_reg.major, sunzilog_reg.minor + con->index); -} - static int __init sunzilog_console_setup(struct console *con, char *options) { struct uart_sunzilog_port *up = &sunzilog_port_table[con->index]; @@ -1402,10 +1397,11 @@ static struct console sunzilog_console = { .name = "ttyS", .write = sunzilog_console_write, - .device = sunzilog_console_device, + .device = uart_console_device, .setup = sunzilog_console_setup, .flags = CON_PRINTBUFFER, .index = -1, + .data = &sunzilog_reg, }; static int __init sunzilog_console_init(void) diff -urN linux-2.5.68-bk5/drivers/serial/uart00.c linux-2.5.68-bk6/drivers/serial/uart00.c --- linux-2.5.68-bk5/drivers/serial/uart00.c 2003-04-19 19:49:11.000000000 -0700 +++ linux-2.5.68-bk6/drivers/serial/uart00.c 2003-04-25 04:34:14.000000000 -0700 @@ -576,11 +576,6 @@ #endif } -static kdev_t uart00_console_device(struct console *co) -{ - return mk_kdev(SERIAL_UART00_MAJOR, SERIAL_UART00_MINOR + co->index); -} - static void __init uart00_console_get_options(struct uart_port *port, int *baud, int *parity, int *bits) @@ -636,13 +631,15 @@ return uart_set_options(port, co, baud, parity, bits, flow); } +extern struct uart_driver uart00_reg; static struct console uart00_console = { .name = SERIAL_UART00_NAME, .write = uart00_console_write, - .device = uart00_console_device, + .device = uart_console_device, .setup = uart00_console_setup, .flags = CON_PRINTBUFFER, .index = 0, + .data = &uart00_reg; }; static int __init uart00_console_init(void) diff -urN linux-2.5.68-bk5/drivers/sgi/char/sgiserial.c linux-2.5.68-bk6/drivers/sgi/char/sgiserial.c --- linux-2.5.68-bk5/drivers/sgi/char/sgiserial.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/sgi/char/sgiserial.c 2003-04-25 04:34:14.000000000 -0700 @@ -2109,9 +2109,10 @@ rs_fair_output(); } -static kdev_t zs_console_device(struct console *con) +static struct tty_driver *zs_console_device(struct console *con, int *index) { - return MKDEV(TTY_MAJOR, 64 + con->index); + *index = con->index; + return &serial_driver; } diff -urN linux-2.5.68-bk5/drivers/tc/zs.c linux-2.5.68-bk6/drivers/tc/zs.c --- linux-2.5.68-bk5/drivers/tc/zs.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/tc/zs.c 2003-04-25 04:34:14.000000000 -0700 @@ -2121,9 +2121,10 @@ } } -static kdev_t serial_console_device(struct console *c) +static struct tty_driver *serial_console_device(struct console *c, int *index) { - return MKDEV(TTY_MAJOR, 64 + c->index); + *index = c->index; + return &serial_driver; } /* diff -urN linux-2.5.68-bk5/drivers/usb/class/audio.c linux-2.5.68-bk6/drivers/usb/class/audio.c --- linux-2.5.68-bk5/drivers/usb/class/audio.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/class/audio.c 2003-04-25 04:34:14.000000000 -0700 @@ -185,7 +185,6 @@ #include #include #include -#include #include #include #include diff -urN linux-2.5.68-bk5/drivers/usb/class/cdc-acm.c linux-2.5.68-bk6/drivers/usb/class/cdc-acm.c --- linux-2.5.68-bk5/drivers/usb/class/cdc-acm.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/class/cdc-acm.c 2003-04-25 04:34:14.000000000 -0700 @@ -432,43 +432,47 @@ dbg("send break failed"); } -static int acm_tty_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg) +static int acm_tty_tiocmget(struct tty_struct *tty, struct file *file) { struct acm *acm = tty->driver_data; - unsigned int mask, newctrl; - if (!ACM_READY(acm)) return -EINVAL; + if (!ACM_READY(acm)) + return -EINVAL; - switch (cmd) { + return (acm->ctrlout & ACM_CTRL_DTR ? TIOCM_DTR : 0) | + (acm->ctrlout & ACM_CTRL_RTS ? TIOCM_RTS : 0) | + (acm->ctrlin & ACM_CTRL_DSR ? TIOCM_DSR : 0) | + (acm->ctrlin & ACM_CTRL_RI ? TIOCM_RI : 0) | + (acm->ctrlin & ACM_CTRL_DCD ? TIOCM_CD : 0) | + TIOCM_CTS; +} - case TIOCMGET: +static int acm_tty_tiocmset(struct tty_struct *tty, struct file *file, + unsigned int set, unsigned int clear) +{ + struct acm *acm = tty->driver_data; + unsigned int newctrl; - return put_user((acm->ctrlout & ACM_CTRL_DTR ? TIOCM_DTR : 0) | - (acm->ctrlout & ACM_CTRL_RTS ? TIOCM_RTS : 0) | - (acm->ctrlin & ACM_CTRL_DSR ? TIOCM_DSR : 0) | - (acm->ctrlin & ACM_CTRL_RI ? TIOCM_RI : 0) | - (acm->ctrlin & ACM_CTRL_DCD ? TIOCM_CD : 0) | - TIOCM_CTS, (unsigned long *) arg); + if (!ACM_READY(acm)) + return -EINVAL; - case TIOCMSET: - case TIOCMBIS: - case TIOCMBIC: + newctrl = acm->ctrlout; + set = (set & TIOCM_DTR ? ACM_CTRL_DTR : 0) | (set & TIOCM_RTS ? ACM_CTRL_RTS : 0); + clear = (clear & TIOCM_DTR ? ACM_CTRL_DTR : 0) | (clear & TIOCM_RTS ? ACM_CTRL_RTS : 0); - if (get_user(mask, (unsigned long *) arg)) - return -EFAULT; + newctrl = (newctrl & ~clear) | set; - newctrl = acm->ctrlout; - mask = (mask & TIOCM_DTR ? ACM_CTRL_DTR : 0) | (mask & TIOCM_RTS ? ACM_CTRL_RTS : 0); + if (acm->ctrlout == newctrl) + return 0; + return acm_set_control(acm, acm->ctrlout = newctrl); +} - switch (cmd) { - case TIOCMSET: newctrl = mask; break; - case TIOCMBIS: newctrl |= mask; break; - case TIOCMBIC: newctrl &= ~mask; break; - } +static int acm_tty_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg) +{ + struct acm *acm = tty->driver_data; - if (acm->ctrlout == newctrl) return 0; - return acm_set_control(acm, acm->ctrlout = newctrl); - } + if (!ACM_READY(acm)) + return -EINVAL; return -ENOIOCTLCMD; } @@ -750,7 +754,9 @@ .unthrottle = acm_tty_unthrottle, .chars_in_buffer = acm_tty_chars_in_buffer, .break_ctl = acm_tty_break_ctl, - .set_termios = acm_tty_set_termios + .set_termios = acm_tty_set_termios, + .tiocmget = acm_tty_tiocmget, + .tiocmset = acm_tty_tiocmset, }; /* diff -urN linux-2.5.68-bk5/drivers/usb/class/usb-midi.c linux-2.5.68-bk6/drivers/usb/class/usb-midi.c --- linux-2.5.68-bk5/drivers/usb/class/usb-midi.c 2003-04-19 19:48:49.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/class/usb-midi.c 2003-04-25 04:34:14.000000000 -0700 @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -820,7 +819,7 @@ struct list_head *devs, *mdevs; struct usb_midi_state *s; struct usb_mididev *m; - int flags; + unsigned long flags; int succeed = 0; #if 0 diff -urN linux-2.5.68-bk5/drivers/usb/core/hcd-pci.c linux-2.5.68-bk6/drivers/usb/core/hcd-pci.c --- linux-2.5.68-bk5/drivers/usb/core/hcd-pci.c 2003-04-19 19:49:26.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/core/hcd-pci.c 2003-04-25 04:34:14.000000000 -0700 @@ -17,11 +17,6 @@ */ #include -#include -#include -#include -#include -#include #ifdef CONFIG_USB_DEBUG #define DEBUG @@ -29,6 +24,11 @@ #undef DEBUG #endif +#include +#include +#include +#include +#include #include #include "hcd.h" @@ -214,7 +214,7 @@ hub = hcd->self.root_hub; hcd->state = USB_STATE_QUIESCING; - dev_dbg (*hcd->controller, "roothub graceful disconnect\n"); + dev_dbg (hcd->controller, "roothub graceful disconnect\n"); usb_disconnect (&hub); hcd->driver->stop (hcd); @@ -326,7 +326,7 @@ retval = -EBUSY; if (hcd->state != USB_STATE_SUSPENDED) { - dev_dbg (*hcd->controller, "can't resume, not suspended!\n"); + dev_dbg (hcd->controller, "can't resume, not suspended!\n"); goto done; } hcd->state = USB_STATE_RESUMING; @@ -336,7 +336,7 @@ retval = hcd->driver->resume (hcd); if (!HCD_IS_RUNNING (hcd->state)) { - dev_dbg (*hcd->controller, "resume fail, retval %d\n", retval); + dev_dbg (hcd->controller, "resume fail, retval %d\n", retval); usb_hc_died (hcd); // FIXME: recover, reset etc. } else { diff -urN linux-2.5.68-bk5/drivers/usb/core/hcd.c linux-2.5.68-bk6/drivers/usb/core/hcd.c --- linux-2.5.68-bk5/drivers/usb/core/hcd.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/core/hcd.c 2003-04-25 04:34:14.000000000 -0700 @@ -961,8 +961,8 @@ spin_lock_irqsave (&hcd_data_lock, flags); list_del_init (&urb->urb_list); dev = urb->dev; - usb_put_dev (dev); spin_unlock_irqrestore (&hcd_data_lock, flags); + usb_put_dev (dev); } diff -urN linux-2.5.68-bk5/drivers/usb/core/usb.c linux-2.5.68-bk6/drivers/usb/core/usb.c --- linux-2.5.68-bk5/drivers/usb/core/usb.c 2003-04-19 19:49:32.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/core/usb.c 2003-04-25 04:34:14.000000000 -0700 @@ -791,14 +791,22 @@ void usb_disconnect(struct usb_device **pdev) { struct usb_device *dev = *pdev; - struct usb_bus *bus = dev->bus; - struct usb_operations *ops = bus->op; + struct usb_bus *bus; + struct usb_operations *ops; int i; might_sleep (); - if (!dev) + if (!dev) { + pr_debug ("%s nodev\n", __FUNCTION__); + return; + } + bus = dev->bus; + if (!bus) { + pr_debug ("%s nobus\n", __FUNCTION__); return; + } + ops = bus->op; *pdev = NULL; diff -urN linux-2.5.68-bk5/drivers/usb/input/hiddev.c linux-2.5.68-bk6/drivers/usb/input/hiddev.c --- linux-2.5.68-bk5/drivers/usb/input/hiddev.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/input/hiddev.c 2003-04-25 04:34:14.000000000 -0700 @@ -35,6 +35,7 @@ #include #include "hid.h" #include +#include #ifdef CONFIG_USB_DYNAMIC_MINORS #define HIDDEV_MINOR_BASE 0 diff -urN linux-2.5.68-bk5/drivers/usb/media/ibmcam.c linux-2.5.68-bk6/drivers/usb/media/ibmcam.c --- linux-2.5.68-bk5/drivers/usb/media/ibmcam.c 2003-04-19 19:48:56.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/media/ibmcam.c 2003-04-25 04:34:14.000000000 -0700 @@ -28,7 +28,6 @@ #include #include -#include #include #include diff -urN linux-2.5.68-bk5/drivers/usb/media/ov511.c linux-2.5.68-bk6/drivers/usb/media/ov511.c --- linux-2.5.68-bk5/drivers/usb/media/ov511.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/media/ov511.c 2003-04-25 04:34:14.000000000 -0700 @@ -47,7 +47,6 @@ #include #include #include -#include #include #if defined (__i386__) diff -urN linux-2.5.68-bk5/drivers/usb/media/pwc-if.c linux-2.5.68-bk6/drivers/usb/media/pwc-if.c --- linux-2.5.68-bk5/drivers/usb/media/pwc-if.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/media/pwc-if.c 2003-04-25 04:34:14.000000000 -0700 @@ -55,7 +55,6 @@ #include #include #include -#include #include #include "pwc.h" diff -urN linux-2.5.68-bk5/drivers/usb/media/se401.c linux-2.5.68-bk6/drivers/usb/media/se401.c --- linux-2.5.68-bk5/drivers/usb/media/se401.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/media/se401.c 2003-04-25 04:34:14.000000000 -0700 @@ -38,7 +38,6 @@ #include #include #include -#include #include #include "se401.h" diff -urN linux-2.5.68-bk5/drivers/usb/media/stv680.c linux-2.5.68-bk6/drivers/usb/media/stv680.c --- linux-2.5.68-bk5/drivers/usb/media/stv680.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/media/stv680.c 2003-04-25 04:34:14.000000000 -0700 @@ -66,7 +66,6 @@ #include #include #include -#include #include #include #include diff -urN linux-2.5.68-bk5/drivers/usb/media/ultracam.c linux-2.5.68-bk6/drivers/usb/media/ultracam.c --- linux-2.5.68-bk5/drivers/usb/media/ultracam.c 2003-04-19 19:48:53.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/media/ultracam.c 2003-04-25 04:34:14.000000000 -0700 @@ -7,7 +7,6 @@ #include #include -#include #include #include diff -urN linux-2.5.68-bk5/drivers/usb/media/usbvideo.c linux-2.5.68-bk6/drivers/usb/media/usbvideo.c --- linux-2.5.68-bk5/drivers/usb/media/usbvideo.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/media/usbvideo.c 2003-04-25 04:34:14.000000000 -0700 @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include diff -urN linux-2.5.68-bk5/drivers/usb/media/vicam.c linux-2.5.68-bk6/drivers/usb/media/vicam.c --- linux-2.5.68-bk5/drivers/usb/media/vicam.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/media/vicam.c 2003-04-25 04:34:14.000000000 -0700 @@ -32,7 +32,6 @@ */ #include -#include #include #include #include diff -urN linux-2.5.68-bk5/drivers/usb/misc/speedtch.c linux-2.5.68-bk6/drivers/usb/misc/speedtch.c --- linux-2.5.68-bk5/drivers/usb/misc/speedtch.c 2003-04-19 19:51:19.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/misc/speedtch.c 2003-04-25 04:34:14.000000000 -0700 @@ -20,7 +20,19 @@ ******************************************************************************/ /* - * Written by Johan Verrept (Johan.Verrept@advalvas.be) + * Written by Johan Verrept, maintained by Duncan Sands (duncan.sands@wanadoo.fr) + * + * 1.6: - No longer opens a connection if the firmware is not loaded + * - Added support for the speedtouch 330 + * - Removed the limit on the number of devices + * - Module now autoloads on device plugin + * - Merged relevant parts of sarlib + * - Replaced the kernel thread with a tasklet + * - New packet transmission code + * - Changed proc file contents + * - Fixed all known SMP races + * - Many fixes and cleanups + * - Various fixes by Oliver Neukum (oliver@neukum.name) * * 1.5A: - Version for inclusion in 2.5 series kernel * - Modifications by Richard Purdie (rpurdie@rpsys.net) @@ -28,6 +40,7 @@ * udsl_usb_send_data_context->urb to a pointer and adding code * to alloc and free it * - remove_wait_queue() added to udsl_atm_processqueue_thread() + * - Duncan Sands (duncan.sands@wanadoo.fr) is the new maintainer * * 1.5: - fixed memory leak when atmsar_decode_aal5 returned NULL. * (reported by stephen.robinson@zen.co.uk) @@ -77,9 +90,9 @@ #define PACKETDEBUG(arg...) #endif -#define DRIVER_AUTHOR "Johan Verrept, Johan.Verrept@advalvas.be" -#define DRIVER_DESC "Driver for the Alcatel SpeedTouch USB ADSL modem" -#define DRIVER_VERSION "1.5A" +#define DRIVER_AUTHOR "Johan Verrept, Duncan Sands " +#define DRIVER_DESC "Alcatel SpeedTouch USB driver" +#define DRIVER_VERSION "1.6" #define SPEEDTOUCH_VENDORID 0x06b9 #define SPEEDTOUCH_PRODUCTID 0x4061 @@ -393,11 +406,12 @@ ** encode ** *************/ +static const unsigned char zeros[ATM_CELL_PAYLOAD]; + static void udsl_groom_skb (struct atm_vcc *vcc, struct sk_buff *skb) { struct udsl_control *ctrl = UDSL_SKB (skb); - unsigned int i, zero_padding; - unsigned char zero = 0; + unsigned int zero_padding; u32 crc; ctrl->atm_data.vcc = vcc; @@ -423,8 +437,7 @@ ctrl->aal5_trailer [3] = skb->len; crc = crc32_be (~0, skb->data, skb->len); - for (i = 0; i < zero_padding; i++) - crc = crc32_be (crc, &zero, 1); + crc = crc32_be (crc, zeros, zero_padding); crc = crc32_be (crc, ctrl->aal5_trailer, 4); crc = ~crc; @@ -566,8 +579,7 @@ atmsar_vcc->vcc->push (atmsar_vcc->vcc, new); } else { dbg - ("dropping incoming packet : rx_inuse = %d, vcc->sk->rcvbuf = %d, skb->true_size = %d", - atomic_read (&atmsar_vcc->vcc->rx_inuse), + ("dropping incoming packet : vcc->sk->rcvbuf = %d, skb->true_size = %d", atmsar_vcc->vcc->sk->rcvbuf, new->truesize); dev_kfree_skb (new); } diff -urN linux-2.5.68-bk5/drivers/usb/net/kaweth.c linux-2.5.68-bk6/drivers/usb/net/kaweth.c --- linux-2.5.68-bk5/drivers/usb/net/kaweth.c 2003-04-19 19:50:30.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/net/kaweth.c 2003-04-25 04:34:14.000000000 -0700 @@ -744,7 +744,7 @@ } } - private_header = __skb_push(skb, 2); + private_header = (u16 *)__skb_push(skb, 2); *private_header = cpu_to_le16(skb->len-2); kaweth->tx_skb = skb; diff -urN linux-2.5.68-bk5/drivers/usb/net/usbnet.c linux-2.5.68-bk6/drivers/usb/net/usbnet.c --- linux-2.5.68-bk5/drivers/usb/net/usbnet.c 2003-04-19 19:49:52.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/net/usbnet.c 2003-04-25 04:34:14.000000000 -0700 @@ -314,8 +314,12 @@ : (in_interrupt () ? "in_interrupt" : "can sleep")) #ifdef DEBUG -#define devdbg(usbnet, fmt, arg...) \ - printk(KERN_DEBUG "%s: " fmt "\n" , (usbnet)->net.name, ## arg) +#define devdbg(usbnet, fmt, arg...) \ + do { \ + printk(KERN_DEBUG "%s:", (usbnet)->net.name); \ + printk(fmt, ## arg); \ + printk("\n"); \ + } while (0) #else #define devdbg(usbnet, fmt, arg...) do {} while(0) #endif diff -urN linux-2.5.68-bk5/drivers/usb/serial/belkin_sa.c linux-2.5.68-bk6/drivers/usb/serial/belkin_sa.c --- linux-2.5.68-bk5/drivers/usb/serial/belkin_sa.c 2003-04-19 19:49:58.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/serial/belkin_sa.c 2003-04-25 04:34:14.000000000 -0700 @@ -101,6 +101,8 @@ static void belkin_sa_set_termios (struct usb_serial_port *port, struct termios * old); static int belkin_sa_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg); static void belkin_sa_break_ctl (struct usb_serial_port *port, int break_state ); +static int belkin_sa_tiocmget (struct usb_serial_port *port, struct file *file); +static int belkin_sa_tiocmset (struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear); static struct usb_device_id id_table_combined [] = { @@ -138,6 +140,8 @@ .ioctl = belkin_sa_ioctl, .set_termios = belkin_sa_set_termios, .break_ctl = belkin_sa_break_ctl, + .tiocmget = belkin_sa_tiocmget, + .tiocmset = belkin_sa_tiocmset, .attach = belkin_sa_startup, .shutdown = belkin_sa_shutdown, }; @@ -502,65 +506,77 @@ } -static int belkin_sa_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg) +static int belkin_sa_tiocmget (struct usb_serial_port *port, struct file *file) +{ + struct belkin_sa_private *priv = usb_get_serial_port_data(port); + unsigned long control_state; + unsigned long flags; + + dbg("%s", __FUNCTION__); + + spin_lock_irqsave(&priv->lock, flags); + control_state = priv->control_state; + spin_unlock_irqrestore(&priv->lock, flags); + + return control_state; +} + + +static int belkin_sa_tiocmset (struct usb_serial_port *port, struct file *file, + unsigned int set, unsigned int clear) { struct usb_serial *serial = port->serial; - __u16 urb_value; /* Will hold the new flags */ struct belkin_sa_private *priv = usb_get_serial_port_data(port); - int ret = 0; - int mask; unsigned long control_state; unsigned long flags; + int retval; + int rts = 0; + int dtr = 0; + dbg("%s", __FUNCTION__); + spin_lock_irqsave(&priv->lock, flags); control_state = priv->control_state; + + if (set & TIOCM_RTS) { + control_state |= TIOCM_RTS; + rts = 1; + } + if (set & TIOCM_DTR) { + control_state |= TIOCM_DTR; + dtr = 1; + } + if (clear & TIOCM_RTS) { + control_state &= ~TIOCM_RTS; + rts = 0; + } + if (clear & TIOCM_DTR) { + control_state &= ~TIOCM_DTR; + dtr = 0; + } + + priv->control_state = control_state; spin_unlock_irqrestore(&priv->lock, flags); - /* Based on code from acm.c and others */ - switch (cmd) { - case TIOCMGET: - return put_user(control_state, (unsigned long *) arg); - break; + retval = BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST, rts); + if (retval < 0) { + err("Set RTS error %d", retval); + goto exit; + } - case TIOCMSET: /* Turns on and off the lines as specified by the mask */ - case TIOCMBIS: /* turns on (Sets) the lines as specified by the mask */ - case TIOCMBIC: /* turns off (Clears) the lines as specified by the mask */ - if (get_user(mask, (unsigned long *) arg)) - return -EFAULT; - - if ((cmd == TIOCMSET) || (mask & TIOCM_RTS)) { - /* RTS needs set */ - urb_value = ((cmd == TIOCMSET) && (mask & TIOCM_RTS)) || (cmd == TIOCMBIS) ? 1 : 0; - if (urb_value) - control_state |= TIOCM_RTS; - else - control_state &= ~TIOCM_RTS; - - if ((ret = BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST, urb_value)) < 0) { - err("Set RTS error %d", ret); - goto cmerror; - } - } + retval = BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, dtr); + if (retval < 0) { + err("Set DTR error %d", retval); + goto exit; + } +exit: + return retval; +} - if ((cmd == TIOCMSET) || (mask & TIOCM_DTR)) { - /* DTR needs set */ - urb_value = ((cmd == TIOCMSET) && (mask & TIOCM_DTR)) || (cmd == TIOCMBIS) ? 1 : 0; - if (urb_value) - control_state |= TIOCM_DTR; - else - control_state &= ~TIOCM_DTR; - if ((ret = BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, urb_value)) < 0) { - err("Set DTR error %d", ret); - goto cmerror; - } - } -cmerror: - spin_lock_irqsave(&priv->lock, flags); - priv->control_state = control_state; - spin_unlock_irqrestore(&priv->lock, flags); - return ret; - break; - + +static int belkin_sa_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg) +{ + switch (cmd) { case TIOCMIWAIT: /* wait for any of the 4 modem inputs (DCD,RI,DSR,CTS)*/ /* TODO */ diff -urN linux-2.5.68-bk5/drivers/usb/serial/digi_acceleport.c linux-2.5.68-bk6/drivers/usb/serial/digi_acceleport.c --- linux-2.5.68-bk5/drivers/usb/serial/digi_acceleport.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/serial/digi_acceleport.c 2003-04-25 04:34:14.000000000 -0700 @@ -460,6 +460,9 @@ static void digi_break_ctl( struct usb_serial_port *port, int break_state ); static int digi_ioctl( struct usb_serial_port *port, struct file *file, unsigned int cmd, unsigned long arg ); +static int digi_tiocmget( struct usb_serial_port *port, struct file *file ); +static int digi_tiocmset( struct usb_serial_port *port, struct file *file, + unsigned int set, unsigned int clear ); static int digi_write( struct usb_serial_port *port, int from_user, const unsigned char *buf, int count ); static void digi_write_bulk_callback( struct urb *urb, struct pt_regs *regs ); @@ -526,6 +529,8 @@ .ioctl = digi_ioctl, .set_termios = digi_set_termios, .break_ctl = digi_break_ctl, + .tiocmget = digi_tiocmget, + .tiocmset = digi_tiocmset, .attach = digi_startup, .shutdown = digi_shutdown, }; @@ -551,6 +556,8 @@ .ioctl = digi_ioctl, .set_termios = digi_set_termios, .break_ctl = digi_break_ctl, + .tiocmget = digi_tiocmget, + .tiocmset = digi_tiocmset, .attach = digi_startup, .shutdown = digi_shutdown, }; @@ -1211,39 +1218,46 @@ } -static int digi_ioctl( struct usb_serial_port *port, struct file *file, - unsigned int cmd, unsigned long arg ) +static int digi_tiocmget( struct usb_serial_port *port, struct file *file ) { + struct digi_port *priv = usb_get_serial_port_data(port); + unsigned int val; + unsigned long flags; + + dbg("%s: TOP: port=%d", __FUNCTION__, priv->dp_port_num); + + spin_lock_irqsave( &priv->dp_port_lock, flags ); + val = priv->dp_modem_signals; + spin_unlock_irqrestore( &priv->dp_port_lock, flags ); + return val; +} + +static int digi_tiocmset( struct usb_serial_port *port, struct file *file, + unsigned int set, unsigned int clear ) +{ struct digi_port *priv = usb_get_serial_port_data(port); unsigned int val; - unsigned long flags = 0; + unsigned long flags; + dbg("%s: TOP: port=%d", __FUNCTION__, priv->dp_port_num); -dbg( "digi_ioctl: TOP: port=%d, cmd=0x%x", priv->dp_port_num, cmd ); + spin_lock_irqsave( &priv->dp_port_lock, flags ); + val = (priv->dp_modem_signals & ~clear) | set; + spin_unlock_irqrestore( &priv->dp_port_lock, flags ); + return digi_set_modem_signals( port, val, 1 ); +} - switch (cmd) { - case TIOCMGET: - spin_lock_irqsave( &priv->dp_port_lock, flags ); - val = priv->dp_modem_signals; - spin_unlock_irqrestore( &priv->dp_port_lock, flags ); - if( copy_to_user((unsigned int *)arg, &val, sizeof(int)) ) - return( -EFAULT ); - return( 0 ); +static int digi_ioctl( struct usb_serial_port *port, struct file *file, + unsigned int cmd, unsigned long arg ) +{ - case TIOCMSET: - case TIOCMBIS: - case TIOCMBIC: - if( copy_from_user(&val, (unsigned int *)arg, sizeof(int)) ) - return( -EFAULT ); - spin_lock_irqsave( &priv->dp_port_lock, flags ); - if( cmd == TIOCMBIS ) - val = priv->dp_modem_signals | val; - else if( cmd == TIOCMBIC ) - val = priv->dp_modem_signals & ~val; - spin_unlock_irqrestore( &priv->dp_port_lock, flags ); - return( digi_set_modem_signals( port, val, 1 ) ); + struct digi_port *priv = usb_get_serial_port_data(port); + +dbg( "digi_ioctl: TOP: port=%d, cmd=0x%x", priv->dp_port_num, cmd ); + + switch (cmd) { case TIOCMIWAIT: /* wait for any of the 4 modem inputs (DCD,RI,DSR,CTS)*/ diff -urN linux-2.5.68-bk5/drivers/usb/serial/ftdi_sio.c linux-2.5.68-bk6/drivers/usb/serial/ftdi_sio.c --- linux-2.5.68-bk5/drivers/usb/serial/ftdi_sio.c 2003-04-19 19:50:35.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/serial/ftdi_sio.c 2003-04-25 04:34:14.000000000 -0700 @@ -175,6 +175,8 @@ static void ftdi_sio_write_bulk_callback (struct urb *urb, struct pt_regs *regs); static void ftdi_sio_read_bulk_callback (struct urb *urb, struct pt_regs *regs); static void ftdi_sio_set_termios (struct usb_serial_port *port, struct termios * old); +static int ftdi_sio_tiocmget (struct usb_serial_port *port, struct file *file); +static int ftdi_sio_tiocmset (struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear); static int ftdi_sio_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg); static void ftdi_sio_break_ctl (struct usb_serial_port *port, int break_state ); @@ -198,6 +200,8 @@ .ioctl = ftdi_sio_ioctl, .set_termios = ftdi_sio_set_termios, .break_ctl = ftdi_sio_break_ctl, + .tiocmget = ftdi_sio_tiocmget, + .tiocmset = ftdi_sio_tiocmset, .attach = ftdi_sio_startup, .shutdown = ftdi_sio_shutdown, }; @@ -219,6 +223,8 @@ .ioctl = ftdi_sio_ioctl, .set_termios = ftdi_sio_set_termios, .break_ctl = ftdi_sio_break_ctl, + .tiocmget = ftdi_sio_tiocmget, + .tiocmset = ftdi_sio_tiocmset, .attach = ftdi_8U232AM_startup, .shutdown = ftdi_sio_shutdown, }; @@ -823,125 +829,100 @@ return; } /* ftdi_sio_set_termios */ -static int ftdi_sio_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg) +static int ftdi_sio_tiocmget (struct usb_serial_port *port, struct file *file) { struct usb_serial *serial = port->serial; struct ftdi_private *priv = usb_get_serial_port_data(port); - __u16 urb_value=0; /* Will hold the new flags */ - char buf[2]; - int ret, mask; + char *buf = NULL; + int ret = -EINVAL; + int size; - dbg("%s cmd 0x%04x", __FUNCTION__, cmd); + dbg("%s", __FUNCTION__); - /* Based on code from acm.c and others */ - switch (cmd) { + buf = kmalloc(2, GFP_KERNEL); + if (!buf) + goto exit; - case TIOCMGET: - dbg("%s TIOCMGET", __FUNCTION__); - if (priv->ftdi_type == sio){ - /* Request the status from the device */ - if ((ret = usb_control_msg(serial->dev, - usb_rcvctrlpipe(serial->dev, 0), - FTDI_SIO_GET_MODEM_STATUS_REQUEST, - FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE, - 0, 0, - buf, 1, WDR_TIMEOUT)) < 0 ) { - err("%s Could not get modem status of device - err: %d", __FUNCTION__, - ret); - return(ret); - } - } else { - /* the 8U232AM returns a two byte value (the sio is a 1 byte value) - in the same - format as the data returned from the in point */ - if ((ret = usb_control_msg(serial->dev, - usb_rcvctrlpipe(serial->dev, 0), - FTDI_SIO_GET_MODEM_STATUS_REQUEST, - FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE, - 0, 0, - buf, 2, WDR_TIMEOUT)) < 0 ) { - err("%s Could not get modem status of device - err: %d", __FUNCTION__, - ret); - return(ret); - } - } + if (priv->ftdi_type == sio) { + size = 1; + } else { + /* the 8U232AM returns a two byte value (the sio is a 1 byte value) - in the same + format as the data returned from the in point */ + size = 2; + } + ret = usb_control_msg(serial->dev, + usb_rcvctrlpipe(serial->dev, 0), + FTDI_SIO_GET_MODEM_STATUS_REQUEST, + FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE, + 0, 0, buf, size, WDR_TIMEOUT); + if (ret < 0) { + err("%s Could not get modem status of device - err: %d", + __FUNCTION__, ret); + goto exit; + } + + ret = (buf[0] & FTDI_SIO_DSR_MASK ? TIOCM_DSR : 0) | + (buf[0] & FTDI_SIO_CTS_MASK ? TIOCM_CTS : 0) | + (buf[0] & FTDI_SIO_RI_MASK ? TIOCM_RI : 0) | + (buf[0] & FTDI_SIO_RLSD_MASK ? TIOCM_CD : 0); + +exit: + kfree(buf); + return ret; +} - return put_user((buf[0] & FTDI_SIO_DSR_MASK ? TIOCM_DSR : 0) | - (buf[0] & FTDI_SIO_CTS_MASK ? TIOCM_CTS : 0) | - (buf[0] & FTDI_SIO_RI_MASK ? TIOCM_RI : 0) | - (buf[0] & FTDI_SIO_RLSD_MASK ? TIOCM_CD : 0), - (unsigned long *) arg); - break; +static int ftdi_sio_tiocmset (struct usb_serial_port *port, struct file *file, + unsigned int set, unsigned int clear) +{ + struct usb_serial *serial = port->serial; + int ret = 0; + + dbg("%s", __FUNCTION__); - case TIOCMSET: /* Turns on and off the lines as specified by the mask */ - dbg("%s TIOCMSET", __FUNCTION__); - if (get_user(mask, (unsigned long *) arg)) - return -EFAULT; - urb_value = ((mask & TIOCM_DTR) ? HIGH : LOW); - if (set_dtr(serial->dev, usb_sndctrlpipe(serial->dev, 0),urb_value) < 0){ - err("Error from DTR set urb (TIOCMSET)"); - } - urb_value = ((mask & TIOCM_RTS) ? HIGH : LOW); - if (set_rts(serial->dev, usb_sndctrlpipe(serial->dev, 0),urb_value) < 0){ - err("Error from RTS set urb (TIOCMSET)"); - } - break; - - case TIOCMBIS: /* turns on (Sets) the lines as specified by the mask */ - dbg("%s TIOCMBIS", __FUNCTION__); - if (get_user(mask, (unsigned long *) arg)) - return -EFAULT; - if (mask & TIOCM_DTR){ - if ((ret = set_dtr(serial->dev, - usb_sndctrlpipe(serial->dev, 0), - HIGH)) < 0) { - err("Urb to set DTR failed"); - return(ret); - } - } - if (mask & TIOCM_RTS) { - if ((ret = set_rts(serial->dev, - usb_sndctrlpipe(serial->dev, 0), - HIGH)) < 0){ - err("Urb to set RTS failed"); - return(ret); - } + if (set & TIOCM_RTS) + if ((ret = set_rts(serial->dev, + usb_sndctrlpipe(serial->dev, 0), + HIGH)) < 0) { + err("Urb to set RTS failed"); + goto exit; + } + + if (set & TIOCM_DTR) + if ((ret = set_dtr(serial->dev, + usb_sndctrlpipe(serial->dev, 0), + HIGH)) < 0) { + err("Urb to set DTR failed"); + goto exit; + } + + if (clear & TIOCM_RTS) + if ((ret = set_rts(serial->dev, + usb_sndctrlpipe(serial->dev, 0), + LOW)) < 0) { + err("Urb to unset RTS failed"); + goto exit; + } + + if (clear & TIOCM_DTR) + if ((ret = set_dtr(serial->dev, + usb_sndctrlpipe(serial->dev, 0), + LOW)) < 0) { + err("Urb to unset DTR failed"); + goto exit; } - break; - case TIOCMBIC: /* turns off (Clears) the lines as specified by the mask */ - dbg("%s TIOCMBIC", __FUNCTION__); - if (get_user(mask, (unsigned long *) arg)) - return -EFAULT; - if (mask & TIOCM_DTR){ - if ((ret = set_dtr(serial->dev, - usb_sndctrlpipe(serial->dev, 0), - LOW)) < 0){ - err("Urb to unset DTR failed"); - return(ret); - } - } - if (mask & TIOCM_RTS) { - if ((ret = set_rts(serial->dev, - usb_sndctrlpipe(serial->dev, 0), - LOW)) < 0){ - err("Urb to unset RTS failed"); - return(ret); - } - } - break; +exit: + return ret; +} - /* - * I had originally implemented TCSET{A,S}{,F,W} and - * TCGET{A,S} here separately, however when testing I - * found that the higher layers actually do the termios - * conversions themselves and pass the call onto - * ftdi_sio_set_termios. - * - */ +static int ftdi_sio_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg) +{ + dbg("%s cmd 0x%04x", __FUNCTION__, cmd); + switch (cmd) { default: /* This is not an error - turns out the higher layers will do - * some ioctls itself (see comment above) + * some ioctls itself */ dbg("%s arg not supported - it was 0x%04x", __FUNCTION__,cmd); return(-ENOIOCTLCMD); diff -urN linux-2.5.68-bk5/drivers/usb/serial/io_edgeport.c linux-2.5.68-bk6/drivers/usb/serial/io_edgeport.c --- linux-2.5.68-bk5/drivers/usb/serial/io_edgeport.c 2003-04-19 19:48:50.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/serial/io_edgeport.c 2003-04-25 04:34:14.000000000 -0700 @@ -455,6 +455,8 @@ static void edge_set_termios (struct usb_serial_port *port, struct termios *old_termios); static int edge_ioctl (struct usb_serial_port *port, struct file *file, unsigned int cmd, unsigned long arg); static void edge_break (struct usb_serial_port *port, int break_state); +static int edge_tiocmget (struct usb_serial_port *port, struct file *file); +static int edge_tiocmset (struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear); static int edge_startup (struct usb_serial *serial); static void edge_shutdown (struct usb_serial *serial); @@ -1762,42 +1764,27 @@ return -ENOIOCTLCMD; } -static int set_modem_info(struct edgeport_port *edge_port, unsigned int cmd, unsigned int *value) +static int edge_tiocmset (struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear) { - unsigned int mcr = edge_port->shadowMCR; - unsigned int arg; - - if (copy_from_user(&arg, value, sizeof(int))) - return -EFAULT; - - switch (cmd) { - case TIOCMBIS: - if (arg & TIOCM_RTS) - mcr |= MCR_RTS; - if (arg & TIOCM_DTR) - mcr |= MCR_RTS; - if (arg & TIOCM_LOOP) - mcr |= MCR_LOOPBACK; - break; + struct edgeport_port *edge_port = usb_get_serial_port_data(port); + unsigned int mcr; - case TIOCMBIC: - if (arg & TIOCM_RTS) - mcr &= ~MCR_RTS; - if (arg & TIOCM_DTR) - mcr &= ~MCR_RTS; - if (arg & TIOCM_LOOP) - mcr &= ~MCR_LOOPBACK; - break; + dbg("%s - port %d", __FUNCTION__, port->number); - case TIOCMSET: - /* turn off the RTS and DTR and LOOPBACK - * and then only turn on what was asked to */ - mcr &= ~(MCR_RTS | MCR_DTR | MCR_LOOPBACK); - mcr |= ((arg & TIOCM_RTS) ? MCR_RTS : 0); - mcr |= ((arg & TIOCM_DTR) ? MCR_DTR : 0); - mcr |= ((arg & TIOCM_LOOP) ? MCR_LOOPBACK : 0); - break; - } + mcr = edge_port->shadowMCR; + if (set & TIOCM_RTS) + mcr |= MCR_RTS; + if (set & TIOCM_DTR) + mcr |= MCR_DTR; + if (set & TIOCM_LOOP) + mcr |= MCR_LOOPBACK; + + if (clear & TIOCM_RTS) + mcr &= ~MCR_RTS; + if (clear & TIOCM_DTR) + mcr &= ~MCR_DTR; + if (clear & TIOCM_LOOP) + mcr &= ~MCR_LOOPBACK; edge_port->shadowMCR = mcr; @@ -1806,12 +1793,17 @@ return 0; } -static int get_modem_info(struct edgeport_port *edge_port, unsigned int *value) +static int edge_tiocmget(struct usb_serial_port *port, struct file *file) { + struct edgeport_port *edge_port = usb_get_serial_port_data(port); unsigned int result = 0; - unsigned int msr = edge_port->shadowMSR; - unsigned int mcr = edge_port->shadowMCR; + unsigned int msr; + unsigned int mcr; + + dbg("%s - port %d", __FUNCTION__, port->number); + msr = edge_port->shadowMSR; + mcr = edge_port->shadowMCR; result = ((mcr & MCR_DTR) ? TIOCM_DTR: 0) /* 0x002 */ | ((mcr & MCR_RTS) ? TIOCM_RTS: 0) /* 0x004 */ | ((msr & MSR_CTS) ? TIOCM_CTS: 0) /* 0x020 */ @@ -1822,13 +1814,9 @@ dbg("%s -- %x", __FUNCTION__, result); - if (copy_to_user(value, &result, sizeof(int))) - return -EFAULT; - return 0; + return result; } - - static int get_serial_info(struct edgeport_port *edge_port, struct serial_struct * retinfo) { struct serial_struct tmp; @@ -1885,16 +1873,6 @@ return get_lsr_info(edge_port, (unsigned int *) arg); return 0; - case TIOCMBIS: - case TIOCMBIC: - case TIOCMSET: - dbg("%s (%d) TIOCMSET/TIOCMBIC/TIOCMSET", __FUNCTION__, port->number); - return set_modem_info(edge_port, cmd, (unsigned int *) arg); - - case TIOCMGET: - dbg("%s (%d) TIOCMGET", __FUNCTION__, port->number); - return get_modem_info(edge_port, (unsigned int *) arg); - case TIOCGSERIAL: dbg("%s (%d) TIOCGSERIAL", __FUNCTION__, port->number); return get_serial_info(edge_port, (struct serial_struct *) arg); diff -urN linux-2.5.68-bk5/drivers/usb/serial/io_tables.h linux-2.5.68-bk6/drivers/usb/serial/io_tables.h --- linux-2.5.68-bk5/drivers/usb/serial/io_tables.h 2003-04-19 19:50:06.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/serial/io_tables.h 2003-04-25 04:34:14.000000000 -0700 @@ -114,6 +114,8 @@ .shutdown = edge_shutdown, .ioctl = edge_ioctl, .set_termios = edge_set_termios, + .tiocmget = edge_tiocmget, + .tiocmset = edge_tiocmset, .write = edge_write, .write_room = edge_write_room, .chars_in_buffer = edge_chars_in_buffer, @@ -137,6 +139,8 @@ .shutdown = edge_shutdown, .ioctl = edge_ioctl, .set_termios = edge_set_termios, + .tiocmget = edge_tiocmget, + .tiocmset = edge_tiocmset, .write = edge_write, .write_room = edge_write_room, .chars_in_buffer = edge_chars_in_buffer, @@ -160,6 +164,8 @@ .shutdown = edge_shutdown, .ioctl = edge_ioctl, .set_termios = edge_set_termios, + .tiocmget = edge_tiocmget, + .tiocmset = edge_tiocmset, .write = edge_write, .write_room = edge_write_room, .chars_in_buffer = edge_chars_in_buffer, @@ -183,6 +189,8 @@ .shutdown = edge_shutdown, .ioctl = edge_ioctl, .set_termios = edge_set_termios, + .tiocmget = edge_tiocmget, + .tiocmset = edge_tiocmset, .write = edge_write, .write_room = edge_write_room, .chars_in_buffer = edge_chars_in_buffer, diff -urN linux-2.5.68-bk5/drivers/usb/serial/io_ti.c linux-2.5.68-bk6/drivers/usb/serial/io_ti.c --- linux-2.5.68-bk5/drivers/usb/serial/io_ti.c 2003-04-19 19:51:12.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/serial/io_ti.c 2003-04-25 04:34:14.000000000 -0700 @@ -2403,42 +2403,27 @@ return; } -static int set_modem_info (struct edgeport_port *edge_port, unsigned int cmd, unsigned int *value) +static int edge_tiocmset (struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear) { - unsigned int mcr = edge_port->shadow_mcr; - unsigned int arg; + struct edgeport_port *edge_port = usb_get_serial_port_data(port); + unsigned int mcr; - if (copy_from_user(&arg, value, sizeof(int))) - return -EFAULT; - - switch (cmd) { - case TIOCMBIS: - if (arg & TIOCM_RTS) - mcr |= MCR_RTS; - if (arg & TIOCM_DTR) - mcr |= MCR_RTS; - if (arg & TIOCM_LOOP) - mcr |= MCR_LOOPBACK; - break; + dbg("%s - port %d", __FUNCTION__, port->number); - case TIOCMBIC: - if (arg & TIOCM_RTS) - mcr &= ~MCR_RTS; - if (arg & TIOCM_DTR) - mcr &= ~MCR_RTS; - if (arg & TIOCM_LOOP) - mcr &= ~MCR_LOOPBACK; - break; - - case TIOCMSET: - /* turn off the RTS and DTR and LOOPBACK - * and then only turn on what was asked to */ - mcr &= ~(MCR_RTS | MCR_DTR | MCR_LOOPBACK); - mcr |= ((arg & TIOCM_RTS) ? MCR_RTS : 0); - mcr |= ((arg & TIOCM_DTR) ? MCR_DTR : 0); - mcr |= ((arg & TIOCM_LOOP) ? MCR_LOOPBACK : 0); - break; - } + mcr = edge_port->shadow_mcr; + if (set & TIOCM_RTS) + mcr |= MCR_RTS; + if (set & TIOCM_DTR) + mcr |= MCR_DTR; + if (set & TIOCM_LOOP) + mcr |= MCR_LOOPBACK; + + if (clear & TIOCM_RTS) + mcr &= ~MCR_RTS; + if (clear & TIOCM_DTR) + mcr &= ~MCR_DTR; + if (clear & TIOCM_LOOP) + mcr &= ~MCR_LOOPBACK; edge_port->shadow_mcr = mcr; @@ -2447,12 +2432,17 @@ return 0; } -static int get_modem_info (struct edgeport_port *edge_port, unsigned int *value) +static int edge_tiocmget(struct usb_serial_port *port, struct file *file) { + struct edgeport_port *edge_port = usb_get_serial_port_data(port); unsigned int result = 0; - unsigned int msr = edge_port->shadow_msr; - unsigned int mcr = edge_port->shadow_mcr; + unsigned int msr; + unsigned int mcr; + dbg("%s - port %d", __FUNCTION__, port->number); + + msr = edge_port->shadow_msr; + mcr = edge_port->shadow_mcr; result = ((mcr & MCR_DTR) ? TIOCM_DTR: 0) /* 0x002 */ | ((mcr & MCR_RTS) ? TIOCM_RTS: 0) /* 0x004 */ | ((msr & MSR_CTS) ? TIOCM_CTS: 0) /* 0x020 */ @@ -2463,9 +2453,7 @@ dbg("%s -- %x", __FUNCTION__, result); - if (copy_to_user(value, &result, sizeof(int))) - return -EFAULT; - return 0; + return result; } static int get_serial_info (struct edgeport_port *edge_port, struct serial_struct * retinfo) @@ -2515,18 +2503,6 @@ // return get_lsr_info(edge_port, (unsigned int *) arg); break; - case TIOCMBIS: - case TIOCMBIC: - case TIOCMSET: - dbg("%s - (%d) TIOCMSET/TIOCMBIC/TIOCMSET", __FUNCTION__, port->number); - return set_modem_info(edge_port, cmd, (unsigned int *) arg); - break; - - case TIOCMGET: - dbg("%s - (%d) TIOCMGET", __FUNCTION__, port->number); - return get_modem_info(edge_port, (unsigned int *) arg); - break; - case TIOCGSERIAL: dbg("%s - (%d) TIOCGSERIAL", __FUNCTION__, port->number); return get_serial_info(edge_port, (struct serial_struct *) arg); @@ -2665,6 +2641,8 @@ .shutdown = edge_shutdown, .ioctl = edge_ioctl, .set_termios = edge_set_termios, + .tiocmget = edge_tiocmget, + .tiocmset = edge_tiocmset, .write = edge_write, .write_room = edge_write_room, .chars_in_buffer = edge_chars_in_buffer, @@ -2688,6 +2666,8 @@ .shutdown = edge_shutdown, .ioctl = edge_ioctl, .set_termios = edge_set_termios, + .tiocmget = edge_tiocmget, + .tiocmset = edge_tiocmset, .write = edge_write, .write_room = edge_write_room, .chars_in_buffer = edge_chars_in_buffer, diff -urN linux-2.5.68-bk5/drivers/usb/serial/keyspan.c linux-2.5.68-bk6/drivers/usb/serial/keyspan.c --- linux-2.5.68-bk5/drivers/usb/serial/keyspan.c 2003-04-19 19:48:51.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/serial/keyspan.c 2003-04-25 04:34:14.000000000 -0700 @@ -282,48 +282,46 @@ keyspan_send_setup(port, 0); } -static int keyspan_ioctl(struct usb_serial_port *port, struct file *file, - unsigned int cmd, unsigned long arg) +static int keyspan_tiocmget(struct usb_serial_port *port, struct file *file) { - unsigned int value, set; + unsigned int value; struct keyspan_port_private *p_priv; p_priv = usb_get_serial_port_data(port); - switch (cmd) { - case TIOCMGET: - value = ((p_priv->rts_state) ? TIOCM_RTS : 0) | - ((p_priv->dtr_state) ? TIOCM_DTR : 0) | - ((p_priv->cts_state) ? TIOCM_CTS : 0) | - ((p_priv->dsr_state) ? TIOCM_DSR : 0) | - ((p_priv->dcd_state) ? TIOCM_CAR : 0) | - ((p_priv->ri_state) ? TIOCM_RNG : 0); - - if (put_user(value, (unsigned int *) arg)) - return -EFAULT; - return 0; - - case TIOCMSET: - if (get_user(value, (unsigned int *) arg)) - return -EFAULT; - p_priv->rts_state = ((value & TIOCM_RTS) ? 1 : 0); - p_priv->dtr_state = ((value & TIOCM_DTR) ? 1 : 0); - keyspan_send_setup(port, 0); - return 0; - - case TIOCMBIS: - case TIOCMBIC: - if (get_user(value, (unsigned int *) arg)) - return -EFAULT; - set = (cmd == TIOCMBIS); - if (value & TIOCM_RTS) - p_priv->rts_state = set; - if (value & TIOCM_DTR) - p_priv->dtr_state = set; - keyspan_send_setup(port, 0); - return 0; - } + value = ((p_priv->rts_state) ? TIOCM_RTS : 0) | + ((p_priv->dtr_state) ? TIOCM_DTR : 0) | + ((p_priv->cts_state) ? TIOCM_CTS : 0) | + ((p_priv->dsr_state) ? TIOCM_DSR : 0) | + ((p_priv->dcd_state) ? TIOCM_CAR : 0) | + ((p_priv->ri_state) ? TIOCM_RNG : 0); + + return value; +} + +static int keyspan_tiocmset(struct usb_serial_port *port, struct file *file, + unsigned int set, unsigned int clear) +{ + struct keyspan_port_private *p_priv; + p_priv = usb_get_serial_port_data(port); + + if (set & TIOCM_RTS) + p_priv->rts_state = 1; + if (set & TIOCM_DTR) + p_priv->dtr_state = 1; + + if (clear & TIOCM_RTS) + p_priv->rts_state = 0; + if (clear & TIOCM_DTR) + p_priv->dtr_state = 0; + keyspan_send_setup(port, 0); + return 0; +} + +static int keyspan_ioctl(struct usb_serial_port *port, struct file *file, + unsigned int cmd, unsigned long arg) +{ return -ENOIOCTLCMD; } diff -urN linux-2.5.68-bk5/drivers/usb/serial/keyspan.h linux-2.5.68-bk6/drivers/usb/serial/keyspan.h --- linux-2.5.68-bk5/drivers/usb/serial/keyspan.h 2003-04-19 19:50:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/serial/keyspan.h 2003-04-25 04:34:14.000000000 -0700 @@ -63,6 +63,11 @@ struct termios *old); static void keyspan_break_ctl (struct usb_serial_port *port, int break_state); +static int keyspan_tiocmget (struct usb_serial_port *port, + struct file *file); +static int keyspan_tiocmset (struct usb_serial_port *port, + struct file *file, unsigned int set, + unsigned int clear); static int keyspan_fake_startup (struct usb_serial *serial); static int keyspan_usa19_calc_baud (u32 baud_rate, u32 baudclk, @@ -551,6 +556,8 @@ .ioctl = keyspan_ioctl, .set_termios = keyspan_set_termios, .break_ctl = keyspan_break_ctl, + .tiocmget = keyspan_tiocmget, + .tiocmset = keyspan_tiocmset, .attach = keyspan_startup, .shutdown = keyspan_shutdown, }; @@ -574,6 +581,8 @@ .ioctl = keyspan_ioctl, .set_termios = keyspan_set_termios, .break_ctl = keyspan_break_ctl, + .tiocmget = keyspan_tiocmget, + .tiocmset = keyspan_tiocmset, .attach = keyspan_startup, .shutdown = keyspan_shutdown, }; @@ -597,6 +606,8 @@ .ioctl = keyspan_ioctl, .set_termios = keyspan_set_termios, .break_ctl = keyspan_break_ctl, + .tiocmget = keyspan_tiocmget, + .tiocmset = keyspan_tiocmset, .attach = keyspan_startup, .shutdown = keyspan_shutdown, }; diff -urN linux-2.5.68-bk5/drivers/usb/serial/keyspan_pda.c linux-2.5.68-bk6/drivers/usb/serial/keyspan_pda.c --- linux-2.5.68-bk5/drivers/usb/serial/keyspan_pda.c 2003-04-19 19:50:07.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/serial/keyspan_pda.c 2003-04-25 04:34:14.000000000 -0700 @@ -457,62 +457,54 @@ return rc; } +static int keyspan_pda_tiocmget(struct usb_serial_port *port, struct file *file) +{ + struct usb_serial *serial = port->serial; + int rc; + unsigned char status; + int value; -static int keyspan_pda_ioctl(struct usb_serial_port *port, struct file *file, - unsigned int cmd, unsigned long arg) + rc = keyspan_pda_get_modem_info(serial, &status); + if (rc < 0) + return rc; + value = + ((status & (1<<7)) ? TIOCM_DTR : 0) | + ((status & (1<<6)) ? TIOCM_CAR : 0) | + ((status & (1<<5)) ? TIOCM_RNG : 0) | + ((status & (1<<4)) ? TIOCM_DSR : 0) | + ((status & (1<<3)) ? TIOCM_CTS : 0) | + ((status & (1<<2)) ? TIOCM_RTS : 0); + return value; +} + +static int keyspan_pda_tiocmset(struct usb_serial_port *port, struct file *file, + unsigned int set, unsigned int clear) { struct usb_serial *serial = port->serial; int rc; - unsigned int value; - unsigned char status, mask; + unsigned char status; + rc = keyspan_pda_get_modem_info(serial, &status); + if (rc < 0) + return rc; + + if (set & TIOCM_RTS) + status |= (1<<2); + if (set & TIOCM_DTR) + status |= (1<<7); + + if (clear & TIOCM_RTS) + status &= ~(1<<2); + if (clear & TIOCM_DTR) + status &= ~(1<<7); + rc = keyspan_pda_set_modem_info(serial, status); + return rc; +} + +static int keyspan_pda_ioctl(struct usb_serial_port *port, struct file *file, + unsigned int cmd, unsigned long arg) +{ switch (cmd) { - case TIOCMGET: /* get modem pins state */ - rc = keyspan_pda_get_modem_info(serial, &status); - if (rc < 0) - return rc; - value = - ((status & (1<<7)) ? TIOCM_DTR : 0) | - ((status & (1<<6)) ? TIOCM_CAR : 0) | - ((status & (1<<5)) ? TIOCM_RNG : 0) | - ((status & (1<<4)) ? TIOCM_DSR : 0) | - ((status & (1<<3)) ? TIOCM_CTS : 0) | - ((status & (1<<2)) ? TIOCM_RTS : 0); - if (copy_to_user((unsigned int *)arg, &value, sizeof(int))) - return -EFAULT; - return 0; - case TIOCMSET: /* set a state as returned by MGET */ - if (copy_from_user(&value, (unsigned int *)arg, sizeof(int))) - return -EFAULT; - status = - ((value & TIOCM_DTR) ? (1<<7) : 0) | - ((value & TIOCM_CAR) ? (1<<6) : 0) | - ((value & TIOCM_RNG) ? (1<<5) : 0) | - ((value & TIOCM_DSR) ? (1<<4) : 0) | - ((value & TIOCM_CTS) ? (1<<3) : 0) | - ((value & TIOCM_RTS) ? (1<<2) : 0); - rc = keyspan_pda_set_modem_info(serial, status); - if (rc < 0) - return rc; - return 0; - case TIOCMBIS: /* set bits in bitmask */ - case TIOCMBIC: /* clear bits from bitmask */ - if (copy_from_user(&value, (unsigned int *)arg, sizeof(int))) - return -EFAULT; - rc = keyspan_pda_get_modem_info(serial, &status); - if (rc < 0) - return rc; - mask = - ((value & TIOCM_RTS) ? (1<<2) : 0) | - ((value & TIOCM_DTR) ? (1<<7) : 0); - if (cmd == TIOCMBIS) - status |= mask; - else - status &= ~mask; - rc = keyspan_pda_set_modem_info(serial, status); - if (rc < 0) - return rc; - return 0; case TIOCMIWAIT: /* wait for any of the 4 modem inputs (DCD,RI,DSR,CTS)*/ /* TODO */ @@ -874,6 +866,8 @@ .ioctl = keyspan_pda_ioctl, .set_termios = keyspan_pda_set_termios, .break_ctl = keyspan_pda_break_ctl, + .tiocmget = keyspan_pda_tiocmget, + .tiocmset = keyspan_pda_tiocmset, .attach = keyspan_pda_startup, .shutdown = keyspan_pda_shutdown, }; diff -urN linux-2.5.68-bk5/drivers/usb/serial/kl5kusb105.c linux-2.5.68-bk6/drivers/usb/serial/kl5kusb105.c --- linux-2.5.68-bk5/drivers/usb/serial/kl5kusb105.c 2003-04-19 19:49:56.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/serial/kl5kusb105.c 2003-04-25 04:34:14.000000000 -0700 @@ -105,6 +105,11 @@ static void klsi_105_break_ctl (struct usb_serial_port *port, int break_state ); */ +static int klsi_105_tiocmget (struct usb_serial_port *port, + struct file *file); +static int klsi_105_tiocmset (struct usb_serial_port *port, + struct file *file, unsigned int set, + unsigned int clear); /* * All of the device info needed for the KLSI converters. @@ -143,6 +148,8 @@ .ioctl = klsi_105_ioctl, .set_termios = klsi_105_set_termios, /*.break_ctl = klsi_105_break_ctl,*/ + .tiocmget = klsi_105_tiocmget, + .tiocmset = klsi_105_tiocmset, .attach = klsi_105_startup, .shutdown = klsi_105_shutdown, .throttle = klsi_105_throttle, @@ -879,68 +886,67 @@ } /* mct_u232_break_ctl */ #endif -static int klsi_105_ioctl (struct usb_serial_port *port, struct file * file, - unsigned int cmd, unsigned long arg) +static int klsi_105_tiocmget (struct usb_serial_port *port, struct file *file) { struct usb_serial *serial = port->serial; struct klsi_105_private *priv = usb_get_serial_port_data(port); - int mask; unsigned long flags; + int rc; + unsigned long line_state; + dbg("%s - request, just guessing", __FUNCTION__); + + rc = klsi_105_get_line_state(serial, &line_state); + if (rc < 0) { + err("Reading line control failed (error = %d)", rc); + /* better return value? EAGAIN? */ + return rc; + } + + spin_lock_irqsave (&priv->lock, flags); + priv->line_state = line_state; + spin_unlock_irqrestore (&priv->lock, flags); + dbg("%s - read line state 0x%lx", __FUNCTION__, line_state); + return (int)line_state; +} + +static int klsi_105_tiocmset (struct usb_serial_port *port, struct file *file, + unsigned int set, unsigned int clear) +{ + int retval = -EINVAL; + + dbg("%s", __FUNCTION__); + +/* if this ever gets implemented, it should be done something like this: + struct usb_serial *serial = port->serial; + struct klsi_105_private *priv = usb_get_serial_port_data(port); + unsigned long flags; + int control; + + spin_lock_irqsave (&priv->lock, flags); + if (set & TIOCM_RTS) + priv->control_state |= TIOCM_RTS; + if (set & TIOCM_DTR) + priv->control_state |= TIOCM_DTR; + if (clear & TIOCM_RTS) + priv->control_state &= ~TIOCM_RTS; + if (clear & TIOCM_DTR) + priv->control_state &= ~TIOCM_DTR; + control = priv->control_state; + spin_unlock_irqrestore (&priv->lock, flags); + retval = mct_u232_set_modem_ctrl(serial, control); +*/ + return retval; +} + +static int klsi_105_ioctl (struct usb_serial_port *port, struct file * file, + unsigned int cmd, unsigned long arg) +{ + struct klsi_105_private *priv = usb_get_serial_port_data(port); dbg("%scmd=0x%x", __FUNCTION__, cmd); /* Based on code from acm.c and others */ switch (cmd) { - case TIOCMGET: { - int rc; - unsigned long line_state; - dbg("%s - TIOCMGET request, just guessing", __FUNCTION__); - - rc = klsi_105_get_line_state(serial, &line_state); - if (rc < 0) { - err("Reading line control failed (error = %d)", rc); - /* better return value? EAGAIN? */ - return -ENOIOCTLCMD; - } - spin_lock_irqsave (&priv->lock, flags); - priv->line_state = line_state; - spin_unlock_irqrestore (&priv->lock, flags); - dbg("%s - read line state 0x%lx", __FUNCTION__, line_state); - return put_user(line_state, (unsigned long *) arg); - }; - - case TIOCMSET: /* Turns on and off the lines as specified by the mask */ - case TIOCMBIS: /* turns on (Sets) the lines as specified by the mask */ - case TIOCMBIC: /* turns off (Clears) the lines as specified by the mask */ - if (get_user(mask, (unsigned long *) arg)) - return -EFAULT; - - if ((cmd == TIOCMSET) || (mask & TIOCM_RTS)) { - /* RTS needs set */ - if( ((cmd == TIOCMSET) && (mask & TIOCM_RTS)) || - (cmd == TIOCMBIS) ) - dbg("%s - set RTS not handled", __FUNCTION__); - /* priv->control_state |= TIOCM_RTS; */ - else - dbg("%s - clear RTS not handled", __FUNCTION__); - /* priv->control_state &= ~TIOCM_RTS; */ - } - - if ((cmd == TIOCMSET) || (mask & TIOCM_DTR)) { - /* DTR needs set */ - if( ((cmd == TIOCMSET) && (mask & TIOCM_DTR)) || - (cmd == TIOCMBIS) ) - dbg("%s - set DTR not handled", __FUNCTION__); - /* priv->control_state |= TIOCM_DTR; */ - else - dbg("%s - clear DTR not handled", __FUNCTION__); - /* priv->control_state &= ~TIOCM_DTR; */ - } - /* - mct_u232_set_modem_ctrl(serial, priv->control_state); - */ - break; - case TIOCMIWAIT: /* wait for any of the 4 modem inputs (DCD,RI,DSR,CTS)*/ /* TODO */ diff -urN linux-2.5.68-bk5/drivers/usb/serial/kobil_sct.c linux-2.5.68-bk6/drivers/usb/serial/kobil_sct.c --- linux-2.5.68-bk5/drivers/usb/serial/kobil_sct.c 2003-04-19 19:50:44.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/serial/kobil_sct.c 2003-04-25 04:34:14.000000000 -0700 @@ -81,6 +81,9 @@ static int kobil_write_room(struct usb_serial_port *port); static int kobil_ioctl(struct usb_serial_port *port, struct file *file, unsigned int cmd, unsigned long arg); +static int kobil_tiocmget(struct usb_serial_port *port, struct file *file); +static int kobil_tiocmset(struct usb_serial_port *port, struct file *file, + unsigned int set, unsigned int clear); static void kobil_read_int_callback( struct urb *urb, struct pt_regs *regs ); static void kobil_write_callback( struct urb *purb, struct pt_regs *regs ); @@ -106,6 +109,8 @@ .attach = kobil_startup, .shutdown = kobil_shutdown, .ioctl = kobil_ioctl, + .tiocmget = kobil_tiocmget, + .tiocmset = kobil_tiocmset, .open = kobil_open, .close = kobil_close, .write = kobil_write, @@ -490,11 +495,120 @@ } +static int kobil_tiocmget(struct usb_serial_port *port, struct file *file) +{ + struct kobil_private * priv; + int result; + unsigned char *transfer_buffer; + int transfer_buffer_length = 8; + + priv = usb_get_serial_port_data(port); + if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID) { + // This device doesn't support ioctl calls + return -EINVAL; + } + + // allocate memory for transfer buffer + transfer_buffer = (unsigned char *) kmalloc(transfer_buffer_length, GFP_KERNEL); + if (!transfer_buffer) { + return -ENOMEM; + } + memset(transfer_buffer, 0, transfer_buffer_length); + + result = usb_control_msg( port->serial->dev, + usb_rcvctrlpipe(port->serial->dev, 0 ), + SUSBCRequest_GetStatusLineState, + USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_IN, + 0, + 0, + transfer_buffer, + transfer_buffer_length, + KOBIL_TIMEOUT); + + dbg("%s - port %d Send get_status_line_state URB returns: %i. Statusline: %02x", + __FUNCTION__, port->number, result, transfer_buffer[0]); + + if ((transfer_buffer[0] & SUSBCR_GSL_DSR) != 0) { + priv->line_state |= TIOCM_DSR; + } else { + priv->line_state &= ~TIOCM_DSR; + } + + kfree(transfer_buffer); + return priv->line_state; +} + +static int kobil_tiocmset(struct usb_serial_port *port, struct file *file, + unsigned int set, unsigned int clear) +{ + struct kobil_private * priv; + int result; + int dtr = 0; + int rts = 0; + unsigned char *transfer_buffer; + int transfer_buffer_length = 8; + + priv = usb_get_serial_port_data(port); + if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID) { + // This device doesn't support ioctl calls + return -EINVAL; + } + + // allocate memory for transfer buffer + transfer_buffer = (unsigned char *) kmalloc(transfer_buffer_length, GFP_KERNEL); + if (! transfer_buffer) { + return -ENOMEM; + } + memset(transfer_buffer, 0, transfer_buffer_length); + + if (set & TIOCM_RTS) + rts = 1; + if (set & TIOCM_DTR) + dtr = 1; + if (clear & TIOCM_RTS) + rts = 0; + if (clear & TIOCM_DTR) + dtr = 0; + + if (priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID) { + if (dtr != 0) + dbg("%s - port %d Setting DTR", __FUNCTION__, port->number); + else + dbg("%s - port %d Clearing DTR", __FUNCTION__, port->number); + result = usb_control_msg( port->serial->dev, + usb_rcvctrlpipe(port->serial->dev, 0 ), + SUSBCRequest_SetStatusLinesOrQueues, + USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT, + ((dtr != 0) ? SUSBCR_SSL_SETDTR : SUSBCR_SSL_CLRDTR), + 0, + transfer_buffer, + 0, + KOBIL_TIMEOUT); + } else { + if (rts != 0) + dbg("%s - port %d Setting RTS", __FUNCTION__, port->number); + else + dbg("%s - port %d Clearing RTS", __FUNCTION__, port->number); + result = usb_control_msg( port->serial->dev, + usb_rcvctrlpipe(port->serial->dev, 0 ), + SUSBCRequest_SetStatusLinesOrQueues, + USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT, + ((rts != 0) ? SUSBCR_SSL_SETRTS : SUSBCR_SSL_CLRRTS), + 0, + transfer_buffer, + 0, + KOBIL_TIMEOUT); + } + dbg("%s - port %d Send set_status_line URB returns: %i", __FUNCTION__, port->number, result); + kfree(transfer_buffer); + return (result < 0) ? result : 0; +} + + static int kobil_ioctl(struct usb_serial_port *port, struct file *file, unsigned int cmd, unsigned long arg) { struct kobil_private * priv; - int mask; int result; unsigned short urb_val = 0; unsigned char *transfer_buffer; @@ -605,90 +719,8 @@ kfree(transfer_buffer); return ((result < 0) ? -EFAULT : 0); - case TIOCMGET: // 0x5415 - // allocate memory for transfer buffer - transfer_buffer = (unsigned char *) kmalloc(transfer_buffer_length, GFP_KERNEL); - if (! transfer_buffer) { - return -ENOBUFS; - } else { - memset(transfer_buffer, 0, transfer_buffer_length); - } - - result = usb_control_msg( port->serial->dev, - usb_rcvctrlpipe(port->serial->dev, 0 ), - SUSBCRequest_GetStatusLineState, - USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_IN, - 0, - 0, - transfer_buffer, - transfer_buffer_length, - KOBIL_TIMEOUT - ); - - dbg("%s - port %d Send get_status_line_state (TIOCMGET) URB returns: %i. Statusline: %02x", - __FUNCTION__, port->number, result, transfer_buffer[0]); - - if ((transfer_buffer[0] & SUSBCR_GSL_DSR) != 0) { - priv->line_state |= TIOCM_DSR; - } else { - priv->line_state &= ~TIOCM_DSR; - } - - kfree(transfer_buffer); - return put_user(priv->line_state, (unsigned long *) arg); - - case TIOCMSET: // 0x5418 - if (get_user(mask, (unsigned long *) arg)){ - return -EFAULT; - } - // allocate memory for transfer buffer - transfer_buffer = (unsigned char *) kmalloc(transfer_buffer_length, GFP_KERNEL); - if (! transfer_buffer) { - return -ENOBUFS; - } else { - memset(transfer_buffer, 0, transfer_buffer_length); - } - - if (priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID) { - if ((mask & TIOCM_DTR) != 0){ - dbg("%s - port %d Setting DTR", __FUNCTION__, port->number); - } else { - dbg("%s - port %d Clearing DTR", __FUNCTION__, port->number); - } - result = usb_control_msg( port->serial->dev, - usb_rcvctrlpipe(port->serial->dev, 0 ), - SUSBCRequest_SetStatusLinesOrQueues, - USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT, - ( ((mask & TIOCM_DTR) != 0) ? SUSBCR_SSL_SETDTR : SUSBCR_SSL_CLRDTR), - 0, - transfer_buffer, - 0, - KOBIL_TIMEOUT - ); - - } else { - if ((mask & TIOCM_RTS) != 0){ - dbg("%s - port %d Setting RTS", __FUNCTION__, port->number); - } else { - dbg("%s - port %d Clearing RTS", __FUNCTION__, port->number); - } - result = usb_control_msg( port->serial->dev, - usb_rcvctrlpipe(port->serial->dev, 0 ), - SUSBCRequest_SetStatusLinesOrQueues, - USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT, - (((mask & TIOCM_RTS) != 0) ? SUSBCR_SSL_SETRTS : SUSBCR_SSL_CLRRTS), - 0, - transfer_buffer, - 0, - KOBIL_TIMEOUT - ); - } - dbg("%s - port %d Send set_status_line (TIOCMSET) URB returns: %i", __FUNCTION__, port->number, result); - - kfree(transfer_buffer); - return ((result < 0) ? -EFAULT : 0); } - return 0; + return -ENOIOCTLCMD; } diff -urN linux-2.5.68-bk5/drivers/usb/serial/mct_u232.c linux-2.5.68-bk6/drivers/usb/serial/mct_u232.c --- linux-2.5.68-bk5/drivers/usb/serial/mct_u232.c 2003-04-19 19:50:07.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/serial/mct_u232.c 2003-04-25 04:34:14.000000000 -0700 @@ -125,7 +125,11 @@ unsigned long arg); static void mct_u232_break_ctl (struct usb_serial_port *port, int break_state ); - +static int mct_u232_tiocmget (struct usb_serial_port *port, + struct file *file); +static int mct_u232_tiocmset (struct usb_serial_port *port, + struct file *file, unsigned int set, + unsigned int clear); /* * All of the device info needed for the MCT USB-RS232 converter. */ @@ -165,6 +169,8 @@ .ioctl = mct_u232_ioctl, .set_termios = mct_u232_set_termios, .break_ctl = mct_u232_break_ctl, + .tiocmget = mct_u232_tiocmget, + .tiocmset = mct_u232_tiocmset, .attach = mct_u232_startup, .shutdown = mct_u232_shutdown, }; @@ -773,57 +779,55 @@ } /* mct_u232_break_ctl */ -static int mct_u232_ioctl (struct usb_serial_port *port, struct file * file, - unsigned int cmd, unsigned long arg) +static int mct_u232_tiocmget (struct usb_serial_port *port, struct file *file) +{ + struct mct_u232_private *priv = usb_get_serial_port_data(port); + unsigned long control_state; + unsigned long flags; + + dbg("%s", __FUNCTION__); + + spin_lock_irqsave(&priv->lock, flags); + control_state = priv->control_state; + spin_unlock_irqrestore(&priv->lock, flags); + + return control_state; +} + +static int mct_u232_tiocmset (struct usb_serial_port *port, struct file *file, + unsigned int set, unsigned int clear) { struct usb_serial *serial = port->serial; struct mct_u232_private *priv = usb_get_serial_port_data(port); - int mask; unsigned long control_state; unsigned long flags; - dbg("%scmd=0x%x", __FUNCTION__, cmd); + dbg("%s", __FUNCTION__); spin_lock_irqsave(&priv->lock, flags); control_state = priv->control_state; + + if (set & TIOCM_RTS) + control_state |= TIOCM_RTS; + if (set & TIOCM_DTR) + control_state |= TIOCM_DTR; + if (clear & TIOCM_RTS) + control_state &= ~TIOCM_RTS; + if (clear & TIOCM_DTR) + control_state &= ~TIOCM_DTR; + + priv->control_state = control_state; spin_unlock_irqrestore(&priv->lock, flags); + return mct_u232_set_modem_ctrl(serial, control_state); +} + +static int mct_u232_ioctl (struct usb_serial_port *port, struct file * file, + unsigned int cmd, unsigned long arg) +{ + dbg("%scmd=0x%x", __FUNCTION__, cmd); /* Based on code from acm.c and others */ switch (cmd) { - case TIOCMGET: - return put_user(control_state, (unsigned long *) arg); - break; - - case TIOCMSET: /* Turns on and off the lines as specified by the mask */ - case TIOCMBIS: /* turns on (Sets) the lines as specified by the mask */ - case TIOCMBIC: /* turns off (Clears) the lines as specified by the mask */ - if (get_user(mask, (unsigned long *) arg)) - return -EFAULT; - - if ((cmd == TIOCMSET) || (mask & TIOCM_RTS)) { - /* RTS needs set */ - if( ((cmd == TIOCMSET) && (mask & TIOCM_RTS)) || - (cmd == TIOCMBIS) ) - control_state |= TIOCM_RTS; - else - control_state &= ~TIOCM_RTS; - } - - if ((cmd == TIOCMSET) || (mask & TIOCM_DTR)) { - /* DTR needs set */ - if( ((cmd == TIOCMSET) && (mask & TIOCM_DTR)) || - (cmd == TIOCMBIS) ) - control_state |= TIOCM_DTR; - else - control_state &= ~TIOCM_DTR; - } - mct_u232_set_modem_ctrl(serial, control_state); - - spin_lock_irqsave(&priv->lock, flags); - priv->control_state = control_state; - spin_unlock_irqrestore(&priv->lock, flags); - break; - case TIOCMIWAIT: /* wait for any of the 4 modem inputs (DCD,RI,DSR,CTS)*/ /* TODO */ diff -urN linux-2.5.68-bk5/drivers/usb/serial/pl2303.c linux-2.5.68-bk6/drivers/usb/serial/pl2303.c --- linux-2.5.68-bk5/drivers/usb/serial/pl2303.c 2003-04-19 19:49:25.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/serial/pl2303.c 2003-04-25 04:34:14.000000000 -0700 @@ -1,7 +1,8 @@ /* * Prolific PL2303 USB to serial adaptor driver * - * Copyright (C) 2001-2002 Greg Kroah-Hartman (greg@kroah.com) + * Copyright (C) 2001-2003 Greg Kroah-Hartman (greg@kroah.com) + * Copyright (C) 2003 IBM Corp. * * Original driver for 2.2.x by anonymous * @@ -111,6 +112,16 @@ #define VENDOR_READ_REQUEST_TYPE 0xc0 #define VENDOR_READ_REQUEST 0x01 +#define UART_STATE 0x08 +#define UART_DCD 0x01 +#define UART_DSR 0x02 +#define UART_BREAK_ERROR 0x04 +#define UART_RING 0x08 +#define UART_FRAME_ERROR 0x10 +#define UART_PARITY_ERROR 0x20 +#define UART_OVERRUN_ERROR 0x40 +#define UART_CTS 0x80 + /* function prototypes for a PL2303 serial converter */ static int pl2303_open (struct usb_serial_port *port, struct file *filp); static void pl2303_close (struct usb_serial_port *port, struct file *filp); @@ -124,6 +135,9 @@ static int pl2303_write (struct usb_serial_port *port, int from_user, const unsigned char *buf, int count); static void pl2303_break_ctl(struct usb_serial_port *port,int break_state); +static int pl2303_tiocmget (struct usb_serial_port *port, struct file *file); +static int pl2303_tiocmset (struct usb_serial_port *port, struct file *file, + unsigned int set, unsigned int clear); static int pl2303_startup (struct usb_serial *serial); static void pl2303_shutdown (struct usb_serial *serial); @@ -143,6 +157,8 @@ .ioctl = pl2303_ioctl, .break_ctl = pl2303_break_ctl, .set_termios = pl2303_set_termios, + .tiocmget = pl2303_tiocmget, + .tiocmset = pl2303_tiocmset, .read_bulk_callback = pl2303_read_bulk_callback, .read_int_callback = pl2303_read_int_callback, .write_bulk_callback = pl2303_write_bulk_callback, @@ -153,6 +169,7 @@ struct pl2303_private { spinlock_t lock; u8 line_control; + u8 line_status; u8 termios_initialized; }; @@ -222,6 +239,7 @@ { struct usb_serial *serial = port->serial; struct pl2303_private *priv = usb_get_serial_port_data(port); + unsigned long flags; unsigned int cflag; unsigned char *buf; int baud; @@ -234,13 +252,13 @@ return; } - spin_lock(&priv->lock); + spin_lock_irqsave(&priv->lock, flags); if (!priv->termios_initialized) { *(port->tty->termios) = tty_std_termios; port->tty->termios->c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL; priv->termios_initialized = 1; } - spin_unlock(&priv->lock); + spin_unlock_irqrestore(&priv->lock, flags); cflag = port->tty->termios->c_cflag; /* check that they really want us to change something */ @@ -350,13 +368,13 @@ if (cflag && CBAUD) { u8 control; - spin_lock (&priv->lock); + spin_lock_irqsave(&priv->lock, flags); if ((cflag && CBAUD) == B0) priv->line_control &= ~(CONTROL_DTR | CONTROL_RTS); else priv->line_control |= (CONTROL_DTR | CONTROL_RTS); control = priv->line_control; - spin_unlock (&priv->lock); + spin_unlock_irqrestore(&priv->lock, flags); set_control_lines (serial->dev, control); } @@ -445,6 +463,7 @@ { struct usb_serial *serial; struct pl2303_private *priv; + unsigned long flags; unsigned int c_cflag; int result; @@ -481,72 +500,56 @@ if (c_cflag & HUPCL) { /* drop DTR and RTS */ priv = usb_get_serial_port_data(port); - spin_lock (&priv->lock); + spin_lock_irqsave(&priv->lock, flags); priv->line_control = 0; - spin_unlock (&priv->lock); + spin_unlock_irqrestore (&priv->lock, flags); set_control_lines (port->serial->dev, 0); } } } -static int set_modem_info (struct usb_serial_port *port, unsigned int cmd, unsigned int *value) +static int pl2303_tiocmset (struct usb_serial_port *port, struct file *file, + unsigned int set, unsigned int clear) { struct pl2303_private *priv = usb_get_serial_port_data(port); - unsigned int arg; + unsigned long flags; u8 control; - if (copy_from_user(&arg, value, sizeof(int))) - return -EFAULT; - - spin_lock (&priv->lock); - switch (cmd) { - case TIOCMBIS: - if (arg & TIOCM_RTS) - priv->line_control |= CONTROL_RTS; - if (arg & TIOCM_DTR) - priv->line_control |= CONTROL_DTR; - break; - - case TIOCMBIC: - if (arg & TIOCM_RTS) - priv->line_control &= ~CONTROL_RTS; - if (arg & TIOCM_DTR) - priv->line_control &= ~CONTROL_DTR; - break; - - case TIOCMSET: - /* turn off RTS and DTR and then only turn - on what was asked to */ - priv->line_control &= ~(CONTROL_RTS | CONTROL_DTR); - priv->line_control |= ((arg & TIOCM_RTS) ? CONTROL_RTS : 0); - priv->line_control |= ((arg & TIOCM_DTR) ? CONTROL_DTR : 0); - break; - } + spin_lock_irqsave (&priv->lock, flags); + if (set & TIOCM_RTS) + priv->line_control |= CONTROL_RTS; + if (set & TIOCM_DTR) + priv->line_control |= CONTROL_DTR; + if (clear & TIOCM_RTS) + priv->line_control &= ~CONTROL_RTS; + if (clear & TIOCM_DTR) + priv->line_control &= ~CONTROL_DTR; control = priv->line_control; - spin_unlock (&priv->lock); + spin_unlock_irqrestore (&priv->lock, flags); return set_control_lines (port->serial->dev, control); } -static int get_modem_info (struct usb_serial_port *port, unsigned int *value) +static int pl2303_tiocmget (struct usb_serial_port *port, struct file *file) { struct pl2303_private *priv = usb_get_serial_port_data(port); + unsigned long flags; unsigned int mcr; unsigned int result; - spin_lock (&priv->lock); + dbg("%s (%d)", __FUNCTION__, port->number); + + spin_lock_irqsave (&priv->lock, flags); mcr = priv->line_control; - spin_unlock (&priv->lock); + spin_unlock_irqrestore (&priv->lock, flags); result = ((mcr & CONTROL_DTR) ? TIOCM_DTR : 0) | ((mcr & CONTROL_RTS) ? TIOCM_RTS : 0); dbg("%s - result = %x", __FUNCTION__, result); - if (copy_to_user(value, &result, sizeof(int))) - return -EFAULT; - return 0; + return result; } static int pl2303_ioctl (struct usb_serial_port *port, struct file *file, unsigned int cmd, unsigned long arg) @@ -554,17 +557,6 @@ dbg("%s (%d) cmd = 0x%04x", __FUNCTION__, port->number, cmd); switch (cmd) { - - case TIOCMGET: - dbg("%s (%d) TIOCMGET", __FUNCTION__, port->number); - return get_modem_info (port, (unsigned int *)arg); - - case TIOCMBIS: - case TIOCMBIC: - case TIOCMSET: - dbg("%s (%d) TIOCMSET/TIOCMBIC/TIOCMSET", __FUNCTION__, port->number); - return set_modem_info(port, cmd, (unsigned int *) arg); - default: dbg("%s not supported = 0x%04x", __FUNCTION__, cmd); break; @@ -573,7 +565,6 @@ return -ENOIOCTLCMD; } - static void pl2303_break_ctl (struct usb_serial_port *port, int break_state) { struct usb_serial *serial = port->serial; @@ -613,9 +604,13 @@ { struct usb_serial_port *port = (struct usb_serial_port *) urb->context; struct usb_serial *serial = get_usb_serial (port, __FUNCTION__); - //unsigned char *data = urb->transfer_buffer; + struct pl2303_private *priv = usb_get_serial_port_data(port); + unsigned char *data = urb->transfer_buffer; + unsigned long flags; int status; + dbg("%s (%d)", __FUNCTION__, port->number); + switch (urb->status) { case 0: /* success */ @@ -637,8 +632,14 @@ usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, urb->transfer_buffer); - //FIXME need to update state of terminal lines variable + if (urb->actual_length > UART_STATE) + goto exit; + /* Save off the uart status for others to look at */ + spin_lock_irqsave(&priv->lock, flags); + priv->line_status = data[UART_STATE]; + spin_unlock_irqrestore(&priv->lock, flags); + exit: status = usb_submit_urb (urb, GFP_ATOMIC); if (status) @@ -651,10 +652,14 @@ { struct usb_serial_port *port = (struct usb_serial_port *) urb->context; struct usb_serial *serial = get_usb_serial (port, __FUNCTION__); + struct pl2303_private *priv = usb_get_serial_port_data(port); struct tty_struct *tty; unsigned char *data = urb->transfer_buffer; + unsigned long flags; int i; int result; + u8 status; + char tty_flag; if (port_paranoia_check (port, __FUNCTION__)) return; @@ -688,13 +693,34 @@ usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data); + /* get tty_flag from status */ + tty_flag = TTY_NORMAL; + + spin_lock_irqsave(&priv->lock, flags); + status = priv->line_status; + spin_unlock_irqrestore(&priv->lock, flags); + + /* break takes precedence over parity, */ + /* which takes precedence over framing errors */ + if (status & UART_BREAK_ERROR ) + tty_flag = TTY_BREAK; + else if (status & UART_PARITY_ERROR) + tty_flag = TTY_PARITY; + else if (status & UART_FRAME_ERROR) + tty_flag = TTY_FRAME; + dbg("%s - tty_flag = %d", __FUNCTION__, tty_flag); + tty = port->tty; if (tty && urb->actual_length) { + /* overrun is special, not associated with a char */ + if (status & UART_OVERRUN_ERROR) + tty_insert_flip_char(tty, 0, TTY_OVERRUN); + for (i = 0; i < urb->actual_length; ++i) { if (tty->flip.count >= TTY_FLIPBUF_SIZE) { tty_flip_buffer_push(tty); } - tty_insert_flip_char (tty, data[i], 0); + tty_insert_flip_char (tty, data[i], tty_flag); } tty_flip_buffer_push (tty); } diff -urN linux-2.5.68-bk5/drivers/usb/serial/usb-serial.c linux-2.5.68-bk6/drivers/usb/serial/usb-serial.c --- linux-2.5.68-bk5/drivers/usb/serial/usb-serial.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/serial/usb-serial.c 2003-04-25 04:34:14.000000000 -0700 @@ -785,6 +785,51 @@ return ((count < begin+length-off) ? count : begin+length-off); } +static int serial_tiocmget (struct tty_struct *tty, struct file *file) +{ + struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data; + struct usb_serial *serial = get_usb_serial (port, __FUNCTION__); + + if (!serial) + goto exit; + + dbg("%s - port %d", __FUNCTION__, port->number); + + if (!port->open_count) { + dbg("%s - port not open", __FUNCTION__); + goto exit; + } + + if (serial->type->tiocmget) + return serial->type->tiocmget(port, file); + +exit: + return -EINVAL; +} + +static int serial_tiocmset (struct tty_struct *tty, struct file *file, + unsigned int set, unsigned int clear) +{ + struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data; + struct usb_serial *serial = get_usb_serial (port, __FUNCTION__); + + if (!serial) + goto exit; + + dbg("%s - port %d", __FUNCTION__, port->number); + + if (!port->open_count) { + dbg("%s - port not open", __FUNCTION__); + goto exit; + } + + if (serial->type->tiocmset) + return serial->type->tiocmset(port, file, set, clear); + +exit: + return -EINVAL; +} + void usb_serial_port_softint(void *private) { struct usb_serial_port *port = (struct usb_serial_port *)private; @@ -1286,6 +1331,8 @@ .break_ctl = serial_break, .chars_in_buffer = serial_chars_in_buffer, .read_proc = serial_read_proc, + .tiocmget = serial_tiocmget, + .tiocmset = serial_tiocmset, }; diff -urN linux-2.5.68-bk5/drivers/usb/serial/usb-serial.h linux-2.5.68-bk6/drivers/usb/serial/usb-serial.h --- linux-2.5.68-bk5/drivers/usb/serial/usb-serial.h 2003-04-19 19:51:23.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/serial/usb-serial.h 2003-04-25 04:34:14.000000000 -0700 @@ -251,6 +251,8 @@ int (*chars_in_buffer) (struct usb_serial_port *port); void (*throttle) (struct usb_serial_port *port); void (*unthrottle) (struct usb_serial_port *port); + int (*tiocmget) (struct usb_serial_port *port, struct file *file); + int (*tiocmset) (struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear); void (*read_int_callback)(struct urb *urb, struct pt_regs *regs); void (*read_bulk_callback)(struct urb *urb, struct pt_regs *regs); diff -urN linux-2.5.68-bk5/drivers/usb/serial/whiteheat.c linux-2.5.68-bk6/drivers/usb/serial/whiteheat.c --- linux-2.5.68-bk5/drivers/usb/serial/whiteheat.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/usb/serial/whiteheat.c 2003-04-25 04:34:14.000000000 -0700 @@ -146,6 +146,8 @@ static int whiteheat_write_room (struct usb_serial_port *port); static int whiteheat_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg); static void whiteheat_set_termios (struct usb_serial_port *port, struct termios * old); +static int whiteheat_tiocmget (struct usb_serial_port *port, struct file *file); +static int whiteheat_tiocmset (struct usb_serial_port *port, struct file *file, unsigned int set, unsigned int clear); static void whiteheat_break_ctl (struct usb_serial_port *port, int break_state); static int whiteheat_chars_in_buffer (struct usb_serial_port *port); static void whiteheat_throttle (struct usb_serial_port *port); @@ -184,6 +186,8 @@ .ioctl = whiteheat_ioctl, .set_termios = whiteheat_set_termios, .break_ctl = whiteheat_break_ctl, + .tiocmget = whiteheat_tiocmget, + .tiocmset = whiteheat_tiocmset, .chars_in_buffer = whiteheat_chars_in_buffer, .throttle = whiteheat_throttle, .unthrottle = whiteheat_unthrottle, @@ -767,73 +771,53 @@ } -static int whiteheat_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg) +static int whiteheat_tiocmget (struct usb_serial_port *port, struct file *file) { struct whiteheat_private *info = usb_get_serial_port_data(port); unsigned int modem_signals = 0; - struct serial_struct serstruct; - - dbg("%s - port %d, cmd 0x%.4x", __FUNCTION__, port->number, cmd); - - switch (cmd) { - case TIOCMGET: - firm_get_dtr_rts(port); - if (info->mcr & UART_MCR_DTR) - modem_signals |= TIOCM_DTR; - if (info->mcr & UART_MCR_RTS) - modem_signals |= TIOCM_RTS; - - if (copy_to_user((unsigned int *)arg, &modem_signals, sizeof(unsigned int))) - return -EFAULT; - - break; - - case TIOCMSET: - if (copy_from_user(&modem_signals, (unsigned int *)arg, sizeof(unsigned int))) - return -EFAULT; - if (modem_signals & TIOCM_DTR) - info->mcr |= UART_MCR_DTR; - else - info->mcr &= ~UART_MCR_DTR; - if (modem_signals & TIOCM_RTS) - info->mcr |= UART_MCR_RTS; - else - info->mcr &= ~UART_MCR_RTS; + dbg("%s - port %d", __FUNCTION__, port->number); - firm_set_dtr(port, info->mcr & UART_MCR_DTR); - firm_set_rts(port, info->mcr & UART_MCR_RTS); + firm_get_dtr_rts(port); + if (info->mcr & UART_MCR_DTR) + modem_signals |= TIOCM_DTR; + if (info->mcr & UART_MCR_RTS) + modem_signals |= TIOCM_RTS; - break; + return modem_signals; +} - case TIOCMBIS: - if (copy_from_user(&modem_signals, (unsigned int *)arg, sizeof(unsigned int))) - return -EFAULT; - if (modem_signals & TIOCM_DTR) - info->mcr |= UART_MCR_DTR; - if (modem_signals & TIOCM_RTS) - info->mcr |= UART_MCR_RTS; +static int whiteheat_tiocmset (struct usb_serial_port *port, struct file *file, + unsigned int set, unsigned int clear) +{ + struct whiteheat_private *info = usb_get_serial_port_data(port); - firm_set_dtr(port, info->mcr & UART_MCR_DTR); - firm_set_rts(port, info->mcr & UART_MCR_RTS); + dbg("%s - port %d", __FUNCTION__, port->number); - break; + if (set & TIOCM_RTS) + info->mcr |= UART_MCR_RTS; + if (set & TIOCM_DTR) + info->mcr |= UART_MCR_DTR; + + if (clear & TIOCM_RTS) + info->mcr &= ~UART_MCR_RTS; + if (clear & TIOCM_DTR) + info->mcr &= ~UART_MCR_DTR; - case TIOCMBIC: - if (copy_from_user(&modem_signals, (unsigned int *)arg, sizeof(unsigned int))) - return -EFAULT; + firm_set_dtr(port, info->mcr & UART_MCR_DTR); + firm_set_rts(port, info->mcr & UART_MCR_RTS); + return 0; +} - if (modem_signals & TIOCM_DTR) - info->mcr &= ~UART_MCR_DTR; - if (modem_signals & TIOCM_RTS) - info->mcr &= ~UART_MCR_RTS; - firm_set_dtr(port, info->mcr & UART_MCR_DTR); - firm_set_rts(port, info->mcr & UART_MCR_RTS); +static int whiteheat_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg) +{ + struct serial_struct serstruct; - break; + dbg("%s - port %d, cmd 0x%.4x", __FUNCTION__, port->number, cmd); + switch (cmd) { case TIOCGSERIAL: memset(&serstruct, 0, sizeof(serstruct)); serstruct.type = PORT_16654; @@ -864,10 +848,10 @@ break; default: - return -ENOIOCTLCMD; + break; } - return 0; + return -ENOIOCTLCMD; } diff -urN linux-2.5.68-bk5/drivers/video/S3triofb.c linux-2.5.68-bk6/drivers/video/S3triofb.c --- linux-2.5.68-bk5/drivers/video/S3triofb.c 2003-04-19 19:51:13.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/S3triofb.c 2003-04-25 04:34:14.000000000 -0700 @@ -520,7 +520,6 @@ strcpy(fb_info.modename, "Trio64 "); strncat(fb_info.modename, dp->full_name, sizeof(fb_info.modename)); - fb_info.node = NODEV; fb_info.currcon = -1; fb_info.fbops = &s3trio_ops; fb_info.screen_base = s3trio_base; @@ -542,7 +541,7 @@ return; printk("fb%d: S3 Trio frame buffer device on %s\n", - minor(fb_info.node), dp->full_name); + fb_info.node, dp->full_name); } diff -urN linux-2.5.68-bk5/drivers/video/acornfb.c linux-2.5.68-bk6/drivers/video/acornfb.c --- linux-2.5.68-bk5/drivers/video/acornfb.c 2003-04-19 19:51:12.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/acornfb.c 2003-04-25 04:34:14.000000000 -0700 @@ -979,7 +979,6 @@ return; first = 0; - fb_info.node = NODEV; fb_info.fbops = &acornfb_ops; fb_info.flags = FBINFO_FLAG_DEFAULT; diff -urN linux-2.5.68-bk5/drivers/video/amifb.c linux-2.5.68-bk6/drivers/video/amifb.c --- linux-2.5.68-bk5/drivers/video/amifb.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/amifb.c 2003-04-25 04:34:14.000000000 -0700 @@ -2385,7 +2385,6 @@ fb_info.monspecs.vfmax = 90; } - fb_info.node = NODEV; fb_info.fbops = &amifb_ops; fb_info.par = ¤tpar; fb_info.flags = FBINFO_FLAG_DEFAULT; @@ -2453,7 +2452,7 @@ } printk("fb%d: %s frame buffer device, using %dK of video memory\n", - minor(fb_info.node), fb_info.fix.id, fb_info.fix.smem_len>>10); + fb_info.node, fb_info.fix.id, fb_info.fix.smem_len>>10); return 0; diff -urN linux-2.5.68-bk5/drivers/video/anakinfb.c linux-2.5.68-bk6/drivers/video/anakinfb.c --- linux-2.5.68-bk5/drivers/video/anakinfb.c 2003-04-19 19:50:00.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/anakinfb.c 2003-04-25 04:34:14.000000000 -0700 @@ -73,7 +73,6 @@ { memset(&fb_info, 0, sizeof(struct fb_info)); - fb_info.node = NODEV; fb_info.flags = FBINFO_FLAG_DEFAULT; fb_info.fbops = &anakinfb_ops; fb_info.var = anakinfb_var; diff -urN linux-2.5.68-bk5/drivers/video/atafb.c linux-2.5.68-bk6/drivers/video/atafb.c --- linux-2.5.68-bk5/drivers/video/atafb.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/atafb.c 2003-04-25 04:34:14.000000000 -0700 @@ -2793,7 +2793,6 @@ strcpy(fb_info.modename, "Atari Builtin "); fb_info.changevar = NULL; - fb_info.node = NODEV; fb_info.fbops = &atafb_ops; fb_info.disp = &disp; fb_info.currcon = -1; @@ -2817,7 +2816,7 @@ printk(" virtual %dx%d\n", disp.var.xres_virtual, disp.var.yres_virtual); printk("fb%d: %s frame buffer device, using %dK of video memory\n", - minor(fb_info.node), fb_info.modename, screen_len>>10); + fb_info.node, fb_info.modename, screen_len>>10); /* TODO: This driver cannot be unloaded yet */ MOD_INC_USE_COUNT; diff -urN linux-2.5.68-bk5/drivers/video/aty/aty128fb.c linux-2.5.68-bk6/drivers/video/aty/aty128fb.c --- linux-2.5.68-bk5/drivers/video/aty/aty128fb.c 2003-04-19 19:49:26.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/aty/aty128fb.c 2003-04-25 04:34:14.000000000 -0700 @@ -1534,7 +1534,6 @@ par->chip_gen = ent->driver_data; /* fill in info */ - info->node = NODEV; info->fbops = &aty128fb_ops; info->flags = FBINFO_FLAG_DEFAULT; @@ -1635,7 +1634,7 @@ #endif printk(KERN_INFO "fb%d: %s frame buffer device on %s\n", - minor(info->node), info->fix.id, video_card); + info->node, info->fix.id, video_card); return 1; /* success! */ } diff -urN linux-2.5.68-bk5/drivers/video/aty/atyfb_base.c linux-2.5.68-bk6/drivers/video/aty/atyfb_base.c --- linux-2.5.68-bk5/drivers/video/aty/atyfb_base.c 2003-04-19 19:50:11.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/aty/atyfb_base.c 2003-04-25 04:34:14.000000000 -0700 @@ -1747,7 +1747,6 @@ fb_memset((void *) info->screen_base, 0, info->fix.smem_len); - info->node = NODEV; info->fbops = &atyfb_ops; info->pseudo_palette = pseudo_palette; info->flags = FBINFO_FLAG_DEFAULT; @@ -1861,7 +1860,7 @@ fb_list = info; printk("fb%d: %s frame buffer device on %s\n", - minor(info->node), info->fix.id, name); + info->node, info->fix.id, name); return 1; } diff -urN linux-2.5.68-bk5/drivers/video/bw2.c linux-2.5.68-bk6/drivers/video/bw2.c --- linux-2.5.68-bk5/drivers/video/bw2.c 2003-04-19 19:50:00.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/bw2.c 2003-04-25 04:34:14.000000000 -0700 @@ -346,7 +346,6 @@ all->par.fbsize = PAGE_ALIGN(linebytes * all->info.var.yres); - all->info.node = NODEV; all->info.flags = FBINFO_FLAG_DEFAULT; all->info.fbops = &bw2_ops; #if defined(CONFIG_SPARC32) diff -urN linux-2.5.68-bk5/drivers/video/cg14.c linux-2.5.68-bk6/drivers/video/cg14.c --- linux-2.5.68-bk5/drivers/video/cg14.c 2003-04-19 19:51:12.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/cg14.c 2003-04-25 04:34:14.000000000 -0700 @@ -473,7 +473,6 @@ all->par.mode = MDI_8_PIX; all->par.ramsize = (is_8mb ? 0x800000 : 0x400000); - all->info.node = NODEV; all->info.flags = FBINFO_FLAG_DEFAULT; all->info.fbops = &cg14_ops; all->info.currcon = -1; diff -urN linux-2.5.68-bk5/drivers/video/cg3.c linux-2.5.68-bk6/drivers/video/cg3.c --- linux-2.5.68-bk5/drivers/video/cg3.c 2003-04-19 19:50:06.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/cg3.c 2003-04-25 04:34:14.000000000 -0700 @@ -395,7 +395,6 @@ sbus_ioremap(&sdev->resource[0], CG3_REGS_OFFSET, sizeof(struct cg3_regs), "cg3 regs"); - all->info.node = NODEV; all->info.flags = FBINFO_FLAG_DEFAULT; all->info.fbops = &cg3_ops; #ifdef CONFIG_SPARC32 diff -urN linux-2.5.68-bk5/drivers/video/cg6.c linux-2.5.68-bk6/drivers/video/cg6.c --- linux-2.5.68-bk5/drivers/video/cg6.c 2003-04-19 19:48:56.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/cg6.c 2003-04-25 04:34:14.000000000 -0700 @@ -680,7 +680,6 @@ sbus_ioremap(&sdev->resource[0], CG6_FHC_OFFSET, sizeof(u32), "cgsix fhc"); - all->info.node = NODEV; all->info.flags = FBINFO_FLAG_DEFAULT; all->info.fbops = &cg6_ops; #ifdef CONFIG_SPARC32 diff -urN linux-2.5.68-bk5/drivers/video/chipsfb.c linux-2.5.68-bk6/drivers/video/chipsfb.c --- linux-2.5.68-bk5/drivers/video/chipsfb.c 2003-04-19 19:49:25.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/chipsfb.c 2003-04-25 04:34:14.000000000 -0700 @@ -361,7 +361,6 @@ p->var = chipsfb_var; - p->node = NODEV; p->fbops = &chipsfb_ops; p->flags = FBINFO_FLAG_DEFAULT; @@ -373,7 +372,7 @@ } printk(KERN_INFO "fb%d: Chips 65550 frame buffer (%dK RAM detected)\n", - minor(p->node), p->fix.smem_len / 1024); + p->node, p->fix.smem_len / 1024); chips_hw_init(); } diff -urN linux-2.5.68-bk5/drivers/video/cirrusfb.c linux-2.5.68-bk6/drivers/video/cirrusfb.c --- linux-2.5.68-bk5/drivers/video/cirrusfb.c 2003-04-19 19:50:45.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/cirrusfb.c 2003-04-25 04:34:14.000000000 -0700 @@ -2781,7 +2781,6 @@ sizeof (fb_info->gen.info.modename)); fb_info->gen.info.modename [sizeof (fb_info->gen.info.modename) - 1] = 0; - fb_info->gen.info.node = NODEV; fb_info->gen.info.fbops = &clgenfb_ops; fb_info->gen.info.disp = &disp; fb_info->gen.info.currcon = -1; diff -urN linux-2.5.68-bk5/drivers/video/controlfb.c linux-2.5.68-bk6/drivers/video/controlfb.c --- linux-2.5.68-bk5/drivers/video/controlfb.c 2003-04-19 19:48:55.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/controlfb.c 2003-04-25 04:34:14.000000000 -0700 @@ -483,7 +483,7 @@ if (register_framebuffer(&p->info) < 0) return -ENXIO; - printk(KERN_INFO "fb%d: control display adapter\n", minor(p->info.node)); + printk(KERN_INFO "fb%d: control display adapter\n", p->info.node); return 0; } @@ -1008,7 +1008,6 @@ { /* Fill fb_info */ info->par = &p->par; - info->node = NODEV; info->fbops = &controlfb_ops; info->pseudo_palette = p->pseudo_palette; info->flags = FBINFO_FLAG_DEFAULT; diff -urN linux-2.5.68-bk5/drivers/video/cyber2000fb.c linux-2.5.68-bk6/drivers/video/cyber2000fb.c --- linux-2.5.68-bk5/drivers/video/cyber2000fb.c 2003-04-19 19:48:55.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/cyber2000fb.c 2003-04-25 04:34:14.000000000 -0700 @@ -1281,7 +1281,6 @@ cfb->fb.fbops = &cyber2000fb_ops; cfb->fb.flags = FBINFO_FLAG_DEFAULT; - cfb->fb.node = NODEV; cfb->fb.pseudo_palette = (void *)(cfb + 1); fb_alloc_cmap(&cfb->fb.cmap, NR_PALETTE, 0); diff -urN linux-2.5.68-bk5/drivers/video/cyberfb.c linux-2.5.68-bk6/drivers/video/cyberfb.c --- linux-2.5.68-bk5/drivers/video/cyberfb.c 2003-04-19 19:48:50.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/cyberfb.c 2003-04-25 04:34:14.000000000 -0700 @@ -1033,7 +1033,6 @@ strcpy(fb_info.modename, cyberfb_name); fb_info.changevar = NULL; - fb_info.node = NODEV; fb_info.fbops = &cyberfb_ops; fb_info.screen_base = (unsigned char *)CyberMem; fb_info.disp = &disp; @@ -1063,7 +1062,7 @@ } printk("fb%d: %s frame buffer device, using %ldK of video memory\n", - minor(fb_info.node), fb_info.modename, CyberSize>>10); + fb_info.node, fb_info.modename, CyberSize>>10); /* TODO: This driver cannot be unloaded yet */ MOD_INC_USE_COUNT; diff -urN linux-2.5.68-bk5/drivers/video/dnfb.c linux-2.5.68-bk6/drivers/video/dnfb.c --- linux-2.5.68-bk5/drivers/video/dnfb.c 2003-04-19 19:50:41.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/dnfb.c 2003-04-25 04:34:14.000000000 -0700 @@ -229,7 +229,6 @@ { int err; - fb_info.node = NODEV; fb_info.fbops = &dn_fb_ops; fb_info.fix = dnfb_fix; fb_info.var = dnfb_var; diff -urN linux-2.5.68-bk5/drivers/video/epson1355fb.c linux-2.5.68-bk6/drivers/video/epson1355fb.c --- linux-2.5.68-bk5/drivers/video/epson1355fb.c 2003-04-19 19:48:50.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/epson1355fb.c 2003-04-25 04:34:14.000000000 -0700 @@ -500,7 +500,6 @@ fb_info.gen.fbhw->detect(); strcpy(fb_info.gen.info.modename, "SED1355"); fb_info.gen.info.changevar = NULL; - fb_info.gen.info.node = NODEV; fb_info.gen.info.fbops = &e1355fb_ops; fb_info.gen.info.screen_base = (void *)E1355_FB_BASE; fb_info.gen.currcon = -1; @@ -517,7 +516,7 @@ do_install_cmap(0, &fb_info.gen); if (register_framebuffer(&fb_info.gen.info) < 0) return -EINVAL; - printk(KERN_INFO "fb%d: %s frame buffer device\n", minor(fb_info.gen.info.node), + printk(KERN_INFO "fb%d: %s frame buffer device\n", fb_info.gen.info.node, fb_info.gen.info.modename); return 0; diff -urN linux-2.5.68-bk5/drivers/video/fbmem.c linux-2.5.68-bk6/drivers/video/fbmem.c --- linux-2.5.68-bk5/drivers/video/fbmem.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/fbmem.c 2003-04-25 04:34:14.000000000 -0700 @@ -753,7 +753,7 @@ for (fi = registered_fb; fi < ®istered_fb[FB_MAX] && len < 4000; fi++) if (*fi) clen += sprintf(buf + clen, "%d %s\n", - minor((*fi)->node), + (*fi)->node, (*fi)->fix.id); *start = buf + offset; if (clen > offset) @@ -1223,7 +1223,7 @@ for (i = 0 ; i < FB_MAX; i++) if (!registered_fb[i]) break; - fb_info->node = mk_kdev(FB_MAJOR, i); + fb_info->node = i; if (fb_info->pixmap.addr == NULL) { fb_info->pixmap.addr = kmalloc(FBPIXMAPSIZE, GFP_KERNEL); @@ -1265,7 +1265,7 @@ { int i; - i = minor(fb_info->node); + i = fb_info->node; if (!registered_fb[i]) return -EINVAL; devfs_remove("fb/%d", i); diff -urN linux-2.5.68-bk5/drivers/video/ffb.c linux-2.5.68-bk6/drivers/video/ffb.c --- linux-2.5.68-bk5/drivers/video/ffb.c 2003-04-19 19:51:23.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/ffb.c 2003-04-25 04:34:14.000000000 -0700 @@ -895,7 +895,6 @@ all->par.prom_node = node; all->par.prom_parent_node = parent; - all->info.node = NODEV; all->info.flags = FBINFO_FLAG_DEFAULT; all->info.fbops = &ffb_ops; all->info.screen_base = (char *) all->par.physbase + FFB_DFB24_POFF; diff -urN linux-2.5.68-bk5/drivers/video/fm2fb.c linux-2.5.68-bk6/drivers/video/fm2fb.c --- linux-2.5.68-bk5/drivers/video/fm2fb.c 2003-04-19 19:49:11.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/fm2fb.c 2003-04-25 04:34:14.000000000 -0700 @@ -259,7 +259,6 @@ if (fm2fb_mode == -1) fm2fb_mode = FM2FB_MODE_PAL; - fb_info.node = NODEV; fb_info.fbops = &fm2fb_ops; fb_info.var = fb_var_modes[fm2fb_mode]; fb_info.screen_base = (char *)fb_fix.smem_start; @@ -273,7 +272,7 @@ if (register_framebuffer(&fb_info) < 0) return -EINVAL; - printk("fb%d: %s frame buffer device\n", minor(fb_info.node), fb_fix.id); + printk("fb%d: %s frame buffer device\n", fb_info.node, fb_fix.id); return 0; } return -ENXIO; diff -urN linux-2.5.68-bk5/drivers/video/g364fb.c linux-2.5.68-bk6/drivers/video/g364fb.c --- linux-2.5.68-bk5/drivers/video/g364fb.c 2003-04-19 19:48:51.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/g364fb.c 2003-04-25 04:34:14.000000000 -0700 @@ -237,7 +237,6 @@ fb_fix.smem_len = (1 << (mem * 2)) * 512 * 1024; fb_var.yres_virtual = fb_fix.smem_len / fb_var.xres; - fb_info.node = NODEV; fb_info.fbops = &g364fb_ops; fb_info.screen_base = (char *) G364_MEM_BASE; /* virtual kernel address */ fb_info.var = fb_var; diff -urN linux-2.5.68-bk5/drivers/video/hgafb.c linux-2.5.68-bk6/drivers/video/hgafb.c --- linux-2.5.68-bk5/drivers/video/hgafb.c 2003-04-19 19:50:36.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/hgafb.c 2003-04-25 04:34:14.000000000 -0700 @@ -549,7 +549,6 @@ hga_fix.smem_start = VGA_MAP_MEM(hga_vram_base); hga_fix.smem_len = hga_vram_len; - fb_info.node = NODEV; fb_info.flags = FBINFO_FLAG_DEFAULT; fb_info.var = hga_default_var; fb_info.fix = hga_fix; @@ -565,7 +564,7 @@ return -EINVAL; printk(KERN_INFO "fb%d: %s frame buffer device\n", - minor(fb_info.node), fb_info.fix.id); + fb_info.node, fb_info.fix.id); return 0; } diff -urN linux-2.5.68-bk5/drivers/video/hitfb.c linux-2.5.68-bk6/drivers/video/hitfb.c --- linux-2.5.68-bk5/drivers/video/hitfb.c 2003-04-19 19:48:51.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/hitfb.c 2003-04-25 04:34:14.000000000 -0700 @@ -153,7 +153,6 @@ } hitfb_var.yres = ldvntr+1; - fb_info.node = NODEV; fb_info.fbops = &hitfb_ops; fb_info.var = hitfb_var; fb_info.fix = hitfb_fix; @@ -169,7 +168,7 @@ return -EINVAL; printk(KERN_INFO "fb%d: %s frame buffer device\n", - minor(fb_info.node), fb_info.fix.id); + fb_info.node, fb_info.fix.id); return 0; } diff -urN linux-2.5.68-bk5/drivers/video/hpfb.c linux-2.5.68-bk6/drivers/video/hpfb.c --- linux-2.5.68-bk5/drivers/video/hpfb.c 2003-04-19 19:49:51.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/hpfb.c 2003-04-25 04:34:14.000000000 -0700 @@ -150,7 +150,6 @@ /* * Let there be consoles.. */ - fb_info.node = NODEV; fb_info.fbops = &hpfb_ops; fb_info.flags = FBINFO_FLAG_DEFAULT; fb_info.var = hpfb_defined; diff -urN linux-2.5.68-bk5/drivers/video/i810/i810_main.c linux-2.5.68-bk6/drivers/video/i810/i810_main.c --- linux-2.5.68-bk5/drivers/video/i810/i810_main.c 2003-04-19 19:48:57.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/i810/i810_main.c 2003-04-25 04:34:14.000000000 -0700 @@ -1828,7 +1828,6 @@ i810_init_device(par); info->screen_base = par->fb.virtual; - info->node = NODEV; info->fbops = &par->i810fb_ops; info->pseudo_palette = par->pseudo_palette; info->flags = FBINFO_FLAG_DEFAULT; @@ -1861,7 +1860,7 @@ "I810FB: Video RAM : %dK\n" "I810FB: Monitor : H: %d-%d KHz V: %d-%d Hz\n" "I810FB: Mode : %dx%d-%dbpp@%dHz\n", - minor(info->node), + info->node, i810_pci_list[entry->driver_data], VERSION_MAJOR, VERSION_MINOR, VERSION_TEENIE, BRANCH_VERSION, (int) par->fb.size>>10, info->monspecs.hfmin/1000, diff -urN linux-2.5.68-bk5/drivers/video/igafb.c linux-2.5.68-bk6/drivers/video/igafb.c --- linux-2.5.68-bk5/drivers/video/igafb.c 2003-04-19 19:49:56.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/igafb.c 2003-04-25 04:34:14.000000000 -0700 @@ -356,7 +356,6 @@ else video_cmap_len = 256; - info->node = NODEV; info->fbops = &igafb_ops; info->flags = FBINFO_FLAG_DEFAULT; @@ -366,7 +365,7 @@ return 0; printk("fb%d: %s frame buffer device at 0x%08lx [%dMB VRAM]\n", - minor(info->node), info->fix.id, + info->node, info->fix.id, par->frame_buffer_phys, info->fix.smem_len >> 20); iga_blank_border(par); diff -urN linux-2.5.68-bk5/drivers/video/imsttfb.c linux-2.5.68-bk6/drivers/video/imsttfb.c --- linux-2.5.68-bk5/drivers/video/imsttfb.c 2003-04-19 19:49:28.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/imsttfb.c 2003-04-25 04:34:14.000000000 -0700 @@ -1440,7 +1440,6 @@ info->var.pixclock = 1000000 / getclkMHz(par); - info->node = NODEV; info->fbops = &imsttfb_ops; info->flags = FBINFO_FLAG_DEFAULT; @@ -1453,7 +1452,7 @@ tmp = (read_reg_le32(par->dc_regs, SSTATUS) & 0x0f00) >> 8; printk("fb%u: %s frame buffer; %uMB vram; chip version %u\n", - minor(info->node), info->fix.id, info->fix.smem_len >> 20, tmp); + info->node, info->fix.id, info->fix.smem_len >> 20, tmp); } static int __devinit diff -urN linux-2.5.68-bk5/drivers/video/leo.c linux-2.5.68-bk6/drivers/video/leo.c --- linux-2.5.68-bk5/drivers/video/leo.c 2003-04-19 19:50:45.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/leo.c 2003-04-25 04:34:14.000000000 -0700 @@ -510,7 +510,6 @@ sbus_ioremap(&sdev->resource[0], LEO_OFF_LX_CURSOR, sizeof(struct leo_cursor), "leolx cursor"); - all->info.node = NODEV; all->info.flags = FBINFO_FLAG_DEFAULT; all->info.fbops = &leo_ops; all->info.currcon = -1; diff -urN linux-2.5.68-bk5/drivers/video/macfb.c linux-2.5.68-bk6/drivers/video/macfb.c --- linux-2.5.68-bk5/drivers/video/macfb.c 2003-04-19 19:48:51.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/macfb.c 2003-04-25 04:34:14.000000000 -0700 @@ -943,7 +943,6 @@ break; } - fb_info.node = NODEV; fb_info.fbops = &macfb_ops; fb_info.var = macfb_defined; fb_info.fix = macfb_fix; @@ -956,7 +955,7 @@ return; printk("fb%d: %s frame buffer device\n", - minor(fb_info.node), fb_info.fix.id); + fb_info.node, fb_info.fix.id); } MODULE_LICENSE("GPL"); diff -urN linux-2.5.68-bk5/drivers/video/matrox/i2c-matroxfb.c linux-2.5.68-bk6/drivers/video/matrox/i2c-matroxfb.c --- linux-2.5.68-bk5/drivers/video/matrox/i2c-matroxfb.c 2003-04-19 19:49:26.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/matrox/i2c-matroxfb.c 2003-04-25 04:34:14.000000000 -0700 @@ -112,7 +112,7 @@ b->mask.clock = clock; b->adapter = matrox_i2c_adapter_template; snprintf(b->adapter.dev.name, DEVICE_NAME_SIZE, name, - minor(minfo->fbcon.node)); + minfo->fbcon.node); b->adapter.data = b; b->adapter.algo_data = &b->bac; b->bac = matrox_i2c_algo_template; diff -urN linux-2.5.68-bk5/drivers/video/matrox/matroxfb_base.c linux-2.5.68-bk6/drivers/video/matrox/matroxfb_base.c --- linux-2.5.68-bk5/drivers/video/matrox/matroxfb_base.c 2003-04-19 19:50:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/matrox/matroxfb_base.c 2003-04-25 04:34:14.000000000 -0700 @@ -1752,7 +1752,6 @@ strcpy(ACCESS_FBINFO(fbcon.modename), "MATROX VGA"); ACCESS_FBINFO(fbcon.changevar) = NULL; - ACCESS_FBINFO(fbcon.node) = NODEV; ACCESS_FBINFO(fbcon.fbops) = &matroxfb_ops; ACCESS_FBINFO(fbcon.disp) = d; ACCESS_FBINFO(fbcon.switch_con) = &matroxfb_switch; @@ -1872,12 +1871,12 @@ goto failVideoIO; } printk("fb%d: %s frame buffer device\n", - minor(ACCESS_FBINFO(fbcon.node)), ACCESS_FBINFO(fbcon.modename)); + ACCESS_FBINFO(fbcon.node), ACCESS_FBINFO(fbcon.modename)); if (ACCESS_FBINFO(fbcon.currcon) < 0) { /* there is no console on this fb... but we have to initialize hardware * until someone tells me what is proper thing to do */ printk(KERN_INFO "fb%d: initializing hardware\n", - minor(ACCESS_FBINFO(fbcon.node))); + ACCESS_FBINFO(fbcon.node)); matroxfb_set_var(&vesafb_defined, -1, &ACCESS_FBINFO(fbcon)); } return 0; diff -urN linux-2.5.68-bk5/drivers/video/matrox/matroxfb_crtc2.c linux-2.5.68-bk6/drivers/video/matrox/matroxfb_crtc2.c --- linux-2.5.68-bk5/drivers/video/matrox/matroxfb_crtc2.c 2003-04-19 19:50:42.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/matrox/matroxfb_crtc2.c 2003-04-25 04:34:14.000000000 -0700 @@ -747,7 +747,6 @@ strcpy(m2info->fbcon.modename, "MATROX CRTC2"); m2info->fbcon.changevar = NULL; - m2info->fbcon.node = NODEV; m2info->fbcon.fbops = &matroxfb_dh_ops; m2info->fbcon.disp = d; m2info->fbcon.switch_con = &matroxfb_dh_switch; @@ -816,7 +815,7 @@ return -1; } printk(KERN_INFO "matroxfb_crtc2: secondary head of fb%u was registered as fb%u\n", - minor(ACCESS_FBINFO(fbcon.node)), minor(m2info->fbcon.node)); + ACCESS_FBINFO(fbcon.node), m2info->fbcon.node); m2info->fbcon_registered = 1; return 0; #undef minfo @@ -839,7 +838,7 @@ printk(KERN_ERR "matroxfb_crtc2: Expect kernel crash after module unload.\n"); return; } - id = minor(m2info->fbcon.node); + id = m2info->fbcon.node; unregister_framebuffer(&m2info->fbcon); kfree(m2info->fbcon.disp); /* return memory back to primary head */ diff -urN linux-2.5.68-bk5/drivers/video/maxinefb.c linux-2.5.68-bk6/drivers/video/maxinefb.c --- linux-2.5.68-bk5/drivers/video/maxinefb.c 2003-04-19 19:48:56.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/maxinefb.c 2003-04-25 04:34:14.000000000 -0700 @@ -155,7 +155,6 @@ */ } - fb_info.node = NODEV; fb_info.fbops = &maxinefb_ops; fb_info.screen_base = (char *) maxinefb_fix.smem_start; fb_info.var = maxinefb_defined; diff -urN linux-2.5.68-bk5/drivers/video/neofb.c linux-2.5.68-bk6/drivers/video/neofb.c --- linux-2.5.68-bk5/drivers/video/neofb.c 2003-04-19 19:50:02.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/neofb.c 2003-04-25 04:34:14.000000000 -0700 @@ -2021,7 +2021,7 @@ goto failed; printk(KERN_INFO "fb%d: %s frame buffer device\n", - minor(info->node), info->fix.id); + info->node, info->fix.id); /* * Our driver data diff -urN linux-2.5.68-bk5/drivers/video/offb.c linux-2.5.68-bk6/drivers/video/offb.c --- linux-2.5.68-bk5/drivers/video/offb.c 2003-04-19 19:51:12.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/offb.c 2003-04-25 04:34:14.000000000 -0700 @@ -523,7 +523,6 @@ var->sync = 0; var->vmode = FB_VMODE_NONINTERLACED; - info->node = NODEV; info->fbops = &offb_ops; info->screen_base = ioremap(address, fix->smem_len); info->par = par; @@ -539,7 +538,7 @@ } printk(KERN_INFO "fb%d: Open Firmware frame buffer device on %s\n", - minor(info->node), full_name); + info->node, full_name); } MODULE_LICENSE("GPL"); diff -urN linux-2.5.68-bk5/drivers/video/p9100.c linux-2.5.68-bk6/drivers/video/p9100.c --- linux-2.5.68-bk5/drivers/video/p9100.c 2003-04-19 19:50:30.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/p9100.c 2003-04-25 04:34:14.000000000 -0700 @@ -298,7 +298,6 @@ sbus_ioremap(&sdev->resource[0], 0, sizeof(struct p9100_regs), "p9100 regs"); - all->info.node = NODEV; all->info.flags = FBINFO_FLAG_DEFAULT; all->info.fbops = &p9100_ops; #ifdef CONFIG_SPARC32 diff -urN linux-2.5.68-bk5/drivers/video/platinumfb.c linux-2.5.68-bk6/drivers/video/platinumfb.c --- linux-2.5.68-bk5/drivers/video/platinumfb.c 2003-04-19 19:49:10.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/platinumfb.c 2003-04-25 04:34:14.000000000 -0700 @@ -327,7 +327,6 @@ { /* Fill fb_info */ info->par = &p->par; - info->node = NODEV; info->fbops = &platinumfb_ops; info->pseudo_palette = p->pseudo_palette; info->flags = FBINFO_FLAG_DEFAULT; @@ -409,7 +408,7 @@ return 0; printk(KERN_INFO "fb%d: platinum frame buffer device\n", - minor(p->info.node)); + p->info.node); return 1; } diff -urN linux-2.5.68-bk5/drivers/video/pm2fb.c linux-2.5.68-bk6/drivers/video/pm2fb.c --- linux-2.5.68-bk5/drivers/video/pm2fb.c 2003-04-19 19:51:21.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/pm2fb.c 2003-04-25 04:34:14.000000000 -0700 @@ -2269,7 +2269,6 @@ fb_info.gen.parsize=sizeof(struct pm2fb_par); fb_info.gen.fbhw=&pm2fb_hwswitch; strcpy(fb_info.gen.info.modename, permedia2_name); - fb_info.gen.info.node = NODEV; fb_info.gen.info.flags=FBINFO_FLAG_DEFAULT; fb_info.gen.info.fbops=&pm2fb_ops; fb_info.gen.info.disp=&fb_info.disp; @@ -2288,7 +2287,7 @@ return -EINVAL; } printk(KERN_INFO "fb%d: %s (%s), using %uK of video memory.\n", - minor(fb_info.gen.info.node), + fb_info.gen.info.node, board_table[fb_info.board].name, permedia2_name, (u32 )(fb_info.regions.fb_size>>10)); diff -urN linux-2.5.68-bk5/drivers/video/pm3fb.c linux-2.5.68-bk6/drivers/video/pm3fb.c --- linux-2.5.68-bk5/drivers/video/pm3fb.c 2003-04-19 19:48:55.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/pm3fb.c 2003-04-25 04:34:14.000000000 -0700 @@ -1602,7 +1602,6 @@ disp[l_fb_info->board_num].scrollmode = 0; /* SCROLL_YNOMOVE; *//* 0 means "let fbcon choose" */ l_fb_info->gen.parsize = sizeof(struct pm3fb_par); l_fb_info->gen.info.changevar = NULL; - l_fb_info->gen.info.node = B_FREE; l_fb_info->gen.info.fbops = &pm3fb_ops; l_fb_info->gen.info.disp = &(disp[l_fb_info->board_num]); if (fontn[l_fb_info->board_num][0]) @@ -1646,7 +1645,7 @@ pm3fb_write_mode(l_fb_info); printk("fb%d: %s, using %uK of video memory (%s)\n", - minor(l_fb_info->gen.info.node), + l_fb_info->gen.info.node, permedia3_name, (u32) (l_fb_info->fb_size >> 10), cardbase[l_fb_info->board_type].cardname); } diff -urN linux-2.5.68-bk5/drivers/video/pmag-ba-fb.c linux-2.5.68-bk6/drivers/video/pmag-ba-fb.c --- linux-2.5.68-bk5/drivers/video/pmag-ba-fb.c 2003-04-19 19:51:12.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/pmag-ba-fb.c 2003-04-25 04:34:14.000000000 -0700 @@ -138,7 +138,6 @@ /* * Let there be consoles.. */ - info->node = NODEV; info->fbops = &pmagbafb_ops; info->var = pmagbafb_defined; info->fix = pmagbafb_fix; diff -urN linux-2.5.68-bk5/drivers/video/pmagb-b-fb.c linux-2.5.68-bk6/drivers/video/pmagb-b-fb.c --- linux-2.5.68-bk5/drivers/video/pmagb-b-fb.c 2003-04-19 19:49:59.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/pmagb-b-fb.c 2003-04-25 04:34:14.000000000 -0700 @@ -141,7 +141,6 @@ /* * Let there be consoles.. */ - info->node = NODEV; info->fbops = &pmagbbfb_ops; info->var = pmagbbfb_defined; info->fix = pmagbbfb_fix; diff -urN linux-2.5.68-bk5/drivers/video/pvr2fb.c linux-2.5.68-bk6/drivers/video/pvr2fb.c --- linux-2.5.68-bk5/drivers/video/pvr2fb.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/pvr2fb.c 2003-04-25 04:34:14.000000000 -0700 @@ -1021,7 +1021,6 @@ strcpy(fb_info.modename, pvr2fb_name); fb_info.changevar = NULL; - fb_info.node = NODEV; fb_info.fbops = &pvr2fb_ops; fb_info.screen_base = (char *) videomemory; fb_info.disp = &disp; @@ -1060,10 +1059,10 @@ modememused = get_line_length(var.xres_virtual, var.bits_per_pixel); modememused *= var.yres_virtual; printk("fb%d: %s frame buffer device, using %ldk/%ldk of video memory\n", - minor(fb_info.node), fb_info.modename, modememused>>10, + fb_info.node, fb_info.modename, modememused>>10, videomemorysize>>10); printk("fb%d: Mode %dx%d-%d pitch = %ld cable: %s video output: %s\n", - minor(fb_info.node), var.xres, var.yres, var.bits_per_pixel, + fb_info.node, var.xres, var.yres, var.bits_per_pixel, get_line_length(var.xres, var.bits_per_pixel), (char *)pvr2_get_param(cables, NULL, cable_type, 3), (char *)pvr2_get_param(outputs, NULL, video_output, 3)); diff -urN linux-2.5.68-bk5/drivers/video/q40fb.c linux-2.5.68-bk6/drivers/video/q40fb.c --- linux-2.5.68-bk5/drivers/video/q40fb.c 2003-04-19 19:48:56.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/q40fb.c 2003-04-25 04:34:14.000000000 -0700 @@ -105,7 +105,6 @@ fb_info.var = q40fb_var; fb_info.fix = q40fb_fix; - fb_info.node = NODEV; fb_info.fbops = &q40fb_ops; fb_info.flags = FBINFO_FLAG_DEFAULT; /* not as module for now */ fb_info.pseudo_palette = pseudo_palette; @@ -121,7 +120,7 @@ } printk(KERN_INFO "fb%d: Q40 frame buffer alive and kicking !\n", - minor(fb_info.node)); + fb_info.node); return 0; } diff -urN linux-2.5.68-bk5/drivers/video/radeonfb.c linux-2.5.68-bk6/drivers/video/radeonfb.c --- linux-2.5.68-bk5/drivers/video/radeonfb.c 2003-04-19 19:51:12.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/radeonfb.c 2003-04-25 04:34:14.000000000 -0700 @@ -2237,7 +2237,6 @@ info->currcon = -1; info->par = rinfo; info->pseudo_palette = rinfo->pseudo_palette; - info->node = NODEV; info->flags = FBINFO_FLAG_DEFAULT; info->fbops = &radeonfb_ops; info->display_fg = NULL; diff -urN linux-2.5.68-bk5/drivers/video/retz3fb.c linux-2.5.68-bk6/drivers/video/retz3fb.c --- linux-2.5.68-bk5/drivers/video/retz3fb.c 2003-04-19 19:50:44.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/retz3fb.c 2003-04-25 04:34:14.000000000 -0700 @@ -1403,7 +1403,6 @@ strcpy(fb_info->modename, retz3fb_name); fb_info->changevar = NULL; - fb_info->node = NODEV; fb_info->fbops = &retz3fb_ops; fb_info->screen_base = zinfo->fbmem; fb_info->disp = &zinfo->disp; @@ -1430,7 +1429,7 @@ return -EINVAL; printk(KERN_INFO "fb%d: %s frame buffer device, using %ldK of " - "video memory\n", minor(fb_info->node), + "video memory\n", fb_info->node, fb_info->modename, zinfo->fbsize>>10); /* FIXME: This driver cannot be unloaded yet */ diff -urN linux-2.5.68-bk5/drivers/video/riva/fbdev.c linux-2.5.68-bk6/drivers/video/riva/fbdev.c --- linux-2.5.68-bk5/drivers/video/riva/fbdev.c 2003-04-19 19:50:29.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/riva/fbdev.c 2003-04-25 04:34:14.000000000 -0700 @@ -1581,7 +1581,6 @@ struct riva_par *par = (struct riva_par *) info->par; unsigned int cmap_len; - info->node = NODEV; info->flags = FBINFO_FLAG_DEFAULT; info->var = rivafb_default_var; info->fix = rivafb_fix; diff -urN linux-2.5.68-bk5/drivers/video/sa1100fb.c linux-2.5.68-bk6/drivers/video/sa1100fb.c --- linux-2.5.68-bk5/drivers/video/sa1100fb.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/sa1100fb.c 2003-04-25 04:34:14.000000000 -0700 @@ -1701,7 +1701,6 @@ fbi->fb.fbops = &sa1100fb_ops; fbi->fb.flags = FBINFO_FLAG_DEFAULT; - fbi->fb.node = NODEV; fbi->fb.monspecs = monspecs; fbi->fb.currcon = -1; fbi->fb.pseudo_palette = (fbi + 1); diff -urN linux-2.5.68-bk5/drivers/video/sgivwfb.c linux-2.5.68-bk6/drivers/video/sgivwfb.c --- linux-2.5.68-bk5/drivers/video/sgivwfb.c 2003-04-19 19:49:27.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/sgivwfb.c 2003-04-25 04:34:14.000000000 -0700 @@ -773,7 +773,6 @@ sgivwfb_fix.ywrapstep = ywrap; sgivwfb_fix.ypanstep = ypan; - fb_info.node = NODEV; fb_info.fix = sgivwfb_fix; switch (flatpanel_id) { @@ -807,7 +806,7 @@ } printk(KERN_INFO "fb%d: SGI DBE frame buffer device, using %ldK of video memory at %#lx\n", - minor(fb_info.node), sgivwfb_mem_size >> 10, sgivwfb_mem_phys); + fb_info.node, sgivwfb_mem_size >> 10, sgivwfb_mem_phys); return 0; fail_register_framebuffer: diff -urN linux-2.5.68-bk5/drivers/video/sis/sis_main.c linux-2.5.68-bk6/drivers/video/sis/sis_main.c --- linux-2.5.68-bk5/drivers/video/sis/sis_main.c 2003-04-19 19:50:08.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/sis/sis_main.c 2003-04-25 04:34:14.000000000 -0700 @@ -4524,7 +4524,6 @@ #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) /* ---- 2.5 series init ---- */ - sis_fb_info.node = NODEV; sis_fb_info.flags = FBINFO_FLAG_DEFAULT; sis_fb_info.var = default_var; sis_fb_info.fix = sisfb_fix; @@ -4571,7 +4570,7 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) printk(KERN_INFO "fb%d: %s frame buffer device, Version %d.%d.%02d\n", - minor(sis_fb_info.node), myid, VER_MAJOR, VER_MINOR, VER_LEVEL); + sis_fb_info.node, myid, VER_MAJOR, VER_MINOR, VER_LEVEL); #endif } /* TW: if mode = "none" */ diff -urN linux-2.5.68-bk5/drivers/video/skeletonfb.c linux-2.5.68-bk6/drivers/video/skeletonfb.c --- linux-2.5.68-bk5/drivers/video/skeletonfb.c 2003-04-19 19:48:53.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/skeletonfb.c 2003-04-25 04:34:14.000000000 -0700 @@ -536,7 +536,6 @@ * space via ioremap. Consult ioport.h. */ info.screen_base = framebuffer_virtual_memory; - info.node = NODEV; info.fbops = &xxxfb_ops; info.fix = xxxfb_fix; info.pseudo_palette = pseudo_palette; @@ -566,7 +565,7 @@ if (register_framebuffer(&info) < 0) return -EINVAL; - printk(KERN_INFO "fb%d: %s frame buffer device\n", minor(info.node), + printk(KERN_INFO "fb%d: %s frame buffer device\n", info.node, info.fix.id); return 0; } diff -urN linux-2.5.68-bk5/drivers/video/sstfb.c linux-2.5.68-bk6/drivers/video/sstfb.c --- linux-2.5.68-bk5/drivers/video/sstfb.c 2003-04-19 19:50:04.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/sstfb.c 2003-04-25 04:34:14.000000000 -0700 @@ -1474,7 +1474,6 @@ f_ddprintk("membase_phys: %#lx\n", fix->smem_start); f_ddprintk("fbbase_virt: %p\n", info->screen_base); - info->node = NODEV; info->flags = FBINFO_FLAG_DEFAULT; info->fbops = &sstfb_ops; info->currcon = -1; @@ -1520,7 +1519,7 @@ sstfb_drawdebugimage(info); printk(KERN_INFO "fb%d: %s frame buffer device at 0x%p\n", - minor(info->node), fix->id, info->screen_base); + info->node, fix->id, info->screen_base); return 0; diff -urN linux-2.5.68-bk5/drivers/video/stifb.c linux-2.5.68-bk6/drivers/video/stifb.c --- linux-2.5.68-bk5/drivers/video/stifb.c 2003-04-19 19:51:23.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/stifb.c 2003-04-25 04:34:14.000000000 -0700 @@ -1277,7 +1277,6 @@ var->bits_per_pixel = bpp; strcpy(fix->id, "stifb"); - info->node = NODEV; info->fbops = &stifb_ops; info->screen_base = (void*) REGION_BASE(fb,1); info->flags = FBINFO_FLAG_DEFAULT; @@ -1306,7 +1305,7 @@ printk(KERN_INFO "fb%d: %s %dx%d-%d frame buffer device, id: %04x, mmio: 0x%04lx\n", - minor(fb->info.node), + fb->info.node, fix->id, var->xres, var->yres, diff -urN linux-2.5.68-bk5/drivers/video/sun3fb.c linux-2.5.68-bk6/drivers/video/sun3fb.c --- linux-2.5.68-bk5/drivers/video/sun3fb.c 2003-04-19 19:48:55.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/sun3fb.c 2003-04-25 04:34:14.000000000 -0700 @@ -569,7 +569,6 @@ fix->type = FB_TYPE_PACKED_PIXELS; fix->visual = FB_VISUAL_PSEUDOCOLOR; - fb->info.node = NODEV; fb->info.fbops = &sun3fb_ops; fb->info.disp = disp; fb->info.currcon = -1; @@ -646,7 +645,7 @@ kfree(fb); return -EINVAL; } - printk("fb%d: %s\n", minor(fb->info.node), p); + printk("fb%d: %s\n", fb->info.node, p); return 0; } diff -urN linux-2.5.68-bk5/drivers/video/tcx.c linux-2.5.68-bk6/drivers/video/tcx.c --- linux-2.5.68-bk5/drivers/video/tcx.c 2003-04-19 19:48:46.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/tcx.c 2003-04-25 04:34:14.000000000 -0700 @@ -374,7 +374,6 @@ all->par.mmap_map[i].poff = sdev->reg_addrs[j].phys_addr; } - all->info.node = NODEV; all->info.flags = FBINFO_FLAG_DEFAULT; all->info.fbops = &tcx_ops; #ifdef CONFIG_SPARC32 diff -urN linux-2.5.68-bk5/drivers/video/tdfxfb.c linux-2.5.68-bk6/drivers/video/tdfxfb.c --- linux-2.5.68-bk5/drivers/video/tdfxfb.c 2003-04-19 19:48:56.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/tdfxfb.c 2003-04-25 04:34:14.000000000 -0700 @@ -1218,7 +1218,6 @@ tdfx_fix.ypanstep = nopan ? 0 : 1; tdfx_fix.ywrapstep = nowrap ? 0 : 1; - info->node = NODEV; info->fbops = &tdfxfb_ops; info->fix = tdfx_fix; info->par = default_par; diff -urN linux-2.5.68-bk5/drivers/video/tgafb.c linux-2.5.68-bk6/drivers/video/tgafb.c --- linux-2.5.68-bk5/drivers/video/tgafb.c 2003-04-19 19:50:29.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/tgafb.c 2003-04-25 04:34:14.000000000 -0700 @@ -1425,7 +1425,6 @@ pci_read_config_byte(pdev, PCI_REVISION_ID, &all->par.tga_chip_rev); /* Setup framebuffer. */ - all->info.node = NODEV; all->info.flags = FBINFO_FLAG_DEFAULT; all->info.fbops = &tgafb_ops; all->info.screen_base = (char *) all->par.tga_fb_base; @@ -1465,7 +1464,7 @@ pdev->bus->number, PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn)); printk(KERN_INFO "fb%d: %s frame buffer device at 0x%lx\n", - minor(all->info.node), all->info.fix.id, bar0_start); + all->info.node, all->info.fix.id, bar0_start); return 0; diff -urN linux-2.5.68-bk5/drivers/video/tridentfb.c linux-2.5.68-bk6/drivers/video/tridentfb.c --- linux-2.5.68-bk5/drivers/video/tridentfb.c 2003-04-19 19:49:31.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/tridentfb.c 2003-04-25 04:34:14.000000000 -0700 @@ -1140,7 +1140,6 @@ nativex = get_nativex(); fb_info.fix = tridentfb_fix; - fb_info.node = NODEV; fb_info.fbops = &tridentfb_ops; @@ -1161,7 +1160,7 @@ return -EINVAL; } output("fb%d: %s frame buffer device %dx%d-%dbpp\n", - minor(fb_info.node), fb_info.fix.id,default_var.xres, + fb_info.node, fb_info.fix.id,default_var.xres, default_var.yres,default_var.bits_per_pixel); return 0; } diff -urN linux-2.5.68-bk5/drivers/video/tx3912fb.c linux-2.5.68-bk6/drivers/video/tx3912fb.c --- linux-2.5.68-bk5/drivers/video/tx3912fb.c 2003-04-19 19:50:02.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/tx3912fb.c 2003-04-25 04:34:14.000000000 -0700 @@ -292,7 +292,6 @@ if ((tx3912fb_fix.line_length * tx3912fb_var.yres_virtual) > tx3912fb_fix.smem_len) return -ENOMEM; - fb_info.node = NODEV; fb_info.fbops = &tx3912fb_ops; fb_info.var = tx3912fb_var; fb_info.fix = tx3912fb_fix; @@ -309,7 +308,7 @@ return -1; printk(KERN_INFO "fb%d: TX3912 frame buffer using %uKB.\n", - minor(fb_info.node), (u_int) (fb_info.fix.smem_len >> 10)); + fb_info.node, (u_int) (fb_info.fix.smem_len >> 10)); return 0; } diff -urN linux-2.5.68-bk5/drivers/video/valkyriefb.c linux-2.5.68-bk6/drivers/video/valkyriefb.c --- linux-2.5.68-bk5/drivers/video/valkyriefb.c 2003-04-19 19:50:43.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/valkyriefb.c 2003-04-25 04:34:14.000000000 -0700 @@ -447,7 +447,7 @@ return; } - printk(KERN_INFO "fb%d: valkyrie frame buffer device\n", GET_FB_IDX(p->info.node)); + printk(KERN_INFO "fb%d: valkyrie frame buffer device\n", p->info.node); } static void valkyrie_set_par(const struct fb_par_valkyrie *par, @@ -715,7 +715,6 @@ static void __init valkyrie_init_info(struct fb_info *info, struct fb_info_valkyrie *p) { strcpy(info->modename, p->fix.id); - info->node = NODEV; info->fbops = &valkyriefb_ops; info->screen_base = (char *) p->frame_buffer + 0x1000; info->disp = &p->disp; diff -urN linux-2.5.68-bk5/drivers/video/vesafb.c linux-2.5.68-bk6/drivers/video/vesafb.c --- linux-2.5.68-bk5/drivers/video/vesafb.c 2003-04-19 19:48:50.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/vesafb.c 2003-04-25 04:34:14.000000000 -0700 @@ -359,7 +359,6 @@ } } - fb_info.node = NODEV; fb_info.fbops = &vesafb_ops; fb_info.var = vesafb_defined; fb_info.fix = vesafb_fix; @@ -372,7 +371,7 @@ return -EINVAL; printk(KERN_INFO "fb%d: %s frame buffer device\n", - minor(fb_info.node), fb_info.fix.id); + fb_info.node, fb_info.fix.id); return 0; } diff -urN linux-2.5.68-bk5/drivers/video/vfb.c linux-2.5.68-bk6/drivers/video/vfb.c --- linux-2.5.68-bk5/drivers/video/vfb.c 2003-04-19 19:48:46.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/vfb.c 2003-04-25 04:34:14.000000000 -0700 @@ -426,7 +426,6 @@ memset(videomemory, 0, videomemorysize); fb_info.screen_base = videomemory; - fb_info.node = NODEV; fb_info.fbops = &vfb_ops; retval = fb_find_mode(&fb_info.var, &fb_info, NULL, @@ -447,7 +446,7 @@ printk(KERN_INFO "fb%d: Virtual frame buffer device, using %ldK of video memory\n", - minor(fb_info.node), videomemorysize >> 10); + fb_info.node, videomemorysize >> 10); return 0; } diff -urN linux-2.5.68-bk5/drivers/video/vga16fb.c linux-2.5.68-bk6/drivers/video/vga16fb.c --- linux-2.5.68-bk5/drivers/video/vga16fb.c 2003-04-19 19:48:56.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/vga16fb.c 2003-04-25 04:34:14.000000000 -0700 @@ -1364,7 +1364,6 @@ vga16fb_defined.blue.length = i; /* name should not depend on EGA/VGA */ - vga16fb.node = NODEV; vga16fb.fbops = &vga16fb_ops; vga16fb.var = vga16fb_defined; vga16fb.fix = vga16fb_fix; @@ -1385,7 +1384,7 @@ } printk(KERN_INFO "fb%d: %s frame buffer device\n", - minor(vga16fb.node), vga16fb.fix.id); + vga16fb.node, vga16fb.fix.id); return 0; } diff -urN linux-2.5.68-bk5/drivers/video/virgefb.c linux-2.5.68-bk6/drivers/video/virgefb.c --- linux-2.5.68-bk5/drivers/video/virgefb.c 2003-04-19 19:48:56.000000000 -0700 +++ linux-2.5.68-bk6/drivers/video/virgefb.c 2003-04-25 04:34:14.000000000 -0700 @@ -1783,7 +1783,6 @@ fbhw = &virgefb_hw_switch; strcpy(fb_info.modename, virgefb_name); fb_info.changevar = NULL; - fb_info.node = NODEV; fb_info.fbops = &virgefb_ops; fb_info.disp = &disp; fb_info.currcon = -1; @@ -1806,7 +1805,7 @@ } printk(KERN_INFO "fb%d: %s frame buffer device, using %ldK of video memory\n", - minor(fb_info.node), fb_info.modename, v_ram_size>>10); + fb_info.node, fb_info.modename, v_ram_size>>10); /* TODO: This driver cannot be unloaded yet */ diff -urN linux-2.5.68-bk5/fs/bio.c linux-2.5.68-bk6/fs/bio.c --- linux-2.5.68-bk5/fs/bio.c 2003-04-19 19:50:01.000000000 -0700 +++ linux-2.5.68-bk6/fs/bio.c 2003-04-25 04:34:14.000000000 -0700 @@ -434,19 +434,9 @@ return len; } -/** - * bio_map_user - map user address into bio - * @bdev: destination block device - * @uaddr: start of user address - * @len: length in bytes - * @write_to_vm: bool indicating writing to pages or not - * - * Map the user space address into a bio suitable for io to a block - * device. Caller should check the size of the returned bio, we might - * not have mapped the entire range specified. - */ -struct bio *bio_map_user(struct block_device *bdev, unsigned long uaddr, - unsigned int len, int write_to_vm) +static struct bio *__bio_map_user(struct block_device *bdev, + unsigned long uaddr, unsigned int len, + int write_to_vm) { unsigned long end = (uaddr + len + PAGE_SIZE - 1) >> PAGE_SHIFT; unsigned long start = uaddr >> PAGE_SHIFT; @@ -510,8 +500,11 @@ kfree(pages); /* - * check if the mapped pages need bouncing for an isa host. + * set data direction, and check if mapped pages need bouncing */ + if (!write_to_vm) + bio->bi_rw |= (1 << BIO_RW); + blk_queue_bounce(q, &bio); return bio; out: @@ -521,17 +514,42 @@ } /** - * bio_unmap_user - unmap a bio - * @bio: the bio being unmapped - * @write_to_vm: bool indicating whether pages were written to - * - * Unmap a bio previously mapped by bio_map_user(). The @write_to_vm - * must be the same as passed into bio_map_user(). Must be called with - * a process context. + * bio_map_user - map user address into bio + * @bdev: destination block device + * @uaddr: start of user address + * @len: length in bytes + * @write_to_vm: bool indicating writing to pages or not * - * bio_unmap_user() may sleep. + * Map the user space address into a bio suitable for io to a block + * device. */ -void bio_unmap_user(struct bio *bio, int write_to_vm) +struct bio *bio_map_user(struct block_device *bdev, unsigned long uaddr, + unsigned int len, int write_to_vm) +{ + struct bio *bio; + + bio = __bio_map_user(bdev, uaddr, len, write_to_vm); + + if (bio) { + if (bio->bi_size < len) { + bio_endio(bio, bio->bi_size, 0); + bio_unmap_user(bio, 0); + return NULL; + } + + /* + * subtle -- if __bio_map_user() ended up bouncing a bio, + * it would normally disappear when its bi_end_io is run. + * however, we need it for the unmap, so grab an extra + * reference to it + */ + bio_get(bio); + } + + return bio; +} + +static void __bio_unmap_user(struct bio *bio, int write_to_vm) { struct bio_vec *bvec; int i; @@ -561,6 +579,23 @@ bio_put(bio); } +/** + * bio_unmap_user - unmap a bio + * @bio: the bio being unmapped + * @write_to_vm: bool indicating whether pages were written to + * + * Unmap a bio previously mapped by bio_map_user(). The @write_to_vm + * must be the same as passed into bio_map_user(). Must be called with + * a process context. + * + * bio_unmap_user() may sleep. + */ +void bio_unmap_user(struct bio *bio, int write_to_vm) +{ + __bio_unmap_user(bio, write_to_vm); + bio_put(bio); +} + /* * bio_set_pages_dirty() and bio_check_pages_dirty() are support functions * for performing direct-IO in BIOs. diff -urN linux-2.5.68-bk5/fs/block_dev.c linux-2.5.68-bk6/fs/block_dev.c --- linux-2.5.68-bk5/fs/block_dev.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/fs/block_dev.c 2003-04-25 04:34:14.000000000 -0700 @@ -449,14 +449,13 @@ { struct gendisk *disk = bdev->bd_disk; struct block_device_operations * bdops = disk->fops; - kdev_t dev = to_kdev_t(bdev->bd_dev); if (!bdops->media_changed) return 0; if (!bdops->media_changed(bdev->bd_disk)) return 0; - if (invalidate_device(dev, 0)) + if (__invalidate_device(bdev, 0)) printk("VFS: busy inodes on changed media.\n"); if (bdops->revalidate_disk) @@ -466,36 +465,6 @@ return 1; } -int full_check_disk_change(struct block_device *bdev) -{ - int res = 0; - if (bdev->bd_contains != bdev) - BUG(); - down(&bdev->bd_sem); - if (check_disk_change(bdev) && bdev->bd_invalidated) { - rescan_partitions(bdev->bd_disk, bdev); - res = 1; - } - up(&bdev->bd_sem); - return res; -} - -/* - * Will die as soon as two remaining callers get converted. - */ -int __check_disk_change(dev_t dev) -{ - struct block_device *bdev = bdget(dev); - int res; - if (!bdev) - return 0; - if (blkdev_get(bdev, FMODE_READ, 0, BDEV_RAW) < 0) - return 0; - res = full_check_disk_change(bdev); - blkdev_put(bdev, BDEV_RAW); - return res; -} - static void bd_set_size(struct block_device *bdev, loff_t size) { unsigned bsize = bdev_hardsect_size(bdev); diff -urN linux-2.5.68-bk5/fs/buffer.c linux-2.5.68-bk6/fs/buffer.c --- linux-2.5.68-bk5/fs/buffer.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/fs/buffer.c 2003-04-25 04:34:14.000000000 -0700 @@ -447,15 +447,6 @@ invalidate_inode_pages(bdev->bd_inode->i_mapping); } -void __invalidate_buffers(kdev_t dev, int destroy_dirty_buffers) -{ - struct block_device *bdev = bdget(kdev_t_to_nr(dev)); - if (bdev) { - invalidate_bdev(bdev, destroy_dirty_buffers); - bdput(bdev); - } -} - /* * Kick pdflush then try to free up some ZONE_NORMAL memory. */ diff -urN linux-2.5.68-bk5/fs/inode.c linux-2.5.68-bk6/fs/inode.c --- linux-2.5.68-bk5/fs/inode.c 2003-04-19 19:51:13.000000000 -0700 +++ linux-2.5.68-bk6/fs/inode.c 2003-04-25 04:34:14.000000000 -0700 @@ -340,15 +340,11 @@ return busy; } -int invalidate_device(kdev_t dev, int do_sync) +int __invalidate_device(struct block_device *bdev, int do_sync) { struct super_block *sb; - struct block_device *bdev = bdget(kdev_t_to_nr(dev)); int res; - if (!bdev) - return 0; - if (do_sync) fsync_bdev(bdev); @@ -366,6 +362,15 @@ drop_super(sb); } invalidate_bdev(bdev, 0); + return res; +} + +int invalidate_device(kdev_t dev, int do_sync) +{ + int res = 0; + struct block_device *bdev = bdget(kdev_t_to_nr(dev)); + if (bdev) + res = __invalidate_device(bdev, do_sync); bdput(bdev); return res; } diff -urN linux-2.5.68-bk5/fs/partitions/devfs.c linux-2.5.68-bk6/fs/partitions/devfs.c --- linux-2.5.68-bk5/fs/partitions/devfs.c 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/fs/partitions/devfs.c 2003-04-25 04:34:14.000000000 -0700 @@ -81,10 +81,6 @@ { char dirname[64], symlink[16]; - if (disk->devfs_name[0] != '\0') - sprintf(disk->devfs_name, "%s/disc%d", disk->disk_name, - disk->first_minor >> disk->minor_shift); - devfs_mk_dir(disk->devfs_name); devfs_mk_bdev(MKDEV(disk->major, disk->first_minor), S_IFBLK|S_IRUSR|S_IWUSR, diff -urN linux-2.5.68-bk5/fs/partitions/mac.c linux-2.5.68-bk6/fs/partitions/mac.c --- linux-2.5.68-bk5/fs/partitions/mac.c 2003-04-19 19:48:55.000000000 -0700 +++ linux-2.5.68-bk6/fs/partitions/mac.c 2003-04-25 04:34:14.000000000 -0700 @@ -12,7 +12,7 @@ #include "mac.h" #ifdef CONFIG_ALL_PPC -extern void note_bootable_part(kdev_t dev, int part, int goodness); +extern void note_bootable_part(dev_t dev, int part, int goodness); #endif /* @@ -121,8 +121,7 @@ } #ifdef CONFIG_ALL_PPC if (found_root_goodness) - note_bootable_part(to_kdev_t(bdev->bd_dev), - found_root, found_root_goodness); + note_bootable_part(bdev->bd_dev, found_root, found_root_goodness); #endif put_dev_sector(sect); diff -urN linux-2.5.68-bk5/include/linux/blkdev.h linux-2.5.68-bk6/include/linux/blkdev.h --- linux-2.5.68-bk5/include/linux/blkdev.h 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/include/linux/blkdev.h 2003-04-25 04:34:14.000000000 -0700 @@ -391,6 +391,8 @@ extern void blk_queue_invalidate_tags(request_queue_t *); extern void blk_congestion_wait(int rw, long timeout); +extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *); + #define MAX_PHYS_SEGMENTS 128 #define MAX_HW_SEGMENTS 128 #define MAX_SECTORS 255 diff -urN linux-2.5.68-bk5/include/linux/buffer_head.h linux-2.5.68-bk6/include/linux/buffer_head.h --- linux-2.5.68-bk5/include/linux/buffer_head.h 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/include/linux/buffer_head.h 2003-04-25 04:34:14.000000000 -0700 @@ -128,9 +128,6 @@ }) #define page_has_buffers(page) PagePrivate(page) -#define invalidate_buffers(dev) __invalidate_buffers((dev), 0) - - /* * Declarations */ @@ -159,7 +156,6 @@ void mark_buffer_async_read(struct buffer_head *bh); void mark_buffer_async_write(struct buffer_head *bh); void invalidate_bdev(struct block_device *, int); -void __invalidate_buffers(kdev_t dev, int); int sync_blockdev(struct block_device *bdev); void __wait_on_buffer(struct buffer_head *); wait_queue_head_t *bh_waitq_head(struct buffer_head *bh); diff -urN linux-2.5.68-bk5/include/linux/console.h linux-2.5.68-bk6/include/linux/console.h --- linux-2.5.68-bk5/include/linux/console.h 2003-04-19 19:49:19.000000000 -0700 +++ linux-2.5.68-bk6/include/linux/console.h 2003-04-25 04:34:14.000000000 -0700 @@ -97,12 +97,13 @@ char name[8]; void (*write)(struct console *, const char *, unsigned); int (*read)(struct console *, const char *, unsigned); - kdev_t (*device)(struct console *); + struct tty_driver *(*device)(struct console *, int *); void (*unblank)(void); int (*setup)(struct console *, char *); short flags; short index; int cflag; + void *data; struct console *next; }; diff -urN linux-2.5.68-bk5/include/linux/fb.h linux-2.5.68-bk6/include/linux/fb.h --- linux-2.5.68-bk5/include/linux/fb.h 2003-04-25 04:34:09.000000000 -0700 +++ linux-2.5.68-bk6/include/linux/fb.h 2003-04-25 04:34:14.000000000 -0700 @@ -396,7 +396,7 @@ }; struct fb_info { - kdev_t node; + int node; int flags; int open; /* Has this been open already ? */ #define FBINFO_FLAG_MODULE 1 /* Low-level driver is a module */ diff -urN linux-2.5.68-bk5/include/linux/fs.h linux-2.5.68-bk6/include/linux/fs.h --- linux-2.5.68-bk5/include/linux/fs.h 2003-04-19 19:48:56.000000000 -0700 +++ linux-2.5.68-bk6/include/linux/fs.h 2003-04-25 04:34:14.000000000 -0700 @@ -1102,9 +1102,8 @@ #define bio_data_dir(bio) ((bio)->bi_rw & 1) extern int check_disk_change(struct block_device *); -extern int full_check_disk_change(struct block_device *); -extern int __check_disk_change(dev_t); extern int invalidate_inodes(struct super_block *); +extern int __invalidate_device(struct block_device *, int); extern int invalidate_device(kdev_t, int); unsigned long invalidate_mapping_pages(struct address_space *mapping, pgoff_t start, pgoff_t end); diff -urN linux-2.5.68-bk5/include/linux/i2c-sensor.h linux-2.5.68-bk6/include/linux/i2c-sensor.h --- linux-2.5.68-bk5/include/linux/i2c-sensor.h 2003-04-19 19:49:57.000000000 -0700 +++ linux-2.5.68-bk6/include/linux/i2c-sensor.h 2003-04-25 04:34:14.000000000 -0700 @@ -22,18 +22,6 @@ #ifndef _LINUX_I2C_SENSOR_H #define _LINUX_I2C_SENSOR_H -#include - -/* The type of callback functions used in sensors_{proc,sysctl}_real */ -typedef void (*i2c_real_callback) (struct i2c_client * client, - int operation, int ctl_name, - int *nrels_mag, long *results); - -/* Values for the operation field in the above function type */ -#define SENSORS_PROC_REAL_INFO 1 -#define SENSORS_PROC_REAL_READ 2 -#define SENSORS_PROC_REAL_WRITE 3 - /* A structure containing detect information. Force variables overrule all other variables; they force a detection on that place. If a specific chip is given, the module blindly assumes this @@ -41,8 +29,8 @@ will still try to figure out what type of chip is present. This is useful if for some reasons the detect for SMBus or ISA address space filled fails. - probe: insmod parameter. Initialize this list with SENSORS_I2C_END values. - A list of pairs. The first value is a bus number (SENSORS_ISA_BUS for + probe: insmod parameter. Initialize this list with I2C_CLIENT_ISA_END values. + A list of pairs. The first value is a bus number (ANY_I2C_ISA_BUS for the ISA bus, -1 for any I2C bus), the second is the address. kind: The kind of chip. 0 equals any chip. */ @@ -52,10 +40,10 @@ }; /* A structure containing the detect information. - normal_i2c: filled in by the module writer. Terminated by SENSORS_I2C_END. + normal_i2c: filled in by the module writer. Terminated by I2C_CLIENT_ISA_END. A list of I2C addresses which should normally be examined. normal_i2c_range: filled in by the module writer. Terminated by - SENSORS_I2C_END + I2C_CLIENT_ISA_END A list of pairs of I2C addresses, each pair being an inclusive range of addresses which should normally be examined. normal_isa: filled in by the module writer. Terminated by SENSORS_ISA_END. @@ -66,24 +54,24 @@ range of addresses which should normally be examined. The third is the modulo parameter: only addresses which are 0 module this value relative to the first address of the range are actually considered. - probe: insmod parameter. Initialize this list with SENSORS_I2C_END values. - A list of pairs. The first value is a bus number (SENSORS_ISA_BUS for + probe: insmod parameter. Initialize this list with I2C_CLIENT_ISA_END values. + A list of pairs. The first value is a bus number (ANY_I2C_ISA_BUS for the ISA bus, -1 for any I2C bus), the second is the address. These addresses are also probed, as if they were in the 'normal' list. - probe_range: insmod parameter. Initialize this list with SENSORS_I2C_END + probe_range: insmod parameter. Initialize this list with I2C_CLIENT_ISA_END values. - A list of triples. The first value is a bus number (SENSORS_ISA_BUS for + A list of triples. The first value is a bus number (ANY_I2C_ISA_BUS for the ISA bus, -1 for any I2C bus), the second and third are addresses. These form an inclusive range of addresses that are also probed, as if they were in the 'normal' list. - ignore: insmod parameter. Initialize this list with SENSORS_I2C_END values. - A list of pairs. The first value is a bus number (SENSORS_ISA_BUS for + ignore: insmod parameter. Initialize this list with I2C_CLIENT_ISA_END values. + A list of pairs. The first value is a bus number (ANY_I2C_ISA_BUS for the ISA bus, -1 for any I2C bus), the second is the I2C address. These addresses are never probed. This parameter overrules 'normal' and 'probe', but not the 'force' lists. - ignore_range: insmod parameter. Initialize this list with SENSORS_I2C_END + ignore_range: insmod parameter. Initialize this list with I2C_CLIENT_ISA_END values. - A list of triples. The first value is a bus number (SENSORS_ISA_BUS for + A list of triples. The first value is a bus number (ANY_I2C_ISA_BUS for the ISA bus, -1 for any I2C bus), the second and third are addresses. These form an inclusive range of I2C addresses that are never probed. This parameter overrules 'normal' and 'probe', but not the 'force' lists. @@ -102,74 +90,35 @@ struct i2c_force_data *forces; }; -/* Internal numbers to terminate lists */ -#define SENSORS_I2C_END 0xfffe -#define SENSORS_ISA_END 0xfffefffe - -/* The numbers to use to set an ISA or I2C bus address */ -#define SENSORS_ISA_BUS 9191 -#define SENSORS_ANY_I2C_BUS 0xffff - -/* The length of the option lists */ -#define SENSORS_MAX_OPTS 48 - -/* Default fill of many variables */ -#define SENSORS_DEFAULTS {SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ - SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ - SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ - SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ - SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ - SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ - SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ - SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ - SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ - SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ - SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ - SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ - SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ - SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ - SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END, \ - SENSORS_I2C_END, SENSORS_I2C_END, SENSORS_I2C_END} - -/* This is ugly. We need to evaluate SENSORS_MAX_OPTS before it is - stringified */ -#define SENSORS_MODPARM_AUX1(x) "1-" #x "h" -#define SENSORS_MODPARM_AUX(x) SENSORS_MODPARM_AUX1(x) -#define SENSORS_MODPARM SENSORS_MODPARM_AUX(SENSORS_MAX_OPTS) - -/* SENSORS_MODULE_PARM creates a module parameter, and puts it in the - module header */ -#define SENSORS_MODULE_PARM(var,desc) \ - static unsigned short var[SENSORS_MAX_OPTS] = SENSORS_DEFAULTS; \ - MODULE_PARM(var,SENSORS_MODPARM); \ - MODULE_PARM_DESC(var,desc) - -/* SENSORS_MODULE_PARM creates a 'force_*' module parameter, and puts it in - the module header */ #define SENSORS_MODULE_PARM_FORCE(name) \ - SENSORS_MODULE_PARM(force_ ## name, \ + I2C_CLIENT_MODULE_PARM(force_ ## name, \ "List of adapter,address pairs which are unquestionably" \ " assumed to contain a `" # name "' chip") /* This defines several insmod variables, and the addr_data structure */ #define SENSORS_INSMOD \ - SENSORS_MODULE_PARM(probe, \ + I2C_CLIENT_MODULE_PARM(probe, \ "List of adapter,address pairs to scan additionally"); \ - SENSORS_MODULE_PARM(probe_range, \ + I2C_CLIENT_MODULE_PARM(probe_range, \ "List of adapter,start-addr,end-addr triples to scan " \ "additionally"); \ - SENSORS_MODULE_PARM(ignore, \ + I2C_CLIENT_MODULE_PARM(ignore, \ "List of adapter,address pairs not to scan"); \ - SENSORS_MODULE_PARM(ignore_range, \ + I2C_CLIENT_MODULE_PARM(ignore_range, \ "List of adapter,start-addr,end-addr triples not to " \ "scan"); \ - static struct i2c_address_data addr_data = \ - {normal_i2c, normal_i2c_range, \ - normal_isa, normal_isa_range, \ - probe, probe_range, \ - ignore, ignore_range, \ - forces} + static struct i2c_address_data addr_data = { \ + .normal_i2c = normal_i2c, \ + .normal_i2c_range = normal_i2c_range, \ + .normal_isa = normal_isa, \ + .normal_isa_range = normal_isa_range, \ + .probe = probe, \ + .probe_range = probe_range, \ + .ignore = ignore, \ + .ignore_range = ignore_range, \ + .forces = forces, \ + } /* The following functions create an enum with the chip names as elements. The first element of the enum is any_chip. These are the only macros @@ -177,7 +126,7 @@ #define SENSORS_INSMOD_0 \ enum chips { any_chip }; \ - SENSORS_MODULE_PARM(force, \ + I2C_CLIENT_MODULE_PARM(force, \ "List of adapter,address pairs to boldly assume " \ "to be present"); \ static struct i2c_force_data forces[] = {{force,any_chip},{NULL}}; \ @@ -185,7 +134,7 @@ #define SENSORS_INSMOD_1(chip1) \ enum chips { any_chip, chip1 }; \ - SENSORS_MODULE_PARM(force, \ + I2C_CLIENT_MODULE_PARM(force, \ "List of adapter,address pairs to boldly assume " \ "to be present"); \ SENSORS_MODULE_PARM_FORCE(chip1); \ @@ -196,7 +145,7 @@ #define SENSORS_INSMOD_2(chip1,chip2) \ enum chips { any_chip, chip1, chip2 }; \ - SENSORS_MODULE_PARM(force, \ + I2C_CLIENT_MODULE_PARM(force, \ "List of adapter,address pairs to boldly assume " \ "to be present"); \ SENSORS_MODULE_PARM_FORCE(chip1); \ @@ -209,7 +158,7 @@ #define SENSORS_INSMOD_3(chip1,chip2,chip3) \ enum chips { any_chip, chip1, chip2, chip3 }; \ - SENSORS_MODULE_PARM(force, \ + I2C_CLIENT_MODULE_PARM(force, \ "List of adapter,address pairs to boldly assume " \ "to be present"); \ SENSORS_MODULE_PARM_FORCE(chip1); \ @@ -224,7 +173,7 @@ #define SENSORS_INSMOD_4(chip1,chip2,chip3,chip4) \ enum chips { any_chip, chip1, chip2, chip3, chip4 }; \ - SENSORS_MODULE_PARM(force, \ + I2C_CLIENT_MODULE_PARM(force, \ "List of adapter,address pairs to boldly assume " \ "to be present"); \ SENSORS_MODULE_PARM_FORCE(chip1); \ @@ -241,7 +190,7 @@ #define SENSORS_INSMOD_5(chip1,chip2,chip3,chip4,chip5) \ enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }; \ - SENSORS_MODULE_PARM(force, \ + I2C_CLIENT_MODULE_PARM(force, \ "List of adapter,address pairs to boldly assume " \ "to be present"); \ SENSORS_MODULE_PARM_FORCE(chip1); \ @@ -260,7 +209,7 @@ #define SENSORS_INSMOD_6(chip1,chip2,chip3,chip4,chip5,chip6) \ enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }; \ - SENSORS_MODULE_PARM(force, \ + I2C_CLIENT_MODULE_PARM(force, \ "List of adapter,address pairs to boldly assume " \ "to be present"); \ SENSORS_MODULE_PARM_FORCE(chip1); \ @@ -281,7 +230,7 @@ #define SENSORS_INSMOD_7(chip1,chip2,chip3,chip4,chip5,chip6,chip7) \ enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, chip7 }; \ - SENSORS_MODULE_PARM(force, \ + I2C_CLIENT_MODULE_PARM(force, \ "List of adapter,address pairs to boldly assume " \ "to be present"); \ SENSORS_MODULE_PARM_FORCE(chip1); \ @@ -304,7 +253,7 @@ #define SENSORS_INSMOD_8(chip1,chip2,chip3,chip4,chip5,chip6,chip7,chip8) \ enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8 }; \ - SENSORS_MODULE_PARM(force, \ + I2C_CLIENT_MODULE_PARM(force, \ "List of adapter,address pairs to boldly assume " \ "to be present"); \ SENSORS_MODULE_PARM_FORCE(chip1); \ @@ -327,16 +276,13 @@ {NULL}}; \ SENSORS_INSMOD -typedef int i2c_found_addr_proc(struct i2c_adapter *adapter, - int addr, int kind); - /* Detect function. It iterates over all possible addresses itself. For SMBus addresses, it will only call found_proc if some client is connected to the SMBus (unless a 'force' matched); for ISA detections, this is not done. */ extern int i2c_detect(struct i2c_adapter *adapter, - struct i2c_address_data *address_data, - i2c_found_addr_proc * found_proc); + struct i2c_address_data *address_data, + int (*found_proc) (struct i2c_adapter *, int, int)); /* This macro is used to scale user-input to sensible values in almost all @@ -350,24 +296,4 @@ else return value; } - - -/* The maximum length of the prefix */ -#define SENSORS_PREFIX_MAX 20 - -/* Sysctl IDs */ -#ifdef DEV_HWMON -#define DEV_SENSORS DEV_HWMON -#else /* ndef DEV_HWMOM */ -#define DEV_SENSORS 2 /* The id of the lm_sensors directory within the - dev table */ -#endif /* def DEV_HWMON */ - -#define SENSORS_CHIPS 1 -struct i2c_chips_data { - int sysctl_id; - char name[SENSORS_PREFIX_MAX + 13]; -}; - #endif /* def _LINUX_I2C_SENSOR_H */ - diff -urN linux-2.5.68-bk5/include/linux/i2c.h linux-2.5.68-bk6/include/linux/i2c.h --- linux-2.5.68-bk5/include/linux/i2c.h 2003-04-19 19:48:53.000000000 -0700 +++ linux-2.5.68-bk6/include/linux/i2c.h 2003-04-25 04:34:14.000000000 -0700 @@ -290,10 +290,12 @@ }; /* Internal numbers to terminate lists */ -#define I2C_CLIENT_END 0xfffe +#define I2C_CLIENT_END 0xfffe +#define I2C_CLIENT_ISA_END 0xfffefffe /* The numbers to use to set I2C bus address */ -#define ANY_I2C_BUS 0xffff +#define ANY_I2C_BUS 0xffff +#define ANY_I2C_ISA_BUS 9191 /* The length of the option lists */ #define I2C_CLIENT_MAX_OPTS 48 @@ -338,12 +340,9 @@ * It will only call found_proc if some client is connected at the * specific address (unless a 'force' matched); */ -typedef int i2c_client_found_addr_proc (struct i2c_adapter *adapter, - int addr, unsigned short flags,int kind); - extern int i2c_probe(struct i2c_adapter *adapter, struct i2c_client_address_data *address_data, - i2c_client_found_addr_proc *found_proc); + int (*found_proc) (struct i2c_adapter *, int, int)); /* An ioctl like call to set div. parameters of the adapter. */ @@ -559,11 +558,15 @@ I2C_CLIENT_MODULE_PARM(force, \ "List of adapter,address pairs to boldly assume " \ "to be present"); \ - static struct i2c_client_address_data addr_data = \ - {normal_i2c, normal_i2c_range, \ - probe, probe_range, \ - ignore, ignore_range, \ - force} + static struct i2c_client_address_data addr_data = { \ + .normal_i2c = normal_i2c, \ + .normal_i2c_range = normal_i2c_range, \ + .probe = probe, \ + .probe_range = probe_range, \ + .ignore = ignore, \ + .ignore_range = ignore_range, \ + .force = force, \ + } /* Detect whether we are on the isa bus. If this returns true, all i2c access will fail! */ diff -urN linux-2.5.68-bk5/include/linux/kdev_t.h linux-2.5.68-bk6/include/linux/kdev_t.h --- linux-2.5.68-bk5/include/linux/kdev_t.h 2003-04-19 19:50:41.000000000 -0700 +++ linux-2.5.68-bk6/include/linux/kdev_t.h 2003-04-25 04:34:14.000000000 -0700 @@ -99,7 +99,6 @@ #define HASHDEV(dev) (kdev_val(dev)) #define NODEV (mk_kdev(0,0)) -#define B_FREE (mk_kdev(0xff,0xff)) static inline int kdev_same(kdev_t dev1, kdev_t dev2) { diff -urN linux-2.5.68-bk5/include/linux/serial_core.h linux-2.5.68-bk6/include/linux/serial_core.h --- linux-2.5.68-bk5/include/linux/serial_core.h 2003-04-19 19:48:51.000000000 -0700 +++ linux-2.5.68-bk6/include/linux/serial_core.h 2003-04-25 04:34:14.000000000 -0700 @@ -300,6 +300,7 @@ int *flow); int uart_set_options(struct uart_port *port, struct console *co, int baud, int parity, int bits, int flow); +struct tty_driver *uart_console_device(struct console *co, int *index); /* * Port/driver registration/removal diff -urN linux-2.5.68-bk5/include/linux/wrapper.h linux-2.5.68-bk6/include/linux/wrapper.h --- linux-2.5.68-bk5/include/linux/wrapper.h 2003-04-19 19:48:57.000000000 -0700 +++ linux-2.5.68-bk6/include/linux/wrapper.h 1969-12-31 16:00:00.000000000 -0800 @@ -1,7 +0,0 @@ -#ifndef _WRAPPER_H_ -#define _WRAPPER_H_ - -#define mem_map_reserve(p) set_bit(PG_reserved, &((p)->flags)) -#define mem_map_unreserve(p) clear_bit(PG_reserved, &((p)->flags)) - -#endif /* _WRAPPER_H_ */ diff -urN linux-2.5.68-bk5/include/media/saa7146.h linux-2.5.68-bk6/include/media/saa7146.h --- linux-2.5.68-bk5/include/media/saa7146.h 2003-04-19 19:48:49.000000000 -0700 +++ linux-2.5.68-bk6/include/media/saa7146.h 2003-04-25 04:34:14.000000000 -0700 @@ -6,7 +6,6 @@ #include /* for delay-stuff */ #include /* for kmalloc/kfree */ #include /* for pci-config-stuff, vendor ids etc. */ -#include /* for mem_map_reserve */ #include /* for "__init" */ #include /* for IMMEDIATE_BH */ #include /* for kernel module loader */ diff -urN linux-2.5.68-bk5/include/video/pm3fb.h linux-2.5.68-bk6/include/video/pm3fb.h --- linux-2.5.68-bk5/include/video/pm3fb.h 2003-04-19 19:50:44.000000000 -0700 +++ linux-2.5.68-bk6/include/video/pm3fb.h 2003-04-25 04:34:14.000000000 -0700 @@ -1147,11 +1147,6 @@ #define MUST_BYTESWAP #endif -/* for compatibility between 2.5, 2.4 and 2.2 */ -#ifndef B_FREE -#define B_FREE -1 -#endif - /* permedia3 -specific definitions */ #define PM3_SCALE_TO_CLOCK(pr, fe, po) ((2 * PM3_REF_CLOCK * fe) / (pr * (1 << (po)))) diff -urN linux-2.5.68-bk5/kernel/ksyms.c linux-2.5.68-bk6/kernel/ksyms.c --- linux-2.5.68-bk5/kernel/ksyms.c 2003-04-19 19:48:49.000000000 -0700 +++ linux-2.5.68-bk6/kernel/ksyms.c 2003-04-25 04:34:14.000000000 -0700 @@ -186,11 +186,10 @@ EXPORT_SYMBOL(put_filp); EXPORT_SYMBOL(files_lock); EXPORT_SYMBOL(check_disk_change); -EXPORT_SYMBOL(__check_disk_change); -EXPORT_SYMBOL(__invalidate_buffers); EXPORT_SYMBOL(invalidate_bdev); EXPORT_SYMBOL(invalidate_inodes); EXPORT_SYMBOL(invalidate_device); +EXPORT_SYMBOL(__invalidate_device); EXPORT_SYMBOL(invalidate_inode_pages); EXPORT_SYMBOL_GPL(invalidate_inode_pages2); EXPORT_SYMBOL(truncate_inode_pages); diff -urN linux-2.5.68-bk5/net/bridge/br_ioctl.c linux-2.5.68-bk6/net/bridge/br_ioctl.c --- linux-2.5.68-bk5/net/bridge/br_ioctl.c 2003-04-19 19:48:51.000000000 -0700 +++ linux-2.5.68-bk6/net/bridge/br_ioctl.c 2003-04-25 04:34:14.000000000 -0700 @@ -19,6 +19,21 @@ #include #include "br_private.h" + +/* Report time remaining in user HZ for compatibility. */ +static inline unsigned long timer_residue(const struct br_timer *timer) +{ + return timer->running + ? ((jiffies - timer->expires) * USER_HZ)/HZ + : 0; +} + +/* Convert API times in USER_HZ to kernel */ +static inline unsigned long user_to_ticks(unsigned long utick) +{ + return (utick * HZ) / USER_HZ; +} + static int br_ioctl_device(struct net_bridge *br, unsigned int cmd, unsigned long arg0, @@ -70,10 +85,10 @@ b.stp_enabled = br->stp_enabled; b.ageing_time = br->ageing_time; b.gc_interval = br->gc_interval; - b.hello_timer_value = br_timer_get_residue(&br->hello_timer); - b.tcn_timer_value = br_timer_get_residue(&br->tcn_timer); - b.topology_change_timer_value = br_timer_get_residue(&br->topology_change_timer); - b.gc_timer_value = br_timer_get_residue(&br->gc_timer); + b.hello_timer_value = timer_residue(&br->hello_timer); + b.tcn_timer_value = timer_residue(&br->tcn_timer); + b.topology_change_timer_value = timer_residue(&br->topology_change_timer); + b.gc_timer_value = timer_residue(&br->gc_timer); read_unlock(&br->lock); if (copy_to_user((void *)arg0, &b, sizeof(b))) @@ -102,34 +117,34 @@ case BRCTL_SET_BRIDGE_FORWARD_DELAY: write_lock(&br->lock); - br->bridge_forward_delay = arg0; + br->bridge_forward_delay = user_to_ticks(arg0); if (br_is_root_bridge(br)) - br->forward_delay = arg0; + br->forward_delay = br->bridge_forward_delay; write_unlock(&br->lock); return 0; case BRCTL_SET_BRIDGE_HELLO_TIME: write_lock(&br->lock); - br->bridge_hello_time = arg0; + br->bridge_hello_time = user_to_ticks(arg0); if (br_is_root_bridge(br)) - br->hello_time = arg0; + br->hello_time = br->bridge_hello_time; write_unlock(&br->lock); return 0; case BRCTL_SET_BRIDGE_MAX_AGE: write_lock(&br->lock); - br->bridge_max_age = arg0; + br->bridge_max_age = user_to_ticks(arg0); if (br_is_root_bridge(br)) - br->max_age = arg0; + br->max_age = br->bridge_max_age; write_unlock(&br->lock); return 0; case BRCTL_SET_AGEING_TIME: - br->ageing_time = arg0; + br->ageing_time = user_to_ticks(arg0); return 0; case BRCTL_SET_GC_INTERVAL: - br->gc_interval = arg0; + br->gc_interval = user_to_ticks(arg0); return 0; case BRCTL_GET_PORT_INFO: @@ -138,8 +153,10 @@ struct net_bridge_port *pt; read_lock(&br->lock); - if ((pt = br_get_port(br, arg1)) == NULL) + if ((pt = br_get_port(br, arg1)) == NULL) { + read_unlock(&br->lock); return -EINVAL; + } memset(&p, 0, sizeof(struct __port_info)); memcpy(&p.designated_root, &pt->designated_root, 8); @@ -151,9 +168,9 @@ p.state = pt->state; p.top_change_ack = pt->topology_change_ack; p.config_pending = pt->config_pending; - p.message_age_timer_value = br_timer_get_residue(&pt->message_age_timer); - p.forward_delay_timer_value = br_timer_get_residue(&pt->forward_delay_timer); - p.hold_timer_value = br_timer_get_residue(&pt->hold_timer); + p.message_age_timer_value = timer_residue(&pt->message_age_timer); + p.forward_delay_timer_value = timer_residue(&pt->forward_delay_timer); + p.hold_timer_value = timer_residue(&pt->hold_timer); read_unlock(&br->lock); @@ -176,25 +193,29 @@ case BRCTL_SET_PORT_PRIORITY: { struct net_bridge_port *p; + int ret = 0; write_lock(&br->lock); - if ((p = br_get_port(br, arg0)) == NULL) - return -EINVAL; - br_stp_set_port_priority(p, arg1); + if ((p = br_get_port(br, arg0)) == NULL) + ret = -EINVAL; + else + br_stp_set_port_priority(p, arg1); write_unlock(&br->lock); - return 0; + return ret; } case BRCTL_SET_PATH_COST: { struct net_bridge_port *p; + int ret = 0; write_lock(&br->lock); if ((p = br_get_port(br, arg0)) == NULL) - return -EINVAL; - br_stp_set_path_cost(p, arg1); + ret = -EINVAL; + else + br_stp_set_path_cost(p, arg1); write_unlock(&br->lock); - return 0; + return ret; } case BRCTL_GET_FDB_ENTRIES: diff -urN linux-2.5.68-bk5/sound/drivers/mpu401/mpu401_uart.c linux-2.5.68-bk6/sound/drivers/mpu401/mpu401_uart.c --- linux-2.5.68-bk5/sound/drivers/mpu401/mpu401_uart.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/drivers/mpu401/mpu401_uart.c 2003-04-25 04:34:14.000000000 -0700 @@ -123,7 +123,7 @@ */ irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - mpu401_t *mpu = snd_magic_cast(mpu401_t, dev_id, return); + mpu401_t *mpu = snd_magic_cast(mpu401_t, dev_id, return IRQ_NONE); if (mpu == NULL) return IRQ_NONE; diff -urN linux-2.5.68-bk5/sound/drivers/mtpav.c linux-2.5.68-bk6/sound/drivers/mtpav.c --- linux-2.5.68-bk5/sound/drivers/mtpav.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/drivers/mtpav.c 2003-04-25 04:34:14.000000000 -0700 @@ -587,7 +587,7 @@ static irqreturn_t snd_mtpav_irqh(int irq, void *dev_id, struct pt_regs *regs) { - mtpav_t *mcard = snd_magic_cast(mtpav_t, dev_id, return); + mtpav_t *mcard = snd_magic_cast(mtpav_t, dev_id, return IRQ_NONE); //printk("irqh()\n"); spin_lock(&mcard->spinlock); diff -urN linux-2.5.68-bk5/sound/isa/ad1816a/ad1816a_lib.c linux-2.5.68-bk6/sound/isa/ad1816a/ad1816a_lib.c --- linux-2.5.68-bk5/sound/isa/ad1816a/ad1816a_lib.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/isa/ad1816a/ad1816a_lib.c 2003-04-25 04:34:14.000000000 -0700 @@ -313,7 +313,7 @@ static irqreturn_t snd_ad1816a_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - ad1816a_t *chip = snd_magic_cast(ad1816a_t, dev_id, return); + ad1816a_t *chip = snd_magic_cast(ad1816a_t, dev_id, return IRQ_NONE); unsigned char status; spin_lock(&chip->lock); diff -urN linux-2.5.68-bk5/sound/isa/ad1848/ad1848_lib.c linux-2.5.68-bk6/sound/isa/ad1848/ad1848_lib.c --- linux-2.5.68-bk5/sound/isa/ad1848/ad1848_lib.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/isa/ad1848/ad1848_lib.c 2003-04-25 04:34:14.000000000 -0700 @@ -587,7 +587,7 @@ irqreturn_t snd_ad1848_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - ad1848_t *chip = snd_magic_cast(ad1848_t, dev_id, return); + ad1848_t *chip = snd_magic_cast(ad1848_t, dev_id, return IRQ_NONE); if ((chip->mode & AD1848_MODE_PLAY) && chip->playback_substream && (chip->mode & AD1848_MODE_RUNNING)) diff -urN linux-2.5.68-bk5/sound/isa/cs423x/cs4231_lib.c linux-2.5.68-bk6/sound/isa/cs423x/cs4231_lib.c --- linux-2.5.68-bk5/sound/isa/cs423x/cs4231_lib.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/isa/cs423x/cs4231_lib.c 2003-04-25 04:34:14.000000000 -0700 @@ -969,7 +969,7 @@ irqreturn_t snd_cs4231_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - cs4231_t *chip = snd_magic_cast(cs4231_t, dev_id, return); + cs4231_t *chip = snd_magic_cast(cs4231_t, dev_id, return IRQ_NONE); unsigned char status; status = snd_cs4231_in(chip, CS4231_IRQ_STATUS); diff -urN linux-2.5.68-bk5/sound/isa/es1688/es1688_lib.c linux-2.5.68-bk6/sound/isa/es1688/es1688_lib.c --- linux-2.5.68-bk5/sound/isa/es1688/es1688_lib.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/isa/es1688/es1688_lib.c 2003-04-25 04:34:14.000000000 -0700 @@ -484,7 +484,7 @@ irqreturn_t snd_es1688_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - es1688_t *chip = snd_magic_cast(es1688_t, dev_id, return); + es1688_t *chip = snd_magic_cast(es1688_t, dev_id, return IRQ_NONE); if (chip->trigger_value == 0x05) /* ok.. playback is active */ snd_pcm_period_elapsed(chip->playback_substream); diff -urN linux-2.5.68-bk5/sound/isa/es18xx.c linux-2.5.68-bk6/sound/isa/es18xx.c --- linux-2.5.68-bk5/sound/isa/es18xx.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/isa/es18xx.c 2003-04-25 04:34:14.000000000 -0700 @@ -729,7 +729,7 @@ static irqreturn_t snd_es18xx_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - es18xx_t *chip = snd_magic_cast(es18xx_t, dev_id, return); + es18xx_t *chip = snd_magic_cast(es18xx_t, dev_id, return IRQ_NONE); unsigned char status; if (chip->caps & ES18XX_CONTROL) { diff -urN linux-2.5.68-bk5/sound/isa/gus/gus_irq.c linux-2.5.68-bk6/sound/isa/gus/gus_irq.c --- linux-2.5.68-bk5/sound/isa/gus/gus_irq.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/isa/gus/gus_irq.c 2003-04-25 04:34:14.000000000 -0700 @@ -32,7 +32,8 @@ irqreturn_t snd_gus_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - snd_gus_card_t * gus = snd_magic_cast(snd_gus_card_t, dev_id, return); + snd_gus_card_t * gus = snd_magic_cast(snd_gus_card_t, + dev_id, return IRQ_NONE); unsigned char status; int loop = 100; int handled = 0; diff -urN linux-2.5.68-bk5/sound/isa/opl3sa2.c linux-2.5.68-bk6/sound/isa/opl3sa2.c --- linux-2.5.68-bk5/sound/isa/opl3sa2.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/isa/opl3sa2.c 2003-04-25 04:34:14.000000000 -0700 @@ -300,7 +300,7 @@ static irqreturn_t snd_opl3sa2_interrupt(int irq, void *dev_id, struct pt_regs *regs) { unsigned short status; - opl3sa2_t *chip = snd_magic_cast(opl3sa2_t, dev_id, return); + opl3sa2_t *chip = snd_magic_cast(opl3sa2_t, dev_id, return IRQ_NONE); int handled = 0; if (chip == NULL || chip->card == NULL) diff -urN linux-2.5.68-bk5/sound/isa/opti9xx/opti92x-ad1848.c linux-2.5.68-bk6/sound/isa/opti9xx/opti92x-ad1848.c --- linux-2.5.68-bk5/sound/isa/opti9xx/opti92x-ad1848.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/isa/opti9xx/opti92x-ad1848.c 2003-04-25 04:34:14.000000000 -0700 @@ -1127,7 +1127,7 @@ irqreturn_t snd_opti93x_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - opti93x_t *codec = snd_magic_cast(opti93x_t, dev_id, return); + opti93x_t *codec = snd_magic_cast(opti93x_t, dev_id, return IRQ_NONE); unsigned char status; status = snd_opti9xx_read(codec->chip, OPTi9XX_MC_REG(11)); diff -urN linux-2.5.68-bk5/sound/isa/sb/es968.c linux-2.5.68-bk6/sound/isa/sb/es968.c --- linux-2.5.68-bk5/sound/isa/sb/es968.c 2003-04-19 19:49:29.000000000 -0700 +++ linux-2.5.68-bk6/sound/isa/sb/es968.c 2003-04-25 04:34:14.000000000 -0700 @@ -78,16 +78,17 @@ #define DRIVER_NAME "snd-card-es968" -static void snd_card_es968_interrupt(int irq, void *dev_id, +static irqreturn_t snd_card_es968_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - sb_t *chip = snd_magic_cast(sb_t, dev_id, return); + sb_t *chip = snd_magic_cast(sb_t, dev_id, return IRQ_NONE); if (chip->open & SB_OPEN_PCM) { snd_sb8dsp_interrupt(chip); } else { snd_sb8dsp_midi_interrupt(chip); } + return IRQ_HANDLED; } static int __devinit snd_card_es968_pnp(int dev, struct snd_card_es968 *acard, diff -urN linux-2.5.68-bk5/sound/isa/sb/sb16_main.c linux-2.5.68-bk6/sound/isa/sb/sb16_main.c --- linux-2.5.68-bk5/sound/isa/sb/sb16_main.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/isa/sb/sb16_main.c 2003-04-25 04:34:14.000000000 -0700 @@ -395,7 +395,7 @@ irqreturn_t snd_sb16dsp_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - sb_t *chip = snd_magic_cast(sb_t, dev_id, return); + sb_t *chip = snd_magic_cast(sb_t, dev_id, return IRQ_NONE); unsigned char status; int ok; diff -urN linux-2.5.68-bk5/sound/isa/sb/sb8.c linux-2.5.68-bk6/sound/isa/sb/sb8.c --- linux-2.5.68-bk5/sound/isa/sb/sb8.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/isa/sb/sb8.c 2003-04-25 04:34:14.000000000 -0700 @@ -72,7 +72,7 @@ static irqreturn_t snd_sb8_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - sb_t *chip = snd_magic_cast(sb_t, dev_id, return); + sb_t *chip = snd_magic_cast(sb_t, dev_id, return IRQ_NONE); if (chip->open & SB_OPEN_PCM) { snd_sb8dsp_interrupt(chip); diff -urN linux-2.5.68-bk5/sound/oss/btaudio.c linux-2.5.68-bk6/sound/oss/btaudio.c --- linux-2.5.68-bk5/sound/oss/btaudio.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/oss/btaudio.c 2003-04-25 04:34:14.000000000 -0700 @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include diff -urN linux-2.5.68-bk5/sound/oss/cmpci.c linux-2.5.68-bk6/sound/oss/cmpci.c --- linux-2.5.68-bk5/sound/oss/cmpci.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/oss/cmpci.c 2003-04-25 04:34:14.000000000 -0700 @@ -98,7 +98,6 @@ #include #include #include -#include #include #include #include diff -urN linux-2.5.68-bk5/sound/oss/cs4281/cs4281m.c linux-2.5.68-bk6/sound/oss/cs4281/cs4281m.c --- linux-2.5.68-bk5/sound/oss/cs4281/cs4281m.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/oss/cs4281/cs4281m.c 2003-04-25 04:34:14.000000000 -0700 @@ -71,7 +71,6 @@ #include #include #include -#include #include #include diff -urN linux-2.5.68-bk5/sound/oss/cs46xx.c linux-2.5.68-bk6/sound/oss/cs46xx.c --- linux-2.5.68-bk5/sound/oss/cs46xx.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/oss/cs46xx.c 2003-04-25 04:34:14.000000000 -0700 @@ -89,7 +89,6 @@ #include #include #include -#include #include #include diff -urN linux-2.5.68-bk5/sound/oss/dmabuf.c linux-2.5.68-bk6/sound/oss/dmabuf.c --- linux-2.5.68-bk5/sound/oss/dmabuf.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/oss/dmabuf.c 2003-04-25 04:34:14.000000000 -0700 @@ -26,7 +26,6 @@ #define SAMPLE_ROUNDUP 0 #include "sound_config.h" -#include #define DMAP_FREE_ON_CLOSE 0 #define DMAP_KEEP_ON_CLOSE 1 diff -urN linux-2.5.68-bk5/sound/oss/emu10k1/audio.c linux-2.5.68-bk6/sound/oss/emu10k1/audio.c --- linux-2.5.68-bk5/sound/oss/emu10k1/audio.c 2003-04-19 19:48:51.000000000 -0700 +++ linux-2.5.68-bk6/sound/oss/emu10k1/audio.c 2003-04-25 04:34:14.000000000 -0700 @@ -37,8 +37,6 @@ #include #include #include -#include - #include "hwaccess.h" #include "cardwo.h" diff -urN linux-2.5.68-bk5/sound/oss/emu10k1/passthrough.c linux-2.5.68-bk6/sound/oss/emu10k1/passthrough.c --- linux-2.5.68-bk5/sound/oss/emu10k1/passthrough.c 2003-04-19 19:49:26.000000000 -0700 +++ linux-2.5.68-bk6/sound/oss/emu10k1/passthrough.c 2003-04-25 04:34:14.000000000 -0700 @@ -36,7 +36,6 @@ #include #include #include -#include #include "hwaccess.h" #include "cardwo.h" diff -urN linux-2.5.68-bk5/sound/oss/es1370.c linux-2.5.68-bk6/sound/oss/es1370.c --- linux-2.5.68-bk5/sound/oss/es1370.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/oss/es1370.c 2003-04-25 04:34:14.000000000 -0700 @@ -151,7 +151,6 @@ #include #include #include -#include #include #include #include diff -urN linux-2.5.68-bk5/sound/oss/es1371.c linux-2.5.68-bk6/sound/oss/es1371.c --- linux-2.5.68-bk5/sound/oss/es1371.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/oss/es1371.c 2003-04-25 04:34:14.000000000 -0700 @@ -126,7 +126,6 @@ #include #include #include -#include #include #include diff -urN linux-2.5.68-bk5/sound/oss/esssolo1.c linux-2.5.68-bk6/sound/oss/esssolo1.c --- linux-2.5.68-bk5/sound/oss/esssolo1.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/oss/esssolo1.c 2003-04-25 04:34:14.000000000 -0700 @@ -102,7 +102,6 @@ #include #include #include -#include #include #include diff -urN linux-2.5.68-bk5/sound/oss/i810_audio.c linux-2.5.68-bk6/sound/oss/i810_audio.c --- linux-2.5.68-bk5/sound/oss/i810_audio.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/oss/i810_audio.c 2003-04-25 04:34:14.000000000 -0700 @@ -96,7 +96,6 @@ #include #include #include -#include #include #include diff -urN linux-2.5.68-bk5/sound/oss/ite8172.c linux-2.5.68-bk6/sound/oss/ite8172.c --- linux-2.5.68-bk5/sound/oss/ite8172.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/oss/ite8172.c 2003-04-25 04:34:14.000000000 -0700 @@ -67,7 +67,6 @@ #include #include #include -#include #include #include #include diff -urN linux-2.5.68-bk5/sound/oss/maestro.c linux-2.5.68-bk6/sound/oss/maestro.c --- linux-2.5.68-bk5/sound/oss/maestro.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/oss/maestro.c 2003-04-25 04:34:14.000000000 -0700 @@ -208,7 +208,6 @@ #include #include #include -#include #include #include #include diff -urN linux-2.5.68-bk5/sound/oss/maestro3.c linux-2.5.68-bk6/sound/oss/maestro3.c --- linux-2.5.68-bk5/sound/oss/maestro3.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/oss/maestro3.c 2003-04-25 04:34:14.000000000 -0700 @@ -149,11 +149,6 @@ #include #include - /* - * for crizappy mmap() - */ -#include - #include "maestro3.h" #define M_DEBUG 1 diff -urN linux-2.5.68-bk5/sound/oss/nec_vrc5477.c linux-2.5.68-bk6/sound/oss/nec_vrc5477.c --- linux-2.5.68-bk5/sound/oss/nec_vrc5477.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/oss/nec_vrc5477.c 2003-04-25 04:34:14.000000000 -0700 @@ -78,7 +78,6 @@ #include #include #include -#include #include #include #include diff -urN linux-2.5.68-bk5/sound/oss/os.h linux-2.5.68-bk6/sound/oss/os.h --- linux-2.5.68-bk5/sound/oss/os.h 2003-04-19 19:51:19.000000000 -0700 +++ linux-2.5.68-bk6/sound/oss/os.h 2003-04-25 04:34:14.000000000 -0700 @@ -32,7 +32,6 @@ #include #endif -#include #include #define FALSE 0 diff -urN linux-2.5.68-bk5/sound/oss/sonicvibes.c linux-2.5.68-bk6/sound/oss/sonicvibes.c --- linux-2.5.68-bk5/sound/oss/sonicvibes.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/oss/sonicvibes.c 2003-04-25 04:34:14.000000000 -0700 @@ -115,7 +115,6 @@ #include #include #include -#include #include #include diff -urN linux-2.5.68-bk5/sound/oss/sscape.c linux-2.5.68-bk6/sound/oss/sscape.c --- linux-2.5.68-bk5/sound/oss/sscape.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/oss/sscape.c 2003-04-25 04:34:14.000000000 -0700 @@ -39,7 +39,6 @@ #include #include #include -#include #include #include "coproc.h" diff -urN linux-2.5.68-bk5/sound/oss/trident.c linux-2.5.68-bk6/sound/oss/trident.c --- linux-2.5.68-bk5/sound/oss/trident.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/oss/trident.c 2003-04-25 04:34:14.000000000 -0700 @@ -195,7 +195,6 @@ #include #include #include -#include #include #include #include diff -urN linux-2.5.68-bk5/sound/oss/via82cxxx_audio.c linux-2.5.68-bk6/sound/oss/via82cxxx_audio.c --- linux-2.5.68-bk5/sound/oss/via82cxxx_audio.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/oss/via82cxxx_audio.c 2003-04-25 04:34:14.000000000 -0700 @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include diff -urN linux-2.5.68-bk5/sound/pci/ali5451/ali5451.c linux-2.5.68-bk6/sound/pci/ali5451/ali5451.c --- linux-2.5.68-bk5/sound/pci/ali5451/ali5451.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/pci/ali5451/ali5451.c 2003-04-25 04:34:14.000000000 -0700 @@ -1036,7 +1036,7 @@ void *dev_id, struct pt_regs *regs) { - ali_t *codec = snd_magic_cast(ali_t, dev_id, return); + ali_t *codec = snd_magic_cast(ali_t, dev_id, return IRQ_NONE); if (codec == NULL) return IRQ_NONE; diff -urN linux-2.5.68-bk5/sound/pci/als4000.c linux-2.5.68-bk6/sound/pci/als4000.c --- linux-2.5.68-bk5/sound/pci/als4000.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/pci/als4000.c 2003-04-25 04:34:14.000000000 -0700 @@ -358,7 +358,7 @@ static irqreturn_t snd_als4000_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - sb_t *chip = snd_magic_cast(sb_t, dev_id, return); + sb_t *chip = snd_magic_cast(sb_t, dev_id, return IRQ_NONE); unsigned long flags; unsigned gcr_status; unsigned sb_status; diff -urN linux-2.5.68-bk5/sound/pci/cmipci.c linux-2.5.68-bk6/sound/pci/cmipci.c --- linux-2.5.68-bk5/sound/pci/cmipci.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/pci/cmipci.c 2003-04-25 04:34:14.000000000 -0700 @@ -1642,7 +1642,7 @@ */ static irqreturn_t snd_cmipci_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - cmipci_t *cm = snd_magic_cast(cmipci_t, dev_id, return); + cmipci_t *cm = snd_magic_cast(cmipci_t, dev_id, return IRQ_NONE); unsigned int status, mask = 0; /* fastpath out, to ease interrupt sharing */ diff -urN linux-2.5.68-bk5/sound/pci/cs4281.c linux-2.5.68-bk6/sound/pci/cs4281.c --- linux-2.5.68-bk5/sound/pci/cs4281.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/pci/cs4281.c 2003-04-25 04:34:14.000000000 -0700 @@ -1885,7 +1885,7 @@ static irqreturn_t snd_cs4281_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - cs4281_t *chip = snd_magic_cast(cs4281_t, dev_id, return); + cs4281_t *chip = snd_magic_cast(cs4281_t, dev_id, return IRQ_NONE); unsigned int status, dma, val; cs4281_dma_t *cdma; diff -urN linux-2.5.68-bk5/sound/pci/cs46xx/cs46xx_lib.c linux-2.5.68-bk6/sound/pci/cs46xx/cs46xx_lib.c --- linux-2.5.68-bk5/sound/pci/cs46xx/cs46xx_lib.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/pci/cs46xx/cs46xx_lib.c 2003-04-25 04:34:14.000000000 -0700 @@ -1219,7 +1219,7 @@ static irqreturn_t snd_cs46xx_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - cs46xx_t *chip = snd_magic_cast(cs46xx_t, dev_id, return); + cs46xx_t *chip = snd_magic_cast(cs46xx_t, dev_id, return IRQ_NONE); u32 status1; #ifdef CONFIG_SND_CS46XX_NEW_DSP dsp_spos_instance_t * ins = chip->dsp_spos_instance; diff -urN linux-2.5.68-bk5/sound/pci/emu10k1/irq.c linux-2.5.68-bk6/sound/pci/emu10k1/irq.c --- linux-2.5.68-bk5/sound/pci/emu10k1/irq.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/pci/emu10k1/irq.c 2003-04-25 04:34:14.000000000 -0700 @@ -32,7 +32,7 @@ irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - emu10k1_t *emu = snd_magic_cast(emu10k1_t, dev_id, return); + emu10k1_t *emu = snd_magic_cast(emu10k1_t, dev_id, return IRQ_NONE); unsigned int status; int handled = 0; diff -urN linux-2.5.68-bk5/sound/pci/ens1370.c linux-2.5.68-bk6/sound/pci/ens1370.c --- linux-2.5.68-bk5/sound/pci/ens1370.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/pci/ens1370.c 2003-04-25 04:34:14.000000000 -0700 @@ -2233,7 +2233,7 @@ static irqreturn_t snd_audiopci_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - ensoniq_t *ensoniq = snd_magic_cast(ensoniq_t, dev_id, return); + ensoniq_t *ensoniq = snd_magic_cast(ensoniq_t, dev_id, return IRQ_NONE); unsigned int status, sctrl; if (ensoniq == NULL) diff -urN linux-2.5.68-bk5/sound/pci/es1938.c linux-2.5.68-bk6/sound/pci/es1938.c --- linux-2.5.68-bk5/sound/pci/es1938.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/pci/es1938.c 2003-04-25 04:34:14.000000000 -0700 @@ -1492,7 +1492,7 @@ * -------------------------------------------------------------------- */ static irqreturn_t snd_es1938_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - es1938_t *chip = snd_magic_cast(es1938_t, dev_id, return); + es1938_t *chip = snd_magic_cast(es1938_t, dev_id, return IRQ_NONE); unsigned char status, audiostatus; int handled = 0; diff -urN linux-2.5.68-bk5/sound/pci/es1968.c linux-2.5.68-bk6/sound/pci/es1968.c --- linux-2.5.68-bk5/sound/pci/es1968.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/pci/es1968.c 2003-04-25 04:34:14.000000000 -0700 @@ -2011,7 +2011,7 @@ */ static irqreturn_t snd_es1968_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - es1968_t *chip = snd_magic_cast(es1968_t, dev_id, return); + es1968_t *chip = snd_magic_cast(es1968_t, dev_id, return IRQ_NONE); u32 event; if (!(event = inb(chip->io_port + 0x1A))) diff -urN linux-2.5.68-bk5/sound/pci/fm801.c linux-2.5.68-bk6/sound/pci/fm801.c --- linux-2.5.68-bk5/sound/pci/fm801.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/pci/fm801.c 2003-04-25 04:34:14.000000000 -0700 @@ -483,7 +483,7 @@ static irqreturn_t snd_fm801_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - fm801_t *chip = snd_magic_cast(fm801_t, dev_id, return); + fm801_t *chip = snd_magic_cast(fm801_t, dev_id, return IRQ_NONE); unsigned short status; unsigned int tmp; diff -urN linux-2.5.68-bk5/sound/pci/ice1712/ice1712.c linux-2.5.68-bk6/sound/pci/ice1712/ice1712.c --- linux-2.5.68-bk5/sound/pci/ice1712/ice1712.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/pci/ice1712/ice1712.c 2003-04-25 04:34:14.000000000 -0700 @@ -400,7 +400,7 @@ static irqreturn_t snd_ice1712_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - ice1712_t *ice = snd_magic_cast(ice1712_t, dev_id, return); + ice1712_t *ice = snd_magic_cast(ice1712_t, dev_id, return IRQ_NONE); unsigned char status; int handled = 0; diff -urN linux-2.5.68-bk5/sound/pci/ice1712/ice1724.c linux-2.5.68-bk6/sound/pci/ice1712/ice1724.c --- linux-2.5.68-bk5/sound/pci/ice1712/ice1724.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/pci/ice1712/ice1724.c 2003-04-25 04:34:14.000000000 -0700 @@ -196,7 +196,7 @@ static irqreturn_t snd_vt1724_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - ice1712_t *ice = snd_magic_cast(ice1712_t, dev_id, return); + ice1712_t *ice = snd_magic_cast(ice1712_t, dev_id, return IRQ_NONE); unsigned char status; int handled = 0; diff -urN linux-2.5.68-bk5/sound/pci/intel8x0.c linux-2.5.68-bk6/sound/pci/intel8x0.c --- linux-2.5.68-bk5/sound/pci/intel8x0.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/pci/intel8x0.c 2003-04-25 04:34:14.000000000 -0700 @@ -718,7 +718,7 @@ static irqreturn_t snd_intel8x0_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - intel8x0_t *chip = snd_magic_cast(intel8x0_t, dev_id, return); + intel8x0_t *chip = snd_magic_cast(intel8x0_t, dev_id, return IRQ_NONE); ichdev_t *ichdev; unsigned int status; unsigned int i; diff -urN linux-2.5.68-bk5/sound/pci/korg1212/korg1212.c linux-2.5.68-bk6/sound/pci/korg1212/korg1212.c --- linux-2.5.68-bk5/sound/pci/korg1212/korg1212.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/pci/korg1212/korg1212.c 2003-04-25 04:34:14.000000000 -0700 @@ -1136,7 +1136,8 @@ static irqreturn_t snd_korg1212_interrupt(int irq, void *dev_id, struct pt_regs *regs) { u32 doorbellValue; - korg1212_t *korg1212 = snd_magic_cast(korg1212_t, dev_id, return); + korg1212_t *korg1212 = snd_magic_cast(korg1212_t, dev_id, + return IRQ_NONE); if(irq != korg1212->irq) return IRQ_NONE; diff -urN linux-2.5.68-bk5/sound/pci/nm256/nm256.c linux-2.5.68-bk6/sound/pci/nm256/nm256.c --- linux-2.5.68-bk5/sound/pci/nm256/nm256.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/pci/nm256/nm256.c 2003-04-25 04:34:14.000000000 -0700 @@ -975,7 +975,7 @@ static irqreturn_t snd_nm256_interrupt(int irq, void *dev_id, struct pt_regs *dummy) { - nm256_t *chip = snd_magic_cast(nm256_t, dev_id, return); + nm256_t *chip = snd_magic_cast(nm256_t, dev_id, return IRQ_NONE); u16 status; u8 cbyte; diff -urN linux-2.5.68-bk5/sound/pci/sonicvibes.c linux-2.5.68-bk6/sound/pci/sonicvibes.c --- linux-2.5.68-bk5/sound/pci/sonicvibes.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/pci/sonicvibes.c 2003-04-25 04:34:14.000000000 -0700 @@ -598,7 +598,8 @@ static irqreturn_t snd_sonicvibes_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - sonicvibes_t *sonic = snd_magic_cast(sonicvibes_t, dev_id, return); + sonicvibes_t *sonic = snd_magic_cast(sonicvibes_t, dev_id, + return IRQ_NONE); unsigned char status; status = inb(SV_REG(sonic, STATUS)); diff -urN linux-2.5.68-bk5/sound/pci/trident/trident_main.c linux-2.5.68-bk6/sound/pci/trident/trident_main.c --- linux-2.5.68-bk5/sound/pci/trident/trident_main.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/pci/trident/trident_main.c 2003-04-25 04:34:14.000000000 -0700 @@ -3689,7 +3689,7 @@ static irqreturn_t snd_trident_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - trident_t *trident = snd_magic_cast(trident_t, dev_id, return); + trident_t *trident = snd_magic_cast(trident_t, dev_id, return IRQ_NONE); unsigned int audio_int, chn_int, stimer, channel, mask, tmp; int delta; snd_trident_voice_t *voice; diff -urN linux-2.5.68-bk5/sound/pci/via82xx.c linux-2.5.68-bk6/sound/pci/via82xx.c --- linux-2.5.68-bk5/sound/pci/via82xx.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/pci/via82xx.c 2003-04-25 04:34:14.000000000 -0700 @@ -576,7 +576,7 @@ static irqreturn_t snd_via82xx_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - via82xx_t *chip = snd_magic_cast(via82xx_t, dev_id, return); + via82xx_t *chip = snd_magic_cast(via82xx_t, dev_id, return IRQ_NONE); unsigned int status; unsigned int i; diff -urN linux-2.5.68-bk5/sound/pci/ymfpci/ymfpci_main.c linux-2.5.68-bk6/sound/pci/ymfpci/ymfpci_main.c --- linux-2.5.68-bk5/sound/pci/ymfpci/ymfpci_main.c 2003-04-25 04:34:10.000000000 -0700 +++ linux-2.5.68-bk6/sound/pci/ymfpci/ymfpci_main.c 2003-04-25 04:34:14.000000000 -0700 @@ -743,7 +743,7 @@ static irqreturn_t snd_ymfpci_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - ymfpci_t *chip = snd_magic_cast(ymfpci_t, dev_id, return); + ymfpci_t *chip = snd_magic_cast(ymfpci_t, dev_id, return IRQ_NONE); u32 status, nvoice, mode; ymfpci_voice_t *voice;