Messages in this thread Patch in this message | | | From | Ricky Beam <> | Subject | Fixed, fixed, and fixed | Date | Sat, 3 May 1997 02:12:15 -0400 (EDT) |
| |
[somebody see that Linus and company see this -- I've still got Linus' email listed in Finland.]
Patches to 2.1.36: Updates a few things for the eepro.c -- Intel EtherExpress Pro -- driver to work sanely as a module (well, sane_r_) I don't think I ever fixed the little problem of the card never leaving promisc mode. The driver will now properly handle an Intel EtherExpress Pro/10+. Your milage may vary. [Gee, I guess I did fix the promisc thing?]
Finishes the queue_task_irq_off transformations.
Adds some symbols for modules to load.
Fixes the previously posted problem with smp_lock.h __asm__ code... just don't version those two symbols.
Fixes the unresolved symbol (ltalk_setup) for ltpc.c as a module.
Misc. other little things to make things shutup. (#includes here and there)
So, anybody nailed down why SMP reboots the machine? My tomcatIII reboots too fast for me to see where it is failing.
The patch: diff -u --recursive --new-file linux-v2.1.36/arch/i386/kernel/i386_ksyms.c local-v2.1.36/arch/i386/kernel/i386_ksyms.c --- linux-v2.1.36/arch/i386/kernel/i386_ksyms.c Wed Apr 16 19:04:15 1997 +++ local-v2.1.36/arch/i386/kernel/i386_ksyms.c Sat May 3 00:06:28 1997 @@ -39,8 +39,8 @@ #ifdef __SMP__ EXPORT_SYMBOL(apic_reg); /* Needed internally for the I386 inlines */ EXPORT_SYMBOL(cpu_data); -EXPORT_SYMBOL(kernel_flag); -EXPORT_SYMBOL(active_kernel_processor); +EXPORT_SYMBOL_NOVERS(kernel_flag); +EXPORT_SYMBOL_NOVERS(active_kernel_processor); EXPORT_SYMBOL(smp_invalidate_needed); EXPORT_SYMBOL_NOVERS(__lock_kernel); diff -u --recursive --new-file linux-v2.1.36/arch/i386/kernel/smp.c local-v2.1.36/arch/i386/kernel/smp.c --- linux-v2.1.36/arch/i386/kernel/smp.c Wed Apr 16 19:52:23 1997 +++ local-v2.1.36/arch/i386/kernel/smp.c Sat May 3 01:36:14 1997 @@ -157,7 +157,7 @@ volatile unsigned long smp_proc_in_lock[NR_CPUS] = {0,};/* for computing process time */ volatile int smp_process_available=0; -/*#define SMP_DEBUG*/ +#define SMP_DEBUG/*CRAMER*/ #ifdef SMP_DEBUG #define SMP_PRINTK(x) printk x diff -u --recursive --new-file linux-v2.1.36/drivers/block/ll_rw_blk.c local-v2.1.36/drivers/block/ll_rw_blk.c --- linux-v2.1.36/drivers/block/ll_rw_blk.c Thu Apr 17 16:20:44 1997 +++ local-v2.1.36/drivers/block/ll_rw_blk.c Fri May 2 21:40:29 1997 @@ -10,6 +10,7 @@ */ #include <linux/sched.h> #include <linux/kernel.h> +#include <linux/tqueue.h> /*CRAMER*/ #include <linux/kernel_stat.h> #include <linux/errno.h> #include <linux/string.h> diff -u --recursive --new-file linux-v2.1.36/drivers/char/cyclades.c local-v2.1.36/drivers/char/cyclades.c --- linux-v2.1.36/drivers/char/cyclades.c Wed Apr 23 01:42:47 1997 +++ local-v2.1.36/drivers/char/cyclades.c Fri May 2 21:40:52 1997 @@ -286,6 +286,7 @@ #include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> +#include <linux/tqueue.h> /*CRAMER*/ #include <linux/bios32.h> #include <linux/pci.h> #include <linux/init.h> @@ -623,7 +624,7 @@ cy_sched_event(struct cyclades_port *info, int event) { info->event |= 1 << event; /* remember what kind of event and who */ - queue_task_irq_off(&info->tqueue, &tq_cyclades); /* it belongs to */ + queue_task(&info->tqueue, &tq_cyclades); /* it belongs to */ mark_bh(CYCLADES_BH); /* then trigger event */ } /* cy_sched_event */ @@ -821,7 +822,7 @@ #endif } } - queue_task_irq_off(&tty->flip.tqueue, &tq_timer); + queue_task(&tty->flip.tqueue, &tq_timer); } /* end of service */ base_addr[CyRIR<<index] = (save_xir & 0x3f); diff -u --recursive --new-file linux-v2.1.36/drivers/char/esp.c local-v2.1.36/drivers/char/esp.c --- linux-v2.1.36/drivers/char/esp.c Wed Apr 23 01:42:47 1997 +++ local-v2.1.36/drivers/char/esp.c Fri May 2 21:41:44 1997 @@ -47,6 +47,7 @@ #include <linux/interrupt.h> #include <linux/tty.h> #include <linux/tty_flip.h> +#include <linux/tqueue.h> /*CRAMER*/ #include <linux/serial.h> #include <linux/serial_reg.h> #include <linux/major.h> diff -u --recursive --new-file linux-v2.1.36/drivers/char/istallion.c local-v2.1.36/drivers/char/istallion.c --- linux-v2.1.36/drivers/char/istallion.c Wed Apr 23 01:42:47 1997 +++ local-v2.1.36/drivers/char/istallion.c Fri May 2 21:41:55 1997 @@ -37,6 +37,7 @@ #include <linux/tty_driver.h> #include <linux/tty.h> #include <linux/tty_flip.h> +#include <linux/tqueue.h> /*CRAMER*/ #include <linux/serial.h> #include <linux/cdk.h> #include <linux/comstats.h> @@ -2450,7 +2451,7 @@ if (! ((portp->flags & ASYNC_CALLOUT_ACTIVE) && (portp->flags & ASYNC_CALLOUT_NOHUP))) { if (tty != (struct tty_struct *) NULL) - queue_task_irq_off(&portp->tqhangup, &tq_scheduler); + queue_task(&portp->tqhangup, &tq_scheduler); } } } diff -u --recursive --new-file linux-v2.1.36/drivers/char/pcxx.c local-v2.1.36/drivers/char/pcxx.c --- linux-v2.1.36/drivers/char/pcxx.c Wed Apr 23 01:42:47 1997 +++ local-v2.1.36/drivers/char/pcxx.c Fri May 2 21:42:09 1997 @@ -65,6 +65,7 @@ #include <linux/fcntl.h> #include <linux/ptrace.h> #include <linux/delay.h> +#include <linux/tqueue.h> /*CRAMER*/ #include <linux/serial.h> #include <linux/tty_driver.h> #include <linux/malloc.h> diff -u --recursive --new-file linux-v2.1.36/drivers/char/riscom8.c local-v2.1.36/drivers/char/riscom8.c --- linux-v2.1.36/drivers/char/riscom8.c Wed Apr 23 01:42:47 1997 +++ local-v2.1.36/drivers/char/riscom8.c Fri May 2 21:42:19 1997 @@ -31,6 +31,7 @@ #include <asm/io.h> #include <linux/kernel.h> +#include <linux/tqueue.h> /*CRAMER*/ #include <linux/sched.h> #include <linux/ioport.h> #include <linux/interrupt.h> @@ -337,7 +338,7 @@ * Still hope this will be changed in near future. */ set_bit(event, &port->event); - queue_task_irq_off(&port->tqueue, &tq_riscom); + queue_task(&port->tqueue, &tq_riscom); mark_bh(RISCOM8_BH); } @@ -419,7 +420,7 @@ *tty->flip.char_buf_ptr++ = ch; tty->flip.count++; - queue_task_irq_off(&tty->flip.tqueue, &tq_timer); + queue_task(&tty->flip.tqueue, &tq_timer); } extern inline void rc_receive(struct riscom_board const * bp) @@ -449,7 +450,7 @@ *tty->flip.flag_buf_ptr++ = 0; tty->flip.count++; } - queue_task_irq_off(&tty->flip.tqueue, &tq_timer); + queue_task(&tty->flip.tqueue, &tq_timer); } extern inline void rc_transmit(struct riscom_board const * bp) @@ -538,7 +539,7 @@ wake_up_interruptible(&port->open_wait); else if (!((port->flags & ASYNC_CALLOUT_ACTIVE) && (port->flags & ASYNC_CALLOUT_NOHUP))) - queue_task_irq_off(&port->tqueue_hangup, + queue_task(&port->tqueue_hangup, &tq_scheduler); } diff -u --recursive --new-file linux-v2.1.36/drivers/char/serial.c local-v2.1.36/drivers/char/serial.c --- linux-v2.1.36/drivers/char/serial.c Wed Apr 23 01:42:47 1997 +++ local-v2.1.36/drivers/char/serial.c Fri May 2 21:42:33 1997 @@ -36,6 +36,7 @@ #include <linux/interrupt.h> #include <linux/tty.h> #include <linux/tty_flip.h> +#include <linux/tqueue.h> /*CRAMER*/ #include <linux/serial.h> #include <linux/serial_reg.h> #include <linux/major.h> diff -u --recursive --new-file linux-v2.1.36/drivers/char/stallion.c local-v2.1.36/drivers/char/stallion.c --- linux-v2.1.36/drivers/char/stallion.c Wed Apr 23 01:42:47 1997 +++ local-v2.1.36/drivers/char/stallion.c Fri May 2 21:42:42 1997 @@ -36,6 +36,7 @@ #include <linux/tty_driver.h> #include <linux/tty.h> #include <linux/tty_flip.h> +#include <linux/tqueue.h> /*CRAMER*/ #include <linux/serial.h> #include <linux/cd1400.h> #include <linux/sc26198.h> @@ -3301,7 +3302,7 @@ len = (head >= tail) ? (head - tail) : (STL_TXBUFSIZE - (tail - head)); if ((len == 0) || ((len < STL_TXBUFLOW) && (test_bit(ASYI_TXLOW, &portp->istate) == 0))) { set_bit(ASYI_TXLOW, &portp->istate); - queue_task_irq_off(&portp->tqueue, &tq_scheduler); + queue_task(&portp->tqueue, &tq_scheduler); } if (len == 0) { @@ -3479,7 +3480,7 @@ misr = inb(ioaddr + EREG_DATA); if (misr & MISR_DCD) { set_bit(ASYI_DCDCHANGE, &portp->istate); - queue_task_irq_off(&portp->tqueue, &tq_scheduler); + queue_task(&portp->tqueue, &tq_scheduler); portp->stats.modem++; } @@ -4159,7 +4160,7 @@ len = (head >= tail) ? (head - tail) : (STL_TXBUFSIZE - (tail - head)); if ((len == 0) || ((len < STL_TXBUFLOW) && (test_bit(ASYI_TXLOW, &portp->istate) == 0))) { set_bit(ASYI_TXLOW, &portp->istate); - queue_task_irq_off(&portp->tqueue, &tq_scheduler); + queue_task(&portp->tqueue, &tq_scheduler); } if (len == 0) { @@ -4377,7 +4378,7 @@ ipr = stl_sc26198getreg(portp, IPR); if (ipr & IPR_DCDCHANGE) { set_bit(ASYI_DCDCHANGE, &portp->istate); - queue_task_irq_off(&portp->tqueue, &tq_scheduler); + queue_task(&portp->tqueue, &tq_scheduler); portp->stats.modem++; } break; diff -u --recursive --new-file linux-v2.1.36/drivers/char/wdt.c local-v2.1.36/drivers/char/wdt.c --- linux-v2.1.36/drivers/char/wdt.c Wed Apr 23 01:42:48 1997 +++ local-v2.1.36/drivers/char/wdt.c Fri May 2 21:49:41 1997 @@ -361,7 +361,7 @@ #ifdef CONFIG_WDT_501 misc_deregister(&temp_miscdev); #endif - notifier_chain_unregister(&boot_notifier_list, &wdt_notifier); + notifier_chain_unregister(&reboot_notifier_list, &wdt_notifier); release_region(io,8); free_irq(irq, NULL); } @@ -381,7 +381,7 @@ misc_register(&temp_miscdev); #endif request_region(io, 8, "wdt501"); - notifier_chain_register(&boot_notifier_list, &wdt_notifier); + notifier_chain_register(&reboot_notifier_list, &wdt_notifier); return 0; } diff -u --recursive --new-file linux-v2.1.36/drivers/isdn/hisax/isdnl1.c local-v2.1.36/drivers/isdn/hisax/isdnl1.c --- linux-v2.1.36/drivers/isdn/hisax/isdnl1.c Tue Feb 25 20:12:49 1997 +++ local-v2.1.36/drivers/isdn/hisax/isdnl1.c Fri May 2 21:15:39 1997 @@ -230,7 +230,7 @@ hscx_sched_event(struct HscxState *hsp, int event) { hsp->event |= 1 << event; - queue_task_irq_off(&hsp->tqueue, &tq_immediate); + queue_task(&hsp->tqueue, &tq_immediate); mark_bh(IMMEDIATE_BH); } @@ -248,7 +248,7 @@ isac_sched_event(struct IsdnCardState *sp, int event) { sp->event |= 1 << event; - queue_task_irq_off(&sp->tqueue, &tq_immediate); + queue_task(&sp->tqueue, &tq_immediate); mark_bh(IMMEDIATE_BH); } diff -u --recursive --new-file linux-v2.1.36/drivers/isdn/isdn_tty.c local-v2.1.36/drivers/isdn/isdn_tty.c --- linux-v2.1.36/drivers/isdn/isdn_tty.c Tue Feb 25 20:12:50 1997 +++ local-v2.1.36/drivers/isdn/isdn_tty.c Fri May 2 22:07:29 1997 @@ -140,6 +140,9 @@ #define __NO_VERSION__ #include <linux/config.h> #include <linux/module.h> +#include <linux/kernel.h> /*CRAMER*/ +#include <linux/stddef.h> /*CRAMER*/ +#include <linux/tqueue.h> /*CRAMER*/ #include <linux/isdn.h> #include "isdn_common.h" #include "isdn_tty.h" @@ -212,7 +215,7 @@ } if (info->emu.mdmreg[12] & 128) tty->flip.flag_buf_ptr[len - 1] = 0xff; - queue_task_irq_off(&tty->flip.tqueue, &tq_timer); + queue_task(&tty->flip.tqueue, &tq_timer); SET_SKB_FREE(skb); kfree_skb(skb, FREE_READ); return 1; @@ -263,7 +266,7 @@ tty->flip.flag_buf_ptr += r; tty->flip.char_buf_ptr += r; if (r) - queue_task_irq_off(&tty->flip.tqueue, &tq_timer); + queue_task(&tty->flip.tqueue, &tq_timer); restore_flags(flags); } } else diff -u --recursive --new-file linux-v2.1.36/drivers/isdn/teles/card.c local-v2.1.36/drivers/isdn/teles/card.c --- linux-v2.1.36/drivers/isdn/teles/card.c Tue Feb 25 20:12:50 1997 +++ local-v2.1.36/drivers/isdn/teles/card.c Fri May 2 21:15:39 1997 @@ -350,7 +350,7 @@ hscx_sched_event(struct HscxState *hsp, int event) { hsp->event |= 1 << event; - queue_task_irq_off(&hsp->tqueue, &tq_immediate); + queue_task(&hsp->tqueue, &tq_immediate); mark_bh(IMMEDIATE_BH); } @@ -544,7 +544,7 @@ isac_sched_event(struct IsdnCardState *sp, int event) { sp->event |= 1 << event; - queue_task_irq_off(&sp->tqueue, &tq_immediate); + queue_task(&sp->tqueue, &tq_immediate); mark_bh(IMMEDIATE_BH); } diff -u --recursive --new-file linux-v2.1.36/drivers/net/eepro.c local-v2.1.36/drivers/net/eepro.c --- linux-v2.1.36/drivers/net/eepro.c Wed Apr 23 01:42:49 1997 +++ local-v2.1.36/drivers/net/eepro.c Sat May 3 01:40:46 1997 @@ -48,14 +48,14 @@ print out format. (BCH, 3/9/95 and 3/14/95) 0.06 First stable release that I am comfortable with. (BCH, - 3/2/95) + 3/2/95) - 0.05 Complete testing of multicast. (BCH, 2/23/95) + 0.05 Complete testing of multicast. (BCH, 2/23/95) - 0.04 Adding multicast support. (BCH, 2/14/95) + 0.04 Adding multicast support. (BCH, 2/14/95) 0.03 First widely alpha release for public testing. - (BCH, 2/14/95) + (BCH, 2/14/95) */ @@ -148,7 +148,7 @@ /* Index to functions, as function prototypes. */ -extern int eepro_probe(struct device *dev); +extern int eepro_probe(struct device *dev); static int eepro_probe1(struct device *dev, short ioaddr); static int eepro_open(struct device *dev); @@ -217,9 +217,9 @@ #define XMT_CHAIN 0x04 #define XMT_COUNT 0x06 -#define BANK0_SELECT 0x00 -#define BANK1_SELECT 0x40 -#define BANK2_SELECT 0x80 +#define BANK0_SELECT 0x00 +#define BANK1_SELECT 0x40 +#define BANK2_SELECT 0x80 /* Bank 0 registers */ #define COMMAND_REG 0x00 /* Register 0 */ @@ -279,7 +279,7 @@ #define REG13 0x0d #define FDX 0x00 #define A_N_ENABLE 0x02 - + #define I_ADD_REG0 0x04 #define I_ADD_REG1 0x05 #define I_ADD_REG2 0x06 @@ -339,19 +339,24 @@ int i; int eepro; /* a flag, TRUE=1 for the EtherExpress Pro/10, FALSE = 0 for other 82595-based lan cards. */ - const char *ifmap[] = {"AUI", "10Base2", "10BaseT"}; - enum iftype { AUI=0, BNC=1, TPE=2 }; + /*CRAMER -- 2 lines*/ + const char *ifmap[] = {"AUI", "10Base2", "10BaseT", "Auto"}; + enum iftype { AUI=0, BNC=1, TPE=2, AUTO=3 }; /* Now, we are going to check for the signature of the ID_REG (register 2 of bank 0) */ + /* CRAMER */ + outb(BANK0_SELECT, ioaddr); /* Switch back to Bank 0 */ + /* Yes, this breaks the rules... */ + if (((id=inb(ioaddr + ID_REG)) & ID_REG_MASK) == ID_REG_SIG) { /* We seem to have the 82595 signature, let's play with its counter (last 2 bits of register 2 of bank 0) to be sure. */ - - counter = (id & R_ROBIN_BITS); + + counter = (id & R_ROBIN_BITS); if (((id=inb(ioaddr+ID_REG)) & R_ROBIN_BITS) == (counter + 0x40)) { @@ -379,29 +384,37 @@ /* Fill in the 'dev' fields. */ dev->base_addr = ioaddr; - + for (i=0; i < 6; i++) { dev->dev_addr[i] = ((unsigned char *) station_addr)[5-i]; printk("%c%02x", i ? ':' : ' ', dev->dev_addr[i]); } - + if ((dev->mem_end & 0x3f) < 3 || /* RX buffer must be more than 3K */ (dev->mem_end & 0x3f) > 29) /* and less than 29K */ dev->mem_end = RCV_RAM; /* or it will be set to 24K */ - else dev->mem_end = 1024*dev->mem_end; /* Maybe I should shift << 10 */ + else + dev->mem_end = 1024*dev->mem_end; /* Maybe I should shift << 10 */ /* From now on, dev->mem_end contains the actual size of rx buffer */ - + if (net_debug > 3) printk(", %dK RCV buffer", (int)(dev->mem_end)/1024); - + outb(BANK2_SELECT, ioaddr); /* be CAREFUL, BANK 2 now */ id = inb(ioaddr + REG3); - if (id & TPE_BIT) + /*CRAMER -- 8 lines*/ + if (id & (TPE_BIT|BNC_BIT)) + dev->if_port = AUI; + else if (id & TPE_BIT) dev->if_port = TPE; - else dev->if_port = BNC; + else if (id & BNC_BIT) + dev->if_port = BNC; + else + dev->if_port = AUTO; - if (dev->irq < 2 && eepro) { + if (dev->irq < 2) { + if (eepro) { i = read_eeprom(ioaddr, 1); switch (i & 0x07) { case 0: dev->irq = 9; break; @@ -413,20 +426,39 @@ printk(" illegal interrupt vector stored in EEPROM.\n"); return ENODEV; } - } - else if (dev->irq == 2) + } else { /* CRAMER */ + i = read_eeprom(ioaddr, 1); + switch (i & 0x07) { + case 0: dev->irq = 3; break; + case 1: dev->irq = 4; break; + case 2: dev->irq = 5; break; + case 3: dev->irq = 7; break; + case 4: dev->irq = 9; break; + case 5: dev->irq = 10; break; + case 6: dev->irq = 11; break; + case 7: dev->irq = 12; break; + default: + printk(" [IRQ:%d] ", i & 0x07); + return ENODEV; + } + } + } else + if (dev->irq == 2) dev->irq = 9; if (dev->irq > 2) { printk(", IRQ %d, %s.\n", dev->irq, ifmap[dev->if_port]); +/* CRAMER: Module-> grab and hold IRQ */ +#ifdef MODULE if (request_irq(dev->irq, &eepro_interrupt, 0, "eepro", NULL)) { printk("%s: unable to get IRQ %d.\n", dev->name, dev->irq); return -EAGAIN; } - } - else printk(", %s.\n", ifmap[dev->if_port]); - +#endif + } else + printk(", %s.\n", ifmap[dev->if_port]); + if ((dev->mem_start & 0xf) > 0) /* I don't know if this is */ net_debug = dev->mem_start & 7; /* still useful or not */ @@ -479,18 +511,26 @@ there is non-reboot way to recover if something goes wrong. */ -static char irqrmap[] = {-1,-1,0,1,-1,2,-1,-1,-1,0,3,4,-1,-1,-1,-1}; +/*CRAMER*/ +/* IRQ -> 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15 */ +static char irqrmap[2][16] ={{-1,-1, 4, 0, 1, 2,-1, 3,-1, 4, 5, 6, 7,-1,-1,-1}, + {-1,-1, 0, 1,-1, 2,-1,-1,-1, 0, 3, 4,-1,-1,-1,-1} + }; static int eepro_grab_irq(struct device *dev) { - int irqlist[] = { 5, 9, 10, 11, 4, 3, 0}; - int *irqp = irqlist, temp_reg, ioaddr = dev->base_addr; + /*CRAMER*/ + const int eepro = ((struct eepro_local *)dev->priv)->eepro; + int irqlist[2][9] = { { 12, 11, 10, 9, 7, 5, 4, 3, 0}, /* 82595*/ + { 11, 10, 9, 5, 4, 3, 0} /*Pro/10*/ + }; + int *irqp = irqlist[eepro], temp_reg, ioaddr = dev->base_addr; outb(BANK1_SELECT, ioaddr); /* be CAREFUL, BANK 1 now */ /* Enable the interrupt line. */ temp_reg = inb(ioaddr + REG1); outb(temp_reg | INT_ENABLE, ioaddr + REG1); - + outb(BANK0_SELECT, ioaddr); /* be CAREFUL, BANK 0 now */ /* clear all interrupts */ @@ -502,7 +542,7 @@ outb(BANK1_SELECT, ioaddr); /* be CAREFUL, BANK 1 now */ temp_reg = inb(ioaddr + INT_NO_REG); - outb((temp_reg & 0xf8) | irqrmap[*irqp], ioaddr + INT_NO_REG); + outb((temp_reg & 0xf8) | irqrmap[eepro][*irqp], ioaddr + INT_NO_REG); outb(BANK0_SELECT, ioaddr); /* Switch back to Bank 0 */ @@ -511,7 +551,7 @@ autoirq_setup(0); outb(DIAGNOSE_CMD, ioaddr); /* RESET the 82595 */ - + if (*irqp == autoirq_report(2) && /* It's a good IRQ line */ (request_irq(dev->irq = *irqp, &eepro_interrupt, 0, "eepro", NULL) == 0)) break; @@ -549,19 +589,27 @@ printk("eepro: entering eepro_open routine.\n"); if (dev->dev_addr[0] == SA_ADDR0 && - dev->dev_addr[1] == SA_ADDR1 && - dev->dev_addr[2] == SA_ADDR2) + dev->dev_addr[1] == SA_ADDR1 && + dev->dev_addr[2] == SA_ADDR2) lp->eepro = 1; /* Yes, an Intel EtherExpress Pro/10 */ - else lp->eepro = 0; /* No, it is a generic 82585 lan card */ + else + lp->eepro = 0; /* No, it is a generic 82585 lan card */ - /* Get the interrupt vector for the 82595 */ +/* CRAMER: Search for IRQ if not supplied. */ + /* Get the interrupt vector for the 82595 */ if (dev->irq < 2 && eepro_grab_irq(dev) == 0) { printk("%s: unable to get IRQ %d.\n", dev->name, dev->irq); return -EAGAIN; } +/* CRAMER: else allocate the supplied IRQ when not a module */ +#ifndef MODULE + else if (request_irq(dev->irq, &eepro_interrupt, 0, "eepro", NULL)) { + printk("%s: unable to get IRQ %d.\n", dev->name, dev->irq); + return -EAGAIN; + } +#endif - if (irq2dev_map[dev->irq] != 0 - || (irq2dev_map[dev->irq] = dev) == 0) + if (irq2dev_map[dev->irq] != 0 || (irq2dev_map[dev->irq] = dev) == 0) return -EAGAIN; /* Initialize the 82595. */ @@ -570,7 +618,7 @@ temp_reg = inb(ioaddr + EEPROM_REG); lp->stepping = temp_reg >> 5; /* Get the stepping number of the 595 */ - + if (net_debug > 3) printk("The stepping of the 82595 is %d\n", lp->stepping); @@ -578,7 +626,7 @@ outb(temp_reg & 0xef, ioaddr + EEPROM_REG); for (i=0; i < 6; i++) outb(dev->dev_addr[i] , ioaddr + I_ADD_REG0 + i); - + temp_reg = inb(ioaddr + REG1); /* Setup Transmit Chaining */ outb(temp_reg | XMT_Chain_Int | XMT_Chain_ErrStop /* and discard bad RCV frames */ | RCV_Discard_BadFrame, ioaddr + REG1); @@ -591,9 +639,9 @@ /* Set the receiving mode */ outb(BANK1_SELECT, ioaddr); /* be CAREFUL, BANK 1 now */ - + temp_reg = inb(ioaddr + INT_NO_REG); - outb((temp_reg & 0xf8) | irqrmap[dev->irq], ioaddr + INT_NO_REG); + outb((temp_reg & 0xf8) | irqrmap[lp->eepro][dev->irq], ioaddr + INT_NO_REG); /* Initialize the RCV and XMT upper and lower limits */ outb(RCV_LOWER_LIMIT, ioaddr + RCV_LOWER_LIMIT_REG); @@ -653,15 +701,15 @@ else if (net_debug > 3) printk("i82595TX detected!\n"); } - + outb(SEL_RESET_CMD, ioaddr); /* We are supposed to wait for 2 us after a SEL_RESET */ SLOW_DOWN_IO; - SLOW_DOWN_IO; + SLOW_DOWN_IO; lp->tx_start = lp->tx_end = XMT_LOWER_LIMIT << 8; /* or = RCV_RAM */ lp->tx_last = 0; - + dev->tbusy = 0; dev->interrupt = 0; dev->start = 1; @@ -684,7 +732,7 @@ if (net_debug > 5) printk("eepro: entering eepro_send_packet routine.\n"); - + if (dev->tbusy) { /* If we get here, some higher level has decided we are broken. There should really be a "kick me" function call instead. */ @@ -705,7 +753,7 @@ /* Do I also need to flush the transmit buffers here? YES? */ lp->tx_start = lp->tx_end = rcv_ram; lp->tx_last = 0; - + dev->tbusy=0; dev->trans_start = jiffies; @@ -713,6 +761,14 @@ } + /* If some higher layer thinks we've missed an tx-done interrupt + we are passed NULL. Caution: dev_tint() handles the cli()/sti() + itself. */ + if (skb == NULL) { + dev_tint(dev); + return 0; + } + /* Block a timer-based transmit from overlapping. */ if (set_bit(0, (void*)&dev->tbusy) != 0) printk("%s: Transmitter access conflict.\n", dev->name); @@ -731,7 +787,7 @@ if (net_debug > 5) printk("eepro: exiting eepro_send_packet routine.\n"); - + return 0; } @@ -746,18 +802,18 @@ if (net_debug > 5) printk("eepro: entering eepro_interrupt routine.\n"); - + if (dev == NULL) { printk ("eepro_interrupt(): irq %d for unknown device.\n", irq); return; } dev->interrupt = 1; - + ioaddr = dev->base_addr; do { status = inb(ioaddr + STATUS_REG); - + if (status & RX_INT) { if (net_debug > 4) printk("eepro: packet received interrupt.\n"); @@ -779,13 +835,13 @@ /* Process the status of transmitted packets */ eepro_transmit_interrupt(dev); } - + } while ((boguscount-- > 0) && (status & 0x06)); dev->interrupt = 0; if (net_debug > 5) printk("eepro: exiting eepro_interrupt routine.\n"); - + return; } @@ -822,8 +878,11 @@ /* Reset the 82595 */ outb(RESET_CMD, ioaddr); +/* CRAMER: release the IRQ only if not a module */ +#ifndef MODULE /* release the interrupt */ free_irq(dev->irq, NULL); +#endif irq2dev_map[dev->irq] = 0; @@ -869,7 +928,7 @@ outb(BANK2_SELECT, ioaddr); /* be CAREFUL, BANK 2 now */ mode = inb(ioaddr + REG2); - outb(mode | PRMSC_Mode, ioaddr + REG2); + outb(mode | PRMSC_Mode, ioaddr + REG2); mode = inb(ioaddr + REG3); outb(mode, ioaddr + REG3); /* writing reg. 3 to complete the update */ outb(BANK0_SELECT, ioaddr); /* Return to BANK 0 now */ @@ -888,15 +947,17 @@ { unsigned short status, *eaddrs; int i, boguscount = 0; - + /* Disable RX and TX interrupts. Necessary to avoid corruption of the HOST_ADDRESS_REG by interrupt service routines. */ outb(ALL_MASK, ioaddr + INT_MASK_REG); outb(BANK2_SELECT, ioaddr); /* be CAREFUL, BANK 2 now */ - mode = inb(ioaddr + REG2); - outb(mode | Multi_IA, ioaddr + REG2); + mode = inb(ioaddr + REG2) + /*CRAMER*/ + & ~PRMSC_Mode; /* Turn off PRMSC_Mode */ + outb(mode | Multi_IA, ioaddr + REG2); mode = inb(ioaddr + REG3); outb(mode, ioaddr + REG3); /* writing reg. 3 to complete the update */ outb(BANK0_SELECT, ioaddr); /* Return to BANK 0 now */ @@ -959,7 +1020,7 @@ /* Re-enable RX and TX interrupts */ outb(ALL_MASK & ~(RX_MASK | TX_MASK), ioaddr + INT_MASK_REG); - + } outb(RCV_ENABLE_CMD, ioaddr); } @@ -979,10 +1040,10 @@ short ee_addr = ioaddr + EEPROM_REG; int read_cmd = location | EE_READ_CMD; short ctrl_val = EECS ; - + outb(BANK2_SELECT, ioaddr); outb(ctrl_val, ee_addr); - + /* Shift the read command bits out. */ for (i = 8; i >= 0; i--) { short outval = (read_cmd & (1 << i)) ? ctrl_val | EEDI @@ -994,7 +1055,7 @@ eeprom_delay(); } outb(ctrl_val, ee_addr); - + for (i = 16; i > 0; i--) { outb(ctrl_val | EESK, ee_addr); eeprom_delay(); retval = (retval << 1) | ((inb(ee_addr) & EEDO) ? 1 : 0); @@ -1056,12 +1117,12 @@ end = last + (((length + 3) >> 1) << 1) + XMT_HEADER; if (end >= RAM_SIZE) { /* the transmit buffer is wrapped around */ - if ((RAM_SIZE - last) <= XMT_HEADER) { + if ((RAM_SIZE - last) <= XMT_HEADER) { /* Arrrr!!!, must keep the xmt header together, several days were lost to chase this one down. */ last = rcv_ram; end = last + (((length + 3) >> 1) << 1) + XMT_HEADER; - } + } else end = rcv_ram + (end - RAM_SIZE); } @@ -1083,7 +1144,7 @@ /* A dummy read to flush the DRAM write pipeline */ status = inw(ioaddr + IO_PORT); - if (lp->tx_start == lp->tx_end) { + if (lp->tx_start == lp->tx_end) { outw(last, ioaddr + XMT_BAR); outb(XMT_CMD, ioaddr); lp->tx_start = last; /* I don't like to change tx_start here */ @@ -1108,7 +1169,7 @@ /* Enable RX and TX interrupts */ outb(ALL_MASK & ~(RX_MASK | TX_MASK), ioaddr + INT_MASK_REG); - + if (dev->tbusy) { dev->tbusy = 0; } @@ -1134,7 +1195,7 @@ if (net_debug > 5) printk("eepro: entering eepro_rx routine.\n"); - + /* Set the read pointer to the start of the RCV */ outw(rcv_car, ioaddr + HOST_ADDRESS_REG); rcv_event = inw(ioaddr + IO_PORT); @@ -1167,8 +1228,8 @@ outb(temp & ~(IO_32_BIT), ioaddr + INT_MASK_REG); } - - skb->protocol = eth_type_trans(skb,dev); + + skb->protocol = eth_type_trans(skb,dev); netif_rx(skb); lp->stats.rx_packets++; } @@ -1282,6 +1343,7 @@ dev_eepro.priv=NULL; /* If we don't do this, we can't re-insmod it later. */ + free_irq(dev_eepro.irq, NULL); /* CRAMER */ release_region(dev_eepro.base_addr, EEPRO_IO_EXTENT); } #endif /* MODULE */ diff -u --recursive --new-file linux-v2.1.36/drivers/net/ltpc.c local-v2.1.36/drivers/net/ltpc.c --- linux-v2.1.36/drivers/net/ltpc.c Wed Apr 23 01:42:49 1997 +++ local-v2.1.36/drivers/net/ltpc.c Sat May 3 00:09:11 1997 @@ -183,8 +183,8 @@ #include <linux/config.h> /* for CONFIG_MAX_16M */ #ifdef MODULE -#include <linux/module.h> #include <linux/version.h> +#include <linux/module.h> #endif #include <linux/kernel.h> @@ -1259,7 +1259,7 @@ if(debug&DEBUG_VERBOSE) printk("waiting\n"); /* if it's in process, wait a bit for it to finish */ timeout = jiffies+HZ; - add_timer(<pc_timer) + add_timer(<pc_timer); /*CRAMER -- ; */ while(del_timer(<pc_timer) && (timeout > jiffies)) { add_timer(<pc_timer); diff -u --recursive --new-file linux-v2.1.36/drivers/net/net_init.c local-v2.1.36/drivers/net/net_init.c --- linux-v2.1.36/drivers/net/net_init.c Thu Apr 10 00:30:30 1997 +++ local-v2.1.36/drivers/net/net_init.c Sat May 3 00:34:59 1997 @@ -248,7 +248,7 @@ #endif -#ifdef CONFIG_ATALK +#if defined(CONFIG_ATALK) || defined(CONFIG_ATALK_MODULE) static int ltalk_change_mtu(struct device *dev, int mtu) { diff -u --recursive --new-file linux-v2.1.36/drivers/scsi/aic7xxx.c local-v2.1.36/drivers/scsi/aic7xxx.c --- linux-v2.1.36/drivers/scsi/aic7xxx.c Wed Apr 23 11:54:21 1997 +++ local-v2.1.36/drivers/scsi/aic7xxx.c Fri May 2 01:39:47 1997 @@ -1521,7 +1521,12 @@ int scb_index = p->scb_link->numscbs; int scb_size = sizeof(struct aic7xxx_scb); +#ifdef notdef p->scb_array[scb_index] = kmalloc(scb_size, GFP_ATOMIC | GFP_DMA); +#else + /* CRAMER -- DMA not required for PCI */ + p->scb_array[scb_index] = kmalloc(scb_size, GFP_ATOMIC); +#endif scbp = (p->scb_array[scb_index]); if (scbp != NULL) { @@ -2868,6 +2873,8 @@ printk(KERN_WARNING "scsi%d: Queue full.\n", p->host_no); scb->state |= SCB_ASSIGNEDQ; scbq_insert_tail(&p->assigned_scbs, scb); + /*CRAMER*/ + udelay(10000); break; default: diff -u --recursive --new-file linux-v2.1.36/drivers/scsi/ppa.c local-v2.1.36/drivers/scsi/ppa.c --- linux-v2.1.36/drivers/scsi/ppa.c Thu Apr 17 17:48:53 1997 +++ local-v2.1.36/drivers/scsi/ppa.c Fri May 2 22:02:37 1997 @@ -120,6 +120,9 @@ #include "ppa.h" /* batteries not included :-) */ +#include <linux/stddef.h> /*CRAMER*/ +#include <linux/tqueue.h> /*CRAMER*/ + /* * modes in which the driver can operate */ diff -u --recursive --new-file linux-v2.1.36/fs/nfsd/lockd.c local-v2.1.36/fs/nfsd/lockd.c --- linux-v2.1.36/fs/nfsd/lockd.c Fri Apr 4 14:06:02 1997 +++ local-v2.1.36/fs/nfsd/lockd.c Fri May 2 22:12:14 1997 @@ -8,6 +8,7 @@ * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de> */ +#include <linux/kernel.h> /*CRAMER*/ #include <linux/types.h> #include <linux/sunrpc/clnt.h> #include <linux/sunrpc/svc.h> diff -u --recursive --new-file linux-v2.1.36/include/asm-i386/hardirq.h local-v2.1.36/include/asm-i386/hardirq.h --- linux-v2.1.36/include/asm-i386/hardirq.h Thu Apr 17 16:29:53 1997 +++ local-v2.1.36/include/asm-i386/hardirq.h Fri May 2 02:02:49 1997 @@ -19,6 +19,7 @@ #else #include <asm/atomic.h> +#include <asm/smp.h> /*CRAMER*/ extern unsigned char global_irq_holder; extern unsigned volatile int global_irq_lock; diff -u --recursive --new-file linux-v2.1.36/include/linux/interrupt.h local-v2.1.36/include/linux/interrupt.h --- linux-v2.1.36/include/linux/interrupt.h Wed Apr 23 02:08:39 1997 +++ local-v2.1.36/include/linux/interrupt.h Fri May 2 05:27:09 1997 @@ -3,8 +3,10 @@ #define _LINUX_INTERRUPT_H #include <linux/kernel.h> +#include <linux/stddef.h> /*CRAMER*/ #include <asm/bitops.h> #include <asm/atomic.h> +#include <asm/system.h> /*CRAMER*/ struct irqaction { void (*handler)(int, void *, struct pt_regs *); diff -u --recursive --new-file linux-v2.1.36/kernel/ksyms.c local-v2.1.36/kernel/ksyms.c --- linux-v2.1.36/kernel/ksyms.c Wed Apr 23 01:49:38 1997 +++ local-v2.1.36/kernel/ksyms.c Sat May 3 00:28:35 1997 @@ -121,6 +121,18 @@ EXPORT_SYMBOL(exit_mm); EXPORT_SYMBOL(exit_files); +/* CRAMER symbols */ +EXPORT_SYMBOL(synchronize_irq); +EXPORT_SYMBOL(reboot_notifier_list); +#if defined(CONFIG_ATALK) || defined(CONFIG_ATALK_MODULE) +# include <linux/if_ltalk.h> + EXPORT_SYMBOL(ltalk_setup); +#endif +#ifdef CONFIG_DLCI_MODULE + extern int (*dlci_ioctl_hook)(unsigned int, void *); + EXPORT_SYMBOL(dlci_ioctl_hook); +#endif + /* internal kernel memory management */ EXPORT_SYMBOL(__get_free_pages); EXPORT_SYMBOL(free_pages); diff -u --recursive --new-file linux-v2.1.36/net/core/sock.c local-v2.1.36/net/core/sock.c --- linux-v2.1.36/net/core/sock.c Wed Apr 23 01:46:27 1997 +++ local-v2.1.36/net/core/sock.c Fri May 2 01:41:51 1997 @@ -188,9 +188,11 @@ * The spec isnt clear if ENOBUFS or EINVAL * is best */ - if(val > SK_WMEM_MAX*2) - return -EINVAL; + val = SK_WMEM_MAX*2; + if(val < 256) + val = 256; + /* * Once this is all 32bit values we can * drop this check. @@ -198,6 +200,7 @@ if(val > 65535) return -EINVAL; sk->sndbuf = max(val,2048); + /* * Wake up sending tasks if we * upped the value.
| |