From 635869f3d23bca34323a7b942cd1777d8f3cf3f8 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 23 Nov 2007 15:21:49 -0500 Subject: [PATCH] Linux 2.2.17pre12 o Fix PC300 X.21 support (Ivan Passos) o Smart2 driver minor fixes, one new card id (Charles White) o Fix PS/2 reconnect lockup on SMP (David Nelson) o Fix duplicate PCI ids (Tim Waugh) o Fix 100Mbit fdx on DEC45x driver (Phil Ezolt, Bill Carr) o Cyclades serial fixes (Ivan Passos) o Additional scsi blacklist entries (Matt Domsch) o Allow ppp deflate to be compiled in (Paul Gortmaker) o Fix i2o block multidrive bug I added in pre10 (Boji Kannanthanam) o Hopefully fix the scsi error handler/initrd bug (Alan Cox) o Small sparc power handling bugfix (Dave Miller) o Directory testing fix if CAP_DAC_READ_SEARCH (Wojciech Purczynski) o Export exec_usermodehelper, clean up baycom (Thomas Sailer) --- Documentation/cpqarray.txt | 1 + MAINTAINERS | 5 +- Makefile | 2 +- arch/sparc64/kernel/power.c | 6 +- drivers/block/cpqarray.c | 28 ++--- drivers/block/smart1,2.h | 7 +- drivers/char/cyclades.c | 201 +++++++++++++++++++++++------- drivers/char/pc_keyb.c | 17 ++- drivers/i2o/i2o_block.c | 12 +- drivers/net/Config.in | 4 +- drivers/net/Makefile | 24 ++-- drivers/net/bsd_comp.c | 30 +++-- drivers/net/de4x5.c | 1 + drivers/net/hamradio/baycom_epp.c | 60 +-------- drivers/net/pc300.c | 19 ++- drivers/net/ppp.c | 20 ++- drivers/net/ppp_deflate.c | 17 +-- drivers/scsi/scsi.c | 6 +- drivers/scsi/scsi_error.c | 6 +- fs/ext2/acl.c | 2 +- fs/namei.c | 2 +- fs/proc/inode.c | 2 +- fs/ufs/acl.c | 2 +- include/linux/kmod.h | 5 + include/linux/pci.h | 4 +- kernel/ksyms.c | 1 + 26 files changed, 305 insertions(+), 179 deletions(-) diff --git a/Documentation/cpqarray.txt b/Documentation/cpqarray.txt index 67db480cb4ee..db9846679d42 100644 --- a/Documentation/cpqarray.txt +++ b/Documentation/cpqarray.txt @@ -17,6 +17,7 @@ This driver is known to work with the following cards: * SA 4200 * SA 4250ES * SA 431 + * RAID LC2 Controller It should also work with some really old Disk array adapters, but I am unable to test against these cards: diff --git a/MAINTAINERS b/MAINTAINERS index f17a08b39ac7..cd389ad0f465 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -297,8 +297,9 @@ S: Maintained COMPAQ SMART2 RAID DRIVER P: Charles White M: Charles White -L: compaqandlinux@yps.org -S: Maintained +L: compaqandlinux@cpqlin.van-dijk.net +W: ftp.compaq.com/pub/products/drivers/linux +S: Supported DAC960 RAID DRIVER P: Leonard N. Zubkoff diff --git a/Makefile b/Makefile index 1fe230b6c49c..5fe6d2d0b791 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 2 SUBLEVEL = 17 -EXTRAVERSION = pre11 +EXTRAVERSION = pre12 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) diff --git a/arch/sparc64/kernel/power.c b/arch/sparc64/kernel/power.c index 4a6df9f49dbb..c0f470e97297 100644 --- a/arch/sparc64/kernel/power.c +++ b/arch/sparc64/kernel/power.c @@ -1,4 +1,4 @@ -/* $Id: power.c,v 1.3.2.1 1999/08/31 18:21:23 davem Exp $ +/* $Id: power.c,v 1.3.2.2 2000/07/11 22:42:09 davem Exp $ * power.c: Power management driver. * * Copyright (C) 1999 David S. Miller (davem@redhat.com) @@ -54,7 +54,7 @@ void machine_power_off(void) static int powerd(void *__unused) { static char *envp[] = { "HOME=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL }; - char *argv[] = { "/usr/bin/shutdown", "-h", "now", NULL }; + char *argv[] = { "/sbin/shutdown", "-h", "now", NULL }; current->session = 1; current->pgrp = 1; @@ -69,7 +69,7 @@ again: } /* Ok, down we go... */ - if (execve("/usr/bin/shutdown", argv, envp) < 0) { + if (execve("/sbin/shutdown", argv, envp) < 0) { printk("powerd: shutdown execution failed\n"); button_pressed = 0; goto again; diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c index 466730186be1..1e19249eb34d 100644 --- a/drivers/block/cpqarray.c +++ b/drivers/block/cpqarray.c @@ -41,8 +41,8 @@ #define SMART2_DRIVER_VERSION(maj,min,submin) ((maj<<16)|(min<<8)|(submin)) -#define DRIVER_NAME "Compaq SMART2 Driver (v 1.0.6)" -#define DRIVER_VERSION SMART2_DRIVER_VERSION(1,0,6) +#define DRIVER_NAME "Compaq SMART2 Driver (v 1.0.9)" +#define DRIVER_VERSION SMART2_DRIVER_VERSION(1,0,9) #define MAJOR_NR COMPAQ_SMART2_MAJOR #include #include @@ -70,7 +70,7 @@ static int eisa[8] = { 0, 0 ,0 ,0, 0, 0 ,0 ,0 }; * product = Marketing Name for the board * access = Address of the struct of function pointers */ -struct board_type products[] = { +static struct board_type products[] = { { 0x0040110E, "IDA", &smart1_access }, { 0x0140110E, "IDA-2", &smart1_access }, { 0x1040110E, "IAES", &smart1_access }, @@ -82,6 +82,7 @@ struct board_type products[] = { { 0x40330E11, "Smart Array 3100ES", &smart2_access }, { 0x40340E11, "Smart Array 221", &smart2_access }, { 0x40400E11, "Integrated Array", &smart4_access }, + { 0x40480E11, "Compaq Raid LC2", &smart4_access }, { 0x40500E11, "Smart Array 4200", &smart4_access }, { 0x40510E11, "Smart Array 4250ES", &smart4_access }, { 0x40580E11, "Smart Array 431", &smart4_access }, @@ -93,7 +94,7 @@ static int * ida_blocksizes; static int * ida_hardsizes; static struct gendisk ida_gendisk[MAX_CTLR]; -struct proc_dir_entry *proc_array = NULL; +static struct proc_dir_entry *proc_array = NULL; /* Debug... */ #define DBG(s) do { s } while(0) @@ -847,8 +848,10 @@ static inline cmdlist_t *removeQ(cmdlist_t **Qptr, cmdlist_t *c) /* * Get a request and submit it to the controller. - * This routine needs to grab all the requests it possibly can from the - * req Q and submit them. Interrupts are off (and need to be off) when you + * This routine needs to grab one requests and submits it. We would like + * to grab all possible requests, but there is a danger of holding the + * io_request lock to long. + * Interrupts are off (and need to be off) when you * are in here (either via the dummy do_ida_request functions or by being * called from the interrupt handler */ @@ -1005,28 +1008,24 @@ static inline void complete_buffers(struct buffer_head *bh, int ok) */ static inline void complete_command(cmdlist_t *cmd, int timeout) { - char buf[80]; int ok=1; if (cmd->req.hdr.rcode & RCODE_NONFATAL && (hba[cmd->ctlr]->misc_tflags & MISC_NONFATAL_WARN) == 0) { - sprintf(buf, "Non Fatal error on ida/c%dd%d\n", + printk(KERN_WARNING "Non Fatal error on ida/c%dd%d\n", cmd->ctlr, cmd->hdr.unit); - console_print(buf); hba[cmd->ctlr]->misc_tflags |= MISC_NONFATAL_WARN; } if (cmd->req.hdr.rcode & RCODE_FATAL) { - sprintf(buf, "Fatal error on ida/c%dd%d\n", + printk(KERN_WARNING "Fatal error on ida/c%dd%d\n", cmd->ctlr, cmd->hdr.unit); - console_print(buf); ok = 0; } if (cmd->req.hdr.rcode & RCODE_INVREQ) { - sprintf(buf, "Invalid request on ida/c%dd%d = (cmd=%x sect=%d cnt=%d sg=%d ret=%x)\n", + printk(KERN_WARNING "Invalid request on ida/c%dd%d = (cmd=%x sect=%d cnt=%d sg=%d ret=%x)\n", cmd->ctlr, cmd->hdr.unit, cmd->req.hdr.cmd, cmd->req.hdr.blk, cmd->req.hdr.blk_cnt, cmd->req.hdr.sg_cnt, cmd->req.hdr.rcode); - console_print(buf); ok = 0; } if (timeout) ok = 0; @@ -1586,7 +1585,8 @@ static void start_fwbk(int ctlr) id_ctlr_t *id_ctlr_buf; int ret_code; - if( hba[ctlr]->board_id != 0x40400E11) + if( (hba[ctlr]->board_id != 0x40400E11) + && (hba[ctlr]->board_id != 0x40480E11) ) /* Not a Integrated Raid, so there is nothing for us to do */ return; printk(KERN_DEBUG "cpqarray: Starting firmware's background" diff --git a/drivers/block/smart1,2.h b/drivers/block/smart1,2.h index 221e4a5f3d77..015980013729 100644 --- a/drivers/block/smart1,2.h +++ b/drivers/block/smart1,2.h @@ -62,13 +62,14 @@ static void smart4_intr_mask(ctlr_info_t *h, unsigned long val) } /* - * For this card fifo is full if reading this port returns 0! + * For older cards FIFO Full = 0. + * On this card 0 means there is room, anything else FIFO Full. * */ static unsigned long smart4_fifo_full(ctlr_info_t *h) { - return (~readl(h->vaddr + S42XX_REQUEST_PORT_OFFSET)); + return (!readl(h->vaddr + S42XX_REQUEST_PORT_OFFSET)); } /* This type of controller returns -1 if the fifo is empty, @@ -81,7 +82,7 @@ static unsigned long smart4_completed(ctlr_info_t *h) = readl(h->vaddr + S42XX_REPLY_PORT_OFFSET); /* Fifo is empty */ - if( register_value == -1) + if( register_value == 0xffffffff) return 0; /* Need to let it know we got the reply */ diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c index 14209e8cbea8..54b0bbde3ff5 100644 --- a/drivers/char/cyclades.c +++ b/drivers/char/cyclades.c @@ -1,7 +1,8 @@ #undef BLOCKMOVE #define Z_WAKE +#undef Z_EXT_CHARS_IN_BUFFER static char rcsid[] = -"$Revision: 2.3.2.6 $$Date: 2000/05/05 13:56:05 $"; +"$Revision: 2.3.2.8 $$Date: 2000/07/06 18:14:16 $"; /* * linux/drivers/char/cyclades.c @@ -24,6 +25,17 @@ static char rcsid[] = * This version supports shared IRQ's (only for PCI boards). * * $Log: cyclades.c,v $ + * Revision 2.3.2.8 2000/07/06 18:14:16 ivan + * Fixed the PCI detection function to work properly on Alpha systems. + * Implemented support for TIOCSERGETLSR ioctl. + * Implemented full support for non-standard baud rates. + * + * Revision 2.3.2.7 2000/06/01 18:26:34 ivan + * Request PLX I/O region, although driver doesn't use it, to avoid + * problems with other drivers accessing it. + * Removed count for on-board buffer characters in cy_chars_in_buffer + * (Cyclades-Z only). + * * Revision 2.3.2.6 2000/05/05 13:56:05 ivan * Driver now reports physical instead of virtual memory addresses. * Masks were added to some Cyclades-Z read accesses. @@ -634,6 +646,7 @@ static char rcsid[] = #include #include #include +#include #include #include @@ -1365,9 +1378,16 @@ cyy_interrupt(int irq, void *dev_id, struct pt_regs *regs) while (char_count-- > 0){ if (!info->xmit_cnt){ - cy_writeb((u_long)base_addr+(CySRER<xmit_buf == 0){ @@ -3133,12 +3153,15 @@ cy_chars_in_buffer(struct tty_struct *tty) card = info->card; channel = (info->line) - (cy_card[card].first_line); +#ifdef Z_EXT_CHARS_IN_BUFFER if (!IS_CYC_Z(cy_card[card])) { +#endif /* Z_EXT_CHARS_IN_BUFFER */ #ifdef CY_DEBUG_IO printk("cyc:cy_chars_in_buffer ttyC%d %d\n", info->line, info->xmit_cnt); /* */ #endif return info->xmit_cnt; +#ifdef Z_EXT_CHARS_IN_BUFFER } else { static volatile struct FIRM_ID *firm_id; static volatile struct ZFW_CTRL *zfw_ctrl; @@ -3167,6 +3190,7 @@ cy_chars_in_buffer(struct tty_struct *tty) #endif return (info->xmit_cnt + char_count); } +#endif /* Z_EXT_CHARS_IN_BUFFER */ } /* cy_chars_in_buffer */ @@ -3176,6 +3200,30 @@ cy_chars_in_buffer(struct tty_struct *tty) * ------------------------------------------------------------ */ +static void +cyy_baud_calc(struct cyclades_port *info, uclong baud) +{ + int co, co_val, bpr; + uclong cy_clock = ((info->chip_rev >= CD1400_REV_J) ? 60000000 : 25000000); + + if (baud == 0) { + info->tbpr = info->tco = info->rbpr = info->rco = 0; + return; + } + + /* determine which prescaler to use */ + for (co = 4, co_val = 2048; co; co--, co_val >>= 2) { + if (cy_clock / co_val / baud > 63) + break; + } + + bpr = (cy_clock / co_val * 2 / baud + 1) / 2; + if (bpr > 255) + bpr = 255; + + info->tbpr = info->rbpr = bpr; + info->tco = info->rco = co; +} /* * This routine finds or computes the various line characteristics. @@ -3189,7 +3237,7 @@ set_line_char(struct cyclades_port * info) int card,chip,channel,index; unsigned cflag, iflag; unsigned short chip_number; - int baud; + int baud, baud_rate = 0; int i; @@ -3225,12 +3273,14 @@ set_line_char(struct cyclades_port * info) index = cy_card[card].bus_index; /* baud rate */ - if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) { - baud = info->baud; - } else { - baud = tty_get_baud_rate(info->tty); - } - if (baud > CD1400_MAX_SPEED) { + baud = tty_get_baud_rate(info->tty); + if ((baud == 38400) && + ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST)) { + if (info->custom_divisor) + baud_rate = info->baud / info->custom_divisor; + else + baud_rate = info->baud; + } else if (baud > CD1400_MAX_SPEED) { baud = CD1400_MAX_SPEED; } /* find the baud index */ @@ -3243,22 +3293,29 @@ set_line_char(struct cyclades_port * info) i = 19; /* CD1400_MAX_SPEED */ } - - if(info->chip_rev >= CD1400_REV_J) { - /* It is a CD1400 rev. J or later */ - info->tbpr = baud_bpr_60[i]; /* Tx BPR */ - info->tco = baud_co_60[i]; /* Tx CO */ - info->rbpr = baud_bpr_60[i]; /* Rx BPR */ - info->rco = baud_co_60[i]; /* Rx CO */ + if ((baud == 38400) && + ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST)) { + cyy_baud_calc(info, baud_rate); } else { - info->tbpr = baud_bpr_25[i]; /* Tx BPR */ - info->tco = baud_co_25[i]; /* Tx CO */ - info->rbpr = baud_bpr_25[i]; /* Rx BPR */ - info->rco = baud_co_25[i]; /* Rx CO */ + if(info->chip_rev >= CD1400_REV_J) { + /* It is a CD1400 rev. J or later */ + info->tbpr = baud_bpr_60[i]; /* Tx BPR */ + info->tco = baud_co_60[i]; /* Tx CO */ + info->rbpr = baud_bpr_60[i]; /* Rx BPR */ + info->rco = baud_co_60[i]; /* Rx CO */ + } else { + info->tbpr = baud_bpr_25[i]; /* Tx BPR */ + info->tco = baud_co_25[i]; /* Tx CO */ + info->rbpr = baud_bpr_25[i]; /* Rx BPR */ + info->rco = baud_co_25[i]; /* Rx CO */ + } } if (baud_table[i] == 134) { - info->timeout = (info->xmit_fifo_size*HZ*15/269) + 2; /* get it right for 134.5 baud */ + info->timeout = (info->xmit_fifo_size*HZ*30/269) + 2; + } else if ((baud == 38400) && + ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST)) { + info->timeout = (info->xmit_fifo_size*HZ*15/baud_rate) + 2; } else if (baud_table[i]) { info->timeout = (info->xmit_fifo_size*HZ*15/baud_table[i]) + 2; /* this needs to be propagated into the card info */ @@ -3447,19 +3504,24 @@ set_line_char(struct cyclades_port * info) buf_ctrl = &zfw_ctrl->buf_ctrl[channel]; /* baud rate */ - if ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) { - baud = info->baud; - } else { - baud = tty_get_baud_rate(info->tty); - } - if (baud > CYZ_MAX_SPEED) { + baud = tty_get_baud_rate(info->tty); + if ((baud == 38400) && + ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST)) { + if (info->custom_divisor) + baud_rate = info->baud / info->custom_divisor; + else + baud_rate = info->baud; + } else if (baud > CYZ_MAX_SPEED) { baud = CYZ_MAX_SPEED; } cy_writel(&ch_ctrl->comm_baud , baud); if (baud == 134) { - info->timeout = (info->xmit_fifo_size*HZ*30/269) + 2; /* get it right for 134.5 baud */ + info->timeout = (info->xmit_fifo_size*HZ*30/269) + 2; + } else if ((baud == 38400) && + ((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST)) { + info->timeout = (info->xmit_fifo_size*HZ*15/baud_rate) + 2; } else if (baud) { info->timeout = (info->xmit_fifo_size*HZ*15/baud) + 2; /* this needs to be propagated into the card info */ @@ -3549,8 +3611,6 @@ set_line_char(struct cyclades_port * info) clear_bit(TTY_IO_ERROR, &info->tty->flags); } } - - } /* set_line_char */ @@ -3571,7 +3631,7 @@ get_serial_info(struct cyclades_port * info, tmp.flags = info->flags; tmp.close_delay = info->close_delay; tmp.baud_base = info->baud; - tmp.custom_divisor = 0; /*!!!*/ + tmp.custom_divisor = info->custom_divisor; tmp.hub6 = 0; /*!!!*/ return copy_to_user(retinfo,&tmp,sizeof(*retinfo))?-EFAULT:0; } /* get_serial_info */ @@ -3597,6 +3657,7 @@ set_serial_info(struct cyclades_port * info, info->flags = ((info->flags & ~ASYNC_USR_MASK) | (new_serial.flags & ASYNC_USR_MASK)); info->baud = new_serial.baud_base; + info->custom_divisor = new_serial.custom_divisor; goto check_and_exit; } @@ -3607,6 +3668,7 @@ set_serial_info(struct cyclades_port * info, */ info->baud = new_serial.baud_base; + info->custom_divisor = new_serial.custom_divisor; info->flags = ((info->flags & ~ASYNC_FLAGS) | (new_serial.flags & ASYNC_FLAGS)); info->close_delay = new_serial.close_delay * HZ/100; @@ -3621,6 +3683,43 @@ check_and_exit: } } /* set_serial_info */ +/* + * get_lsr_info - get line status register info + * + * Purpose: Let user call ioctl() to get info when the UART physically + * is emptied. On bus types like RS485, the transmitter must + * release the bus after transmitting. This must be done when + * the transmit shift register is empty, not be done when the + * transmit holding register is empty. This functionality + * allows an RS485 driver to be written in user space. + */ +static int get_lsr_info(struct cyclades_port *info, unsigned int *value) +{ + int card, chip, channel, index; + unsigned char status; + unsigned int result; + unsigned long flags; + unsigned char *base_addr; + + card = info->card; + channel = (info->line) - (cy_card[card].first_line); + if (!IS_CYC_Z(cy_card[card])) { + chip = channel>>2; + channel &= 0x03; + index = cy_card[card].bus_index; + base_addr = (unsigned char *) + (cy_card[card].base_addr + (cy_chip_offset[chip]<irq; cy_pci_phys0 = pdev->base_address[0]; + cy_pci_phys1 = pdev->base_address[1]; cy_pci_phys2 = pdev->base_address[2]; pci_read_config_byte(pdev, PCI_REVISION_ID, &cyy_rev_id); @@ -4913,6 +5016,7 @@ cy_detect_pci(void)) (ulong)cy_pci_phys2, (ulong)cy_pci_phys0); #endif cy_pci_phys0 &= PCI_BASE_ADDRESS_MEM_MASK; + cy_pci_phys1 &= PCI_BASE_ADDRESS_IO_MASK; cy_pci_phys2 &= PCI_BASE_ADDRESS_MEM_MASK; if (cy_pci_phys2 & ~PCI_BASE_ADDRESS_IO_MASK) { @@ -4921,6 +5025,11 @@ cy_detect_pci(void)) cy_pci_phys2 &= PCI_BASE_ADDRESS_IO_MASK; } + /* Although we don't use this I/O region, we should + request it from the kernel anyway, to avoid problems + with other drivers accessing it. */ + request_region(cy_pci_phys1, CyPCI_Yctl, "Cyclom-Y"); + #if defined(__alpha__) if (device_id == PCI_DEVICE_ID_CYCLOM_Y_Lo) { /* below 1M? */ printk("Cyclom-Y/PCI (bus=0x0%x, pci_id=0x%x, ", @@ -4934,10 +5043,9 @@ cy_detect_pci(void)) i--; continue; } -#else +#endif cy_pci_addr0 = (ulong)ioremap(cy_pci_phys0, CyPCI_Yctl); cy_pci_addr2 = (ulong)ioremap(cy_pci_phys2, CyPCI_Ywin); -#endif #ifdef CY_PCI_DEBUG printk("Cyclom-Y/PCI: relocate winaddr=0x%lx ctladdr=0x%lx\n", @@ -5046,6 +5154,7 @@ cy_detect_pci(void)) (ulong)cy_pci_phys2, (ulong)cy_pci_phys0); #endif cy_pci_phys0 &= PCI_BASE_ADDRESS_MEM_MASK; + cy_pci_phys1 &= PCI_BASE_ADDRESS_IO_MASK; cy_pci_phys2 &= PCI_BASE_ADDRESS_MEM_MASK; if (cy_pci_phys2 & ~PCI_BASE_ADDRESS_IO_MASK) { @@ -5053,9 +5162,13 @@ cy_detect_pci(void)) "Ignoring it...\n"); cy_pci_phys2 &= PCI_BASE_ADDRESS_IO_MASK; } -#if !defined(__alpha__) - cy_pci_addr0 = (ulong)ioremap(cy_pci_phys0, CyPCI_Zctl); -#endif + + /* Although we don't use this I/O region, we should + request it from the kernel anyway, to avoid problems + with other drivers accessing it. */ + request_region(cy_pci_phys1, CyPCI_Zctl, "Cyclades-Z"); + + cy_pci_addr0 = (ulong)ioremap(cy_pci_phys0, CyPCI_Zctl); /* Disable interrupts on the PLX before resetting it */ cy_writew(cy_pci_addr0+0x68, @@ -5071,9 +5184,7 @@ cy_detect_pci(void)) mailbox = (uclong)cy_readl(&((struct RUNTIME_9060 *) cy_pci_addr0)->mail_box_0); if (mailbox == ZE_V1) { -#if !defined(__alpha__) - cy_pci_addr2 = (ulong)ioremap(cy_pci_phys2, CyPCI_Ze_win); -#endif + cy_pci_addr2 = (ulong)ioremap(cy_pci_phys2, CyPCI_Ze_win); if (ZeIndex == NR_CARDS) { printk("Cyclades-Ze/PCI found at 0x%lx ", (ulong)cy_pci_phys2); @@ -5090,9 +5201,7 @@ cy_detect_pci(void)) i--; continue; } else { -#if !defined(__alpha__) - cy_pci_addr2 = (ulong)ioremap(cy_pci_phys2, CyPCI_Zwin); -#endif + cy_pci_addr2 = (ulong)ioremap(cy_pci_phys2, CyPCI_Zwin); } #ifdef CY_PCI_DEBUG @@ -5531,6 +5640,7 @@ cy_init(void)) info->tco = 0; info->rbpr = 0; info->rco = 0; + info->custom_divisor = 0; info->close_delay = 5*HZ/10; info->closing_wait = CLOSING_WAIT_DELAY; info->icount.cts = info->icount.dsr = @@ -5589,6 +5699,7 @@ cy_init(void)) info->cor3 = 0x08; /* _very_ small rcv threshold */ info->cor4 = 0; info->cor5 = 0; + info->custom_divisor = 0; info->close_delay = 5*HZ/10; info->closing_wait = CLOSING_WAIT_DELAY; info->icount.cts = info->icount.dsr = diff --git a/drivers/char/pc_keyb.c b/drivers/char/pc_keyb.c index d7090479257e..1a033c5845fb 100644 --- a/drivers/char/pc_keyb.c +++ b/drivers/char/pc_keyb.c @@ -401,15 +401,14 @@ static inline void handle_mouse_event(unsigned char scancode) } else if(scancode == AUX_RECONNECT){ queue->head = queue->tail = 0; /* Flush input queue */ - /* - * need this stuff? seems to work fine w/o it for me - aux_write_ack(AUX_SET_SAMPLE); - aux_write_ack(100); - aux_write_ack(AUX_SET_RES); - aux_write_ack(3); - aux_write_ack(AUX_SET_SCALE21); - */ - aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */ + /* ping the mouse :) */ + kb_wait(); + kbd_write_command(KBD_CCMD_WRITE_MOUSE); + kb_wait(); + kbd_write_output(AUX_ENABLE_DEV); + /* we expect an ACK in response. */ + mouse_reply_expected++; + kb_wait(); return; } diff --git a/drivers/i2o/i2o_block.c b/drivers/i2o/i2o_block.c index f91b10e0845d..e5ef5dd322a2 100644 --- a/drivers/i2o/i2o_block.c +++ b/drivers/i2o/i2o_block.c @@ -1227,8 +1227,14 @@ static int i2ob_scan(int bios) else b = c->devices; - for (d=b;d!=NULL;d=d->next) + while(b != NULL) { + d=b; + if(bios) + b = b->next; + else + b = b->prev; + if(d->lct_data.class_id!=I2O_CLASS_RANDOM_BLOCK_STORAGE) continue; if(d->lct_data.user_tid != 0xFFF) @@ -1303,7 +1309,7 @@ static void i2ob_probe(void) /* * Now the remainder. */ - + printk(KERN_INFO "i2o_block: Checking for I2O Block devices...\n"); i2ob_scan(0); } @@ -1651,7 +1657,7 @@ int i2o_block_init(void) * Finally see what is actually plugged in to our controllers */ i2ob_probe(); - + return 0; } diff --git a/drivers/net/Config.in b/drivers/net/Config.in index 9a0101a1533d..f849cc13dc78 100644 --- a/drivers/net/Config.in +++ b/drivers/net/Config.in @@ -225,8 +225,8 @@ if [ ! "$CONFIG_PARPORT" = "n" ]; then fi tristate 'PPP (point-to-point) support' CONFIG_PPP -if [ ! "$CONFIG_PPP" = "n" ]; then - comment 'CCP compressors for PPP are only built as modules.' +if [ "$CONFIG_PPP" = "y" ]; then + comment 'CCP compressors for PPP will also be built in.' fi tristate 'SLIP (serial line) support' CONFIG_SLIP diff --git a/drivers/net/Makefile b/drivers/net/Makefile index 7b9856483ea2..307608ede011 100644 --- a/drivers/net/Makefile +++ b/drivers/net/Makefile @@ -22,6 +22,8 @@ CONFIG_8390_BUILTIN := CONFIG_8390_MODULE := CONFIG_SLHC_BUILTIN := CONFIG_SLHC_MODULE := +CONFIG_BSDCOMP_BUILTIN := +CONFIG_BSDCOMP_MODULE := CONFIG_PPPDEF_BUILTIN := CONFIG_PPPDEF_MODULE := CONFIG_7990_BUILTIN := @@ -35,12 +37,14 @@ CONFIG_SYNCPPP_MODULE := ifeq ($(CONFIG_ISDN),y) ifeq ($(CONFIG_ISDN_PPP),y) + CONFIG_BSDCOMP_BUILTIN = y CONFIG_SLHC_BUILTIN = y CONFIG_PPPDEF_BUILTIN = y endif else ifeq ($(CONFIG_ISDN),m) ifeq ($(CONFIG_ISDN_PPP),y) + CONFIG_BSDCOMP_MODULE = y CONFIG_SLHC_MODULE = y CONFIG_PPPDEF_MODULE = y endif @@ -311,19 +315,17 @@ else endif endif -# bsd_comp.o is *always* a module, for some documented reason -# (licensing). ifeq ($(CONFIG_PPP),y) LX_OBJS += ppp.o -M_OBJS += bsd_comp.o +CONFIG_BSDCOMP_BUILTIN = y CONFIG_SLHC_BUILTIN = y CONFIG_PPPDEF_BUILTIN = y else ifeq ($(CONFIG_PPP),m) + CONFIG_BSDCOMP_MODULE = y CONFIG_SLHC_MODULE = y CONFIG_PPPDEF_MODULE = y MX_OBJS += ppp.o - M_OBJS += bsd_comp.o endif endif @@ -1022,6 +1024,16 @@ else endif endif +# If anything built-in uses bsd_comp, then build it into the kernel also. +# If not, but a module uses it, build as a module. +ifdef CONFIG_BSDCOMP_BUILTIN +LX_OBJS += bsd_comp.o +else + ifdef CONFIG_BSDCOMP_MODULE + MX_OBJS += bsd_comp.o + endif +endif + # If anything built-in uses slhc, then build it into the kernel also. # If not, but a module uses it, build as a module. ifdef CONFIG_SLHC_BUILTIN @@ -1034,10 +1046,8 @@ endif # if anything built-in uses ppp_deflate, then build it into the kernel also. # If not, but a module uses it, build as a module. -# ... NO!!! ppp_deflate.o does not work as resident; -# it works only as a module! ifdef CONFIG_PPPDEF_BUILTIN -MX_OBJS += ppp_deflate.o +LX_OBJS += ppp_deflate.o else ifdef CONFIG_PPPDEF_MODULE MX_OBJS += ppp_deflate.o diff --git a/drivers/net/bsd_comp.c b/drivers/net/bsd_comp.c index 073a7392ab2b..fe57e6e1c1da 100644 --- a/drivers/net/bsd_comp.c +++ b/drivers/net/bsd_comp.c @@ -1,3 +1,11 @@ +/* + * Update: The Berkeley copyright was changed, and the change + * is retroactive to all "true" BSD software (ie everything + * from UCB as opposed to other peoples code that just carried + * the same license). The new copyright doesn't clash with the + * GPL, so the module-only restriction has been removed.. + */ + /* Because this code is derived from the 4.3BSD compress source: * * Copyright (c) 1985, 1986 The Regents of the University of California. @@ -53,12 +61,9 @@ * From: bsd_comp.c,v 1.3 1994/12/08 01:59:58 paulus Exp */ -#ifndef MODULE -#error This file must be compiled as a module. -#endif - #include #include +#include #include #include #include @@ -1173,12 +1178,7 @@ static struct compressor ppp_bsd_compress = { bsd_comp_stats /* decomp_stat */ }; -/************************************************************* - * Module support routines - *************************************************************/ - -int -init_module(void) +__initfunc(int bsd_comp_install(void)) { int answer = ppp_register_compressor (&ppp_bsd_compress); if (answer == 0) @@ -1186,8 +1186,18 @@ init_module(void) return answer; } +#ifdef MODULE + +int +init_module(void) +{ + return bsd_comp_install(); +} + void cleanup_module(void) { ppp_unregister_compressor (&ppp_bsd_compress); } + +#endif /* MODULE */ diff --git a/drivers/net/de4x5.c b/drivers/net/de4x5.c index 0bd71464f6e5..2f9eb5bded51 100644 --- a/drivers/net/de4x5.c +++ b/drivers/net/de4x5.c @@ -3242,6 +3242,7 @@ srom_map_media(struct device *dev) case ANS: lp->media = ANS; + lp->fdx = lp->params.fdx; break; default: diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c index e14fb89304c7..081ff57638ef 100644 --- a/drivers/net/hamradio/baycom_epp.c +++ b/drivers/net/hamradio/baycom_epp.c @@ -51,12 +51,14 @@ #include #include #include +#include #include #include #include #include //#include #include +#include #include #include #include @@ -70,56 +72,6 @@ /* --------------------------------------------------------------------- */ -/* - * currently this module is supposed to support both module styles, i.e. - * the old one present up to about 2.1.9, and the new one functioning - * starting with 2.1.21. The reason is I have a kit allowing to compile - * this module also under 2.0.x which was requested by several people. - * This will go in 2.2 - */ -#include - -#if LINUX_VERSION_CODE >= 0x20100 -#include -#else -#include -#include - -#undef put_user -#undef get_user - -#define put_user(x,ptr) ({ __put_user((unsigned long)(x),(ptr),sizeof(*(ptr))); 0; }) -#define get_user(x,ptr) ({ x = ((__typeof__(*(ptr)))__get_user((ptr),sizeof(*(ptr)))); 0; }) - -extern inline int copy_from_user(void *to, const void *from, unsigned long n) -{ - int i = verify_area(VERIFY_READ, from, n); - if (i) - return i; - memcpy_fromfs(to, from, n); - return 0; -} - -extern inline int copy_to_user(void *to, const void *from, unsigned long n) -{ - int i = verify_area(VERIFY_WRITE, to, n); - if (i) - return i; - memcpy_tofs(to, from, n); - return 0; -} -#endif - -#if LINUX_VERSION_CODE >= 0x20123 -#include -#else -#define __init -#define __initdata -#define __initfunc(x) x -#endif - -/* --------------------------------------------------------------------- */ - #define BAYCOM_DEBUG #define BAYCOM_MAGIC 19730510 @@ -455,12 +407,8 @@ static int exec_eppfpga(void *b) sprintf(portarg, "%ld", bc->pdev->port->base); printk(KERN_DEBUG "%s: %s -s -p %s -m %s\n", bc_drvname, eppconfig_path, portarg, modearg); - for (i = 0; i < current->files->max_fds; i++ ) - if (current->files->fd[i]) - close(i); - set_fs(KERNEL_DS); /* Allow execve args to be in kernel space. */ - current->uid = current->euid = current->fsuid = 0; - if (execve(eppconfig_path, argv, envp) < 0) { + i = exec_usermodehelper(eppconfig_path, argv, envp); + if (i < 0) { printk(KERN_ERR "%s: failed to exec %s -s -p %s -m %s, errno = %d\n", bc_drvname, eppconfig_path, portarg, modearg, errno); return -errno; diff --git a/drivers/net/pc300.c b/drivers/net/pc300.c index 438405e1604e..ec9c5ae08a67 100644 --- a/drivers/net/pc300.c +++ b/drivers/net/pc300.c @@ -1,6 +1,6 @@ #define USE_PCI_CLOCK static char rcsid[] = -"$Revision: 3.1.0.1 $$Date: 2000/06/23 $"; +"$Revision: 3.1.0.2 $$Date: 2000/06/27 $"; /* * pc300.c Cyclades-PC300(tm) Driver. @@ -15,6 +15,10 @@ static char rcsid[] = * 2 of the License, or (at your option) any later version. * * $Log: pc300.c,v $ + * Revision 3.1.0.2 2000/06/27 ivan + * Previous bugfix for the framing errors with external clock made X21 + * boards stop working. This version fixes it. + * * Revision 3.1.0.1 2000/06/23 ivan * Revisited cpc_queue_xmit to prevent race conditions on Tx DMA buffer * handling when Tx timeouts occur. @@ -2205,17 +2209,24 @@ ch_config(pc300dev_t *d) cpc_writeb(scabase + M_REG(TXS, ch), (TXS_DTRXC|TXS_IBRG|br)); cpc_writeb(scabase + M_REG(TMCR, ch), tmc); cpc_writeb(scabase + M_REG(RXS, ch), (RXS_IBRG|br)); - if (card->hw.type == PC300_X21) + if (card->hw.type == PC300_X21) { cpc_writeb(scabase + M_REG(GPO, ch), 1); + cpc_writeb(scabase + M_REG(EXS, ch), EXS_TES1|EXS_RES1); + } else { + cpc_writeb(scabase + M_REG(EXS, ch), EXS_TES1); + } } else { cpc_writeb(scabase + M_REG(TMCT, ch), 1); cpc_writeb(scabase + M_REG(TXS, ch), TXS_DTRXC); cpc_writeb(scabase + M_REG(TMCR, ch), 1); cpc_writeb(scabase + M_REG(RXS, ch), 0); - if (card->hw.type == PC300_X21) + if (card->hw.type == PC300_X21) { cpc_writeb(scabase + M_REG(GPO, ch), 0); + cpc_writeb(scabase + M_REG(EXS, ch), EXS_TES1|EXS_RES1); + } else { + cpc_writeb(scabase + M_REG(EXS, ch), EXS_TES1); + } } - cpc_writeb(scabase + M_REG(EXS, ch), EXS_TES1); break; case PC300_TE: diff --git a/drivers/net/ppp.c b/drivers/net/ppp.c index 156b370834cf..e9496d842353 100644 --- a/drivers/net/ppp.c +++ b/drivers/net/ppp.c @@ -49,6 +49,7 @@ #include #include +#include #include #include #include @@ -94,8 +95,8 @@ * Local functions */ +int ppp_register_compressor (struct compressor *cp); #ifdef CONFIG_MODULES -static int ppp_register_compressor (struct compressor *cp); static void ppp_unregister_compressor (struct compressor *cp); #endif @@ -317,6 +318,10 @@ ppp_first_time(void) #ifndef MODULE + +extern int bsd_comp_install(void); +extern int ppp_deflate_install(void); + /* * Called at boot time if the PPP driver is compiled into the kernel. */ @@ -328,7 +333,11 @@ ppp_init(struct device *dev) if (first_time) { first_time = 0; - answer = ppp_first_time(); + answer = ppp_first_time(); + if (answer == 0) { + bsd_comp_install(); + ppp_deflate_install(); + } } if (answer == 0) answer = -ENODEV; @@ -3041,8 +3050,10 @@ static struct compressor *find_compressor (int type) return (struct compressor *) 0; } -#ifdef CONFIG_MODULES -static int ppp_register_compressor (struct compressor *cp) +/* + * If PPP is built-in then so are compressors, so __initfunc is okay here. + */ +__initfunc(int ppp_register_compressor (struct compressor *cp)) { struct compressor_link *new; unsigned long flags; @@ -3070,6 +3081,7 @@ static int ppp_register_compressor (struct compressor *cp) return 0; } +#ifdef CONFIG_MODULES static void ppp_unregister_compressor (struct compressor *cp) { struct compressor_link *prev = (struct compressor_link *) 0; diff --git a/drivers/net/ppp_deflate.c b/drivers/net/ppp_deflate.c index 3ef379ab2a93..e95ed84f1fea 100644 --- a/drivers/net/ppp_deflate.c +++ b/drivers/net/ppp_deflate.c @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -656,13 +657,7 @@ struct compressor ppp_deflate_draft = { z_comp_stats, /* decomp_stat */ }; -#ifdef MODULE -/************************************************************* - * Module support routines - *************************************************************/ - -int -init_module(void) +__initfunc(int ppp_deflate_install(void)) { int answer = ppp_register_compressor (&ppp_deflate); if (answer == 0) @@ -671,6 +666,14 @@ init_module(void) ppp_register_compressor(&ppp_deflate_draft); return answer; } + +#ifdef MODULE + +int +init_module(void) +{ + return ppp_deflate_install(); +} void cleanup_module(void) diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index ee2b00e0af93..9f8fd558f7d1 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -307,7 +307,11 @@ static struct dev_info device_list[] = {"MATSHITA","PD-1","*", BLIST_FORCELUN | BLIST_SINGLELUN}, {"iomega","jaz 1GB","J.86", BLIST_NOTQ | BLIST_NOLUN}, {"TOSHIBA","CDROM","*", BLIST_ISROM}, -{"MegaRAID", "LD", "*", BLIST_FORCELUN}, +{"MegaRAID", "LD", "*", BLIST_FORCELUN}, /* Multiple luns always safe (logical raid vols) */ +{"DGC", "RAID", "*", BLIST_SPARSELUN}, /* Dell PV 650F (tgt @ LUN 0) */ +{"DGC", "DISK", "*", BLIST_SPARSELUN}, /* Dell PV 650F (no tgt @ LUN 0) */ +{"DELL", "PV530F", "*", BLIST_SPARSELUN}, /* Dell PV 530F */ +{"SONY", "TSL", "*", BLIST_FORCELUN}, /* DDS3 & DDS4 autoloaders */ /* * Must be at end of list... */ diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index a797f8c8da54..80615b638382 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -1941,7 +1941,11 @@ scsi_error_handler(void * data) current->pgrp = 1; /* Become as one with the init task */ - + + exit_files(current); + current->files = init_task.files; + atomic_inc(¤t->files->count); + exit_fs(current); /* current->fs->count--; */ fs = init_task.fs; current->fs = fs; diff --git a/fs/ext2/acl.c b/fs/ext2/acl.c index 111a2d6e0578..60e1028a522b 100644 --- a/fs/ext2/acl.c +++ b/fs/ext2/acl.c @@ -54,7 +54,7 @@ int ext2_permission (struct inode * inode, int mask) if (((mode & mask & S_IRWXO) == mask) || capable(CAP_DAC_OVERRIDE)) return 0; if ((mask == S_IROTH) || - (S_ISDIR(mode) && !(mask & ~(S_IROTH | S_IXOTH)))) + (S_ISDIR(inode->i_mode) && !(mask & ~(S_IROTH | S_IXOTH)))) if (capable(CAP_DAC_READ_SEARCH)) return 0; return -EACCES; diff --git a/fs/namei.c b/fs/namei.c index a2f5d2881783..b307f3d5b5c0 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -155,7 +155,7 @@ int permission(struct inode * inode,int mask) return 0; /* read and search access */ if ((mask == S_IROTH) || - (S_ISDIR(mode) && !(mask & ~(S_IROTH | S_IXOTH)))) + (S_ISDIR(inode->i_mode) && !(mask & ~(S_IROTH | S_IXOTH)))) if (capable(CAP_DAC_READ_SEARCH)) return 0; return -EACCES; diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 44c4916f8598..4b6ed72bb46e 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -149,7 +149,7 @@ static int standard_permission(struct inode *inode, int mask) return 0; /* read and search access */ if ((mask == S_IROTH) || - (S_ISDIR(mode) && !(mask & ~(S_IROTH | S_IXOTH)))) + (S_ISDIR(inode->i_mode) && !(mask & ~(S_IROTH | S_IXOTH)))) if (capable(CAP_DAC_READ_SEARCH)) return 0; return -EACCES; diff --git a/fs/ufs/acl.c b/fs/ufs/acl.c index b002d3398785..ee30dd4d11ff 100644 --- a/fs/ufs/acl.c +++ b/fs/ufs/acl.c @@ -61,7 +61,7 @@ int ufs_permission (struct inode * inode, int mask) if (((mode & mask & S_IRWXO) == mask) || capable(CAP_DAC_OVERRIDE)) return 0; if ((mask == S_IROTH) || - (S_ISDIR(mode) && !(mask & ~(S_IROTH | S_IXOTH)))) + (S_ISDIR(inode->i_mode) && !(mask & ~(S_IROTH | S_IXOTH)))) if (capable(CAP_DAC_READ_SEARCH)) return 0; return -EACCES; diff --git a/include/linux/kmod.h b/include/linux/kmod.h index 7392910d39fe..6e8646c8b60f 100644 --- a/include/linux/kmod.h +++ b/include/linux/kmod.h @@ -6,7 +6,12 @@ #ifdef CONFIG_KMOD extern int request_module(const char * name); +extern int exec_usermodehelper(char *program_path, char *argv[], char *envp[]); #else #define request_module(x) do {} while(0) +static inline int exec_usermodehelper(char *program_path, char *argv[], char *envp[]) +{ + return -EACCES; +} #endif diff --git a/include/linux/pci.h b/include/linux/pci.h index 7c322763d953..6d7008cb2eb8 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1047,13 +1047,11 @@ #define PCI_VENDOR_ID_TIMEDIA 0x1409 #define PCI_DEVICE_ID_TIMEDIA_1889 0x7168 +#define PCI_DEVICE_ID_TIMEDIA_4008A 0x7268 #define PCI_VENDOR_ID_AFAVLAB 0x14db #define PCI_DEVICE_ID_AFAVLAB_TK9902 0x2120 -#define PCI_VENDOR_ID_TIMEDIA 0x1409 -#define PCI_DEVICE_ID_TIMEDIA_4008A 0x7268 - #define PCI_VENDOR_ID_SYMPHONY 0x1c1c #define PCI_DEVICE_ID_SYMPHONY_101 0x0001 diff --git a/kernel/ksyms.c b/kernel/ksyms.c index 8980bc39778b..00ddc7454422 100644 --- a/kernel/ksyms.c +++ b/kernel/ksyms.c @@ -75,6 +75,7 @@ __attribute__((section("__ksymtab"))) = { #ifdef CONFIG_KMOD EXPORT_SYMBOL(request_module); +EXPORT_SYMBOL(exec_usermodehelper); #endif #ifdef CONFIG_MODULES -- 2.39.5