From b81024c6bb6a249787c73830e91ef18c980198da Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 23 Nov 2007 15:29:50 -0500 Subject: [PATCH] Import 2.3.36 --- arch/i386/kernel/pci-pc.c | 1 + arch/sparc/kernel/sys_sparc.c | 6 +- arch/sparc/lib/rwsem.S | 1 - arch/sparc64/kernel/ioctl32.c | 3 +- arch/sparc64/kernel/sys_sparc.c | 1 + drivers/cdrom/cdrom.c | 55 +++----- drivers/char/agp/Makefile | 5 +- drivers/char/agp/agpgart_be.c | 1 - drivers/char/drm/Makefile | 21 ++- drivers/char/drm/gamma_drv.c | 3 +- drivers/char/drm/init.c | 2 +- drivers/char/drm/tdfx_drv.c | 7 +- drivers/fc4/soc.c | 2 +- drivers/fc4/soc.h | 5 + drivers/fc4/socal.c | 29 +--- drivers/net/aironet4500_core.c | 3 +- drivers/net/arcnet/arc-rawmode.c | 1 - drivers/net/arcnet/arcnet.c | 1 + drivers/net/arcnet/rfc1051.c | 1 - drivers/net/arcnet/rfc1201.c | 1 - drivers/net/irda/toshoboe.c | 2 +- drivers/net/irda/w83977af_ir.c | 2 +- drivers/pcmcia/pci_socket.h | 1 + drivers/pcmcia/yenta.c | 31 ++++- drivers/sbus/char/jsflash.c | 1 - drivers/scsi/ide-scsi.c | 3 +- drivers/scsi/scsi.c | 4 +- drivers/scsi/st.c | 123 +++++++++-------- drivers/scsi/st.h | 1 - drivers/scsi/st_options.h | 4 +- drivers/telephony/ixj.c | 2 +- drivers/usb/Makefile | 18 +-- drivers/usb/acm.c | 30 ++--- drivers/usb/hid.c | 32 +++-- drivers/usb/inits.h | 26 ---- drivers/usb/uhci.c | 6 - drivers/usb/usb-core.c | 276 +++++++++++++++++++-------------------- drivers/usb/usb.c | 11 +- drivers/usb/usb.h | 14 +- fs/devices.c | 4 +- fs/devpts/inode.c | 6 +- fs/efs/inode.c | 10 +- fs/openpromfs/inode.c | 3 +- fs/udf/inode.c | 11 +- fs/udf/namei.c | 19 +-- fs/ufs/namei.c | 5 +- fs/ufs/super.c | 6 + include/asm-sparc64/semaphore.h | 1 + include/linux/fs.h | 2 - include/linux/ufs_fs_sb.h | 2 + include/net/br.h | 1 + include/net/irda/irlmp_frame.h | 1 + kernel/ksyms.c | 3 - net/irda/af_irda.c | 1 + net/irda/irlmp_event.c | 1 + 55 files changed, 373 insertions(+), 439 deletions(-) delete mode 100644 drivers/usb/inits.h rewrite drivers/usb/usb-core.c (68%) diff --git a/arch/i386/kernel/pci-pc.c b/arch/i386/kernel/pci-pc.c index 9ee1d6355..d0ff0b6c3 100644 --- a/arch/i386/kernel/pci-pc.c +++ b/arch/i386/kernel/pci-pc.c @@ -1063,6 +1063,7 @@ static char *pcibios_lookup_irq(struct pci_dev *dev, struct irq_routing_table *r case ID(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371FB_0): case ID(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371SB_0): case ID(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_0): + case ID(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533): /* Intel PIIX: PIRQ holds configuration register address */ pci_read_config_byte(router, pirq, &x); if (x < 16) { diff --git a/arch/sparc/kernel/sys_sparc.c b/arch/sparc/kernel/sys_sparc.c index 663991ab9..69379de4a 100644 --- a/arch/sparc/kernel/sys_sparc.c +++ b/arch/sparc/kernel/sys_sparc.c @@ -1,4 +1,4 @@ -/* $Id: sys_sparc.c,v 1.55 1999/12/21 14:09:09 jj Exp $ +/* $Id: sys_sparc.c,v 1.56 2000/01/04 11:01:26 jj Exp $ * linux/arch/sparc/kernel/sys_sparc.c * * This file contains various random system calls that @@ -227,7 +227,9 @@ asmlinkage unsigned long sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long pgoff) { - return do_mmap2(addr, len, prot, flags, fd, pgoff); + /* Make sure the shift for mmap2 is constant (12), no matter what PAGE_SIZE + we have. */ + return do_mmap2(addr, len, prot, flags, fd, pgoff >> (PAGE_SHIFT - 12)); } asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len, diff --git a/arch/sparc/lib/rwsem.S b/arch/sparc/lib/rwsem.S index 4a6f2f4c0..e4e8eebec 100644 --- a/arch/sparc/lib/rwsem.S +++ b/arch/sparc/lib/rwsem.S @@ -4,7 +4,6 @@ * Copyright (C) 1999 Jakub Jelinek (jakub@redhat.com) */ -#include #include #include diff --git a/arch/sparc64/kernel/ioctl32.c b/arch/sparc64/kernel/ioctl32.c index f3a46bf90..ef0fb3e94 100644 --- a/arch/sparc64/kernel/ioctl32.c +++ b/arch/sparc64/kernel/ioctl32.c @@ -1,4 +1,4 @@ -/* $Id: ioctl32.c,v 1.71 1999/12/19 23:13:13 davem Exp $ +/* $Id: ioctl32.c,v 1.72 2000/01/04 15:43:45 davem Exp $ * ioctl32.c: Conversion between 32bit and 64bit native ioctls. * * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) @@ -2181,7 +2181,6 @@ asmlinkage int sys32_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) case PPPIOCSNPMODE: case PPPIOCGDEBUG: case PPPIOCSDEBUG: - case PPPIOCGIDLE: case PPPIOCNEWUNIT: case PPPIOCATTACH: case PPPIOCDETACH: diff --git a/arch/sparc64/kernel/sys_sparc.c b/arch/sparc64/kernel/sys_sparc.c index 5e65aeea5..53d2d8c2d 100644 --- a/arch/sparc64/kernel/sys_sparc.c +++ b/arch/sparc64/kernel/sys_sparc.c @@ -6,6 +6,7 @@ * platform. */ +#include #include #include #include diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index d952ecf4b..a05b7a232 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -636,9 +636,9 @@ int cdrom_release(struct inode *ip, struct file *fp) int opened_for_data; cdinfo(CD_CLOSE, "entering cdrom_release\n"); - if (cdi == NULL) - return 0; - if (cdi->use_count > 0) cdi->use_count--; + + if (cdi->use_count > 0) + cdi->use_count--; if (cdi->use_count == 0) cdinfo(CD_CLOSE, "Use count for \"/dev/%s\" now zero\n", cdi->name); if (cdi->use_count == 0 && @@ -812,15 +812,12 @@ int media_changed(struct cdrom_device_info *cdi, int queue) return ret; } -static -int cdrom_media_changed(kdev_t dev) +static int cdrom_media_changed(kdev_t dev) { struct cdrom_device_info *cdi = cdrom_find_device(dev); /* This talks to the VFS, which doesn't like errors - just 1 or 0. * Returning "0" is always safe (media hasn't been changed). Do that * if the low-level cdrom driver dosn't support media changed. */ - if (cdi == NULL) - return 0; if (cdi->ops->media_changed == NULL) return 0; if (!CDROM_CAN(CDC_MEDIA_CHANGED)) @@ -828,6 +825,7 @@ int cdrom_media_changed(kdev_t dev) return (media_changed(cdi, 0)); } +/* badly broken, I know. Is due for a fixup anytime. */ void cdrom_count_tracks(struct cdrom_device_info *cdi, tracktype* tracks) { struct cdrom_tochdr header; @@ -913,12 +911,11 @@ void sanitize_format(union cdrom_addr *addr, *curr = requested; } -void init_cdrom_command(struct cdrom_generic_command *cgc, - void *buffer, int len) +void init_cdrom_command(struct cdrom_generic_command *cgc, void *buf, int len) { memset(cgc, 0, sizeof(struct cdrom_generic_command)); - memset(buffer, 0, len); - cgc->buffer = (char *) buffer; + memset(buf, 0, len); + cgc->buffer = (char *) buf; cgc->buflen = len; } @@ -1382,37 +1379,21 @@ static int cdrom_read_block(struct cdrom_device_info *cdi, return cdo->generic_packet(cdi, cgc); } -/* Some of the cdrom ioctls are not implemented here, because these - * appear to be either too device-specific, or it is not clear to me - * what use they are. These are (number of drivers that support them - * in parenthesis): CDROMREADMODE1 (2+ide), CDROMREADMODE2 (2+ide), - * CDROMREADAUDIO (2+ide), CDROMREADRAW (2), CDROMREADCOOKED (2), - * CDROMSEEK (2), CDROMPLAYBLK (scsi), CDROMREADALL (1). Read-audio, - * OK (although i guess the record companies aren't too happy with - * this, most drives therefore refuse to transport audio data). But - * why are there 5 different READs defined? For now, these functions - * are left over to the device-specific ioctl routine, - * cdo->dev_ioctl. Note that as a result of this, no - * memory-verification is performed for these ioctls. +/* Just about every imaginable ioctl is supported in the Uniform layer + * these days. ATAPI / SCSI specific code now mainly resides in + * mmc_ioct(). */ -static -int cdrom_ioctl(struct inode *ip, struct file *fp, - unsigned int cmd, unsigned long arg) +static int cdrom_ioctl(struct inode *ip, struct file *fp, unsigned int cmd, + unsigned long arg) { kdev_t dev = ip->i_rdev; struct cdrom_device_info *cdi = cdrom_find_device(dev); - struct cdrom_device_ops *cdo; + struct cdrom_device_ops *cdo = cdi->ops; int ret; - if (cdi == NULL) - return -ENODEV; - cdo = cdi->ops; - /* the first few commands do not deal with audio drive_info, but only with routines in cdrom device operations. */ switch (cmd) { - /* maybe we should order cases after statistics of use? */ - case CDROMMULTISESSION: { struct cdrom_multisession ms_info; u_char requested_format; @@ -1902,8 +1883,7 @@ static int mmc_ioctl(struct cdrom_device_info *cdi, unsigned int cmd, /* get toc entry for start and end track */ if (cdo->audio_ioctl(cdi, CDROMREADTOCHDR, &tochdr)) return -EINVAL; - entry.cdte_track = ti.cdti_trk1 + 1; - if (entry.cdte_track > tochdr.cdth_trk1) + if ((entry.cdte_track = ti.cdti_trk0) > tochdr.cdth_trk1) return -EINVAL; if (cdo->audio_ioctl(cdi, CDROMREADTOCENTRY, &entry)) return -EINVAL; @@ -1912,7 +1892,10 @@ static int mmc_ioctl(struct cdrom_device_info *cdi, unsigned int cmd, cgc.cmd[4] = entry.cdte_addr.msf.second; cgc.cmd[5] = entry.cdte_addr.msf.frame; - entry.cdte_track = ti.cdti_trk1; + entry.cdte_track = ti.cdti_trk1 + 1; + if (entry.cdte_track > tochdr.cdth_trk1) + entry.cdte_track = CDROM_LEADOUT; + if (cdo->audio_ioctl(cdi, CDROMREADTOCENTRY, &entry)) return -EINVAL; diff --git a/drivers/char/agp/Makefile b/drivers/char/agp/Makefile index 39a0e3672..d20869b0e 100644 --- a/drivers/char/agp/Makefile +++ b/drivers/char/agp/Makefile @@ -6,9 +6,12 @@ O_TARGET := agp.o ifeq ($(CONFIG_AGP),y) - O_OBJS += agpgart.o + O_OBJS += agpgart_fe.o + OX_OBJS += agpgart_be.o else ifeq ($(CONFIG_AGP), m) + MI_OBJS += agpgart_fe.o + MIX_OBJS += agpgart_be.o M_OBJS += agpgart.o endif endif diff --git a/drivers/char/agp/agpgart_be.c b/drivers/char/agp/agpgart_be.c index 05b83814c..27413489a 100644 --- a/drivers/char/agp/agpgart_be.c +++ b/drivers/char/agp/agpgart_be.c @@ -23,7 +23,6 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ -#define EXPORT_SYMTAB #include #include #include diff --git a/drivers/char/drm/Makefile b/drivers/char/drm/Makefile index e33418fd4..ff70792d7 100644 --- a/drivers/char/drm/Makefile +++ b/drivers/char/drm/Makefile @@ -10,7 +10,6 @@ # parent makes.. # -L_TARGET := libdrm.a O_TARGET := drm.o L_OBJS := init.o memory.o proc.o auth.o context.o drawable.o bufs.o \ @@ -19,25 +18,33 @@ L_OBJS := init.o memory.o proc.o auth.o context.o drawable.o bufs.o \ M_OBJS := ifeq ($(CONFIG_DRM_GAMMA),y) - O_OBJS += gamma.o + OX_OBJS += gamma_drv.o + O_OBJS += gamma_dma.o else ifeq ($(CONFIG_DRM_GAMMA),m) + MIX_OBJS += gamma_drv.o + MI_OBJS += gamma_dma.o M_OBJS += gamma.o endif endif ifeq ($(CONFIG_DRM_TDFX),y) - O_OBJS += tdfx.o + OX_OBJS += tdfx_drv.o + O_OBJS += tdfx_context.o else ifeq ($(CONFIG_DRM_TDFX),m) + MIX_OBJS += tdfx_drv.o + MI_OBJS += tdfx_context.o M_OBJS += tdfx.o endif endif +O_OBJS += $(L_OBJS) + include $(TOPDIR)/Rules.make -gamma.o: gamma_drv.o gamma_dma.o $(L_TARGET) - $(LD) $(LD_RFLAG) -r -o $@ gamma_drv.o gamma_dma.o -L. -ldrm +gamma.o : gamma_drv.o gamma_dma.o $(L_OBJS) + $(LD) $(LD_RFLAG) -r -o $@ gamma_drv.o gamma_dma.o $(L_OBJS) -tdfx.o: tdfx_drv.o tdfx_context.o $(L_TARGET) - $(LD) $(LD_RFLAG) -r -o $@ tdfx_drv.o tdfx_context.o -L. -ldrm +tdfx.o: tdfx_drv.o tdfx_context.o $(L_OBJS) + $(LD) $(LD_RFLAG) -r -o $@ tdfx_drv.o tdfx_context.o $(L_OBJS) diff --git a/drivers/char/drm/gamma_drv.c b/drivers/char/drm/gamma_drv.c index 2a966cab1..028772f26 100644 --- a/drivers/char/drm/gamma_drv.c +++ b/drivers/char/drm/gamma_drv.c @@ -29,7 +29,6 @@ * */ -#define EXPORT_SYMTAB #include #include "drmP.h" #include "gamma_drv.h" @@ -122,7 +121,7 @@ void cleanup_module(void) #ifndef MODULE /* gamma_setup is called by the kernel to parse command-line options passed * via the boot-loader (e.g., LILO). It calls the insmod option routine, - * drm_parse_drm. + * drm_parse_options. * * This is not currently supported, since it requires changes to * linux/init/main.c. */ diff --git a/drivers/char/drm/init.c b/drivers/char/drm/init.c index e6b78395c..f416a99af 100644 --- a/drivers/char/drm/init.c +++ b/drivers/char/drm/init.c @@ -35,7 +35,7 @@ int drm_flags = 0; /* drm_parse_option parses a single option. See description for - drm_parse_drm for details. */ + drm_parse_options for details. */ static void drm_parse_option(char *s) { diff --git a/drivers/char/drm/tdfx_drv.c b/drivers/char/drm/tdfx_drv.c index c5913a08e..f56e2af95 100644 --- a/drivers/char/drm/tdfx_drv.c +++ b/drivers/char/drm/tdfx_drv.c @@ -29,7 +29,6 @@ * */ -#define EXPORT_SYMTAB #include #include "drmP.h" #include "tdfx_drv.h" @@ -89,7 +88,9 @@ static drm_ioctl_desc_t tdfx_ioctls[] = { }; #define TDFX_IOCTL_COUNT DRM_ARRAY_SIZE(tdfx_ioctls) +#ifdef MODULE static char *tdfx = NULL; +#endif MODULE_AUTHOR("Precision Insight, Inc., Cedar Park, Texas."); MODULE_DESCRIPTION("tdfx"); @@ -587,10 +588,11 @@ int tdfx_unlock(struct inode *inode, struct file *filp, unsigned int cmd, module_init(tdfx_init); module_exit(tdfx_cleanup); +#ifndef MODULE /* * tdfx_setup is called by the kernel to parse command-line options passed * via the boot-loader (e.g., LILO). It calls the insmod option routine, - * drm_parse_drm. + * drm_parse_options. */ static int __init tdfx_options(char *str) { @@ -599,3 +601,4 @@ static int __init tdfx_options(char *str) } __setup("tdfx=", tdfx_options); +#endif diff --git a/drivers/fc4/soc.c b/drivers/fc4/soc.c index 5db573fc0..c44c3fc8c 100644 --- a/drivers/fc4/soc.c +++ b/drivers/fc4/soc.c @@ -205,7 +205,7 @@ static void inline soc_unsolicited (struct soc *s) hwrsp = (soc_rsp *)sw_cq->pool + sw_cq->out; hwrspc = NULL; - flags = hwrsp->shdr.flags; + flags = xram_get_16 ((xram_p)&hwrsp->shdr.flags); count = xram_get_8 ((xram_p)&hwrsp->count); fc = (fc_channel *)&s->port[flags & SOC_PORT_B]; SOD(("FC %08lx fcp_state_change %08lx\n", diff --git a/drivers/fc4/soc.h b/drivers/fc4/soc.h index e944c8534..740e1a395 100644 --- a/drivers/fc4/soc.h +++ b/drivers/fc4/soc.h @@ -96,6 +96,11 @@ static inline u32 xram_get_32low (xram_p x) return (u32) sbus_readw(x + 0x02UL); } +static inline u16 xram_get_16 (xram_p x) +{ + return sbus_readw(x); +} + static inline u8 xram_get_8 (xram_p x) { if (x & (xram_p)0x1) { diff --git a/drivers/fc4/socal.c b/drivers/fc4/socal.c index f31364fae..c63aaa6b8 100644 --- a/drivers/fc4/socal.c +++ b/drivers/fc4/socal.c @@ -135,7 +135,6 @@ static void socal_reset(fc_channel *fc) static void inline socal_solicited(struct socal *s, unsigned long qno) { - fc_hdr fchdr; socal_rsp *hwrsp; socal_cq *sw_cq; int token; @@ -144,11 +143,6 @@ static void inline socal_solicited(struct socal *s, unsigned long qno) sw_cq = &s->rsp[qno]; - if (sw_cq->pool == NULL) { - SOD(("address %08x xram %p\n", sw_cq->hw_cq->address, s->xram)) - sw_cq->pool = - (socal_req *)(s->xram + (sw_cq->hw_cq->address & 0xfffe)); - } /* Finally an improvement against old SOC :) */ sw_cq->in = sbus_readb(s->regs + RESP + qno); SOD (("socal_solicited, %d packets arrived\n", @@ -199,13 +193,12 @@ static void inline socal_solicited(struct socal *s, unsigned long qno) token & ((1 << 11) - 1), FC_STATUS_OK, NULL); } else { - socal_copy_from_xram(&fchdr, &hwrsp->fchdr, sizeof(fchdr)); /* We have intentionally defined FC_STATUS_* constants * to match SOCAL_* constants, otherwise we'd have to * translate status. */ fcp_receive_solicited(fc, token >> 12, - token & ((1 << 11) - 1), status, &fchdr); + token & ((1 << 11) - 1), status, &hwrsp->fchdr); } if (++sw_cq->out > sw_cq->last) { @@ -259,11 +252,6 @@ static void inline socal_unsolicited (struct socal *s, unsigned long qno) fc_channel *fc; sw_cq = &s->rsp[qno]; - if (sw_cq->pool == NULL) { - SOD(("address %08x xram %lx\n", sw_cq->hw_cq->address, s->xram)) - sw_cq->pool = - (socal_req *)(s->xram + (sw_cq->hw_cq->address & 0xfffe)); - } sw_cq->in = sbus_readb(s->regs + RESP + qno); SOD (("socal_unsolicited, %d packets arrived, in %d\n", @@ -352,7 +340,6 @@ static void inline socal_unsolicited (struct socal *s, unsigned long qno) { int r_ctl = *((u8 *)&hwrsp->fchdr); unsigned len; - char buf[64]; if ((r_ctl & 0xf0) == R_CTL_EXTENDED_SVC) { len = hwrsp->shdr.bytecnt; @@ -363,21 +350,19 @@ static void inline socal_unsolicited (struct socal *s, unsigned long qno) } else { if (len > 60) len = 60; - socal_copy_from_xram(buf, hwrspc, - (len + 3) & ~3); - if (*(u32 *)buf == LS_DISPLAY) { + if (*(u32 *)hwrspc == LS_DISPLAY) { int i; for (i = 4; i < len; i++) - if (buf[i] == '\n') - buf[i] = ' '; - buf[len] = 0; + if (((u8 *)hwrspc)[i] == '\n') + ((u8 *)hwrspc)[i] = ' '; + ((u8 *)hwrspc)[len] = 0; printk ("%s message: %s\n", - fc->name, buf + 4); + fc->name, ((u8 *)hwrspc) + 4); } else { printk ("%s: Unknown LS_CMD " "%08x\n", fc->name, - *(u32 *)buf); + *(u32 *)hwrspc); } } } else { diff --git a/drivers/net/aironet4500_core.c b/drivers/net/aironet4500_core.c index 6b293dad1..1b82d4715 100644 --- a/drivers/net/aironet4500_core.c +++ b/drivers/net/aironet4500_core.c @@ -18,6 +18,7 @@ */ #include +#include #include #include #include @@ -3265,4 +3266,4 @@ void cleanup_module(void) } #endif - \ No newline at end of file + diff --git a/drivers/net/arcnet/arc-rawmode.c b/drivers/net/arcnet/arc-rawmode.c index b59b24951..b182b2049 100644 --- a/drivers/net/arcnet/arc-rawmode.c +++ b/drivers/net/arcnet/arc-rawmode.c @@ -25,7 +25,6 @@ */ #include -#include /* for CONFIG_INET */ #include #include #include diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c index ec2f72fb4..98b2ac4da 100644 --- a/drivers/net/arcnet/arcnet.c +++ b/drivers/net/arcnet/arcnet.c @@ -44,6 +44,7 @@ #define VERSION "arcnet: v3.91 BETA 99/12/18 - by Avery Pennarun et al.\n" #include +#include #include #include #include diff --git a/drivers/net/arcnet/rfc1051.c b/drivers/net/arcnet/rfc1051.c index 4732a0122..687ab89a0 100644 --- a/drivers/net/arcnet/rfc1051.c +++ b/drivers/net/arcnet/rfc1051.c @@ -24,7 +24,6 @@ * ********************** */ #include -#include /* for CONFIG_INET */ #include #include #include diff --git a/drivers/net/arcnet/rfc1201.c b/drivers/net/arcnet/rfc1201.c index c753b855e..759263ca0 100644 --- a/drivers/net/arcnet/rfc1201.c +++ b/drivers/net/arcnet/rfc1201.c @@ -24,7 +24,6 @@ * ********************** */ #include -#include /* for CONFIG_INET */ #include #include #include diff --git a/drivers/net/irda/toshoboe.c b/drivers/net/irda/toshoboe.c index 6715d07b8..982ddb4f7 100644 --- a/drivers/net/irda/toshoboe.c +++ b/drivers/net/irda/toshoboe.c @@ -87,7 +87,7 @@ static char *rcsid = "$Id: toshoboe.c,v 1.91 1999/06/29 14:21:06 root Exp $"; /* No user servicable parts below here */ #include - +#include #include #include #include diff --git a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c index 82f308cd6..717ada5ce 100644 --- a/drivers/net/irda/w83977af_ir.c +++ b/drivers/net/irda/w83977af_ir.c @@ -40,7 +40,7 @@ ********************************************************************/ #include - +#include #include #include #include diff --git a/drivers/pcmcia/pci_socket.h b/drivers/pcmcia/pci_socket.h index d4cec4241..41ea4ec09 100644 --- a/drivers/pcmcia/pci_socket.h +++ b/drivers/pcmcia/pci_socket.h @@ -14,6 +14,7 @@ typedef struct pci_socket { void *info; struct pci_socket_ops *op; socket_cap_t cap; + struct timer_list timer; } pci_socket_t; struct pci_socket_ops { diff --git a/drivers/pcmcia/yenta.c b/drivers/pcmcia/yenta.c index 330c657b2..c2413f526 100644 --- a/drivers/pcmcia/yenta.c +++ b/drivers/pcmcia/yenta.c @@ -411,6 +411,13 @@ static void yenta_interrupt(int irq, void *dev_id, struct pt_regs *regs) if (events && socket->handler) socket->handler(socket->info, events); + + mod_timer(&socket->timer, jiffies + HZ); +} + +static void yenta_timer(unsigned long data) +{ + yenta_interrupt(0, (pci_socket_t *) data, NULL); } static unsigned int yenta_probe_irq(pci_socket_t *socket) @@ -426,8 +433,10 @@ static unsigned int yenta_probe_irq(pci_socket_t *socket) if (socket->cb_irq && socket->cb_irq < 16) return 1 << socket->cb_irq; - printk("CardBus: Hmm.. Routing interrupts to bad PCI irq %d\n", socket->cb_irq); - return 0; + /* Uhhuh. Try falling back on ISA interrupts */ + printk("CardBus: Hmm.. Bad PCI irq routing (irq%d)\n", socket->cb_irq); + bridge_ctrl |= CB_BRIDGE_INTR; + config_writew(socket, CB_BRIDGE_CONTROL, bridge_ctrl); } cb_writel(socket, CB_SOCKET_EVENT, -1); @@ -627,15 +636,25 @@ static int yenta_open(pci_socket_t *socket) /* Disable all events */ cb_writel(socket, CB_SOCKET_MASK, 0x0); + /* Set up the bridge regions.. */ + yenta_allocate_resources(socket); + + /* + * Always poll the socket too, just in case the cardbus interrupt + * doesn't exist (it happens), or we just lose an interrupt.. + */ + init_timer(&socket->timer); + socket->timer.expires = jiffies + HZ; + socket->timer.data = (unsigned long)socket; + socket->timer.function = yenta_timer; + add_timer(&socket->timer); + if (dev->irq && !request_irq(dev->irq, yenta_interrupt, SA_SHIRQ, dev->name, socket)) socket->cb_irq = dev->irq; - /* Figure out what the dang thing can do.. */ + /* And figure out what the dang thing can do for the PCMCIA layer... */ yenta_get_socket_capabilities(socket); - /* Set up the bridge regions.. */ - yenta_allocate_resources(socket); - printk("Socket status: %08x\n", cb_readl(socket, CB_SOCKET_STATE)); return 0; } diff --git a/drivers/sbus/char/jsflash.c b/drivers/sbus/char/jsflash.c index 52b4258b0..ab4ff4f90 100644 --- a/drivers/sbus/char/jsflash.c +++ b/drivers/sbus/char/jsflash.c @@ -22,7 +22,6 @@ * instead. We should discuss this. */ -#include #include #include #include diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c index 006a2aff9..6554ee2f0 100644 --- a/drivers/scsi/ide-scsi.c +++ b/drivers/scsi/ide-scsi.c @@ -636,10 +636,9 @@ int idescsi_ioctl (Scsi_Device *dev, int cmd, void *arg) { ide_drive_t *drive = idescsi_drives[dev->id]; idescsi_scsi_t *scsi = drive->driver_data; - int enable = (int) arg; if (cmd == SG_SET_TRANSFORM) { - if (enable) + if (arg) set_bit(IDESCSI_SG_TRANSFORM, &scsi->transform); else clear_bit(IDESCSI_SG_TRANSFORM, &scsi->transform); diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index fb986e231..51ee72cea 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -293,8 +293,8 @@ static struct dev_info device_list[] = {"MATSHITA","PD-2 LF-D100","*", BLIST_GHOST}, {"HITACHI", "GF-1050","*", BLIST_GHOST}, /* Hitachi SCSI DVD-RAM */ {"TOSHIBA","CDROM","*", BLIST_ISROM}, - {"Toshiba","DVD-RAM SD-W1101","*", BLIST_GHOST}, - {"Toshiba","DVD-RAM SD-W1111","*", BLIST_GHOST}, + {"TOSHIBA","DVD-RAM SD-W1101","*", BLIST_GHOST}, + {"TOSHIBA","DVD-RAM SD-W1111","*", BLIST_GHOST}, /* * Must be at end of list... diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index aa8dee0c8..90d0d213f 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c @@ -8,10 +8,10 @@ order) Klaus Ehrenfried, Wolfgang Denk, Steve Hirsch, Andreas Koppenh"ofer, Michael Leodolter, Eyal Lebedinsky, J"org Weule, and Eric Youngdale. - Copyright 1992 - 1999 Kai Makisara + Copyright 1992 - 2000 Kai Makisara email Kai.Makisara@metla.fi - Last modified: Thu Dec 16 23:08:29 1999 by makisara@kai.makisara.local + Last modified: Tue Jan 4 21:43:17 2000 by makisara@kai.makisara.local Some small formal changes - aeb, 950809 */ @@ -2915,7 +2915,7 @@ static int st_ioctl(struct inode *inode, struct file *file, static ST_buffer * new_tape_buffer(int from_initialization, int need_dma) { - int i, priority, b_size, got = 0, segs = 0; + int i, priority, b_size, order, got = 0, segs = 0; ST_buffer *tb; if (st_nbr_buffers >= st_template.dev_max) @@ -2927,20 +2927,20 @@ static ST_buffer * priority = GFP_KERNEL; i = sizeof(ST_buffer) + (st_max_sg_segs - 1) * sizeof(struct scatterlist); - tb = (ST_buffer *) scsi_init_malloc(i, priority); + tb = (ST_buffer *) kmalloc(i, priority); if (tb) { - tb->this_size = i; if (need_dma) priority |= GFP_DMA; /* Try to allocate the first segment up to ST_FIRST_ORDER and the others big enough to reach the goal */ - for (b_size = PAGE_SIZE << ST_FIRST_ORDER; - b_size / 2 >= st_buffer_size && b_size > PAGE_SIZE;) - b_size /= 2; - for (; b_size >= PAGE_SIZE; b_size /= 2) { + for (b_size = PAGE_SIZE, order=0; + b_size < st_buffer_size && order < ST_FIRST_ORDER; + order++, b_size *= 2) + ; + for ( ; b_size >= PAGE_SIZE; order--, b_size /= 2) { tb->sg[0].address = - (unsigned char *) scsi_init_malloc(b_size, priority); + (unsigned char *) __get_free_pages(priority, order); if (tb->sg[0].address != NULL) { tb->sg[0].alt_address = NULL; tb->sg[0].length = b_size; @@ -2948,30 +2948,33 @@ static ST_buffer * } } if (tb->sg[segs].address == NULL) { - scsi_init_free((char *) tb, tb->this_size); + kfree(tb); tb = NULL; } else { /* Got something, continue */ - for (b_size = PAGE_SIZE; + for (b_size = PAGE_SIZE, order=0; st_buffer_size > - tb->sg[0].length + (ST_FIRST_SG - 1) * b_size;) - b_size *= 2; - + tb->sg[0].length + (ST_FIRST_SG - 1) * b_size; + order++, b_size *= 2) + ; for (segs = 1, got = tb->sg[0].length; - got < st_buffer_size && segs < ST_FIRST_SG;) { + got < st_buffer_size && segs < ST_FIRST_SG;) { tb->sg[segs].address = - (unsigned char *) scsi_init_malloc(b_size, priority); + (unsigned char *) __get_free_pages(priority, + order); if (tb->sg[segs].address == NULL) { if (st_buffer_size - got <= (ST_FIRST_SG - segs) * b_size / 2) { b_size /= 2; /* Large enough for the rest of the buffers */ + order--; continue; } - for (i = 0; i < segs - 1; i++) - scsi_init_free(tb->sg[i].address, - tb->sg[i].length); - scsi_init_free((char *) tb, tb->this_size); + tb->sg_segs = segs; + tb->orig_sg_segs = 0; + DEB(tb->buffer_size = got); + normalize_buffer(tb); + kfree(tb); tb = NULL; break; } @@ -3011,7 +3014,7 @@ static ST_buffer * /* Try to allocate a temporary enlarged tape buffer */ static int enlarge_buffer(ST_buffer * STbuffer, int new_size, int need_dma) { - int segs, nbr, max_segs, b_size, priority, got; + int segs, nbr, max_segs, b_size, priority, order, got; normalize_buffer(STbuffer); @@ -3025,20 +3028,23 @@ static int enlarge_buffer(ST_buffer * STbuffer, int new_size, int need_dma) priority = GFP_KERNEL; if (need_dma) priority |= GFP_DMA; - for (b_size = PAGE_SIZE; b_size * nbr < new_size - STbuffer->buffer_size;) - b_size *= 2; + for (b_size = PAGE_SIZE, order=0; + b_size * nbr < new_size - STbuffer->buffer_size; + order++, b_size *= 2); for (segs = STbuffer->sg_segs, got = STbuffer->buffer_size; segs < max_segs && got < new_size;) { STbuffer->sg[segs].address = - (unsigned char *) scsi_init_malloc(b_size, priority); + (unsigned char *) __get_free_pages(priority, order); if (STbuffer->sg[segs].address == NULL) { if (new_size - got <= (max_segs - segs) * b_size / 2) { b_size /= 2; /* Large enough for the rest of the buffers */ + order--; continue; } printk(KERN_NOTICE "st: failed to enlarge buffer to %d bytes.\n", new_size); + DEB(STbuffer->buffer_size = got); normalize_buffer(STbuffer); return FALSE; } @@ -3060,16 +3066,20 @@ static int enlarge_buffer(ST_buffer * STbuffer, int new_size, int need_dma) /* Release the extra buffer */ static void normalize_buffer(ST_buffer * STbuffer) { - int i; + int i, order, b_size; for (i = STbuffer->orig_sg_segs; i < STbuffer->sg_segs; i++) { - scsi_init_free(STbuffer->sg[i].address, STbuffer->sg[i].length); + for (b_size=PAGE_SIZE, order=0; b_size < STbuffer->sg[i].length; + order++, b_size *= 2) + ; + free_pages((unsigned long)(STbuffer->sg[i].address), order); STbuffer->buffer_size -= STbuffer->sg[i].length; } DEB( if (debugging && STbuffer->orig_sg_segs < STbuffer->sg_segs) printk(ST_DEB_MSG "st: Buffer at %p normalized to %d bytes (segs %d).\n", - STbuffer->b_data, STbuffer->buffer_size, STbuffer->sg_segs); + STbuffer->sg[0].address, STbuffer->buffer_size, + STbuffer->sg_segs); ) /* end DEB */ STbuffer->sg_segs = STbuffer->orig_sg_segs; } @@ -3320,7 +3330,7 @@ static int st_registered = 0; /* Driver initialization (not __init because may be called later) */ static int st_init() { - int i; + int i, j; Scsi_Tape *STp; int target_nbr; @@ -3346,8 +3356,8 @@ static int st_init() if (st_template.dev_max > 128 / ST_NBR_MODES) printk(KERN_INFO "st: Only %d tapes accessible.\n", 128 / ST_NBR_MODES); scsi_tapes = - (Scsi_Tape *) scsi_init_malloc(st_template.dev_max * sizeof(Scsi_Tape), - GFP_ATOMIC); + (Scsi_Tape *) kmalloc(st_template.dev_max * sizeof(Scsi_Tape), + GFP_ATOMIC); if (scsi_tapes == NULL) { printk(KERN_ERR "Unable to allocate descriptors for SCSI tapes.\n"); unregister_chrdev(SCSI_TAPE_MAJOR, "st"); @@ -3361,21 +3371,30 @@ static int st_init() for (i = 0; i < st_template.dev_max; ++i) { STp = &(scsi_tapes[i]); STp->capacity = 0xfffff; - STp->mt_status = (struct mtget *) scsi_init_malloc(sizeof(struct mtget), - GFP_ATOMIC); + STp->mt_status = (struct mtget *) kmalloc(sizeof(struct mtget), + GFP_ATOMIC); + if (STp->mt_status == NULL) { + for (j=0; j < i; j++) + kfree(scsi_tapes[j].mt_status); + kfree(scsi_tapes); + unregister_chrdev(SCSI_TAPE_MAJOR, "st"); + return 1; + } /* Initialize status */ memset((void *) scsi_tapes[i].mt_status, 0, sizeof(struct mtget)); } /* Allocate the buffers */ st_buffers = - (ST_buffer **) scsi_init_malloc(st_template.dev_max * sizeof(ST_buffer *), - GFP_ATOMIC); + (ST_buffer **) kmalloc(st_template.dev_max * sizeof(ST_buffer *), + GFP_ATOMIC); if (st_buffers == NULL) { printk(KERN_ERR "Unable to allocate tape buffer pointers.\n"); unregister_chrdev(SCSI_TAPE_MAJOR, "st"); - scsi_init_free((char *) scsi_tapes, - st_template.dev_max * sizeof(Scsi_Tape)); + for (i=0; i < st_template.dev_max; i++) + kfree(scsi_tapes[i].mt_status); + kfree(scsi_tapes); + unregister_chrdev(SCSI_TAPE_MAJOR, "st"); return 1; } target_nbr = st_template.dev_noticed; @@ -3420,42 +3439,32 @@ static void st_detach(Scsi_Device * SDp) int __init init_module(void) { - int result; - validate_options(); st_template.module = &__this_module; - result = scsi_register_module(MODULE_SCSI_DEV, &st_template); - if (result) - return result; - - return 0; + return scsi_register_module(MODULE_SCSI_DEV, &st_template); } void cleanup_module(void) { - int i, j; + int i; scsi_unregister_module(MODULE_SCSI_DEV, &st_template); unregister_chrdev(SCSI_TAPE_MAJOR, "st"); st_registered--; if (scsi_tapes != NULL) { - scsi_init_free((char *) scsi_tapes, - st_template.dev_max * sizeof(Scsi_Tape)); - + for (i=0; i < st_template.dev_max; ++i) + kfree(scsi_tapes[i].mt_status); + kfree(scsi_tapes); if (st_buffers != NULL) { - for (i = 0; i < st_nbr_buffers; i++) - { + for (i = 0; i < st_nbr_buffers; i++) { if (st_buffers[i] != NULL) { - for (j = 0; j < st_buffers[i]->sg_segs; j++) - scsi_init_free((char *) st_buffers[i]->sg[j].address, - st_buffers[i]->sg[j].length); - scsi_init_free((char *) st_buffers[i], - st_buffers[i]->this_size); + st_buffers[i]->orig_sg_segs = 0; + normalize_buffer(st_buffers[i]); + kfree(st_buffers[i]); } } - scsi_init_free((char *) st_buffers, - st_template.dev_max * sizeof(ST_buffer *)); + kfree(st_buffers); } } st_template.dev_max = 0; diff --git a/drivers/scsi/st.h b/drivers/scsi/st.h index 9d5428e3f..479dca079 100644 --- a/drivers/scsi/st.h +++ b/drivers/scsi/st.h @@ -13,7 +13,6 @@ typedef struct { unsigned char in_use; unsigned char dma; /* DMA-able buffer */ - int this_size; /* allocated size of the structure */ int buffer_size; int buffer_blocks; int buffer_bytes; diff --git a/drivers/scsi/st_options.h b/drivers/scsi/st_options.h index cca951036..8cbc1c69e 100644 --- a/drivers/scsi/st_options.h +++ b/drivers/scsi/st_options.h @@ -1,9 +1,9 @@ /* The compile-time configurable defaults for the Linux SCSI tape driver. - Copyright 1995-1999 Kai Makisara. + Copyright 1995-2000 Kai Makisara. - Last modified: Sat Aug 7 13:42:21 1999 by makisara@kai.makisara.local + Last modified: Sat Jan 1 18:34:38 2000 by makisara@kai.makisara.local */ #ifndef _ST_OPTIONS_H diff --git a/drivers/telephony/ixj.c b/drivers/telephony/ixj.c index 6065dbcc1..8f3115cf5 100644 --- a/drivers/telephony/ixj.c +++ b/drivers/telephony/ixj.c @@ -34,7 +34,7 @@ static char ixj_c_rcsid[] = "$Id: ixj.c,v 3.4 1999/12/16 22:18:36 root Exp root #define MAXRINGS 5 #include - +#include #include #include #include /* printk() */ diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile index 6d08917a0..573c42946 100644 --- a/drivers/usb/Makefile +++ b/drivers/usb/Makefile @@ -10,16 +10,18 @@ L_TARGET := usb.a MOD_LIST_NAME := USB_MODULES ifeq ($(CONFIG_USB),y) - L_OBJS += usbcore.o + L_OBJS += usb-debug.o usb-core.o hub.o + LX_OBJS += usb.o ifeq ($(CONFIG_USB_PROC),y) L_OBJS += proc_usb.o endif endif ifeq ($(CONFIG_USB),m) M_OBJS += usbcore.o - MIX_OBJS += usb.o usb-debug.o usb-core.o + MI_OBJS += usb-debug.o usb-core.o hub.o + MIX_OBJS += usb.o ifeq ($(CONFIG_USB_PROC),y) - MIX_OBJS += proc_usb.o + MI_OBJS += proc_usb.o endif endif @@ -92,16 +94,6 @@ endif ifeq ($(CONFIG_USB_OV511),m) M_OBJS += ov511.o - MI_OBJS += ov511.o -endif - -ifeq ($(CONFIG_USB_OV511),y) - L_OBJS += ov511.o -endif - -ifeq ($(CONFIG_USB_OV511),m) - M_OBJS += ov511.o - MI_OBJS += ov511.o endif ifeq ($(CONFIG_USB_DC2XX),y) diff --git a/drivers/usb/acm.c b/drivers/usb/acm.c index fb3f8e1e9..ae392db7e 100644 --- a/drivers/usb/acm.c +++ b/drivers/usb/acm.c @@ -243,13 +243,10 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp) if (!acm->present) return -EINVAL; - if (acm->used++) { - MOD_INC_USE_COUNT; - return 0; - } - MOD_INC_USE_COUNT; + if (acm->used++) return 0; + if (usb_submit_urb(&acm->ctrlurb)) acm_debug("usb_submit_urb(ctrl irq) failed"); @@ -265,18 +262,18 @@ static void acm_tty_close(struct tty_struct *tty, struct file *filp) { struct acm *acm = tty->driver_data; - if (!ACM_READY(acm)) return; - - if (--acm->used) { - MOD_DEC_USE_COUNT; - return; - } - - acm_set_control(acm->ctrlout = 0, acm); - usb_unlink_urb(&acm->writeurb); - usb_unlink_urb(&acm->readurb); + if (!acm->used) return; MOD_DEC_USE_COUNT; + + if (--acm->used) return; + + if (acm->present) { + acm_set_control(acm->ctrlout = 0, acm); + usb_unlink_urb(&acm->ctrlurb); + usb_unlink_urb(&acm->writeurb); + usb_unlink_urb(&acm->readurb); + } } static int acm_tty_write(struct tty_struct *tty, int from_user, const unsigned char *buf, int count) @@ -348,7 +345,6 @@ static void *acm_probe(struct usb_device *dev, unsigned int ifnum) struct usb_endpoint_descriptor *epctrl, *epread, *epwrite; int readsize, ctrlsize, minor, i; unsigned char *buf; - char *s = NULL; for (minor = 0; minor < ACM_TTY_MINORS && (acm_table[minor].present || acm_table[minor].used); minor++); @@ -423,6 +419,8 @@ static void *acm_probe(struct usb_device *dev, unsigned int ifnum) usb_driver_claim_interface(&acm_driver, acm->cfg->interface + 0, acm); usb_driver_claim_interface(&acm_driver, acm->cfg->interface + 1, acm); + acm_set_control(acm->ctrlout, acm); + acm->present = 1; return acm; diff --git a/drivers/usb/hid.c b/drivers/usb/hid.c index 861c4424b..c028b7911 100644 --- a/drivers/usb/hid.c +++ b/drivers/usb/hid.c @@ -177,8 +177,8 @@ static int close_collection(struct hid_parser *parser) static unsigned hid_lookup_collection(struct hid_parser *parser, unsigned type) { - unsigned n; - for (n = parser->collection_stack_ptr; n; n--) + int n; + for (n = parser->collection_stack_ptr - 1; n >= 0; n--) if (parser->collection_stack[n].type == type) return parser->collection_stack[n].usage; return 0; /* we know nothing about this usage type */ @@ -296,7 +296,7 @@ static int hid_parser_global(struct hid_parser *parser, struct hid_item *item) case HID_GLOBAL_ITEM_TAG_POP: if (parser->global_stack_ptr > 0) { - memcpy(&parser->global, parser->global_stack + parser->global_stack_ptr--, + memcpy(&parser->global, parser->global_stack + --parser->global_stack_ptr, sizeof(struct hid_parser)); return 0; } @@ -970,13 +970,15 @@ static void hid_init_input(struct hid_device *hid) #if 1 { char rdata[rlen]; - struct urb urb = { - transfer_buffer: rdata, - actual_length: rlen, - context: hid - }; + struct urb urb; + memset(&urb, 0, sizeof(struct urb)); memset(rdata, 0, rlen); + + urb.transfer_buffer = rdata; + urb.actual_length = rlen; + urb.context = hid; + hid_debug("getting report type %d id %d len %d", report->type + 1, report->id, rlen); if ((read = usb_get_report(hid->dev, report->type + 1, report->id, hid->ifnum, rdata, rlen)) != rlen) { @@ -1184,6 +1186,11 @@ static struct usb_driver hid_driver = { }; #ifdef MODULE +void cleanup_module(void) +{ + usb_deregister(&hid_driver); +} + int init_module(void) #else int hid_init(void) @@ -1192,12 +1199,3 @@ int hid_init(void) usb_register(&hid_driver); return 0; } - -#ifdef MODULE -void module_cleanup(void) -#else -void hid_cleanup(void) -#endif -{ - usb_deregister(&hid_driver); -} diff --git a/drivers/usb/inits.h b/drivers/usb/inits.h deleted file mode 100644 index 5e7eff546..000000000 --- a/drivers/usb/inits.h +++ /dev/null @@ -1,26 +0,0 @@ -int usb_acm_init(void); -void usb_acm_cleanup(void); -int usb_audio_init(void); -int usb_cpia_init(void); -void usb_cpia_cleanup(void); -int usb_ov511_init(void); -void usb_ov511_cleanup(void); -int usb_dc2xx_init(void); -void usb_dc2xx_cleanup(void); -int usb_hub_init(void); -void usb_hub_cleanup(void); -void usb_major_init(void); -void usb_major_cleanup(void); -int usb_scanner_init(void); -void usb_scanner_cleanup(void); -int usb_printer_init(void); -int usb_scsi_init(void); -int usb_serial_init(void); -int dabusb_init(void); -void dabusb_cleanup(void); -int proc_usb_init(void); -void proc_usb_cleanup(void); -int hid_init(void); -int input_init(void); -int usb_mouse_init(void); -int usb_kbd_init(void); diff --git a/drivers/usb/uhci.c b/drivers/usb/uhci.c index 9b990fd2e..c071f5192 100644 --- a/drivers/usb/uhci.c +++ b/drivers/usb/uhci.c @@ -15,11 +15,6 @@ * $Id: uhci.c,v 1.149 1999/12/26 20:57:14 acher Exp $ */ - -#ifndef EXPORT_SYMTAB -#define EXPORT_SYMTAB -#endif - #include #include #include @@ -1807,7 +1802,6 @@ _static int process_interrupt (puhci_t s, purb_t purb) else { desc->hw.td.status &= ~TD_CTRL_IOC; // inactivate TD } - err: } return ret; diff --git a/drivers/usb/usb-core.c b/drivers/usb/usb-core.c dissimilarity index 68% index 978085ff2..2302d42a7 100644 --- a/drivers/usb/usb-core.c +++ b/drivers/usb/usb-core.c @@ -1,138 +1,138 @@ -/* - * driver/usb/usb-core.c - * - * (C) Copyright David Waite 1999 - * based on code from usb.c, by Linus Torvalds - * - * The purpose of this file is to pull any and all generic modular code from - * usb.c and put it in a separate file. This way usb.c is kept as a generic - * library, while this file handles starting drivers, etc. - * - */ -#include -#include -#include - -#include "inits.h" -#include "usb.h" - -#ifndef CONFIG_USB_MODULE -# ifdef CONFIG_USB_UHCI - int uhci_init(void); -# endif -# ifdef CONFIG_USB_OHCI_HCD - int ohci_hcd_init(void); -# endif -#endif - -int usb_init(void) -{ - usb_major_init(); -#ifdef CONFIG_USB_PROC - proc_usb_init(); -#endif - usb_hub_init(); - -#ifndef CONFIG_USB_MODULE -# ifdef CONFIG_USB_UHCI - uhci_init(); -# endif -# ifdef CONFIG_USB_OHCI_HCD - ohci_hcd_init(); -# endif -# ifdef CONFIG_USB_SCANNER - usb_scanner_init(); -# endif -# ifdef CONFIG_USB_AUDIO - usb_audio_init(); -# endif -# ifdef CONFIG_USB_ACM - usb_acm_init(); -# endif -# ifdef CONFIG_USB_PRINTER - usb_printer_init(); -# endif -# ifdef CONFIG_USB_SERIAL - usb_serial_init(); -# endif -# ifdef CONFIG_USB_CPIA - usb_cpia_init(); -# endif -# ifdef CONFIG_USB_OV511 - usb_ov511_init(); -# endif -# ifdef CONFIG_USB_DC2XX - usb_dc2xx_init(); -# endif -# ifdef CONFIG_USB_SCSI - usb_scsi_init(); -# endif -# ifdef CONFIG_USB_DABUSB - dabusb_init(); -# endif -# if defined(CONFIG_USB_HID) || defined(CONFIG_USB_MOUSE) || defined(CONFIG_USB_KBD) - input_init(); -# endif -# ifdef CONFIG_USB_HID - hid_init(); -# endif -# ifdef CONFIG_USB_MOUSE - usb_mouse_init(); -# endif -# ifdef CONFIG_USB_KBD - usb_kbd_init(); -# endif -#endif - return 0; -} - -/* - * Clean up when unloading the module - */ -void cleanup_drivers(void) -{ - usb_major_cleanup(); -#ifdef CONFIG_USB_PROC - proc_usb_cleanup (); -#endif - usb_hub_cleanup(); - -#ifndef MODULE -# ifdef CONFIG_USB_MOUSE - usb_mouse_cleanup(); -# endif -# ifdef CONFIG_USB_SCANNER - usb_scanner_cleanup(); -# endif -# ifdef CONFIG_USB_DABUSB - dabusb_cleanup(); -# endif -# ifdef CONFIG_USB_KBD - usb_kbd_cleanup(); -# endif -# ifdef CONFIG_USB_ACM - usb_acm_cleanup(); -# endif -# ifdef CONFIG_USB_CPIA - usb_cpia_cleanup(); -# endif -# ifdef CONFIG_USB_OV511 - usb_ov511_cleanup(); -# endif -# ifdef CONFIG_USB_DC2XX - usb_dc2xx_cleanup(); -# endif -#endif -} - -#ifdef MODULE -int init_module(void) -{ - return usb_init(); -} - -void cleanup_module(void) -{ - cleanup_drivers(); -} -#endif +/* + * driver/usb/usb-core.c + * + * (C) Copyright David Waite 1999 + * based on code from usb.c, by Linus Torvalds + * + * The purpose of this file is to pull any and all generic modular code from + * usb.c and put it in a separate file. This way usb.c is kept as a generic + * library, while this file handles starting drivers, etc. + * + */ + +#include +#include +#include + +#include "usb.h" + +/* + * USB core + */ + +int usb_hub_init(void); +void usb_hub_cleanup(void); +int usb_major_init(void); +void usb_major_cleanup(void); +int proc_usb_init(void); +void proc_usb_cleanup(void); + +/* + * USB device drivers + */ + +int usb_acm_init(void); +int usb_audio_init(void); +int usb_cpia_init(void); +int usb_ov511_init(void); +int usb_dc2xx_init(void); +int usb_scanner_init(void); +int usb_printer_init(void); +int usb_scsi_init(void); +int usb_serial_init(void); +int dabusb_init(void); +int hid_init(void); +int input_init(void); +int usb_mouse_init(void); +int usb_kbd_init(void); + +/* + * HCI drivers + */ + +int uhci_init(void); +int ohci_hcd_init(void); + +#ifdef MODULE + +/* + * Cleanup + */ + +void cleanup_module(void) +{ + usb_major_cleanup(); +#ifdef CONFIG_USB_PROC + proc_usb_cleanup (); +#endif + usb_hub_cleanup(); + +} + +/* + * Init + */ + +int init_module(void) +#else +int usb_init(void) +#endif +{ + usb_major_init(); +#ifdef CONFIG_USB_PROC + proc_usb_init(); +#endif + usb_hub_init(); + +#ifndef CONFIG_USB_MODULE +#ifdef CONFIG_USB_SCANNER + usb_scanner_init(); +#endif +#ifdef CONFIG_USB_AUDIO + usb_audio_init(); +#endif +#ifdef CONFIG_USB_ACM + usb_acm_init(); +#endif +#ifdef CONFIG_USB_PRINTER + usb_printer_init(); +#endif +#ifdef CONFIG_USB_SERIAL + usb_serial_init(); +#endif +#ifdef CONFIG_USB_CPIA + usb_cpia_init(); +#endif +#ifdef CONFIG_USB_OV511 + usb_ov511_init(); +#endif +#ifdef CONFIG_USB_DC2XX + usb_dc2xx_init(); +#endif +#ifdef CONFIG_USB_SCSI + usb_scsi_init(); +#endif +#ifdef CONFIG_USB_DABUSB + dabusb_init(); +#endif +#if defined(CONFIG_USB_HID) || defined(CONFIG_USB_MOUSE) || defined(CONFIG_USB_KBD) + input_init(); +#endif +#ifdef CONFIG_USB_HID + hid_init(); +#endif +#ifdef CONFIG_USB_MOUSE + usb_mouse_init(); +#endif +#ifdef CONFIG_USB_KBD + usb_kbd_init(); +#endif +#ifdef CONFIG_USB_UHCI + uhci_init(); +#endif +#ifdef CONFIG_USB_OHCI_HCD + ohci_hcd_init(); +#endif +#endif + return 0; +} diff --git a/drivers/usb/usb.c b/drivers/usb/usb.c index b9610f91f..8be60046a 100644 --- a/drivers/usb/usb.c +++ b/drivers/usb/usb.c @@ -18,10 +18,6 @@ * $Id: usb.c,v 1.39 1999/12/27 15:17:47 acher Exp $ */ -#ifndef EXPORT_SYMTAB -#define EXPORT_SYMTAB -#endif - #define USB_DEBUG 1 #include @@ -1724,12 +1720,13 @@ static struct file_operations usb_fops = { NULL /* release */ }; -void usb_major_init(void) +int usb_major_init(void) { if (register_chrdev(USB_MAJOR,"usb",&usb_fops)) { - printk("unable to get major %d for usb devices\n", - USB_MAJOR); + printk("unable to get major %d for usb devices\n", USB_MAJOR); + return -EBUSY; } + return 0; } void usb_major_cleanup(void) diff --git a/drivers/usb/usb.h b/drivers/usb/usb.h index 3e7c44dcc..6233b1601 100644 --- a/drivers/usb/usb.h +++ b/drivers/usb/usb.h @@ -169,9 +169,6 @@ struct usb_proc_setinterface { #define USB_PROC_SETINTERFACE _IOR('U', 4, struct usb_proc_setinterface) #define USB_PROC_SETCONFIGURATION _IOR('U', 5, unsigned int) - - - #ifdef __KERNEL__ #include @@ -180,19 +177,10 @@ struct usb_proc_setinterface { #define USB_MAJOR 180 -extern int usb_hub_init(void); -extern int usb_kbd_init(void); -extern int usb_cpia_init(void); -extern int usb_dc2xx_init(void); -extern int usb_mouse_init(void); -extern int usb_printer_init(void); - -extern void usb_hub_cleanup(void); -extern void usb_mouse_cleanup(void); - /* for 2.2-kernels */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) + static __inline__ void list_add_tail(struct list_head *new, struct list_head *head) { __list_add(new, head->prev, head); diff --git a/fs/devices.c b/fs/devices.c index b44acfacf..4c69112af 100644 --- a/fs/devices.c +++ b/fs/devices.c @@ -265,7 +265,7 @@ struct file_operations def_blk_fops = { NULL, /* release */ }; -struct inode_operations blkdev_inode_operations = { +static struct inode_operations blkdev_inode_operations = { &def_blk_fops, /* default file operations */ NULL, /* create */ NULL, /* lookup */ @@ -320,7 +320,7 @@ struct file_operations def_chr_fops = { NULL, /* release */ }; -struct inode_operations chrdev_inode_operations = { +static struct inode_operations chrdev_inode_operations = { &def_chr_fops, /* default file operations */ NULL, /* create */ NULL, /* lookup */ diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c index b11cae5ba..56433a343 100644 --- a/fs/devpts/inode.c +++ b/fs/devpts/inode.c @@ -284,10 +284,8 @@ static void devpts_read_inode(struct inode *inode) if ( ino >= sbi->max_ptys ) return; /* Bogus */ - inode->i_mode = S_IFCHR; - inode->i_rdev = MKDEV(0,0); /* Gets filled in by devpts_pty_new() */ - - inode->i_op = &chrdev_inode_operations; + /* Gets filled in by devpts_pty_new() */ + init_special_inode(inode,S_IFCHR,0); return; } diff --git a/fs/efs/inode.c b/fs/efs/inode.c index b6a2ad3fa..7ed3db6ad 100644 --- a/fs/efs/inode.c +++ b/fs/efs/inode.c @@ -131,16 +131,10 @@ void efs_read_inode(struct inode *inode) { inode->i_op = &efs_symlink_inode_operations; break; case S_IFCHR: - inode->i_rdev = device; - inode->i_op = &chrdev_inode_operations; - break; case S_IFBLK: - inode->i_rdev = device; - inode->i_op = &blkdev_inode_operations; - break; case S_IFIFO: - init_fifo(inode); - break; + init_special_inode(inode, inode->i_mode, device); + break; default: printk(KERN_WARNING "EFS: unsupported inode mode %o\n", inode->i_mode); goto read_inode_error; diff --git a/fs/openpromfs/inode.c b/fs/openpromfs/inode.c index f677594de..b09462b89 100644 --- a/fs/openpromfs/inode.c +++ b/fs/openpromfs/inode.c @@ -1,4 +1,4 @@ -/* $Id: inode.c,v 1.2 1999/12/27 07:13:38 anton Exp $ +/* $Id: inode.c,v 1.3 2000/01/04 10:02:29 jj Exp $ * openpromfs.c: /proc/openprom handling routines * * Copyright (C) 1996-1999 Jakub Jelinek (jakub@redhat.com) @@ -1097,6 +1097,7 @@ out_no_root: iput(root_inode); s->s_dev = 0; unlock_super(s); + MOD_DEC_USE_COUNT; return NULL; } diff --git a/fs/udf/inode.c b/fs/udf/inode.c index 05e03def5..dc9589609 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -1147,19 +1147,18 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh) } case FILE_TYPE_BLOCK: { - inode->i_op = &blkdev_inode_operations; inode->i_mode |= S_IFBLK; break; } case FILE_TYPE_CHAR: { - inode->i_op = &chrdev_inode_operations; inode->i_mode |= S_IFCHR; break; } case FILE_TYPE_FIFO: { - init_fifo(inode); + init_special_inode(inode, inode->i_mode|S_FIFO, 0); + break; } case FILE_TYPE_SYMLINK: { @@ -1185,9 +1184,9 @@ static void udf_fill_inode(struct inode *inode, struct buffer_head *bh) if (dsea) { - inode->i_rdev = to_kdev_t( - (le32_to_cpu(dsea->majorDeviceIdent)) << 8) | - (le32_to_cpu(dsea->minorDeviceIdent) & 0xFF); + init_special_inode(inode, inode->i_mode, + ((le32_to_cpu(dsea->majorDeviceIdent)) << 8) | + (le32_to_cpu(dsea->minorDeviceIdent) & 0xFF)); /* Developer ID ??? */ udf_release_data(tbh); } diff --git a/fs/udf/namei.c b/fs/udf/namei.c index ea921eeb3..ebf344832 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c @@ -702,24 +702,7 @@ int udf_mknod(struct inode * dir, struct dentry * dentry, int mode, int rdev) mark_inode_dirty(dir); dir->i_version = ++event; } - if (S_ISREG(inode->i_mode)) - { - inode->i_op = &udf_file_inode_operations; - } - else if (S_ISCHR(inode->i_mode)) - { - inode->i_op = &chrdev_inode_operations; - } - else if (S_ISBLK(inode->i_mode)) - { - inode->i_op = &blkdev_inode_operations; - } - else if (S_ISFIFO(inode->i_mode)) - { - init_fifo(inode); - } - if (S_ISBLK(mode) || S_ISCHR(mode)) - inode->i_rdev = to_kdev_t(rdev); + init_special_inode(inode, mode, rdev); mark_inode_dirty(inode); if (fibh.sbh != fibh.ebh) diff --git a/fs/ufs/namei.c b/fs/ufs/namei.c index 497f69867..33413b8cd 100644 --- a/fs/ufs/namei.c +++ b/fs/ufs/namei.c @@ -764,7 +764,7 @@ int ufs_symlink (struct inode * dir, struct dentry * dentry, err = -ENAMETOOLONG; l = strlen(symname)+1; - if (l > dir->i_sb->s_blocksize) + if (l > sb->s_blocksize) goto out; err = -EIO; @@ -774,8 +774,7 @@ int ufs_symlink (struct inode * dir, struct dentry * dentry, } inode->i_mode = S_IFLNK | S_IRWXUGO; - /***if (l > sizeof (inode->u.ufs_i.i_data)) {***/ - if (1) { + if (l > sb->u.ufs_sb.s_uspi->s_maxsymlinklen) { /* slow symlink */ inode->i_op = &ufs_symlink_inode_operations; err = block_symlink(inode, symname, l); diff --git a/fs/ufs/super.c b/fs/ufs/super.c index a3419a5a8..11a13baec 100644 --- a/fs/ufs/super.c +++ b/fs/ufs/super.c @@ -497,6 +497,7 @@ struct super_block * ufs_read_super (struct super_block * sb, void * data, uspi->s_fshift = 10; uspi->s_sbsize = super_block_size = 2048; uspi->s_sbbase = 0; + uspi->s_maxsymlinklen = 56; flags |= UFS_DE_OLD | UFS_UID_EFT | UFS_ST_SUN | UFS_CG_SUN; break; @@ -507,6 +508,7 @@ struct super_block * ufs_read_super (struct super_block * sb, void * data, uspi->s_fshift = 10; uspi->s_sbsize = super_block_size = 2048; uspi->s_sbbase = 0; + uspi->s_maxsymlinklen = 56; flags |= UFS_DE_OLD | UFS_UID_EFT | UFS_ST_SUNx86 | UFS_CG_SUN; break; @@ -760,6 +762,10 @@ magic_found: uspi->s_bpf = uspi->s_fsize << 3; uspi->s_bpfshift = uspi->s_fshift + 3; uspi->s_bpfmask = uspi->s_bpf - 1; + if ((sb->u.ufs_sb.s_mount_opt & UFS_MOUNT_UFSTYPE) == + UFS_MOUNT_UFSTYPE_44BSD) + uspi->s_maxsymlinklen = + SWAB32(usb3->fs_u2.fs_44.fs_maxsymlinklen); sb->u.ufs_sb.s_flags = flags; sb->u.ufs_sb.s_swab = swab; diff --git a/include/asm-sparc64/semaphore.h b/include/asm-sparc64/semaphore.h index 717f6a533..046385d3c 100644 --- a/include/asm-sparc64/semaphore.h +++ b/include/asm-sparc64/semaphore.h @@ -5,6 +5,7 @@ #ifdef __KERNEL__ #include +#include #include struct semaphore { diff --git a/include/linux/fs.h b/include/linux/fs.h index 7d584155f..b6099060f 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -749,14 +749,12 @@ extern int unregister_blkdev(unsigned int, const char *); extern int blkdev_open(struct inode *, struct file *); extern int blkdev_release (struct inode *); extern struct file_operations def_blk_fops; -extern struct inode_operations blkdev_inode_operations; /* fs/devices.c */ extern int register_chrdev(unsigned int, const char *, struct file_operations *); extern int unregister_chrdev(unsigned int, const char *); extern int chrdev_open(struct inode *, struct file *); extern struct file_operations def_chr_fops; -extern struct inode_operations chrdev_inode_operations; extern char * bdevname(kdev_t); extern char * cdevname(kdev_t); extern char * kdevname(kdev_t); diff --git a/include/linux/ufs_fs_sb.h b/include/linux/ufs_fs_sb.h index 2fc49e99f..ac9d9c03d 100644 --- a/include/linux/ufs_fs_sb.h +++ b/include/linux/ufs_fs_sb.h @@ -107,6 +107,8 @@ struct ufs_sb_private_info { __u32 s_bpf; /* bits per fragment */ __u32 s_bpfshift; /* bits per fragment shift*/ __u32 s_bpfmask; /* bits per fragment mask */ + + __u32 s_maxsymlinklen;/* upper limit on fast symlinks' size */ }; diff --git a/include/net/br.h b/include/net/br.h index 194b3bdc7..bfa25b645 100644 --- a/include/net/br.h +++ b/include/net/br.h @@ -1,3 +1,4 @@ +#include /* * Constants and structure definitions for the bridging code */ diff --git a/include/net/irda/irlmp_frame.h b/include/net/irda/irlmp_frame.h index 3df2aad31..779d34acc 100644 --- a/include/net/irda/irlmp_frame.h +++ b/include/net/irda/irlmp_frame.h @@ -26,6 +26,7 @@ #ifndef IRMLP_FRAME_H #define IRMLP_FRAME_H +#include #include #include diff --git a/kernel/ksyms.c b/kernel/ksyms.c index b401e8a53..8abd4876c 100644 --- a/kernel/ksyms.c +++ b/kernel/ksyms.c @@ -417,10 +417,7 @@ EXPORT_SYMBOL(clear_inode); EXPORT_SYMBOL(nr_async_pages); EXPORT_SYMBOL(___strtok); EXPORT_SYMBOL(init_special_inode); -EXPORT_SYMBOL(init_fifo); EXPORT_SYMBOL(fifo_inode_operations); -EXPORT_SYMBOL(chrdev_inode_operations); -EXPORT_SYMBOL(blkdev_inode_operations); EXPORT_SYMBOL(read_ahead); EXPORT_SYMBOL(get_hash_table); EXPORT_SYMBOL(get_empty_inode); diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index 19663d4b8..ded65eb9c 100644 --- a/net/irda/af_irda.c +++ b/net/irda/af_irda.c @@ -42,6 +42,7 @@ * ********************************************************************/ +#include #include #include #include diff --git a/net/irda/irlmp_event.c b/net/irda/irlmp_event.c index a9ef0c9cf..ace20d70e 100644 --- a/net/irda/irlmp_event.c +++ b/net/irda/irlmp_event.c @@ -23,6 +23,7 @@ * ********************************************************************/ +#include #include #include -- 2.11.4.GIT