## Automatically generated incremental diff ## From: linux-2.5.3-pre3 ## To: linux-2.5.3-pre4 ## Robot: $Id: make-incremental-diff,v 1.9 2001/12/10 00:06:56 hpa Exp $ diff -urN linux-2.5.3-pre3/Documentation/Configure.help linux/Documentation/Configure.help --- linux-2.5.3-pre3/Documentation/Configure.help Wed Jan 23 17:30:57 2002 +++ linux/Documentation/Configure.help Wed Jan 23 17:31:03 2002 @@ -2433,6 +2433,14 @@ If you want to compile it as a module, say M here and read . If unsure, say `N'. +AH/ESP match support +CONFIG_IP_NF_MATCH_AH_ESP + These two match extensions (`ah' and `esp') allow you to match a + range of SPIs inside AH or ESP headers of IPSec packets. + + If you want to compile it as a module, say M here and read + Documentation/modules.txt. If unsure, say `N'. + TOS match support CONFIG_IP_NF_MATCH_TOS TOS matching allows you to match packets based on the Type Of @@ -2600,6 +2608,19 @@ If you want to compile it as a module, say M here and read . If unsure, say `N'. +ULOG target support +CONFIG_IP_NF_TARGET_ULOG + This option adds a `ULOG' target, which allows you to create rules in + any iptables table. The packet is passed to a userspace logging + daemon using netlink multicast sockets; unlike the LOG target + which can only be viewed through syslog. + + The apropriate userspace logging daemon (ulogd) may be obtained from + http://www.gnumonks.org/projects/ulogd + + If you want to compile it as a module, say M here and read + Documentation/modules.txt. If unsure, say `N'. + LOG target support CONFIG_IP_NF_TARGET_LOG This option adds a `LOG' target, which allows you to create rules in @@ -2656,6 +2677,23 @@ If you want to compile it as a module, say M here and read . If unsure, say `N'. +IPV6 queue handler (EXPERIMENTAL) +CONFIG_IP6_NF_QUEUE + + This option adds a queue handler to the kernel for IPv6 + packets which lets us to receive the filtered packets + with QUEUE target using libiptc as we can do with + the IPv4 now. + + (C) Fernando Anton 2001 + IPv64 Project - Work based in IPv64 draft by Arturo Azcorra. + Universidad Carlos III de Madrid + Universidad Politecnica de Alcala de Henares + email: fanton@it.uc3m.es + + If you want to compile it as a module, say M here and read + Documentation/modules.txt. If unsure, say `N'. + Owner match support CONFIG_IP6_NF_MATCH_OWNER Packet owner matching allows you to match locally-generated packets @@ -4127,6 +4165,16 @@ CONFIG_FB_L7200 This driver supports the L7200 Color LCD. Say Y if you want graphics support. + +NeoMagic display support (EXPERIMENTAL) +CONFIG_FB_NEOMAGIC + This driver supports notebooks with NeoMagic PCI chips. + Say Y if you have such a graphics card. + + The driver is also available as a module ( = code which can be + inserted and removed from the running kernel whenever you want). The + module will be called neofb.o. If you want to compile it as a + module, say M here and read Documentation/modules.txt. PowerMac "control" frame buffer device support CONFIG_FB_CONTROL diff -urN linux-2.5.3-pre3/Makefile linux/Makefile --- linux-2.5.3-pre3/Makefile Wed Jan 23 17:30:57 2002 +++ linux/Makefile Wed Jan 23 17:31:03 2002 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 5 SUBLEVEL = 3 -EXTRAVERSION =-pre3 +EXTRAVERSION =-pre4 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) diff -urN linux-2.5.3-pre3/arch/alpha/kernel/time.c linux/arch/alpha/kernel/time.c --- linux-2.5.3-pre3/arch/alpha/kernel/time.c Sat Nov 17 11:47:44 2001 +++ linux/arch/alpha/kernel/time.c Wed Jan 23 17:31:03 2002 @@ -379,8 +379,6 @@ /* Startup the timer source. */ alpha_mv.init_rtc(); - do_get_fast_time = do_gettimeofday; - /* * If we had wanted SRM console printk echoing early, undo it now. * diff -urN linux-2.5.3-pre3/arch/alpha/vmlinux.lds.in linux/arch/alpha/vmlinux.lds.in --- linux-2.5.3-pre3/arch/alpha/vmlinux.lds.in Thu Nov 22 10:54:10 2001 +++ linux/arch/alpha/vmlinux.lds.in Wed Jan 23 17:31:03 2002 @@ -41,7 +41,15 @@ . = ALIGN(8); __initcall_start = .; - .initcall.init : { *(.initcall.init) } + .initcall.init : { + *(.initcall1.init) + *(.initcall2.init) + *(.initcall3.init) + *(.initcall4.init) + *(.initcall5.init) + *(.initcall6.init) + *(.initcall7.init) + } __initcall_end = .; . = ALIGN(2*8192); /* Align double page for init_task_union */ diff -urN linux-2.5.3-pre3/arch/arm/kernel/ecard.c linux/arch/arm/kernel/ecard.c --- linux-2.5.3-pre3/arch/arm/kernel/ecard.c Wed Jan 23 17:30:57 2002 +++ linux/arch/arm/kernel/ecard.c Wed Jan 23 17:31:03 2002 @@ -1097,6 +1097,8 @@ ecard_proc_init(); } +subsys_initcall(ecard_init); + EXPORT_SYMBOL(ecard_startfind); EXPORT_SYMBOL(ecard_find); EXPORT_SYMBOL(ecard_readchunk); diff -urN linux-2.5.3-pre3/arch/arm/vmlinux-armo.lds.in linux/arch/arm/vmlinux-armo.lds.in --- linux-2.5.3-pre3/arch/arm/vmlinux-armo.lds.in Sat Jan 5 13:04:30 2002 +++ linux/arch/arm/vmlinux-armo.lds.in Wed Jan 23 17:31:03 2002 @@ -27,7 +27,13 @@ *(.setup.init) __setup_end = .; __initcall_start = .; - *(.initcall.init) + *(.initcall1.init) + *(.initcall2.init) + *(.initcall3.init) + *(.initcall4.init) + *(.initcall5.init) + *(.initcall6.init) + *(.initcall7.init) __initcall_end = .; . = ALIGN(32768); __init_end = .; diff -urN linux-2.5.3-pre3/arch/arm/vmlinux-armv.lds.in linux/arch/arm/vmlinux-armv.lds.in --- linux-2.5.3-pre3/arch/arm/vmlinux-armv.lds.in Sat Jan 5 13:04:30 2002 +++ linux/arch/arm/vmlinux-armv.lds.in Wed Jan 23 17:31:03 2002 @@ -26,7 +26,13 @@ *(.setup.init) __setup_end = .; __initcall_start = .; - *(.initcall.init) + *(.initcall1.init) + *(.initcall2.init) + *(.initcall3.init) + *(.initcall4.init) + *(.initcall5.init) + *(.initcall6.init) + *(.initcall7.init) __initcall_end = .; . = ALIGN(4096); __init_end = .; diff -urN linux-2.5.3-pre3/arch/cris/cris.ld linux/arch/cris/cris.ld --- linux-2.5.3-pre3/arch/cris/cris.ld Mon Oct 8 11:43:54 2001 +++ linux/arch/cris/cris.ld Wed Jan 23 17:31:03 2002 @@ -63,7 +63,13 @@ __setup_end = .; .initcall.init : { __initcall_start = .; - *(.initcall.init); + *(.initcall1.init); + *(.initcall2.init); + *(.initcall3.init); + *(.initcall4.init); + *(.initcall5.init); + *(.initcall6.init); + *(.initcall7.init); __initcall_end = .; /* We fill to the next page, so we can discard all init diff -urN linux-2.5.3-pre3/arch/i386/kernel/mca.c linux/arch/i386/kernel/mca.c --- linux-2.5.3-pre3/arch/i386/kernel/mca.c Thu Aug 24 12:52:32 2000 +++ linux/arch/i386/kernel/mca.c Wed Jan 23 17:31:03 2002 @@ -311,6 +311,8 @@ #endif } +subsys_initcall(mca_init); + /*--------------------------------------------------------------------*/ static void mca_handle_nmi_slot(int slot, int check_flag) diff -urN linux-2.5.3-pre3/arch/i386/kernel/time.c linux/arch/i386/kernel/time.c --- linux-2.5.3-pre3/arch/i386/kernel/time.c Sun Nov 11 10:20:21 2001 +++ linux/arch/i386/kernel/time.c Wed Jan 23 17:31:03 2002 @@ -681,7 +681,6 @@ #ifndef do_gettimeoffset do_gettimeoffset = do_fast_gettimeoffset; #endif - do_get_fast_time = do_gettimeofday; /* report CPU clock rate in Hz. * The formula is (10^6 * 2^32) / (2^32 * 1 / (clocks/us)) = diff -urN linux-2.5.3-pre3/arch/i386/vmlinux.lds linux/arch/i386/vmlinux.lds --- linux-2.5.3-pre3/arch/i386/vmlinux.lds Mon Jul 2 14:40:14 2001 +++ linux/arch/i386/vmlinux.lds Wed Jan 23 17:31:03 2002 @@ -48,7 +48,15 @@ .setup.init : { *(.setup.init) } __setup_end = .; __initcall_start = .; - .initcall.init : { *(.initcall.init) } + .initcall.init : { + *(.initcall1.init) + *(.initcall2.init) + *(.initcall3.init) + *(.initcall4.init) + *(.initcall5.init) + *(.initcall6.init) + *(.initcall7.init) + } __initcall_end = .; . = ALIGN(4096); __init_end = .; diff -urN linux-2.5.3-pre3/arch/ia64/kernel/time.c linux/arch/ia64/kernel/time.c --- linux-2.5.3-pre3/arch/ia64/kernel/time.c Fri Nov 9 14:26:17 2001 +++ linux/arch/ia64/kernel/time.c Wed Jan 23 17:31:03 2002 @@ -145,9 +145,6 @@ tv->tv_usec = usec; } -/* XXX there should be a cleaner way for declaring an alias... */ -asm (".global get_fast_time; get_fast_time = do_gettimeofday"); - static void timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { diff -urN linux-2.5.3-pre3/arch/ia64/vmlinux.lds.S linux/arch/ia64/vmlinux.lds.S --- linux-2.5.3-pre3/arch/ia64/vmlinux.lds.S Tue Jul 31 10:30:09 2001 +++ linux/arch/ia64/vmlinux.lds.S Wed Jan 23 17:31:03 2002 @@ -104,8 +104,16 @@ { *(.setup.init) } __setup_end = .; __initcall_start = .; - .initcall.init : AT(ADDR(.initcall.init) - PAGE_OFFSET) - { *(.initcall.init) } + .initcall.init : AT(ADDR(.initcall1.init) - PAGE_OFFSET) + { + *(.initcall1.init) + *(.initcall2.init) + *(.initcall3.init) + *(.initcall4.init) + *(.initcall5.init) + *(.initcall6.init) + *(.initcall7.init) + } __initcall_end = .; . = ALIGN(PAGE_SIZE); __init_end = .; diff -urN linux-2.5.3-pre3/arch/m68k/vmlinux-sun3.lds linux/arch/m68k/vmlinux-sun3.lds --- linux-2.5.3-pre3/arch/m68k/vmlinux-sun3.lds Mon Jul 2 14:40:14 2001 +++ linux/arch/m68k/vmlinux-sun3.lds Wed Jan 23 17:31:03 2002 @@ -43,7 +43,15 @@ .setup.init : { *(.setup.init) } __setup_end = .; __initcall_start = .; - .initcall.init : { *(.initcall.init) } + .initcall.init : { + *(.initcall1.init) + *(.initcall2.init) + *(.initcall3.init) + *(.initcall4.init) + *(.initcall5.init) + *(.initcall6.init) + *(.initcall7.init) + } __initcall_end = .; . = ALIGN(8192); __init_end = .; diff -urN linux-2.5.3-pre3/arch/m68k/vmlinux.lds linux/arch/m68k/vmlinux.lds --- linux-2.5.3-pre3/arch/m68k/vmlinux.lds Mon Jul 2 14:40:14 2001 +++ linux/arch/m68k/vmlinux.lds Wed Jan 23 17:31:03 2002 @@ -47,7 +47,15 @@ .setup.init : { *(.setup.init) } __setup_end = .; __initcall_start = .; - .initcall.init : { *(.initcall.init) } + .initcall.init : { + *(.initcall1.init) + *(.initcall2.init) + *(.initcall3.init) + *(.initcall4.init) + *(.initcall5.init) + *(.initcall6.init) + *(.initcall7.init) + } __initcall_end = .; . = ALIGN(8192); __init_end = .; diff -urN linux-2.5.3-pre3/arch/mips/ld.script.in linux/arch/mips/ld.script.in --- linux-2.5.3-pre3/arch/mips/ld.script.in Mon Jul 2 13:56:40 2001 +++ linux/arch/mips/ld.script.in Wed Jan 23 17:31:03 2002 @@ -44,7 +44,15 @@ .setup.init : { *(.setup.init) } __setup_end = .; __initcall_start = .; - .initcall.init : { *(.initcall.init) } + .initcall.init : { + *(.initcall1.init) + *(.initcall2.init) + *(.initcall3.init) + *(.initcall4.init) + *(.initcall5.init) + *(.initcall6.init) + *(.initcall7.init) + } __initcall_end = .; . = ALIGN(4096); /* Align double page for init_task_union */ __init_end = .; diff -urN linux-2.5.3-pre3/arch/mips64/ld.script.elf32.S linux/arch/mips64/ld.script.elf32.S --- linux-2.5.3-pre3/arch/mips64/ld.script.elf32.S Mon Jul 2 14:40:58 2001 +++ linux/arch/mips64/ld.script.elf32.S Wed Jan 23 17:31:03 2002 @@ -40,7 +40,15 @@ .setup.init : { *(.setup.init) } __setup_end = .; __initcall_start = .; - .initcall.init : { *(.initcall.init) } + .initcall.init : { + *(.initcall1.init) + *(.initcall2.init) + *(.initcall3.init) + *(.initcall4.init) + *(.initcall5.init) + *(.initcall6.init) + *(.initcall7.init) + } __initcall_end = .; . = ALIGN(4096); /* Align double page for init_task_union */ __init_end = .; diff -urN linux-2.5.3-pre3/arch/mips64/ld.script.elf64 linux/arch/mips64/ld.script.elf64 --- linux-2.5.3-pre3/arch/mips64/ld.script.elf64 Mon Jul 2 14:40:58 2001 +++ linux/arch/mips64/ld.script.elf64 Wed Jan 23 17:31:03 2002 @@ -49,7 +49,15 @@ .setup.init : { *(.setup.init) } __setup_end = .; __initcall_start = .; - .initcall.init : { *(.initcall.init) } + .initcall.init : { + *(.initcall1.init) + *(.initcall2.init) + *(.initcall3.init) + *(.initcall4.init) + *(.initcall5.init) + *(.initcall6.init) + *(.initcall7.init) + } __initcall_end = .; . = ALIGN(4096); /* Align double page for init_task_union */ __init_end = .; diff -urN linux-2.5.3-pre3/arch/parisc/vmlinux.lds linux/arch/parisc/vmlinux.lds --- linux-2.5.3-pre3/arch/parisc/vmlinux.lds Mon Jul 2 14:40:58 2001 +++ linux/arch/parisc/vmlinux.lds Wed Jan 23 17:31:03 2002 @@ -51,7 +51,15 @@ .setup.init : { *(.setup.init) } __setup_end = .; __initcall_start = .; - .initcall.init : { *(.initcall.init) } + .initcall.init : { + *(.initcall1.init) + *(.initcall2.init) + *(.initcall3.init) + *(.initcall4.init) + *(.initcall5.init) + *(.initcall6.init) + *(.initcall7.init) + } __initcall_end = .; __init_end = .; diff -urN linux-2.5.3-pre3/arch/ppc/kernel/setup.c linux/arch/ppc/kernel/setup.c --- linux-2.5.3-pre3/arch/ppc/kernel/setup.c Wed Jan 23 17:30:57 2002 +++ linux/arch/ppc/kernel/setup.c Wed Jan 23 17:31:03 2002 @@ -535,6 +535,8 @@ } } +subsys_initcall(ppc_init); + /* Warning, IO base is not yet inited */ void __init setup_arch(char **cmdline_p) { diff -urN linux-2.5.3-pre3/arch/ppc/kernel/time.c linux/arch/ppc/kernel/time.c --- linux-2.5.3-pre3/arch/ppc/kernel/time.c Mon Oct 8 11:43:01 2001 +++ linux/arch/ppc/kernel/time.c Wed Jan 23 17:31:03 2002 @@ -352,8 +352,6 @@ tz.tz_dsttime = 0; do_sys_settimeofday(NULL, &tz); } - - do_get_fast_time = do_gettimeofday; } #define TICK_SIZE tick diff -urN linux-2.5.3-pre3/arch/ppc/vmlinux.lds linux/arch/ppc/vmlinux.lds --- linux-2.5.3-pre3/arch/ppc/vmlinux.lds Tue Aug 28 06:58:33 2001 +++ linux/arch/ppc/vmlinux.lds Wed Jan 23 17:31:03 2002 @@ -94,7 +94,15 @@ .setup.init : { *(.setup.init) } __setup_end = .; __initcall_start = .; - .initcall.init : { *(.initcall.init) } + .initcall.init : { + *(.initcall1.init) + *(.initcall2.init) + *(.initcall3.init) + *(.initcall4.init) + *(.initcall5.init) + *(.initcall6.init) + *(.initcall7.init) + } __initcall_end = .; . = ALIGN(4096); __init_end = .; diff -urN linux-2.5.3-pre3/arch/s390/kernel/time.c linux/arch/s390/kernel/time.c --- linux-2.5.3-pre3/arch/s390/kernel/time.c Thu Oct 11 09:04:57 2001 +++ linux/arch/s390/kernel/time.c Wed Jan 23 17:31:03 2002 @@ -249,7 +249,4 @@ init_timer_cc -= 0x8126d60e46000000LL - (0x3c26700LL*1000000*4096); tod_to_timeval(init_timer_cc, &xtime); - - /* Set do_get_fast_time function pointer. */ - do_get_fast_time = do_gettimeofday; } diff -urN linux-2.5.3-pre3/arch/s390/vmlinux-shared.lds linux/arch/s390/vmlinux-shared.lds --- linux-2.5.3-pre3/arch/s390/vmlinux-shared.lds Sun Aug 12 10:38:48 2001 +++ linux/arch/s390/vmlinux-shared.lds Wed Jan 23 17:31:03 2002 @@ -55,7 +55,15 @@ .setup.init : { *(.setup.init) } __setup_end = .; __initcall_start = .; - .initcall.init : { *(.initcall.init) } + .initcall.init : { + *(.initcall1.init) + *(.initcall2.init) + *(.initcall3.init) + *(.initcall4.init) + *(.initcall5.init) + *(.initcall6.init) + *(.initcall7.init) + } __initcall_end = .; . = ALIGN(4096); __init_end = .; diff -urN linux-2.5.3-pre3/arch/s390/vmlinux.lds linux/arch/s390/vmlinux.lds --- linux-2.5.3-pre3/arch/s390/vmlinux.lds Mon Jul 2 14:40:58 2001 +++ linux/arch/s390/vmlinux.lds Wed Jan 23 17:31:03 2002 @@ -53,7 +53,15 @@ .setup.init : { *(.setup.init) } __setup_end = .; __initcall_start = .; - .initcall.init : { *(.initcall.init) } + .initcall.init : { + *(.initcall1.init) + *(.initcall2.init) + *(.initcall3.init) + *(.initcall4.init) + *(.initcall5.init) + *(.initcall6.init) + *(.initcall7.init) + } __initcall_end = .; . = ALIGN(4096); __init_end = .; diff -urN linux-2.5.3-pre3/arch/s390x/kernel/time.c linux/arch/s390x/kernel/time.c --- linux-2.5.3-pre3/arch/s390x/kernel/time.c Thu Oct 11 09:04:57 2001 +++ linux/arch/s390x/kernel/time.c Wed Jan 23 17:31:03 2002 @@ -255,7 +255,4 @@ init_timer_cc -= 0x8126d60e46000000LL - (0x3c26700LL*1000000*4096); tod_to_timeval(init_timer_cc, &xtime); - - /* Set do_get_fast_time function pointer. */ - do_get_fast_time = do_gettimeofday; } diff -urN linux-2.5.3-pre3/arch/s390x/vmlinux-shared.lds linux/arch/s390x/vmlinux-shared.lds --- linux-2.5.3-pre3/arch/s390x/vmlinux-shared.lds Sun Aug 12 10:38:48 2001 +++ linux/arch/s390x/vmlinux-shared.lds Wed Jan 23 17:31:03 2002 @@ -55,7 +55,15 @@ .setup.init : { *(.setup.init) } __setup_end = .; __initcall_start = .; - .initcall.init : { *(.initcall.init) } + .initcall.init : { + *(.initcall1.init) + *(.initcall2.init) + *(.initcall3.init) + *(.initcall4.init) + *(.initcall5.init) + *(.initcall6.init) + *(.initcall7.init) + } __initcall_end = .; . = ALIGN(4096); __init_end = .; diff -urN linux-2.5.3-pre3/arch/s390x/vmlinux.lds linux/arch/s390x/vmlinux.lds --- linux-2.5.3-pre3/arch/s390x/vmlinux.lds Mon Jul 2 14:40:58 2001 +++ linux/arch/s390x/vmlinux.lds Wed Jan 23 17:31:03 2002 @@ -53,7 +53,15 @@ .setup.init : { *(.setup.init) } __setup_end = .; __initcall_start = .; - .initcall.init : { *(.initcall.init) } + .initcall.init : { + *(.initcall1.init) + *(.initcall2.init) + *(.initcall3.init) + *(.initcall4.init) + *(.initcall5.init) + *(.initcall6.init) + *(.initcall7.init) + } __initcall_end = .; . = ALIGN(4096); __init_end = .; diff -urN linux-2.5.3-pre3/arch/sh/vmlinux.lds.S linux/arch/sh/vmlinux.lds.S --- linux-2.5.3-pre3/arch/sh/vmlinux.lds.S Sat Sep 8 12:29:09 2001 +++ linux/arch/sh/vmlinux.lds.S Wed Jan 23 17:31:03 2002 @@ -63,7 +63,15 @@ .setup.init : { *(.setup.init) } __setup_end = .; __initcall_start = .; - .initcall.init : { *(.initcall.init) } + .initcall.init : { + *(.initcall1.init) + *(.initcall2.init) + *(.initcall3.init) + *(.initcall4.init) + *(.initcall5.init) + *(.initcall6.init) + *(.initcall7.init) + } __initcall_end = .; __machvec_start = .; .machvec.init : { *(.machvec.init) } diff -urN linux-2.5.3-pre3/arch/sparc/kernel/pcic.c linux/arch/sparc/kernel/pcic.c --- linux-2.5.3-pre3/arch/sparc/kernel/pcic.c Sun Feb 18 19:49:44 2001 +++ linux/arch/sparc/kernel/pcic.c Wed Jan 23 17:31:03 2002 @@ -1,4 +1,4 @@ -/* $Id: pcic.c,v 1.22 2001/02/13 01:16:43 davem Exp $ +/* $Id: pcic.c,v 1.23 2002/01/23 14:33:55 davem Exp $ * pcic.c: Sparc/PCI controller support * * Copyright (C) 1998 V. Roganov and G. Raiko @@ -759,7 +759,6 @@ unsigned long v; int timer_irq, irq; - do_get_fast_time = pci_do_gettimeofday; /* A hack until do_gettimeofday prototype is moved to arch specific headers and btfixupped. Patch do_gettimeofday with ba pci_do_gettimeofday; nop */ ((unsigned int *)do_gettimeofday)[0] = diff -urN linux-2.5.3-pre3/arch/sparc/kernel/process.c linux/arch/sparc/kernel/process.c --- linux-2.5.3-pre3/arch/sparc/kernel/process.c Wed Jan 23 17:30:57 2002 +++ linux/arch/sparc/kernel/process.c Wed Jan 23 17:31:03 2002 @@ -1,4 +1,4 @@ -/* $Id: process.c,v 1.160 2002/01/11 08:45:38 davem Exp $ +/* $Id: process.c,v 1.161 2002/01/23 11:27:32 davem Exp $ * linux/arch/sparc/kernel/process.c * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) diff -urN linux-2.5.3-pre3/arch/sparc/kernel/time.c linux/arch/sparc/kernel/time.c --- linux-2.5.3-pre3/arch/sparc/kernel/time.c Tue Oct 30 15:08:11 2001 +++ linux/arch/sparc/kernel/time.c Wed Jan 23 17:31:03 2002 @@ -1,4 +1,4 @@ -/* $Id: time.c,v 1.59 2001/10/30 04:54:21 davem Exp $ +/* $Id: time.c,v 1.60 2002/01/23 14:33:55 davem Exp $ * linux/arch/sparc/kernel/time.c * * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) @@ -371,7 +371,6 @@ struct intersil *iregs; #endif - do_get_fast_time = do_gettimeofday; BTFIXUPSET_CALL(bus_do_settimeofday, sbus_do_settimeofday, BTFIXUPCALL_NORM); btfixup(); diff -urN linux-2.5.3-pre3/arch/sparc/vmlinux.lds linux/arch/sparc/vmlinux.lds --- linux-2.5.3-pre3/arch/sparc/vmlinux.lds Mon Jul 2 14:40:58 2001 +++ linux/arch/sparc/vmlinux.lds Wed Jan 23 17:31:03 2002 @@ -45,7 +45,15 @@ .setup_init : { *(.setup.init) } __setup_end = .; __initcall_start = .; - .initcall.init : { *(.initcall.init) } + .initcall.init : { + *(.initcall1.init) + *(.initcall2.init) + *(.initcall3.init) + *(.initcall4.init) + *(.initcall5.init) + *(.initcall6.init) + *(.initcall7.init) + } __initcall_end = .; . = ALIGN(4096); __init_end = .; diff -urN linux-2.5.3-pre3/arch/sparc64/defconfig linux/arch/sparc64/defconfig --- linux-2.5.3-pre3/arch/sparc64/defconfig Wed Jan 23 17:30:57 2002 +++ linux/arch/sparc64/defconfig Wed Jan 23 17:31:03 2002 @@ -253,6 +253,7 @@ # CONFIG_BLK_DEV_HD is not set CONFIG_BLK_DEV_IDEDISK=y # CONFIG_IDEDISK_MULTI_MODE is not set +# CONFIG_IDEDISK_STROKE is not set # CONFIG_BLK_DEV_IDEDISK_VENDOR is not set # CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set # CONFIG_BLK_DEV_IDEDISK_IBM is not set @@ -267,6 +268,7 @@ # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_BLK_DEV_IDESCSI is not set +# CONFIG_IDE_TASK_IOCTL is not set # # IDE chipset support/bugfixes @@ -278,12 +280,15 @@ CONFIG_BLK_DEV_IDEPCI=y # CONFIG_IDEPCI_SHARE_IRQ is not set CONFIG_BLK_DEV_IDEDMA_PCI=y -CONFIG_BLK_DEV_ADMA=y # CONFIG_BLK_DEV_OFFBOARD is not set +# CONFIG_BLK_DEV_IDEDMA_FORCED is not set CONFIG_IDEDMA_PCI_AUTO=y +CONFIG_IDEDMA_ONLYDISK=y CONFIG_BLK_DEV_IDEDMA=y # CONFIG_IDEDMA_PCI_WIP is not set +# CONFIG_BLK_DEV_IDEDMA_TIMEOUT is not set # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set +CONFIG_BLK_DEV_ADMA=y # CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_AEC62XX_TUNING is not set CONFIG_BLK_DEV_ALI15X3=y @@ -298,6 +303,7 @@ # CONFIG_BLK_DEV_HPT366 is not set CONFIG_BLK_DEV_NS87415=y # CONFIG_BLK_DEV_OPTI621 is not set +# CONFIG_BLK_DEV_PDC_ADMA is not set # CONFIG_BLK_DEV_PDC202XX is not set # CONFIG_PDC202XX_BURST is not set # CONFIG_PDC202XX_FORCE is not set diff -urN linux-2.5.3-pre3/arch/sparc64/kernel/pci_psycho.c linux/arch/sparc64/kernel/pci_psycho.c --- linux-2.5.3-pre3/arch/sparc64/kernel/pci_psycho.c Mon Jan 14 10:10:44 2002 +++ linux/arch/sparc64/kernel/pci_psycho.c Wed Jan 23 17:31:03 2002 @@ -1,4 +1,4 @@ -/* $Id: pci_psycho.c,v 1.31 2002/01/05 07:33:16 davem Exp $ +/* $Id: pci_psycho.c,v 1.32 2002/01/23 11:27:32 davem Exp $ * pci_psycho.c: PSYCHO/U2P specific PCI controller support. * * Copyright (C) 1997, 1998, 1999 David S. Miller (davem@caipfs.rutgers.edu) @@ -345,7 +345,7 @@ /*0x2f*/15, /* Correctable ECC */ /*0x30*/15, /* PCI Bus A Error */ /*0x31*/15, /* PCI Bus B Error */ -/*0x32*/1, /* Power Management */ +/*0x32*/15, /* Power Management */ }; static int __init psycho_ino_to_pil(struct pci_dev *pdev, unsigned int ino) @@ -354,7 +354,7 @@ ret = psycho_pil_table[ino]; if (ret == 0 && pdev == NULL) { - ret = 1; + ret = 2; } else if (ret == 0) { switch ((pdev->class >> 16) & 0xff) { case PCI_BASE_CLASS_STORAGE: @@ -377,7 +377,7 @@ break; default: - ret = 1; + ret = 2; break; }; } @@ -410,6 +410,10 @@ /* Now build the IRQ bucket. */ pil = psycho_ino_to_pil(pdev, ino); + + if (PIL_RESERVED(pil)) + BUG(); + imap = p->controller_regs + imap_off; imap += 4; diff -urN linux-2.5.3-pre3/arch/sparc64/kernel/pci_sabre.c linux/arch/sparc64/kernel/pci_sabre.c --- linux-2.5.3-pre3/arch/sparc64/kernel/pci_sabre.c Mon Jan 14 10:10:44 2002 +++ linux/arch/sparc64/kernel/pci_sabre.c Wed Jan 23 17:31:03 2002 @@ -1,4 +1,4 @@ -/* $Id: pci_sabre.c,v 1.41 2001/11/14 13:17:56 davem Exp $ +/* $Id: pci_sabre.c,v 1.42 2002/01/23 11:27:32 davem Exp $ * pci_sabre.c: Sabre specific PCI controller support. * * Copyright (C) 1997, 1998, 1999 David S. Miller (davem@caipfs.rutgers.edu) @@ -582,7 +582,7 @@ /*0x2f*/15, /* Correctable ECC */ /*0x30*/15, /* PCI Bus A Error */ /*0x31*/15, /* PCI Bus B Error */ -/*0x32*/1, /* Power Management */ +/*0x32*/15, /* Power Management */ }; static int __init sabre_ino_to_pil(struct pci_dev *pdev, unsigned int ino) @@ -596,7 +596,7 @@ ret = sabre_pil_table[ino]; if (ret == 0 && pdev == NULL) { - ret = 1; + ret = 2; } else if (ret == 0) { switch ((pdev->class >> 16) & 0xff) { case PCI_BASE_CLASS_STORAGE: @@ -619,7 +619,7 @@ break; default: - ret = 1; + ret = 2; break; }; } @@ -651,6 +651,10 @@ /* Now build the IRQ bucket. */ pil = sabre_ino_to_pil(pdev, ino); + + if (PIL_RESERVED(pil)) + BUG(); + imap = p->controller_regs + imap_off; imap += 4; diff -urN linux-2.5.3-pre3/arch/sparc64/kernel/pci_schizo.c linux/arch/sparc64/kernel/pci_schizo.c --- linux-2.5.3-pre3/arch/sparc64/kernel/pci_schizo.c Mon Jan 14 10:10:44 2002 +++ linux/arch/sparc64/kernel/pci_schizo.c Wed Jan 23 17:31:03 2002 @@ -1,4 +1,4 @@ -/* $Id: pci_schizo.c,v 1.23 2001/11/14 13:17:56 davem Exp $ +/* $Id: pci_schizo.c,v 1.24 2002/01/23 11:27:32 davem Exp $ * pci_schizo.c: SCHIZO specific PCI controller support. * * Copyright (C) 2001 David S. Miller (davem@redhat.com) @@ -344,7 +344,7 @@ ret = schizo_pil_table[ino]; if (ret == 0 && pdev == NULL) { - ret = 1; + ret = 2; } else if (ret == 0) { switch ((pdev->class >> 16) & 0xff) { case PCI_BASE_CLASS_STORAGE: @@ -367,7 +367,7 @@ break; default: - ret = 1; + ret = 2; break; }; } @@ -395,6 +395,10 @@ /* Now build the IRQ bucket. */ pil = schizo_ino_to_pil(pdev, ino); + + if (PIL_RESERVED(pil)) + BUG(); + imap = p->controller_regs + pbm_off + imap_off; imap += 4; diff -urN linux-2.5.3-pre3/arch/sparc64/kernel/process.c linux/arch/sparc64/kernel/process.c --- linux-2.5.3-pre3/arch/sparc64/kernel/process.c Wed Jan 23 17:31:00 2002 +++ linux/arch/sparc64/kernel/process.c Wed Jan 23 17:31:03 2002 @@ -1,4 +1,4 @@ -/* $Id: process.c,v 1.128 2002/01/11 08:45:38 davem Exp $ +/* $Id: process.c,v 1.129 2002/01/23 11:27:32 davem Exp $ * arch/sparc64/kernel/process.c * * Copyright (C) 1995, 1996 David S. Miller (davem@caip.rutgers.edu) diff -urN linux-2.5.3-pre3/arch/sparc64/kernel/sbus.c linux/arch/sparc64/kernel/sbus.c --- linux-2.5.3-pre3/arch/sparc64/kernel/sbus.c Mon Jan 14 10:10:44 2002 +++ linux/arch/sparc64/kernel/sbus.c Wed Jan 23 17:31:03 2002 @@ -1,4 +1,4 @@ -/* $Id: sbus.c,v 1.18 2001/12/17 07:05:09 davem Exp $ +/* $Id: sbus.c,v 1.19 2002/01/23 11:27:32 davem Exp $ * sbus.c: UltraSparc SBUS controller support. * * Copyright (C) 1999 David S. Miller (davem@redhat.com) @@ -628,10 +628,10 @@ /* SBUS SYSIO INO number to Sparc PIL level. */ static unsigned char sysio_ino_to_pil[] = { - 0, 1, 2, 7, 5, 7, 8, 9, /* SBUS slot 0 */ - 0, 1, 2, 7, 5, 7, 8, 9, /* SBUS slot 1 */ - 0, 1, 2, 7, 5, 7, 8, 9, /* SBUS slot 2 */ - 0, 1, 2, 7, 5, 7, 8, 9, /* SBUS slot 3 */ + 0, 2, 2, 7, 5, 7, 8, 9, /* SBUS slot 0 */ + 0, 2, 2, 7, 5, 7, 8, 9, /* SBUS slot 1 */ + 0, 2, 2, 7, 5, 7, 8, 9, /* SBUS slot 2 */ + 0, 2, 2, 7, 5, 7, 8, 9, /* SBUS slot 3 */ 3, /* Onboard SCSI */ 5, /* Onboard Ethernet */ /*XXX*/ 8, /* Onboard BPP */ @@ -754,6 +754,10 @@ printk("sbus_irq_build: Bad SYSIO INO[%x]\n", ino); panic("Bad SYSIO IRQ translations..."); } + + if (PIL_RESERVED(pil)) + BUG(); + imap = sysio_irq_offsets[ino]; if (imap == ((unsigned long)-1)) { prom_printf("get_irq_translations: Bad SYSIO INO[%x] cpu[%d]\n", diff -urN linux-2.5.3-pre3/arch/sparc64/kernel/smp.c linux/arch/sparc64/kernel/smp.c --- linux-2.5.3-pre3/arch/sparc64/kernel/smp.c Wed Jan 23 17:31:00 2002 +++ linux/arch/sparc64/kernel/smp.c Wed Jan 23 17:31:03 2002 @@ -218,10 +218,12 @@ atomic_inc(&init_mm.mm_count); current->active_mm = &init_mm; + init_idle(); + while (!smp_threads_ready) membar("#LoadLoad"); - init_idle(); + idle_startup_done(); } void cpu_panic(void) @@ -873,6 +875,48 @@ local_flush_and_out: __flush_tlb_page(ctx, page, SECONDARY_CONTEXT); } +} + +/* Process migration IPIs. */ + +extern unsigned long xcall_migrate_task; + +static spinlock_t migration_lock = SPIN_LOCK_UNLOCKED; +static task_t *new_task; + +void smp_migrate_task(int cpu, task_t *p) +{ + unsigned long mask = 1UL << cpu; + + if (cpu == smp_processor_id()) + return; + + if (smp_processors_ready && (cpu_present_map & mask) != 0) { + u64 data0 = (((u64)&xcall_migrate_task) & 0xffffffff); + + spin_lock(&migration_lock); + new_task = p; + + if (tlb_type == spitfire) + spitfire_xcall_deliver(data0, 0, 0, mask); + else + cheetah_xcall_deliver(data0, 0, 0, mask); + } +} + +/* Called at PIL level 1. */ +asmlinkage void smp_task_migration_interrupt(int irq, struct pt_regs *regs) +{ + task_t *p; + + if (irq != PIL_MIGRATE) + BUG(); + + clear_softint(1 << irq); + + p = new_task; + spin_unlock(&migration_lock); + sched_task_migrated(p); } /* CPU capture. */ diff -urN linux-2.5.3-pre3/arch/sparc64/kernel/time.c linux/arch/sparc64/kernel/time.c --- linux-2.5.3-pre3/arch/sparc64/kernel/time.c Mon Jan 14 10:10:44 2002 +++ linux/arch/sparc64/kernel/time.c Wed Jan 23 17:31:03 2002 @@ -1,4 +1,4 @@ -/* $Id: time.c,v 1.41 2001/11/20 18:24:55 kanoj Exp $ +/* $Id: time.c,v 1.42 2002/01/23 14:33:55 davem Exp $ * time.c: UltraSparc timer and TOD clock support. * * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) @@ -329,8 +329,6 @@ unsigned long dregs = 0UL; #endif u8 tmp; - - do_get_fast_time = do_gettimeofday; if (!mregs && !dregs) { prom_printf("Something wrong, clock regs not mapped yet.\n"); diff -urN linux-2.5.3-pre3/arch/sparc64/kernel/ttable.S linux/arch/sparc64/kernel/ttable.S --- linux-2.5.3-pre3/arch/sparc64/kernel/ttable.S Mon Jan 14 10:10:44 2002 +++ linux/arch/sparc64/kernel/ttable.S Wed Jan 23 17:31:03 2002 @@ -1,4 +1,4 @@ -/* $Id: ttable.S,v 1.36 2001/11/28 23:32:16 davem Exp $ +/* $Id: ttable.S,v 1.37 2002/01/23 11:27:32 davem Exp $ * ttable.S: Sparc V9 Trap Table(s) with SpitFire/Cheetah extensions. * * Copyright (C) 1996, 2001 David S. Miller (davem@caip.rutgers.edu) @@ -44,7 +44,12 @@ tl0_privact: TRAP_NOSAVE(__do_privact) tl0_resv038: BTRAP(0x38) BTRAP(0x39) BTRAP(0x3a) BTRAP(0x3b) BTRAP(0x3c) BTRAP(0x3d) tl0_resv03e: BTRAP(0x3e) BTRAP(0x3f) BTRAP(0x40) -tl0_irq1: TRAP_IRQ(handler_irq, 1) TRAP_IRQ(handler_irq, 2) +#ifdef CONFIG_SMP +tl0_irq1: TRAP_IRQ(smp_task_migration_interrupt, 1) +#else +tl0_irq1: BTRAP(0x41) +#endif +tl0_irq2: TRAP_IRQ(handler_irq, 2) tl0_irq3: TRAP_IRQ(handler_irq, 3) TRAP_IRQ(handler_irq, 4) tl0_irq5: TRAP_IRQ(handler_irq, 5) TRAP_IRQ(handler_irq, 6) tl0_irq7: TRAP_IRQ(handler_irq, 7) TRAP_IRQ(handler_irq, 8) diff -urN linux-2.5.3-pre3/arch/sparc64/mm/ultra.S linux/arch/sparc64/mm/ultra.S --- linux-2.5.3-pre3/arch/sparc64/mm/ultra.S Mon Jan 14 10:10:44 2002 +++ linux/arch/sparc64/mm/ultra.S Wed Jan 23 17:31:03 2002 @@ -1,4 +1,4 @@ -/* $Id: ultra.S,v 1.70 2001/11/29 16:42:10 kanoj Exp $ +/* $Id: ultra.S,v 1.71 2002/01/23 11:27:36 davem Exp $ * ultra.S: Don't expand these all over the place... * * Copyright (C) 1997, 2000 David S. Miller (davem@redhat.com) @@ -10,6 +10,7 @@ #include #include #include +#include /* Basically, all this madness has to do with the * fact that Cheetah does not support IMMU flushes @@ -690,5 +691,12 @@ nop b,pt %xcc, rtrap clr %l6 + + .globl xcall_migrate_task +xcall_migrate_task: + mov 1, %g2 + sllx %g2, (PIL_MIGRATE), %g2 + wr %g2, 0x0, %set_softint + retry #endif /* CONFIG_SMP */ diff -urN linux-2.5.3-pre3/arch/sparc64/vmlinux.lds linux/arch/sparc64/vmlinux.lds --- linux-2.5.3-pre3/arch/sparc64/vmlinux.lds Fri Sep 7 11:01:20 2001 +++ linux/arch/sparc64/vmlinux.lds Wed Jan 23 17:31:03 2002 @@ -46,7 +46,15 @@ .setup_init : { *(.setup.init) } __setup_end = .; __initcall_start = .; - .initcall.init : { *(.initcall.init) } + .initcall.init : { + *(.initcall1.init) + *(.initcall2.init) + *(.initcall3.init) + *(.initcall4.init) + *(.initcall5.init) + *(.initcall6.init) + *(.initcall7.init) + } __initcall_end = .; . = ALIGN(8192); __init_end = .; diff -urN linux-2.5.3-pre3/drivers/char/joystick/iforce.c linux/drivers/char/joystick/iforce.c --- linux-2.5.3-pre3/drivers/char/joystick/iforce.c Sun Jan 6 18:49:21 2002 +++ linux/drivers/char/joystick/iforce.c Wed Jan 23 17:31:04 2002 @@ -133,7 +133,7 @@ #endif #ifdef IFORCE_USB struct usb_device *usbdev; /* USB transfer */ - struct urb irq, out, ctrl; + struct urb *irq, *out, *ctrl; struct usb_ctrlrequest dr; #endif /* Force Feedback */ @@ -196,28 +196,28 @@ DECLARE_WAITQUEUE(wait, current); int timeout = HZ; /* 1 second */ - memcpy(iforce->out.transfer_buffer + 1, data, LO(cmd)); - ((char*)iforce->out.transfer_buffer)[0] = HI(cmd); - iforce->out.transfer_buffer_length = LO(cmd) + 2; - iforce->out.dev = iforce->usbdev; + memcpy(iforce->out->transfer_buffer + 1, data, LO(cmd)); + ((char*)iforce->out->transfer_buffer)[0] = HI(cmd); + iforce->out->transfer_buffer_length = LO(cmd) + 2; + iforce->out->dev = iforce->usbdev; set_current_state(TASK_INTERRUPTIBLE); add_wait_queue(&iforce->wait, &wait); - if (usb_submit_urb(&iforce->out)) { + if (usb_submit_urb(iforce->out)) { set_current_state(TASK_RUNNING); remove_wait_queue(&iforce->wait, &wait); return; } - while (timeout && iforce->out.status == -EINPROGRESS) + while (timeout && iforce->out->status == -EINPROGRESS) timeout = schedule_timeout(timeout); set_current_state(TASK_RUNNING); remove_wait_queue(&iforce->wait, &wait); if (!timeout) - usb_unlink_urb(&iforce->out); + usb_unlink_urb(iforce->out); return; } @@ -284,25 +284,25 @@ case IFORCE_USB: iforce->dr.bRequest = packet[0]; - iforce->ctrl.dev = iforce->usbdev; + iforce->ctrl->dev = iforce->usbdev; set_current_state(TASK_INTERRUPTIBLE); add_wait_queue(&iforce->wait, &wait); - if (usb_submit_urb(&iforce->ctrl)) { + if (usb_submit_urb(iforce->ctrl)) { set_current_state(TASK_RUNNING); remove_wait_queue(&iforce->wait, &wait); return -1; } - while (timeout && iforce->ctrl.status == -EINPROGRESS) + while (timeout && iforce->ctrl->status == -EINPROGRESS) timeout = schedule_timeout(timeout); set_current_state(TASK_RUNNING); remove_wait_queue(&iforce->wait, &wait); if (!timeout) { - usb_unlink_urb(&iforce->ctrl); + usb_unlink_urb(iforce->ctrl); return -1; } @@ -344,8 +344,8 @@ case IFORCE_USB: if (iforce->open++) break; - iforce->irq.dev = iforce->usbdev; - if (usb_submit_urb(&iforce->irq)) + iforce->irq->dev = iforce->usbdev; + if (usb_submit_urb(iforce->irq)) return -EIO; break; #endif @@ -361,7 +361,7 @@ #ifdef IFORCE_USB case IFORCE_USB: if (!--iforce->open) - usb_unlink_urb(&iforce->irq); + usb_unlink_urb(iforce->irq); break; #endif } @@ -1024,6 +1024,25 @@ if (!(iforce = kmalloc(sizeof(struct iforce) + 32, GFP_KERNEL))) return NULL; memset(iforce, 0, sizeof(struct iforce)); + iforce->irq = usb_alloc_urb(0); + if (!iforce->irq) { + kfree(iforce); + return NULL; + } + iforce->out = usb_alloc_urb(0); + if (!iforce->out) { + usb_free_urb(iforce->irq); + kfree(iforce); + return NULL; + } + iforce->ctrl = usb_alloc_urb(0); + if (!iforce->ctrl) { + usb_free_urb(iforce->out); + usb_free_urb(iforce->irq); + kfree(iforce); + return NULL; + } + iforce->bus = IFORCE_USB; iforce->usbdev = dev; @@ -1031,16 +1050,19 @@ iforce->dr.wIndex = 0; iforce->dr.wLength = 16; - FILL_INT_URB(&iforce->irq, dev, usb_rcvintpipe(dev, epirq->bEndpointAddress), + FILL_INT_URB(iforce->irq, dev, usb_rcvintpipe(dev, epirq->bEndpointAddress), iforce->data, 16, iforce_usb_irq, iforce, epirq->bInterval); - FILL_BULK_URB(&iforce->out, dev, usb_sndbulkpipe(dev, epout->bEndpointAddress), + FILL_BULK_URB(iforce->out, dev, usb_sndbulkpipe(dev, epout->bEndpointAddress), iforce + 1, 32, iforce_usb_out, iforce); - FILL_CONTROL_URB(&iforce->ctrl, dev, usb_rcvctrlpipe(dev, 0), + FILL_CONTROL_URB(iforce->ctrl, dev, usb_rcvctrlpipe(dev, 0), (void*) &iforce->dr, iforce->edata, 16, iforce_usb_ctrl, iforce); if (iforce_init_device(iforce)) { + usb_free_urb(iforce->ctrl); + usb_free_urb(iforce->out); + usb_free_urb(iforce->irq); kfree(iforce); return NULL; } @@ -1055,8 +1077,11 @@ static void iforce_usb_disconnect(struct usb_device *dev, void *ptr) { struct iforce *iforce = ptr; - usb_unlink_urb(&iforce->irq); + usb_unlink_urb(iforce->irq); input_unregister_device(&iforce->dev); + usb_free_urb(iforce->ctrl); + usb_free_urb(iforce->out); + usb_free_urb(iforce->irq); kfree(iforce); } diff -urN linux-2.5.3-pre3/drivers/dio/dio.c linux/drivers/dio/dio.c --- linux-2.5.3-pre3/drivers/dio/dio.c Fri Feb 9 11:30:23 2001 +++ linux/drivers/dio/dio.c Wed Jan 23 17:31:04 2002 @@ -208,6 +208,8 @@ } } +subsys_initcall(dio_init); + /* Bear in mind that this is called in the very early stages of initialisation * in order to get the virtual address of the serial port for the console... */ diff -urN linux-2.5.3-pre3/drivers/ieee1394/video1394.c linux/drivers/ieee1394/video1394.c --- linux-2.5.3-pre3/drivers/ieee1394/video1394.c Wed Jan 23 17:31:01 2002 +++ linux/drivers/ieee1394/video1394.c Wed Jan 23 17:31:04 2002 @@ -639,7 +639,7 @@ if (d->ir_prg[i][d->nb_cmd-1].status & 0xFFFF0000) { reset_ir_status(d, i); d->buffer_status[i] = VIDEO1394_BUFFER_READY; - get_fast_time(&d->buffer_time[i]); + do_gettimeofday(&d->buffer_time[i]); } } spin_unlock(&d->lock); diff -urN linux-2.5.3-pre3/drivers/input/evdev.c linux/drivers/input/evdev.c --- linux-2.5.3-pre3/drivers/input/evdev.c Thu Jan 3 12:20:10 2002 +++ linux/drivers/input/evdev.c Wed Jan 23 17:31:04 2002 @@ -67,7 +67,7 @@ while (list) { - get_fast_time(&list->buffer[list->head].time); + do_gettimeofday(&list->buffer[list->head].time); list->buffer[list->head].type = type; list->buffer[list->head].code = code; list->buffer[list->head].value = value; diff -urN linux-2.5.3-pre3/drivers/media/video/zr36067.c linux/drivers/media/video/zr36067.c --- linux-2.5.3-pre3/drivers/media/video/zr36067.c Wed Jan 23 17:31:01 2002 +++ linux/drivers/media/video/zr36067.c Wed Jan 23 17:31:04 2002 @@ -2608,7 +2608,7 @@ } frame = zr->jpg_pend[zr->jpg_dma_tail & BUZ_MASK_FRAME]; gbuf = &zr->jpg_gbuf[frame]; - get_fast_time(&gbuf->bs.timestamp); + do_gettimeofday(&gbuf->bs.timestamp); if (zr->codec_mode == BUZ_MODE_MOTION_COMPRESS) { gbuf->bs.length = (stat_com & 0x7fffff) >> 1; diff -urN linux-2.5.3-pre3/drivers/net/irda/ali-ircc.c linux/drivers/net/irda/ali-ircc.c --- linux-2.5.3-pre3/drivers/net/irda/ali-ircc.c Sun Sep 30 12:26:06 2001 +++ linux/drivers/net/irda/ali-ircc.c Wed Jan 23 17:31:04 2002 @@ -1496,7 +1496,7 @@ if (mtt) { /* Check how much time we have used already */ - get_fast_time(&self->now); + do_gettimeofday(&self->now); diff = self->now.tv_usec - self->stamp.tv_usec; /* self->stamp is set from ali_ircc_dma_receive_complete() */ @@ -1913,7 +1913,7 @@ * reduce the min turn time a bit since we will know * how much time we have used for protocol processing */ - get_fast_time(&self->stamp); + do_gettimeofday(&self->stamp); skb = dev_alloc_skb(len+1); if (skb == NULL) diff -urN linux-2.5.3-pre3/drivers/net/irda/irda-usb.c linux/drivers/net/irda/irda-usb.c --- linux-2.5.3-pre3/drivers/net/irda/irda-usb.c Tue Jan 1 13:52:10 2002 +++ linux/drivers/net/irda/irda-usb.c Wed Jan 23 17:31:04 2002 @@ -427,7 +427,7 @@ mtt = irda_get_mtt(skb); if (mtt) { int diff; - get_fast_time(&self->now); + do_gettimeofday(&self->now); diff = self->now.tv_usec - self->stamp.tv_usec; #ifdef IU_USB_MIN_RTT /* Factor in USB delays -> Get rid of udelay() that @@ -798,7 +798,7 @@ * reduce the min turn time a bit since we will know * how much time we have used for protocol processing */ - get_fast_time(&self->stamp); + do_gettimeofday(&self->stamp); /* Fix skb, and remove USB-IrDA header */ skb_put(skb, urb->actual_length); diff -urN linux-2.5.3-pre3/drivers/net/irda/nsc-ircc.c linux/drivers/net/irda/nsc-ircc.c --- linux-2.5.3-pre3/drivers/net/irda/nsc-ircc.c Wed Jan 9 14:56:33 2002 +++ linux/drivers/net/irda/nsc-ircc.c Wed Jan 23 17:31:04 2002 @@ -1163,7 +1163,7 @@ mtt = irda_get_mtt(skb); if (mtt) { /* Check how much time we have used already */ - get_fast_time(&self->now); + do_gettimeofday(&self->now); diff = self->now.tv_usec - self->stamp.tv_usec; if (diff < 0) diff += 1000000; @@ -1535,7 +1535,7 @@ * reduce the min turn time a bit since we will know * how much time we have used for protocol processing */ - get_fast_time(&self->stamp); + do_gettimeofday(&self->stamp); skb = dev_alloc_skb(len+1); if (skb == NULL) { diff -urN linux-2.5.3-pre3/drivers/net/sungem.c linux/drivers/net/sungem.c --- linux-2.5.3-pre3/drivers/net/sungem.c Wed Jan 23 17:31:01 2002 +++ linux/drivers/net/sungem.c Wed Jan 23 17:31:04 2002 @@ -1,4 +1,4 @@ -/* $Id: sungem.c,v 1.48 2002/01/15 06:26:37 davem Exp $ +/* $Id: sungem.c,v 1.49 2002/01/23 15:40:45 davem Exp $ * sungem.c: Sun GEM ethernet driver. * * Copyright (C) 2000, 2001 David S. Miller (davem@redhat.com) @@ -10,6 +10,10 @@ * - Get rid of all those nasty mdelay's and replace them * with schedule_timeout. * - Implement WOL + * - Currently, forced Gb mode is only supported on bcm54xx + * PHY for which I use the SPD2 bit of the control register. + * On m1011 PHY, I can't force as I don't have the specs, but + * I can at least detect gigabit with autoneg. */ #include @@ -86,7 +90,7 @@ BMCR_ANENABLE, /* 0 : autoneg */ 0, /* 1 : 10bt half duplex */ BMCR_SPEED100, /* 2 : 100bt half duplex */ - BMCR_SPD2, /* verify this */ /* 3 : 1000bt half duplex */ + BMCR_SPD2, /* bcm54xx only */ /* 3 : 1000bt half duplex */ BMCR_FULLDPLX, /* 4 : 10bt full duplex */ BMCR_SPEED100|BMCR_FULLDPLX, /* 5 : 100bt full duplex */ BMCR_SPD2|BMCR_FULLDPLX /* 6 : 1000bt full duplex */ @@ -1004,6 +1008,14 @@ *fd = 1; if (val & (LPA_100FULL | LPA_100HALF)) *spd = 100; + + if (gp->phy_mod == phymod_m1011) { + val = phy_read(gp, 0x0a); + if (val & 0xc00) + *spd = 1000; + if (val & 0x800) + *fd = 1; + } } } @@ -1579,6 +1591,11 @@ gem_init_bcm5411_phy(gp); gp->gigabit_capable = 1; break; + case 0x1410c60: + printk("M1011 (Marvel ?)\n"); + gp->phy_mod = phymod_m1011; + gp->gigabit_capable = 1; + break; case 0x18074c0: printk("Lucent\n"); @@ -1591,7 +1608,7 @@ break; default: - printk("Unknown\n"); + printk("Unknown (Using generic mode)\n"); gp->phy_mod = phymod_generic; break; }; @@ -1662,6 +1679,12 @@ writel(val, gp->regs + PCS_SCTRL); gp->gigabit_capable = 1; } + + /* BMCR_SPD2 is a broadcom 54xx specific thing afaik */ + if (gp->phy_mod != phymod_bcm5400 && gp->phy_mod != phymod_bcm5401 && + gp->phy_mod != phymod_bcm5411) + gp->link_cntl &= ~BMCR_SPD2; + } static void gem_init_dma(struct gem *gp) @@ -1851,9 +1874,8 @@ u32 mif_cfg; /* On Apple's sungem, we can't rely on registers as the chip - * was been powered down by the firmware. We do the PHY lookup - * when the interface is opened and we configure the driver - * with known values. + * was been powered down by the firmware. The PHY is looked + * up later on. */ if (pdev->vendor == PCI_VENDOR_ID_APPLE) { gp->phy_type = phy_mii_mdio0; @@ -1978,7 +2000,8 @@ pmac_call_feature(PMAC_FTR_GMAC_ENABLE, gp->of_node, 0, 1); - udelay(100); + current->state = TASK_UNINTERRUPTIBLE; + schedule_timeout((21 * HZ) / 1000); pci_read_config_word(gp->pdev, PCI_COMMAND, &cmd); cmd |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE; @@ -2048,7 +2071,8 @@ val & ~MII_BCM5201_AUXMODE2_LOWPOWER); #endif phy_write(gp, MII_BCM5201_MULTIPHY, MII_BCM5201_MULTIPHY_SUPERISOLATE); - } + } else if (gp->phy_mod == phymod_m1011) + phy_write(gp, MII_BMCR, BMCR_PDOWN); /* According to Apple, we must set the MDIO pins to this begnign * state or we may 1) eat more current, 2) damage some PHYs diff -urN linux-2.5.3-pre3/drivers/net/sungem.h linux/drivers/net/sungem.h --- linux-2.5.3-pre3/drivers/net/sungem.h Wed Jan 23 17:31:01 2002 +++ linux/drivers/net/sungem.h Wed Jan 23 17:31:04 2002 @@ -1,4 +1,4 @@ -/* $Id: sungem.h,v 1.11 2002/01/12 07:19:55 davem Exp $ +/* $Id: sungem.h,v 1.12 2002/01/23 15:40:45 davem Exp $ * sungem.h: Definitions for Sun GEM ethernet driver. * * Copyright (C) 2000 David S. Miller (davem@redhat.com) @@ -941,6 +941,7 @@ phymod_bcm5400, phymod_bcm5401, phymod_bcm5411, + phymod_m1011, }; enum link_state { diff -urN linux-2.5.3-pre3/drivers/nubus/nubus.c linux/drivers/nubus/nubus.c --- linux-2.5.3-pre3/drivers/nubus/nubus.c Wed Jun 27 17:10:55 2001 +++ linux/drivers/nubus/nubus.c Wed Jan 23 17:31:04 2002 @@ -1039,3 +1039,5 @@ nubus_proc_init(); #endif } + +subsys_initcall(nubus_init); diff -urN linux-2.5.3-pre3/drivers/pci/pci.c linux/drivers/pci/pci.c --- linux-2.5.3-pre3/drivers/pci/pci.c Tue Nov 20 21:53:29 2001 +++ linux/drivers/pci/pci.c Wed Jan 23 17:31:04 2002 @@ -1064,6 +1064,7 @@ memset(b, 0, sizeof(*b)); INIT_LIST_HEAD(&b->children); INIT_LIST_HEAD(&b->devices); + iobus_init(&b->iobus); } return b; } @@ -1085,6 +1086,13 @@ child->ops = parent->ops; child->sysdata = parent->sysdata; + /* init generic fields */ + child->iobus.self = &dev->dev; + child->iobus.parent = &parent->iobus; + dev->dev.subordinate = &child->iobus; + + strcpy(child->iobus.name,dev->dev.name); + /* * Set up the primary, secondary and subordinate * bus numbers. @@ -1180,6 +1188,7 @@ pci_write_config_word(dev, PCI_COMMAND, cr); } sprintf(child->name, (is_cardbus ? "PCI CardBus #%02x" : "PCI Bus #%02x"), child->number); + return max; } @@ -1288,13 +1297,22 @@ dev->vendor = l & 0xffff; dev->device = (l >> 16) & 0xffff; + /* make sure generic fields are setup properly */ + device_init_dev(&dev->dev); + /* Assume 32-bit PCI; let 64-bit PCI cards (which are far rarer) set this higher, assuming the system even supports it. */ dev->dma_mask = 0xffffffff; if (pci_setup_device(dev) < 0) { kfree(dev); - dev = NULL; + return NULL; } + + /* now put in global tree */ + strcpy(dev->dev.name,dev->name); + strcpy(dev->dev.bus_id,dev->slot_name); + + device_register(&dev->dev); return dev; } @@ -1345,10 +1363,17 @@ DBG("Scanning bus %02x\n", bus->number); max = bus->secondary; + /* we should know for sure what the bus number is, so set the bus ID + * for the bus and make sure it's registered in the device tree */ + sprintf(bus->iobus.bus_id,"pci%d",bus->number); + iobus_register(&bus->iobus); + /* Create a device template */ memset(&dev0, 0, sizeof(dev0)); + device_init_dev(&dev0.dev); dev0.bus = bus; dev0.sysdata = bus->sysdata; + dev0.dev.parent = &bus->iobus; /* Go find them, Rover! */ for (devfn = 0; devfn < 0x100; devfn += 8) { @@ -1403,8 +1428,14 @@ } b = pci_alloc_bus(); + if (!b) + return NULL; list_add_tail(&b->node, &pci_root_buses); + sprintf(b->iobus.bus_id,"pci%d",bus); + strcpy(b->iobus.name,"Host/PCI Bridge"); + iobus_register(&b->iobus); + b->number = b->secondary = bus; b->resource[0] = &ioport_resource; b->resource[1] = &iomem_resource; @@ -1929,7 +1960,7 @@ } -void __devinit pci_init(void) +static int __devinit pci_init(void) { struct pci_dev *dev; @@ -1942,6 +1973,7 @@ #ifdef CONFIG_PM pm_register(PM_PCI_DEV, 0, pci_pm_callback); #endif + return 0; } static int __devinit pci_setup(char *str) @@ -1958,6 +1990,8 @@ } return 1; } + +subsys_initcall(pci_init); __setup("pci=", pci_setup); diff -urN linux-2.5.3-pre3/drivers/pcmcia/ds.c linux/drivers/pcmcia/ds.c --- linux-2.5.3-pre3/drivers/pcmcia/ds.c Tue Jan 1 11:51:31 2002 +++ linux/drivers/pcmcia/ds.c Wed Jan 23 17:31:04 2002 @@ -966,12 +966,9 @@ return 0; } -#ifdef MODULE +late_initcall(init_pcmcia_ds); -int __init init_module(void) -{ - return init_pcmcia_ds(); -} +#ifdef MODULE void __exit cleanup_module(void) { diff -urN linux-2.5.3-pre3/drivers/pnp/isapnp.c linux/drivers/pnp/isapnp.c --- linux-2.5.3-pre3/drivers/pnp/isapnp.c Mon Nov 12 10:02:54 2001 +++ linux/drivers/pnp/isapnp.c Wed Jan 23 17:31:04 2002 @@ -2356,12 +2356,9 @@ return 0; } -#ifdef MODULE +subsys_initcall(isapnp_init); -int init_module(void) -{ - return isapnp_init(); -} +#ifdef MODULE void cleanup_module(void) { diff -urN linux-2.5.3-pre3/drivers/sbus/sbus.c linux/drivers/sbus/sbus.c --- linux-2.5.3-pre3/drivers/sbus/sbus.c Mon Jan 14 10:10:44 2002 +++ linux/drivers/sbus/sbus.c Wed Jan 23 17:31:04 2002 @@ -509,3 +509,5 @@ } #endif } + +subsys_initcall(sbus_init); diff -urN linux-2.5.3-pre3/drivers/scsi/README.st linux/drivers/scsi/README.st --- linux-2.5.3-pre3/drivers/scsi/README.st Fri Nov 9 13:52:21 2001 +++ linux/drivers/scsi/README.st Wed Jan 23 17:31:04 2002 @@ -2,7 +2,7 @@ The driver is currently maintained by Kai M{kisara (email Kai.Makisara@metla.fi) -Last modified: Thu Nov 1 22:41:59 2001 by makisara@kai.makisara.local +Last modified: Tue Jan 22 21:08:57 2002 by makisara BASICS @@ -86,6 +86,11 @@ The compile options are defined in the file linux/drivers/scsi/st_options.h. +4. If the open option O_NONBLOCK is used, open succeeds even if the +drive is not ready. If O_NONBLOCK is not used, the driver waits for +the drive to become ready. If this does not happen in ST_BLOCK_SECONDS +seconds, open fails with the errno value EIO. + BSD AND SYS V SEMANTICS @@ -327,12 +332,19 @@ 0xffffff means that the default is not used any more. MT_ST_DEF_DENSITY MT_ST_DEF_DRVBUFFER + Used to set or clear the density (8 bits), and drive buffer + state (3 bits). If the value is MT_ST_CLEAR_DEFAULT + (0xfffff) the default will not be used any more. Otherwise + the lowermost bits of the value contain the new value of + the parameter. MT_ST_DEF_COMPRESSION - Used to set or clear the density (8 bits), drive buffer - state (3 bits), and compression (single bit). If the value is - MT_ST_CLEAR_DEFAULT (0xfffff), the default will not be used - any more. Otherwise the lower-most bits of the value contain - the new value of the parameter. + The compression default will not be used if the value of + the lowermost byte is 0xff. Otherwise the lowermost bit + contains the new default. If the bits 8-15 are set to a + non-zero number, and this number is not 0xff, the number is + used as the compression algorithm. The value + MT_ST_CLEAR_DEFAULT can be used to clear the compression + default. MT_ST_SET_TIMEOUT Set the normal timeout in seconds for this device. The default is 900 seconds (15 minutes). The timeout should be diff -urN linux-2.5.3-pre3/drivers/scsi/st.c linux/drivers/scsi/st.c --- linux-2.5.3-pre3/drivers/scsi/st.c Fri Jan 4 12:07:27 2002 +++ linux/drivers/scsi/st.c Wed Jan 23 17:31:04 2002 @@ -9,19 +9,16 @@ Steve Hirsch, Andreas Koppenh"ofer, Michael Leodolter, Eyal Lebedinsky, Michael Schaefer, J"org Weule, and Eric Youngdale. - Copyright 1992 - 2001 Kai Makisara + Copyright 1992 - 2002 Kai Makisara email Kai.Makisara@metla.fi - Last modified: Sat Nov 3 19:30:55 2001 by makisara@kai.makisara.local + Last modified: Wed Jan 23 20:22:42 2002 by makisara Some small formal changes - aeb, 950809 Last modified: 18-JAN-1998 Richard Gooch Devfs support - - Reminder: write_lock_irqsave() can be replaced by write_lock() when the old SCSI - error handling will be discarded. */ -static char *verstr = "20011103"; +static char *verstr = "20020123"; #include @@ -160,21 +157,19 @@ static int append_to_buffer(const char *, ST_buffer *, int); static int from_buffer(ST_buffer *, char *, int); -static int st_init(void); static int st_attach(Scsi_Device *); static int st_detect(Scsi_Device *); static void st_detach(Scsi_Device *); -static struct Scsi_Device_Template st_template = -{ - name:"tape", - tag:"st", - scsi_type:TYPE_TAPE, - major:SCSI_TAPE_MAJOR, - detect:st_detect, - init:st_init, - attach:st_attach, - detach:st_detach +static struct Scsi_Device_Template st_template = { + module: THIS_MODULE, + name: "tape", + tag: "st", + scsi_type: TYPE_TAPE, + major: SCSI_TAPE_MAJOR, + detect: st_detect, + attach: st_attach, + detach: st_detach }; static int st_compression(Scsi_Tape *, int); @@ -239,7 +234,7 @@ return 0; } - if (driver_byte(result) & DRIVER_SENSE) + if ((driver_byte(result) & DRIVER_MASK) == DRIVER_SENSE) scode = sense[2] & 0x0f; else { sense[0] = 0; @@ -638,20 +633,96 @@ return 0; } +/* Test if the drive is ready. Returns either one of the codes below or a negative system + error code. */ +#define CHKRES_READY 0 +#define CHKRES_NEW_SESSION 1 +#define CHKRES_NOT_READY 2 +#define CHKRES_NO_TAPE 3 + +#define MAX_ATTENTIONS 10 + +static int test_ready(Scsi_Tape *STp, int do_wait) +{ + int attentions, waits, max_wait, scode; + int retval = CHKRES_READY, new_session = FALSE; + unsigned char cmd[MAX_COMMAND_SIZE]; + Scsi_Request *SRpnt = NULL; + + max_wait = do_wait ? ST_BLOCK_SECONDS : 0; + + for (attentions=waits=0; ; ) { + memset((void *) &cmd[0], 0, MAX_COMMAND_SIZE); + cmd[0] = TEST_UNIT_READY; + SRpnt = st_do_scsi(SRpnt, STp, cmd, 0, SCSI_DATA_NONE, + STp->long_timeout, MAX_READY_RETRIES, TRUE); + + if (!SRpnt) { + retval = (STp->buffer)->syscall_result; + break; + } + + if ((SRpnt->sr_sense_buffer[0] & 0x70) == 0x70) { + + scode = (SRpnt->sr_sense_buffer[2] & 0x0f); + + if (scode == UNIT_ATTENTION) { /* New media? */ + new_session = TRUE; + if (attentions < MAX_ATTENTIONS) { + attentions++; + continue; + } + else { + retval = (-EIO); + break; + } + } + + if (scode == NOT_READY) { + if (waits < max_wait) { + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(HZ); + if (signal_pending(current)) { + retval = (-EINTR); + break; + } + waits++; + continue; + } + else { + if ((STp->device)->scsi_level >= SCSI_2 && + SRpnt->sr_sense_buffer[12] == 0x3a) /* Check ASC */ + retval = CHKRES_NO_TAPE; + else + retval = CHKRES_NOT_READY; + break; + } + } + } + + retval = (STp->buffer)->syscall_result; + if (!retval) + retval = new_session ? CHKRES_NEW_SESSION : CHKRES_READY; + break; + } + + if (SRpnt != NULL) + scsi_release_request(SRpnt); + return retval; +} + + /* See if the drive is ready and gather information about the tape. Return values: < 0 negative error code from errno.h 0 drive ready 1 drive not ready (possibly no tape) */ -#define CHKRES_READY 0 -#define CHKRES_NOT_READY 1 - static int check_tape(Scsi_Tape *STp, struct file *filp) { - int i, retval, new_session = FALSE; + int i, retval, new_session = FALSE, do_wait; unsigned char cmd[MAX_COMMAND_SIZE], saved_cleaning; unsigned short st_flags = filp->f_flags; - Scsi_Request *SRpnt; + Scsi_Request *SRpnt = NULL; ST_mode *STm; ST_partstat *STps; int dev = TAPE_NR(STp->devt); @@ -668,32 +739,16 @@ } STm = &(STp->modes[STp->current_mode]); - memset((void *) &cmd[0], 0, MAX_COMMAND_SIZE); - cmd[0] = TEST_UNIT_READY; - saved_cleaning = STp->cleaning_req; STp->cleaning_req = 0; - SRpnt = st_do_scsi(NULL, STp, cmd, 0, SCSI_DATA_NONE, STp->long_timeout, - MAX_READY_RETRIES, TRUE); - if (!SRpnt) { - retval = (STp->buffer)->syscall_result; - goto err_out; - } - if ((SRpnt->sr_sense_buffer[0] & 0x70) == 0x70 && - (SRpnt->sr_sense_buffer[2] & 0x0f) == UNIT_ATTENTION) { /* New media? */ + do_wait = ((filp->f_flags & O_NONBLOCK) == 0); + retval = test_ready(STp, do_wait); - /* Flush the queued UNIT ATTENTION sense data */ - for (i=0; i < 10; i++) { - memset((void *) &cmd[0], 0, MAX_COMMAND_SIZE); - cmd[0] = TEST_UNIT_READY; - SRpnt = st_do_scsi(SRpnt, STp, cmd, 0, SCSI_DATA_NONE, - STp->long_timeout, MAX_READY_RETRIES, TRUE); - if ((SRpnt->sr_sense_buffer[0] & 0x70) != 0x70 || - (SRpnt->sr_sense_buffer[2] & 0x0f) != UNIT_ATTENTION) - break; - } + if (retval < 0) + goto err_out; + if (retval == CHKRES_NEW_SESSION) { (STp->device)->was_reset = 0; STp->partition = STp->new_partition = 0; if (STp->can_partitions) @@ -710,26 +765,23 @@ } new_session = TRUE; } - else + else { STp->cleaning_req |= saved_cleaning; - if ((STp->buffer)->syscall_result != 0) { - if ((STp->device)->scsi_level >= SCSI_2 && - (SRpnt->sr_sense_buffer[0] & 0x70) == 0x70 && - (SRpnt->sr_sense_buffer[2] & 0x0f) == NOT_READY && - SRpnt->sr_sense_buffer[12] == 0x3a) { /* Check ASC */ - STp->ready = ST_NO_TAPE; - } else - STp->ready = ST_NOT_READY; - scsi_release_request(SRpnt); - SRpnt = NULL; - STp->density = 0; /* Clear the erroneous "residue" */ - STp->write_prot = 0; - STp->block_size = 0; - STp->ps[0].drv_file = STp->ps[0].drv_block = (-1); - STp->partition = STp->new_partition = 0; - STp->door_locked = ST_UNLOCKED; - return CHKRES_NOT_READY; + if (retval == CHKRES_NOT_READY || retval == CHKRES_NO_TAPE) { + if (retval == CHKRES_NO_TAPE) + STp->ready = ST_NO_TAPE; + else + STp->ready = ST_NOT_READY; + + STp->density = 0; /* Clear the erroneous "residue" */ + STp->write_prot = 0; + STp->block_size = 0; + STp->ps[0].drv_file = STp->ps[0].drv_block = (-1); + STp->partition = STp->new_partition = 0; + STp->door_locked = ST_UNLOCKED; + return CHKRES_NOT_READY; + } } if (STp->omit_blklims) @@ -740,6 +792,10 @@ SRpnt = st_do_scsi(SRpnt, STp, cmd, 6, SCSI_DATA_READ, STp->timeout, MAX_READY_RETRIES, TRUE); + if (!SRpnt) { + retval = (STp->buffer)->syscall_result; + goto err_out; + } if (!SRpnt->sr_result && !SRpnt->sr_sense_buffer[0]) { STp->max_block = ((STp->buffer)->b_data[1] << 16) | @@ -763,6 +819,10 @@ SRpnt = st_do_scsi(SRpnt, STp, cmd, 12, SCSI_DATA_READ, STp->timeout, MAX_READY_RETRIES, TRUE); + if (!SRpnt) { + retval = (STp->buffer)->syscall_result; + goto err_out; + } if ((STp->buffer)->syscall_result != 0) { DEBC(printk(ST_DEB_MSG "st%d: No Mode Sense.\n", dev)); @@ -862,22 +922,21 @@ Scsi_Tape *STp; ST_partstat *STps; int dev = TAPE_NR(inode->i_rdev); - unsigned long flags; - write_lock_irqsave(&st_dev_arr_lock, flags); + write_lock(&st_dev_arr_lock); STp = scsi_tapes[dev]; if (dev >= st_template.dev_max || STp == NULL) { - write_unlock_irqrestore(&st_dev_arr_lock, flags); + write_unlock(&st_dev_arr_lock); return (-ENXIO); } if (STp->in_use) { - write_unlock_irqrestore(&st_dev_arr_lock, flags); + write_unlock(&st_dev_arr_lock); DEB( printk(ST_DEB_MSG "st%d: Device already in use.\n", dev); ) return (-EBUSY); } STp->in_use = 1; - write_unlock_irqrestore(&st_dev_arr_lock, flags); + write_unlock(&st_dev_arr_lock); STp->rew_at_close = STp->autorew_dev = (minor(inode->i_rdev) & 0x80) == 0; if (STp->device->host->hostt->module) @@ -891,7 +950,7 @@ /* Allocate a buffer for this user */ need_dma_buffer = STp->restr_dma; - write_lock_irqsave(&st_dev_arr_lock, flags); + write_lock(&st_dev_arr_lock); for (i = 0; i < st_nbr_buffers; i++) if (!st_buffers[i]->in_use && (!need_dma_buffer || st_buffers[i]->dma)) { @@ -899,7 +958,7 @@ (STp->buffer)->in_use = 1; break; } - write_unlock_irqrestore(&st_dev_arr_lock, flags); + write_unlock(&st_dev_arr_lock); if (i >= st_nbr_buffers) { STp->buffer = new_tape_buffer(FALSE, need_dma_buffer, TRUE); if (STp->buffer == NULL) { @@ -935,6 +994,11 @@ retval = check_tape(STp, filp); if (retval < 0) goto err_out; + if ((filp->f_flags & O_NONBLOCK) == 0 && + retval != CHKRES_READY) { + retval = (-EIO); + goto err_out; + } return 0; err_out: @@ -1076,7 +1140,6 @@ { int result = 0; Scsi_Tape *STp; - unsigned long flags; kdev_t devt = inode->i_rdev; int dev; @@ -1091,16 +1154,16 @@ if (STp->buffer != NULL) { normalize_buffer(STp->buffer); - write_lock_irqsave(&st_dev_arr_lock, flags); + write_lock(&st_dev_arr_lock); (STp->buffer)->in_use = 0; STp->buffer = NULL; } else { - write_lock_irqsave(&st_dev_arr_lock, flags); + write_lock(&st_dev_arr_lock); } STp->in_use = 0; - write_unlock_irqrestore(&st_dev_arr_lock, flags); + write_unlock(&st_dev_arr_lock); STp->device->access_count--; if (STp->device->host->hostt->module) __MOD_DEC_USE_COUNT(STp->device->host->hostt->module); @@ -1944,6 +2007,10 @@ STm->default_blksize = value; printk(KERN_INFO "st%d: Default block size set to %d bytes.\n", dev, STm->default_blksize); + if (STp->ready == ST_READY) { + STp->blksize_changed = FALSE; + set_mode_densblk(STp, STm); + } } } else if (code == MT_ST_TIMEOUTS) { value = (options & ~MT_ST_OPTIONS); @@ -1979,6 +2046,10 @@ STm->default_density = value & 0xff; printk(KERN_INFO "st%d: Density default set to %x\n", dev, STm->default_density); + if (STp->ready == ST_READY) { + STp->density_changed = FALSE; + set_mode_densblk(STp, STm); + } } } else if (code == MT_ST_DEF_DRVBUFFER) { if (value == MT_ST_CLEAR_DEFAULT) { @@ -1990,6 +2061,8 @@ printk(KERN_INFO "st%d: Drive buffer default set to %x\n", dev, STp->default_drvbuffer); + if (STp->ready == ST_READY) + st_int_ioctl(STp, MTSETDRVBUFFER, STp->default_drvbuffer); } } else if (code == MT_ST_DEF_COMPRESSION) { if (value == MT_ST_CLEAR_DEFAULT) { @@ -1997,9 +2070,20 @@ printk(KERN_INFO "st%d: Compression default disabled.\n", dev); } else { - STm->default_compression = (value & 1 ? ST_YES : ST_NO); - printk(KERN_INFO "st%d: Compression default set to %x\n", - dev, (value & 1)); + if ((value & 0xff00) != 0) { + STp->c_algo = (value & 0xff00) >> 8; + printk(KERN_INFO "st%d: Compression algorithm set to 0x%x.\n", + dev, STp->c_algo); + } + if ((value & 0xff) != 0xff) { + STm->default_compression = (value & 1 ? ST_YES : ST_NO); + printk(KERN_INFO "st%d: Compression default set to %x\n", + dev, (value & 1)); + if (STp->ready == ST_READY) { + STp->compression_changed = FALSE; + st_compression(STp, (STm->default_compression == ST_YES)); + } + } } } } else @@ -2087,6 +2171,7 @@ #define COMPRESSION_PAGE_LENGTH 16 #define CP_OFF_DCE_DCC 2 +#define CP_OFF_C_ALGO 7 #define DCE_MASK 0x80 #define DCC_MASK 0x40 @@ -2122,16 +2207,22 @@ (b_data[mpoffs + CP_OFF_DCE_DCC] & DCE_MASK ? 1 : 0))); /* Check if compression can be changed */ - if ((b_data[mpoffs + 2] & DCC_MASK) == 0) { + if ((b_data[mpoffs + CP_OFF_DCE_DCC] & DCC_MASK) == 0) { DEBC(printk(ST_DEB_MSG "st%d: Compression not supported.\n", dev)); return (-EIO); } /* Do the change */ - if (state) + if (state) { b_data[mpoffs + CP_OFF_DCE_DCC] |= DCE_MASK; - else + if (STp->c_algo != 0) + b_data[mpoffs + CP_OFF_C_ALGO] = STp->c_algo; + } + else { b_data[mpoffs + CP_OFF_DCE_DCC] &= ~DCE_MASK; + if (STp->c_algo != 0) + b_data[mpoffs + CP_OFF_C_ALGO] = 0; /* no compression */ + } retval = write_mode_page(STp, COMPRESSION_PAGE); if (retval) { @@ -2171,7 +2262,7 @@ */ if (load_code >= 1 + MT_ST_HPLOADER_OFFSET && load_code <= 6 + MT_ST_HPLOADER_OFFSET) { - DEBC(printk(ST_DEB_MSG "st%d: Enhanced %sload slot %2ld.\n", + DEBC(printk(ST_DEB_MSG "st%d: Enhanced %sload slot %2d.\n", dev, (cmd[4]) ? "" : "un", load_code - MT_ST_HPLOADER_OFFSET)); cmd[3] = load_code - MT_ST_HPLOADER_OFFSET; /* MediaID field of C1553A */ @@ -2202,12 +2293,12 @@ if (!load_code) STp->rew_at_close = 0; - else + else { STp->rew_at_close = STp->autorew_dev; - - retval = check_tape(STp, filp); - if (retval > 0) - retval = 0; + retval = check_tape(STp, filp); + if (retval > 0) + retval = 0; + } } else { STps = &(STp->ps[STp->partition]); @@ -3286,7 +3377,6 @@ new_tape_buffer(int from_initialization, int need_dma, int in_use) { int i, priority, b_size, order, got = 0, segs = 0; - unsigned long flags; ST_buffer *tb; read_lock(&st_dev_arr_lock); @@ -3381,9 +3471,9 @@ tb->buffer_size = got; tb->writing = 0; - write_lock_irqsave(&st_dev_arr_lock, flags); + write_lock(&st_dev_arr_lock); st_buffers[st_nbr_buffers++] = tb; - write_unlock_irqrestore(&st_dev_arr_lock, flags); + write_unlock(&st_dev_arr_lock); return tb; } @@ -3611,7 +3701,6 @@ ST_mode *STm; ST_partstat *STps; int i, mode, target_nbr, dev_num; - unsigned long flags = 0; char *stp; if (SDp->type != TYPE_TAPE) @@ -3624,7 +3713,7 @@ return 1; } - write_lock_irqsave(&st_dev_arr_lock, flags); + write_lock(&st_dev_arr_lock); if (st_template.nr_dev >= st_template.dev_max) { Scsi_Tape **tmp_da; ST_buffer **tmp_ba; @@ -3635,7 +3724,7 @@ tmp_dev_max = ST_MAX_TAPES; if (tmp_dev_max <= st_template.nr_dev) { SDp->attached--; - write_unlock_irqrestore(&st_dev_arr_lock, flags); + write_unlock(&st_dev_arr_lock); printk(KERN_ERR "st: Too many tape devices (max. %d).\n", ST_MAX_TAPES); return 1; @@ -3649,7 +3738,7 @@ if (tmp_ba != NULL) kfree(tmp_ba); SDp->attached--; - write_unlock_irqrestore(&st_dev_arr_lock, flags); + write_unlock(&st_dev_arr_lock); printk(KERN_ERR "st: Can't extend device array.\n"); return 1; } @@ -3682,7 +3771,7 @@ tpnt = kmalloc(sizeof(Scsi_Tape), GFP_ATOMIC); if (tpnt == NULL) { SDp->attached--; - write_unlock_irqrestore(&st_dev_arr_lock, flags); + write_unlock(&st_dev_arr_lock); printk(KERN_ERR "st: Can't allocate device descriptor.\n"); return 1; } @@ -3770,7 +3859,7 @@ init_MUTEX(&tpnt->lock); st_template.nr_dev++; - write_unlock_irqrestore(&st_dev_arr_lock, flags); + write_unlock(&st_dev_arr_lock); printk(KERN_WARNING "Attached scsi tape st%d at scsi%d, channel %d, id %d, lun %d\n", dev_num, SDp->host->host_no, SDp->channel, SDp->id, SDp->lun); @@ -3798,45 +3887,12 @@ return 1; } -static int st_registered = 0; - -/* Driver initialization (not __init because may be called later) */ -static int st_init() -{ - unsigned long flags; - - if (st_template.dev_noticed == 0 || st_registered) - return 0; - - printk(KERN_INFO - "st: Version %s, bufsize %d, wrt %d, max init. bufs %d, s/g segs %d\n", - verstr, st_buffer_size, st_write_threshold, st_max_buffers, st_max_sg_segs); - - write_lock_irqsave(&st_dev_arr_lock, flags); - if (!st_registered) { - if (devfs_register_chrdev(SCSI_TAPE_MAJOR, "st", &st_fops)) { - write_unlock_irqrestore(&st_dev_arr_lock, flags); - printk(KERN_ERR "Unable to get major %d for SCSI tapes\n", - MAJOR_NR); - return 1; - } - st_registered++; - } - - st_template.dev_max = 0; - st_nbr_buffers = 0; - write_unlock_irqrestore(&st_dev_arr_lock, flags); - - return 0; -} - static void st_detach(Scsi_Device * SDp) { Scsi_Tape *tpnt; int i, mode; - unsigned long flags; - write_lock_irqsave(&st_dev_arr_lock, flags); + write_lock(&st_dev_arr_lock); for (i = 0; i < st_template.dev_max; i++) { tpnt = scsi_tapes[i]; if (tpnt != NULL && tpnt->device == SDp) { @@ -3852,22 +3908,30 @@ SDp->attached--; st_template.nr_dev--; st_template.dev_noticed--; - write_unlock_irqrestore(&st_dev_arr_lock, flags); + write_unlock(&st_dev_arr_lock); return; } } - write_unlock_irqrestore(&st_dev_arr_lock, flags); + write_unlock(&st_dev_arr_lock); return; } - static int __init init_st(void) { validate_options(); - st_template.module = THIS_MODULE; - return scsi_register_device(&st_template); + printk(KERN_INFO + "st: Version %s, bufsize %d, wrt %d, " + "max init. bufs %d, s/g segs %d\n", + verstr, st_buffer_size, st_write_threshold, + st_max_buffers, st_max_sg_segs); + + if (devfs_register_chrdev(SCSI_TAPE_MAJOR, "st", &st_fops) >= 0) + return scsi_register_device(&st_template); + + printk(KERN_ERR "Unable to get major %d for SCSI tapes\n", MAJOR_NR); + return 1; } static void __exit exit_st(void) @@ -3876,7 +3940,6 @@ scsi_unregister_device(&st_template); devfs_unregister_chrdev(SCSI_TAPE_MAJOR, "st"); - st_registered--; if (scsi_tapes != NULL) { for (i=0; i < st_template.dev_max; ++i) if (scsi_tapes[i]) diff -urN linux-2.5.3-pre3/drivers/scsi/st.h linux/drivers/scsi/st.h --- linux-2.5.3-pre3/drivers/scsi/st.h Fri Nov 9 13:52:21 2001 +++ linux/drivers/scsi/st.h Wed Jan 23 17:31:04 2002 @@ -83,6 +83,7 @@ unsigned char cln_sense_value; unsigned char cln_sense_mask; unsigned char use_pf; /* Set Page Format bit in all mode selects? */ + unsigned char c_algo; /* compression algorithm */ int tape_type; int write_threshold; int timeout; /* timeout for normal commands */ diff -urN linux-2.5.3-pre3/drivers/scsi/st_options.h linux/drivers/scsi/st_options.h --- linux-2.5.3-pre3/drivers/scsi/st_options.h Mon Apr 24 13:54:22 2000 +++ linux/drivers/scsi/st_options.h Wed Jan 23 17:31:04 2002 @@ -3,7 +3,7 @@ Copyright 1995-2000 Kai Makisara. - Last modified: Sat Apr 22 14:47:02 2000 by makisara@kai.makisara.local + Last modified: Tue Jan 22 21:52:34 2002 by makisara */ #ifndef _ST_OPTIONS_H @@ -99,5 +99,7 @@ The default is BSD semantics. */ #define ST_SYSV 0 +/* Time to wait for the drive to become ready if blocking open */ +#define ST_BLOCK_SECONDS 120 #endif diff -urN linux-2.5.3-pre3/drivers/sound/cmpci.c linux/drivers/sound/cmpci.c --- linux-2.5.3-pre3/drivers/sound/cmpci.c Wed Jan 23 17:31:01 2002 +++ linux/drivers/sound/cmpci.c Wed Jan 23 17:31:04 2002 @@ -1440,7 +1440,7 @@ static int cm_open_mixdev(struct inode *inode, struct file *file) { - int minor = MINOR(inode->i_rdev); + int minor = minor(inode->i_rdev); struct cm_state *s = devs; while (s && s->dev_mixer != minor) @@ -2190,7 +2190,7 @@ static int cm_open(struct inode *inode, struct file *file) { - int minor = MINOR(inode->i_rdev); + int minor = minor(inode->i_rdev); struct cm_state *s = devs; unsigned char fmtm = ~0, fmts = 0; @@ -2445,7 +2445,7 @@ static int cm_midi_open(struct inode *inode, struct file *file) { - int minor = MINOR(inode->i_rdev); + int minor = minor(inode->i_rdev); struct cm_state *s = devs; unsigned long flags; @@ -2662,7 +2662,7 @@ static int cm_dmfm_open(struct inode *inode, struct file *file) { - int minor = MINOR(inode->i_rdev); + int minor = minor(inode->i_rdev); struct cm_state *s = devs; while (s && s->dev_dmfm != minor) @@ -2861,7 +2861,9 @@ struct cm_state *s; mm_segment_t fs; int i, val; +#if defined(CONFIG_SOUND_CMPCI_MIDI) || defined(CONFIG_SOUND_CMPCI_FM) unsigned char reg_mask = 0; +#endif struct { unsigned short deviceid; char *devicename; diff -urN linux-2.5.3-pre3/drivers/sound/ymfpci.c linux/drivers/sound/ymfpci.c --- linux-2.5.3-pre3/drivers/sound/ymfpci.c Wed Jan 23 17:31:01 2002 +++ linux/drivers/sound/ymfpci.c Wed Jan 23 17:31:04 2002 @@ -832,7 +832,14 @@ u32 lpfK = ymfpci_calc_lpfK(rate); ymfpci_playback_bank_t *bank; int nbank; - unsigned le_0x40000000 = cpu_to_le32(0x40000000); + + /* + * The gain is a floating point number. According to the manual, + * bit 31 indicates a sign bit, bit 30 indicates an integer part, + * and bits [29:15] indicate a decimal fraction part. Thus, + * for a gain of 1.0 the constant of 0x40000000 is loaded. + */ + unsigned default_gain = cpu_to_le32(0x40000000); format = (stereo ? 0x00010000 : 0) | (w_16 ? 0 : 0x80000000); if (stereo) @@ -847,7 +854,7 @@ bank->loop_start = 0; bank->loop_end = cpu_to_le32(end); bank->loop_frac = 0; - bank->eg_gain_end = le_0x40000000; + bank->eg_gain_end = default_gain; bank->lpfQ = cpu_to_le32(lpfQ); bank->status = 0; bank->num_of_frames = 0; @@ -858,7 +865,7 @@ bank->delta_end = cpu_to_le32(delta); bank->lpfK = bank->lpfK_end = cpu_to_le32(lpfK); - bank->eg_gain = le_0x40000000; + bank->eg_gain = default_gain; bank->lpfD1 = bank->lpfD2 = 0; @@ -878,31 +885,31 @@ bank->left_gain = bank->right_gain = bank->left_gain_end = - bank->right_gain_end = le_0x40000000; + bank->right_gain_end = default_gain; } else { bank->eff2_gain = bank->eff2_gain_end = bank->eff3_gain = - bank->eff3_gain_end = le_0x40000000; + bank->eff3_gain_end = default_gain; } } else { if (!spdif) { if ((voice->number & 1) == 0) { bank->left_gain = - bank->left_gain_end = le_0x40000000; + bank->left_gain_end = default_gain; } else { bank->format |= cpu_to_le32(1); bank->right_gain = - bank->right_gain_end = le_0x40000000; + bank->right_gain_end = default_gain; } } else { if ((voice->number & 1) == 0) { bank->eff2_gain = - bank->eff2_gain_end = le_0x40000000; + bank->eff2_gain_end = default_gain; } else { bank->format |= cpu_to_le32(1); bank->eff3_gain = - bank->eff3_gain_end = le_0x40000000; + bank->eff3_gain_end = default_gain; } } } diff -urN linux-2.5.3-pre3/drivers/tc/tc.c linux/drivers/tc/tc.c --- linux-2.5.3-pre3/drivers/tc/tc.c Thu Oct 11 09:43:30 2001 +++ linux/drivers/tc/tc.c Wed Jan 23 17:31:04 2002 @@ -236,6 +236,8 @@ } } +subsys_initcall(tc_init); + EXPORT_SYMBOL(search_tc_card); EXPORT_SYMBOL(claim_tc_card); EXPORT_SYMBOL(release_tc_card); diff -urN linux-2.5.3-pre3/drivers/usb/CDCEther.c linux/drivers/usb/CDCEther.c --- linux-2.5.3-pre3/drivers/usb/CDCEther.c Sat Dec 8 20:28:44 2001 +++ linux/drivers/usb/CDCEther.c Wed Jan 23 17:31:04 2002 @@ -125,14 +125,14 @@ goon: // Prep the USB to wait for another frame - FILL_BULK_URB( ðer_dev->rx_urb, ether_dev->usb, + FILL_BULK_URB( ether_dev->rx_urb, ether_dev->usb, usb_rcvbulkpipe(ether_dev->usb, ether_dev->data_ep_in), ether_dev->rx_buff, ether_dev->wMaxSegmentSize, read_bulk_callback, ether_dev ); // Give this to the USB subsystem so it can tell us // when more data arrives. - if ( (res = usb_submit_urb(ðer_dev->rx_urb)) ) { + if ( (res = usb_submit_urb(ether_dev->rx_urb)) ) { warn( __FUNCTION__ " failed submint rx_urb %d", res); } @@ -259,8 +259,8 @@ warn("%s: Tx timed out.", net->name); // Tear the waiting frame off the list - ether_dev->tx_urb.transfer_flags |= USB_ASYNC_UNLINK; - usb_unlink_urb( ðer_dev->tx_urb ); + ether_dev->tx_urb->transfer_flags |= USB_ASYNC_UNLINK; + usb_unlink_urb( ether_dev->tx_urb ); // Update statistics ether_dev->stats.tx_errors++; @@ -293,16 +293,16 @@ memcpy(ether_dev->tx_buff, skb->data, skb->len); // Fill in the URB for shipping it out. - FILL_BULK_URB( ðer_dev->tx_urb, ether_dev->usb, + FILL_BULK_URB( ether_dev->tx_urb, ether_dev->usb, usb_sndbulkpipe(ether_dev->usb, ether_dev->data_ep_out), ether_dev->tx_buff, ether_dev->wMaxSegmentSize, write_bulk_callback, ether_dev ); // Tell the URB how much it will be transporting today - ether_dev->tx_urb.transfer_buffer_length = count; + ether_dev->tx_urb->transfer_buffer_length = count; // Send the URB on its merry way. - if ((res = usb_submit_urb(ðer_dev->tx_urb))) { + if ((res = usb_submit_urb(ether_dev->tx_urb))) { // Hmm... It didn't go. Tell someone... warn("failed tx_urb %d", res); // update some stats... @@ -344,13 +344,13 @@ } // Prep a receive URB - FILL_BULK_URB( ðer_dev->rx_urb, ether_dev->usb, + FILL_BULK_URB( ether_dev->rx_urb, ether_dev->usb, usb_rcvbulkpipe(ether_dev->usb, ether_dev->data_ep_in), ether_dev->rx_buff, ether_dev->wMaxSegmentSize, read_bulk_callback, ether_dev ); // Put it out there so the device can send us stuff - if ( (res = usb_submit_urb(ðer_dev->rx_urb)) ) + if ( (res = usb_submit_urb(ether_dev->rx_urb)) ) { // Hmm... Okay... warn( __FUNCTION__ " failed rx_urb %d", res ); @@ -383,9 +383,9 @@ } // We don't need the URBs anymore. - usb_unlink_urb( ðer_dev->rx_urb ); - usb_unlink_urb( ðer_dev->tx_urb ); - usb_unlink_urb( ðer_dev->intr_urb ); + usb_unlink_urb( ether_dev->rx_urb ); + usb_unlink_urb( ether_dev->tx_urb ); + usb_unlink_urb( ether_dev->intr_urb ); // That's it. I'm done. return 0; @@ -1144,6 +1144,25 @@ // Zero everything out. memset(ether_dev, 0, sizeof(ether_dev_t)); + ether_dev->rx_urb = usb_alloc_urb(0); + if (!ether_dev->rx_urb) { + kfree(ether_dev); + return NULL; + } + ether_dev->tx_urb = usb_alloc_urb(0); + if (!ether_dev->tx_urb) { + usb_free_urb(ether_dev->rx_urb); + kfree(ether_dev); + return NULL; + } + ether_dev->intr_urb = usb_alloc_urb(0); + if (!ether_dev->intr_urb) { + usb_free_urb(ether_dev->tx_urb); + usb_free_urb(ether_dev->rx_urb); + kfree(ether_dev); + return NULL; + } + // Let's see if we can find a configuration we can use. rc = find_valid_configuration( usb, ether_dev ); if (rc) { @@ -1290,6 +1309,9 @@ &(usb->config[ether_dev->configuration_num].interface[ether_dev->data_interface]) ); // No more tied up kernel memory + usb_free_urb(ether_dev->intr_urb); + usb_free_urb(ether_dev->rx_urb); + usb_free_urb(ether_dev->rx_urb); kfree( ether_dev ); // This does no good, but it looks nice! diff -urN linux-2.5.3-pre3/drivers/usb/CDCEther.h linux/drivers/usb/CDCEther.h --- linux-2.5.3-pre3/drivers/usb/CDCEther.h Sun Sep 23 09:49:00 2001 +++ linux/drivers/usb/CDCEther.h Wed Jan 23 17:31:04 2002 @@ -83,7 +83,7 @@ __u16 wNumberMCFilters; __u8 bNumberPowerFilters; int intr_interval; - struct urb rx_urb, tx_urb, intr_urb; + struct urb *rx_urb, *tx_urb, *intr_urb; unsigned char ALIGN(rx_buff[CDC_ETHER_MAX_MTU]); unsigned char ALIGN(tx_buff[CDC_ETHER_MAX_MTU]); unsigned char ALIGN(intr_buff[8]); diff -urN linux-2.5.3-pre3/drivers/usb/audio.c linux/drivers/usb/audio.c --- linux-2.5.3-pre3/drivers/usb/audio.c Wed Jan 23 17:31:01 2002 +++ linux/drivers/usb/audio.c Wed Jan 23 17:31:04 2002 @@ -297,12 +297,12 @@ #define FLG_CONNECTED 32 struct my_data_urb { - struct urb urb; + struct urb *urb; struct usb_iso_packet_descriptor isoframe[DESCFRAMES]; }; struct my_sync_urb { - struct urb urb; + struct urb *urb; struct usb_iso_packet_descriptor isoframe[SYNCFRAMES]; }; @@ -648,27 +648,27 @@ spin_unlock_irqrestore(&as->lock, flags); if (notkilled && signal_pending(current)) { if (i & FLG_URB0RUNNING) - usb_unlink_urb(&u->durb[0].urb); + usb_unlink_urb(u->durb[0].urb); if (i & FLG_URB1RUNNING) - usb_unlink_urb(&u->durb[1].urb); + usb_unlink_urb(u->durb[1].urb); if (i & FLG_SYNC0RUNNING) - usb_unlink_urb(&u->surb[0].urb); + usb_unlink_urb(u->surb[0].urb); if (i & FLG_SYNC1RUNNING) - usb_unlink_urb(&u->surb[1].urb); + usb_unlink_urb(u->surb[1].urb); notkilled = 0; } } set_current_state(TASK_RUNNING); - if (u->durb[0].urb.transfer_buffer) - kfree(u->durb[0].urb.transfer_buffer); - if (u->durb[1].urb.transfer_buffer) - kfree(u->durb[1].urb.transfer_buffer); - if (u->surb[0].urb.transfer_buffer) - kfree(u->surb[0].urb.transfer_buffer); - if (u->surb[1].urb.transfer_buffer) - kfree(u->surb[1].urb.transfer_buffer); - u->durb[0].urb.transfer_buffer = u->durb[1].urb.transfer_buffer = - u->surb[0].urb.transfer_buffer = u->surb[1].urb.transfer_buffer = NULL; + if (u->durb[0].urb->transfer_buffer) + kfree(u->durb[0].urb->transfer_buffer); + if (u->durb[1].urb->transfer_buffer) + kfree(u->durb[1].urb->transfer_buffer); + if (u->surb[0].urb->transfer_buffer) + kfree(u->surb[0].urb->transfer_buffer); + if (u->surb[1].urb->transfer_buffer) + kfree(u->surb[1].urb->transfer_buffer); + u->durb[0].urb->transfer_buffer = u->durb[1].urb->transfer_buffer = + u->surb[0].urb->transfer_buffer = u->surb[1].urb->transfer_buffer = NULL; } static inline void usbin_release(struct usb_audiodev *as) @@ -904,9 +904,9 @@ #if 0 printk(KERN_DEBUG "usbin_completed: status %d errcnt %d flags 0x%x\n", urb->status, urb->error_count, u->flags); #endif - if (urb == &u->durb[0].urb) + if (urb == u->durb[0].urb) mask = FLG_URB0RUNNING; - else if (urb == &u->durb[1].urb) + else if (urb == u->durb[1].urb) mask = FLG_URB1RUNNING; else { mask = 0; @@ -969,9 +969,9 @@ #if 0 printk(KERN_DEBUG "usbin_sync_completed: status %d errcnt %d flags 0x%x\n", urb->status, urb->error_count, u->flags); #endif - if (urb == &u->surb[0].urb) + if (urb == u->surb[0].urb) mask = FLG_SYNC0RUNNING; - else if (urb == &u->surb[1].urb) + else if (urb == u->surb[1].urb) mask = FLG_SYNC1RUNNING; else { mask = 0; @@ -1017,26 +1017,26 @@ u->phase = 0; maxsze = (u->freqmax + 0x3fff) >> (14 - AFMT_BYTESSHIFT(u->format)); bufsz = DESCFRAMES * maxsze; - if (u->durb[0].urb.transfer_buffer) - kfree(u->durb[0].urb.transfer_buffer); - u->durb[0].urb.transfer_buffer = kmalloc(bufsz, GFP_KERNEL); - u->durb[0].urb.transfer_buffer_length = bufsz; - if (u->durb[1].urb.transfer_buffer) - kfree(u->durb[1].urb.transfer_buffer); - u->durb[1].urb.transfer_buffer = kmalloc(bufsz, GFP_KERNEL); - u->durb[1].urb.transfer_buffer_length = bufsz; + if (u->durb[0].urb->transfer_buffer) + kfree(u->durb[0].urb->transfer_buffer); + u->durb[0].urb->transfer_buffer = kmalloc(bufsz, GFP_KERNEL); + u->durb[0].urb->transfer_buffer_length = bufsz; + if (u->durb[1].urb->transfer_buffer) + kfree(u->durb[1].urb->transfer_buffer); + u->durb[1].urb->transfer_buffer = kmalloc(bufsz, GFP_KERNEL); + u->durb[1].urb->transfer_buffer_length = bufsz; if (u->syncpipe) { - if (u->surb[0].urb.transfer_buffer) - kfree(u->surb[0].urb.transfer_buffer); - u->surb[0].urb.transfer_buffer = kmalloc(3*SYNCFRAMES, GFP_KERNEL); - u->surb[0].urb.transfer_buffer_length = 3*SYNCFRAMES; - if (u->surb[1].urb.transfer_buffer) - kfree(u->surb[1].urb.transfer_buffer); - u->surb[1].urb.transfer_buffer = kmalloc(3*SYNCFRAMES, GFP_KERNEL); - u->surb[1].urb.transfer_buffer_length = 3*SYNCFRAMES; + if (u->surb[0].urb->transfer_buffer) + kfree(u->surb[0].urb->transfer_buffer); + u->surb[0].urb->transfer_buffer = kmalloc(3*SYNCFRAMES, GFP_KERNEL); + u->surb[0].urb->transfer_buffer_length = 3*SYNCFRAMES; + if (u->surb[1].urb->transfer_buffer) + kfree(u->surb[1].urb->transfer_buffer); + u->surb[1].urb->transfer_buffer = kmalloc(3*SYNCFRAMES, GFP_KERNEL); + u->surb[1].urb->transfer_buffer_length = 3*SYNCFRAMES; } - if (!u->durb[0].urb.transfer_buffer || !u->durb[1].urb.transfer_buffer || - (u->syncpipe && (!u->surb[0].urb.transfer_buffer || !u->surb[1].urb.transfer_buffer))) { + if (!u->durb[0].urb->transfer_buffer || !u->durb[1].urb->transfer_buffer || + (u->syncpipe && (!u->surb[0].urb->transfer_buffer || !u->surb[1].urb->transfer_buffer))) { printk(KERN_ERR "usbaudio: cannot start playback device %d\n", dev->devnum); return 0; } @@ -1048,7 +1048,7 @@ } u->flags |= FLG_RUNNING; if (!(u->flags & FLG_URB0RUNNING)) { - urb = &u->durb[0].urb; + urb = u->durb[0].urb; urb->dev = dev; urb->pipe = u->datapipe; urb->transfer_flags = USB_ISO_ASAP; @@ -1061,7 +1061,7 @@ u->flags &= ~FLG_RUNNING; } if (u->flags & FLG_RUNNING && !(u->flags & FLG_URB1RUNNING)) { - urb = &u->durb[1].urb; + urb = u->durb[1].urb; urb->dev = dev; urb->pipe = u->datapipe; urb->transfer_flags = USB_ISO_ASAP; @@ -1075,7 +1075,7 @@ } if (u->syncpipe) { if (u->flags & FLG_RUNNING && !(u->flags & FLG_SYNC0RUNNING)) { - urb = &u->surb[0].urb; + urb = u->surb[0].urb; urb->dev = dev; urb->pipe = u->syncpipe; urb->transfer_flags = USB_ISO_ASAP; @@ -1089,7 +1089,7 @@ u->flags &= ~FLG_RUNNING; } if (u->flags & FLG_RUNNING && !(u->flags & FLG_SYNC1RUNNING)) { - urb = &u->surb[1].urb; + urb = u->surb[1].urb; urb->dev = dev; urb->pipe = u->syncpipe; urb->transfer_flags = USB_ISO_ASAP; @@ -1125,27 +1125,27 @@ spin_unlock_irqrestore(&as->lock, flags); if (notkilled && signal_pending(current)) { if (i & FLG_URB0RUNNING) - usb_unlink_urb(&u->durb[0].urb); + usb_unlink_urb(u->durb[0].urb); if (i & FLG_URB1RUNNING) - usb_unlink_urb(&u->durb[1].urb); + usb_unlink_urb(u->durb[1].urb); if (i & FLG_SYNC0RUNNING) - usb_unlink_urb(&u->surb[0].urb); + usb_unlink_urb(u->surb[0].urb); if (i & FLG_SYNC1RUNNING) - usb_unlink_urb(&u->surb[1].urb); + usb_unlink_urb(u->surb[1].urb); notkilled = 0; } } set_current_state(TASK_RUNNING); - if (u->durb[0].urb.transfer_buffer) - kfree(u->durb[0].urb.transfer_buffer); - if (u->durb[1].urb.transfer_buffer) - kfree(u->durb[1].urb.transfer_buffer); - if (u->surb[0].urb.transfer_buffer) - kfree(u->surb[0].urb.transfer_buffer); - if (u->surb[1].urb.transfer_buffer) - kfree(u->surb[1].urb.transfer_buffer); - u->durb[0].urb.transfer_buffer = u->durb[1].urb.transfer_buffer = - u->surb[0].urb.transfer_buffer = u->surb[1].urb.transfer_buffer = NULL; + if (u->durb[0].urb->transfer_buffer) + kfree(u->durb[0].urb->transfer_buffer); + if (u->durb[1].urb->transfer_buffer) + kfree(u->durb[1].urb->transfer_buffer); + if (u->surb[0].urb->transfer_buffer) + kfree(u->surb[0].urb->transfer_buffer); + if (u->surb[1].urb->transfer_buffer) + kfree(u->surb[1].urb->transfer_buffer); + u->durb[0].urb->transfer_buffer = u->durb[1].urb->transfer_buffer = + u->surb[0].urb->transfer_buffer = u->surb[1].urb->transfer_buffer = NULL; } static inline void usbout_release(struct usb_audiodev *as) @@ -1262,9 +1262,9 @@ #if 0 printk(KERN_DEBUG "usbout_completed: status %d errcnt %d flags 0x%x\n", urb->status, urb->error_count, u->flags); #endif - if (urb == &u->durb[0].urb) + if (urb == u->durb[0].urb) mask = FLG_URB0RUNNING; - else if (urb == &u->durb[1].urb) + else if (urb == u->durb[1].urb) mask = FLG_URB1RUNNING; else { mask = 0; @@ -1334,9 +1334,9 @@ #if 0 printk(KERN_DEBUG "usbout_sync_completed: status %d errcnt %d flags 0x%x\n", urb->status, urb->error_count, u->flags); #endif - if (urb == &u->surb[0].urb) + if (urb == u->surb[0].urb) mask = FLG_SYNC0RUNNING; - else if (urb == &u->surb[1].urb) + else if (urb == u->surb[1].urb) mask = FLG_SYNC1RUNNING; else { mask = 0; @@ -1382,26 +1382,26 @@ u->phase = 0; maxsze = (u->freqmax + 0x3fff) >> (14 - AFMT_BYTESSHIFT(u->format)); bufsz = DESCFRAMES * maxsze; - if (u->durb[0].urb.transfer_buffer) - kfree(u->durb[0].urb.transfer_buffer); - u->durb[0].urb.transfer_buffer = kmalloc(bufsz, GFP_KERNEL); - u->durb[0].urb.transfer_buffer_length = bufsz; - if (u->durb[1].urb.transfer_buffer) - kfree(u->durb[1].urb.transfer_buffer); - u->durb[1].urb.transfer_buffer = kmalloc(bufsz, GFP_KERNEL); - u->durb[1].urb.transfer_buffer_length = bufsz; + if (u->durb[0].urb->transfer_buffer) + kfree(u->durb[0].urb->transfer_buffer); + u->durb[0].urb->transfer_buffer = kmalloc(bufsz, GFP_KERNEL); + u->durb[0].urb->transfer_buffer_length = bufsz; + if (u->durb[1].urb->transfer_buffer) + kfree(u->durb[1].urb->transfer_buffer); + u->durb[1].urb->transfer_buffer = kmalloc(bufsz, GFP_KERNEL); + u->durb[1].urb->transfer_buffer_length = bufsz; if (u->syncpipe) { - if (u->surb[0].urb.transfer_buffer) - kfree(u->surb[0].urb.transfer_buffer); - u->surb[0].urb.transfer_buffer = kmalloc(3*SYNCFRAMES, GFP_KERNEL); - u->surb[0].urb.transfer_buffer_length = 3*SYNCFRAMES; - if (u->surb[1].urb.transfer_buffer) - kfree(u->surb[1].urb.transfer_buffer); - u->surb[1].urb.transfer_buffer = kmalloc(3*SYNCFRAMES, GFP_KERNEL); - u->surb[1].urb.transfer_buffer_length = 3*SYNCFRAMES; + if (u->surb[0].urb->transfer_buffer) + kfree(u->surb[0].urb->transfer_buffer); + u->surb[0].urb->transfer_buffer = kmalloc(3*SYNCFRAMES, GFP_KERNEL); + u->surb[0].urb->transfer_buffer_length = 3*SYNCFRAMES; + if (u->surb[1].urb->transfer_buffer) + kfree(u->surb[1].urb->transfer_buffer); + u->surb[1].urb->transfer_buffer = kmalloc(3*SYNCFRAMES, GFP_KERNEL); + u->surb[1].urb->transfer_buffer_length = 3*SYNCFRAMES; } - if (!u->durb[0].urb.transfer_buffer || !u->durb[1].urb.transfer_buffer || - (u->syncpipe && (!u->surb[0].urb.transfer_buffer || !u->surb[1].urb.transfer_buffer))) { + if (!u->durb[0].urb->transfer_buffer || !u->durb[1].urb->transfer_buffer || + (u->syncpipe && (!u->surb[0].urb->transfer_buffer || !u->surb[1].urb->transfer_buffer))) { printk(KERN_ERR "usbaudio: cannot start playback device %d\n", dev->devnum); return 0; } @@ -1413,7 +1413,7 @@ } u->flags |= FLG_RUNNING; if (!(u->flags & FLG_URB0RUNNING)) { - urb = &u->durb[0].urb; + urb = u->durb[0].urb; urb->dev = dev; urb->pipe = u->datapipe; urb->transfer_flags = USB_ISO_ASAP; @@ -1426,7 +1426,7 @@ u->flags &= ~FLG_RUNNING; } if (u->flags & FLG_RUNNING && !(u->flags & FLG_URB1RUNNING)) { - urb = &u->durb[1].urb; + urb = u->durb[1].urb; urb->dev = dev; urb->pipe = u->datapipe; urb->transfer_flags = USB_ISO_ASAP; @@ -1440,7 +1440,7 @@ } if (u->syncpipe) { if (u->flags & FLG_RUNNING && !(u->flags & FLG_SYNC0RUNNING)) { - urb = &u->surb[0].urb; + urb = u->surb[0].urb; urb->dev = dev; urb->pipe = u->syncpipe; urb->transfer_flags = USB_ISO_ASAP; @@ -1454,7 +1454,7 @@ u->flags &= ~FLG_RUNNING; } if (u->flags & FLG_RUNNING && !(u->flags & FLG_SYNC1RUNNING)) { - urb = &u->surb[1].urb; + urb = u->surb[1].urb; urb->dev = dev; urb->pipe = u->syncpipe; urb->transfer_flags = USB_ISO_ASAP; @@ -1921,6 +1921,14 @@ usbout_release(as); dmabuf_release(&as->usbin.dma); dmabuf_release(&as->usbout.dma); + usb_free_urb(as->usbin.durb[0].urb); + usb_free_urb(as->usbin.durb[1].urb); + usb_free_urb(as->usbin.surb[0].urb); + usb_free_urb(as->usbin.surb[1].urb); + usb_free_urb(as->usbout.durb[0].urb); + usb_free_urb(as->usbout.durb[1].urb); + usb_free_urb(as->usbout.surb[0].urb); + usb_free_urb(as->usbout.surb[1].urb); kfree(as); } while (!list_empty(&s->mixerlist)) { @@ -2821,14 +2829,33 @@ init_waitqueue_head(&as->usbin.dma.wait); init_waitqueue_head(&as->usbout.dma.wait); spin_lock_init(&as->lock); - spin_lock_init(&as->usbin.durb[0].urb.lock); - spin_lock_init(&as->usbin.durb[1].urb.lock); - spin_lock_init(&as->usbin.surb[0].urb.lock); - spin_lock_init(&as->usbin.surb[1].urb.lock); - spin_lock_init(&as->usbout.durb[0].urb.lock); - spin_lock_init(&as->usbout.durb[1].urb.lock); - spin_lock_init(&as->usbout.surb[0].urb.lock); - spin_lock_init(&as->usbout.surb[1].urb.lock); + as->usbin.durb[0].urb = usb_alloc_urb(0); + as->usbin.durb[1].urb = usb_alloc_urb(0); + as->usbin.surb[0].urb = usb_alloc_urb(0); + as->usbin.surb[1].urb = usb_alloc_urb(0); + as->usbout.durb[0].urb = usb_alloc_urb(0); + as->usbout.durb[1].urb = usb_alloc_urb(0); + as->usbout.surb[0].urb = usb_alloc_urb(0); + as->usbout.surb[1].urb = usb_alloc_urb(0); + if ((!as->usbin.durb[0].urb) || + (!as->usbin.durb[1].urb) || + (!as->usbin.surb[0].urb) || + (!as->usbin.surb[1].urb) || + (!as->usbout.durb[0].urb) || + (!as->usbout.durb[1].urb) || + (!as->usbout.surb[0].urb) || + (!as->usbout.surb[1].urb)) { + usb_free_urb(as->usbin.durb[0].urb); + usb_free_urb(as->usbin.durb[1].urb); + usb_free_urb(as->usbin.surb[0].urb); + usb_free_urb(as->usbin.surb[1].urb); + usb_free_urb(as->usbout.durb[0].urb); + usb_free_urb(as->usbout.durb[1].urb); + usb_free_urb(as->usbout.surb[0].urb); + usb_free_urb(as->usbout.surb[1].urb); + kfree(as); + return; + } as->state = s; as->usbin.interface = asifin; as->usbout.interface = asifout; @@ -2997,11 +3024,27 @@ } } if (as->numfmtin == 0 && as->numfmtout == 0) { + usb_free_urb(as->usbin.durb[0].urb); + usb_free_urb(as->usbin.durb[1].urb); + usb_free_urb(as->usbin.surb[0].urb); + usb_free_urb(as->usbin.surb[1].urb); + usb_free_urb(as->usbout.durb[0].urb); + usb_free_urb(as->usbout.durb[1].urb); + usb_free_urb(as->usbout.surb[0].urb); + usb_free_urb(as->usbout.surb[1].urb); kfree(as); return; } if ((as->dev_audio = register_sound_dsp(&usb_audio_fops, -1)) < 0) { printk(KERN_ERR "usbaudio: cannot register dsp\n"); + usb_free_urb(as->usbin.durb[0].urb); + usb_free_urb(as->usbin.durb[1].urb); + usb_free_urb(as->usbin.surb[0].urb); + usb_free_urb(as->usbin.surb[1].urb); + usb_free_urb(as->usbout.durb[0].urb); + usb_free_urb(as->usbout.durb[1].urb); + usb_free_urb(as->usbout.surb[0].urb); + usb_free_urb(as->usbout.surb[1].urb); kfree(as); return; } diff -urN linux-2.5.3-pre3/drivers/usb/catc.c linux/drivers/usb/catc.c --- linux-2.5.3-pre3/drivers/usb/catc.c Thu Jan 10 16:23:46 2002 +++ linux/drivers/usb/catc.c Wed Jan 23 17:31:04 2002 @@ -179,7 +179,7 @@ void (*callback)(struct catc *catc, struct ctrl_queue *q); } ctrl_queue[CTRL_QUEUE]; - struct urb tx_urb, rx_urb, irq_urb, ctrl_urb; + struct urb *tx_urb, *rx_urb, *irq_urb, *ctrl_urb; }; /* @@ -256,8 +256,8 @@ } if ((data[1] & 0x80) && !test_and_set_bit(RX_RUNNING, &catc->flags)) { - catc->rx_urb.dev = catc->usbdev; - if ((status = usb_submit_urb(&catc->rx_urb)) < 0) { + catc->rx_urb->dev = catc->usbdev; + if ((status = usb_submit_urb(catc->rx_urb)) < 0) { err("submit(rx_urb) status %d", status); return; } @@ -282,11 +282,11 @@ { int status; - catc->tx_urb.transfer_buffer_length = catc->tx_ptr; - catc->tx_urb.transfer_buffer = catc->tx_buf[catc->tx_idx]; - catc->tx_urb.dev = catc->usbdev; + catc->tx_urb->transfer_buffer_length = catc->tx_ptr; + catc->tx_urb->transfer_buffer = catc->tx_buf[catc->tx_idx]; + catc->tx_urb->dev = catc->usbdev; - if ((status = usb_submit_urb(&catc->tx_urb)) < 0) + if ((status = usb_submit_urb(catc->tx_urb)) < 0) err("submit(tx_urb), status %d", status); catc->tx_idx = !catc->tx_idx; @@ -363,8 +363,8 @@ struct catc *catc = netdev->priv; warn("Transmit timed out."); - catc->tx_urb.transfer_flags |= USB_ASYNC_UNLINK; - usb_unlink_urb(&catc->tx_urb); + catc->tx_urb->transfer_flags |= USB_ASYNC_UNLINK; + usb_unlink_urb(catc->tx_urb); } /* @@ -383,7 +383,7 @@ { struct ctrl_queue *q = catc->ctrl_queue + catc->ctrl_tail; struct usb_device *usbdev = catc->usbdev; - struct urb *urb = &catc->ctrl_urb; + struct urb *urb = catc->ctrl_urb; struct usb_ctrlrequest *dr = &catc->ctrl_dr; int status; @@ -402,7 +402,7 @@ if (!q->dir && q->buf && q->len) memcpy(catc->ctrl_buf, q->buf, q->len); - if ((status = usb_submit_urb(&catc->ctrl_urb))) + if ((status = usb_submit_urb(catc->ctrl_urb))) err("submit(ctrl_urb) status %d", status); } @@ -624,8 +624,8 @@ struct catc *catc = netdev->priv; int status; - catc->irq_urb.dev = catc->usbdev; - if ((status = usb_submit_urb(&catc->irq_urb)) < 0) { + catc->irq_urb->dev = catc->usbdev; + if ((status = usb_submit_urb(catc->irq_urb)) < 0) { err("submit(irq_urb) status %d", status); return -1; } @@ -645,10 +645,10 @@ del_timer_sync(&catc->timer); - usb_unlink_urb(&catc->rx_urb); - usb_unlink_urb(&catc->tx_urb); - usb_unlink_urb(&catc->irq_urb); - usb_unlink_urb(&catc->ctrl_urb); + usb_unlink_urb(catc->rx_urb); + usb_unlink_urb(catc->tx_urb); + usb_unlink_urb(catc->irq_urb); + usb_unlink_urb(catc->ctrl_urb); return 0; } @@ -694,16 +694,26 @@ catc->timer.data = (long) catc; catc->timer.function = catc_stats_timer; - FILL_CONTROL_URB(&catc->ctrl_urb, usbdev, usb_sndctrlpipe(usbdev, 0), + catc->ctrl_urb = usb_alloc_urb(0); + catc->tx_urb = usb_alloc_urb(0); + catc->rx_urb = usb_alloc_urb(0); + catc->irq_urb = usb_alloc_urb(0); + if ((!catc->ctrl_urb) || (!catc->tx_urb) || + (!catc->rx_urb) || (!catc->irq_urb)) { + err("No free urbs available."); + return NULL; + } + + FILL_CONTROL_URB(catc->ctrl_urb, usbdev, usb_sndctrlpipe(usbdev, 0), NULL, NULL, 0, catc_ctrl_done, catc); - FILL_BULK_URB(&catc->tx_urb, usbdev, usb_sndbulkpipe(usbdev, 1), + FILL_BULK_URB(catc->tx_urb, usbdev, usb_sndbulkpipe(usbdev, 1), NULL, 0, catc_tx_done, catc); - FILL_BULK_URB(&catc->rx_urb, usbdev, usb_rcvbulkpipe(usbdev, 1), + FILL_BULK_URB(catc->rx_urb, usbdev, usb_rcvbulkpipe(usbdev, 1), catc->rx_buf, RX_MAX_BURST * (PKT_SZ + 2), catc_rx_done, catc); - FILL_INT_URB(&catc->irq_urb, usbdev, usb_rcvintpipe(usbdev, 2), + FILL_INT_URB(catc->irq_urb, usbdev, usb_rcvintpipe(usbdev, 2), catc->irq_buf, 2, catc_irq_done, catc, 1); dbg("Checking memory size\n"); @@ -772,6 +782,10 @@ { struct catc *catc = dev_ptr; unregister_netdev(catc->netdev); + usb_free_urb(catc->ctrl_urb); + usb_free_urb(catc->tx_urb); + usb_free_urb(catc->rx_urb); + usb_free_urb(catc->irq_urb); kfree(catc->netdev); kfree(catc); } diff -urN linux-2.5.3-pre3/drivers/usb/devio.c linux/drivers/usb/devio.c --- linux-2.5.3-pre3/drivers/usb/devio.c Wed Jan 23 17:31:01 2002 +++ linux/drivers/usb/devio.c Wed Jan 23 17:31:04 2002 @@ -53,7 +53,7 @@ unsigned int signr; void *userbuffer; void *userurb; - struct urb urb; + struct urb *urb; }; static loff_t usbdev_lseek(struct file *file, loff_t offset, int orig) @@ -175,17 +175,21 @@ if (!as) return NULL; memset(as, 0, assize); - as->urb.number_of_packets = numisoframes; - spin_lock_init(&as->urb.lock); + as->urb = usb_alloc_urb(numisoframes); + if (!as->urb) { + kfree(as); + return NULL; + } return as; } static void free_async(struct async *as) { - if (as->urb.transfer_buffer) - kfree(as->urb.transfer_buffer); - if (as->urb.setup_packet) - kfree(as->urb.setup_packet); + if (as->urb->transfer_buffer) + kfree(as->urb->transfer_buffer); + if (as->urb->setup_packet) + kfree(as->urb->setup_packet); + usb_free_urb(as->urb); kfree(as); } @@ -259,7 +263,7 @@ wake_up(&ps->wait); if (as->signr) { sinfo.si_signo = as->signr; - sinfo.si_errno = as->urb.status; + sinfo.si_errno = as->urb->status; sinfo.si_code = SI_ASYNCIO; sinfo.si_addr = as->userurb; send_sig_info(as->signr, &sinfo, as->task); @@ -278,7 +282,7 @@ INIT_LIST_HEAD(&as->asynclist); spin_unlock_irqrestore(&ps->lock, flags); /* usb_unlink_urb calls the completion handler with status == -ENOENT */ - usb_unlink_urb(&as->urb); + usb_unlink_urb(as->urb); spin_lock_irqsave(&ps->lock, flags); } spin_unlock_irqrestore(&ps->lock, flags); @@ -862,7 +866,7 @@ kfree(dr); return -ENOMEM; } - if (!(as->urb.transfer_buffer = kmalloc(uurb.buffer_length, GFP_KERNEL))) { + if (!(as->urb->transfer_buffer = kmalloc(uurb.buffer_length, GFP_KERNEL))) { if (isopkt) kfree(isopkt); if (dr) @@ -870,19 +874,19 @@ free_async(as); return -ENOMEM; } - as->urb.next = NULL; - as->urb.dev = ps->dev; - as->urb.pipe = (uurb.type << 30) | __create_pipe(ps->dev, uurb.endpoint & 0xf) | (uurb.endpoint & USB_DIR_IN); - as->urb.transfer_flags = uurb.flags; - as->urb.transfer_buffer_length = uurb.buffer_length; - as->urb.setup_packet = (unsigned char*)dr; - as->urb.start_frame = uurb.start_frame; - as->urb.number_of_packets = uurb.number_of_packets; - as->urb.context = as; - as->urb.complete = async_completed; + as->urb->next = NULL; + as->urb->dev = ps->dev; + as->urb->pipe = (uurb.type << 30) | __create_pipe(ps->dev, uurb.endpoint & 0xf) | (uurb.endpoint & USB_DIR_IN); + as->urb->transfer_flags = uurb.flags; + as->urb->transfer_buffer_length = uurb.buffer_length; + as->urb->setup_packet = (unsigned char*)dr; + as->urb->start_frame = uurb.start_frame; + as->urb->number_of_packets = uurb.number_of_packets; + as->urb->context = as; + as->urb->complete = async_completed; for (totlen = u = 0; u < uurb.number_of_packets; u++) { - as->urb.iso_frame_desc[u].offset = totlen; - as->urb.iso_frame_desc[u].length = isopkt[u].length; + as->urb->iso_frame_desc[u].offset = totlen; + as->urb->iso_frame_desc[u].length = isopkt[u].length; totlen += isopkt[u].length; } if (isopkt) @@ -896,13 +900,13 @@ as->signr = uurb.signr; as->task = current; if (!(uurb.endpoint & USB_DIR_IN)) { - if (copy_from_user(as->urb.transfer_buffer, uurb.buffer, as->urb.transfer_buffer_length)) { + if (copy_from_user(as->urb->transfer_buffer, uurb.buffer, as->urb->transfer_buffer_length)) { free_async(as); return -EFAULT; } } async_newpending(as); - if ((ret = usb_submit_urb(&as->urb))) { + if ((ret = usb_submit_urb(as->urb))) { printk(KERN_DEBUG "usbdevfs: usb_submit_urb returned %d\n", ret); async_removepending(as); free_async(as); @@ -918,34 +922,35 @@ as = async_getpending(ps, arg); if (!as) return -EINVAL; - usb_unlink_urb(&as->urb); + usb_unlink_urb(as->urb); return 0; } static int processcompl(struct async *as) { + struct urb *urb = as->urb; unsigned int i; if (as->userbuffer) - if (copy_to_user(as->userbuffer, as->urb.transfer_buffer, as->urb.transfer_buffer_length)) + if (copy_to_user(as->userbuffer, urb->transfer_buffer, urb->transfer_buffer_length)) return -EFAULT; - if (put_user(as->urb.status, + if (put_user(urb->status, &((struct usbdevfs_urb *)as->userurb)->status)) return -EFAULT; - if (put_user(as->urb.actual_length, + if (put_user(urb->actual_length, &((struct usbdevfs_urb *)as->userurb)->actual_length)) return -EFAULT; - if (put_user(as->urb.error_count, + if (put_user(urb->error_count, &((struct usbdevfs_urb *)as->userurb)->error_count)) return -EFAULT; - if (!(usb_pipeisoc(as->urb.pipe))) + if (!(usb_pipeisoc(urb->pipe))) return 0; - for (i = 0; i < as->urb.number_of_packets; i++) { - if (put_user(as->urb.iso_frame_desc[i].actual_length, + for (i = 0; i < urb->number_of_packets; i++) { + if (put_user(urb->iso_frame_desc[i].actual_length, &((struct usbdevfs_urb *)as->userurb)->iso_frame_desc[i].actual_length)) return -EFAULT; - if (put_user(as->urb.iso_frame_desc[i].status, + if (put_user(urb->iso_frame_desc[i].status, &((struct usbdevfs_urb *)as->userurb)->iso_frame_desc[i].status)) return -EFAULT; } diff -urN linux-2.5.3-pre3/drivers/usb/dsbr100.c linux/drivers/usb/dsbr100.c --- linux-2.5.3-pre3/drivers/usb/dsbr100.c Tue Oct 9 15:15:02 2001 +++ linux/drivers/usb/dsbr100.c Wed Jan 23 17:31:04 2002 @@ -90,7 +90,7 @@ MODULE_PARM(radio_nr, "i"); typedef struct -{ struct urb readurb,writeurb; +{ struct usb_device *dev; unsigned char transfer_buffer[TB_LEN]; int curfreq; diff -urN linux-2.5.3-pre3/drivers/usb/hpusbscsi.c linux/drivers/usb/hpusbscsi.c --- linux-2.5.3-pre3/drivers/usb/hpusbscsi.c Wed Jan 23 17:31:01 2002 +++ linux/drivers/usb/hpusbscsi.c Wed Jan 23 17:31:04 2002 @@ -56,8 +56,17 @@ return NULL; DEBUG ("Allocated memory\n"); memset (new, 0, sizeof (struct hpusbscsi)); - spin_lock_init (&new->dataurb.lock); - spin_lock_init (&new->controlurb.lock); + new->dataurb = usb_alloc_urb(0); + if (!new->dataurb) { + kfree (new); + return NULL; + } + new->controlurb = usb_alloc_urb(0); + if (!new->controlurb) { + usb_free_urb (new->dataurb); + kfree (new); + return NULL; + } new->dev = dev; init_waitqueue_head (&new->pending); init_waitqueue_head (&new->deathrow); @@ -126,6 +135,8 @@ return new; err_out: + usb_free_urb (new->controlurb); + usb_free_urb (new->dataurb); kfree (new); return NULL; } @@ -133,7 +144,7 @@ static void hpusbscsi_usb_disconnect (struct usb_device *dev, void *ptr) { - usb_unlink_urb(&(((struct hpusbscsi *) ptr)->controlurb)); + usb_unlink_urb((((struct hpusbscsi *) ptr)->controlurb)); ((struct hpusbscsi *) ptr)->dev = NULL; } @@ -184,8 +195,10 @@ old = tmp; tmp = tmp->next; o = (struct hpusbscsi *)old; - usb_unlink_urb(&o->controlurb); + usb_unlink_urb(o->controlurb); scsi_unregister_host(&o->ctempl); + usb_free_urb(o->controlurb); + usb_free_urb(o->dataurb); kfree(old); } @@ -222,7 +235,7 @@ sht->proc_dir = NULL; /* build and submit an interrupt URB for status byte handling */ - FILL_INT_URB(&desc->controlurb, + FILL_INT_URB(desc->controlurb, desc->dev, usb_rcvintpipe(desc->dev,desc->ep_int), &desc->scsi_state_byte, @@ -232,7 +245,7 @@ desc->interrupt_interval ); - if ( 0 > usb_submit_urb(&desc->controlurb)) { + if ( 0 > usb_submit_urb(desc->controlurb)) { kfree(sht->proc_name); return 0; } @@ -241,7 +254,7 @@ desc->host = scsi_register (sht, sizeof (desc)); if (desc->host == NULL) { kfree (sht->proc_name); - usb_unlink_urb(&desc->controlurb); + usb_unlink_urb(desc->controlurb); return 0; } desc->host->hostdata[0] = (unsigned long) desc; @@ -297,7 +310,7 @@ /* We prepare the urb for writing out the scsi command */ FILL_BULK_URB( - &hpusbscsi->dataurb, + hpusbscsi->dataurb, hpusbscsi->dev, usb_sndbulkpipe(hpusbscsi->dev,hpusbscsi->ep_out), srb->cmnd, @@ -308,7 +321,7 @@ hpusbscsi->scallback = callback; hpusbscsi->srb = srb; - res = usb_submit_urb(&hpusbscsi->dataurb); + res = usb_submit_urb(hpusbscsi->dataurb); if (unlikely(res)) { hpusbscsi->state = HP_STATE_FREE; TRACE_STATE; @@ -340,8 +353,8 @@ struct hpusbscsi* hpusbscsi = (struct hpusbscsi*)(srb->host->hostdata[0]); printk(KERN_DEBUG"Requested is canceled.\n"); - usb_unlink_urb(&hpusbscsi->dataurb); - usb_unlink_urb(&hpusbscsi->controlurb); + usb_unlink_urb(hpusbscsi->dataurb); + usb_unlink_urb(hpusbscsi->controlurb); hpusbscsi->state = HP_STATE_FREE; return SCSI_ABORT_PENDING; diff -urN linux-2.5.3-pre3/drivers/usb/hpusbscsi.h linux/drivers/usb/hpusbscsi.h --- linux-2.5.3-pre3/drivers/usb/hpusbscsi.h Wed Nov 28 10:22:27 2001 +++ linux/drivers/usb/hpusbscsi.h Wed Jan 23 17:31:04 2002 @@ -26,8 +26,8 @@ wait_queue_head_t pending; wait_queue_head_t deathrow; - struct urb dataurb; - struct urb controlurb; + struct urb *dataurb; + struct urb *controlurb; int fragment; int state; diff -urN linux-2.5.3-pre3/drivers/usb/inode.c linux/drivers/usb/inode.c --- linux-2.5.3-pre3/drivers/usb/inode.c Tue Jan 1 13:52:10 2002 +++ linux/drivers/usb/inode.c Wed Jan 23 17:31:04 2002 @@ -678,6 +678,8 @@ void usbfs_add_device(struct usb_device *dev) { char name[8]; + int i; + int i_size; sprintf (name, "%03d", dev->devnum); dev->dentry = fs_create_file (name, @@ -687,6 +689,17 @@ devuid, devgid); if (dev->dentry == NULL) return; + + /* Set the size of the device's file to be + * equal to the size of the device descriptors. */ + i_size = sizeof (struct usb_device_descriptor); + for (i = 0; i < dev->descriptor.bNumConfigurations; ++i) { + struct usb_config_descriptor *config = + (struct usb_config_descriptor *)dev->rawdescriptors[i]; + i_size += le16_to_cpu (config->wTotalLength); + } + if (dev->dentry->d_inode) + dev->dentry->d_inode->i_size = i_size; usbfs_update_special(); usbdevfs_conn_disc_event(); diff -urN linux-2.5.3-pre3/drivers/usb/microtek.c linux/drivers/usb/microtek.c --- linux-2.5.3-pre3/drivers/usb/microtek.c Wed Jan 23 17:31:01 2002 +++ linux/drivers/usb/microtek.c Wed Jan 23 17:31:04 2002 @@ -324,7 +324,7 @@ MTS_DEBUG_GOT_HERE(); mts_debug_dump(desc); - usb_unlink_urb( &desc->urb ); + usb_unlink_urb( desc->urb ); } static struct mts_desc * mts_list; /* list of active scanners */ @@ -365,6 +365,7 @@ scsi_unregister_host(&to_remove->ctempl); unlock_kernel(); + usb_free_urb(to_remove->urb); kfree( to_remove ); } @@ -705,7 +706,7 @@ } - FILL_BULK_URB(&desc->urb, + FILL_BULK_URB(desc->urb, desc->usb_dev, usb_sndbulkpipe(desc->usb_dev,desc->ep_out), srb->cmnd, @@ -718,7 +719,7 @@ mts_build_transfer_context( srb, desc ); desc->context.final_callback = callback; - res=usb_submit_urb(&desc->urb); + res=usb_submit_urb(desc->urb); if(unlikely(res)){ MTS_ERROR("error %d submitting URB\n",(int)res); @@ -932,10 +933,12 @@ return NULL; } - /* As done by usb_alloc_urb */ memset( new_desc, 0, sizeof(*new_desc) ); - spin_lock_init(&new_desc->urb.lock); - + new_desc->urb = usb_alloc_urb(0); + if (!new_desc->urb) { + kfree(new_desc); + return NULL; + } /* initialising that descriptor */ new_desc->usb_dev = dev; diff -urN linux-2.5.3-pre3/drivers/usb/microtek.h linux/drivers/usb/microtek.h --- linux-2.5.3-pre3/drivers/usb/microtek.h Fri Mar 23 11:50:01 2001 +++ linux/drivers/usb/microtek.h Wed Jan 23 17:31:04 2002 @@ -46,7 +46,7 @@ struct semaphore lock; - struct urb urb; + struct urb *urb; struct mts_transfer_context context; }; diff -urN linux-2.5.3-pre3/drivers/usb/pegasus.c linux/drivers/usb/pegasus.c --- linux-2.5.3-pre3/drivers/usb/pegasus.c Wed Jan 23 17:31:01 2002 +++ linux/drivers/usb/pegasus.c Wed Jan 23 17:31:04 2002 @@ -147,9 +147,9 @@ pegasus->dr.wValue = cpu_to_le16 (0); pegasus->dr.wIndex = cpu_to_le16p(&indx); pegasus->dr.wLength = cpu_to_le16p(&size); - pegasus->ctrl_urb.transfer_buffer_length = size; + pegasus->ctrl_urb->transfer_buffer_length = size; - FILL_CONTROL_URB( &pegasus->ctrl_urb, pegasus->usb, + FILL_CONTROL_URB( pegasus->ctrl_urb, pegasus->usb, usb_rcvctrlpipe(pegasus->usb,0), (char *)&pegasus->dr, buffer, size, ctrl_callback, pegasus ); @@ -157,7 +157,7 @@ add_wait_queue( &pegasus->ctrl_wait, &wait ); set_current_state( TASK_UNINTERRUPTIBLE ); - if ( (ret = usb_submit_urb( &pegasus->ctrl_urb )) ) { + if ( (ret = usb_submit_urb( pegasus->ctrl_urb )) ) { err( __FUNCTION__ " BAD CTRLs %d", ret); goto out; } @@ -197,9 +197,9 @@ pegasus->dr.wValue = cpu_to_le16 (0); pegasus->dr.wIndex = cpu_to_le16p( &indx ); pegasus->dr.wLength = cpu_to_le16p( &size ); - pegasus->ctrl_urb.transfer_buffer_length = size; + pegasus->ctrl_urb->transfer_buffer_length = size; - FILL_CONTROL_URB( &pegasus->ctrl_urb, pegasus->usb, + FILL_CONTROL_URB( pegasus->ctrl_urb, pegasus->usb, usb_sndctrlpipe(pegasus->usb,0), (char *)&pegasus->dr, buffer, size, ctrl_callback, pegasus ); @@ -207,7 +207,7 @@ add_wait_queue( &pegasus->ctrl_wait, &wait ); set_current_state( TASK_UNINTERRUPTIBLE ); - if ( (ret = usb_submit_urb( &pegasus->ctrl_urb )) ) { + if ( (ret = usb_submit_urb( pegasus->ctrl_urb )) ) { err( __FUNCTION__ " BAD CTRL %d", ret); goto out; } @@ -247,9 +247,9 @@ pegasus->dr.wValue = cpu_to_le16p( &dat); pegasus->dr.wIndex = cpu_to_le16p( &indx ); pegasus->dr.wLength = cpu_to_le16( 1 ); - pegasus->ctrl_urb.transfer_buffer_length = 1; + pegasus->ctrl_urb->transfer_buffer_length = 1; - FILL_CONTROL_URB( &pegasus->ctrl_urb, pegasus->usb, + FILL_CONTROL_URB( pegasus->ctrl_urb, pegasus->usb, usb_sndctrlpipe(pegasus->usb,0), (char *)&pegasus->dr, buffer, 1, ctrl_callback, pegasus ); @@ -257,7 +257,7 @@ add_wait_queue( &pegasus->ctrl_wait, &wait ); set_current_state( TASK_UNINTERRUPTIBLE ); - if ( (ret = usb_submit_urb( &pegasus->ctrl_urb )) ) { + if ( (ret = usb_submit_urb( pegasus->ctrl_urb )) ) { err( __FUNCTION__ " BAD CTRL %d", ret); goto out; } @@ -280,14 +280,14 @@ pegasus->dr.wValue = 0; pegasus->dr.wIndex = cpu_to_le16(EthCtrl0); pegasus->dr.wLength = cpu_to_le16(3); - pegasus->ctrl_urb.transfer_buffer_length = 3; + pegasus->ctrl_urb->transfer_buffer_length = 3; - FILL_CONTROL_URB( &pegasus->ctrl_urb, pegasus->usb, + FILL_CONTROL_URB( pegasus->ctrl_urb, pegasus->usb, usb_sndctrlpipe(pegasus->usb,0), (char *)&pegasus->dr, pegasus->eth_regs, 3, ctrl_callback, pegasus ); - if ( (ret = usb_submit_urb( &pegasus->ctrl_urb )) ) + if ( (ret = usb_submit_urb( pegasus->ctrl_urb )) ) err( __FUNCTION__ " BAD CTRL %d, flags %x",ret,pegasus->flags ); return ret; @@ -569,11 +569,11 @@ pegasus->stats.rx_bytes += pkt_len; goon: - FILL_BULK_URB( &pegasus->rx_urb, pegasus->usb, + FILL_BULK_URB( pegasus->rx_urb, pegasus->usb, usb_rcvbulkpipe(pegasus->usb, 1), pegasus->rx_buff, PEGASUS_MAX_MTU, read_bulk_callback, pegasus ); - if ( (res = usb_submit_urb(&pegasus->rx_urb)) ) + if ( (res = usb_submit_urb(pegasus->rx_urb)) ) warn( __FUNCTION__ " failed submint rx_urb %d", res); pegasus->flags &= ~PEGASUS_RX_BUSY; } @@ -639,8 +639,8 @@ return; warn("%s: Tx timed out.", net->name); - pegasus->tx_urb.transfer_flags |= USB_ASYNC_UNLINK; - usb_unlink_urb( &pegasus->tx_urb ); + pegasus->tx_urb->transfer_flags |= USB_ASYNC_UNLINK; + usb_unlink_urb( pegasus->tx_urb ); pegasus->stats.tx_errors++; } @@ -656,12 +656,12 @@ ((__u16 *)pegasus->tx_buff)[0] = cpu_to_le16( l16 ); memcpy(pegasus->tx_buff+2, skb->data, skb->len); - FILL_BULK_URB( &pegasus->tx_urb, pegasus->usb, + FILL_BULK_URB( pegasus->tx_urb, pegasus->usb, usb_sndbulkpipe(pegasus->usb, 2), pegasus->tx_buff, PEGASUS_MAX_MTU, write_bulk_callback, pegasus ); - pegasus->tx_urb.transfer_buffer_length = count; - if ((res = usb_submit_urb(&pegasus->tx_urb))) { + pegasus->tx_urb->transfer_buffer_length = count; + if ((res = usb_submit_urb(pegasus->tx_urb))) { warn("failed tx_urb %d", res); pegasus->stats.tx_errors++; netif_start_queue( net ); @@ -717,18 +717,18 @@ err("can't enable_net_traffic() - %d", res); return -EIO; } - FILL_BULK_URB( &pegasus->rx_urb, pegasus->usb, + FILL_BULK_URB( pegasus->rx_urb, pegasus->usb, usb_rcvbulkpipe(pegasus->usb, 1), pegasus->rx_buff, PEGASUS_MAX_MTU, read_bulk_callback, pegasus ); - if ( (res = usb_submit_urb(&pegasus->rx_urb)) ) + if ( (res = usb_submit_urb(pegasus->rx_urb)) ) warn( __FUNCTION__ " failed rx_urb %d", res ); #ifdef PEGASUS_USE_INTR - FILL_INT_URB( &pegasus->intr_urb, pegasus->usb, + FILL_INT_URB( pegasus->intr_urb, pegasus->usb, usb_rcvintpipe(pegasus->usb, 3), pegasus->intr_buff, sizeof(pegasus->intr_buff), intr_callback, pegasus, pegasus->intr_interval ); - if ( (res = usb_submit_urb(&pegasus->intr_urb)) ) + if ( (res = usb_submit_urb(pegasus->intr_urb)) ) warn( __FUNCTION__ " failed intr_urb %d", res); #endif netif_start_queue( net ); @@ -747,11 +747,11 @@ if ( !(pegasus->flags & PEGASUS_UNPLUG) ) disable_net_traffic( pegasus ); - usb_unlink_urb( &pegasus->rx_urb ); - usb_unlink_urb( &pegasus->tx_urb ); - usb_unlink_urb( &pegasus->ctrl_urb ); + usb_unlink_urb( pegasus->rx_urb ); + usb_unlink_urb( pegasus->tx_urb ); + usb_unlink_urb( pegasus->ctrl_urb ); #ifdef PEGASUS_USE_INTR - usb_unlink_urb( &pegasus->intr_urb ); + usb_unlink_urb( pegasus->intr_urb ); #endif return 0; @@ -800,7 +800,7 @@ } pegasus->flags |= ETH_REGS_CHANGE; - ctrl_callback( &pegasus->ctrl_urb ); + ctrl_callback( pegasus->ctrl_urb ); netif_wake_queue(net); } @@ -856,6 +856,33 @@ pegasus->dev_index = dev_index; init_waitqueue_head( &pegasus->ctrl_wait ); + pegasus->ctrl_urb = usb_alloc_urb(0); + if (!pegasus->ctrl_urb) { + kfree (pegasus); + return NULL; + } + pegasus->rx_urb = usb_alloc_urb(0); + if (!pegasus->rx_urb) { + usb_free_urb (pegasus->ctrl_urb); + kfree (pegasus); + return NULL; + } + pegasus->tx_urb = usb_alloc_urb(0); + if (!pegasus->tx_urb) { + usb_free_urb (pegasus->rx_urb); + usb_free_urb (pegasus->ctrl_urb); + kfree (pegasus); + return NULL; + } + pegasus->intr_urb = usb_alloc_urb(0); + if (!pegasus->intr_urb) { + usb_free_urb (pegasus->tx_urb); + usb_free_urb (pegasus->rx_urb); + usb_free_urb (pegasus->ctrl_urb); + kfree (pegasus); + return NULL; + } + net = init_etherdev( NULL, 0 ); if ( !net ) { kfree( pegasus ); @@ -883,6 +910,7 @@ if ( reset_mac(pegasus) ) { err("can't reset MAC"); unregister_netdev( pegasus->net ); + kfree(pegasus->net); kfree(pegasus); pegasus = NULL; return NULL; @@ -919,6 +947,11 @@ pegasus->flags |= PEGASUS_UNPLUG; unregister_netdev( pegasus->net ); usb_dec_dev_use( dev ); + usb_free_urb (pegasus->intr_urb); + usb_free_urb (pegasus->tx_urb); + usb_free_urb (pegasus->rx_urb); + usb_free_urb (pegasus->ctrl_urb); + kfree( pegasus->net ); kfree( pegasus ); pegasus = NULL; } diff -urN linux-2.5.3-pre3/drivers/usb/pegasus.h linux/drivers/usb/pegasus.h --- linux-2.5.3-pre3/drivers/usb/pegasus.h Sun Jan 6 18:49:21 2002 +++ linux/drivers/usb/pegasus.h Wed Jan 23 17:31:04 2002 @@ -107,7 +107,7 @@ unsigned features; int dev_index; int intr_interval; - struct urb ctrl_urb, rx_urb, tx_urb, intr_urb; + struct urb *ctrl_urb, *rx_urb, *tx_urb, *intr_urb; struct usb_ctrlrequest dr; wait_queue_head_t ctrl_wait; struct semaphore ctrl_sem; @@ -145,6 +145,7 @@ #define VENDOR_SMARTBRIDGES 0x08d1 #define VENDOR_SMC 0x0707 #define VENDOR_SOHOWARE 0x15e8 +#define VENDOR_SIEMENS 0x067c #else /* PEGASUS_DEV */ @@ -173,6 +174,8 @@ DEFAULT_GPIO_RESET | PEGASUS_II ) PEGASUS_DEV( "Accton USB 10/100 Ethernet Adapter", VENDOR_ACCTON, 0x1046, DEFAULT_GPIO_RESET ) +PEGASUS_DEV( "SpeedStream USB 10/100 Ethernet", VENDOR_ACCTON, 0x5046, + DEFAULT_GPIO_RESET ) PEGASUS_DEV( "ADMtek ADM8511 \"Pegasus II\" USB Ethernet", VENDOR_ADMTEK, 0x8511, DEFAULT_GPIO_RESET | PEGASUS_II ) @@ -244,6 +247,8 @@ PEGASUS_DEV( "SMC 202 USB Ethernet", VENDOR_SMC, 0x0200, DEFAULT_GPIO_RESET ) PEGASUS_DEV( "SOHOware NUB100 Ethernet", VENDOR_SOHOWARE, 0x9100, + DEFAULT_GPIO_RESET ) +PEGASUS_DEV( "SpeedStream USB 10/100 Ethernet", VENDOR_SIEMENS, 0x1001, DEFAULT_GPIO_RESET ) diff -urN linux-2.5.3-pre3/drivers/usb/scanner.c linux/drivers/usb/scanner.c --- linux-2.5.3-pre3/drivers/usb/scanner.c Sun Jan 6 18:49:21 2002 +++ linux/drivers/usb/scanner.c Wed Jan 23 17:31:04 2002 @@ -972,6 +972,13 @@ } memset (scn, 0, sizeof(struct scn_usb_data)); + scn->scn_irq = usb_alloc_urb(0); + if (!scn->scn_irq) { + kfree(scn); + up(&scn_mutex); + return NULL; + } + init_MUTEX(&(scn->sem)); /* Initializes to unlocked */ dbg ("probe_scanner(%d): Address of scn:%p", scn_minor, scn); @@ -979,13 +986,13 @@ /* Ok, if we detected an interrupt EP, setup a handler for it */ if (have_intr) { dbg("probe_scanner(%d): Configuring IRQ handler for intr EP:%d", scn_minor, have_intr); - FILL_INT_URB(&scn->scn_irq, dev, + FILL_INT_URB(scn->scn_irq, dev, usb_rcvintpipe(dev, have_intr), &scn->button, 1, irq_scanner, scn, // endpoint[(int)have_intr].bInterval); 250); - if (usb_submit_urb(&scn->scn_irq)) { + if (usb_submit_urb(scn->scn_irq)) { err("probe_scanner(%d): Unable to allocate INT URB.", scn_minor); kfree(scn); up(&scn_mutex); @@ -1067,7 +1074,7 @@ if(scn->intr_ep) { dbg("disconnect_scanner(%d): Unlinking IRQ URB", scn->scn_minor); - usb_unlink_urb(&scn->scn_irq); + usb_unlink_urb(scn->scn_irq); } usb_driver_release_interface(&scanner_driver, &scn->scn_dev->actconfig->interface[scn->ifnum]); @@ -1078,6 +1085,7 @@ dbg("disconnect_scanner: De-allocating minor:%d", scn->scn_minor); devfs_unregister(scn->devfs); p_scn_table[scn->scn_minor] = NULL; + usb_free_urb(scn->scn_irq); up (&(scn->sem)); kfree (scn); up (&scn_mutex); diff -urN linux-2.5.3-pre3/drivers/usb/scanner.h linux/drivers/usb/scanner.h --- linux-2.5.3-pre3/drivers/usb/scanner.h Sun Jan 6 18:49:21 2002 +++ linux/drivers/usb/scanner.h Wed Jan 23 17:31:04 2002 @@ -241,7 +241,7 @@ struct scn_usb_data { struct usb_device *scn_dev; devfs_handle_t devfs; /* devfs device */ - struct urb scn_irq; + struct urb *scn_irq; unsigned int ifnum; /* Interface number of the USB device */ int scn_minor; /* Scanner minor - used in disconnect() */ unsigned char button; /* Front panel buffer */ diff -urN linux-2.5.3-pre3/drivers/usb/usb-uhci.c linux/drivers/usb/usb-uhci.c --- linux-2.5.3-pre3/drivers/usb/usb-uhci.c Wed Jan 23 17:31:01 2002 +++ linux/drivers/usb/usb-uhci.c Wed Jan 23 17:31:04 2002 @@ -16,7 +16,7 @@ * (C) Copyright 1999 Randy Dunlap * (C) Copyright 1999 Gregory P. Smith * - * $Id: usb-uhci.c,v 1.268 2001/08/29 14:08:43 acher Exp $ + * $Id: usb-uhci.c,v 1.275 2002/01/19 20:57:33 acher Exp $ */ #include @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -52,7 +53,7 @@ /* This enables an extra UHCI slab for memory debugging */ #define DEBUG_SLAB -#define VERSTR "$Revision: 1.268 $ time " __TIME__ " " __DATE__ +#define VERSTR "$Revision: 1.275 $ time " __TIME__ " " __DATE__ #include #include "usb-uhci.h" @@ -61,7 +62,7 @@ /* * Version Information */ -#define DRIVER_VERSION "v1.268" +#define DRIVER_VERSION "v1.275" #define DRIVER_AUTHOR "Georg Acher, Deti Fliegl, Thomas Sailer, Roman Weissgaerber" #define DRIVER_DESC "USB Universal Host Controller Interface driver" @@ -71,6 +72,9 @@ #define DEBUG_SYMBOLS #ifdef DEBUG_SYMBOLS #define _static + #ifndef EXPORT_SYMTAB + #define EXPORT_SYMTAB + #endif #else #define _static static #endif @@ -1182,6 +1186,7 @@ // cleanup the rest switch (usb_pipetype (urb->pipe)) { + case PIPE_INTERRUPT: case PIPE_ISOCHRONOUS: uhci_wait_ms(1); uhci_clean_iso_step2(s, urb_priv); @@ -1779,17 +1784,15 @@ type = usb_pipetype (urb->pipe); hcpriv = (urb_priv_t*)urb->hcpriv; - - if ( urb->timeout && - ((hcpriv->started + urb->timeout) < jiffies)) { + + if ( urb->timeout && time_after(jiffies, hcpriv->started + urb->timeout)) { urb->transfer_flags |= USB_TIMEOUT_KILLED | USB_ASYNC_UNLINK; async_dbg("uhci_check_timeout: timeout for %p",urb); uhci_unlink_urb_async(s, urb, UNLINK_ASYNC_STORE_URB); } #ifdef CONFIG_USB_UHCI_HIGH_BANDWIDTH else if (((type == PIPE_BULK) || (type == PIPE_CONTROL)) && - (hcpriv->use_loop) && - ((hcpriv->started + IDLE_TIMEOUT) < jiffies)) + (hcpriv->use_loop) && time_after(jiffies, hcpriv->started + IDLE_TIMEOUT)) disable_desc_loop(s, urb); #endif @@ -2445,7 +2448,7 @@ break; } - if (!desc->hw.td.status & cpu_to_le32(TD_CTRL_IOC)) { + if (!(desc->hw.td.status & cpu_to_le32(TD_CTRL_IOC))) { // do not process one-shot TDs, no recycling break; } @@ -2509,6 +2512,8 @@ } else { uhci_unlink_urb_async(s, urb, UNLINK_ASYNC_STORE_URB); + // correct toggle after unlink + usb_dotoggle (urb->dev, usb_pipeendpoint (urb->pipe), usb_pipeout (urb->pipe)); clr_td_ioc(desc); // inactivate TD } } @@ -2738,7 +2743,7 @@ if (status != 1) { // Avoid too much error messages at a time - if ((jiffies - s->last_error_time > ERROR_SUPPRESSION_TIME)) { + if (time_after(jiffies, s->last_error_time + ERROR_SUPPRESSION_TIME)) { warn("interrupt, status %x, frame# %i", status, UHCI_GET_CURRENT_FRAME(s)); s->last_error_time = jiffies; @@ -2786,7 +2791,7 @@ break; } } - if ((jiffies - s->timeout_check) > (HZ/30)) + if (time_after(jiffies, s->timeout_check + (HZ/30))) uhci_check_timeouts(s); clean_descs(s, CLEAN_NOT_FORCED); @@ -2815,7 +2820,7 @@ _static void start_hc (uhci_t *s) { unsigned int io_addr = s->io_addr; - int timeout = 1000; + int timeout = 10; /* * Reset the HC - this will force us to get a @@ -2830,6 +2835,7 @@ err("USBCMD_HCRESET timed out!"); break; } + udelay(1); } /* Turn on all interrupts */ @@ -2845,7 +2851,8 @@ s->running = 1; } -_static void __devexit +/* No __devexit, since it maybe called from alloc_uhci() */ +_static void uhci_pci_remove (struct pci_dev *dev) { uhci_t *s = pci_get_drvdata(dev); @@ -3130,4 +3137,3 @@ MODULE_AUTHOR( DRIVER_AUTHOR ); MODULE_DESCRIPTION( DRIVER_DESC ); MODULE_LICENSE("GPL"); - diff -urN linux-2.5.3-pre3/drivers/usb/usbkbd.c linux/drivers/usb/usbkbd.c --- linux-2.5.3-pre3/drivers/usb/usbkbd.c Sun Jan 6 18:49:21 2002 +++ linux/drivers/usb/usbkbd.c Wed Jan 23 17:31:04 2002 @@ -73,7 +73,7 @@ struct usb_device *usbdev; unsigned char new[8]; unsigned char old[8]; - struct urb irq, led; + struct urb *irq, *led; struct usb_ctrlrequest dr; unsigned char leds, newleds; char name[128]; @@ -121,15 +121,15 @@ (!!test_bit(LED_SCROLLL, dev->led) << 2) | (!!test_bit(LED_CAPSL, dev->led) << 1) | (!!test_bit(LED_NUML, dev->led)); - if (kbd->led.status == -EINPROGRESS) + if (kbd->led->status == -EINPROGRESS) return 0; if (kbd->leds == kbd->newleds) return 0; kbd->leds = kbd->newleds; - kbd->led.dev = kbd->usbdev; - if (usb_submit_urb(&kbd->led)) + kbd->led->dev = kbd->usbdev; + if (usb_submit_urb(kbd->led)) err("usb_submit_urb(leds) failed"); return 0; @@ -146,8 +146,8 @@ return; kbd->leds = kbd->newleds; - kbd->led.dev = kbd->usbdev; - if (usb_submit_urb(&kbd->led)) + kbd->led->dev = kbd->usbdev; + if (usb_submit_urb(kbd->led)) err("usb_submit_urb(leds) failed"); } @@ -158,8 +158,8 @@ if (kbd->open++) return 0; - kbd->irq.dev = kbd->usbdev; - if (usb_submit_urb(&kbd->irq)) + kbd->irq->dev = kbd->usbdev; + if (usb_submit_urb(kbd->irq)) return -EIO; return 0; @@ -170,7 +170,7 @@ struct usb_kbd *kbd = dev->private; if (!--kbd->open) - usb_unlink_urb(&kbd->irq); + usb_unlink_urb(kbd->irq); } static void *usb_kbd_probe(struct usb_device *dev, unsigned int ifnum, @@ -201,6 +201,18 @@ if (!(kbd = kmalloc(sizeof(struct usb_kbd), GFP_KERNEL))) return NULL; memset(kbd, 0, sizeof(struct usb_kbd)); + kbd->irq = usb_alloc_urb(0); + if (!kbd->irq) { + kfree(kbd); + return NULL; + } + kbd->led = usb_alloc_urb(0); + if (!kbd->led) { + usb_free_urb(kbd->irq); + kfree(kbd); + return NULL; + } + kbd->usbdev = dev; kbd->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_LED) | BIT(EV_REP); @@ -215,7 +227,7 @@ kbd->dev.open = usb_kbd_open; kbd->dev.close = usb_kbd_close; - FILL_INT_URB(&kbd->irq, dev, pipe, kbd->new, maxp > 8 ? 8 : maxp, + FILL_INT_URB(kbd->irq, dev, pipe, kbd->new, maxp > 8 ? 8 : maxp, usb_kbd_irq, kbd, endpoint->bInterval); kbd->dr.bRequestType = USB_TYPE_CLASS | USB_RECIP_INTERFACE; @@ -248,7 +260,7 @@ kfree(buf); - FILL_CONTROL_URB(&kbd->led, dev, usb_sndctrlpipe(dev, 0), + FILL_CONTROL_URB(kbd->led, dev, usb_sndctrlpipe(dev, 0), (void*) &kbd->dr, &kbd->leds, 1, usb_kbd_led, kbd); input_register_device(&kbd->dev); @@ -262,8 +274,10 @@ static void usb_kbd_disconnect(struct usb_device *dev, void *ptr) { struct usb_kbd *kbd = ptr; - usb_unlink_urb(&kbd->irq); + usb_unlink_urb(kbd->irq); input_unregister_device(&kbd->dev); + usb_free_urb(kbd->irq); + usb_free_urb(kbd->led); kfree(kbd); } diff -urN linux-2.5.3-pre3/drivers/usb/usbmouse.c linux/drivers/usb/usbmouse.c --- linux-2.5.3-pre3/drivers/usb/usbmouse.c Sat Dec 8 20:28:45 2001 +++ linux/drivers/usb/usbmouse.c Wed Jan 23 17:31:04 2002 @@ -54,7 +54,7 @@ char name[128]; struct usb_device *usbdev; struct input_dev dev; - struct urb irq; + struct urb *irq; int open; }; @@ -84,8 +84,8 @@ if (mouse->open++) return 0; - mouse->irq.dev = mouse->usbdev; - if (usb_submit_urb(&mouse->irq)) + mouse->irq->dev = mouse->usbdev; + if (usb_submit_urb(mouse->irq)) return -EIO; return 0; @@ -96,7 +96,7 @@ struct usb_mouse *mouse = dev->private; if (!--mouse->open) - usb_unlink_urb(&mouse->irq); + usb_unlink_urb(mouse->irq); } static void *usb_mouse_probe(struct usb_device *dev, unsigned int ifnum, @@ -126,6 +126,12 @@ if (!(mouse = kmalloc(sizeof(struct usb_mouse), GFP_KERNEL))) return NULL; memset(mouse, 0, sizeof(struct usb_mouse)); + mouse->irq = usb_alloc_urb(0); + if (!mouse->irq) { + kfree(mouse); + return NULL; + } + mouse->usbdev = dev; mouse->dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REL); @@ -162,7 +168,7 @@ kfree(buf); - FILL_INT_URB(&mouse->irq, dev, pipe, mouse->data, maxp > 8 ? 8 : maxp, + FILL_INT_URB(mouse->irq, dev, pipe, mouse->data, maxp > 8 ? 8 : maxp, usb_mouse_irq, mouse, endpoint->bInterval); input_register_device(&mouse->dev); @@ -176,8 +182,9 @@ static void usb_mouse_disconnect(struct usb_device *dev, void *ptr) { struct usb_mouse *mouse = ptr; - usb_unlink_urb(&mouse->irq); + usb_unlink_urb(mouse->irq); input_unregister_device(&mouse->dev); + usb_free_urb(mouse->irq); kfree(mouse); } diff -urN linux-2.5.3-pre3/drivers/usb/vicam.c linux/drivers/usb/vicam.c --- linux-2.5.3-pre3/drivers/usb/vicam.c Wed Jan 23 17:31:01 2002 +++ linux/drivers/usb/vicam.c Wed Jan 23 17:31:04 2002 @@ -344,7 +344,7 @@ synchronize(vicam); mdelay(10); vicam_parameters(vicam); - printk("Submiting urb: %d\n", usb_submit_urb(&vicam->readurb)); + printk("Submiting urb: %d\n", usb_submit_urb(vicam->readurb)); #endif } @@ -841,9 +841,9 @@ vicam_parameters(vicam); - FILL_BULK_URB(&vicam->readurb, vicam->udev, usb_rcvbulkpipe(vicam->udev, 0x81), + FILL_BULK_URB(vicam->readurb, vicam->udev, usb_rcvbulkpipe(vicam->udev, 0x81), buf, 0x1e480, vicam_bulk, vicam); - printk("Submiting urb: %d\n", usb_submit_urb(&vicam->readurb)); + printk("Submiting urb: %d\n", usb_submit_urb(vicam->readurb)); return 0; error: @@ -877,7 +877,13 @@ return NULL; } memset(vicam, 0, sizeof(*vicam)); - + + vicam->readurb = usb_alloc_urb(0); + if (!vicam->readurb) { + kfree(vicam); + return NULL; + } + vicam->udev = udev; vicam->camera_name = camera_name; vicam->win.brightness = 128; @@ -925,6 +931,7 @@ if (!vicam->open_count) { /* Other random junk */ + usb_free_urb(vicam->readurb); kfree(vicam); vicam = NULL; } diff -urN linux-2.5.3-pre3/drivers/usb/vicam.h linux/drivers/usb/vicam.h --- linux-2.5.3-pre3/drivers/usb/vicam.h Wed Jan 23 17:31:01 2002 +++ linux/drivers/usb/vicam.h Wed Jan 23 17:31:04 2002 @@ -75,7 +75,7 @@ int maxframesize; struct picture_parm win; struct proc_dir_entry *proc_entry; /* /proc/se401/videoX */ - struct urb readurb; + struct urb *readurb; }; #endif diff -urN linux-2.5.3-pre3/drivers/usb/wacom.c linux/drivers/usb/wacom.c --- linux-2.5.3-pre3/drivers/usb/wacom.c Mon Sep 17 22:52:35 2001 +++ linux/drivers/usb/wacom.c Wed Jan 23 17:31:04 2002 @@ -100,7 +100,7 @@ signed char data[10]; struct input_dev dev; struct usb_device *usbdev; - struct urb irq; + struct urb *irq; struct wacom_features *features; int tool[2]; int open; @@ -335,8 +335,8 @@ if (wacom->open++) return 0; - wacom->irq.dev = wacom->usbdev; - if (usb_submit_urb(&wacom->irq)) + wacom->irq->dev = wacom->usbdev; + if (usb_submit_urb(wacom->irq)) return -EIO; return 0; @@ -347,7 +347,7 @@ struct wacom *wacom = dev->private; if (!--wacom->open) - usb_unlink_urb(&wacom->irq); + usb_unlink_urb(wacom->irq); } static void *wacom_probe(struct usb_device *dev, unsigned int ifnum, const struct usb_device_id *id) @@ -358,6 +358,12 @@ if (!(wacom = kmalloc(sizeof(struct wacom), GFP_KERNEL))) return NULL; memset(wacom, 0, sizeof(struct wacom)); + wacom->irq = usb_alloc_urb(0); + if (!wacom->irq) { + kfree(wacom); + return NULL; + } + wacom->features = wacom_features + id->driver_info; wacom->dev.evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_MSC) | wacom->features->evbit; @@ -397,7 +403,7 @@ endpoint = dev->config[0].interface[ifnum].altsetting[0].endpoint + 0; - FILL_INT_URB(&wacom->irq, dev, usb_rcvintpipe(dev, endpoint->bEndpointAddress), + FILL_INT_URB(wacom->irq, dev, usb_rcvintpipe(dev, endpoint->bEndpointAddress), wacom->data, wacom->features->pktlen, wacom->features->irq, wacom, endpoint->bInterval); input_register_device(&wacom->dev); @@ -411,8 +417,9 @@ static void wacom_disconnect(struct usb_device *dev, void *ptr) { struct wacom *wacom = ptr; - usb_unlink_urb(&wacom->irq); + usb_unlink_urb(wacom->irq); input_unregister_device(&wacom->dev); + usb_free_urb(wacom->irq); kfree(wacom); } diff -urN linux-2.5.3-pre3/drivers/video/Config.in linux/drivers/video/Config.in --- linux-2.5.3-pre3/drivers/video/Config.in Wed Nov 14 15:16:31 2001 +++ linux/drivers/video/Config.in Wed Jan 23 17:31:04 2002 @@ -143,6 +143,7 @@ bool ' SIS 630/540/730 support' CONFIG_FB_SIS_300 bool ' SIS 315H/315 support' CONFIG_FB_SIS_315 fi + tristate ' NeoMagic display support (EXPERIMENTAL)' CONFIG_FB_NEOMAGIC tristate ' 3Dfx Banshee/Voodoo3 display support (EXPERIMENTAL)' CONFIG_FB_3DFX tristate ' 3Dfx Voodoo Graphics (sst1) support (EXPERIMENTAL)' CONFIG_FB_VOODOO1 fi @@ -268,7 +269,7 @@ "$CONFIG_FB_SA1100" = "y" -o "$CONFIG_FB_3DFX" = "y" -o \ "$CONFIG_FB_PMAG_BA" = "y" -o "$CONFIG_FB_PMAGB_B" = "y" -o \ "$CONFIG_FB_MAXINE" = "y" -o "$CONFIG_FB_TX3912" = "y" -o \ - "$CONFIG_FB_SIS" = "y" ]; then + "$CONFIG_FB_SIS" = "y" -o "$CONFIG_FB_NEOMAGIC" = "y" ]; then define_tristate CONFIG_FBCON_CFB8 y else if [ "$CONFIG_FB_ACORN" = "m" -o "$CONFIG_FB_ATARI" = "m" -o \ @@ -288,7 +289,7 @@ "$CONFIG_FB_PMAG_BA" = "m" -o "$CONFIG_FB_PMAGB_B" = "m" -o \ "$CONFIG_FB_MAXINE" = "m" -o "$CONFIG_FB_RADEON" = "m" -o \ "$CONFIG_FB_SA1100" = "m" -o "$CONFIG_FB_SIS" = "m" -o \ - "$CONFIG_FB_TX3912" = "m" ]; then + "$CONFIG_FB_TX3912" = "m" -o "$CONFIG_FB_NEOMAGIC" = "m" ]; then define_tristate CONFIG_FBCON_CFB8 m fi fi @@ -304,7 +305,8 @@ "$CONFIG_FB_RIVA" = "y" -o "$CONFIG_FB_ATY128" = "y" -o \ "$CONFIG_FB_CYBER2000" = "y" -o "$CONFIG_FB_3DFX" = "y" -o \ "$CONFIG_FB_SIS" = "y" -o "$CONFIG_FB_SA1100" = "y" -o \ - "$CONFIG_FB_PVR2" = "y" -o "$CONFIG_FB_VOODOO1" = "y" ]; then + "$CONFIG_FB_PVR2" = "y" -o "$CONFIG_FB_VOODOO1" = "y" -o \ + "$CONFIG_FB_NEOMAGIC" = "y" ]; then define_tristate CONFIG_FBCON_CFB16 y else if [ "$CONFIG_FB_ATARI" = "m" -o "$CONFIG_FB_ATY" = "m" -o \ @@ -319,7 +321,8 @@ "$CONFIG_FB_RIVA" = "m" -o "$CONFIG_FB_ATY128" = "m" -o \ "$CONFIG_FB_CYBER2000" = "m" -o "$CONFIG_FB_SIS" = "m" -o \ "$CONFIG_FB_SA1100" = "m" -o "$CONFIG_FB_RADEON" = "m" -o \ - "$CONFIG_FB_PVR2" = "m" -o "$CONFIG_FB_VOODOO1" = "m" ]; then + "$CONFIG_FB_PVR2" = "m" -o "$CONFIG_FB_VOODOO1" = "m" -o \ + "$CONFIG_FB_NEOMAGIC" = "m" ]; then define_tristate CONFIG_FBCON_CFB16 m fi fi @@ -328,7 +331,7 @@ "$CONFIG_FB_MATROX" = "y" -o "$CONFIG_FB_PM2" = "y" -o \ "$CONFIG_FB_ATY128" = "y" -o "$CONFIG_FB_RADEON" = "y" -o \ "$CONFIG_FB_CYBER2000" = "y" -o "$CONFIG_FB_PVR2" = "y" -o \ - "$CONFIG_FB_VOODOO1" = "y" ]; then + "$CONFIG_FB_VOODOO1" = "y" -o "$CONFIG_FB_NEOMAGIC" = "y" ]; then define_tristate CONFIG_FBCON_CFB24 y else if [ "$CONFIG_FB_ATY" = "m" -o "$CONFIG_FB_VIRTUAL" = "m" -o \ @@ -336,7 +339,7 @@ "$CONFIG_FB_MATROX" = "m" -o "$CONFIG_FB_PM2" = "m" -o \ "$CONFIG_FB_ATY128" = "m" -o "$CONFIG_FB_RADEON" = "m" -o \ "$CONFIG_FB_CYBER2000" = "m" -o "$CONFIG_FB_PVR2" = "m" -o \ - "$CONFIG_FB_VOODOO1" = "m" ]; then + "$CONFIG_FB_VOODOO1" = "m" -o "$CONFIG_FB_NEOMAGIC" = "y" ]; then define_tristate CONFIG_FBCON_CFB24 m fi fi diff -urN linux-2.5.3-pre3/drivers/video/Makefile linux/drivers/video/Makefile --- linux-2.5.3-pre3/drivers/video/Makefile Thu Oct 25 13:53:52 2001 +++ linux/drivers/video/Makefile Wed Jan 23 17:31:04 2002 @@ -49,6 +49,7 @@ obj-$(CONFIG_FB_ATARI) += atafb.o obj-$(CONFIG_FB_ATY128) += aty128fb.o obj-$(CONFIG_FB_RADEON) += radeonfb.o +obj-$(CONFIG_FB_NEOMAGIC) += neofb.o obj-$(CONFIG_FB_IGA) += igafb.o obj-$(CONFIG_FB_CONTROL) += controlfb.o obj-$(CONFIG_FB_PLATINUM) += platinumfb.o diff -urN linux-2.5.3-pre3/drivers/video/S3triofb.c linux/drivers/video/S3triofb.c --- linux-2.5.3-pre3/drivers/video/S3triofb.c Thu Sep 13 16:04:43 2001 +++ linux/drivers/video/S3triofb.c Wed Jan 23 17:31:04 2002 @@ -554,7 +554,7 @@ strcpy(fb_info.modename, "Trio64 "); strncat(fb_info.modename, dp->full_name, sizeof(fb_info.modename)); - fb_info.node = -1; + fb_info.node = NODEV; fb_info.fbops = &s3trio_ops; #if 0 fb_info.fbvar_num = 1; diff -urN linux-2.5.3-pre3/drivers/video/acornfb.c linux/drivers/video/acornfb.c --- linux-2.5.3-pre3/drivers/video/acornfb.c Wed Jan 23 17:31:01 2002 +++ linux/drivers/video/acornfb.c Wed Jan 23 17:31:04 2002 @@ -1318,7 +1318,7 @@ strcpy(fb_info.modename, "Acorn"); strcpy(fb_info.fontname, "Acorn8x8"); - fb_info.node = -1; + fb_info.node = NODEV; fb_info.fbops = &acornfb_ops; fb_info.disp = &global_disp; fb_info.changevar = NULL; diff -urN linux-2.5.3-pre3/drivers/video/amifb.c linux/drivers/video/amifb.c --- linux-2.5.3-pre3/drivers/video/amifb.c Wed Nov 14 14:52:20 2001 +++ linux/drivers/video/amifb.c Wed Jan 23 17:31:04 2002 @@ -1730,7 +1730,7 @@ strcpy(fb_info.modename, amifb_name); fb_info.changevar = NULL; - fb_info.node = -1; + fb_info.node = NODEV; fb_info.fbops = &amifb_ops; fb_info.disp = &disp; fb_info.switch_con = &amifbcon_switch; diff -urN linux-2.5.3-pre3/drivers/video/atafb.c linux/drivers/video/atafb.c --- linux-2.5.3-pre3/drivers/video/atafb.c Thu Oct 25 00:02:26 2001 +++ linux/drivers/video/atafb.c Wed Jan 23 17:31:04 2002 @@ -2828,7 +2828,7 @@ strcpy(fb_info.modename, "Atari Builtin "); fb_info.changevar = NULL; - fb_info.node = -1; + fb_info.node = NODEV; fb_info.fbops = &atafb_ops; fb_info.disp = &disp; fb_info.switch_con = &atafb_switch; diff -urN linux-2.5.3-pre3/drivers/video/aty128fb.c linux/drivers/video/aty128fb.c --- linux-2.5.3-pre3/drivers/video/aty128fb.c Sun Nov 11 10:09:37 2001 +++ linux/drivers/video/aty128fb.c Wed Jan 23 17:31:04 2002 @@ -1704,7 +1704,7 @@ /* fill in info */ strcpy(info->fb_info.modename, aty128fb_name); - info->fb_info.node = -1; + info->fb_info.node = NODEV; info->fb_info.fbops = &aty128fb_ops; info->fb_info.disp = &info->disp; strcpy(info->fb_info.fontname, fontname); diff -urN linux-2.5.3-pre3/drivers/video/chipsfb.c linux/drivers/video/chipsfb.c --- linux-2.5.3-pre3/drivers/video/chipsfb.c Thu Sep 13 16:04:43 2001 +++ linux/drivers/video/chipsfb.c Wed Jan 23 17:31:04 2002 @@ -578,7 +578,7 @@ p->disp.scrollmode = SCROLL_YREDRAW; strcpy(p->info.modename, p->fix.id); - p->info.node = -1; + p->info.node = NODEV; p->info.fbops = &chipsfb_ops; p->info.disp = &p->disp; p->info.fontname[0] = 0; diff -urN linux-2.5.3-pre3/drivers/video/clgenfb.c linux/drivers/video/clgenfb.c --- linux-2.5.3-pre3/drivers/video/clgenfb.c Mon Nov 19 15:19:42 2001 +++ linux/drivers/video/clgenfb.c Wed Jan 23 17:31:04 2002 @@ -2758,7 +2758,7 @@ sizeof (fb_info->gen.info.modename)); fb_info->gen.info.modename [sizeof (fb_info->gen.info.modename) - 1] = 0; - fb_info->gen.info.node = -1; + fb_info->gen.info.node = NODEV; fb_info->gen.info.fbops = &clgenfb_ops; fb_info->gen.info.disp = &disp; fb_info->gen.info.changevar = NULL; diff -urN linux-2.5.3-pre3/drivers/video/controlfb.c linux/drivers/video/controlfb.c --- linux-2.5.3-pre3/drivers/video/controlfb.c Wed Jan 23 17:31:01 2002 +++ linux/drivers/video/controlfb.c Wed Jan 23 17:31:04 2002 @@ -1376,7 +1376,7 @@ static void __init control_init_info(struct fb_info *info, struct fb_info_control *p) { strcpy(info->modename, "control"); - info->node = -1; /* ??? danj */ + info->node = NODEV; info->fbops = &controlfb_ops; info->disp = &p->display; strcpy(info->fontname, fontname); diff -urN linux-2.5.3-pre3/drivers/video/cyberfb.c linux/drivers/video/cyberfb.c --- linux-2.5.3-pre3/drivers/video/cyberfb.c Wed Nov 14 14:52:20 2001 +++ linux/drivers/video/cyberfb.c Wed Jan 23 17:31:04 2002 @@ -1085,7 +1085,7 @@ strcpy(fb_info.modename, cyberfb_name); fb_info.changevar = NULL; - fb_info.node = -1; + fb_info.node = NODEV; fb_info.fbops = &cyberfb_ops; fb_info.disp = &disp; fb_info.switch_con = &Cyberfb_switch; diff -urN linux-2.5.3-pre3/drivers/video/dn_cfb4.c linux/drivers/video/dn_cfb4.c --- linux-2.5.3-pre3/drivers/video/dn_cfb4.c Sun Dec 30 10:31:51 2001 +++ linux/drivers/video/dn_cfb4.c Wed Jan 23 17:31:04 2002 @@ -305,7 +305,7 @@ fb_info.switch_con=&dnfbcon_switch; fb_info.updatevar=&dnfbcon_updatevar; fb_info.blank=&dnfbcon_blank; - fb_info.node = -1; + fb_info.node = NODEV; fb_info.fbops = &dn_fb_ops; fb_info.flags = FBINFO_FLAG_DEFAULT; diff -urN linux-2.5.3-pre3/drivers/video/dn_cfb8.c linux/drivers/video/dn_cfb8.c --- linux-2.5.3-pre3/drivers/video/dn_cfb8.c Sun Dec 30 10:31:51 2001 +++ linux/drivers/video/dn_cfb8.c Wed Jan 23 17:31:04 2002 @@ -292,7 +292,7 @@ fb_info.switch_con=&dnfbcon_switch; fb_info.updatevar=&dnfbcon_updatevar; fb_info.blank=&dnfbcon_blank; - fb_info.node = -1; + fb_info.node = NODEV; fb_info.fbops = &dn_fb_ops; printk("dn_fb_init: register\n"); diff -urN linux-2.5.3-pre3/drivers/video/dnfb.c linux/drivers/video/dnfb.c --- linux-2.5.3-pre3/drivers/video/dnfb.c Sun Dec 30 10:31:51 2001 +++ linux/drivers/video/dnfb.c Wed Jan 23 17:31:04 2002 @@ -307,7 +307,7 @@ fb_info.switch_con=&dnfbcon_switch; fb_info.updatevar=&dnfbcon_updatevar; fb_info.blank=&dnfbcon_blank; - fb_info.node = -1; + fb_info.node = NODEV; fb_info.fbops = &dn_fb_ops; dn_fb_get_var(&disp[0].var,0, &fb_info); diff -urN linux-2.5.3-pre3/drivers/video/epson1355fb.c linux/drivers/video/epson1355fb.c --- linux-2.5.3-pre3/drivers/video/epson1355fb.c Thu Sep 13 16:04:43 2001 +++ linux/drivers/video/epson1355fb.c Wed Jan 23 17:31:04 2002 @@ -500,7 +500,7 @@ fb_info.gen.fbhw->detect(); strcpy(fb_info.gen.info.modename, "SED1355"); fb_info.gen.info.changevar = NULL; - fb_info.gen.info.node = -1; + fb_info.gen.info.node = NODEV; fb_info.gen.info.fbops = &e1355fb_ops; fb_info.gen.info.disp = &disp; fb_info.gen.parsize = sizeof(struct e1355_par); diff -urN linux-2.5.3-pre3/drivers/video/fbmem.c linux/drivers/video/fbmem.c --- linux-2.5.3-pre3/drivers/video/fbmem.c Wed Jan 23 17:31:01 2002 +++ linux/drivers/video/fbmem.c Wed Jan 23 17:31:04 2002 @@ -73,6 +73,8 @@ extern int atyfb_setup(char*); extern int aty128fb_init(void); extern int aty128fb_setup(char*); +extern int neofb_init(void); +extern int neofb_setup(char*); extern int igafb_init(void); extern int igafb_setup(char*); extern int imsttfb_init(void); @@ -172,6 +174,9 @@ #endif #ifdef CONFIG_FB_ATY128 { "aty128fb", aty128fb_init, aty128fb_setup }, +#endif +#ifdef CONFIG_FB_NEOMAGIC + { "neo", neofb_init, neofb_setup }, #endif #ifdef CONFIG_FB_VIRGE { "virge", virgefb_init, virgefb_setup }, diff -urN linux-2.5.3-pre3/drivers/video/fm2fb.c linux/drivers/video/fm2fb.c --- linux-2.5.3-pre3/drivers/video/fm2fb.c Wed Nov 14 14:52:20 2001 +++ linux/drivers/video/fm2fb.c Wed Jan 23 17:31:04 2002 @@ -401,7 +401,7 @@ disp.scrollmode = SCROLL_YREDRAW; strcpy(fb_info.modename, fb_fix.id); - fb_info.node = -1; + fb_info.node = NODEV; fb_info.fbops = &fm2fb_ops; fb_info.disp = &disp; fb_info.fontname[0] = '\0'; diff -urN linux-2.5.3-pre3/drivers/video/g364fb.c linux/drivers/video/g364fb.c --- linux-2.5.3-pre3/drivers/video/g364fb.c Thu Sep 13 16:04:43 2001 +++ linux/drivers/video/g364fb.c Wed Jan 23 17:31:04 2002 @@ -378,7 +378,7 @@ disp.dispsw = &fbcon_g364cfb8; strcpy(fb_info.modename, fb_fix.id); - fb_info.node = -1; + fb_info.node = NODEV; fb_info.fbops = &g364fb_ops; fb_info.disp = &disp; fb_info.fontname[0] = '\0'; diff -urN linux-2.5.3-pre3/drivers/video/hgafb.c linux/drivers/video/hgafb.c --- linux-2.5.3-pre3/drivers/video/hgafb.c Mon Nov 12 09:46:25 2001 +++ linux/drivers/video/hgafb.c Wed Jan 23 17:31:04 2002 @@ -742,7 +742,7 @@ disp.scrollmode = SCROLL_YREDRAW; strcpy (fb_info.modename, hga_fix.id); - fb_info.node = -1; + fb_info.node = NODEV; fb_info.flags = FBINFO_FLAG_DEFAULT; /* fb_info.open = ??? */ fb_info.var = hga_default_var; diff -urN linux-2.5.3-pre3/drivers/video/hitfb.c linux/drivers/video/hitfb.c --- linux-2.5.3-pre3/drivers/video/hitfb.c Thu Sep 13 16:04:43 2001 +++ linux/drivers/video/hitfb.c Wed Jan 23 17:31:04 2002 @@ -344,7 +344,7 @@ int __init hitfb_init(void) { strcpy(fb_info.gen.info.modename, "Hitachi HD64461"); - fb_info.gen.info.node = -1; + fb_info.gen.info.node = NODEV; fb_info.gen.info.flags = FBINFO_FLAG_DEFAULT; fb_info.gen.info.fbops = &hitfb_ops; fb_info.gen.info.disp = &fb_info.disp; diff -urN linux-2.5.3-pre3/drivers/video/hpfb.c linux/drivers/video/hpfb.c --- linux-2.5.3-pre3/drivers/video/hpfb.c Thu Sep 13 16:04:43 2001 +++ linux/drivers/video/hpfb.c Wed Jan 23 17:31:04 2002 @@ -328,7 +328,7 @@ */ strcpy(fb_info.modename, "Topcat"); fb_info.changevar = NULL; - fb_info.node = -1; + fb_info.node = NODEV; fb_info.fbops = &hpfb_ops; fb_info.disp = &disp; fb_info.switch_con = &hpfb_switch; diff -urN linux-2.5.3-pre3/drivers/video/igafb.c linux/drivers/video/igafb.c --- linux-2.5.3-pre3/drivers/video/igafb.c Wed Jan 23 17:31:01 2002 +++ linux/drivers/video/igafb.c Wed Jan 23 17:31:04 2002 @@ -568,7 +568,7 @@ } strcpy(info->fb_info.modename, igafb_name); - info->fb_info.node = -1; + info->fb_info.node = NODEV; info->fb_info.fbops = &igafb_ops; info->fb_info.disp = &info->disp; strcpy(info->fb_info.fontname, fontname); diff -urN linux-2.5.3-pre3/drivers/video/imsttfb.c linux/drivers/video/imsttfb.c --- linux-2.5.3-pre3/drivers/video/imsttfb.c Wed Nov 14 14:52:20 2001 +++ linux/drivers/video/imsttfb.c Wed Jan 23 17:31:04 2002 @@ -1866,7 +1866,7 @@ strcpy(p->info.modename, p->fix.id); strcpy(p->info.fontname, fontname); - p->info.node = -1; + p->info.node = NODEV; p->info.fbops = &imsttfb_ops; p->info.disp = &p->disp; p->info.changevar = 0; diff -urN linux-2.5.3-pre3/drivers/video/macfb.c linux/drivers/video/macfb.c --- linux-2.5.3-pre3/drivers/video/macfb.c Wed Nov 14 14:52:20 2001 +++ linux/drivers/video/macfb.c Wed Jan 23 17:31:04 2002 @@ -1221,7 +1221,7 @@ } fb_info.changevar = NULL; - fb_info.node = -1; + fb_info.node = NODEV; fb_info.fbops = &macfb_ops; fb_info.disp = &disp; fb_info.switch_con = &macfb_switch; diff -urN linux-2.5.3-pre3/drivers/video/maxinefb.c linux/drivers/video/maxinefb.c --- linux-2.5.3-pre3/drivers/video/maxinefb.c Thu Sep 13 16:04:43 2001 +++ linux/drivers/video/maxinefb.c Wed Jan 23 17:31:04 2002 @@ -358,7 +358,7 @@ strcpy(fb_info.modename, "Maxine onboard graphics 1024x768x8"); /* fb_info.modename: maximum of 39 characters + trailing nullbyte, KM */ fb_info.changevar = NULL; - fb_info.node = -1; + fb_info.node = NODEV; fb_info.fbops = &maxinefb_ops; fb_info.disp = &disp; fb_info.switch_con = &maxinefb_switch; diff -urN linux-2.5.3-pre3/drivers/video/neofb.c linux/drivers/video/neofb.c --- linux-2.5.3-pre3/drivers/video/neofb.c Wed Dec 31 16:00:00 1969 +++ linux/drivers/video/neofb.c Wed Jan 23 17:31:04 2002 @@ -0,0 +1,2421 @@ +/* + * linux/drivers/video/neofb.c -- NeoMagic Framebuffer Driver + * + * Copyright (c) 2001 Denis Oliver Kropp + * + * + * Card specific code is based on XFree86's neomagic driver. + * Framebuffer framework code is based on code of cyber2000fb. + * + * This file is subject to the terms and conditions of the GNU General + * Public License. See the file COPYING in the main directory of this + * archive for more details. + * + * + * 0.3.1 + * - added module license (dok) + * + * 0.3 + * - hardware accelerated clear and move for 2200 and above (dok) + * - maximum allowed dotclock is handled now (dok) + * + * 0.2.1 + * - correct panning after X usage (dok) + * - added module and kernel parameters (dok) + * - no stretching if external display is enabled (dok) + * + * 0.2 + * - initial version (dok) + * + * + * TODO + * - ioctl for internal/external switching + * - blanking + * - 32bit depth support, maybe impossible + * - disable pan-on-sync, need specs + * + * BUGS + * - white margin on bootup like with tdfxfb (colormap problem?) + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#ifdef CONFIG_MTRR +#include +#endif + +#include