Commit 12e35fae authored by Linus Torvalds's avatar Linus Torvalds

Import 2.1.54

parent 6696fcb6
This diff is collapsed.
......@@ -47,7 +47,7 @@ foo \kill}%
%
\title{{\bf Linux Allocated Devices}}
\author{Maintained by H. Peter Anvin $<$hpa@zytor.com$>$}
\date{Last revised: July 28, 1997}
\date{Last revised: September 5, 1997}
\maketitle
%
\noindent
......@@ -216,7 +216,9 @@ reply.
\major{85}{}{char }{Linux/SGI shared memory input queue}
\major{86}{}{char }{SCSI media changer}
\major{87}{}{char }{Sony Control-A1 stereo control bus}
\major{88}{--119}{}{Unallocated}
\major{88}{}{char }{COMX synchronous serial card}
\major{89}{}{char }{I$^2$C bus interface}
\major{90}{--119}{}{Unallocated}
\major{120}{--127}{}{Local/experimental use}
\major{128}{--239}{}{Unallocated}
\major{240}{--254}{}{Local/experimental use}
......@@ -525,6 +527,7 @@ physical disks.
\minor{148}{/dev/gfx}{Linux/SGI graphics effects device}
\minor{149}{/dev/input/mouse}{Linux/SGI Irix emulation mouse}
\minor{150}{/dev/input/keyboard}{Linux/SGI Irix emulation keyboard}
\minor{151}{/dev/led}{Front panel LEDs}
\end{devicelist}
\begin{devicelist}
......@@ -1417,8 +1420,8 @@ Currently for Dolphin Interconnect Solutions' PCI-SCI bridge.
\begin{devicelist}
\major{82}{}{char }{WiNRADiO communications receiver card}
\major{0}{/dev/winradio0}{First WiNRADiO card}
\major{1}{/dev/winradio1}{Second WiNRADiO card}
\minor{0}{/dev/winradio0}{First WiNRADiO card}
\minor{1}{/dev/winradio1}{Second WiNRADiO card}
\minordots
\end{devicelist}
......@@ -1465,7 +1468,21 @@ on {\url http://home.pages.de/~videotext/\/}.
\end{devicelist}
\begin{devicelist}
\major{88}{--119}{}{Unallocated}
\major{88}{}{char }{COMX synchronous serial card}
\minor{0}{/dev/comx0}{Channel 0}
\minor{1}{/dev/comx1}{Channel 1}
\minordots
\end{devicelist}
\begin{devicelist}
\major{89}{}{char }{I$^2$C bus interface}
\minor{0}{/dev/i2c0}{First I$^2$C adapter}
\minor{1}{/dev/i2c1}{Second I$^2$C adapter}
\minordots
\end{devicelist}
\begin{devicelist}
\major{90}{--119}{}{Unallocated}
\end{devicelist}
\begin{devicelist}
......
LINUX ALLOCATED DEVICES
Maintained by H. Peter Anvin <hpa@zytor.com>
Last revised: July 28, 1997
Last revised: September 5, 1997
This list is the successor to Rick Miller's Linux Device List, which
he stopped maintaining when he got busy with other things in 1993. It
......@@ -301,6 +301,7 @@ reply.
148 = /dev/gfx Linux/SGI graphics effects device
149 = /dev/input/mouse Linux/SGI Irix emulation mouse
150 = /dev/input/keyboard Linux/SGI Irix emulation keyboard
151 = /dev/led Front panel LEDs
11 char Raw keyboard device
0 = /dev/kbd Raw keyboard device
......@@ -1031,7 +1032,17 @@ reply.
1 = /dev/controla1 Second device on chain
...
88-119 UNALLOCATED
88 char COMX synchronous serial card
0 = /dev/comx0 COMX channel 0
1 = /dev/comx1 COMX channel 1
...
89 char I2C bus interface
0 = /dev/i2c0 First I2C adapter
1 = /dev/i2c1 Second I2C adapter
...
90-119 UNALLOCATED
120-127 LOCAL/EXPERIMENTAL USE
......
VERSION = 2
PATCHLEVEL = 1
SUBLEVEL = 53
SUBLEVEL = 54
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/)
......
......@@ -186,6 +186,7 @@ static void layout_dev(struct pci_dev *dev)
pcibios_read_config_dword(bus->number, dev->devfn, reg, &base);
if (!base) {
/* this base-address register is unused */
dev->base_address[(reg - PCI_BASE_ADDRESS_0)>>2] = 0;
continue;
}
......
......@@ -23,8 +23,10 @@ comment 'General setup'
bool 'Kernel math emulation' CONFIG_MATH_EMULATION
bool 'Networking support' CONFIG_NET
bool 'PCI bios support' CONFIG_PCI
bool 'PCI support' CONFIG_PCI
if [ "$CONFIG_PCI" = "y" ]; then
bool ' PCI BIOS support' CONFIG_PCI_BIOS
bool ' PCI direct access support' CONFIG_PCI_DIRECT
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
bool ' PCI bridge optimization (experimental)' CONFIG_PCI_OPTIMIZE
fi
......
......@@ -20,6 +20,8 @@ CONFIG_MODULES=y
# CONFIG_MATH_EMULATION is not set
CONFIG_NET=y
CONFIG_PCI=y
CONFIG_PCI_BIOS=y
# CONFIG_PCI_DIRECT is not set
# CONFIG_MCA is not set
CONFIG_SYSVIPC=y
CONFIG_SYSCTL=y
......@@ -139,7 +141,6 @@ CONFIG_SCSI_OMIT_FLASHPOINT=y
# CONFIG_SCSI_NCR53C406A is not set
# CONFIG_SCSI_NCR53C7xx is not set
# CONFIG_SCSI_NCR53C8XX is not set
# CONFIG_SCSI_PPA is not set
# CONFIG_SCSI_PAS16 is not set
# CONFIG_SCSI_QLOGIC_FAS is not set
# CONFIG_SCSI_QLOGIC_ISP is not set
......@@ -162,6 +163,7 @@ CONFIG_NET_ETHERNET=y
# CONFIG_NET_VENDOR_3COM is not set
# CONFIG_LANCE is not set
# CONFIG_NET_VENDOR_SMC is not set
# CONFIG_NET_VENDOR_RACAL is not set
# CONFIG_NET_ISA is not set
CONFIG_NET_EISA=y
# CONFIG_PCNET32 is not set
......@@ -174,7 +176,6 @@ CONFIG_EEXPRESS_PRO100=y
# CONFIG_NET_POCKET is not set
# CONFIG_FDDI is not set
# CONFIG_DLCI is not set
# CONFIG_PLIP is not set
# CONFIG_PPP is not set
# CONFIG_NET_RADIO is not set
# CONFIG_SLIP is not set
......@@ -239,6 +240,7 @@ CONFIG_82C710_MOUSE=y
# CONFIG_APM is not set
# CONFIG_WATCHDOG is not set
# CONFIG_RTC is not set
# CONFIG_H8 is not set
# CONFIG_NVRAM is not set
# CONFIG_JOYSTICK is not set
......
This diff is collapsed.
......@@ -42,8 +42,6 @@
extern volatile unsigned long smp_local_timer_ticks[1+NR_CPUS];
#endif
#define CR0_NE 32
unsigned int local_irq_count[NR_CPUS];
#ifdef __SMP__
atomic_t __intel_bh_counter;
......@@ -55,6 +53,8 @@ int __intel_bh_counter;
static unsigned int int_count[NR_CPUS][NR_IRQS] = {{0},};
#endif
atomic_t nmi_counter;
/*
* This contains the irq mask for both irq controllers
*/
......@@ -199,7 +199,6 @@ static void no_action(int cpl, void *dev_id, struct pt_regs *regs) { }
* be shot.
*/
static void math_error_irq(int cpl, void *dev_id, struct pt_regs *regs)
{
outb(0,0xF0);
......@@ -224,28 +223,26 @@ static struct irqaction *irq_action[16] = {
int get_irq_list(char *buf)
{
int i, len = 0;
int i;
struct irqaction * action;
char *p = buf;
for (i = 0 ; i < NR_IRQS ; i++) {
action = irq_action[i];
if (!action)
continue;
len += sprintf(buf+len, "%2d: %10u %s",
p += sprintf(p, "%3d: %10u %s",
i, kstat.interrupts[i], action->name);
for (action=action->next; action; action = action->next) {
len += sprintf(buf+len, ", %s", action->name);
p += sprintf(p, ", %s", action->name);
}
len += sprintf(buf+len, "\n");
*p++ = '\n';
}
/*
* Linus - should you add NMI counts here ?????
*/
p += sprintf(p, "NMI: %10u\n", atomic_read(&nmi_counter));
#ifdef __SMP_PROF__
len+=sprintf(buf+len, "IPI: %8lu received\n",
ipi_count);
p += sprintf(p, "IPI: %10lu\n", ipi_count);
#endif
return len;
return p - buf;
}
#ifdef __SMP_PROF__
......
......@@ -29,6 +29,7 @@
#include <asm/uaccess.h>
#include <asm/io.h>
#include <asm/spinlock.h>
#include <asm/atomic.h>
asmlinkage int system_call(void);
asmlinkage void lcall7(void);
......@@ -271,7 +272,9 @@ static void unknown_nmi_error(unsigned char reason, struct pt_regs * regs)
asmlinkage void do_nmi(struct pt_regs * regs, long error_code)
{
unsigned char reason = inb(0x61);
extern atomic_t nmi_counter;
atomic_inc(&nmi_counter);
if (reason & 0x80)
mem_parity_error(reason, regs);
if (reason & 0x40)
......@@ -348,7 +351,10 @@ asmlinkage void do_coprocessor_error(struct pt_regs * regs, long error_code)
asmlinkage void do_spurious_interrupt_bug(struct pt_regs * regs,
long error_code)
{
#if 0
/* No need to warn about this any longer. */
printk("Ignoring P6 Local APIC Spurious Interrupt Bug...\n");
#endif
}
/*
......
......@@ -261,6 +261,43 @@ __initfunc(unsigned long paging_init(unsigned long start_mem, unsigned long end_
return free_area_init(start_mem, end_mem);
}
/*
* Test if the WP bit works in supervisor mode. It isn't supported on 386's
* and also on some strange 486's (NexGen etc.). All 586+'s are OK. The jumps
* before and after the test are here to work-around some nasty CPU bugs.
*/
__initfunc(void test_wp_bit(void))
{
unsigned char tmp_reg;
unsigned long old = pg0[0];
printk("Checking if this processor honours the WP bit even in supervisor mode... ");
pg0[0] = pte_val(mk_pte(PAGE_OFFSET, PAGE_READONLY));
local_flush_tlb();
current->mm->mmap->vm_start += PAGE_SIZE;
__asm__ __volatile__(
"jmp 1f; 1:\n"
"movb %0,%1\n"
"movb %1,%0\n"
"jmp 1f; 1:\n"
:"=m" (*(char *) __va(0)),
"=q" (tmp_reg)
:/* no inputs */
:"memory");
pg0[0] = old;
local_flush_tlb();
current->mm->mmap->vm_start -= PAGE_SIZE;
if (wp_works_ok < 0) {
wp_works_ok = 0;
printk("No.\n");
#ifndef CONFIG_M386
panic("This kernel doesn't support CPU's with broken WP. Recompile it for a 386!");
#endif
} else
printk("Ok.\n");
}
__initfunc(void mem_init(unsigned long start_mem, unsigned long end_mem))
{
unsigned long start_low_mem = PAGE_SIZE;
......@@ -339,30 +376,9 @@ __initfunc(void mem_init(unsigned long start_mem, unsigned long end_mem))
reservedpages << (PAGE_SHIFT-10),
datapages << (PAGE_SHIFT-10),
initpages << (PAGE_SHIFT-10));
/* test if the WP bit is honoured in supervisor mode */
if (wp_works_ok < 0) {
unsigned char tmp_reg;
unsigned long old = pg0[0];
printk("Checking if this processor honours the WP bit even in supervisor mode... ");
pg0[0] = pte_val(mk_pte(PAGE_OFFSET, PAGE_READONLY));
local_flush_tlb();
current->mm->mmap->vm_start += PAGE_SIZE;
__asm__ __volatile__(
"movb %0,%1 ; movb %1,%0"
:"=m" (*(char *) __va(0)),
"=q" (tmp_reg)
:/* no inputs */
:"memory");
pg0[0] = old;
local_flush_tlb();
current->mm->mmap->vm_start -= PAGE_SIZE;
if (wp_works_ok < 0) {
wp_works_ok = 0;
printk("No.\n");
} else
printk("Ok.\n");
}
return;
if (wp_works_ok < 0)
test_wp_bit();
}
void free_initmem(void)
......
......@@ -68,7 +68,7 @@ CONFIG_SOLARIS_EMUL=m
#
# Floppy, IDE, and other block devices
#
# CONFIG_BLK_DEV_FD is not set
CONFIG_BLK_DEV_FD=y
CONFIG_BLK_DEV_MD=y
CONFIG_MD_LINEAR=m
CONFIG_MD_STRIPED=m
......
/* $Id: ebus.c,v 1.7 1997/08/28 02:23:17 ecd Exp $
/* $Id: ebus.c,v 1.8 1997/09/05 22:59:39 ecd Exp $
* ebus.c: PCI to EBus bridge device.
*
* Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be)
......@@ -39,16 +39,72 @@ extern void auxio_probe(void);
extern unsigned int psycho_irq_build(unsigned int full_ino);
__initfunc(void fill_ebus_device(int node, struct linux_ebus_device *dev))
static inline unsigned long
ebus_alloc(unsigned long *memory_start, size_t size)
{
unsigned long mem;
*memory_start = (*memory_start + 7) & ~(7);
mem = *memory_start;
*memory_start += size;
return mem;
}
__initfunc(void fill_ebus_child(int node, struct linux_ebus_child *dev))
{
int regs[PROMREG_MAX];
int irqs[PROMREG_MAX];
char lbuf[128];
int i, len;
dev->prom_node = node;
prom_getstring(node, "name", lbuf, sizeof(lbuf));
strcpy(dev->prom_name, lbuf);
len = prom_getproperty(node, "reg", (void *)regs, sizeof(regs));
dev->num_addrs = len / sizeof(regs[0]);
for (i = 0; i < dev->num_addrs; i++) {
if (regs[i] >= dev->parent->num_addrs) {
prom_printf("UGH: property for %s was %d, need < %d\n",
dev->prom_name, len, dev->parent->num_addrs);
panic(__FUNCTION__);
}
dev->base_address[i] = dev->parent->base_address[regs[i]];
}
len = prom_getproperty(node, "interrupts", (char *)&irqs, sizeof(irqs));
if ((len == -1) || (len == 0)) {
dev->num_irqs = 0;
} else {
dev->num_irqs = len / sizeof(irqs[0]);
for (i = 0; i < dev->num_irqs; i++)
dev->irqs[i] = psycho_irq_build(irqs[i]);
}
#ifdef DEBUG_FILL_EBUS_DEV
printk("child '%s': address%s\n", dev->prom_name,
dev->num_addrs > 1 ? "es" : "");
for (i = 0; i < dev->num_addrs; i++)
printk(" %016lx\n", dev->base_address[i]);
if (dev->num_irqs) {
printk(" IRQ%s", dev->num_irqs > 1 ? "s" : "");
for (i = 0; i < dev->num_irqs; i++)
printk(" %08x", dev->irqs[i]);
printk("\n");
}
#endif
}
__initfunc(unsigned long fill_ebus_device(int node, struct linux_ebus_device *dev,
unsigned long memory_start))
{
struct linux_prom_registers regs[PROMREG_MAX];
struct linux_ebus_child *child;
int irqs[PROMINTR_MAX];
char lbuf[128];
int i, n, len;
#ifndef CONFIG_PCI
return;
#endif
dev->prom_node = node;
prom_getstring(node, "name", lbuf, sizeof(lbuf));
strcpy(dev->prom_name, lbuf);
......@@ -90,6 +146,27 @@ __initfunc(void fill_ebus_device(int node, struct linux_ebus_device *dev))
printk("\n");
}
#endif
if ((node = prom_getchild(node))) {
dev->children = (struct linux_ebus_child *)
ebus_alloc(&memory_start, sizeof(struct linux_ebus_child));
child = dev->children;
child->next = 0;
child->parent = dev;
fill_ebus_child(node, child);
while ((node = prom_getsibling(node))) {
child->next = (struct linux_ebus_child *)
ebus_alloc(&memory_start, sizeof(struct linux_ebus_child));
child = child->next;
child->next = 0;
child->parent = dev;
fill_ebus_child(node, child);
}
}
return memory_start;
}
__initfunc(unsigned long ebus_init(unsigned long memory_start,
......@@ -100,31 +177,32 @@ __initfunc(unsigned long ebus_init(unsigned long memory_start,
struct linux_ebus_device *dev;
struct linux_ebus *ebus;
struct pci_dev *pdev;
struct pcidev_cookie *cookie;
char lbuf[128];
unsigned long addr, *base;
int nd, len, ebusnd, topnd;
unsigned short pci_command;
int nd, len, ebusnd;
int reg, rng, nreg;
int devfn;
int num_ebus = 0;
#ifndef CONFIG_PCI
return memory_start;
#endif
memory_start = ((memory_start + 7) & (~7));
topnd = psycho_root->pbm_B.prom_node;
if (!topnd)
if (!pcibios_present())
return memory_start;
ebusnd = prom_searchsiblings(prom_getchild(topnd), "ebus");
if (ebusnd == 0) {
printk("EBUS: No EBUS's found.\n");
for (pdev = pci_devices; pdev; pdev = pdev->next) {
if ((pdev->vendor == PCI_VENDOR_ID_SUN) &&
(pdev->device == PCI_DEVICE_ID_SUN_EBUS))
break;
}
if (!pdev) {
printk("ebus: No EBus's found.\n");
return memory_start;
}
ebus_chain = ebus = (struct linux_ebus *)memory_start;
memory_start += sizeof(struct linux_ebus);
cookie = pdev->sysdata;
ebusnd = cookie->prom_node;
ebus_chain = ebus = (struct linux_ebus *)
ebus_alloc(&memory_start, sizeof(struct linux_ebus));
ebus->next = 0;
while (ebusnd) {
......@@ -133,7 +211,16 @@ __initfunc(unsigned long ebus_init(unsigned long memory_start,
prom_getstring(ebusnd, "name", lbuf, sizeof(lbuf));
ebus->prom_node = ebusnd;
strcpy(ebus->prom_name, lbuf);
ebus->parent = pbm = &psycho_root->pbm_B;
ebus->self = pdev;
ebus->parent = pbm = cookie->pbm;
/* Enable BUS Master. */
pcibios_read_config_word(pdev->bus->number, pdev->devfn,
PCI_COMMAND, &pci_command);
pci_command |= PCI_COMMAND_MASTER;
pcibios_write_config_word(pdev->bus->number, pdev->devfn,
PCI_COMMAND, pci_command);
len = prom_getproperty(ebusnd, "reg", (void *)regs,
sizeof(regs));
......@@ -144,17 +231,6 @@ __initfunc(unsigned long ebus_init(unsigned long memory_start,
}
nreg = len / sizeof(struct linux_prom_pci_registers);
devfn = (regs[0].phys_hi >> 8) & 0xff;
for (pdev = pbm->pci_bus.devices; pdev; pdev = pdev->sibling)
if (pdev->devfn == devfn)
break;
if (!pdev) {
prom_printf("%s: can't find PCI device\n",
__FUNCTION__);
prom_halt();
}
ebus->self = pdev;
base = &ebus->self->base_address[0];
for (reg = 0; reg < nreg; reg++) {
if (!(regs[reg].phys_hi & 0x03000000))
......@@ -181,25 +257,41 @@ __initfunc(unsigned long ebus_init(unsigned long memory_start,
prom_ebus_ranges_init(ebus);
nd = prom_getchild(ebusnd);
ebus->devices = (struct linux_ebus_device *)memory_start;
memory_start += sizeof(struct linux_ebus_device);
ebus->devices = (struct linux_ebus_device *)
ebus_alloc(&memory_start, sizeof(struct linux_ebus_device));
dev = ebus->devices;
dev->next = 0;
dev->children = 0;
dev->parent = ebus;
fill_ebus_device(nd, dev);
memory_start = fill_ebus_device(nd, dev, memory_start);
while ((nd = prom_getsibling(nd))) {
dev->next = (struct linux_ebus_device *)memory_start;
memory_start += sizeof(struct linux_ebus_device);
dev->next = (struct linux_ebus_device *)
ebus_alloc(&memory_start, sizeof(struct linux_ebus_device));
dev = dev->next;
dev->next = 0;
dev->children = 0;
dev->parent = ebus;
fill_ebus_device(nd, dev);
memory_start = fill_ebus_device(nd, dev, memory_start);
}
for (pdev = pdev->next; pdev; pdev = pdev->next) {
if ((pdev->vendor == PCI_VENDOR_ID_SUN) &&
(pdev->device == PCI_DEVICE_ID_SUN_EBUS))
break;
}
if (!pdev)
break;
ebusnd = prom_searchsiblings(prom_getsibling(ebusnd), "ebus");
cookie = pdev->sysdata;
ebusnd = cookie->prom_node;
ebus->next = (struct linux_ebus *)
ebus_alloc(&memory_start, sizeof(struct linux_ebus));
ebus = ebus->next;
ebus->next = 0;
++num_ebus;
}
......
/* $Id: ioctl32.c,v 1.17 1997/09/03 11:54:49 ecd Exp $
/* $Id: ioctl32.c,v 1.18 1997/09/06 02:25:13 davem Exp $
* ioctl32.c: Conversion between 32bit and 64bit native ioctls.
*
* Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
......@@ -33,13 +33,6 @@
#include <asm/rtc.h>
#include <asm/openpromio.h>
/*
* XXX: for DaveM:
* This is the kludge to know what size of buffer to
* copy back to the user... (ecd)
*/
int ifr_data_len;
/* As gcc will warn about casting u32 to some ptr, we have to cast it to
* unsigned long first, and that's what is A() for.
* You just do (void *)A(x), instead of having to type (void *)((unsigned long)x)
......@@ -203,13 +196,17 @@ static inline int dev_ifsioc(unsigned int fd, unsigned int cmd, u32 arg)
case SIOCGPPPVER:
{
u32 data;
int len;
__get_user(data, &(((struct ifreq32 *)A(arg))->ifr_ifru.ifru_data));
/*
* XXX: for DaveM:
* Here we use 'ifr_data_len' to know what size of buffer to
* copy back to the user... (ecd)
*/
if (copy_to_user((char *)A(data), ifr.ifr_data, ifr_data_len))
if(cmd == SIOCGPPPVER)
len = strlen(PPP_VERSION) + 1;
else if(cmd == SIOCGPPPCSTATS)
len = sizeof(struct ppp_comp_stats);
else
len = sizeof(struct ppp_stats);
if (copy_to_user((char *)A(data), ifr.ifr_data, len))
return -EFAULT;
break;
}
......
......@@ -161,11 +161,6 @@ static inline int __get_order(unsigned long size);
#include <linux/blk.h>
#include <linux/cdrom.h> /* for the compatibility eject ioctl */
#ifndef FLOPPY_MOTOR_MASK
#define FLOPPY_MOTOR_MASK 0xf0
#endif
#ifndef fd_get_dma_residue
#define fd_get_dma_residue() get_dma_residue(FLOPPY_DMA)
#endif
......
......@@ -584,7 +584,7 @@ static int hd_ioctl(struct inode * inode, struct file * file,
unsigned int cmd, unsigned long arg)
{
struct hd_geometry *loc = (struct hd_geometry *) arg;
int dev, err;
int dev;
if ((!inode) || !(inode->i_rdev))
return -EINVAL;
......@@ -593,19 +593,15 @@ static int hd_ioctl(struct inode * inode, struct file * file,
return -EINVAL;
switch (cmd) {
case HDIO_GETGEO:
{
struct hd_geometry g;
if (!loc) return -EINVAL;
err = verify_area(VERIFY_WRITE, loc, sizeof(*loc));
if (err)
return err;
put_user(hd_info[dev].head,
(char *) &loc->heads);
put_user(hd_info[dev].sect,
(char *) &loc->sectors);
put_user(hd_info[dev].cyl,
(short *) &loc->cylinders);
put_user(hd[MINOR(inode->i_rdev)].start_sect,
(long *) &loc->start);
return 0;
g.heads = hd_info[dev].head;
g.sectors = hd_info[dev].sect;
g.cylinders = hd_info[dev].cyl;
g.start = hd[MINOR(inode->i_rdev)].start_sect;
return copy_to_user(loc, &g, sizeof g) ? -EFAULT : 0;
}
case BLKRASET:
if(!suser()) return -EACCES;
if(arg > 0xff) return -EINVAL;
......@@ -613,18 +609,12 @@ static int hd_ioctl(struct inode * inode, struct file * file,
return 0;
case BLKRAGET:
if (!arg) return -EINVAL;
err = verify_area(VERIFY_WRITE, (long *) arg, sizeof(long));
if (err)
return err;
put_user(read_ahead[MAJOR(inode->i_rdev)],(long *) arg);
return 0;
return put_user(read_ahead[MAJOR(inode->i_rdev)],
(long *) arg);
case BLKGETSIZE: /* Return device size */
if (!arg) return -EINVAL;
err = verify_area(VERIFY_WRITE, (long *) arg, sizeof(long));
if (err)
return err;
put_user(hd[MINOR(inode->i_rdev)].nr_sects, (long *) arg);
return 0;
return put_user(hd[MINOR(inode->i_rdev)].nr_sects,
(long *) arg);
case BLKFLSBUF:
if(!suser()) return -EACCES;
fsync_dev(inode->i_rdev);
......@@ -817,7 +807,7 @@ __initfunc(int hd_init(void))
/*
* This routine is called to flush all partitions and partition tables
* for a changed scsi disk, and then re-read the new partition table.
* for a changed disk, and then re-read the new partition table.
* If we are revalidating a disk because of a media change, then we
* enter with usage == 0. If we are using an ioctl, we automatically have
* usage == 1 (we need an open channel to use an ioctl :-), so this
......@@ -850,8 +840,11 @@ static int revalidate_hddisk(kdev_t dev, int maxusage)
for (i=max_p - 1; i >=0 ; i--) {
int minor = start + i;
kdev_t devi = MKDEV(MAJOR_NR, minor);
struct super_block *sb = get_super(devi);
sync_dev(devi);
invalidate_inodes(devi);
if (sb)
invalidate_inodes(sb);
invalidate_buffers(devi);
gdev->part[minor].start_sect = 0;
gdev->part[minor].nr_sects = 0;
......
......@@ -20,13 +20,13 @@
#include <linux/module.h>
#include <linux/md.h>
#include <linux/raid0.h>
#include <linux/malloc.h>
#include <linux/vmalloc.h>
#define MAJOR_NR MD_MAJOR
#define MD_DRIVER
#define MD_PERSONALITY
static void create_strip_zones (int minor, struct md_dev *mddev)
static int create_strip_zones (int minor, struct md_dev *mddev)
{
int i, j, c=0;
int current_offset=0;
......@@ -50,8 +50,8 @@ static void create_strip_zones (int minor, struct md_dev *mddev)
c=0;
}
data->strip_zone=kmalloc (sizeof(struct strip_zone)*data->nr_strip_zones,
GFP_KERNEL);
if ((data->strip_zone=vmalloc(sizeof(struct strip_zone)*data->nr_strip_zones)) == NULL)
return 1;
data->smallest=NULL;
......@@ -81,6 +81,7 @@ static void create_strip_zones (int minor, struct md_dev *mddev)
data->strip_zone[i-1].size) : 0;
current_offset=smallest_by_zone->size;
}
return 0;
}
static int raid0_run (int minor, struct md_dev *mddev)
......@@ -90,17 +91,26 @@ static int raid0_run (int minor, struct md_dev *mddev)
MOD_INC_USE_COUNT;
mddev->private=kmalloc (sizeof (struct raid0_data), GFP_KERNEL);
if ((mddev->private=vmalloc (sizeof (struct raid0_data))) == NULL) return 1;
data=(struct raid0_data *) mddev->private;
create_strip_zones (minor, mddev);
if (create_strip_zones (minor, mddev))
{
vfree(data);
return 1;
}
nb_zone=data->nr_zones=
md_size[minor]/data->smallest->size +
(md_size[minor]%data->smallest->size ? 1 : 0);
data->hash_table=kmalloc (sizeof (struct raid0_hash)*nb_zone, GFP_KERNEL);
printk ("raid0 : Allocating %d bytes for hash.\n",sizeof(struct raid0_hash)*nb_zone);
if ((data->hash_table=vmalloc (sizeof (struct raid0_hash)*nb_zone)) == NULL)
{
vfree(data->strip_zone);
vfree(data);
return 1;
}
size=data->strip_zone[cur].size;
i=0;
......@@ -142,9 +152,9 @@ static int raid0_stop (int minor, struct md_dev *mddev)
{
struct raid0_data *data=(struct raid0_data *) mddev->private;
kfree (data->hash_table);
kfree (data->strip_zone);
kfree (data);
vfree (data->hash_table);
vfree (data->strip_zone);
vfree (data);
MOD_DEC_USE_COUNT;
return 0;
......
......@@ -447,7 +447,7 @@ __initfunc(static void rd_load_image(kdev_t device,int offset))
struct inode inode, out_inode;
struct file infile, outfile;
struct dentry in_dentry, out_dentry;
unsigned short fs;
unsigned long fs;
kdev_t ram_device;
int nblocks, i;
char *buf;
......
......@@ -101,8 +101,10 @@ if [ "$CONFIG_WATCHDOG" != "n" ]; then
fi
tristate ' Software Watchdog' CONFIG_SOFT_WATCHDOG
tristate ' Berkshire Products PC Watchdog' CONFIG_PCWATCHDOG
tristate ' Acquire SBC Watchdog Timer' CONFIG_ACQUIRE_WDT
fi
bool 'Enhanced Real Time Clock Support' CONFIG_RTC
bool 'Tadpole ANA H8 Support' CONFIG_H8
tristate '/dev/nvram support' CONFIG_NVRAM
tristate 'PC joystick support' CONFIG_JOYSTICK
endmenu
......@@ -204,6 +204,16 @@ else
endif
endif
ifeq ($(CONFIG_ACQUIRE_WDT),y)
M = y
L_OBJS += acquirewdt.o
else
ifeq ($(CONFIG_ACQUIRE_WDT),m)
M_OBJS += acquirewdt.o
MM = m
endif
endif
ifeq ($(CONFIG_AMIGAMOUSE),y)
M = y
L_OBJS += amigamouse.o
......@@ -293,6 +303,11 @@ LX_OBJS += apm_bios.o
M = y
endif
ifdef CONFIG_H8
LX_OBJS += h8.o
M = y
endif
ifdef M
LX_OBJS += misc.o
else
......
/*
* Acquire Single Board Computer Watchdog Timer driver for Linux 2.1.x
*
* Based on wdt.c. Original copyright messages:
*
* (c) Copyright 1996 Alan Cox <alan@cymru.net>, All Rights Reserved.
* http://www.cymru.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
* warranty for any of this software. This material is provided
* "AS-IS" and at no charge.
*
* (c) Copyright 1995 Alan Cox <alan@lxorguk.ukuu.org.uk>
*
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/malloc.h>
#include <linux/ioport.h>
#include <linux/fcntl.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include <linux/notifier.h>
#include <linux/reboot.h>
#include <linux/init.h>
static int acq_is_open=0;
/*
* You must set these - there is no sane way to probe for this board.
*/
#define WDT_STOP 0x43
#define WDT_START 0x443
#define WATCHDOG_MINOR 130
#define WD_TIMO (100*60) /* 1 minute */
/*
* Kernel methods.
*/
static void acq_ping(void)
{
/* Write a watchdog value */
inb_p(WDT_START);
}
static long acq_write(struct inode *inode, struct file *file, const char *buf, unsigned long count)
{
if(count)
{
acq_ping();
return 1;
}
return 0;
}
static long acq_read(struct inode *inode, struct file *file, char *buf, unsigned long count)
{
return -EINVAL;
}
static int acq_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg)
{
static struct watchdog_info ident=
{
WDIOF_KEEPALIVEPING, 1, "Acquire WDT"
};
switch(cmd)
{
case WDIOC_GETSUPPORT:
if (copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident)))
return -EFAULT;
break;
case WDIOC_GETSTATUS:
if (copy_to_user((int *)arg, &acq_is_open, sizeof(int)))
return -EFAULT;
break;
case WDIOC_KEEPALIVE:
acq_ping();
break;
default:
return -ENOIOCTLCMD;
}
return 0;
}
static int acq_open(struct inode *inode, struct file *file)
{
switch(MINOR(inode->i_rdev))
{
case WATCHDOG_MINOR:
if(acq_is_open)
return -EBUSY;
MOD_INC_USE_COUNT;
/*
* Activate
*/
acq_is_open=1;
inb_p(WDT_START);
return 0;
default:
return -ENODEV;
}
}
static int acq_close(struct inode *inode, struct file *file)
{
if(MINOR(inode->i_rdev)==WATCHDOG_MINOR)
{
#ifndef CONFIG_WATCHDOG_NOWAYOUT
inb_p(WDT_STOP);
#endif
acq_is_open=0;
}
MOD_DEC_USE_COUNT;
return 0;
}
/*
* Notifier for system down
*/
static int acq_notify_sys(struct notifier_block *this, unsigned long code,
void *unused)
{
if(code==SYS_DOWN || code==SYS_HALT)
{
/* Turn the card off */
inb_p(WDT_STOP);
}
return NOTIFY_DONE;
}
/*
* Kernel Interfaces
*/
static struct file_operations acq_fops = {
NULL,
acq_read,
acq_write,
NULL, /* No Readdir */
NULL, /* No Select */
acq_ioctl,
NULL, /* No mmap */
acq_open,
acq_close
};
static struct miscdevice acq_miscdev=
{
WATCHDOG_MINOR,
"Acquire WDT",
&acq_fops
};
/*
* The WDT card needs to learn about soft shutdowns in order to
* turn the timebomb registers off.
*/
static struct notifier_block acq_notifier=
{
acq_notify_sys,
NULL,
0
};
#ifdef MODULE
#define acq_init init_module
void cleanup_module(void)
{
misc_deregister(&acq_miscdev);
unregister_reboot_notifier(&acq_notifier);
release_region(WDT_STOP,1);
release_region(WDT_START,1);
}
#endif
__initfunc(int acq_init(void))
{
printk("WDT driver for Acquire single board computer initialising.\n");
misc_register(&acq_miscdev);
request_region(WDT_STOP, 1, "Acquire WDT");
request_region(WDT_START, 1, "Acquire WDT");
unregister_reboot_notifier(&acq_notifier);
return 0;
}
This diff is collapsed.
/*
*/
#ifndef __H8_H__
#define __H8_H__
/*
* Register address and offsets
*/
#define H8_BASE_ADDR 0x170 /* default */
#define H8_IRQ 9 /* default */
#define H8_STATUS_REG_OFF 0x4
#define H8_CMD_REG_OFF 0x4
#define H8_DATA_REG_OFF 0x0
/* H8 register bit definitions */
/* status register */
#define H8_OFULL 0x1 /* output data register full */
#define H8_IFULL 0x2 /* input data register full */
#define H8_CMD 0x8 /* command / not data */
#define H8_INTR 0xfa
#define H8_NACK 0xfc
#define H8_BYTE_LEVEL_ACK 0xfd
#define H8_CMD_ACK 0xfe
#define H8_SYNC_BYTE 0x99
/*
* H8 command definitions
*/
/* System info commands */
#define H8_SYNC 0x0
#define H8_RD_SN 0x1
#define H8_RD_ENET_ADDR 0x2
#define H8_RD_HW_VER 0x3
#define H8_RD_MIC_VER 0x4
#define H8_RD_MAX_TEMP 0x5
#define H8_RD_MIN_TEMP 0x6
#define H8_RD_CURR_TEMP 0x7
#define H8_RD_SYS_VARIENT 0x8
#define H8_RD_PWR_ON_CYCLES 0x9
#define H8_RD_PWR_ON_SECS 0xa
#define H8_RD_RESET_STATUS 0xb
#define H8_RD_PWR_DN_STATUS 0xc
#define H8_RD_EVENT_STATUS 0xd
#define H8_RD_ROM_CKSM 0xe
#define H8_RD_EXT_STATUS 0xf
#define H8_RD_USER_CFG 0x10
#define H8_RD_INT_BATT_VOLT 0x11
#define H8_RD_DC_INPUT_VOLT 0x12
#define H8_RD_HORIZ_PTR_VOLT 0x13
#define H8_RD_VERT_PTR_VOLT 0x14
#define H8_RD_EEPROM_STATUS 0x15
#define H8_RD_ERR_STATUS 0x16
#define H8_RD_NEW_BUSY_SPEED 0x17
#define H8_RD_CONFIG_INTERFACE 0x18
#define H8_RD_INT_BATT_STATUS 0x19
#define H8_RD_EXT_BATT_STATUS 0x1a
#define H8_RD_PWR_UP_STATUS 0x1b
#define H8_RD_EVENT_STATUS_MASK 0x56
/* Read/write/modify commands */
#define H8_CTL_EMU_BITPORT 0x32
#define H8_DEVICE_CONTROL 0x21
#define H8_CTL_TFT_BRT_DC 0x22
#define H8_CTL_WATCHDOG 0x23
#define H8_CTL_MIC_PROT 0x24
#define H8_CTL_INT_BATT_CHG 0x25
#define H8_CTL_EXT_BATT_CHG 0x26
#define H8_CTL_MARK_SPACE 0x27
#define H8_CTL_MOUSE_SENSITIVITY 0x28
#define H8_CTL_DIAG_MODE 0x29
#define H8_CTL_IDLE_AND_BUSY_SPDS 0x2a
#define H8_CTL_TFT_BRT_BATT 0x2b
#define H8_CTL_UPPER_TEMP 0x2c
#define H8_CTL_LOWER_TEMP 0x2d
#define H8_CTL_TEMP_CUTOUT 0x2e
#define H8_CTL_WAKEUP 0x2f
#define H8_CTL_CHG_THRESHOLD 0x30
#define H8_CTL_TURBO_MODE 0x31
#define H8_SET_DIAG_STATUS 0x40
#define H8_SOFTWARE_RESET 0x41
#define H8_RECAL_PTR 0x42
#define H8_SET_INT_BATT_PERCENT 0x43
#define H8_WRT_CFG_INTERFACE_REG 0x45
#define H8_WRT_EVENT_STATUS_MASK 0x57
#define H8_ENTER_POST_MODE 0x46
#define H8_EXIT_POST_MODE 0x47
/* Block transfer commands */
#define H8_RD_EEPROM 0x50
#define H8_WRT_EEPROM 0x51
#define H8_WRT_TO_STATUS_DISP 0x52
#define H8_DEFINE_SPC_CHAR 0x53
/* Generic commands */
#define H8_DEFINE_TABLE_STRING_ENTRY 0x60
/* Battery control commands */
#define H8_PERFORM_EMU_CMD 0x70
#define H8_EMU_RD_REG 0x71
#define H8_EMU_WRT_REG 0x72
#define H8_EMU_RD_RAM 0x73
#define H8_EMU_WRT_RAM 0x74
#define H8_BQ_RD_REG 0x75
#define H8_BQ_WRT_REG 0x76
/* System admin commands */
#define H8_PWR_OFF 0x80
/*
* H8 command related definitions
*/
/* device control argument bits */
#define H8_ENAB_EXTSMI 0x1
#define H8_DISAB_IRQ 0x2
#define H8_ENAB_FLASH_WRT 0x4
#define H8_ENAB_THERM 0x8
#define H8_ENAB_INT_PTR 0x10
#define H8_ENAB_LOW_SPD_IND 0x20
#define H8_ENAB_EXT_PTR 0x40
#define H8_DISAB_PWR_OFF_SW 0x80
#define H8_POWER_OFF 0x80
/* H8 read event status bits */
#define H8_DC_CHANGE 0x1
#define H8_INT_BATT_LOW 0x2
#define H8_INT_BATT_CHARGE_THRESHOLD 0x4
#define H8_INT_BATT_CHARGE_STATE 0x8
#define H8_INT_BATT_STATUS 0x10
#define H8_EXT_BATT_CHARGE_STATE 0x20
#define H8_EXT_BATT_LOW 0x40
#define H8_EXT_BATT_STATUS 0x80
#define H8_THERMAL_THRESHOLD 0x100
#define H8_WATCHDOG 0x200
#define H8_DOCKING_STATION_STATUS 0x400
#define H8_EXT_MOUSE_OR_CASE_SWITCH 0x800
#define H8_KEYBOARD 0x1000
#define H8_BATT_CHANGE_OVER 0x2000
#define H8_POWER_BUTTON 0x4000
#define H8_SHUTDOWN 0x8000
/* H8 control idle and busy speeds */
#define H8_SPEED_LOW 0x1
#define H8_SPEED_MED 0x2
#define H8_SPEED_HI 0x3
#define H8_SPEED_LOCKED 0x80
#define H8_MAX_CMD_SIZE 18
#define H8_Q_ALLOC_AMOUNT 10
/* H8 state field values */
#define H8_IDLE 1
#define H8_XMIT 2
#define H8_RCV 3
#define H8_RESYNC 4
#define H8_INTR_MODE 5
/* Mask values for control functions */
#define UTH_HYSTERESIS 5
#define DEFAULT_UTHERMAL_THRESHOLD 115
#define H8_TIMEOUT_INTERVAL 30
#define H8_RUN 4
#define H8_GET_MAX_TEMP 0x1
#define H8_GET_CURR_TEMP 0x2
#define H8_GET_UPPR_THRMAL_THOLD 0x4
#define H8_GET_ETHERNET_ADDR 0x8
#define H8_SYNC_OP 0x10
#define H8_SET_UPPR_THRMAL_THOLD 0x20
#define H8_GET_INT_BATT_STAT 0x40
#define H8_GET_CPU_SPD 0x80
#define H8_MANAGE_UTHERM 0x100
#define H8_MANAGE_LTHERM 0x200
#define H8_HALT 0x400
#define H8_CRASH 0x800
#define H8_GET_EXT_STATUS 0x10000
#define H8_MANAGE_QUIET 0x20000
#define H8_MANAGE_SPEEDUP 0x40000
#define H8_MANAGE_BATTERY 0x80000
#define H8_SYSTEM_DELAY_TEST 0x100000
#define H8_POWER_SWITCH_TEST 0x200000
/* cpu speeds and clock divisor values */
#define MHZ_14 5
#define MHZ_28 4
#define MHZ_57 3
#define MHZ_115 2
#define MHZ_230 0
/*
* H8 data
*/
struct h8_data {
u_int ser_num;
u_char ether_add[6];
u_short hw_ver;
u_short mic_ver;
u_short max_tmp;
u_short min_tmp;
u_short cur_tmp;
u_int sys_var;
u_int pow_on;
u_int pow_on_secs;
u_char reset_status;
u_char pwr_dn_status;
u_short event_status;
u_short rom_cksm;
u_short ext_status;
u_short u_cfg;
u_char ibatt_volt;
u_char dc_volt;
u_char ptr_horiz;
u_char ptr_vert;
u_char eeprom_status;
u_char error_status;
u_char new_busy_speed;
u_char cfg_interface;
u_short int_batt_status;
u_short ext_batt_status;
u_char pow_up_status;
u_char event_status_mask;
};
/*
* H8 command buffers
*/
typedef struct h8_cmd_q {
DLNODE(struct h8_cmd_q) link; /* double linked list */
int ncmd; /* number of bytes in command */
int nrsp; /* number of bytes in response */
int cnt; /* number of bytes sent/received */
int nacks; /* number of byte level acks */
u_char cmdbuf[H8_MAX_CMD_SIZE]; /* buffer to store command */
u_char rcvbuf[H8_MAX_CMD_SIZE]; /* buffer to store response */
} h8_cmd_q_t;
typedef struct __queue_head {
DLNODE(struct h8_cmd_q) link;
} queue_head_t;
union intr_buf {
u_char byte[2];
u_int word;
};
#endif /* __H8_H_ */
......@@ -339,13 +339,6 @@ static int mmap_zero(struct inode * inode, struct file * file, struct vm_area_st
return 0;
}
static long read_full(struct inode * node, struct file * file,
char * buf, unsigned long count)
{
file->f_pos += count;
return count;
}
static long write_full(struct inode * inode, struct file * file,
const char * buf, unsigned long count)
{
......@@ -390,7 +383,9 @@ static long long memory_lseek(struct inode * inode, struct file * file,
#define mmap_kmem mmap_mem
#define zero_lseek null_lseek
#define full_lseek null_lseek
#define write_zero write_null
#define read_full read_zero
static struct file_operations mem_fops = {
memory_lseek,
......@@ -457,7 +452,7 @@ static struct file_operations zero_fops = {
};
static struct file_operations full_fops = {
memory_lseek,
full_lseek,
read_full,
write_full,
NULL, /* full_readdir */
......
......@@ -71,10 +71,12 @@ extern int atari_mouse_init(void);
extern int sun_mouse_init(void);
extern void watchdog_init(void);
extern void wdt_init(void);
extern void acq_init(void);
extern void pcwatchdog_init(void);
extern int rtc_init(void);
extern int dsp56k_init(void);
extern int nvram_init(void);
extern void hfmodem_init(void);
#ifdef CONFIG_PROC_FS
static int misc_read_proc(char *buf, char **start, off_t offset,
......@@ -231,18 +233,27 @@ __initfunc(int misc_init(void))
#ifdef CONFIG_WDT
wdt_init();
#endif
#ifdef CONFIG_ACQUIRE_WDT
acq_init();
#endif
#ifdef CONFIG_SOFT_WATCHDOG
watchdog_init();
#endif
#ifdef CONFIG_APM
apm_bios_init();
#endif
#ifdef CONFIG_H8
h8_init();
#endif
#ifdef CONFIG_RTC
rtc_init();
#endif
#ifdef CONFIG_ATARI_DSP56K
dsp56k_init();
#endif
#ifdef CONFIG_HFMODEM
hfmodem_init();
#endif
#ifdef CONFIG_NVRAM
nvram_init();
#endif
......
......@@ -18,6 +18,8 @@
#include <linux/kernel.h>
#include <linux/malloc.h>
#include <linux/config.h>
#ifdef CONFIG_KERNELD
#include <linux/kerneld.h>
#endif
......
/* arc-rimi.c:
/* $Id: arc-rimi.c,v 1.2 1997/09/05 08:57:51 mj Exp $
Derived from the original arcnet.c,
Written 1994-1996 by Avery Pennarun,
which was in turn derived from skeleton.c by Donald Becker.
......@@ -75,38 +76,8 @@
#undef SLOW_XMIT_COPY
/* External functions from arcnet.c */
#if ARCNET_DEBUG_MAX & D_SKB
extern void arcnet_dump_skb(struct device *dev,struct sk_buff *skb,
char *desc);
#else
#define arcnet_dump_skb(dev,skb,desc) ;
#endif
#if (ARCNET_DEBUG_MAX & D_RX) || (ARCNET_DEBUG_MAX & D_TX)
extern void arcnet_dump_packet(struct device *dev,u_char *buffer,int ext,
char *desc);
#else
#define arcnet_dump_packet(dev,buffer,ext,desc) ;
#endif
extern void arcnet_tx_done(struct device *dev, struct arcnet_local *lp);
extern void arcnet_makename(char *device);
extern void arcnet_interrupt(int irq,void *dev_id,struct pt_regs *regs);
extern void arcnet_setup(struct device *dev);
extern int arcnet_go_tx(struct device *dev,int enable_irq);
extern void arcnetA_continue_tx(struct device *dev);
extern void arcnet_rx(struct arcnet_local *lp, u_char *arcsoft, short length, int saddr, int daddr);
extern void arcnet_use_count(int open);
/* Internal function declarations */
static int arcrimi_probe(struct device *dev);
static void arcrimi_rx(struct device *dev,int recbuf);
static int arcrimi_found(struct device *dev,int ioaddr,int airq,u_long shmem);
......@@ -122,7 +93,6 @@ static void arcrimi_openclose(int open);
/* Module parameters */
#ifdef MODULE
static int shmem=0x0; /* <--- EDIT THESE LINES FOR YOUR CONFIGURATION */
static int irq=0; /* or use the insmod io= irq= shmem= options */
......@@ -142,7 +112,6 @@ extern int arcnet_num_devs;
/* Handy defines for ARCnet specific stuff */
/* COM 9026 controller chip --> ARCnet register addresses */
#define _INTMASK (ioaddr+0) /* writable */
#define _STATUS (ioaddr+0) /* readable */
......@@ -155,20 +124,14 @@ extern int arcnet_num_devs;
#define RDDATAflag 0x00 /* Next access is a read/~write */
#define ARCSTATUS readb(_STATUS)
#define ACOMMAND(cmd) writeb((cmd),_COMMAND)
#define ARCRESET writeb(TESTvalue,ioaddr-0x800) /* fake reset */
#define AINTMASK(msk) writeb((msk),_INTMASK)
#define SETCONF writeb(lp->config,_CONFIG)
static const char *version =
"arc-rimi.c: v2.91 97/08/19 Avery Pennarun <apenwarr@bond.net> et al.\n";
"arc-rimi.c: v2.92 97/09/02 Avery Pennarun <apenwarr@bond.net> et al.\n";
/****************************************************************************
* *
......@@ -205,7 +168,6 @@ __initfunc(int arcrimi_probe(struct device *dev))
}
/* Set up the struct device associated with this card. Called after
* probing succeeds.
*/
......@@ -399,9 +361,6 @@ static void arcrimi_command(struct device *dev, u_char cmd)
}
/* The actual interrupt handler routine - handle various IRQ's generated
* by the card.
*/
......@@ -421,7 +380,6 @@ arcrimi_inthandler(struct device *dev)
status = ARCSTATUS;
didsomething=0;
/* RESET flag was enabled - card is resetting and if RX
* is disabled, it's NOT because we just got a packet.
*/
......@@ -435,7 +393,6 @@ arcrimi_inthandler(struct device *dev)
break;
}
/* RX is inhibited - we must have received something. */
if (status & lp->intmask & NORXflag)
{
......@@ -552,8 +509,6 @@ arcrimi_inthandler(struct device *dev)
#ifdef SHOW_RECONFIGS
BUGMSG(D_NORMAL,"Network reconfiguration detected (status=%Xh)\n",
status);
#endif /* SHOW_RECONFIGS */
#ifdef RECON_THRESHOLD
......@@ -621,11 +576,9 @@ arcrimi_inthandler(struct device *dev)
BUGMSG(D_DURING,"\n");
SETMASK; /* put back interrupt mask */
}
/* A packet has arrived; grab it from the buffers and pass it to the generic
* arcnet_rx routing to deal with it.
*/
......@@ -673,10 +626,8 @@ arcrimi_rx(struct device *dev,int recbuf)
length=512-offset;
}
arcnet_rx(lp, arcsoft, length, saddr, daddr);
BUGLVL(D_RX) arcnet_dump_packet(lp->adev,arcpacket->raw,length>240,"rx");
#ifndef SLOW_XMIT_COPY
......@@ -684,11 +635,9 @@ arcrimi_rx(struct device *dev,int recbuf)
BUGLVL(D_DURING)
memset((void *)arcpacket->raw,0x42,512);
#endif
}
/* Given an skb, copy a packet into the ARCnet buffers for later transmission
* by arcnet_go_tx.
*/
......@@ -781,7 +730,6 @@ arcrimi_prepare_tx(struct device *dev,u_char *hdr,int hdrlen,
}
/****************************************************************************
* *
* Kernel Loadable Module Support *
......@@ -856,7 +804,6 @@ void cleanup_module(void)
#else
__initfunc(void arcrimi_setup (char *str, int *ints))
{
struct device *dev;
......@@ -902,6 +849,3 @@ __initfunc(void arcrimi_setup (char *str, int *ints))
}
#endif /* MODULE */
/* arcnet.c:
/* $Id: arcnet.c,v 1.30 1997/09/05 08:57:46 mj Exp $
Written 1994-1996 by Avery Pennarun,
derived from skeleton.c by Donald Becker.
Contact Avery at: apenwarr@foxnet.net or
Contact Avery at: apenwarr@bond.net or
RR #5 Pole Line Road, Thunder Bay, ON, Canada P7C 5M9
**********************
......@@ -17,6 +18,12 @@
**********************
v2.92 ALPHA (97/02/09)
- Code cleanup [Martin Mares <mj@atrey.karlin.mff.cuni.cz>]
- Better probing for the COM90xx chipset, although only as
a temporary solution until we implement adding of all found
devices at once. [mj]
v2.91 ALPHA (97/19/08)
- Add counting of octets in/out.
......@@ -122,8 +129,9 @@
- Smarter recovery from RECON-during-transmit conditions. (ie.
retransmit immediately)
- Add support for the new 1.3.x IP header cache, and other features.
- Debug level should be changed with a system call, not a hack to
the "metric" flag.
- Replace setting of debug level with the "metric" flag hack by
something better. SIOCDEVPRIVATE is a good candidate, but it would
require an extra user-level utility.
- What about cards with shared memory that can be "turned off?"
(or that have none at all, like the SMC PC500longboard)
......@@ -154,9 +162,7 @@
*/
static const char *version =
"arcnet.c: v2.91 97/08/19 Avery Pennarun <apenwarr@bond.net> et al.\n";
"arcnet.c: v2.92 97/09/02 Avery Pennarun <apenwarr@bond.net> et al.\n";
#include <linux/module.h>
#include <linux/config.h>
......@@ -204,12 +210,10 @@ static const char *version =
* overhead in using them.
*/
#define AINTMASK(x) ((*lp->asetmask)(dev, x))
#define ARCSTATUS ((*lp->astatus)(dev))
#define ACOMMAND(x) ((*lp->acommand)(dev, x))
int arcnet_debug=ARCNET_DEBUG;
/* Exported function prototypes */
......@@ -235,7 +239,6 @@ int arcnet_go_tx(struct device *dev,int enable_irq);
void arcnet_interrupt(int irq,void *dev_id,struct pt_regs *regs);
void arcnet_rx(struct arcnet_local *lp, u_char *arcsoft, short length, int saddr, int daddr);
EXPORT_SYMBOL(arcnet_debug);
EXPORT_SYMBOL(arcnet_tx_done);
EXPORT_SYMBOL(arcnet_use_count);
......@@ -302,10 +305,6 @@ static unsigned short arcnetS_type_trans(struct sk_buff *skb,struct device *dev)
#endif
/****************************************************************************
* *
* Packet dumps for debugging *
......@@ -334,6 +333,7 @@ void arcnet_dump_skb(struct device *dev,struct sk_buff *skb,char *desc)
}
#endif
/* Dump the contents of an ARCnet buffer
*/
#if (ARCNET_DEBUG_MAX & D_RX) || (ARCNET_DEBUG_MAX & D_TX)
......@@ -357,8 +357,6 @@ void arcnet_dump_packet(struct device *dev,u_char *buffer,int ext,char *desc)
#endif
/* Setup a struct device for ARCnet. This should really be in net_init.c
* but since there are three different ARCnet devices ANYWAY... <gargle>
*
......@@ -385,7 +383,6 @@ void arcnet_setup(struct device *dev)
dev->pa_mask = 0;
dev->pa_alen = 4;
/* Put in this stuff here, so we don't have to export the symbols
* to the chipset drivers.
*/
......@@ -405,7 +402,6 @@ void arcnet_setup(struct device *dev)
* *
****************************************************************************/
/* Open/initialize the board. This is called sometime after booting when
* the 'ifconfig' program is run.
*
......@@ -432,12 +428,6 @@ arcnet_open(struct device *dev)
*/
if ((*lp->arcnet_reset)(dev,0) && (*lp->arcnet_reset)(dev,1))
return -ENODEV;
#if 0
/* reset the card twice in case something goes wrong the first time.
*/
if ((*(lp->arcnet_reset))(dev,1) && (*(lp->arcnet_reset))(dev,1))
return -ENODEV;
#endif
dev->tbusy=0;
dev->interrupt=0;
......@@ -522,7 +512,6 @@ arcnet_close(struct device *dev)
lp->edev->start=0;
#endif
/* Shut down the card */
/* Disable TX if we need to */
......@@ -546,9 +535,6 @@ arcnet_close(struct device *dev)
lp->sdev->interrupt=0;
#endif
/* do NOT free lp->adev!! It's static! */
lp->adev=NULL;
......@@ -581,7 +567,6 @@ arcnet_close(struct device *dev)
}
/****************************************************************************
* *
* Transmitter routines *
......@@ -946,7 +931,6 @@ arcnet_interrupt(int irq,void *dev_id,struct pt_regs *regs)
BUGMSG(D_DURING,"in arcnet_interrupt\n");
lp=(struct arcnet_local *)dev->priv;
/* RESET flag was enabled - if !dev->start, we must clear it right
......@@ -1344,15 +1328,12 @@ arcnetA_rx(struct device *dev,u_char *buf,
}
/****************************************************************************
* *
* Miscellaneous routines *
* *
****************************************************************************/
/* Get the current statistics. This may be called with the card open or
* closed.
*/
......@@ -1439,7 +1420,6 @@ static int arcnetA_header(struct sk_buff *skb,struct device *dev,
}
/* Rebuild the ARCnet ClientData header. This is called after an ARP
* (or in future other address resolution) has completed on this
* sk_buff. We now let ARP fill in the other fields.
......@@ -1625,13 +1605,9 @@ arcnetE_send_packet(struct sk_buff *skb, struct device *dev)
BUGMSG(D_DURING," length=%Xh, offset=%Xh\n",
length,offset);
(*lp->prepare_tx)(dev, &proto, 1, skb->data, length-1, daddr, 0,
offset);
dev_kfree_skb(skb,FREE_WRITE);
if (arcnet_go_tx(dev,1))
......@@ -1803,8 +1779,6 @@ arcnetS_rx(struct device *dev,u_char *buf,
BUGMSG(D_DURING,"it's an RFC1051 packet (length=%d)\n",
length);
{ /* was "if not split" in A protocol, S is never split */
skb = alloc_skb(length, GFP_ATOMIC);
......@@ -1966,14 +1940,13 @@ unsigned short arcnetS_type_trans(struct sk_buff *skb,struct device *dev)
#endif /* CONFIG_ARCNET_1051 */
/****************************************************************************
* *
* Kernel Loadable Module Support *
* *
****************************************************************************/
#ifdef MODULE
void cleanup_module(void)
......@@ -1999,11 +1972,11 @@ struct device arcnet_devs[MAX_ARCNET_DEVS];
int arcnet_num_devs=0;
char arcnet_dev_names[MAX_ARCNET_DEVS][10];
void arcnet_init(void)
__initfunc(void arcnet_init(void))
{
int c;
(void) init_module();
init_module();
/* Don't register_netdev here. The chain hasn't been initialised. */
......@@ -2039,14 +2012,18 @@ void arcnet_init(void)
for (c=0; c< arcnet_num_devs; c++)
if (!arcnet_dev_names[c][0])
arcnet_makename((char *)&arcnet_dev_names[c]);
}
static
#endif /* MODULE */
int init_module()
{
#if 1
#ifdef MODULE
int init_module(void)
#else
__initfunc(static int init_module(void))
#endif
{
#ifdef ALPHA_WARNING
BUGLVL(D_EXTRA)
{
printk("arcnet: ***\n");
......@@ -2058,8 +2035,7 @@ int init_module()
}
#endif
printk("%sGeneric arcnet support for Linux kernel.\n"
"Available protocols: ARCnet RFC1201"
printk("%sAvailable protocols: ARCnet RFC1201"
#ifdef CONFIG_ARCNET_ETH
", Ethernet-Encap"
#endif
......@@ -2074,50 +2050,20 @@ int init_module()
}
void arcnet_makename(char *device)
{
__u32 arcmask=0;
struct device *dev;
char *c;
int arcnum;
for (dev = dev_base; dev; dev=dev->next)
{
arcnum=0;
if (!strncmp(dev->name, "arc", 3))
{
c = &dev->name[3];
while ((*c)>='0' && (*c)<='9')
{
arcnum *= 10;
arcnum += (*(c++)-'0');
}
if (arcnum<32)
arcmask |= ((__u32)1 << arcnum);
}
}
/* arcmask now holds a mask of the first 32 arcnet names available */
if ((__u32)~arcmask)
arcnum = 0;
for (;;)
{
for (arcnum=0; arcmask&1; arcnum++, arcmask >>=1)
;
sprintf (device, "arc%d",arcnum);
}
else
{
printk (KERN_INFO "arcnet: Can't find name for device\n");
sprintf (device, "arc???");
sprintf(device, "arc%d", arcnum);
for (dev = dev_base; dev; dev=dev->next)
if (dev->name != device && !strcmp(dev->name, device))
break;
if (!dev)
return;
arcnum++;
}
}
/* com20020.c:
/* $Id: com20020.c,v 1.2 1997/09/05 08:57:50 mj Exp $
Written 1997 by David Woodhouse <dwmw2@cam.ac.uk>
Derived from the original arcnet.c,
......@@ -59,36 +60,6 @@
#include <net/arp.h>
/* External functions from arcnet.c */
#if ARCNET_DEBUG_MAX & D_SKB
extern void arcnet_dump_skb(struct device *dev,struct sk_buff *skb,
char *desc);
#else
#define arcnet_dump_skb(dev,skb,desc) ;
#endif
#if (ARCNET_DEBUG_MAX & D_RX) || (ARCNET_DEBUG_MAX & D_TX)
extern void arcnet_dump_packet(struct device *dev,u_char *buffer,int ext,
char *desc);
#else
#define arcnet_dump_packet(dev,buffer,ext,desc) ;
#endif
extern void arcnet_tx_done(struct device *dev, struct arcnet_local *lp);
extern void arcnet_makename(char *device);
extern void arcnet_interrupt(int irq,void *dev_id,struct pt_regs *regs);
extern void arcnet_setup(struct device *dev);
extern int arcnet_go_tx(struct device *dev,int enable_irq);
extern void arcnetA_continue_tx(struct device *dev);
extern void arcnet_rx(struct arcnet_local *lp, u_char *arcsoft, short length, int saddr, int daddr);
extern void arcnet_use_count(int open);
/* Internal function declarations */
static int arc20020_probe(struct device *dev);
......@@ -136,7 +107,6 @@ extern int arcnet_num_devs;
#endif
/* Handy defines for ARCnet specific stuff */
static char *clockrates[]={"2.5 Mb/s","1.25Mb/s","625 Kb/s","312.5 Kb/s",
......@@ -144,7 +114,7 @@ static char *clockrates[]={"2.5 Mb/s","1.25Mb/s","625 Kb/s","312.5 Kb/s",
"Reserved"};
/* The number of low I/O ports used by the ethercard. */
/* The number of low I/O ports used by the card. */
#define ARCNET_TOTAL_SIZE 9
#define _INTMASK (ioaddr+0) /* writable */
......@@ -156,7 +126,6 @@ static char *clockrates[]={"2.5 Mb/s","1.25Mb/s","625 Kb/s","312.5 Kb/s",
#define _ADDR_HI (ioaddr+2) /* Control registers for said */
#define _ADDR_LO (ioaddr+3)
#define RDDATAflag 0x80 /* Next access is a read/~write */
#define NEWNXTIDflag 0x02 /* ID to which token is passed has changed */
......@@ -178,7 +147,6 @@ static char *clockrates[]={"2.5 Mb/s","1.25Mb/s","625 Kb/s","312.5 Kb/s",
outb(0x18 , _CONFIG); \
}
#define ARCSTATUS inb(_STATUS)
#define ACOMMAND(cmd) outb((cmd),_COMMAND)
#define AINTMASK(msk) outb((msk),_INTMASK)
......@@ -247,7 +215,7 @@ void put_whole_buffer (struct device *dev, unsigned offset, unsigned length, cha
static const char *version =
"com20020.c: v2.91 97/08/19 Avery Pennarun <apenwarr@bond.net> et al.\n";
"com20020.c: v2.92 97/09/02 Avery Pennarun <apenwarr@bond.net> et al.\n";
/****************************************************************************
* *
......@@ -256,7 +224,6 @@ static const char *version =
****************************************************************************/
/* We cannot probe for an IO mapped card either, although we can check that
* it's where we were told it was, and even autoirq
*/
......@@ -300,15 +267,12 @@ __initfunc(int arc20020_probe(struct device *dev))
return -ENODEV;
}
BUGMSG(D_INIT_REASONS,"Status after reset: %X\n",status);
/* Enable TX */
outb(0x39,_CONFIG);
outb(inb(ioaddr+8),ioaddr+7);
ACOMMAND(CFLAGScmd|RESETclear|CONFIGclear);
BUGMSG(D_INIT_REASONS,"Status after reset acknowledged: %X\n",status);
......@@ -364,7 +328,6 @@ __initfunc(int arc20020_probe(struct device *dev))
}
/* Set up the struct device associated with this card. Called after
* probing succeeds.
*/
......@@ -385,10 +348,8 @@ __initfunc(int arc20020_found(struct device *dev,int ioaddr,int airq))
request_region(ioaddr,ARCNET_TOTAL_SIZE,"arcnet (COM20020)");
dev->base_addr=ioaddr;
dev->mem_start=dev->mem_end=dev->rmem_start=dev->rmem_end=(long)NULL;
/* Initialize the rest of the device structure. */
dev->priv = kmalloc(sizeof(struct arcnet_local), GFP_KERNEL);
......@@ -414,7 +375,6 @@ __initfunc(int arc20020_found(struct device *dev,int ioaddr,int airq))
lp->prepare_tx=arc20020_prepare_tx;
lp->inthandler=arc20020_inthandler;
dev->set_multicast_list = arc20020_set_mc_list;
/* Fill in the fields of the device structure with generic
......@@ -479,7 +439,7 @@ __initfunc(int arc20020_found(struct device *dev,int ioaddr,int airq))
/****************************************************************************
* *
* Utility routines for arcnet.c *
* Utility routines *
* *
****************************************************************************/
......@@ -595,6 +555,7 @@ static void arc20020_openclose(int open)
MOD_DEC_USE_COUNT;
}
static void arc20020_en_dis_able_TX(struct device *dev, int enable)
{
struct arcnet_local *lp=(struct arcnet_local *)dev->priv;
......@@ -612,6 +573,7 @@ static void arc20020_setmask(struct device *dev, u_char mask)
AINTMASK(mask);
}
static u_char arc20020_status(struct device *dev)
{
short ioaddr=dev->base_addr;
......@@ -619,6 +581,7 @@ static u_char arc20020_status(struct device *dev)
return ARCSTATUS;
}
static void arc20020_command(struct device *dev, u_char cmd)
{
short ioaddr=dev->base_addr;
......@@ -637,8 +600,6 @@ arc20020_inthandler(struct device *dev)
int ioaddr=dev->base_addr, status, boguscount = 3, didsomething,
dstatus;
AINTMASK(0);
BUGMSG(D_DURING,"in arc20020_inthandler (status=%Xh, intmask=%Xh)\n",
......@@ -663,7 +624,6 @@ arc20020_inthandler(struct device *dev)
break;
}
/* RX is inhibited - we must have received something. */
if (status & lp->intmask & NORXflag)
{
......@@ -679,11 +639,9 @@ arc20020_inthandler(struct device *dev)
if (lp->intx)
oldaddr=(inb(_ADDR_HI)<<8) | inb(_ADDR_LO);
/* Got a packet. */
arc20020_rx(dev,!recbuf);
if (lp->intx)
{
outb( (oldaddr >> 8), _ADDR_HI);
......@@ -798,7 +756,6 @@ arc20020_inthandler(struct device *dev)
lp->stats.tx_carrier_errors++;
#ifdef SHOW_RECONFIGS
BUGMSG(D_NORMAL,"Network reconfiguration detected (status=%Xh, diag status=%Xh, config=%X)\n",
status,dstatus,lp->config);
#endif /* SHOW_RECONFIGS */
......@@ -872,7 +829,6 @@ arc20020_inthandler(struct device *dev)
}
/* A packet has arrived; grab it from the buffers and pass it to the generic
* arcnet_rx routing to deal with it.
*/
......@@ -931,7 +887,6 @@ arc20020_rx(struct device *dev,int recbuf)
}
/* Given an skb, copy a packet into the ARCnet buffers for later transmission
* by arcnet_go_tx.
*/
......@@ -1083,6 +1038,7 @@ void cleanup_module(void)
/* Decrease use count of arcnet.o */
arcnet_use_count(0);
}
#else
__initfunc(void com20020_setup (char *str, int *ints))
......@@ -1139,6 +1095,3 @@ __initfunc(void com20020_setup (char *str, int *ints))
arcnet_num_devs++;
}
#endif /* MODULE */
/* com90io.c:
/* $Id: com90io.c,v 1.2 1997/09/05 08:57:52 mj Exp $
Written 1997 by David Woodhouse <dwmw2@cam.ac.uk>
Derived from the original arcnet.c,
Written 1994-1996 by Avery Pennarun,
which was in turn derived from skeleton.c by Donald Becker.
Contact Avery at: apenwarr@foxnet.net or
Contact Avery at: apenwarr@bond.net or
RR #5 Pole Line Road, Thunder Bay, ON, Canada P7C 5M9
**********************
......@@ -59,36 +60,6 @@
#include <net/arp.h>
/* External functions from arcnet.c */
#if ARCNET_DEBUG_MAX & D_SKB
extern void arcnet_dump_skb(struct device *dev,struct sk_buff *skb,
char *desc);
#else
#define arcnet_dump_skb(dev,skb,desc) ;
#endif
#if (ARCNET_DEBUG_MAX & D_RX) || (ARCNET_DEBUG_MAX & D_TX)
extern void arcnet_dump_packet(struct device *dev,u_char *buffer,int ext,
char *desc);
#else
#define arcnet_dump_packet(dev,buffer,ext,desc) ;
#endif
extern void arcnet_tx_done(struct device *dev, struct arcnet_local *lp);
extern void arcnet_makename(char *device);
extern void arcnet_interrupt(int irq,void *dev_id,struct pt_regs *regs);
extern void arcnet_setup(struct device *dev);
extern int arcnet_go_tx(struct device *dev,int enable_irq);
extern void arcnetA_continue_tx(struct device *dev);
extern void arcnet_rx(struct arcnet_local *lp, u_char *arcsoft, short length, int saddr, int daddr);
extern void arcnet_use_count(int open);
/* Internal function declarations */
static int arc90io_probe(struct device *dev);
......@@ -127,13 +98,12 @@ extern int arcnet_num_devs;
#endif
/* Handy defines for ARCnet specific stuff */
/* The number of low I/O ports used by the ethercard. */
/* The number of low I/O ports used by the card. */
#define ARCNET_TOTAL_SIZE 16
/* COM 9026 controller chip --> ARCnet register addresses */
/* COM 9026 controller chip --> ARCnet register addresses */
#define _INTMASK (ioaddr+0) /* writable */
#define _STATUS (ioaddr+0) /* readable */
#define _COMMAND (ioaddr+1) /* writable, returns random vals on read (?) */
......@@ -149,7 +119,6 @@ extern int arcnet_num_devs;
#define ARCRESET inb(_RESET)
#define SETCONF outb((lp->config),_CONFIG)
......@@ -217,14 +186,13 @@ void put_whole_buffer (struct device *dev, unsigned offset, unsigned length, cha
static const char *version =
"com90io.c: v2.91 97/08/19 Avery Pennarun <apenwarr@bond.net> et al.\n";
/****************************************************************************
* *
* Probe and initialization *
* *
****************************************************************************/
/* We cannot probe for an IO mapped card either, although we can check that
* it's where we were told it was, and even autoirq
*/
......@@ -268,10 +236,8 @@ __initfunc(int arc90io_probe(struct device *dev))
return -ENODEV;
}
BUGMSG(D_INIT_REASONS,"Status after reset: %X\n",status);
ACOMMAND(CFLAGScmd|RESETclear|CONFIGclear);
BUGMSG(D_INIT_REASONS,"Status after reset acknowledged: %X\n",status);
......@@ -286,7 +252,6 @@ __initfunc(int arc90io_probe(struct device *dev))
outb((0x16 | IOMAPflag) &~ENABLE16flag, _CONFIG);
/* Read first loc'n of memory */
outb(AUTOINCflag ,_ADDR_HI);
......@@ -323,7 +288,6 @@ __initfunc(int arc90io_probe(struct device *dev))
}
/* Set up the struct device associated with this card. Called after
* probing succeeds.
*/
......@@ -344,10 +308,8 @@ __initfunc(int arc90io_found(struct device *dev,int ioaddr,int airq))
request_region(ioaddr,ARCNET_TOTAL_SIZE,"arcnet (COM90xx-IO)");
dev->base_addr=ioaddr;
dev->mem_start=dev->mem_end=dev->rmem_start=dev->rmem_end=(long)NULL;
/* Initialize the rest of the device structure. */
dev->priv = kmalloc(sizeof(struct arcnet_local), GFP_KERNEL);
......@@ -372,9 +334,6 @@ __initfunc(int arc90io_found(struct device *dev,int ioaddr,int airq))
lp->prepare_tx=arc90io_prepare_tx;
lp->inthandler=arc90io_inthandler;
/* Fill in the fields of the device structure with generic
* values.
*/
......@@ -417,7 +376,7 @@ __initfunc(int arc90io_found(struct device *dev,int ioaddr,int airq))
/****************************************************************************
* *
* Utility routines for arcnet.c *
* Utility routines *
* *
****************************************************************************/
......@@ -500,7 +459,6 @@ static void arc90io_openclose(int open)
}
static void arc90io_setmask(struct device *dev, u_char mask)
{
short ioaddr=dev->base_addr;
......@@ -532,9 +490,6 @@ arc90io_inthandler(struct device *dev)
struct arcnet_local *lp=(struct arcnet_local *)dev->priv;
int ioaddr=dev->base_addr, status, boguscount = 3, didsomething;
AINTMASK(0);
BUGMSG(D_DURING,"in arc90io_inthandler (status=%Xh, intmask=%Xh)\n",
......@@ -545,7 +500,6 @@ arc90io_inthandler(struct device *dev)
status = ARCSTATUS;
didsomething=0;
/* RESET flag was enabled - card is resetting and if RX
* is disabled, it's NOT because we just got a packet.
*/
......@@ -559,7 +513,6 @@ arc90io_inthandler(struct device *dev)
break;
}
/* RX is inhibited - we must have received something. */
if (status & lp->intmask & NORXflag)
{
......@@ -679,7 +632,6 @@ arc90io_inthandler(struct device *dev)
didsomething++;
}
#ifdef DETECT_RECONFIGS
if (status & (lp->intmask) & RECONflag)
{
......@@ -687,7 +639,6 @@ arc90io_inthandler(struct device *dev)
lp->stats.tx_carrier_errors++;
#ifdef SHOW_RECONFIGS
BUGMSG(D_NORMAL,"Network reconfiguration detected"
" (status=%Xh, config=%X)\n",
status,lp->config);
......@@ -758,11 +709,9 @@ arc90io_inthandler(struct device *dev)
BUGMSG(D_DURING,"\n");
SETMASK; /* put back interrupt mask */
}
/* A packet has arrived; grab it from the buffers and pass it to the generic
* arcnet_rx routing to deal with it.
*/
......@@ -821,7 +770,6 @@ arc90io_rx(struct device *dev,int recbuf)
}
/* Given an skb, copy a packet into the ARCnet buffers for later transmission
* by arcnet_go_tx.
*/
......@@ -969,8 +917,8 @@ void cleanup_module(void)
/* Decrease use count of arcnet.o */
arcnet_use_count(0);
}
#else
#else
__initfunc(void com90io_setup (char *str, int *ints))
{
......@@ -1014,6 +962,3 @@ __initfunc(void com90io_setup (char *str, int *ints))
}
#endif /* MODULE */
This diff is collapsed.
......@@ -462,14 +462,17 @@ static void set_rx_mode(struct device *dev);
/* 'options' is used to pass a transceiver override or full-duplex flag
e.g. "options=16" for FD, "options=32" for 100mbps-only. */
static int full_duplex[] = {-1, -1, -1, -1, -1, -1, -1, -1};
#ifdef MODULE
static int options[] = {-1, -1, -1, -1, -1, -1, -1, -1};
static int debug = -1; /* The debug level */
#endif
/* A list of all installed Speedo devices, for removing the driver module. */
static struct device *root_speedo_dev = NULL;
#endif
int eepro100_init(struct device *dev)
{
int cards_found = 0;
......
......@@ -521,7 +521,7 @@ ppp_free_buf (struct ppp_buffer *ptr)
extern inline int
lock_buffer (register struct ppp_buffer *buf)
{
register int state;
register long state;
int flags;
/*
* Save the current state and if free then set it to the "busy" state
......@@ -1071,6 +1071,7 @@ ppp_tty_receive (struct tty_struct *tty, const __u8 * data,
*/
if (ppp->flags & SC_LOG_RAWIN)
ppp_print_buffer ("receive buffer", data, count);
/*
* Collect the character and error condition for the character. Set the toss
* flag for the first character error.
......@@ -1083,6 +1084,7 @@ ppp_tty_receive (struct tty_struct *tty, const __u8 * data,
ppp->toss = *flags;
++flags;
}
/*
* Set the flags for 8 data bits and no parity.
*
......@@ -1467,6 +1469,7 @@ static void ppp_doframe_lower (struct ppp *ppp, __u8 *data, int count)
{
__u16 proto = PPP_PROTOCOL (data);
ppp_proto_type *proto_ptr;
/*
* Ignore empty frames
*/
......@@ -1507,6 +1510,7 @@ ppp_doframe (struct ppp *ppp)
int addr, ctrl, proto;
int new_count;
__u8 *new_data;
/*
* If there is a pending error from the receiver then log it and discard
* the damaged frame.
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -736,4 +736,11 @@ Scsi_Host_Template driver_template = GENERIC_NCR5380;
#include <linux/module.h>
#include "scsi_module.c"
MODULE_PARM(ncr_irq, "i");
MODULE_PARM(ncr_dma, "i");
MODULE_PARM(ncr_addr, "i");
MODULE_PARM(ncr_5380, "i");
MODULE_PARM(ncr_53c400, "i");
#endif
......@@ -7,9 +7,7 @@
* Paul Mackerras, August 1996.
* Copyright (C) 1996 Paul Mackerras.
*/
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/types.h>
......
This diff is collapsed.
......@@ -37,6 +37,7 @@
#endif
#define MAX_SCSI_DEVICE_CODE 10
extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE];
extern void scsi_make_blocked_list(void);
extern volatile int in_scan_scsis;
......
......@@ -72,5 +72,7 @@ EXPORT_SYMBOL(scsi_hostlist);
EXPORT_SYMBOL(scsi_hosts);
EXPORT_SYMBOL(scsi_devicelist);
EXPORT_SYMBOL(scsi_devices);
EXPORT_SYMBOL(scsi_device_types);
#endif /* CONFIG_MODULES */
This diff is collapsed.
......@@ -11,17 +11,12 @@
* ------------------------------------------------------------------------- */
#include <linux/module.h>
#include "autofs_i.h"
#if LINUX_VERSION_CODE < kver(2,1,36)
#define __initfunc(X) X
#else
#include <linux/init.h>
#endif
#include "autofs_i.h"
static struct file_system_type autofs_fs_type = {
"autofs",
0 /* FS_NO_DCACHE doesn't work correctly */,
0,
autofs_read_super,
NULL
};
......@@ -29,11 +24,7 @@ static struct file_system_type autofs_fs_type = {
#ifdef MODULE
int init_module(void)
{
int status;
if ((status = register_filesystem(&autofs_fs_type)) == 0)
register_symtab(0);
return status;
return register_filesystem(&autofs_fs_type);
}
void cleanup_module(void)
......
......@@ -394,16 +394,9 @@ static inline int autofs_get_set_timeout(struct autofs_sb_info *sbi,
int rv;
unsigned long ntimeout;
#if LINUX_VERSION_CODE < kver(2,1,0)
if ( (rv = verify_area(VERIFY_WRITE, p, sizeof(unsigned long))) )
return rv;
ntimeout = get_user(p);
put_user(sbi->exp_timeout/HZ, p);
#else
if ( (rv = get_user(ntimeout, p)) ||
(rv = put_user(sbi->exp_timeout/HZ, p)) )
return rv;
#endif
if ( ntimeout > ULONG_MAX/HZ )
sbi->exp_timeout = 0;
......@@ -416,15 +409,7 @@ static inline int autofs_get_set_timeout(struct autofs_sb_info *sbi,
/* Return protocol version */
static inline int autofs_get_protover(int *p)
{
#if LINUX_VERSION_CODE < kver(2,1,0)
int rv;
if ( (rv = verify_area(VERIFY_WRITE, p, sizeof(int))) )
return rv;
put_user(AUTOFS_PROTO_VERSION, p);
return 0;
#else
return put_user(AUTOFS_PROTO_VERSION, p);
#endif
}
/* Perform an expiry operation */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment