]> git.hungrycats.org Git - linux/commitdiff
v2.4.14.4 -> v2.4.14.5
authorLinus Torvalds <torvalds@athlon.transmeta.com>
Tue, 5 Feb 2002 04:33:47 +0000 (20:33 -0800)
committerLinus Torvalds <torvalds@athlon.transmeta.com>
Tue, 5 Feb 2002 04:33:47 +0000 (20:33 -0800)
  - Greg KH: enable hotplug driver support
  - Andrea Arcangeli: remove bogus sanity check
  - David Mosberger: /proc/cpuinfo and scsi scatter-gather for ia64
  - David Hinds: 16-bit pcmcia network driver updates/cleanups
  - Hugh Dickins: remove some stale code from VM
  - David Miller: /proc/cpuinfo for sparc, sparc fork bug fix, network
  fixes, warning fixes
  - Peter Braam: intermezzo update
  - Greg KH: USB updates
  - Ivan Kokshaysky: /proc/cpuinfo for alpha
  - David Woodhouse: jffs2 - remove dead code, remove gcc3 warning
  - Hugh Dickins: fix kiobuf page allocation/deallocation

121 files changed:
Documentation/Configure.help
Makefile
arch/alpha/kernel/proto.h
arch/alpha/kernel/setup.c
arch/alpha/kernel/smp.c
arch/i386/config.in
arch/i386/defconfig
arch/i386/kernel/i386_ksyms.c
arch/i386/kernel/io_apic.c
arch/i386/kernel/setup.c
arch/ia64/kernel/setup.c
arch/ia64/lib/swiotlb.c
arch/sparc/defconfig
arch/sparc/kernel/ebus.c
arch/sparc/kernel/entry.S
arch/sparc/kernel/process.c
arch/sparc/kernel/setup.c
arch/sparc/kernel/smp.c
arch/sparc/mm/srmmu.c
arch/sparc/mm/sun4c.c
arch/sparc64/config.in
arch/sparc64/defconfig
arch/sparc64/kernel/ebus.c
arch/sparc64/kernel/ioctl32.c
arch/sparc64/kernel/irq.c
arch/sparc64/kernel/isa.c
arch/sparc64/kernel/setup.c
arch/sparc64/kernel/smp.c
arch/sparc64/mm/init.c
arch/sparc64/mm/ultra.S
drivers/atm/Config.in
drivers/atm/atmdev_init.c
drivers/atm/idt77252.c
drivers/atm/idt77252.h
drivers/atm/suni.c
drivers/char/acpi_serial.c
drivers/char/rtc.c
drivers/ide/pdc202xx.c
drivers/ide/pdcraid.c
drivers/net/Config.in
drivers/net/bmac.c
drivers/net/bonding.c
drivers/net/pcmcia/3c574_cs.c
drivers/net/pcmcia/3c589_cs.c
drivers/net/pcmcia/fmvj18x_cs.c
drivers/net/pcmcia/nmclan_cs.c
drivers/net/pcmcia/pcnet_cs.c
drivers/net/pcmcia/smc91c92_cs.c
drivers/net/pcmcia/xirc2ps_cs.c
drivers/net/sk98lin/skvpd.c
drivers/pcmcia/yenta.c
drivers/sbus/char/su.c
drivers/scsi/aic7xxx/aic7xxx_linux_pci.c
drivers/scsi/osst.c
drivers/sound/trident.c
drivers/usb/bluetooth.c
drivers/usb/catc.c
drivers/usb/hid.h
drivers/usb/kaweth.c
drivers/usb/serial/ftdi_sio.c
drivers/usb/serial/io_edgeport.c
drivers/usb/serial/io_tables.h
drivers/usb/serial/io_usbvend.h
drivers/usb/storage/freecom.c
drivers/usb/storage/isd200.c
drivers/video/Config.in
drivers/video/acornfb.c
drivers/video/amifb.c
drivers/video/controlfb.c
drivers/video/cyberfb.c
drivers/video/fbmem.c
drivers/video/fm2fb.c
drivers/video/igafb.c
drivers/video/imsttfb.c
drivers/video/macfb.c
drivers/video/matrox/matroxfb_base.c
drivers/video/platinumfb.c
drivers/video/radeonfb.c
drivers/video/retz3fb.c
drivers/video/riva/fbdev.c
drivers/video/sa1100fb.c
drivers/video/sgivwfb.c
drivers/video/sstfb.c
drivers/video/tdfxfb.c
drivers/video/tgafb.c
drivers/video/valkyriefb.c
drivers/video/vesafb.c
drivers/video/vfb.c
drivers/video/vga16fb.c
drivers/video/virgefb.c
fs/affs/super.c
fs/buffer.c
fs/ext3/file.c
fs/intermezzo/dcache.c
fs/intermezzo/dir.c
fs/intermezzo/journal.c
fs/intermezzo/journal_xfs.c
fs/intermezzo/methods.c
fs/intermezzo/presto.c
fs/intermezzo/vfs.c
fs/jffs2/nodelist.c
include/asm-i386/processor.h
include/asm-ia64/scatterlist.h
include/asm-sparc/io.h
include/asm-sparc/pci.h
include/asm-sparc/pgtable.h
include/asm-sparc/smp.h
include/asm-sparc64/io.h
include/asm-sparc64/pci.h
include/asm-sparc64/pgtable.h
include/linux/intermezzo_fs.h
include/linux/module.h
include/linux/swap.h
mm/filemap.c
mm/memory.c
mm/shmem.c
net/8021q/vlanproc.c
net/bridge/br_stp_bpdu.c
net/ipv4/ipconfig.c
net/ipv4/tcp_input.c
net/irda/irda_device.c

index b97ed9c1d28204c81bd99ae1e550a79989bceca1..9b4a26e9ad1b01642d77ca33789cab8deef946bf 100644 (file)
@@ -6147,6 +6147,31 @@ CONFIG_ATM_NICSTAR_USE_IDT77105
   This driver is required for proper handling of temporary carrier
   loss, so if you have a 25Mbps NICStAR based ATM card you must say Y.
 
+IDT 77252 (NICStAR II)
+CONFIG_ATM_IDT77252
+  Driver for the IDT 77252 ATM PCI chips.
+
+  This driver is also available as a module.  If you want to compile
+  it as a module, say M here and read
+  <file:Documentation/modules.txt>. The module will be called idt77252.o
+
+Enable debugging messages
+CONFIG_ATM_IDT77252_DEBUG
+  Somewhat useful debugging messages are available. The choice of
+  messages is controlled by a bitmap.  This may be specified as a
+  module argument.  See the file <file:drivers/atm/idt77252.h> for
+  the meanings of the bits in the mask.
+
+  When active, these messages can have a significant impact on the
+  speed of the driver, and the size of your syslog files! When
+  inactive, they will have only a modest impact on performance.
+
+Receive ALL cells in raw queue
+CONFIG_ATM_IDT77252_RCV_ALL
+  Enable receiving of all cells on the ATM link, that do not match
+  an open connection in the raw cell queue of the driver.  Useful
+  for debugging or special applications only, so the safe answer is N.
+
 Madge Ambassador (Collage PCI 155 Server)
 CONFIG_ATM_AMBASSADOR
   This is a driver for ATMizer based ATM card produced by Madge
@@ -12494,8 +12519,6 @@ CONFIG_USB_HIDDEV
   Say Y here if you want to support HID devices (from the USB
   specification standpoint) that aren't strictly user interface
   devices, like monitor controls and Uninterruptable Power Supplies.
-  It is also used for "consumer keys" on multimedia keyboards and
-  USB speakers.
 
   This module supports these devices separately using a separate
   event interface on /dev/usb/hiddevX (char 180:96 to 180:111).
index 2d8279ce5a7e083a634c2aee39c478a9199e272e..6448d3715ea7c79bf518861359ba04ab9fbbf3f2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
 SUBLEVEL = 15
-EXTRAVERSION =-pre4
+EXTRAVERSION =-pre5
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
index 7be5f6dc81ee38ed57c8a736a4a83b8990e21a29..170ee06fc5c23eeba6cea899b753417ce8cb1b04 100644 (file)
@@ -91,7 +91,6 @@ extern void unregister_srm_console(void);
 
 /* smp.c */
 extern void setup_smp(void);
-extern int smp_info(char *buffer);
 extern void handle_ipi(struct pt_regs *);
 extern void smp_percpu_timer_interrupt(struct pt_regs *);
 
index 141566649ea34b8844b97df742934b1568315c25..54495b1d08248b4055753de64deb994eb2f11156 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/ioport.h>
 #include <linux/bootmem.h>
 #include <linux/pci.h>
+#include <linux/seq_file.h>
 
 #ifdef CONFIG_BLK_DEV_INITRD
 #include <linux/blk.h>
@@ -1043,10 +1044,8 @@ get_nr_processors(struct percpu_struct *cpubase, unsigned long num)
 }
 
 
-/*
- * BUFFER is PAGE_SIZE bytes long.
- */
-int get_cpuinfo(char *buffer)
+static int
+show_cpuinfo(struct seq_file *f, void *slot)
 {
        extern struct unaligned_stat {
                unsigned long count, va, pc;
@@ -1058,14 +1057,15 @@ int get_cpuinfo(char *buffer)
                "EV68CX", "EV7", "EV79", "EV69"
        };
 
-       struct percpu_struct *cpu;
+       struct percpu_struct *cpu = slot;
        unsigned int cpu_index;
        char *cpu_name;
        char *systype_name;
        char *sysvariation_name;
-       int len, nr_processors;
+       int nr_processors;
 
-       cpu = (struct percpu_struct*)((char*)hwrpb + hwrpb->processor_offset);
+       if (!cpu)
+               return 1;
        cpu_index = (unsigned) (cpu->type - 1);
        cpu_name = "Unknown";
        if (cpu_index < N(cpu_names))
@@ -1076,8 +1076,7 @@ int get_cpuinfo(char *buffer)
 
        nr_processors = get_nr_processors(cpu, hwrpb->nr_processors);
 
-       len = sprintf(buffer,
-                     "cpu\t\t\t: Alpha\n"
+       seq_printf(f, "cpu\t\t\t: Alpha\n"
                      "cpu model\t\t: %s\n"
                      "cpu variation\t\t: %ld\n"
                      "cpu revision\t\t: %ld\n"
@@ -1114,12 +1113,42 @@ int get_cpuinfo(char *buffer)
                       platform_string(), nr_processors);
 
 #ifdef CONFIG_SMP
-       len += smp_info(buffer+len);
+       seq_printf(f, "cpus active\t\t: %d\n"
+                     "cpu active mask\t\t: %016lx\n",
+                      smp_num_cpus, cpu_present_mask);
 #endif
 
-       return len;
+       return 0;
+}
+
+/*
+ * We show only CPU #0 info.
+ */
+static void *
+c_start(struct seq_file *f, loff_t *pos)
+{
+       return *pos ? NULL : (char *)hwrpb + hwrpb->processor_offset;
+}
+
+static void *
+c_next(struct seq_file *f, void *v, loff_t *pos)
+{
+       return NULL;
 }
 
+static void
+c_stop(struct seq_file *f, void *v)
+{
+}
+
+struct seq_operations cpuinfo_op = {
+       start:  c_start,
+       next:   c_next,
+       stop:   c_stop,
+       show:   show_cpuinfo,
+};
+
+
 static int alpha_panic_event(struct notifier_block *this,
                             unsigned long event,
                             void *ptr)
index e7c736053d56e02e1fe1fd0a61db729976b35977..ad18fd97d8b3851e3888757d888c70827ce3f031 100644 (file)
@@ -1091,15 +1091,6 @@ flush_icache_page(struct vm_area_struct *vma, struct page *page)
        }
 }
 \f
-int
-smp_info(char *buffer)
-{
-       return sprintf(buffer,
-                      "cpus active\t\t: %d\n"
-                      "cpu active mask\t\t: %016lx\n",
-                      smp_num_cpus, cpu_present_mask);
-}
-\f
 #if DEBUG_SPINLOCK
 void
 spin_unlock(spinlock_t * lock)
index c98908d1aa0c719aeb5cce344ff1016a7236cf90..b534519c203047369c6a8b42340953a333be8f71 100644 (file)
@@ -234,8 +234,10 @@ bool 'Support for hot-pluggable devices' CONFIG_HOTPLUG
 
 if [ "$CONFIG_HOTPLUG" = "y" ] ; then
    source drivers/pcmcia/Config.in
+   source drivers/hotplug/Config.in
 else
    define_bool CONFIG_PCMCIA n
+   define_bool CONFIG_HOTPLUG_PCI n
 fi
 
 bool 'System V IPC' CONFIG_SYSVIPC
index c064a7f543001de71a525a849c152158c4ea5d9c..f225091013867724ecfd48fbd96cac9627361ac6 100644 (file)
@@ -88,6 +88,13 @@ CONFIG_CARDBUS=y
 # CONFIG_I82092 is not set
 # CONFIG_I82365 is not set
 # CONFIG_TCIC is not set
+
+#
+# PCI Hotplug Support
+#
+# CONFIG_HOTPLUG_PCI is not set
+# CONFIG_HOTPLUG_PCI_COMPAQ is not set
+# CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM is not set
 CONFIG_SYSVIPC=y
 # CONFIG_BSD_PROCESS_ACCT is not set
 CONFIG_SYSCTL=y
index 17d091d639cc01af39cab8618c4d2fa21ad19188..e82ed527e97255de187f71689e6517f22ea5289c 100644 (file)
@@ -163,10 +163,6 @@ extern void * memcpy(void *,const void *,__kernel_size_t);
 EXPORT_SYMBOL_NOVERS(memcpy);
 EXPORT_SYMBOL_NOVERS(memset);
 
-#ifdef CONFIG_X86_PAE
-EXPORT_SYMBOL(empty_zero_page);
-#endif
-
 #ifdef CONFIG_HAVE_DEC_LOCK
 EXPORT_SYMBOL(atomic_dec_and_lock);
 #endif
index f875e4309a0b3d8803585f8079bb4500b92e153c..1f98f7abbb7a43e570838109f3e11b3fac2eb96f 100644 (file)
@@ -753,7 +753,6 @@ void __init print_IO_APIC(void)
        printk(KERN_DEBUG ".......     : PRQ implemented: %X\n", reg_01.PRQ);
        printk(KERN_DEBUG ".......     : IO APIC version: %04X\n", reg_01.version);
        if (    (reg_01.version != 0x01) && /* 82489DX IO-APICs */
-               (reg_01.version != 0x02) && /* 82801BA IO-APICs (ICH2) */
                (reg_01.version != 0x10) && /* oldest IO-APICs */
                (reg_01.version != 0x11) && /* Pentium/Pro IO-APICs */
                (reg_01.version != 0x13) && /* Xeon IO-APICs */
index 1ba2d8b2d23603d96de99dc66e7e6f60f297c1aa..d2091941fdb6e8546e926b2ef21e9bff84d32000 100644 (file)
@@ -2788,7 +2788,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 
 static void *c_start(struct seq_file *m, loff_t *pos)
 {
-       return *pos < NR_CPUS ? &cpu_data[*pos] : NULL;
+       return *pos < NR_CPUS ? cpu_data + *pos : NULL;
 }
 static void *c_next(struct seq_file *m, void *v, loff_t *pos)
 {
index 7fb3b658b75de2ca4648df85d57e28cb29d1878f..7eda0246c98b7e3a8eae50ddcb55be0a9015e3d8 100644 (file)
@@ -2,12 +2,13 @@
  * Architecture-specific setup.
  *
  * Copyright (C) 1998-2001 Hewlett-Packard Co
- * Copyright (C) 1998-2001 David Mosberger-Tang <davidm@hpl.hp.com>
+ *     David Mosberger-Tang <davidm@hpl.hp.com>
  * Copyright (C) 1998, 1999, 2001 Stephane Eranian <eranian@hpl.hp.com>
  * Copyright (C) 2000, Rohit Seth <rohit.seth@intel.com>
  * Copyright (C) 1999 VA Linux Systems
  * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
  *
+ * 11/12/01 D.Mosberger Convert get_cpuinfo() to seq_file based show_cpuinfo().
  * 04/04/00 D.Mosberger renamed cpu_initialized to cpu_online_map
  * 03/31/00 R.Seth     cpu_initialized and current->processor fixes
  * 02/04/00 D.Mosberger        some more get_cpuinfo fixes...
@@ -23,6 +24,7 @@
 #include <linux/kernel.h>
 #include <linux/reboot.h>
 #include <linux/sched.h>
+#include <linux/seq_file.h>
 #include <linux/string.h>
 #include <linux/threads.h>
 #include <linux/console.h>
@@ -364,61 +366,89 @@ setup_arch (char **cmdline_p)
 /*
  * Display cpu info for all cpu's.
  */
-int
-get_cpuinfo (char *buffer)
+static int
+show_cpuinfo (struct seq_file *m, void *v)
 {
 #ifdef CONFIG_SMP
 #      define lpj      c->loops_per_jiffy
 #else
 #      define lpj      loops_per_jiffy
 #endif
-       char family[32], features[128], *cp, *p = buffer;
-       struct cpuinfo_ia64 *c;
-       unsigned long mask, cpu;
-
-       for (cpu = 0; cpu < smp_num_cpus; ++cpu) {
-               c = cpu_data(cpu);
-               mask = c->features;
-
-               switch (c->family) {
-                     case 0x07:        memcpy(family, "Itanium", 8); break;
-                     case 0x1f:        memcpy(family, "McKinley", 9); break;
-                     default:          sprintf(family, "%u", c->family); break;
-               }
+       char family[32], features[128], *cp;
+       struct cpuinfo_ia64 *c = v;
+       unsigned long mask, cpu = c - cpu_data(0);
 
-               /* build the feature string: */
-               memcpy(features, " standard", 10);
-               cp = features;
-               if (mask & 1) {
-                       strcpy(cp, " branchlong");
-                       cp = strchr(cp, '\0');
-                       mask &= ~1UL;
-               }
-               if (mask)
-                       sprintf(cp, " 0x%lx", mask);
-
-               p += sprintf(p,
-                            "processor  : %lu\n"
-                            "vendor     : %s\n"
-                            "arch       : IA-64\n"
-                            "family     : %s\n"
-                            "model      : %u\n"
-                            "revision   : %u\n"
-                            "archrev    : %u\n"
-                            "features   :%s\n" /* don't change this---it _is_ right! */
-                            "cpu number : %lu\n"
-                            "cpu regs   : %u\n"
-                            "cpu MHz    : %lu.%06lu\n"
-                            "itc MHz    : %lu.%06lu\n"
-                            "BogoMIPS   : %lu.%02lu\n\n",
-                            cpu, c->vendor, family, c->model, c->revision, c->archrev, features,
-                            c->ppn, c->number, c->proc_freq / 1000000, c->proc_freq % 1000000,
-                            c->itc_freq / 1000000, c->itc_freq % 1000000,
-                            lpj*HZ/500000, (lpj*HZ/5000) % 100);
+#ifdef CONFIG_SMP
+       if (!(cpu_online_map & (1 << cpu)))
+               return 0;
+#endif
+
+       mask = c->features;
+
+       switch (c->family) {
+             case 0x07:        memcpy(family, "Itanium", 8); break;
+             case 0x1f:        memcpy(family, "McKinley", 9); break;
+             default:          sprintf(family, "%u", c->family); break;
+       }
+
+       /* build the feature string: */
+       memcpy(features, " standard", 10);
+       cp = features;
+       if (mask & 1) {
+               strcpy(cp, " branchlong");
+               cp = strchr(cp, '\0');
+               mask &= ~1UL;
        }
-       return p - buffer;
+       if (mask)
+               sprintf(cp, " 0x%lx", mask);
+
+       seq_printf(m,
+                  "processor  : %lu\n"
+                  "vendor     : %s\n"
+                  "arch       : IA-64\n"
+                  "family     : %s\n"
+                  "model      : %u\n"
+                  "revision   : %u\n"
+                  "archrev    : %u\n"
+                  "features   :%s\n"   /* don't change this---it _is_ right! */
+                  "cpu number : %lu\n"
+                  "cpu regs   : %u\n"
+                  "cpu MHz    : %lu.%06lu\n"
+                  "itc MHz    : %lu.%06lu\n"
+                  "BogoMIPS   : %lu.%02lu\n\n",
+                  cpu, c->vendor, family, c->model, c->revision, c->archrev,
+                  features, c->ppn, c->number,
+                  c->proc_freq / 1000000, c->proc_freq % 1000000,
+                  c->itc_freq / 1000000, c->itc_freq % 1000000,
+                  lpj*HZ/500000, (lpj*HZ/5000) % 100);
+       return 0;
+}
+
+static void *
+c_start (struct seq_file *m, loff_t *pos)
+{
+       return *pos < NR_CPUS ? cpu_data(*pos) : NULL;
+}
+
+static void *
+c_next (struct seq_file *m, void *v, loff_t *pos)
+{
+       ++*pos;
+       return c_start(m, pos);
 }
 
+static void
+c_stop (struct seq_file *m, void *v)
+{
+}
+
+struct seq_operations cpuinfo_op = {
+       start:  c_start,
+       next:   c_next,
+       stop:   c_stop,
+       show:   show_cpuinfo
+};
+
 void
 identify_cpu (struct cpuinfo_ia64 *c)
 {
index 11d3f61121497140d107736363b09f546c7b9695..312dd49f9d4d3b1ad10e6d50591d481395d2043e 100644 (file)
 #define ALIGN(val, align) ((unsigned long)     \
        (((unsigned long) (val) + ((align) - 1)) & ~((align) - 1)))
 
+#define SG_ENT_VIRT_ADDRESS(sg)        ((sg)->address ? (sg)->address                  \
+                                : page_address((sg)->page) + (sg)->offset)
+#define SG_ENT_PHYS_ADDRESS(SG)        virt_to_phys(SG_ENT_VIRT_ADDRESS(SG))
+
 /*
  * log of the size of each IO TLB slab.  The number of slabs is command line controllable.
  */
@@ -392,15 +396,20 @@ swiotlb_sync_single (struct pci_dev *hwdev, dma_addr_t pci_addr, size_t size, in
 int
 swiotlb_map_sg (struct pci_dev *hwdev, struct scatterlist *sg, int nelems, int direction)
 {
+       void *addr;
        int i;
 
        if (direction == PCI_DMA_NONE)
                BUG();
 
        for (i = 0; i < nelems; i++, sg++) {
-               sg->page = sg->address;
-               if ((virt_to_phys(sg->address) & ~hwdev->dma_mask) != 0) {
-                       sg->address = map_single(hwdev, sg->address, sg->length, direction);
+               sg->orig_address = SG_ENT_VIRT_ADDRESS(sg);
+               if ((SG_ENT_PHYS_ADDRESS(sg) & ~hwdev->dma_mask) != 0) {
+                       addr = map_single(hwdev, sg->address, sg->length, direction);
+                       if (sg->address)
+                               sg->address = addr;
+                       else
+                               sg->page = virt_to_page(addr);
                }
        }
        return nelems;
@@ -419,9 +428,12 @@ swiotlb_unmap_sg (struct pci_dev *hwdev, struct scatterlist *sg, int nelems, int
                BUG();
 
        for (i = 0; i < nelems; i++, sg++)
-               if (sg->page != sg->address) {
-                       unmap_single(hwdev, sg->address, sg->length, direction);
-                       sg->address = sg->page;
+               if (sg->orig_address != SG_ENT_VIRT_ADDRESS(sg)) {
+                       unmap_single(hwdev, SG_ENT_VIRT_ADDRESS(sg), sg->length, direction);
+                       if (sg->address)
+                               sg->address = sg->orig_address;
+                       else
+                               sg->page = virt_to_page(sg->orig_address);
                } else if (direction == PCI_DMA_FROMDEVICE)
                        mark_clean(sg->address, sg->length);
 }
@@ -442,14 +454,14 @@ swiotlb_sync_sg (struct pci_dev *hwdev, struct scatterlist *sg, int nelems, int
                BUG();
 
        for (i = 0; i < nelems; i++, sg++)
-               if (sg->page != sg->address)
-                       sync_single(hwdev, sg->address, sg->length, direction);
+               if (sg->orig_address != SG_ENT_VIRT_ADDRESS(sg))
+                       sync_single(hwdev, SG_ENT_VIRT_ADDRESS(sg), sg->length, direction);
 }
 
 unsigned long
 swiotlb_dma_address (struct scatterlist *sg)
 {
-       return virt_to_phys(sg->address);
+       return SG_ENT_PHYS_ADDRESS(sg);
 }
 
 EXPORT_SYMBOL(swiotlb_init);
index c69547764b5d2aa10cf6db9625324faa4904fe34..7c9b66a2779ae32b309dcb577d4081fd34a60947 100644 (file)
@@ -270,11 +270,15 @@ CONFIG_AUTOFS_FS=m
 CONFIG_AUTOFS4_FS=m
 # CONFIG_REISERFS_FS is not set
 # CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
 # CONFIG_ADFS_FS is not set
 # CONFIG_ADFS_FS_RW is not set
 CONFIG_AFFS_FS=m
 # CONFIG_HFS_FS is not set
 # CONFIG_BFS_FS is not set
+CONFIG_EXT3_FS=m
+CONFIG_JBD=m
+# CONFIG_JBD_DEBUG is not set
 CONFIG_FAT_FS=m
 CONFIG_MSDOS_FS=m
 # CONFIG_UMSDOS_FS is not set
@@ -287,6 +291,7 @@ CONFIG_EFS_FS=m
 # CONFIG_RAMFS is not set
 CONFIG_ISO9660_FS=m
 # CONFIG_JOLIET is not set
+# CONFIG_ZISOFS is not set
 CONFIG_MINIX_FS=m
 # CONFIG_VXFS_FS is not set
 # CONFIG_NTFS_FS is not set
@@ -311,6 +316,7 @@ CONFIG_UFS_FS=m
 # Network File Systems
 #
 CONFIG_CODA_FS=m
+CONFIG_INTERMEZZO_FS=m
 CONFIG_NFS_FS=y
 # CONFIG_NFS_V3 is not set
 # CONFIG_ROOT_NFS is not set
@@ -329,6 +335,8 @@ CONFIG_SMB_FS=m
 # CONFIG_NCPFS_SMALLDOS is not set
 # CONFIG_NCPFS_NLS is not set
 # CONFIG_NCPFS_EXTRAS is not set
+# CONFIG_ZISOFS_FS is not set
+# CONFIG_ZLIB_FS_INFLATE is not set
 
 #
 # Partition Types
index 5a5df71d48ce317cbb8c639a3a8c9e770f20d4dd..609ab361f192c616d6e6a04e7c6a5699d0e54f39 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ebus.c,v 1.17 2001/08/06 13:12:57 davem Exp $
+/* $Id: ebus.c,v 1.18 2001/11/08 04:41:33 davem Exp $
  * ebus.c: PCI to EBus bridge device.
  *
  * Copyright (C) 1997  Eddie C. Dost  (ecd@skynet.be)
@@ -113,6 +113,9 @@ void __init fill_ebus_child(int node, struct linux_prom_registers *preg,
                dev->resource[i].start = dev->parent->resource[regs[i]].start; /* XXX resource */
        }
 
+       for (i = 0; i < PROMINTR_MAX; i++)
+               dev->irqs[i] = PCI_IRQ_NONE;
+
        if ((dev->irqs[0] = ebus_blacklist_irq(dev->prom_name)) != 0) {
                dev->num_irqs = 1;
        } else if ((len = prom_getproperty(node, "interrupts",
@@ -205,6 +208,9 @@ void __init fill_ebus_device(int node, struct linux_ebus_device *dev)
                dev->resource[i].start = baseaddr;      /* XXX Unaligned */
        }
 
+       for (i = 0; i < PROMINTR_MAX; i++)
+               dev->irqs[i] = PCI_IRQ_NONE;
+
        if ((dev->irqs[0] = ebus_blacklist_irq(dev->prom_name)) != 0) {
                dev->num_irqs = 1;
        } else if ((len = prom_getproperty(node, "interrupts",
index 47fcf622603324243d01b8532a9b26717afdbd83..48a26da9ea2a384442d3c4bd8b5e7c0b3b3958f6 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: entry.S,v 1.169 2001/01/25 21:47:20 davem Exp $
+/* $Id: entry.S,v 1.170 2001/11/13 00:57:05 davem Exp $
  * arch/sparc/kernel/entry.S:  Sparc trap low-level entry points.
  *
  * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -1461,21 +1461,12 @@ linux_syscall_trace:
        b       2f
         mov    %i4, %o4
 
-       .globl  C_LABEL(ret_from_syscall)
-C_LABEL(ret_from_syscall):
-       b       C_LABEL(ret_sys_call)
-        ld     [%sp + REGWIN_SZ + PT_I0], %o0
-
-#ifdef CONFIG_SMP
-       .globl  C_LABEL(ret_from_smpfork)
-C_LABEL(ret_from_smpfork):
-       wr      %l0, PSR_ET, %psr
-       WRITE_PAUSE
+       .globl  C_LABEL(ret_from_fork)
+C_LABEL(ret_from_fork):
        call    schedule_tail
         mov    %g3, %o0
        b       C_LABEL(ret_sys_call)
         ld     [%sp + REGWIN_SZ + PT_I0], %o0
-#endif
 
        /* Linux native and SunOS system calls enter here... */
        .align  4
index 8f5f8761613f0ae228b680be0612115702de5734..c7c93ab3cfdae374ff1ac554f8889873dc5ebba4 100644 (file)
@@ -1,4 +1,4 @@
-/*  $Id: process.c,v 1.156 2001/10/02 02:22:26 davem Exp $
+/*  $Id: process.c,v 1.157 2001/11/13 00:57:05 davem Exp $
  *  linux/arch/sparc/kernel/process.c
  *
  *  Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -455,11 +455,7 @@ clone_stackframe(struct sparc_stackf *dst, struct sparc_stackf *src)
  *       allocate the task_struct and kernel stack in
  *       do_fork().
  */
-#ifdef CONFIG_SMP
-extern void ret_from_smpfork(void);
-#else
-extern void ret_from_syscall(void);
-#endif
+extern void ret_from_fork(void);
 
 int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
                unsigned long unused,
@@ -493,13 +489,8 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
        copy_regwin(new_stack, (((struct reg_window *) regs) - 1));
 
        p->thread.ksp = (unsigned long) new_stack;
-#ifdef CONFIG_SMP
-       p->thread.kpc = (((unsigned long) ret_from_smpfork) - 0x8);
-       p->thread.kpsr = current->thread.fork_kpsr | PSR_PIL;
-#else
-       p->thread.kpc = (((unsigned long) ret_from_syscall) - 0x8);
+       p->thread.kpc = (((unsigned long) ret_from_fork) - 0x8);
        p->thread.kpsr = current->thread.fork_kpsr;
-#endif
        p->thread.kwim = current->thread.fork_kwim;
 
        /* This is used for sun4c only */
index b779867d8f57118e959bb0556e4f13fafd5f6426..89fbafcdd47af4be7926faaab07a26f9b656b3f8 100644 (file)
@@ -1,4 +1,4 @@
-/*  $Id: setup.c,v 1.125 2001/09/20 00:35:30 davem Exp $
+/*  $Id: setup.c,v 1.126 2001/11/13 00:49:27 davem Exp $
  *  linux/arch/sparc/kernel/setup.c
  *
  *  Copyright (C) 1995  David S. Miller (davem@caip.rutgers.edu)
@@ -20,6 +20,7 @@
 #include <linux/delay.h>
 #include <linux/config.h>
 #include <linux/fs.h>
+#include <linux/seq_file.h>
 #include <linux/kdev_t.h>
 #include <linux/major.h>
 #include <linux/string.h>
@@ -455,42 +456,72 @@ asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on)
        return -EIO;
 }
 
-/* BUFFER is PAGE_SIZE bytes long. */
-
 extern char *sparc_cpu_type[];
 extern char *sparc_fpu_type[];
 
-int get_cpuinfo(char *buffer)
+static int show_cpuinfo(struct seq_file *m, void *__unused)
 {
-       int cpuid=hard_smp_processor_id();
-       int len;
-
-       len = sprintf(buffer, "cpu\t\t: %s\n"
-            "fpu\t\t: %s\n"
-            "promlib\t\t: Version %d Revision %d\n"
-            "prom\t\t: %d.%d\n"
-            "type\t\t: %s\n"
-           "ncpus probed\t: %d\n"
-           "ncpus active\t: %d\n"
+       int cpuid = hard_smp_processor_id();
+
+       seq_printf(m,
+                  "cpu\t\t: %s\n"
+                  "fpu\t\t: %s\n"
+                  "promlib\t\t: Version %d Revision %d\n"
+                  "prom\t\t: %d.%d\n"
+                  "type\t\t: %s\n"
+                  "ncpus probed\t: %d\n"
+                  "ncpus active\t: %d\n"
 #ifndef CONFIG_SMP
-            "BogoMips\t: %lu.%02lu\n"
+                  "BogoMips\t: %lu.%02lu\n"
 #endif
-           ,
-           sparc_cpu_type[cpuid] ? : "undetermined",
-           sparc_fpu_type[cpuid] ? : "undetermined",
-            romvec->pv_romvers, prom_rev, romvec->pv_printrev >> 16, (short)romvec->pv_printrev,
-            &cputypval,
-           linux_num_cpus, smp_num_cpus
+                  ,
+                  sparc_cpu_type[cpuid] ? : "undetermined",
+                  sparc_fpu_type[cpuid] ? : "undetermined",
+                  romvec->pv_romvers,
+                  prom_rev,
+                  romvec->pv_printrev >> 16,
+                  (short) romvec->pv_printrev,
+                  &cputypval,
+                  linux_num_cpus,
+                  smp_num_cpus
 #ifndef CONFIG_SMP
-           , loops_per_jiffy/(500000/HZ), (loops_per_jiffy/(5000/HZ)) % 100
+                  , loops_per_jiffy/(500000/HZ),
+                  (loops_per_jiffy/(5000/HZ)) % 100
 #endif
-           );
+               );
+
 #ifdef CONFIG_SMP
-       len += smp_bogo_info(buffer + len);
+       smp_bogo_info(m);
 #endif
-       len += mmu_info(buffer + len);
+       mmu_info(m);
 #ifdef CONFIG_SMP
-       len += smp_info(buffer + len);
+       smp_info(m);
 #endif
-       return len;
+       return 0;
+}
+
+static void *c_start(struct seq_file *m, loff_t *pos)
+{
+       /* The pointer we are returning is arbitrary,
+        * it just has to be non-NULL and not IS_ERR
+        * in the success case.
+        */
+       return *pos == 0 ? &c_start : NULL;
+}
+
+static void *c_next(struct seq_file *m, void *v, loff_t *pos)
+{
+       ++*pos;
+       return c_start(m, pos);
 }
+
+static void c_stop(struct seq_file *m, void *v)
+{
+}
+
+struct seq_operations cpuinfo_op = {
+       start:  c_start,
+       next:   c_next,
+       stop:   c_stop,
+       show:   show_cpuinfo,
+};
index 8ee76b996b5a7f18b8a9ab89f75a8bf2e9945207..7d272865b85a126d80179802ca44f460381d7d66 100644 (file)
@@ -16,6 +16,8 @@
 #include <linux/init.h>
 #include <linux/spinlock.h>
 #include <linux/mm.h>
+#include <linux/fs.h>
+#include <linux/seq_file.h>
 
 #include <asm/ptrace.h>
 #include <asm/atomic.h>
@@ -276,25 +278,26 @@ int setup_profiling_timer(unsigned int multiplier)
        return 0;
 }
 
-int smp_bogo_info(char *buf)
+void smp_bogo_info(struct seq_file *m)
 {
-       int len = 0, i;
+       int i;
        
-       for (i = 0; i < NR_CPUS; i++)
+       for (i = 0; i < NR_CPUS; i++) {
                if (cpu_present_map & (1 << i))
-                       len += sprintf(buf + len, "Cpu%dBogo\t: %lu.%02lu\n", 
-                                       i,
-                                       cpu_data[i].udelay_val/(500000/HZ),
-                                       (cpu_data[i].udelay_val/(5000/HZ))%100);
-       return len;
+                       seq_printf(m,
+                                  "Cpu%dBogo\t: %lu.%02lu\n", 
+                                  i,
+                                  cpu_data[i].udelay_val/(500000/HZ),
+                                  (cpu_data[i].udelay_val/(5000/HZ))%100);
+       }
 }
 
-int smp_info(char *buf)
+void smp_info(struct seq_file *m)
 {
-       int len = 0, i;
+       int i;
        
-       for (i = 0; i < NR_CPUS; i++)
+       for (i = 0; i < NR_CPUS; i++) {
                if (cpu_present_map & (1 << i))
-                       len += sprintf(buf + len, "CPU%d\t\t: online\n", i);
-       return len;
+                       seq_printf(m, "CPU%d\t\t: online\n", i);
+       }
 }
index dd74b189d93de8da8c947e9171e06752145c6585..90533bdfc7208a76867d03b4b7c25072e1eae68b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: srmmu.c,v 1.232 2001/10/30 04:54:22 davem Exp $
+/* $Id: srmmu.c,v 1.233 2001/11/13 00:49:27 davem Exp $
  * srmmu.c:  SRMMU specific routines for memory management.
  *
  * Copyright (C) 1995 David S. Miller  (davem@caip.rutgers.edu)
@@ -18,6 +18,8 @@
 #include <linux/blk.h>
 #include <linux/spinlock.h>
 #include <linux/bootmem.h>
+#include <linux/fs.h>
+#include <linux/seq_file.h>
 
 #include <asm/page.h>
 #include <asm/pgalloc.h>
@@ -1209,18 +1211,17 @@ void __init srmmu_paging_init(void)
        }
 }
 
-static int srmmu_mmu_info(char *buf)
+static void srmmu_mmu_info(struct seq_file *m)
 {
-       return sprintf(buf, 
-               "MMU type\t: %s\n"
-               "contexts\t: %d\n"
-               "nocache total\t: %ld\n"
-               "nocache used\t: %d\n"
-               , srmmu_name,
-               num_contexts,
-               SRMMU_NOCACHE_SIZE,
-               (srmmu_nocache_used << SRMMU_NOCACHE_BITMAP_SHIFT)
-       );
+       seq_printf(m, 
+                  "MMU type\t: %s\n"
+                  "contexts\t: %d\n"
+                  "nocache total\t: %ld\n"
+                  "nocache used\t: %d\n",
+                  srmmu_name,
+                  num_contexts,
+                  SRMMU_NOCACHE_SIZE,
+                  (srmmu_nocache_used << SRMMU_NOCACHE_BITMAP_SHIFT));
 }
 
 static void srmmu_update_mmu_cache(struct vm_area_struct * vma, unsigned long address, pte_t pte)
index 06a2cf483f5f163381b6e33e860a3a19865386f1..b9f42ac0f752a5e73465bfebfb71cbfad6b03bc7 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: sun4c.c,v 1.208 2001/10/30 04:54:22 davem Exp $
+/* $Id: sun4c.c,v 1.210 2001/11/13 03:27:47 davem Exp $
  * sun4c.c: Doing in software what should be done in hardware.
  *
  * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
@@ -16,6 +16,8 @@
 #include <linux/init.h>
 #include <linux/bootmem.h>
 #include <linux/highmem.h>
+#include <linux/fs.h>
+#include <linux/seq_file.h>
 
 #include <asm/scatterlist.h>
 #include <asm/page.h>
@@ -2043,40 +2045,37 @@ static void sun4c_destroy_context_sw(struct mm_struct *mm)
        }
 }
 
-static int sun4c_mmu_info(char *buf)
+static void sun4c_mmu_info(struct seq_file *m)
 {
        int used_user_entries, i;
-       int len;
 
        used_user_entries = 0;
        for (i = 0; i < num_contexts; i++)
                used_user_entries += sun4c_context_ring[i].num_entries;
 
-       len = sprintf(buf, 
-               "vacsize\t\t: %d bytes\n"
-               "vachwflush\t: %s\n"
-               "vaclinesize\t: %d bytes\n"
-               "mmuctxs\t\t: %d\n"
-               "mmupsegs\t: %d\n"
-               "kernelpsegs\t: %d\n"
-               "kfreepsegs\t: %d\n"
-               "usedpsegs\t: %d\n"
-               "ufreepsegs\t: %d\n"
-               "user_taken\t: %d\n"
-               "max_taken\t: %d\n",
-               sun4c_vacinfo.num_bytes,
-               (sun4c_vacinfo.do_hwflushes ? "yes" : "no"),
-               sun4c_vacinfo.linesize,
-               num_contexts,
-               (invalid_segment + 1),
-               sun4c_kernel_ring.num_entries,
-               sun4c_kfree_ring.num_entries,
-               used_user_entries,
-               sun4c_ufree_ring.num_entries,
-               sun4c_user_taken_entries,
-               max_user_taken_entries);
-
-       return len;
+       seq_printf(m, 
+                  "vacsize\t\t: %d bytes\n"
+                  "vachwflush\t: %s\n"
+                  "vaclinesize\t: %d bytes\n"
+                  "mmuctxs\t\t: %d\n"
+                  "mmupsegs\t: %d\n"
+                  "kernelpsegs\t: %d\n"
+                  "kfreepsegs\t: %d\n"
+                  "usedpsegs\t: %d\n"
+                  "ufreepsegs\t: %d\n"
+                  "user_taken\t: %d\n"
+                  "max_taken\t: %d\n",
+                  sun4c_vacinfo.num_bytes,
+                  (sun4c_vacinfo.do_hwflushes ? "yes" : "no"),
+                  sun4c_vacinfo.linesize,
+                  num_contexts,
+                  (invalid_segment + 1),
+                  sun4c_kernel_ring.num_entries,
+                  sun4c_kfree_ring.num_entries,
+                  used_user_entries,
+                  sun4c_ufree_ring.num_entries,
+                  sun4c_user_taken_entries,
+                  max_user_taken_entries);
 }
 
 /* Nothing below here should touch the mmu hardware nor the mmu_entry
@@ -2100,7 +2099,6 @@ static int sun4c_pte_present(pte_t pte)
 }
 static void sun4c_pte_clear(pte_t *ptep)       { *ptep = __pte(0); }
 
-static int sun4c_pmd_none(pmd_t pmd)           { return !pmd_val(pmd); }
 static int sun4c_pmd_bad(pmd_t pmd)
 {
        return (((pmd_val(pmd) & ~PAGE_MASK) != PGD_TABLE) ||
index 9f33017e721b2cf1dcb666c38fc41f46c48d399f..1b91160e21aca4c7d1e097d0f6483444fbf12d4f 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: config.in,v 1.150 2001/09/18 00:36:03 davem Exp $
+# $Id: config.in,v 1.152 2001/11/12 10:20:47 davem Exp $
 # For a description of the syntax of this configuration file,
 # see the Configure script.
 #
@@ -181,8 +181,17 @@ if [ "$CONFIG_SCSI" != "n" ]; then
             bool '  Collect statistics to report in /proc' CONFIG_AIC7XXX_OLD_PROC_STATS
          fi
       fi
-      dep_tristate 'NCR53C8XX SCSI support' CONFIG_SCSI_NCR53C8XX $CONFIG_SCSI
-      dep_tristate 'SYM53C8XX SCSI support' CONFIG_SCSI_SYM53C8XX $CONFIG_SCSI
+      dep_tristate 'SYM53C8XX Version 2 SCSI support' CONFIG_SCSI_SYM53C8XX_2 $CONFIG_SCSI
+      if [ "$CONFIG_SCSI_SYM53C8XX_2" != "n" ]; then
+         int  '  DMA addressing mode' CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE 1
+         int  '  default tagged command queue depth' CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS 16
+         int  '  maximum number of queued commands' CONFIG_SCSI_SYM53C8XX_MAX_TAGS 64
+         bool '  use normal IO' CONFIG_SCSI_SYM53C8XX_IOMAPPED
+      fi
+      if [ "$CONFIG_SCSI_SYM53C8XX_2" != "y" ]; then
+         dep_tristate 'NCR53C8XX SCSI support' CONFIG_SCSI_NCR53C8XX $CONFIG_SCSI
+         dep_tristate 'SYM53C8XX SCSI support' CONFIG_SCSI_SYM53C8XX $CONFIG_SCSI
+      fi
       if [ "$CONFIG_SCSI_NCR53C8XX" != "n" -o "$CONFIG_SCSI_SYM53C8XX" != "n" ]; then
         int 'default tagged command queue depth' CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS 8
         int 'maximum number of queued commands' CONFIG_SCSI_NCR53C8XX_MAX_TAGS 32
index c2b5bebb55162e087dd5323d1c112b43c74cd4a0..813126deeda9a146cb92dde4c6367580ea5ee544 100644 (file)
@@ -70,6 +70,7 @@ CONFIG_PARPORT_PC_FIFO=y
 # CONFIG_PARPORT_AMIGA is not set
 # CONFIG_PARPORT_MFC3 is not set
 # CONFIG_PARPORT_ATARI is not set
+# CONFIG_PARPORT_GSC is not set
 # CONFIG_PARPORT_SUNBPP is not set
 # CONFIG_PARPORT_OTHER is not set
 CONFIG_PARPORT_1284=y
@@ -215,7 +216,27 @@ CONFIG_DECNET_SIOCGIFCONF=y
 #
 # QoS and/or fair queueing
 #
-# CONFIG_NET_SCHED is not set
+CONFIG_NET_SCHED=y
+CONFIG_NET_SCH_CBQ=m
+CONFIG_NET_SCH_CSZ=m
+CONFIG_NET_SCH_PRIO=m
+CONFIG_NET_SCH_RED=m
+CONFIG_NET_SCH_SFQ=m
+CONFIG_NET_SCH_TEQL=m
+CONFIG_NET_SCH_TBF=m
+CONFIG_NET_SCH_GRED=m
+CONFIG_NET_SCH_DSMARK=m
+CONFIG_NET_QOS=y
+CONFIG_NET_ESTIMATOR=y
+CONFIG_NET_CLS=y
+CONFIG_NET_CLS_TCINDEX=m
+CONFIG_NET_CLS_ROUTE4=m
+CONFIG_NET_CLS_ROUTE=y
+CONFIG_NET_CLS_FW=m
+CONFIG_NET_CLS_U32=m
+CONFIG_NET_CLS_RSVP=m
+CONFIG_NET_CLS_RSVP6=m
+CONFIG_NET_CLS_POLICE=y
 
 #
 # ATA/IDE/MFM/RLL support
@@ -333,6 +354,7 @@ CONFIG_SCSI_AIC7XXX_OLD=m
 CONFIG_AIC7XXX_OLD_TCQ_ON_BY_DEFAULT=y
 CONFIG_AIC7XXX_OLD_CMDS_PER_DEVICE=8
 CONFIG_AIC7XXX_OLD_PROC_STATS=y
+# CONFIG_SCSI_SYM53C8XX_2 is not set
 CONFIG_SCSI_NCR53C8XX=m
 CONFIG_SCSI_SYM53C8XX=y
 CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=4
@@ -411,6 +433,9 @@ CONFIG_NETDEVICES=y
 # Appletalk devices
 #
 # CONFIG_APPLETALK is not set
+# CONFIG_LTPC is not set
+# CONFIG_COPS is not set
+# CONFIG_IPDDP is not set
 CONFIG_DUMMY=m
 CONFIG_BONDING=m
 CONFIG_EQUALIZER=m
@@ -560,11 +585,15 @@ CONFIG_AUTOFS_FS=m
 CONFIG_AUTOFS4_FS=m
 # CONFIG_REISERFS_FS is not set
 # CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
 # CONFIG_ADFS_FS is not set
 # CONFIG_ADFS_FS_RW is not set
 CONFIG_AFFS_FS=m
 # CONFIG_HFS_FS is not set
 CONFIG_BFS_FS=m
+CONFIG_EXT3_FS=m
+CONFIG_JBD=m
+# CONFIG_JBD_DEBUG is not set
 CONFIG_FAT_FS=m
 CONFIG_MSDOS_FS=m
 # CONFIG_UMSDOS_FS is not set
@@ -577,6 +606,7 @@ CONFIG_EFS_FS=m
 CONFIG_RAMFS=m
 CONFIG_ISO9660_FS=m
 CONFIG_JOLIET=y
+# CONFIG_ZISOFS is not set
 CONFIG_MINIX_FS=m
 # CONFIG_VXFS_FS is not set
 # CONFIG_NTFS_FS is not set
@@ -601,6 +631,7 @@ CONFIG_UFS_FS_WRITE=y
 # Network File Systems
 #
 CONFIG_CODA_FS=m
+CONFIG_INTERMEZZO_FS=m
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 # CONFIG_ROOT_NFS is not set
@@ -619,6 +650,8 @@ CONFIG_LOCKD_V4=y
 # CONFIG_NCPFS_SMALLDOS is not set
 # CONFIG_NCPFS_NLS is not set
 # CONFIG_NCPFS_EXTRAS is not set
+# CONFIG_ZISOFS_FS is not set
+# CONFIG_ZLIB_FS_INFLATE is not set
 
 #
 # Partition Types
@@ -708,7 +741,6 @@ CONFIG_USB=y
 CONFIG_USB_DEVICEFS=y
 # CONFIG_USB_BANDWIDTH is not set
 # CONFIG_USB_LONG_TIMEOUT is not set
-# CONFIG_USB_LARGE_CONFIG is not set
 
 #
 # USB Controllers
index 9c98f266e60d23d6a235fb932c6914eab8a608ab..524e7f17030cd44e4d78fcae8259ef7cc9e0fe7f 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ebus.c,v 1.63 2001/06/08 02:27:16 davem Exp $
+/* $Id: ebus.c,v 1.64 2001/11/08 04:41:33 davem Exp $
  * ebus.c: PCI to EBus bridge device.
  *
  * Copyright (C) 1997  Eddie C. Dost  (ecd@skynet.be)
@@ -134,6 +134,9 @@ void __init fill_ebus_child(int node, struct linux_prom_registers *preg,
                }
        }
 
+       for (i = 0; i < PROMINTR_MAX; i++)
+               dev->irqs[i] = PCI_IRQ_NONE;
+
        len = prom_getproperty(node, "interrupts", (char *)&irqs, sizeof(irqs));
        if ((len == -1) || (len == 0)) {
                dev->num_irqs = 0;
@@ -221,6 +224,9 @@ void __init fill_ebus_device(int node, struct linux_ebus_device *dev)
        }
 
 probe_interrupts:
+       for (i = 0; i < PROMINTR_MAX; i++)
+               dev->irqs[i] = PCI_IRQ_NONE;
+
        len = prom_getproperty(node, "interrupts", (char *)&irqs, sizeof(irqs));
        if ((len == -1) || (len == 0)) {
                dev->num_irqs = 0;
index 9b55906e36907fc964c28dfeec2869fd6a25db7c..2a3ef1fb4d23a605d8bac4de1643be5aad9a3c9a 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ioctl32.c,v 1.131 2001/11/07 01:13:23 davem Exp $
+/* $Id: ioctl32.c,v 1.132 2001/11/07 05:56:19 davem Exp $
  * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
  *
  * Copyright (C) 1997-2000  Jakub Jelinek  (jakub@redhat.com)
@@ -457,6 +457,7 @@ struct ifconf32 {
         __kernel_caddr_t32  ifcbuf;
 };
 
+#ifdef CONFIG_NET
 static int dev_ifname32(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
        struct net_device *dev;
@@ -475,6 +476,7 @@ static int dev_ifname32(unsigned int fd, unsigned int cmd, unsigned long arg)
        err = copy_to_user((struct ifreq32 *)arg, &ifr32, sizeof(struct ifreq32));
        return (err ? -EFAULT : 0);
 }
+#endif
 
 static inline int dev_ifconf(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
@@ -565,9 +567,25 @@ static int ethtool_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
        }
        switch (ethcmd) {
        case ETHTOOL_GDRVINFO:  len = sizeof(struct ethtool_drvinfo); break;
+       case ETHTOOL_GMSGLVL:
+       case ETHTOOL_SMSGLVL:
+       case ETHTOOL_GLINK:
+       case ETHTOOL_NWAY_RST:  len = sizeof(struct ethtool_value); break;
+       case ETHTOOL_GREGS: {
+               struct ethtool_regs *regaddr = (struct ethtool_regs *)A(data);
+               /* darned variable size arguments */
+               if (get_user(len, (u32 *)&regaddr->len)) {
+                       err = -EFAULT;
+                       goto out;
+               }
+               len += sizeof(struct ethtool_regs);
+               break;
+       }
        case ETHTOOL_GSET:
-       case ETHTOOL_SSET:
-       default:                len = sizeof(struct ethtool_cmd); break;
+       case ETHTOOL_SSET:      len = sizeof(struct ethtool_cmd); break;
+       default:
+               err = -EOPNOTSUPP;
+               goto out;
        }
 
        if (copy_from_user(ifr.ifr_data, (char *)A(data), len)) {
@@ -4508,7 +4526,9 @@ COMPATIBLE_IOCTL(NBD_DISCONNECT)
 /* And these ioctls need translation */
 HANDLE_IOCTL(MEMREADOOB32, mtd_rw_oob)
 HANDLE_IOCTL(MEMWRITEOOB32, mtd_rw_oob)
+#ifdef CONFIG_NET
 HANDLE_IOCTL(SIOCGIFNAME, dev_ifname32)
+#endif
 HANDLE_IOCTL(SIOCGIFCONF, dev_ifconf)
 HANDLE_IOCTL(SIOCGIFFLAGS, dev_ifsioc)
 HANDLE_IOCTL(SIOCSIFFLAGS, dev_ifsioc)
index 694cd382518857cb3245dd8ac5f763111db68cb4..6343cc6e28e61b201e17363968108266012341b0 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: irq.c,v 1.101 2001/06/04 06:50:18 ecd Exp $
+/* $Id: irq.c,v 1.109 2001/11/12 22:22:37 davem Exp $
  * irq.c: UltraSparc IRQ handling/init/registry.
  *
  * Copyright (C) 1997  David S. Miller  (davem@caip.rutgers.edu)
 #include <linux/mm.h>
 #include <linux/interrupt.h>
 #include <linux/slab.h>
-#include <linux/random.h> /* XXX ADD add_foo_randomness() calls... -DaveM */
+#include <linux/random.h>
 #include <linux/init.h>
 #include <linux/delay.h>
+#include <linux/proc_fs.h>
 
 #include <asm/ptrace.h>
 #include <asm/processor.h>
 #include <asm/hardirq.h>
 #include <asm/softirq.h>
 #include <asm/starfire.h>
-
-/* Internal flag, should not be visible elsewhere at all. */
-#define SA_IMAP_MASKED         0x100
-#define SA_DMA_SYNC            0x200
+#include <asm/uaccess.h>
 
 #ifdef CONFIG_SMP
 static void distribute_irqs(void);
@@ -64,7 +62,7 @@ unsigned int __up_workvec[16] __attribute__ ((aligned (64)));
 #endif
 
 #ifdef CONFIG_PCI
-/* This is a table of physical addresses used to deal with SA_DMA_SYNC.
+/* This is a table of physical addresses used to deal with IBF_DMA_SYNC.
  * It is used for PCI only to synchronize DMA transfers with IRQ delivery
  * for devices behind busses other than APB on Sabre systems.
  *
@@ -89,6 +87,23 @@ struct irqaction *irq_action[NR_IRQS+1] = {
          NULL, NULL, NULL, NULL, NULL, NULL , NULL, NULL
 };
 
+static void register_irq_proc (unsigned int irq);
+
+/*
+ * Upper 2b of irqaction->flags holds the ino.
+ * irqaction->mask holds the smp affinity information.
+ */
+#define put_ino_in_irqaction(action, irq) \
+       action->flags &= 0xffffffffffffUL; \
+       if (__bucket(irq) == &pil0_dummy_bucket) \
+               action->flags |= 0xdeadUL << 48;  \
+       else \
+               action->flags |= __irq_ino(irq) << 48;
+#define get_ino_in_irqaction(action)   (action->flags >> 48)
+
+#define put_smpaff_in_irqaction(action, smpaff)        (action)->mask = (smpaff)
+#define get_smpaff_in_irqaction(action)        ((action)->mask)
+
 int get_irq_list(char *buf)
 {
        int i, len = 0;
@@ -108,13 +123,11 @@ int get_irq_list(char *buf)
                        len += sprintf(buf + len, "%10u ",
                                       kstat.irqs[cpu_logical_map(j)][i]);
 #endif
-               len += sprintf(buf + len, "%c %s",
-                              (action->flags & SA_INTERRUPT) ? '+' : ' ',
-                              action->name);
+               len += sprintf(buf + len, " %s:%lx", action->name, \
+                                               get_ino_in_irqaction(action));
                for(action = action->next; action; action = action->next) {
-                       len += sprintf(buf+len, ",%s %s",
-                                      (action->flags & SA_INTERRUPT) ? " +" : "",
-                                      action->name);
+                       len += sprintf(buf+len, ", %s:%lx", action->name, \
+                                               get_ino_in_irqaction(action));
                }
                len += sprintf(buf + len, "\n");
        }
@@ -286,23 +299,18 @@ int request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *)
        if(!handler)
            return -EINVAL;
 
-       if (!bucket->pil)
-               irqflags &= ~SA_IMAP_MASKED;
-       else {
-               irqflags |= SA_IMAP_MASKED;
-               if (bucket->flags & IBF_PCI) {
-                       /*
-                        * PCI IRQs should never use SA_INTERRUPT.
-                        */
-                       irqflags &= ~(SA_INTERRUPT);
-
-                       /*
-                        * Check wether we _should_ use DMA Write Sync
-                        * (for devices behind bridges behind APB). 
-                        */
-                       if (bucket->flags & IBF_DMA_SYNC)
-                               irqflags |= SA_DMA_SYNC;
-               }
+       if ((bucket != &pil0_dummy_bucket) && (irqflags & SA_SAMPLE_RANDOM)) {
+               /*
+                * This function might sleep, we want to call it first,
+                * outside of the atomic block. In SA_STATIC_ALLOC case,
+                * random driver's kmalloc will fail, but it is safe.
+                * If already initialized, random driver will not reinit.
+                * Yes, this might clear the entropy pool if the wrong
+                * driver is attempted to be loaded, without actually
+                * installing a new handler, but is this really a problem,
+                * only the sysadmin is able to do this.
+                */
+               rand_initialize_irq(irq);
        }
 
        save_and_cli(flags);
@@ -316,12 +324,6 @@ int request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *)
                        restore_flags(flags);
                        return -EBUSY;
                }
-               if((action->flags & SA_INTERRUPT) ^ (irqflags & SA_INTERRUPT)) {
-                       printk("Attempt to mix fast and slow interrupts on IRQ%d "
-                              "denied\n", bucket->pil);
-                       restore_flags(flags);
-                       return -EBUSY;
-               }   
                action = NULL;          /* Or else! */
        }
 
@@ -344,7 +346,7 @@ int request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *)
                return -ENOMEM;
        }
 
-       if ((irqflags & SA_IMAP_MASKED) == 0) {
+       if (bucket == &pil0_dummy_bucket) {
                bucket->irq_info = action;
                bucket->flags |= IBF_ACTIVE;
        } else {
@@ -405,12 +407,13 @@ int request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *)
                        bucket->pending = 0;
        }
 
-       action->mask = (unsigned long) bucket;
        action->handler = handler;
        action->flags = irqflags;
        action->name = name;
        action->next = NULL;
        action->dev_id = dev_id;
+       put_ino_in_irqaction(action, irq);
+       put_smpaff_in_irqaction(action, 0);
 
        if(tmp)
                tmp->next = action;
@@ -425,6 +428,8 @@ int request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *)
                set_softint(1 << bucket->pil);
        }
        restore_flags(flags);
+       if ((bucket != &pil0_dummy_bucket) && (!(irqflags & SA_STATIC_ALLOC)))
+               register_irq_proc(__irq_ino(irq));
 
 #ifdef CONFIG_SMP
        distribute_irqs();
@@ -492,7 +497,7 @@ void free_irq(unsigned int irq, void *dev_id)
        else
                *(bucket->pil + irq_action) = action->next;
 
-       if(action->flags & SA_IMAP_MASKED) {
+       if (bucket != &pil0_dummy_bucket) {
                unsigned long imap = bucket->imap;
                void **vector, *orig;
                int ent;
@@ -716,36 +721,80 @@ void catch_disabled_ivec(struct pt_regs *regs)
 /* Tune this... */
 #define FORWARD_VOLUME         12
 
-void handler_irq(int irq, struct pt_regs *regs)
-{
-       struct ino_bucket *bp, *nbp;
-       int cpu = smp_processor_id();
 #ifdef CONFIG_SMP
-       int should_forward = (this_is_starfire == 0     &&
-                             irq < 10                  &&
-                             current->pid != 0);
-       unsigned int buddy = 0;
+
+static inline void redirect_intr(int cpu, struct ino_bucket *bp)
+{
+       /* Ok, here is what is going on:
+        * 1) Retargeting IRQs on Starfire is very
+        *    expensive so just forget about it on them.
+        * 2) Moving around very high priority interrupts
+        *    is a losing game.
+        * 3) If the current cpu is idle, interrupts are
+        *    useful work, so keep them here.  But do not
+        *    pass to our neighbour if he is not very idle.
+        * 4) If sysadmin explicitly asks for directed intrs,
+        *    Just Do It.
+        */
+       struct irqaction *ap = bp->irq_info;
+       unsigned long cpu_mask = get_smpaff_in_irqaction(ap);
+       unsigned int buddy, ticks;
+
+       if (cpu_mask == 0)
+               cpu_mask = ~0UL;
+
+       if (this_is_starfire != 0 ||
+           bp->pil >= 10 || current->pid == 0)
+               goto out;
 
        /* 'cpu' is the MID (ie. UPAID), calculate the MID
         * of our buddy.
         */
-       if (should_forward != 0) {
-               buddy = cpu_number_map(cpu) + 1;
+       buddy = cpu_number_map(cpu) + 1;
+       if (buddy >= NR_CPUS ||
+           cpu_logical_map(buddy) == -1)
+               buddy = 0;
+
+       ticks = 0;
+       while ((cpu_mask & (1UL << buddy)) == 0) {
+               buddy++;
                if (buddy >= NR_CPUS ||
-                   (buddy = cpu_logical_map(buddy)) == -1)
+                   cpu_logical_map(buddy) == -1)
                        buddy = cpu_logical_map(0);
+               if (++ticks > NR_CPUS) {
+                       put_smpaff_in_irqaction(ap, 0);
+                       goto out;
+               }
+       }
 
-               /* Voo-doo programming. */
-               if (cpu_data[buddy].idle_volume < FORWARD_VOLUME)
-                       should_forward = 0;
+       if (buddy == cpu_number_map(cpu))
+               goto out;
+
+       buddy = cpu_logical_map(buddy);
+
+       /* Voo-doo programming. */
+       if (cpu_data[buddy].idle_volume < FORWARD_VOLUME)
+               goto out;
+
+       /* This just so happens to be correct on Cheetah
+        * at the moment.
+        */
+       buddy <<= 26;
+
+       /* Push it to our buddy. */
+       upa_writel(buddy | IMAP_VALID, bp->imap);
+
+out:
+       return;
+}
 
-               /* This just so happens to be correct on Cheetah
-                * at the moment.
-                */
-               buddy <<= 26;
-       }
 #endif
 
+void handler_irq(int irq, struct pt_regs *regs)
+{
+       struct ino_bucket *bp, *nbp;
+       int cpu = smp_processor_id();
+
 #ifndef CONFIG_SMP
        /*
         * Check for TICK_INT on level 14 softint.
@@ -765,6 +814,8 @@ void handler_irq(int irq, struct pt_regs *regs)
                clear_softint(clr_mask);
        }
 #else
+       int should_forward = 1;
+
        clear_softint(1 << irq);
 #endif
 
@@ -781,6 +832,7 @@ void handler_irq(int irq, struct pt_regs *regs)
 #endif
        for ( ; bp != NULL; bp = nbp) {
                unsigned char flags = bp->flags;
+               unsigned char random = 0;
 
                nbp = __bucket(bp->irq_chain);
                bp->irq_chain = 0;
@@ -795,34 +847,30 @@ void handler_irq(int irq, struct pt_regs *regs)
                        if ((flags & IBF_MULTI) == 0) {
                                struct irqaction *ap = bp->irq_info;
                                ap->handler(__irq(bp), ap->dev_id, regs);
+                               random |= ap->flags & SA_SAMPLE_RANDOM;
                        } else {
                                void **vector = (void **)bp->irq_info;
                                int ent;
                                for (ent = 0; ent < 4; ent++) {
                                        struct irqaction *ap = vector[ent];
-                                       if (ap != NULL)
+                                       if (ap != NULL) {
                                                ap->handler(__irq(bp), ap->dev_id, regs);
+                                               random |= ap->flags & SA_SAMPLE_RANDOM;
+                                       }
                                }
                        }
                        /* Only the dummy bucket lacks IMAP/ICLR. */
                        if (bp->pil != 0) {
 #ifdef CONFIG_SMP
-                               /* Ok, here is what is going on:
-                                * 1) Retargeting IRQs on Starfire is very
-                                *    expensive so just forget about it on them.
-                                * 2) Moving around very high priority interrupts
-                                *    is a losing game.
-                                * 3) If the current cpu is idle, interrupts are
-                                *    useful work, so keep them here.  But do not
-                                *    pass to our neighbour if he is not very idle.
-                                */
-                               if (should_forward != 0) {
-                                       /* Push it to our buddy. */
+                               if (should_forward) {
+                                       redirect_intr(cpu, bp);
                                        should_forward = 0;
-                                       upa_writel(buddy | IMAP_VALID, bp->imap);
                                }
 #endif
                                upa_writel(ICLR_IDLE, bp->iclr);
+                               /* Test and add entropy */
+                               if (random)
+                                       add_interrupt_randomness(irq);
                        }
                } else
                        bp->pending = 1;
@@ -843,7 +891,7 @@ void sparc_floppy_irq(int irq, void *dev_cookie, struct pt_regs *regs)
        kstat.irqs[cpu][irq]++;
 
        *(irq_work(cpu, irq)) = 0;
-       bucket = (struct ino_bucket *)action->mask;
+       bucket = get_ino_in_irqaction(action) + ivector_table;
 
        floppy_interrupt(irq, dev_cookie, regs);
        upa_writel(ICLR_IDLE, bucket->iclr);
@@ -896,10 +944,6 @@ int request_fast_irq(unsigned int irq,
                return -EINVAL;
        }       
        
-       /* Only IMAP style interrupts can be registered as fast. */
-       if(bucket->pil == 0)
-               return -EINVAL;
-
        if(!handler)
                return -EINVAL;
 
@@ -918,6 +962,10 @@ int request_fast_irq(unsigned int irq,
                return -EBUSY;
        }
 
+       /*
+        * We do not check for SA_SAMPLE_RANDOM in this path. Neither do we
+        * support smp intr affinity in this path.
+        */
        save_and_cli(flags);
        if(irqflags & SA_STATIC_ALLOC) {
                if(static_irq_count < MAX_STATIC_ALLOC)
@@ -938,12 +986,13 @@ int request_fast_irq(unsigned int irq,
        bucket->irq_info = action;
        bucket->flags |= IBF_ACTIVE;
 
-       action->mask = (unsigned long) bucket;
        action->handler = handler;
-       action->flags = irqflags | SA_IMAP_MASKED;
+       action->flags = irqflags;
        action->dev_id = NULL;
        action->name = name;
        action->next = NULL;
+       put_ino_in_irqaction(action, irq);
+       put_smpaff_in_irqaction(action, 0);
 
        *(bucket->pil + irq_action) = action;
        enable_irq(irq);
@@ -993,7 +1042,7 @@ void init_timers(void (*cfunc)(int, void *, struct pt_regs *),
 #endif
 
        /* Register IRQ handler. */
-       err = request_irq(build_irq(0, 0, 0UL, 0UL), cfunc, (SA_INTERRUPT | SA_STATIC_ALLOC),
+       err = request_irq(build_irq(0, 0, 0UL, 0UL), cfunc, SA_STATIC_ALLOC,
                          "timer", NULL);
 
        if(err) {
@@ -1079,14 +1128,10 @@ void init_timers(void (*cfunc)(int, void *, struct pt_regs *),
 #ifdef CONFIG_SMP
 static int retarget_one_irq(struct irqaction *p, int goal_cpu)
 {
-       struct ino_bucket *bucket = __bucket(p->mask);
+       struct ino_bucket *bucket = get_ino_in_irqaction(p) + ivector_table;
        unsigned long imap = bucket->imap;
        unsigned int tid;
 
-       /* Never change this, it causes problems on Ex000 systems. */
-       if (bucket->pil == 12)
-               return goal_cpu;
-
        if (tlb_type == cheetah) {
                tid = __cpu_logical_map[goal_cpu] << 26;
                tid &= IMAP_AID_SAFARI;
@@ -1114,11 +1159,16 @@ static void distribute_irqs(void)
 
        save_and_cli(flags);
        cpu = 0;
-       for(level = 0; level < NR_IRQS; level++) {
+
+       /*
+        * Skip the timer at [0], and very rare error/power intrs at [15].
+        * Also level [12], it causes problems on Ex000 systems.
+        */
+       for(level = 1; level < NR_IRQS; level++) {
                struct irqaction *p = irq_action[level];
+               if (level == 12) continue;
                while(p) {
-                       if(p->flags & SA_IMAP_MASKED)
-                               cpu = retarget_one_irq(p, cpu);
+                       cpu = retarget_one_irq(p, cpu);
                        p = p->next;
                }
        }
@@ -1228,7 +1278,173 @@ void __init init_IRQ(void)
                             : "g1");
 }
 
-void init_irq_proc(void)
+static struct proc_dir_entry * root_irq_dir;
+static struct proc_dir_entry * irq_dir [NUM_IVECS];
+
+#ifdef CONFIG_SMP
+
+#define HEX_DIGITS 16
+
+static unsigned int parse_hex_value (const char *buffer,
+               unsigned long count, unsigned long *ret)
 {
-       /* For now, nothing... */
+       unsigned char hexnum [HEX_DIGITS];
+       unsigned long value;
+       int i;
+
+       if (!count)
+               return -EINVAL;
+       if (count > HEX_DIGITS)
+               count = HEX_DIGITS;
+       if (copy_from_user(hexnum, buffer, count))
+               return -EFAULT;
+
+       /*
+        * Parse the first 8 characters as a hex string, any non-hex char
+        * is end-of-string. '00e1', 'e1', '00E1', 'E1' are all the same.
+        */
+       value = 0;
+
+       for (i = 0; i < count; i++) {
+               unsigned int c = hexnum[i];
+
+               switch (c) {
+                       case '0' ... '9': c -= '0'; break;
+                       case 'a' ... 'f': c -= 'a'-10; break;
+                       case 'A' ... 'F': c -= 'A'-10; break;
+               default:
+                       goto out;
+               }
+               value = (value << 4) | c;
+       }
+out:
+       *ret = value;
+       return 0;
+}
+
+static unsigned long hw_to_logical(unsigned long mask)
+{
+       unsigned long new_mask = 0UL;
+       int i;
+
+       for (i = 0; i < NR_CPUS; i++) {
+               if (mask & (1UL << i)) {
+                       int logical = cpu_number_map(i);
+
+                       new_mask |= (1UL << logical);
+               }
+       }
+
+       return new_mask;
+}
+
+static unsigned long logical_to_hw(unsigned long mask)
+{
+       unsigned long new_mask = 0UL;
+       int i;
+
+       for (i = 0; i < NR_CPUS; i++) {
+               if (mask & (1UL << i)) {
+                       int hw = cpu_logical_map(i);
+
+                       new_mask |= (1UL << hw);
+               }
+       }
+
+       return new_mask;
+}
+
+static int irq_affinity_read_proc (char *page, char **start, off_t off,
+                       int count, int *eof, void *data)
+{
+       struct ino_bucket *bp = ivector_table + (long)data;
+       struct irqaction *ap = bp->irq_info;
+       unsigned long mask = get_smpaff_in_irqaction(ap);
+
+       mask = logical_to_hw(mask);
+
+       if (count < HEX_DIGITS+1)
+               return -EINVAL;
+       return sprintf (page, "%016lx\n", mask == 0 ? ~0UL : mask);
+}
+
+static inline void set_intr_affinity(int irq, unsigned long hw_aff)
+{
+       struct ino_bucket *bp = ivector_table + irq;
+       unsigned long aff = hw_to_logical(hw_aff);
+
+       /*
+        * Users specify affinity in terms of cpu ids, which is what
+        * is displayed via /proc/cpuinfo. As soon as we do this, 
+        * handler_irq() might see and take action.
+        */
+       put_smpaff_in_irqaction((struct irqaction *)bp->irq_info, aff);
+
+       /* Migration is simply done by the next cpu to service this
+        * interrupt.
+        */
+}
+
+static int irq_affinity_write_proc (struct file *file, const char *buffer,
+                                       unsigned long count, void *data)
+{
+       int irq = (long) data, full_count = count, err;
+       unsigned long new_value;
+
+       err = parse_hex_value(buffer, count, &new_value);
+
+       /*
+        * Do not allow disabling IRQs completely - it's a too easy
+        * way to make the system unusable accidentally :-) At least
+        * one online CPU still has to be targeted.
+        */
+       new_value &= cpu_online_map;
+       if (!new_value)
+               return -EINVAL;
+
+       set_intr_affinity(irq, new_value);
+
+       return full_count;
 }
+
+#endif
+
+#define MAX_NAMELEN 10
+
+static void register_irq_proc (unsigned int irq)
+{
+       char name [MAX_NAMELEN];
+
+       if (!root_irq_dir || irq_dir[irq])
+               return;
+
+       memset(name, 0, MAX_NAMELEN);
+       sprintf(name, "%x", irq);
+
+       /* create /proc/irq/1234 */
+       irq_dir[irq] = proc_mkdir(name, root_irq_dir);
+
+#ifdef CONFIG_SMP
+       /* XXX SMP affinity not supported on starfire yet. */
+       if (this_is_starfire == 0) {
+               struct proc_dir_entry *entry;
+
+               /* create /proc/irq/1234/smp_affinity */
+               entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]);
+
+               if (entry) {
+                       entry->nlink = 1;
+                       entry->data = (void *)(long)irq;
+                       entry->read_proc = irq_affinity_read_proc;
+                       entry->write_proc = irq_affinity_write_proc;
+               }
+       }
+#endif
+}
+
+void init_irq_proc (void)
+{
+       /* create /proc/irq */
+       root_irq_dir = proc_mkdir("irq", 0);
+}
+
index 99a47e17b83c2cdb5450bda23a1a33076dc23629..0b45d9897d4721c3043eb99f4edb498610df2bcc 100644 (file)
@@ -74,7 +74,7 @@ static void __init isa_dev_get_irq(struct isa_device *isa_dev)
        irq_prop = prom_getintdefault(isa_dev->prom_node,
                                      "interrupts", -1);
        if (irq_prop <= 0) {
-               isa_dev->irq = 0;
+               isa_dev->irq = PCI_IRQ_NONE;
        } else {
                int i;
 
@@ -85,7 +85,7 @@ static void __init isa_dev_get_irq(struct isa_device *isa_dev)
                                int ino = grover_irq_table[i].pci_ino;
 
                                if (ino == 0) {
-                                       isa_dev->irq = 0;
+                                       isa_dev->irq = PCI_IRQ_NONE;
                                } else {
                                        pbm = isa_dev->bus->parent;
                                        pcic = pbm->parent;
index 29a1751e6f3217fe4fbbd9ed596c2d2ed4257372..765f5591cc5bf99c7e1c34147ed3b0c6f4dd1649 100644 (file)
@@ -1,4 +1,4 @@
-/*  $Id: setup.c,v 1.70 2001/10/25 18:48:03 davem Exp $
+/*  $Id: setup.c,v 1.71 2001/11/13 00:49:28 davem Exp $
  *  linux/arch/sparc64/kernel/setup.c
  *
  *  Copyright (C) 1995,1996  David S. Miller (davem@caip.rutgers.edu)
@@ -20,6 +20,7 @@
 #include <linux/delay.h>
 #include <linux/config.h>
 #include <linux/fs.h>
+#include <linux/seq_file.h>
 #include <linux/kdev_t.h>
 #include <linux/major.h>
 #include <linux/string.h>
@@ -606,54 +607,77 @@ asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on)
 extern char *sparc_cpu_type[];
 extern char *sparc_fpu_type[];
 
-extern int smp_info(char *);
-extern int smp_bogo(char *);
-extern int mmu_info(char *);
+extern void smp_info(struct seq_file *);
+extern void smp_bogo(struct seq_file *);
+extern void mmu_info(struct seq_file *);
 
 #ifndef CONFIG_SMP
 unsigned long up_clock_tick;
 #endif
 
-int get_cpuinfo(char *buffer)
+static int show_cpuinfo(struct seq_file *m, void *__unused)
 {
-       int cpuid=smp_processor_id();
-       int len;
-
-       len = sprintf(buffer, 
-           "cpu\t\t: %s\n"
-            "fpu\t\t: %s\n"
-            "promlib\t\t: Version 3 Revision %d\n"
-            "prom\t\t: %d.%d.%d\n"
-            "type\t\t: sun4u\n"
-           "ncpus probed\t: %d\n"
-           "ncpus active\t: %d\n"
+       int cpuid = smp_processor_id();
+
+       seq_printf(m, 
+                  "cpu\t\t: %s\n"
+                  "fpu\t\t: %s\n"
+                  "promlib\t\t: Version 3 Revision %d\n"
+                  "prom\t\t: %d.%d.%d\n"
+                  "type\t\t: sun4u\n"
+                  "ncpus probed\t: %d\n"
+                  "ncpus active\t: %d\n"
 #ifndef CONFIG_SMP
-            "Cpu0Bogo\t: %lu.%02lu\n"
-           "Cpu0ClkTck\t: %016lx\n"
+                  "Cpu0Bogo\t: %lu.%02lu\n"
+                  "Cpu0ClkTck\t: %016lx\n"
 #endif
-           ,
-            sparc_cpu_type[cpuid],
-            sparc_fpu_type[cpuid],
-            prom_rev, prom_prev >> 16, (prom_prev >> 8) & 0xff, prom_prev & 0xff,
-           linux_num_cpus, smp_num_cpus
+                  ,
+                  sparc_cpu_type[cpuid],
+                  sparc_fpu_type[cpuid],
+                  prom_rev,
+                  prom_prev >> 16,
+                  (prom_prev >> 8) & 0xff,
+                  prom_prev & 0xff,
+                  linux_num_cpus,
+                  smp_num_cpus
 #ifndef CONFIG_SMP
-           , loops_per_jiffy/(500000/HZ), (loops_per_jiffy/(5000/HZ)) % 100,
-           up_clock_tick
+                  , loops_per_jiffy/(500000/HZ),
+                  (loops_per_jiffy/(5000/HZ)) % 100,
+                  up_clock_tick
 #endif
-           );
+               );
 #ifdef CONFIG_SMP
-       len += smp_bogo(buffer + len);
+       smp_bogo(m);
 #endif
-       len += mmu_info(buffer + len);
+       mmu_info(m);
 #ifdef CONFIG_SMP
-       len += smp_info(buffer + len);
+       smp_info(m);
 #endif
-#undef ZS_LOG
-#ifdef ZS_LOG
-       {
-               extern int zs_dumplog(char *);
-               len += zs_dumplog(buffer + len);
-       }
-#endif
-       return len;
+       return 0;
+}
+
+static void *c_start(struct seq_file *m, loff_t *pos)
+{
+       /* The pointer we are returning is arbitrary,
+        * it just has to be non-NULL and not IS_ERR
+        * in the success case.
+        */
+       return *pos == 0 ? &c_start : NULL;
 }
+
+static void *c_next(struct seq_file *m, void *v, loff_t *pos)
+{
+       ++*pos;
+       return c_start(m, pos);
+}
+
+static void c_stop(struct seq_file *m, void *v)
+{
+}
+
+struct seq_operations cpuinfo_op = {
+       start:  c_start,
+       next:   c_next,
+       stop:   c_stop,
+       show:   show_cpuinfo,
+};
index c0c473e59ed227547f26cb05b9541ba31c9a1206..69a21837e2a56a3b34773d60d4a91f6b5aff2270 100644 (file)
@@ -15,6 +15,8 @@
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/spinlock.h>
+#include <linux/fs.h>
+#include <linux/seq_file.h>
 
 #include <asm/head.h>
 #include <asm/ptrace.h>
@@ -68,31 +70,30 @@ static int __init maxcpus(char *str)
 
 __setup("maxcpus=", maxcpus);
 
-int smp_info(char *buf)
+void smp_info(struct seq_file *m)
 {
-       int len = 7, i;
+       int i;
        
-       strcpy(buf, "State:\n");
-       for (i = 0; i < NR_CPUS; i++)
+       seq_printf(m, "State:\n");
+       for (i = 0; i < NR_CPUS; i++) {
                if (cpu_present_map & (1UL << i))
-                       len += sprintf(buf + len,
-                                       "CPU%d:\t\tonline\n", i);
-       return len;
+                       seq_printf(m,
+                                  "CPU%d:\t\tonline\n", i);
+       }
 }
 
-int smp_bogo(char *buf)
+void smp_bogo(struct seq_file *m)
 {
-       int len = 0, i;
+       int i;
        
        for (i = 0; i < NR_CPUS; i++)
                if (cpu_present_map & (1UL << i))
-                       len += sprintf(buf + len,
-                                      "Cpu%dBogo\t: %lu.%02lu\n"
-                                      "Cpu%dClkTck\t: %016lx\n",
-                                      i, cpu_data[i].udelay_val / (500000/HZ),
-                                      (cpu_data[i].udelay_val / (5000/HZ)) % 100,
-                                      i, cpu_data[i].clock_tick);
-       return len;
+                       seq_printf(m,
+                                  "Cpu%dBogo\t: %lu.%02lu\n"
+                                  "Cpu%dClkTck\t: %016lx\n",
+                                  i, cpu_data[i].udelay_val / (500000/HZ),
+                                  (cpu_data[i].udelay_val / (5000/HZ)) % 100,
+                                  i, cpu_data[i].clock_tick);
 }
 
 void __init smp_store_cpu_info(int id)
@@ -559,19 +560,30 @@ int smp_call_function(void (*func)(void *info), void *info,
 
        smp_cross_call(&xcall_call_function,
                       0, (u64) &data, 0);
-       if (wait) {
-               while (atomic_read(&data.finished) != cpus)
-                       barrier();
-       }
+       /* 
+        * Wait for other cpus to complete function or at
+        * least snap the call data.
+        */
+       while (atomic_read(&data.finished) != cpus)
+               barrier();
 
        return 0;
 }
 
 void smp_call_function_client(struct call_data_struct *call_data)
 {
-       call_data->func(call_data->info);
-       if (call_data->wait)
+       void (*func) (void *info) = call_data->func;
+       void *info = call_data->info;
+
+       if (call_data->wait) {
+               /* let initiator proceed only after completion */
+               func(info);
                atomic_inc(&call_data->finished);
+       } else {
+               /* let initiator proceed after getting data */
+               atomic_inc(&call_data->finished);
+               func(info);
+       }
 }
 
 extern unsigned long xcall_flush_tlb_page;
index dc27806bfcfdaef9785b16741096d0cd892856e4..2d363621a44be15df51361d625dbec510ed880da 100644 (file)
@@ -1,4 +1,4 @@
-/*  $Id: init.c,v 1.199 2001/10/25 18:48:03 davem Exp $
+/*  $Id: init.c,v 1.202 2001/11/13 00:49:28 davem Exp $
  *  arch/sparc64/mm/init.c
  *
  *  Copyright (C) 1996-1999 David S. Miller (davem@caip.rutgers.edu)
@@ -16,6 +16,9 @@
 #include <linux/blk.h>
 #include <linux/swap.h>
 #include <linux/swapctl.h>
+#include <linux/pagemap.h>
+#include <linux/fs.h>
+#include <linux/seq_file.h>
 
 #include <asm/head.h>
 #include <asm/system.h>
@@ -249,27 +252,23 @@ void show_mem(void)
        show_buffers();
 }
 
-int mmu_info(char *buf)
+void mmu_info(struct seq_file *m)
 {
-       int len;
-
        if (tlb_type == cheetah)
-               len = sprintf(buf, "MMU Type\t: Cheetah\n");
+               seq_printf(m, "MMU Type\t: Cheetah\n");
        else if (tlb_type == spitfire)
-               len = sprintf(buf, "MMU Type\t: Spitfire\n");
+               seq_printf(m, "MMU Type\t: Spitfire\n");
        else
-               len = sprintf(buf, "MMU Type\t: ???\n");
+               seq_printf(m, "MMU Type\t: ???\n");
 
 #ifdef DCFLUSH_DEBUG
-       len += sprintf(buf + len, "DCPageFlushes\t: %d\n",
-                      atomic_read(&dcpage_flushes));
+       seq_printf(m, "DCPageFlushes\t: %d\n",
+                  atomic_read(&dcpage_flushes));
 #ifdef CONFIG_SMP
-       len += sprintf(buf + len, "DCPageFlushesXC\t: %d\n",
-                      atomic_read(&dcpage_flushes_xcall));
+       seq_printf(m, "DCPageFlushesXC\t: %d\n",
+                  atomic_read(&dcpage_flushes_xcall));
 #endif /* CONFIG_SMP */
 #endif /* DCFLUSH_DEBUG */
-
-       return len;
 }
 
 struct linux_prom_translation {
@@ -1400,7 +1399,7 @@ void __init paging_init(void)
        if (second_alias_page)
                spitfire_flush_dtlb_nucleus_page(second_alias_page);
 
-       flush_tlb_all();
+       __flush_tlb_all();
 
        {
                unsigned long zones_size[MAX_NR_ZONES];
index 934626698f06d3aa1eb12fee5472610c1314e711..8faa35963fb9843443cb9e7b3d1f72d2e1219f78 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ultra.S,v 1.67 2001/10/23 14:28:20 davem Exp $
+/* $Id: ultra.S,v 1.68 2001/11/09 14:59:19 davem Exp $
  * ultra.S: Don't expand these all over the place...
  *
  * Copyright (C) 1997, 2000 David S. Miller (davem@redhat.com)
@@ -316,9 +316,9 @@ flush_dcpage_cheetah:
        sethi           %hi(PAGE_SIZE), %o4
 1:     subcc           %o4, (1 << 5), %o4
        stxa            %g0, [%o0 + %o4] ASI_DCACHE_INVALIDATE
-       membar          #Sync
        bne,pt          %icc, 1b
         nop
+       membar          #Sync
        /* I-cache flush never needed on Cheetah, see callers. */
        retl
         nop
@@ -509,9 +509,9 @@ xcall_flush_dcache_page_cheetah: /* %g1 == physical page address */
        sethi           %hi(PAGE_SIZE), %g3
 1:     subcc           %g3, (1 << 5), %g3
        stxa            %g0, [%g1 + %g3] ASI_DCACHE_INVALIDATE
-       membar          #Sync
        bne,pt          %icc, 1b
         nop
+       membar          #Sync
        retry
        nop
 
index bfd0786c7b69ce73df48e4ccbc7bdc7114346560..ae3d20e00b8d2ec930e96ff24c909c3aab96c35d 100644 (file)
@@ -42,6 +42,7 @@ if [ "$CONFIG_PCI" = "y" ]; then
    fi
    tristate 'IDT 77252 (NICStAR II)' CONFIG_ATM_IDT77252
    if [ "$CONFIG_ATM_IDT77252" != "n" ]; then
+      bool '  Enable debugging messages' CONFIG_ATM_IDT77252_DEBUG
       bool '  Receive ALL cells in raw queue' CONFIG_ATM_IDT77252_RCV_ALL
       define_bool CONFIG_ATM_IDT77252_USE_SUNI y
    fi
index 1d554ca7d0df3e54818c41e690922d5ff8c624e0..f9e350e191ba692dd37d1b7b37bcded8dc8049cb 100644 (file)
@@ -13,9 +13,6 @@ extern int zatm_detect(void);
 #ifdef CONFIG_ATM_NICSTAR
 extern int nicstar_detect(void);
 #endif
-#ifdef CONFIG_ATM_IDT77252
-extern int idt77252_detect(void);
-#endif
 #ifdef CONFIG_ATM_AMBASSADOR
 extern int amb_detect(void);
 #endif
@@ -50,9 +47,6 @@ int __init atmdev_init(void)
 #ifdef CONFIG_ATM_NICSTAR
        devs += nicstar_detect();
 #endif
-#ifdef CONFIG_ATM_IDT77252
-       devs += idt77252_detect();
-#endif
 #ifdef CONFIG_ATM_AMBASSADOR
        devs += amb_detect();
 #endif
index 9fe83cf21eb838db73eb4b06c3d92730c0c839e3..2ab2ed402947df36a6a28876a901b1e0c538b269 100644 (file)
@@ -1,8 +1,8 @@
 /******************************************************************* 
- * ident "$Id: idt77252.c,v 1.1 2001/11/05 21:52:22 ecd Exp $"
+ * ident "$Id: idt77252.c,v 1.2 2001/11/11 08:13:54 ecd Exp $"
  *
  * $Author: ecd $
- * $Date: 2001/11/05 21:52:22 $
+ * $Date: 2001/11/11 08:13:54 $
  *
  * Copyright (c) 2000 ATecoM GmbH 
  *
@@ -30,7 +30,7 @@
  *
  *******************************************************************/
 static char const rcsid[] =
-"$Id: idt77252.c,v 1.1 2001/11/05 21:52:22 ecd Exp $";
+"$Id: idt77252.c,v 1.2 2001/11/11 08:13:54 ecd Exp $";
 
 
 #include <linux/module.h>
@@ -57,8 +57,6 @@ static char const rcsid[] =
 #endif /* CONFIG_ATM_IDT77252_USE_SUNI */
 
 
-#define DEBUG 1
-
 #include "idt77252.h"
 #include "idt77252_tables.h"
 
@@ -72,10 +70,9 @@ static unsigned int vpibits = 1;
  * Debug HACKs.
  */
 #define DEBUG_MODULE 1
-#undef DEBUG_RAW_CELLS
 #undef HAVE_EEPROM     /* does not work, yet. */
 
-#ifdef DEBUG
+#ifdef CONFIG_ATM_IDT77252_DEBUG
 static unsigned long debug = DBG_GENERAL;
 #endif
 
@@ -144,21 +141,15 @@ static void idt77252_softint(void *dev_id);
 
 static struct atmdev_ops idt77252_ops =
 {
-       idt77252_dev_close,     /* dev_close */
-       idt77252_open,          /* open */
-       idt77252_close,         /* close */
-       NULL,                   /* ioctl */
-       NULL,                   /* getsockopt */
-       NULL,                   /* setsockopt */
-       idt77252_send,          /* send */
-       NULL,                   /* sg_send */
-       idt77252_send_oam,      /* send_oam */
-       idt77252_phy_put,
-       idt77252_phy_get,
-       NULL,                   /* feedback */
-       idt77252_change_qos,
-       NULL,                   /* free_rx_skb */
-       idt77252_proc_read      /* proc_read */
+       dev_close:      idt77252_dev_close,
+       open:           idt77252_open,
+       close:          idt77252_close,
+       send:           idt77252_send,
+       send_oam:       idt77252_send_oam,
+       phy_put:        idt77252_phy_put,
+       phy_get:        idt77252_phy_get,
+       change_qos:     idt77252_change_qos,
+       proc_read:      idt77252_proc_read
 };
 
 static struct idt77252_dev *idt77252_chain = NULL;
@@ -540,7 +531,7 @@ idt77252_eeprom_init(struct idt77252_dev *card)
 #endif /* HAVE_EEPROM */
 
 
-#ifdef DEBUG
+#ifdef CONFIG_ATM_IDT77252_DEBUG
 static void
 dump_tct(struct idt77252_dev *card, int index)
 {
@@ -1130,7 +1121,7 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
        if (!rpp->count++)
                rpp->first = skb;
        *rpp->last = skb;
-       rpp->last = &IDT77252_PRV_NEXT(skb);
+       rpp->last = &skb->next;
 
        if (stat & SAR_RSQE_EPDU) {
                unsigned char *l1l2;
@@ -1177,7 +1168,7 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
                        for (i = 0; i < rpp->count; i++) {
                                memcpy(skb_put(skb, sb->len),
                                       sb->data, sb->len);
-                               sb = IDT77252_PRV_NEXT(sb);
+                               sb = sb->next;
                        }
 
                        recycle_rx_pool_skb(card, rpp);
@@ -1191,6 +1182,8 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
 
                        return;
                }
+
+               skb->next = NULL;
                flush_rx_pool(card, rpp);
 
                if (!atm_charge(vcc, skb->truesize)) {
@@ -1284,45 +1277,40 @@ idt77252_rx_raw(struct idt77252_dev *card)
                vci = (header & ATM_HDR_VCI_MASK) >> ATM_HDR_VCI_SHIFT;
                pti = (header & ATM_HDR_PTI_MASK) >> ATM_HDR_PTI_SHIFT;
 
-#ifdef DEBUG_RAW_CELLS
-{
-               int i;
-
-               printk("%s: raw cell %x.%02x.%04x.%x.%x\n",
-                      card->name, (header >> 28) & 0x000f,
-                      (header >> 20) & 0x00ff,
-                      (header >>  4) & 0xffff,
-                      (header >>  1) & 0x0007,
-                      (header >>  0) & 0x0001);
-               for (i = 16; i < 64; i++)
-                       printk(" %02x", queue->data[i]);
-               printk("\n");
-}
+#ifdef CONFIG_ATM_IDT77252_DEBUG
+               if (debug & DBG_RAW_CELL) {
+                       int i;
+
+                       printk("%s: raw cell %x.%02x.%04x.%x.%x\n",
+                              card->name, (header >> 28) & 0x000f,
+                              (header >> 20) & 0x00ff,
+                              (header >>  4) & 0xffff,
+                              (header >>  1) & 0x0007,
+                              (header >>  0) & 0x0001);
+                       for (i = 16; i < 64; i++)
+                               printk(" %02x", queue->data[i]);
+                       printk("\n");
+               }
 #endif
+
                if (vpi >= (1<<card->vpibits) || vci >= (1<<card->vcibits)) {
-#ifdef DEBUG_RAW_CELLS
-                       printk("%s: SDU received for out-of-range vc %u.%u\n",
-                              card->name, vpi, vci);
-#endif
+                       RPRINTK("%s: SDU received for out-of-range vc %u.%u\n",
+                               card->name, vpi, vci);
                        goto drop;
                }
 
                vc = card->vcs[VPCI2VC(card, vpi, vci)];
                if (!vc || !test_bit(VCF_RX, &vc->flags)) {
-#ifdef DEBUG_RAW_CELLS
-                       printk("%s: SDU received on non RX vc %u.%u\n",
-                              card->name, vpi, vci);
-#endif
+                       RPRINTK("%s: SDU received on non RX vc %u.%u\n",
+                               card->name, vpi, vci);
                        goto drop;
                }
 
                vcc = vc->rx_vcc;
 
                if (vcc->qos.aal != ATM_AAL0) {
-#ifdef DEBUG_RAW_CELLS
-                       printk("%s: raw cell for non AAL0 vc %u.%u\n",
+                       RPRINTK("%s: raw cell for non AAL0 vc %u.%u\n",
                                card->name, vpi, vci);
-#endif
                        atomic_inc(&vcc->stats->rx_drop);
                        goto drop;
                }
@@ -1939,7 +1927,8 @@ recycle_rx_pool_skb(struct idt77252_dev *card, struct rx_pool *rpp)
 
        skb = rpp->first;
        for (i = 0; i < rpp->count; i++) {
-               next = IDT77252_PRV_NEXT(skb);
+               next = skb->next;
+               skb->next = NULL;
                recycle_rx_skb(card, skb);
                skb = next;
        }
@@ -2705,31 +2694,31 @@ idt77252_proc_read(struct atm_dev *dev, loff_t * pos, char *page)
        if (!left--)
                return sprintf(page, "IDT77252 Interrupts:\n");
        if (!left--)
-               return sprintf(page, "TSIF:  %u\n", card->irqstat[15]);
+               return sprintf(page, "TSIF:  %lu\n", card->irqstat[15]);
        if (!left--)
-               return sprintf(page, "TXICP: %u\n", card->irqstat[14]);
+               return sprintf(page, "TXICP: %lu\n", card->irqstat[14]);
        if (!left--)
-               return sprintf(page, "TSQF:  %u\n", card->irqstat[12]);
+               return sprintf(page, "TSQF:  %lu\n", card->irqstat[12]);
        if (!left--)
-               return sprintf(page, "TMROF: %u\n", card->irqstat[11]);
+               return sprintf(page, "TMROF: %lu\n", card->irqstat[11]);
        if (!left--)
-               return sprintf(page, "PHYI:  %u\n", card->irqstat[10]);
+               return sprintf(page, "PHYI:  %lu\n", card->irqstat[10]);
        if (!left--)
-               return sprintf(page, "FBQ3A: %u\n", card->irqstat[8]);
+               return sprintf(page, "FBQ3A: %lu\n", card->irqstat[8]);
        if (!left--)
-               return sprintf(page, "FBQ2A: %u\n", card->irqstat[7]);
+               return sprintf(page, "FBQ2A: %lu\n", card->irqstat[7]);
        if (!left--)
-               return sprintf(page, "RSQF:  %u\n", card->irqstat[6]);
+               return sprintf(page, "RSQF:  %lu\n", card->irqstat[6]);
        if (!left--)
-               return sprintf(page, "EPDU:  %u\n", card->irqstat[5]);
+               return sprintf(page, "EPDU:  %lu\n", card->irqstat[5]);
        if (!left--)
-               return sprintf(page, "RAWCF: %u\n", card->irqstat[4]);
+               return sprintf(page, "RAWCF: %lu\n", card->irqstat[4]);
        if (!left--)
-               return sprintf(page, "FBQ1A: %u\n", card->irqstat[3]);
+               return sprintf(page, "FBQ1A: %lu\n", card->irqstat[3]);
        if (!left--)
-               return sprintf(page, "FBQ0A: %u\n", card->irqstat[2]);
+               return sprintf(page, "FBQ0A: %lu\n", card->irqstat[2]);
        if (!left--)
-               return sprintf(page, "RSQAF: %u\n", card->irqstat[1]);
+               return sprintf(page, "RSQAF: %lu\n", card->irqstat[1]);
        if (!left--)
                return sprintf(page, "IDT77252 Transmit Connection Table:\n");
 
@@ -2846,7 +2835,7 @@ idt77252_interrupt(int irq, void *dev_id, struct pt_regs *ptregs)
        if (stat & SAR_STAT_TXICP) {    /* Incomplete CS-PDU has  */
                INTPRINTK("%s: TXICP\n", card->name);
                card->irqstat[14]++;
-#ifdef DEBUG
+#ifdef CONFIG_ATM_IDT77252_DEBUG
                idt77252_tx_dump(card);
 #endif
        }
@@ -3220,7 +3209,7 @@ deinit_card(struct idt77252_dev *card)
 }
 
 
-static int
+static int __devinit
 init_sram(struct idt77252_dev *card)
 {
        int i;
@@ -3369,7 +3358,7 @@ init_sram(struct idt77252_dev *card)
        return 0;
 }
 
-static int
+static int __devinit
 init_card(struct atm_dev *dev)
 {
        struct idt77252_dev *card = dev->dev_data;
@@ -3652,8 +3641,8 @@ init_card(struct atm_dev *dev)
 /*****************************************************************************/
 
 
-static int
-preset_idt77252(struct idt77252_dev *card)
+static int __devinit
+idt77252_preset(struct idt77252_dev *card)
 {
        u16 pci_command;
 
@@ -3694,7 +3683,7 @@ preset_idt77252(struct idt77252_dev *card)
 }
 
 
-unsigned long
+static unsigned long __devinit
 probe_sram(struct idt77252_dev *card)
 {
        u32 data, addr;
@@ -3716,180 +3705,176 @@ probe_sram(struct idt77252_dev *card)
        return addr * sizeof(u32);
 }
 
-int
-idt77252_probe(void)
+static int __devinit
+idt77252_init_one(struct pci_dev *pcidev, const struct pci_device_id *id)
 {
-       struct idt77252_dev **last, *card;
-       struct pci_dev *pcidev = NULL;
+       static struct idt77252_dev **last = &idt77252_chain;
+       static int index = 0;
+
+       unsigned long membase, srambase;
+       struct idt77252_dev *card;
        struct atm_dev *dev;
        ushort revision = 0;
-       int i, index = 0;
+       int i;
 
-       last = &idt77252_chain;
 
-       if (!pci_present()) {
-               printk(KERN_NOTICE "idt77252: no PCI subsystem found.\n");
+       if (pci_read_config_word(pcidev, PCI_REVISION_ID, &revision)) {
+               printk("idt77252-%d: can't read PCI_REVISION_ID\n", index);
                return -ENODEV;
        }
 
-       while ((pcidev = pci_find_device(PCI_VENDOR_ID_IDT,
-                                        PCI_DEVICE_ID_IDT_IDT77252,
-                                        pcidev))) {
-               unsigned long membase, srambase;
-
-               if (pci_read_config_word(pcidev, PCI_REVISION_ID, &revision)) {
-                       printk("idt77252-%d: can't read PCI_REVISION_ID\n",
-                              index);
-                       continue;
-               }
-               card = kmalloc(sizeof(struct idt77252_dev), GFP_KERNEL);
-               if (!card) {
-                       printk("idt77252-%d: can't allocate private data\n",
-                              index);
-                       continue;
-               }
-               memset(card, 0, sizeof(struct idt77252_dev));
+       card = kmalloc(sizeof(struct idt77252_dev), GFP_KERNEL);
+       if (!card) {
+               printk("idt77252-%d: can't allocate private data\n", index);
+               return -ENOMEM;
+       }
+       memset(card, 0, sizeof(struct idt77252_dev));
 
-               card->revision = revision;
-               card->index = index;
-               card->pcidev = pcidev;
-               sprintf(card->name, "idt77252-%d", card->index);
+       card->revision = revision;
+       card->index = index;
+       card->pcidev = pcidev;
+       sprintf(card->name, "idt77252-%d", card->index);
 
-               card->tqueue.routine = idt77252_softint;
-               card->tqueue.data = (void *)card;
+       card->tqueue.routine = idt77252_softint;
+       card->tqueue.data = (void *)card;
 
-               membase = pci_resource_start(pcidev, 1);
-               srambase = pci_resource_start(pcidev, 2);
+       membase = pci_resource_start(pcidev, 1);
+       srambase = pci_resource_start(pcidev, 2);
 
-               init_MUTEX(&card->mutex);
-               spin_lock_init(&card->cmd_lock);
-               spin_lock_init(&card->tst_lock);
+       init_MUTEX(&card->mutex);
+       spin_lock_init(&card->cmd_lock);
+       spin_lock_init(&card->tst_lock);
 
-               card->tst_timer.data = (unsigned long)card;
-               card->tst_timer.function = tst_timer;
-               init_timer(&card->tst_timer);
+       card->tst_timer.data = (unsigned long)card;
+       card->tst_timer.function = tst_timer;
+       init_timer(&card->tst_timer);
 
-               /* Do the I/O remapping... */
-               card->membase = (unsigned long) ioremap(membase, 1024);
-               if (!card->membase) {
-                       printk("%s: can't ioremap() membase\n", card->name);
-                       kfree(card);
-                       continue;
-               }
+       /* Do the I/O remapping... */
+       card->membase = (unsigned long) ioremap(membase, 1024);
+       if (!card->membase) {
+               printk("%s: can't ioremap() membase\n", card->name);
+               kfree(card);
+               return -EIO;
+       }
 
-               if (preset_idt77252(card)) {
-                       printk("%s: preset failed\n", card->name);
-                       iounmap((void *) card->membase);
-                       kfree(card);
-                       continue;
-               }
+       if (idt77252_preset(card)) {
+               printk("%s: preset failed\n", card->name);
+               iounmap((void *) card->membase);
+               kfree(card);
+               return -EIO;
+       }
 
-               dev = atm_dev_register("idt77252", &idt77252_ops, -1, 0);
-               if (!dev) {
-                       printk("%s: can't register atm device\n", card->name);
-                       iounmap((void *) card->membase);
-                       kfree(card);
-                       continue;
-               }
-               dev->dev_data = card;
-               card->atmdev = dev;
+       dev = atm_dev_register("idt77252", &idt77252_ops, -1, 0);
+       if (!dev) {
+               printk("%s: can't register atm device\n", card->name);
+               iounmap((void *) card->membase);
+               kfree(card);
+               return -EIO;
+       }
+       dev->dev_data = card;
+       card->atmdev = dev;
 
 #ifdef CONFIG_ATM_IDT77252_USE_SUNI
-               suni_init(dev);
-               if (!dev->phy) {
-                       printk("%s: can't init SUNI\n", card->name);
-                       deinit_card(card);
-                       kfree(card);
-                       continue;
-               }
+       suni_init(dev);
+       if (!dev->phy) {
+               printk("%s: can't init SUNI\n", card->name);
+               deinit_card(card);
+               kfree(card);
+               return -EIO;
+       }
 #endif /* CONFIG_ATM_IDT77252_USE_SUNI */
 
-               card->sramsize = probe_sram(card);
+       card->sramsize = probe_sram(card);
 
-               for (i = 0; i < 4; i++) {
-                       card->fbq[i] = (unsigned long)
+       for (i = 0; i < 4; i++) {
+               card->fbq[i] = (unsigned long)
                            ioremap(srambase | 0x200000 | (i << 18), 4);
-                       if (!card->fbq[i]) {
-                               printk("%s: can't ioremap() FBQ%d\n",
-                                      card->name, i);
-                               deinit_card(card);
-                               kfree(card);
-                               goto next;
-                       }
-               }
-
-               printk("%s: ABR SAR (Rev %c): MEM %08lx SRAM %08lx [%u KB]\n",
-                      card->name, ((revision > 1) && (revision < 25)) ?
-                      'A' + revision - 1 : '?',
-                      membase, srambase, card->sramsize / 1024);
-
-               if (init_card(dev)) {
-                       printk("%s: init_card failed\n", card->name);
-
+               if (!card->fbq[i]) {
+                       printk("%s: can't ioremap() FBQ%d\n", card->name, i);
                        deinit_card(card);
                        kfree(card);
-                       continue;
+                       return -EIO;
                }
-               dev->ci_range.vpi_bits = card->vpibits;
-               dev->ci_range.vci_bits = card->vcibits;
-               dev->link_rate = card->link_pcr;
+       }
 
-               if (dev->phy->start)
-                       dev->phy->start(dev);
+       printk("%s: ABR SAR (Rev %c): MEM %08lx SRAM %08lx [%u KB]\n",
+              card->name, ((revision > 1) && (revision < 25)) ?
+              'A' + revision - 1 : '?', membase, srambase,
+              card->sramsize / 1024);
 
-               if (idt77252_dev_open(card)) {
-                       printk("%s: dev_open failed\n", card->name);
+       if (init_card(dev)) {
+               printk("%s: init_card failed\n", card->name);
+               deinit_card(card);
+               kfree(card);
+               return -EIO;
+       }
 
-                       if (dev->phy->stop)
-                               dev->phy->stop(dev);
-                       deinit_card(card);
-                       kfree(card);
-                       continue;
-               }
+       dev->ci_range.vpi_bits = card->vpibits;
+       dev->ci_range.vci_bits = card->vcibits;
+       dev->link_rate = card->link_pcr;
+
+       if (dev->phy->start)
+               dev->phy->start(dev);
 
-               *last = card;
-               last = &card->next;
-               index++;
-       next:
+       if (idt77252_dev_open(card)) {
+               printk("%s: dev_open failed\n", card->name);
+
+               if (dev->phy->stop)
+                       dev->phy->stop(dev);
+               deinit_card(card);
+               kfree(card);
+               return -EIO;
        }
 
-       return index;
+       *last = card;
+       last = &card->next;
+       index++;
+
+       return 0;
 }
 
-#ifdef MODULE
+static struct pci_device_id idt77252_pci_tbl[] __devinitdata =
+{
+       { PCI_VENDOR_ID_IDT, PCI_DEVICE_ID_IDT_IDT77252,
+         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+       { 0, }
+};
 
-MODULE_PARM(vpibits, "i");
-MODULE_AUTHOR("Eddie C. Dost <ecd@atecom.com>");
-MODULE_DESCRIPTION("IDT77252 ABR SAR Driver");
-#ifdef DEBUG
-MODULE_PARM(debug, "i");
-#endif
+static struct pci_driver idt77252_driver = {
+       name:           "idt77252",
+       id_table:       idt77252_pci_tbl,
+       probe:          idt77252_init_one,
+};
 
-int
-init_module(void)
+static int __init idt77252_init(void)
 {
-       int     v;
+       struct sk_buff *skb;
 
-       printk("idt77252 init_module: %s at %p\n", __FUNCTION__, init_module);
+       printk("%s: at %p\n", __FUNCTION__, idt77252_init);
 
-       /*
-        * this modification is somewhat silly, as atmdev_init.c doesn't
-        * check for EIO, it only accumulates the return value in the sum
-        * of atm adaptors found.
-        */
-       v = idt77252_probe();
-       if (v < 0)
+       if (sizeof(skb->cb) < sizeof(struct atm_skb_data) +
+                             sizeof(struct idt77252_skb_prv)) {
+               printk(KERN_ERR "%s: skb->cb is too small (%lu < %lu)\n",
+                      __FUNCTION__, (unsigned long) sizeof(skb->cb),
+                      (unsigned long) sizeof(struct atm_skb_data) +
+                                      sizeof(struct idt77252_skb_prv));
                return -EIO;
+       }
 
-       return 0;
+       if (pci_register_driver(&idt77252_driver) > 0)
+               return 0;
+
+       pci_unregister_driver(&idt77252_driver);
+       return -ENODEV;
 }
 
-void
-cleanup_module(void)
+static void __exit idt77252_exit(void)
 {
        struct idt77252_dev *card;
        struct atm_dev *dev;
 
+       pci_unregister_driver(&idt77252_driver);
+
        while (idt77252_chain) {
                card = idt77252_chain;
                dev = card->atmdev;
@@ -3904,17 +3889,18 @@ cleanup_module(void)
        DIPRINTK("idt77252: finished cleanup-module().\n");
 }
 
-#else
+module_init(idt77252_init);
+module_exit(idt77252_exit);
 
-int __init idt77252_detect(void)
-{
-       int     v;
+EXPORT_NO_SYMBOLS;
+MODULE_LICENSE("GPL");
 
-       v = idt77252_probe();
-       if (v < 0)
-               return -EIO;
-       else
-               return v;
-}
+MODULE_PARM(vpibits, "i");
+MODULE_PARM_DESC(vpibits, "number of VPI bits supported (0, 1, or 2)");
+#ifdef CONFIG_ATM_IDT77252_DEBUG
+MODULE_PARM(debug, "i");
+MODULE_PARM_DESC(debug,   "debug bitmap, see drivers/atm/idt77252.h");
+#endif
 
-#endif /* MODULE */
+MODULE_AUTHOR("Eddie C. Dost <ecd@atecom.com>");
+MODULE_DESCRIPTION("IDT77252 ABR SAR Driver");
index 00e32529bbcaa1c410763b391c4c94c4c4ff1b95..2b26367cc365846625e99651a828774046ff1b07 100644 (file)
@@ -1,8 +1,8 @@
 /******************************************************************* 
- * ident "$Id: idt77252.h,v 1.1 2001/11/05 21:52:22 ecd Exp $"
+ * ident "$Id: idt77252.h,v 1.2 2001/11/11 08:13:54 ecd Exp $"
  *
  * $Author: ecd $
- * $Date: 2001/11/05 21:52:22 $
+ * $Date: 2001/11/11 08:13:54 $
  *
  * Copyright (c) 2000 ATecoM GmbH 
  *
@@ -52,6 +52,7 @@
 /*                                                                           */
 /*****************************************************************************/
 
+#define DBG_RAW_CELL   0x00000400
 #define DBG_TINY       0x00000200
 #define DBG_GENERAL     0x00000100
 #define DBG_XGENERAL    0x00000080
@@ -63,7 +64,7 @@
 #define DBG_RX_DATA     0x00000002
 #define DBG_TX_DATA     0x00000001
 
-#ifdef DEBUG
+#ifdef CONFIG_ATM_IDT77252_DEBUG
 
 #define CPRINTK(args...)   do { if (debug & DBG_CLOSE_CONN) printk(args); } while(0)
 #define OPRINTK(args...)   do { if (debug & DBG_OPEN_CONN)  printk(args); } while(0)
@@ -75,6 +76,7 @@
 #define XPRINTK(args...)   do { if (debug & DBG_XGENERAL)   printk(args); } while(0)
 #define DPRINTK(args...)   do { if (debug & DBG_GENERAL)    printk(args); } while(0)
 #define NPRINTK(args...)   do { if (debug & DBG_TINY)      printk(args); } while(0)
+#define RPRINTK(args...)   do { if (debug & DBG_RAW_CELL)   printk(args); } while(0)
 
 #else
 
@@ -88,6 +90,7 @@
 #define XPRINTK(args...)       do { } while(0)
 #define DPRINTK(args...)       do { } while(0)
 #define NPRINTK(args...)       do { } while(0)
+#define RPRINTK(args...)       do { } while(0)
 
 #endif
 
@@ -785,26 +788,17 @@ struct idt77252_dev
 
 
 struct idt77252_skb_prv {
-       struct scqe             tbd;    /* Transmit Buffer Descriptor */
-       u32                     pool;   /* sb_pool index */
-       dma_addr_t              paddr;  /* DMA handle */
-       void                    *vaddr; /* DMA virtual address */
-       unsigned int            size;   /* DMA buffer size */
-       struct sk_buff          *next;  /* next PDU buffer */
+       struct scqe     tbd;    /* Transmit Buffer Descriptor */
+       dma_addr_t      paddr;  /* DMA handle */
+       u32             pool;   /* sb_pool handle */
 };
 
 #define IDT77252_PRV_TBD(skb)  \
        (((struct idt77252_skb_prv *)(ATM_SKB(skb)+1))->tbd)
-#define IDT77252_PRV_POOL(skb) \
-       (((struct idt77252_skb_prv *)(ATM_SKB(skb)+1))->pool)
 #define IDT77252_PRV_PADDR(skb)        \
        (((struct idt77252_skb_prv *)(ATM_SKB(skb)+1))->paddr)
-#define IDT77252_PRV_VADDR(skb)        \
-       (((struct idt77252_skb_prv *)(ATM_SKB(skb)+1))->vaddr)
-#define IDT77252_PRV_SIZE(skb) \
-       (((struct idt77252_skb_prv *)(ATM_SKB(skb)+1))->size)
-#define IDT77252_PRV_NEXT(skb) \
-       (((struct idt77252_skb_prv *)(ATM_SKB(skb)+1))->next)
+#define IDT77252_PRV_POOL(skb) \
+       (((struct idt77252_skb_prv *)(ATM_SKB(skb)+1))->pool)
 
 /*****************************************************************************/
 /*                                                                           */
index dc0caddd0114c5a24b0ecd5f0fe48754e0fefe90..3d7605c1fd6dfc488289d301038b4cc4f438071c 100644 (file)
@@ -232,6 +232,9 @@ static int suni_start(struct atm_dev *dev)
 
        if (!(PRIV(dev) = kmalloc(sizeof(struct suni_priv),GFP_KERNEL)))
                return -ENOMEM;
+
+       MOD_INC_USE_COUNT;
+
        PRIV(dev)->dev = dev;
        spin_lock_irqsave(&sunis_lock,flags);
        first = !sunis;
@@ -276,6 +279,8 @@ static int suni_stop(struct atm_dev *dev)
        if (!sunis) del_timer_sync(&poll_timer);
        spin_unlock_irqrestore(&sunis_lock,flags);
        kfree(PRIV(dev));
+
+       MOD_DEC_USE_COUNT;
        return 0;
 }
 
@@ -316,7 +321,6 @@ MODULE_LICENSE("GPL");
 
 int init_module(void)
 {
-       MOD_INC_USE_COUNT;
        return 0;
 }
 
index b1bf421d476075885c7dc090ca7fe63a3b65475d..f0c7f188299fef1872dfccc5e26a5adcfe61cafa 100644 (file)
@@ -170,6 +170,8 @@ void __init setup_serial_acpi(void *tablep)
                serial_req.irq = 0;
        }
        else {
+               serial_req.flags = ASYNC_SKIP_TEST | ASYNC_BOOT_AUTOCONF | 
+                                       ASYNC_AUTO_IRQ;
                if (acpi_ser_p->int_type & 
                        (ACPI_SERIAL_INT_APIC | ACPI_SERIAL_INT_SAPIC)) {
                        serial_req.irq = global_sys_irq;
@@ -177,9 +179,16 @@ void __init setup_serial_acpi(void *tablep)
                else if (acpi_ser_p->int_type & ACPI_SERIAL_INT_PCAT) {
                        serial_req.irq = acpi_ser_p->irq;
                }
+               else {
+                       /*
+                        * IRQ type not being set would mean UART will
+                        * run in polling mode. Do not probe for IRQ in
+                        * that case.
+                        */
+                       serial_req.flags = ASYNC_SKIP_TEST|ASYNC_BOOT_AUTOCONF;
+               }
        }
 
-       serial_req.flags = ASYNC_SKIP_TEST | ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ;
        serial_req.xmit_fifo_size = serial_req.custom_divisor = 0;
        serial_req.close_delay = serial_req.hub6 = serial_req.closing_wait = 0;
        serial_req.iomem_reg_shift = 0;
index fd097a69ab17e026aa84478f7de0d91f99daa636..f8964bf1e71f990d1dd72d6129f303f683da198b 100644 (file)
 #endif
 
 static unsigned long rtc_port;
-static int rtc_irq;
+static int rtc_irq = PCI_IRQ_NONE;
 #endif
 
+static int rtc_has_irq = 1;
+
 /*
  *     We sponge a minor off of the misc major. No need slurping
  *     up another valuable major dev number for this. If you add
@@ -198,6 +200,9 @@ static ssize_t rtc_read(struct file *file, char *buf,
        unsigned long data;
        ssize_t retval;
        
+       if (rtc_has_irq == 0)
+               return -EIO;
+
        if (count < sizeof(unsigned long))
                return -EINVAL;
 
@@ -244,6 +249,22 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
 {
        struct rtc_time wtime; 
 
+#if RTC_IRQ
+       if (rtc_has_irq == 0) {
+               switch (cmd) {
+               case RTC_AIE_OFF:
+               case RTC_AIE_ON:
+               case RTC_PIE_OFF:
+               case RTC_PIE_ON:
+               case RTC_UIE_OFF:
+               case RTC_UIE_ON:
+               case RTC_IRQP_READ:
+               case RTC_IRQP_SET:
+                       return -EINVAL;
+               };
+       }
+#endif
+
        switch (cmd) {
 #if RTC_IRQ
        case RTC_AIE_OFF:       /* Mask alarm int. enab. bit    */
@@ -412,15 +433,18 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
                        yrs = 73;
                }
 #endif
+               /* These limits and adjustments are independant of
+                * whether the chip is in binary mode or not.
+                */
+               if (yrs > 169) {
+                       spin_unlock_irq(&rtc_lock);
+                       return -EINVAL;
+               }
+               if (yrs >= 100)
+                       yrs -= 100;
+
                if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY)
                    || RTC_ALWAYS_BCD) {
-                       if (yrs > 169) {
-                               spin_unlock_irq(&rtc_lock);
-                               return -EINVAL;
-                       }
-                       if (yrs >= 100)
-                               yrs -= 100;
-
                        BIN_TO_BCD(sec);
                        BIN_TO_BCD(min);
                        BIN_TO_BCD(hrs);
@@ -550,13 +574,16 @@ static int rtc_fasync (int fd, struct file *filp, int on)
 static int rtc_release(struct inode *inode, struct file *file)
 {
 #if RTC_IRQ
+       unsigned char tmp;
+
+       if (rtc_has_irq == 0)
+               goto no_irq;
+
        /*
         * Turn off all interrupts once the device is no longer
         * in use, and clear the data.
         */
 
-       unsigned char tmp;
-
        spin_lock_irq(&rtc_lock);
        tmp = CMOS_READ(RTC_CONTROL);
        tmp &=  ~RTC_PIE;
@@ -574,6 +601,7 @@ static int rtc_release(struct inode *inode, struct file *file)
        if (file->f_flags & FASYNC) {
                rtc_fasync (-1, file, 0);
        }
+no_irq:
 #endif
 
        spin_lock_irq (&rtc_lock);
@@ -592,6 +620,9 @@ static unsigned int rtc_poll(struct file *file, poll_table *wait)
 {
        unsigned long l;
 
+       if (rtc_has_irq == 0)
+               return 0;
+
        poll_wait(file, &rtc_wait, wait);
 
        spin_lock_irq (&rtc_lock);
@@ -669,12 +700,17 @@ static int __init rtc_init(void)
        return -EIO;
 
 found:
+       if (rtc_irq == PCI_IRQ_NONE) {
+               rtc_has_irq = 0;
+               goto no_irq;
+       }
+
        /*
         * XXX Interrupt pin #7 in Espresso is shared between RTC and
         * PCI Slot 2 INTA# (and some INTx# in Slot 1). SA_INTERRUPT here
         * is asking for trouble with add-on boards. Change to SA_SHIRQ.
         */
-       if(request_irq(rtc_irq, rtc_interrupt, SA_INTERRUPT, "rtc", (void *)&rtc_port)) {
+       if (request_irq(rtc_irq, rtc_interrupt, SA_INTERRUPT, "rtc", (void *)&rtc_port)) {
                /*
                 * Standard way for sparc to print irq's is to use
                 * __irq_itoa(). I think for EBus it's ok to use %d.
@@ -682,6 +718,7 @@ found:
                printk(KERN_ERR "rtc: cannot register IRQ %d\n", rtc_irq);
                return -EIO;
        }
+no_irq:
 #else
        if (check_region (RTC_PORT (0), RTC_IO_EXTENT))
        {
@@ -768,11 +805,13 @@ static void __exit rtc_exit (void)
        misc_deregister(&rtc_dev);
 
 #ifdef __sparc__
-       free_irq (rtc_irq, &rtc_port);
+       if (rtc_has_irq)
+               free_irq (rtc_irq, &rtc_port);
 #else
        release_region (RTC_PORT (0), RTC_IO_EXTENT);
 #if RTC_IRQ
-       free_irq (RTC_IRQ, NULL);
+       if (rtc_has_irq)
+               free_irq (RTC_IRQ, NULL);
 #endif
 #endif /* __sparc__ */
 }
index cbfc1e444e0884805ad4ae3bf0ea3335909747fc..5c17b6c6e4cf3e6beb9bfd161d44278d10365842 100644 (file)
@@ -230,6 +230,7 @@ const char *pdc_quirk_drives[] = {
        "QUANTUM FIREBALLP KA6.4",
        "QUANTUM FIREBALLP LM20.4",
        "QUANTUM FIREBALLP KX20.5",
+       "QUANTUM FIREBALLP KX27.3",
        "QUANTUM FIREBALLP LM20.5",
        NULL
 };
index 0c98b7b1d27bdcb584ea7d8ba28aedd3f8593024..7a2e093b35060ee925cff7953710fb220001b663 100644 (file)
@@ -100,9 +100,7 @@ static struct pdcraid raid[16];
 static int pdcraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
 {
        unsigned int minor;
-       unsigned long sectors,*larg;
-
-       
+       unsigned long sectors;
 
        if (!inode || !inode->i_rdev) 
                return -EINVAL;
@@ -283,10 +281,6 @@ static int pdcraid0_make_request (request_queue_t *q, int rw, struct buffer_head
         * Let the main block layer submit the IO and resolve recursion:
         */
        return 1;
-
- outerr:
-       buffer_IO_error(bh);
-       return 0;
 }
 
 static int pdcraid1_write_request(request_queue_t *q, int rw, struct buffer_head * bh)
@@ -551,8 +545,7 @@ static void __init fill_cutoff(int device)
                           
 static __init int pdcraid_init_one(int device,int raidlevel)
 {
-       request_queue_t *q;
-       int i,count;
+       int i, count;
 
        for (i=0; i<14; i++)
                probedisk(i, device, raidlevel);
@@ -583,10 +576,9 @@ static __init int pdcraid_init_one(int device,int raidlevel)
 
 static __init int pdcraid_init(void)
 {
-       int i,retval,device,count=0;
+       int retval, device, count = 0;
 
        do {
-       
                cookie = 0;
                device=ataraid_get_device(&pdcraid0_ops);
                if (device<0)
index 5b781d9b1b283eb3eb4d9cf50cf0667055c6305f..bfdd6756622f477b6489028c0d7458d740e45852 100644 (file)
@@ -34,12 +34,12 @@ if [ "$CONFIG_NET_ETHERNET" = "y" ]; then
       fi
    fi
    if [ "$CONFIG_PPC" = "y" ]; then
-      tristate '  MACE (Power Mac ethernet) support' CONFIG_MACE
+      dep_tristate '  MACE (Power Mac ethernet) support' CONFIG_MACE $CONFIG_ALL_PPC
       if [ "$CONFIG_MACE" != "n" ]; then
         bool '    Use AAUI port instead of TP by default' CONFIG_MACE_AAUI_PORT
       fi
-      tristate '  BMAC (G3 ethernet) support' CONFIG_BMAC
-      tristate '  GMAC (G4/iBook ethernet) support' CONFIG_GMAC
+      dep_tristate '  BMAC (G3 ethernet) support' CONFIG_BMAC $CONFIG_ALL_PPC
+      dep_tristate '  GMAC (G4/iBook ethernet) support' CONFIG_GMAC $CONFIG_ALL_PPC
       tristate '  National DP83902AV (Oak ethernet) support' CONFIG_OAKNET
    fi
    if [ "$CONFIG_ZORRO" = "y" ]; then
index b326541e4b781a2433aaff762390c01d58eef067..cf0d30df691bf33c0b85c2529a2488a237605eb4 100644 (file)
@@ -1659,7 +1659,7 @@ bmac_proc_info(char *buffer, char **start, off_t offset, int length)
 MODULE_AUTHOR("Randy Gobbel/Paul Mackerras");
 MODULE_DESCRIPTION("PowerMac BMAC ethernet driver.");
 MODULE_LICENSE("GPL");
-
+EXPORT_NO_SYMBOLS;
 
 static void __exit bmac_cleanup (void)
 {
index dbc0cb4c7685f7b1ee7c299e1dd1982aa26728e7..63e0c1e1fb86a8819cdf8eade0f7cf4c2dfaab91 100644 (file)
 #include <linux/ptrace.h>
 #include <linux/ioport.h>
 #include <linux/in.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/string.h>
 #include <linux/init.h>
 #include <linux/timer.h>
index d1986a2ccafbe8511b53d34041d6fd7fc52e15ad..8f3fd9917e37d50c1574337932dc8bf4224830c0 100644 (file)
 
 */
 
-/* Driver author info must always be in the binary.  Version too.. */
-static const char *tc574_version =
-"3c574_cs.c v1.08 9/24/98 Donald Becker/David Hinds, becker@scyld.com.\n";
-
 /*
                                Theory of Operation
 
@@ -63,7 +59,7 @@ invalid ramWidth is Very Bad.
 
 V. References
 
-http://cesdis.gsfc.nasa.gov/linux/misc/NWay.html
+http://www.scyld.com/expert/NWay.html
 http://www.national.com/pf/DP/DP83840.html
 
 Thanks to Terry Murphy of 3Com for providing development information for
@@ -100,24 +96,43 @@ earlier 3Com products.
 #include <pcmcia/ds.h>
 #include <pcmcia/mem_op.h>
 
-/* A few values that may be tweaked. */
-MODULE_PARM(irq_mask, "i");
-MODULE_PARM(irq_list, "1-4i");
-MODULE_PARM(max_interrupt_work, "i");
-MODULE_PARM(full_duplex, "i");
+/*====================================================================*/
+
+/* Module parameters */
+
+MODULE_AUTHOR("David Hinds <dahinds@users.sourceforge.net>");
+MODULE_DESCRIPTION("3Com 3c574 series PCMCIA ethernet driver");
+MODULE_LICENSE("GPL");
+
+#define INT_MODULE_PARM(n, v) static int n = v; MODULE_PARM(n, "i")
 
 /* Now-standard PC card module parameters. */
-static u_int irq_mask = 0xdeb8;                        /* IRQ3,4,5,7,9,10,11,12,14,15 */
+INT_MODULE_PARM(irq_mask, 0xdeb8);
 static int irq_list[4] = { -1 };
-
-/* Time in jiffies before concluding the transmitter is hung. */
-#define TX_TIMEOUT  ((800*HZ)/1000)
+MODULE_PARM(irq_list, "1-4i");
 
 /* Maximum events (Rx packets, etc.) to handle at each interrupt. */
-static int max_interrupt_work = 32;
+INT_MODULE_PARM(max_interrupt_work, 32);
 
 /* Force full duplex modes? */
-static int full_duplex;
+INT_MODULE_PARM(full_duplex, 0);
+
+/* Autodetect link polarity reversal? */
+INT_MODULE_PARM(auto_polarity, 1);
+
+#ifdef PCMCIA_DEBUG
+INT_MODULE_PARM(pc_debug, PCMCIA_DEBUG);
+#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
+static char *version =
+"3c574_cs.c 1.65 2001/10/13 00:08:50 Donald Becker/David Hinds, becker@scyld.com.\n";
+#else
+#define DEBUG(n, args...)
+#endif
+
+/*====================================================================*/
+
+/* Time in jiffies before concluding the transmitter is hung. */
+#define TX_TIMEOUT  ((800*HZ)/1000)
 
 /* To minimize the size of the driver source and make the driver more
    readable not all constants are symbolically defined.
@@ -197,7 +212,7 @@ struct el3_private {
        dev_node_t node;
        struct net_device_stats stats;
        u16 advertising, partner;                       /* NWay media advertisement */
-       unsigned char phys[2];                          /* MII device addresses. */
+       unsigned char phys;                                     /* MII device address */
        unsigned int
          autoselect:1, default_media:3;        /* Read from the EEPROM/Wn3_Config. */
        /* for transceiver monitoring */
@@ -210,17 +225,7 @@ struct el3_private {
 /* Set iff a MII transceiver on any interface requires mdio preamble.
    This only set with the original DP83840 on older 3c905 boards, so the extra
    code size of a per-interface flag is not worthwhile. */
-static char mii_preamble_required;
-
-#ifdef PCMCIA_DEBUG
-static int pc_debug = PCMCIA_DEBUG;
-MODULE_PARM(pc_debug, "i");
-#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
-static char *version =
-"3c574_cs.c 1.000 1998/1/8 Donald Becker, becker@scyld.com.\n";
-#else
-#define DEBUG(n, args...)
-#endif
+static char mii_preamble_required = 0;
 
 /* Index of functions. */
 
@@ -509,7 +514,7 @@ static void tc574_config(dev_link_t *link)
        }
 
        {
-               int phy, phy_idx = 0;
+               int phy;
                
                /* Roadrunner only: Turn on the MII transceiver */
                outw(0x8040, ioaddr + Wn3_Options);
@@ -521,29 +526,30 @@ static void tc574_config(dev_link_t *link)
                outw(0x8040, ioaddr + Wn3_Options);
                
                EL3WINDOW(4);
-               for (phy = 1; phy <= 32 && phy_idx < sizeof(lp->phys); phy++) {
+               for (phy = 1; phy <= 32; phy++) {
                        int mii_status;
                        mdio_sync(ioaddr, 32);
                        mii_status = mdio_read(ioaddr, phy & 0x1f, 1);
                        if (mii_status != 0xffff) {
-                               lp->phys[phy_idx++] = phy & 0x1f;
+                               lp->phys = phy & 0x1f;
                                DEBUG(0, "  MII transceiver at index %d, status %x.\n",
                                          phy, mii_status);
                                if ((mii_status & 0x0040) == 0)
                                        mii_preamble_required = 1;
+                               break;
                        }
                }
-               if (phy_idx == 0) {
+               if (phy > 32) {
                        printk(KERN_NOTICE "  No MII transceivers found!\n");
                        goto failed;
                }
-               i = mdio_read(ioaddr, lp->phys[0], 16) | 0x40;
-               mdio_write(ioaddr, lp->phys[0], 16, i);
-               lp->advertising = mdio_read(ioaddr, lp->phys[0], 4);
+               i = mdio_read(ioaddr, lp->phys, 16) | 0x40;
+               mdio_write(ioaddr, lp->phys, 16, i);
+               lp->advertising = mdio_read(ioaddr, lp->phys, 4);
                if (full_duplex) {
                        /* Only advertise the FD media types. */
                        lp->advertising &= ~0x02a0;
-                       mdio_write(ioaddr, lp->phys[0], 4, lp->advertising);
+                       mdio_write(ioaddr, lp->phys, 4, lp->advertising);
                }
        }
 
@@ -807,7 +813,12 @@ static void tc574_reset(struct net_device *dev)
        outw(0x0040, ioaddr + Wn4_NetDiag);
        /* .. re-sync MII and re-fill what NWay is advertising. */
        mdio_sync(ioaddr, 32);
-       mdio_write(ioaddr, lp->phys[0], 4, lp->advertising);
+       mdio_write(ioaddr, lp->phys, 4, lp->advertising);
+       if (!auto_polarity) {
+               /* works for TDK 78Q2120 series MII's */
+               int i = mdio_read(ioaddr, lp->phys, 16) | 0x20;
+               mdio_write(ioaddr, lp->phys, 16, i);
+       }
 
        /* Switch to register set 1 for normal use, just for TxFree. */
        EL3WINDOW(1);
@@ -1032,8 +1043,8 @@ static void media_check(u_long arg)
        save_flags(flags);
        cli();
        EL3WINDOW(4);
-       media = mdio_read(ioaddr, lp->phys[0], 1);
-       partner = mdio_read(ioaddr, lp->phys[0], 5);
+       media = mdio_read(ioaddr, lp->phys, 1);
+       partner = mdio_read(ioaddr, lp->phys, 5);
        EL3WINDOW(1);
        restore_flags(flags);
 
@@ -1122,7 +1133,6 @@ static void update_stats(struct net_device *dev)
        /* BadSSD */                                       inb(ioaddr + 12);
        up                                                               = inb(ioaddr + 13);
 
-       lp->stats.rx_bytes += rx + ((up & 0x0f) << 16);
        lp->stats.tx_bytes += tx + ((up & 0xf0) << 12);
 
        EL3WINDOW(1);
@@ -1160,10 +1170,8 @@ static int el3_rx(struct net_device *dev, int worklimit)
                        if (skb != NULL) {
                                skb->dev = dev;
                                skb_reserve(skb, 2);
-
                                insl(ioaddr+RX_FIFO, skb_put(skb, pkt_len),
                                                ((pkt_len+3)>>2));
-
                                skb->protocol = eth_type_trans(skb, dev);
                                netif_rx(skb);
                                dev->last_rx = jiffies;
@@ -1187,7 +1195,7 @@ static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
        struct el3_private *lp = (struct el3_private *)dev->priv;
        ioaddr_t ioaddr = dev->base_addr;
        u16 *data = (u16 *)&rq->ifr_data;
-       int phy = lp->phys[0] & 0x1f;
+       int phy = lp->phys & 0x1f;
 
        DEBUG(2, "%s: In ioct(%-.6s, %#4.4x) %4.4x %4.4x %4.4x %4.4x.\n",
                  dev->name, rq->ifr_ifrn.ifrn_name, cmd,
@@ -1289,8 +1297,6 @@ static int __init init_3c574_cs(void)
 {
        servinfo_t serv;
 
-       /* Always emit the version, before any failure. */
-       printk(KERN_INFO"%s", tc574_version);
        DEBUG(0, "%s\n", version);
        CardServices(GetCardServicesInfo, &serv);
        if (serv.Revision != CS_RELEASE_CODE) {
@@ -1312,7 +1318,6 @@ static void __exit exit_3c574_cs(void)
 
 module_init(init_3c574_cs);
 module_exit(exit_3c574_cs);
-MODULE_LICENSE("GPL");
 
 /*
  * Local variables:
index 1deb93034180725b48974b14c590db7fc332858f..2098eab9c5a5cd3a3d5d5bc63b475b1ed2337988 100644 (file)
@@ -4,7 +4,7 @@
     
     Copyright (C) 1999 David A. Hinds -- dahinds@users.sourceforge.net
 
-    3c589_cs.c 1.156 2001/02/07 00:19:41
+    3c589_cs.c 1.162 2001/10/13 00:08:50
 
     The network driver code is based on Donald Becker's 3c589 code:
     
@@ -112,31 +112,33 @@ struct el3_private {
 
 static char *if_names[] = { "auto", "10baseT", "10base2", "AUI" };
 
-#ifdef PCMCIA_DEBUG
-static int pc_debug = PCMCIA_DEBUG;
-MODULE_PARM(pc_debug, "i");
-#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
-static char *version =
-"3c589_cs.c 1.156 2001/02/07 00:19:41 (David Hinds)";
-#else
-#define DEBUG(n, args...)
-#endif
-
 /*====================================================================*/
 
-/* Parameters that can be set with 'insmod' */
+/* Module parameters */
+
+MODULE_AUTHOR("David Hinds <dahinds@users.sourceforge.net>");
+MODULE_DESCRIPTION("3Com 3c589 series PCMCIA ethernet driver");
+MODULE_LICENSE("GPL");
+
+#define INT_MODULE_PARM(n, v) static int n = v; MODULE_PARM(n, "i")
 
 /* Special hook for setting if_port when module is loaded */
-static int if_port;
+INT_MODULE_PARM(if_port, 0);
 
 /* Bit map of interrupts to choose from */
-static u_int irq_mask = 0xdeb8;
+INT_MODULE_PARM(irq_mask, 0xdeb8);
 static int irq_list[4] = { -1 };
-
-MODULE_PARM(if_port, "i");
-MODULE_PARM(irq_mask, "i");
 MODULE_PARM(irq_list, "1-4i");
 
+#ifdef PCMCIA_DEBUG
+INT_MODULE_PARM(pc_debug, PCMCIA_DEBUG);
+#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
+static char *version =
+"3c589_cs.c 1.162 2001/10/13 00:08:50 (David Hinds)";
+#else
+#define DEBUG(n, args...)
+#endif
+
 /*====================================================================*/
 
 static void tc589_config(dev_link_t *link);
@@ -986,12 +988,10 @@ static int el3_rx(struct net_device *dev)
                  pkt_len, rx_status);
            if (skb != NULL) {
                skb->dev = dev;
-               
                skb_reserve(skb, 2);
                insl(ioaddr+RX_FIFO, skb_put(skb, pkt_len),
                        (pkt_len+3)>>2);
                skb->protocol = eth_type_trans(skb, dev);
-               
                netif_rx(skb);
                dev->last_rx = jiffies;
                lp->stats.rx_packets++;
@@ -1097,4 +1097,3 @@ static void __exit exit_3c589_cs(void)
 
 module_init(init_3c589_cs);
 module_exit(exit_3c589_cs);
-MODULE_LICENSE("GPL");
index 73908f868a7e751f35b9c977bf8ffee35f1413fa..dc6ca00df31735ac52646f14a35d4085abc50f8c 100644 (file)
@@ -1,5 +1,5 @@
 /*======================================================================
-    fmvj18x_cs.c 2.2 2001/01/07
+    fmvj18x_cs.c 2.6 2001/09/17
 
     A fmvj18x (and its compatibles) PCMCIA client driver
 
@@ -23,8 +23,9 @@
     
     The author may be reached as becker@scyld.com, or C/O
     Scyld Computing Corporation
-    410 Severn Ave., Suite 210, Annapolis MD 21403
-    
+    410 Severn Ave., Suite 210
+    Annapolis MD 21403
+   
 ======================================================================*/
 
 #include <linux/module.h>
 #include <pcmcia/ciscode.h>
 #include <pcmcia/ds.h>
 
-/*
-   All the PCMCIA modules use PCMCIA_DEBUG to control debugging.  If
-   you do not define PCMCIA_DEBUG at all, all the debug code will be
-   left out.  If you compile with PCMCIA_DEBUG=0, the debug code will
-   be present but disabled -- but it can then be enabled for specific
-   modules at load time with a 'pc_debug=#' option to insmod.
-*/
-#ifdef PCMCIA_DEBUG
-static int pc_debug = PCMCIA_DEBUG;
-MODULE_PARM(pc_debug, "i");
-#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
-#else
-#define DEBUG(n, args...)
-#endif
+/*====================================================================*/
+
+/* Module parameters */
+#define INT_MODULE_PARM(n, v) static int n = v; MODULE_PARM(n, "i")
 
 /* Bit map of interrupts to choose from */
 /* This means pick from 15, 14, 12, 11, 10, 9, 7, 5, 4, and 3 */
-static u_int irq_mask = 0xdeb8;
+INT_MODULE_PARM(irq_mask, 0xdeb8);
 static int irq_list[4] = { -1 };
+MODULE_PARM(irq_list, "1-4i");
 
 /* SRAM configuration */
 /* 0:4KB*2 TX buffer   else:8KB*2 TX buffer */
-static int sram_config;
+INT_MODULE_PARM(sram_config, 0);
 
-MODULE_PARM(irq_mask, "i");
-MODULE_PARM(irq_list, "1-4i");
-MODULE_PARM(sram_config, "i");
-
-/*====================================================================*/
-/* 
-   driver version infomation 
- */
 #ifdef PCMCIA_DEBUG
-static char *version = "fmvj18x_cs.c 2.2 2001/01/07";
+INT_MODULE_PARM(pc_debug, PCMCIA_DEBUG);
+#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
+static char *version = "fmvj18x_cs.c 2.6 2001/09/17";
+#else
+#define DEBUG(n, args...)
 #endif
 
 /*====================================================================*/
@@ -454,7 +442,9 @@ static void fmvj18x_config(dev_link_t *link)
            break;
        case MANFID_FUJITSU:
            if (le16_to_cpu(buf[1]) == PRODID_FUJITSU_MBH10302)
-               cardtype = MBH10302;
+                /* RATOC REX-5588/9822/4886's PRODID are 0004(=MBH10302),
+                   but these are MBH10304 based card. */ 
+               cardtype = MBH10304;
            else if (le16_to_cpu(buf[1]) == PRODID_FUJITSU_MBH10304)
                cardtype = MBH10304;
            else
@@ -476,7 +466,7 @@ static void fmvj18x_config(dev_link_t *link)
                cardtype = XXX10304;    /* MBH10304 with buggy CIS */
                link->conf.ConfigIndex = 0x20;
            } else {
-               cardtype = MBH10302;
+               cardtype = MBH10302;    /* NextCom NC5310, etc. */
                link->conf.ConfigIndex = 1;
            }
            break;
@@ -518,17 +508,17 @@ req_irq:
 
     ioaddr = dev->base_addr;
 
-    /* Power On chip and select bank 0 */
-    if(cardtype == UNGERMANN)
-       outb(BANK_0U, ioaddr + CONFIG_1);
-    else
-       outb(BANK_0, ioaddr + CONFIG_1);
-
     /* Reset controller */
     if( sram_config == 0 ) 
        outb(CONFIG0_RST, ioaddr + CONFIG_0);
     else
        outb(CONFIG0_RST_1, ioaddr + CONFIG_0);
+
+    /* Power On chip and select bank 0 */
+    if(cardtype == UNGERMANN)
+       outb(BANK_0U, ioaddr + CONFIG_1);
+    else
+       outb(BANK_0, ioaddr + CONFIG_1);
     
     /* Set hardware address */
     switch (cardtype) {
@@ -937,18 +927,18 @@ static void fjn_reset(struct net_device *dev)
 
     DEBUG(4, "fjn_reset(%s) called.\n",dev->name);
 
+    /* Reset controller */
+    if( sram_config == 0 ) 
+       outb(CONFIG0_RST, ioaddr + CONFIG_0);
+    else
+       outb(CONFIG0_RST_1, ioaddr + CONFIG_0);
+
     /* Power On chip and select bank 0 */
     if( lp->cardtype == UNGERMANN)
        outb(BANK_0U, ioaddr + CONFIG_1);
     else
        outb(BANK_0, ioaddr + CONFIG_1);
 
-    /* Reset buffers */
-    if( sram_config == 0 ) 
-       outb(CONFIG0_RST, ioaddr + CONFIG_0);
-    else
-       outb(CONFIG0_RST_1, ioaddr + CONFIG_0);
-
     /* Set Tx modes */
     outb(D_TX_MODE, ioaddr + TX_MODE);
     /* set Rx modes */
@@ -975,7 +965,7 @@ static void fjn_reset(struct net_device *dev)
        outb(BANK_2, ioaddr + CONFIG_1);
 
     /* set 16col ctrl bits */
-    if( lp->cardtype == TDK ) 
+    if( lp->cardtype == TDK || lp->cardtype == CONTEC
         outb(TDK_AUTO_MODE, ioaddr + COL_CTRL);
     else
         outb(AUTO_MODE, ioaddr + COL_CTRL);
@@ -1257,4 +1247,3 @@ static void set_rx_mode(struct net_device *dev)
     }
     restore_flags(flags);
 }
-MODULE_LICENSE("GPL");
index 62a62bc50036d0edc14893bfea017c30ed52f465..5987f76be9c31ca004c31366c7572df469e7ec96 100644 (file)
@@ -385,32 +385,31 @@ static char *if_names[]={
     "Auto", "10baseT", "BNC",
 };
 
-#ifdef PCMCIA_DEBUG
-static int pc_debug = PCMCIA_DEBUG;
-MODULE_PARM(pc_debug, "i");
-#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
-#else
-#define DEBUG(n, args...)
-#endif
-
 /* ----------------------------------------------------------------------------
 Parameters
        These are the parameters that can be set during loading with
        'insmod'.
 ---------------------------------------------------------------------------- */
 
-/* 0=auto, 1=10baseT, 2 = 10base2, default=auto */
-static int if_port;
+MODULE_DESCRIPTION("New Media PCMCIA ethernet driver");
+MODULE_LICENSE("GPL");
 
-/* Bit map of interrupts to choose from */
-static u_int irq_mask = 0xdeb8;
-static int irq_list[4] = { -1 };
+#define INT_MODULE_PARM(n, v) static int n = v; MODULE_PARM(n, "i")
 
-MODULE_PARM(if_port, "i");
-MODULE_PARM(irq_mask, "i");
+static int irq_list[4] = { -1 };
 MODULE_PARM(irq_list, "1-4i");
-MODULE_LICENSE("GPL");
 
+/* 0=auto, 1=10baseT, 2 = 10base2, default=auto */
+INT_MODULE_PARM(if_port, 0);
+/* Bit map of interrupts to choose from */
+INT_MODULE_PARM(irq_mask, 0xdeb8);
+
+#ifdef PCMCIA_DEBUG
+INT_MODULE_PARM(pc_debug, PCMCIA_DEBUG);
+#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
+#else
+#define DEBUG(n, args...)
+#endif
 
 /* ----------------------------------------------------------------------------
 Function Prototypes
@@ -1290,9 +1289,10 @@ static int mace_rx(struct net_device *dev, unsigned char RxCnt)
        skb->protocol = eth_type_trans(skb, dev);
        
        netif_rx(skb); /* Send the packet to the upper (protocol) layers. */
+
        dev->last_rx = jiffies;
        lp->linux_stats.rx_packets++;
-       lp->linux_stats.rx_bytes += pkt_len;
+       lp->linux_stats.rx_bytes += skb->len;
        outb(0xFF, ioaddr + AM2150_RCV_NEXT); /* skip to next frame */
        continue;
       } else {
index e22fa262d5ed2c00627e5531df2798b58b076791..30a011271018ec797bd08f529d9e405ac00449d3 100644 (file)
@@ -11,7 +11,7 @@
 
     Copyright (C) 1999 David A. Hinds -- dahinds@users.sourceforge.net
 
-    pcnet_cs.c 1.132 2001/02/09 03:13:29
+    pcnet_cs.c 1.144 2001/11/07 04:06:56
     
     The network driver code is based on Donald Becker's NE2000 code:
 
@@ -20,7 +20,7 @@
     Director, National Security Agency.  This software may be used and
     distributed according to the terms of the GNU General Public License,
     incorporated herein by reference.
-    Donald Becker may be reached at becker@scyld.com.
+    Donald Becker may be reached at becker@scyld.com
 
     Based also on Keith Moore's changes to Don Becker's code, for IBM
     CCAE support.  Drivers merged back together, and shared-memory
@@ -39,6 +39,7 @@
 #include <linux/delay.h>
 #include <asm/io.h>
 #include <asm/system.h>
+#include <asm/byteorder.h>
 
 #include <linux/netdevice.h>
 #include <../drivers/net/8390.h>
@@ -72,14 +73,18 @@ static int pc_debug = PCMCIA_DEBUG;
 MODULE_PARM(pc_debug, "i");
 #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
 static char *version =
-"pcnet_cs.c 1.132 2001/02/09 03:13:29 (David Hinds)";
+"pcnet_cs.c 1.144 2001/11/07 04:06:56 (David Hinds)";
 #else
 #define DEBUG(n, args...)
 #endif
 
 /*====================================================================*/
 
-/* Parameters that can be set with 'insmod' */
+/* Module parameters */
+
+MODULE_AUTHOR("David Hinds <dahinds@users.sourceforge.net>");
+MODULE_DESCRIPTION("NE2000 compatible PCMCIA ethernet driver");
+MODULE_LICENSE("GPL");
 
 #define INT_MODULE_PARM(n, v) static int n = v; MODULE_PARM(n, "i")
 
@@ -94,6 +99,7 @@ INT_MODULE_PARM(mem_speed,    0);     /* shared mem speed, in ns */
 INT_MODULE_PARM(delay_output,  0);     /* pause after xmit? */
 INT_MODULE_PARM(delay_time,    4);     /* in usec */
 INT_MODULE_PARM(use_shmem,     -1);    /* use shared memory? */
+INT_MODULE_PARM(full_duplex,   0);     /* full duplex? */
 
 /* Ugh!  Let the user hardwire the hardware address for queer cards */
 static int hw_addr[6] = { 0, /* ... */ };
@@ -101,13 +107,14 @@ MODULE_PARM(hw_addr, "6i");
 
 /*====================================================================*/
 
+static void mii_phy_probe(struct net_device *dev);
 static void pcnet_config(dev_link_t *link);
 static void pcnet_release(u_long arg);
 static int pcnet_event(event_t event, int priority,
                       event_callback_args_t *args);
 static int pcnet_open(struct net_device *dev);
 static int pcnet_close(struct net_device *dev);
-static int do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
+static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
 static void ei_irq_wrapper(int irq, void *dev_id, struct pt_regs *regs);
 static void ei_watchdog(u_long arg);
 static void pcnet_reset_8390(struct net_device *dev);
@@ -140,6 +147,12 @@ typedef struct hw_info_t {
 #define HAS_MII                0x40
 #define USE_SHMEM      0x80    /* autodetected */
 
+#define AM79C9XX_HOME_PHY      0x00006B90  /* HomePNA PHY */
+#define AM79C9XX_ETH_PHY       0x00006B70  /* 10baseT PHY */
+#define MII_PHYID_REV_MASK     0xfffffff0
+#define MII_PHYID_REG1         0x02
+#define MII_PHYID_REG2         0x03
+
 static hw_info_t hw_info[] = {
     { /* Accton EN2212 */ 0x0ff0, 0x00, 0x00, 0xe8, DELAY_OUTPUT }, 
     { /* Allied Telesis LA-PCM */ 0x0ff0, 0x00, 0x00, 0xf4, 0 },
@@ -216,7 +229,10 @@ typedef struct pcnet_dev_t {
     caddr_t            base;
     struct timer_list  watchdog;
     int                        stale, fast_poll;
+    u_char             phy_id;
+    u_char             eth_phy, pna_phy;
     u_short            link_status;
+    u_long             mii_reset;
 } pcnet_dev_t;
 
 /*======================================================================
@@ -518,8 +534,8 @@ static hw_info_t *get_ax88190(dev_link_t *link)
        dev->dev_addr[i] = j & 0xff;
        dev->dev_addr[i+1] = j >> 8;
     }
-    printk(KERN_INFO "pcnet_cs: sorry, the AX88190 chipset is not "
-          "supported.\n");
+    printk(KERN_NOTICE "pcnet_cs: this is an AX88190 card!\n");
+    printk(KERN_NOTICE "pcnet_cs: use axnet_cs instead.\n");
     return NULL;
 }
 
@@ -749,10 +765,13 @@ static void pcnet_config(dev_link_t *link)
     link->state &= ~DEV_CONFIG_PENDING;
 
     if (info->flags & (IS_DL10019|IS_DL10022)) {
-       dev->do_ioctl = &do_ioctl;
+       u_char id = inb(dev->base_addr + 0x1a);
+       dev->do_ioctl = &ei_ioctl;
+       mii_phy_probe(dev);
        printk(KERN_INFO "%s: NE2000 (DL100%d rev %02x): ",
-              dev->name, ((info->flags & IS_DL10022) ? 22 : 19),
-              inb(dev->base_addr + 0x1a));
+              dev->name, ((info->flags & IS_DL10022) ? 22 : 19), id);
+       if (info->pna_phy)
+           printk("PNA, ");
     } else
        printk(KERN_INFO "%s: NE2000 Compatible: ", dev->name);
     printk("io %#3lx, irq %d,", dev->base_addr, dev->irq);
@@ -954,15 +973,44 @@ static void set_misc_reg(struct net_device *dev)
        outb_p(tmp, nic_base + PCNET_MISC);
     }
     if (info->flags & IS_DL10022) {
-       mdio_reset(nic_base + DLINK_GPIO, 0);
-       /* Restart MII autonegotiation */
-       mdio_write(nic_base + DLINK_GPIO, 0, 0, 0x0000);
-       mdio_write(nic_base + DLINK_GPIO, 0, 0, 0x1200);
+       if (info->flags & HAS_MII) {
+           mdio_reset(nic_base + DLINK_GPIO, info->eth_phy);
+           /* Restart MII autonegotiation */
+           mdio_write(nic_base + DLINK_GPIO, info->eth_phy, 0, 0x0000);
+           mdio_write(nic_base + DLINK_GPIO, info->eth_phy, 0, 0x1200);
+           info->mii_reset = jiffies;
+       } else {
+           outb(full_duplex ? 4 : 0, nic_base + DLINK_DIAG);
+       }
     }
 }
 
 /*====================================================================*/
 
+static void mii_phy_probe(struct net_device *dev)
+{
+    pcnet_dev_t *info = (pcnet_dev_t *)dev;    
+    ioaddr_t mii_addr = dev->base_addr + DLINK_GPIO;
+    int i;
+    u_int tmp, phyid;
+
+    for (i = 31; i >= 0; i--) {
+       tmp = mdio_read(mii_addr, i, 1);
+       if ((tmp == 0) || (tmp == 0xffff))
+           continue;
+       tmp = mdio_read(mii_addr, i, MII_PHYID_REG1);
+       phyid = tmp << 16;
+       phyid |= mdio_read(mii_addr, i, MII_PHYID_REG2);
+       phyid &= MII_PHYID_REV_MASK;
+       DEBUG(0, "%s: MII at %d is 0x%08x\n", dev->name, i, phyid);
+       if (phyid == AM79C9XX_HOME_PHY) {
+           info->pna_phy = i;
+       } else if (phyid != AM79C9XX_ETH_PHY) {
+           info->eth_phy = i;
+       }
+    }
+}
+
 static int pcnet_open(struct net_device *dev)
 {
     pcnet_dev_t *info = (pcnet_dev_t *)dev;
@@ -979,6 +1027,7 @@ static int pcnet_open(struct net_device *dev)
     set_misc_reg(dev);
     request_irq(dev->irq, ei_irq_wrapper, SA_SHIRQ, dev_info, dev);
 
+    info->phy_id = info->eth_phy;
     info->link_status = 0x00;
     info->watchdog.function = &ei_watchdog;
     info->watchdog.data = (u_long)info;
@@ -1074,6 +1123,7 @@ static void ei_watchdog(u_long arg)
     pcnet_dev_t *info = (pcnet_dev_t *)(arg);
     struct net_device *dev = &info->dev;
     ioaddr_t nic_base = dev->base_addr;
+    ioaddr_t mii_addr = nic_base + DLINK_GPIO;
     u_short link;
 
     if (!netif_device_present(dev)) goto reschedule;
@@ -1097,35 +1147,57 @@ static void ei_watchdog(u_long arg)
     if (!(info->flags & HAS_MII))
        goto reschedule;
 
-    link = mdio_read(dev->base_addr + DLINK_GPIO, 0, 1);
+    mdio_read(mii_addr, info->phy_id, 1);
+    link = mdio_read(mii_addr, info->phy_id, 1);
     if (!link || (link == 0xffff)) {
-       printk(KERN_INFO "%s: MII is missing!\n", dev->name);
-       info->flags &= ~HAS_MII;
+       if (info->eth_phy) {
+           info->phy_id = info->eth_phy = 0;
+       } else {
+           printk(KERN_INFO "%s: MII is missing!\n", dev->name);
+           info->flags &= ~HAS_MII;
+       }
        goto reschedule;
     }
 
     link &= 0x0004;
     if (link != info->link_status) {
-       u_short p = mdio_read(dev->base_addr + DLINK_GPIO, 0, 5);
+       u_short p = mdio_read(mii_addr, info->phy_id, 5);
        printk(KERN_INFO "%s: %s link beat\n", dev->name,
               (link) ? "found" : "lost");
        if (link && (info->flags & IS_DL10022)) {
            /* Disable collision detection on full duplex links */
-           outb((p & 0x0140) ? 4 : 0, dev->base_addr + DLINK_DIAG);
+           outb((p & 0x0140) ? 4 : 0, nic_base + DLINK_DIAG);
        }
        if (link) {
-           if (p)
-               printk(KERN_INFO "%s: autonegotiation complete: "
-                      "%sbaseT-%cD selected\n", dev->name,
-                      ((p & 0x0180) ? "100" : "10"),
-                      ((p & 0x0140) ? 'F' : 'H'));
-           else
-               printk(KERN_INFO "%s: link partner did not autonegotiate\n",
-                      dev->name);
+           if (info->phy_id == info->eth_phy) {
+               if (p)
+                   printk(KERN_INFO "%s: autonegotiation complete: "
+                          "%sbaseT-%cD selected\n", dev->name,
+                          ((p & 0x0180) ? "100" : "10"),
+                          ((p & 0x0140) ? 'F' : 'H'));
+               else
+                   printk(KERN_INFO "%s: link partner did not "
+                          "autonegotiate\n", dev->name);
+           }
            NS8390_init(dev, 1);
        }
        info->link_status = link;
     }
+    if (info->pna_phy && (jiffies - info->mii_reset > 6*HZ)) {
+       link = mdio_read(mii_addr, info->eth_phy, 1) & 0x0004;
+       if (((info->phy_id == info->pna_phy) && link) ||
+           ((info->phy_id != info->pna_phy) && !link)) {
+           /* isolate this MII and try flipping to the other one */
+           mdio_write(mii_addr, info->phy_id, 0, 0x0400);
+           info->phy_id ^= info->pna_phy ^ info->eth_phy;
+           printk(KERN_INFO "%s: switched to %s transceiver\n", dev->name,
+                  (info->phy_id == info->eth_phy) ? "ethernet" : "PNA");
+           mdio_write(mii_addr, info->phy_id, 0,
+                      (info->phy_id == info->eth_phy) ? 0x1000 : 0);
+           info->link_status = 0;
+           info->mii_reset = jiffies;
+       }
+    }
 
 reschedule:
     info->watchdog.expires = jiffies + HZ;
@@ -1134,20 +1206,21 @@ reschedule:
 
 /*====================================================================*/
 
-static int do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
+static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
+    pcnet_dev_t *info = (pcnet_dev_t *)dev;
     u16 *data = (u16 *)&rq->ifr_data;
-    ioaddr_t addr = dev->base_addr + DLINK_GPIO;
+    ioaddr_t mii_addr = dev->base_addr + DLINK_GPIO;
     switch (cmd) {
     case SIOCDEVPRIVATE:
-       data[0] = 0;
+       data[0] = info->phy_id;
     case SIOCDEVPRIVATE+1:
-       data[3] = mdio_read(addr, data[0], data[1] & 0x1f);
+       data[3] = mdio_read(mii_addr, data[0], data[1] & 0x1f);
        return 0;
     case SIOCDEVPRIVATE+2:
        if (!capable(CAP_NET_ADMIN))
            return -EPERM;
-       mdio_write(addr, data[0], data[1] & 0x1f, data[2]);
+       mdio_write(mii_addr, data[0], data[1] & 0x1f, data[2]);
        return 0;
     }
     return -EOPNOTSUPP;
@@ -1522,4 +1595,3 @@ static void __exit exit_pcnet_cs(void)
 
 module_init(init_pcnet_cs);
 module_exit(exit_pcnet_cs);
-MODULE_LICENSE("GPL");
index 90eaf258b31e382e713050f9578a549ba6ae1927..f1c322bb2dbd4676a5ff9fa39af2b64bd529037e 100644 (file)
@@ -8,7 +8,7 @@
 
     Copyright (C) 1999 David A. Hinds -- dahinds@users.sourceforge.net
 
-    smc91c92_cs.c 1.106 2001/02/07 00:19:58
+    smc91c92_cs.c 1.113 2001/10/13 00:08:53
     
     This driver contains code written by Donald Becker
     (becker@scyld.com), Rowan Hughes (x-csrdh@jcu.edu.au),
 
 /*====================================================================*/
 
-#ifdef PCMCIA_DEBUG
-static int pc_debug = PCMCIA_DEBUG;
-MODULE_PARM(pc_debug, "i");
-static const char *version =
-"smc91c92_cs.c 0.09 1996/8/4 Donald Becker, becker@scyld.com.\n";
-#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
-#else
-#define DEBUG(n, args...)
-#endif
-
 static char *if_names[] = { "auto", "10baseT", "10base2"};
 
-/* Parameters that can be set with 'insmod' */
+/* Module parameters */
+
+MODULE_DESCRIPTION("SMC 91c92 series PCMCIA ethernet driver");
+MODULE_LICENSE("GPL");
+
+#define INT_MODULE_PARM(n, v) static int n = v; MODULE_PARM(n, "i")
 
 /*
   Transceiver/media type.
@@ -76,16 +71,23 @@ static char *if_names[] = { "auto", "10baseT", "10base2"};
    1 = 10baseT (and autoselect if #define AUTOSELECT),
    2 = AUI/10base2,
 */
-static int if_port;
+INT_MODULE_PARM(if_port, 0);
 
 /* Bit map of interrupts to choose from. */
-static u_int irq_mask = 0xdeb8;
+INT_MODULE_PARM(irq_mask, 0xdeb8);
 static int irq_list[4] = { -1 };
-
-MODULE_PARM(if_port, "i");
-MODULE_PARM(irq_mask, "i");
 MODULE_PARM(irq_list, "1-4i");
-MODULE_LICENSE("GPL");
+
+#ifdef PCMCIA_DEBUG
+INT_MODULE_PARM(pc_debug, PCMCIA_DEBUG);
+static const char *version =
+"smc91c92_cs.c 0.09 1996/8/4 Donald Becker, becker@scyld.com.\n";
+#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
+#else
+#define DEBUG(n, args...)
+#endif
+
+/*====================================================================*/
 
 /* Operational parameter that usually are not changed. */
 
@@ -118,7 +120,8 @@ struct smc_private {
     int                                watchdog, tx_err;
     u_short                    media_status;
     u_short                    fast_poll;
-    u_long                     last_rx;
+    u_short                    link_status;
+    int                                phy_id;
 };
 
 /* Special definitions for Megahertz multifunction cards */
@@ -246,6 +249,7 @@ enum RxCfg { RxAllMulti = 0x0004, RxPromisc = 0x0002,
 #define        MULTICAST2      2
 #define        MULTICAST4      4
 #define        MULTICAST6      6
+#define MGMT           8 
 #define REVISION       0x0a
 
 /* Transmit status bits. */
@@ -287,6 +291,9 @@ static int s9k_config(struct net_device *dev, struct ifmap *map);
 static void smc_set_xcvr(struct net_device *dev, int if_port);
 static void smc_reset(struct net_device *dev);
 static void media_check(u_long arg);
+static void mdio_sync(ioaddr_t addr);
+static int mdio_read(ioaddr_t addr, int phy_id, int loc);
+static void mdio_write(ioaddr_t addr, int phy_id, int loc, int value);
 
 /*======================================================================
 
@@ -908,7 +915,8 @@ static void smc91c92_config(dev_link_t *link)
     cisparse_t parse;
     u_short buf[32];
     char *name;
-    int i, rev;
+    int i, j, rev;
+    ioaddr_t ioaddr;
 
     DEBUG(0, "smc91c92_config(0x%p)\n", link);
     
@@ -1006,9 +1014,10 @@ static void smc91c92_config(dev_link_t *link)
           dev->irq);
     for (i = 0; i < 6; i++)
        printk("%02X%s", dev->dev_addr[i], ((i<5) ? ":" : "\n"));
+
+    ioaddr = dev->base_addr;
     if (rev > 0) {
        u_long mir, mcr;
-       ioaddr_t ioaddr = dev->base_addr;
        SMC_SELECT_BANK(0);
        mir = inw(ioaddr + MEMINFO) & 0xff;
        if (mir == 0xff) mir++;
@@ -1030,6 +1039,23 @@ static void smc91c92_config(dev_link_t *link)
               "MII" : if_names[dev->if_port]);
     }
     
+    if (smc->cfg & CFG_MII_SELECT) {
+       SMC_SELECT_BANK(3);
+
+       for (i = 0; i < 32; i++) {
+           j = mdio_read(dev->base_addr + MGMT, i, 1);
+           if ((j != 0) && (j != 0xffff)) break;
+       }
+       smc->phy_id = (i < 32) ? i : -1;
+       if (i < 32) {
+           DEBUG(0, "  MII transceiver at index %d, status %x.\n", i, j);
+       } else {
+           printk(KERN_NOTICE "  No MII transceivers found!\n");
+       }
+
+       SMC_SELECT_BANK(0);
+    }
+
     return;
     
 config_undo:
@@ -1088,7 +1114,8 @@ static int smc91c92_event(event_t event, int priority,
     dev_link_t *link = args->client_data;
     struct smc_private *smc = link->priv;
     struct net_device *dev = &smc->dev;
-    
+    int i;   
     DEBUG(1, "smc91c92_event(0x%06x)\n", event);
 
     switch (event) {
@@ -1130,6 +1157,16 @@ static int smc91c92_event(event_t event, int priority,
                set_bits(0x0300, dev->base_addr-0x10+OSITECH_AUI_PWR);
                set_bits(0x0300, dev->base_addr-0x10+OSITECH_RESET_ISR);
            }
+           if (((smc->manfid == MANFID_OSITECH) &&
+               (smc->cardid == PRODID_OSITECH_SEVEN)) ||
+               ((smc->manfid == MANFID_PSION) &&
+               (smc->cardid == PRODID_PSION_NET100))) {
+               /* Download the Seven of Diamonds firmware */
+               for (i = 0; i < sizeof(__Xilinx7OD); i++) {
+                   outb(__Xilinx7OD[i], link->io.BasePort1+2);
+                   udelay(50);
+               }
+           }
            if (link->open) {
                smc_reset(dev);
                netif_device_attach(dev);
@@ -1140,6 +1177,63 @@ static int smc91c92_event(event_t event, int priority,
     return 0;
 } /* smc91c92_event */
 
+/*======================================================================
+
+    MII interface support for SMC91cXX based cards
+======================================================================*/
+
+#define MDIO_SHIFT_CLK         0x04
+#define MDIO_DATA_OUT          0x01
+#define MDIO_DIR_WRITE         0x08
+#define MDIO_DATA_WRITE0       (MDIO_DIR_WRITE)
+#define MDIO_DATA_WRITE1       (MDIO_DIR_WRITE | MDIO_DATA_OUT)
+#define MDIO_DATA_READ         0x02
+
+static void mdio_sync(ioaddr_t addr)
+{
+    int bits;
+    for (bits = 0; bits < 32; bits++) {
+       outb(MDIO_DATA_WRITE1, addr);
+       outb(MDIO_DATA_WRITE1 | MDIO_SHIFT_CLK, addr);
+    }
+}
+
+static int mdio_read(ioaddr_t addr, int phy_id, int loc)
+{
+    u_int cmd = (0x06<<10)|(phy_id<<5)|loc;
+    int i, retval = 0;
+
+    mdio_sync(addr);
+    for (i = 13; i >= 0; i--) {
+       int dat = (cmd&(1<<i)) ? MDIO_DATA_WRITE1 : MDIO_DATA_WRITE0;
+       outb(dat, addr);
+       outb(dat | MDIO_SHIFT_CLK, addr);
+    }
+    for (i = 19; i > 0; i--) {
+       outb(0, addr);
+       retval = (retval << 1) | ((inb(addr) & MDIO_DATA_READ) != 0);
+       outb(MDIO_SHIFT_CLK, addr);
+    }
+    return (retval>>1) & 0xffff;
+}
+
+static void mdio_write(ioaddr_t addr, int phy_id, int loc, int value)
+{
+    u_int cmd = (0x05<<28)|(phy_id<<23)|(loc<<18)|(1<<17)|value;
+    int i;
+
+    mdio_sync(addr);
+    for (i = 31; i >= 0; i--) {
+       int dat = (cmd&(1<<i)) ? MDIO_DATA_WRITE1 : MDIO_DATA_WRITE0;
+       outb(dat, addr);
+       outb(dat | MDIO_SHIFT_CLK, addr);
+    }
+    for (i = 1; i >= 0; i--) {
+       outb(0, addr);
+       outb(MDIO_SHIFT_CLK, addr);
+    }
+}
+
 /*======================================================================
   
     The driver core code, most of which should be common with a
@@ -1501,7 +1595,6 @@ static void smc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
        if (status & IM_RCV_INT) {
            /* Got a packet(s). */
            smc_rx(dev);
-           smc->last_rx = jiffies;
        }
        if (status & IM_TX_INT) {
            smc_tx_err(dev);
@@ -1844,6 +1937,17 @@ static void smc_reset(struct net_device *dev)
         TCR_ENABLE | TCR_PAD_EN, ioaddr + TCR);
     set_rx_mode(dev);
 
+    if (smc->cfg & CFG_MII_SELECT) {
+       SMC_SELECT_BANK(3);
+
+       /* Reset MII */
+       mdio_write(ioaddr + MGMT, smc->phy_id, 0, 0x8000);
+
+       /* Restart MII autonegotiation */
+       mdio_write(ioaddr + MGMT, smc->phy_id, 0, 0x0000);
+       mdio_write(ioaddr + MGMT, smc->phy_id, 0, 0x1200);
+    }
+
     /* Enable interrupts. */
     SMC_SELECT_BANK(2);
     outw((IM_EPH_INT | IM_RX_OVRN_INT | IM_RCV_INT) << 8,
@@ -1862,18 +1966,20 @@ static void media_check(u_long arg)
     struct net_device *dev = &smc->dev;
     ioaddr_t ioaddr = dev->base_addr;
     u_short i, media, saved_bank;
+    ioaddr_t mii_addr = dev->base_addr + MGMT;
+    u_short link;
+
+    saved_bank = inw(ioaddr + BANK_SELECT);
 
     if (!netif_device_present(dev))
        goto reschedule;
 
-    saved_bank = inw(ioaddr + BANK_SELECT);
     SMC_SELECT_BANK(2);
     i = inw(ioaddr + INTERRUPT);
     SMC_SELECT_BANK(0);
     media = inw(ioaddr + EPH) & EPH_LINK_OK;
     SMC_SELECT_BANK(1);
     media |= (inw(ioaddr + CONFIG) & CFG_AUI_SELECT) ? 2 : 1;
-    SMC_SELECT_BANK(saved_bank);
     
     /* Check for pending interrupt with watchdog flag set: with
        this, we can limp along even if the interrupt is blocked */
@@ -1887,14 +1993,42 @@ static void media_check(u_long arg)
        smc->fast_poll--;
        smc->media.expires = jiffies + 1;
        add_timer(&smc->media);
+       SMC_SELECT_BANK(saved_bank);
        return;
     }
 
+    if (smc->cfg & CFG_MII_SELECT) {
+       if (smc->phy_id < 0)
+           goto reschedule;
+
+       SMC_SELECT_BANK(3);
+       link = mdio_read(mii_addr, smc->phy_id, 1);
+       if (!link || (link == 0xffff)) {
+           printk(KERN_INFO "%s: MII is missing!\n", dev->name);
+           smc->phy_id = -1;
+           goto reschedule;
+       }
+
+       link &= 0x0004;
+       if (link != smc->link_status) {
+           u_short p = mdio_read(mii_addr, smc->phy_id, 5);
+           printk(KERN_INFO "%s: %s link beat\n", dev->name,
+               (link) ? "found" : "lost");
+           if (link) {
+               printk(KERN_INFO "%s: autonegotiation complete: "
+                   "%sbaseT-%cD selected\n", dev->name,
+                   ((p & 0x0180) ? "100" : "10"),
+                   (((p & 0x0100) || ((p & 0x1c0) == 0x40)) ? 'F' : 'H'));
+           }
+           smc->link_status = link;
+       }
+    }
+
     if (smc->cfg & CFG_MII_SELECT)
        goto reschedule;
 
     /* Ignore collisions unless we've had no rx's recently */
-    if (jiffies - smc->last_rx > HZ) {
+    if (jiffies - dev->last_rx > HZ) {
        if (smc->tx_err || (smc->media_status & EPH_16COL))
            media |= EPH_16COL;
     }
@@ -1930,6 +2064,7 @@ static void media_check(u_long arg)
 reschedule:
     smc->media.expires = jiffies + HZ;
     add_timer(&smc->media);
+    SMC_SELECT_BANK(saved_bank);
 }
 
 /*====================================================================*/
index 757ff555d235aa4a88fe310d1f52f04fd0384983..80799c1b6904be25c1187c958d50ff29bf04dcf7 100644 (file)
@@ -5,6 +5,11 @@
  * This driver supports various Xircom CreditCard Ethernet adapters
  * including the CE2, CE IIps, RE-10, CEM28, CEM33, CE33, CEM56,
  * CE3-100, CE3B, RE-100, REM10BT, and REM56G-100.
+ *
+ * 2000-09-24 <psheer@icon.co.za> The Xircom CE3B-100 may not
+ * autodetect the media properly. In this case use the
+ * if_port=1 (for 10BaseT) or if_port=4 (for 100BaseT) options
+ * to force the media type.
  * 
  * Written originally by Werner Koch based on David Hinds' skeleton of the
  * PCMCIA driver.
@@ -246,7 +251,10 @@ static char *version =
 #define XIR_CBE     14 /* (prodid 1) cardbus ethernet: not supported */
 /*====================================================================*/
 
-/* Parameters that can be set with 'insmod' */
+/* Module parameters */
+
+MODULE_DESCRIPTION("Xircom PCMCIA ethernet driver");
+MODULE_LICENSE("Dual MPL/GPL");
 
 #define INT_MODULE_PARM(n, v) static int n = v; MODULE_PARM(n, "i")
 
@@ -382,7 +390,6 @@ static int init_mii(struct net_device *dev);
 static void do_powerdown(struct net_device *dev);
 static int do_stop(struct net_device *dev);
 
-
 /*=============== Helper functions =========================*/
 static void
 flush_stale_links(void)
@@ -1441,7 +1448,7 @@ xirc2ps_interrupt(int irq, void *dev_id, struct pt_regs *regs)
            lp->stats.rx_fifo_errors++; /* okay ? */
            DEBUG(3, "%s: Alignment error\n", dev->name);
        }
-       
+
        /* clear the received/dropped/error packet */
        PutWord(XIRCREG0_DO, 0x8000); /* issue cmd: skip_rx_packet */
 
@@ -1926,6 +1933,12 @@ init_mii(struct net_device *dev)
     unsigned control, status, linkpartner;
     int i;
 
+    if (if_port == 4 || if_port == 1) { /* force 100BaseT or 10BaseT */
+       dev->if_port = if_port;
+       local->probe_port = 0;
+       return 1;
+    }
+
     status = mii_rd(ioaddr,  0, 1);
     if ((status & 0xff00) != 0x7800)
        return 0; /* No MII */
@@ -2090,4 +2103,3 @@ static int __init setup_xirc2ps_cs(char *str)
 
 __setup("xirc2ps_cs=", setup_xirc2ps_cs);
 #endif
-MODULE_LICENSE("GPL");
index 4890f149b3dcb1015ad9611428e44ba1cd6cc060..f3683e3af4e88580a1e6bf5f9b72877e1019308d 100644 (file)
@@ -237,6 +237,7 @@ int         addr)   /* VPD address */
                2:      error,  data verify error
 
  */
+#if 0 /* Unused at the moment */
 static int     VpdWriteDWord(
 SK_AC          *pAC,   /* pAC pointer */
 SK_IOC         IoC,    /* IO Context */
@@ -268,6 +269,7 @@ SK_U32              data)   /* VPD data to write */
        }
        return(0) ;
 }
+#endif
 
 /*
  *     Read one Stream of 'len' bytes of VPD data, starting at 'addr' from
index b61a3724b53b6abf28c562f7345dbaa8b41bcb7b..dfbbda448903b1cdde2c6f15e6805943f337308c 100644 (file)
@@ -673,6 +673,9 @@ static int yenta_init(pci_socket_t *socket)
 {
        yenta_config_init(socket);
        yenta_clear_maps(socket);
+
+       /* Re-enable interrupts */
+       cb_writel(socket, CB_SOCKET_MASK, CB_CDMASK);
        return 0;
 }
 
@@ -680,6 +683,9 @@ static int yenta_suspend(pci_socket_t *socket)
 {
        yenta_set_socket(socket, &dead_socket);
 
+       /* Disable interrupts */
+       cb_writel(socket, CB_SOCKET_MASK, 0x0);
+
        /*
         * This does not work currently. The controller
         * loses too much informationduring D3 to come up
index aa08f537cf437dae373787f78c2408dd979b6c37..edc07784c7c5da1b1f42585a52a8259769b1aacc 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: su.c,v 1.53 2001/10/13 08:27:50 davem Exp $
+/* $Id: su.c,v 1.54 2001/11/07 14:52:30 davem Exp $
  * su.c: Small serial driver for keyboard/mouse interface on sparc32/PCI
  *
  * Copyright (C) 1997  Eddie C. Dost  (ecd@skynet.be)
@@ -2252,7 +2252,7 @@ done:
  */
 static __inline__ void __init show_su_version(void)
 {
-       char *revision = "$Revision: 1.53 $";
+       char *revision = "$Revision: 1.54 $";
        char *version, *p;
 
        version = strchr(revision, ' ');
@@ -3027,14 +3027,16 @@ int su_console_registered = 0;
 int __init su_serial_console_init(void)
 {
        extern int con_is_present(void);
+       int index;
 
        if (con_is_present())
                return 0;
        if (serial_console == 0)
                return 0;
-       if (su_table[0].port == 0 || su_table[0].port_node == 0)
+       index = serial_console - 1;
+       if (su_table[index].port == 0 || su_table[index].port_node == 0)
                return 0;
-       sercons.index = 0;
+       sercons.index = index;
        register_console(&sercons);
        su_console_registered = 1;
        return 0;
index 3889dd3e693bf366b2e597945800dbd1bd24c9e6..92f8a86b132f54faf6e671b543d36c3167adfd6f 100644 (file)
@@ -51,9 +51,11 @@ static int   ahc_linux_pci_dev_probe(struct pci_dev *pdev,
                                        const struct pci_device_id *ent);
 static int     ahc_linux_pci_reserve_io_region(struct ahc_softc *ahc,
                                                u_long *base);
+#ifdef MMAPIO
 static int     ahc_linux_pci_reserve_mem_region(struct ahc_softc *ahc,
                                                 u_long *bus_addr,
                                                 uint8_t **maddr);
+#endif /* MMAPIO */
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
 static void    ahc_linux_pci_dev_remove(struct pci_dev *pdev);
 
@@ -236,6 +238,7 @@ ahc_linux_pci_reserve_io_region(struct ahc_softc *ahc, u_long *base)
        return (0);
 }
 
+#ifdef MMAPIO
 static int
 ahc_linux_pci_reserve_mem_region(struct ahc_softc *ahc,
                                 u_long *bus_addr,
@@ -274,6 +277,7 @@ ahc_linux_pci_reserve_mem_region(struct ahc_softc *ahc,
                error = ENOMEM;
        return (error);
 }
+#endif /* MMAPIO */
 
 int
 ahc_pci_map_registers(struct ahc_softc *ahc)
index feef961930a91a5dc5023e9d612e5878053d6cd6..dc7c60fa557e9e3ef15b34e38b33923defb6e007 100644 (file)
@@ -1382,7 +1382,7 @@ static int osst_reposition_and_retry(OS_Scsi_Tape * STp, Scsi_Request ** aSRpnt,
        unsigned char   cmd[MAX_COMMAND_SIZE];
        Scsi_Request  * SRpnt;
        int             dev       = TAPE_NR(STp->devt);
-       int             expected  __attribute__ ((__unused__));
+       int             expected  = 0;
        int             attempts  = 1000 / skip;
        int             flag      = 1;
        long            startwait = jiffies;
index 89a376dd9605db4eea22b37e8ee6152ba768fe5e..aabd8adc656c24e78e09debbc94f16c8ee05b61c 100644 (file)
@@ -3942,7 +3942,6 @@ static int __init trident_probe(struct pci_dev *pci_dev, const struct pci_device
 {
        unsigned long iobase;
        struct trident_card *card;
-       dma_addr_t mask;
        u8 bits;
        u8 revision;
        int i = 0;
index 0726f57359ec08602b240b5a18b8ce1f965640a3..1b8e8190a58e9bcc65b280b0b662aa688d02716a 100644 (file)
@@ -322,9 +322,9 @@ static int bluetooth_ctrl_msg (struct usb_bluetooth *bluetooth, int request, int
 
        dr->requesttype = BLUETOOTH_CONTROL_REQUEST_TYPE;
        dr->request = request;
-       dr->value = cpu_to_le16p(&value);
-       dr->index = cpu_to_le16p(&bluetooth->control_out_bInterfaceNum);
-       dr->length = cpu_to_le16p(&len);
+       dr->value = cpu_to_le16((u16) value);
+       dr->index = cpu_to_le16((u16) bluetooth->control_out_bInterfaceNum);
+       dr->length = cpu_to_le16((u16) len);
        
        FILL_CONTROL_URB (urb, bluetooth->dev, usb_sndctrlpipe(bluetooth->dev, 0),
                          (unsigned char*)dr, urb->transfer_buffer, len, bluetooth_ctrl_callback, bluetooth);
index bffef60b29e9dc03d950aa7f80d07d7a832983cb..9cd3f2166bd8d73d1712c790631189b052d4e0fb 100644 (file)
@@ -330,7 +330,7 @@ static int catc_hard_start_xmit(struct sk_buff *skb, struct net_device *netdev)
 
        catc->tx_ptr = (((catc->tx_ptr - 1) >> 6) + 1) << 6;
        tx_buf = catc->tx_buf[catc->tx_idx] + catc->tx_ptr;
-       *((u16*)tx_buf) = cpu_to_le16p(&skb->len);
+       *((u16*)tx_buf) = cpu_to_le16((u16)skb->len);
        memcpy(tx_buf + 2, skb->data, skb->len);
        catc->tx_ptr += skb->len + 2;
 
index cfc21092600df370d36af22c2791419509f0a397..529a1112a8028d681fdf2441892d1b04f1790668 100644 (file)
@@ -363,7 +363,7 @@ void hidinput_disconnect(struct hid_device *);
 
 #endif
 
-#define IS_INPUT_APPLICATION(a) ((a >= 0x00010000) && (a <= 0x00010008))
+#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || ( a == 0x000c0001))
 
 int hid_open(struct hid_device *);
 void hid_close(struct hid_device *);
index 8a4432065435c0ea9f1dca691380c1ece9b3d101..df36984addf3f4a3c2840fb381c4062bbf22ae26 100644 (file)
@@ -374,9 +374,9 @@ static int kaweth_download_firmware(struct kaweth_device *kaweth,
        kaweth_dbg("High: %i, Low:%i", kaweth->firmware_buf[3],
                   kaweth->firmware_buf[2]);
 
-       kaweth_dbg("Downloading firmware at %x to kaweth device at %x", 
-           (int)data, 
-           (int)kaweth);
+       kaweth_dbg("Downloading firmware at %p to kaweth device at %p", 
+           data, 
+           kaweth);
        kaweth_dbg("Firmware length: %d", data_len);
 
        return kaweth_control(kaweth,
@@ -480,7 +480,7 @@ static void kaweth_usb_receive(struct urb *urb)
        int count = urb->actual_length;
        int count2 = urb->transfer_buffer_length;
                        
-       __u16 pkt_len = le16_to_cpup(kaweth->rx_buf);
+       __u16 pkt_len = le16_to_cpup((u16 *)kaweth->rx_buf);
 
        struct sk_buff *skb;
 
index d8d767f24407be55df68dfb88dee0d0d23928c24..b5be01825d9b5250cf19305870b7d8e591838f6e 100644 (file)
@@ -437,7 +437,6 @@ static int ftdi_sio_write (struct usb_serial_port *port, int from_user,
        struct usb_serial *serial = port->serial;
        struct ftdi_private *priv = (struct ftdi_private *)port->private;
        unsigned char *first_byte = port->write_urb->transfer_buffer;
-       unsigned char dbug_byte;
        int data_offset ;
        int result;
        
index fa08f724f547a895ef55b8918a25b7f797124e4f..de1a523ce5d3bc0191744ca61c1ff7c72a98a007 100644 (file)
@@ -1018,6 +1018,7 @@ static int edge_open (struct usb_serial_port *port, struct file * filp)
                        /* Like to use FILL_INT_URB, but we don't know wMaxPacketSize or bInterval, something to change for 2.5... */
                        edge_serial->interrupt_read_urb->complete = edge_interrupt_callback;
                        edge_serial->interrupt_read_urb->context = edge_serial;
+                       edge_serial->interrupt_read_urb->dev = serial->dev;
                        /* FILL_INT_URB(edge_serial->interrupt_read_urb, serial->dev, 
                                     usb_rcvintpipe (serial->dev, edge_serial->interrupt_in_endpoint),
                                     edge_serial->interrupt_in_buffer, edge_serial->interrupt_in_endpoint.wMaxPacketSize,
@@ -1028,8 +1029,9 @@ static int edge_open (struct usb_serial_port *port, struct file * filp)
                        /* Like to use FILL_BULK_URB, but we don't know wMaxPacketSize or bInterval, something to change for 2.5... */
                        edge_serial->read_urb->complete = edge_bulk_in_callback;
                        edge_serial->read_urb->context = edge_serial;
+                       edge_serial->read_urb->dev = serial->dev;
                        /* FILL_BULK_URB(edge_serial->read_urb, serial->dev, 
-                                     usb_rcvbulkpipe (serial->dev, edge_serial->bulk_in_endpoint),
+                                     usb_rcvbulkpipe (serial->dev, port->bulk_in_endpointAddress),
                                      edge_serial->bulk_in_buffer, edge_serial->bulk_in_endpoint->wMaxPacketSize,
                                      edge_bulk_in_callback, edge_serial);
                        */
@@ -1399,7 +1401,6 @@ static void send_more_port_data(struct edgeport_serial *edge_serial, struct edge
        struct urb      *urb;
        unsigned char   *buffer;
        int             status;
-       unsigned long   flags;
        int             count;
        int             bytesleft;
        int             firsthalf;
@@ -1407,13 +1408,9 @@ static void send_more_port_data(struct edgeport_serial *edge_serial, struct edge
 
        dbg(__FUNCTION__"(%d)", edge_port->port->number);
 
-       /* find our next free urb */    // ICK!!! FIXME!!!
-       save_flags(flags); cli();
-
        if (edge_port->write_in_progress ||
            !edge_port->open             ||
            (fifo->count == 0)) {
-               restore_flags(flags);
                dbg(__FUNCTION__"(%d) EXIT - fifo %d, PendingWrite = %d", edge_port->port->number, fifo->count, edge_port->write_in_progress);
                return;
        }
@@ -1426,14 +1423,12 @@ static void send_more_port_data(struct edgeport_serial *edge_serial, struct edge
        //      it's better to wait for more credits so we can do a larger
        //      write.
        if (edge_port->txCredits < EDGE_FW_GET_TX_CREDITS_SEND_THRESHOLD(edge_port->maxTxCredits)) {
-               restore_flags(flags);
                dbg(__FUNCTION__"(%d) Not enough credit - fifo %d TxCredit %d", edge_port->port->number, fifo->count, edge_port->txCredits );
                return;
        }
 
        // lock this write
        edge_port->write_in_progress = TRUE;
-       restore_flags(flags);
 
        // get a pointer to the write_urb
        urb = edge_port->write_urb;
@@ -1833,7 +1828,6 @@ static int edge_ioctl (struct usb_serial_port *port, struct file *file, unsigned
        struct async_icount cnow;
        struct async_icount cprev;
        struct serial_icounter_struct icount;
-       unsigned long flags;
 
 
        dbg(__FUNCTION__" - port %d, cmd = 0x%x", port->number, cmd);
@@ -1845,14 +1839,6 @@ static int edge_ioctl (struct usb_serial_port *port, struct file *file, unsigned
                        return get_number_bytes_avail(edge_port, (unsigned int *) arg);
                        break;
 
-//             case TCGETS:            
-//                     dbg(__FUNCTION__" (%d) TCGETS",  port->number);
-//                     break;
-
-//             case TCSETS:            
-//                     dbg(__FUNCTION__" (%d) TCSETS",  port->number);
-//                     break;
-
                case TIOCSERGETLSR:
                        dbg(__FUNCTION__" (%d) TIOCSERGETLSR",  port->number);
                        return get_lsr_info(edge_port, (unsigned int *) arg);
@@ -1878,17 +1864,13 @@ static int edge_ioctl (struct usb_serial_port *port, struct file *file, unsigned
 
                case TIOCMIWAIT:
                        dbg(__FUNCTION__" (%d) TIOCMIWAIT",  port->number);
-                       save_flags(flags); cli();
                        cprev = edge_port->icount;
-                       restore_flags(flags);
                        while (1) {
                                interruptible_sleep_on(&edge_port->delta_msr_wait);
                                /* see if a signal did it */
                                if (signal_pending(current))
                                        return -ERESTARTSYS;
-                               save_flags(flags); cli();
-                               cnow = edge_port->icount; /* atomic copy */
-                               restore_flags(flags);
+                               cnow = edge_port->icount;
                                if (cnow.rng == cprev.rng && cnow.dsr == cprev.dsr &&
                                    cnow.dcd == cprev.dcd && cnow.cts == cprev.cts)
                                        return -EIO; /* no change => error */
@@ -1904,9 +1886,7 @@ static int edge_ioctl (struct usb_serial_port *port, struct file *file, unsigned
                        break;
 
                case TIOCGICOUNT:
-                       save_flags(flags); cli();
                        cnow = edge_port->icount;
-                       restore_flags(flags);
                        icount.cts = cnow.cts;
                        icount.dsr = cnow.dsr;
                        icount.rng = cnow.rng;
@@ -3054,22 +3034,10 @@ static void edge_shutdown (struct usb_serial *serial)
  ****************************************************************************/
 int __init edgeport_init(void)
 {
-       usb_serial_register (&edgeport_4_device);
-       usb_serial_register (&rapidport_4_device);
-       usb_serial_register (&edgeport_4t_device);
-       usb_serial_register (&edgeport_2_device);
-       usb_serial_register (&edgeport_4i_device);
-       usb_serial_register (&edgeport_2i_device);
-       usb_serial_register (&edgeport_prl_device);
-       usb_serial_register (&edgeport_421_device);
-       usb_serial_register (&edgeport_21_device);
-       usb_serial_register (&edgeport_8dual_device);
-       usb_serial_register (&edgeport_8_device);
-       usb_serial_register (&edgeport_2din_device);
-       usb_serial_register (&edgeport_4din_device);
-       usb_serial_register (&edgeport_16dual_device);
-       usb_serial_register (&edgeport_compat_id_device);
-       usb_serial_register (&edgeport_8i_device);
+       usb_serial_register (&edgeport_1port_device);
+       usb_serial_register (&edgeport_2port_device);
+       usb_serial_register (&edgeport_4port_device);
+       usb_serial_register (&edgeport_8port_device);
        info(DRIVER_DESC " " DRIVER_VERSION);
        return 0;
 }
@@ -3082,22 +3050,10 @@ int __init edgeport_init(void)
  ****************************************************************************/
 void __exit edgeport_exit (void)
 {
-       usb_serial_deregister (&edgeport_4_device);
-       usb_serial_deregister (&rapidport_4_device);
-       usb_serial_deregister (&edgeport_4t_device);
-       usb_serial_deregister (&edgeport_2_device);
-       usb_serial_deregister (&edgeport_4i_device);
-       usb_serial_deregister (&edgeport_2i_device);
-       usb_serial_deregister (&edgeport_prl_device);
-       usb_serial_deregister (&edgeport_421_device);
-       usb_serial_deregister (&edgeport_21_device);
-       usb_serial_deregister (&edgeport_8dual_device);
-       usb_serial_deregister (&edgeport_8_device);
-       usb_serial_deregister (&edgeport_2din_device);
-       usb_serial_deregister (&edgeport_4din_device);
-       usb_serial_deregister (&edgeport_16dual_device);
-       usb_serial_deregister (&edgeport_compat_id_device);
-       usb_serial_deregister (&edgeport_8i_device);
+       usb_serial_deregister (&edgeport_1port_device);
+       usb_serial_deregister (&edgeport_2port_device);
+       usb_serial_deregister (&edgeport_4port_device);
+       usb_serial_deregister (&edgeport_8port_device);
 }
 
 module_init(edgeport_init);
index d7e2c2aeb13c0793b6e93ca01ed908b57ada9f15..7391139055882ea9c8a4d34d16386457836b1215 100644 (file)
  * 
  */
 
-static __devinitdata struct usb_device_id edgeport_4_id_table [] =     {{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4)}, {} };
-static __devinitdata struct usb_device_id rapidport_4_id_table [] =    {{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_RAPIDPORT_4) }, {} };
-static __devinitdata struct usb_device_id edgeport_4t_id_table [] =    {{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4T) }, {} };
-static __devinitdata struct usb_device_id edgeport_2_id_table [] =     {{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_2) }, {} };
-static __devinitdata struct usb_device_id edgeport_4i_id_table [] =    {{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4I) }, {} };
-static __devinitdata struct usb_device_id edgeport_2i_id_table [] =    {{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_2I) }, {} };
-static __devinitdata struct usb_device_id edgeport_prl_id_table [] =   {{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_PARALLEL_PORT) }, {} };
-static __devinitdata struct usb_device_id edgeport_421_id_table [] =   {{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_421) }, {} };
-static __devinitdata struct usb_device_id edgeport_21_id_table [] =    {{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_21) }, {} };
-static __devinitdata struct usb_device_id edgeport_8dual_id_table [] = {{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8_DUAL_CPU) }, {} };
-static __devinitdata struct usb_device_id edgeport_8_id_table [] =     {{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8) }, {} };
-static __devinitdata struct usb_device_id edgeport_2din_id_table [] =  {{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_2_DIN) }, {} };
-static __devinitdata struct usb_device_id edgeport_4din_id_table [] =  {{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4_DIN) }, {} };
-static __devinitdata struct usb_device_id edgeport_16dual_id_table [] =        {{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_16_DUAL_CPU) }, {} };
-static __devinitdata struct usb_device_id edgeport_compat_id_table [] =        {{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_COMPATIBLE) }, {} };
-static __devinitdata struct usb_device_id edgeport_8i_id_table [] =    {{ USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8I) }, {} };
+#ifndef IO_TABLES_H
+#define IO_TABLES_H
 
+static __devinitdata struct usb_device_id edgeport_1port_id_table [] = {
+       { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_PARALLEL_PORT) },
+       { }
+};
+
+static __devinitdata struct usb_device_id edgeport_2port_id_table [] = {
+       { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_2) },
+       { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_2I) },
+       { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_421) },
+       { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_21) },
+       { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_2_DIN) },
+       { }
+};
+
+static __devinitdata struct usb_device_id edgeport_4port_id_table [] = {
+       { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4) },
+       { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_RAPIDPORT_4) },
+       { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4T) },
+       { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_MT4X56USB) },
+       { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4I) },
+       { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8_DUAL_CPU) },
+       { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4_DIN) },
+       { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_COMPATIBLE) },
+       { }
+};
+
+static __devinitdata struct usb_device_id edgeport_8port_id_table [] = {
+       { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8) },
+       { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_16_DUAL_CPU) },
+       { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_8I) },
+       { }
+};
 
 /* Devices that this driver supports */
 static __devinitdata struct usb_device_id id_table_combined [] = {
        { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4) },
        { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_RAPIDPORT_4) },
        { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4T) },
+       { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_MT4X56USB) },
        { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_2) },
        { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_4I) },
        { USB_DEVICE(USB_VENDOR_ID_ION, ION_DEVICE_ID_EDGEPORT_2I) },
@@ -52,155 +71,9 @@ static __devinitdata struct usb_device_id id_table_combined [] = {
 
 MODULE_DEVICE_TABLE (usb, id_table_combined);
 
-
-/* build up the list of devices that this driver supports */
-struct usb_serial_device_type edgeport_4_device = {
-       name:                   "Edgeport 4",
-       id_table:               edgeport_4_id_table,
-       needs_interrupt_in:     MUST_HAVE,
-       needs_bulk_in:          MUST_HAVE,
-       needs_bulk_out:         MUST_HAVE,
-       num_interrupt_in:       1,
-       num_bulk_in:            1,
-       num_bulk_out:           1,
-       num_ports:              4,
-       open:                   edge_open,
-       close:                  edge_close,
-       throttle:               edge_throttle,
-       unthrottle:             edge_unthrottle,
-       startup:                edge_startup,
-       shutdown:               edge_shutdown,
-       ioctl:                  edge_ioctl,
-       set_termios:            edge_set_termios,
-       write:                  edge_write,
-       write_room:             edge_write_room,
-       chars_in_buffer:        edge_chars_in_buffer,
-       break_ctl:              edge_break,
-};
-
-struct usb_serial_device_type rapidport_4_device = {
-       name:                   "Rapidport 4",
-       id_table:               rapidport_4_id_table,
-       needs_interrupt_in:     MUST_HAVE,
-       needs_bulk_in:          MUST_HAVE,
-       needs_bulk_out:         MUST_HAVE,
-       num_interrupt_in:       1,
-       num_bulk_in:            1,
-       num_bulk_out:           1,
-       num_ports:              4,
-       open:                   edge_open,
-       close:                  edge_close,
-       throttle:               edge_throttle,
-       unthrottle:             edge_unthrottle,
-       startup:                edge_startup,
-       shutdown:               edge_shutdown,
-       ioctl:                  edge_ioctl,
-       set_termios:            edge_set_termios,
-       write:                  edge_write,
-       write_room:             edge_write_room,
-       chars_in_buffer:        edge_chars_in_buffer,
-       break_ctl:              edge_break,
-};
-
-struct usb_serial_device_type edgeport_4t_device = {
-       name:                   "Edgeport 4t",
-       id_table:               edgeport_4t_id_table,
-       needs_interrupt_in:     MUST_HAVE,
-       needs_bulk_in:          MUST_HAVE,
-       needs_bulk_out:         MUST_HAVE,
-       num_interrupt_in:       1,
-       num_bulk_in:            1,
-       num_bulk_out:           1,
-       num_ports:              4,
-       open:                   edge_open,
-       close:                  edge_close,
-       throttle:               edge_throttle,
-       unthrottle:             edge_unthrottle,
-       startup:                edge_startup,
-       shutdown:               edge_shutdown,
-       ioctl:                  edge_ioctl,
-       set_termios:            edge_set_termios,
-       write:                  edge_write,
-       write_room:             edge_write_room,
-       chars_in_buffer:        edge_chars_in_buffer,
-       break_ctl:              edge_break,
-};
-
-struct usb_serial_device_type edgeport_2_device = {
-       name:                   "Edgeport 2",
-       id_table:               edgeport_2_id_table,
-       needs_interrupt_in:     MUST_HAVE,
-       needs_bulk_in:          MUST_HAVE,
-       needs_bulk_out:         MUST_HAVE,
-       num_interrupt_in:       1,
-       num_bulk_in:            1,
-       num_bulk_out:           1,
-       num_ports:              2,
-       open:                   edge_open,
-       close:                  edge_close,
-       throttle:               edge_throttle,
-       unthrottle:             edge_unthrottle,
-       startup:                edge_startup,
-       shutdown:               edge_shutdown,
-       ioctl:                  edge_ioctl,
-       set_termios:            edge_set_termios,
-       write:                  edge_write,
-       write_room:             edge_write_room,
-       chars_in_buffer:        edge_chars_in_buffer,
-       break_ctl:              edge_break,
-};
-
-struct usb_serial_device_type edgeport_4i_device = {
-       name:                   "Edgeport 4i",
-       id_table:               edgeport_4i_id_table,
-       needs_interrupt_in:     MUST_HAVE,
-       needs_bulk_in:          MUST_HAVE,
-       needs_bulk_out:         MUST_HAVE,
-       num_interrupt_in:       1,
-       num_bulk_in:            1,
-       num_bulk_out:           1,
-       num_ports:              4,
-       open:                   edge_open,
-       close:                  edge_close,
-       throttle:               edge_throttle,
-       unthrottle:             edge_unthrottle,
-       startup:                edge_startup,
-       shutdown:               edge_shutdown,
-       ioctl:                  edge_ioctl,
-       set_termios:            edge_set_termios,
-       write:                  edge_write,
-       write_room:             edge_write_room,
-       chars_in_buffer:        edge_chars_in_buffer,
-       break_ctl:              edge_break,
-};
-
-struct usb_serial_device_type edgeport_2i_device = {
-       name:                   "Edgeport 2i",
-       id_table:               edgeport_2i_id_table,
-       needs_interrupt_in:     MUST_HAVE,
-       needs_bulk_in:          MUST_HAVE,
-       needs_bulk_out:         MUST_HAVE,
-       num_interrupt_in:       1,
-       num_bulk_in:            1,
-       num_bulk_out:           1,
-       num_ports:              2,
-       open:                   edge_open,
-       close:                  edge_close,
-       throttle:               edge_throttle,
-       unthrottle:             edge_unthrottle,
-       startup:                edge_startup,
-       shutdown:               edge_shutdown,
-       ioctl:                  edge_ioctl,
-       set_termios:            edge_set_termios,
-       write:                  edge_write,
-       write_room:             edge_write_room,
-       chars_in_buffer:        edge_chars_in_buffer,
-       break_ctl:              edge_break,
-};
-
-struct usb_serial_device_type edgeport_prl_device = {
-       name:                   "Edgeport Parallel",
-       id_table:               edgeport_prl_id_table,
+static struct usb_serial_device_type edgeport_1port_device = {
+       name:                   "Edgeport 1 port adapter",
+       id_table:               edgeport_1port_id_table,
        needs_interrupt_in:     MUST_HAVE,
        needs_bulk_in:          MUST_HAVE,
        needs_bulk_out:         MUST_HAVE,
@@ -222,9 +95,9 @@ struct usb_serial_device_type edgeport_prl_device = {
        break_ctl:              edge_break,
 };
 
-struct usb_serial_device_type edgeport_421_device = {
-       name:                   "Edgeport 421",
-       id_table:               edgeport_421_id_table,
+static struct usb_serial_device_type edgeport_2port_device = {
+       name:                   "Edgeport 2 port adapter",
+       id_table:               edgeport_2port_id_table,
        needs_interrupt_in:     MUST_HAVE,
        needs_bulk_in:          MUST_HAVE,
        needs_bulk_out:         MUST_HAVE,
@@ -246,33 +119,9 @@ struct usb_serial_device_type edgeport_421_device = {
        break_ctl:              edge_break,
 };
 
-struct usb_serial_device_type edgeport_21_device = {
-       name:                   "Edgeport 21",
-       id_table:               edgeport_21_id_table,
-       needs_interrupt_in:     MUST_HAVE,
-       needs_bulk_in:          MUST_HAVE,
-       needs_bulk_out:         MUST_HAVE,
-       num_interrupt_in:       1,
-       num_bulk_in:            1,
-       num_bulk_out:           1,
-       num_ports:              2,
-       open:                   edge_open,
-       close:                  edge_close,
-       throttle:               edge_throttle,
-       unthrottle:             edge_unthrottle,
-       startup:                edge_startup,
-       shutdown:               edge_shutdown,
-       ioctl:                  edge_ioctl,
-       set_termios:            edge_set_termios,
-       write:                  edge_write,
-       write_room:             edge_write_room,
-       chars_in_buffer:        edge_chars_in_buffer,
-       break_ctl:              edge_break,
-};
-
-struct usb_serial_device_type edgeport_8dual_device = {
-       name:                   "Edgeport 8 dual cpu",
-       id_table:               edgeport_8dual_id_table,
+static struct usb_serial_device_type edgeport_4port_device = {
+       name:                   "Edgeport 4 port adapter",
+       id_table:               edgeport_4port_id_table,
        needs_interrupt_in:     MUST_HAVE,
        needs_bulk_in:          MUST_HAVE,
        needs_bulk_out:         MUST_HAVE,
@@ -294,9 +143,9 @@ struct usb_serial_device_type edgeport_8dual_device = {
        break_ctl:              edge_break,
 };
 
-struct usb_serial_device_type edgeport_8_device = {
-       name:                   "Edgeport 8",
-       id_table:               edgeport_8_id_table,
+static struct usb_serial_device_type edgeport_8port_device = {
+       name:                   "Edgeport 8 port adapter",
+       id_table:               edgeport_8port_id_table,
        needs_interrupt_in:     MUST_HAVE,
        needs_bulk_in:          MUST_HAVE,
        needs_bulk_out:         MUST_HAVE,
@@ -318,127 +167,5 @@ struct usb_serial_device_type edgeport_8_device = {
        break_ctl:              edge_break,
 };
 
-struct usb_serial_device_type edgeport_2din_device = {
-       name:                   "Edgeport 2din",
-       id_table:               edgeport_2din_id_table,
-       needs_interrupt_in:     MUST_HAVE,
-       needs_bulk_in:          MUST_HAVE,
-       needs_bulk_out:         MUST_HAVE,
-       num_interrupt_in:       1,
-       num_bulk_in:            1,
-       num_bulk_out:           1,
-       num_ports:              2,
-       open:                   edge_open,
-       close:                  edge_close,
-       throttle:               edge_throttle,
-       unthrottle:             edge_unthrottle,
-       startup:                edge_startup,
-       shutdown:               edge_shutdown,
-       ioctl:                  edge_ioctl,
-       set_termios:            edge_set_termios,
-       write:                  edge_write,
-       write_room:             edge_write_room,
-       chars_in_buffer:        edge_chars_in_buffer,
-       break_ctl:              edge_break,
-};
-
-struct usb_serial_device_type edgeport_4din_device = {
-       name:                   "Edgeport 4din",
-       id_table:               edgeport_4din_id_table,
-       needs_interrupt_in:     MUST_HAVE,
-       needs_bulk_in:          MUST_HAVE,
-       needs_bulk_out:         MUST_HAVE,
-       num_interrupt_in:       1,
-       num_bulk_in:            1,
-       num_bulk_out:           1,
-       num_ports:              4,
-       open:                   edge_open,
-       close:                  edge_close,
-       throttle:               edge_throttle,
-       unthrottle:             edge_unthrottle,
-       startup:                edge_startup,
-       shutdown:               edge_shutdown,
-       ioctl:                  edge_ioctl,
-       set_termios:            edge_set_termios,
-       write:                  edge_write,
-       write_room:             edge_write_room,
-       chars_in_buffer:        edge_chars_in_buffer,
-       break_ctl:              edge_break,
-};
-
-struct usb_serial_device_type edgeport_16dual_device = {
-       name:                   "Edgeport 16 dual cpu",
-       id_table:               edgeport_16dual_id_table,
-       needs_interrupt_in:     MUST_HAVE,
-       needs_bulk_in:          MUST_HAVE,
-       needs_bulk_out:         MUST_HAVE,
-       num_interrupt_in:       1,
-       num_bulk_in:            1,
-       num_bulk_out:           1,
-       num_ports:              8,
-       open:                   edge_open,
-       close:                  edge_close,
-       throttle:               edge_throttle,
-       unthrottle:             edge_unthrottle,
-       startup:                edge_startup,
-       shutdown:               edge_shutdown,
-       ioctl:                  edge_ioctl,
-       set_termios:            edge_set_termios,
-       write:                  edge_write,
-       write_room:             edge_write_room,
-       chars_in_buffer:        edge_chars_in_buffer,
-       break_ctl:              edge_break,
-};
-
-struct usb_serial_device_type edgeport_compat_id_device = {
-       name:                   "Edgeport Compatible",
-       id_table:               edgeport_compat_id_table,
-       needs_interrupt_in:     MUST_HAVE,
-       needs_bulk_in:          MUST_HAVE,
-       needs_bulk_out:         MUST_HAVE,
-       num_interrupt_in:       1,
-       num_bulk_in:            1,
-       num_bulk_out:           1,
-       num_ports:              4,
-       open:                   edge_open,
-       close:                  edge_close,
-       throttle:               edge_throttle,
-       unthrottle:             edge_unthrottle,
-       startup:                edge_startup,
-       shutdown:               edge_shutdown,
-       ioctl:                  edge_ioctl,
-       set_termios:            edge_set_termios,
-       write:                  edge_write,
-       write_room:             edge_write_room,
-       chars_in_buffer:        edge_chars_in_buffer,
-       break_ctl:              edge_break,
-};
-
-
-struct usb_serial_device_type edgeport_8i_device = {
-       name:                   "Edgeport 8i",
-       id_table:               edgeport_8i_id_table,
-       needs_interrupt_in:     MUST_HAVE,
-       needs_bulk_in:          MUST_HAVE,
-       needs_bulk_out:         MUST_HAVE,
-       num_interrupt_in:       1,
-       num_bulk_in:            1,
-       num_bulk_out:           1,
-       num_ports:              8,
-       open:                   edge_open,
-       close:                  edge_close,
-       throttle:               edge_throttle,
-       unthrottle:             edge_unthrottle,
-       startup:                edge_startup,
-       shutdown:               edge_shutdown,
-       ioctl:                  edge_ioctl,
-       set_termios:            edge_set_termios,
-       write:                  edge_write,
-       write_room:             edge_write_room,
-       chars_in_buffer:        edge_chars_in_buffer,
-       break_ctl:              edge_break,
-};
-
-
-
+#endif
 
index d1c33eec859a569dded0071ece01b2ed372f4c8d..6d023b3494429e3823ea250e27df11b396db7677 100644 (file)
@@ -90,6 +90,7 @@
 #define ION_DEVICE_ID_EDGEPORT_16_DUAL_CPU     0x012   // Half of an Edgeport/16 (the kind with 2 EP/8s)
 #define ION_DEVICE_ID_EDGEPORT_COMPATIBLE      0x013   // Edgeport Compatible, for NCR, Axiohm etc. testing
 #define ION_DEVICE_ID_EDGEPORT_8I              0x014   // Edgeport/8 RS422 (single-CPU)
+#define ION_DEVICE_ID_MT4X56USB                        0x1403  // OEM device
 
 // These IDs are used by the Edgeport.exe program for uninstalling.
 // 
index 6c94e167e1458a6b9ccd0a87b15731db09f7cfa3..28de67b24f670207b8c3c0c510b2d50d07aa6755 100644 (file)
@@ -208,6 +208,7 @@ freecom_ide_write (struct us_data *us, int reg, int value)
 }
 #endif
 
+#if 0 /* Unused at this time */
 /* Read a value from an ide register. */
 static int
 freecom_ide_read (struct us_data *us, int reg, int *value)
@@ -268,6 +269,7 @@ freecom_ide_read (struct us_data *us, int reg, int *value)
 
         return USB_STOR_TRANSPORT_GOOD;
 }
+#endif
 
 static int
 freecom_readdata (Scsi_Cmnd *srb, struct us_data *us,
index ce084a2a9a7d6017a9041162962453d6c2ee2c71..baab4d50d91602da23bf844ccb72b84f332172e0 100644 (file)
@@ -1112,8 +1112,10 @@ static int isd200_try_enum(struct us_data *us, unsigned char master_slave,
 
        /* loop until we detect !BSY or timeout */
        while(TRUE) {
+#ifdef CONFIG_USB_STORAGE_DEBUG
                char* mstr = master_slave == ATA_ADDRESS_DEVHEAD_STD ?
                        "Master" : "Slave";
+#endif
 
                status = isd200_action( us, ACTION_ENUM, NULL, master_slave );
                if ( status != ISD200_GOOD )
index e0fc97c83756435435d6675115436d4f627a25b6..ffb3a7160ab1d792f29043459f1662a65cd46b79 100644 (file)
@@ -64,10 +64,10 @@ if [ "$CONFIG_FB" = "y" ]; then
       fi
    fi
    if [ "$CONFIG_PPC" = "y" ]; then
-      bool '  Open Firmware frame buffer device support' CONFIG_FB_OF
-      bool '  Apple "control" display support' CONFIG_FB_CONTROL
-      bool '  Apple "platinum" display support' CONFIG_FB_PLATINUM
-      bool '  Apple "valkyrie" display support' CONFIG_FB_VALKYRIE
+      dep_bool '  Open Firmware frame buffer device support' CONFIG_FB_OF $CONFIG_ALL_PPC
+      dep_bool '  Apple "control" display support' CONFIG_FB_CONTROL $CONFIG_ALL_PPC
+      dep_bool '  Apple "platinum" display support' CONFIG_FB_PLATINUM $CONFIG_ALL_PPC
+      dep_bool '  Apple "valkyrie" display support' CONFIG_FB_VALKYRIE $CONFIG_ALL_PPC
       bool '  Chips 65550 display support' CONFIG_FB_CT65550
       bool '  IMS Twin Turbo display support' CONFIG_FB_IMSTT
       bool '  S3 Trio display support' CONFIG_FB_S3TRIO
index f102c975729ffcca594eb3d3284046cd3de97f57..50391f8212185659a0365e54840f1a103a52cc35 100644 (file)
@@ -1528,7 +1528,7 @@ acornfb_setup(char *options)
 
        acornfb_init_fbinfo();
 
-       while (opt = strsep(&options, ",")) {
+       while ((opt = strsep(&options, ",")) != NULL) {
                if (!*opt)
                        continue;
 
index fb30cde0f2fa9d9cae9e571b3813be47bda76a4d..cab58a763256b96b0cab712522e35253436d7f79 100644 (file)
@@ -1192,7 +1192,9 @@ int __init amifb_setup(char *options)
        if (!options || !*options)
                return 0;
 
-       while (this_opt = strsep(&options, ",")) {
+       while ((this_opt = strsep(&options, ",")) != NULL) {
+               if (!*this_opt)
+                       continue;
                if (!strcmp(this_opt, "inverse")) {
                        amifb_inverse = 1;
                        fb_invert_cmaps();
index 15c6116aeaa16f6847113f8c18dacd48261e1019..2535b2d6cb0e9acc7a78a60df34e0399ac8407f3 100644 (file)
@@ -1423,7 +1423,7 @@ void __init control_setup(char *options)
        if (!options || !*options)
                return;
 
-       while (this_opt = strsep(&options, ",")) {
+       while ((this_opt = strsep(&options, ",")) != NULL) {
                if (!strncmp(this_opt, "font:", 5)) {
                        char *p;
                        int i;
index ff9b6cef54bd1331579cd22e537232dcf8280111..f7925485b7ece62c55793ebfb92e041cf06155c1 100644 (file)
@@ -1022,7 +1022,9 @@ int __init cyberfb_setup(char *options)
                return 0;
        }
 
-       while (this_opt = strsep(&options, ",")) {
+       while ((this_opt = strsep(&options, ",")) != NULL) {
+               if (!*this_opt)
+                       continue;
                if (!strcmp(this_opt, "inverse")) {
                        Cyberfb_inverse = 1;
                        fb_invert_cmaps();
index e5080d25f3aba7162d02381b3dad0f0cea2341dc..8f445aff7fa870374fc74fe74fffb0487da7fc52 100644 (file)
@@ -563,8 +563,10 @@ fb_mmap(struct file *file, struct vm_area_struct * vma)
                /* memory mapped io */
                off -= len;
                fb->fb_get_var(&var, PROC_CONSOLE(info), info);
-               if (var.accel_flags)
+               if (var.accel_flags) {
+                       unlock_kernel();
                        return -EINVAL;
+               }
                start = fix.mmio_start;
                len = PAGE_ALIGN((start & ~PAGE_MASK)+fix.mmio_len);
        }
index 6eaff519139b388f7146a41e00bd789529768608..1f4883c786cfda41a7bab2a9d27fe2042c0264bf 100644 (file)
@@ -430,7 +430,7 @@ int __init fm2fb_setup(char *options)
     if (!options || !*options)
        return 0;
 
-    while (this_opt = strsep(&options, ",")) {
+    while ((this_opt = strsep(&options, ",")) != NULL) {
        if (!strncmp(this_opt, "pal", 3))
            fm2fb_mode = FM2FB_MODE_PAL;
        else if (!strncmp(this_opt, "ntsc", 4))
index 7379dfbbc1d61323c6a3aac112e0b02a3b01e535..673e96557b4bb98926e09b8b41964734621b18a9 100644 (file)
@@ -773,7 +773,7 @@ int __init igafb_setup(char *options)
     if (!options || !*options)
         return 0;
 
-    while (this_opt = strsep(&options, ",")) {
+    while ((this_opt = strsep(&options, ",")) != NULL) {
         if (!strncmp(this_opt, "font:", 5)) {
                 char *p;
                 int i;
index 6f7c697adc209e964b66a778bec2c4b86cb63af1..2030ab5967a8605248cadde40532235dcc24ee50 100644 (file)
@@ -1977,7 +1977,7 @@ imsttfb_setup(char *options)
        if (!options || !*options)
                return 0;
 
-       while (this_opt = strsep(&options, ",")) {
+       while ((this_opt = strsep(&options, ",")) != NULL) {
                if (!strncmp(this_opt, "font:", 5)) {
                        char *p;
                        int i;
index 5588d8acb1848b506403c3d8cfbfaf1b5ef80e51..df9602d538e4d36823b62c5294a143afb133a261 100644 (file)
@@ -848,7 +848,7 @@ void __init macfb_setup(char *options, int *ints)
        if (!options || !*options)
                return;
        
-       while (this_opt = strsep(&options, ",")) {
+       while ((this_opt = strsep(&options, ",")) != NULL) {
                if (!*this_opt) continue;
                
                if (! strcmp(this_opt, "inverse"))
index ec543f5728ce557fdcd085ea3cdef686d822c486..0902bee80076efbcc947228b7f5f0c140f0b2cfc 100644 (file)
@@ -2372,7 +2372,7 @@ int __init matroxfb_setup(char *options) {
        if (!options || !*options)
                return 0;
 
-       while (this_opt = strsep(&options, ",")) {
+       while ((this_opt = strsep(&options, ",")) != NULL) {
                if (!*this_opt) continue;
 
                dprintk("matroxfb_setup: option %s\n", this_opt);
index f8b6a9cf96febc69c92b8d789db9776e5a48c376..b558e0d42f0d5dbf7775e91c8b8ba3b416f50f08 100644 (file)
@@ -841,7 +841,7 @@ int __init platinum_setup(char *options)
        if (!options || !*options)
                return 0;
 
-       while (this_opt = strsep(&options, ",")) {
+       while ((this_opt = strsep(&options, ",")) != NULL) {
                if (!strncmp(this_opt, "font:", 5)) {
                        char *p;
                        int i;
index 27c32ae6a1c04d12f89038ab5fc39e0079fce348..30db837cb97ca4dd7ae51d2ab323d99a94eaca65 100644 (file)
@@ -642,7 +642,9 @@ int __init radeonfb_setup (char *options)
         if (!options || !*options)
                 return 0;
  
-       while (this_opt = strsep (&options, ",")) {
+       while ((this_opt = strsep (&options, ",")) != NULL) {
+               if (!*this_opt)
+                       continue;
                 if (!strncmp (this_opt, "font:", 5)) {
                         char *p;
                         int i;
index afb7db1999b431029e9f1082875b19a55950306e..335015cdce29dd611c9851a0a8e882fe1f53211e 100644 (file)
@@ -1348,7 +1348,9 @@ int __init retz3fb_setup(char *options)
        if (!options || !*options)
                return 0;
 
-       while (this_opt = strsep(&options, ",")) {
+       while ((this_opt = strsep(&options, ",")) != NULL) {
+               if (!*this_opt)
+                       continue;
                if (!strcmp(this_opt, "inverse")) {
                        z3fb_inverse = 1;
                        fb_invert_cmaps();
index f62ccf6760c04226ae1d79cd32f2981fa5555094..2213a85955821613f75b706c92f826a2ff62c1db 100644 (file)
@@ -2045,7 +2045,9 @@ int __init rivafb_setup(char *options)
        if (!options || !*options)
                return 0;
 
-       while (this_opt = strsep(&options, ",")) {
+       while ((this_opt = strsep(&options, ",")) != NULL) {
+               if (!*this_opt)
+                       continue;
                if (!strncmp(this_opt, "font:", 5)) {
                        char *p;
                        int i;
index 8699daa9fb1f310d2bd2e9e1fcc7a1c53ce31337..b80a6b520dc50afe7990d567c37d74c425ef01d3 100644 (file)
@@ -2369,7 +2369,7 @@ int __init sa1100fb_setup(char *options)
        if (!options || !*options)
                return 0;
 
-       while (this_opt = strsep(&options, ",")) {
+       while ((this_opt = strsep(&options, ",")) != NULL) {
 
                if (!strncmp(this_opt, "bpp:", 4))
                        current_par.max_bpp =
index 524c8e3d850aac558fadf13c6c82c434723694a6..2d24d9f25524077a74b36d276d552bfdb57506d5 100644 (file)
@@ -863,7 +863,7 @@ int __init sgivwfb_setup(char *options)
   if (!options || !*options)
     return 0;
 
-  while (this_opt = strsep(&options, ",")) {
+  while ((this_opt = strsep(&options, ",")) != NULL) {
     if (!strncmp(this_opt, "font:", 5))
       strcpy(fb_info.fontname, this_opt+5);
   }
index 0b717f44bc5e2d236761e165f4017ee99623feee..843b0b15c6f1b04cd163f8db31ecf688007d92a2 100644 (file)
@@ -1697,7 +1697,7 @@ int  __init sstfb_setup(char *options)
        if (!options || !*options)
                return 0;
 
-       while (this_opt = strsep(&options, ",")) {
+       while ((this_opt = strsep(&options, ",")) != NULL) {
                if (!*this_opt) continue;
 
                f_ddprintk("option %s\n", this_opt);
index 32b66b5a4bc070a8ed4673813e5fc4b138d5c2d4..11c93e7373a023e040197fb1d200f00f35cf4431 100644 (file)
@@ -2086,7 +2086,9 @@ void tdfxfb_setup(char *options,
   if(!options || !*options)
     return;
 
-  while(this_opt = strsep(&options, ",")) {
+  while((this_opt = strsep(&options, ",")) != NULL) {
+    if(!*this_opt)
+      continue;
     if(!strcmp(this_opt, "inverse")) {
       inverse = 1;
       fb_invert_cmaps();
index 35a77b8abdec9eade08980627b1c6f3170dc2160..a98c62c7e7dcbee531628c0dc144e41b5dde2296 100644 (file)
@@ -889,7 +889,7 @@ int __init tgafb_setup(char *options) {
     int i;
     
     if (options && *options) {
-       while (this_opt = strsep(&options, ",")) {
+       while ((this_opt = strsep(&options, ",")) != NULL) {
                    if (!*this_opt) { continue; }
         
            if (!strncmp(this_opt, "font:", 5)) {
index 09307d62231af09982ecde1c44526349365c81bc..1af28c8afe73d1cc5b52541150aec80aff668ad3 100644 (file)
@@ -801,7 +801,7 @@ int __init valkyriefb_setup(char *options)
        if (!options || !*options)
                return 0;
 
-       while (this_opt = strsep(&options, ",")) {
+       while ((this_opt = strsep(&options, ",")) != NULL) {
                if (!strncmp(this_opt, "font:", 5)) {
                        char *p;
                        int i;
index ff08bdc0b7bc404546546b2c29451f6ec1db3ae1..62897efab91e2ca5fcd0bc0e4367b1c5d5027317 100644 (file)
@@ -457,7 +457,7 @@ int __init vesafb_setup(char *options)
        if (!options || !*options)
                return 0;
        
-       while (this_opt = strsep(&options, ",")) {
+       while ((this_opt = strsep(&options, ",")) != NULL) {
                if (!*this_opt) continue;
                
                if (! strcmp(this_opt, "inverse"))
index 78edbfcdd51c2bca1954419c71ca5ca4400c0580..a8ef9a54a45685f56eebaa2c87740f11f9f511b8 100644 (file)
@@ -382,7 +382,7 @@ int __init vfb_setup(char *options)
     if (!options || !*options)
        return 0;
 
-    while (this_opt = strsep(&options, ",")) {
+    while ((this_opt = strsep(&options, ",")) != NULL) {
        if (!strncmp(this_opt, "font:", 5))
            strcpy(fb_info.fontname, this_opt+5);
     }
index 196c05d5e0bca24159f7709fc4ad70f3bfa2f928..3a6572c6af69c5f7d1545d5ba27ba4c9014ae524 100644 (file)
@@ -692,7 +692,7 @@ int vga16fb_setup(char *options)
        if (!options || !*options)
                return 0;
        
-       while (this_opt = strsep(&options, ",")) {
+       while ((this_opt = strsep(&options, ",")) != NULL) {
                if (!*this_opt) continue;
                
                if (!strncmp(this_opt, "font:", 5))
index a5a81486a2148f7cd5f70d9ad6ba8800bcf03957..9a0a69dd7165847397ecb1f2bc12606d09b66d06 100644 (file)
@@ -1085,7 +1085,9 @@ int __init virgefb_setup(char *options)
        if (!options || !*options)
                return 0;
 
-       while (this_opt = strsep(&options, ",")) {
+       while ((this_opt = strsep(&options, ",")) != NULL) {
+               if (!*this_opt)
+                       continue;
                if (!strcmp(this_opt, "inverse")) {
                        Cyberfb_inverse = 1;
                        fb_invert_cmaps();
@@ -1099,6 +1101,7 @@ int __init virgefb_setup(char *options)
                }
                else
                        get_video_mode(this_opt);
+       }
 
        DPRINTK("default mode: xres=%d, yres=%d, bpp=%d\n",virgefb_default.xres,
                                                            virgefb_default.yres,
index 3c6cc4cf57906b502441eccebe61d7f574208671..a2a034fc2fe2051c2330a341b94004e27e8d8b5d 100644 (file)
@@ -270,7 +270,6 @@ affs_read_super(struct super_block *sb, void *data, int silent)
        size = (BLOCK_SIZE / 512) * blocks;
        pr_debug("AFFS: initial blksize=%d, blocks=%d\n", 512, blocks);
 
-#warning
        affs_set_blocksize(sb, PAGE_SIZE);
        /* Try to find root block. Its location depends on the block size. */
 
index 50fe506d0943190ca3be2681db252bfef2ac5053..fc76385034375740020b6963a1e3be2283719843 100644 (file)
@@ -539,6 +539,15 @@ static void __remove_from_queues(struct buffer_head *bh)
        __remove_from_lru_list(bh);
 }
 
+static void remove_from_queues(struct buffer_head *bh)
+{
+       spin_lock(&lru_list_lock);
+       write_lock(&hash_table_lock);
+       __remove_from_queues(bh);
+       write_unlock(&hash_table_lock); 
+       spin_unlock(&lru_list_lock);
+}
+
 struct buffer_head * get_hash_table(kdev_t dev, int block, int size)
 {
        struct buffer_head *bh, **p = &hash(dev, block);
@@ -1352,6 +1361,7 @@ static void discard_buffer(struct buffer_head * bh)
                clear_bit(BH_Mapped, &bh->b_state);
                clear_bit(BH_Req, &bh->b_state);
                clear_bit(BH_New, &bh->b_state);
+               remove_from_queues(bh);
                unlock_buffer(bh);
        }
 }
index 706be7472de11c17851fb7ae3d0546cb9fbca362..65ee4b28dc3d1329ea6ccd1b42a7386257b6574f 100644 (file)
@@ -61,22 +61,19 @@ static int ext3_open_file (struct inode * inode, struct file * filp)
 static ssize_t
 ext3_file_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
 {
-       int ret;
        struct inode *inode = file->f_dentry->d_inode;
 
-       ret = generic_file_write(file, buf, count, ppos);
-       if ((ret >= 0) && IS_SYNC(inode)) {
-               if (file->f_flags & O_SYNC) {
-                       /*
-                        * generic_osync_inode() has already done the sync
-                        */
-               } else {
-                       int ret2 = ext3_force_commit(inode->i_sb);
-                       if (ret2)
-                               ret = ret2;
-               }
-       }
-       return ret;
+       /*
+        * Nasty: if the file is subject to synchronous writes then we need
+        * to force generic_osync_inode() to call ext3_write_inode().
+        * We do that by marking the inode dirty.  This adds much more
+        * computational expense than we need, but we're going to sync
+        * anyway.
+        */
+       if (IS_SYNC(inode) || (file->f_flags & O_SYNC))
+               mark_inode_dirty(inode);
+
+       return generic_file_write(file, buf, count, ppos);
 }
 
 struct file_operations ext3_file_operations = {
index 87a6d5e6c66859254908dce518eb0b4df7b9e1f7..d3091041325ca977c108421637ce0f30181ebd4b 100644 (file)
@@ -52,9 +52,8 @@ static int presto_dentry_revalidate(struct dentry *de, int flag)
 static void presto_d_release(struct dentry *dentry)
 {
         if (!presto_d2d(dentry)) {
-                printk("VERY BAD: dentry: %p\n", dentry);
-                if (dentry->d_inode)
-                        printk("    inode: %ld\n", dentry->d_inode->i_ino);
+                /* This should really only happen in the case of a dentry
+                 * with no inode. */
                 return;
         }
 
@@ -78,14 +77,18 @@ struct dentry_operations presto_dentry_ops =
 void presto_set_dd(struct dentry * dentry)
 {
         ENTRY;
+        if (dentry == NULL)
+                BUG();
+
         if (dentry->d_fsdata) {
                 printk("VERY BAD: dentry: %p\n", dentry);
                 if (dentry->d_inode)
                         printk("    inode: %ld\n", dentry->d_inode->i_ino);
+                EXIT;
                 return;
         }
 
-        if (! dentry->d_inode) {
+        if (dentry->d_inode == NULL) {
                 dentry->d_fsdata = kmem_cache_alloc(presto_dentry_slab,
                                                     SLAB_KERNEL);
                 memset(dentry->d_fsdata, 0, sizeof(struct presto_dentry_data));
@@ -125,7 +128,7 @@ void presto_init_ddata_cache(void)
         presto_dentry_slab =
                 kmem_cache_create("presto_cache",
                                   sizeof(struct presto_dentry_data), 0,
-                                  SLAB_HWCACHE_ALIGN|SLAB_POISON, NULL,
+                                  SLAB_HWCACHE_ALIGN, NULL,
                                   NULL);
         EXIT;
 }
index 8df4a62623bef0407e75b0a95e6a3539daf80a16..25f7f1810d01e58d31d0553feb3940d2777f7570 100644 (file)
@@ -163,13 +163,20 @@ struct dentry *presto_ilookup(struct inode *dir, struct dentry *dentry,
                 return ERR_PTR(-EPERM);
         }
         inode = iget(dir->i_sb, ino);
-        if (!inode || !inode->i_nlink || is_bad_inode(inode)) {
+        if (!inode || is_bad_inode(inode)) {
                 CDEBUG(D_PIOCTL, "fatal: invalid inode %ld (%s).\n",
                        ino, inode ? inode->i_nlink ? "bad inode" :
                        "no links" : "NULL");
                 error = -ENOENT;
                 EXIT;
                 goto cleanup_iput;
+        } else if (inode->i_nlink == 0) {
+                /* This is quite evil, but we have little choice.  If we were
+                 * to iput() again with i_nlink == 0, delete_inode would get
+                 * called again, which ext3 really Does Not Like. */
+                atomic_dec(&inode->i_count);
+                EXIT;
+                return ERR_PTR(-ENOENT);
         }
 
         /* We need to make sure we have the right inode (by checking the
@@ -185,6 +192,8 @@ struct dentry *presto_ilookup(struct inode *dir, struct dentry *dentry,
         }
 
         d_instantiate(dentry, inode);
+        dentry->d_flags |= DCACHE_NFSD_DISCONNECTED; /* NFS hack */
+
         EXIT;
         return NULL;
 
index 7ccdb51f720326dd1c304508d08297d35b7d79b2..530393b005f984d0e92a7622bbfab9dfafeb4e7f 100644 (file)
@@ -106,7 +106,8 @@ static int presto_do_truncate(struct presto_file_set *fset,
         lock_kernel();
         
         if (size_check != inode->i_size) { 
-                fs_up(&inode->i_sem); 
+                unlock_kernel();
+                fs_up(&inode->i_sem);
                 EXIT;
                 return -EALREADY; 
         }
index 822a6de2db6717094e4762a0bf9f983a022f6f4d..f6eacd0dc5b923b94d3385feea01acd714527b4b 100644 (file)
@@ -24,7 +24,7 @@
 #include <linux/intermezzo_kml.h>
 #include <linux/intermezzo_journal.h>
 
-#if defined(CONFIG_XFS_FS)
+#if 0
 
 /* XFS has journalling, but these functions do nothing yet... */
 
index 2620f8a09e4ae4cc9333ebc77993dad4e5acede7..09496b3caef7d02074c6ff5f30b7208cc7e5a01f 100644 (file)
@@ -163,7 +163,8 @@ void filter_setup_journal_ops(struct filter_fs *ops, char *cache_type)
 
         if ( strlen(cache_type) == strlen("xfs") &&
              memcmp(cache_type, "xfs", strlen("xfs")) == 0 ) {
-#if defined(CONFIG_XFS_FS) || defined (CONFIG_XFS_FS_MODULE)
+#if 0
+                //#if defined(CONFIG_XFS_FS) || defined (CONFIG_XFS_FS_MODULE)
                 ops->o_trops = &presto_xfs_journal_ops;
 #else
                 ops->o_trops = NULL;
index 699f07e10f6f6dca1779bcda6bd57a749bd9393f..3d51c30f290941e1d63d603673ee2ddf3e56997b 100644 (file)
@@ -1035,6 +1035,7 @@ int presto_clear_all_fsetroots(char *path)
                 goto put_out;
         }
 
+       error = 0;
         cache = fset->fset_cache;
         cache->cache_flags &= ~CACHE_FSETROOT_SET;
 
index 1f9eea0793faa7994469772e92ffe9ad5174ec75..8d37756a7f13eff3377a87aa5f8e4ee137b08ad1 100644 (file)
@@ -162,6 +162,9 @@ static inline int presto_do_expect(struct lento_vfs_context *info, struct inode
         return 1;
 }
 
+
+/* XXX fixme: this should not fail, all these dentries are in memory
+   when _we_ call this */
 int presto_settime(struct presto_file_set *fset, 
                    struct dentry *dentry, 
                    struct lento_vfs_context *ctx, 
@@ -194,8 +197,7 @@ int presto_settime(struct presto_file_set *fset,
 
         error = -EPERM;
         iops = filter_c2cdiops(fset->fset_cache->cache_filter); 
-        if (!iops &&
-            !iops->setattr) {
+        if (!iops) { 
                 EXIT;
                 return error;
         }
@@ -203,7 +205,7 @@ int presto_settime(struct presto_file_set *fset,
         if (iops->setattr != NULL)
                 error = iops->setattr(dentry, &iattr);
         else {
-               error = 0; // we suppose no error, Arthur
+               error = 0;
                 inode_setattr(dentry->d_inode, &iattr);
        }
         EXIT;
@@ -391,64 +393,6 @@ exit:
         return error;
 }
 
-int presto_do_statfs (struct presto_file_set *fset, 
-                      struct statfs * buf)
-{
-        struct super_operations *sops;
-        struct super_block *sb;
-        int result;
-        ENTRY;
-
-        if ( !fset ) {
-                EXIT;
-                return -EINVAL;
-        }
-        if ( !fset->fset_cache ) {
-                EXIT;
-                return -EINVAL;
-        }
-        if ( !fset->fset_cache->cache_filter ) {
-                EXIT;
-                return -EINVAL;
-        }
-
-        sops = filter_c2csops(fset->fset_cache->cache_filter);
-        if ( ! sops ) {
-                EXIT;
-                return -EINVAL;
-        }
-        if ( ! fset->fset_cache->cache_mtde ) {
-                EXIT;
-                return -EINVAL;
-        }
-
-        if ( ! fset->fset_cache->cache_mtde->d_inode ) {
-                EXIT;
-                return -EINVAL;
-        }
-
-        if ( ! fset->fset_cache->cache_mtde->d_inode->i_sb ) {
-                EXIT;
-                return -EINVAL;
-        }
-        sb = fset->fset_cache->cache_mtde->d_inode->i_sb;
-
-        if (sops->statfs) {
-                mm_segment_t old_fs = get_fs();
-                memset(buf, 0, sizeof(struct statfs));
-                set_fs(get_ds());
-                lock_kernel();
-                result = sops->statfs(sb, buf);
-                unlock_kernel();
-                set_fs(old_fs);
-        } else {
-                result = -EINVAL;
-        }
-
-        EXIT;
-        return result;
-}
-
 int presto_do_create(struct presto_file_set *fset, struct dentry *dir,
                      struct dentry *dentry, int mode,
                      struct lento_vfs_context *info)
@@ -1333,14 +1277,14 @@ int presto_do_rmdir(struct presto_file_set *fset, struct dentry *dir,
         dput(dentry);
 
         presto_debug_fail_blkdev(fset, PRESTO_OP_RMDIR | 0x10);
-        if ( do_kml )
+        if ( !error && do_kml )
                 error = presto_journal_rmdir(&rec, fset, dir, &tgt_dir_ver,
                                              &old_dir_ver,
                                              dentry->d_name.len,
                                              dentry->d_name.name);
 
         presto_debug_fail_blkdev(fset, PRESTO_OP_RMDIR | 0x20);
-        if ( do_expect ) 
+        if ( !error && do_expect ) 
                 error = presto_write_last_rcvd(&rec, fset, info);
 
         presto_debug_fail_blkdev(fset, PRESTO_OP_RMDIR | 0x30);
index 2c0e1999f5a6002ac0b0ae30079cd07c6fad9a7f..27e90b8b366e118347336b60288f4b61980314fe 100644 (file)
@@ -31,7 +31,7 @@
  * provisions above, a recipient may use your version of this file
  * under either the RHEPL or the GPL.
  *
- * $Id: nodelist.c,v 1.29 2001/09/19 00:06:35 dwmw2 Exp $
+ * $Id: nodelist.c,v 1.30 2001/11/14 10:35:21 dwmw2 Exp $
  *
  */
 
 #include <linux/mtd/mtd.h>
 #include "nodelist.h"
 
-#if 0
-/**
- *     jffs2_add_raw_node_ref - Add a jffs2_raw_node_ref to the cached
- *                             node list for the filesystem
- *     @sb: Pointer to filesystem information structure
- *     @ref: New node to add
- *
- *     Adds a new node reference to the filesystem\'s node cache, which
- *     is the only permanent storage required for the filesystem.
- */
-void jffs2_add_raw_node_ref(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *ref)
-{
-       /* Sort the list, hash it or do _something_ useful with it */
-       spin_lock(&c->nodelist_lock);
-       ref->next = c->nodelist;
-       c->nodelist = ref;
-       spin_unlock(&c->nodelist_lock);
-       return 0;
-}
-#endif
 void jffs2_add_fd_to_list(struct jffs2_sb_info *c, struct jffs2_full_dirent *new, struct jffs2_full_dirent **list)
 {
        struct jffs2_full_dirent **prev = list;
@@ -92,7 +72,7 @@ void jffs2_add_fd_to_list(struct jffs2_sb_info *c, struct jffs2_full_dirent *new
        D1(while(*list) {
                printk(KERN_DEBUG "Dirent \"%s\" (hash 0x%08x, ino #%u\n", (*list)->name, (*list)->nhash, (*list)->ino);
                list = &(*list)->next;
-       })
+       });
 }
 
 /* Put a new tmp_dnode_info into the list, keeping the list in 
index ee4167bb67c5186cf123ee3c3e619436b2b0cd45..a270f2dd518f5951318c68c233febfc8178f9651 100644 (file)
@@ -76,7 +76,7 @@ extern struct tss_struct init_tss[NR_CPUS];
 extern struct cpuinfo_x86 cpu_data[];
 #define current_cpu_data cpu_data[smp_processor_id()]
 #else
-#define cpu_data &boot_cpu_data
+#define cpu_data (&boot_cpu_data)
 #define current_cpu_data boot_cpu_data
 #endif
 
index 2b4f7afa9bd98d712ffd052a6be1b5bff6d89509..8ab328670e7a431199e2c28777f2eab4109edaa1 100644 (file)
@@ -7,8 +7,14 @@
  */
 
 struct scatterlist {
-       char *address;          /* location data is to be transferred to */
-       void *page;             /* stupid: SCSI code insists on a member of this name... */
+       /* This will disappear in 2.5.x: */
+       char *address;          /* location data is to be transferred to, NULL for highmem page */
+       char *orig_address;     /* for use by swiotlb */
+
+       /* These two are only valid if ADDRESS member of this struct is NULL.  */
+       struct page *page;
+       unsigned int offset;
+
        unsigned int length;    /* buffer length */
 };
 
index 7c9bfa8e99523338ebd1f18d4f5b3bc649b5c3df..3d74130c7d236a7c5cf065cd438c236951f2905d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: io.h,v 1.28 2000/09/17 05:12:00 davem Exp $
+ * $Id: io.h,v 1.29 2001/11/10 09:28:34 davem Exp $
  */
 #ifndef __SPARC_IO_H
 #define __SPARC_IO_H
 #define virt_to_bus virt_to_phys
 #define bus_to_virt phys_to_virt
 
-extern __inline__ unsigned  flip_dword (unsigned d) {
+static __inline__ u32 flip_dword (u32 d)
+{
        return ((d&0xff)<<24) | (((d>>8)&0xff)<<16) | (((d>>16)&0xff)<<8)| ((d>>24)&0xff);
 }
 
-extern __inline__ unsigned short flip_word (unsigned short d) {
+static __inline__ u16 flip_word (u16 d)
+{
        return ((d&0xff) << 8) | ((d>>8)&0xff);
 }
 
 /*
  * Memory mapped I/O to PCI
  */
-extern __inline__ unsigned long readb(unsigned long addr) {
-       return *(volatile unsigned char*)addr;
+static __inline__ u8 readb(unsigned long addr)
+{
+       return *(volatile u8 *)addr;
 }
 
-extern __inline__ unsigned long readw(unsigned long addr) {
-       return flip_word(*(volatile unsigned short*)addr);
+static __inline__ u16 readw(unsigned long addr)
+{
+       return flip_word(*(volatile u16 *)addr);
 }
 
-extern __inline__ unsigned long readl(unsigned long addr) {
-       return flip_dword(*(volatile unsigned long*)addr);
+static __inline__ u32 readl(unsigned long addr)
+{
+       return flip_dword(*(volatile u32 *)addr);
 }
 
-extern __inline__ void writeb(unsigned char b, unsigned long addr) {
-       *(volatile unsigned char*)addr = b;
+static __inline__ void writeb(u8 b, unsigned long addr)
+{
+       *(volatile u8 *)addr = b;
 }
 
-extern __inline__ void writew(unsigned short b, unsigned long addr) {
-       *(volatile unsigned short*)addr = flip_word(b);
+static __inline__ void writew(u16 b, unsigned long addr)
+{
+       *(volatile u16 *)addr = flip_word(b);
 }
 
-extern __inline__ void writel(unsigned int b, unsigned long addr) {
-       *(volatile unsigned long*)addr = flip_dword(b);
+static __inline__ void writel(u32 b, unsigned long addr)
+{
+       *(volatile u32 *)addr = flip_dword(b);
 }
 
 /* Now the 'raw' versions. */
-extern __inline__ unsigned long __raw_readb(unsigned long addr) {
-       return *(volatile unsigned char*)addr;
+static __inline__ u8 __raw_readb(unsigned long addr)
+{
+       return *(volatile u8 *)addr;
 }
 
-extern __inline__ unsigned long __raw_readw(unsigned long addr) {
-       return *(volatile unsigned short*)addr;
+static __inline__ u16 __raw_readw(unsigned long addr)
+{
+       return *(volatile u16 *)addr;
 }
 
-extern __inline__ unsigned long __raw_readl(unsigned long addr) {
-       return *(volatile unsigned long*)addr;
+static __inline__ u32 __raw_readl(unsigned long addr)
+{
+       return *(volatile u32 *)addr;
 }
 
-extern __inline__ void __raw_writeb(unsigned char b, unsigned long addr) {
-       *(volatile unsigned char*)addr = b;
+static __inline__ void __raw_writeb(u8 b, unsigned long addr)
+{
+       *(volatile u8 *)addr = b;
 }
 
-extern __inline__ void __raw_writew(unsigned short b, unsigned long addr) {
-       *(volatile unsigned short*)addr = b;
+static __inline__ void __raw_writew(u16 b, unsigned long addr)
+{
+       *(volatile u16 *)addr = b;
 }
 
-extern __inline__ void __raw_writel(unsigned int b, unsigned long addr) {
-       *(volatile unsigned long*)addr = b;
+static __inline__ void __raw_writel(u32 b, unsigned long addr)
+{
+       *(volatile u32 *)addr = b;
 }
 
 /*
@@ -118,37 +132,43 @@ extern void insl(unsigned long addr, void *dst, unsigned long count);
  * SBus has only one, memory mapped, I/O space.
  * We do not need to flip bytes for SBus of course.
  */
-extern __inline__ unsigned int _sbus_readb(unsigned long addr) {
-       return *(volatile unsigned char*)addr;
+static __inline__ u8 _sbus_readb(unsigned long addr)
+{
+       return *(volatile u8 *)addr;
 }
 
-extern __inline__ unsigned int _sbus_readw(unsigned long addr) {
-       return *(volatile unsigned short*)addr;
+static __inline__ u16 _sbus_readw(unsigned long addr)
+{
+       return *(volatile u16 *)addr;
 }
 
-extern __inline__ unsigned int _sbus_readl(unsigned long addr) {
-       return *(volatile unsigned long*)addr;
+static __inline__ u32 _sbus_readl(unsigned long addr)
+{
+       return *(volatile u32 *)addr;
 }
 
-extern __inline__ void _sbus_writeb(unsigned char b, unsigned long addr) {
-       *(volatile unsigned char*)addr = b;
+static __inline__ void _sbus_writeb(u8 b, unsigned long addr)
+{
+       *(volatile u8 *)addr = b;
 }
 
-extern __inline__ void _sbus_writew(unsigned short b, unsigned long addr) {
-       *(volatile unsigned short*)addr = b;
+static __inline__ void _sbus_writew(u16 b, unsigned long addr)
+{
+       *(volatile u16 *)addr = b;
 }
 
-extern __inline__ void _sbus_writel(unsigned int b, unsigned long addr) {
-       *(volatile unsigned long*)addr = b;
+static __inline__ void _sbus_writel(u32 b, unsigned long addr)
+{
+       *(volatile u32 *)addr = b;
 }
 
 /*
  * The only reason for #define's is to hide casts to unsigned long.
  * XXX Rewrite drivers without structures for registers.
  */
-#define sbus_readb(a)  _sbus_readb((unsigned long)(a))
-#define sbus_readw(a)  _sbus_readw((unsigned long)(a))
-#define sbus_readl(a)  _sbus_readl((unsigned long)(a))
+#define sbus_readb(a)          _sbus_readb((unsigned long)(a))
+#define sbus_readw(a)          _sbus_readw((unsigned long)(a))
+#define sbus_readl(a)          _sbus_readl((unsigned long)(a))
 #define sbus_writeb(v, a)      _sbus_writeb(v, (unsigned long)(a))
 #define sbus_writew(v, a)      _sbus_writew(v, (unsigned long)(a))
 #define sbus_writel(v, a)      _sbus_writel(v, (unsigned long)(a))
index 2f9feef2841141eba49ab5cadcc89bfbf86ec713..0bc0b4019c9544f59f7786c90302673c94adf9bc 100644 (file)
@@ -12,6 +12,8 @@
 #define PCIBIOS_MIN_IO         0UL
 #define PCIBIOS_MIN_MEM                0UL
 
+#define PCI_IRQ_NONE           0xffffffff
+
 extern inline void pcibios_set_master(struct pci_dev *dev)
 {
        /* No special bus mastering setup handling */
index a2a3777f1fb476be0590e67e8539263caa71ef7e..c7b3b20ed22b9281f3a9532c1c94dc72d4d597dd 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: pgtable.h,v 1.107 2001/08/06 13:16:37 davem Exp $ */
+/* $Id: pgtable.h,v 1.109 2001/11/13 00:49:32 davem Exp $ */
 #ifndef _SPARC_PGTABLE_H
 #define _SPARC_PGTABLE_H
 
@@ -358,7 +358,8 @@ BTFIXUPDEF_CALL(void, set_pte, pte_t *, pte_t)
 
 #define set_pte(ptep,pteval) BTFIXUP_CALL(set_pte)(ptep,pteval)
 
-BTFIXUPDEF_CALL(int, mmu_info, char *)
+struct seq_file;
+BTFIXUPDEF_CALL(void, mmu_info, struct seq_file *)
 
 #define mmu_info(p) BTFIXUP_CALL(mmu_info)(p)
 
index 31507b7bc624c7aa52de0014337a1818f5c4ffcb..dbdab2c1ebb6898c8749659ea53ee184e78a9f9d 100644 (file)
@@ -67,8 +67,9 @@ void smp_callin(void);
 void smp_boot_cpus(void);
 void smp_store_cpu_info(int);
 
-int smp_bogo_info(char *buf);
-int smp_info(char *buf);
+struct seq_file;
+void smp_bogo_info(struct seq_file *);
+void smp_info(struct seq_file *);
 
 BTFIXUPDEF_CALL(void, smp_cross_call, smpfunc_t, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long)
 BTFIXUPDEF_CALL(void, smp_message_pass, int, int, unsigned long, int)
index 9e80435f8f998e6350e37a541cc3c59ad2483902..ac2ae3a46681e1d6d53314d0ef24ca80e6ac46f7 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: io.h,v 1.36 2000/09/17 05:12:00 davem Exp $ */
+/* $Id: io.h,v 1.40 2001/11/10 09:24:56 davem Exp $ */
 #ifndef __SPARC64_IO_H
 #define __SPARC64_IO_H
 
@@ -26,9 +26,9 @@ extern unsigned long pci_memspace_mask;
 
 #define bus_dvma_to_mem(__vaddr) ((__vaddr) & pci_memspace_mask)
 
-extern __inline__ unsigned int inb(unsigned long addr)
+static __inline__ u8 inb(unsigned long addr)
 {
-       unsigned int ret;
+       u8 ret;
 
        __asm__ __volatile__("lduba\t[%1] %2, %0\t/* pci_inb */"
                             : "=r" (ret)
@@ -37,9 +37,9 @@ extern __inline__ unsigned int inb(unsigned long addr)
        return ret;
 }
 
-extern __inline__ unsigned int inw(unsigned long addr)
+static __inline__ u16 inw(unsigned long addr)
 {
-       unsigned int ret;
+       u16 ret;
 
        __asm__ __volatile__("lduha\t[%1] %2, %0\t/* pci_inw */"
                             : "=r" (ret)
@@ -48,9 +48,9 @@ extern __inline__ unsigned int inw(unsigned long addr)
        return ret;
 }
 
-extern __inline__ unsigned int inl(unsigned long addr)
+static __inline__ u32 inl(unsigned long addr)
 {
-       unsigned int ret;
+       u32 ret;
 
        __asm__ __volatile__("lduwa\t[%1] %2, %0\t/* pci_inl */"
                             : "=r" (ret)
@@ -59,21 +59,21 @@ extern __inline__ unsigned int inl(unsigned long addr)
        return ret;
 }
 
-extern __inline__ void outb(unsigned char b, unsigned long addr)
+static __inline__ void outb(u8 b, unsigned long addr)
 {
        __asm__ __volatile__("stba\t%r0, [%1] %2\t/* pci_outb */"
                             : /* no outputs */
                             : "Jr" (b), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E_L));
 }
 
-extern __inline__ void outw(unsigned short w, unsigned long addr)
+static __inline__ void outw(u16 w, unsigned long addr)
 {
        __asm__ __volatile__("stha\t%r0, [%1] %2\t/* pci_outw */"
                             : /* no outputs */
                             : "Jr" (w), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E_L));
 }
 
-extern __inline__ void outl(unsigned int l, unsigned long addr)
+static __inline__ void outl(u32 l, unsigned long addr)
 {
        __asm__ __volatile__("stwa\t%r0, [%1] %2\t/* pci_outl */"
                             : /* no outputs */
@@ -95,9 +95,9 @@ extern void insw(unsigned long addr, void *dst, unsigned long count);
 extern void insl(unsigned long addr, void *dst, unsigned long count);
 
 /* Memory functions, same as I/O accesses on Ultra. */
-extern __inline__ unsigned int _readb(unsigned long addr)
+static __inline__ u8 _readb(unsigned long addr)
 {
-       unsigned int ret;
+       u8 ret;
 
        __asm__ __volatile__("lduba\t[%1] %2, %0\t/* pci_readb */"
                             : "=r" (ret)
@@ -106,9 +106,9 @@ extern __inline__ unsigned int _readb(unsigned long addr)
        return ret;
 }
 
-extern __inline__ unsigned int _readw(unsigned long addr)
+static __inline__ u16 _readw(unsigned long addr)
 {
-       unsigned int ret;
+       u16 ret;
 
        __asm__ __volatile__("lduha\t[%1] %2, %0\t/* pci_readw */"
                             : "=r" (ret)
@@ -117,9 +117,9 @@ extern __inline__ unsigned int _readw(unsigned long addr)
        return ret;
 }
 
-extern __inline__ unsigned int _readl(unsigned long addr)
+static __inline__ u32 _readl(unsigned long addr)
 {
-       unsigned int ret;
+       u32 ret;
 
        __asm__ __volatile__("lduwa\t[%1] %2, %0\t/* pci_readl */"
                             : "=r" (ret)
@@ -128,38 +128,58 @@ extern __inline__ unsigned int _readl(unsigned long addr)
        return ret;
 }
 
-extern __inline__ void _writeb(unsigned char b, unsigned long addr)
+static __inline__ u64 _readq(unsigned long addr)
+{
+       u64 ret;
+
+       __asm__ __volatile__("ldxa\t[%1] %2, %0\t/* pci_readq */"
+                            : "=r" (ret)
+                            : "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E_L));
+
+       return ret;
+}
+
+static __inline__ void _writeb(u8 b, unsigned long addr)
 {
        __asm__ __volatile__("stba\t%r0, [%1] %2\t/* pci_writeb */"
                             : /* no outputs */
                             : "Jr" (b), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E_L));
 }
 
-extern __inline__ void _writew(unsigned short w, unsigned long addr)
+static __inline__ void _writew(u16 w, unsigned long addr)
 {
        __asm__ __volatile__("stha\t%r0, [%1] %2\t/* pci_writew */"
                             : /* no outputs */
                             : "Jr" (w), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E_L));
 }
 
-extern __inline__ void _writel(unsigned int l, unsigned long addr)
+static __inline__ void _writel(u32 l, unsigned long addr)
 {
        __asm__ __volatile__("stwa\t%r0, [%1] %2\t/* pci_writel */"
                             : /* no outputs */
                             : "Jr" (l), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E_L));
 }
 
+static __inline__ void _writeq(u64 q, unsigned long addr)
+{
+       __asm__ __volatile__("stxa\t%r0, [%1] %2\t/* pci_writeq */"
+                            : /* no outputs */
+                            : "Jr" (q), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E_L));
+}
+
 #define readb(__addr)          (_readb((unsigned long)(__addr)))
 #define readw(__addr)          (_readw((unsigned long)(__addr)))
 #define readl(__addr)          (_readl((unsigned long)(__addr)))
-#define writeb(__b, __addr)    (_writeb((__b), (unsigned long)(__addr)))
-#define writew(__w, __addr)    (_writew((__w), (unsigned long)(__addr)))
-#define writel(__l, __addr)    (_writel((__l), (unsigned long)(__addr)))
+#define readq(__addr)          (_readq((unsigned long)(__addr)))
+#define writeb(__b, __addr)    (_writeb((u8)(__b), (unsigned long)(__addr)))
+#define writew(__w, __addr)    (_writew((u16)(__w), (unsigned long)(__addr)))
+#define writel(__l, __addr)    (_writel((u32)(__l), (unsigned long)(__addr)))
+#define writeq(__q, __addr)    (_writeq((u64)(__q), (unsigned long)(__addr)))
 
 /* Now versions without byte-swapping. */
-extern __inline__ unsigned int _raw_readb(unsigned long addr)
+static __inline__ u8 _raw_readb(unsigned long addr)
 {
-       unsigned int ret;
+       u8 ret;
 
        __asm__ __volatile__("lduba\t[%1] %2, %0\t/* pci_raw_readb */"
                             : "=r" (ret)
@@ -168,9 +188,9 @@ extern __inline__ unsigned int _raw_readb(unsigned long addr)
        return ret;
 }
 
-extern __inline__ unsigned int _raw_readw(unsigned long addr)
+static __inline__ u16 _raw_readw(unsigned long addr)
 {
-       unsigned int ret;
+       u16 ret;
 
        __asm__ __volatile__("lduha\t[%1] %2, %0\t/* pci_raw_readw */"
                             : "=r" (ret)
@@ -179,9 +199,9 @@ extern __inline__ unsigned int _raw_readw(unsigned long addr)
        return ret;
 }
 
-extern __inline__ unsigned int _raw_readl(unsigned long addr)
+static __inline__ u32 _raw_readl(unsigned long addr)
 {
-       unsigned int ret;
+       u32 ret;
 
        __asm__ __volatile__("lduwa\t[%1] %2, %0\t/* pci_raw_readl */"
                             : "=r" (ret)
@@ -190,33 +210,52 @@ extern __inline__ unsigned int _raw_readl(unsigned long addr)
        return ret;
 }
 
-extern __inline__ void _raw_writeb(unsigned char b, unsigned long addr)
+static __inline__ u64 _raw_readq(unsigned long addr)
+{
+       u64 ret;
+
+       __asm__ __volatile__("ldxa\t[%1] %2, %0\t/* pci_raw_readq */"
+                            : "=r" (ret)
+                            : "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E));
+
+       return ret;
+}
+
+static __inline__ void _raw_writeb(u8 b, unsigned long addr)
 {
        __asm__ __volatile__("stba\t%r0, [%1] %2\t/* pci_raw_writeb */"
                             : /* no outputs */
                             : "Jr" (b), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E));
 }
 
-extern __inline__ void _raw_writew(unsigned short w, unsigned long addr)
+static __inline__ void _raw_writew(u16 w, unsigned long addr)
 {
        __asm__ __volatile__("stha\t%r0, [%1] %2\t/* pci_raw_writew */"
                             : /* no outputs */
                             : "Jr" (w), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E));
 }
 
-extern __inline__ void _raw_writel(unsigned int l, unsigned long addr)
+static __inline__ void _raw_writel(u32 l, unsigned long addr)
 {
        __asm__ __volatile__("stwa\t%r0, [%1] %2\t/* pci_raw_writel */"
                             : /* no outputs */
                             : "Jr" (l), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E));
 }
 
+static __inline__ void _raw_writeq(u64 q, unsigned long addr)
+{
+       __asm__ __volatile__("stxa\t%r0, [%1] %2\t/* pci_raw_writeq */"
+                            : /* no outputs */
+                            : "Jr" (q), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E));
+}
+
 #define __raw_readb(__addr)            (_raw_readb((unsigned long)(__addr)))
 #define __raw_readw(__addr)            (_raw_readw((unsigned long)(__addr)))
 #define __raw_readl(__addr)            (_raw_readl((unsigned long)(__addr)))
-#define __raw_writeb(__b, __addr)      (_raw_writeb((__b), (unsigned long)(__addr)))
-#define __raw_writew(__w, __addr)      (_raw_writew((__w), (unsigned long)(__addr)))
-#define __raw_writel(__l, __addr)      (_raw_writel((__l), (unsigned long)(__addr)))
+#define __raw_writeb(__b, __addr)      (_raw_writeb((u8)(__b), (unsigned long)(__addr)))
+#define __raw_writew(__w, __addr)      (_raw_writew((u16)(__w), (unsigned long)(__addr)))
+#define __raw_writel(__l, __addr)      (_raw_writel((u32)(__l), (unsigned long)(__addr)))
+#define __raw_writeq(__q, __addr)      (_raw_writeq((u64)(__q), (unsigned long)(__addr)))
 
 /* Valid I/O Space regions are anywhere, because each PCI bus supported
  * can live in an arbitrary area of the physical address range.
@@ -226,9 +265,9 @@ extern __inline__ void _raw_writel(unsigned int l, unsigned long addr)
 /* Now, SBUS variants, only difference from PCI is that we do
  * not use little-endian ASIs.
  */
-extern __inline__ unsigned int _sbus_readb(unsigned long addr)
+static __inline__ u8 _sbus_readb(unsigned long addr)
 {
-       unsigned int ret;
+       u8 ret;
 
        __asm__ __volatile__("lduba\t[%1] %2, %0\t/* sbus_readb */"
                             : "=r" (ret)
@@ -237,9 +276,9 @@ extern __inline__ unsigned int _sbus_readb(unsigned long addr)
        return ret;
 }
 
-extern __inline__ unsigned int _sbus_readw(unsigned long addr)
+static __inline__ u16 _sbus_readw(unsigned long addr)
 {
-       unsigned int ret;
+       u16 ret;
 
        __asm__ __volatile__("lduha\t[%1] %2, %0\t/* sbus_readw */"
                             : "=r" (ret)
@@ -248,9 +287,9 @@ extern __inline__ unsigned int _sbus_readw(unsigned long addr)
        return ret;
 }
 
-extern __inline__ unsigned int _sbus_readl(unsigned long addr)
+static __inline__ u32 _sbus_readl(unsigned long addr)
 {
-       unsigned int ret;
+       u32 ret;
 
        __asm__ __volatile__("lduwa\t[%1] %2, %0\t/* sbus_readl */"
                             : "=r" (ret)
@@ -259,21 +298,21 @@ extern __inline__ unsigned int _sbus_readl(unsigned long addr)
        return ret;
 }
 
-extern __inline__ void _sbus_writeb(unsigned char b, unsigned long addr)
+static __inline__ void _sbus_writeb(u8 b, unsigned long addr)
 {
        __asm__ __volatile__("stba\t%r0, [%1] %2\t/* sbus_writeb */"
                             : /* no outputs */
                             : "Jr" (b), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E));
 }
 
-extern __inline__ void _sbus_writew(unsigned short w, unsigned long addr)
+static __inline__ void _sbus_writew(u16 w, unsigned long addr)
 {
        __asm__ __volatile__("stha\t%r0, [%1] %2\t/* sbus_writew */"
                             : /* no outputs */
                             : "Jr" (w), "r" (addr), "i" (ASI_PHYS_BYPASS_EC_E));
 }
 
-extern __inline__ void _sbus_writel(unsigned int l, unsigned long addr)
+static __inline__ void _sbus_writel(u32 l, unsigned long addr)
 {
        __asm__ __volatile__("stwa\t%r0, [%1] %2\t/* sbus_writel */"
                             : /* no outputs */
index 48c6a9002ddb80a0b6347a611b683d197ee95f62..b00cae885ff40f2d93d786aa74ff37cbba74dcd5 100644 (file)
@@ -15,6 +15,8 @@
 #define PCIBIOS_MIN_IO         0UL
 #define PCIBIOS_MIN_MEM                0UL
 
+#define PCI_IRQ_NONE           0xffffffff
+
 extern inline void pcibios_set_master(struct pci_dev *dev)
 {
        /* No special bus mastering setup handling */
index 22aec51acd2237d23dd703a4707fea9581710816..4fb5bd035b8c925bdc5f20c53058a41543c2afd0 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: pgtable.h,v 1.151 2001/10/25 18:48:03 davem Exp $
+/* $Id: pgtable.h,v 1.152 2001/11/12 09:43:39 davem Exp $
  * pgtable.h: SpitFire page table operations.
  *
  * Copyright 1996,1997 David S. Miller (davem@caip.rutgers.edu)
index 0120602438744afda927ed168fde506dfe15137b..240dd8f24fe678b26d4930a7a3ed4cc10ff790a1 100644 (file)
@@ -362,8 +362,6 @@ int presto_do_mknod(struct presto_file_set *fset, struct dentry *dir,
 int presto_do_rename(struct presto_file_set *fset, struct dentry *old_dir,
                      struct dentry *old_dentry, struct dentry *new_dir,
                      struct dentry *new_dentry, struct lento_vfs_context *info);
-int presto_do_statfs (struct presto_file_set *fset, 
-                      struct statfs * buf);
 
 int lento_setattr(const char *name, struct iattr *iattr,
                   struct lento_vfs_context *info);
index e554242553a6f448f39e48f6a0a606e5816ca813..f3a8370db10acb4410cd30413d0220e2c02ac368 100644 (file)
@@ -317,7 +317,7 @@ static const char __module_using_checksums[] __attribute__((section(".modinfo"))
  * const, other exit data may be writable.
  */
 #define MODULE_GENERIC_TABLE(gtype,name) \
-static struct gtype##_id * __module_##gtype##_table \
+static const struct gtype##_id * __module_##gtype##_table \
   __attribute__ ((unused, __section__(".data.exit"))) = name
 
 #ifndef __GENKSYMS__
index 8c6a3dd48b7f78f18f908abf04ddc5db967aacc6..7ea6e7334bc5d69fe6c61d1b365707713fcff7ad 100644 (file)
@@ -170,8 +170,6 @@ do {                                                \
                BUG();                          \
        if (PageActive(page))                   \
                BUG();                          \
-       if (page_count(page) == 0)              \
-               BUG();                          \
 } while (0)
 
 #define add_page_to_active_list(page)          \
@@ -202,20 +200,6 @@ do {                                               \
        nr_inactive_pages--;                    \
 } while (0)
 
-/*
- * Ugly ugly ugly HACK to make sure the inactive lists
- * don't fill up with unfreeable ramdisk pages. We really
- * want to fix the ramdisk driver to mark its pages as
- * unfreeable instead of using dirty buffer magic, but the
- * next code-change time is when 2.5 is forked...
- */
-#ifndef _LINUX_KDEV_T_H
-#include <linux/kdev_t.h>
-#endif
-#ifndef _LINUX_MAJOR_H
-#include <linux/major.h>
-#endif
-
 extern spinlock_t swaplock;
 
 #define swap_list_lock()       spin_lock(&swaplock)
index 73963605d53934492d8e6177167410490fcd09d1..1e2665a20f52907faeb11f89a76bcdd847b2b3dd 100644 (file)
@@ -2916,8 +2916,10 @@ unlock:
 
        /* For now, when the user asks for O_SYNC, we'll actually
         * provide O_DSYNC. */
-       if ((status >= 0) && (file->f_flags & O_SYNC))
-               status = generic_osync_inode(inode, OSYNC_METADATA|OSYNC_DATA);
+       if (status >= 0) {
+               if ((file->f_flags & O_SYNC) || IS_SYNC(inode))
+                       status = generic_osync_inode(inode, OSYNC_METADATA|OSYNC_DATA);
+       }
        
        err = written ? written : status;
 out:
index 1ece6dc254d371f273db6fbcb623279d95ae42f2..cd99761be47571c1c64bd5f4b995b5d537be1e3f 100644 (file)
@@ -520,7 +520,7 @@ int map_user_kiobuf(int rw, struct kiobuf *iobuf, unsigned long va, size_t len)
                map = get_page_map(map);
                if (map) {
                        flush_dcache_page(map);
-                       atomic_inc(&map->count);
+                       page_cache_get(map);
                } else
                        printk (KERN_INFO "Mapped page missing [%d]\n", i);
                spin_unlock(&mm->page_table_lock);
@@ -588,7 +588,7 @@ void unmap_kiobuf (struct kiobuf *iobuf)
                if (map) {
                        if (iobuf->locked)
                                UnlockPage(map);
-                       __free_page(map);
+                       page_cache_release(map);
                }
        }
        
index 4bc3ec770ee852b2d8832bd337c0a615b4ae2c75..63e6838976c7daa820f1917b2526130e6fa4a7f7 100644 (file)
@@ -433,6 +433,8 @@ static int shmem_writepage(struct page * page)
        index = page->index;
        inode = mapping->host;
        info = SHMEM_I(inode);
+       if (info->locked)
+               return fail_writepage(page);
 getswap:
        swap = get_swap_page();
        if (!swap.val)
@@ -579,8 +581,6 @@ repeat:
 
        /* We have the page */
        SetPageUptodate(page);
-       if (info->locked)
-               page_cache_get(page);
        return page;
 no_space:
        spin_unlock (&sbinfo->stat_lock);
@@ -639,26 +639,9 @@ void shmem_lock(struct file * file, int lock)
 {
        struct inode * inode = file->f_dentry->d_inode;
        struct shmem_inode_info * info = SHMEM_I(inode);
-       struct page * page;
-       unsigned long idx, size;
 
        down(&info->sem);
-       if (info->locked == lock) 
-               goto out;
        info->locked = lock;
-       size = (inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
-       for (idx = 0; idx < size; idx++) {
-               page = find_lock_page(inode->i_mapping, idx);
-               if (!page)
-                       continue;
-               if (!lock) {
-                       /* release the extra count and our reference */
-                       page_cache_release(page);
-                       page_cache_release(page);
-               }
-               UnlockPage(page);
-       }
-out:
        up(&info->sem);
 }
 
index 6689c7bbac9225ac7e6a1dce852363edf6c1ae40..c2d58f4e553728d1c3132c9528d16f745742b8ef 100644 (file)
@@ -21,7 +21,7 @@
 #include <linux/stddef.h>      /* offsetof(), etc. */
 #include <linux/errno.h>       /* return codes */
 #include <linux/kernel.h>
-#include <linux/malloc.h>      /* kmalloc(), kfree() */
+#include <linux/slab.h>                /* kmalloc(), kfree() */
 #include <linux/mm.h>          /* verify_area(), etc. */
 #include <linux/string.h>      /* inline mem*, str* functions */
 #include <linux/init.h>                /* __initfunc et al. */
index 71e51ffb2cd8c33c621e0d5960c1e808009a4a04..3a683577f919b6c6f6e07cdd04ea7189657dc0b0 100644 (file)
@@ -5,7 +5,7 @@
  *     Authors:
  *     Lennert Buytenhek               <buytenh@gnu.org>
  *
- *     $Id: br_stp_bpdu.c,v 1.2 2000/02/21 15:51:34 davem Exp $
+ *     $Id: br_stp_bpdu.c,v 1.3 2001/11/10 02:35:25 davem Exp $
  *
  *     This program is free software; you can redistribute it and/or
  *     modify it under the terms of the GNU General Public License
@@ -14,6 +14,7 @@
  */
 
 #include <linux/kernel.h>
+#include <linux/if_ether.h>
 #include <linux/if_bridge.h>
 #include "br_private.h"
 #include "br_private_stp.h"
@@ -42,6 +43,7 @@ static void br_send_bpdu(struct net_bridge_port *p, unsigned char *data, int len
        }
 
        skb->dev = dev;
+       skb->protocol = htons(ETH_P_802_2);
        skb->mac.raw = skb_put(skb, size);
        memcpy(skb->mac.raw, bridge_ula, ETH_ALEN);
        memcpy(skb->mac.raw+ETH_ALEN, dev->dev_addr, ETH_ALEN);
index b5778616e5bd05b3a9afdfb347c08c37a6d7845d..accf014200a6c66e91099b50b793ce1203739a2c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  $Id: ipconfig.c,v 1.40 2001/10/30 03:08:02 davem Exp $
+ *  $Id: ipconfig.c,v 1.42 2001/11/10 07:23:12 davem Exp $
  *
  *  Automatic Configuration of IP -- use DHCP, BOOTP, RARP, or
  *  user-supplied information to configure own IP address and routes.
@@ -639,7 +639,7 @@ static inline void ic_bootp_cleanup(void)
 /*
  *  Send DHCP/BOOTP request to single interface.
  */
-static void __init ic_bootp_send_if(struct ic_device *d, u32 jiffies)
+static void __init ic_bootp_send_if(struct ic_device *d, unsigned long jiffies_diff)
 {
        struct net_device *dev = d->dev;
        struct sk_buff *skb;
@@ -686,7 +686,7 @@ static void __init ic_bootp_send_if(struct ic_device *d, u32 jiffies)
        b->your_ip = INADDR_NONE;
        b->server_ip = INADDR_NONE;
        memcpy(b->hw_addr, dev->dev_addr, dev->addr_len);
-       b->secs = htons(jiffies / HZ);
+       b->secs = htons(jiffies_diff / HZ);
        b->xid = d->xid;
 
        /* add DHCP options or BOOTP extensions */
@@ -1009,7 +1009,7 @@ static int __init ic_dynamic(void)
 #endif
 
                jiff = jiffies + (d->next ? CONF_INTER_TIMEOUT : timeout);
-               while (jiffies < jiff && !ic_got_reply) {
+               while (time_before(jiffies, jiff) && !ic_got_reply) {
                        barrier();
                        cpu_relax();
                }
@@ -1124,7 +1124,7 @@ static int __init ip_auto_config(void)
  try_try_again:
        /* Give hardware a chance to settle */
        jiff = jiffies + CONF_PRE_OPEN;
-       while (jiffies < jiff)
+       while (time_before(jiffies, jiff))
                ;
 
        /* Setup all network devices */
@@ -1133,7 +1133,7 @@ static int __init ip_auto_config(void)
 
        /* Give drivers a chance to settle */
        jiff = jiffies + CONF_POST_OPEN;
-       while (jiffies < jiff)
+       while (time_before(jiffies, jiff))
                        ;
 
        /*
index 2bd5dd41668b420cdc95285528e62ef3fff71d4a..a77ca424365087eb90e6c190ccf69de39d96d828 100644 (file)
@@ -2462,7 +2462,7 @@ static void tcp_sack_remove(struct tcp_opt *tp)
 
                        /* Zap this SACK, by moving forward any other SACKS. */
                        for (i=this_sack+1; i < num_sacks; i++)
-                               sp[i-1] = sp[i];
+                               tp->selective_acks[i-1] = tp->selective_acks[i];
                        num_sacks--;
                        continue;
                }
index 1571ee4d008dedd682a777919ef20b3aba61ead2..1bb82ed57e23a482a9977ae570400e24684706e3 100644 (file)
@@ -130,9 +130,6 @@ int __init irda_device_init( void)
 #ifdef CONFIG_SA1100_FIR
        sa1100_irda_init();
 #endif
-#ifdef CONFIG_SA1100_FIR
-       sa1100_irda_init();
-#endif
 #ifdef CONFIG_NSC_FIR
        nsc_ircc_init();
 #endif
@@ -160,9 +157,6 @@ int __init irda_device_init( void)
 #ifdef CONFIG_OLD_BELKIN
        old_belkin_init();
 #endif
-#ifdef CONFIG_EP7211_IR
-       ep7211_ir_init();
-#endif
 #ifdef CONFIG_EP7211_IR
        ep7211_ir_init();
 #endif