## Automatically generated incremental diff ## From: linux-2.0.37-pre9 ## To: linux-2.0.37-pre10 ## Robot: $Id: make-incremental-diff,v 1.11 2002/02/20 02:59:33 hpa Exp $ diff -urN linux-2.0.37-pre9/arch/alpha/Makefile linux-2.0.37-pre10/arch/alpha/Makefile --- linux-2.0.37-pre9/arch/alpha/Makefile 2003-08-15 15:04:44.000000000 -0700 +++ linux-2.0.37-pre10/arch/alpha/Makefile 2003-08-15 15:04:44.000000000 -0700 @@ -27,9 +27,9 @@ CFLAGS := $(CFLAGS) -mno-fp-regs # determine if we can use the BWX instructions with GAS -dummy=$(shell rm -f /tmp/GAS_VER) +dummy:=$(shell rm -f /tmp/GAS_VER) #$(shell $(AS) --version >& /tmp/GAS_VER) -dummy=$(shell $(AS) --version > /tmp/GAS_VER 2>&1) +dummy:=$(shell $(AS) --version > /tmp/GAS_VER 2>&1) OLD_GAS := $(shell if cat /tmp/GAS_VER | grep 'version 2.7' > /dev/null; then echo yes; else echo no; fi) ifneq ($(OLD_GAS),yes) diff -urN linux-2.0.37-pre9/drivers/char/cyclades.c linux-2.0.37-pre10/drivers/char/cyclades.c --- linux-2.0.37-pre9/drivers/char/cyclades.c 2003-08-15 15:04:44.000000000 -0700 +++ linux-2.0.37-pre10/drivers/char/cyclades.c 2003-08-15 15:04:44.000000000 -0700 @@ -1,7 +1,7 @@ #define BLOCKMOVE #define Z_WAKE static char rcsid[] = -"$Revision: 2.1.1.11 $$Date: 1998/12/30 18:58:47 $"; +"$Revision: 2.1.2.1 $$Date: 1999/04/08 16:17:18 $"; /* * linux/drivers/char/cyclades.c @@ -31,6 +31,16 @@ * void cleanup_module(void); * * $Log: cyclades.c,v $ + * Revision 2.1.2.1 1999/04/08 16:17:18 ivan + * cy_wait_until_sent function revisited; + * Module usage counter scheme revisited; + * Added support to the upcoming Y PCI boards (i.e., support to additional + * PCI Device ID's). + * + * Revision 2.1.1.12 1999/01/19 13:08:18 ivan + * Fixed PLX PCI bridge registers mapping for Cyclom-Y boards, so + * that it works even with addresses out of memory page boundaries. + * * Revision 2.1.1.11 1998/12/30 18:58:47 ivan * Changed access to PLX PCI bridge registers from I/O to MMIO, in * order to make PLX9050-based boards work with certain motherboards. @@ -523,6 +533,7 @@ #undef CY_DEBUG_COUNT #undef CY_DEBUG_DTR #undef CY_DEBUG_WAIT_UNTIL_SENT +#undef CY_DEBUG_INTERRUPTS #undef CY_16Y_HACK #undef CY_ENABLE_MONITORING #undef CY_PCI_DEBUG @@ -762,16 +773,20 @@ /* PCI related definitions */ -static unsigned short cy_pci_nboard = 0; -static unsigned short cy_isa_nboard = 0; -static unsigned short cy_nboard = 0; -static unsigned short cy_pci_dev_id[] = { - PCI_DEVICE_ID_CYCLOM_Y_Lo,/* PCI below 1Mb */ - PCI_DEVICE_ID_CYCLOM_Y_Hi,/* PCI above 1Mb */ - PCI_DEVICE_ID_CYCLOM_Z_Lo,/* PCI below 1Mb */ - PCI_DEVICE_ID_CYCLOM_Z_Hi,/* PCI above 1Mb */ - 0 /* end of table */ - }; +static unsigned short cy_pci_nboard = 0; +static unsigned short cy_isa_nboard = 0; +static unsigned short cy_nboard = 0; +static unsigned short cy_pci_dev_id[] = { + PCI_DEVICE_ID_CYCLOM_Y_Lo, /* PCI < 1Mb */ + PCI_DEVICE_ID_CYCLOM_Y_Hi, /* PCI > 1Mb */ + PCI_DEVICE_ID_CYCLOM_4Y_Lo, /* 4Y PCI < 1Mb */ + PCI_DEVICE_ID_CYCLOM_4Y_Hi, /* 4Y PCI > 1Mb */ + PCI_DEVICE_ID_CYCLOM_8Y_Lo, /* 8Y PCI < 1Mb */ + PCI_DEVICE_ID_CYCLOM_8Y_Hi, /* 8Y PCI > 1Mb */ + PCI_DEVICE_ID_CYCLOM_Z_Lo, /* Z PCI < 1Mb */ + PCI_DEVICE_ID_CYCLOM_Z_Hi, /* Z PCI > 1Mb */ + 0 /* end of table */ + }; static void cy_start(struct tty_struct *); @@ -2512,13 +2527,17 @@ { struct cyclades_port *info; int retval, line; + unsigned long page; + MOD_INC_USE_COUNT; line = MINOR(tty->device) - tty->driver.minor_start; if ((line < 0) || (NR_PORTS <= line)){ + MOD_DEC_USE_COUNT; return -ENODEV; } info = &cy_port[line]; if (info->line < 0){ + MOD_DEC_USE_COUNT; return -ENODEV; } @@ -2544,6 +2563,8 @@ #ifdef CY_DEBUG_OTHER printk("cyc:cy_open ttyC%d\n", info->line); /* */ #endif + tty->driver_data = info; + info->tty = tty; if (serial_paranoia_check(info, tty->device, "cy_open")){ return -ENODEV; } @@ -2556,16 +2577,15 @@ printk("cyc:cy_open (%d): incrementing count to %d\n", current->pid, info->count); #endif - tty->driver_data = info; - info->tty = tty; - /* Some drivers have (incorrect/incomplete) code to test - against a race condition. Should add good code here!!! */ if (!tmp_buf) { - tmp_buf = (unsigned char *) get_free_page(GFP_KERNEL); - if (!tmp_buf){ - return -ENOMEM; - } + page = get_free_page(GFP_KERNEL); + if (!page) + return -ENOMEM; + if (tmp_buf) + free_page(page); + else + tmp_buf = (unsigned char *) page; } if ((info->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) { @@ -2582,8 +2602,6 @@ return retval; } - MOD_INC_USE_COUNT; - retval = block_til_ready(tty, filp, info); if (retval) { #ifdef CY_DEBUG_OPEN @@ -2616,6 +2634,9 @@ if (serial_paranoia_check(info, tty->device, "cy_wait_until_sent")) return; + if (info->xmit_fifo_size == 0) + return; /* Just in case.... */ + orig_jiffies = jiffies; /* * Set the check interval to be 1/5 of the estimated time to @@ -2633,6 +2654,17 @@ timeout = 0; if (timeout) char_time = MIN(char_time, timeout); + /* + * If the transmitter hasn't cleared in twice the approximate + * amount of time to send the entire FIFO, it probably won't + * ever clear. This assumes the UART isn't doing flow + * control, which is currently the case. Hence, if it ever + * takes longer than info->timeout, this is probably due to a + * UART bug of some kind. So, we clamp the timeout parameter at + * 2*info->timeout. + */ + if (!timeout || timeout > 2*info->timeout) + timeout = 2*info->timeout; #ifdef CY_DEBUG_WAIT_UNTIL_SENT printk("In cy_wait_until_sent(%d) check=%lu...", timeout, char_time); printk("jiff=%lu...", jiffies); @@ -2686,8 +2718,7 @@ printk("cyc:cy_close ttyC%d\n", info->line); #endif - if (!info - || serial_paranoia_check(info, tty->device, "cy_close")){ + if (!info || serial_paranoia_check(info, tty->device, "cy_close")){ return; } #ifdef CY_DEBUG_OPEN @@ -4754,6 +4785,8 @@ pcibios_read_config_byte(cyy_bus, cyy_dev_fn, PCI_REVISION_ID, &cyy_rev_id); + device_id &= ~PCI_DEVICE_ID_MASK; + if ((device_id == PCI_DEVICE_ID_CYCLOM_Y_Lo) || (device_id == PCI_DEVICE_ID_CYCLOM_Y_Hi)){ #ifdef CY_PCI_DEBUG @@ -4761,11 +4794,11 @@ cyy_bus, cyy_dev_fn); printk("rev_id=%d) IRQ%d\n", cyy_rev_id, (int)cy_pci_irq); - printk("Cyclom-Y/PCI:found winaddr=0x%lx ioaddr=0x%lx\n", - (ulong)cy_pci_addr2, (ulong)cy_pci_addr1); + printk("Cyclom-Y/PCI:found winaddr=0x%lx ctladdr=0x%lx\n", + (ulong)cy_pci_addr2, (ulong)cy_pci_addr0); #endif - cy_pci_addr0 &= PCI_BASE_ADDRESS_MEM_MASK; - cy_pci_addr2 &= PCI_BASE_ADDRESS_MEM_MASK; + cy_pci_addr0 &= PCI_BASE_ADDRESS_MEM_MASK; + cy_pci_addr2 &= PCI_BASE_ADDRESS_MEM_MASK; #if defined(__alpha__) if (device_id == PCI_DEVICE_ID_CYCLOM_Y_Lo) { /* below 1M? */ @@ -4773,22 +4806,24 @@ cyy_bus, cyy_dev_fn); printk("rev_id=%d) IRQ%d\n", cyy_rev_id, (int)cy_pci_irq); - printk("Cyclom-Y/PCI:found winaddr=0x%lx ioaddr=0x%lx\n", - (ulong)cy_pci_addr2, (ulong)cy_pci_addr1); + printk("Cyclom-Y/PCI:found winaddr=0x%lx ctladdr=0x%lx\n", + (ulong)cy_pci_addr2, (ulong)cy_pci_addr0); printk("Cyclom-Y/PCI not supported for low addresses in " "Alpha systems.\n"); i--; continue; } #else - cy_pci_addr0 = (ulong) ioremap(cy_pci_addr0, CyPCI_Yctl); + cy_pci_addr0 = (ulong)ioremap(cy_pci_addr0 & PAGE_MASK, + PAGE_ALIGN(CyPCI_Yctl)) + + (cy_pci_addr0 & (PAGE_SIZE-1)); if ((ulong)cy_pci_addr2 >= 0x100000) /* above 1M? */ cy_pci_addr2 = (ulong) ioremap(cy_pci_addr2, CyPCI_Ywin); #endif #ifdef CY_PCI_DEBUG - printk("Cyclom-Y/PCI: relocate winaddr=0x%lx ioaddr=0x%lx\n", - (u_long)cy_pci_addr2, (u_long)cy_pci_addr1); + printk("Cyclom-Y/PCI: relocate winaddr=0x%lx ctladdr=0x%lx\n", + (u_long)cy_pci_addr2, (u_long)cy_pci_addr0); #endif cy_pci_nchan = (unsigned short)(CyPORTS_PER_CHIP * cyy_init_card((volatile ucchar *)cy_pci_addr2, 1)); @@ -4831,7 +4866,7 @@ /* set cy_card */ cy_card[j].base_addr = (ulong)cy_pci_addr2; - cy_card[j].ctl_addr = (ulong)cy_pci_addr0; + cy_card[j].ctl_addr = (ulong)cy_pci_addr0; cy_card[j].irq = (int) cy_pci_irq; cy_card[j].bus_index = 1; cy_card[j].first_line = cy_next_channel; diff -urN linux-2.0.37-pre9/drivers/char/isicom.c linux-2.0.37-pre10/drivers/char/isicom.c --- linux-2.0.37-pre9/drivers/char/isicom.c 1998-11-15 10:32:54.000000000 -0800 +++ linux-2.0.37-pre10/drivers/char/isicom.c 2003-08-15 15:04:44.000000000 -0700 @@ -116,6 +116,7 @@ #ifdef ISICOM_DEBUG printk(KERN_DEBUG "ISILoad:Firmware loader Opened!!!\n"); #endif + MOD_INC_USE_COUNT; return 0; } @@ -124,6 +125,7 @@ #ifdef ISICOM_DEBUG printk(KERN_DEBUG "ISILoad:Firmware loader Close(Release)d\n",); #endif + MOD_DEC_USE_COUNT; } static int ISILoad_ioctl(struct inode *inode, struct file *filp, diff -urN linux-2.0.37-pre9/drivers/char/selection.h linux-2.0.37-pre10/drivers/char/selection.h --- linux-2.0.37-pre9/drivers/char/selection.h 1998-06-03 15:17:47.000000000 -0700 +++ linux-2.0.37-pre10/drivers/char/selection.h 2003-08-15 15:04:44.000000000 -0700 @@ -66,12 +66,13 @@ #ifdef CONFIG_TGA_CONSOLE # ifdef CONFIG_VGA_CONSOLE -extern int curr_cons; extern const struct console_desc cons_devices[]; # endif extern unsigned long video_mem_term; +int tga_blitc (unsigned int, unsigned long); + /* * TGA console screen memory access * @@ -110,8 +111,8 @@ * TGA might need the char blitted to the screen, * but check first, we could be running on a VGA. */ - if (con_blitc && IS_VIDEO_MEMORY(addr)) - con_blitc(val, (unsigned long) addr); + if (tga_blitc && IS_VIDEO_MEMORY(addr)) + tga_blitc(val, (unsigned long) addr); } else writew(val, (unsigned long) addr); } diff -urN linux-2.0.37-pre9/drivers/char/tga.c linux-2.0.37-pre10/drivers/char/tga.c --- linux-2.0.37-pre9/drivers/char/tga.c 1998-11-15 10:32:55.000000000 -0800 +++ linux-2.0.37-pre10/drivers/char/tga.c 2003-08-15 15:04:44.000000000 -0700 @@ -40,6 +40,7 @@ extern void register_console(void (*proc)(const char *)); extern void console_print(const char *); +extern void set_palette (void); /* vga.c */ /* TGA hardware description (minimal) */ /* @@ -484,11 +485,6 @@ tga_init_video(); tga_clear_screen(); -#ifdef CONFIG_VGA_CONSOLE - /* if both are configured, we are using a dispatch table, - so we must set the index */ - curr_cons = 1; -#endif } unsigned char PLLbits[7] = { 0x80, 0x04, 0x00, 0x24, 0x44, 0x80, 0xb8 }; diff -urN linux-2.0.37-pre9/drivers/net/ne.c linux-2.0.37-pre10/drivers/net/ne.c --- linux-2.0.37-pre9/drivers/net/ne.c 2003-08-15 15:04:44.000000000 -0700 +++ linux-2.0.37-pre10/drivers/net/ne.c 2003-08-15 15:04:45.000000000 -0700 @@ -423,6 +423,7 @@ outb_p(0x00, ioaddr + EN0_RCNTLO); outb_p(0x00, ioaddr + EN0_RCNTHI); outb_p(E8390_RREAD+E8390_START, ioaddr); /* Trigger it... */ + udelay(10000); /* wait 10ms for interrupt to propagate */ outb_p(0x00, ioaddr + EN0_IMR); /* Mask it again. */ dev->irq = autoirq_report(0); if (ei_debug > 2) @@ -676,9 +677,7 @@ outb_p(0x00, nic_base + EN0_RSARHI); outb_p(E8390_RREAD+E8390_START, nic_base + NE_CMD); /* Make certain that the dummy read has occurred. */ - SLOW_DOWN_IO; - SLOW_DOWN_IO; - SLOW_DOWN_IO; + udelay(6); #endif outb_p(ENISR_RDC, nic_base + EN0_ISR); diff -urN linux-2.0.37-pre9/drivers/net/rclanmtl.c linux-2.0.37-pre10/drivers/net/rclanmtl.c --- linux-2.0.37-pre9/drivers/net/rclanmtl.c 2003-08-15 15:04:44.000000000 -0700 +++ linux-2.0.37-pre10/drivers/net/rclanmtl.c 2003-08-15 15:04:45.000000000 -0700 @@ -2,7 +2,7 @@ ** ************************************************************************* ** ** -** R C L A N M T L . C $Revision: 5 $ +** R C L A N M T L . C $Revision: 6 $ ** ** ** RedCreek I2O LAN Message Transport Layer program module. @@ -29,6 +29,10 @@ ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +** +** 1998-1999, LAN API was modified and enhanced by Alice Hennessy. +** +** Sometime in 1997, LAN API was written from scratch by Wendell Nichols. ** ************************************************************************* */ @@ -200,7 +204,7 @@ /* Special TID Assignments */ #define I2O_IOP_TID 0 -#define I2O_HOST_TID 1 +#define I2O_HOST_TID 0xB91 /* RedCreek I2O private message codes */ #define RC_PRIVATE_GET_MAC_ADDR 0x0001/**/ /* OBSOLETE */ diff -urN linux-2.0.37-pre9/drivers/net/rclanmtl.h linux-2.0.37-pre10/drivers/net/rclanmtl.h --- linux-2.0.37-pre9/drivers/net/rclanmtl.h 2003-08-15 15:04:44.000000000 -0700 +++ linux-2.0.37-pre10/drivers/net/rclanmtl.h 2003-08-15 15:04:45.000000000 -0700 @@ -2,7 +2,7 @@ ** ************************************************************************* ** ** -** R C L A N M T L . H $Revision: 5 $ +** R C L A N M T L . H $Revision: 6 $ ** ** ** RedCreek I2O LAN Message Transport Layer header file. diff -urN linux-2.0.37-pre9/drivers/net/rcpci45.c linux-2.0.37-pre10/drivers/net/rcpci45.c --- linux-2.0.37-pre9/drivers/net/rcpci45.c 2003-08-15 15:04:44.000000000 -0700 +++ linux-2.0.37-pre10/drivers/net/rcpci45.c 2003-08-15 15:04:45.000000000 -0700 @@ -1,4 +1,5 @@ /* +** ** RCpci45.c ** ** @@ -36,16 +37,18 @@ ** ** ** Pete Popov, January 11,99: Fixed a couple of 2.1.x problems -** (virt_to_bus() not called), tested it under 2.2pre5, and added a -** #define to enable the use of the same file for both, the 2.0.x kernels -** as well as the 2.1.x. +** (virt_to_bus() not called), tested it under 2.2pre5 (as a module), and +** added a #define(s) to enable the use of the same file for both, the 2.0.x +** kernels as well as the 2.1.x. ** ** Ported to 2.1.x by Alan Cox 1998/12/9. ** +** Sometime in mid 1998, written by Pete Popov and Brian Moyle. +** ***************************************************************************/ static char *version = -"RedCreek Communications PCI linux driver version 2.00\n"; +"RedCreek Communications PCI linux driver version 2.02\n"; #include @@ -155,11 +158,10 @@ }; -static int RCscan(void); -static struct device -*RCfound_device(struct device *, int, int, int, int, int, int); +static int RCinit(struct device *dev); +static int RCscan(struct device *dev); +static int RCfound_device(struct device *, int, int, int, int, int, int); -static int RCprobe1(struct device *); static int RCopen(struct device *); static int RC_xmit_packet(struct sk_buff *, struct device *); static void RCinterrupt(int, void *, struct pt_regs *); @@ -180,134 +182,143 @@ #ifdef MODULE int init_module(void) #else -int rcpci_probe(struct netdevice *dev) +int rcpci_probe(struct device *dev) #endif { int cards_found; - printk(version); - - root_RCdev = NULL; - cards_found = RCscan(); #ifdef MODULE - return cards_found ? 0 : -ENODEV; + cards_found = RCscan(NULL); #else - return -1; + cards_found = RCscan(dev); #endif + if (cards_found) + printk(version); + return cards_found ? 0 : -ENODEV; } -static int RCscan() +static int RCscan(struct device *dev) { int cards_found = 0; - struct device *dev = 0; + static int pci_index = 0; + + if (!pcibios_present()) + return cards_found; - if (pcibios_present()) + for (;pci_index < 0x8; pci_index++) { - static int pci_index = 0; unsigned char pci_bus, pci_device_fn; int scan_status; int board_index = 0; - - for (;pci_index < 0xff; pci_index++) - { - unsigned char pci_irq_line; - unsigned short pci_command, vendor, device, class; - unsigned int pci_ioaddr; + unsigned char pci_irq_line; + unsigned short pci_command, vendor, device, class; + unsigned int pci_ioaddr; - scan_status = - (pcibios_find_device (RC_PCI45_VENDOR_ID, - RC_PCI45_DEVICE_ID, - pci_index, - &pci_bus, - &pci_device_fn)); + scan_status = + (pcibios_find_device (RC_PCI45_VENDOR_ID, + RC_PCI45_DEVICE_ID, + pci_index, + &pci_bus, + &pci_device_fn)); #ifdef RCDEBUG - printk("rc scan_status = 0x%X\n", scan_status); + printk("rc scan_status = 0x%X\n", scan_status); +#endif + if (scan_status != PCIBIOS_SUCCESSFUL) + break; + pcibios_read_config_word(pci_bus, + pci_device_fn, + PCI_VENDOR_ID, &vendor); + pcibios_read_config_word(pci_bus, + pci_device_fn, + PCI_DEVICE_ID, &device); + pcibios_read_config_byte(pci_bus, + pci_device_fn, + PCI_INTERRUPT_LINE, &pci_irq_line); + pcibios_read_config_dword(pci_bus, + pci_device_fn, + PCI_BASE_ADDRESS_0, &pci_ioaddr); + pcibios_read_config_word(pci_bus, + pci_device_fn, + PCI_CLASS_DEVICE, &class); + + pci_ioaddr &= ~0xf; + +#ifdef RCDEBUG + printk("rc: Found RedCreek PCI adapter\n"); + printk("rc: pci class = 0x%x 0x%x \n", class, class>>8); + printk("rc: pci_bus = %d, pci_device_fn = %d\n", pci_bus, pci_device_fn); + printk("rc: pci_irq_line = 0x%x \n", pci_irq_line); + printk("rc: pci_ioaddr = 0x%x\n", pci_ioaddr); #endif - if (scan_status != PCIBIOS_SUCCESSFUL) - break; - pcibios_read_config_word(pci_bus, - pci_device_fn, - PCI_VENDOR_ID, &vendor); - pcibios_read_config_word(pci_bus, - pci_device_fn, - PCI_DEVICE_ID, &device); - pcibios_read_config_byte(pci_bus, - pci_device_fn, - PCI_INTERRUPT_LINE, &pci_irq_line); - pcibios_read_config_dword(pci_bus, - pci_device_fn, - PCI_BASE_ADDRESS_0, &pci_ioaddr); - pcibios_read_config_word(pci_bus, - pci_device_fn, - PCI_CLASS_DEVICE, &class); - - pci_ioaddr &= ~0xf; + if (check_region(pci_ioaddr, 2*32768)) + { + printk("rc: check_region failed\n"); + continue; + } #ifdef RCDEBUG - printk("rc: Found RedCreek PCI adapter\n"); - printk("rc: pci class = 0x%x 0x%x \n", class, class>>8); - printk("rc: pci_bus = %d, pci_device_fn = %d\n", pci_bus, pci_device_fn); - printk("rc: pci_irq_line = 0x%x \n", pci_irq_line); - printk("rc: pci_ioaddr = 0x%x\n", pci_ioaddr); + else + { + printk("rc: check_region passed\n"); + } #endif + + /* + * Get and check the bus-master and latency values. + * Some PCI BIOSes fail to set the master-enable bit. + */ -#if 1 - if (check_region(pci_ioaddr, 2*32768)) - { - printk("rc: check_region failed\n"); - continue; - } - else - { - printk("rc: check_region passed\n"); - } -#endif - + pcibios_read_config_word(pci_bus, + pci_device_fn, + PCI_COMMAND, + &pci_command); + if ( ! (pci_command & PCI_COMMAND_MASTER)) { + printk("rc: PCI Master Bit has not been set!\n"); + + pci_command |= PCI_COMMAND_MASTER; + pcibios_write_config_word(pci_bus, + pci_device_fn, + PCI_COMMAND, + pci_command); + } + if ( ! (pci_command & PCI_COMMAND_MEMORY)) { /* - * Get and check the bus-master and latency values. - * Some PCI BIOSes fail to set the master-enable bit. + * If the BIOS did not set the memory enable bit, what else + * did it not initialize? Skip this adapter. */ - - pcibios_read_config_word(pci_bus, - pci_device_fn, - PCI_COMMAND, - &pci_command); - if ( ! (pci_command & PCI_COMMAND_MASTER)) { - printk("rc: PCI Master Bit has not been set!\n"); - - pci_command |= PCI_COMMAND_MASTER; - pcibios_write_config_word(pci_bus, - pci_device_fn, - PCI_COMMAND, - pci_command); - } - if ( ! (pci_command & PCI_COMMAND_MEMORY)) { - /* - * If the BIOS did not set the memory enable bit, what else - * did it not initialize? Skip this adapter. - */ - printk("rc: Adapter %d, PCI Memory Bit has not been set!\n", - cards_found); - printk("rc: Bios problem? \n"); - continue; - } - - dev = RCfound_device(dev, pci_ioaddr, pci_irq_line, - pci_bus, pci_device_fn, - board_index++, cards_found); - - if (dev) { - dev = 0; - cards_found++; - } + printk("rc: Adapter %d, PCI Memory Bit has not been set!\n", + cards_found); + printk("rc: Bios problem? \n"); + continue; + } + + if (!RCfound_device(dev, pci_ioaddr, pci_irq_line, + pci_bus, pci_device_fn, + board_index++, cards_found)) + { + dev = 0; + cards_found++; } } +#ifdef RCDEBUG printk("rc: found %d cards \n", cards_found); +#endif return cards_found; } -static struct device * +static int RCinit(struct device *dev) +{ + dev->open = &RCopen; + dev->hard_start_xmit = &RC_xmit_packet; + dev->stop = &RCclose; + dev->get_stats = &RCget_stats; + dev->do_ioctl = &RCioctl; + dev->set_config = &RCconfig; + return 0; +} + +static int RCfound_device(struct device *dev, int memaddr, int irq, int bus, int function, int product_index, int card_idx) { @@ -324,18 +335,37 @@ * assigned to DPA; and finally, the rest will be assigned to the * the LAN API layer. */ + +#ifdef MODULE dev = (struct device *) kmalloc(dev_size, GFP_DMA | GFP_KERNEL |GFP_ATOMIC); + if (!dev) + { + printk("rc: unable to kmalloc dev\n"); + return 1; + } memset(dev, 0, dev_size); -#ifdef RCDEBUG - printk("rc: dev = 0x%08X\n", (uint)dev); -#endif - /* * dev->priv will point to the start of DPA. */ dev->priv = (void *)(((long)dev + sizeof(struct device) + 15) & ~15); +#else + dev->priv = 0; + dev->priv = (struct device *) kmalloc(dev_size, GFP_DMA | GFP_KERNEL |GFP_ATOMIC); + if (!dev->priv) + { + printk("rc: unable to kmalloc private area\n"); + return 1; + } + memset(dev->priv, 0, dev_size); +#endif + +#ifdef RCDEBUG + printk("rc: dev = 0x%x, dev->priv = 0x%x\n", (uint)dev, (uint)dev->priv); +#endif + pDpa = dev->priv; - dev->name = pDpa->devname; + if (!dev->name) + dev->name = pDpa->devname; pDpa->dev = dev; /* this is just for easy reference */ pDpa->function = function; @@ -378,24 +408,21 @@ printk( "RC PCI 45: %s: unable to get IRQ %d\n", (PU8)dev->name, (uint)dev->irq ); iounmap(vaddr); kfree(dev); - return 0; + return 1; } init_status = RCInitI2OMsgLayer(pDpa->id, dev->base_addr, - pDpa->PLanApiPA, (PU8)virt_to_bus((void *)pDpa->PLanApiPA), - (PFNTXCALLBACK)RCxmit_callback, - (PFNRXCALLBACK)RCrecv_callback, - (PFNCALLBACK)RCreboot_callback); -#ifdef RCDEBUG - printk("rc: I2O msg initted: status = 0x%x\n", init_status); -#endif + pDpa->PLanApiPA, (PU8)virt_to_bus((void *)pDpa->PLanApiPA), + (PFNTXCALLBACK)RCxmit_callback, + (PFNRXCALLBACK)RCrecv_callback, + (PFNCALLBACK)RCreboot_callback); if (init_status) { printk("rc: Unable to initialize msg layer\n"); free_irq(dev->irq, dev); iounmap(vaddr); kfree(dev); - return 0; + return 1; } if (RCGetMAC(pDpa->id, dev->dev_addr, NULL)) { @@ -403,38 +430,34 @@ free_irq(dev->irq, dev); iounmap(vaddr); kfree(dev); - return 0; + return 1; } DriverControlWord |= WARM_REBOOT_CAPABLE; RCReportDriverCapability(pDpa->id, DriverControlWord); - dev->init = RCprobe1; + dev->init = &RCinit; ether_setup(dev); /* linux kernel interface */ pDpa->next = root_RCdev; root_RCdev = dev; +#ifdef MODULE if (register_netdev(dev) != 0) /* linux kernel interface */ { printk("rc: unable to register device \n"); free_irq(dev->irq, dev); iounmap(vaddr); kfree(dev); - return 0; + return 1; } - return dev; -} +#else + RCinit(dev); +#endif + printk("%s: RedCreek Communications IPSEC VPN adapter\n", + dev->name); -static int RCprobe1(struct device *dev) -{ - dev->open = RCopen; - dev->hard_start_xmit = RC_xmit_packet; - dev->stop = RCclose; - dev->get_stats = RCget_stats; - dev->do_ioctl = RCioctl; - dev->set_config = RCconfig; - return 0; + return 0; /* success */ } static int @@ -516,6 +539,7 @@ #ifdef RCDEBUG printk("rc: RC_xmit_packet: tbusy!\n"); #endif + dev->tbusy = 1; return 1; } @@ -658,7 +682,7 @@ RCShutdownLANCard(pDpa->id,0,0,0); printk("rc: scheduling timer...\n"); init_timer(&pDpa->timer); - pDpa->timer.expires = RUN_AT((30*HZ)/10); /* 3 sec. */ + pDpa->timer.expires = RUN_AT((40*HZ)/10); /* 4 sec. */ pDpa->timer.data = (unsigned long)dev; pDpa->timer.function = &rc_timer; /* timer handler */ add_timer(&pDpa->timer); @@ -757,9 +781,11 @@ if (!pDpa->shutdown && !pDpa->reboot) printk("rc: RCrecv error: status = 0x%x\n", (uint)Status); +#ifdef RCDEBUG else printk("rc: Returning %d buffers, status = 0x%x\n", PktCount, (uint)Status); +#endif /* * TO DO: check the nature of the failure and put the adapter in * failed mode if it's a hard failure. Send a reset to the adapter @@ -808,6 +834,8 @@ (uint)skb->data[0], (uint)skb->data[1], (uint)skb->data[2], (uint)skb->data[3], (uint)skb->data[4], (uint)skb->data[5]); #endif + +#ifdef PROMISCUOUS_BY_DEFAULT /* early 2.x firmware */ if ( (memcmp(dev->dev_addr, skb->data, 6)) && (!broadcast_packet(skb->data))) { @@ -838,6 +866,7 @@ } } else +#endif /* PROMISCUOUS_BY_DEFAULT */ { len = PacketDescBlock[2]; skb->dev = dev; @@ -883,10 +912,10 @@ pDpa = (PDPA) (dev->priv); +#ifdef RCDEBUG if (pDpa->shutdown) printk("rc: shutdown: service irq\n"); -#ifdef RCDEBUG printk("RC irq: pDpa = 0x%x, dev = 0x%x, id = %d\n", (uint)pDpa, (uint)dev, (uint)pDpa->id); printk("dev = 0x%x\n", (uint)dev); @@ -901,7 +930,8 @@ return; } -#define REBOOT_REINIT_RETRY_LIMIT 10 + +#define REBOOT_REINIT_RETRY_LIMIT 4 static void rc_timer(unsigned long data) { struct device *dev = (struct device *)data; @@ -914,12 +944,12 @@ if (pDpa->reboot) { - init_status = RCInitI2OMsgLayer(pDpa->id, dev->base_addr, - pDpa->PLanApiPA, pDpa->PLanApiPA, - (PFNTXCALLBACK)RCxmit_callback, - (PFNRXCALLBACK)RCrecv_callback, - (PFNCALLBACK)RCreboot_callback); + pDpa->PLanApiPA, + (PU8)virt_to_bus((void *)pDpa->PLanApiPA), + (PFNTXCALLBACK)RCxmit_callback, + (PFNRXCALLBACK)RCrecv_callback, + (PFNCALLBACK)RCreboot_callback); switch(init_status) { @@ -949,14 +979,16 @@ (uint)pDpa->numOutRcvBuffers); } printk("rc: Initialization done.\n"); + dev->tbusy=0; + retry=0; return; case RC_RTN_FREE_Q_EMPTY: retry++; - printk("rc: inbound free q emtpy\n"); + printk("rc: inbound free q empty\n"); break; default: retry++; - printk("rc: unexpected bad status after reboot\n"); + printk("rc: bad status after reboot: %d\n", init_status); break; } @@ -972,7 +1004,7 @@ { printk("rc: rescheduling timer...\n"); init_timer(&pDpa->timer); - pDpa->timer.expires = RUN_AT((30*HZ)/10); /* 3 sec. */ + pDpa->timer.expires = RUN_AT((40*HZ)/10); /* 3 sec. */ pDpa->timer.data = (unsigned long)dev; pDpa->timer.function = &rc_timer; /* timer handler */ add_timer(&pDpa->timer); @@ -1286,6 +1318,8 @@ return 0; } + +#ifdef MODULE void cleanup_module(void) { @@ -1315,6 +1349,8 @@ root_RCdev = next; } } +#endif + static int RC_allocate_and_post_buffers(struct device *dev, int numBuffers) diff -urN linux-2.0.37-pre9/drivers/pci/pci.c linux-2.0.37-pre10/drivers/pci/pci.c --- linux-2.0.37-pre9/drivers/pci/pci.c 2003-08-15 15:04:44.000000000 -0700 +++ linux-2.0.37-pre10/drivers/pci/pci.c 2003-08-15 15:04:45.000000000 -0700 @@ -432,8 +432,12 @@ DEVICE( RP, RP32INTF, "RocketPort 32 Intf"), DEVICE( CYCLADES, CYCLOM_Y_Lo, "Cyclom-Y below 1Mbyte"), DEVICE( CYCLADES, CYCLOM_Y_Hi, "Cyclom-Y above 1Mbyte"), - DEVICE( CYCLADES, CYCLOM_Z_Lo, "Cyclom-Z below 1Mbyte"), - DEVICE( CYCLADES, CYCLOM_Z_Hi, "Cyclom-Z above 1Mbyte"), + DEVICE( CYCLADES, CYCLOM_4Y_Lo, "Cyclom-4Y below 1Mbyte"), + DEVICE( CYCLADES, CYCLOM_4Y_Hi, "Cyclom-4Y above 1Mbyte"), + DEVICE( CYCLADES, CYCLOM_8Y_Lo, "Cyclom-8Y below 1Mbyte"), + DEVICE( CYCLADES, CYCLOM_8Y_Hi, "Cyclom-8Y above 1Mbyte"), + DEVICE( CYCLADES, CYCLOM_Z_Lo, "Cyclades-Z below 1Mbyte"), + DEVICE( CYCLADES, CYCLOM_Z_Hi, "Cyclades-Z above 1Mbyte"), DEVICE( ESSENTIAL, ESSENTIAL_ROADRUNNER,"Roadrunner serial HIPPI"), DEVICE( O2, O2_6832, "6832"), DEVICE( 3DFX, 3DFX_VOODOO, "Voodoo"), diff -urN linux-2.0.37-pre9/fs/ext2/fsync.c linux-2.0.37-pre10/fs/ext2/fsync.c --- linux-2.0.37-pre9/fs/ext2/fsync.c 1998-07-13 13:47:34.000000000 -0700 +++ linux-2.0.37-pre10/fs/ext2/fsync.c 2003-08-15 15:04:45.000000000 -0700 @@ -10,6 +10,8 @@ * linux/fs/minix/truncate.c Copyright (C) 1991, 1992 Linus Torvalds * * ext2fs fsync primitive + * + * Fast 'fsync' on large files (Scott Laird ) */ #include @@ -173,6 +175,13 @@ */ goto skip; + /* fsync on large files is *slow*, so fall back to sync() if + * the file's over 10M */ + if (inode->i_size>10000000) { + file_fsync(inode,file); + goto skip; + } + for (wait=0; wait<=1; wait++) { err |= sync_direct (inode, wait); diff -urN linux-2.0.37-pre9/fs/isofs/inode.c linux-2.0.37-pre10/fs/isofs/inode.c --- linux-2.0.37-pre9/fs/isofs/inode.c 2003-08-15 15:04:44.000000000 -0700 +++ linux-2.0.37-pre10/fs/isofs/inode.c 2003-08-15 15:04:45.000000000 -0700 @@ -554,12 +554,17 @@ return NULL; } +#ifdef DO_FUNKY_BROKEN_MEDIA_CHANGE_CHECK if(!check_disk_change(s->s_dev)) { return s; } if (s->u.isofs_sb.s_nls_iocharset) unload_nls(s->u.isofs_sb.s_nls_iocharset); if (opt.iocharset) kfree(opt.iocharset); +#else + check_disk_change(s->s_dev); + return s; +#endif out: /* Kick out for various error conditions */ brelse(bh); diff -urN linux-2.0.37-pre9/include/asm-i386/bugs.h linux-2.0.37-pre10/include/asm-i386/bugs.h --- linux-2.0.37-pre9/include/asm-i386/bugs.h 2003-08-15 15:04:44.000000000 -0700 +++ linux-2.0.37-pre10/include/asm-i386/bugs.h 2003-08-15 15:04:45.000000000 -0700 @@ -373,5 +373,6 @@ check_fpu(); check_hlt(); check_pentium_f00f(); + check_privacy(); system_utsname.machine[1] = '0' + x86; } diff -urN linux-2.0.37-pre9/include/linux/cyclades.h linux-2.0.37-pre10/include/linux/cyclades.h --- linux-2.0.37-pre9/include/linux/cyclades.h 2003-08-15 15:04:44.000000000 -0700 +++ linux-2.0.37-pre10/include/linux/cyclades.h 2003-08-15 15:04:45.000000000 -0700 @@ -316,6 +316,7 @@ #define C_IN_OVR_ERROR 0x00008000 /* overrun error */ #define C_IN_RXOFL 0x00010000 /* RX buffer overflow */ #define C_IN_IOCTLW 0x00020000 /* I/O control w/ wait */ +#define C_IN_MRTS 0x00040000 /* modem RTS drop */ /* flow control */ @@ -332,12 +333,14 @@ /* rs_control/rs_status RS-232 signals */ +#define C_RS_PARAM 0x80000000 /* Indicates presence of parameter in + IOCTLM command */ +#define C_RS_RTS 0x00000001 /* RTS */ +#define C_RS_DTR 0x00000004 /* DTR */ #define C_RS_DCD 0x00000100 /* CD */ #define C_RS_DSR 0x00000200 /* DSR */ #define C_RS_RI 0x00000400 /* RI */ #define C_RS_CTS 0x00000800 /* CTS */ -#define C_RS_RTS 0x00000001 /* RTS */ -#define C_RS_DTR 0x00000004 /* DTR */ /* commands Host <-> Board */ @@ -353,13 +356,18 @@ #define C_CM_SET_BREAK 0x43 /* Tx break on */ #define C_CM_CLR_BREAK 0x44 /* Tx break off */ #define C_CM_CMD_DONE 0x45 /* Previous command done */ +#define C_CM_INTBACK2 0x46 /* Alternate Interrupt back */ #define C_CM_TINACT 0x51 /* set inactivity detection */ #define C_CM_IRQ_ENBL 0x52 /* enable generation of interrupts */ #define C_CM_IRQ_DSBL 0x53 /* disable generation of interrupts */ -#define C_CM_ACK_ENBL 0x54 /* enable acknolowdged interrupt mode */ -#define C_CM_ACK_DSBL 0x55 /* disable acknolowdged intr mode */ +#define C_CM_ACK_ENBL 0x54 /* enable acknowledged interrupt mode */ +#define C_CM_ACK_DSBL 0x55 /* disable acknowledged intr mode */ #define C_CM_FLUSH_RX 0x56 /* flushes Rx buffer */ #define C_CM_FLUSH_TX 0x57 /* flushes Tx buffer */ +#define C_CM_Q_ENABLE 0x58 /* enables queue access from the + driver */ +#define C_CM_Q_DISABLE 0x59 /* disables queue access from the + driver */ #define C_CM_TXBEMPTY 0x60 /* Tx buffer is empty */ #define C_CM_TXLOWWM 0x61 /* Tx buffer low water mark */ @@ -369,6 +377,7 @@ #define C_CM_MDSR 0x71 /* modem DSR change */ #define C_CM_MRI 0x72 /* modem RI change */ #define C_CM_MCTS 0x73 /* modem CTS change */ +#define C_CM_MRTS 0x74 /* modem RTS drop */ #define C_CM_RXBRK 0x84 /* Break received */ #define C_CM_PR_ERROR 0x85 /* Parity error */ #define C_CM_FR_ERROR 0x86 /* Frame error */ @@ -449,9 +458,22 @@ /* FW to Host commands */ uclong fwcmd_channel; /* channel number */ uclong fwcmd_param; /* pointer to parameters */ + uclong zf_int_queue_addr; /* offset for INT_QUEUE structure */ /* filler so the structures are aligned */ - uclong filler[7]; + uclong filler[6]; +}; + +/* Host Interrupt Queue */ + +#define QUEUE_SIZE (10*MAX_CHAN) + +struct INT_QUEUE { + unsigned char intr_code[QUEUE_SIZE]; + unsigned long channel[QUEUE_SIZE]; + unsigned long param[QUEUE_SIZE]; + unsigned long put; + unsigned long get; }; /* @@ -581,11 +603,13 @@ #define CyISA_Ywin 0x2000 #define CyPCI_Ywin 0x4000 -#define CyPCI_Yctl 0x80 +#define CyPCI_Yctl 0x80 #define CyPCI_Zctl CTRL_WINDOW_SIZE #define CyPCI_Zwin 0x80000 #define CyPCI_Ze_win (2 * CyPCI_Zwin) +#define PCI_DEVICE_ID_MASK 0x06 + /**** CD1400 registers ****/ #define CD1400_REV_G 0x46 diff -urN linux-2.0.37-pre9/include/linux/nls.h linux-2.0.37-pre10/include/linux/nls.h --- linux-2.0.37-pre9/include/linux/nls.h 2003-08-15 15:04:44.000000000 -0700 +++ linux-2.0.37-pre10/include/linux/nls.h 2003-08-15 15:04:45.000000000 -0700 @@ -42,6 +42,7 @@ extern int init_nls_iso8859_7(void); extern int init_nls_iso8859_8(void); extern int init_nls_iso8859_9(void); +extern int init_nls_iso8859_15(void); extern int init_nls_cp437(void); extern int init_nls_cp737(void); extern int init_nls_cp775(void); diff -urN linux-2.0.37-pre9/include/linux/pci.h linux-2.0.37-pre10/include/linux/pci.h --- linux-2.0.37-pre9/include/linux/pci.h 2003-08-15 15:04:44.000000000 -0700 +++ linux-2.0.37-pre10/include/linux/pci.h 2003-08-15 15:04:45.000000000 -0700 @@ -819,6 +819,10 @@ #define PCI_VENDOR_ID_CYCLADES 0x120e #define PCI_DEVICE_ID_CYCLOM_Y_Lo 0x0100 #define PCI_DEVICE_ID_CYCLOM_Y_Hi 0x0101 +#define PCI_DEVICE_ID_CYCLOM_4Y_Lo 0x0102 +#define PCI_DEVICE_ID_CYCLOM_4Y_Hi 0x0103 +#define PCI_DEVICE_ID_CYCLOM_8Y_Lo 0x0104 +#define PCI_DEVICE_ID_CYCLOM_8Y_Hi 0x0105 #define PCI_DEVICE_ID_CYCLOM_Z_Lo 0x0200 #define PCI_DEVICE_ID_CYCLOM_Z_Hi 0x0201