Commit 770b8afb authored by Linus Torvalds's avatar Linus Torvalds

Import 1.3.42

parent a89a2558
......@@ -336,11 +336,11 @@ S: Laval, Quebec
S: Canada H7Y 1V9
N: David Gentzel
E: gentzel@nova.enet.dec.com
D: BusLogic driver and original UltraStor driver
E: gentzel@telerama.lm.com
D: Original BusLogic driver and original UltraStor driver
S: Whitfield Software Services
S: 631 Idlewood Avenue
S: Carnegie, Pennsylvania 15106-1126
S: 600 North Bell Avenue, Suite 160
S: Carnegie, Pennsylvania 15106-4304
S: USA
N: Philip Gladstone
......@@ -1077,7 +1077,8 @@ S: Germany
N: Leonard N. Zubkoff
E: lnz@dandelion.com
D: XFree86 and BusLogic driver additions
D: BusLogic SCSI driver
D: Miscellaneous kernel fixes
S: 3078 Sulphur Spring Court
S: San Jose, California 95148
S: USA
......@@ -748,14 +748,11 @@ CONFIG_SCSI_AIC7XXX
BusLogic SCSI support
CONFIG_SCSI_BUSLOGIC
This is support for the BusLogic family of SCSI host adaptors. If
it doesn't work out of the box, you may have to change some settings
in drivers/scsi/buslogic.h. Please read the SCSI-HOWTO, available
via ftp (user: anonymous) at
sunsite.unc.edu:/pub/Linux/docs/HOWTO. This driver is also available
as a module ( = code which can be inserted in and removed from the
running kernel whenever you want). If you want to compile it as a
module, say M here and read Documentation/modules.txt.
This is support for BusLogic MultiMaster SCSI Host Adaptors. Consult
the documentation in drivers/scsi/README.BusLogic for more information.
BusLogic FlashPoint SCSI Host Adapters are not supported by this driver.
If this driver does not work correctly without modification, please
consult the author. This driver is not currently available as a module.
EATA-DMA (DPT,NEC&ATT for ISA,EISA,PCI) support
CONFIG_SCSI_EATA_DMA
......
......@@ -3,9 +3,7 @@ SMP support for Linux with up to 32 processors using the Intel MP
specification.
WARNING:
This is experimental. Back up your disks first. Build only
with gcc2.5.8.
This is experimental. Back up your disks first.
To fix:
......@@ -27,4 +25,4 @@ o Distribute irq's (locking present just needs the 82489 to be asked
nicely).
o 486 startup code.
o How to handle mixed FPU/non FPU processors.
o Support 4Mb page mode again
o Support 4Mb page mode again [TESTING]
......@@ -38,14 +38,54 @@ Wed 2-Aug-95 <matti.aarnio@utu.fi>
--------------------------
8390 based Network Modules (Paul Gortmaker, Nov 12, 1995)
--------------------------
(Includes: smc-ultra, ne, wd, 3c503, hp, hp-plus, e2100 and ac3200)
The 8390 series of network drivers now support multiple card systems without
reloading the same module multiple times (memory efficient!) This is done by
specifying multiple comma separated values, such as:
insmod 3c503.o io=0x280,0x300,0x330,0x350 xcvr=0,1,0,1
The above would have the one module controlling four 3c503 cards, with card 2
and 4 using external transcievers. The "insmod" manual describes the usage
of comma separated value lists.
It is *STRONGLY RECOMMENDED* that you supply "io=" instead of autoprobing.
If an "io=" argument is not supplied, then the ISA drivers will complain
about autoprobing being not recommended, and begrudgingly autoprobe for
a *SINGLE CARD ONLY* -- if you want to use multiple cards you *have* to
supply an "io=0xNNN,0xQQQ,..." argument.
The ne module is an exception to the above. A NE2000 is essentially an
8390 chip, some bus glue and some RAM. Because of this, the ne probe is
more invasive than the rest, and so at boot we make sure the ne probe is
done last of all the 8390 cards (so that it won't trip over other 8390 based
cards) With modules we can't ensure that all other non-ne 8390 cards have
already been found. Because of this, the ne module REQUIRES an "io=0xNNN"
argument passed in via insmod. It will refuse to autoprobe.
It is also worth noting that auto-IRQ probably isn't as reliable during
the flurry of interrupt activity on a running machine. Cards such as the
ne2000 that can't get the IRQ setting from an EEPROM or configuration
register are probably best supplied with an "irq=M" argument as well.
----------------------------------------------------------------------
Card/Module List - Configurable Parameters and Default Values
----------------------------------------------------------------------
3c501.c:
io = 0x280 IO base address
irq = 5 IRQ
(Probes ports: 0x280, 0x300)
3c503.c:
io = 0x300
irq = 0
io = 0 (It will complain if you don't supply an "io=0xNNN")
irq = 0 (IRQ software selected by driver using autoIRQ)
xcvr = 0 (Use xcvr=1 to select external transceiver.)
(Probes ports: 0x300, 0x310, 0x330, 0x350, 0x250, 0x280, 0x2A0, 0x2E0)
3c505.c:
......@@ -69,8 +109,8 @@ Wed 2-Aug-95 <matti.aarnio@utu.fi>
(No public options, several other modules need this one)
ac3200.c:
io = 0
irq = 0
io = 0 (Checks 0x1000 to 0x8fff in 0x1000 intervals)
irq = 0 (Read from config register)
(EISA probing..)
apricot.c:
......@@ -101,14 +141,10 @@ atp.c: *Not modularized*
(Probes ports: 0x378, 0x278, 0x3BC;
fixed IRQs: 5 and 7 )
auto_irq.c: *Static kernel component*
de4x5.c:
io = 0x000b
irq = 10
is_not_dec = 0 -- For SMC card using DEC 21140 set this to 1
is_not_dec = 0 -- For non-DEC card using DEC 21040/21041/21140 chip, set this to 1
(EISA, and PCI probing)
de600.c:
......@@ -130,8 +166,10 @@ dummy.c:
No options
e2100.c:
io = 0x300
irq = 0
io = 0 (It will complain if you don't supply an "io=0xNNN")
irq = 0 (IRQ software selected by driver)
mem = 0 (Override default shared memory start of 0xd0000)
xcvr = 0 (Use xcvr=1 to select external transceiver.)
(Probes ports: 0x300, 0x280, 0x380, 0x220)
eepro.c:
......@@ -158,13 +196,13 @@ ewrk3.c:
0x300, 0x340, 0x360, 0x380, 0x3A0, 0x3C0)
hp-plus.c:
io = 0x200
irq = 0
io = 0 (It will complain if you don't supply an "io=0xNNN")
irq = 0 (IRQ read from configuration register)
(Probes ports: 0x200, 0x240, 0x280, 0x2C0, 0x300, 0x320, 0x340)
hp.c:
io = 0x300
irq = 0
io = 0 (It will complain if you don't supply an "io=0xNNN")
irq = 0 (IRQ software selected by driver using autoIRQ)
(Probes ports: 0x300, 0x320, 0x340, 0x280, 0x2C0, 0x200, 0x240)
hp100.c:
......@@ -184,8 +222,8 @@ lance.c: *Not modularized*
loopback.c: *Static kernel component*
ne.c:
io = 0x300
irq = 0
io = 0 (Explicitly *requires* an "io=0xNNN" value)
irq = 0 (Tries to determine configured IRQ via autoIRQ)
(Probes ports: 0x300, 0x280, 0x320, 0x340, 0x360)
net_init.c: *Static kernel component*
......@@ -225,8 +263,8 @@ slip.c:
smc-ultra.c:
io = 0x200
irq = 0
io = 0 (It will complain if you don't supply an "io=0xNNN")
irq = 0 (IRQ val. read from EEPROM)
(Probes ports: 0x200, 0x220, 0x240, 0x280, 0x300, 0x340, 0x380)
tulip.c: *Partial modularization*
......@@ -240,11 +278,12 @@ wavelan.c:
irq = 0 (Not honoured, if changed..)
wd.c:
io = 0x300
irq = 0
io = 0 (It will complain if you don't supply an "io=0xNNN")
irq = 0 (IRQ val. read from EEPROM, ancient cards use autoIRQ)
mem = 0 (Force shared-memory on address 0xC8000, or whatever..)
(Probes ports: 0x300, 0x280, 0x380, 0x240,
uses AUTOIRQ)
mem_end = 0 (Force non-std. mem. size via supplying mem_end val.)
(eg. for 32k WD8003EBT, use mem=0xd0000 mem_end=0xd8000)
(Probes ports: 0x300, 0x280, 0x380, 0x240)
znet.c: *Not modularized*
(Only one device on Zenith Z-Note (notebook?) systems,
......
VERSION = 1
PATCHLEVEL = 3
SUBLEVEL = 41
SUBLEVEL = 42
ARCH = i386
......@@ -9,8 +9,7 @@ ARCH = i386
# because it makes re-config very ugly and too many fundamental files depend
# on "CONFIG_SMP"
#
# NOTE! SMP is experimental, and gcc-2.5.8 is recommended. See the file
# Documentation/SMP.
# NOTE! SMP is experimental. See the file Documentation/SMP.txt
#
# SMP = 1
......@@ -61,6 +60,15 @@ endif
ROOT_DEV = CURRENT
#
# NFS_ROOT_NAME specifies the default name of the directory to mount
# as root via NFS, if the kernel does not get the "root=" option from
# the boot loader. The "%s" will be replaced by the IP-number of the
# local system.
#
NFS_ROOT = -DNFS_ROOT="\"/tftpboot/%s\""
#
# INSTALL_PATH specifies where to place the updated kernel and system map
# images. Uncomment if you want to place them anywhere other than root.
......@@ -126,11 +134,22 @@ endif
include arch/$(ARCH)/Makefile
ifdef SMP
.S.s:
$(CC) -D__ASSEMBLY__ -D__SMP__ -traditional -E -o $*.s $<
.S.o:
$(CC) -D__ASSEMBLY__ -D__SMP__ -traditional -c -o $*.o $<
else
.S.s:
$(CC) -D__ASSEMBLY__ -traditional -E -o $*.s $<
.S.o:
$(CC) -D__ASSEMBLY__ -traditional -c -o $*.o $<
endif
Version: dummy
@rm -f include/linux/compile.h
......@@ -200,7 +219,7 @@ init/version.o: init/version.c include/linux/compile.h
$(CC) $(CFLAGS) -DUTS_MACHINE='"$(ARCH)"' -c -o init/version.o init/version.c
init/main.o: init/main.c
$(CC) $(CFLAGS) $(PROFILING) -c -o $*.o $<
$(CC) $(CFLAGS) $(PROFILING) $(NFS_ROOT) -c -o $*.o $<
fs: dummy
$(MAKE) linuxsubdirs SUBDIRS=fs
......
......@@ -352,8 +352,39 @@ static inline void device_interrupt(int irq, int ack, struct pt_regs * regs)
static inline void isa_device_interrupt(unsigned long vector,
struct pt_regs * regs)
{
unsigned long pic;
#if defined(CONFIG_ALPHA_APECS)
# define IACK_SC APECS_IACK_SC
#elif defined(CONFIG_ALPHA_LCA)
# define IACK_SC LCA_IACK_SC
#endif
int j;
/*
* Generate a PCI interrupt acknowledge cycle. The PIC will
* respond with the interrupt vector of the highest priority
* interrupt that is pending. The PALcode sets up the
* interrupts vectors such that irq level L generates vector
* L.
*/
j = *(volatile int *) IACK_SC;
j &= 0xff;
if (j == 7) {
if (!(inb(0x20) & 0x80)) {
/* it's only a passive release... */
return;
}
}
device_interrupt(j, j, regs);
#if 0
unsigned long pic;
/*
* It seems to me that the probability of two or more *device*
* interrupts occuring at almost exactly the same time is
* pretty low. So why pay the price of checking for
* additional interrupts here if the common case can be
* handled so much easier?
*/
/*
* The first read of gives you *all* interrupting lines.
* Therefore, read the mask register and and out those lines
......@@ -369,6 +400,7 @@ static inline void isa_device_interrupt(unsigned long vector,
pic &= pic - 1;
device_interrupt(j, j, regs);
}
#endif
}
static inline void cabriolet_and_eb66p_device_interrupt(unsigned long vector,
......
......@@ -56,6 +56,10 @@ CFLAGS := $(CFLAGS) -m386
endif
endif
ifdef SMP
CFLAGS := $(CFLAGS) -D__SMP__
endif
HEAD := arch/i386/kernel/head.o
SUBDIRS := $(SUBDIRS) arch/i386/kernel arch/i386/mm arch/i386/lib
......
......@@ -15,6 +15,10 @@ ifdef CONFIG_KERNEL_ELF
CFLAGS := $(CFLAGS) -D__BFD__
endif
ifdef SMP
CFLAGS := $(CFLAGS) -D__SMP__
endif
zImage: $(CONFIGURE) bootsect setup compressed/vmlinux tools/build
ifdef CONFIG_KERNEL_ELF
$(OBJDUMP) $(OBJDUMP_FLAGS) -o $(ZIMAGE_OFFSET) compressed/vmlinux > compressed/vmlinux.out
......
......@@ -47,7 +47,7 @@ SWAP_DEV = 0
#define RAMDISK 0
#endif
#ifndef CONFIG_ROOT_RDONLY
#define CONFIG_ROOT_RDONLY 0
#define CONFIG_ROOT_RDONLY 1
#endif
! ld86 requires an entry symbol. This may as well be the usual one.
......
......@@ -11,6 +11,10 @@ OBJECTS = $(HEAD) inflate.o unzip.o misc.o
CFLAGS = -O2 -DSTDC_HEADERS
ifdef SMP
CFLAGS := $(CFLAGS) -D__SMP__
endif
ifdef CONFIG_KERNEL_ELF
TARGET=--target elf32-i386
INPUT_DATA=input_data
......@@ -22,9 +26,18 @@ all: vmlinux
vmlinux: piggy.o $(OBJECTS)
$(LD) $(ZLINKFLAGS) -o vmlinux $(OBJECTS) piggy.o
ifdef SMP
head.o: head.S $(TOPDIR)/include/linux/tasks.h
$(CC) -D__SMP__ -traditional -c head.S
else
head.o: head.S $(TOPDIR)/include/linux/tasks.h
$(CC) -traditional -c head.S
endif
ifdef CONFIG_KERNEL_ELF
# You cannot compress a file and have the kernel uncompress it, it must
......
This diff is collapsed.
......@@ -49,7 +49,7 @@ CONFIG_INET=y
#
# CONFIG_INET_PCTCP is not set
# CONFIG_INET_RARP is not set
CONFIG_INET_SNARL=y
# CONFIG_NO_PATH_MTU_DISCOVERY is not set
# CONFIG_TCP_NAGLE_OFF is not set
CONFIG_IP_NOSR=y
CONFIG_SKB_LARGE=y
......@@ -102,6 +102,7 @@ CONFIG_MSDOS_FS=y
# CONFIG_UMSDOS_FS is not set
CONFIG_PROC_FS=y
CONFIG_NFS_FS=y
# CONFIG_ROOT_NFS is not set
CONFIG_ISO9660_FS=y
# CONFIG_HPFS_FS is not set
# CONFIG_SYSV_FS is not set
......
......@@ -14,8 +14,15 @@ LD86 =ld86 -0
#.S.s:
# $(CPP) -D__ASSEMBLY__ -traditional $< -o $*.s
ifdef SMP
.S.o:
$(CC) -D__ASSEMBLY__ -D__SMP__ -traditional -c $< -o $*.o
else
.S.o:
$(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o
endif
all: kernel.o head.o
......@@ -24,12 +31,19 @@ O_OBJS := process.o signal.o entry.o traps.o irq.o vm86.o bios32.o \
ptrace.o ioport.o ldt.o setup.o time.o sys_i386.o
ifdef SMP
O_OBJS += smp.o
endif
head.o: head.S $(TOPDIR)/include/linux/tasks.h
$(CC) -D__ASSEMBLY__ -D__SMP__ -traditional -c $*.S -o $*.o
else
head.o: head.S $(TOPDIR)/include/linux/tasks.h
$(CC) -D__ASSEMBLY__ -traditional -c $*.S -o $*.o
endif
hexify:
$(HOSTCC) hexify.c -o hexify
......@@ -48,10 +62,10 @@ trampoline32.o: trampoline32.s
$(AS386) -o $@ $<
trampoline.s: trampoline.S $(CONFIGURE) $(TOPDIR)/include/linux/config.h Makefile
$(CPP) -traditional $< -o $@
$(CPP) -D__SMP__ -traditional $< -o $@
trampoline32.s: trampoline32.S $(CONFIGURE) $(TOPDIR)/include/linux/config.h Makefile
$(CPP) -traditional $< -o $@
$(CPP) -D__SMP__ -traditional $< -o $@
clean:
rm -f trampoline hexify
......
......@@ -383,6 +383,12 @@ const char *pcibios_strerror (int error)
case PCIBIOS_BAD_REGISTER_NUMBER:
return "BAD_REGISTER_NUMBER";
case PCIBIOS_SET_FAILED:
return "SET_FAILED";
case PCIBIOS_BUFFER_TOO_SMALL:
return "BUFFER_TOO_SMALL";
default:
sprintf (buf, "UNKNOWN RETURN 0x%x", error);
return buf;
......
......@@ -103,8 +103,8 @@ void setup_arch(char **cmdline_p,
if (memory_end > 16*1024*1024)
memory_end = 16*1024*1024;
#endif
if (MOUNT_ROOT_RDONLY)
root_mountflags |= MS_RDONLY;
if (!MOUNT_ROOT_RDONLY)
root_mountflags &= ~MS_RDONLY;
memory_start = (unsigned long) &_end;
init_task.mm->start_code = TASK_SIZE;
init_task.mm->end_code = TASK_SIZE + (unsigned long) &_etext;
......
......@@ -2440,14 +2440,21 @@ static int make_raw_rw_request(void)
raw_cmd->flags |= FD_RAW_READ;
COMMAND = FM_MODE(floppy,FD_READ);
} else if ((unsigned long)CURRENT->buffer < MAX_DMA_ADDRESS) {
unsigned long dma_limit;
int direct, indirect;
indirect= transfer_size(ssize,max_sector,max_buffer_sectors*2) -
sector_t;
max_size = minimum(buffer_chain_size(),
(MAX_DMA_ADDRESS -
((unsigned long) CURRENT->buffer))>>9);
/*
* Do NOT use minimum() here---MAX_DMA_ADDRESS is 64 bits wide
* on a 64 bit machine!
*/
max_size = buffer_chain_size();
dma_limit = (MAX_DMA_ADDRESS - ((unsigned long) CURRENT->buffer)) >> 9;
if ((unsigned long) max_size > dma_limit) {
max_size = dma_limit;
}
/* 64 kb boundaries */
if (CROSS_64KB(CURRENT->buffer, max_size << 9))
max_size = (K_64 - ((long) CURRENT->buffer) % K_64)>>9;
......@@ -3033,8 +3040,7 @@ static inline int set_geometry(unsigned int cmd, struct floppy_struct *g,
return -EPERM;
LOCK_FDC(drive,1);
for (cnt = 0; cnt < N_DRIVE; cnt++){
if (TYPE(drive_state[cnt].fd_device) ==
type &&
if (TYPE(drive_state[cnt].fd_device) == type &&
drive_state[cnt].fd_ref)
set_bit(drive, &fake_change);
}
......@@ -3047,7 +3053,9 @@ static inline int set_geometry(unsigned int cmd, struct floppy_struct *g,
for (cnt = 0; cnt < N_DRIVE; cnt++){
if (TYPE(drive_state[cnt].fd_device) == type &&
drive_state[cnt].fd_ref)
check_disk_change(drive_state[cnt].fd_device);
check_disk_change(
MKDEV(FLOPPY_MAJOR,
drive_state[cnt].fd_device));
}
} else {
LOCK_FDC(drive,1);
......@@ -3125,7 +3133,7 @@ static inline int normalize_0x02xx_ioctl(int *cmd, int *size)
DPRINT1("warning: obsolete ioctl 0x%x\n",ocmd);
DPRINT("please recompile your program\n");
/* these ioctls only existed
* in two (development)
* in six (development)
* kernels anyways. That's why we
* complain about these, and not about
* the much older 0x00xx ioctl's
......@@ -3206,12 +3214,12 @@ static int fd_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
return -EPERM;
/* verify writability of result, and fail early */
if (_IOC_DIR(cmd) & _IOC_WRITE)
if (_IOC_DIR(cmd) & _IOC_READ)
ECALL(verify_area(VERIFY_WRITE,(void *) param, size));
/* copyin */
CLEARSTRUCT(&inparam);
if (_IOC_DIR(cmd) & _IOC_READ)
if (_IOC_DIR(cmd) & _IOC_WRITE)
ECALL(fd_copyin((void *)param, &inparam, size))
switch (cmd) {
......@@ -3304,7 +3312,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
return -EINVAL;
}
if (_IOC_DIR(cmd) & _IOC_WRITE)
if (_IOC_DIR(cmd) & _IOC_READ)
return fd_copyout((void *)param, outparam, size);
else
return 0;
......@@ -3479,11 +3487,10 @@ static int floppy_open(struct inode * inode, struct file * filp)
}
UDRS->fd_device = MINOR(inode->i_rdev);
if (old_dev && old_dev != inode->i_rdev) {
if (old_dev != -1 && old_dev != MINOR(inode->i_rdev)) {
if (buffer_drive == drive)
buffer_track = -1;
invalidate_buffers(old_dev);
invalidate_buffers(MKDEV(FLOPPY_MAJOR,old_dev));
}
/* Allow ioctls if we have write-permissions even if read-only open */
......@@ -3831,6 +3838,7 @@ int floppy_init(void)
CLEARSTRUCT(UDRS);
CLEARSTRUCT(UDRWE);
UDRS->flags = FD_VERIFY | FD_DISK_NEWCHANGE | FD_DISK_CHANGED;
UDRS->fd_device = -1;
floppy_track_buffer = NULL;
max_buffer_sectors = 0;
}
......
......@@ -104,7 +104,7 @@ int * hardsect_size[MAX_BLKDEV] = { NULL, NULL, };
* force the transfer to start only after we have put all the requests
* on the list.
*/
static void plug_device(struct blk_dev_struct * dev, struct request * plug)
static inline void plug_device(struct blk_dev_struct * dev, struct request * plug)
{
unsigned long flags;
......@@ -121,7 +121,7 @@ static void plug_device(struct blk_dev_struct * dev, struct request * plug)
/*
* remove the plug and let it rip..
*/
static void unplug_device(struct blk_dev_struct * dev)
static inline void unplug_device(struct blk_dev_struct * dev)
{
struct request * req;
unsigned long flags;
......
......@@ -62,22 +62,11 @@
*/
#include <linux/config.h>
#ifdef MODULE
# include <linux/module.h>
#endif
#include <linux/version.h>
#include <linux/module.h>
#ifdef MODULE
# ifndef CONFIG_MODVERSIONS
char kernel_version[]= UTS_RELEASE;
# endif
#define mcd_init init_module
#else
# define MOD_INC_USE_COUNT
# define MOD_DEC_USE_COUNT
#endif
#include <linux/errno.h>
......
......@@ -37,23 +37,7 @@ static const char *mcdx_c_version
= "mcdx.c,v 1.17 1995/11/06 01:07:57 heiko Exp";
#endif
#include <linux/config.h>
#ifdef MODULE
#include <linux/module.h>
#endif
#include <linux/version.h>
#ifdef MODULE
#ifndef CONFIG_MODVERSIONS
char kernel_version[] = UTS_RELEASE;
#endif
#else
#define MOD_INC_USE_COUNT
#define MOD_DEC_USE_COUNT
#define MOD_IN_USE 1
#endif MODULE
#include <linux/errno.h>
#include <linux/signal.h>
......
static char rcsid[] =
"$Revision: 1.36.3.2 $$Date: 1995/09/08 22:07:14 $";
"$Revision: 1.36.3.4 $$Date: 1995/11/13 20:45:10 $";
/*
* linux/drivers/char/cyclades.c
*
......@@ -24,6 +24,19 @@ static char rcsid[] =
* int cy_open(struct tty_struct *tty, struct file *filp);
*
* $Log: cyclades.c,v $
* Revision 1.36.3.4 1995/11/13 20:45:10 bentson
* Changes by Corey Minyard <minyard@wf-rch.cirr.com> distributed
* in 1.3.41 kernel to remove a possible race condition, extend
* some error messages, and let the driver run as a loadable module
* Change by Alan Wendt <alan@ez0.ezlink.com> to remove a
* possible race condition.
* Change by Marcio Saito <marcio@cyclades.com> to fix PCI addressing.
*
* Revision 1.36.3.3 1995/11/13 19:44:48 bentson
* Changes by Linus Torvalds in 1.3.33 kernel distribution
* required due to reordering of driver initialization.
* Drivers are now initialized *after* memory management.
*
* Revision 1.36.3.2 1995/09/08 22:07:14 bentson
* remove printk from ISR; fix typo
*
......@@ -452,12 +465,13 @@ SP(char *data){
console_print(data);
restore_flags(flags);
}
char scrn[2];
void
CP(char data){
unsigned long flags;
char scrn[2];
save_flags(flags); cli();
scrn[0] = data;
scrn[1] = '\0';
console_print(scrn);
restore_flags(flags);
}/* CP */
......@@ -1296,8 +1310,10 @@ shutdown(struct cyclades_port * info)
*/
save_flags(flags); cli();
if (info->xmit_buf){
free_page((unsigned long) info->xmit_buf);
info->xmit_buf = 0;
unsigned long temp;
temp = info->xmit_buf;
info->xmit_buf = 0;
free_page((unsigned long) temp);
}
base_addr[CyCAR<<index] = (u_char)channel;
......@@ -2693,7 +2709,7 @@ cy_init_card(unsigned char *true_base_addr,int index)
and this must be a Cyclom-16Y, not a Cyclom-32Ye.
*/
if (chip_number == 4
&& *(true_base_addr + cy_chip_offset[0] + CyGFRCR) == 0){
&& *(true_base_addr + (cy_chip_offset[0]<<index) + (CyGFRCR<<index)) == 0){
return chip_number;
}
......
......@@ -25,6 +25,7 @@
Changelog:
Paul Gortmaker : add support for the 2nd 8kB of RAM on 16 bit cards.
Paul Gortmaker : multiple card support for module users.
*/
......@@ -182,16 +183,24 @@ el2_probe1(struct device *dev, int ioaddr)
return ENODEV;
}
if (dev == NULL)
dev = init_etherdev(0, sizeof(struct ei_device));
/* We should have a "dev" from Space.c or the static module table. */
if (dev == NULL) {
printk("3c503.c: Passed a NULL device.\n");
dev = init_etherdev(0, 0);
}
if (ei_debug && version_printed++ == 0)
printk(version);
dev->base_addr = ioaddr;
ethdev_init(dev);
printk("%s: 3c503 at i/o base %#3x, node address", dev->name, ioaddr);
/* Allocate dev->priv and fill in 8390 specific dev fields. */
if (ethdev_init(dev)) {
printk ("3c503: unable to allocate memory for dev->priv.\n");
return -ENOMEM;
}
printk("%s: 3c503 at i/o base %#3x, node ", dev->name, ioaddr);
/* Retrieve and print the ethernet address. */
for (i = 0; i < 6; i++)
......@@ -220,6 +229,7 @@ el2_probe1(struct device *dev, int ioaddr)
#else
ei_status.interface_num = dev->mem_end & 0xf;
#endif
printk(", using %sternal xcvr.\n", ei_status.interface_num == 0 ? "in" : "ex");
if ((membase_reg & 0xf0) == 0) {
dev->mem_start = 0;
......@@ -241,7 +251,7 @@ el2_probe1(struct device *dev, int ioaddr)
writel(test_val, mem_base + i);
if (readl(mem_base) != 0xba5eba5e
|| readl(mem_base + i) != test_val) {
printk(" memory failure or memory address conflict.\n");
printk("3c503.c: memory failure or memory address conflict.\n");
dev->mem_start = 0;
ei_status.name = "3c503-PIO";
break;
......@@ -292,7 +302,7 @@ el2_probe1(struct device *dev, int ioaddr)
if (dev->irq == 2)
dev->irq = 9;
else if (dev->irq > 5 && dev->irq != 9) {
printk("\n3c503: configured interrupt %d invalid, will use autoIRQ.\n",
printk("3c503: configured interrupt %d invalid, will use autoIRQ.\n",
dev->irq);
dev->irq = 0;
}
......@@ -304,7 +314,7 @@ el2_probe1(struct device *dev, int ioaddr)
dev->stop = &el2_close;
if (dev->mem_start)
printk("\n%s: %s - %dkB RAM, 8kB shared mem window at %#6lx-%#6lx.\n",
printk("%s: %s - %dkB RAM, 8kB shared mem window at %#6lx-%#6lx.\n",
dev->name, ei_status.name, (wordlength+1)<<3,
dev->mem_start, dev->mem_end-1);
......@@ -344,8 +354,11 @@ el2_open(struct device *dev)
return -EAGAIN;
}
}
el2_init_card(dev);
return ei_open(dev);
ei_open(dev);
MOD_INC_USE_COUNT;
return 0;
}
static int
......@@ -356,9 +369,8 @@ el2_close(struct device *dev)
irq2dev_map[dev->irq] = NULL;
outb(EGACFR_IRQOFF, E33G_GACFR); /* disable interrupts. */
NS8390_init(dev, 0);
dev->start = 0;
ei_close(dev);
MOD_DEC_USE_COUNT;
return 0;
}
......@@ -526,56 +538,69 @@ el2_block_input(struct device *dev, int count, struct sk_buff *skb, int ring_off
}
outb_p(ei_status.interface_num == 0 ? ECNTRL_THIN : ECNTRL_AUI, E33G_CNTRL);
}
#ifdef MODULE
static struct device el2_drv =
{"3c503", 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, el2_probe };
static struct device el2pio_drv =
{"3c503pio", 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, el2_pio_probe };
static int io = 0x300;
static int irq = 0;
static int no_pio = 1;
int init_module(void)
#ifdef MODULE
#define MAX_EL2_CARDS 4 /* Max number of EL2 cards per module */
#define NAMELEN 8 /* # of chars for storing dev->name */
static char namelist[NAMELEN * MAX_EL2_CARDS] = { 0, };
static struct device dev_el2[MAX_EL2_CARDS] = {
{
NULL, /* assign a chunk of namelist[] below */
0, 0, 0, 0,
0, 0,
0, 0, 0, NULL, NULL
},
};
static int io[MAX_EL2_CARDS] = { 0, };
static int irq[MAX_EL2_CARDS] = { 0, };
static int xcvr[MAX_EL2_CARDS] = { 0, }; /* choose int. or ext. xcvr */
/* This is set up so that only a single autoprobe takes place per call.
ISA device autoprobes on a running machine are not recommended. */
int
init_module(void)
{
int rc1, rc2;
el2_drv.base_addr = io;
el2_drv.irq = irq;
el2pio_drv.base_addr = io;
el2pio_drv.irq = irq;
if (io == 0)
printk("3c503: You should not use auto-probing with insmod!\n");
rc2 = 0;
no_pio = 1;
rc1 = register_netdev(&el2_drv);
if (rc1 != 0) {
rc2 = register_netdev(&el2pio_drv);
no_pio = 0;
int this_dev, found = 0;
for (this_dev = 0; this_dev < MAX_EL2_CARDS; this_dev++) {
struct device *dev = &dev_el2[this_dev];
dev->name = namelist+(NAMELEN*this_dev);
dev->irq = irq[this_dev];
dev->base_addr = io[this_dev];
dev->mem_end = xcvr[this_dev]; /* low 4bits = xcvr sel. */
dev->init = el2_probe;
if (io[this_dev] == 0) {
if (this_dev != 0) break; /* only autoprobe 1st one */
printk(KERN_NOTICE "3c503.c: Presently autoprobing (not recommended) for a single card.\n");
}
if (register_netdev(dev) != 0) {
printk(KERN_WARNING "3c503.c: No 3c503 card found (i/o = 0x%x).\n", io[this_dev]);
if (found != 0) return 0; /* Got at least one. */
return -ENXIO;
}
found++;
}
if (rc1 != 0 && rc2 != 0)
return -EIO;
return 0;
}
void
cleanup_module(void)
{
int ioaddr;
if (no_pio) {
ioaddr = el2_drv.base_addr;
unregister_netdev(&el2_drv);
} else {
ioaddr = el2pio_drv.base_addr;
unregister_netdev(&el2pio_drv);
int this_dev;
for (this_dev = 0; this_dev < MAX_EL2_CARDS; this_dev++) {
struct device *dev = &dev_el2[this_dev];
if (dev->priv != NULL) {
/* NB: el2_close() handles free_irq + irq2dev map */
kfree(dev->priv);
dev->priv = NULL;
release_region(dev->base_addr, EL2_IO_EXTENT);
unregister_netdev(dev);
}
}
/* If we don't do this, we can't re-insmod it later. */
release_region(ioaddr, EL2_IO_EXTENT);
}
#endif /* MODULE */
......
......@@ -55,7 +55,6 @@ static const char *version =
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include "8390.h"
......@@ -118,10 +117,11 @@ static void set_multicast_list(struct device *dev, int num_addrs, void *addrs);
int ei_open(struct device *dev)
{
struct ei_device *ei_local = (struct ei_device *) dev->priv;
if ( ! ei_local) {
printk("%s: Opening a non-existent physical device\n", dev->name);
return ENXIO;
/* This can't happen unless somebody forgot to call ethdev_init(). */
if (ei_local == NULL) {
printk(KERN_EMERG "%s: ei_open passed a non-existent device!\n", dev->name);
return -ENXIO;
}
irq2dev_map[dev->irq] = dev;
......@@ -131,6 +131,14 @@ int ei_open(struct device *dev)
return 0;
}
/* Opposite of above. Only used when "ifconfig <devname> down" is done. */
int ei_close(struct device *dev)
{
NS8390_init(dev, 0);
dev->start = 0;
return 0;
}
static int ei_start_xmit(struct sk_buff *skb, struct device *dev)
{
int e8390_base = dev->base_addr;
......@@ -603,10 +611,6 @@ int ethdev_init(struct device *dev)
ei_local->pingpong = ei_pingpong;
}
/* The open call may be overridden by the card-specific code. */
if (dev->open == NULL)
dev->open = &ei_open;
/* We should have a dev->stop entry also. */
dev->hard_start_xmit = &ei_start_xmit;
dev->get_stats = get_stats;
#ifdef HAVE_MULTICAST
......
......@@ -32,12 +32,13 @@ extern int ethif_init(struct device *dev);
extern int ethdev_init(struct device *dev);
extern void NS8390_init(struct device *dev, int startp);
extern int ei_open(struct device *dev);
extern int ei_close(struct device *dev);
extern void ei_interrupt(int irq, struct pt_regs *regs);
#ifndef HAVE_AUTOIRQ
/* From auto_irq.c */
extern struct device *irq2dev_map[16];
extern void autoirq_setup(int waittime);
extern int autoirq_setup(int waittime);
extern int autoirq_report(int waittime);
#endif
......
......@@ -10,11 +10,7 @@ tristate 'PPP (point-to-point) support' CONFIG_PPP
if [ ! "$CONFIG_PPP" = "n" ]; then
comment 'CCP compressors for PPP are only built as modules.'
fi
if [ "$CONFIG_AX25" = "y" ]; then
bool 'Z8530 SCC kiss emulation driver for AX.25' CONFIG_SCC
else
bool 'Z8530 SCC kiss emulation driver for AX.25' CONFIG_SCC
fi
bool 'Z8530 SCC kiss emulation driver for AX.25' CONFIG_SCC
tristate 'PLIP (parallel port) support' CONFIG_PLIP
tristate 'EQL (serial line load balancing) support' CONFIG_EQUALIZER
bool 'Do you want to be offered ALPHA test drivers' CONFIG_NET_ALPHA
......
......@@ -139,7 +139,7 @@ else
endif
endif
ifneq ($(CONFIG_PPP),n)
ifdef CONFIG_PPP
M_OBJS += bsd_comp.o
endif
......
......@@ -97,15 +97,21 @@ ethif_probe(struct device *dev)
#if defined(CONFIG_EL2) || defined(EL2) /* 3c503 */
&& el2_probe(dev)
#endif
#if defined(CONFIG_NE2000) || defined(NE2000)
&& ne_probe(dev)
#endif
#if defined(CONFIG_HPLAN) || defined(HPLAN)
&& hp_probe(dev)
#endif
#if defined(CONFIG_HPLAN_PLUS)
&& hp_plus_probe(dev)
#endif
#ifdef CONFIG_AC3200 /* Ansel Communications EISA 3200. */
&& ac3200_probe(dev)
#endif
#ifdef CONFIG_E2100 /* Cabletron E21xx series. */
&& e2100_probe(dev)
#endif
#if defined(CONFIG_NE2000) || defined(NE2000)
&& ne_probe(dev)
#endif
#ifdef CONFIG_AT1500
&& at1500_probe(dev)
#endif
......@@ -148,12 +154,6 @@ ethif_probe(struct device *dev)
#ifdef CONFIG_ELPLUS /* 3c505 */
&& elplus_probe(dev)
#endif
#ifdef CONFIG_AC3200 /* Ansel Communications EISA 3200. */
&& ac3200_probe(dev)
#endif
#ifdef CONFIG_E2100 /* Cabletron E21xx series. */
&& e2100_probe(dev)
#endif
#ifdef CONFIG_DE600 /* D-Link DE-600 adapter */
&& de600_probe(dev)
#endif
......
......@@ -97,13 +97,16 @@ int ac3200_probe(struct device *dev)
else if (ioaddr > 0) /* Don't probe at all. */
return ENXIO;
/* If you have a pre-pl15 machine you should delete this line. */
/* If you have a pre 0.99pl15 machine you should delete this line. */
if ( ! EISA_bus)
return ENXIO;
for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000)
for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000) {
if (check_region(ioaddr, AC_IO_EXTENT))
continue;
if (ac_probe1(ioaddr, dev) == 0)
return 0;
}
return ENODEV;
}
......@@ -138,6 +141,13 @@ static int ac_probe1(int ioaddr, struct device *dev)
return ENODEV;
}
/* We should have a "dev" from Space.c or the static module table. */
if (dev == NULL) {
printk("ac3200.c: Passed a NULL device.\n");
dev = init_etherdev(0, 0);
}
for(i = 0; i < ETHER_ADDR_LEN; i++)
dev->dev_addr[i] = inb(ioaddr + AC_SA_PROM + i);
......@@ -159,6 +169,13 @@ static int ac_probe1(int ioaddr, struct device *dev)
return EAGAIN;
}
/* Allocate dev->priv and fill in 8390 specific dev fields. */
if (ethdev_init(dev)) {
printk (" unable to allocate memory for dev->priv.\n");
free_irq(dev->irq);
return -ENOMEM;
}
request_region(ioaddr, AC_IO_EXTENT, "ac3200");
dev->base_addr = ioaddr;
......@@ -180,8 +197,6 @@ static int ac_probe1(int ioaddr, struct device *dev)
dev->mem_end = dev->rmem_end = dev->mem_start
+ (AC_STOP_PG - AC_START_PG)*256;
ethdev_init(dev);
ei_status.name = "AC3200";
ei_status.tx_start_page = AC_START_PG;
ei_status.rx_start_page = AC_START_PG + TX_PAGES;
......@@ -208,7 +223,6 @@ static int ac_probe1(int ioaddr, struct device *dev)
static int ac_open(struct device *dev)
{
int rc;
#ifdef notyet
/* Someday we may enable the IRQ and shared memory here. */
int ioaddr = dev->base_addr;
......@@ -217,8 +231,7 @@ static int ac_open(struct device *dev)
return -EAGAIN;
#endif
rc = ei_open(dev);
if (rc != 0) return rc;
ei_open(dev);
MOD_INC_USE_COUNT;
......@@ -293,7 +306,7 @@ static int ac_close_card(struct device *dev)
irq2dev_map[dev->irq] = 0;
#endif
NS8390_init(dev, 0);
ei_close(dev);
MOD_DEC_USE_COUNT;
......@@ -301,35 +314,64 @@ static int ac_close_card(struct device *dev)
}
#ifdef MODULE
static char devicename[9] = { 0, };
static struct device dev_ac3200 = {
devicename, /* device name is inserted by linux/drivers/net/net_init.c */
0, 0, 0, 0,
0, 0,
0, 0, 0, NULL, ac3200_probe };
static int io = 0;
static int irq = 0;
int init_module(void)
#define MAX_AC32_CARDS 4 /* Max number of AC32 cards per module */
#define NAMELEN 8 /* # of chars for storing dev->name */
static char namelist[NAMELEN * MAX_AC32_CARDS] = { 0, };
static struct device dev_ac32[MAX_AC32_CARDS] = {
{
NULL, /* assign a chunk of namelist[] below */
0, 0, 0, 0,
0, 0,
0, 0, 0, NULL, NULL
},
};
static int io[MAX_AC32_CARDS] = { 0, };
static int irq[MAX_AC32_CARDS] = { 0, };
static int mem[MAX_AC32_CARDS] = { 0, };
int
init_module(void)
{
dev_ac3200.base_addr = io;
dev_ac3200.irq = irq;
if (register_netdev(&dev_ac3200) != 0) {
printk("ac3200: register_netdev() returned non-zero.\n");
return -EIO;
int this_dev, found = 0;
for (this_dev = 0; this_dev < MAX_AC32_CARDS; this_dev++) {
struct device *dev = &dev_ac32[this_dev];
dev->name = namelist+(NAMELEN*this_dev);
dev->irq = irq[this_dev];
dev->base_addr = io[this_dev];
dev->mem_start = mem[this_dev]; /* Currently ignored by driver */
dev->init = ac3200_probe;
/* Default is to only install one card. */
if (io[this_dev] == 0 && this_dev != 0) break;
if (register_netdev(dev) != 0) {
printk(KERN_WARNING "ac3200.c: No ac3200 card found (i/o = 0x%x).\n", io[this_dev]);
if (found != 0) return 0; /* Got at least one. */
return -ENXIO;
}
found++;
}
return 0;
}
void
cleanup_module(void)
{
unregister_netdev(&dev_ac3200);
/* If we don't do this, we can't re-insmod it later. */
free_irq(dev_ac3200.irq);
release_region(dev_ac3200.base_addr, AC_IO_EXTENT);
int this_dev;
for (this_dev = 0; this_dev < MAX_AC32_CARDS; this_dev++) {
struct device *dev = &dev_ac32[this_dev];
if (dev->priv != NULL) {
kfree(dev->priv);
dev->priv = NULL;
/* Someday free_irq + irq2dev may be in ac_close_card() */
free_irq(dev->irq);
irq2dev_map[dev->irq] = NULL;
release_region(dev->base_addr, AC_IO_EXTENT);
unregister_netdev(dev);
}
}
}
#endif /* MODULE */
......
......@@ -139,6 +139,7 @@ int e21_probe1(struct device *dev, int ioaddr)
{
int i, status;
unsigned char *station_addr = dev->dev_addr;
static unsigned version_printed = 0;
/* First check the station address for the Ctron prefix. */
if (inb(ioaddr + E21_SAPROM + 0) != 0x00
......@@ -160,6 +161,15 @@ int e21_probe1(struct device *dev, int ioaddr)
inb(ioaddr + E21_MEDIA); /* Point to media selection. */
outb(0, ioaddr + E21_ASIC); /* and disable the secondary interface. */
if (ei_debug && version_printed++ == 0)
printk(version);
/* We should have a "dev" from Space.c or the static module table. */
if (dev == NULL) {
printk("e2100.c: Passed a NULL device.\n");
dev = init_etherdev(0, 0);
}
printk("%s: E21** at %#3x,", dev->name, ioaddr);
for (i = 0; i < 6; i++)
printk(" %02X", station_addr[i]);
......@@ -178,14 +188,18 @@ int e21_probe1(struct device *dev, int ioaddr)
} else if (dev->irq == 2) /* Fixup luser bogosity: IRQ2 is really IRQ9 */
dev->irq = 9;
/* Allocate dev->priv and fill in 8390 specific dev fields. */
if (ethdev_init(dev)) {
printk (" unable to get memory for dev->priv.\n");
return -ENOMEM;
}
/* Grab the region so we can find a different board if IRQ select fails. */
request_region(ioaddr, E21_IO_EXTENT, "e2100");
/* The 8390 is at the base address. */
dev->base_addr = ioaddr;
ethdev_init(dev);
ei_status.name = "E2100";
ei_status.word16 = 1;
ei_status.tx_start_page = E21_TX_START_PG;
......@@ -223,9 +237,6 @@ int e21_probe1(struct device *dev, int ioaddr)
printk(", IRQ %d, %s media, memory @ %#lx.\n", dev->irq,
dev->if_port ? "secondary" : "primary", dev->mem_start);
if (ei_debug > 0)
printk(version);
ei_status.reset_8390 = &e21_reset_8390;
ei_status.block_input = &e21_block_input;
ei_status.block_output = &e21_block_output;
......@@ -241,7 +252,6 @@ static int
e21_open(struct device *dev)
{
short ioaddr = dev->base_addr;
int rc;
if (request_irq(dev->irq, ei_interrupt, 0, "e2100")) {
return EBUSY;
......@@ -257,8 +267,7 @@ e21_open(struct device *dev)
inb(ioaddr + E21_MEM_BASE);
outb(0, ioaddr + E21_ASIC + ((dev->mem_start >> 17) & 7));
rc = ei_open(dev);
if (rc != 0) return rc;
ei_open(dev);
MOD_INC_USE_COUNT;
return 0;
}
......@@ -338,8 +347,8 @@ e21_close(struct device *dev)
if (ei_debug > 1)
printk("%s: Shutting down ethercard.\n", dev->name);
free_irq(dev->irq);
dev->irq = ei_status.saved_irq;
free_irq(dev->irq);
dev->irq = ei_status.saved_irq;
/* Shut off the interrupt line and secondary interface. */
inb(ioaddr + E21_IRQ_LOW);
......@@ -347,9 +356,9 @@ e21_close(struct device *dev)
inb(ioaddr + E21_IRQ_HIGH); /* High IRQ bit, and if_port. */
outb(0, ioaddr + E21_ASIC);
irq2dev_map[dev->irq] = NULL;
irq2dev_map[dev->irq] = NULL;
NS8390_init(dev, 0);
ei_close(dev);
/* Double-check that the memory has been turned off, because really
really bad things happen if it isn't. */
......@@ -365,37 +374,70 @@ struct netdev_entry e21_drv =
{"e21", e21_probe1, E21_IO_EXTENT, e21_probe_list};
#endif
#ifdef MODULE
static char devicename[9] = { 0, };
static struct device dev_e2100 = {
devicename, /* device name is inserted by linux/drivers/net/net_init.c */
0, 0, 0, 0,
0, 0,
0, 0, 0, NULL, e2100_probe };
static int io = 0x300;
static int irq = 0;
int init_module(void)
#define MAX_E21_CARDS 4 /* Max number of E21 cards per module */
#define NAMELEN 8 /* # of chars for storing dev->name */
static char namelist[NAMELEN * MAX_E21_CARDS] = { 0, };
static struct device dev_e21[MAX_E21_CARDS] = {
{
NULL, /* assign a chunk of namelist[] below */
0, 0, 0, 0,
0, 0,
0, 0, 0, NULL, NULL
},
};
static int io[MAX_E21_CARDS] = { 0, };
static int irq[MAX_E21_CARDS] = { 0, };
static int mem[MAX_E21_CARDS] = { 0, };
static int xcvr[MAX_E21_CARDS] = { 0, }; /* choose int. or ext. xcvr */
/* This is set up so that only a single autoprobe takes place per call.
ISA device autoprobes on a running machine are not recommended. */
int
init_module(void)
{
if (io == 0)
printk("e2100: You should not use auto-probing with insmod!\n");
dev_e2100.base_addr = io;
dev_e2100.irq = irq;
if (register_netdev(&dev_e2100) != 0) {
printk("e2100: register_netdev() returned non-zero.\n");
return -EIO;
int this_dev, found = 0;
for (this_dev = 0; this_dev < MAX_E21_CARDS; this_dev++) {
struct device *dev = &dev_e21[this_dev];
dev->name = namelist+(NAMELEN*this_dev);
dev->irq = irq[this_dev];
dev->base_addr = io[this_dev];
dev->mem_start = mem[this_dev];
dev->mem_end = xcvr[this_dev]; /* low 4bits = xcvr sel. */
dev->init = e2100_probe;
if (io[this_dev] == 0) {
if (this_dev != 0) break; /* only autoprobe 1st one */
printk(KERN_NOTICE "e2100.c: Presently autoprobing (not recommended) for a single card.\n");
}
if (register_netdev(dev) != 0) {
printk(KERN_WARNING "e2100.c: No E2100 card found (i/o = 0x%x).\n", io[this_dev]);
if (found != 0) return 0; /* Got at least one. */
return -ENXIO;
}
found++;
}
return 0;
}
void
cleanup_module(void)
{
unregister_netdev(&dev_e2100);
/* If we don't do this, we can't re-insmod it later. */
release_region(dev_e2100.base_addr, E21_IO_EXTENT);
int this_dev;
for (this_dev = 0; this_dev < MAX_E21_CARDS; this_dev++) {
struct device *dev = &dev_e21[this_dev];
if (dev->priv != NULL) {
/* NB: e21_close() handles free_irq + irq2dev map */
kfree(dev->priv);
dev->priv = NULL;
release_region(dev->base_addr, E21_IO_EXTENT);
unregister_netdev(dev);
}
}
}
#endif /* MODULE */
......
......@@ -150,14 +150,21 @@ int hpp_probe1(struct device *dev, int ioaddr)
unsigned char checksum = 0;
const char *name = "HP-PC-LAN+";
int mem_start;
static unsigned version_printed = 0;
/* Check for the HP+ signature, 50 48 0x 53. */
if (inw(ioaddr + HP_ID) != 0x4850
|| (inw(ioaddr + HP_PAGING) & 0xfff0) != 0x5300)
return ENODEV;
if (dev == NULL)
dev = init_etherdev(0, sizeof(struct ei_device));
/* We should have a "dev" from Space.c or the static module table. */
if (dev == NULL) {
printk("hp-plus.c: Passed a NULL device.\n");
dev = init_etherdev(0, 0);
}
if (ei_debug && version_printed++ == 0)
printk(version);
printk("%s: %s at %#3x,", dev->name, name, ioaddr);
......@@ -181,6 +188,12 @@ int hpp_probe1(struct device *dev, int ioaddr)
printk(" ID %4.4x", inw(ioaddr + 12));
}
/* Allocate dev->priv and fill in 8390 specific dev fields. */
if (ethdev_init(dev)) {
printk ("hp-plus.c: unable to allocate memory for dev->priv.\n");
return -ENOMEM;
}
/* Grab the region so we can find another board if something fails. */
request_region(ioaddr, HP_IO_EXTENT,"hp-plus");
......@@ -200,18 +213,14 @@ int hpp_probe1(struct device *dev, int ioaddr)
}
}
printk( "%s%s", KERN_INFO, version);
/* Set the wrap registers for string I/O reads. */
outw((HP_START_PG + TX_2X_PAGES) | ((HP_STOP_PG - 1) << 8), ioaddr + 14);
/* Set the base address to point to the NIC, not the "real" base! */
dev->base_addr = ioaddr + NIC_OFFSET;
ethdev_init(dev);
dev->open = &hpp_open;
dev->stop = &hpp_close;
dev->open = &hpp_open;
dev->stop = &hpp_close;
ei_status.name = name;
ei_status.word16 = 0; /* Agggghhhhh! Debug time: 2 days! */
......@@ -267,7 +276,9 @@ hpp_open(struct device *dev)
/* Select the operational page. */
outw(Perf_Page, ioaddr + HP_PAGING);
return ei_open(dev);
ei_open(dev);
MOD_INC_USE_COUNT;
return 0;
}
static int
......@@ -276,13 +287,14 @@ hpp_close(struct device *dev)
int ioaddr = dev->base_addr - NIC_OFFSET;
int option_reg = inw(ioaddr + HPP_OPTION);
free_irq(dev->irq);
irq2dev_map[dev->irq] = NULL;
NS8390_init(dev, 0);
free_irq(dev->irq);
irq2dev_map[dev->irq] = NULL;
ei_close(dev);
outw((option_reg & ~EnableIRQ) | MemDisable | NICReset | ChipReset,
ioaddr + HPP_OPTION);
return 0;
MOD_DEC_USE_COUNT;
return 0;
}
static void
......@@ -396,39 +408,67 @@ hpp_mem_block_output(struct device *dev, int count,
return;
}
#ifdef MODULE
static char devicename[9] = { 0, };
static struct device dev_hp = {
devicename, /* device name is inserted by linux/drivers/net/net_init.c */
0, 0, 0, 0,
0, 0,
0, 0, 0, NULL, hp_plus_probe };
static int io = 0x200;
static int irq = 0;
int init_module(void)
#define MAX_HPP_CARDS 4 /* Max number of HPP cards per module */
#define NAMELEN 8 /* # of chars for storing dev->name */
static char namelist[NAMELEN * MAX_HPP_CARDS] = { 0, };
static struct device dev_hpp[MAX_HPP_CARDS] = {
{
NULL, /* assign a chunk of namelist[] below */
0, 0, 0, 0,
0, 0,
0, 0, 0, NULL, NULL
},
};
static int io[MAX_HPP_CARDS] = { 0, };
static int irq[MAX_HPP_CARDS] = { 0, };
/* This is set up so that only a single autoprobe takes place per call.
ISA device autoprobes on a running machine are not recommended. */
int
init_module(void)
{
if (io == 0)
printk("HP-plus: You should not use auto-probing with insmod!\n");
dev_hp.base_addr = io;
dev_hp.irq = irq;
if (register_netdev(&dev_hp) != 0) {
printk("HP-plus: register_netdev() returned non-zero.\n");
return -EIO;
int this_dev, found = 0;
for (this_dev = 0; this_dev < MAX_HPP_CARDS; this_dev++) {
struct device *dev = &dev_hpp[this_dev];
dev->name = namelist+(NAMELEN*this_dev);
dev->irq = irq[this_dev];
dev->base_addr = io[this_dev];
dev->init = hp_plus_probe;
if (io[this_dev] == 0) {
if (this_dev != 0) break; /* only autoprobe 1st one */
printk(KERN_NOTICE "hp-plus.c: Presently autoprobing (not recommended) for a single card.\n");
}
if (register_netdev(dev) != 0) {
printk(KERN_WARNING "hp-plus.c: No HP-Plus card found (i/o = 0x%x).\n", io[this_dev]);
if (found != 0) return 0; /* Got at least one. */
return -ENXIO;
}
found++;
}
return 0;
}
void
cleanup_module(void)
{
int ioaddr = dev_hp.base_addr - NIC_OFFSET;
unregister_netdev(&dev_hp);
/* If we don't do this, we can't re-insmod it later. */
release_region(ioaddr, HP_IO_EXTENT);
int this_dev;
for (this_dev = 0; this_dev < MAX_HPP_CARDS; this_dev++) {
struct device *dev = &dev_hpp[this_dev];
if (dev->priv != NULL) {
/* NB: hpp_close() handles free_irq + irq2dev map */
int ioaddr = dev->base_addr - NIC_OFFSET;
kfree(dev->priv);
dev->priv = NULL;
release_region(ioaddr, HP_IO_EXTENT);
unregister_netdev(dev);
}
}
}
#endif /* MODULE */
......
......@@ -57,6 +57,8 @@ static unsigned int hppclan_portlist[] =
int hp_probe(struct device *dev);
int hp_probe1(struct device *dev, int ioaddr);
static int hp_open(struct device *dev);
static int hp_close(struct device *dev);
static void hp_reset_8390(struct device *dev);
static void hp_get_8390_hdr(struct device *dev, struct e8390_pkt_hdr *hdr,
int ring_page);
......@@ -106,6 +108,7 @@ int hp_probe1(struct device *dev, int ioaddr)
{
int i, board_id, wordmode;
const char *name;
static unsigned version_printed = 0;
/* Check for the HP physical address, 08 00 09 xx xx xx. */
/* This really isn't good enough: we may pick up HP LANCE boards
......@@ -126,9 +129,15 @@ int hp_probe1(struct device *dev, int ioaddr)
wordmode = 0;
}
if (dev == NULL)
dev = init_etherdev(0, sizeof(struct ei_device));
/* We should have a "dev" from Space.c or the static module table. */
if (dev == NULL) {
printk("hp.c: Passed a NULL device.\n");
dev = init_etherdev(0, 0);
}
if (ei_debug && version_printed++ == 0)
printk(version);
printk("%s: %s (ID %02x) at %#3x,", dev->name, name, board_id, ioaddr);
for(i = 0; i < ETHER_ADDR_LEN; i++)
......@@ -167,16 +176,20 @@ int hp_probe1(struct device *dev, int ioaddr)
}
}
/* Allocate dev->priv and fill in 8390 specific dev fields. */
if (ethdev_init(dev)) {
printk (" unable to get memory for dev->priv.\n");
free_irq(dev->irq);
return -ENOMEM;
}
/* Grab the region so we can find another board if something fails. */
request_region(ioaddr, HP_IO_EXTENT,"hp");
if (ei_debug > 1)
printk(version);
/* Set the base address to point to the NIC, not the "real" base! */
dev->base_addr = ioaddr + NIC_OFFSET;
ethdev_init(dev);
dev->open = &hp_open;
dev->stop = &hp_close;
ei_status.name = name;
ei_status.word16 = wordmode;
......@@ -193,6 +206,22 @@ int hp_probe1(struct device *dev, int ioaddr)
return 0;
}
static int
hp_open(struct device *dev)
{
ei_open(dev);
MOD_INC_USE_COUNT;
return 0;
}
static int
hp_close(struct device *dev)
{
ei_close(dev);
MOD_DEC_USE_COUNT;
return 0;
}
static void
hp_reset_8390(struct device *dev)
{
......@@ -348,39 +377,66 @@ hp_init_card(struct device *dev)
}
#ifdef MODULE
static char devicename[9] = { 0, };
static struct device dev_hp = {
devicename, /* device name is inserted by linux/drivers/net/net_init.c */
0, 0, 0, 0,
0, 0,
0, 0, 0, NULL, hp_probe };
static int io = 300;
static int irq = 0;
int init_module(void)
#define MAX_HP_CARDS 4 /* Max number of HP cards per module */
#define NAMELEN 8 /* # of chars for storing dev->name */
static char namelist[NAMELEN * MAX_HP_CARDS] = { 0, };
static struct device dev_hp[MAX_HP_CARDS] = {
{
NULL, /* assign a chunk of namelist[] below */
0, 0, 0, 0,
0, 0,
0, 0, 0, NULL, NULL
},
};
static int io[MAX_HP_CARDS] = { 0, };
static int irq[MAX_HP_CARDS] = { 0, };
/* This is set up so that only a single autoprobe takes place per call.
ISA device autoprobes on a running machine are not recommended. */
int
init_module(void)
{
if (io == 0)
printk("hp: You should not use auto-probing with insmod!\n");
dev_hp.base_addr = io;
dev_hp.irq = irq;
if (register_netdev(&dev_hp) != 0) {
printk("hp: register_netdev() returned non-zero.\n");
return -EIO;
int this_dev, found = 0;
for (this_dev = 0; this_dev < MAX_HP_CARDS; this_dev++) {
struct device *dev = &dev_hp[this_dev];
dev->name = namelist+(NAMELEN*this_dev);
dev->irq = irq[this_dev];
dev->base_addr = io[this_dev];
dev->init = hp_probe;
if (io[this_dev] == 0) {
if (this_dev != 0) break; /* only autoprobe 1st one */
printk(KERN_NOTICE "hp.c: Presently autoprobing (not recommended) for a single card.\n");
}
if (register_netdev(dev) != 0) {
printk(KERN_WARNING "hp.c: No HP card found (i/o = 0x%x).\n", io[this_dev]);
if (found != 0) return 0; /* Got at least one. */
return -ENXIO;
}
found++;
}
return 0;
}
void
cleanup_module(void)
{
int ioaddr = dev_hp.base_addr - NIC_OFFSET;
unregister_netdev(&dev_hp);
/* If we don't do this, we can't re-insmod it later. */
free_irq(dev_hp.irq);
release_region(ioaddr, HP_IO_EXTENT);
int this_dev;
for (this_dev = 0; this_dev < MAX_HP_CARDS; this_dev++) {
struct device *dev = &dev_hp[this_dev];
if (dev->priv != NULL) {
int ioaddr = dev->base_addr - NIC_OFFSET;
kfree(dev->priv);
dev->priv = NULL;
free_irq(dev->irq);
irq2dev_map[dev->irq] = NULL;
release_region(ioaddr, HP_IO_EXTENT);
unregister_netdev(dev);
}
}
}
#endif /* MODULE */
......
......@@ -21,6 +21,7 @@
Paul Gortmaker : use ENISR_RDC to monitor Tx PIO uploads, made
sanity checks and bad clone support optional.
Paul Gortmaker : new reset code, reset card after probe at boot.
Paul Gortmaker : multiple card support for module users.
*/
......@@ -53,6 +54,9 @@ static const char *version =
/* Do we implement the read before write bugfix ? */
/* #define NE_RW_BUGFIX */
/* Do we have a non std. amount of memory? (in units of 256 byte pages) */
/* #define PACKETBUF_MEMSIZE 0x40 */
/* ---- No user-serviceable parts below ---- */
/* A zero-terminated list of I/O addresses to be probed. */
......@@ -89,6 +93,9 @@ bad_clone_list[] = {
int ne_probe(struct device *dev);
static int ne_probe1(struct device *dev, int ioaddr);
static int ne_open(struct device *dev);
static int ne_close(struct device *dev);
static void ne_reset_8390(struct device *dev);
static void ne_get_8390_hdr(struct device *dev, struct e8390_pkt_hdr *hdr,
int ring_page);
......@@ -155,6 +162,7 @@ static int ne_probe1(struct device *dev, int ioaddr)
int start_page, stop_page;
int neX000, ctron;
int reg0 = inb_p(ioaddr);
static unsigned version_printed = 0;
if (reg0 == 0xFF)
return ENODEV;
......@@ -173,6 +181,9 @@ static int ne_probe1(struct device *dev, int ioaddr)
}
}
if (ei_debug && version_printed++ == 0)
printk(version);
printk("NE*000 ethercard probe at %#3x:", ioaddr);
/* Reset card. Who knows what dain-bramaged state it was left in. */
......@@ -236,11 +247,6 @@ static int ne_probe1(struct device *dev, int ioaddr)
stop_page = NE1SM_STOP_PG;
}
for(i = 0; i < ETHER_ADDR_LEN; i++) {
dev->dev_addr[i] = SA_prom[i];
printk(" %2.2x", SA_prom[i]);
}
neX000 = (SA_prom[14] == 0x57 && SA_prom[15] == 0x57);
ctron = (SA_prom[0] == 0x00 && SA_prom[1] == 0x00 && SA_prom[2] == 0x1d);
......@@ -248,7 +254,7 @@ static int ne_probe1(struct device *dev, int ioaddr)
if (neX000) {
name = (wordlength == 2) ? "NE2000" : "NE1000";
} else if (ctron) {
name = "Cabletron";
name = (wordlength == 2) ? "Ctron-8" : "Ctron-16";
start_page = 0x01;
stop_page = (wordlength == 2) ? 0x40 : 0x20;
} else {
......@@ -279,9 +285,11 @@ static int ne_probe1(struct device *dev, int ioaddr)
}
if (dev == NULL)
dev = init_etherdev(0, sizeof(struct ei_device));
/* We should have a "dev" from Space.c or the static module table. */
if (dev == NULL) {
printk("ne.c: Passed a NULL device.\n");
dev = init_etherdev(0, 0);
}
if (dev->irq < 2) {
autoirq_setup(0);
......@@ -297,11 +305,16 @@ static int ne_probe1(struct device *dev, int ioaddr)
/* Fixup for users that don't know that IRQ 2 is really IRQ 9,
or don't know which one to set. */
dev->irq = 9;
if (! dev->irq) {
printk(" failed to detect IRQ line.\n");
return EAGAIN;
}
/* Snarf the interrupt now. There's no point in waiting since we cannot
share and the board will usually be enabled. */
{
int irqval = request_irq (dev->irq, ei_interrupt, 0, wordlength==2 ? "ne2000":"ne1000");
int irqval = request_irq(dev->irq, ei_interrupt, 0, name);
if (irqval) {
printk (" unable to get IRQ %d (irqval=%d).\n", dev->irq, irqval);
return EAGAIN;
......@@ -310,18 +323,23 @@ static int ne_probe1(struct device *dev, int ioaddr)
dev->base_addr = ioaddr;
request_region(ioaddr, NE_IO_EXTENT, wordlength==2 ? "ne2000":"ne1000");
/* Allocate dev->priv and fill in 8390 specific dev fields. */
if (ethdev_init(dev)) {
printk (" unable to get memory for dev->priv.\n");
free_irq(dev->irq);
return -ENOMEM;
}
request_region(ioaddr, NE_IO_EXTENT, name);
for(i = 0; i < ETHER_ADDR_LEN; i++)
for(i = 0; i < ETHER_ADDR_LEN; i++) {
printk(" %2.2x", SA_prom[i]);
dev->dev_addr[i] = SA_prom[i];
}
ethdev_init(dev);
printk("\n%s: %s found at %#x, using IRQ %d.\n",
dev->name, name, ioaddr, dev->irq);
if (ei_debug > 0)
printk(version);
ei_status.name = name;
ei_status.tx_start_page = start_page;
ei_status.stop_page = stop_page;
......@@ -337,10 +355,30 @@ static int ne_probe1(struct device *dev, int ioaddr)
ei_status.block_input = &ne_block_input;
ei_status.block_output = &ne_block_output;
ei_status.get_8390_hdr = &ne_get_8390_hdr;
dev->open = &ne_open;
dev->stop = &ne_close;
NS8390_init(dev, 0);
return 0;
}
static int
ne_open(struct device *dev)
{
ei_open(dev);
MOD_INC_USE_COUNT;
return 0;
}
static int
ne_close(struct device *dev)
{
if (ei_debug > 1)
printk("%s: Shutting down ethercard.\n", dev->name);
ei_close(dev);
MOD_DEC_USE_COUNT;
return 0;
}
/* Hard reset the card. This used to pause for the same period that a
8390 reset command required, but that shouldn't be necessary. */
static void
......@@ -568,36 +606,71 @@ ne_block_output(struct device *dev, int count,
return;
}
#ifdef MODULE
static char devicename[9] = { 0, };
static struct device dev_ne2000 = {
devicename, /* device name is inserted by linux/drivers/net/net_init.c */
0, 0, 0, 0,
0, 0,
0, 0, 0, NULL, ne_probe };
#define MAX_NE_CARDS 4 /* Max number of NE cards per module */
#define NAMELEN 8 /* # of chars for storing dev->name */
static char namelist[NAMELEN * MAX_NE_CARDS] = { 0, };
static struct device dev_ne[MAX_NE_CARDS] = {
{
NULL, /* assign a chunk of namelist[] below */
0, 0, 0, 0,
0, 0,
0, 0, 0, NULL, NULL
},
};
static int io[MAX_NE_CARDS] = { 0, };
static int irq[MAX_NE_CARDS] = { 0, };
static int io = 0x300;
static int irq = 0;
/* This is set up so that no autoprobe takes place. We can't guarantee
that the ne2k probe is the last 8390 based probe to take place (as it
is at boot) and so the probe will get confused by any other 8390 cards.
ISA device autoprobes on a running machine are not recommended anyway. */
int init_module(void)
int
init_module(void)
{
if (io == 0)
printk("ne: You should not use auto-probing with insmod!\n");
dev_ne2000.base_addr = io;
dev_ne2000.irq = irq;
if (register_netdev(&dev_ne2000) != 0)
return -EIO;
int this_dev, found = 0;
for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) {
struct device *dev = &dev_ne[this_dev];
dev->name = namelist+(NAMELEN*this_dev);
dev->irq = irq[this_dev];
dev->base_addr = io[this_dev];
dev->init = ne_probe;
if (io[this_dev] == 0) {
if (this_dev != 0) break; /* only complain once */
printk(KERN_NOTICE "ne.c: Module autoprobing not allowed. Append \"io=0xNNN\" value(s).\n");
return -EPERM;
}
if (register_netdev(dev) != 0) {
printk(KERN_WARNING "ne.c: No NE*000 card found (i/o = 0x%x).\n", io[this_dev]);
if (found != 0) return 0; /* Got at least one. */
return -ENXIO;
}
found++;
}
return 0;
}
void
cleanup_module(void)
{
unregister_netdev(&dev_ne2000);
/* If we don't do this, we can't re-insmod it later. */
free_irq(dev_ne2000.irq);
release_region(dev_ne2000.base_addr, NE_IO_EXTENT);
int this_dev;
for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) {
struct device *dev = &dev_ne[this_dev];
if (dev->priv != NULL) {
kfree(dev->priv);
dev->priv = NULL;
free_irq(dev->irq);
irq2dev_map[dev->irq] = NULL;
release_region(dev->base_addr, NE_IO_EXTENT);
unregister_netdev(dev);
}
}
}
#endif /* MODULE */
......
......@@ -132,8 +132,9 @@ init_etherdev(struct device *dev, int sizeof_priv)
}
static int eth_mac_addr(struct device *dev, struct sockaddr *addr)
static int eth_mac_addr(struct device *dev, void *p)
{
struct sockaddr *addr=p;
if(dev->start)
return -EBUSY;
memcpy(dev->dev_addr, addr->sa_data,dev->addr_len);
......@@ -164,7 +165,8 @@ void ether_setup(struct device *dev)
dev->hard_header = eth_header;
dev->rebuild_header = eth_rebuild_header;
dev->set_mac_address = eth_mac_addr;
dev->header_cache = eth_header_cache;
dev->header_cache_bind = eth_header_cache_bind;
dev->header_cache_update = eth_header_cache_update;
dev->type = ARPHRD_ETHER;
dev->hard_header_len = ETH_HLEN;
......
......@@ -35,6 +35,10 @@
This driver does not support the programmed-I/O data transfer mode of
the EtherEZ. That support (if available) is smc-ez.c. Nor does it
use the non-8390-compatible "Altego" mode. (No support currently planned.)
Changelog:
Paul Gortmaker : multiple card support for module users.
*/
static const char *version =
......@@ -117,6 +121,7 @@ int ultra_probe1(struct device *dev, int ioaddr)
int checksum = 0;
const char *model_name;
unsigned char eeprom_irq = 0;
static unsigned version_printed = 0;
/* Values from various config regs. */
unsigned char num_pages, irqreg, addr;
unsigned char idreg = inb(ioaddr + 7);
......@@ -135,10 +140,14 @@ int ultra_probe1(struct device *dev, int ioaddr)
if ((checksum & 0xff) != 0xFF)
return ENODEV;
if (dev == NULL)
dev = init_etherdev(0, sizeof(struct ei_device));
if (dev == NULL) /* Still.. */
return ENOMEM; /* Out of memory ?? */
/* We should have a "dev" from Space.c or the static module table. */
if (dev == NULL) {
printk("smc-ultra.c: Passed a NULL device.\n");
dev = init_etherdev(0, 0);
}
if (ei_debug && version_printed++ == 0)
printk(version);
model_name = (idreg & 0xF0) == 0x20 ? "SMC Ultra" : "SMC EtherEZ";
......@@ -175,7 +184,12 @@ int ultra_probe1(struct device *dev, int ioaddr)
eeprom_irq = 1;
}
/* Allocate dev->priv and fill in 8390 specific dev fields. */
if (ethdev_init(dev)) {
printk (", no memory for dev->priv.\n");
return -ENOMEM;
}
/* OK, we are certain this is going to work. Setup the device. */
request_region(ioaddr, ULTRA_IO_EXTENT, model_name);
......@@ -190,8 +204,6 @@ int ultra_probe1(struct device *dev, int ioaddr)
num_pages = num_pages_tbl[(addr >> 4) & 3];
}
ethdev_init(dev);
ei_status.name = model_name;
ei_status.word16 = 1;
ei_status.tx_start_page = START_PG;
......@@ -204,8 +216,6 @@ int ultra_probe1(struct device *dev, int ioaddr)
printk(",%s IRQ %d memory %#lx-%#lx.\n", eeprom_irq ? "" : "assigned ",
dev->irq, dev->mem_start, dev->mem_end-1);
if (ei_debug > 0)
printk(version);
ei_status.reset_8390 = &ultra_reset_8390;
ei_status.block_input = &ultra_block_input;
......@@ -222,7 +232,6 @@ static int
ultra_open(struct device *dev)
{
int ioaddr = dev->base_addr - ULTRA_NIC_OFFSET; /* ASIC addr */
int rc;
if (request_irq(dev->irq, ei_interrupt, 0, ei_status.name))
return -EAGAIN;
......@@ -230,8 +239,7 @@ ultra_open(struct device *dev)
outb(ULTRA_MEMENB, ioaddr); /* Enable memory, 16 bit mode. */
outb(0x80, ioaddr + 5);
outb(0x01, ioaddr + 6); /* Enable interrupts and memory. */
rc = ei_open(dev);
if (rc != 0) return rc;
ei_open(dev);
MOD_INC_USE_COUNT;
return 0;
}
......@@ -330,39 +338,67 @@ ultra_close_card(struct device *dev)
return 0;
}
#ifdef MODULE
static char devicename[9] = { 0, };
static struct device dev_ultra = {
devicename, /* device name is inserted by linux/drivers/net/net_init.c */
0, 0, 0, 0,
0, 0,
0, 0, 0, NULL, ultra_probe };
static int io = 0x200;
static int irq = 0;
int init_module(void)
#define MAX_ULTRA_CARDS 4 /* Max number of Ultra cards per module */
#define NAMELEN 8 /* # of chars for storing dev->name */
static char namelist[NAMELEN * MAX_ULTRA_CARDS] = { 0, };
static struct device dev_ultra[MAX_ULTRA_CARDS] = {
{
NULL, /* assign a chunk of namelist[] below */
0, 0, 0, 0,
0, 0,
0, 0, 0, NULL, NULL
},
};
static int io[MAX_ULTRA_CARDS] = { 0, };
static int irq[MAX_ULTRA_CARDS] = { 0, };
/* This is set up so that only a single autoprobe takes place per call.
ISA device autoprobes on a running machine are not recommended. */
int
init_module(void)
{
if (io == 0)
printk("smc-ultra: You should not use auto-probing with insmod!\n");
dev_ultra.base_addr = io;
dev_ultra.irq = irq;
if (register_netdev(&dev_ultra) != 0) {
printk("smc-ultra: register_netdev() returned non-zero.\n");
return -EIO;
int this_dev, found = 0;
for (this_dev = 0; this_dev < MAX_ULTRA_CARDS; this_dev++) {
struct device *dev = &dev_ultra[this_dev];
dev->name = namelist+(NAMELEN*this_dev);
dev->irq = irq[this_dev];
dev->base_addr = io[this_dev];
dev->init = ultra_probe;
if (io[this_dev] == 0) {
if (this_dev != 0) break; /* only autoprobe 1st one */
printk(KERN_NOTICE "smc-ultra.c: Presently autoprobing (not recommended) for a single card.\n");
}
if (register_netdev(dev) != 0) {
printk(KERN_WARNING "smc-ultra.c: No SMC Ultra card found (i/o = 0x%x).\n", io[this_dev]);
if (found != 0) return 0; /* Got at least one. */
return -ENXIO;
}
found++;
}
return 0;
}
void
cleanup_module(void)
{
int ioaddr = dev_ultra.base_addr - ULTRA_NIC_OFFSET;
unregister_netdev(&dev_ultra);
/* If we don't do this, we can't re-insmod it later. */
release_region(ioaddr, ULTRA_IO_EXTENT);
int this_dev;
for (this_dev = 0; this_dev < MAX_ULTRA_CARDS; this_dev++) {
struct device *dev = &dev_ultra[this_dev];
if (dev->priv != NULL) {
/* NB: ultra_close_card() does free_irq + irq2dev */
int ioaddr = dev->base_addr - ULTRA_NIC_OFFSET;
kfree(dev->priv);
dev->priv = NULL;
release_region(ioaddr, ULTRA_IO_EXTENT);
unregister_netdev(dev);
}
}
}
#endif /* MODULE */
......
......@@ -88,7 +88,7 @@ int tunnel_init(struct device *dev)
dev->addr_len=0;
dev->hard_header_len=0;
dev->hard_header=NULL;
dev->header_cache=NULL;
dev->header_cache_bind=NULL;
dev->rebuild_header=NULL;
/* End of stomp 8) */
return 0;
......@@ -271,7 +271,6 @@ tunnel_get_stats(struct device *dev)
}
#ifdef MODULE
char kernel_version[] = UTS_RELEASE;
static int tunnel_probe(struct device *dev)
{
......
......@@ -18,7 +18,9 @@
Changelog:
Paul Gortmaker : multiple card support for module users
Paul Gortmaker : multiple card support for module users, support
for non-standard memory sizes.
*/
......@@ -121,8 +123,11 @@ int wd_probe1(struct device *dev, int ioaddr)
|| (checksum & 0xff) != 0xFF)
return ENODEV;
if (dev == NULL)
dev = init_etherdev(0, sizeof(struct ei_device));
/* We should have a "dev" from Space.c or the static module table. */
if (dev == NULL) {
printk("wd.c: Passed a NULL device.\n");
dev = init_etherdev(0, 0);
}
if (ei_debug && version_printed++ == 0)
printk(version);
......@@ -246,20 +251,32 @@ int wd_probe1(struct device *dev, int ioaddr)
return EAGAIN;
}
/* Allocate dev->priv and fill in 8390 specific dev fields. */
if (ethdev_init(dev)) {
printk (" unable to get memory for dev->priv.\n");
free_irq(dev->irq);
return -ENOMEM;
}
/* OK, were are certain this is going to work. Setup the device. */
request_region(ioaddr, WD_IO_EXTENT,"wd");
ethdev_init(dev);
ei_status.name = model_name;
ei_status.word16 = word16;
ei_status.tx_start_page = WD_START_PG;
ei_status.rx_start_page = WD_START_PG + TX_PAGES;
ei_status.stop_page = word16 ? WD13_STOP_PG : WD03_STOP_PG;
/* Don't map in the shared memory until the board is actually opened. */
dev->rmem_start = dev->mem_start + TX_PAGES*256;
dev->mem_end = dev->rmem_end
= dev->mem_start + (ei_status.stop_page - WD_START_PG)*256;
/* Some cards (eg WD8003EBT) can be jumpered for more (32k!) memory. */
if (dev->mem_end != 0) {
ei_status.stop_page = (dev->mem_end - dev->mem_start)/256;
} else {
ei_status.stop_page = word16 ? WD13_STOP_PG : WD03_STOP_PG;
dev->mem_end = dev->mem_start + (ei_status.stop_page - WD_START_PG)*256;
}
dev->rmem_end = dev->mem_end;
printk(" %s, IRQ %d, shared memory at %#lx-%#lx.\n",
model_name, dev->irq, dev->mem_start, dev->mem_end-1);
......@@ -286,7 +303,6 @@ static int
wd_open(struct device *dev)
{
int ioaddr = dev->base_addr - WD_NIC_OFFSET; /* WD_CMDREG */
int rc;
/* Map in the shared memory. Always set register 0 last to remain
compatible with very old boards. */
......@@ -297,8 +313,7 @@ wd_open(struct device *dev)
outb(ei_status.reg5, ioaddr+WD_CMDREG5);
outb(ei_status.reg0, ioaddr); /* WD_CMDREG */
rc = ei_open(dev);
if (rc != 0) return rc;
ei_open(dev);
MOD_INC_USE_COUNT;
return 0;
}
......@@ -392,11 +407,11 @@ wd_close_card(struct device *dev)
if (ei_debug > 1)
printk("%s: Shutting down ethercard.\n", dev->name);
NS8390_init(dev, 0);
dev->start = 0;
ei_close(dev);
/* Change from 16-bit to 8-bit shared memory so reboot works. */
outb(ei_status.reg5, wd_cmdreg + WD_CMDREG5 );
if (ei_status.word16)
outb(ei_status.reg5, wd_cmdreg + WD_CMDREG5 );
/* And disable the shared memory. */
outb(ei_status.reg0 & ~WD_MEMENB, wd_cmdreg);
......@@ -406,12 +421,12 @@ wd_close_card(struct device *dev)
return 0;
}
#ifdef MODULE
#define MAX_WD_MODS 4 /* Max number of wd modules allowed */
#define NAMELEN 9 /* # of chars for storing dev->name */
static char namelist[NAMELEN * MAX_WD_MODS] = { 0, };
static struct device dev_wd80x3[MAX_WD_MODS] = {
#define MAX_WD_CARDS 4 /* Max number of wd cards per module */
#define NAMELEN 8 /* # of chars for storing dev->name */
static char namelist[NAMELEN * MAX_WD_CARDS] = { 0, };
static struct device dev_wd[MAX_WD_CARDS] = {
{
NULL, /* assign a chunk of namelist[] below */
0, 0, 0, 0,
......@@ -420,31 +435,36 @@ static struct device dev_wd80x3[MAX_WD_MODS] = {
},
};
static int io[MAX_WD_MODS] = { 0, };
static int irq[MAX_WD_MODS] = { 0, };
static int mem[MAX_WD_MODS] = { 0, };
static int io[MAX_WD_CARDS] = { 0, };
static int irq[MAX_WD_CARDS] = { 0, };
static int mem[MAX_WD_CARDS] = { 0, };
static int mem_end[MAX_WD_CARDS] = { 0, }; /* for non std. mem size */
/* This is set up so that only a single autoprobe takes place per call.
ISA device autoprobes on a running machine are not recommended. */
int
init_module(void)
{
int this_dev;
for (this_dev = 0; this_dev < MAX_WD_MODS; this_dev++) {
dev_wd80x3[this_dev].name = namelist+(NAMELEN*this_dev);
dev_wd80x3[this_dev].irq = irq[this_dev];
dev_wd80x3[this_dev].base_addr = io[this_dev];
dev_wd80x3[this_dev].mem_start = mem[this_dev];
dev_wd80x3[this_dev].init = wd_probe;
int this_dev, found = 0;
for (this_dev = 0; this_dev < MAX_WD_CARDS; this_dev++) {
struct device *dev = &dev_wd[this_dev];
dev->name = namelist+(NAMELEN*this_dev);
dev->irq = irq[this_dev];
dev->base_addr = io[this_dev];
dev->mem_start = mem[this_dev];
dev->mem_end = mem_end[this_dev];
dev->init = wd_probe;
if (io[this_dev] == 0) {
if (this_dev != 0) break; /* only autoprobe 1st one */
printk(KERN_NOTICE "wd.c: Presently autoprobing (not recommended) for a single card.\n");
}
if (register_netdev(&dev_wd80x3[this_dev]) != 0) {
printk(KERN_WARNING "modules: No wd80x3 card found (i/o = 0x%x).\n", io[this_dev]);
return -EIO;
if (register_netdev(dev) != 0) {
printk(KERN_WARNING "wd.c: No wd80x3 card found (i/o = 0x%x).\n", io[this_dev]);
if (found != 0) return 0; /* Got at least one. */
return -ENXIO;
}
found++;
}
return 0;
......@@ -455,12 +475,16 @@ cleanup_module(void)
{
int this_dev;
for (this_dev = 0; this_dev < MAX_WD_MODS; this_dev++) {
if (dev_wd80x3[this_dev].priv != NULL) {
int ioaddr = dev_wd80x3[this_dev].base_addr - WD_NIC_OFFSET;
unregister_netdev(&dev_wd80x3[this_dev]);
free_irq(dev_wd80x3[this_dev].irq);
for (this_dev = 0; this_dev < MAX_WD_CARDS; this_dev++) {
struct device *dev = &dev_wd[this_dev];
if (dev->priv != NULL) {
int ioaddr = dev->base_addr - WD_NIC_OFFSET;
kfree(dev->priv);
dev->priv = NULL;
free_irq(dev->irq);
irq2dev_map[dev->irq] = NULL;
release_region(ioaddr, WD_IO_EXTENT);
unregister_netdev(dev);
}
}
}
......
......@@ -289,22 +289,6 @@ struct pci_dev_info *pci_lookup_dev(unsigned int vendor, unsigned int dev)
}
}
const char *pci_strbioserr (int error)
{
switch (error) {
case PCIBIOS_SUCCESSFUL: return "SUCCESSFUL";
case PCIBIOS_FUNC_NOT_SUPPORTED: return "FUNC_NOT_SUPPORTED";
case PCIBIOS_BAD_VENDOR_ID: return "SUCCESSFUL";
case PCIBIOS_DEVICE_NOT_FOUND: return "DEVICE_NOT_FOUND";
case PCIBIOS_BAD_REGISTER_NUMBER: return "BAD_REGISTER_NUMBER";
case PCIBIOS_SET_FAILED: return "SET_FAILED";
case PCIBIOS_BUFFER_TOO_SMALL: return "BUFFER_TOO_SMALL";
default: return "Unknown error status";
}
}
const char *pci_strclass (unsigned int class)
{
switch (class >> 8) {
......
......@@ -894,7 +894,7 @@ static int ncr_pci_init (Scsi_Host_Template *tpnt, int board, int chip,
&irq))) {
printk ("scsi-ncr53c7,8xx : error %s not initializing due to error reading configuration space\n"
" perhaps you specified an incorrect PCI bus, device, or function.\n"
, pci_strbioserr(error));
, pcibios_strerror(error));
return -1;
}
......
This diff is collapsed.
This diff is collapsed.
Fri Nov 10 15:29:49 1995 Leonard N. Zubkoff (lnz@dandelion.com)
* Released new BusLogic driver.
Wed Aug 9 22:37:04 1995 Andries Brouwer <aeb@cwi.nl>
As a preparation for new device code, separated the various
......
......@@ -18,7 +18,7 @@ dep_tristate 'Adaptec AHA152X support' CONFIG_SCSI_AHA152X $CONFIG_SCSI
dep_tristate 'Adaptec AHA1542 support' CONFIG_SCSI_AHA1542 $CONFIG_SCSI
dep_tristate 'Adaptec AHA1740 support' CONFIG_SCSI_AHA1740 $CONFIG_SCSI
dep_tristate 'Adaptec AHA274X/284X/294X support' CONFIG_SCSI_AIC7XXX $CONFIG_SCSI
dep_tristate 'BusLogic SCSI support' CONFIG_SCSI_BUSLOGIC $CONFIG_SCSI
bool 'BusLogic SCSI support' CONFIG_SCSI_BUSLOGIC
dep_tristate 'EATA-DMA (DPT, NEC, ATT, Olivetti) support' CONFIG_SCSI_EATA_DMA $CONFIG_SCSI
dep_tristate 'EATA-PIO (old DPT PM2001, PM2012A) support' CONFIG_SCSI_EATA_PIO $CONFIG_SCSI
dep_tristate 'UltraStor 14F/34F support' CONFIG_SCSI_U14_34F $CONFIG_SCSI
......
......@@ -113,10 +113,10 @@ else
endif
ifeq ($(CONFIG_SCSI_BUSLOGIC),y)
L_OBJS += buslogic.o
L_OBJS += BusLogic.o
else
ifeq ($(CONFIG_SCSI_BUSLOGIC),m)
M_OBJS += buslogic.o
M_OBJS += BusLogic.o
endif
endif
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -58,7 +58,7 @@
#endif
#ifdef CONFIG_SCSI_BUSLOGIC
#include "buslogic.h"
#include "BusLogic.h"
#endif
#ifdef CONFIG_SCSI_EATA_DMA
......@@ -167,7 +167,7 @@ static Scsi_Host_Template builtin_scsi_hosts[] =
#ifdef CONFIG_SCSI_AHA152X
AHA152X,
#endif
/* Buslogic must come before aha1542.c */
/* BusLogic must come before aha1542.c */
#ifdef CONFIG_SCSI_BUSLOGIC
BUSLOGIC,
#endif
......
......@@ -53,6 +53,8 @@ struct symbol_table scsi_symbol_table = {
X(scsi_ioctl),
X(print_command),
X(print_sense),
X(print_msg),
X(print_status),
X(dma_free_sectors),
X(kernel_scsi_ioctl),
X(need_isa_buffer),
......
......@@ -406,6 +406,33 @@ const char *seagate_st0x_info(struct Scsi_Host * shpnt) {
return buffer;
}
int seagate_st0x_proc_info(char *buffer, char **start, off_t offset,
int length, int hostno, int inout)
{
const char *info = seagate_st0x_info(NULL);
int len;
int pos;
int begin;
if (inout) return(-ENOSYS);
begin = 0;
strcpy(buffer,info);
strcat(buffer,"\n");
pos = len = strlen(buffer);
if (pos<offset) {
len = 0;
begin = pos;
}
*start = buffer + (offset - begin);
len -= (offset - begin);
if ( len > length ) len = length;
return(len);
}
/*
* These are our saved pointers for the outstanding command that is
* waiting for a reconnect
......
......@@ -19,6 +19,7 @@ int seagate_st0x_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
int seagate_st0x_abort(Scsi_Cmnd *);
const char *seagate_st0x_info(struct Scsi_Host *);
int seagate_st0x_reset(Scsi_Cmnd *);
int seagate_st0x_proc_info(char *,char **,off_t,int,int,int);
#ifndef NULL
#define NULL 0
......@@ -27,7 +28,7 @@ int seagate_st0x_reset(Scsi_Cmnd *);
#include <linux/kdev_t.h>
int seagate_st0x_biosparam(Disk *, kdev_t, int*);
#define SEAGATE_ST0X { NULL, NULL, NULL, NULL, \
#define SEAGATE_ST0X { NULL, NULL, NULL, seagate_st0x_proc_info, \
NULL, seagate_st0x_detect, \
NULL, \
seagate_st0x_info, seagate_st0x_command, \
......
......@@ -15,6 +15,9 @@ fi
bool '/proc filesystem support' CONFIG_PROC_FS
if [ "$CONFIG_INET" = "y" ]; then
tristate 'NFS filesystem support' CONFIG_NFS_FS
if [ "$CONFIG_NFS_FS" = "y" ]; then
bool 'Root file system on NFS' CONFIG_ROOT_NFS
fi
fi
tristate 'ISO9660 cdrom filesystem support' CONFIG_ISO9660_FS
tristate 'OS/2 HPFS filesystem support (read only)' CONFIG_HPFS_FS
......
This diff is collapsed.
......@@ -428,7 +428,7 @@ static inline void insert_into_queues(struct buffer_head * bh)
bh->b_next->b_prev = bh;
}
static struct buffer_head * find_buffer(kdev_t dev, int block, int size)
static inline struct buffer_head * find_buffer(kdev_t dev, int block, int size)
{
struct buffer_head * tmp;
......@@ -807,10 +807,8 @@ void refile_buffer(struct buffer_head * buf)
/*
* Release a buffer head
*/
void brelse(struct buffer_head * buf)
void __brelse(struct buffer_head * buf)
{
if (!buf)
return;
wait_on_buffer(buf);
/* If dirty, mark the time this buffer should be written back */
......@@ -828,10 +826,8 @@ void brelse(struct buffer_head * buf)
/*
* bforget() is like brelse(), except is throws the buffer away
*/
void bforget(struct buffer_head * buf)
void __bforget(struct buffer_head * buf)
{
if (!buf)
return;
wait_on_buffer(buf);
if (buf->b_count != 1) {
printk("Aieee... bforget(): count = %d\n", buf->b_count);
......@@ -1044,7 +1040,7 @@ static void read_buffers(struct buffer_head * bh[], int nrbuf)
* "address" points to the new page we can use to move things
* around..
*/
static unsigned long try_to_align(struct buffer_head ** bh, int nrbuf,
static inline unsigned long try_to_align(struct buffer_head ** bh, int nrbuf,
unsigned long address)
{
while (nrbuf-- > 0)
......
......@@ -130,7 +130,7 @@ static inline void add_hash(struct dir_cache_entry * de, struct hash_list * hash
/*
* Find a directory cache entry given all the necessary info.
*/
static struct dir_cache_entry * find_entry(struct inode * dir, const char * name, int len, struct hash_list * hash)
static inline struct dir_cache_entry * find_entry(struct inode * dir, const char * name, int len, struct hash_list * hash)
{
struct dir_cache_entry * de = hash->next;
......
......@@ -953,12 +953,22 @@ static int load_aout_library(int fd)
file = current->files->fd[fd];
inode = file->f_inode;
set_fs(KERNEL_DS);
if (file->f_op->read(inode, file, (char *) &ex, sizeof(ex)) != sizeof(ex)) {
if (!file || !file->f_op)
return -EACCES;
}
/* Seek into the file */
if (file->f_op->lseek) {
if ((error = file->f_op->lseek(inode, file, 0, 0)) != 0)
return -ENOEXEC;
} else
file->f_pos = 0;
set_fs(KERNEL_DS);
error = file->f_op->read(inode, file, (char *) &ex, sizeof(ex));
set_fs(USER_DS);
if (error != sizeof(ex))
return -ENOEXEC;
/* We come in here for the regular a.out style of shared libraries */
if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != QMAGIC) || N_TRSIZE(ex) ||
N_DRSIZE(ex) || ((ex.a_entry & 0xfff) && N_MAGIC(ex) == ZMAGIC) ||
......
......@@ -171,7 +171,7 @@ void ext_statfs (struct super_block *sb, struct statfs *buf, int bufsiz)
#define inode_bmap(inode,nr) ((inode)->u.ext_i.i_data[(nr)])
static int block_bmap(struct buffer_head * bh, int nr)
static inline int block_bmap(struct buffer_head * bh, int nr)
{
int tmp;
......
......@@ -17,7 +17,7 @@ extern int fcntl_getlk(unsigned int, struct flock *);
extern int fcntl_setlk(unsigned int, unsigned int, struct flock *);
extern int sock_fcntl (struct file *, unsigned int cmd, unsigned long arg);
static int dupfd(unsigned int fd, unsigned int arg)
static inline int dupfd(unsigned int fd, unsigned int arg)
{
if (fd >= NR_OPEN || !current->files->fd[fd])
return -EBADF;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -9,6 +9,11 @@
O_TARGET := nfs.o
O_OBJS := proc.o sock.o rpcsock.o inode.o file.o dir.o symlink.o mmap.o
ifdef CONFIG_ROOT_NFS
O_OBJS += nfsroot.o
endif
M_OBJS := $(O_TARGET)
include $(TOPDIR)/Rules.make
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.
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