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
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).
VERSION = 2
PATCHLEVEL = 4
SUBLEVEL = 15
-EXTRAVERSION =-pre4
+EXTRAVERSION =-pre5
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
/* 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 *);
#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>
}
-/*
- * 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;
"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))
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"
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)
}
}
\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)
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
# 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
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
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 */
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)
{
* 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...
#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>
/*
* 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)
{
#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.
*/
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;
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);
}
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);
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
# 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
# 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
# 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
-/* $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)
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",
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",
-/* $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)
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
-/* $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)
* 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,
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 */
-/* $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)
#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>
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,
+};
#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>
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);
+ }
}
-/* $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)
#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>
}
}
-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)
-/* $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)
#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>
}
}
-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
}
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) ||
-# $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.
#
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
# 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
#
# 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
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
# 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
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
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
# 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
# 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
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
-/* $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)
}
}
+ 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;
}
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;
-/* $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)
__kernel_caddr_t32 ifcbuf;
};
+#ifdef CONFIG_NET
static int dev_ifname32(unsigned int fd, unsigned int cmd, unsigned long arg)
{
struct net_device *dev;
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)
{
}
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 *)®addr->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)) {
/* 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)
-/* $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);
#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.
*
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;
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");
}
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);
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! */
}
return -ENOMEM;
}
- if ((irqflags & SA_IMAP_MASKED) == 0) {
+ if (bucket == &pil0_dummy_bucket) {
bucket->irq_info = action;
bucket->flags |= IBF_ACTIVE;
} else {
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;
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();
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;
/* 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.
clear_softint(clr_mask);
}
#else
+ int should_forward = 1;
+
clear_softint(1 << irq);
#endif
#endif
for ( ; bp != NULL; bp = nbp) {
unsigned char flags = bp->flags;
+ unsigned char random = 0;
nbp = __bucket(bp->irq_chain);
bp->irq_chain = 0;
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;
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);
return -EINVAL;
}
- /* Only IMAP style interrupts can be registered as fast. */
- if(bucket->pil == 0)
- return -EINVAL;
-
if(!handler)
return -EINVAL;
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)
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);
#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) {
#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;
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;
}
}
: "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);
+}
+
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;
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;
-/* $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)
#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>
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,
+};
#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>
__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)
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;
-/* $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)
#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>
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 {
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];
-/* $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)
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
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
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
#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
#ifdef CONFIG_ATM_NICSTAR
devs += nicstar_detect();
#endif
-#ifdef CONFIG_ATM_IDT77252
- devs += idt77252_detect();
-#endif
#ifdef CONFIG_ATM_AMBASSADOR
devs += amb_detect();
#endif
/*******************************************************************
- * 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
*
*
*******************************************************************/
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>
#endif /* CONFIG_ATM_IDT77252_USE_SUNI */
-#define DEBUG 1
-
#include "idt77252.h"
#include "idt77252_tables.h"
* 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
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;
#endif /* HAVE_EEPROM */
-#ifdef DEBUG
+#ifdef CONFIG_ATM_IDT77252_DEBUG
static void
dump_tct(struct idt77252_dev *card, int index)
{
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;
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);
return;
}
+
+ skb->next = NULL;
flush_rx_pool(card, rpp);
if (!atm_charge(vcc, skb->truesize)) {
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;
}
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;
}
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");
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
}
}
-static int
+static int __devinit
init_sram(struct idt77252_dev *card)
{
int i;
return 0;
}
-static int
+static int __devinit
init_card(struct atm_dev *dev)
{
struct idt77252_dev *card = dev->dev_data;
/*****************************************************************************/
-static int
-preset_idt77252(struct idt77252_dev *card)
+static int __devinit
+idt77252_preset(struct idt77252_dev *card)
{
u16 pci_command;
}
-unsigned long
+static unsigned long __devinit
probe_sram(struct idt77252_dev *card)
{
u32 data, addr;
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;
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");
/*******************************************************************
- * 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
*
/* */
/*****************************************************************************/
+#define DBG_RAW_CELL 0x00000400
#define DBG_TINY 0x00000200
#define DBG_GENERAL 0x00000100
#define DBG_XGENERAL 0x00000080
#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)
#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
#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
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)
/*****************************************************************************/
/* */
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;
if (!sunis) del_timer_sync(&poll_timer);
spin_unlock_irqrestore(&sunis_lock,flags);
kfree(PRIV(dev));
+
+ MOD_DEC_USE_COUNT;
return 0;
}
int init_module(void)
{
- MOD_INC_USE_COUNT;
return 0;
}
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;
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;
#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
unsigned long data;
ssize_t retval;
+ if (rtc_has_irq == 0)
+ return -EIO;
+
if (count < sizeof(unsigned long))
return -EINVAL;
{
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 */
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);
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;
if (file->f_flags & FASYNC) {
rtc_fasync (-1, file, 0);
}
+no_irq:
#endif
spin_lock_irq (&rtc_lock);
{
unsigned long l;
+ if (rtc_has_irq == 0)
+ return 0;
+
poll_wait(file, &rtc_wait, wait);
spin_lock_irq (&rtc_lock);
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.
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))
{
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__ */
}
"QUANTUM FIREBALLP KA6.4",
"QUANTUM FIREBALLP LM20.4",
"QUANTUM FIREBALLP KX20.5",
+ "QUANTUM FIREBALLP KX27.3",
"QUANTUM FIREBALLP LM20.5",
NULL
};
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;
* 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)
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);
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)
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
MODULE_AUTHOR("Randy Gobbel/Paul Mackerras");
MODULE_DESCRIPTION("PowerMac BMAC ethernet driver.");
MODULE_LICENSE("GPL");
-
+EXPORT_NO_SYMBOLS;
static void __exit bmac_cleanup (void)
{
#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>
*/
-/* 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
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
#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.
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 */
/* 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. */
}
{
- int phy, phy_idx = 0;
+ int phy;
/* Roadrunner only: Turn on the MII transceiver */
outw(0x8040, ioaddr + Wn3_Options);
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);
}
}
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);
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);
/* 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);
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;
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,
{
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) {
module_init(init_3c574_cs);
module_exit(exit_3c574_cs);
-MODULE_LICENSE("GPL");
/*
* Local variables:
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:
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);
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++;
module_init(init_3c589_cs);
module_exit(exit_3c589_cs);
-MODULE_LICENSE("GPL");
/*======================================================================
- fmvj18x_cs.c 2.2 2001/01/07
+ fmvj18x_cs.c 2.6 2001/09/17
A fmvj18x (and its compatibles) PCMCIA client driver
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
/*====================================================================*/
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
cardtype = XXX10304; /* MBH10304 with buggy CIS */
link->conf.ConfigIndex = 0x20;
} else {
- cardtype = MBH10302;
+ cardtype = MBH10302; /* NextCom NC5310, etc. */
link->conf.ConfigIndex = 1;
}
break;
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) {
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 */
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);
}
restore_flags(flags);
}
-MODULE_LICENSE("GPL");
"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
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 {
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:
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
#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>
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")
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, /* ... */ };
/*====================================================================*/
+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);
#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 },
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;
/*======================================================================
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;
}
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);
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;
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;
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;
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;
/*====================================================================*/
-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;
module_init(init_pcnet_cs);
module_exit(exit_pcnet_cs);
-MODULE_LICENSE("GPL");
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.
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. */
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 */
#define MULTICAST2 2
#define MULTICAST4 4
#define MULTICAST6 6
+#define MGMT 8
#define REVISION 0x0a
/* Transmit status bits. */
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);
/*======================================================================
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);
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++;
"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:
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) {
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);
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
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);
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,
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 */
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;
}
reschedule:
smc->media.expires = jiffies + HZ;
add_timer(&smc->media);
+ SMC_SELECT_BANK(saved_bank);
}
/*====================================================================*/
* 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.
#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")
static void do_powerdown(struct net_device *dev);
static int do_stop(struct net_device *dev);
-
/*=============== Helper functions =========================*/
static void
flush_stale_links(void)
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 */
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 */
__setup("xirc2ps_cs=", setup_xirc2ps_cs);
#endif
-MODULE_LICENSE("GPL");
2: error, data verify error
*/
+#if 0 /* Unused at the moment */
static int VpdWriteDWord(
SK_AC *pAC, /* pAC pointer */
SK_IOC IoC, /* IO Context */
}
return(0) ;
}
+#endif
/*
* Read one Stream of 'len' bytes of VPD data, starting at 'addr' from
{
yenta_config_init(socket);
yenta_clear_maps(socket);
+
+ /* Re-enable interrupts */
+ cb_writel(socket, CB_SOCKET_MASK, CB_CDMASK);
return 0;
}
{
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
-/* $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)
*/
static __inline__ void __init show_su_version(void)
{
- char *revision = "$Revision: 1.53 $";
+ char *revision = "$Revision: 1.54 $";
char *version, *p;
version = strchr(revision, ' ');
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;
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);
return (0);
}
+#ifdef MMAPIO
static int
ahc_linux_pci_reserve_mem_region(struct ahc_softc *ahc,
u_long *bus_addr,
error = ENOMEM;
return (error);
}
+#endif /* MMAPIO */
int
ahc_pci_map_registers(struct ahc_softc *ahc)
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;
{
unsigned long iobase;
struct trident_card *card;
- dma_addr_t mask;
u8 bits;
u8 revision;
int i = 0;
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);
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;
#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 *);
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,
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;
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;
/* 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,
/* 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);
*/
struct urb *urb;
unsigned char *buffer;
int status;
- unsigned long flags;
int count;
int bytesleft;
int firsthalf;
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;
}
// 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;
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);
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);
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 */
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;
****************************************************************************/
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;
}
****************************************************************************/
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);
*
*/
-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) },
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,
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,
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,
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,
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
#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.
//
}
#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)
return USB_STOR_TRANSPORT_GOOD;
}
+#endif
static int
freecom_readdata (Scsi_Cmnd *srb, struct us_data *us,
/* 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 )
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
acornfb_init_fbinfo();
- while (opt = strsep(&options, ",")) {
+ while ((opt = strsep(&options, ",")) != NULL) {
if (!*opt)
continue;
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();
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;
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();
/* 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);
}
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))
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;
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;
if (!options || !*options)
return;
- while (this_opt = strsep(&options, ",")) {
+ while ((this_opt = strsep(&options, ",")) != NULL) {
if (!*this_opt) continue;
if (! strcmp(this_opt, "inverse"))
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);
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;
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;
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();
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;
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 =
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);
}
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);
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();
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)) {
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;
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"))
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);
}
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))
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();
}
else
get_video_mode(this_opt);
+ }
DPRINTK("default mode: xres=%d, yres=%d, bpp=%d\n",virgefb_default.xres,
virgefb_default.yres,
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. */
__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);
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);
}
}
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 = {
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;
}
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));
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;
}
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
}
d_instantiate(dentry, inode);
+ dentry->d_flags |= DCACHE_NFSD_DISCONNECTED; /* NFS hack */
+
EXIT;
return NULL;
lock_kernel();
if (size_check != inode->i_size) {
- fs_up(&inode->i_sem);
+ unlock_kernel();
+ fs_up(&inode->i_sem);
EXIT;
return -EALREADY;
}
#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... */
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;
goto put_out;
}
+ error = 0;
cache = fset->fset_cache;
cache->cache_flags &= ~CACHE_FSETROOT_SET;
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,
error = -EPERM;
iops = filter_c2cdiops(fset->fset_cache->cache_filter);
- if (!iops &&
- !iops->setattr) {
+ if (!iops) {
EXIT;
return error;
}
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;
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)
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);
* 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;
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
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
*/
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 */
};
/*
- * $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;
}
/*
* 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))
#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 */
-/* $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
#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)
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)
-/* $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
#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)
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)
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)
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 */
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)
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)
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)
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)
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)
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)
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.
/* 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)
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)
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)
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 */
#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 */
-/* $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)
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);
* 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__
BUG(); \
if (PageActive(page)) \
BUG(); \
- if (page_count(page) == 0) \
- BUG(); \
} while (0)
#define add_page_to_active_list(page) \
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)
/* 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:
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);
if (map) {
if (iobuf->locked)
UnlockPage(map);
- __free_page(map);
+ page_cache_release(map);
}
}
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)
/* We have the page */
SetPageUptodate(page);
- if (info->locked)
- page_cache_get(page);
return page;
no_space:
spin_unlock (&sbinfo->stat_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);
}
#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. */
* 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
*/
#include <linux/kernel.h>
+#include <linux/if_ether.h>
#include <linux/if_bridge.h>
#include "br_private.h"
#include "br_private_stp.h"
}
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);
/*
- * $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.
/*
* 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;
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 */
#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();
}
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 */
/* Give drivers a chance to settle */
jiff = jiffies + CONF_POST_OPEN;
- while (jiffies < jiff)
+ while (time_before(jiffies, jiff))
;
/*
/* 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;
}
#ifdef CONFIG_SA1100_FIR
sa1100_irda_init();
#endif
-#ifdef CONFIG_SA1100_FIR
- sa1100_irda_init();
-#endif
#ifdef CONFIG_NSC_FIR
nsc_ircc_init();
#endif
#ifdef CONFIG_OLD_BELKIN
old_belkin_init();
#endif
-#ifdef CONFIG_EP7211_IR
- ep7211_ir_init();
-#endif
#ifdef CONFIG_EP7211_IR
ep7211_ir_init();
#endif