summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2003-01-05 15:24:42 +1100
committerPaul Mackerras <paulus@samba.org>2003-01-05 15:24:42 +1100
commit62b0c735efc55f48f67798eae3fb225efd3fcccf (patch)
tree366c3b6a6cc2be368895bbcdfa1507eadc28fe0c
parent287580bb9ca0672a06181c6c75685b3bf2d36c9a (diff)
parent6b4e1e926ae0ee936914e4fd729382af433938fb (diff)
Merge samba.org:/home/paulus/kernel/linux-2.5
into samba.org:/home/paulus/kernel/for-linus-ppc
-rw-r--r--arch/alpha/Kconfig54
-rw-r--r--arch/alpha/Makefile96
-rw-r--r--arch/alpha/boot/Makefile121
-rw-r--r--arch/alpha/kernel/Makefile124
-rw-r--r--arch/alpha/kernel/alpha_ksyms.c2
-rw-r--r--arch/alpha/kernel/irq_i8259.c4
-rw-r--r--arch/alpha/kernel/sys_alcor.c8
-rw-r--r--arch/alpha/lib/Makefile71
-rw-r--r--arch/alpha/math-emu/Makefile2
-rw-r--r--arch/arm/Kconfig39
-rw-r--r--arch/cris/Kconfig41
-rw-r--r--arch/i386/Kconfig41
-rw-r--r--arch/i386/kernel/smpboot.c7
-rw-r--r--arch/ia64/Kconfig38
-rw-r--r--arch/ia64/ia32/sys_ia32.c36
-rw-r--r--arch/m68k/Kconfig490
-rw-r--r--arch/m68knommu/Kconfig41
-rw-r--r--arch/mips/Kconfig41
-rw-r--r--arch/mips64/Kconfig41
-rw-r--r--arch/parisc/Kconfig40
-rw-r--r--arch/ppc/Kconfig41
-rw-r--r--arch/ppc64/Kconfig41
-rw-r--r--arch/ppc64/kernel/sys_ppc32.c28
-rw-r--r--arch/s390x/kernel/linux32.c30
-rw-r--r--arch/s390x/kernel/linux32.h9
-rw-r--r--arch/sh/Kconfig42
-rw-r--r--arch/sparc/Kconfig390
-rw-r--r--arch/sparc/Makefile21
-rw-r--r--arch/sparc/boot/Makefile53
-rw-r--r--arch/sparc/kernel/Makefile6
-rw-r--r--arch/sparc/kernel/sparc_ksyms.c11
-rw-r--r--arch/sparc/kernel/sun4c_irq.c13
-rw-r--r--arch/sparc/kernel/sun4d_irq.c10
-rw-r--r--arch/sparc/kernel/sun4m_irq.c13
-rw-r--r--arch/sparc64/Kconfig43
-rw-r--r--arch/sparc64/Makefile5
-rw-r--r--arch/sparc64/kernel/sys_sparc32.c28
-rw-r--r--arch/v850/Kconfig41
-rw-r--r--arch/x86_64/Kconfig43
-rw-r--r--arch/x86_64/ia32/sys_ia32.c28
-rw-r--r--drivers/char/agp/Kconfig10
-rw-r--r--drivers/char/agp/Makefile1
-rw-r--r--drivers/char/agp/agp.h7
-rw-r--r--drivers/char/agp/amd-k8-agp.c9
-rw-r--r--drivers/char/agp/backend.c2
-rw-r--r--drivers/char/agp/frontend.c3
-rw-r--r--drivers/char/agp/generic-3.0.c21
-rw-r--r--drivers/char/agp/generic.c38
-rw-r--r--drivers/char/agp/intel-agp.c4
-rw-r--r--drivers/char/agp/via-agp.c59
-rw-r--r--drivers/char/agp/via-kt400.c199
-rw-r--r--drivers/net/Kconfig235
-rw-r--r--drivers/net/Makefile1
-rw-r--r--drivers/net/Makefile.lib1
-rwxr-xr-xdrivers/net/amd8111e.c1651
-rwxr-xr-xdrivers/net/amd8111e.h786
-rw-r--r--drivers/net/arcnet/Kconfig2
-rw-r--r--drivers/net/e100/e100.h13
-rw-r--r--drivers/net/e100/e100_config.c16
-rw-r--r--drivers/net/e100/e100_main.c371
-rw-r--r--drivers/net/e100/e100_test.c26
-rw-r--r--drivers/net/e1000/e1000.h1
-rw-r--r--drivers/net/e1000/e1000_ethtool.c22
-rw-r--r--drivers/net/e1000/e1000_main.c83
-rw-r--r--drivers/net/e1000/e1000_osdep.h2
-rw-r--r--drivers/net/e1000/e1000_param.c25
-rw-r--r--drivers/net/e1000/e1000_proc.c24
-rw-r--r--drivers/net/eepro100.c1
-rw-r--r--drivers/net/irda/ali-ircc.c7
-rw-r--r--drivers/net/irda/donauboe.c7
-rw-r--r--drivers/net/irda/irda-usb.c6
-rw-r--r--drivers/net/irda/nsc-ircc.c7
-rw-r--r--drivers/net/irda/w83977af_ir.c7
-rw-r--r--drivers/net/mii.c8
-rw-r--r--drivers/net/natsemi.c44
-rw-r--r--drivers/net/sunlance.c1
-rw-r--r--drivers/net/tokenring/Kconfig2
-rw-r--r--drivers/net/tulip/de4x5.c1
-rw-r--r--drivers/net/wireless/Kconfig6
-rw-r--r--drivers/sbus/sbus.c73
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_osm.h1
-rw-r--r--drivers/scsi/pcmcia/Makefile20
-rw-r--r--drivers/scsi/pcmcia/aha152x_core.c3
-rw-r--r--drivers/scsi/pcmcia/aha152x_stub.c10
-rw-r--r--drivers/scsi/pcmcia/fdomain_core.c2
-rw-r--r--drivers/scsi/pcmcia/fdomain_stub.c7
-rw-r--r--drivers/scsi/pcmcia/nsp_cs.c4
-rw-r--r--drivers/scsi/pcmcia/nsp_cs.h2
-rw-r--r--drivers/scsi/pcmcia/qlogic_core.c2
-rw-r--r--drivers/scsi/pcmcia/qlogic_stub.c6
-rw-r--r--drivers/usb/core/hcd.c1
-rw-r--r--drivers/usb/host/ohci-dbg.c2
-rw-r--r--fs/compat.c31
-rw-r--r--fs/hugetlbfs/inode.c1
-rw-r--r--fs/nfs/nfs4xdr.c2
-rw-r--r--include/asm-alpha/irq.h1
-rw-r--r--include/asm-i386/io_apic.h3
-rw-r--r--include/asm-ia64/compat.h8
-rw-r--r--include/asm-ia64/ia32.h9
-rw-r--r--include/asm-ppc64/compat.h9
-rw-r--r--include/asm-ppc64/ppc32.h9
-rw-r--r--include/asm-s390x/compat.h9
-rw-r--r--include/asm-sparc/bitops.h3
-rw-r--r--include/asm-sparc/ide.h4
-rw-r--r--include/asm-sparc/sbus.h11
-rw-r--r--include/asm-sparc/system.h1
-rw-r--r--include/asm-sparc/thread_info.h2
-rw-r--r--include/asm-sparc64/compat.h9
-rw-r--r--include/asm-sparc64/fcntl.h11
-rw-r--r--include/asm-sparc64/ide.h4
-rw-r--r--include/asm-sparc64/smp.h4
-rw-r--r--include/asm-x86_64/compat.h8
-rw-r--r--include/asm-x86_64/ia32.h10
-rw-r--r--include/linux/agp_backend.h2
-rw-r--r--include/linux/compat.h7
-rw-r--r--include/linux/crc32.h12
-rw-r--r--include/linux/pci_ids.h1
-rw-r--r--init/Kconfig16
-rw-r--r--kernel/module.c22
-rw-r--r--lib/crc32.c21
-rw-r--r--net/Kconfig21
-rw-r--r--sound/oss/cmpci.c5
-rw-r--r--sound/oss/es1370.c9
-rw-r--r--sound/oss/es1371.c9
-rw-r--r--sound/oss/esssolo1.c7
-rw-r--r--sound/oss/sonicvibes.c9
126 files changed, 3860 insertions, 2505 deletions
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index 33175c774128..e01bb0f3cfd0 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -7,9 +7,8 @@ config ALPHA
default y
help
The Alpha is a 64-bit general-purpose processor designed and
- marketed by the Digital Equipment Corporation of blessed memory, now
- Compaq. Alpha Linux dates from 1995-1996 and was the first non-x86
- port. The Alpha Linux project has a home page at
+ marketed by the Digital Equipment Corporation of blessed memory,
+ now Hewlett-Packard. The Alpha Linux project has a home page at
<http://www.alphalinux.org/>.
config MMU
@@ -42,9 +41,6 @@ menu "System setup"
choice
prompt "Alpha system type"
default ALPHA_GENERIC
-
-config ALPHA_GENERIC
- bool "Generic"
---help---
This is the system type of your hardware. A "generic" kernel will
run on any supported Alpha system. However, if you configure a
@@ -84,6 +80,11 @@ config ALPHA_GENERIC
If you don't know what to do, choose "generic".
+config ALPHA_GENERIC
+ bool "Generic"
+ help
+ A generic kernel will run on all supported Alpha hardware.
+
config ALPHA_ALCOR
bool "Alcor/Alpha-XLT"
help
@@ -810,47 +811,6 @@ source "drivers/ieee1394/Kconfig"
source "net/Kconfig"
-
-menu "Network device support"
- depends on NET
-
-config NETDEVICES
- bool "Network device support"
- ---help---
- You can say N here if you don't intend to connect your Linux box to
- any other computer at all or if all your connections will be over a
- telephone line with a modem either via UUCP (UUCP is a protocol to
- forward mail and news between unix hosts over telephone lines; read
- the UUCP-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>) or dialing up a shell
- account or a BBS, even using term (term is a program which gives you
- almost full Internet connectivity if you have a regular dial up
- shell account on some Internet connected Unix computer. Read
- <http://www.bart.nl/~patrickr/term-howto/Term-HOWTO.html>).
-
- You'll have to say Y if your computer contains a network card that
- you want to use under Linux (make sure you know its name because you
- will be asked for it and read the Ethernet-HOWTO (especially if you
- plan to use more than one network card under Linux)) or if you want
- to use SLIP (Serial Line Internet Protocol is the protocol used to
- send Internet traffic over telephone lines or null modem cables) or
- CSLIP (compressed SLIP) or PPP (Point to Point Protocol, a better
- and newer replacement for SLIP) or PLIP (Parallel Line Internet
- Protocol is mainly used to create a mini network by connecting the
- parallel ports of two local machines) or AX.25/KISS (protocol for
- sending Internet traffic over amateur radio links).
-
- Make sure to read the NET-3-HOWTO. Eventually, you will have to read
- Olaf Kirch's excellent and free book "Network Administrator's
- Guide", to be found in <http://www.linuxdoc.org/docs.html#guide>. If
- unsure, say Y.
-
-source "drivers/net/Kconfig"
-
-source "drivers/atm/Kconfig"
-
-endmenu
-
source "net/ax25/Kconfig"
source "drivers/isdn/Kconfig"
diff --git a/arch/alpha/Makefile b/arch/alpha/Makefile
index 5730945a1922..79f400d4888f 100644
--- a/arch/alpha/Makefile
+++ b/arch/alpha/Makefile
@@ -10,13 +10,17 @@
NM := $(NM) -B
-LDFLAGS_vmlinux = -static -N #-relax
-CFLAGS := $(CFLAGS) -pipe -mno-fp-regs -ffixed-8
-LDFLAGS_BLOB := --format binary --oformat elf64-alpha
+LDFLAGS_vmlinux := -static -N #-relax
+LDFLAGS_BLOB := --format binary --oformat elf64-alpha
+cflags-y := -pipe -mno-fp-regs -ffixed-8
# Determine if we can use the BWX instructions with GAS.
old_gas := $(shell if $(AS) --version 2>&1 | grep 'version 2.7' > /dev/null; then echo y; else echo n; fi)
+ifeq ($(old_gas),y)
+$(error The assembler '$(AS)' does not support the BWX instruction)
+endif
+
# Determine if GCC understands the -mcpu= option.
have_mcpu := $(shell if $(CC) -mcpu=ev5 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi)
@@ -27,68 +31,64 @@ have_mcpu_ev6 := $(shell if $(CC) -mcpu=ev6 -S -o /dev/null -xc /dev/null > /dev
have_mcpu_ev67 := $(shell if $(CC) -mcpu=ev67 -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi)
have_msmall_data := $(shell if $(CC) -msmall-data -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo y; else echo n; fi)
-ifeq ($(have_msmall_data),y)
- CFLAGS := $(CFLAGS) -msmall-data
-endif
+
+cflags-$(have_msmall_data) += -msmall-data
# Turn on the proper cpu optimizations.
ifeq ($(have_mcpu),y)
+ mcpu_done := n
# If GENERIC, make sure to turn off any instruction set extensions that
# the host compiler might have on by default. Given that EV4 and EV5
# have the same instruction set, prefer EV5 because an EV5 schedule is
# more likely to keep an EV4 processor busy than vice-versa.
- mcpu_done := n
ifeq ($(CONFIG_ALPHA_GENERIC),y)
- CFLAGS := $(CFLAGS) -mcpu=ev5
+ mcpu := ev5
mcpu_done := y
endif
ifeq ($(mcpu_done)$(CONFIG_ALPHA_SX164)$(have_mcpu_pca56),nyy)
- CFLAGS := $(CFLAGS) -mcpu=pca56
+ mcpu := pca56
mcpu_done := y
endif
ifeq ($(mcpu_done)$(CONFIG_ALPHA_POLARIS)$(have_mcpu_pca56),nyy)
- CFLAGS := $(CFLAGS) -mcpu=pca56
+ mcpu := pca56
mcpu_done := y
endif
ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV4),ny)
- CFLAGS := $(CFLAGS) -mcpu=ev4
+ mcpu := ev4
mcpu_done := y
endif
ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV56),ny)
- CFLAGS := $(CFLAGS) -mcpu=ev56
+ mcpu := ev56
mcpu_done := y
endif
ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV5),ny)
- CFLAGS := $(CFLAGS) -mcpu=ev5
+ mcpu := ev5
mcpu_done := y
endif
ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV67)$(have_mcpu_ev67),nyy)
- CFLAGS := $(CFLAGS) -mcpu=ev67
+ mcpu := ev67
mcpu_done := y
endif
ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV6),ny)
ifeq ($(have_mcpu_ev6),y)
- CFLAGS := $(CFLAGS) -mcpu=ev6
+ mcpu := ev6
else
ifeq ($(have_mcpu_pca56),y)
- CFLAGS := $(CFLAGS) -mcpu=pca56
+ mcpu := pca56
else
- CFLAGS := $(CFLAGS) -mcpu=ev56
+ mcpu=ev56
endif
endif
mcpu_done := y
endif
+ cflags-$(mcpu_done) += -mcpu=$(mcpu)
endif
+
# For TSUNAMI, we must have the assembler not emulate our instructions.
# The same is true for IRONGATE, POLARIS, PYXIS.
# BWX is most important, but we don't really want any emulation ever.
-
-ifeq ($(old_gas),y)
- # How do we do #error in make?
- CFLAGS := --error-please-upgrade-your-assembler
-endif
-CFLAGS := $(CFLAGS) -Wa,-mev6
+CFLAGS += $(cflags-y) -Wa,-mev6
HEAD := arch/alpha/kernel/head.o
@@ -96,37 +96,16 @@ core-y += arch/alpha/kernel/ arch/alpha/mm/
core-$(CONFIG_MATHEMU) += arch/alpha/math-emu/
libs-y += arch/alpha/lib/
-export libs-y
-
-MAKEBOOT = $(MAKE) -C arch/alpha/boot
+boot := arch/alpha/boot
-rawboot: vmlinux
- @$(MAKEBOOT) rawboot
+#Default target when executing make with no arguments
+all boot: $(boot)/vmlinux.gz
-boot: vmlinux
- @$(MAKEBOOT)
+$(boot)/vmlinux.gz: vmlinux
+ $(Q)$(MAKE) -f scripts/Makefile.build obj=$(boot) $@
-#
-# My boot writes directly to a specific disk partition, I doubt most
-# people will want to do that without changes..
-#
-msb my-special-boot: vmlinux
- @$(MAKEBOOT) msb
-
-bootimage: vmlinux
- @$(MAKEBOOT) bootimage
-
-srmboot: vmlinux
- @$(MAKEBOOT) srmboot
-
-archclean:
- @$(MAKEBOOT) clean
-
-archmrproper:
- rm -f include/asm-alpha/asm_offsets.h
-
-bootpfile: vmlinux
- @$(MAKEBOOT) bootpfile
+bootimage bootpfile: vmlinux
+ $(Q)$(MAKE) -f scripts/Makefile.build obj=$(boot) $(boot)/$@
prepare: include/asm-$(ARCH)/asm_offsets.h
@@ -134,12 +113,19 @@ prepare: include/asm-$(ARCH)/asm_offsets.h
arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
include/config/MARKER
-include/asm-$(ARCH)/asm_offsets.h.tmp: arch/$(ARCH)/kernel/asm-offsets.s
- @$(generate-asm-offsets.h) < $< > $@
-
-include/asm-$(ARCH)/asm_offsets.h: include/asm-$(ARCH)/asm_offsets.h.tmp
+include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
@echo -n ' Generating $@'
+ @$(generate-asm-offsets.h) < $< > $@.tmp
@$(update-if-changed)
+archclean:
+ $(Q)$(MAKE) -f scripts/Makefile.clean obj=$(boot)
+
CLEAN_FILES += include/asm-$(ARCH)/offset.h.tmp \
include/asm-$(ARCH)/offset.h
+
+define archhelp
+ echo '* boot - Compressed kernel image (arch/alpha/boot/vmlinux.gz)'
+ echo ' bootimage - SRM bootable image (arch/alpha/boot/bootimage)'
+ echo ' bootpfile - BOOTP bootable image (arch/alpha/boot/bootpfile)'
+endef
diff --git a/arch/alpha/boot/Makefile b/arch/alpha/boot/Makefile
index 8ea7df0b78a2..ff36b472038b 100644
--- a/arch/alpha/boot/Makefile
+++ b/arch/alpha/boot/Makefile
@@ -8,58 +8,35 @@
# Copyright (C) 1994 by Linus Torvalds
#
-LINKFLAGS = -static -T bootloader.lds -uvsprintf #-N -relax
-
-CFLAGS := $(CFLAGS) -I$(TOPDIR)/include
-
-.S.s:
- $(CPP) $(AFLAGS) -traditional -o $*.o $<
-.S.o:
- $(CC) $(AFLAGS) -traditional -c -o $*.o $<
-
-OBJECTS = head.o main.o
-BPOBJECTS = head.o bootp.o
-TARGETS = vmlinux.gz tools/objstrip # also needed by aboot & milo
-VMLINUX = $(TOPDIR)/vmlinux
-OBJSTRIP = tools/objstrip
-LIBS := $(addprefix $(TOPDIR)/,$(libs-y))
-
-all: $(TARGETS)
- @echo Ready to install kernel in $(shell pwd)/vmlinux.gz
-
-# normally no need to build these:
-rawboot: vmlinux.nh tools/lxboot tools/bootlx
-
-msb: tools/lxboot tools/bootlx vmlinux.nh
- ( cat tools/lxboot tools/bootlx vmlinux.nh ) > /dev/rz0a
- disklabel -rw rz0 'linux' tools/lxboot tools/bootlx
-
-bootimage: tools/mkbb tools/lxboot tools/bootlx vmlinux.nh
- ( cat tools/lxboot tools/bootlx vmlinux.nh ) > bootimage
- tools/mkbb bootimage tools/lxboot
-
-bootpfile: tools/bootph vmlinux.nh
- cat tools/bootph vmlinux.nh > bootpfile
+host-progs := tools/mkbb tools/objstrip
+EXTRA_TARGETS := vmlinux.gz vmlinux \
+ vmlinux.nh tools/lxboot tools/bootlx tools/bootph \
+ bootloader bootpheader
+OBJSTRIP := $(obj)/tools/objstrip
+
+# SRM bootable image. Copy to offset 512 of a partition.
+$(obj)/bootimage: $(addprefix $(obj)/tools/,mkbb lxboot bootlx) $(obj)/vmlinux.nh
+ ( cat $(obj)/tools/lxboot $(obj)/tools/bootlx $(obj)/vmlinux.nh ) > $@
+ $(obj)/tools/mkbb $@ $(obj)/tools/lxboot
+ @echo ' Bootimage $@ is ready'
+
+# BOOTP bootable image. Define INITRD during make to append initrd image.
+$(obj)/bootpfile: $(obj)/tools/bootph $(obj)/vmlinux.nh
+ cat $(obj)/tools/bootph $(obj)/vmlinux.nh > $@
ifdef INITRD
- cat $(INITRD) >> bootpfile
+ cat $(INITRD) >> $@
endif
-srmboot: bootdevice bootimage
- dd if=bootimage of=$(BOOTDEV) bs=512 seek=1 skip=1
- tools/mkbb $(BOOTDEV) tools/lxboot
-
-bootdevice:
- @test "$(BOOTDEV)" != "" || (echo You must specify BOOTDEV ; exit -1)
-
-vmlinux.gz: vmlinux
- gzip -fv9 vmlinux
+# Compressed kernel image
+$(obj)/vmlinux.gz: $(obj)/vmlinux FORCE
+ $(call if_changed,gzip)
+ @echo ' Kernel $@ is ready'
-main.o: ksize.h
+$(obj)/main.o: $(obj)/ksize.h
+$(obj)/bootp.o: $(obj)/ksize.h
-bootp.o: ksize.h
-
-ksize.h: vmlinux.nh FORCE
- echo "#define KERNEL_SIZE `ls -l vmlinux.nh | awk '{print $$5}'`" > $@T
+$(obj)/ksize.h: $(obj)/vmlinux.nh FORCE
+ echo "#define KERNEL_SIZE `ls -l $(obj)/vmlinux.nh | awk '{print $$5}'`" > $@T
ifdef INITRD
[ -f $(INITRD) ] || exit 1
echo "#define INITRD_IMAGE_SIZE `ls -l $(INITRD) | awk '{print $$5}'`" >> $@T
@@ -67,36 +44,36 @@ endif
cmp -s $@T $@ || mv -f $@T $@
rm -f $@T
-vmlinux.nh: $(VMLINUX) $(OBJSTRIP)
- $(OBJSTRIP) -v $(VMLINUX) vmlinux.nh
-
-vmlinux: $(TOPDIR)/vmlinux
- $(STRIP) -o vmlinux $(VMLINUX)
-
-tools/lxboot: $(OBJSTRIP) bootloader
- $(OBJSTRIP) -p bootloader tools/lxboot
+quiet_cmd_strip = STRIP $@
+ cmd_strip = $(STRIP) -o $@ $<
+$(obj)/vmlinux: vmlinux FORCE
+ $(call if_changed,strip)
-tools/bootlx: bootloader $(OBJSTRIP)
- $(OBJSTRIP) -vb bootloader tools/bootlx
+quiet_cmd_objstrip = OBJSTRIP $@
+ cmd_objstrip = $(OBJSTRIP) $(OSFLAGS_$(@F)) $< $@
-tools/bootph: bootpheader $(OBJSTRIP)
- $(OBJSTRIP) -vb bootpheader tools/bootph
+OSFLAGS_vmlinux.nh := -v
+OSFLAGS_lxboot := -p
+OSFLAGS_bootlx := -vb
+OSFLAGS_bootph := -vb
-$(OBJSTRIP): $(OBJSTRIP).c
- $(HOSTCC) $(HOSTCFLAGS) $< -o $@
+$(obj)/vmlinux.nh: vmlinux $(OBJSTRIP) FORCE
+ $(call if_changed,objstrip)
+
+$(obj)/tools/lxboot: $(obj)/bootloader $(OBJSTRIP) FORCE
+ $(call if_changed,objstrip)
-tools/mkbb: tools/mkbb.c
- $(HOSTCC) tools/mkbb.c -o tools/mkbb
+$(obj)/tools/bootlx: $(obj)/bootloader $(OBJSTRIP) FORCE
+ $(call if_changed,objstrip)
-bootloader: $(OBJECTS)
- $(LD) $(LINKFLAGS) $(OBJECTS) $(LIBS) -o bootloader
+$(obj)/tools/bootph: $(obj)/bootpheader $(OBJSTRIP) FORCE
+ $(call if_changed,objstrip)
-bootpheader: $(BPOBJECTS)
- $(LD) $(LINKFLAGS) $(BPOBJECTS) $(LIBS) -o bootpheader
+LDFLAGS_bootloader := -static -uvsprintf -T #-N -relax
+LDFLAGS_bootpheader := -static -uvsprintf -T #-N -relax
-clean:
- rm -f $(TARGETS) bootloader bootimage bootpfile bootpheader
- rm -f tools/mkbb tools/bootlx tools/lxboot tools/bootph
- rm -f vmlinux.nh ksize.h
+$(obj)/bootloader: $(obj)/bootloader.lds $(obj)/head.o $(obj)/main.o FORCE
+ $(call if_changed,ld)
-FORCE:
+$(obj)/bootpheader: $(obj)/bootloader.lds $(obj)/head.o $(obj)/bootp.o FORCE
+ $(call if_changed,ld)
diff --git a/arch/alpha/kernel/Makefile b/arch/alpha/kernel/Makefile
index 0c41f049a770..b22cbaeae0b8 100644
--- a/arch/alpha/kernel/Makefile
+++ b/arch/alpha/kernel/Makefile
@@ -12,83 +12,77 @@ obj-y := entry.o traps.o process.o init_task.o osf_sys.o irq.o \
irq_alpha.o signal.o setup.o ptrace.o time.o semaphore.o \
alpha_ksyms.o systbls.o err_common.o
-#
-# FIXME!
-# These should be made conditional on the stuff that needs them!
-#
-obj-y += irq_i8259.o irq_srm.o \
- es1888.o smc37c669.o smc37c93x.o ns87312.o
-
-ifdef CONFIG_VGA_HOSE
-obj-y += console.o
-endif
-
-obj-$(CONFIG_SMP) += smp.o
-obj-$(CONFIG_PCI) += pci.o pci_iommu.o
+obj-$(CONFIG_VGA_HOSE) += console.o
+obj-$(CONFIG_SMP) += smp.o
+obj-$(CONFIG_PCI) += pci.o pci_iommu.o
obj-$(CONFIG_SRM_ENV) += srm_env.o
ifdef CONFIG_ALPHA_GENERIC
-obj-y += core_apecs.o core_cia.o core_irongate.o core_lca.o core_mcpcia.o \
- core_polaris.o core_t2.o core_tsunami.o core_titan.o \
- sys_alcor.o sys_cabriolet.o sys_dp264.o sys_eb64p.o sys_eiger.o \
+obj-y += core_apecs.o core_cia.o core_irongate.o core_lca.o \
+ core_mcpcia.o core_polaris.o core_t2.o core_tsunami.o \
+ core_titan.o core_wildfire.o
+
+obj-y += sys_alcor.o sys_cabriolet.o sys_dp264.o sys_eb64p.o sys_eiger.o \
sys_jensen.o sys_miata.o sys_mikasa.o sys_nautilus.o sys_titan.o \
sys_noritake.o sys_rawhide.o sys_ruffian.o sys_rx164.o \
sys_sable.o sys_sio.o sys_sx164.o sys_takara.o \
- sys_wildfire.o core_wildfire.o irq_pyxis.o
+ sys_wildfire.o
+
+obj-y += irq_pyxis.o irq_i8259.o irq_srm.o
+
+obj-y += es1888.o smc37c669.o smc37c93x.o ns87312.o
else
# Core logic support
-obj-$(CONFIG_ALPHA_APECS) += core_apecs.o
-obj-$(CONFIG_ALPHA_CIA) += core_cia.o
-
-obj-$(CONFIG_ALPHA_IRONGATE) += core_irongate.o
-obj-$(CONFIG_ALPHA_LCA) += core_lca.o
-obj-$(CONFIG_ALPHA_MCPCIA) += core_mcpcia.o
-obj-$(CONFIG_ALPHA_T2) += core_t2.o
-obj-$(CONFIG_ALPHA_TSUNAMI) += core_tsunami.o
-obj-$(CONFIG_ALPHA_TITAN) += core_titan.o
-obj-$(CONFIG_ALPHA_POLARIS) += core_polaris.o
-obj-$(CONFIG_ALPHA_WILDFIRE) += core_wildfire.o
+obj-$(CONFIG_ALPHA_APECS) += core_apecs.o
+obj-$(CONFIG_ALPHA_CIA) += core_cia.o
+obj-$(CONFIG_ALPHA_IRONGATE) += core_irongate.o
+obj-$(CONFIG_ALPHA_LCA) += core_lca.o
+obj-$(CONFIG_ALPHA_MCPCIA) += core_mcpcia.o
+obj-$(CONFIG_ALPHA_POLARIS) += core_polaris.o
+obj-$(CONFIG_ALPHA_T2) += core_t2.o
+obj-$(CONFIG_ALPHA_TSUNAMI) += core_tsunami.o
+obj-$(CONFIG_ALPHA_TITAN) += core_titan.o
+obj-$(CONFIG_ALPHA_WILDFIRE) += core_wildfire.o
# Board support
-ifneq ($(CONFIG_ALPHA_ALCOR)$(CONFIG_ALPHA_XLT),)
-obj-y += sys_alcor.o
-endif
-ifneq ($(CONFIG_ALPHA_CABRIOLET)$(CONFIG_ALPHA_EB164)$(CONFIG_ALPHA_EB66P)$(CONFIG_ALPHA_LX164)$(CONFIG_ALPHA_PC164),)
-obj-y += sys_cabriolet.o
-endif
-
-obj-$(CONFIG_ALPHA_DP264) += sys_dp264.o
-obj-$(CONFIG_ALPHA_SHARK) += sys_dp264.o
-obj-$(CONFIG_ALPHA_TITAN) += sys_titan.o
-
-ifneq ($(CONFIG_ALPHA_EB64P)$(CONFIG_ALPHA_EB66),)
-obj-y += sys_eb64p.o
-endif
-
-obj-$(CONFIG_ALPHA_EIGER) += sys_eiger.o
-obj-$(CONFIG_ALPHA_JENSEN) += sys_jensen.o pci-noop.o
-obj-$(CONFIG_ALPHA_MIATA) += sys_miata.o
-obj-$(CONFIG_ALPHA_MIKASA) += sys_mikasa.o
-obj-$(CONFIG_ALPHA_NAUTILUS) += sys_nautilus.o
-obj-$(CONFIG_ALPHA_NORITAKE) += sys_noritake.o
-obj-$(CONFIG_ALPHA_RAWHIDE) += sys_rawhide.o
-obj-$(CONFIG_ALPHA_RUFFIAN) += sys_ruffian.o
-obj-$(CONFIG_ALPHA_RX164) += sys_rx164.o
-obj-$(CONFIG_ALPHA_SABLE) += sys_sable.o
-
-ifneq ($(CONFIG_ALPHA_BOOK1)$(CONFIG_ALPHA_AVANTI)$(CONFIG_ALPHA_NONAME)$(CONFIG_ALPHA_P2K)$(CONFIG_ALPHA_XL),)
-obj-y += sys_sio.o
-endif
-
-obj-$(CONFIG_ALPHA_SX164) += sys_sx164.o
-obj-$(CONFIG_ALPHA_TAKARA) += sys_takara.o
-obj-$(CONFIG_ALPHA_WILDFIRE) += sys_wildfire.o
-
-ifneq ($(CONFIG_ALPHA_MIATA)$(CONFIG_ALPHA_RUFFIAN)$(CONFIG_ALPHA_SX164),)
-obj-y += irq_pyxis.o
-endif
+obj-$(CONFIG_ALPHA_ALCOR) += sys_alcor.o irq_i8259.o irq_srm.o
+obj-$(CONFIG_ALPHA_CABRIOLET) += sys_cabriolet.o irq_i8259.o irq_srm.o \
+ ns87312.o
+obj-$(CONFIG_ALPHA_EB164) += sys_cabriolet.o irq_i8259.o irq_srm.o \
+ ns87312.o
+obj-$(CONFIG_ALPHA_EB66P) += sys_cabriolet.o irq_i8259.o irq_srm.o \
+ ns87312.o
+obj-$(CONFIG_ALPHA_LX164) += sys_cabriolet.o irq_i8259.o irq_srm.o \
+ smc37c93x.o
+obj-$(CONFIG_ALPHA_PC164) += sys_cabriolet.o irq_i8259.o irq_srm.o \
+ smc37c93x.o
+obj-$(CONFIG_ALPHA_DP264) += sys_dp264.o irq_i8259.o es1888.o smc37c669.o
+obj-$(CONFIG_ALPHA_SHARK) += sys_dp264.o irq_i8259.o es1888.o smc37c669.o
+obj-$(CONFIG_ALPHA_TITAN) += sys_titan.o irq_i8259.o smc37c669.o
+obj-$(CONFIG_ALPHA_EB64P) += sys_eb64p.o irq_i8259.o
+obj-$(CONFIG_ALPHA_EB66) += sys_eb64p.o irq_i8259.o
+obj-$(CONFIG_ALPHA_EIGER) += sys_eiger.o irq_i8259.o
+obj-$(CONFIG_ALPHA_JENSEN) += sys_jensen.o pci-noop.o irq_i8259.o
+obj-$(CONFIG_ALPHA_MIATA) += sys_miata.o irq_pyxis.o irq_i8259.o \
+ es1888.o smc37c669.o
+obj-$(CONFIG_ALPHA_MIKASA) += sys_mikasa.o irq_i8259.o irq_srm.o
+obj-$(CONFIG_ALPHA_NAUTILUS) += sys_nautilus.o irq_i8259.o irq_srm.o
+obj-$(CONFIG_ALPHA_NORITAKE) += sys_noritake.o irq_i8259.o
+obj-$(CONFIG_ALPHA_RAWHIDE) += sys_rawhide.o irq_i8259.o
+obj-$(CONFIG_ALPHA_RUFFIAN) += sys_ruffian.o irq_pyxis.o irq_i8259.o
+obj-$(CONFIG_ALPHA_RX164) += sys_rx164.o irq_i8259.o
+obj-$(CONFIG_ALPHA_SABLE) += sys_sable.o
+obj-$(CONFIG_ALPHA_BOOK1) += sys_sio.o irq_i8259.o irq_srm.o ns87312.o
+obj-$(CONFIG_ALPHA_AVANTI) += sys_sio.o irq_i8259.o irq_srm.o ns87312.o
+obj-$(CONFIG_ALPHA_NONAME) += sys_sio.o irq_i8259.o irq_srm.o ns87312.o
+obj-$(CONFIG_ALPHA_P2K) += sys_sio.o irq_i8259.o irq_srm.o ns87312.o
+obj-$(CONFIG_ALPHA_XL) += sys_sio.o irq_i8259.o irq_srm.o ns87312.o
+obj-$(CONFIG_ALPHA_SX164) += sys_sx164.o irq_pyxis.o irq_i8259.o \
+ irq_srm.o smc37c669.o
+obj-$(CONFIG_ALPHA_TAKARA) += sys_takara.o irq_i8259.o ns87312.o
+obj-$(CONFIG_ALPHA_WILDFIRE) += sys_wildfire.o irq_i8259.o
endif # GENERIC
diff --git a/arch/alpha/kernel/alpha_ksyms.c b/arch/alpha/kernel/alpha_ksyms.c
index 4aeb791b23c4..d571cc2877a4 100644
--- a/arch/alpha/kernel/alpha_ksyms.c
+++ b/arch/alpha/kernel/alpha_ksyms.c
@@ -33,6 +33,7 @@
#include <asm/semaphore.h>
#include <asm/tlbflush.h>
#include <asm/cacheflush.h>
+#include <asm/vga.h>
#define __KERNEL_SYSCALLS__
#include <asm/unistd.h>
@@ -90,6 +91,7 @@ EXPORT_SYMBOL(___raw_writeq);
EXPORT_SYMBOL(_memcpy_fromio);
EXPORT_SYMBOL(_memcpy_toio);
EXPORT_SYMBOL(_memset_c_io);
+EXPORT_SYMBOL(scr_memcpyw);
EXPORT_SYMBOL(insb);
EXPORT_SYMBOL(insw);
EXPORT_SYMBOL(insl);
diff --git a/arch/alpha/kernel/irq_i8259.c b/arch/alpha/kernel/irq_i8259.c
index f308e98ff210..52231e371310 100644
--- a/arch/alpha/kernel/irq_i8259.c
+++ b/arch/alpha/kernel/irq_i8259.c
@@ -130,11 +130,11 @@ init_i8259a_irqs(void)
# define IACK_SC TITAN_IACK_SC
#elif defined(CONFIG_ALPHA_TSUNAMI)
# define IACK_SC TSUNAMI_IACK_SC
-#elif defined(CONFIG_ALPHA_POLARIS)
-# define IACK_SC POLARIS_IACK_SC
#elif defined(CONFIG_ALPHA_IRONGATE)
# define IACK_SC IRONGATE_IACK_SC
#endif
+/* Note that CONFIG_ALPHA_POLARIS is intentionally left out here, since
+ sys_rx164 wants to use isa_no_iack_sc_device_interrupt for some reason. */
#if defined(IACK_SC)
void
diff --git a/arch/alpha/kernel/sys_alcor.c b/arch/alpha/kernel/sys_alcor.c
index 42c22d05bbc6..a90b51837c7f 100644
--- a/arch/alpha/kernel/sys_alcor.c
+++ b/arch/alpha/kernel/sys_alcor.c
@@ -245,7 +245,6 @@ alcor_kill_arch(int mode)
* The System Vectors
*/
-#if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_ALCOR)
struct alpha_machine_vector alcor_mv __initmv = {
.vector_name = "Alcor",
DO_EV5_MMU,
@@ -273,9 +272,7 @@ struct alpha_machine_vector alcor_mv __initmv = {
}}
};
ALIAS_MV(alcor)
-#endif
-#if defined(CONFIG_ALPHA_GENERIC) || defined(CONFIG_ALPHA_XLT)
struct alpha_machine_vector xlt_mv __initmv = {
.vector_name = "XLT",
DO_EV5_MMU,
@@ -302,5 +299,6 @@ struct alpha_machine_vector xlt_mv __initmv = {
.gru_int_req_bits = XLT_GRU_INT_REQ_BITS
}}
};
-ALIAS_MV(xlt)
-#endif
+
+/* No alpha_mv alias for XLT, since we compile it in unconditionally
+ with ALCOR; setup_arch knows how to cope. */
diff --git a/arch/alpha/lib/Makefile b/arch/alpha/lib/Makefile
index 72b5752cfae0..28c8eb689e86 100644
--- a/arch/alpha/lib/Makefile
+++ b/arch/alpha/lib/Makefile
@@ -7,58 +7,53 @@ L_TARGET := lib.a
# Many of these routines have implementations tuned for ev6.
# Choose them iff we're targeting ev6 specifically.
-ev6 :=
-ifeq ($(CONFIG_ALPHA_EV6),y)
- ev6 := ev6-
-endif
+ev6-$(CONFIG_ALPHA_EV6) := ev6-
# Several make use of the cttz instruction introduced in ev67.
-ev67 :=
-ifeq ($(CONFIG_ALPHA_EV67),y)
- ev67 := ev67-
-endif
+ev67-$(CONFIG_ALPHA_EV67) := ev67-
obj-y = __divqu.o __remqu.o __divlu.o __remlu.o \
udelay.o \
- $(ev6)memset.o \
- $(ev6)memcpy.o \
+ $(ev6-y)memset.o \
+ $(ev6-y)memcpy.o \
memmove.o \
io.o \
checksum.o \
csum_partial_copy.o \
- $(ev67)strlen.o \
- $(ev67)strcat.o \
+ $(ev67-y)strlen.o \
+ $(ev67-y)strcat.o \
strcpy.o \
- $(ev67)strncat.o \
+ $(ev67-y)strncat.o \
strncpy.o \
- $(ev6)stxcpy.o \
- $(ev6)stxncpy.o \
- $(ev67)strchr.o \
- $(ev67)strrchr.o \
- $(ev6)memchr.o \
- $(ev6)copy_user.o \
- $(ev6)clear_user.o \
- $(ev6)strncpy_from_user.o \
- $(ev67)strlen_user.o \
- $(ev6)csum_ipv6_magic.o \
- $(ev6)clear_page.o \
- $(ev6)copy_page.o \
+ $(ev6-y)stxcpy.o \
+ $(ev6-y)stxncpy.o \
+ $(ev67-y)strchr.o \
+ $(ev67-y)strrchr.o \
+ $(ev6-y)memchr.o \
+ $(ev6-y)copy_user.o \
+ $(ev6-y)clear_user.o \
+ $(ev6-y)strncpy_from_user.o \
+ $(ev67-y)strlen_user.o \
+ $(ev6-y)csum_ipv6_magic.o \
+ $(ev6-y)clear_page.o \
+ $(ev6-y)copy_page.o \
strcasecmp.o \
fpreg.o \
callback_srm.o srm_puts.o srm_printk.o
obj-$(CONFIG_SMP) += dec_and_lock.o
-$(obj)/__divqu.o: $(obj)/$(ev6)divide.S
- $(CC) $(AFLAGS) -DDIV -c -o $(obj)/__divqu.o $(obj)/$(ev6)divide.S
-
-$(obj)/__remqu.o: $(obj)/$(ev6)divide.S
- $(CC) $(AFLAGS) -DREM -c -o $(obj)/__remqu.o $(obj)/$(ev6)divide.S
-
-$(obj)/__divlu.o: $(obj)/$(ev6)divide.S
- $(CC) $(AFLAGS) -DDIV -DINTSIZE \
- -c -o $(obj)/__divlu.o $(obj)/$(ev6)divide.S
-
-$(obj)/__remlu.o: $(obj)/$(ev6)divide.S
- $(CC) $(AFLAGS) -DREM -DINTSIZE \
- -c -o $(obj)/__remlu.o $(obj)/$(ev6)divide.S
+# The division routines are built from single source, with different defines.
+AFLAGS___divqu.o = -DDIV
+AFLAGS___remqu.o = -DREM
+AFLAGS___divlu.o = -DDIV -DINTSIZE
+AFLAGS___remlu.o = -DREM -DINTSIZE
+
+$(obj)/__divqu.o: $(obj)/$(ev6-y)divide.S
+ $(cmd_as_o_S)
+$(obj)/__remqu.o: $(obj)/$(ev6-y)divide.S
+ $(cmd_as_o_S)
+$(obj)/__divlu.o: $(obj)/$(ev6-y)divide.S
+ $(cmd_as_o_S)
+$(obj)/__remlu.o: $(obj)/$(ev6-y)divide.S
+ $(cmd_as_o_S)
diff --git a/arch/alpha/math-emu/Makefile b/arch/alpha/math-emu/Makefile
index 57921ead7697..dd59ab12c946 100644
--- a/arch/alpha/math-emu/Makefile
+++ b/arch/alpha/math-emu/Makefile
@@ -2,6 +2,6 @@
# Makefile for the FPU instruction emulation.
#
-CFLAGS += -I. -I$(TOPDIR)/include/math-emu -w
+CFLAGS += -Iinclude/math-emu -w
obj-$(CONFIG_MATHEMU) += math.o qrnnd.o
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index f887b250fee1..28563dd35619 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -898,45 +898,6 @@ source "drivers/acorn/block/Kconfig"
source "net/Kconfig"
-
-menu "Network device support"
- depends on NET
-
-config NETDEVICES
- bool "Network device support"
- ---help---
- You can say N here if you don't intend to connect your Linux box to
- any other computer at all or if all your connections will be over a
- telephone line with a modem either via UUCP (UUCP is a protocol to
- forward mail and news between unix hosts over telephone lines; read
- the UUCP-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>) or dialing up a shell
- account or a BBS, even using term (term is a program which gives you
- almost full Internet connectivity if you have a regular dial up
- shell account on some Internet connected Unix computer. Read
- <http://www.bart.nl/~patrickr/term-howto/Term-HOWTO.html>).
-
- You'll have to say Y if your computer contains a network card that
- you want to use under Linux (make sure you know its name because you
- will be asked for it and read the Ethernet-HOWTO (especially if you
- plan to use more than one network card under Linux)) or if you want
- to use SLIP (Serial Line Internet Protocol is the protocol used to
- send Internet traffic over telephone lines or null modem cables) or
- CSLIP (compressed SLIP) or PPP (Point to Point Protocol, a better
- and newer replacement for SLIP) or PLIP (Parallel Line Internet
- Protocol is mainly used to create a mini network by connecting the
- parallel ports of two local machines) or AX.25/KISS (protocol for
- sending Internet traffic over amateur radio links).
-
- Make sure to read the NET-3-HOWTO. Eventually, you will have to read
- Olaf Kirch's excellent and free book "Network Administrator's
- Guide", to be found in <http://www.linuxdoc.org/docs.html#guide>. If
- unsure, say Y.
-
-source "drivers/net/Kconfig"
-
-endmenu
-
# source net/ax25/Config.in
source "net/irda/Kconfig"
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig
index 5f7f8e0d1469..9081054193f3 100644
--- a/arch/cris/Kconfig
+++ b/arch/cris/Kconfig
@@ -603,47 +603,6 @@ source "drivers/message/i2o/Kconfig"
source "net/Kconfig"
-
-menu "Network device support"
- depends on NET
-
-config NETDEVICES
- bool "Network device support"
- ---help---
- You can say N here if you don't intend to connect your Linux box to
- any other computer at all or if all your connections will be over a
- telephone line with a modem either via UUCP (UUCP is a protocol to
- forward mail and news between unix hosts over telephone lines; read
- the UUCP-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>) or dialing up a shell
- account or a BBS, even using term (term is a program which gives you
- almost full Internet connectivity if you have a regular dial up
- shell account on some Internet connected Unix computer. Read
- <http://www.bart.nl/~patrickr/term-howto/Term-HOWTO.html>).
-
- You'll have to say Y if your computer contains a network card that
- you want to use under Linux (make sure you know its name because you
- will be asked for it and read the Ethernet-HOWTO (especially if you
- plan to use more than one network card under Linux)) or if you want
- to use SLIP (Serial Line Internet Protocol is the protocol used to
- send Internet traffic over telephone lines or null modem cables) or
- CSLIP (compressed SLIP) or PPP (Point to Point Protocol, a better
- and newer replacement for SLIP) or PLIP (Parallel Line Internet
- Protocol is mainly used to create a mini network by connecting the
- parallel ports of two local machines) or AX.25/KISS (protocol for
- sending Internet traffic over amateur radio links).
-
- Make sure to read the NET-3-HOWTO. Eventually, you will have to read
- Olaf Kirch's excellent and free book "Network Administrator's
- Guide", to be found in <http://www.linuxdoc.org/docs.html#guide>. If
- unsure, say Y.
-
-source "drivers/net/Kconfig"
-
-source "drivers/atm/Kconfig"
-
-endmenu
-
source "net/ax25/Kconfig"
source "net/irda/Kconfig"
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig
index 186f22f8c1cf..e26819f478ba 100644
--- a/arch/i386/Kconfig
+++ b/arch/i386/Kconfig
@@ -1436,47 +1436,6 @@ source "drivers/message/i2o/Kconfig"
source "net/Kconfig"
-
-menu "Network device support"
- depends on NET
-
-config NETDEVICES
- bool "Network device support"
- ---help---
- You can say N here if you don't intend to connect your Linux box to
- any other computer at all or if all your connections will be over a
- telephone line with a modem either via UUCP (UUCP is a protocol to
- forward mail and news between unix hosts over telephone lines; read
- the UUCP-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>) or dialing up a shell
- account or a BBS, even using term (term is a program which gives you
- almost full Internet connectivity if you have a regular dial up
- shell account on some Internet connected Unix computer. Read
- <http://www.bart.nl/~patrickr/term-howto/Term-HOWTO.html>).
-
- You'll have to say Y if your computer contains a network card that
- you want to use under Linux (make sure you know its name because you
- will be asked for it and read the Ethernet-HOWTO (especially if you
- plan to use more than one network card under Linux)) or if you want
- to use SLIP (Serial Line Internet Protocol is the protocol used to
- send Internet traffic over telephone lines or null modem cables) or
- CSLIP (compressed SLIP) or PPP (Point to Point Protocol, a better
- and newer replacement for SLIP) or PLIP (Parallel Line Internet
- Protocol is mainly used to create a mini network by connecting the
- parallel ports of two local machines) or AX.25/KISS (protocol for
- sending Internet traffic over amateur radio links).
-
- Make sure to read the NET-3-HOWTO. Eventually, you will have to read
- Olaf Kirch's excellent and free book "Network Administrator's
- Guide", to be found in <http://www.linuxdoc.org/docs.html#guide>. If
- unsure, say Y.
-
-source "drivers/net/Kconfig"
-
-source "drivers/atm/Kconfig"
-
-endmenu
-
source "net/ax25/Kconfig"
source "net/irda/Kconfig"
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
index b602e889879f..1330f0d33bf7 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/i386/kernel/smpboot.c
@@ -813,7 +813,8 @@ static void __init do_boot_cpu (int apicid)
/* So we see what's up */
printk("Booting processor %d/%d eip %lx\n", cpu, apicid, start_eip);
- stack_start.esp = (void *) (1024 + PAGE_SIZE + (char *)idle->thread_info);
+ /* Stack for startup_32 can be just as for start_secondary onwards */
+ stack_start.esp = (void *) idle->thread.esp;
/*
* This grunge runs the startup process for
@@ -882,7 +883,7 @@ static void __init do_boot_cpu (int apicid)
Dprintk("CPU has booted.\n");
} else {
boot_error= 1;
- if (*((volatile unsigned char *)phys_to_virt(8192))
+ if (*((volatile unsigned char *)trampoline_base)
== 0xA5)
/* trampoline started but...? */
printk("Stuck ??\n");
@@ -904,7 +905,7 @@ static void __init do_boot_cpu (int apicid)
}
/* mark "stuck" area as not stuck */
- *((volatile unsigned long *)phys_to_virt(8192)) = 0;
+ *((volatile unsigned long *)trampoline_base) = 0;
if(clustered_apic_mode) {
printk("Restoring NMI vector\n");
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 1a2933160766..615fa7ea5764 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -655,44 +655,6 @@ source "net/Kconfig"
if !IA64_HP_SIM
-menu "Network device support"
- depends on NET
-
-config NETDEVICES
- bool "Network device support"
- ---help---
- You can say N here if you don't intend to connect your Linux box to
- any other computer at all or if all your connections will be over a
- telephone line with a modem either via UUCP (UUCP is a protocol to
- forward mail and news between unix hosts over telephone lines; read
- the UUCP-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>) or dialing up a shell
- account or a BBS, even using term (term is a program which gives you
- almost full Internet connectivity if you have a regular dial up
- shell account on some Internet connected Unix computer. Read
- <http://www.bart.nl/~patrickr/term-howto/Term-HOWTO.html>).
-
- You'll have to say Y if your computer contains a network card that
- you want to use under Linux (make sure you know its name because you
- will be asked for it and read the Ethernet-HOWTO (especially if you
- plan to use more than one network card under Linux)) or if you want
- to use SLIP (Serial Line Internet Protocol is the protocol used to
- send Internet traffic over telephone lines or null modem cables) or
- CSLIP (compressed SLIP) or PPP (Point to Point Protocol, a better
- and newer replacement for SLIP) or PLIP (Parallel Line Internet
- Protocol is mainly used to create a mini network by connecting the
- parallel ports of two local systems) or AX.25/KISS (protocol for
- sending Internet traffic over amateur radio links).
-
- Make sure to read the NET-3-HOWTO. Eventually, you will have to read
- Olaf Kirch's excellent and free book "Network Administrator's
- Guide", to be found in <http://www.linuxdoc.org/docs.html#guide>. If
- unsure, say Y.
-
-source "drivers/net/Kconfig"
-
-endmenu
-
source "net/ax25/Kconfig"
source "drivers/isdn/Kconfig"
diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c
index 73ebb59b2b88..cc2a8a7e4ba3 100644
--- a/arch/ia64/ia32/sys_ia32.c
+++ b/arch/ia64/ia32/sys_ia32.c
@@ -3017,38 +3017,6 @@ sys32_ptrace (int request, pid_t pid, unsigned int addr, unsigned int data,
return ret;
}
-static inline int
-get_flock32(struct flock *kfl, struct flock32 *ufl)
-{
- int err;
-
- if (!access_ok(VERIFY_READ, ufl, sizeof(*ufl)))
- return -EFAULT;
-
- err = __get_user(kfl->l_type, &ufl->l_type);
- err |= __get_user(kfl->l_whence, &ufl->l_whence);
- err |= __get_user(kfl->l_start, &ufl->l_start);
- err |= __get_user(kfl->l_len, &ufl->l_len);
- err |= __get_user(kfl->l_pid, &ufl->l_pid);
- return err;
-}
-
-static inline int
-put_flock32(struct flock *kfl, struct flock32 *ufl)
-{
- int err;
-
- if (!access_ok(VERIFY_WRITE, ufl, sizeof(*ufl)))
- return -EFAULT;
-
- err = __put_user(kfl->l_type, &ufl->l_type);
- err |= __put_user(kfl->l_whence, &ufl->l_whence);
- err |= __put_user(kfl->l_start, &ufl->l_start);
- err |= __put_user(kfl->l_len, &ufl->l_len);
- err |= __put_user(kfl->l_pid, &ufl->l_pid);
- return err;
-}
-
extern asmlinkage long sys_fcntl (unsigned int fd, unsigned int cmd, unsigned long arg);
asmlinkage long
@@ -3062,13 +3030,13 @@ sys32_fcntl (unsigned int fd, unsigned int cmd, unsigned int arg)
case F_GETLK:
case F_SETLK:
case F_SETLKW:
- if (get_flock32(&f, (struct flock32 *) A(arg)))
+ if (get_compat_flock(&f, (struct compat_flock *) A(arg)))
return -EFAULT;
old_fs = get_fs();
set_fs(KERNEL_DS);
ret = sys_fcntl(fd, cmd, (unsigned long) &f);
set_fs(old_fs);
- if (cmd == F_GETLK && put_flock32(&f, (struct flock32 *) A(arg)))
+ if (cmd == F_GETLK && put_compat_flock(&f, (struct compat_flock *) A(arg)))
return -EFAULT;
return ret;
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index 82fb20e2b639..657e5f9afb94 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -1152,496 +1152,6 @@ endmenu
source "net/Kconfig"
-menu "Network device support"
- depends on NET
-
-config NETDEVICES
- bool "Network device support"
- ---help---
- You can say N here if you don't intend to connect your Linux box to
- any other computer at all or if all your connections will be over a
- telephone line with a modem either via UUCP (UUCP is a protocol to
- forward mail and news between unix hosts over telephone lines; read
- the UUCP-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>) or dialing up a shell
- account or a BBS, even using term (term is a program which gives you
- almost full Internet connectivity if you have a regular dial up
- shell account on some Internet connected Unix computer. Read
- <http://www.bart.nl/~patrickr/term-howto/Term-HOWTO.html>).
-
- You'll have to say Y if your computer contains a network card that
- you want to use under Linux (make sure you know its name because you
- will be asked for it and read the Ethernet-HOWTO (especially if you
- plan to use more than one network card under Linux)) or if you want
- to use SLIP (Serial Line Internet Protocol is the protocol used to
- send Internet traffic over telephone lines or null modem cables) or
- CSLIP (compressed SLIP) or PPP (Point to Point Protocol, a better
- and newer replacement for SLIP) or PLIP (Parallel Line Internet
- Protocol is mainly used to create a mini network by connecting the
- parallel ports of two local machines) or AX.25/KISS (protocol for
- sending Internet traffic over amateur radio links).
-
- Make sure to read the NET-3-HOWTO. Eventually, you will have to read
- Olaf Kirch's excellent and free book "Network Administrator's
- Guide", to be found in <http://www.linuxdoc.org/docs.html#guide>. If
- unsure, say Y.
-
-#
-# Network device configuration
-#
-config DUMMY
- tristate "Dummy net driver support"
- depends on NETDEVICES
- ---help---
- This is essentially a bit-bucket device (i.e. traffic you send to
- this device is consigned into oblivion) with a configurable IP
- address. It is most commonly used in order to make your currently
- inactive SLIP address seem like a real address for local programs.
- If you use SLIP or PPP, you might want to say Y here. Since this
- thing often comes in handy, the default is Y. It won't enlarge your
- kernel either. What a deal. Read about it in the Network
- Administrator's Guide, available from
- <http://www.linuxdoc.org/docs.html#guide>.
-
- If you want to compile this as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want),
- say M here and read <file:Documentation/modules.txt>. The module
- will be called dummy.o. If you want to use more than one dummy
- device at a time, you need to compile this driver as a module.
- Instead of 'dummy', the devices will then be called 'dummy0',
- 'dummy1' etc.
-
-config SLIP
- tristate "SLIP (serial line) support"
- depends on NETDEVICES
- ---help---
- Say Y if you intend to use SLIP or CSLIP (compressed SLIP) to
- connect to your Internet service provider or to connect to some
- other local Unix box or if you want to configure your Linux box as a
- Slip/CSlip server for other people to dial in. SLIP (Serial Line
- Internet Protocol) is a protocol used to send Internet traffic over
- serial connections such as telephone lines or null modem cables;
- nowadays, the protocol PPP is more commonly used for this same
- purpose.
-
- Normally, your access provider has to support SLIP in order for you
- to be able to use it, but there is now a SLIP emulator called SLiRP
- around (available from
- <ftp://ibiblio.org/pub/Linux/system/network/serial/>) which
- allows you to use SLIP over a regular dial up shell connection. If
- you plan to use SLiRP, make sure to say Y to CSLIP, below. The
- NET-3-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>, explains how to
- configure SLIP. Note that you don't need this option if you just
- want to run term (term is a program which gives you almost full
- Internet connectivity if you have a regular dial up shell account on
- some Internet connected Unix computer. Read
- <http://www.bart.nl/~patrickr/term-howto/Term-HOWTO.html>). SLIP
- support will enlarge your kernel by about 4 KB. If unsure, say N.
-
- If you want to compile this as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want),
- say M here and read <file:Documentation/modules.txt> as well as
- <file:Documentation/networking/net-modules.txt>. The module will be
- called slip.o.
-
-config SLIP_COMPRESSED
- bool "CSLIP compressed headers"
- depends on SLIP
- ---help---
- This protocol is faster than SLIP because it uses compression on the
- TCP/IP headers (not on the data itself), but it has to be supported
- on both ends. Ask your access provider if you are not sure and
- answer Y, just in case. You will still be able to use plain SLIP. If
- you plan to use SLiRP, the SLIP emulator (available from
- <ftp://ibiblio.org/pub/Linux/system/network/serial/>) which
- allows you to use SLIP over a regular dial up shell connection, you
- definitely want to say Y here. The NET-3-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>, explains how to configure
- CSLIP. This won't enlarge your kernel.
-
-config SLIP_SMART
- bool "Keepalive and linefill"
- depends on SLIP
- help
- Adds additional capabilities to the SLIP driver to support the
- RELCOM line fill and keepalive monitoring. Ideal on poor quality
- analogue lines.
-
-config SLIP_MODE_SLIP6
- bool "Six bit SLIP encapsulation"
- depends on SLIP
- help
- Just occasionally you may need to run IP over hostile serial
- networks that don't pass all control characters or are only seven
- bit. Saying Y here adds an extra mode you can use with SLIP:
- "slip6". In this mode, SLIP will only send normal ASCII symbols over
- the serial device. Naturally, this has to be supported at the other
- end of the link as well. It's good enough, for example, to run IP
- over the async ports of a Camtec JNT Pad. If unsure, say N.
-
-config PPP
- tristate "PPP (point-to-point protocol) support"
- depends on NETDEVICES
- ---help---
- PPP (Point to Point Protocol) is a newer and better SLIP. It serves
- the same purpose: sending Internet traffic over telephone (and other
- serial) lines. Ask your access provider if they support it, because
- otherwise you can't use it; most Internet access providers these
- days support PPP rather than SLIP.
-
- To use PPP, you need an additional program called pppd as described
- in the PPP-HOWTO, available at
- <http://www.linuxdoc.org/docs.html#howto>. Make sure that you have
- the version of pppd recommended in <file:Documentation/Changes>.
- The PPP option enlarges your kernel by about 16 KB.
-
- There are actually two versions of PPP: the traditional PPP for
- asynchronous lines, such as regular analog phone lines, and
- synchronous PPP which can be used over digital ISDN lines for
- example. If you want to use PPP over phone lines or other
- asynchronous serial lines, you need to say Y (or M) here and also to
- the next option, "PPP support for async serial ports". For PPP over
- synchronous lines, you should say Y (or M) here and to "Support
- synchronous PPP", below.
-
- 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 said Y to "Version information on all symbols" above, then
- you cannot compile the PPP driver into the kernel; you can then only
- compile it as a module. The module will be called ppp_generic.o.
- If you want to compile it as a module, say M here and read
- <file:Documentation/modules.txt> as well as
- <file:Documentation/networking/net-modules.txt>.
-
-config PPP_MULTILINK
- bool "PPP multilink support (EXPERIMENTAL)"
- depends on PPP && EXPERIMENTAL
-
-config PPP_FILTER
- bool "PPP filtering"
- depends on PPP && FILTER
-
-config PPP_ASYNC
- tristate "PPP support for async serial ports"
- depends on PPP
-
-config PPP_SYNC_TTY
- tristate "PPP support for sync tty ports"
- depends on PPP
-
-config PPP_DEFLATE
- tristate "PPP Deflate compression"
- depends on PPP
-
-config PPP_BSDCOMP
- tristate "PPP BSD-Compress compression"
- depends on PPP
-
-config PPPOE
- tristate "PPP over Ethernet (EXPERIMENTAL)"
- depends on EXPERIMENTAL && PPP
-
-config EQUALIZER
- tristate "EQL (serial line load balancing) support"
- depends on NETDEVICES
- ---help---
- If you have two serial connections to some other computer (this
- usually requires two modems and two telephone lines) and you use
- SLIP (the protocol for sending Internet traffic over telephone
- lines) or PPP (a better SLIP) on them, you can make them behave like
- one double speed connection using this driver. Naturally, this has
- to be supported at the other end as well, either with a similar EQL
- Linux driver or with a Livingston Portmaster 2e.
-
- Say Y if you want this and read
- <file:Documentation/networking/eql.txt>. You may also want to read
- section 6.2 of the NET-3-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>.
-
- This driver is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called eql.o. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>. If
- unsure, say N.
-
-config ARIADNE
- tristate "Ariadne support"
- depends on NETDEVICES && ZORRO
- help
- If you have a Village Tronic Ariadne Ethernet adapter, say Y.
- Otherwise, say N.
-
- This driver is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you
- want). The module is called ariadne.o. If you want to compile it as
- a module, say M here and read <file:Documentation/modules.txt>.
-
-config ARIADNE2
- tristate "Ariadne II support"
- depends on NETDEVICES && ZORRO
- help
- This driver is for the Village Tronic Ariadne II and the Individual
- Computers X-Surf Ethernet cards. If you have such a card, say Y.
- Otherwise, say N.
-
- This driver is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called ariadne2.o. If you want to compile it as
- a module, say M here and read <file:Documentation/modules.txt>.
-
-config A2065
- tristate "A2065 support"
- depends on NETDEVICES && ZORRO
- help
- If you have a Commodore A2065 Ethernet adapter, say Y. Otherwise,
- say N.
-
- This driver is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you
- want). The module is called a2065.o. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>.
-
-config HYDRA
- tristate "Hydra support"
- depends on NETDEVICES && ZORRO
- help
- If you have a Hydra Ethernet adapter, say Y. Otherwise, say N.
-
- This driver is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you
- want). The module is called hydra.o. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>.
-
-config APNE
- tristate "PCMCIA NE2000 support"
- depends on NETDEVICES && AMIGA_PCMCIA
- help
- If you have a PCMCIA NE2000 compatible adapter, say Y. Otherwise,
- say N.
-
- This driver is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you
- want). The module is called apne.o. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>.
-
-config APOLLO_ELPLUS
- tristate "Apollo 3c505 support"
- depends on NETDEVICES && APOLLO
- help
- Say Y or M here if your Apollo has a 3Com 3c505 ISA Ethernet card.
- If you don't have one made for Apollos, you can use one from a PC,
- except that your Apollo won't be able to boot from it (because the
- code in the ROM will be for a PC).
-
-config MAC8390
- bool "Macintosh NS 8390 based ethernet cards"
- depends on NETDEVICES && MAC
- help
- If you want to include a driver to support Nubus or LC-PDS
- Ethernet cards using an NS8390 chipset or its equivalent, say Y
- and read the Ethernet-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>.
-
-config MACSONIC
- tristate "Macintosh SONIC based ethernet (onboard, NuBus, LC, CS)"
- depends on NETDEVICES && MAC
- ---help---
- Support for NatSemi SONIC based Ethernet devices. This includes
- the onboard Ethernet in many Quadras as well as some LC-PDS,
- a few Nubus and all known Comm Slot Ethernet cards. If you have
- one of these say Y and read the Ethernet-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>.
-
- If you want to compile this as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want),
- say M here and read <file:Documentation/modules.txt> as well as
- <file:Documentation/networking/net-modules.txt>. This module will
- be called macsonic.o.
-
-config SMC9194
- tristate "Macintosh SMC 9194 based ethernet cards"
- depends on NETDEVICES && MAC
- ---help---
- This is support for the SMC9xxx based Ethernet cards. Choose this
- option if you have a DELL laptop with the docking station, or
- another SMC9192/9194 based chipset. Say Y if you want it compiled
- into the kernel, and read the file
- <file:Documentation/networking/smc9.txt> and the Ethernet-HOWTO,
- available from <http://www.linuxdoc.org/docs.html#howto>.
-
- This driver is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called smc9194.o. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt> as well
- as <file:Documentation/networking/net-modules.txt>.
-
-config MAC89x0
- tristate "Macintosh CS89x0 based ethernet cards"
- depends on NETDEVICES && MAC
- ---help---
- Support for CS89x0 chipset based Ethernet cards. If you have a
- Nubus or LC-PDS network (Ethernet) card of this type, say Y and
- read the Ethernet-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>.
-
- If you want to compile this as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want),
- say M here and read <file:Documentation/modules.txt> as well as
- <file:Documentation/networking/net-modules.txt>. This module will
- be called mac89x0.o.
-
-config MACMACE
- bool "Macintosh (AV) onboard MACE ethernet (EXPERIMENTAL)"
- depends on NETDEVICES && MAC && EXPERIMENTAL
- help
- Support for the onboard AMD 79C940 MACE Ethernet controller used in
- the 660AV and 840AV Macintosh. If you have one of these Macintoshes
- say Y and read the Ethernet-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>.
-
-config MVME147_NET
- tristate "MVME147 (Lance) Ethernet support"
- depends on NETDEVICES && MVME147
- help
- Support for the on-board Ethernet interface on the Motorola MVME147
- single-board computer. Say Y here to include the
- driver for this chip in your kernel. If you want to compile it as
- a module, say M here and read <file:Documentation/modules.txt>.
-
-config MVME16x_NET
- tristate "MVME16x Ethernet support"
- depends on NETDEVICES && MVME16x
- help
- This is the driver for the Ethernet interface on the Motorola
- MVME162, 166, 167, 172 and 177 boards. Say Y here to include the
- driver for this chip in your kernel. If you want to compile it as
- a module, say M here and read <file:Documentation/modules.txt>.
-
-config BVME6000_NET
- tristate "BVME6000 Ethernet support"
- depends on NETDEVICES && BVME6000
- help
- This is the driver for the Ethernet interface on BVME4000 and
- BVME6000 VME boards. Say Y here to include the driver for this chip
- in your kernel. If you want to compile it as a module, say M here
- and read <file:Documentation/modules.txt>.
-
-config ATARILANCE
- tristate "Atari Lance support"
- depends on NETDEVICES && ATARI
- help
- Say Y to include support for several Atari Ethernet adapters based
- on the AMD Lance chipset: RieblCard (with or without battery), or
- PAMCard VME (also the version by Rhotron, with different addresses).
-
-config ATARI_BIONET
- tristate "BioNet-100 support"
- depends on NETDEVICES && ATARI && ATARI_ACSI!=n
- help
- Say Y to include support for BioData's BioNet-100 Ethernet adapter
- for the ACSI port. The driver works (has to work...) with a polled
- I/O scheme, so it's rather slow :-(
-
-config ATARI_PAMSNET
- tristate "PAMsNet support"
- depends on NETDEVICES && ATARI && ATARI_ACSI!=n
- help
- Say Y to include support for the PAMsNet Ethernet adapter for the
- ACSI port ("ACSI node"). The driver works (has to work...) with a
- polled I/O scheme, so it's rather slow :-(
-
-config SUN3LANCE
- tristate "Sun3/Sun3x on-board LANCE support"
- depends on NETDEVICES && (SUN3 || SUN3X)
- help
- Most Sun3 and Sun3x motherboards (including the 3/50, 3/60 and 3/80)
- featured an AMD Lance 10Mbit Ethernet controller on board; say Y
- here to compile in the Linux driver for this and enable Ethernet.
- General Linux information on the Sun 3 and 3x series (now
- discontinued) is at
- <http://www.angelfire.com/ca2/tech68k/sun3.html>.
-
- If you're not building a kernel for a Sun 3, say N.
-
-config SUN3_82586
- tristate "Sun3 on-board Intel 82586 support"
- depends on NETDEVICES && SUN3
- help
- This driver enables support for the on-board Intel 82586 based
- Ethernet adapter found on Sun 3/1xx and 3/2xx motherboards. Note
- that this driver does not support 82586-based adapters on additional
- VME boards.
-
-config HPLANCE
- bool "HP on-board LANCE support"
- depends on NETDEVICES && HP300
- help
- If you want to use the builtin "LANCE" Ethernet controller on an
- HP300 machine, say Y here.
-
-config PLIP
- tristate "PLIP (parallel port) support"
- depends on NETDEVICES && Q40 && PARPORT
- ---help---
- PLIP (Parallel Line Internet Protocol) is used to create a
- reasonably fast mini network consisting of two (or, rarely, more)
- local machines. A PLIP link from a Linux box is a popular means to
- install a Linux distribution on a machine which doesn't have a
- CD-ROM drive (a minimal system has to be transferred with floppies
- first). The kernels on both machines need to have this PLIP option
- enabled for this to work.
-
- The PLIP driver has two modes, mode 0 and mode 1. The parallel
- ports (the connectors at the computers with 25 holes) are connected
- with "null printer" or "Turbo Laplink" cables which can transmit 4
- bits at a time (mode 0) or with special PLIP cables, to be used on
- bidirectional parallel ports only, which can transmit 8 bits at a
- time (mode 1); you can find the wiring of these cables in
- <file:Documentation/networking/PLIP.txt>. The cables can be up to
- 15m long. Mode 0 works also if one of the machines runs DOS/Windows
- and has some PLIP software installed, e.g. the Crynwr PLIP packet
- driver (<http://oak.oakland.edu/simtel.net/msdos/pktdrvr-pre.html>)
- and winsock or NCSA's telnet.
-
- If you want to use PLIP, say Y and read the PLIP mini-HOWTO as well
- as the NET-3-HOWTO, both available from
- <http://www.linuxdoc.org/docs.html#howto>. Note that the PLIP
- protocol has been changed and this PLIP driver won't work together
- with the PLIP support in Linux versions 1.0.x. This option enlarges
- your kernel by about 8 KB.
-
- If you want to compile this as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want),
- say M here and read <file:Documentation/modules.txt> as well as
- <file:Documentation/networking/net-modules.txt>. The module will be
- called plip.o. If unsure, say Y or M, in case you buy a laptop
- later.
-
-config NE2000
- tristate "NE2000/NE1000 support"
- depends on NETDEVICES && Q40 && m
- ---help---
- If you have a network (Ethernet) card of this type, say Y and read
- the Ethernet-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>. Many Ethernet cards
- without a specific driver are compatible with NE2000.
-
- If you have a PCI NE2000 card however, say N here and Y to "PCI
- NE2000 support", above. If you have a NE2000 card and are running on
- an MCA system (a bus system used on some IBM PS/2 computers and
- laptops), say N here and Y to "NE/2 (ne2000 MCA version) support",
- below.
-
- This driver is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called ne.o. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt> as well
- as <file:Documentation/networking/net-modules.txt>.
-
-endmenu
-
-
menu "Character devices"
config SERIAL
diff --git a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig
index 333eb3c5fb98..db981241a41e 100644
--- a/arch/m68knommu/Kconfig
+++ b/arch/m68knommu/Kconfig
@@ -611,47 +611,6 @@ source "drivers/message/i2o/Kconfig"
source "net/Kconfig"
-
-menu "Network device support"
- depends on NET
-
-config NETDEVICES
- bool "Network device support"
- ---help---
- You can say N here if you don't intend to connect your Linux box to
- any other computer at all or if all your connections will be over a
- telephone line with a modem either via UUCP (UUCP is a protocol to
- forward mail and news between unix hosts over telephone lines; read
- the UUCP-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>) or dialing up a shell
- account or a BBS, even using term (term is a program which gives you
- almost full Internet connectivity if you have a regular dial up
- shell account on some Internet connected Unix computer. Read
- <http://www.bart.nl/~patrickr/term-howto/Term-HOWTO.html>).
-
- You'll have to say Y if your computer contains a network card that
- you want to use under Linux (make sure you know its name because you
- will be asked for it and read the Ethernet-HOWTO (especially if you
- plan to use more than one network card under Linux)) or if you want
- to use SLIP (Serial Line Internet Protocol is the protocol used to
- send Internet traffic over telephone lines or null modem cables) or
- CSLIP (compressed SLIP) or PPP (Point to Point Protocol, a better
- and newer replacement for SLIP) or PLIP (Parallel Line Internet
- Protocol is mainly used to create a mini network by connecting the
- parallel ports of two local machines) or AX.25/KISS (protocol for
- sending Internet traffic over amateur radio links).
-
- Make sure to read the NET-3-HOWTO. Eventually, you will have to read
- Olaf Kirch's excellent and free book "Network Administrator's
- Guide", to be found in <http://www.linuxdoc.org/docs.html#guide>. If
- unsure, say Y.
-
-source "drivers/net/Kconfig"
-
-source "drivers/atm/Kconfig"
-
-endmenu
-
source "net/ax25/Kconfig"
source "net/irda/Kconfig"
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index fb570cf0ae57..44744dbe40fe 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -919,47 +919,6 @@ endif
source "net/Kconfig"
-
-menu "Network device support"
- depends on NET
-
-config NETDEVICES
- bool "Network device support"
- ---help---
- You can say N here if you don't intend to connect your Linux box to
- any other computer at all or if all your connections will be over a
- telephone line with a modem either via UUCP (UUCP is a protocol to
- forward mail and news between unix hosts over telephone lines; read
- the UUCP-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>) or dialing up a shell
- account or a BBS, even using term (term is a program which gives you
- almost full Internet connectivity if you have a regular dial up
- shell account on some Internet connected Unix computer. Read
- <http://www.bart.nl/~patrickr/term-howto/Term-HOWTO.html>).
-
- You'll have to say Y if your computer contains a network card that
- you want to use under Linux (make sure you know its name because you
- will be asked for it and read the Ethernet-HOWTO (especially if you
- plan to use more than one network card under Linux)) or if you want
- to use SLIP (Serial Line Internet Protocol is the protocol used to
- send Internet traffic over telephone lines or null modem cables) or
- CSLIP (compressed SLIP) or PPP (Point to Point Protocol, a better
- and newer replacement for SLIP) or PLIP (Parallel Line Internet
- Protocol is mainly used to create a mini network by connecting the
- parallel ports of two local machines) or AX.25/KISS (protocol for
- sending Internet traffic over amateur radio links).
-
- Make sure to read the NET-3-HOWTO. Eventually, you will have to read
- Olaf Kirch's excellent and free book "Network Administrator's
- Guide", to be found in <http://www.linuxdoc.org/docs.html#guide>. If
- unsure, say Y.
-
-source "drivers/net/Kconfig"
-
-source "drivers/atm/Kconfig"
-
-endmenu
-
source "net/ax25/Kconfig"
source "net/irda/Kconfig"
diff --git a/arch/mips64/Kconfig b/arch/mips64/Kconfig
index a42f67b70e6e..4b242b93aae4 100644
--- a/arch/mips64/Kconfig
+++ b/arch/mips64/Kconfig
@@ -504,47 +504,6 @@ endmenu
#source drivers/message/i2o/Config.in
source "net/Kconfig"
-
-menu "Network device support"
- depends on NET
-
-config NETDEVICES
- bool "Network device support"
- ---help---
- You can say N here if you don't intend to connect your Linux box to
- any other computer at all or if all your connections will be over a
- telephone line with a modem either via UUCP (UUCP is a protocol to
- forward mail and news between unix hosts over telephone lines; read
- the UUCP-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>) or dialing up a shell
- account or a BBS, even using term (term is a program which gives you
- almost full Internet connectivity if you have a regular dial up
- shell account on some Internet connected Unix computer. Read
- <http://www.bart.nl/~patrickr/term-howto/Term-HOWTO.html>).
-
- You'll have to say Y if your computer contains a network card that
- you want to use under Linux (make sure you know its name because you
- will be asked for it and read the Ethernet-HOWTO (especially if you
- plan to use more than one network card under Linux)) or if you want
- to use SLIP (Serial Line Internet Protocol is the protocol used to
- send Internet traffic over telephone lines or null modem cables) or
- CSLIP (compressed SLIP) or PPP (Point to Point Protocol, a better
- and newer replacement for SLIP) or PLIP (Parallel Line Internet
- Protocol is mainly used to create a mini network by connecting the
- parallel ports of two local machines) or AX.25/KISS (protocol for
- sending Internet traffic over amateur radio links).
-
- Make sure to read the NET-3-HOWTO. Eventually, you will have to read
- Olaf Kirch's excellent and free book "Network Administrator's
- Guide", to be found in <http://www.linuxdoc.org/docs.html#guide>. If
- unsure, say Y.
-
-source "drivers/net/Kconfig"
-
-source "drivers/atm/Kconfig"
-
-endmenu
-
source "net/ax25/Kconfig"
source "net/irda/Kconfig"
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 3104b344cf09..25baa10a0035 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -276,46 +276,6 @@ source "drivers/md/Kconfig"
source "net/Kconfig"
-menu "Network device support"
- depends on NET
-
-config NETDEVICES
- bool "Network device support"
- ---help---
- You can say N here if you don't intend to connect your Linux box to
- any other computer at all or if all your connections will be over a
- telephone line with a modem either via UUCP (UUCP is a protocol to
- forward mail and news between unix hosts over telephone lines; read
- the UUCP-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>) or dialing up a shell
- account or a BBS, even using term (term is a program which gives you
- almost full Internet connectivity if you have a regular dial up
- shell account on some Internet connected Unix computer. Read
- <http://www.bart.nl/~patrickr/term-howto/Term-HOWTO.html>).
-
- You'll have to say Y if your computer contains a network card that
- you want to use under Linux (make sure you know its name because you
- will be asked for it and read the Ethernet-HOWTO (especially if you
- plan to use more than one network card under Linux)) or if you want
- to use SLIP (Serial Line Internet Protocol is the protocol used to
- send Internet traffic over telephone lines or null modem cables) or
- CSLIP (compressed SLIP) or PPP (Point to Point Protocol, a better
- and newer replacement for SLIP) or PLIP (Parallel Line Internet
- Protocol is mainly used to create a mini network by connecting the
- parallel ports of two local machines) or AX.25/KISS (protocol for
- sending Internet traffic over amateur radio links).
-
- Make sure to read the NET-3-HOWTO. Eventually, you will have to read
- Olaf Kirch's excellent and free book "Network Administrator's
- Guide", to be found in <http://www.linuxdoc.org/docs.html#guide>. If
- unsure, say Y.
-
-source "drivers/net/Kconfig"
-
-source "drivers/atm/Kconfig"
-
-endmenu
-
#source "net/ax25/Kconfig"
source "net/irda/Kconfig"
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig
index 3c55bfb40f21..10f2bb5d2de0 100644
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@ -1415,47 +1415,6 @@ source "drivers/message/i2o/Kconfig"
source "net/Kconfig"
-
-menu "Network device support"
- depends on NET
-
-config NETDEVICES
- bool "Network device support"
- ---help---
- You can say N here if you don't intend to connect your Linux box to
- any other computer at all or if all your connections will be over a
- telephone line with a modem either via UUCP (UUCP is a protocol to
- forward mail and news between unix hosts over telephone lines; read
- the UUCP-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>) or dialing up a shell
- account or a BBS, even using term (term is a program which gives you
- almost full Internet connectivity if you have a regular dial up
- shell account on some Internet connected Unix computer. Read
- <http://www.bart.nl/~patrickr/term-howto/Term-HOWTO.html>).
-
- You'll have to say Y if your computer contains a network card that
- you want to use under Linux (make sure you know its name because you
- will be asked for it and read the Ethernet-HOWTO (especially if you
- plan to use more than one network card under Linux)) or if you want
- to use SLIP (Serial Line Internet Protocol is the protocol used to
- send Internet traffic over telephone lines or null modem cables) or
- CSLIP (compressed SLIP) or PPP (Point to Point Protocol, a better
- and newer replacement for SLIP) or PLIP (Parallel Line Internet
- Protocol is mainly used to create a mini network by connecting the
- parallel ports of two local machines) or AX.25/KISS (protocol for
- sending Internet traffic over amateur radio links).
-
- Make sure to read the NET-3-HOWTO. Eventually, you will have to read
- Olaf Kirch's excellent and free book "Network Administrator's
- Guide", to be found in <http://www.linuxdoc.org/docs.html#guide>. If
- unsure, say Y.
-
-source "drivers/net/Kconfig"
-
-source "drivers/atm/Kconfig"
-
-endmenu
-
source "net/ax25/Kconfig"
source "net/irda/Kconfig"
diff --git a/arch/ppc64/Kconfig b/arch/ppc64/Kconfig
index 6ae491191a36..7d5444a9d56e 100644
--- a/arch/ppc64/Kconfig
+++ b/arch/ppc64/Kconfig
@@ -354,47 +354,6 @@ source "drivers/message/i2o/Kconfig"
source "net/Kconfig"
-
-menu "Network device support"
- depends on NET
-
-config NETDEVICES
- bool "Network device support"
- ---help---
- You can say N here if you don't intend to connect your Linux box to
- any other computer at all or if all your connections will be over a
- telephone line with a modem either via UUCP (UUCP is a protocol to
- forward mail and news between unix hosts over telephone lines; read
- the UUCP-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>) or dialing up a shell
- account or a BBS, even using term (term is a program which gives you
- almost full Internet connectivity if you have a regular dial up
- shell account on some Internet connected Unix computer. Read
- <http://www.bart.nl/~patrickr/term-howto/Term-HOWTO.html>).
-
- You'll have to say Y if your computer contains a network card that
- you want to use under Linux (make sure you know its name because you
- will be asked for it and read the Ethernet-HOWTO (especially if you
- plan to use more than one network card under Linux)) or if you want
- to use SLIP (Serial Line Internet Protocol is the protocol used to
- send Internet traffic over telephone lines or null modem cables) or
- CSLIP (compressed SLIP) or PPP (Point to Point Protocol, a better
- and newer replacement for SLIP) or PLIP (Parallel Line Internet
- Protocol is mainly used to create a mini network by connecting the
- parallel ports of two local machines) or AX.25/KISS (protocol for
- sending Internet traffic over amateur radio links).
-
- Make sure to read the NET-3-HOWTO. Eventually, you will have to read
- Olaf Kirch's excellent and free book "Network Administrator's
- Guide", to be found in <http://www.linuxdoc.org/docs.html#guide>. If
- unsure, say Y.
-
-source "drivers/net/Kconfig"
-
-source "drivers/atm/Kconfig"
-
-endmenu
-
source "net/ax25/Kconfig"
source "net/irda/Kconfig"
diff --git a/arch/ppc64/kernel/sys_ppc32.c b/arch/ppc64/kernel/sys_ppc32.c
index 625b4676d043..95d8975b0bbe 100644
--- a/arch/ppc64/kernel/sys_ppc32.c
+++ b/arch/ppc64/kernel/sys_ppc32.c
@@ -247,30 +247,6 @@ out:
return ret;
}
-static inline int get_flock(struct flock *kfl, struct flock32 *ufl)
-{
- int err;
-
- err = get_user(kfl->l_type, &ufl->l_type);
- err |= __get_user(kfl->l_whence, &ufl->l_whence);
- err |= __get_user(kfl->l_start, &ufl->l_start);
- err |= __get_user(kfl->l_len, &ufl->l_len);
- err |= __get_user(kfl->l_pid, &ufl->l_pid);
- return err;
-}
-
-static inline int put_flock(struct flock *kfl, struct flock32 *ufl)
-{
- int err;
-
- err = __put_user(kfl->l_type, &ufl->l_type);
- err |= __put_user(kfl->l_whence, &ufl->l_whence);
- err |= __put_user(kfl->l_start, &ufl->l_start);
- err |= __put_user(kfl->l_len, &ufl->l_len);
- err |= __put_user(kfl->l_pid, &ufl->l_pid);
- return err;
-}
-
extern asmlinkage long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg);
asmlinkage long sys32_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg)
{
@@ -283,12 +259,12 @@ asmlinkage long sys32_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg
mm_segment_t old_fs;
long ret;
- if(get_flock(&f, (struct flock32 *)arg))
+ if(get_compat_flock(&f, (struct compat_flock *)arg))
return -EFAULT;
old_fs = get_fs(); set_fs (KERNEL_DS);
ret = sys_fcntl(fd, cmd, (unsigned long)&f);
set_fs (old_fs);
- if(put_flock(&f, (struct flock32 *)arg))
+ if(put_compat_flock(&f, (struct compat_flock *)arg))
return -EFAULT;
return ret;
}
diff --git a/arch/s390x/kernel/linux32.c b/arch/s390x/kernel/linux32.c
index ea87f61f1b6f..0241506a4305 100644
--- a/arch/s390x/kernel/linux32.c
+++ b/arch/s390x/kernel/linux32.c
@@ -833,30 +833,6 @@ out:
return err;
}
-static inline int get_flock(struct flock *kfl, struct flock32 *ufl)
-{
- int err;
-
- err = get_user(kfl->l_type, &ufl->l_type);
- err |= __get_user(kfl->l_whence, &ufl->l_whence);
- err |= __get_user(kfl->l_start, &ufl->l_start);
- err |= __get_user(kfl->l_len, &ufl->l_len);
- err |= __get_user(kfl->l_pid, &ufl->l_pid);
- return err;
-}
-
-static inline int put_flock(struct flock *kfl, struct flock32 *ufl)
-{
- int err;
-
- err = __put_user(kfl->l_type, &ufl->l_type);
- err |= __put_user(kfl->l_whence, &ufl->l_whence);
- err |= __put_user(kfl->l_start, &ufl->l_start);
- err |= __put_user(kfl->l_len, &ufl->l_len);
- err |= __put_user(kfl->l_pid, &ufl->l_pid);
- return err;
-}
-
extern asmlinkage long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg);
asmlinkage long sys32_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg)
@@ -868,7 +844,7 @@ asmlinkage long sys32_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg
mm_segment_t old_fs;
long ret;
- if(get_flock(&f, (struct flock32 *)A(arg)))
+ if(get_compat_flock(&f, (struct compat_flock *)A(arg)))
return -EFAULT;
old_fs = get_fs(); set_fs (KERNEL_DS);
ret = sys_fcntl(fd, cmd, (unsigned long)&f);
@@ -877,7 +853,7 @@ asmlinkage long sys32_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg
if (f.l_start >= 0x7fffffffUL ||
f.l_start + f.l_len >= 0x7fffffffUL)
return -EOVERFLOW;
- if(put_flock(&f, (struct flock32 *)A(arg)))
+ if(put_compat_flock(&f, (struct compat_flock *)A(arg)))
return -EFAULT;
return 0;
}
@@ -888,7 +864,7 @@ asmlinkage long sys32_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg
mm_segment_t old_fs;
long ret;
- if(get_flock(&f, (struct flock32 *)A(arg)))
+ if(get_compat_flock(&f, (struct compat_flock *)A(arg)))
return -EFAULT;
old_fs = get_fs(); set_fs (KERNEL_DS);
ret = sys_fcntl(fd, cmd, (unsigned long)&f);
diff --git a/arch/s390x/kernel/linux32.h b/arch/s390x/kernel/linux32.h
index 94fdd15c7560..0c43c224c678 100644
--- a/arch/s390x/kernel/linux32.h
+++ b/arch/s390x/kernel/linux32.h
@@ -25,15 +25,6 @@ struct ipc_kludge_32 {
#define F_SETLK64 13
#define F_SETLKW64 14
-struct flock32 {
- short l_type;
- short l_whence;
- compat_off_t l_start;
- compat_off_t l_len;
- compat_pid_t l_pid;
- short __unused;
-};
-
struct statfs32 {
__s32 f_type;
__s32 f_bsize;
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 24d33e1d5734..894f49d3f269 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -745,48 +745,6 @@ source "drivers/ieee1394/Kconfig"
source "net/Kconfig"
-
-menu "Network device support"
- depends on NET
-
-config NETDEVICES
- bool "Network device support"
- ---help---
- You can say N here if you don't intend to connect your Linux box to
- any other computer at all or if all your connections will be over a
- telephone line with a modem either via UUCP (UUCP is a protocol to
- forward mail and news between unix hosts over telephone lines; read
- the UUCP-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>) or dialing up a shell
- account or a BBS, even using term (term is a program which gives you
- almost full Internet connectivity if you have a regular dial up
- shell account on some Internet connected Unix computer. Read
- <http://www.bart.nl/~patrickr/term-howto/Term-HOWTO.html>).
-
- You'll have to say Y if your computer contains a network card that
- you want to use under Linux (make sure you know its name because you
- will be asked for it and read the Ethernet-HOWTO (especially if you
- plan to use more than one network card under Linux)) or if you want
- to use SLIP (Serial Line Internet Protocol is the protocol used to
- send Internet traffic over telephone lines or null modem cables) or
- CSLIP (compressed SLIP) or PPP (Point to Point Protocol, a better
- and newer replacement for SLIP) or PLIP (Parallel Line Internet
- Protocol is mainly used to create a mini network by connecting the
- parallel ports of two local machines) or AX.25/KISS (protocol for
- sending Internet traffic over amateur radio links).
-
- Make sure to read the NET-3-HOWTO. Eventually, you will have to read
- Olaf Kirch's excellent and free book "Network Administrator's
- Guide", to be found in <http://www.linuxdoc.org/docs.html#guide>. If
- unsure, say Y.
-
-source "drivers/net/Kconfig"
-
-source "drivers/atm/Kconfig"
-
-endmenu
-
-
menu "Old CD-ROM drivers (not SCSI, not IDE)"
config CD_NO_IDESCSI
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index cc5d534ec3b1..e64173082211 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -883,396 +883,6 @@ source "drivers/fc4/Kconfig"
source "net/Kconfig"
-
-menu "Network device support"
- depends on NET
-
-config NETDEVICES
- bool "Network device support"
- ---help---
- You can say N here if you don't intend to connect your Linux box to
- any other computer at all or if all your connections will be over a
- telephone line with a modem either via UUCP (UUCP is a protocol to
- forward mail and news between unix hosts over telephone lines; read
- the UUCP-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>) or dialing up a shell
- account or a BBS, even using term (term is a program which gives you
- almost full Internet connectivity if you have a regular dial up
- shell account on some Internet connected Unix computer. Read
- <http://www.bart.nl/~patrickr/term-howto/Term-HOWTO.html>).
-
- You'll have to say Y if your computer contains a network card that
- you want to use under Linux (make sure you know its name because you
- will be asked for it and read the Ethernet-HOWTO (especially if you
- plan to use more than one network card under Linux)) or if you want
- to use SLIP (Serial Line Internet Protocol is the protocol used to
- send Internet traffic over telephone lines or null modem cables) or
- CSLIP (compressed SLIP) or PPP (Point to Point Protocol, a better
- and newer replacement for SLIP) or PLIP (Parallel Line Internet
- Protocol is mainly used to create a mini network by connecting the
- parallel ports of two local machines) or AX.25/KISS (protocol for
- sending Internet traffic over amateur radio links).
-
- Make sure to read the NET-3-HOWTO. Eventually, you will have to read
- Olaf Kirch's excellent and free book "Network Administrator's
- Guide", to be found in <http://www.linuxdoc.org/docs.html#guide>. If
- unsure, say Y.
-
-config DUMMY
- tristate "Dummy net driver support"
- depends on NETDEVICES
- ---help---
- This is essentially a bit-bucket device (i.e. traffic you send to
- this device is consigned into oblivion) with a configurable IP
- address. It is most commonly used in order to make your currently
- inactive SLIP address seem like a real address for local programs.
- If you use SLIP or PPP, you might want to say Y here. Since this
- thing often comes in handy, the default is Y. It won't enlarge your
- kernel either. What a deal. Read about it in the Network
- Administrator's Guide, available from
- <http://www.linuxdoc.org/docs.html#guide>.
-
- If you want to compile this as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want),
- say M here and read <file:Documentation/modules.txt>. The module
- will be called dummy.o. If you want to use more than one dummy
- device at a time, you need to compile this driver as a module.
- Instead of 'dummy', the devices will then be called 'dummy0',
- 'dummy1' etc.
-
-config BONDING
- tristate "Bonding driver support"
- depends on NETDEVICES
- ---help---
- Say 'Y' or 'M' if you wish to be able to 'bond' multiple Ethernet
- Channels together. This is called 'Etherchannel' by Cisco,
- 'Trunking' by Sun, and 'Bonding' in Linux.
-
- If you have two Ethernet connections to some other computer, you can
- make them behave like one double speed connection using this driver.
- Naturally, this has to be supported at the other end as well, either
- with a similar Bonding Linux driver, a Cisco 5500 switch or a
- SunTrunking SunSoft driver.
-
- This is similar to the EQL driver, but it merges Ethernet segments
- instead of serial lines.
-
- If you want to compile this as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want),
- say M here and read <file:Documentation/modules.txt>. The module
- will be called bonding.o.
-
-config TUN
- tristate "Universal TUN/TAP device driver support"
- depends on NETDEVICES
- ---help---
- TUN/TAP provides packet reception and transmission for user space
- programs. It can be viewed as a simple Point-to-Point or Ethernet
- device, which instead of receiving packets from a physical media,
- receives them from user space program and instead of sending packets
- via physical media writes them to the user space program.
-
- When a program opens /dev/net/tun, driver creates and registers
- corresponding net device tunX or tapX. After a program closed above
- devices, driver will automatically delete tunXX or tapXX device and
- all routes corresponding to it.
-
- Please read <file:Documentation/networking/tuntap.txt> for more
- information.
-
- This driver is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called tun.o. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>.
-
- If you don't know what to use this for, you don't need it.
-
-config ETHERTAP
- tristate "Ethertap network tap (OBSOLETE)"
- depends on NETDEVICES && EXPERIMENTAL && NETLINK
- ---help---
- If you say Y here (and have said Y to "Kernel/User network link
- driver", above) and create a character special file /dev/tap0 with
- major number 36 and minor number 16 using mknod ("man mknod"), you
- will be able to have a user space program read and write raw
- Ethernet frames from/to that special file. tap0 can be configured
- with ifconfig and route like any other Ethernet device but it is not
- connected to any physical LAN; everything written by the user to
- /dev/tap0 is treated by the kernel as if it had come in from a LAN
- to the device tap0; everything the kernel wants to send out over the
- device tap0 can instead be read by the user from /dev/tap0: the user
- mode program replaces the LAN that would be attached to an ordinary
- Ethernet device. Please read the file
- <file:Documentation/networking/ethertap.txt> for more information.
-
- This driver is also available as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want).
- The module will be called ethertap.o. If you want to compile it as a
- module, say M here and read <file:Documentation/modules.txt>.
-
- If you don't know what to use this for, you don't need it.
-
-config PPP
- tristate "PPP (point-to-point protocol) support"
- depends on NETDEVICES
- ---help---
- PPP (Point to Point Protocol) is a newer and better SLIP. It serves
- the same purpose: sending Internet traffic over telephone (and other
- serial) lines. Ask your access provider if they support it, because
- otherwise you can't use it; most Internet access providers these
- days support PPP rather than SLIP.
-
- To use PPP, you need an additional program called pppd as described
- in the PPP-HOWTO, available at
- <http://www.linuxdoc.org/docs.html#howto>. Make sure that you have
- the version of pppd recommended in <file:Documentation/Changes>.
- The PPP option enlarges your kernel by about 16 KB.
-
- There are actually two versions of PPP: the traditional PPP for
- asynchronous lines, such as regular analog phone lines, and
- synchronous PPP which can be used over digital ISDN lines for
- example. If you want to use PPP over phone lines or other
- asynchronous serial lines, you need to say Y (or M) here and also to
- the next option, "PPP support for async serial ports". For PPP over
- synchronous lines, you should say Y (or M) here and to "Support
- synchronous PPP", below.
-
- 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 said Y to "Version information on all symbols" above, then
- you cannot compile the PPP driver into the kernel; you can then only
- compile it as a module. The module will be called ppp_generic.o.
- If you want to compile it as a module, say M here and read
- <file:Documentation/modules.txt> as well as
- <file:Documentation/networking/net-modules.txt>.
-
-config PPP_ASYNC
- tristate "PPP support for async serial ports"
- depends on PPP
- ---help---
- Say Y (or M) here if you want to be able to use PPP over standard
- asynchronous serial ports, such as COM1 or COM2 on a PC. If you use
- a modem (not a synchronous or ISDN modem) to contact your ISP, you
- need this option.
-
- This code is also available as a module (code which can be inserted
- into and removed from the running kernel). If you want to compile
- it as a module, say M here and read <file:Documentation/modules.txt>.
-
- If unsure, say Y.
-
-config PPP_SYNC_TTY
- tristate "PPP support for sync tty ports"
- depends on PPP
- help
- Say Y (or M) here if you want to be able to use PPP over synchronous
- (HDLC) tty devices, such as the SyncLink adapter. These devices
- are often used for high-speed leased lines like T1/E1.
-
- This code is also available as a module (code which can be inserted
- into and removed from the running kernel). If you want to compile
- it as a module, say M here and read
- <file:Documentation/modules.txt>.
-
-config PPP_DEFLATE
- tristate "PPP Deflate compression"
- depends on PPP
- ---help---
- Support for the Deflate compression method for PPP, which uses the
- Deflate algorithm (the same algorithm that gzip uses) to compress
- each PPP packet before it is sent over the wire. The machine at the
- other end of the PPP link (usually your ISP) has to support the
- Deflate compression method as well for this to be useful. Even if
- they don't support it, it is safe to say Y here.
-
- This code is also available as a module (code which can be inserted
- into and removed from the running kernel). If you want to compile
- it as a module, say M here and read
- <file:Documentation/modules.txt>.
-
-config PPP_BSDCOMP
- tristate "PPP BSD-Compress compression"
- depends on NETDEVICES && PPP!=n && m
- ---help---
- Support for the BSD-Compress compression method for PPP, which uses
- the LZW compression method to compress each PPP packet before it is
- sent over the wire. The machine at the other end of the PPP link
- (usually your ISP) has to support the BSD-Compress compression
- method as well for this to be useful. Even if they don't support it,
- it is safe to say Y here.
-
- The PPP Deflate compression method ("PPP Deflate compression",
- above) is preferable to BSD-Compress, because it compresses better
- and is patent-free.
-
- Note that the BSD compression code will always be compiled as a
- module; it is called bsd_comp.o and will show up in the directory
- modules once you have said "make modules". If unsure, say N.
-
-config SLIP
- tristate "SLIP (serial line) support"
- depends on NETDEVICES
- ---help---
- Say Y if you intend to use SLIP or CSLIP (compressed SLIP) to
- connect to your Internet service provider or to connect to some
- other local Unix box or if you want to configure your Linux box as a
- Slip/CSlip server for other people to dial in. SLIP (Serial Line
- Internet Protocol) is a protocol used to send Internet traffic over
- serial connections such as telephone lines or null modem cables;
- nowadays, the protocol PPP is more commonly used for this same
- purpose.
-
- Normally, your access provider has to support SLIP in order for you
- to be able to use it, but there is now a SLIP emulator called SLiRP
- around (available from
- <ftp://ibiblio.org/pub/Linux/system/network/serial/>) which
- allows you to use SLIP over a regular dial up shell connection. If
- you plan to use SLiRP, make sure to say Y to CSLIP, below. The
- NET-3-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>, explains how to
- configure SLIP. Note that you don't need this option if you just
- want to run term (term is a program which gives you almost full
- Internet connectivity if you have a regular dial up shell account on
- some Internet connected Unix computer. Read
- <http://www.bart.nl/~patrickr/term-howto/Term-HOWTO.html>). SLIP
- support will enlarge your kernel by about 4 KB. If unsure, say N.
-
- If you want to compile this as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want),
- say M here and read <file:Documentation/modules.txt> as well as
- <file:Documentation/networking/net-modules.txt>. The module will be
- called slip.o.
-
-config SLIP_COMPRESSED
- bool "CSLIP compressed headers"
- depends on SLIP
- ---help---
- This protocol is faster than SLIP because it uses compression on the
- TCP/IP headers (not on the data itself), but it has to be supported
- on both ends. Ask your access provider if you are not sure and
- answer Y, just in case. You will still be able to use plain SLIP. If
- you plan to use SLiRP, the SLIP emulator (available from
- <ftp://ibiblio.org/pub/Linux/system/network/serial/>) which
- allows you to use SLIP over a regular dial up shell connection, you
- definitely want to say Y here. The NET-3-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>, explains how to configure
- CSLIP. This won't enlarge your kernel.
-
-config SLIP_SMART
- bool "Keepalive and linefill"
- depends on SLIP
- help
- Adds additional capabilities to the SLIP driver to support the
- RELCOM line fill and keepalive monitoring. Ideal on poor quality
- analogue lines.
-
-config SLIP_MODE_SLIP6
- bool "Six bit SLIP encapsulation"
- depends on SLIP
- help
- Just occasionally you may need to run IP over hostile serial
- networks that don't pass all control characters or are only seven
- bit. Saying Y here adds an extra mode you can use with SLIP:
- "slip6". In this mode, SLIP will only send normal ASCII symbols over
- the serial device. Naturally, this has to be supported at the other
- end of the link as well. It's good enough, for example, to run IP
- over the async ports of a Camtec JNT Pad. If unsure, say N.
-
-config SUNLANCE
- tristate "Sun LANCE support"
- depends on NETDEVICES
- help
- This driver supports the "le" interface present on all 32-bit Sparc
- systems, on some older Ultra systems and as an Sbus option. These
- cards are based on the AMD Lance chipset, which is better known
- via the NE2100 cards.
-
- This support is also available as a module called sunlance.o ( =
- 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 <file:Documentation/modules.txt>.
-
-config HAPPYMEAL
- tristate "Sun Happy Meal 10/100baseT support"
- depends on NETDEVICES
- help
- This driver supports the "hme" interface present on most Ultra
- systems and as an option on older Sbus systems. This driver supports
- both PCI and Sbus devices. This driver also supports the "qfe" quad
- 100baseT device available in both PCI and Sbus configurations.
-
- This support is also available as a module called sunhme.o ( = 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 <file:Documentation/modules.txt>.
-
-config SUNBMAC
- tristate "Sun BigMAC 10/100baseT support (EXPERIMENTAL)"
- depends on NETDEVICES && EXPERIMENTAL
- help
- This driver supports the "be" interface available as an Sbus option.
- This is Sun's older 100baseT Ethernet device.
-
- This support is also available as a module called sunbmac.o ( = 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 <file:Documentation/modules.txt>.
-
-config SUNQE
- tristate "Sun QuadEthernet support"
- depends on NETDEVICES
- help
- This driver supports the "qe" 10baseT Ethernet device, available as
- an Sbus option. Note that this is not the same as Quad FastEthernet
- "qfe" which is supported by the Happy Meal driver instead.
-
- This support is also available as a module called sunqe.o ( = 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 <file:Documentation/modules.txt>.
-
-config MYRI_SBUS
- tristate "MyriCOM Gigabit Ethernet support"
- depends on NETDEVICES
- help
- This driver supports MyriCOM Sbus gigabit Ethernet cards.
-
- If you want to compile this driver as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want),
- say M here and read <file:Documentation/modules.txt>. This is
- recommended. The module will be called myri_sbus.o.
-
-config VORTEX
- tristate "3c590/3c900 series (592/595/597) \"Vortex/Boomerang\" support"
- depends on NETDEVICES && PCI
- ---help---
- This option enables driver support for a large number of 10mbps and
- 10/100mbps EISA, PCI and PCMCIA 3Com network cards:
-
- "Vortex" (Fast EtherLink 3c590/3c592/3c595/3c597) EISA and PCI
- "Boomerang" (EtherLink XL 3c900 or 3c905) PCI
- "Cyclone" (3c540/3c900/3c905/3c980/3c575/3c656) PCI and Cardbus
- "Tornado" (3c905) PCI
- "Hurricane" (3c555/3cSOHO) PCI
-
- If you have such a card, say Y and read the Ethernet-HOWTO,
- available from <http://www.linuxdoc.org/docs.html#howto>. More
- specific information is in
- <file:Documentation/networking/vortex.txt> and in the comments at
- the beginning of <file:drivers/net/3c59x.c>.
-
- If you want to compile this as a module ( = code which can be
- inserted in and removed from the running kernel whenever you want),
- say M here and read <file:Documentation/modules.txt> as well as
- <file:Documentation/networking/net-modules.txt>.
-
-# bool ' FDDI driver support' CONFIG_FDDI
-# if [ "$CONFIG_FDDI" = "y" ]; then
-# fi
-source "drivers/atm/Kconfig"
-
-endmenu
-
source "net/ax25/Kconfig"
# This one must be before the filesystem configs. -DaveM
diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile
index 943ca6d17905..c3df9d40ef79 100644
--- a/arch/sparc/Makefile
+++ b/arch/sparc/Makefile
@@ -53,27 +53,26 @@ NET_Y := $(patsubst %/, %/built-in.o, $(net-y))
LIBS_Y := $(patsubst %/, %/lib.a, $(libs-y))
export INIT_Y CORE_Y DRIVERS_Y NET_Y LIBS_Y HEAD
-image: vmlinux
- $(MAKE) -C arch/sparc/boot image
+makeboot =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/$(ARCH)/boot $(1)
+
+image tftpboot.img: vmlinux
+ $(call makeboot,arch/sparc/boot/$@)
archclean:
- rm -f $(TOPDIR)/vmlinux.aout
- -$(MAKE) -C arch/sparc/boot clean
+ $(Q)$(MAKE) -f scripts/Makefile.clean obj=arch/$(ARCH)/boot
archmrproper:
- rm -f $(TOPDIR)/include/asm-sparc/asm_offsets.h
prepare: include/asm-$(ARCH)/asm_offsets.h
arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
include/config/MARKER
-include/asm-$(ARCH)/asm_offsets.h.tmp: arch/$(ARCH)/kernel/asm-offsets.s
- @$(generate-asm-offsets.h) < $< > $@
-
-include/asm-$(ARCH)/asm_offsets.h: include/asm-$(ARCH)/asm_offsets.h.tmp
+include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
@echo -n ' Generating $@'
+ @$(generate-asm-offsets.h) < $< > $@.tmp
@$(update-if-changed)
-tftpboot.img:
- $(MAKE) -C arch/sparc/boot tftpboot.img
+CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h.tmp \
+ include/asm-$(ARCH)/asm_offsets.h \
+ arch/$(ARCH)/kernel/asm-offsets.s
diff --git a/arch/sparc/boot/Makefile b/arch/sparc/boot/Makefile
index 983c8e40cf19..e979c4b20871 100644
--- a/arch/sparc/boot/Makefile
+++ b/arch/sparc/boot/Makefile
@@ -4,38 +4,35 @@
# Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
# Copyright (C) 1997,1998 Jakub Jelinek (jj@ultra.linux.cz)
-ROOT_IMG =/usr/src/root.img
-ELFTOAOUT =elftoaout
+ROOT_IMG := /usr/src/root.img
+ELFTOAOUT := elftoaout
-all: btfix.o
+host-progs := piggyback btfixupprep
+EXTRA_TARGETS := tftpboot.img btfix.o btfix.s image
-tftpboot.img: piggyback
- $(ELFTOAOUT) $(TOPDIR)/vmlinux -o tftpboot.img
- ./piggyback tftpboot.img $(TOPDIR)/System.map $(ROOT_IMG)
-
-piggyback: piggyback.c
- $(HOSTCC) $(HOSTCFLAGS) -o piggyback piggyback.c
-
-btfixupprep: btfixupprep.c
- $(HOSTCC) $(HOSTCFLAGS) -o btfixupprep btfixupprep.c
-
-clean:
- rm -f btfixupprep piggyback tftpboot.img btfix.o btfix.s image
+quiet_cmd_elftoaout = ELFTOAOUT $@
+ cmd_elftoaout = $(ELFTOAOUT) $(obj)/image -o $@
+quiet_cmd_piggy = PIGGY $@
+ cmd_piggy = $(obj)/piggyback $@ $(obj)/System.map $(ROOT_IMG)
+quiet_cmd_btfix = BTFIX $@
+ cmd_btfix = $(OBJDUMP) -x vmlinux | $(obj)/btfixupprep > $@
BTOBJS := $(HEAD) $(INIT_Y)
BTLIBS := $(CORE_Y) $(LIBS_Y) $(DRIVERS_Y) $(NET_Y)
+LDFLAGS_image := -T arch/sparc/vmlinux.lds.s $(BTOBJS) --start-group $(BTLIBS) --end-group
# Actual linking
-image: btfix.o
- $(LD) $(LDFLAGS) -T ../vmlinux.lds.s \
- $(patsubst %,$(TOPDIR)/%,$(BTOBJS)) \
- --start-group \
- $(patsubst %,$(TOPDIR)/%,$(BTLIBS)) \
- btfix.o \
- --end-group -o image
-
-btfix.s: btfixupprep $(TOPDIR)/vmlinux
- $(OBJDUMP) -x $(TOPDIR)/vmlinux | ./btfixupprep > btfix.s
-
-btfix.o: btfix.s
- $(CC) -c -o btfix.o btfix.s
+$(obj)/image: $(obj)/btfix.o FORCE
+ $(call if_changed,ld)
+ $(NM) $@ | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > $(obj)/System.map
+
+$(obj)/tftpboot.img: $(obj)/piggyback $(obj)/System.map $(obj)/image FORCE
+ $(call if_changed,elftoaout)
+ $(call if_changed,piggy)
+
+$(obj)/btfix.s: $(obj)/btfixupprep vmlinux FORCE
+ $(call if_changed,btfix)
+
+archhelp:
+ @echo '* image - kernel image ($(obj)/image)'
+ @echo ' tftpboot.img - image prepared for tftp'
diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile
index 2eab65c8f31a..06a1371a97f7 100644
--- a/arch/sparc/kernel/Makefile
+++ b/arch/sparc/kernel/Makefile
@@ -2,15 +2,13 @@
# Makefile for the linux kernel.
#
-SH = $(CONFIG_SHELL)
-
EXTRA_TARGETS := head.o init_task.o
-EXTRA_AFLAGS := -ansi
+EXTRA_AFLAGS := -ansi
export-objs := sparc_ksyms.o
IRQ_OBJS := irq.o sun4m_irq.o sun4c_irq.o sun4d_irq.o
-obj-y := entry.o wof.o wuf.o etrap.o rtrap.o traps.o ${IRQ_OBJS} \
+obj-y := entry.o wof.o wuf.o etrap.o rtrap.o traps.o $(IRQ_OBJS) \
process.o signal.o ioport.o setup.o idprom.o \
sys_sparc.o sunos_asm.o systbls.o \
time.o windows.o cpu.o devices.o sclow.o \
diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c
index 1adbf88aee8f..e72292b59349 100644
--- a/arch/sparc/kernel/sparc_ksyms.c
+++ b/arch/sparc/kernel/sparc_ksyms.c
@@ -103,7 +103,8 @@ __attribute__((section("__ksymtab"))) = \
/* used by various drivers */
EXPORT_SYMBOL(sparc_cpu_model);
EXPORT_SYMBOL(kernel_thread);
-#ifdef SPIN_LOCK_DEBUG
+#ifdef CONFIG_DEBUG_SPINLOCK
+#ifdef CONFIG_SMP
EXPORT_SYMBOL(_do_spin_lock);
EXPORT_SYMBOL(_do_spin_unlock);
EXPORT_SYMBOL(_spin_trylock);
@@ -111,10 +112,12 @@ EXPORT_SYMBOL(_do_read_lock);
EXPORT_SYMBOL(_do_read_unlock);
EXPORT_SYMBOL(_do_write_lock);
EXPORT_SYMBOL(_do_write_unlock);
+#endif
#else
-EXPORT_SYMBOL_PRIVATE(_rw_read_enter);
-EXPORT_SYMBOL_PRIVATE(_rw_read_exit);
-EXPORT_SYMBOL_PRIVATE(_rw_write_enter);
+// XXX find what uses (or used) these.
+// EXPORT_SYMBOL_PRIVATE(_rw_read_enter);
+// EXPORT_SYMBOL_PRIVATE(_rw_read_exit);
+// EXPORT_SYMBOL_PRIVATE(_rw_write_enter);
#endif
/* semaphores */
EXPORT_SYMBOL(__up);
diff --git a/arch/sparc/kernel/sun4c_irq.c b/arch/sparc/kernel/sun4c_irq.c
index ee1df80fd42d..22b1ea12186f 100644
--- a/arch/sparc/kernel/sun4c_irq.c
+++ b/arch/sparc/kernel/sun4c_irq.c
@@ -34,6 +34,7 @@
#include <asm/sun4paddr.h>
#include <asm/idprom.h>
#include <asm/machines.h>
+#include <asm/sbus.h>
#if 0
static struct resource sun4c_timer_eb = { "sun4c_timer" };
@@ -51,6 +52,17 @@ static struct resource sun4c_intr_eb = { "sun4c_intr" };
*/
unsigned char *interrupt_enable = 0;
+static int sun4c_pil_map[] = { 0, 1, 2, 3, 5, 7, 8, 9 };
+
+unsigned int sun4c_sbint_to_irq(struct sbus_dev *sdev, unsigned int sbint)
+{
+ if (sbint >= sizeof(sun4c_pil_map)) {
+ printk(KERN_ERR "%s: bogus SBINT %d\n", sdev->prom_name, sbint);
+ BUG();
+ }
+ return sun4c_pil_map[sbint];
+}
+
static void sun4c_disable_irq(unsigned int irq_nr)
{
unsigned long flags;
@@ -213,6 +225,7 @@ void __init sun4c_init_IRQ(void)
int_regs[0].reg_size, "sun4c_intr");
}
+ BTFIXUPSET_CALL(sbint_to_irq, sun4c_sbint_to_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(enable_irq, sun4c_enable_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(disable_irq, sun4c_disable_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(enable_pil_irq, sun4c_enable_irq, BTFIXUPCALL_NORM);
diff --git a/arch/sparc/kernel/sun4d_irq.c b/arch/sparc/kernel/sun4d_irq.c
index a23291d1c905..39010033cbad 100644
--- a/arch/sparc/kernel/sun4d_irq.c
+++ b/arch/sparc/kernel/sun4d_irq.c
@@ -252,6 +252,15 @@ unsigned int sun4d_build_irq(struct sbus_dev *sdev, int irq)
return irq;
}
+unsigned int sun4d_sbint_to_irq(struct sbus_dev *sdev, unsigned int sbint)
+{
+ if (sbint >= sizeof(sbus_to_pil)) {
+ printk(KERN_ERR "%s: bogus SBINT %d\n", sdev->prom_name, sbint);
+ BUG();
+ }
+ return sun4d_build_irq(sdev, sbus_to_pil[sbint]);
+}
+
int sun4d_request_irq(unsigned int irq,
void (*handler)(int, void *, struct pt_regs *),
unsigned long irqflags, const char * devname, void *dev_id)
@@ -541,6 +550,7 @@ void __init sun4d_init_IRQ(void)
{
local_irq_disable();
+ BTFIXUPSET_CALL(sbint_to_irq, sun4d_sbint_to_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(enable_irq, sun4d_enable_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(disable_irq, sun4d_disable_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(clear_clock_irq, sun4d_clear_clock_irq, BTFIXUPCALL_NORM);
diff --git a/arch/sparc/kernel/sun4m_irq.c b/arch/sparc/kernel/sun4m_irq.c
index 6280baf60539..eb2fcff68da4 100644
--- a/arch/sparc/kernel/sun4m_irq.c
+++ b/arch/sparc/kernel/sun4m_irq.c
@@ -36,6 +36,7 @@
#include <asm/smp.h>
#include <asm/irq.h>
#include <asm/io.h>
+#include <asm/sbus.h>
static unsigned long dummy;
@@ -77,6 +78,17 @@ static unsigned long irq_mask[] = {
SUN4M_INT_SBUS(6) /* 14 irq 13 */
};
+static int sun4m_pil_map[] = { 0, 2, 3, 5, 7, 9, 11, 13 };
+
+unsigned int sun4m_sbint_to_irq(struct sbus_dev *sdev, unsigned int sbint)
+{
+ if (sbint >= sizeof(sun4m_pil_map)) {
+ printk(KERN_ERR "%s: bogus SBINT %d\n", sdev->prom_name, sbint);
+ BUG();
+ }
+ return sun4m_pil_map[sbint] | 0x30;
+}
+
inline unsigned long sun4m_get_irqmask(unsigned int irq)
{
unsigned long mask;
@@ -366,6 +378,7 @@ void __init sun4m_init_IRQ(void)
&sun4m_interrupts->undirected_target;
sun4m_interrupts->undirected_target = 0;
}
+ BTFIXUPSET_CALL(sbint_to_irq, sun4m_sbint_to_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(enable_irq, sun4m_enable_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(disable_irq, sun4m_disable_irq, BTFIXUPCALL_NORM);
BTFIXUPSET_CALL(enable_pil_irq, sun4m_enable_pil_irq, BTFIXUPCALL_NORM);
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index 815b9fef3e18..b5403396d199 100644
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -986,7 +986,7 @@ choice
optional
depends on SCSI && PCI
-source "drivers/scsi/aic7xxx/Kconfig"
+source "drivers/scsi/aic7xxx/Kconfig.aic7xxx"
config SCSI_AIC7XXX_OLD
tristate "Old driver"
@@ -1404,47 +1404,6 @@ source "drivers/ieee1394/Kconfig"
source "net/Kconfig"
-
-menu "Network device support"
- depends on NET
-
-config NETDEVICES
- bool "Network device support"
- ---help---
- You can say N here if you don't intend to connect your Linux box to
- any other computer at all or if all your connections will be over a
- telephone line with a modem either via UUCP (UUCP is a protocol to
- forward mail and news between unix hosts over telephone lines; read
- the UUCP-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>) or dialing up a shell
- account or a BBS, even using term (term is a program which gives you
- almost full Internet connectivity if you have a regular dial up
- shell account on some Internet connected Unix computer. Read
- <http://www.bart.nl/~patrickr/term-howto/Term-HOWTO.html>).
-
- You'll have to say Y if your computer contains a network card that
- you want to use under Linux (make sure you know its name because you
- will be asked for it and read the Ethernet-HOWTO (especially if you
- plan to use more than one network card under Linux)) or if you want
- to use SLIP (Serial Line Internet Protocol is the protocol used to
- send Internet traffic over telephone lines or null modem cables) or
- CSLIP (compressed SLIP) or PPP (Point to Point Protocol, a better
- and newer replacement for SLIP) or PLIP (Parallel Line Internet
- Protocol is mainly used to create a mini network by connecting the
- parallel ports of two local machines) or AX.25/KISS (protocol for
- sending Internet traffic over amateur radio links).
-
- Make sure to read the NET-3-HOWTO. Eventually, you will have to read
- Olaf Kirch's excellent and free book "Network Administrator's
- Guide", to be found in <http://www.linuxdoc.org/docs.html#guide>. If
- unsure, say Y.
-
-source "drivers/net/Kconfig"
-
-source "drivers/atm/Kconfig"
-
-endmenu
-
source "net/ax25/Kconfig"
# This one must be before the filesystem configs. -DaveM
diff --git a/arch/sparc64/Makefile b/arch/sparc64/Makefile
index 32ef5188df77..f4064a5ea142 100644
--- a/arch/sparc64/Makefile
+++ b/arch/sparc64/Makefile
@@ -74,8 +74,13 @@ drivers-$(CONFIG_OPROFILE) += arch/sparc64/oprofile/
tftpboot.img vmlinux.aout:
$(Q)$(MAKE) $(build)=arch/sparc64/boot arch/sparc64/boot/$@
+archclean:
+
+archmrproper:
+
define archhelp
echo '* vmlinux - Standard sparc64 kernel'
echo ' vmlinux.aout - a.out kernel for sparc64'
echo ' tftpboot.img - Image prepared for tftp'
endef
+
diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c
index 2ddea3f674e8..e22bbcc94a97 100644
--- a/arch/sparc64/kernel/sys_sparc32.c
+++ b/arch/sparc64/kernel/sys_sparc32.c
@@ -804,30 +804,6 @@ out:
return err;
}
-static inline int get_flock(struct flock *kfl, struct flock32 *ufl)
-{
- int err;
-
- err = get_user(kfl->l_type, &ufl->l_type);
- err |= __get_user(kfl->l_whence, &ufl->l_whence);
- err |= __get_user(kfl->l_start, &ufl->l_start);
- err |= __get_user(kfl->l_len, &ufl->l_len);
- err |= __get_user(kfl->l_pid, &ufl->l_pid);
- return err;
-}
-
-static inline int put_flock(struct flock *kfl, struct flock32 *ufl)
-{
- int err;
-
- err = __put_user(kfl->l_type, &ufl->l_type);
- err |= __put_user(kfl->l_whence, &ufl->l_whence);
- err |= __put_user(kfl->l_start, &ufl->l_start);
- err |= __put_user(kfl->l_len, &ufl->l_len);
- err |= __put_user(kfl->l_pid, &ufl->l_pid);
- return err;
-}
-
extern asmlinkage long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg);
asmlinkage long sys32_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg)
@@ -841,13 +817,13 @@ asmlinkage long sys32_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg
mm_segment_t old_fs;
long ret;
- if (get_flock(&f, (struct flock32 *)arg))
+ if (get_compat_flock(&f, (struct compat_flock *)arg))
return -EFAULT;
old_fs = get_fs(); set_fs (KERNEL_DS);
ret = sys_fcntl(fd, cmd, (unsigned long)&f);
set_fs (old_fs);
if (ret) return ret;
- if (put_flock(&f, (struct flock32 *)arg))
+ if (put_compat_flock(&f, (struct compat_flock *)arg))
return -EFAULT;
return 0;
}
diff --git a/arch/v850/Kconfig b/arch/v850/Kconfig
index c96e55a6aebd..2c1ab625eb77 100644
--- a/arch/v850/Kconfig
+++ b/arch/v850/Kconfig
@@ -304,47 +304,6 @@ source "drivers/message/i2o/Kconfig"
source "net/Kconfig"
-
-menu "Network device support"
- depends on NET
-
-config NETDEVICES
- bool "Network device support"
- ---help---
- You can say N here if you don't intend to connect your Linux box to
- any other computer at all or if all your connections will be over a
- telephone line with a modem either via UUCP (UUCP is a protocol to
- forward mail and news between unix hosts over telephone lines; read
- the UUCP-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>) or dialing up a shell
- account or a BBS, even using term (term is a program which gives you
- almost full Internet connectivity if you have a regular dial up
- shell account on some Internet connected Unix computer. Read
- <http://www.bart.nl/~patrickr/term-howto/Term-HOWTO.html>).
-
- You'll have to say Y if your computer contains a network card that
- you want to use under Linux (make sure you know its name because you
- will be asked for it and read the Ethernet-HOWTO (especially if you
- plan to use more than one network card under Linux)) or if you want
- to use SLIP (Serial Line Internet Protocol is the protocol used to
- send Internet traffic over telephone lines or null modem cables) or
- CSLIP (compressed SLIP) or PPP (Point to Point Protocol, a better
- and newer replacement for SLIP) or PLIP (Parallel Line Internet
- Protocol is mainly used to create a mini network by connecting the
- parallel ports of two local machines) or AX.25/KISS (protocol for
- sending Internet traffic over amateur radio links).
-
- Make sure to read the NET-3-HOWTO. Eventually, you will have to read
- Olaf Kirch's excellent and free book "Network Administrator's
- Guide", to be found in <http://www.linuxdoc.org/docs.html#guide>. If
- unsure, say Y.
-
-source "drivers/net/Kconfig"
-
-source "drivers/atm/Kconfig"
-
-endmenu
-
source "net/ax25/Kconfig"
source "net/irda/Kconfig"
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig
index 13f7e51be1b3..6d95f38a29d8 100644
--- a/arch/x86_64/Kconfig
+++ b/arch/x86_64/Kconfig
@@ -567,49 +567,6 @@ source "drivers/ieee1394/Kconfig"
#source drivers/message/i2o/Config.in
source "net/Kconfig"
-
-menu "Network device support"
- depends on NET
-
-config NETDEVICES
- bool "Network device support"
- ---help---
- You can say N here if you don't intend to connect your Linux box to
- any other computer at all or if all your connections will be over a
- telephone line with a modem either via UUCP (UUCP is a protocol to
- forward mail and news between unix hosts over telephone lines; read
- the UUCP-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>) or dialing up a shell
- account or a BBS, even using term (term is a program which gives you
- almost full Internet connectivity if you have a regular dial up
- shell account on some Internet connected Unix computer. Read
- <http://www.bart.nl/~patrickr/term-howto/Term-HOWTO.html>).
-
- You'll have to say Y if your computer contains a network card that
- you want to use under Linux (make sure you know its name because you
- will be asked for it and read the Ethernet-HOWTO (especially if you
- plan to use more than one network card under Linux)) or if you want
- to use SLIP (Serial Line Internet Protocol is the protocol used to
- send Internet traffic over telephone lines or null modem cables) or
- CSLIP (compressed SLIP) or PPP (Point to Point Protocol, a better
- and newer replacement for SLIP) or PLIP (Parallel Line Internet
- Protocol is mainly used to create a mini network by connecting the
- parallel ports of two local machines) or AX.25/KISS (protocol for
- sending Internet traffic over amateur radio links).
-
- Make sure to read the NET-3-HOWTO. Eventually, you will have to read
- Olaf Kirch's excellent and free book "Network Administrator's
- Guide", to be found in <http://www.linuxdoc.org/docs.html#guide>. If
- unsure, say Y.
-
-source "drivers/net/Kconfig"
-
-# ATM seems to be largely 64bit unsafe and also unmaintained - disable it for now.
-# if [ "$CONFIG_ATM" = "y" ]; then
-# source drivers/atm/Config.in
-# fi
-endmenu
-
source "net/ax25/Kconfig"
source "net/irda/Kconfig"
diff --git a/arch/x86_64/ia32/sys_ia32.c b/arch/x86_64/ia32/sys_ia32.c
index 9a53811f2499..bfa49f6bdb34 100644
--- a/arch/x86_64/ia32/sys_ia32.c
+++ b/arch/x86_64/ia32/sys_ia32.c
@@ -1066,30 +1066,6 @@ sys32_getrusage(int who, struct rusage32 *ru)
return ret;
}
-static inline int get_flock(struct flock *kfl, struct flock32 *ufl)
-{
- int err;
-
- err = get_user(kfl->l_type, &ufl->l_type);
- err |= __get_user(kfl->l_whence, &ufl->l_whence);
- err |= __get_user(kfl->l_start, &ufl->l_start);
- err |= __get_user(kfl->l_len, &ufl->l_len);
- err |= __get_user(kfl->l_pid, &ufl->l_pid);
- return err;
-}
-
-static inline int put_flock(struct flock *kfl, struct flock32 *ufl)
-{
- int err;
-
- err = __put_user(kfl->l_type, &ufl->l_type);
- err |= __put_user(kfl->l_whence, &ufl->l_whence);
- err |= __put_user(kfl->l_start, &ufl->l_start);
- err |= __put_user(kfl->l_len, &ufl->l_len);
- err |= __put_user(kfl->l_pid, &ufl->l_pid);
- return err;
-}
-
extern asmlinkage long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg);
asmlinkage long sys32_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg);
@@ -1105,13 +1081,13 @@ asmlinkage long sys32_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg
mm_segment_t old_fs;
long ret;
- if (get_flock(&f, (struct flock32 *)arg))
+ if (get_compat_flock(&f, (struct compat_flock *)arg))
return -EFAULT;
old_fs = get_fs(); set_fs (KERNEL_DS);
ret = sys_fcntl(fd, cmd, (unsigned long)&f);
set_fs (old_fs);
if (ret) return ret;
- if (put_flock(&f, (struct flock32 *)arg))
+ if (put_compat_flock(&f, (struct compat_flock *)arg))
return -EFAULT;
return 0;
}
diff --git a/drivers/char/agp/Kconfig b/drivers/char/agp/Kconfig
index b27355fe0135..b68000d5da44 100644
--- a/drivers/char/agp/Kconfig
+++ b/drivers/char/agp/Kconfig
@@ -61,6 +61,16 @@ config AGP_VIA
You should say Y here if you use XFree86 3.3.6 or 4.x and want to
use GLX or DRI. If unsure, say N.
+config AGP_VIA_KT400
+ tristate "VIA KT400 chipset support"
+ depends on AGP3
+ help
+ This option gives you AGP support for the GLX component of the
+ XFree86 4.x on VIA KT400 AGP 3.0 chipsets.
+
+ You should say Y here if you use XFree86 3.3.6 or 4.x and want to
+ use GLX or DRI. If unsure, say N.
+
config AGP_AMD
tristate "AMD Irongate, 761, and 762 support"
depends on AGP
diff --git a/drivers/char/agp/Makefile b/drivers/char/agp/Makefile
index 88f62c3284fc..2ff6e33ffb4e 100644
--- a/drivers/char/agp/Makefile
+++ b/drivers/char/agp/Makefile
@@ -12,6 +12,7 @@ obj-$(CONFIG_AGP) += agpgart.o
obj-$(CONFIG_AGP_INTEL) += intel-agp.o
obj-$(CONFIG_AGP_VIA) += via-agp.o
+obj-$(CONFIG_AGP_VIA_KT400) += via-kt400.o
obj-$(CONFIG_AGP_AMD) += amd-k7-agp.o
obj-$(CONFIG_AGP_SIS) += sis-agp.o
obj-$(CONFIG_AGP_ALI) += ali-agp.o
diff --git a/drivers/char/agp/agp.h b/drivers/char/agp/agp.h
index e001b44a5b39..d0fc9f658abf 100644
--- a/drivers/char/agp/agp.h
+++ b/drivers/char/agp/agp.h
@@ -1,5 +1,6 @@
/*
- * AGPGART module version 0.99
+ * AGPGART module
+ * Copyright (C) 2002 Dave Jones
* Copyright (C) 1999 Jeff Hartmann
* Copyright (C) 1999 Precision Insight, Inc.
* Copyright (C) 1999 Xi Graphics, Inc.
@@ -46,6 +47,7 @@ void agp_generic_destroy_page(void *addr);
int agp_generic_suspend(void);
void agp_generic_resume(void);
void agp_free_key(int key);
+int agp_num_entries(void);
#define PFX "agpgart: "
@@ -292,6 +294,9 @@ struct agp_bridge_data {
#define VIA_ATTBASE 0x88
/* VIA KT400 */
+#define VIA_AGP3_GARTCTRL 0x90
+#define VIA_AGP3_APSIZE 0x94
+#define VIA_AGP3_ATTBASE 0x98
#define VIA_AGPSEL 0xfd
/* SiS registers */
diff --git a/drivers/char/agp/amd-k8-agp.c b/drivers/char/agp/amd-k8-agp.c
index f7a2a3f81d0b..4b9e5994f6b4 100644
--- a/drivers/char/agp/amd-k8-agp.c
+++ b/drivers/char/agp/amd-k8-agp.c
@@ -14,8 +14,6 @@
#include <linux/agp_backend.h>
#include "agp.h"
-extern int agp_memory_reserved;
-
static u_int64_t pci_read64 (struct pci_dev *dev, int reg)
{
union {
@@ -48,16 +46,11 @@ static void pci_write64 (struct pci_dev *dev, int reg, u64 value)
static int x86_64_insert_memory(agp_memory * mem, off_t pg_start, int type)
{
int i, j, num_entries;
- void *temp;
long tmp;
u32 pte;
u64 addr;
- temp = agp_bridge.current_size;
-
- num_entries = A_SIZE_32(temp)->num_entries;
-
- num_entries -= agp_memory_reserved>>PAGE_SHIFT;
+ num_entries = agp_num_entries();
if (type != 0 || mem->type != 0)
return -EINVAL;
diff --git a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c
index a901a2af7cdb..65cf115d48ce 100644
--- a/drivers/char/agp/backend.c
+++ b/drivers/char/agp/backend.c
@@ -1,5 +1,5 @@
/*
- * AGPGART module version 1.0
+ * AGPGART driver backend routines.
* Copyright (C) 2002 Dave Jones.
* Copyright (C) 1999 Jeff Hartmann.
* Copyright (C) 1999 Precision Insight, Inc.
diff --git a/drivers/char/agp/frontend.c b/drivers/char/agp/frontend.c
index 46f7d16c9f65..2fb607ad1b4c 100644
--- a/drivers/char/agp/frontend.c
+++ b/drivers/char/agp/frontend.c
@@ -1,5 +1,6 @@
/*
- * AGPGART module frontend version 0.99
+ * AGPGART driver frontend
+ * Copyright (C) 2002 Dave Jones
* Copyright (C) 1999 Jeff Hartmann
* Copyright (C) 1999 Precision Insight, Inc.
* Copyright (C) 1999 Xi Graphics, Inc.
diff --git a/drivers/char/agp/generic-3.0.c b/drivers/char/agp/generic-3.0.c
index 11a7a4df100f..5319451fa81d 100644
--- a/drivers/char/agp/generic-3.0.c
+++ b/drivers/char/agp/generic-3.0.c
@@ -1,3 +1,7 @@
+/*
+ * Generic routines for AGP 3.0 compliant bridges.
+ */
+
#include <linux/list.h>
#include <linux/pci.h>
#include <linux/agp_backend.h>
@@ -393,8 +397,7 @@ static int agp_3_0_node_enable(u32 mode, u32 minor)
if(mcapndx == 0) {
printk(KERN_ERR PFX "woah! Non-AGP device "
- "found on the secondary bus of an AGP 3.0 "
- "bridge!\n");
+ "found on the secondary bus of an AGP 3.0 bridge!\n");
ret = -ENODEV;
goto free_and_exit;
}
@@ -442,9 +445,8 @@ static int agp_3_0_node_enable(u32 mode, u32 minor)
rate = 0x2;
break;
default:
- printk(KERN_ERR PFX "woah! Bogus AGP rate "
- "value found advertised behind an AGP 3.0 "
- "bridge!\n");
+ printk(KERN_ERR PFX "woah! Bogus AGP rate (%d) "
+ "value found advertised behind an AGP 3.0 bridge!\n", rate);
ret = -ENODEV;
goto free_and_exit;
}
@@ -455,12 +457,10 @@ static int agp_3_0_node_enable(u32 mode, u32 minor)
* whether isochronous transfers are supported.
*/
if(isoch != 0) {
- if((ret = agp_3_0_isochronous_node_enable(dev_list,
- ndevs)) != 0)
+ if((ret = agp_3_0_isochronous_node_enable(dev_list, ndevs)) != 0)
goto free_and_exit;
} else {
- if((ret = agp_3_0_nonisochronous_node_enable(dev_list,
- ndevs)) != 0)
+ if((ret = agp_3_0_nonisochronous_node_enable(dev_list,ndevs)) != 0)
goto free_and_exit;
}
@@ -534,8 +534,7 @@ int agp_generic_agp_3_0_enable(u32 mode)
major = (ncapid >> 20) & 0xf;
minor = (ncapid >> 16) & 0xf;
- printk(KERN_INFO PFX "Found an AGP %d.%d compliant device.\n",
- major, minor);
+ printk(KERN_INFO PFX "Found an AGP %d.%d compliant device.\n",major, minor);
if(major >= 3) {
pci_read_config_dword(agp_bridge.dev, agp_bridge.capndx + 0x4, &agp_3_0);
diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c
index cc5ab2feb26e..6a55778defc9 100644
--- a/drivers/char/agp/generic.c
+++ b/drivers/char/agp/generic.c
@@ -1,5 +1,5 @@
/*
- * AGPGART module version 1.0
+ * AGPGART driver.
* Copyright (C) 2002 Dave Jones.
* Copyright (C) 1999 Jeff Hartmann.
* Copyright (C) 1999 Precision Insight, Inc.
@@ -203,6 +203,40 @@ static int agp_return_size(void)
return current_size;
}
+int agp_num_entries(void)
+{
+ int num_entries;
+ void *temp;
+
+ temp = agp_bridge.current_size;
+
+ switch (agp_bridge.size_type) {
+ case U8_APER_SIZE:
+ num_entries = A_SIZE_8(temp)->num_entries;
+ break;
+ case U16_APER_SIZE:
+ num_entries = A_SIZE_16(temp)->num_entries;
+ break;
+ case U32_APER_SIZE:
+ num_entries = A_SIZE_32(temp)->num_entries;
+ break;
+ case LVL2_APER_SIZE:
+ num_entries = A_SIZE_LVL2(temp)->num_entries;
+ break;
+ case FIXED_APER_SIZE:
+ num_entries = A_SIZE_FIX(temp)->num_entries;
+ break;
+ default:
+ num_entries = 0;
+ break;
+ }
+
+ num_entries -= agp_memory_reserved>>PAGE_SHIFT;
+ if (num_entries<0)
+ num_entries = 0;
+ return num_entries;
+}
+
/* Routine to copy over information structure */
int agp_copy_info(agp_kern_info * info)
@@ -713,3 +747,5 @@ EXPORT_SYMBOL(agp_generic_alloc_by_type);
EXPORT_SYMBOL(agp_generic_free_by_type);
EXPORT_SYMBOL(global_cache_flush);
+EXPORT_SYMBOL_GPL(agp_num_entries);
+
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
index ee2961fc4834..c9457777eb64 100644
--- a/drivers/char/agp/intel-agp.c
+++ b/drivers/char/agp/intel-agp.c
@@ -1467,7 +1467,9 @@ static struct __initdata pci_driver agp_intel_pci_driver = {
.probe = agp_intel_probe,
};
-static int __init agp_intel_init(void)
+/* intel_agp_init() must not be declared static for explicit
+ early initialization to work (ie i810fb) */
+int __init agp_intel_init(void)
{
int ret_val;
static int agp_initialised=0;
diff --git a/drivers/char/agp/via-agp.c b/drivers/char/agp/via-agp.c
index a6b774459075..b9ec5981f6ce 100644
--- a/drivers/char/agp/via-agp.c
+++ b/drivers/char/agp/via-agp.c
@@ -124,65 +124,23 @@ static int __init via_generic_setup (struct pci_dev *pdev)
return 0;
}
-#ifdef CONFIG_AGP3
/*
* The KT400 does magick to put the AGP bridge compliant with the same
* standards version as the graphics card. If we haven't fallen into
- * 2.0 compatability mode, we run the normal 3.0 code, and fall back
- * if something nasty happens.
+ * 2.0 compatability mode, we abort, as this gets picked up by
+ * via-agp3.o
*/
-static void __init via_kt400_enable(u32 mode)
-{
- if ((agp_generic_agp_3_0_enable(mode))==FALSE)
- /* Something weird happened, fall back to 2.0 */
- agp_generic_agp_enable(mode);
-}
-#endif
static int __init via_kt400_setup(struct pci_dev *pdev)
{
u8 reg;
-
- agp_bridge.masks = via_generic_masks;
- agp_bridge.num_of_masks = 1;
- agp_bridge.aperture_sizes = (void *) via_generic_sizes;
- agp_bridge.size_type = U8_APER_SIZE;
- agp_bridge.num_aperture_sizes = 7;
- agp_bridge.dev_private_data = NULL;
- agp_bridge.needs_scratch_page = FALSE;
- agp_bridge.configure = via_configure;
- agp_bridge.fetch_size = via_fetch_size;
- agp_bridge.cleanup = via_cleanup;
- agp_bridge.tlb_flush = via_tlbflush;
- agp_bridge.mask_memory = via_mask_memory;
- agp_bridge.cache_flush = global_cache_flush;
- agp_bridge.create_gatt_table = agp_generic_create_gatt_table;
- agp_bridge.free_gatt_table = agp_generic_free_gatt_table;
- agp_bridge.insert_memory = agp_generic_insert_memory;
- agp_bridge.remove_memory = agp_generic_remove_memory;
- agp_bridge.alloc_by_type = agp_generic_alloc_by_type;
- agp_bridge.free_by_type = agp_generic_free_by_type;
- agp_bridge.agp_alloc_page = agp_generic_alloc_page;
- agp_bridge.agp_destroy_page = agp_generic_destroy_page;
- agp_bridge.suspend = agp_generic_suspend;
- agp_bridge.resume = agp_generic_resume;
- agp_bridge.cant_use_aperture = 0;
-
pci_read_config_byte(pdev, VIA_AGPSEL, &reg);
+ /* Check AGP 2.0 compatability mode. */
if ((reg & (1<<1))==1) {
- /* AGP 2.0 compatability mode. */
- agp_bridge.agp_enable = agp_generic_agp_enable;
-
- } else {
-#ifdef CONFIG_AGP3
- /* AGP 3.0 mode */
- agp_bridge.agp_enable = via_kt400_enable;
-#else
- printk ("AGP: VIA KT400 in AGP3.0 mode support not compiled in.\n");
- return -ENODEV;
-#endif
+ via_generic_setup(pdev);
+ return 0;
}
- return 0;
+ return -ENODEV;
}
static struct agp_device_ids via_agp_device_ids[] __initdata =
@@ -244,6 +202,11 @@ static struct agp_device_ids via_agp_device_ids[] __initdata =
.chipset = VIA_VT8605,
.chipset_name = "Apollo ProSavage PM133"
},
+ {
+ .device_id = PCI_DEVICE_ID_VIA_8235_0,
+ .chipset = VIA_P4X400,
+ .chipset_name = "P4X400"
+ },
{ }, /* dummy final entry, always present */
};
diff --git a/drivers/char/agp/via-kt400.c b/drivers/char/agp/via-kt400.c
new file mode 100644
index 000000000000..b23b19ab90c9
--- /dev/null
+++ b/drivers/char/agp/via-kt400.c
@@ -0,0 +1,199 @@
+/*
+ * VIA KT400 AGPGART routines.
+ *
+ * The KT400 does magick to put the AGP bridge compliant with the same
+ * standards version as the graphics card. If we haven't fallen into
+ * 2.0 compatability mode, we run this code. Otherwise, we run the
+ * code in via-agp.c
+ */
+
+#include <linux/types.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <linux/agp_backend.h>
+#include "agp.h"
+
+static int via_fetch_size(void)
+{
+ int i;
+ u8 temp;
+ struct aper_size_info_16 *values;
+
+ values = A_SIZE_16(agp_bridge.aperture_sizes);
+ pci_read_config_byte(agp_bridge.dev, VIA_AGP3_APSIZE, &temp);
+ for (i = 0; i < agp_bridge.num_aperture_sizes; i++) {
+ if (temp == values[i].size_value) {
+ agp_bridge.previous_size =
+ agp_bridge.current_size = (void *) (values + i);
+ agp_bridge.aperture_size_idx = i;
+ return values[i].size;
+ }
+ }
+ return 0;
+}
+
+static int via_configure(void)
+{
+ u32 temp;
+ struct aper_size_info_16 *current_size;
+
+ current_size = A_SIZE_16(agp_bridge.current_size);
+
+ /* address to map too */
+ pci_read_config_dword(agp_bridge.dev, VIA_APBASE, &temp);
+ agp_bridge.gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK);
+
+ /* attbase - aperture GATT base */
+ pci_write_config_dword(agp_bridge.dev, VIA_AGP3_ATTBASE,
+ agp_bridge.gatt_bus_addr & 0xfffff000);
+ return 0;
+}
+
+static void via_cleanup(void)
+{
+ struct aper_size_info_16 *previous_size;
+
+ previous_size = A_SIZE_16(agp_bridge.previous_size);
+ pci_write_config_byte(agp_bridge.dev, VIA_APSIZE, previous_size->size_value);
+}
+
+static void via_tlbflush(agp_memory * mem)
+{
+ u32 temp;
+
+ pci_read_config_dword(agp_bridge.dev, VIA_AGP3_GARTCTRL, &temp);
+ pci_write_config_dword(agp_bridge.dev, VIA_AGP3_GARTCTRL, temp & ~(1<<7));
+ pci_write_config_dword(agp_bridge.dev, VIA_AGP3_GARTCTRL, temp);
+}
+
+static unsigned long via_mask_memory(unsigned long addr, int type)
+{
+ /* Memory type is ignored */
+
+ return addr | agp_bridge.masks[0].mask;
+}
+
+static struct aper_size_info_16 via_generic_sizes[11] =
+{
+ { 4, 1024, 0, 1<<11|1<<10|1<<9|1<<8|1<<5|1<<4|1<<3|1<<2|1<<1|1<<0 },
+ { 8, 2048, 1, 1<<11|1<<10|1<<9|1<<8|1<<5|1<<4|1<<3|1<<2|1<<1},
+ { 16, 4096, 2, 1<<11|1<<10|1<<9|1<<8|1<<5|1<<4|1<<3|1<<2},
+ { 32, 8192, 3, 1<<11|1<<10|1<<9|1<<8|1<<5|1<<4|1<<3},
+ { 64, 16384, 4, 1<<11|1<<10|1<<9|1<<8|1<<5|1<<4},
+ { 128, 32768, 5, 1<<11|1<<10|1<<9|1<<8|1<<5},
+ { 256, 65536, 6, 1<<11|1<<10|1<<9|1<<8},
+ { 512, 131072, 7, 1<<11|1<<10|1<<9},
+ { 1024, 262144, 8, 1<<11|1<<10},
+ { 2048, 524288, 9, 1<<11} /* 2GB <- Max supported */
+};
+
+static struct gatt_mask via_generic_masks[] =
+{
+ {.mask = 0x00000000, .type = 0}
+};
+
+
+static void __init via_kt400_enable(u32 mode)
+{
+ if ((agp_generic_agp_3_0_enable(mode))==FALSE)
+ printk (KERN_INFO PFX "agp_generic_agp_3_0_enable() failed\n");
+}
+
+
+static int __init agp_via_probe (struct pci_dev *dev, const struct pci_device_id *ent)
+{
+ u8 reg;
+ u8 cap_ptr = 0;
+
+ cap_ptr = pci_find_capability(dev, PCI_CAP_ID_AGP);
+ if (cap_ptr == 0)
+ return -ENODEV;
+
+ pci_read_config_byte(dev, VIA_AGPSEL, &reg);
+ /* Check if we are in AGP 2.0 compatability mode, if so it
+ * will be picked up by via-agp.o */
+ if ((reg & (1<<1))==1)
+ return -ENODEV;
+
+ printk (KERN_INFO PFX "Detected VIA KT400 AGP3 chipset\n");
+
+ agp_bridge.dev = dev;
+ agp_bridge.type = VIA_APOLLO_KT400_3;
+ agp_bridge.capndx = cap_ptr;
+ agp_bridge.masks = via_generic_masks;
+ agp_bridge.num_of_masks = 1;
+ agp_bridge.aperture_sizes = (void *) via_generic_sizes;
+ agp_bridge.size_type = U8_APER_SIZE;
+ agp_bridge.num_aperture_sizes = 7;
+ agp_bridge.dev_private_data = NULL;
+ agp_bridge.needs_scratch_page = FALSE;
+ agp_bridge.agp_enable = via_kt400_enable;
+ agp_bridge.configure = via_configure;
+ agp_bridge.fetch_size = via_fetch_size;
+ agp_bridge.cleanup = via_cleanup;
+ agp_bridge.tlb_flush = via_tlbflush;
+ agp_bridge.mask_memory = via_mask_memory;
+ agp_bridge.cache_flush = global_cache_flush;
+ agp_bridge.create_gatt_table = agp_generic_create_gatt_table;
+ agp_bridge.free_gatt_table = agp_generic_free_gatt_table;
+ agp_bridge.insert_memory = agp_generic_insert_memory;
+ agp_bridge.remove_memory = agp_generic_remove_memory;
+ agp_bridge.alloc_by_type = agp_generic_alloc_by_type;
+ agp_bridge.free_by_type = agp_generic_free_by_type;
+ agp_bridge.agp_alloc_page = agp_generic_alloc_page;
+ agp_bridge.agp_destroy_page = agp_generic_destroy_page;
+ agp_bridge.suspend = agp_generic_suspend;
+ agp_bridge.resume = agp_generic_resume;
+ agp_bridge.cant_use_aperture = 0;
+
+ /* Fill in the mode register */
+ pci_read_config_dword(agp_bridge.dev, agp_bridge.capndx+4, &agp_bridge.mode);
+
+ agp_register_driver(dev);
+ return 0;
+}
+
+static struct pci_device_id agp_via_pci_table[] __initdata = {
+ {
+ .class = (PCI_CLASS_BRIDGE_HOST << 8),
+ .class_mask = ~0,
+ .vendor = PCI_VENDOR_ID_VIA,
+ .device = PCI_DEVICE_ID_VIA_8377_0,
+ .subvendor = PCI_ANY_ID,
+ .subdevice = PCI_ANY_ID,
+ },
+ { }
+};
+
+MODULE_DEVICE_TABLE(pci, agp_via_pci_table);
+
+static struct __initdata pci_driver agp_via_pci_driver = {
+ .name = "agpgart-via",
+ .id_table = agp_via_pci_table,
+ .probe = agp_via_probe,
+};
+
+static int __init agp_via_init(void)
+{
+ int ret_val;
+
+ ret_val = pci_module_init(&agp_via_pci_driver);
+ if (ret_val)
+ agp_bridge.type = NOT_SUPPORTED;
+
+ return ret_val;
+}
+
+static void __exit agp_via_cleanup(void)
+{
+ agp_unregister_driver();
+ pci_unregister_driver(&agp_via_pci_driver);
+}
+
+module_init(agp_via_init);
+module_exit(agp_via_cleanup);
+
+MODULE_AUTHOR("Dave Jones <davej@codemonkey.org.uk>");
+MODULE_LICENSE("GPL and additional rights");
+
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index dbfeb7f67f15..50befb7f289f 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1,7 +1,42 @@
#
# Network device configuration
#
-source "drivers/net/arcnet/Kconfig"
+
+config NETDEVICES
+ depends on NET
+ bool "Network device support"
+ ---help---
+ You can say N here if you don't intend to connect your Linux box to
+ any other computer at all or if all your connections will be over a
+ telephone line with a modem either via UUCP (UUCP is a protocol to
+ forward mail and news between unix hosts over telephone lines; read
+ the UUCP-HOWTO, available from
+ <http://www.linuxdoc.org/docs.html#howto>) or dialing up a shell
+ account or a BBS, even using term (term is a program which gives you
+ almost full Internet connectivity if you have a regular dial up
+ shell account on some Internet connected Unix computer. Read
+ <http://www.bart.nl/~patrickr/term-howto/Term-HOWTO.html>).
+
+ You'll have to say Y if your computer contains a network card that
+ you want to use under Linux (make sure you know its name because you
+ will be asked for it and read the Ethernet-HOWTO (especially if you
+ plan to use more than one network card under Linux)) or if you want
+ to use SLIP (Serial Line Internet Protocol is the protocol used to
+ send Internet traffic over telephone lines or null modem cables) or
+ CSLIP (compressed SLIP) or PPP (Point to Point Protocol, a better
+ and newer replacement for SLIP) or PLIP (Parallel Line Internet
+ Protocol is mainly used to create a mini network by connecting the
+ parallel ports of two local machines) or AX.25/KISS (protocol for
+ sending Internet traffic over amateur radio links).
+
+ Make sure to read the NET-3-HOWTO. Eventually, you will have to read
+ Olaf Kirch's excellent and free book "Network Administrator's
+ Guide", to be found in <http://www.linuxdoc.org/docs.html#guide>. If
+ unsure, say Y.
+
+if NETDEVICES
+ source "drivers/net/arcnet/Kconfig"
+endif
config DUMMY
tristate "Dummy net driver support"
@@ -245,6 +280,19 @@ config ARIADNE
want). The module is called ariadne.o. If you want to compile it as
a module, say M here and read <file:Documentation/modules.txt>.
+config ARIADNE2
+ tristate "Ariadne II support"
+ depends on NETDEVICES && ZORRO
+ help
+ This driver is for the Village Tronic Ariadne II and the Individual
+ Computers X-Surf Ethernet cards. If you have such a card, say Y.
+ Otherwise, say N.
+
+ This driver is also available as a module ( = code which can be
+ inserted in and removed from the running kernel whenever you want).
+ The module will be called ariadne2.o. If you want to compile it as
+ a module, say M here and read <file:Documentation/modules.txt>.
+
config NE2K_ZORRO
tristate "Ariadne II and X-Surf support"
depends on NET_ETHERNET && ZORRO
@@ -272,6 +320,156 @@ config HYDRA
want). The module is called hydra.o. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
+config APNE
+ tristate "PCMCIA NE2000 support"
+ depends on NETDEVICES && AMIGA_PCMCIA
+ help
+ If you have a PCMCIA NE2000 compatible adapter, say Y. Otherwise,
+ say N.
+
+ This driver is also available as a module ( = code which can be
+ inserted in and removed from the running kernel whenever you
+ want). The module is called apne.o. If you want to compile it as a
+ module, say M here and read <file:Documentation/modules.txt>.
+
+config APOLLO_ELPLUS
+ tristate "Apollo 3c505 support"
+ depends on NETDEVICES && APOLLO
+ help
+ Say Y or M here if your Apollo has a 3Com 3c505 ISA Ethernet card.
+ If you don't have one made for Apollos, you can use one from a PC,
+ except that your Apollo won't be able to boot from it (because the
+ code in the ROM will be for a PC).
+
+config MAC8390
+ bool "Macintosh NS 8390 based ethernet cards"
+ depends on NETDEVICES && MAC
+ help
+ If you want to include a driver to support Nubus or LC-PDS
+ Ethernet cards using an NS8390 chipset or its equivalent, say Y
+ and read the Ethernet-HOWTO, available from
+ <http://www.linuxdoc.org/docs.html#howto>.
+
+config MAC89x0
+ tristate "Macintosh CS89x0 based ethernet cards"
+ depends on NETDEVICES && MAC
+ ---help---
+ Support for CS89x0 chipset based Ethernet cards. If you have a
+ Nubus or LC-PDS network (Ethernet) card of this type, say Y and
+ read the Ethernet-HOWTO, available from
+ <http://www.linuxdoc.org/docs.html#howto>.
+
+ If you want to compile this as a module ( = code which can be
+ inserted in and removed from the running kernel whenever you want),
+ say M here and read <file:Documentation/modules.txt> as well as
+ <file:Documentation/networking/net-modules.txt>. This module will
+ be called mac89x0.o.
+
+config MACSONIC
+ tristate "Macintosh SONIC based ethernet (onboard, NuBus, LC, CS)"
+ depends on NETDEVICES && MAC
+ ---help---
+ Support for NatSemi SONIC based Ethernet devices. This includes
+ the onboard Ethernet in many Quadras as well as some LC-PDS,
+ a few Nubus and all known Comm Slot Ethernet cards. If you have
+ one of these say Y and read the Ethernet-HOWTO, available from
+ <http://www.linuxdoc.org/docs.html#howto>.
+
+ If you want to compile this as a module ( = code which can be
+ inserted in and removed from the running kernel whenever you want),
+ say M here and read <file:Documentation/modules.txt> as well as
+ <file:Documentation/networking/net-modules.txt>. This module will
+ be called macsonic.o.
+
+config MACMACE
+ bool "Macintosh (AV) onboard MACE ethernet (EXPERIMENTAL)"
+ depends on NETDEVICES && MAC && EXPERIMENTAL
+ help
+ Support for the onboard AMD 79C940 MACE Ethernet controller used in
+ the 660AV and 840AV Macintosh. If you have one of these Macintoshes
+ say Y and read the Ethernet-HOWTO, available from
+ <http://www.linuxdoc.org/docs.html#howto>.
+
+config MVME147_NET
+ tristate "MVME147 (Lance) Ethernet support"
+ depends on NETDEVICES && MVME147
+ help
+ Support for the on-board Ethernet interface on the Motorola MVME147
+ single-board computer. Say Y here to include the
+ driver for this chip in your kernel. If you want to compile it as
+ a module, say M here and read <file:Documentation/modules.txt>.
+
+config MVME16x_NET
+ tristate "MVME16x Ethernet support"
+ depends on NETDEVICES && MVME16x
+ help
+ This is the driver for the Ethernet interface on the Motorola
+ MVME162, 166, 167, 172 and 177 boards. Say Y here to include the
+ driver for this chip in your kernel. If you want to compile it as
+ a module, say M here and read <file:Documentation/modules.txt>.
+
+config BVME6000_NET
+ tristate "BVME6000 Ethernet support"
+ depends on NETDEVICES && BVME6000
+ help
+ This is the driver for the Ethernet interface on BVME4000 and
+ BVME6000 VME boards. Say Y here to include the driver for this chip
+ in your kernel. If you want to compile it as a module, say M here
+ and read <file:Documentation/modules.txt>.
+
+config ATARILANCE
+ tristate "Atari Lance support"
+ depends on NETDEVICES && ATARI
+ help
+ Say Y to include support for several Atari Ethernet adapters based
+ on the AMD Lance chipset: RieblCard (with or without battery), or
+ PAMCard VME (also the version by Rhotron, with different addresses).
+
+config ATARI_BIONET
+ tristate "BioNet-100 support"
+ depends on NETDEVICES && ATARI && ATARI_ACSI!=n
+ help
+ Say Y to include support for BioData's BioNet-100 Ethernet adapter
+ for the ACSI port. The driver works (has to work...) with a polled
+ I/O scheme, so it's rather slow :-(
+
+config ATARI_PAMSNET
+ tristate "PAMsNet support"
+ depends on NETDEVICES && ATARI && ATARI_ACSI!=n
+ help
+ Say Y to include support for the PAMsNet Ethernet adapter for the
+ ACSI port ("ACSI node"). The driver works (has to work...) with a
+ polled I/O scheme, so it's rather slow :-(
+
+config SUN3LANCE
+ tristate "Sun3/Sun3x on-board LANCE support"
+ depends on NETDEVICES && (SUN3 || SUN3X)
+ help
+ Most Sun3 and Sun3x motherboards (including the 3/50, 3/60 and 3/80)
+ featured an AMD Lance 10Mbit Ethernet controller on board; say Y
+ here to compile in the Linux driver for this and enable Ethernet.
+ General Linux information on the Sun 3 and 3x series (now
+ discontinued) is at
+ <http://www.angelfire.com/ca2/tech68k/sun3.html>.
+
+ If you're not building a kernel for a Sun 3, say N.
+
+config SUN3_82586
+ tristate "Sun3 on-board Intel 82586 support"
+ depends on NETDEVICES && SUN3
+ help
+ This driver enables support for the on-board Intel 82586 based
+ Ethernet adapter found on Sun 3/1xx and 3/2xx motherboards. Note
+ that this driver does not support 82586-based adapters on additional
+ VME boards.
+
+config HPLANCE
+ bool "HP on-board LANCE support"
+ depends on NETDEVICES && HP300
+ help
+ If you want to use the builtin "LANCE" Ethernet controller on an
+ HP300 machine, say Y here.
+
config LASI_82596
tristate "Lasi ethernet"
depends on NET_ETHERNET && PARISC && GSC_LASI
@@ -384,7 +582,7 @@ config SUNGEM
config NET_VENDOR_3COM
bool "3COM cards"
- depends on NET_ETHERNET
+ depends on NET_ETHERNET && (ISA || EISA || MCA || PCI)
help
If you have a network (Ethernet) card belonging to this class, say Y
and read the Ethernet-HOWTO, available from
@@ -555,7 +753,7 @@ config LANCE
config NET_VENDOR_SMC
bool "Western Digital/SMC cards"
- depends on NET_ETHERNET
+ depends on NET_ETHERNET && (ISA || MCA || EISA || MAC)
help
If you have a network (Ethernet) card belonging to this class, say Y
and read the Ethernet-HOWTO, available from
@@ -631,7 +829,7 @@ config ULTRA32
config SMC9194
tristate "SMC 9194 support"
- depends on NET_VENDOR_SMC && ISA
+ depends on NET_VENDOR_SMC && (ISA || MAC)
---help---
This is support for the SMC9xxx based Ethernet cards. Choose this
option if you have a DELL laptop with the docking station, or
@@ -648,7 +846,7 @@ config SMC9194
config NET_VENDOR_RACAL
bool "Racal-Interlan (Micom) NI cards"
- depends on NET_ETHERNET
+ depends on NET_ETHERNET && ISA
help
If you have a network (Ethernet) card belonging to this class, such
as the NI5010, NI5210 or NI6210, say Y and read the Ethernet-HOWTO,
@@ -898,7 +1096,7 @@ config ETH16I
config NE2000
tristate "NE2000/NE1000 support"
- depends on NET_ISA
+ depends on NET_ISA || (Q40 && m)
---help---
If you have a network (Ethernet) card of this type, say Y and read
the Ethernet-HOWTO, available from
@@ -1024,6 +1222,20 @@ config PCNET32
module, say M here and read <file:Documentation/modules.txt> as well
as <file:Documentation/networking/net-modules.txt>.
+config AMD8111_ETH
+ tristate "AMD 8111 (new PCI lance) support"
+ depends on NET_PCI && PCI
+ help
+ If you have an AMD 8111-based PCI lance ethernet card,
+ answer Y here and read the Ethernet-HOWTO, available from
+ <http://www.linuxdoc.org/docs.html#howto>.
+
+ This driver is also available as a module ( = code which can be
+ inserted in and removed from the running kernel whenever you want).
+ The module will be called amd8111e.o. If you want to compile it as a
+ module, say M here and read <file:Documentation/modules.txt> as well
+ as <file:Documentation/networking/net-modules.txt>.
+
config ADAPTEC_STARFIRE
tristate "Adaptec Starfire/DuraLAN support"
depends on NET_PCI && PCI
@@ -1459,7 +1671,7 @@ config LAN_SAA9730
config NET_POCKET
bool "Pocket and portable adapters"
- depends on NET_ETHERNET
+ depends on NET_ETHERNET && ISA
---help---
Cute little network (Ethernet) devices which attach to the parallel
port ("pocket adapters"), commonly used with laptops. If you have
@@ -1777,7 +1989,7 @@ config VETH
config FDDI
bool "FDDI driver support"
- depends on NETDEVICES
+ depends on NETDEVICES && (PCI || EISA)
help
Fiber Distributed Data Interface is a high speed local area network
design; essentially a replacement for high speed Ethernet. FDDI can
@@ -1828,7 +2040,7 @@ config SKFP
config HIPPI
bool "HIPPI driver support (EXPERIMENTAL)"
- depends on NETDEVICES && EXPERIMENTAL && INET
+ depends on NETDEVICES && EXPERIMENTAL && INET && PCI
help
HIgh Performance Parallel Interface (HIPPI) is a 800Mbit/sec and
1600Mbit/sec dual-simplex switched or point-to-point network. HIPPI
@@ -2181,7 +2393,7 @@ config ARLAN
config AIRONET4500
tristate "Aironet 4500/4800 series adapters"
- depends on NET_RADIO
+ depends on NET_RADIO && (PCI || ISA || PCMCIA)
---help---
www.aironet.com (recently bought by Cisco) makes these 802.11 DS
adapters. Driver by Elmer Joandi (elmer@ylenurme.ee).
@@ -2286,7 +2498,7 @@ source "drivers/net/tokenring/Kconfig"
config NET_FC
bool "Fibre Channel driver support"
- depends on NETDEVICES
+ depends on NETDEVICES && SCSI && PCI
help
Fibre Channel is a high speed serial protocol mainly used to connect
large storage devices to the computer; it is compatible with and
@@ -2348,3 +2560,4 @@ source "drivers/net/wan/Kconfig"
source "drivers/net/pcmcia/Kconfig"
+source "drivers/atm/Kconfig"
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 11d31e417ac3..f6a0725f3925 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -183,6 +183,7 @@ obj-$(CONFIG_MAC89x0) += mac89x0.o
obj-$(CONFIG_TUN) += tun.o
obj-$(CONFIG_DL2K) += dl2k.o
obj-$(CONFIG_R8169) += r8169.o
+obj-$(CONFIG_AMD8111_ETH) += amd8111e.o
# non-drivers/net drivers who want mii lib
obj-$(CONFIG_PCMCIA_SMC91C92) += mii.o
diff --git a/drivers/net/Makefile.lib b/drivers/net/Makefile.lib
index f5caa5c8be65..e234cba81875 100644
--- a/drivers/net/Makefile.lib
+++ b/drivers/net/Makefile.lib
@@ -37,6 +37,7 @@ obj-$(CONFIG_VIA_RHINE) += crc32.o
obj-$(CONFIG_YELLOWFIN) += crc32.o
obj-$(CONFIG_WINBOND_840) += crc32.o
obj-$(CONFIG_R8169) += crc32.o
+obj-$(CONFIG_AMD8111_ETH) += crc32.o
# These rely on drivers/net/7990.o which requires crc32.o
diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c
new file mode 100755
index 000000000000..40e9265b2599
--- /dev/null
+++ b/drivers/net/amd8111e.c
@@ -0,0 +1,1651 @@
+
+/* Advanced Micro Devices Inc. AMD8111E Linux Network Driver
+ * Copyright (C) 2002 Advanced Micro Devices
+ *
+ *
+ * Copyright 2001,2002 Jeff Garzik <jgarzik@mandrakesoft.com> [ 8139cp.c,tg3.c ]
+ * Copyright (C) 2001, 2002 David S. Miller (davem@redhat.com)[ tg3.c]
+ * Copyright 1996-1999 Thomas Bogendoerfer [ pcnet32.c ]
+ * Derived from the lance driver written 1993,1994,1995 by Donald Becker.
+ * Copyright 1993 United States Government as represented by the
+ * Director, National Security Agency.[ pcnet32.c ]
+ * Carsten Langgaard, carstenl@mips.com [ pcnet32.c ]
+ * Copyright (C) 2000 MIPS Technologies, Inc. All rights reserved.
+ *
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+
+Module Name:
+
+ amd8111e.c
+
+Abstract:
+
+ AMD8111 based 10/100 Ethernet Controller Driver.
+
+Environment:
+
+ Kernel Mode
+
+Revision History:
+
+*/
+
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/compiler.h>
+#include <linux/slab.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <linux/pci.h>
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/skbuff.h>
+#include <linux/ethtool.h>
+#include <linux/mii.h>
+#include <linux/if_vlan.h>
+#include <linux/ctype.h>
+#include <linux/crc32.h>
+
+#include <asm/system.h>
+#include <asm/io.h>
+#include <asm/byteorder.h>
+#include <asm/uaccess.h>
+
+#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
+#define AMD8111E_VLAN_TAG_USED 1
+#else
+#define AMD8111E_VLAN_TAG_USED 0
+#endif
+
+#include "amd8111e.h"
+#define MODULE_NAME "amd8111e"
+#define MODULE_VERSION "3.0.0"
+MODULE_AUTHOR("Advanced Micro Devices, Inc.");
+MODULE_DESCRIPTION ("AMD8111 based 10/100 Ethernet Controller. Driver Version 3.0.0");
+MODULE_LICENSE("GPL");
+
+MODULE_PARM(speed_duplex, "1-" __MODULE_STRING (MAX_UNITS) "i");
+MODULE_PARM_DESC(speed_duplex, "Set device speed and duplex modes, 0: Auto Negotitate, 1: 10Mbps Half Duplex, 2: 10Mbps Full Duplex, 3: 100Mbps Half Duplex, 4: 100Mbps Full Duplex");
+
+static struct pci_device_id amd8111e_pci_tbl[] __devinitdata = {
+
+ { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD8111E_7462,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
+ { 0, }
+
+};
+
+/*
+This function will set PHY speed. During initialization sets the original speed to 100 full.
+*/
+static void amd8111e_set_ext_phy(struct net_device *dev)
+{
+ struct amd8111e_priv *lp = (struct amd8111e_priv *)dev->priv;
+ unsigned long reg_val = 0;
+ void * mmio = lp->mmio;
+ struct amd8111e_link_config *link_config = &lp->link_config;
+
+ if(!lp->opened){
+ /* Initializing SPEED_100 and DUPLEX_FULL as original values */
+ link_config->orig_speed = SPEED_100;
+ link_config->orig_duplex = DUPLEX_FULL;
+ link_config->orig_phy_option = XPHYSP |XPHYFD;
+ }
+ reg_val = lp->ext_phy_option;
+
+ /* Disable port manager */
+ writel((u32) EN_PMGR, mmio + CMD3 );
+
+ /* Reset PHY */
+ writel((u32)XPHYRST | lp->ext_phy_option, mmio + CTRL2);
+
+ /* Enable port manager */
+ writel((u32)VAL1 | EN_PMGR, mmio + CMD3 );
+}
+
+/*
+This function will unmap skb->data space and will free
+all transmit and receive skbuffs.
+*/
+static int amd8111e_free_skbs(struct net_device *dev)
+{
+ struct amd8111e_priv *lp = (struct amd8111e_priv *)dev->priv;
+ struct sk_buff* rx_skbuff;
+ int i;
+
+ /* Freeing transmit skbs */
+ for(i = 0; i < NUM_TX_BUFFERS; i++){
+ if(lp->tx_skbuff[i]){
+ pci_unmap_single(lp->pci_dev,lp->tx_dma_addr[i], lp->tx_skbuff[i]->len,PCI_DMA_TODEVICE);
+ dev_kfree_skb (lp->tx_skbuff[i]);
+ lp->tx_skbuff[i] = NULL;
+ lp->tx_dma_addr[i] = 0;
+ }
+ }
+ /* Freeing previously allocated receive buffers */
+ for (i = 0; i < NUM_RX_BUFFERS; i++){
+ rx_skbuff = lp->rx_skbuff[i];
+ if(rx_skbuff != NULL){
+ pci_unmap_single(lp->pci_dev,lp->rx_dma_addr[i],
+ lp->rx_buff_len - 2,PCI_DMA_FROMDEVICE);
+ dev_kfree_skb(lp->rx_skbuff[i]);
+ lp->rx_skbuff[i] = NULL;
+ lp->rx_dma_addr[i] = 0;
+ }
+ }
+
+ return 0;
+}
+
+/*
+ This will set the receive buffer length corresponding to the mtu size of network interface.
+*/
+static inline void amd8111e_set_rx_buff_len(struct net_device* dev)
+{
+ struct amd8111e_priv* lp = dev->priv;
+ unsigned int mtu = dev->mtu;
+
+ if (mtu > ETH_DATA_LEN){
+ /* MTU + ethernet header + FCS + optional VLAN tag */
+ lp->rx_buff_len = mtu + ETH_HLEN + 8;
+ lp->options |= OPTION_JUMBO_ENABLE;
+ } else{
+ lp->rx_buff_len = PKT_BUFF_SZ;
+ lp->options &= ~OPTION_JUMBO_ENABLE;
+ }
+}
+
+/*
+This function will free all the previously allocated buffers, determine new receive buffer length and will allocate new receive buffers. This function also allocates and initializes both the transmitter and receive hardware descriptors.
+ */
+static int amd8111e_init_ring(struct net_device *dev)
+{
+ struct amd8111e_priv *lp = (struct amd8111e_priv *)dev->priv;
+ int i;
+
+ lp->rx_idx = lp->tx_idx = 0;
+ lp->tx_complete_idx = 0;
+ lp->tx_ring_idx = 0;
+
+
+ if(lp->opened)
+ /* Free previously allocated transmit and receive skbs */
+ amd8111e_free_skbs(dev);
+
+ else{
+ /* allocate the tx and rx descriptors */
+ if((lp->tx_ring = pci_alloc_consistent(lp->pci_dev,
+ sizeof(struct amd8111e_tx_dr)*NUM_TX_RING_DR,
+ &lp->tx_ring_dma_addr)) == NULL)
+
+ goto err_no_mem;
+
+ if((lp->rx_ring = pci_alloc_consistent(lp->pci_dev,
+ sizeof(struct amd8111e_rx_dr)*NUM_RX_RING_DR,
+ &lp->rx_ring_dma_addr)) == NULL)
+
+ goto err_free_tx_ring;
+
+ }
+ /* Set new receive buff size */
+ amd8111e_set_rx_buff_len(dev);
+
+ /* Allocating receive skbs */
+ for (i = 0; i < NUM_RX_BUFFERS; i++) {
+
+ if (!(lp->rx_skbuff[i] = dev_alloc_skb(lp->rx_buff_len))) {
+ /* Release previos allocated skbs */
+ for(--i; i >= 0 ;i--)
+ dev_kfree_skb(lp->rx_skbuff[i]);
+ goto err_free_rx_ring;
+ }
+ skb_reserve(lp->rx_skbuff[i],2);
+ }
+ /* Initilaizing receive descriptors */
+ for (i = 0; i < NUM_RX_BUFFERS; i++) {
+ lp->rx_dma_addr[i] = pci_map_single(lp->pci_dev,
+ lp->rx_skbuff[i]->data,lp->rx_buff_len-2, PCI_DMA_FROMDEVICE);
+
+ lp->rx_ring[i].buff_phy_addr = cpu_to_le32(lp->rx_dma_addr[i]);
+ lp->rx_ring[i].buff_count = cpu_to_le16(lp->rx_buff_len);
+ lp->rx_ring[i].rx_dr_offset10 = cpu_to_le16(OWN_BIT);
+ }
+
+ /* Initializing transmit descriptors */
+ for (i = 0; i < NUM_TX_RING_DR; i++) {
+ lp->tx_ring[i].buff_phy_addr = 0;
+ lp->tx_ring[i].tx_dr_offset2 = 0;
+ lp->tx_ring[i].buff_count = 0;
+ }
+
+ return 0;
+
+err_free_rx_ring:
+
+ pci_free_consistent(lp->pci_dev,
+ sizeof(struct amd8111e_rx_dr)*NUM_RX_RING_DR,lp->rx_ring,
+ lp->rx_ring_dma_addr);
+
+err_free_tx_ring:
+
+ pci_free_consistent(lp->pci_dev,
+ sizeof(struct amd8111e_tx_dr)*NUM_TX_RING_DR,lp->tx_ring,
+ lp->tx_ring_dma_addr);
+
+err_no_mem:
+ return -ENOMEM;
+}
+/*
+This function initializes the device registers and starts the device.
+*/
+static int amd8111e_restart(struct net_device *dev)
+{
+ struct amd8111e_priv *lp = (struct amd8111e_priv* )dev->priv;
+ void * mmio = lp->mmio;
+ int i,reg_val;
+
+ /* stop the chip */
+ writel(RUN, mmio + CMD0);
+
+ if(amd8111e_init_ring(dev))
+ return -ENOMEM;
+
+ amd8111e_set_ext_phy(dev);
+
+ /* set control registers */
+ reg_val = readl(mmio + CTRL1);
+
+ writel( reg_val| XMTSP_128 | CACHE_ALIGN | B1_MASK, mmio + CTRL1 );
+
+ /* enable interrupt */
+ writel( APINT5EN | APINT4EN | APINT3EN | APINT2EN | APINT1EN |
+ APINT0EN | MIIPDTINTEN | MCCIINTEN | MCCINTEN | MREINTEN |
+ SPNDINTEN | MPINTEN | SINTEN | STINTEN, mmio + INTEN0);
+
+ writel(VAL3 | LCINTEN | VAL1 | TINTEN0 | VAL0 | RINTEN0, mmio + INTEN0);
+
+ /* initialize tx and rx ring base addresses */
+ writel((u32)lp->tx_ring_dma_addr,mmio + XMT_RING_BASE_ADDR0);
+ writel((u32)lp->rx_ring_dma_addr,mmio+ RCV_RING_BASE_ADDR0);
+
+ writew((u32)NUM_TX_RING_DR, mmio + XMT_RING_LEN0);
+ writew((u16)NUM_RX_RING_DR, mmio + RCV_RING_LEN0);
+
+ if(lp->options & OPTION_JUMBO_ENABLE){
+ writel((u32)VAL2|JUMBO, mmio + CMD3);
+ /* Reset REX_UFLO */
+ writel( REX_UFLO, mmio + CMD2);
+ /* Should not set REX_UFLO for jumbo frames */
+ writel( VAL0 | APAD_XMT | REX_RTRY, mmio + CMD2);
+ }else
+ writel( VAL0 | APAD_XMT | REX_RTRY|REX_UFLO, mmio + CMD2);
+
+#if AMD8111E_VLAN_TAG_USED
+ writel((u32) VAL2|VSIZE|VL_TAG_DEL, mmio + CMD3);
+#endif
+ writel( VAL0 | APAD_XMT | REX_RTRY, mmio + CMD2 );
+
+ /* Setting the MAC address to the device */
+ for(i = 0; i < ETH_ADDR_LEN; i++)
+ writeb( dev->dev_addr[i], mmio + PADR + i );
+
+ /* set RUN bit to start the chip */
+ writel(VAL2 | RDMD0, mmio + CMD0);
+ writel(VAL0 | INTREN | RUN, mmio + CMD0);
+
+ return 0;
+}
+/*
+This function clears necessary the device registers.
+*/
+static void amd8111e_init_hw_default( struct amd8111e_priv* lp)
+{
+ unsigned int reg_val;
+ unsigned int logic_filter[2] ={0,};
+ void * mmio = lp->mmio;
+
+
+ /* AUTOPOLL0 Register *//*TBD default value is 8100 in FPS */
+ writew( 0x8101, mmio + AUTOPOLL0);
+
+ /* Clear RCV_RING_BASE_ADDR */
+ writel(0, mmio + RCV_RING_BASE_ADDR0);
+
+ /* Clear XMT_RING_BASE_ADDR */
+ writel(0, mmio + XMT_RING_BASE_ADDR0);
+ writel(0, mmio + XMT_RING_BASE_ADDR1);
+ writel(0, mmio + XMT_RING_BASE_ADDR2);
+ writel(0, mmio + XMT_RING_BASE_ADDR3);
+
+ /* Clear CMD0 */
+ writel(CMD0_CLEAR,mmio + CMD0);
+
+ /* Clear CMD2 */
+ writel(CMD2_CLEAR, mmio +CMD2);
+
+ /* Clear CMD7 */
+ writel(CMD7_CLEAR , mmio + CMD7);
+
+ /* Clear DLY_INT_A and DLY_INT_B */
+ writel(0x0, mmio + DLY_INT_A);
+ writel(0x0, mmio + DLY_INT_B);
+
+ /* Clear FLOW_CONTROL */
+ writel(0x0, mmio + FLOW_CONTROL);
+
+ /* Clear INT0 write 1 to clear register */
+ reg_val = readl(mmio + INT0);
+ writel(reg_val, mmio + INT0);
+
+ /* Clear STVAL */
+ writel(0x0, mmio + STVAL);
+
+ /* Clear INTEN0 */
+ writel( INTEN0_CLEAR, mmio + INTEN0);
+
+ /* Clear LADRF */
+ writel(0x0 , mmio + LADRF);
+
+ /* Set SRAM_SIZE & SRAM_BOUNDARY registers */
+ writel( 0x80010,mmio + SRAM_SIZE);
+
+ /* Clear RCV_RING0_LEN */
+ writel(0x0, mmio + RCV_RING_LEN0);
+
+ /* Clear XMT_RING0/1/2/3_LEN */
+ writel(0x0, mmio + XMT_RING_LEN0);
+ writel(0x0, mmio + XMT_RING_LEN1);
+ writel(0x0, mmio + XMT_RING_LEN2);
+ writel(0x0, mmio + XMT_RING_LEN3);
+
+ /* Clear XMT_RING_LIMIT */
+ writel(0x0, mmio + XMT_RING_LIMIT);
+
+ /* Clear MIB */
+ writew(MIB_CLEAR, mmio + MIB_ADDR);
+
+ /* Clear LARF */
+ AMD8111E_WRITE_REG64(mmio, LADRF,logic_filter);
+
+ /* SRAM_SIZE register */
+ reg_val = readl(mmio + SRAM_SIZE);
+
+ if(lp->options & OPTION_JUMBO_ENABLE)
+ writel( VAL2|JUMBO, mmio + CMD3);
+#if AMD8111E_VLAN_TAG_USED
+ writel(VAL2|VSIZE|VL_TAG_DEL, mmio + CMD3 );
+#endif
+ /* CMD2 register */
+ reg_val = readl(mmio + CMD2);
+
+}
+
+/*
+This function disables the interrupt and clears all the pending
+interrupts in INT0
+ */
+static void amd8111e_disable_interrupt(struct amd8111e_priv* lp)
+{
+ u32 intr0;
+
+ /* Disable interrupt */
+ writel(INTREN, lp->mmio + CMD0);
+
+ /* Clear INT0 */
+ intr0 = readl(lp->mmio + INT0);
+ writel(intr0, lp->mmio + INT0);
+
+}
+
+/*
+This function stops the chip.
+*/
+static void amd8111e_stop_chip(struct amd8111e_priv* lp)
+{
+ writel(RUN, lp->mmio + CMD0);
+}
+
+/*
+This function frees the transmiter and receiver descriptor rings.
+*/
+static void amd8111e_free_ring(struct amd8111e_priv* lp)
+{
+
+ /* Free transmit and receive skbs */
+ amd8111e_free_skbs(lp->amd8111e_net_dev);
+
+ /* Free transmit and receive descriptor rings */
+ if(lp->rx_ring){
+ pci_free_consistent(lp->pci_dev,
+ sizeof(struct amd8111e_rx_dr)*NUM_RX_RING_DR,
+ lp->rx_ring, lp->rx_ring_dma_addr);
+ lp->rx_ring = NULL;
+ }
+
+ if(lp->tx_ring){
+ pci_free_consistent(lp->pci_dev,
+ sizeof(struct amd8111e_tx_dr)*NUM_TX_RING_DR,
+ lp->tx_ring, lp->tx_ring_dma_addr);
+
+ lp->tx_ring = NULL;
+ }
+
+}
+#if AMD8111E_VLAN_TAG_USED
+/*
+This is the receive indication function for packets with vlan tag.
+*/
+static int amd8111e_vlan_rx(struct amd8111e_priv *lp, struct sk_buff *skb, u16 vlan_tag)
+{
+ return vlan_hwaccel_rx(skb, lp->vlgrp, vlan_tag);
+}
+#endif
+
+/*
+This function will free all the transmit skbs that are actually transmitted by the device. It will check the ownership of the skb before freeing the skb.
+*/
+static int amd8111e_tx(struct net_device *dev)
+{
+ struct amd8111e_priv* lp = dev->priv;
+ int tx_index = lp->tx_complete_idx & TX_RING_DR_MOD_MASK;
+ int status;
+
+ /* Complete all the transmit packet */
+ while (lp->tx_complete_idx != lp->tx_idx){
+ tx_index = lp->tx_complete_idx & TX_RING_DR_MOD_MASK;
+ status = le16_to_cpu(lp->tx_ring[tx_index].tx_dr_offset2);
+
+ if(status & OWN_BIT)
+ break; /* It still hasn't been Txed */
+
+ lp->tx_ring[tx_index].buff_phy_addr = 0;
+
+ /* We must free the original skb */
+ if (lp->tx_skbuff[tx_index]) {
+ pci_unmap_single(lp->pci_dev, lp->tx_dma_addr[tx_index],
+ lp->tx_skbuff[tx_index]->len,
+ PCI_DMA_TODEVICE);
+ dev_kfree_skb_irq (lp->tx_skbuff[tx_index]);
+ lp->tx_skbuff[tx_index] = 0;
+ lp->tx_dma_addr[tx_index] = 0;
+ }
+ lp->tx_complete_idx++;
+
+ if (netif_queue_stopped(dev) &&
+ lp->tx_complete_idx > lp->tx_idx - NUM_TX_BUFFERS +2){
+ /* The ring is no longer full, clear tbusy. */
+ netif_wake_queue (dev);
+ }
+ }
+ return 0;
+}
+
+/*
+This function will check the ownership of receive buffers and descriptors. It will indicate to kernel up to half the number of maximum receive buffers in the descriptor ring, in a single receive interrupt. It will also replenish the descriptors with new skbs.
+*/
+static int amd8111e_rx(struct net_device *dev)
+{
+ struct amd8111e_priv *lp = dev->priv;
+ struct sk_buff *skb,*new_skb;
+ int rx_index = lp->rx_idx & RX_RING_DR_MOD_MASK;
+ int min_pkt_len, status;
+ int num_rx_pkt = 0;
+ int max_rx_pkt = NUM_RX_BUFFERS/2;
+ short pkt_len;
+#if AMD8111E_VLAN_TAG_USED
+ short vtag;
+#endif
+
+ /* If we own the next entry, it's a new packet. Send it up. */
+ while(++num_rx_pkt <= max_rx_pkt){
+ if(lp->rx_ring[rx_index].rx_dr_offset10 & OWN_BIT)
+ return 0;
+
+ /* check if err summary bit is set */
+ if(le16_to_cpu(lp->rx_ring[rx_index].rx_dr_offset10) & ERR_BIT){
+ /*
+ * There is a tricky error noted by John Murphy,
+ * <murf@perftech.com> to Russ Nelson: Even with full-sized
+ * buffers it's possible for a jabber packet to use two
+ * buffers, with only the last correctly noting the error. */
+ /* reseting flags */
+ lp->rx_ring[rx_index].rx_dr_offset10 &=
+ cpu_to_le16(RESET_RX_FLAGS);
+ goto err_next_pkt;
+ }
+ /* check for STP and ENP */
+ status = le16_to_cpu(lp->rx_ring[rx_index].rx_dr_offset10);
+ if(!((status & STP_BIT) && (status & ENP_BIT))){
+ /* reseting flags */
+ lp->rx_ring[rx_index].rx_dr_offset10 &=
+ cpu_to_le16(RESET_RX_FLAGS);
+ goto err_next_pkt;
+ }
+ pkt_len = le16_to_cpu(lp->rx_ring[rx_index].msg_count) - 4;
+
+#if AMD8111E_VLAN_TAG_USED
+ vtag = le16_to_cpu(lp->rx_ring[rx_index].rx_dr_offset10) & TT_MASK;
+ /*MAC will strip vlan tag*/
+ if(lp->vlgrp != NULL && vtag !=0)
+ min_pkt_len =MIN_PKT_LEN - 4;
+ else
+#endif
+ min_pkt_len =MIN_PKT_LEN;
+
+ if (pkt_len < min_pkt_len) {
+ lp->rx_ring[rx_index].rx_dr_offset10 &=
+ cpu_to_le16(RESET_RX_FLAGS);
+ lp->stats.rx_errors++;
+ goto err_next_pkt;
+ }
+ if(!(new_skb = dev_alloc_skb(lp->rx_buff_len))){
+ /* if allocation fail,
+ ignore that pkt and go to next one */
+ lp->rx_ring[rx_index].rx_dr_offset10 &=
+ cpu_to_le16(RESET_RX_FLAGS);
+ lp->stats.rx_errors++;
+ goto err_next_pkt;
+ }
+
+ skb_reserve(new_skb, 2);
+ skb = lp->rx_skbuff[rx_index];
+ pci_unmap_single(lp->pci_dev,lp->rx_dma_addr[rx_index],
+ lp->rx_buff_len-2, PCI_DMA_FROMDEVICE);
+ skb_put(skb, pkt_len);
+ skb->dev = dev;
+ lp->rx_skbuff[rx_index] = new_skb;
+ new_skb->dev = dev;
+ lp->rx_dma_addr[rx_index] = pci_map_single(lp->pci_dev,
+ new_skb->data, lp->rx_buff_len-2,PCI_DMA_FROMDEVICE);
+
+ skb->protocol = eth_type_trans(skb, dev);
+
+#if AMD8111E_VLAN_TAG_USED
+
+ vtag = lp->rx_ring[rx_index].rx_dr_offset10 & TT_MASK;
+ if(lp->vlgrp != NULL && (vtag == TT_VLAN_TAGGED)){
+ amd8111e_vlan_rx(lp, skb,
+ lp->rx_ring[rx_index].tag_ctrl_info);
+ } else
+#endif
+
+ dev->last_rx = jiffies;
+ netif_rx (skb);
+
+err_next_pkt:
+ lp->rx_ring[rx_index].buff_phy_addr
+ = cpu_to_le32(lp->rx_dma_addr[rx_index]);
+ lp->rx_ring[rx_index].buff_count =
+ cpu_to_le16(lp->rx_buff_len-2);
+ lp->rx_ring[rx_index].rx_dr_offset10 |= cpu_to_le16(OWN_BIT);
+ rx_index = (++lp->rx_idx) & RX_RING_DR_MOD_MASK;
+ }
+
+ return 0;
+}
+
+/*
+This function will store the original speed to restore later, if autoneg is turned on. This speed will be set later when the autoneg is turned off. If the link status indicates that link is down, that will be indicated to the kernel */
+
+static int amd8111e_link_change(struct net_device* dev)
+{
+ struct amd8111e_priv *lp = dev->priv;
+ int status0,speed;
+
+ /* read the link change */
+ status0 = readl(lp->mmio + STAT0);
+
+ if(status0 & LINK_STATS){
+ if(status0 & AUTONEG_COMPLETE){
+ /* keeping the original speeds */
+ if((lp->link_config.speed != SPEED_INVALID)&&
+ (lp->link_config.duplex != DUPLEX_INVALID)){
+ lp->link_config.orig_speed = lp->link_config.speed;
+ lp->link_config.orig_duplex = lp->link_config.duplex;
+ lp->link_config.orig_phy_option = lp->ext_phy_option;
+ }
+
+ lp->link_config.speed = SPEED_INVALID;
+ lp->link_config.duplex = DUPLEX_INVALID;
+ lp->link_config.autoneg = AUTONEG_ENABLE;
+ netif_carrier_on(dev);
+ return 0;
+ }
+ if(status0 & FULL_DPLX)
+ lp->link_config.duplex = DUPLEX_FULL;
+ else
+ lp->link_config.duplex = DUPLEX_HALF;
+ speed = (status0 & SPEED_MASK) >> 7;
+ if(speed == PHY_SPEED_10)
+ lp->link_config.speed = SPEED_10;
+ else if(speed == PHY_SPEED_100)
+ lp->link_config.speed = SPEED_100;
+ lp->link_config.autoneg = AUTONEG_DISABLE;
+ netif_carrier_on(dev);
+ }
+ else{
+ lp->link_config.speed = SPEED_INVALID;
+ lp->link_config.duplex = DUPLEX_INVALID;
+ lp->link_config.autoneg = AUTONEG_INVALID;
+ netif_carrier_off(dev);
+ }
+
+ return 0;
+}
+/*
+This function reads the mib counters.
+*/
+static int amd8111e_read_mib(void* mmio, u8 MIB_COUNTER)
+{
+ unsigned int status;
+ unsigned int data;
+ unsigned int repeat = REPEAT_CNT;
+
+ writew( MIB_RD_CMD | MIB_COUNTER, mmio + MIB_ADDR);
+ do {
+ status = readw(mmio + MIB_ADDR);
+ udelay(2); /* controller takes MAX 2 us to get mib data */
+ }
+ while (--repeat && (status & MIB_CMD_ACTIVE));
+
+ data = readl(mmio + MIB_DATA);
+ return data;
+}
+
+/*
+This function retuurns the reads the mib registers and returns the hardware statistics. It adds the previous statistics with new values.*/
+static struct net_device_stats *amd8111e_get_stats(struct net_device * dev)
+{
+ struct amd8111e_priv *lp = dev->priv;
+ void * mmio = lp->mmio;
+ unsigned long flags;
+ struct net_device_stats *prev_stats = &lp->prev_stats;
+ struct net_device_stats* new_stats = &lp->stats;
+
+ if(!lp->opened)
+ return prev_stats;
+ spin_lock_irqsave (&lp->lock, flags);
+
+ /* stats.rx_packets */
+ new_stats->rx_packets = prev_stats->rx_packets+
+ amd8111e_read_mib(mmio, rcv_broadcast_pkts)+
+ amd8111e_read_mib(mmio, rcv_multicast_pkts)+
+ amd8111e_read_mib(mmio, rcv_unicast_pkts);
+
+ /* stats.tx_packets */
+ new_stats->tx_packets = prev_stats->tx_packets+
+ amd8111e_read_mib(mmio, xmt_packets);
+
+ /*stats.rx_bytes */
+ new_stats->rx_bytes = prev_stats->rx_bytes+
+ amd8111e_read_mib(mmio, rcv_octets);
+
+ /* stats.tx_bytes */
+ new_stats->tx_bytes = prev_stats->tx_bytes+
+ amd8111e_read_mib(mmio, xmt_octets);
+
+ /* stats.rx_errors */
+ new_stats->rx_errors = prev_stats->rx_errors+
+ amd8111e_read_mib(mmio, rcv_undersize_pkts)+
+ amd8111e_read_mib(mmio, rcv_fragments)+
+ amd8111e_read_mib(mmio, rcv_jabbers)+
+ amd8111e_read_mib(mmio, rcv_alignment_errors)+
+ amd8111e_read_mib(mmio, rcv_fcs_errors)+
+ amd8111e_read_mib(mmio, rcv_miss_pkts);
+
+ /* stats.tx_errors */
+ new_stats->tx_errors = prev_stats->tx_errors+
+ amd8111e_read_mib(mmio, xmt_underrun_pkts);
+
+ /* stats.rx_dropped*/
+ new_stats->rx_dropped = prev_stats->rx_dropped+
+ amd8111e_read_mib(mmio, rcv_miss_pkts);
+
+ /* stats.tx_dropped*/
+ new_stats->tx_dropped = prev_stats->tx_dropped+
+ amd8111e_read_mib(mmio, xmt_underrun_pkts);
+
+ /* stats.multicast*/
+ new_stats->multicast = prev_stats->multicast+
+ amd8111e_read_mib(mmio, rcv_multicast_pkts);
+
+ /* stats.collisions*/
+ new_stats->collisions = prev_stats->collisions+
+ amd8111e_read_mib(mmio, xmt_collisions);
+
+ /* stats.rx_length_errors*/
+ new_stats->rx_length_errors = prev_stats->rx_length_errors+
+ amd8111e_read_mib(mmio, rcv_undersize_pkts)+
+ amd8111e_read_mib(mmio, rcv_oversize_pkts);
+
+ /* stats.rx_over_errors*/
+ new_stats->rx_over_errors = prev_stats->rx_over_errors+
+ amd8111e_read_mib(mmio, rcv_miss_pkts);
+
+ /* stats.rx_crc_errors*/
+ new_stats->rx_crc_errors = prev_stats->rx_crc_errors+
+ amd8111e_read_mib(mmio, rcv_fcs_errors);
+
+ /* stats.rx_frame_errors*/
+ new_stats->rx_frame_errors = prev_stats->rx_frame_errors+
+ amd8111e_read_mib(mmio, rcv_alignment_errors);
+
+ /* stats.rx_fifo_errors */
+ new_stats->rx_fifo_errors = prev_stats->rx_fifo_errors+
+ amd8111e_read_mib(mmio, rcv_miss_pkts);
+
+ /* stats.rx_missed_errors */
+ new_stats->rx_missed_errors = prev_stats->rx_missed_errors+
+ amd8111e_read_mib(mmio, rcv_miss_pkts);
+
+ /* stats.tx_aborted_errors*/
+ new_stats->tx_aborted_errors = prev_stats->tx_aborted_errors+
+ amd8111e_read_mib(mmio, xmt_excessive_collision);
+
+ /* stats.tx_carrier_errors*/
+ new_stats->tx_carrier_errors = prev_stats->tx_carrier_errors+
+ amd8111e_read_mib(mmio, xmt_loss_carrier);
+
+ /* stats.tx_fifo_errors*/
+ new_stats->tx_fifo_errors = prev_stats->tx_fifo_errors+
+ amd8111e_read_mib(mmio, xmt_underrun_pkts);
+
+ /* stats.tx_window_errors*/
+ new_stats->tx_window_errors = prev_stats->tx_window_errors+
+ amd8111e_read_mib(mmio, xmt_late_collision);
+
+ spin_unlock_irqrestore (&lp->lock, flags);
+
+ return new_stats;
+}
+
+/*
+This is device interrupt function. It handles transmit, receive and link change interrupts.
+*/
+static void amd8111e_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+
+ struct net_device * dev = (struct net_device *) dev_id;
+ struct amd8111e_priv *lp = dev->priv;
+ void * mmio = lp->mmio;
+ unsigned int intr0;
+
+ if(dev == NULL)
+ return;
+
+ spin_lock (&lp->lock);
+ /* disabling interrupt */
+ writel(INTREN, mmio + CMD0);
+
+ /* Read interrupt status */
+ intr0 = readl(mmio + INT0);
+
+ /* Process all the INT event until INTR bit is clear. */
+
+ if (!(intr0 & INTR))
+ goto err_no_interrupt;
+
+ /* Current driver processes 3 interrupts : RINT,TINT,LCINT */
+ writel(intr0, mmio + INT0);
+
+ /* Check if Receive Interrupt has occurred. */
+ if(intr0 & RINT0){
+ amd8111e_rx(dev);
+ writel(VAL2 | RDMD0, mmio + CMD0);
+ }
+
+ /* Check if Transmit Interrupt has occurred. */
+ if(intr0 & TINT0)
+ amd8111e_tx(dev);
+
+ /* Check if Link Change Interrupt has occurred. */
+ if (intr0 & LCINT)
+ amd8111e_link_change(dev);
+
+err_no_interrupt:
+ writel( VAL0 | INTREN,mmio + CMD0);
+ spin_unlock(&lp->lock);
+ return;
+
+}
+/*
+This function closes the network interface and copies the new set of statistics into the previous statistics structure so that most recent statistics will be available after the interface is down.
+*/
+static int amd8111e_close(struct net_device * dev)
+{
+ struct amd8111e_priv *lp = dev->priv;
+ netif_stop_queue(dev);
+
+ spin_lock_irq(&lp->lock);
+
+ amd8111e_disable_interrupt(lp);
+ amd8111e_stop_chip(lp);
+ amd8111e_free_ring(lp);
+
+ netif_carrier_off(lp->amd8111e_net_dev);
+
+ spin_unlock_irq(&lp->lock);
+
+ free_irq(dev->irq, dev);
+ memcpy(&lp->prev_stats,amd8111e_get_stats(dev), sizeof(lp->prev_stats));
+ lp->opened = 0;
+ return 0;
+}
+/* This function opens new interface.It requests irq for the device, initializes the device,buffers and descriptors, and starts the device.
+*/
+static int amd8111e_open(struct net_device * dev )
+{
+ struct amd8111e_priv *lp = (struct amd8111e_priv *)dev->priv;
+
+ if(dev->irq ==0 || request_irq(dev->irq, amd8111e_interrupt, SA_SHIRQ,
+ dev->name, dev))
+ return -EAGAIN;
+
+ spin_lock_irq(&lp->lock);
+
+ amd8111e_init_hw_default(lp);
+
+ if(amd8111e_restart(dev)){
+ spin_unlock_irq(&lp->lock);
+ return -ENOMEM;
+ }
+
+ lp->opened = 1;
+
+ spin_unlock_irq(&lp->lock);
+
+ netif_start_queue(dev);
+
+ return 0;
+}
+/*
+This function checks if there is any transmit descriptors available to queue more packet.
+*/
+static int amd8111e_tx_queue_avail(struct amd8111e_priv* lp )
+{
+ int tx_index = lp->tx_idx & TX_BUFF_MOD_MASK;
+ if(lp->tx_skbuff[tx_index] != 0)
+ return -1;
+ else
+ return 0;
+
+}
+/*
+This function will queue the transmit packets to the descriptors and will trigger the send operation. It also initializes the transmit descriptors with buffer physical address, byte count, ownership to hardware etc.
+*/
+
+static int amd8111e_start_xmit(struct sk_buff *skb, struct net_device * dev)
+{
+ struct amd8111e_priv *lp = dev->priv;
+ int tx_index;
+ unsigned long flags;
+
+ spin_lock_irqsave(&lp->lock, flags);
+
+ tx_index = lp->tx_idx & TX_RING_DR_MOD_MASK;
+
+ lp->tx_ring[tx_index].buff_count = cpu_to_le16(skb->len);
+
+ lp->tx_skbuff[tx_index] = skb;
+ lp->tx_ring[tx_index].tx_dr_offset2 = 0;
+
+#if AMD8111E_VLAN_TAG_USED
+ if((lp->vlgrp != NULL) && vlan_tx_tag_present(skb)){
+
+ lp->tx_ring[tx_index].tag_ctrl_cmd |=
+ cpu_to_le32(TCC_VLAN_INSERT);
+ lp->tx_ring[tx_index].tag_ctrl_info =
+ cpu_to_le16(vlan_tx_tag_get(skb));
+
+ }
+#endif
+ lp->tx_dma_addr[tx_index] =
+ pci_map_single(lp->pci_dev, skb->data, skb->len, PCI_DMA_TODEVICE);
+ lp->tx_ring[tx_index].buff_phy_addr =
+ (u32) cpu_to_le32(lp->tx_dma_addr[tx_index]);
+
+ /* Set FCS and LTINT bits */
+ lp->tx_ring[tx_index].tx_dr_offset2 |=
+ cpu_to_le16(OWN_BIT | STP_BIT | ENP_BIT|ADD_FCS_BIT|LTINT_BIT);
+
+ lp->tx_idx++;
+
+ /* Trigger an immediate send poll. */
+ writel( VAL1 | TDMD0, lp->mmio + CMD0);
+ writel( VAL2 | RDMD0,lp->mmio + CMD0);
+
+ dev->trans_start = jiffies;
+
+ if(amd8111e_tx_queue_avail(lp) < 0){
+ netif_stop_queue(dev);
+ }
+ spin_unlock_irqrestore(&lp->lock, flags);
+ return 0;
+}
+/*
+This function returns all the memory mapped registers of the device.
+*/
+static char* amd8111e_read_regs(struct amd8111e_priv* lp)
+{
+ void * mmio = lp->mmio;
+ unsigned char * reg_buff;
+
+ int i;
+
+ reg_buff = kmalloc( AMD8111E_REG_DUMP_LEN,GFP_KERNEL);
+ if(NULL == reg_buff)
+ return NULL;
+ for( i=0; i< AMD8111E_REG_DUMP_LEN;i+=4);
+ reg_buff[i]= readl(mmio + i);
+ return reg_buff;
+}
+/*
+This function sets promiscuos mode, all-multi mode or the multicast address
+list to the device.
+*/
+static void amd8111e_set_multicast_list(struct net_device *dev)
+{
+ struct dev_mc_list* mc_ptr;
+ struct amd8111e_priv *lp = dev->priv;
+ u32 mc_filter[2] ;
+ int i,bit_num;
+
+ if(dev->flags & IFF_PROMISC){
+ printk("%s: Setting promiscuous mode.\n",dev->name);
+ writel( VAL2 | PROM, lp->mmio + CMD2);
+ return;
+ }
+ else
+ writel( PROM, lp->mmio + CMD2);
+ if(dev->flags & IFF_ALLMULTI || dev->mc_count > MAX_FILTER_SIZE){
+ /* get all multicast packet */
+ mc_filter[1] = mc_filter[0] = 0xffffffff;
+ lp->mc_list = dev->mc_list;
+ lp->options |= OPTION_MULTICAST_ENABLE;
+ AMD8111E_WRITE_REG64(lp->mmio, LADRF,mc_filter);
+ return;
+ }
+ if( dev->mc_count == 0 ){
+ /* get only own packets */
+ mc_filter[1] = mc_filter[0] = 0;
+ lp->mc_list = 0;
+ lp->options &= ~OPTION_MULTICAST_ENABLE;
+ AMD8111E_WRITE_REG64(lp->mmio, LADRF,mc_filter);
+ /* disable promiscous mode */
+ writel(PROM, lp->mmio + CMD2);
+ return;
+ }
+ /* load all the multicast addresses in the logic filter */
+ lp->options |= OPTION_MULTICAST_ENABLE;
+ lp->mc_list = dev->mc_list;
+ mc_filter[1] = mc_filter[0] = 0;
+ for (i = 0, mc_ptr = dev->mc_list; mc_ptr && i < dev->mc_count;
+ i++, mc_ptr = mc_ptr->next) {
+ bit_num = ether_crc(ETH_ALEN, mc_ptr->dmi_addr) >> 26;
+
+ mc_filter[bit_num >> 5] |= 1 << (bit_num & 31);
+ }
+
+ AMD8111E_WRITE_REG64(lp->mmio, LADRF, mc_filter);
+ return;
+}
+/*
+This function handles all the ethtool ioctls. It gives driver info, gets/sets driver speed, gets memory mapped register values, forces auto negotiation, sets/gets WOL options for ethtool application.
+*/
+
+static int amd8111e_ethtool_ioctl(struct net_device* dev, void* useraddr)
+{
+ struct amd8111e_priv *lp = dev->priv;
+ struct pci_dev *pci_dev = lp->pci_dev;
+ u32 ethcmd;
+
+ if( useraddr == NULL)
+ return -EINVAL;
+ if(copy_from_user (&ethcmd, useraddr, sizeof (ethcmd)))
+ return -EFAULT;
+
+ switch(ethcmd){
+
+ case ETHTOOL_GDRVINFO:{
+ struct ethtool_drvinfo info = { ETHTOOL_GDRVINFO };
+ strcpy (info.driver, MODULE_NAME);
+ strcpy (info.version, MODULE_VERSION);
+ memset(&info.fw_version, 0, sizeof(info.fw_version));
+ strcpy (info.bus_info, pci_dev->slot_name);
+ info.eedump_len = 0;
+ info.regdump_len = AMD8111E_REG_DUMP_LEN;
+ if (copy_to_user (useraddr, &info, sizeof(info)))
+ return -EFAULT;
+ return 0;
+ }
+ case ETHTOOL_GSET:{
+ struct ethtool_cmd cmd = { ETHTOOL_GSET };
+
+ if (!lp->opened)
+ return -EAGAIN;
+
+ cmd.supported = SUPPORTED_Autoneg |
+ SUPPORTED_100baseT_Half |
+ SUPPORTED_100baseT_Full |
+ SUPPORTED_10baseT_Half |
+ SUPPORTED_10baseT_Full |
+ SUPPORTED_MII;
+
+ cmd.advertising = ADVERTISED_Autoneg |
+ ADVERTISED_100baseT_Half |
+ ADVERTISED_100baseT_Full |
+ ADVERTISED_10baseT_Half |
+ ADVERTISED_10baseT_Full |
+ ADVERTISED_MII;
+ cmd.speed = lp->link_config.speed;
+ cmd.duplex = lp->link_config.duplex;
+ cmd.port = 0;
+ cmd.phy_address = PHY_ID;
+ cmd.transceiver = XCVR_EXTERNAL;
+ cmd.autoneg = lp->link_config.autoneg;
+ cmd.maxtxpkt = 0; /* not implemented interrupt coalasing */
+ cmd.maxrxpkt = 0; /* not implemented interrupt coalasing */
+ if (copy_to_user(useraddr, &cmd, sizeof(cmd)))
+ return -EFAULT;
+ return 0;
+ }
+ case ETHTOOL_SSET: {
+
+ struct ethtool_cmd cmd;
+
+ if (!lp->opened)
+ return -EAGAIN;
+ if (copy_from_user(&cmd, useraddr, sizeof(cmd)))
+ return -EFAULT;
+
+ spin_lock_irq(&lp->lock);
+
+ if(cmd.autoneg == AUTONEG_ENABLE){
+ /* keeping the original speeds */
+ if((lp->link_config.speed != SPEED_INVALID)&&
+ (lp->link_config.duplex != DUPLEX_INVALID)){
+ lp->link_config.orig_speed = lp->link_config.speed;
+ lp->link_config.orig_duplex = lp->link_config.duplex;
+ lp->link_config.orig_phy_option = lp->ext_phy_option;
+ }
+
+ lp->ext_phy_option = XPHYANE;
+ }
+ else if(cmd.speed == SPEED_100 && cmd.duplex == DUPLEX_HALF)
+ lp->ext_phy_option = XPHYSP;
+ else if(cmd.speed == SPEED_100 && cmd.duplex == DUPLEX_FULL)
+ lp->ext_phy_option = XPHYSP |XPHYFD;
+ else if(cmd.speed == SPEED_10 && cmd.duplex == DUPLEX_HALF)
+ lp->ext_phy_option = 0;
+ else if(cmd.speed == SPEED_10 && cmd.duplex == DUPLEX_FULL)
+ lp->ext_phy_option = XPHYFD;
+ else {
+ /* setting the original speed */
+ cmd.speed = lp->link_config.orig_speed;
+ cmd.duplex = lp->link_config.orig_duplex;
+ lp->ext_phy_option = lp->link_config.orig_phy_option;
+ }
+ lp->link_config.autoneg = cmd.autoneg;
+ if (cmd.autoneg == AUTONEG_ENABLE) {
+
+ lp->link_config.speed = SPEED_INVALID;
+ lp->link_config.duplex = DUPLEX_INVALID;
+ } else {
+ lp->link_config.speed = cmd.speed;
+ lp->link_config.duplex = cmd.duplex;
+ }
+ amd8111e_set_ext_phy(dev);
+ spin_unlock_irq(&lp->lock);
+ return 0;
+ }
+ case ETHTOOL_GREGS: {
+ struct ethtool_regs regs;
+ u8 *regbuf;
+ int ret;
+
+ if (copy_from_user(&regs, useraddr, sizeof(regs)))
+ return -EFAULT;
+ if (regs.len > AMD8111E_REG_DUMP_LEN)
+ regs.len = AMD8111E_REG_DUMP_LEN;
+ regs.version = 0;
+ if (copy_to_user(useraddr, &regs, sizeof(regs)))
+ return -EFAULT;
+
+ regbuf = amd8111e_read_regs(lp);
+ if (!regbuf)
+ return -ENOMEM;
+
+ useraddr += offsetof(struct ethtool_regs, data);
+ ret = 0;
+ if (copy_to_user(useraddr, regbuf, regs.len))
+ ret = -EFAULT;
+ kfree(regbuf);
+ return ret;
+ }
+ case ETHTOOL_NWAY_RST: {
+ int ret;
+ spin_lock_irq(&lp->lock);
+ if(lp->link_config.autoneg == AUTONEG_ENABLE){
+ lp->ext_phy_option = XPHYANE;
+ amd8111e_set_ext_phy(dev);
+ ret = 0;
+ }else
+ ret = -EINVAL;
+ spin_unlock_irq(&lp->lock);
+ return ret;
+ }
+ case ETHTOOL_GLINK: {
+ struct ethtool_value val = { ETHTOOL_GLINK };
+
+ val.data = netif_carrier_ok(dev) ? 1 : 0;
+ if (copy_to_user(useraddr, &val, sizeof(val)))
+ return -EFAULT;
+ }
+ case ETHTOOL_GWOL: {
+ struct ethtool_wolinfo wol_info = { ETHTOOL_GWOL };
+
+ wol_info.supported = WAKE_MAGIC|WAKE_PHY;
+ wol_info.wolopts = 0;
+ if (lp->options & OPTION_WOL_ENABLE)
+ wol_info.wolopts = WAKE_MAGIC;
+ memset(&wol_info.sopass, 0, sizeof(wol_info.sopass));
+ if (copy_to_user(useraddr, &wol_info, sizeof(wol_info)))
+ return -EFAULT;
+ return 0;
+ }
+ case ETHTOOL_SWOL: {
+ struct ethtool_wolinfo wol_info;
+
+ if (copy_from_user(&wol_info, useraddr, sizeof(wol_info)))
+ return -EFAULT;
+ if (wol_info.wolopts & ~(WAKE_MAGIC |WAKE_PHY))
+ return -EINVAL;
+ spin_lock_irq(&lp->lock);
+ if(wol_info.wolopts & WAKE_MAGIC)
+ lp->options |=
+ (OPTION_WOL_ENABLE | OPTION_WAKE_MAGIC_ENABLE);
+ else if(wol_info.wolopts & WAKE_PHY)
+ lp->options |=
+ (OPTION_WOL_ENABLE | OPTION_WAKE_PHY_ENABLE);
+ else
+ lp->options &= ~OPTION_WOL_ENABLE;
+ spin_unlock_irq(&lp->lock);
+ return 0;
+ }
+
+ default:
+ break;
+ }
+ return -EOPNOTSUPP;
+}
+static int amd8111e_read_phy(struct amd8111e_priv* lp, int phy_id, int reg, u32* val)
+{
+ void * mmio = lp->mmio;
+ unsigned int reg_val;
+ unsigned int repeat= REPEAT_CNT;
+
+ reg_val = readl(mmio + PHY_ACCESS);
+ while (reg_val & PHY_CMD_ACTIVE)
+ reg_val = readl( mmio + PHY_ACCESS );
+
+ writel( PHY_RD_CMD | ((phy_id & 0x1f) << 21) |
+ ((reg & 0x1f) << 16), mmio +PHY_ACCESS);
+ do{
+ reg_val = readl(mmio + PHY_ACCESS);
+ udelay(30); /* It takes 30 us to read/write data */
+ } while (--repeat && (reg_val & PHY_CMD_ACTIVE));
+ if(reg_val & PHY_RD_ERR)
+ goto err_phy_read;
+
+ *val = reg_val & 0xffff;
+ return 0;
+err_phy_read:
+ *val = 0;
+ return -EINVAL;
+
+}
+static int amd8111e_write_phy(struct amd8111e_priv* lp,int phy_id, int reg, u32 val)
+{
+ unsigned int repeat = REPEAT_CNT
+ void * mmio = lp->mmio;
+ unsigned int reg_val;
+
+
+ reg_val = readl(mmio + PHY_ACCESS);
+ while (reg_val & PHY_CMD_ACTIVE)
+ reg_val = readl( mmio + PHY_ACCESS );
+
+ writel( PHY_WR_CMD | ((phy_id & 0x1f) << 21) |
+ ((reg & 0x1f) << 16)|val, mmio + PHY_ACCESS);
+
+ do{
+ reg_val = readl(mmio + PHY_ACCESS);
+ udelay(30); /* It takes 30 us to read/write the data */
+ } while (--repeat && (reg_val & PHY_CMD_ACTIVE));
+
+ if(reg_val & PHY_RD_ERR)
+ goto err_phy_write;
+
+ return 0;
+
+err_phy_write:
+ return -EINVAL;
+
+}
+static int amd8111e_ioctl(struct net_device * dev , struct ifreq *ifr, int cmd)
+{
+ struct mii_ioctl_data *data = (struct mii_ioctl_data *)&ifr->ifr_data;
+ struct amd8111e_priv *lp = dev->priv;
+ int err;
+ u32 mii_regval;
+
+ if (!capable(CAP_NET_ADMIN))
+ return -EPERM;
+
+ switch(cmd) {
+ case SIOCETHTOOL:
+ return amd8111e_ethtool_ioctl(dev, (void *) ifr->ifr_data);
+ case SIOCGMIIPHY:
+ data->phy_id = PHY_ID;
+
+ /* fallthru */
+ case SIOCGMIIREG:
+
+ spin_lock_irq(&lp->lock);
+ err = amd8111e_read_phy(lp, data->phy_id,
+ data->reg_num & PHY_REG_ADDR_MASK, &mii_regval);
+ spin_unlock_irq(&lp->lock);
+
+ data->val_out = mii_regval;
+ return err;
+
+ case SIOCSMIIREG:
+
+ spin_lock_irq(&lp->lock);
+ err = amd8111e_write_phy(lp, data->phy_id,
+ data->reg_num & PHY_REG_ADDR_MASK, data->val_in);
+ spin_unlock_irq(&lp->lock);
+
+ return err;
+
+ default:
+ /* do nothing */
+ break;
+ }
+ return -EOPNOTSUPP;
+}
+/*
+This function changes the mtu of the device. It restarts the device to initialize the descriptor with new receive buffers.
+*/
+int amd8111e_change_mtu(struct net_device *dev, int new_mtu)
+{
+ struct amd8111e_priv *lp = dev->priv;
+ int err;
+
+ if ((new_mtu < AMD8111E_MIN_MTU) || (new_mtu > AMD8111E_MAX_MTU))
+ return -EINVAL;
+
+ if (!netif_running(dev)) {
+ /* new_mtu will be used
+ when device starts netxt time */
+ dev->mtu = new_mtu;
+ return 0;
+ }
+
+ spin_lock_irq(&lp->lock);
+
+ /* stop the chip */
+ writel(RUN, lp->mmio + CMD0);
+
+ dev->mtu = new_mtu;
+
+ /* if (new_mtu > ETH_DATA_LEN)
+ lp->options |= OPTION_JUMBO_ENABLE;
+ else
+ lp->options &= ~OPTION_JUMBO_ENABLE;
+ */
+ err = amd8111e_restart(dev);
+ spin_unlock_irq(&lp->lock);
+
+ netif_start_queue(dev);
+ return err;
+}
+
+#if AMD8111E_VLAN_TAG_USED
+static void amd8111e_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
+{
+ struct amd8111e_priv *lp = dev->priv;
+ spin_lock_irq(&lp->lock);
+ lp->vlgrp = grp;
+ spin_unlock_irq(&lp->lock);
+}
+
+static void amd8111e_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
+{
+ struct amd8111e_priv *lp = dev->priv;
+ spin_lock_irq(&lp->lock);
+ if (lp->vlgrp)
+ lp->vlgrp->vlan_devices[vid] = NULL;
+ spin_unlock_irq(&lp->lock);
+}
+#endif
+static int amd8111e_enable_magicpkt(struct amd8111e_priv* lp)
+{
+ writel( VAL1|MPPLBA, lp->mmio + CMD3);
+ writel( VAL0|MPEN_SW, lp->mmio + CMD7);
+ return 0;
+}
+
+static int amd8111e_enable_link_change(struct amd8111e_priv* lp)
+{
+ /* Adapter is already stoped/suspended/interrupt-disabled */
+ writel(VAL0|LCMODE_SW,lp->mmio + CMD7);
+ return 0;
+}
+
+/*
+This function sets the power state of the device. When the device go to lower power states 1,2, and 3 it enables the wake on lan
+*/
+static int amd8111e_set_power_state(struct amd8111e_priv* lp, u32 state)
+{
+ u16 power_control;
+ int pm = lp->pm_cap;
+
+ pci_read_config_word(lp->pci_dev,
+ pm + PCI_PM_CTRL,
+ &power_control);
+
+ power_control |= PCI_PM_CTRL_PME_STATUS;
+ power_control &= ~(PCI_PM_CTRL_STATE_MASK);
+ switch (state) {
+ case 0:
+ power_control |= 0;
+ pci_write_config_word(lp->pci_dev,
+ pm + PCI_PM_CTRL,
+ power_control);
+ return 0;
+
+ case 1:
+ power_control |= 1;
+ break;
+
+ case 2:
+ power_control |= 2;
+ break;
+
+ case 3:
+ power_control |= 3;
+ break;
+ default:
+
+ printk(KERN_WARNING "%s: Invalid power state (%d) requested.\n",
+ lp->amd8111e_net_dev->name, state);
+ return -EINVAL;
+ }
+
+ if(lp->options & OPTION_WAKE_MAGIC_ENABLE)
+ amd8111e_enable_magicpkt(lp);
+ if(lp->options & OPTION_WAKE_PHY_ENABLE)
+ amd8111e_enable_link_change(lp);
+
+ /* Setting new power state. */
+ pci_write_config_word(lp->pci_dev, pm + PCI_PM_CTRL, power_control);
+
+ return 0;
+
+
+}
+static int amd8111e_suspend(struct pci_dev *pci_dev, u32 state)
+{
+ struct net_device *dev = pci_get_drvdata(pci_dev);
+ struct amd8111e_priv *lp = dev->priv;
+ int err;
+
+ if (!netif_running(dev))
+ return 0;
+
+ /* disable the interrupt */
+ spin_lock_irq(&lp->lock);
+ amd8111e_disable_interrupt(lp);
+ spin_unlock_irq(&lp->lock);
+
+ netif_device_detach(dev);
+
+ /* stop chip */
+ spin_lock_irq(&lp->lock);
+ amd8111e_stop_chip(lp);
+ spin_unlock_irq(&lp->lock);
+
+ err = amd8111e_set_power_state(lp, state);
+ if (err) {
+
+ spin_lock_irq(&lp->lock);
+ amd8111e_restart(dev);
+ spin_unlock_irq(&lp->lock);
+
+ netif_device_attach(dev);
+ }
+ return err;
+}
+static int amd8111e_resume(struct pci_dev *pci_dev)
+{
+ struct net_device *dev = pci_get_drvdata(pci_dev);
+ struct amd8111e_priv *lp = dev->priv;
+ int err;
+
+ if (!netif_running(dev))
+ return 0;
+
+ err = amd8111e_set_power_state(lp, 0);
+ if (err)
+ return err;
+
+ netif_device_attach(dev);
+
+ spin_lock_irq(&lp->lock);
+ amd8111e_restart(dev);
+ spin_unlock_irq(&lp->lock);
+
+ return 0;
+}
+
+
+static void __devexit amd8111e_remove_one(struct pci_dev *pdev)
+{
+ struct net_device *dev = pci_get_drvdata(pdev);
+ if (dev) {
+ unregister_netdev(dev);
+ iounmap((void *) ((struct amd8111e_priv *)(dev->priv))->mmio);
+ kfree(dev);
+ pci_release_regions(pdev);
+ pci_disable_device(pdev);
+ pci_set_drvdata(pdev, NULL);
+ }
+}
+
+static int __devinit amd8111e_probe_one(struct pci_dev *pdev,
+ const struct pci_device_id *ent)
+{
+ int err,i,pm_cap;
+ unsigned long reg_addr,reg_len;
+ struct amd8111e_priv* lp;
+ struct net_device* dev;
+ unsigned int chip_version;
+
+ err = pci_enable_device(pdev);
+ if(err){
+ printk(KERN_ERR "amd8111e: Cannot enable new PCI device,"
+ "exiting.\n");
+ return err;
+ }
+
+ if(!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)){
+ printk(KERN_ERR "amd8111e: Cannot find PCI base address"
+ "exiting.\n");
+ err = -ENODEV;
+ goto err_disable_pdev;
+ }
+
+ err = pci_request_regions(pdev, MODULE_NAME);
+ if(err){
+ printk(KERN_ERR "amd8111e: Cannot obtain PCI resources, "
+ "exiting.\n");
+ goto err_disable_pdev;
+ }
+
+ pci_set_master(pdev);
+
+ /* Find power-management capability. */
+ if((pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM))==0){
+ printk(KERN_ERR "amd8111e: No Power Management capability, "
+ "exiting.\n");
+ goto err_free_reg;
+ }
+
+ /* Initialize DMA */
+ if(!pci_dma_supported(pdev, 0xffffffff)){
+ printk(KERN_ERR "amd8111e: DMA not supported,"
+ "exiting.\n");
+ goto err_free_reg;
+ } else
+ pdev->dma_mask = 0xffffffff;
+
+ reg_addr = pci_resource_start(pdev, 0);
+ reg_len = pci_resource_len(pdev, 0);
+
+ dev = alloc_etherdev(sizeof(struct amd8111e_priv));
+ if (!dev) {
+ printk(KERN_ERR "amd8111e: Etherdev alloc failed, exiting.\n");
+ err = -ENOMEM;
+ goto err_free_reg;
+ }
+
+ SET_MODULE_OWNER(dev);
+
+#if AMD8111E_VLAN_TAG_USED
+ dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX ;
+ dev->vlan_rx_register =amd8111e_vlan_rx_register;
+ dev->vlan_rx_kill_vid = amd8111e_vlan_rx_kill_vid;
+#endif
+
+ lp = dev->priv;
+ memset (lp, 0, sizeof (*lp));
+ lp->pci_dev = pdev;
+ lp->amd8111e_net_dev = dev;
+ lp->pm_cap = pm_cap;
+
+ spin_lock_init(&lp->lock);
+
+ lp->mmio = ioremap(reg_addr, reg_len);
+ if (lp->mmio == 0) {
+ printk(KERN_ERR "amd8111e: Cannot map device registers, "
+ "exiting\n");
+ err = -ENOMEM;
+ goto err_free_dev;
+ }
+
+ /* Initializing MAC address */
+ for(i = 0; i < ETH_ADDR_LEN; i++)
+ dev->dev_addr[i] =readb(lp->mmio + PADR + i);
+ /* Setting user defined speed */
+ if (speed_duplex[card_idx] > sizeof(speed_duplex_mapping))
+ lp->ext_phy_option = XPHYANE;
+ else
+ lp->ext_phy_option =
+ speed_duplex_mapping[speed_duplex[card_idx]];
+ /* Initialize driver entry points */
+ dev->open = amd8111e_open;
+ dev->hard_start_xmit = amd8111e_start_xmit;
+ dev->stop = amd8111e_close;
+ dev->get_stats = amd8111e_get_stats;
+ dev->set_multicast_list = amd8111e_set_multicast_list;
+ dev->do_ioctl = amd8111e_ioctl;
+ dev->change_mtu = amd8111e_change_mtu;
+ dev->irq =pdev->irq;
+
+#if AMD8111E_VLAN_TAG_USED
+ dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
+ dev->vlan_rx_register =amd8111e_vlan_rx_register;
+ dev->vlan_rx_kill_vid = amd8111e_vlan_rx_kill_vid;
+#endif
+
+ /* Set receive buffer length and set jumbo option*/
+ amd8111e_set_rx_buff_len(dev);
+
+
+ /* dev->tx_timeout = tg3_tx_timeout; */
+ /* dev->watchdog_timeo = TG3_TX_TIMEOUT; */
+
+ err = register_netdev(dev);
+ if (err) {
+ printk(KERN_ERR "amd8111e: Cannot register net device, "
+ "exiting.\n");
+ goto err_iounmap;
+ }
+
+ pci_set_drvdata(pdev, dev);
+
+ /* display driver and device information */
+
+ chip_version = (readl(lp->mmio + CHIPID) & 0xf0000000)>>28;
+ printk("%s: AMD-8111e Driver Version: %s\n",dev->name,MODULE_VERSION);
+ printk("%s: [ Rev %x ] PCI 10/100BaseT Ethernet ", dev->name, chip_version);
+ for (i = 0; i < 6; i++)
+ printk("%2.2x%c", dev->dev_addr[i],i == 5 ? ' ' : ':');
+ printk("\n");
+ return 0;
+err_iounmap:
+ iounmap((void *) lp->mmio);
+
+err_free_dev:
+ kfree(dev);
+
+err_free_reg:
+ pci_release_regions(pdev);
+
+err_disable_pdev:
+ pci_disable_device(pdev);
+ pci_set_drvdata(pdev, NULL);
+ return err;
+
+}
+
+static struct pci_driver amd8111e_driver = {
+ name: MODULE_NAME,
+ id_table: amd8111e_pci_tbl,
+ probe: amd8111e_probe_one,
+ remove: __devexit_p(amd8111e_remove_one),
+ suspend: amd8111e_suspend,
+ resume: amd8111e_resume
+};
+
+static int __init amd8111e_init(void)
+{
+ return pci_module_init(&amd8111e_driver);
+}
+
+static void __exit amd8111e_cleanup(void)
+{
+ pci_unregister_driver(&amd8111e_driver);
+}
+
+module_init(amd8111e_init);
+module_exit(amd8111e_cleanup);
diff --git a/drivers/net/amd8111e.h b/drivers/net/amd8111e.h
new file mode 100755
index 000000000000..3ae04e329dfb
--- /dev/null
+++ b/drivers/net/amd8111e.h
@@ -0,0 +1,786 @@
+/*
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+
+Module Name:
+
+ amd8111e.h
+
+Abstract:
+
+ AMD8111 based 10/100 Ethernet Controller driver definitions.
+
+Environment:
+
+ Kernel Mode
+
+Revision History:
+
+*/
+
+#ifndef _AMD811E_H
+#define _AMD811E_H
+
+/* Hardware definitions */
+
+#define B31_MASK 0x80000000
+#define B30_MASK 0X40000000
+#define B29_MASK 0x20000000
+#define B28_MASK 0x10000000
+#define B27_MASK 0x08000000
+#define B26_MASK 0x04000000
+#define B25_MASK 0x02000000
+#define B24_MASK 0x01000000
+#define B23_MASK 0x00800000
+#define B22_MASK 0x00400000
+#define B21_MASK 0x00200000
+#define B20_MASK 0x00100000
+#define B19_MASK 0x00080000
+#define B18_MASK 0x00040000
+#define B17_MASK 0x00020000
+#define B16_MASK 0x00010000
+
+#define B15_MASK 0x8000
+#define B14_MASK 0x4000
+#define B13_MASK 0x2000
+#define B12_MASK 0x1000
+#define B11_MASK 0x0800
+#define B10_MASK 0x0400
+#define B9_MASK 0x0200
+#define B8_MASK 0x0100
+#define B7_MASK 0x0080
+#define B6_MASK 0x0040
+#define B5_MASK 0x0020
+#define B4_MASK 0x0010
+#define B3_MASK 0x0008
+#define B2_MASK 0x0004
+#define B1_MASK 0x0002
+#define B0_MASK 0x0001
+
+/* PCI register offset */
+#define PCI_ID_REG 0x00
+#define PCI_COMMAND_REG 0x04
+/* #define MEMEN_BIT B1_MASK */
+/* #define IOEN_BIT B0_MASK */
+#define PCI_REV_ID_REG 0x08
+#define PCI_MEM_BASE_REG 0x10
+/* #define MEMBASE_MASK 0xFFFFF000 */
+/* #define MEMBASE_SIZE 4096 */
+#define PCI_INTR_REG 0x3C
+#define PCI_STATUS_REG 0x06
+#define PCI_CAP_ID_REG_OFFSET 0x34
+#define PCI_PMC_REG_OFFSET 0x36
+#define PCI_PMCSR_REG_OFFSET 0x38
+
+/* #define NEW_CAP 0x0010 */
+#define PME_EN 0x0100
+
+#define PARTID_MASK 0xFFFFF000
+#define PARTID_START_BIT 12
+
+/* #define LANCE_DWIO_RESET_PORT 0x18
+#define LANCE_WIO_RESET_PORT 0x14 */
+#define MIB_OFFSET 0x28
+
+/* Command style register access
+
+Registers CMD0, CMD2, CMD3,CMD7 and INTEN0 uses a write access technique called command style access. It allows the write to selected bits of this register without altering the bits that are not selected. Command style registers are divided into 4 bytes that can be written independently. Higher order bit of each byte is the value bit that specifies the value that will be written into the selected bits of register.
+
+eg., if the value 10011010b is written into the least significant byte of a command style register, bits 1,3 and 4 of the register will be set to 1, and the other bits will not be altered. If the value 00011010b is written into the same byte, bits 1,3 and 4 will be cleared to 0 and the other bits will not be altered.
+
+*/
+
+/* Offset for Memory Mapped Registers. */
+/* 32 bit registers */
+
+#define ASF_STAT 0x00 /* ASF status register */
+#define CHIPID 0x04 /* Chip ID regsiter */
+#define MIB_DATA 0x10 /* MIB data register */
+#define MIB_ADDR 0x14 /* MIB address register */
+#define STAT0 0x30 /* Status0 register */
+#define INT0 0x38 /* Interrupt0 register */
+#define INTEN0 0x40 /* Interrupt0 enable register*/
+#define CMD0 0x48 /* Command0 register */
+#define CMD2 0x50 /* Command2 register */
+#define CMD3 0x54 /* Command3 resiter */
+#define CMD7 0x64 /* Command7 register */
+
+#define CTRL1 0x6C /* Control1 register */
+#define CTRL2 0x70 /* Control2 register */
+
+#define XMT_RING_LIMIT 0x7C /* Transmit ring limit register */
+
+#define AUTOPOLL0 0x88 /* Auto-poll0 register */
+#define AUTOPOLL1 0x8A /* Auto-poll1 register */
+#define AUTOPOLL2 0x8C /* Auto-poll2 register */
+#define AUTOPOLL3 0x8E /* Auto-poll3 register */
+#define AUTOPOLL4 0x90 /* Auto-poll4 register */
+#define AUTOPOLL5 0x92 /* Auto-poll5 register */
+
+#define AP_VALUE 0x98 /* Auto-poll value register */
+#define DLY_INT_A 0xA8 /* Group A delayed interrupt register */
+#define DLY_INT_B 0xAC /* Group B delayed interrupt register */
+
+#define FLOW_CONTROL 0xC8 /* Flow control register */
+#define PHY_ACCESS 0xD0 /* PHY access register */
+
+#define STVAL 0xD8 /* Software timer value register */
+
+#define XMT_RING_BASE_ADDR0 0x100 /* Transmit ring0 base addr register */
+#define XMT_RING_BASE_ADDR1 0x108 /* Transmit ring1 base addr register */
+#define XMT_RING_BASE_ADDR2 0x110 /* Transmit ring2 base addr register */
+#define XMT_RING_BASE_ADDR3 0x118 /* Transmit ring2 base addr register */
+
+#define RCV_RING_BASE_ADDR0 0x120 /* Transmit ring0 base addr register */
+
+#define PMAT0 0x190 /* OnNow pattern register0 */
+#define PMAT1 0x194 /* OnNow pattern register1 */
+
+/* 16bit registers */
+
+#define XMT_RING_LEN0 0x140 /* Transmit Ring0 length register */
+#define XMT_RING_LEN1 0x144 /* Transmit Ring1 length register */
+#define XMT_RING_LEN2 0x148 /* Transmit Ring2 length register */
+#define XMT_RING_LEN3 0x14C /* Transmit Ring3 length register */
+
+#define RCV_RING_LEN0 0x150 /* Transmit Ring0 length register */
+
+#define SRAM_SIZE 0x178 /* SRAM size register */
+#define SRAM_BOUNDARY 0x17A /* SRAM boundary register */
+
+/* 48bit register */
+
+#define PADR 0x160 /* Physical address register */
+
+/* 64bit register */
+
+#define LADRF 0x168 /* Logical address filter register */
+
+/* 8bit regsisters */
+
+#define IFS1 0x18C /* Inter-frame spacing Part1 register */
+#define IFS 0x18D /* Inter-frame spacing register */
+
+/* Register Bit Definitions */
+
+/* STAT_ASF 0x00, 32bit register */
+#define ASF_INIT_DONE B1_MASK
+#define ASF_INIT_PRESENT B0_MASK
+
+/* MIB_ADDR 0x14, 16bit register */
+#define MIB_CMD_ACTIVE B15_MASK
+#define MIB_RD_CMD B13_MASK
+#define MIB_CLEAR B12_MASK
+#define MIB_ADDRESS 0x0000003F /* 5:0 */
+
+/* QOS_ADDR 0x1C, 16bit register */
+#define QOS_CMD_ACTIVE B15_MASK
+#define QOS_WR_CMD B14_MASK
+#define QOS_RD_CMD B13_MASK
+#define QOS_ADDRESS 0x0000001F /* 4:0 */
+
+/* STAT0 0x30, 32bit register */
+#define PAUSE_PEND B14_MASK
+#define PAUSING B13_MASK
+#define PMAT_DET B12_MASK
+#define MP_DET B11_MASK
+#define LC_DET B10_MASK
+#define SPEED_MASK 0x0380 /* 9:7 */
+#define FULL_DPLX B6_MASK
+#define LINK_STATS B5_MASK
+#define AUTONEG_COMPLETE B4_MASK
+#define MIIPD B3_MASK
+#define RX_SUSPENDED B2_MASK
+#define TX_SUSPENDED B1_MASK
+#define RUNNING B0_MASK
+#define PHY_SPEED_10 0x2
+#define PHY_SPEED_100 0x3
+
+/* INT0 0x38, 32bit register */
+#define INTR B31_MASK
+#define PCSINT B28_MASK
+#define LCINT B27_MASK
+#define APINT5 B26_MASK
+#define APINT4 B25_MASK
+#define APINT3 B24_MASK
+#define TINT_SUM B23_MASK
+#define APINT2 B22_MASK
+#define APINT1 B21_MASK
+#define APINT0 B20_MASK
+#define MIIPDTINT B19_MASK
+#define MCCIINT B18_MASK
+#define MCCINT B17_MASK
+#define MREINT B16_MASK
+#define RINT_SUM B15_MASK
+#define SPNDINT B14_MASK
+#define MPINT B13_MASK
+#define SINT B12_MASK
+#define TINT3 B11_MASK
+#define TINT2 B10_MASK
+#define TINT1 B9_MASK
+#define TINT0 B8_MASK
+#define UINT B7_MASK
+#define STINT B4_MASK
+#define RINT3 B3_MASK
+#define RINT2 B2_MASK
+#define RINT1 B1_MASK
+#define RINT0 B0_MASK
+
+/* INTEN0 0x40, 32bit register */
+#define VAL3 B31_MASK /* VAL bit for byte 3 */
+#define VAL2 B23_MASK /* VAL bit for byte 2 */
+#define VAL1 B15_MASK /* VAL bit for byte 1 */
+#define VAL0 B7_MASK /* VAL bit for byte 0 */
+/* VAL3 */
+#define PSCINTEN B28_MASK
+#define LCINTEN B27_MASK
+#define APINT5EN B26_MASK
+#define APINT4EN B25_MASK
+#define APINT3EN B24_MASK
+/* VAL2 */
+#define APINT2EN B22_MASK
+#define APINT1EN B21_MASK
+#define APINT0EN B20_MASK
+#define MIIPDTINTEN B19_MASK
+#define MCCIINTEN B18_MASK
+#define MCCINTEN B17_MASK
+#define MREINTEN B16_MASK
+/* VAL1 */
+#define SPNDINTEN B14_MASK
+#define MPINTEN B13_MASK
+#define SINTEN B12_MASK
+#define TINTEN3 B11_MASK
+#define TINTEN2 B10_MASK
+#define TINTEN1 B9_MASK
+#define TINTEN0 B8_MASK
+/* VAL0 */
+#define STINTEN B4_MASK
+#define RINTEN3 B3_MASK
+#define RINTEN2 B2_MASK
+#define RINTEN1 B1_MASK
+#define RINTEN0 B0_MASK
+
+#define INTEN0_CLEAR 0x1F7F7F1F /* Command style register */
+
+/* CMD0 0x48, 32bit register */
+/* VAL2 */
+#define RDMD3 B19_MASK
+#define RDMD2 B18_MASK
+#define RDMD1 B17_MASK
+#define RDMD0 B16_MASK
+/* VAL1 */
+#define TDMD3 B11_MASK
+#define TDMD2 B10_MASK
+#define TDMD1 B9_MASK
+#define TDMD0 B8_MASK
+/* VAL0 */
+#define UINTCMD B6_MASK
+#define RX_FAST_SPND B5_MASK
+#define TX_FAST_SPND B4_MASK
+#define RX_SPND B3_MASK
+#define TX_SPND B2_MASK
+#define INTREN B1_MASK
+#define RUN B0_MASK
+
+#define CMD0_CLEAR 0x000F0F7F /* Command style register */
+
+/* CMD2 0x50, 32bit register */
+/* VAL3 */
+#define CONDUIT_MODE B29_MASK
+/* VAL2 */
+#define RPA B19_MASK
+#define DRCVPA B18_MASK
+#define DRCVBC B17_MASK
+#define PROM B16_MASK
+/* VAL1 */
+#define ASTRP_RCV B13_MASK
+#define FCOLL B12_MASK
+#define EMBA B11_MASK
+#define DXMT2PD B10_MASK
+#define LTINTEN B9_MASK
+#define DXMTFCS B8_MASK
+/* VAL0 */
+#define APAD_XMT B6_MASK
+#define DRTY B5_MASK
+#define INLOOP B4_MASK
+#define EXLOOP B3_MASK
+#define REX_RTRY B2_MASK
+#define REX_UFLO B1_MASK
+#define REX_LCOL B0_MASK
+
+#define CMD2_CLEAR 0x3F7F3F7F /* Command style register */
+
+/* CMD3 0x54, 32bit register */
+/* VAL3 */
+#define ASF_INIT_DONE_ALIAS B29_MASK
+/* VAL2 */
+#define JUMBO B21_MASK
+#define VSIZE B20_MASK
+#define VLONLY B19_MASK
+#define VL_TAG_DEL B18_MASK
+/* VAL1 */
+#define EN_PMGR B14_MASK
+#define INTLEVEL B13_MASK
+#define FORCE_FULL_DUPLEX B12_MASK
+#define FORCE_LINK_STATUS B11_MASK
+#define APEP B10_MASK
+#define MPPLBA B9_MASK
+/* VAL0 */
+#define RESET_PHY_PULSE B2_MASK
+#define RESET_PHY B1_MASK
+#define PHY_RST_POL B0_MASK
+/* CMD7 0x64, 32bit register */
+/* VAL0 */
+#define PMAT_SAVE_MATCH B4_MASK
+#define PMAT_MODE B3_MASK
+#define MPEN_SW B1_MASK
+#define LCMODE_SW B0_MASK
+
+#define CMD7_CLEAR 0x0000001B /* Command style register */
+/* CTRL0 0x68, 32bit register */
+#define PHY_SEL 0x03000000 /* 25:24 */
+#define RESET_PHY_WIDTH 0x00FF0000 /* 23:16 */
+#define BSWP_REGS B10_MASK
+#define BSWP_DESC B9_MASK
+#define BSWP_DATA B8_MASK
+#define CACHE_ALIGN B4_MASK
+#define BURST_LIMIT 0x0000000F /* 3:0 */
+
+/* CTRL1 0x6C, 32bit register */
+#define SLOTMOD_MASK 0x03000000 /* 25:24 */
+#define XMTSP_MASK 0x300 /* 17:16 */
+#define XMTSP_128 0x200
+#define XMTSP_64 0x100
+#define CRTL1_DEFAULT 0x00000017
+
+/* CTRL2 0x70, 32bit register */
+#define FS_MASK 0x00070000 /* 18:16 */
+#define FMDC_MASK 0x00000300 /* 9:8 */
+#define XPHYRST B7_MASK
+#define XPHYANE B6_MASK
+#define XPHYFD B5_MASK
+#define XPHYSP B3_MASK /* 4:3 */
+#define APDW_MASK 0x00000007 /* 2:0 */
+
+/* RCV_RING_CFG 0x78, 16bit register */
+#define RCV_DROP3 B11_MASK
+#define RCV_DROP2 B10_MASK
+#define RCV_DROP1 B9_MASK
+#define RCV_DROP0 B8_MASK
+#define RCV_RING_DEFAULT 0x0030 /* 5:4 */
+#define RCV_RING3_EN B3_MASK
+#define RCV_RING2_EN B2_MASK
+#define RCV_RING1_EN B1_MASK
+#define RCV_RING0_EN B0_MASK
+
+/* XMT_RING_LIMIT 0x7C, 32bit register */
+#define XMT_RING2_LIMIT 0x00FF0000 /* 23:16 */
+#define XMT_RING1_LIMIT 0x0000FF00 /* 15:8 */
+#define XMT_RING0_LIMIT 0x000000FF /* 7:0 */
+
+/* AUTOPOLL0 0x88, 16bit register */
+#define AP_REG0_EN B15_MASK
+#define AP_REG0_ADDR_MASK 0x1F00 /* 12:8 */
+#define AP_PHY0_ADDR_MASK 0x001F /* 4:0 */
+
+/* AUTOPOLL1 0x8A, 16bit register */
+#define AP_REG1_EN B15_MASK
+#define AP_REG1_ADDR_MASK 0x1F00 /* 12:8 */
+#define AP_PRE_SUP1 B6_MASK
+#define AP_PHY1_DFLT B5_MASK
+#define AP_PHY1_ADDR_MASK 0x001F /* 4:0 */
+
+/* AUTOPOLL2 0x8C, 16bit register */
+#define AP_REG2_EN B15_MASK
+#define AP_REG2_ADDR_MASK 0x1F00 /* 12:8 */
+#define AP_PRE_SUP2 B6_MASK
+#define AP_PHY2_DFLT B5_MASK
+#define AP_PHY2_ADDR_MASK 0x001F /* 4:0 */
+
+/* AUTOPOLL3 0x8E, 16bit register */
+#define AP_REG3_EN B15_MASK
+#define AP_REG3_ADDR_MASK 0x1F00 /* 12:8 */
+#define AP_PRE_SUP3 B6_MASK
+#define AP_PHY3_DFLT B5_MASK
+#define AP_PHY3_ADDR_MASK 0x001F /* 4:0 */
+
+/* AUTOPOLL4 0x90, 16bit register */
+#define AP_REG4_EN B15_MASK
+#define AP_REG4_ADDR_MASK 0x1F00 /* 12:8 */
+#define AP_PRE_SUP4 B6_MASK
+#define AP_PHY4_DFLT B5_MASK
+#define AP_PHY4_ADDR_MASK 0x001F /* 4:0 */
+
+/* AUTOPOLL5 0x92, 16bit register */
+#define AP_REG5_EN B15_MASK
+#define AP_REG5_ADDR_MASK 0x1F00 /* 12:8 */
+#define AP_PRE_SUP5 B6_MASK
+#define AP_PHY5_DFLT B5_MASK
+#define AP_PHY5_ADDR_MASK 0x001F /* 4:0 */
+
+/* AP_VALUE 0x98, 32bit ragister */
+#define AP_VAL_ACTIVE B31_MASK
+#define AP_VAL_RD_CMD B29_MASK
+#define AP_ADDR 0x00070000 /* 18:16 */
+#define AP_VAL 0x0000FFFF /* 15:0 */
+
+/* PCS_ANEG 0x9C, 32bit register */
+#define SYNC_LOST B10_MASK
+#define IMATCH B9_MASK
+#define CMATCH B8_MASK
+#define PCS_AN_IDLE B1_MASK
+#define PCS_AN_CFG B0_MASK
+
+/* DLY_INT_A 0xA8, 32bit register */
+#define DLY_INT_A_R3 B31_MASK
+#define DLY_INT_A_R2 B30_MASK
+#define DLY_INT_A_R1 B29_MASK
+#define DLY_INT_A_R0 B28_MASK
+#define DLY_INT_A_T3 B27_MASK
+#define DLY_INT_A_T2 B26_MASK
+#define DLY_INT_A_T1 B25_MASK
+#define DLY_INT_A_T0 B24_MASK
+#define EVENT_COUNT_A 0x00FF0000 /* 20:16 */
+#define MAX_DELAY_TIME_A 0x000007FF /* 10:0 */
+
+/* DLY_INT_B 0xAC, 32bit register */
+#define DLY_INT_B_R3 B31_MASK
+#define DLY_INT_B_R2 B30_MASK
+#define DLY_INT_B_R1 B29_MASK
+#define DLY_INT_B_R0 B28_MASK
+#define DLY_INT_B_T3 B27_MASK
+#define DLY_INT_B_T2 B26_MASK
+#define DLY_INT_B_T1 B25_MASK
+#define DLY_INT_B_T0 B24_MASK
+#define EVENT_COUNT_B 0x00FF0000 /* 20:16 */
+#define MAX_DELAY_TIME_B 0x000007FF /* 10:0 */
+
+/* DFC_THRESH2 0xC0, 16bit register */
+#define DFC_THRESH2_HIGH 0xFF00 /* 15:8 */
+#define DFC_THRESH2_LOW 0x00FF /* 7:0 */
+
+/* DFC_THRESH3 0xC2, 16bit register */
+#define DFC_THRESH3_HIGH 0xFF00 /* 15:8 */
+#define DFC_THRESH3_LOW 0x00FF /* 7:0 */
+
+/* DFC_THRESH0 0xC4, 16bit register */
+#define DFC_THRESH0_HIGH 0xFF00 /* 15:8 */
+#define DFC_THRESH0_LOW 0x00FF /* 7:0 */
+
+/* DFC_THRESH1 0xC6, 16bit register */
+#define DFC_THRESH1_HIGH 0xFF00 /* 15:8 */
+#define DFC_THRESH1_LOW 0x00FF /* 7:0 */
+
+/* FLOW_CONTROL 0xC8, 32bit register */
+#define PAUSE_LEN_CHG B30_MASK
+#define FFC_EN B28_MASK
+#define DFC_RING3_EN B27_MASK
+#define DFC_RING2_EN B26_MASK
+#define DFC_RING1_EN B25_MASK
+#define DFC_RING0_EN B24_MASK
+#define FIXP_CONGEST B21_MASK
+#define FPA B20_MASK
+#define NPA B19_MASK
+#define FIXP B18_MASK
+#define FCPEN B17_MASK
+#define FCCMD B16_MASK
+#define PAUSE_LEN 0x0000FFFF /* 15:0 */
+
+/* FFC THRESH 0xCC, 32bit register */
+#define FFC_HIGH 0xFFFF0000 /* 31:16 */
+#define FFC_LOW 0x0000FFFF /* 15:0 */
+
+/* PHY_ ACCESS 0xD0, 32bit register */
+#define PHY_CMD_ACTIVE B31_MASK
+#define PHY_WR_CMD B30_MASK
+#define PHY_RD_CMD B29_MASK
+#define PHY_RD_ERR B28_MASK
+#define PHY_PRE_SUP B27_MASK
+#define PHY_ADDR 0x03E00000 /* 25:21 */
+#define PHY_REG_ADDR 0x001F0000 /* 20:16 */
+#define PHY_DATA 0x0000FFFF /* 15:0 */
+
+/* LED0..3 0xE0..0xE6, 16bit register */
+#define LEDOUT B15_MASK
+#define LEDPOL B14_MASK
+#define LEDDIS B13_MASK
+#define LEDSTRETCH B12_MASK
+#define LED1000 B8_MASK
+#define LED100 B7_MASK
+#define LEDMP B6_MASK
+#define LEDFD B5_MASK
+#define LEDLINK B4_MASK
+#define LEDRCVMAT B3_MASK
+#define LEDXMT B2_MASK
+#define LEDRCV B1_MASK
+#define LEDCOLOUT B0_MASK
+
+/* EEPROM_ACC 0x17C, 16bit register */
+#define PVALID B15_MASK
+#define PREAD B14_MASK
+#define EEDET B13_MASK
+#define EEN B4_MASK
+#define ECS B2_MASK
+#define EESK B1_MASK
+#define edi_edo b0_MASK
+
+/* PMAT0 0x190, 32bit register */
+#define PMR_ACTIVE B31_MASK
+#define PMR_WR_CMD B30_MASK
+#define PMR_RD_CMD B29_MASK
+#define PMR_BANK B28_MASK
+#define PMR_ADDR 0x007F0000 /* 22:16 */
+#define PMR_B4 0x000000FF /* 15:0 */
+
+/* PMAT1 0x194, 32bit register */
+#define PMR_B3 0xFF000000 /* 31:24 */
+#define PMR_B2 0x00FF0000 /* 23:16 */
+#define PMR_B1 0x0000FF00 /* 15:8 */
+#define PMR_B0 0x000000FF /* 7:0 */
+
+/************************************************************************/
+/* */
+/* MIB counter definitions */
+/* */
+/************************************************************************/
+
+#define rcv_miss_pkts 0x00
+#define rcv_octets 0x01
+#define rcv_broadcast_pkts 0x02
+#define rcv_multicast_pkts 0x03
+#define rcv_undersize_pkts 0x04
+#define rcv_oversize_pkts 0x05
+#define rcv_fragments 0x06
+#define rcv_jabbers 0x07
+#define rcv_unicast_pkts 0x08
+#define rcv_alignment_errors 0x09
+#define rcv_fcs_errors 0x0A
+#define rcv_good_octets 0x0B
+#define rcv_mac_ctrl 0x0C
+#define rcv_flow_ctrl 0x0D
+#define rcv_pkts_64_octets 0x0E
+#define rcv_pkts_65to127_octets 0x0F
+#define rcv_pkts_128to255_octets 0x10
+#define rcv_pkts_256to511_octets 0x11
+#define rcv_pkts_512to1023_octets 0x12
+#define rcv_pkts_1024to1518_octets 0x13
+#define rcv_unsupported_opcode 0x14
+#define rcv_symbol_errors 0x15
+#define rcv_drop_pkts_ring1 0x16
+#define rcv_drop_pkts_ring2 0x17
+#define rcv_drop_pkts_ring3 0x18
+#define rcv_drop_pkts_ring4 0x19
+#define rcv_jumbo_pkts 0x1A
+
+#define xmt_underrun_pkts 0x20
+#define xmt_octets 0x21
+#define xmt_packets 0x22
+#define xmt_broadcast_pkts 0x23
+#define xmt_multicast_pkts 0x24
+#define xmt_collisions 0x25
+#define xmt_unicast_pkts 0x26
+#define xmt_one_collision 0x27
+#define xmt_multiple_collision 0x28
+#define xmt_deferred_transmit 0x29
+#define xmt_late_collision 0x2A
+#define xmt_excessive_defer 0x2B
+#define xmt_loss_carrier 0x2C
+#define xmt_excessive_collision 0x2D
+#define xmt_back_pressure 0x2E
+#define xmt_flow_ctrl 0x2F
+#define xmt_pkts_64_octets 0x30
+#define xmt_pkts_65to127_octets 0x31
+#define xmt_pkts_128to255_octets 0x32
+#define xmt_pkts_256to511_octets 0x33
+#define xmt_pkts_512to1023_octets 0x34
+#define xmt_pkts_1024to1518_octet 0x35
+#define xmt_oversize_pkts 0x36
+#define xmt_jumbo_pkts 0x37
+
+
+/* Driver definitions */
+
+#define PCI_VENDOR_ID_AMD 0x1022
+#define PCI_DEVICE_ID_AMD8111E_7462 0x7462
+
+#define MAX_UNITS 16 /* Maximum number of devices possible */
+
+#define NUM_TX_BUFFERS 32 /* Number of transmit buffers */
+#define NUM_RX_BUFFERS 32 /* Number of receive buffers */
+
+#define TX_BUFF_MOD_MASK 31 /* (NUM_TX_BUFFERS -1) */
+#define RX_BUFF_MOD_MASK 31 /* (NUM_RX_BUFFERS -1) */
+
+#define NUM_TX_RING_DR 32
+#define NUM_RX_RING_DR 32
+
+#define TX_RING_DR_MOD_MASK 31 /* (NUM_TX_RING_DR -1) */
+#define RX_RING_DR_MOD_MASK 31 /* (NUM_RX_RING_DR -1) */
+
+#define MAX_FILTER_SIZE 64 /* Maximum multicast address */
+#define AMD8111E_MIN_MTU 60
+#define AMD8111E_MAX_MTU 9000
+
+#define PKT_BUFF_SZ 1536
+#define MIN_PKT_LEN 60
+#define ETH_ADDR_LEN 6
+
+#define OPTION_VLAN_ENABLE 0x0001
+#define OPTION_JUMBO_ENABLE 0x0002
+#define OPTION_MULTICAST_ENABLE 0x0004
+#define OPTION_WOL_ENABLE 0x0008
+#define OPTION_WAKE_MAGIC_ENABLE 0x0010
+#define OPTION_WAKE_PHY_ENABLE 0x0020
+
+#define PHY_REG_ADDR_MASK 0x1f
+
+/* Assume contoller gets data 10 times the maximum processing time */
+#define REPEAT_CNT 10;
+
+/* amd8111e decriptor flag definitions */
+
+#define OWN_BIT B15_MASK
+#define ADD_FCS_BIT B13_MASK
+#define LTINT_BIT B12_MASK
+#define STP_BIT B9_MASK
+#define ENP_BIT B8_MASK
+#define KILL_BIT B6_MASK
+#define TCC_MASK 0x0003
+#define TCC_VLAN_INSERT B1_MASK
+#define TCC_VLAN_REPLACE 0x0003
+#define RESET_RX_FLAGS 0x0000
+
+#define ERR_BIT B14_MASK
+#define FRAM_BIT B13_MASK
+#define OFLO_BIT B12_MASK
+#define CRC_BIT B11_MASK
+#define PAM_BIT B6_MASK
+#define LAFM_BIT B5_MASK
+#define BAM_BIT B4_MASK
+#define TT_MASK 0x000c
+#define TT_VLAN_TAGGED 0x000c
+#define TT_PRTY_TAGGED 0x0008
+
+/* driver ioctl parameters */
+#define PHY_ID 0x01 /* currently it is fixed */
+#define AMD8111E_REG_DUMP_LEN 4096 /* Memory mapped register length */
+
+/* amd8111e desriptor format */
+
+struct amd8111e_tx_dr{
+
+ u16 buff_count; /* Size of the buffer pointed by this descriptor */
+
+ u16 tx_dr_offset2;
+
+ u16 tag_ctrl_info;
+
+ u16 tag_ctrl_cmd;
+
+ u32 buff_phy_addr;
+
+ u32 reserved;
+};
+
+struct amd8111e_rx_dr{
+
+ u32 reserved;
+
+ u16 msg_count; /* Received message len */
+
+ u16 tag_ctrl_info;
+
+ u16 buff_count; /* Len of the buffer pointed by descriptor. */
+
+ u16 rx_dr_offset10;
+
+ u32 buff_phy_addr;
+
+};
+struct amd8111e_link_config{
+
+#define SPEED_INVALID 0xffff
+#define DUPLEX_INVALID 0xff
+#define AUTONEG_INVALID 0xff
+
+ unsigned long orig_phy_option;
+ u16 speed;
+ u8 duplex;
+ u8 autoneg;
+ u16 orig_speed;
+ u8 orig_duplex;
+ u8 reserved; /* 32bit alignment */
+};
+struct amd8111e_priv{
+
+ struct amd8111e_tx_dr* tx_ring;
+ struct amd8111e_rx_dr* rx_ring;
+ dma_addr_t tx_ring_dma_addr; /* tx descriptor ring base address */
+ dma_addr_t rx_ring_dma_addr; /* rx descriptor ring base address */
+ const char *name;
+ struct pci_dev *pci_dev; /* Ptr to the associated pci_dev */
+ struct net_device* amd8111e_net_dev; /* ptr to associated net_device */
+ /* Transmit and recive skbs */
+ struct sk_buff *tx_skbuff[NUM_TX_BUFFERS];
+ struct sk_buff *rx_skbuff[NUM_RX_BUFFERS];
+ /* Transmit and receive dma mapped addr */
+ dma_addr_t tx_dma_addr[NUM_TX_BUFFERS];
+ dma_addr_t rx_dma_addr[NUM_RX_BUFFERS];
+ /* Reg memory mapped address */
+ void * mmio;
+
+ spinlock_t lock; /* Guard lock */
+ unsigned long rx_idx, tx_idx; /* The next free ring entry */
+ unsigned long tx_complete_idx;
+ unsigned long tx_ring_complete_idx;
+ unsigned long tx_ring_idx;
+ int rx_buff_len; /* Buffer length of rx buffers */
+ int options; /* Options enabled/disabled for the device */
+ unsigned long ext_phy_option;
+ struct amd8111e_link_config link_config;
+ int pm_cap;
+
+ struct net_device *next;
+#if AMD8111E_VLAN_TAG_USED
+ struct vlan_group *vlgrp;
+#endif
+ char opened;
+ struct net_device_stats stats;
+ struct net_device_stats prev_stats;
+ struct dev_mc_list* mc_list;
+
+};
+#define AMD8111E_READ_REG64(_memMapBase, _offset, _pUlData) \
+ *(u32*)(_pUlData) = readl(_memMapBase + (_offset)); \
+ *((u32*)(_pUlData))+1) = readl(_memMapBase + ((_offset)+4))
+
+#define AMD8111E_WRITE_REG64(_memMapBase, _offset, _pUlData) \
+ writel(*(u32*)(_pUlData), _memMapBase + (_offset)); \
+ writel(*(u32*)((u8*)(_pUlData)+4), _memMapBase + ((_offset)+4)) \
+
+/* maps the external speed options to internal value */
+static unsigned char speed_duplex_mapping[] = {
+
+ XPHYANE, /* Auto-negotiation, speed_duplex option 0 */
+ 0, /* 10M Half, speed_duplex option 1 */
+ XPHYFD, /* 10M Full, speed_duplex option 2 */
+ XPHYSP, /* 100M Half, speed_duplex option 3 */
+ XPHYFD | XPHYSP /* 100M Full, speed_duplex option 4 */
+};
+static int card_idx;
+static int speed_duplex[MAX_UNITS] = { 0, };
+
+#endif /* _AMD8111E_H */
+
diff --git a/drivers/net/arcnet/Kconfig b/drivers/net/arcnet/Kconfig
index df5bd14a8518..699cbd9630fd 100644
--- a/drivers/net/arcnet/Kconfig
+++ b/drivers/net/arcnet/Kconfig
@@ -3,7 +3,7 @@
#
menu "ARCnet devices"
- depends on NETDEVICES
+ depends on NETDEVICES && (ISA || PCI)
config ARCNET
tristate "ARCnet support"
diff --git a/drivers/net/e100/e100.h b/drivers/net/e100/e100.h
index be562cd2387e..f51facfce1f0 100644
--- a/drivers/net/e100/e100.h
+++ b/drivers/net/e100/e100.h
@@ -268,6 +268,7 @@ struct driver_stats {
#define SCB_CUC_NOOP 0
#define SCB_CUC_START BIT_4 /* CU Start */
#define SCB_CUC_RESUME BIT_5 /* CU Resume */
+#define SCB_CUC_UNKNOWN BIT_7 /* CU unknown command */
/* Changed for 82558 enhancements */
#define SCB_CUC_STATIC_RESUME (BIT_5 | BIT_7) /* 82558/9 Static Resume */
#define SCB_CUC_DUMP_ADDR BIT_6 /* CU Dump Counters Address */
@@ -953,6 +954,10 @@ struct e100_private {
u32 pci_state[16];
#endif
char ifname[IFNAMSIZ];
+#ifdef E100_CU_DEBUG
+ u8 last_cmd;
+ u8 last_sub_cmd;
+#endif
};
#define E100_AUTONEG 0
@@ -964,7 +969,7 @@ struct e100_private {
/********* function prototypes *************/
extern void e100_isolate_driver(struct e100_private *bdp);
extern void e100_sw_reset(struct e100_private *bdp, u32 reset_cmd);
-extern void e100_start_cu(struct e100_private *bdp, tcb_t *tcb);
+extern u8 e100_start_cu(struct e100_private *bdp, tcb_t *tcb);
extern void e100_free_non_tx_cmd(struct e100_private *bdp,
nxmit_cb_entry_t *non_tx_cmd);
extern nxmit_cb_entry_t *e100_alloc_non_tx_cmd(struct e100_private *bdp);
@@ -976,8 +981,10 @@ extern unsigned char e100_get_link_state(struct e100_private *bdp);
extern unsigned char e100_wait_scb(struct e100_private *bdp);
extern void e100_deisolate_driver(struct e100_private *bdp, u8 full_reset);
-extern unsigned char e100_hw_reset_recover(struct e100_private *bdp,
- u32 reset_cmd);
+extern unsigned char e100_configure_device(struct e100_private *bdp);
+#ifdef E100_CU_DEBUG
+extern unsigned char e100_cu_unknown_state(struct e100_private *bdp);
+#endif
#define ROM_TEST_FAIL 0x01
#define REGISTER_TEST_FAIL 0x02
diff --git a/drivers/net/e100/e100_config.c b/drivers/net/e100/e100_config.c
index 70ca375b84a1..3cd58243ebd8 100644
--- a/drivers/net/e100/e100_config.c
+++ b/drivers/net/e100/e100_config.c
@@ -494,8 +494,7 @@ e100_config_long_rx(struct e100_private *bdp, unsigned char enable)
* e100_config_wol
* @bdp: atapter's private data struct
*
- * This sets configuration options for Wake On LAN functionality (WOL) in the
- * config record. WOL options are retrieved from wolinfo_wolopts in @bdp
+ * This sets configuration options for PHY and Magic Packet WoL
*/
void
e100_config_wol(struct e100_private *bdp)
@@ -504,14 +503,21 @@ e100_config_wol(struct e100_private *bdp)
if (bdp->wolopts & WAKE_PHY) {
bdp->config[9] |= CB_LINK_STATUS_WOL;
- E100_CONFIG(bdp, 9);
+ }
+ else {
+ /* Disable PHY WoL */
+ bdp->config[9] &= ~CB_LINK_STATUS_WOL;
}
- if (!(bdp->wolopts & WAKE_MAGIC)) {
+ if (bdp->wolopts & WAKE_MAGIC) {
+ bdp->config[19] &= ~CB_DISABLE_MAGPAK_WAKE;
+ }
+ else {
+ /* Disable Magic Packet WoL */
bdp->config[19] |= CB_DISABLE_MAGPAK_WAKE;
- E100_CONFIG(bdp, 19);
}
+ E100_CONFIG(bdp, 19);
spin_unlock_bh(&(bdp->config_lock));
}
diff --git a/drivers/net/e100/e100_main.c b/drivers/net/e100/e100_main.c
index 3f38f62ada89..1d105d13fd7e 100644
--- a/drivers/net/e100/e100_main.c
+++ b/drivers/net/e100/e100_main.c
@@ -46,6 +46,21 @@
/* Change Log
*
+ * 2.1.29 12/20/02
+ * o Bug fix: Device command timeout due to SMBus processing during init
+ * o Bug fix: Not setting/clearing I (Interrupt) bit in tcb correctly
+ * o Bug fix: Not using EEPROM WoL setting as default in ethtool
+ * o Bug fix: Not able to set autoneg on using ethtool when interface down
+ * o Bug fix: Not able to change speed/duplex using ethtool/mii
+ * when interface up
+ * o Bug fix: Ethtool shows autoneg on when forced to 100/Full
+ * o Bug fix: Compiler error when CONFIG_PROC_FS not defined
+ * o Bug fix: 2.5.44 e100 doesn't load with preemptive kernel enabled
+ * (sleep while holding spinlock)
+ * o Bug fix: 2.1.24-k1 doesn't display complete statistics
+ * o Bug fix: System panic due to NULL watchdog timer dereference during
+ * ifconfig down, rmmod and insmod
+ *
* 2.1.24 10/7/02
* o Bug fix: Wrong files under /proc/net/PRO_LAN_Adapters/ when interface
* name is changed
@@ -56,21 +71,6 @@
* o Removed misleading printks
*
* 2.1.12 8/2/02
- * o Feature: ethtool register dump
- * o Bug fix: Driver passes wrong name to /proc/interrupts
- * o Bug fix: Ethernet bridging not working
- * o Bug fix: Promiscuous mode is not working
- * o Bug fix: Checked return value from copy_from_user (William Stinson,
- * wstinson@infonie.fr)
- * o Bug fix: ARP wake on LAN fails
- * o Bug fix: mii-diag does not update driver level's speed, duplex and
- * re-configure flow control
- * o Bug fix: Ethtool shows wrong speed/duplex when not connected
- * o Bug fix: Ethtool shows wrong speed/duplex when reconnected if forced
- * speed/duplex
- * o Bug fix: PHY loopback diagnostic fails
- *
- * 2.1.6 7/5/02
*/
#include <linux/config.h>
@@ -135,7 +135,7 @@ static void e100_non_tx_background(unsigned long);
/* Global Data structures and variables */
char e100_copyright[] __devinitdata = "Copyright (c) 2002 Intel Corporation";
-char e100_driver_version[]="2.1.24-k2";
+char e100_driver_version[]="2.1.29-k1";
const char *e100_full_driver_name = "Intel(R) PRO/100 Network Driver";
char e100_short_driver_name[] = "e100";
static int e100nics = 0;
@@ -224,7 +224,7 @@ static void e100_check_options(int board, struct e100_private *bdp);
static void e100_set_int_option(int *, int, int, int, int, char *);
static void e100_set_bool_option(struct e100_private *bdp, int, u32, int,
char *);
-unsigned char e100_wait_exec_cmplx(struct e100_private *, u32, u8);
+unsigned char e100_wait_exec_cmplx(struct e100_private *, u32, u8, u8);
void e100_exec_cmplx(struct e100_private *, u32, u8);
/**
@@ -443,9 +443,21 @@ e100_wait_exec_simple(struct e100_private *bdp, u8 scb_cmd_low)
if (!e100_wait_scb(bdp)) {
printk(KERN_DEBUG "e100: %s: e100_wait_exec_simple: failed\n",
bdp->device->name);
+#ifdef E100_CU_DEBUG
+ printk(KERN_ERR "e100: %s: Last command (%x/%x) "
+ "timeout\n", bdp->device->name,
+ bdp->last_cmd, bdp->last_sub_cmd);
+ printk(KERN_ERR "e100: %s: Current simple command (%x) "
+ "can't be executed\n",
+ bdp->device->name, scb_cmd_low);
+#endif
return false;
}
e100_exec_cmd(bdp, scb_cmd_low);
+#ifdef E100_CU_DEBUG
+ bdp->last_cmd = scb_cmd_low;
+ bdp->last_sub_cmd = 0;
+#endif
return true;
}
@@ -458,12 +470,24 @@ e100_exec_cmplx(struct e100_private *bdp, u32 phys_addr, u8 cmd)
}
unsigned char
-e100_wait_exec_cmplx(struct e100_private *bdp, u32 phys_addr, u8 cmd)
+e100_wait_exec_cmplx(struct e100_private *bdp, u32 phys_addr, u8 cmd, u8 sub_cmd)
{
if (!e100_wait_scb(bdp)) {
+#ifdef E100_CU_DEBUG
+ printk(KERN_ERR "e100: %s: Last command (%x/%x) "
+ "timeout\n", bdp->device->name,
+ bdp->last_cmd, bdp->last_sub_cmd);
+ printk(KERN_ERR "e100: %s: Current complex command "
+ "(%x/%x) can't be executed\n",
+ bdp->device->name, cmd, sub_cmd);
+#endif
return false;
}
e100_exec_cmplx(bdp, phys_addr, cmd);
+#ifdef E100_CU_DEBUG
+ bdp->last_cmd = cmd;
+ bdp->last_sub_cmd = sub_cmd;
+#endif
return true;
}
@@ -494,18 +518,23 @@ e100_wait_cus_idle(struct e100_private *bdp)
}
/**
- * e100_dis_intr - disable interrupts
+ * e100_disable_clear_intr - disable and clear/ack interrupts
* @bdp: atapter's private data struct
*
* This routine disables interrupts at the hardware, by setting
* the M (mask) bit in the adapter's CSR SCB command word.
+ * It also clear/ack interrupts.
*/
static inline void
-e100_dis_intr(struct e100_private *bdp)
+e100_disable_clear_intr(struct e100_private *bdp)
{
+ u16 intr_status;
/* Disable interrupts on our PCI board by setting the mask bit */
writeb(SCB_INT_MASK, &bdp->scb->scb_cmd_hi);
- readw(&(bdp->scb->scb_status)); /* flushes last write, read-safe */
+ intr_status = readw(&bdp->scb->scb_status);
+ /* ack and clear intrs */
+ writew(intr_status, &bdp->scb->scb_status);
+ readw(&bdp->scb->scb_status);
}
/**
@@ -623,7 +652,7 @@ e100_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
cal_checksum = e100_eeprom_calculate_chksum(bdp);
read_checksum = e100_eeprom_read(bdp, (bdp->eeprom_size - 1));
if (cal_checksum != read_checksum) {
- printk(KERN_ERR "e100: Corrupted EERPROM on instance #%d\n",
+ printk(KERN_ERR "e100: Corrupted EEPROM on instance #%d\n",
e100nics);
rc = -ENODEV;
goto err_pci;
@@ -673,12 +702,17 @@ e100_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
bdp->device->name);
}
- /* Disabling all WOLs as initialization */
- bdp->wolsupported = bdp->wolopts = 0;
- if (bdp->rev_id >= D101A4_REV_ID) {
- bdp->wolsupported = WAKE_PHY | WAKE_MAGIC;
+ bdp->wolsupported = 0;
+ bdp->wolopts = 0;
+
+ /* Check if WoL is enabled on EEPROM */
+ if (e100_eeprom_read(bdp, EEPROM_ID_WORD) & BIT_5) {
+ if (bdp->rev_id >= D101A4_REV_ID)
+ bdp->wolsupported = WAKE_PHY | WAKE_MAGIC;
if (bdp->rev_id >= D101MA_REV_ID)
bdp->wolsupported |= WAKE_UCAST | WAKE_ARP;
+ /* Magic Packet WoL is enabled on device by default */
+ /* if EEPROM WoL bit is TRUE */
bdp->wolopts = WAKE_MAGIC;
}
@@ -953,12 +987,12 @@ e100_open(struct net_device *dev)
goto err_exit;
}
- if (!e100_wait_exec_cmplx(bdp, 0, SCB_CUC_LOAD_BASE)) {
+ if (!e100_wait_exec_cmplx(bdp, 0, SCB_CUC_LOAD_BASE, 0)) {
rc = -EAGAIN;
goto err_exit;
}
- if (!e100_wait_exec_cmplx(bdp, 0, SCB_RUC_LOAD_BASE)) {
+ if (!e100_wait_exec_cmplx(bdp, 0, SCB_RUC_LOAD_BASE, 0)) {
rc = -EAGAIN;
goto err_exit;
}
@@ -1235,7 +1269,8 @@ e100_init(struct e100_private *bdp)
printk(KERN_ERR "e100: hw init failed\n");
return false;
}
- e100_dis_intr(bdp);
+ /* Interrupts are enabled after device reset */
+ e100_disable_clear_intr(bdp);
return true;
}
@@ -1303,10 +1338,10 @@ e100_hw_init(struct e100_private *bdp, u32 reset_cmd)
e100_sw_reset(bdp, reset_cmd);
/* Load the CU BASE (set to 0, because we use linear mode) */
- if (!e100_wait_exec_cmplx(bdp, 0, SCB_CUC_LOAD_BASE))
+ if (!e100_wait_exec_cmplx(bdp, 0, SCB_CUC_LOAD_BASE, 0))
return false;
- if (!e100_wait_exec_cmplx(bdp, 0, SCB_RUC_LOAD_BASE))
+ if (!e100_wait_exec_cmplx(bdp, 0, SCB_RUC_LOAD_BASE, 0))
return false;
/* Load interrupt microcode */
@@ -1590,6 +1625,12 @@ e100_watchdog(struct net_device *dev)
{
struct e100_private *bdp = dev->priv;
+#ifdef E100_CU_DEBUG
+ if (e100_cu_unknown_state(bdp)) {
+ printk(KERN_ERR "e100: %s: CU unknown state in e100_watchdog\n",
+ dev->name);
+ }
+#endif
if (!netif_running(dev)) {
return;
}
@@ -1646,7 +1687,8 @@ e100_watchdog(struct net_device *dev)
if (netif_running(dev))
netif_wake_queue(dev);
} else {
- netif_stop_queue(dev);
+ if (netif_running(dev))
+ netif_stop_queue(dev);
}
rmb();
@@ -1774,11 +1816,8 @@ e100intr(int irq, void *dev_inst, struct pt_regs *regs)
return;
}
- /* disable intr before we ack & after identifying the intr as ours */
- e100_dis_intr(bdp);
-
- writew(intr_status, &bdp->scb->scb_status); /* ack intrs */
- readw(&bdp->scb->scb_status);
+ /* disable and ack intr */
+ e100_disable_clear_intr(bdp);
/* the device is closed, don't continue or else bad things may happen. */
if (!netif_running(dev)) {
@@ -2208,10 +2247,11 @@ e100_prepare_xmit_buff(struct e100_private *bdp, struct sk_buff *skb)
*
* e100_start_cu must be called while holding the tx_lock !
*/
-void
+u8
e100_start_cu(struct e100_private *bdp, tcb_t *tcb)
{
unsigned long lock_flag;
+ u8 ret = true;
spin_lock_irqsave(&(bdp->bd_lock), lock_flag);
switch (bdp->next_cu_cmd) {
@@ -2242,12 +2282,13 @@ e100_start_cu(struct e100_private *bdp, tcb_t *tcb)
"e100: %s: cu_start: timeout waiting for cu\n",
bdp->device->name);
if (!e100_wait_exec_cmplx(bdp, (u32) (tcb->tcb_phys),
- SCB_CUC_START)) {
+ SCB_CUC_START, CB_TRANSMIT)) {
printk(KERN_DEBUG
"e100: %s: cu_start: timeout waiting for scb\n",
bdp->device->name);
e100_exec_cmplx(bdp, (u32) (tcb->tcb_phys),
SCB_CUC_START);
+ ret = false;
}
bdp->next_cu_cmd = RESUME_WAIT;
@@ -2259,6 +2300,7 @@ e100_start_cu(struct e100_private *bdp, tcb_t *tcb)
bdp->last_tcb = tcb;
spin_unlock_irqrestore(&(bdp->bd_lock), lock_flag);
+ return ret;
}
/* ====================================================================== */
@@ -2306,8 +2348,9 @@ e100_selftest(struct e100_private *bdp, u32 *st_timeout, u32 *st_result)
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(HZ / 100 + 1);
- /* disable interrupts since the're now enabled */
- e100_dis_intr(bdp);
+ /* disable interrupts since they are enabled */
+ /* after device reset during selftest */
+ e100_disable_clear_intr(bdp);
/* if The First Self Test DWORD Still Zero, We've timed out. If the
* second DWORD is not zero then we have an error. */
@@ -2405,7 +2448,7 @@ e100_start_ru(struct e100_private *bdp)
spin_lock(&bdp->bd_lock);
- if (!e100_wait_exec_cmplx(bdp, rx_struct->dma_addr, SCB_RUC_START)) {
+ if (!e100_wait_exec_cmplx(bdp, rx_struct->dma_addr, SCB_RUC_START, 0)) {
printk(KERN_DEBUG
"e100: %s: start_ru: wait_scb failed\n",
bdp->device->name);
@@ -2473,7 +2516,7 @@ e100_clr_cntrs(struct e100_private *bdp)
*pcmd_complete = 0;
wmb();
- if (!e100_wait_exec_cmplx(bdp, bdp->stat_cnt_phys, SCB_CUC_DUMP_ADDR))
+ if (!e100_wait_exec_cmplx(bdp, bdp->stat_cnt_phys, SCB_CUC_DUMP_ADDR, 0))
return false;
/* wait 10 microseconds for the command to complete */
@@ -2595,8 +2638,10 @@ e100_exec_non_cu_cmd(struct e100_private *bdp, nxmit_cb_entry_t *command)
unsigned long lock_flag;
unsigned long expiration_time;
unsigned char rc = true;
+ u8 sub_cmd;
ntcb_hdr = (cb_header_t *) command->non_tx_cmd; /* get hdr of non tcb cmd */
+ sub_cmd = cpu_to_le16(ntcb_hdr->cb_cmd);
/* Set the Command Block to be the last command block */
ntcb_hdr->cb_cmd |= __constant_cpu_to_le16(CB_EL_BIT);
@@ -2629,7 +2674,7 @@ e100_exec_non_cu_cmd(struct e100_private *bdp, nxmit_cb_entry_t *command)
spin_lock_irqsave(&bdp->bd_lock, lock_flag);
- if (!e100_wait_exec_cmplx(bdp, command->dma_addr, SCB_CUC_START)) {
+ if (!e100_wait_exec_cmplx(bdp, command->dma_addr, SCB_CUC_START, sub_cmd)) {
spin_unlock_irqrestore(&(bdp->bd_lock), lock_flag);
rc = false;
goto exit;
@@ -2649,6 +2694,10 @@ e100_exec_non_cu_cmd(struct e100_private *bdp, nxmit_cb_entry_t *command)
yield();
spin_lock_bh(&(bdp->bd_non_tx_lock));
} else {
+#ifdef E100_CU_DEBUG
+ printk(KERN_ERR "e100: %s: non-TX command (%x) "
+ "timeout\n", bdp->device->name, sub_cmd);
+#endif
rc = false;
goto exit;
}
@@ -2694,7 +2743,12 @@ e100_sw_reset(struct e100_private *bdp, u32 reset_cmd)
}
/* Mask off our interrupt line -- its unmasked after reset */
- e100_dis_intr(bdp);
+ e100_disable_clear_intr(bdp);
+#ifdef E100_CU_DEBUG
+ bdp->last_cmd = 0;
+ bdp->last_sub_cmd = 0;
+#endif
+
}
/**
@@ -2894,19 +2948,6 @@ e100_D101M_checksum(struct e100_private *bdp, struct sk_buff *skb)
void __devinit
e100_print_brd_conf(struct e100_private *bdp)
{
- if (netif_carrier_ok(bdp->device)) {
- printk(KERN_NOTICE
- " Mem:0x%08lx IRQ:%d Speed:%d Mbps Dx:%s\n",
- (unsigned long) bdp->device->mem_start,
- bdp->device->irq, bdp->cur_line_speed,
- (bdp->cur_dplx_mode == FULL_DUPLEX) ? "Full" : "Half");
- } else {
- printk(KERN_NOTICE
- " Mem:0x%08lx IRQ:%d Speed:%d Mbps Dx:%s\n",
- (unsigned long) bdp->device->mem_start,
- bdp->device->irq, 0, "N/A");
- }
-
/* Print the string if checksum Offloading was enabled */
if (bdp->flags & DF_CSUM_OFFLOAD)
printk(KERN_NOTICE " Hardware receive checksums enabled\n");
@@ -3005,8 +3046,13 @@ err:
void
e100_isolate_driver(struct e100_private *bdp)
{
- if (netif_running(bdp->device)) {
- e100_dis_intr(bdp);
+
+ /* Check if interface is up */
+ /* NOTE: Can't use netif_running(bdp->device) because */
+ /* dev_close clears __LINK_STATE_START before calling */
+ /* e100_close (aka dev->stop) */
+ if (bdp->device->flags & IFF_UP) {
+ e100_disable_clear_intr(bdp);
del_timer_sync(&bdp->watchdog_timer);
del_timer_sync(&bdp->hwi_timer);
/* If in middle of cable diag, */
@@ -3045,63 +3091,51 @@ e100_tcb_add_C_bit(struct e100_private *bdp)
}
/*
- * Procedure: e100_hw_reset_recover
+ * Procedure: e100_configure_device
*
- * Description: This routine will recover the hw after reset.
+ * Description: This routine will configure device
*
* Arguments:
* bdp - Ptr to this card's e100_bdconfig structure
- * reset_cmd - s/w reset or selective reset.
*
* Returns:
* true upon success
* false upon failure
*/
unsigned char
-e100_hw_reset_recover(struct e100_private *bdp, u32 reset_cmd)
+e100_configure_device(struct e100_private *bdp)
{
- bdp->last_tcb = NULL;
- if (reset_cmd == PORT_SOFTWARE_RESET) {
-
- /*load CU & RU base */
- if (!e100_wait_exec_cmplx(bdp, 0, SCB_CUC_LOAD_BASE)) {
- return false;
- }
+ /*load CU & RU base */
+ if (!e100_wait_exec_cmplx(bdp, 0, SCB_CUC_LOAD_BASE, 0))
+ return false;
- if (e100_load_microcode(bdp)) {
- bdp->flags |= DF_UCODE_LOADED;
- }
+ if (e100_load_microcode(bdp))
+ bdp->flags |= DF_UCODE_LOADED;
- if (!e100_wait_exec_cmplx(bdp, 0, SCB_RUC_LOAD_BASE)) {
- return false;
- }
+ if (!e100_wait_exec_cmplx(bdp, 0, SCB_RUC_LOAD_BASE, 0))
+ return false;
- /* Issue the load dump counters address command */
- if (!e100_wait_exec_cmplx(bdp, bdp->stat_cnt_phys,
- SCB_CUC_DUMP_ADDR)) {
- return false;
- }
+ /* Issue the load dump counters address command */
+ if (!e100_wait_exec_cmplx(bdp, bdp->stat_cnt_phys, SCB_CUC_DUMP_ADDR, 0))
+ return false;
- if (!e100_setup_iaaddr(bdp, bdp->device->dev_addr)) {
- printk(KERN_ERR
- "e100: e100_hw_reset_recover: "
- "setup iaaddr failed\n");
- return false;
- }
+ if (!e100_setup_iaaddr(bdp, bdp->device->dev_addr)) {
+ printk(KERN_ERR "e100: e100_configure_device: "
+ "setup iaaddr failed\n");
+ return false;
+ }
- e100_set_multi_exec(bdp->device);
-
- /* Change for 82558 enhancement */
- /* If 82558/9 and if the user has enabled flow control, set up * the
- * Flow Control Reg. in the CSR */
- if ((bdp->flags & IS_BACHELOR)
- && (bdp->params.b_params & PRM_FC)) {
- writeb(DFLT_FC_THLD,
- &bdp->scb->scb_ext.d101_scb.scb_fc_thld);
- writeb(DFLT_FC_CMD,
- &bdp->scb->scb_ext.d101_scb.scb_fc_xon_xoff);
- }
+ e100_set_multi_exec(bdp->device);
+ /* Change for 82558 enhancement */
+ /* If 82558/9 and if the user has enabled flow control, set up */
+ /* flow Control Reg. in the CSR */
+ if ((bdp->flags & IS_BACHELOR)
+ && (bdp->params.b_params & PRM_FC)) {
+ writeb(DFLT_FC_THLD,
+ &bdp->scb->scb_ext.d101_scb.scb_fc_thld);
+ writeb(DFLT_FC_CMD,
+ &bdp->scb->scb_ext.d101_scb.scb_fc_xon_xoff);
}
e100_force_config(bdp);
@@ -3115,7 +3149,7 @@ e100_deisolate_driver(struct e100_private *bdp, u8 full_reset)
u32 cmd = full_reset ? PORT_SOFTWARE_RESET : PORT_SELECTIVE_RESET;
e100_sw_reset(bdp, cmd);
if (cmd == PORT_SOFTWARE_RESET) {
- if (!e100_hw_reset_recover(bdp, cmd))
+ if (!e100_configure_device(bdp))
printk(KERN_ERR "e100: e100_deisolate_driver:"
" device configuration failed\n");
}
@@ -3253,10 +3287,8 @@ static int
e100_ethtool_set_settings(struct net_device *dev, struct ifreq *ifr)
{
struct e100_private *bdp;
- int current_duplex;
int e100_new_speed_duplex;
int ethtool_new_speed_duplex;
- int speed_duplex_change_required;
struct ethtool_cmd ecmd;
if (!capable(CAP_NET_ADMIN)) {
@@ -3264,64 +3296,48 @@ e100_ethtool_set_settings(struct net_device *dev, struct ifreq *ifr)
}
bdp = dev->priv;
- if (netif_running(dev)) {
- return -EBUSY;
- }
if (copy_from_user(&ecmd, ifr->ifr_data, sizeof (ecmd))) {
return -EFAULT;
}
- current_duplex =
- (bdp->cur_dplx_mode == HALF_DUPLEX) ? DUPLEX_HALF : DUPLEX_FULL;
- speed_duplex_change_required = (ecmd.speed != bdp->cur_line_speed)
- || (ecmd.duplex != current_duplex);
-
- if ((ecmd.autoneg == AUTONEG_ENABLE) && speed_duplex_change_required) {
- return -EINVAL;
- }
if ((ecmd.autoneg == AUTONEG_ENABLE)
&& (bdp->speed_duplex_caps & SUPPORTED_Autoneg)) {
bdp->params.e100_speed_duplex = E100_AUTONEG;
e100_set_speed_duplex(bdp);
} else {
- if (speed_duplex_change_required) {
- if (ecmd.speed == SPEED_10) {
- if (ecmd.duplex == DUPLEX_HALF) {
- e100_new_speed_duplex =
- E100_SPEED_10_HALF;
- ethtool_new_speed_duplex =
- SUPPORTED_10baseT_Half;
-
- } else {
- e100_new_speed_duplex =
- E100_SPEED_10_FULL;
- ethtool_new_speed_duplex =
- SUPPORTED_10baseT_Full;
- }
-
- } else {
- if (ecmd.duplex == DUPLEX_HALF) {
- e100_new_speed_duplex =
- E100_SPEED_100_HALF;
- ethtool_new_speed_duplex =
- SUPPORTED_100baseT_Half;
-
- } else {
- e100_new_speed_duplex =
- E100_SPEED_100_FULL;
- ethtool_new_speed_duplex =
- SUPPORTED_100baseT_Full;
- }
- }
-
- if (bdp->speed_duplex_caps & ethtool_new_speed_duplex) {
- bdp->params.e100_speed_duplex =
- e100_new_speed_duplex;
- e100_set_speed_duplex(bdp);
- } else {
- return -EOPNOTSUPP;
- }
+ if (ecmd.speed == SPEED_10) {
+ if (ecmd.duplex == DUPLEX_HALF) {
+ e100_new_speed_duplex =
+ E100_SPEED_10_HALF;
+ ethtool_new_speed_duplex =
+ SUPPORTED_10baseT_Half;
+ } else {
+ e100_new_speed_duplex =
+ E100_SPEED_10_FULL;
+ ethtool_new_speed_duplex =
+ SUPPORTED_10baseT_Full;
+ }
+ } else {
+ if (ecmd.duplex == DUPLEX_HALF) {
+ e100_new_speed_duplex =
+ E100_SPEED_100_HALF;
+ ethtool_new_speed_duplex =
+ SUPPORTED_100baseT_Half;
+ } else {
+ e100_new_speed_duplex =
+ E100_SPEED_100_FULL;
+ ethtool_new_speed_duplex =
+ SUPPORTED_100baseT_Full;
+ }
}
+
+ if (bdp->speed_duplex_caps & ethtool_new_speed_duplex) {
+ bdp->params.e100_speed_duplex =
+ e100_new_speed_duplex;
+ e100_set_speed_duplex(bdp);
+ } else {
+ return -EOPNOTSUPP;
+ }
}
return 0;
@@ -3838,9 +3854,6 @@ e100_mii_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
case SIOCSMIIREG:
if (!capable(CAP_NET_ADMIN))
return -EPERM;
- if (netif_running(dev)) {
- return -EBUSY;
- }
/* If reg = 0 && change speed/duplex */
if (data_ptr->reg_num == 0 &&
(data_ptr->val_in == (BMCR_ANENABLE | BMCR_ANRESTART) /* restart cmd */
@@ -3860,10 +3873,9 @@ e100_mii_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
bdp->params.e100_speed_duplex = E100_SPEED_10_HALF;
e100_set_speed_duplex(bdp);
}
- else {
- e100_mdi_write(bdp, data_ptr->reg_num, bdp->phy_addr,
- data_ptr->val_in);
- }
+ else
+ /* Only allows changing speed/duplex */
+ return -EINVAL;
break;
@@ -3960,6 +3972,8 @@ e100_non_tx_background(unsigned long ptr)
struct e100_private *bdp = (struct e100_private *) ptr;
nxmit_cb_entry_t *active_command;
int restart = true;
+ cb_header_t *non_tx_cmd;
+ u8 sub_cmd;
spin_lock_bh(&(bdp->bd_non_tx_lock));
@@ -3987,6 +4001,15 @@ e100_non_tx_background(unsigned long ptr)
&& time_before(jiffies, active_command->expiration_time)) {
goto exit;
} else {
+ non_tx_cmd = (cb_header_t *) active_command->non_tx_cmd;
+ sub_cmd = CB_CMD_MASK & le16_to_cpu(non_tx_cmd->cb_cmd);
+#ifdef E100_CU_DEBUG
+ if (!(non_tx_cmd->cb_status
+ & __constant_cpu_to_le16(CB_STATUS_COMPLETE)))
+ printk(KERN_ERR "e100: %s: Queued "
+ "command (%x) timeout\n",
+ bdp->device->name, sub_cmd);
+#endif
list_del(&(active_command->list_elem));
e100_free_non_tx_cmd(bdp, active_command);
}
@@ -4009,9 +4032,10 @@ e100_non_tx_background(unsigned long ptr)
bdp->non_tx_command_state = E100_WAIT_NON_TX_FINISH;
active_command = list_entry(bdp->non_tx_cmd_list.next,
nxmit_cb_entry_t, list_elem);
+ sub_cmd = ((cb_header_t *) active_command->non_tx_cmd)->cb_cmd;
spin_lock_irq(&(bdp->bd_lock));
e100_wait_exec_cmplx(bdp, active_command->dma_addr,
- SCB_CUC_START);
+ SCB_CUC_START, sub_cmd);
spin_unlock_irq(&(bdp->bd_lock));
active_command->expiration_time = jiffies + HZ;
cmd_type = CB_CMD_MASK &
@@ -4084,9 +4108,11 @@ e100_suspend(struct pci_dev *pcid, u32 state)
e100_isolate_driver(bdp);
pci_save_state(pcid, bdp->pci_state);
+ /* Enable or disable WoL */
+ e100_do_wol(pcid, bdp);
+
/* If wol is enabled */
if (bdp->wolopts) {
- e100_do_wol(pcid, bdp);
pci_enable_wake(pcid, 3, 1); /* Enable PME for power state D3 */
pci_set_power_state(pcid, 3); /* Set power state to D3. */
} else {
@@ -4102,17 +4128,13 @@ e100_resume(struct pci_dev *pcid)
{
struct net_device *netdev = pci_get_drvdata(pcid);
struct e100_private *bdp = netdev->priv;
- u8 full_reset = false;
pci_set_power_state(pcid, 0);
pci_enable_wake(pcid, 0, 0); /* Clear PME status and disable PME */
pci_restore_state(pcid, bdp->pci_state);
- if (bdp->wolopts & (WAKE_UCAST | WAKE_ARP)) {
- full_reset = true;
- }
-
- e100_deisolate_driver(bdp, full_reset);
+ /* Also do device full reset because device was in D3 state */
+ e100_deisolate_driver(bdp, true);
return 0;
}
@@ -4239,3 +4261,20 @@ static void e100_hwi_restore(struct e100_private *bdp)
e100_mdi_write(bdp, MII_BMCR, bdp->phy_addr, control);
return;
}
+
+#ifdef E100_CU_DEBUG
+unsigned char
+e100_cu_unknown_state(struct e100_private *bdp)
+{
+ u8 scb_cmd_low;
+ u16 scb_status;
+ scb_cmd_low = bdp->scb->scb_cmd_low;
+ scb_status = le16_to_cpu(bdp->scb->scb_status);
+ /* If CU is active and executing unknown cmd */
+ if (scb_status & SCB_CUS_ACTIVE && scb_cmd_low & SCB_CUC_UNKNOWN)
+ return true;
+ else
+ return false;
+}
+#endif
+
diff --git a/drivers/net/e100/e100_test.c b/drivers/net/e100/e100_test.c
index 6cceb97c0d13..27ff5af00bfd 100644
--- a/drivers/net/e100/e100_test.c
+++ b/drivers/net/e100/e100_test.c
@@ -29,7 +29,7 @@
#include "e100_config.h"
extern u16 e100_eeprom_read(struct e100_private *, u16);
-extern int e100_wait_exec_cmplx(struct e100_private *, u32,u8);
+extern int e100_wait_exec_cmplx(struct e100_private *, u32,u8, u8);
extern void e100_phy_reset(struct e100_private *bdp);
extern void e100_phy_autoneg(struct e100_private *bdp);
extern void e100_phy_set_loopback(struct e100_private *bdp);
@@ -95,11 +95,9 @@ e100_run_diag(struct net_device *dev, u64 *test_info, u32 flags)
test_info [E100_EEPROM_TEST_FAIL] = true;
}
- e100_deisolate_driver(bdp, false);
-
- /*Let card recover from the test*/
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(HZ * 2);
+ e100_deisolate_driver(bdp, false);
return flags | (test_result ? 0 : ETH_TEST_FL_FAILED);
}
@@ -128,7 +126,7 @@ e100_diag_selftest(struct net_device *dev)
}
}
- e100_hw_reset_recover(bdp,PORT_SOFTWARE_RESET);
+ e100_configure_device(bdp);
return retval;
}
@@ -166,13 +164,19 @@ e100_diag_loopback (struct net_device *dev)
{
u8 rc = 0;
+ printk(KERN_DEBUG "%s: PHY loopback test starts\n", dev->name);
+ e100_sw_reset(dev->priv, PORT_SELECTIVE_RESET);
if (!e100_diag_one_loopback(dev, PHY_LOOPBACK)) {
rc |= PHY_LOOPBACK;
}
+ printk(KERN_DEBUG "%s: PHY loopback test ends\n", dev->name);
+ printk(KERN_DEBUG "%s: MAC loopback test starts\n", dev->name);
+ e100_sw_reset(dev->priv, PORT_SELECTIVE_RESET);
if (!e100_diag_one_loopback(dev, MAC_LOOPBACK)) {
rc |= MAC_LOOPBACK;
}
+ printk(KERN_DEBUG "%s: MAC loopback test ends\n", dev->name);
return rc;
}
@@ -341,12 +345,12 @@ static void
e100_diag_loopback_cu_ru_exec(struct e100_private *bdp)
{
/*load CU & RU base */
- if (!e100_wait_exec_cmplx(bdp, 0, SCB_CUC_LOAD_BASE))
- printk("e100: SCB_CUC_LOAD_BASE failed\n");
- if(!e100_wait_exec_cmplx(bdp, 0, SCB_RUC_LOAD_BASE))
- printk("e100: SCB_RUC_LOAD_BASE failed!\n");
- if(!e100_wait_exec_cmplx(bdp, bdp->loopback.dma_handle, SCB_RUC_START))
- printk("e100: SCB_RUC_START failed!\n");
+ if (!e100_wait_exec_cmplx(bdp, 0, SCB_CUC_LOAD_BASE, 0))
+ printk(KERN_ERR "e100: SCB_CUC_LOAD_BASE failed\n");
+ if(!e100_wait_exec_cmplx(bdp, 0, SCB_RUC_LOAD_BASE, 0))
+ printk(KERN_ERR "e100: SCB_RUC_LOAD_BASE failed!\n");
+ if(!e100_wait_exec_cmplx(bdp, bdp->loopback.dma_handle, SCB_RUC_START, 0))
+ printk(KERN_ERR "e100: SCB_RUC_START failed!\n");
bdp->next_cu_cmd = START_WAIT;
e100_start_cu(bdp, bdp->loopback.tcb);
diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index b3136f036ba2..93b332615a5f 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -113,6 +113,7 @@ struct e1000_adapter;
#define E1000_DEFAULT_PBA 0x00000030
#define AUTO_ALL_MODES 0
+#define E1000_EEPROM_APME 4
/* only works for sizes that are powers of 2 */
#define E1000_ROUNDUP(i, size) ((i) = (((i) + (size) - 1) & ~((size) - 1)))
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index 679625d47be8..2175d427b732 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -194,7 +194,7 @@ e1000_ethtool_gregs(struct e1000_adapter *adapter,
regs_buff[4] = E1000_READ_REG(hw, RDH);
regs_buff[5] = E1000_READ_REG(hw, RDT);
regs_buff[6] = E1000_READ_REG(hw, RDTR);
-
+
regs_buff[7] = E1000_READ_REG(hw, TCTL);
regs_buff[8] = E1000_READ_REG(hw, TDLEN);
regs_buff[9] = E1000_READ_REG(hw, TDH);
@@ -233,7 +233,7 @@ e1000_ethtool_geeprom(struct e1000_adapter *adapter,
return 0;
}
-static int
+static int
e1000_ethtool_seeprom(struct e1000_adapter *adapter,
struct ethtool_eeprom *eeprom, void *user_data)
{
@@ -306,12 +306,10 @@ e1000_ethtool_gwol(struct e1000_adapter *adapter, struct ethtool_wolinfo *wol)
/* Fall Through */
default:
- wol->supported = WAKE_PHY | WAKE_UCAST |
- WAKE_MCAST | WAKE_BCAST | WAKE_MAGIC;
-
+ wol->supported = WAKE_UCAST | WAKE_MCAST
+ | WAKE_BCAST | WAKE_MAGIC;
+
wol->wolopts = 0;
- if(adapter->wol & E1000_WUFC_LNKC)
- wol->wolopts |= WAKE_PHY;
if(adapter->wol & E1000_WUFC_EX)
wol->wolopts |= WAKE_UCAST;
if(adapter->wol & E1000_WUFC_MC)
@@ -343,13 +341,11 @@ e1000_ethtool_swol(struct e1000_adapter *adapter, struct ethtool_wolinfo *wol)
/* Fall Through */
default:
- if(wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE))
+ if(wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE | WAKE_PHY))
return -EOPNOTSUPP;
adapter->wol = 0;
- if(wol->wolopts & WAKE_PHY)
- adapter->wol |= E1000_WUFC_LNKC;
if(wol->wolopts & WAKE_UCAST)
adapter->wol |= E1000_WUFC_EX;
if(wol->wolopts & WAKE_MCAST)
@@ -374,7 +370,7 @@ static void
e1000_led_blink_callback(unsigned long data)
{
struct e1000_adapter *adapter = (struct e1000_adapter *) data;
-
+
if(test_and_change_bit(E1000_LED_ON, &adapter->led_status))
e1000_led_off(&adapter->hw);
else
@@ -394,13 +390,13 @@ e1000_ethtool_led_blink(struct e1000_adapter *adapter, struct ethtool_value *id)
e1000_setup_led(&adapter->hw);
mod_timer(&adapter->blink_timer, jiffies);
-
+
set_current_state(TASK_INTERRUPTIBLE);
if(id->data)
schedule_timeout(id->data * HZ);
else
schedule_timeout(MAX_SCHEDULE_TIMEOUT);
-
+
del_timer_sync(&adapter->blink_timer);
e1000_led_off(&adapter->hw);
clear_bit(E1000_LED_ON, &adapter->led_status);
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 6064844afe79..38dcc05df72e 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -26,11 +26,21 @@
*******************************************************************************/
-#define __E1000_MAIN__
#include "e1000.h"
/* Change Log
*
+ * 4.4.19 11/27/02
+ * o Feature: Added user-settable knob for interrupt throttle rate (ITR).
+ * o Cleanup: removed large static array allocations.
+ * o Cleanup: C99 struct initializer format.
+ * o Bug fix: restore VLAN settings when interface is brought up.
+ * o Bug fix: return cleanly in probe if error in detecting MAC type.
+ * o Bug fix: Wake up on magic packet by default only if enabled in eeprom.
+ * o Bug fix: Validate MAC address in set_mac.
+ * o Bug fix: Throw away zero-length Tx skbs.
+ * o Bug fix: Make ethtool EEPROM acceses work on older versions of ethtool.
+ *
* 4.4.12 10/15/02
* o Clean up: use members of pci_device rather than direct calls to
* pci_read_config_word.
@@ -43,30 +53,13 @@
* o Now setting netdev->mem_end in e1000_probe.
* o Clean up: Moved tx_timeout from interrupt context to process context
* using schedule_task.
- *
- * o Feature: merged in modified NAPI patch from Robert Olsson
- * <Robert.Olsson@its.uu.se> Uppsala Univeristy, Sweden.
- *
- * 4.3.15 8/9/02
- * o Converted from Dual BSD/GPL license to GPL license.
- * o Clean up: use pci_[clear|set]_mwi rather than direct calls to
- * pci_write_config_word.
- * o Bug fix: added read-behind-write calls to post writes before delays.
- * o Bug fix: removed mdelay busy-waits in interrupt context.
- * o Clean up: direct clear of descriptor bits rather than using memset.
- * o Bug fix: added wmb() for ia-64 between descritor writes and advancing
- * descriptor tail.
- * o Feature: added locking mechanism for asf functionality.
- * o Feature: exposed two Tx and one Rx interrupt delay knobs for finer
- * control over interurpt rate tuning.
- * o Misc ethtool bug fixes.
- *
- * 4.3.2 7/5/02
+ *
+ * 4.3.15 8/9/02
*/
-
+
char e1000_driver_name[] = "e1000";
char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
-char e1000_driver_version[] = "4.4.12-k1";
+char e1000_driver_version[] = "4.4.19-k1";
char e1000_copyright[] = "Copyright (c) 1999-2002 Intel Corporation.";
/* e1000_pci_tbl - PCI Device ID Table
@@ -175,6 +168,7 @@ static void e1000_tx_timeout_task(struct net_device *dev);
static void e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp);
static void e1000_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid);
static void e1000_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid);
+static void e1000_restore_vlan(struct e1000_adapter *adapter);
static int e1000_notify_reboot(struct notifier_block *, unsigned long event, void *ptr);
static int e1000_notify_netdev(struct notifier_block *, unsigned long event, void *ptr);
@@ -274,6 +268,7 @@ e1000_up(struct e1000_adapter *adapter)
/* hardware has been reset, we need to reload some things */
e1000_set_multi(netdev);
+ e1000_restore_vlan(adapter);
e1000_configure_tx(adapter);
e1000_setup_rctl(adapter);
@@ -349,6 +344,7 @@ e1000_probe(struct pci_dev *pdev,
int mmio_len;
int pci_using_dac;
int i;
+ uint16_t eeprom_data;
if((i = pci_enable_device(pdev)))
return i;
@@ -501,8 +497,9 @@ e1000_probe(struct pci_dev *pdev,
* enable the ACPI Magic Packet filter
*/
+ e1000_read_eeprom(&adapter->hw, EEPROM_INIT_CONTROL2_REG, &eeprom_data);
if((adapter->hw.mac_type >= e1000_82544) &&
- (E1000_READ_REG(&adapter->hw, WUC) & E1000_WUC_APME))
+ (eeprom_data & E1000_EEPROM_APME))
adapter->wol |= E1000_WUFC_MAG;
/* reset the hardware with the new settings */
@@ -583,6 +580,7 @@ e1000_sw_init(struct e1000_adapter *adapter)
hw->subsystem_id = pdev->subsystem_device;
pci_read_config_byte(pdev, PCI_REVISION_ID, &hw->revision_id);
+
pci_read_config_word(pdev, PCI_COMMAND, &hw->pci_cmd_word);
adapter->rx_buffer_len = E1000_RXBUFFER_2048;
@@ -627,7 +625,7 @@ e1000_sw_init(struct e1000_adapter *adapter)
hw->adaptive_ifs = TRUE;
/* Copper options */
-
+
if(hw->media_type == e1000_media_type_copper) {
hw->mdix = AUTO_ALL_MODES;
hw->disable_polarity_correction = FALSE;
@@ -1144,6 +1142,9 @@ e1000_set_mac(struct net_device *netdev, void *p)
struct e1000_adapter *adapter = netdev->priv;
struct sockaddr *addr = p;
+ if(!is_valid_ether_addr(addr->sa_data))
+ return -EADDRNOTAVAIL;
+
/* 82542 2.0 needs to be in reset to write receive address registers */
if(adapter->hw.mac_type == e1000_82542_rev2_0)
@@ -1400,7 +1401,6 @@ e1000_tx_map(struct e1000_adapter *adapter, struct sk_buff *skb)
int f;
len = skb->len - skb->data_len;
-
i = (tx_ring->next_to_use + tx_ring->count - 1) % tx_ring->count;
count = 0;
@@ -1507,11 +1507,16 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
{
struct e1000_adapter *adapter = netdev->priv;
int tx_flags = 0, count;
-
int f;
count = TXD_USE_COUNT(skb->len - skb->data_len,
adapter->max_data_per_txd);
+
+ if(count == 0) {
+ dev_kfree_skb_any(skb);
+ return 0;
+ }
+
for(f = 0; f < skb_shinfo(skb)->nr_frags; f++)
count += TXD_USE_COUNT(skb_shinfo(skb)->frags[f].size,
adapter->max_data_per_txd);
@@ -2392,6 +2397,21 @@ e1000_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid)
e1000_write_vfta(&adapter->hw, index, vfta);
}
+static void
+e1000_restore_vlan(struct e1000_adapter *adapter)
+{
+ e1000_vlan_rx_register(adapter->netdev, adapter->vlgrp);
+
+ if(adapter->vlgrp) {
+ uint16_t vid;
+ for(vid = 0; vid < VLAN_GROUP_ARRAY_LEN; vid++) {
+ if(!adapter->vlgrp->vlan_devices[vid])
+ continue;
+ e1000_vlan_rx_add_vid(adapter->netdev, vid);
+ }
+ }
+}
+
static int
e1000_notify_reboot(struct notifier_block *nb, unsigned long event, void *p)
{
@@ -2437,14 +2457,19 @@ e1000_suspend(struct pci_dev *pdev, uint32_t state)
{
struct net_device *netdev = pci_get_drvdata(pdev);
struct e1000_adapter *adapter = netdev->priv;
- uint32_t ctrl, ctrl_ext, rctl, manc;
+ uint32_t ctrl, ctrl_ext, rctl, manc, status;
+ uint32_t wufc = adapter->wol;
netif_device_detach(netdev);
if(netif_running(netdev))
e1000_down(adapter);
- if(adapter->wol) {
+ status = E1000_READ_REG(&adapter->hw, STATUS);
+ if(status & E1000_STATUS_LU)
+ wufc &= ~E1000_WUFC_LNKC;
+
+ if(wufc) {
e1000_setup_rctl(adapter);
e1000_set_multi(netdev);
@@ -2474,7 +2499,7 @@ e1000_suspend(struct pci_dev *pdev, uint32_t state)
}
E1000_WRITE_REG(&adapter->hw, WUC, E1000_WUC_PME_EN);
- E1000_WRITE_REG(&adapter->hw, WUFC, adapter->wol);
+ E1000_WRITE_REG(&adapter->hw, WUFC, wufc);
pci_enable_wake(pdev, 3, 1);
pci_enable_wake(pdev, 4, 1); /* 4 == D3 cold */
} else {
diff --git a/drivers/net/e1000/e1000_osdep.h b/drivers/net/e1000/e1000_osdep.h
index c8b8d6f452ec..aa1dd7dd8d01 100644
--- a/drivers/net/e1000/e1000_osdep.h
+++ b/drivers/net/e1000/e1000_osdep.h
@@ -27,7 +27,7 @@
*******************************************************************************/
-/* glue for the OS independant part of e1000
+/* glue for the OS independant part of e1000
* includes register access macros
*/
diff --git a/drivers/net/e1000/e1000_param.c b/drivers/net/e1000/e1000_param.c
index 3bdc3f7375a9..a11941f3f213 100644
--- a/drivers/net/e1000/e1000_param.c
+++ b/drivers/net/e1000/e1000_param.c
@@ -230,7 +230,6 @@ struct e1000_option {
} arg;
};
-
static int __devinit
e1000_validate_option(int *value, struct e1000_option *opt)
{
@@ -273,7 +272,7 @@ e1000_validate_option(int *value, struct e1000_option *opt)
default:
BUG();
}
-
+
printk(KERN_INFO "Invalid %s specified (%i) %s\n",
opt->name, *value, opt->err);
*value = opt->def;
@@ -298,7 +297,7 @@ e1000_check_options(struct e1000_adapter *adapter)
{
int bd = adapter->bd_number;
if(bd >= E1000_MAX_NIC) {
- printk(KERN_NOTICE
+ printk(KERN_NOTICE
"Warning: no configuration for board #%i\n", bd);
printk(KERN_NOTICE "Using defaults for all values\n");
bd = E1000_MAX_NIC;
@@ -314,7 +313,7 @@ e1000_check_options(struct e1000_adapter *adapter)
};
struct e1000_desc_ring *tx_ring = &adapter->tx_ring;
e1000_mac_type mac_type = adapter->hw.mac_type;
- opt.arg.r.max = mac_type < e1000_82544 ?
+ opt.arg.r.max = mac_type < e1000_82544 ?
MAX_TXD : MAX_82544_TXD;
tx_ring->count = TxDescriptors[bd];
@@ -344,13 +343,13 @@ e1000_check_options(struct e1000_adapter *adapter)
.err = "defaulting to Enabled",
.def = OPTION_ENABLED
};
-
+
int rx_csum = XsumRX[bd];
e1000_validate_option(&rx_csum, &opt);
adapter->rx_csum = rx_csum;
}
{ /* Flow Control */
-
+
struct e1000_opt_list fc_list[] =
{{ e1000_fc_none, "Flow Control Disabled" },
{ e1000_fc_rx_pause,"Flow Control Receive Only" },
@@ -478,9 +477,10 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
{ /* Speed */
struct e1000_opt_list speed_list[] = {{ 0, "" },
- { SPEED_10, "" },
- { SPEED_100, "" },
- { SPEED_1000, "" }};
+ { SPEED_10, "" },
+ { SPEED_100, "" },
+ { SPEED_1000, "" }};
+
struct e1000_option opt = {
.type = list_option,
.name = "Speed",
@@ -494,8 +494,9 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
}
{ /* Duplex */
struct e1000_opt_list dplx_list[] = {{ 0, "" },
- { HALF_DUPLEX, "" },
- { FULL_DUPLEX, "" }};
+ { HALF_DUPLEX, "" },
+ { FULL_DUPLEX, "" }};
+
struct e1000_option opt = {
.type = list_option,
.name = "Duplex",
@@ -572,7 +573,7 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
printk(KERN_INFO "Half Duplex specified without Speed\n");
printk(KERN_INFO "Using Autonegotiation at Half Duplex only\n");
adapter->hw.autoneg = 1;
- adapter->hw.autoneg_advertised = ADVERTISE_10_HALF |
+ adapter->hw.autoneg_advertised = ADVERTISE_10_HALF |
ADVERTISE_100_HALF;
break;
case FULL_DUPLEX:
diff --git a/drivers/net/e1000/e1000_proc.c b/drivers/net/e1000/e1000_proc.c
index 55883b22c690..79ca94fba2c7 100644
--- a/drivers/net/e1000/e1000_proc.c
+++ b/drivers/net/e1000/e1000_proc.c
@@ -109,7 +109,7 @@ e1000_proc_info_read(char *page, char **start, off_t off,
if(!strlen(elem->tag))
p += sprintf(p, "\n");
else
- p += sprintf(p, "%-*.*s %.*s\n",
+ p += sprintf(p, "%-*.*s %.*s\n",
TAG_MAX_LENGTH, TAG_MAX_LENGTH,
elem->tag, FIELD_MAX_LENGTH,
elem->func(elem->data, elem->len, buf));
@@ -126,7 +126,7 @@ e1000_proc_single_read(char *page, char **start, off_t off,
{
struct proc_list *elem = data;
- sprintf(page, "%.*s", FIELD_MAX_LENGTH, elem->func(elem->data,
+ sprintf(page, "%.*s", FIELD_MAX_LENGTH, elem->func(elem->data,
elem->len, page));
return e1000_proc_read(page, start, off, count, eof);
@@ -216,7 +216,7 @@ e1000_proc_singles_create(struct proc_dir_entry *parent,
}
static void
-e1000_proc_dirs_create(void *data, char *name,
+e1000_proc_dirs_create(void *data, char *name,
struct list_head *proc_list_head)
{
struct proc_dir_entry *intel_proc_dir, *proc_dir, *info_entry;
@@ -257,7 +257,7 @@ e1000_proc_dirs_create(void *data, char *name,
static void
e1000_proc_list_add(struct list_head *proc_list_head, char *tag,
- void *data, size_t len,
+ void *data, size_t len,
char *(*func)(void *, size_t, char *))
{
struct proc_list *new = (struct proc_list *)
@@ -509,8 +509,8 @@ e1000_proc_mdi_x_enabled(void *data, size_t len, char *buf)
{
struct e1000_adapter *adapter = data;
e1000_auto_x_mode mdix_mode = adapter->phy_info.mdix_mode;
- sprintf(buf,
- mdix_mode == e1000_auto_x_mode_manual_mdi ? "MDI" :
+ sprintf(buf,
+ mdix_mode == e1000_auto_x_mode_manual_mdi ? "MDI" :
mdix_mode == e1000_auto_x_mode_manual_mdix ? "MDI-X" :
"Unknown");
return buf;
@@ -531,7 +531,7 @@ e1000_proc_rx_status(void *data, size_t len, char *buf)
* e1000_proc_list_setup - build link list of proc praramters
* @adapter: board private structure
*
- * Order matters - ethx.info entries are ordered in the order links
+ * Order matters - ethx.info entries are ordered in the order links
* are added to list.
*/
@@ -610,7 +610,7 @@ e1000_proc_list_setup(struct e1000_adapter *adapter)
LIST_ADD_U("Tx_Aborted_Errors", &adapter->net_stats.tx_aborted_errors);
LIST_ADD_U("Tx_Carrier_Errors", &adapter->net_stats.tx_carrier_errors);
LIST_ADD_U("Tx_FIFO_Errors", &adapter->net_stats.tx_fifo_errors);
- LIST_ADD_U("Tx_Heartbeat_Errors",
+ LIST_ADD_U("Tx_Heartbeat_Errors",
&adapter->net_stats.tx_heartbeat_errors);
LIST_ADD_U("Tx_Window_Errors", &adapter->net_stats.tx_window_errors);
@@ -649,17 +649,17 @@ e1000_proc_list_setup(struct e1000_adapter *adapter)
adapter, e1000_proc_cable_polarity);
LIST_ADD_F("PHY_Disable_Polarity_Correction",
adapter, e1000_proc_polarity_correction);
- LIST_ADD_U("PHY_Idle_Errors",
+ LIST_ADD_U("PHY_Idle_Errors",
&adapter->phy_stats.idle_errors);
LIST_ADD_U("PHY_Receive_Errors",
&adapter->phy_stats.receive_errors);
LIST_ADD_F("PHY_MDI_X_Enabled",
adapter, e1000_proc_mdi_x_enabled);
LIST_ADD_F("PHY_Local_Receiver_Status",
- &adapter->phy_info.local_rx,
+ &adapter->phy_info.local_rx,
e1000_proc_rx_status);
LIST_ADD_F("PHY_Remote_Receiver_Status",
- &adapter->phy_info.remote_rx,
+ &adapter->phy_info.remote_rx,
e1000_proc_rx_status);
}
@@ -675,7 +675,7 @@ e1000_proc_dev_setup(struct e1000_adapter *adapter)
{
e1000_proc_list_setup(adapter);
- e1000_proc_dirs_create(adapter,
+ e1000_proc_dirs_create(adapter,
adapter->ifname,
&adapter->proc_list_head);
}
diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c
index 84bffe17cb91..ac2b24017e96 100644
--- a/drivers/net/eepro100.c
+++ b/drivers/net/eepro100.c
@@ -2383,6 +2383,7 @@ static struct pci_device_id eepro100_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_INTEL, 0x103C, PCI_ANY_ID, PCI_ANY_ID, },
{ PCI_VENDOR_ID_INTEL, 0x103D, PCI_ANY_ID, PCI_ANY_ID, },
{ PCI_VENDOR_ID_INTEL, 0x103E, PCI_ANY_ID, PCI_ANY_ID, },
+ { PCI_VENDOR_ID_INTEL, 0x1059, PCI_ANY_ID, PCI_ANY_ID, },
{ PCI_VENDOR_ID_INTEL, 0x1227, PCI_ANY_ID, PCI_ANY_ID, },
{ PCI_VENDOR_ID_INTEL, 0x1228, PCI_ANY_ID, PCI_ANY_ID, },
{ PCI_VENDOR_ID_INTEL, 0x2449, PCI_ANY_ID, PCI_ANY_ID, },
diff --git a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c
index afbe50ffbd33..9377d772d36c 100644
--- a/drivers/net/irda/ali-ircc.c
+++ b/drivers/net/irda/ali-ircc.c
@@ -1303,6 +1303,9 @@ static int ali_ircc_net_init(struct net_device *dev)
{
IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__ );
+ /* Keep track of module usage */
+ SET_MODULE_OWNER(dev);
+
/* Setup to be a normal IrDA network device driver */
irda_device_setup(dev);
@@ -1369,8 +1372,6 @@ static int ali_ircc_net_open(struct net_device *dev)
*/
self->irlap = irlap_open(dev, &self->qos, hwname);
- MOD_INC_USE_COUNT;
-
IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__ );
return 0;
@@ -1411,8 +1412,6 @@ static int ali_ircc_net_close(struct net_device *dev)
free_irq(self->io.irq, dev);
free_dma(self->io.dma);
- MOD_DEC_USE_COUNT;
-
IRDA_DEBUG(2, "%s(), ----------------- End ------------------\n", __FUNCTION__ );
return 0;
diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c
index 5b78bb15d18f..b8a3c498228a 100644
--- a/drivers/net/irda/donauboe.c
+++ b/drivers/net/irda/donauboe.c
@@ -1388,6 +1388,9 @@ toshoboe_net_init (struct net_device *dev)
{
IRDA_DEBUG (4, "%s()\n", __FUNCTION__);
+ /* Keep track of module usage */
+ SET_MODULE_OWNER(dev);
+
/* Setup to be a normal IrDA network device driver */
irda_device_setup (dev);
@@ -1435,8 +1438,6 @@ toshoboe_net_open (struct net_device *dev)
self->irdad = 1;
- MOD_INC_USE_COUNT;
-
return 0;
}
@@ -1467,8 +1468,6 @@ toshoboe_net_close (struct net_device *dev)
toshoboe_stopchip (self);
}
- MOD_DEC_USE_COUNT;
-
return 0;
}
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c
index b1bd18dbb347..c42db630930d 100644
--- a/drivers/net/irda/irda-usb.c
+++ b/drivers/net/irda/irda-usb.c
@@ -904,6 +904,9 @@ static int irda_usb_net_init(struct net_device *dev)
{
IRDA_DEBUG(1, "%s()\n", __FUNCTION__);
+ /* Keep track of module usage */
+ SET_MODULE_OWNER(dev);
+
/* Set up to be a normal IrDA network device driver */
irda_device_setup(dev);
@@ -974,7 +977,6 @@ static int irda_usb_net_open(struct net_device *netdev)
irda_usb_submit(self, NULL, self->rx_urb[i]);
/* Ready to play !!! */
- MOD_INC_USE_COUNT;
return 0;
}
@@ -1026,8 +1028,6 @@ static int irda_usb_net_close(struct net_device *netdev)
irlap_close(self->irlap);
self->irlap = NULL;
- MOD_DEC_USE_COUNT;
-
return 0;
}
diff --git a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c
index 63748b7bbe32..850d08cfaff0 100644
--- a/drivers/net/irda/nsc-ircc.c
+++ b/drivers/net/irda/nsc-ircc.c
@@ -1866,6 +1866,9 @@ static int nsc_ircc_net_init(struct net_device *dev)
{
IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
+ /* Keep track of module usage */
+ SET_MODULE_OWNER(dev);
+
/* Setup to be a normal IrDA network device driver */
irda_device_setup(dev);
@@ -1934,8 +1937,6 @@ static int nsc_ircc_net_open(struct net_device *dev)
*/
self->irlap = irlap_open(dev, &self->qos, hwname);
- MOD_INC_USE_COUNT;
-
return 0;
}
@@ -1983,8 +1984,6 @@ static int nsc_ircc_net_close(struct net_device *dev)
/* Restore bank register */
outb(bank, iobase+BSR);
- MOD_DEC_USE_COUNT;
-
return 0;
}
diff --git a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c
index b5b962eab7c9..52df492072d8 100644
--- a/drivers/net/irda/w83977af_ir.c
+++ b/drivers/net/irda/w83977af_ir.c
@@ -1197,6 +1197,9 @@ static int w83977af_net_init(struct net_device *dev)
{
IRDA_DEBUG(0, "%s()\n", __FUNCTION__ );
+ /* Keep track of module usage */
+ SET_MODULE_OWNER(dev);
+
/* Set up to be a normal IrDA network device driver */
irda_device_setup(dev);
@@ -1267,8 +1270,6 @@ static int w83977af_net_open(struct net_device *dev)
*/
self->irlap = irlap_open(dev, &self->qos, hwname);
- MOD_INC_USE_COUNT;
-
return 0;
}
@@ -1317,8 +1318,6 @@ static int w83977af_net_close(struct net_device *dev)
/* Restore bank register */
outb(set, iobase+SSR);
- MOD_DEC_USE_COUNT;
-
return 0;
}
diff --git a/drivers/net/mii.c b/drivers/net/mii.c
index e50469a241f6..3de5e46045d6 100644
--- a/drivers/net/mii.c
+++ b/drivers/net/mii.c
@@ -124,13 +124,13 @@ int mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd)
/* advertise only what has been requested */
advert = mii->mdio_read(dev, mii->phy_id, MII_ADVERTISE);
tmp = advert & ~(ADVERTISE_ALL | ADVERTISE_100BASE4);
- if (ADVERTISED_10baseT_Half)
+ if (ecmd->advertising & ADVERTISED_10baseT_Half)
tmp |= ADVERTISE_10HALF;
- if (ADVERTISED_10baseT_Full)
+ if (ecmd->advertising & ADVERTISED_10baseT_Full)
tmp |= ADVERTISE_10FULL;
- if (ADVERTISED_100baseT_Half)
+ if (ecmd->advertising & ADVERTISED_100baseT_Half)
tmp |= ADVERTISE_100HALF;
- if (ADVERTISED_100baseT_Full)
+ if (ecmd->advertising & ADVERTISED_100baseT_Full)
tmp |= ADVERTISE_100FULL;
if (advert != tmp) {
mii->mdio_write(dev, mii->phy_id, MII_ADVERTISE, tmp);
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c
index 2e3a533fd860..e0424d610a2d 100644
--- a/drivers/net/natsemi.c
+++ b/drivers/net/natsemi.c
@@ -164,6 +164,7 @@
#include <linux/delay.h>
#include <linux/rtnetlink.h>
#include <linux/mii.h>
+#include <linux/crc32.h>
#include <asm/processor.h> /* Processor type for cache alignment. */
#include <asm/bitops.h>
#include <asm/io.h>
@@ -1898,44 +1899,6 @@ static struct net_device_stats *get_stats(struct net_device *dev)
return &np->stats;
}
-/**
- * dp83815_crc - computer CRC for hash table entries
- *
- * Note - this is, for some reason, *not* the same function
- * as ether_crc_le() or ether_crc(), though it uses the
- * same big-endian polynomial.
- */
-#define DP_POLYNOMIAL 0x04C11DB7
-static unsigned dp83815_crc(int length, unsigned char *data)
-{
- u32 crc;
- u8 cur_byte;
- u8 msb;
- u8 byte, bit;
-
- crc = ~0;
- for (byte=0; byte<length; byte++) {
- cur_byte = *data++;
- for (bit=0; bit<8; bit++) {
- msb = crc >> 31;
- crc <<= 1;
- if (msb ^ (cur_byte & 1)) {
- crc ^= DP_POLYNOMIAL;
- crc |= 1;
- }
- cur_byte >>= 1;
- }
- }
- crc >>= 23;
-
- return (crc);
-}
-
-
-void set_bit_le(int offset, unsigned char * data)
-{
- data[offset >> 3] |= (1 << (offset & 0x07));
-}
#define HASH_TABLE 0x200
static void __set_rx_mode(struct net_device *dev)
{
@@ -1960,9 +1923,8 @@ static void __set_rx_mode(struct net_device *dev)
memset(mc_filter, 0, sizeof(mc_filter));
for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
i++, mclist = mclist->next) {
- set_bit_le(
- dp83815_crc(ETH_ALEN, mclist->dmi_addr) & 0x1ff,
- mc_filter);
+ int i = (ether_crc(ETH_ALEN, mclist->dmi_addr) >> 23) & 0x1ff;
+ mc_filter[i/8] |= (1 << (i & 0x07));
}
rx_mode = RxFilterEnable | AcceptBroadcast
| AcceptMulticast | AcceptMyPhys;
diff --git a/drivers/net/sunlance.c b/drivers/net/sunlance.c
index 91d4895a3f5f..3ca201cb6d8d 100644
--- a/drivers/net/sunlance.c
+++ b/drivers/net/sunlance.c
@@ -1496,6 +1496,7 @@ static inline struct sbus_dma *find_ledma(struct sbus_dev *sdev)
#ifdef CONFIG_SUN4
#include <asm/sun4paddr.h>
+#include <asm/machines.h>
/* Find all the lance cards on the system and initialize them */
static int __init sparc_lance_probe(void)
diff --git a/drivers/net/tokenring/Kconfig b/drivers/net/tokenring/Kconfig
index 8b3488f1230b..06df8def7553 100644
--- a/drivers/net/tokenring/Kconfig
+++ b/drivers/net/tokenring/Kconfig
@@ -91,7 +91,7 @@ config 3C359
config TMS380TR
tristate "Generic TMS380 Token Ring ISA/PCI adapter support"
- depends on TR
+ depends on TR && (PCI || ISA)
---help---
This driver provides generic support for token ring adapters
based on the Texas Instruments TMS380 series chipsets. This
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
index d896b88cb1da..67047bf7b56b 100644
--- a/drivers/net/tulip/de4x5.c
+++ b/drivers/net/tulip/de4x5.c
@@ -1223,6 +1223,7 @@ de4x5_hw_init(struct net_device *dev, u_long iobase, struct pci_dev *pdev)
lp->pdev = pdev;
memcpy((char *)&lp->srom,(char *)&bus.srom,sizeof(struct de4x5_srom));
lp->lock = (spinlock_t) SPIN_LOCK_UNLOCKED;
+ init_timer(&lp->timer);
de4x5_parse_params(dev);
/*
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
index 5f1cea63241a..38667fa242e2 100644
--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -2,12 +2,12 @@
# Wireless LAN device configuration
#
comment "Wireless ISA/PCI cards support"
- depends on NET_RADIO
+ depends on NET_RADIO && (ISA || PCI || ALL_PPC || PCMCIA)
# Good old obsolete Wavelan.
config WAVELAN
tristate "AT&T/Lucent old WaveLAN & DEC RoamAbout DS ISA support"
- depends on NET_RADIO
+ depends on NET_RADIO && ISA
---help---
The Lucent WaveLAN (formerly NCR and AT&T; or DEC RoamAbout DS) is
a Radio LAN (wireless Ethernet-like Local Area Network) using the
@@ -54,7 +54,7 @@ config AIRO
config HERMES
tristate "Hermes chipset 802.11b support (Orinoco/Prism2/Symbol)"
- depends on NET_RADIO
+ depends on NET_RADIO && (ALL_PPC || PCI || PCMCIA)
---help---
A driver for 802.11b wireless cards based based on the "Hermes" or
Intersil HFA384x (Prism 2) MAC controller. This includes the vast
diff --git a/drivers/sbus/sbus.c b/drivers/sbus/sbus.c
index 5056ae6266dc..d0643538ba64 100644
--- a/drivers/sbus/sbus.c
+++ b/drivers/sbus/sbus.c
@@ -20,6 +20,9 @@
struct sbus_bus *sbus_root = NULL;
static struct linux_prom_irqs irqs[PROMINTR_MAX] __initdata = { { 0 } };
+#ifdef CONFIG_SPARC32
+static int interrupts[PROMINTR_MAX] __initdata = { 0 };
+#endif
#ifdef CONFIG_PCI
extern int pcic_present(void);
@@ -108,7 +111,7 @@ no_ranges:
* XXX Pull this crud out into an arch specific area
* XXX at some point. -DaveM
*/
-#ifdef __sparc_v9__
+#ifdef CONFIG_SPARC64
len = prom_getproperty(prom_node, "interrupts",
(char *) irqs, sizeof(irqs));
if (len == -1 || len == 0) {
@@ -123,24 +126,43 @@ no_ranges:
sdev->irqs[0] = sbus_build_irq(sdev->bus, pri);
}
-#else
+#endif /* CONFIG_SPARC64 */
+
+#ifdef CONFIG_SPARC32
len = prom_getproperty(prom_node, "intr",
(char *)irqs, sizeof(irqs));
- if (len == -1)
- len = 0;
- sdev->num_irqs = len / 8;
- if (sdev->num_irqs == 0) {
- sdev->irqs[0] = 0;
- } else if (sparc_cpu_model == sun4d) {
- extern unsigned int sun4d_build_irq(struct sbus_dev *sdev, int irq);
-
- for (len = 0; len < sdev->num_irqs; len++)
- sdev->irqs[len] = sun4d_build_irq(sdev, irqs[len].pri);
+ if (len != -1) {
+ sdev->num_irqs = len / 8;
+ if (sdev->num_irqs == 0) {
+ sdev->irqs[0] = 0;
+ } else if (sparc_cpu_model == sun4d) {
+ extern unsigned int sun4d_build_irq(struct sbus_dev *sdev, int irq);
+
+ for (len = 0; len < sdev->num_irqs; len++)
+ sdev->irqs[len] = sun4d_build_irq(sdev, irqs[len].pri);
+ } else {
+ for (len = 0; len < sdev->num_irqs; len++)
+ sdev->irqs[len] = irqs[len].pri;
+ }
} else {
- for (len = 0; len < sdev->num_irqs; len++)
- sdev->irqs[len] = irqs[len].pri;
- }
-#endif /* !__sparc_v9__ */
+ /* No "intr" node found-- check for "interrupts" node.
+ * This node contains SBus interrupt levels, not IPLs
+ * as in "intr", and no vector values. We convert
+ * SBus interrupt levels to PILs (platform specific).
+ */
+ len = prom_getproperty(prom_node, "interrupts",
+ (char *)interrupts, sizeof(interrupts));
+ if (len == -1) {
+ sdev->irqs[0] = 0;
+ sdev->num_irqs = 0;
+ } else {
+ sdev->num_irqs = len / sizeof(int);
+ for (len = 0; len < sdev->num_irqs; len++) {
+ sdev->irqs[len] = sbint_to_irq(sdev, interrupts[len]);
+ }
+ }
+ }
+#endif /* CONFIG_SPARC32 */
}
/* This routine gets called from whoever needs the sbus first, to scan
@@ -295,7 +317,7 @@ static int __init sbus_init(void)
struct sbus_dev *this_dev;
int num_sbus = 0; /* How many did we find? */
-#ifndef __sparc_v9__
+#ifdef CONFIG_SPARC32
register_proc_sparc_ioport();
#endif
@@ -316,7 +338,7 @@ static int __init sbus_init(void)
prom_printf("Neither SBUS nor PCI found.\n");
prom_halt();
} else {
-#ifdef __sparc_v9__
+#ifdef CONFIG_SPARC64
firetruck_init();
#endif
}
@@ -362,18 +384,19 @@ static int __init sbus_init(void)
/* Loop until we find no more SBUS's */
while(this_sbus) {
-#ifdef __sparc_v9__
+#ifdef CONFIG_SPARC64
/* IOMMU hides inside SBUS/SYSIO prom node on Ultra. */
if(sparc_cpu_model == sun4u) {
extern void sbus_iommu_init(int prom_node, struct sbus_bus *sbus);
sbus_iommu_init(this_sbus, sbus);
}
-#endif
-#ifndef __sparc_v9__
+#endif /* CONFIG_SPARC64 */
+
+#ifdef CONFIG_SPARC32
if (sparc_cpu_model == sun4d)
iounit_init(this_sbus, iommund, sbus);
-#endif
+#endif /* CONFIG_SPARC32 */
printk("sbus%d: ", num_sbus);
sbus_clock = prom_getint(this_sbus, "clock-frequency");
if(sbus_clock == -1)
@@ -385,7 +408,7 @@ static int __init sbus_init(void)
prom_getstring(this_sbus, "name",
sbus->prom_name, sizeof(sbus->prom_name));
sbus->clock_freq = sbus_clock;
-#ifndef __sparc_v9__
+#ifdef CONFIG_SPARC32
if (sparc_cpu_model == sun4d) {
sbus->devid = prom_getint(iommund, "device-id");
sbus->board = prom_getint(iommund, "board#");
@@ -498,7 +521,7 @@ static int __init sbus_init(void)
sun4d_init_sbi_irq();
}
-#ifdef __sparc_v9__
+#ifdef CONFIG_SPARC64
if (sparc_cpu_model == sun4u) {
firetruck_init();
}
@@ -507,7 +530,7 @@ static int __init sbus_init(void)
if (sparc_cpu_model == sun4u)
auxio_probe ();
#endif
-#ifdef __sparc_v9__
+#ifdef CONFIG_SPARC64
if (sparc_cpu_model == sun4u) {
extern void clock_probe(void);
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.h b/drivers/scsi/aic7xxx/aic7xxx_osm.h
index 3e8f383baf9d..3b4b602f969f 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.h
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.h
@@ -72,6 +72,7 @@
#endif
#include <linux/module.h>
#include <asm/byteorder.h>
+#include <asm/io.h>
#ifndef KERNEL_VERSION
#define KERNEL_VERSION(x,y,z) (((x)<<16)+((y)<<8)+(z))
diff --git a/drivers/scsi/pcmcia/Makefile b/drivers/scsi/pcmcia/Makefile
index 01785300ee90..301a6bdddd2e 100644
--- a/drivers/scsi/pcmcia/Makefile
+++ b/drivers/scsi/pcmcia/Makefile
@@ -1,17 +1,5 @@
-#
-# Makefile for the Linux PCMCIA SCSI drivers.
-#
-obj-y :=
-obj-m :=
-obj-n :=
-obj- :=
-
-vpath %c ..
-
-CFLAGS_aha152x.o = -DPCMCIA -D__NO_VERSION__ -DAHA152X_STAT
-CFLAGS_fdomain.o = -DPCMCIA -D__NO_VERSION__
-CFLAGS_qlogicfas.o = -DPCMCIA -D__NO_VERSION__
+EXTRA_CFLAGS += -Idrivers/scsi
# 16-bit client drivers
obj-$(CONFIG_PCMCIA_QLOGIC) += qlogic_cs.o
@@ -19,6 +7,6 @@ obj-$(CONFIG_PCMCIA_FDOMAIN) += fdomain_cs.o
obj-$(CONFIG_PCMCIA_AHA152X) += aha152x_cs.o
obj-$(CONFIG_PCMCIA_NINJA_SCSI) += nsp_cs.o
-aha152x_cs-objs := aha152x_stub.o aha152x.o
-fdomain_cs-objs := fdomain_stub.o fdomain.o
-qlogic_cs-objs := qlogic_stub.o qlogicfas.o
+aha152x_cs-objs := aha152x_stub.o aha152x_core.o
+fdomain_cs-objs := fdomain_stub.o fdomain_core.o
+qlogic_cs-objs := qlogic_stub.o qlogic_core.o
diff --git a/drivers/scsi/pcmcia/aha152x_core.c b/drivers/scsi/pcmcia/aha152x_core.c
new file mode 100644
index 000000000000..dba3716511c5
--- /dev/null
+++ b/drivers/scsi/pcmcia/aha152x_core.c
@@ -0,0 +1,3 @@
+#define PCMCIA 1
+#define AHA152X_STAT 1
+#include "aha152x.c"
diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c
index 9f2e4e9e3b45..58c0d39106da 100644
--- a/drivers/scsi/pcmcia/aha152x_stub.c
+++ b/drivers/scsi/pcmcia/aha152x_stub.c
@@ -45,11 +45,10 @@
#include <scsi/scsi.h>
#include <linux/major.h>
#include <linux/blk.h>
-
-#include <../drivers/scsi/scsi.h>
-#include <../drivers/scsi/hosts.h>
#include <scsi/scsi_ioctl.h>
-#include <../drivers/scsi/aha152x.h>
+
+#include "scsi.h"
+#include "hosts.h"
#include <pcmcia/version.h>
#include <pcmcia/cs_types.h>
@@ -112,7 +111,8 @@ static int aha152x_event(event_t event, int priority,
static dev_link_t *aha152x_attach(void);
static void aha152x_detach(dev_link_t *);
-static Scsi_Host_Template driver_template = AHA152X;
+#define driver_template aha152x_driver_template
+extern Scsi_Host_Template aha152x_driver_template;
static dev_link_t *dev_list = NULL;
diff --git a/drivers/scsi/pcmcia/fdomain_core.c b/drivers/scsi/pcmcia/fdomain_core.c
new file mode 100644
index 000000000000..a48913791868
--- /dev/null
+++ b/drivers/scsi/pcmcia/fdomain_core.c
@@ -0,0 +1,2 @@
+#define PCMCIA 1
+#include "fdomain.c"
diff --git a/drivers/scsi/pcmcia/fdomain_stub.c b/drivers/scsi/pcmcia/fdomain_stub.c
index 84fef0b16331..7c671257c739 100644
--- a/drivers/scsi/pcmcia/fdomain_stub.c
+++ b/drivers/scsi/pcmcia/fdomain_stub.c
@@ -42,11 +42,10 @@
#include <scsi/scsi.h>
#include <linux/major.h>
#include <linux/blk.h>
-
-#include <../drivers/scsi/scsi.h>
-#include <../drivers/scsi/hosts.h>
#include <scsi/scsi_ioctl.h>
-#include <../drivers/scsi/fdomain.h>
+
+#include "scsi.h"
+#include "hosts.h"
#include <pcmcia/version.h>
#include <pcmcia/cs_types.h>
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index 947b78c90f57..c5fcc6116d99 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -50,8 +50,8 @@
#include <asm/io.h>
#include <asm/irq.h>
-#include <../drivers/scsi/scsi.h>
-#include <../drivers/scsi/hosts.h>
+#include "scsi.h"
+#include "hosts.h"
#include <scsi/scsi.h>
#include <scsi/scsi_ioctl.h>
diff --git a/drivers/scsi/pcmcia/nsp_cs.h b/drivers/scsi/pcmcia/nsp_cs.h
index 8397b8002ce5..73368cf79b2a 100644
--- a/drivers/scsi/pcmcia/nsp_cs.h
+++ b/drivers/scsi/pcmcia/nsp_cs.h
@@ -15,6 +15,8 @@
#ifndef __nsp_cs__
#define __nsp_cs__
+#include <linux/version.h>
+
/* for debugging */
//#define PCMCIA_DEBUG 9
diff --git a/drivers/scsi/pcmcia/qlogic_core.c b/drivers/scsi/pcmcia/qlogic_core.c
new file mode 100644
index 000000000000..78abe22b1878
--- /dev/null
+++ b/drivers/scsi/pcmcia/qlogic_core.c
@@ -0,0 +1,2 @@
+#define PCMCIA 1
+#include "qlogicfas.c"
diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c
index 6e7b79d5b93e..52f5df6c900b 100644
--- a/drivers/scsi/pcmcia/qlogic_stub.c
+++ b/drivers/scsi/pcmcia/qlogic_stub.c
@@ -43,12 +43,10 @@
#include <scsi/scsi.h>
#include <linux/major.h>
#include <linux/blk.h>
-
-#include <../drivers/scsi/scsi.h>
-#include <../drivers/scsi/hosts.h>
#include <scsi/scsi_ioctl.h>
-#include <../drivers/scsi/qlogicfas.h>
+#include "scsi.h"
+#include "hosts.h"
#include <pcmcia/version.h>
#include <pcmcia/cs_types.h>
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index bc59f1c31e6a..526dabe7ac66 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -35,6 +35,7 @@
#include <linux/completion.h>
#include <linux/uts.h> /* for UTS_SYSNAME */
#include <linux/pci.h> /* for hcd->pdev and dma addressing */
+#include <linux/dma-mapping.h>
#include <asm/byteorder.h>
#include <linux/usb.h>
diff --git a/drivers/usb/host/ohci-dbg.c b/drivers/usb/host/ohci-dbg.c
index 5ab762bd73b3..c175e87c80f5 100644
--- a/drivers/usb/host/ohci-dbg.c
+++ b/drivers/usb/host/ohci-dbg.c
@@ -355,7 +355,7 @@ show_list (struct ohci_hcd *ohci, char *buf, size_t count, struct ed *ed)
scratch,
(info & ED_SKIP) ? " s" : "",
(ed->hwHeadP & ED_H) ? " H" : "",
- (ed->hwHeadP & ED_C) ? data1 : data0);
+ (ed->hwHeadP & ED_C) ? "data1" : "data0");
size -= temp;
buf += temp;
diff --git a/fs/compat.c b/fs/compat.c
index 91dc5981fa38..2a0bdefb362a 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -16,6 +16,7 @@
#include <linux/errno.h>
#include <linux/time.h>
#include <linux/fs.h>
+#include <linux/fcntl.h>
#include <asm/uaccess.h>
@@ -70,3 +71,33 @@ asmlinkage long compat_sys_newfstat(unsigned int fd,
error = cp_compat_stat(&stat, statbuf);
return error;
}
+
+int get_compat_flock(struct flock *kfl, struct compat_flock *ufl)
+{
+ int err;
+
+ if (!access_ok(VERIFY_READ, ufl, sizeof(*ufl)))
+ return -EFAULT;
+
+ err = __get_user(kfl->l_type, &ufl->l_type);
+ err |= __get_user(kfl->l_whence, &ufl->l_whence);
+ err |= __get_user(kfl->l_start, &ufl->l_start);
+ err |= __get_user(kfl->l_len, &ufl->l_len);
+ err |= __get_user(kfl->l_pid, &ufl->l_pid);
+ return err;
+}
+
+int put_compat_flock(struct flock *kfl, struct compat_flock *ufl)
+{
+ int err;
+
+ if (!access_ok(VERIFY_WRITE, ufl, sizeof(*ufl)))
+ return -EFAULT;
+
+ err = __put_user(kfl->l_type, &ufl->l_type);
+ err |= __put_user(kfl->l_whence, &ufl->l_whence);
+ err |= __put_user(kfl->l_start, &ufl->l_start);
+ err |= __put_user(kfl->l_len, &ufl->l_len);
+ err |= __put_user(kfl->l_pid, &ufl->l_pid);
+ return err;
+}
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 545d2ea807cd..7ad96198f947 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -79,6 +79,7 @@ static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma)
*/
static int hugetlbfs_readpage(struct file *file, struct page * page)
{
+ unlock_page(page);
return -EINVAL;
}
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index cb22452b2823..53ac5b398266 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -321,7 +321,7 @@ encode_attrs(struct xdr_stream *xdr, struct iattr *iap)
* Now we backfill the bitmap and the attribute buffer length.
*/
if (len != ((char *)p - (char *)q) + 4) {
- printk ("encode_attr: Attr length calculation error! %u != %u\n",
+ printk ("encode_attr: Attr length calculation error! %u != %Zu\n",
len, ((char *)p - (char *)q) + 4);
BUG();
}
diff --git a/include/asm-alpha/irq.h b/include/asm-alpha/irq.h
index b7804cc7b1e1..1a06d47bb55d 100644
--- a/include/asm-alpha/irq.h
+++ b/include/asm-alpha/irq.h
@@ -31,7 +31,6 @@
# define NR_IRQS 32
#elif defined(CONFIG_ALPHA_ALCOR) || \
- defined(CONFIG_ALPHA_XLT) || \
defined(CONFIG_ALPHA_MIATA) || \
defined(CONFIG_ALPHA_RUFFIAN) || \
defined(CONFIG_ALPHA_RX164) || \
diff --git a/include/asm-i386/io_apic.h b/include/asm-i386/io_apic.h
index 500053c36f82..57d8cf06ddc5 100644
--- a/include/asm-i386/io_apic.h
+++ b/include/asm-i386/io_apic.h
@@ -16,7 +16,8 @@
#define APIC_MISMATCH_DEBUG
#define IO_APIC_BASE(idx) \
- ((volatile int *)__fix_to_virt(FIX_IO_APIC_BASE_0 + idx))
+ ((volatile int *)(__fix_to_virt(FIX_IO_APIC_BASE_0 + idx) \
+ + (mp_ioapics[idx].mpc_apicaddr & ~PAGE_MASK)))
/*
* The structure of the IO-APIC:
diff --git a/include/asm-ia64/compat.h b/include/asm-ia64/compat.h
index a01babfd700e..69bf8481be81 100644
--- a/include/asm-ia64/compat.h
+++ b/include/asm-ia64/compat.h
@@ -53,4 +53,12 @@ struct compat_stat {
u32 __unused5;
};
+struct compat_flock {
+ short l_type;
+ short l_whence;
+ compat_off_t l_start;
+ compat_off_t l_len;
+ compat_pid_t l_pid;
+};
+
#endif /* _ASM_IA64_COMPAT_H */
diff --git a/include/asm-ia64/ia32.h b/include/asm-ia64/ia32.h
index 1c23e5189319..bb2f802fe3dc 100644
--- a/include/asm-ia64/ia32.h
+++ b/include/asm-ia64/ia32.h
@@ -29,15 +29,6 @@ typedef __kernel_fsid_t __kernel_fsid_t32;
#define IA32_PAGE_ALIGN(addr) (((addr) + IA32_PAGE_SIZE - 1) & IA32_PAGE_MASK)
#define IA32_CLOCKS_PER_SEC 100 /* Cast in stone for IA32 Linux */
-/* fcntl.h */
-struct flock32 {
- short l_type;
- short l_whence;
- compat_off_t l_start;
- compat_off_t l_len;
- compat_pid_t l_pid;
-};
-
#define F_GETLK64 12
#define F_SETLK64 13
#define F_SETLKW64 14
diff --git a/include/asm-ppc64/compat.h b/include/asm-ppc64/compat.h
index 8ad44c0e53d4..a32b56af16b5 100644
--- a/include/asm-ppc64/compat.h
+++ b/include/asm-ppc64/compat.h
@@ -55,4 +55,13 @@ struct compat_stat {
u32 __unused4[2];
};
+struct compat_flock {
+ short l_type;
+ short l_whence;
+ compat_off_t l_start;
+ compat_off_t l_len;
+ compat_pid_t l_pid;
+ short __unused;
+};
+
#endif /* _ASM_PPC64_COMPAT_H */
diff --git a/include/asm-ppc64/ppc32.h b/include/asm-ppc64/ppc32.h
index 5b7a8dc91bda..019ae718e38b 100644
--- a/include/asm-ppc64/ppc32.h
+++ b/include/asm-ppc64/ppc32.h
@@ -141,15 +141,6 @@ typedef struct sigaltstack_32 {
compat_size_t ss_size;
} stack_32_t;
-struct flock32 {
- short l_type;
- short l_whence;
- compat_off_t l_start;
- compat_off_t l_len;
- compat_pid_t l_pid;
- short __unused;
-};
-
struct sigcontext32 {
unsigned int _unused[4];
int signal;
diff --git a/include/asm-s390x/compat.h b/include/asm-s390x/compat.h
index e376c77f391c..d84bb8d4020d 100644
--- a/include/asm-s390x/compat.h
+++ b/include/asm-s390x/compat.h
@@ -58,4 +58,13 @@ struct compat_stat {
u32 __unused5;
};
+struct compat_flock {
+ short l_type;
+ short l_whence;
+ compat_off_t l_start;
+ compat_off_t l_len;
+ compat_pid_t l_pid;
+ short __unused;
+};
+
#endif /* _ASM_S390X_COMPAT_H */
diff --git a/include/asm-sparc/bitops.h b/include/asm-sparc/bitops.h
index dae6d062eeb5..5b9707927b43 100644
--- a/include/asm-sparc/bitops.h
+++ b/include/asm-sparc/bitops.h
@@ -9,9 +9,8 @@
#ifndef _SPARC_BITOPS_H
#define _SPARC_BITOPS_H
-#include <linux/kernel.h>
+#include <linux/compiler.h>
#include <asm/byteorder.h>
-#include <asm/system.h>
#ifdef __KERNEL__
diff --git a/include/asm-sparc/ide.h b/include/asm-sparc/ide.h
index c8a97fd7ef6a..40c498bd2445 100644
--- a/include/asm-sparc/ide.h
+++ b/include/asm-sparc/ide.h
@@ -78,11 +78,9 @@ static __inline__ void ide_init_default_hwifs(void)
#define ide_release_region(from,extent) release_region((from), (extent))
/*
- * The following are not needed for the non-m68k ports
+ * The following is not needed for the non-m68k ports
*/
#define ide_ack_intr(hwif) (1)
-#define ide_release_lock(lock) do {} while (0)
-#define ide_get_lock(lock, hdlr, data) do {} while (0)
/* XXX Known to be broken. Axboe will fix the problems this
* XXX has by making seperate IN/OUT macros for IDE_DATA
diff --git a/include/asm-sparc/sbus.h b/include/asm-sparc/sbus.h
index 6a95593c2d52..bf09706e88ea 100644
--- a/include/asm-sparc/sbus.h
+++ b/include/asm-sparc/sbus.h
@@ -121,4 +121,15 @@ extern void sbus_unmap_sg(struct sbus_dev *, struct scatterlist *, int, int);
extern void sbus_dma_sync_single(struct sbus_dev *, dma_addr_t, size_t, int);
extern void sbus_dma_sync_sg(struct sbus_dev *, struct scatterlist *, int, int);
+/* Eric Brower (ebrower@usa.net)
+ * Translate SBus interrupt levels to ino values--
+ * this is used when converting sbus "interrupts" OBP
+ * node values to "intr" node values, and is platform
+ * dependent. If only we could call OBP with
+ * "sbus-intr>cpu (sbint -- ino)" from kernel...
+ * See .../drivers/sbus/sbus.c for details.
+ */
+BTFIXUPDEF_CALL(unsigned int, sbint_to_irq, struct sbus_dev *sdev, unsigned int)
+#define sbint_to_irq(sdev, sbint) BTFIXUP_CALL(sbint_to_irq)(sdev, sbint)
+
#endif /* !(_SPARC_SBUS_H) */
diff --git a/include/asm-sparc/system.h b/include/asm-sparc/system.h
index b743926155c5..244647dc22c4 100644
--- a/include/asm-sparc/system.h
+++ b/include/asm-sparc/system.h
@@ -7,6 +7,7 @@
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/threads.h> /* NR_CPUS */
+#include <linux/thread_info.h>
#include <asm/segment.h>
#include <asm/page.h>
diff --git a/include/asm-sparc/thread_info.h b/include/asm-sparc/thread_info.h
index f724a01c94ff..bc004d4c0e3b 100644
--- a/include/asm-sparc/thread_info.h
+++ b/include/asm-sparc/thread_info.h
@@ -11,8 +11,6 @@
#ifndef _ASM_THREAD_INFO_H
#define _ASM_THREAD_INFO_H
-// XXX todo: comment thread_info components and see what breaks.
-
#ifdef __KERNEL__
#ifndef __ASSEMBLY__
diff --git a/include/asm-sparc64/compat.h b/include/asm-sparc64/compat.h
index 36fcfd6ced5f..f384c300e5e3 100644
--- a/include/asm-sparc64/compat.h
+++ b/include/asm-sparc64/compat.h
@@ -42,4 +42,13 @@ struct compat_timeval {
s32 tv_usec;
};
+struct compat_flock {
+ short l_type;
+ short l_whence;
+ __kernel_off_t32 l_start;
+ __kernel_off_t32 l_len;
+ __kernel_pid_t32 l_pid;
+ short __unused;
+};
+
#endif /* _ASM_SPARC64_COMPAT_H */
diff --git a/include/asm-sparc64/fcntl.h b/include/asm-sparc64/fcntl.h
index 38ee2703ede9..902daf86f13b 100644
--- a/include/asm-sparc64/fcntl.h
+++ b/include/asm-sparc64/fcntl.h
@@ -79,17 +79,6 @@ struct flock {
};
#ifdef __KERNEL__
-struct flock32 {
- short l_type;
- short l_whence;
- __kernel_off_t32 l_start;
- __kernel_off_t32 l_len;
- __kernel_pid_t32 l_pid;
- short __unused;
-};
-#endif
-
-#ifdef __KERNEL__
#define flock64 flock
#endif
diff --git a/include/asm-sparc64/ide.h b/include/asm-sparc64/ide.h
index 8adfd4967c1c..32aab1e59203 100644
--- a/include/asm-sparc64/ide.h
+++ b/include/asm-sparc64/ide.h
@@ -75,11 +75,9 @@ static __inline__ void ide_init_default_hwifs(void)
#define ide_release_region(from,extent) release_region((from), (extent))
/*
- * The following are not needed for the non-m68k ports
+ * The following is not needed for the non-m68k ports
*/
#define ide_ack_intr(hwif) (1)
-#define ide_release_lock(lock) do {} while (0)
-#define ide_get_lock(lock, hdlr, data) do {} while (0)
/* XXX Known to be broken. Axboe will fix the problems this
* XXX has by making seperate IN/OUT macros for IDE_DATA
diff --git a/include/asm-sparc64/smp.h b/include/asm-sparc64/smp.h
index babbfe5f916b..b57fd36a1193 100644
--- a/include/asm-sparc64/smp.h
+++ b/include/asm-sparc64/smp.h
@@ -8,12 +8,14 @@
#include <linux/config.h>
#include <linux/threads.h>
-#include <linux/cache.h>
#include <asm/asi.h>
#include <asm/starfire.h>
#include <asm/spitfire.h>
#ifndef __ASSEMBLY__
+
+#include <linux/cache.h>
+
/* PROM provided per-processor information we need
* to start them all up.
*/
diff --git a/include/asm-x86_64/compat.h b/include/asm-x86_64/compat.h
index 47e4aa499cc2..adc5293b3a2b 100644
--- a/include/asm-x86_64/compat.h
+++ b/include/asm-x86_64/compat.h
@@ -54,4 +54,12 @@ struct compat_stat {
u32 __unused5;
};
+struct compat_flock {
+ short l_type;
+ short l_whence;
+ compat_off_t l_start;
+ compat_off_t l_len;
+ compat_pid_t l_pid;
+};
+
#endif /* _ASM_X86_64_COMPAT_H */
diff --git a/include/asm-x86_64/ia32.h b/include/asm-x86_64/ia32.h
index 23d4d607a398..802b85d4750f 100644
--- a/include/asm-x86_64/ia32.h
+++ b/include/asm-x86_64/ia32.h
@@ -22,16 +22,6 @@ typedef long __kernel_loff_t32;
typedef __kernel_fsid_t __kernel_fsid_t32;
-/* fcntl.h */
-struct flock32 {
- short l_type;
- short l_whence;
- compat_off_t l_start;
- compat_off_t l_len;
- compat_pid_t l_pid;
-};
-
-
struct ia32_flock64 {
short l_type;
short l_whence;
diff --git a/include/linux/agp_backend.h b/include/linux/agp_backend.h
index e6fa886e8d82..90890f4e9e6d 100644
--- a/include/linux/agp_backend.h
+++ b/include/linux/agp_backend.h
@@ -60,8 +60,10 @@ enum chipset_type {
VIA_APOLLO_KX133,
VIA_APOLLO_KT133,
VIA_APOLLO_KT400,
+ VIA_APOLLO_KT400_3,
VIA_APOLLO_PRO_266,
VIA_VT8605,
+ VIA_P4X400,
SIS_GENERIC,
AMD_GENERIC,
AMD_IRONGATE,
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 62daefb17672..39405f5a06ea 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -9,9 +9,12 @@
#ifdef CONFIG_COMPAT
#include <linux/stat.h>
+#include <linux/param.h> /* for HZ */
+#include <linux/fcntl.h> /* for struct flock */
#include <asm/compat.h>
-#define compat_jiffies_to_clock_t(x) ((x) / (HZ / COMPAT_USER_HZ))
+#define compat_jiffies_to_clock_t(x) \
+ (((unsigned long)(x) * COMPAT_USER_HZ) / HZ)
struct compat_utimbuf {
compat_time_t actime;
@@ -31,6 +34,8 @@ struct compat_tms {
};
extern int cp_compat_stat(struct kstat *, struct compat_stat *);
+extern int get_compat_flock(struct flock *, struct compat_flock *);
+extern int put_compat_flock(struct flock *, struct compat_flock *);
#endif /* CONFIG_COMPAT */
#endif /* _LINUX_COMPAT_H */
diff --git a/include/linux/crc32.h b/include/linux/crc32.h
index a0033ffee91c..56c0645789a9 100644
--- a/include/linux/crc32.h
+++ b/include/linux/crc32.h
@@ -9,9 +9,19 @@
extern u32 crc32_le(u32 crc, unsigned char const *p, size_t len);
extern u32 crc32_be(u32 crc, unsigned char const *p, size_t len);
+extern u32 bitreverse(u32 in);
#define crc32(seed, data, length) crc32_le(seed, (unsigned char const *)data, length)
+
+/*
+ * Helpers for hash table generation of ethernet nics:
+ *
+ * Ethernet sends the least significant bit of a byte first, thus crc32_le
+ * is used. The output of crc32_le is bit reversed [most significant bit
+ * is in bit nr 0], thus it must be reversed before use. Except for
+ * nics that bit swap the result internally...
+ */
+#define ether_crc(length, data) bitreverse(crc32_le(~0, data, length))
#define ether_crc_le(length, data) crc32_le(~0, data, length)
-#define ether_crc(length, data) crc32_be(~0, data, length)
#endif /* _LINUX_CRC32_H */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index f9945ae00d7a..89874d8eeee7 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1092,6 +1092,7 @@
#define PCI_DEVICE_ID_VIA_8233C_0 0x3109
#define PCI_DEVICE_ID_VIA_8361 0x3112
#define PCI_DEVICE_ID_VIA_8233A 0x3147
+#define PCI_DEVICE_ID_VIA_8235_0 0x3168
#define PCI_DEVICE_ID_VIA_8235 0x3177
#define PCI_DEVICE_ID_VIA_8377_0 0x3189
#define PCI_DEVICE_ID_VIA_86C100A 0x6100
diff --git a/init/Kconfig b/init/Kconfig
index 1597113085a8..962d16696ef9 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -37,22 +37,6 @@ endmenu
menu "General setup"
-config NET
- bool "Networking support"
- ---help---
- Unless you really know what you are doing, you should say Y here.
- The reason is that some programs need kernel networking support even
- when running on a stand-alone machine that isn't connected to any
- other computer. If you are upgrading from an older kernel, you
- should consider updating your networking tools too because changes
- in the kernel and the tools often go hand in hand. The tools are
- contained in the package net-tools, the location and version number
- of which are given in <file:Documentation/Changes>.
-
- For a general introduction to Linux networking, it is highly
- recommended to read the NET-HOWTO, available from
- <http://www.linuxdoc.org/docs.html#howto>.
-
config SYSVIPC
bool "System V IPC"
---help---
diff --git a/kernel/module.c b/kernel/module.c
index 680deb635e30..ff961f21135f 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -880,7 +880,7 @@ static long get_offset(unsigned long *size, Elf_Shdr *sechdr)
/* Lay out the SHF_ALLOC sections in a way not dissimilar to how ld
might -- code, read-only data, read-write data, small data. Tally
- sizes, and place the offsets into sh_link fields: high bit means it
+ sizes, and place the offsets into sh_entsize fields: high bit means it
belongs in init. */
static void layout_sections(struct module *mod,
const Elf_Ehdr *hdr,
@@ -896,7 +896,7 @@ static void layout_sections(struct module *mod,
unsigned int m, i;
for (i = 0; i < hdr->e_shnum; i++)
- sechdrs[i].sh_link = ~0UL;
+ sechdrs[i].sh_entsize = ~0UL;
DEBUGP("Core section allocation order:\n");
for (m = 0; m < ARRAY_SIZE(masks); ++m) {
@@ -905,10 +905,10 @@ static void layout_sections(struct module *mod,
if ((s->sh_flags & masks[m][0]) != masks[m][0]
|| (s->sh_flags & masks[m][1])
- || s->sh_link != ~0UL
+ || s->sh_entsize != ~0UL
|| strstr(secstrings + s->sh_name, ".init"))
continue;
- s->sh_link = get_offset(&mod->core_size, s);
+ s->sh_entsize = get_offset(&mod->core_size, s);
DEBUGP("\t%s\n", name);
}
}
@@ -920,11 +920,11 @@ static void layout_sections(struct module *mod,
if ((s->sh_flags & masks[m][0]) != masks[m][0]
|| (s->sh_flags & masks[m][1])
- || s->sh_link != ~0UL
+ || s->sh_entsize != ~0UL
|| !strstr(secstrings + s->sh_name, ".init"))
continue;
- s->sh_link = (get_offset(&mod->init_size, s)
- | INIT_OFFSET_MASK);
+ s->sh_entsize = (get_offset(&mod->init_size, s)
+ | INIT_OFFSET_MASK);
DEBUGP("\t%s\n", name);
}
}
@@ -1066,7 +1066,7 @@ static struct module *load_module(void *umod,
if (err < 0)
goto free_mod;
- /* Determine total sizes, and put offsets in sh_link. For now
+ /* Determine total sizes, and put offsets in sh_entsize. For now
this is done generically; there doesn't appear to be any
special cases for the architectures. */
layout_sections(mod, hdr, sechdrs, secstrings);
@@ -1095,11 +1095,11 @@ static struct module *load_module(void *umod,
if (!(sechdrs[i].sh_flags & SHF_ALLOC))
continue;
- if (sechdrs[i].sh_link & INIT_OFFSET_MASK)
+ if (sechdrs[i].sh_entsize & INIT_OFFSET_MASK)
dest = mod->module_init
- + (sechdrs[i].sh_link & ~INIT_OFFSET_MASK);
+ + (sechdrs[i].sh_entsize & ~INIT_OFFSET_MASK);
else
- dest = mod->module_core + sechdrs[i].sh_link;
+ dest = mod->module_core + sechdrs[i].sh_entsize;
if (sechdrs[i].sh_type != SHT_NOBITS)
memcpy(dest, (void *)sechdrs[i].sh_addr,
diff --git a/lib/crc32.c b/lib/crc32.c
index 47a142688b1d..b3defb2db345 100644
--- a/lib/crc32.c
+++ b/lib/crc32.c
@@ -265,8 +265,19 @@ u32 attribute((pure)) crc32_be(u32 crc, unsigned char const *p, size_t len)
}
#endif
+u32 bitreverse(u32 x)
+{
+ x = (x >> 16) | (x << 16);
+ x = (x >> 8 & 0x00ff00ff) | (x << 8 & 0xff00ff00);
+ x = (x >> 4 & 0x0f0f0f0f) | (x << 4 & 0xf0f0f0f0);
+ x = (x >> 2 & 0x33333333) | (x << 2 & 0xcccccccc);
+ x = (x >> 1 & 0x55555555) | (x << 1 & 0xaaaaaaaa);
+ return x;
+}
+
EXPORT_SYMBOL(crc32_le);
EXPORT_SYMBOL(crc32_be);
+EXPORT_SYMBOL(bitreverse);
/*
* A brief CRC tutorial.
@@ -412,16 +423,6 @@ buf_dump(char const *prefix, unsigned char const *buf, size_t len)
}
#endif
-static u32 attribute((const)) bitreverse(u32 x)
-{
- x = (x >> 16) | (x << 16);
- x = (x >> 8 & 0x00ff00ff) | (x << 8 & 0xff00ff00);
- x = (x >> 4 & 0x0f0f0f0f) | (x << 4 & 0xf0f0f0f0);
- x = (x >> 2 & 0x33333333) | (x << 2 & 0xcccccccc);
- x = (x >> 1 & 0x55555555) | (x << 1 & 0xaaaaaaaa);
- return x;
-}
-
static void bytereverse(unsigned char *buf, size_t len)
{
while (len--) {
diff --git a/net/Kconfig b/net/Kconfig
index fade78906088..a33b80a90c2f 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -2,6 +2,24 @@
# Network configuration
#
+menu "Networking support"
+
+config NET
+ bool "Networking support"
+ ---help---
+ Unless you really know what you are doing, you should say Y here.
+ The reason is that some programs need kernel networking support even
+ when running on a stand-alone machine that isn't connected to any
+ other computer. If you are upgrading from an older kernel, you
+ should consider updating your networking tools too because changes
+ in the kernel and the tools often go hand in hand. The tools are
+ contained in the package net-tools, the location and version number
+ of which are given in <file:Documentation/Changes>.
+
+ For a general introduction to Linux networking, it is highly
+ recommended to read the NET-HOWTO, available from
+ <http://www.linuxdoc.org/docs.html#howto>.
+
menu "Networking options"
depends on NET
@@ -652,3 +670,6 @@ endmenu
endmenu
+source "drivers/net/Kconfig"
+
+endmenu
diff --git a/sound/oss/cmpci.c b/sound/oss/cmpci.c
index 22a7f0ea6481..9328b1944243 100644
--- a/sound/oss/cmpci.c
+++ b/sound/oss/cmpci.c
@@ -82,6 +82,7 @@
* - speaker mixer support
* Mon Aug 13 2001
* - optimizations and cleanups
+ * 03/01/2003 - open_mode fixes from Georg Acher <acher@in.tum.de>
*
*/
/*****************************************************************************/
@@ -2272,7 +2273,7 @@ static int cm_release(struct inode *inode, struct file *file)
stop_adc(s);
dealloc_dmabuf(&s->dma_adc);
}
- s->open_mode &= (~file->f_mode) & (FMODE_READ|FMODE_WRITE);
+ s->open_mode &= ~(file->f_mode & (FMODE_READ|FMODE_WRITE));
up(&s->open_sem);
wake_up(&s->open_wait);
unlock_kernel();
@@ -2540,7 +2541,7 @@ static int cm_midi_release(struct inode *inode, struct file *file)
set_current_state(TASK_RUNNING);
}
down(&s->open_sem);
- s->open_mode &= (~(file->f_mode << FMODE_MIDI_SHIFT)) & (FMODE_MIDI_READ|FMODE_MIDI_WRITE);
+ s->open_mode &= ~((file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ|FMODE_MIDI_WRITE));
spin_lock_irqsave(&s->lock, flags);
if (!(s->open_mode & (FMODE_MIDI_READ | FMODE_MIDI_WRITE))) {
del_timer(&s->midi.timer);
diff --git a/sound/oss/es1370.c b/sound/oss/es1370.c
index 3f0a251bff97..010cf06f42c9 100644
--- a/sound/oss/es1370.c
+++ b/sound/oss/es1370.c
@@ -3,7 +3,7 @@
/*
* es1370.c -- Ensoniq ES1370/Asahi Kasei AK4531 audio driver.
*
- * Copyright (C) 1998-2001 Thomas Sailer (t.sailer@alumni.ethz.ch)
+ * Copyright (C) 1998-2001, 2003 Thomas Sailer (t.sailer@alumni.ethz.ch)
*
* 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
@@ -117,6 +117,7 @@
* 07.01.2001 0.36 Timeout change in wrcodec as requested by Frank Klemm <pfk@fuchs.offl.uni-jena.de>
* 31.01.2001 0.37 Register/Unregister gameport
* Fix SETTRIGGER non OSS API conformity
+ * 03.01.2003 0.38 open_mode fixes from Georg Acher <acher@in.tum.de>
*
* some important things missing in Ensoniq documentation:
*
@@ -1807,7 +1808,7 @@ static int es1370_release(struct inode *inode, struct file *file)
stop_adc(s);
dealloc_dmabuf(s, &s->dma_adc);
}
- s->open_mode &= (~file->f_mode) & (FMODE_READ|FMODE_WRITE);
+ s->open_mode &= ~(file->f_mode & (FMODE_READ|FMODE_WRITE));
wake_up(&s->open_wait);
up(&s->open_sem);
unlock_kernel();
@@ -2498,7 +2499,7 @@ static int es1370_midi_release(struct inode *inode, struct file *file)
set_current_state(TASK_RUNNING);
}
down(&s->open_sem);
- s->open_mode &= (~(file->f_mode << FMODE_MIDI_SHIFT)) & (FMODE_MIDI_READ|FMODE_MIDI_WRITE);
+ s->open_mode &= ~((file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ|FMODE_MIDI_WRITE));
spin_lock_irqsave(&s->lock, flags);
if (!(s->open_mode & (FMODE_MIDI_READ | FMODE_MIDI_WRITE))) {
s->ctrl &= ~CTRL_UART_EN;
@@ -2740,7 +2741,7 @@ static int __init init_es1370(void)
{
if (!pci_present()) /* No PCI bus in this machine! */
return -ENODEV;
- printk(KERN_INFO "es1370: version v0.37 time " __TIME__ " " __DATE__ "\n");
+ printk(KERN_INFO "es1370: version v0.38 time " __TIME__ " " __DATE__ "\n");
return pci_module_init(&es1370_driver);
}
diff --git a/sound/oss/es1371.c b/sound/oss/es1371.c
index 60331859f645..2c98362c1e67 100644
--- a/sound/oss/es1371.c
+++ b/sound/oss/es1371.c
@@ -3,7 +3,7 @@
/*
* es1371.c -- Creative Ensoniq ES1371.
*
- * Copyright (C) 1998-2001 Thomas Sailer (t.sailer@alumni.ethz.ch)
+ * Copyright (C) 1998-2001, 2003 Thomas Sailer (t.sailer@alumni.ethz.ch)
*
* 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
@@ -104,6 +104,7 @@
* 31.01.2001 0.30 Register/Unregister gameport
* Fix SETTRIGGER non OSS API conformity
* 14.07.2001 0.31 Add list of laptops needing amplifier control
+ * 03.01.2003 0.32 open_mode fixes from Georg Acher <acher@in.tum.de>
*/
/*****************************************************************************/
@@ -1995,7 +1996,7 @@ static int es1371_release(struct inode *inode, struct file *file)
stop_adc(s);
dealloc_dmabuf(s, &s->dma_adc);
}
- s->open_mode &= (~file->f_mode) & (FMODE_READ|FMODE_WRITE);
+ s->open_mode &= ~(file->f_mode & (FMODE_READ|FMODE_WRITE));
up(&s->open_sem);
wake_up(&s->open_wait);
unlock_kernel();
@@ -2675,7 +2676,7 @@ static int es1371_midi_release(struct inode *inode, struct file *file)
set_current_state(TASK_RUNNING);
}
down(&s->open_sem);
- s->open_mode &= (~(file->f_mode << FMODE_MIDI_SHIFT)) & (FMODE_MIDI_READ|FMODE_MIDI_WRITE);
+ s->open_mode &= ~((file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ|FMODE_MIDI_WRITE));
spin_lock_irqsave(&s->lock, flags);
if (!(s->open_mode & (FMODE_MIDI_READ | FMODE_MIDI_WRITE))) {
s->ctrl &= ~CTRL_UART_EN;
@@ -3044,7 +3045,7 @@ static int __init init_es1371(void)
{
if (!pci_present()) /* No PCI bus in this machine! */
return -ENODEV;
- printk(KERN_INFO PFX "version v0.30 time " __TIME__ " " __DATE__ "\n");
+ printk(KERN_INFO PFX "version v0.32 time " __TIME__ " " __DATE__ "\n");
return pci_module_init(&es1371_driver);
}
diff --git a/sound/oss/esssolo1.c b/sound/oss/esssolo1.c
index ecbe731fcb6a..82404d2e49d3 100644
--- a/sound/oss/esssolo1.c
+++ b/sound/oss/esssolo1.c
@@ -3,7 +3,7 @@
/*
* esssolo1.c -- ESS Technology Solo1 (ES1946) audio driver.
*
- * Copyright (C) 1998-2001 Thomas Sailer (t.sailer@alumni.ethz.ch)
+ * Copyright (C) 1998-2001, 2003 Thomas Sailer (t.sailer@alumni.ethz.ch)
*
* 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
@@ -82,6 +82,7 @@
* 22.05.2001 0.19 more cleanups, changed PM to PCI 2.4 style, got rid
* of global list of devices, using pci device data.
* Marcus Meissner <mm@caldera.de>
+ * 03.01.2003 0.20 open_mode fixes from Georg Acher <acher@in.tum.de>
*/
/*****************************************************************************/
@@ -1986,7 +1987,7 @@ static int solo1_midi_release(struct inode *inode, struct file *file)
set_current_state(TASK_RUNNING);
}
down(&s->open_sem);
- s->open_mode &= (~(file->f_mode << FMODE_MIDI_SHIFT)) & (FMODE_MIDI_READ|FMODE_MIDI_WRITE);
+ s->open_mode &= ~((file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ|FMODE_MIDI_WRITE));
spin_lock_irqsave(&s->lock, flags);
if (!(s->open_mode & (FMODE_MIDI_READ | FMODE_MIDI_WRITE))) {
outb(0x30, s->iobase + 7); /* enable A1, A2 irq's */
@@ -2461,7 +2462,7 @@ static int __init init_solo1(void)
{
if (!pci_present()) /* No PCI bus in this machine! */
return -ENODEV;
- printk(KERN_INFO "solo1: version v0.19 time " __TIME__ " " __DATE__ "\n");
+ printk(KERN_INFO "solo1: version v0.20 time " __TIME__ " " __DATE__ "\n");
if (!pci_register_driver(&solo1_driver)) {
pci_unregister_driver(&solo1_driver);
return -ENODEV;
diff --git a/sound/oss/sonicvibes.c b/sound/oss/sonicvibes.c
index 387c2f76f317..50e9ae077917 100644
--- a/sound/oss/sonicvibes.c
+++ b/sound/oss/sonicvibes.c
@@ -3,7 +3,7 @@
/*
* sonicvibes.c -- S3 Sonic Vibes audio driver.
*
- * Copyright (C) 1998-2001 Thomas Sailer (t.sailer@alumni.ethz.ch)
+ * Copyright (C) 1998-2001, 2003 Thomas Sailer (t.sailer@alumni.ethz.ch)
*
* 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
@@ -94,6 +94,7 @@
* Fix SETTRIGGER non OSS API conformity
* 18.05.2001 0.30 PCI probing and error values cleaned up by Marcus
* Meissner <mm@caldera.de>
+ * 03.01.2003 0.31 open_mode fixes from Georg Acher <acher@in.tum.de>
*
*/
@@ -1969,7 +1970,7 @@ static int sv_release(struct inode *inode, struct file *file)
stop_adc(s);
dealloc_dmabuf(s, &s->dma_adc);
}
- s->open_mode &= (~file->f_mode) & (FMODE_READ|FMODE_WRITE);
+ s->open_mode &= ~(file->f_mode & (FMODE_READ|FMODE_WRITE));
wake_up(&s->open_wait);
up(&s->open_sem);
unlock_kernel();
@@ -2245,7 +2246,7 @@ static int sv_midi_release(struct inode *inode, struct file *file)
set_current_state(TASK_RUNNING);
}
down(&s->open_sem);
- s->open_mode &= (~(file->f_mode << FMODE_MIDI_SHIFT)) & (FMODE_MIDI_READ|FMODE_MIDI_WRITE);
+ s->open_mode &= ~((file->f_mode << FMODE_MIDI_SHIFT) & (FMODE_MIDI_READ|FMODE_MIDI_WRITE));
spin_lock_irqsave(&s->lock, flags);
if (!(s->open_mode & (FMODE_MIDI_READ | FMODE_MIDI_WRITE))) {
outb(inb(s->ioenh + SV_CODEC_INTMASK) & ~SV_CINTMASK_MIDI, s->ioenh + SV_CODEC_INTMASK);
@@ -2725,7 +2726,7 @@ static int __init init_sonicvibes(void)
{
if (!pci_present()) /* No PCI bus in this machine! */
return -ENODEV;
- printk(KERN_INFO "sv: version v0.30 time " __TIME__ " " __DATE__ "\n");
+ printk(KERN_INFO "sv: version v0.31 time " __TIME__ " " __DATE__ "\n");
#if 0
if (!(wavetable_mem = __get_free_pages(GFP_KERNEL, 20-PAGE_SHIFT)))
printk(KERN_INFO "sv: cannot allocate 1MB of contiguous nonpageable memory for wavetable data\n");