Merge branch 'for-linus-merged' of master.kernel.org:/home/rmk/linux-2.6-arm
Linus Torvalds [Fri, 8 Aug 2008 18:38:42 +0000 (11:38 -0700)]
* 'for-linus-merged' of master.kernel.org:/home/rmk/linux-2.6-arm:
  [ARM] 5177/1: arm/mach-sa1100/Makefile: remove CONFIG_SA1100_USB
  [ARM] 5166/1: magician: add MAINTAINERS entry
  [ARM] fix pnx4008 build errors
  [ARM] Fix SMP booting with non-zero PHYS_OFFSET
  [ARM] 5185/1: Fix spi num_chipselect for lubbock
  [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach
  [ARM] Add support for arch/arm/mach-*/include and arch/arm/plat-*/include
  [ARM] Remove asm/hardware.h, use asm/arch/hardware.h instead
  [ARM] Eliminate useless includes of asm/mach-types.h
  [ARM] Fix circular include dependency with IRQ headers
  avr32: Use <mach/foo.h> instead of <asm/arch/foo.h>
  avr32: Introduce arch/avr32/mach-*/include/mach
  avr32: Move include/asm-avr32 to arch/avr32/include/asm
  [ARM] sa1100_wdt: use reset_status to remember watchdog reset status
  [ARM] pxa: introduce reset_status and clear_reset_status for driver's usage
  [ARM] pxa: introduce reset.h for reset specific header information

188 files changed:
Documentation/DocBook/z8530book.tmpl
MAINTAINERS
arch/powerpc/.gitignore [deleted file]
arch/sh/include/asm/sh_eth.h [new file with mode: 0644]
arch/sparc/include/asm/ebus_32.h
arch/sparc/include/asm/ebus_64.h
arch/sparc/include/asm/of_platform.h
arch/sparc/include/asm/parport.h
arch/sparc/include/asm/sbus_32.h
arch/sparc/include/asm/sbus_64.h
arch/sparc/kernel/ioport.c
arch/sparc/kernel/time.c
arch/sparc64/kernel/auxio.c
arch/sparc64/kernel/ebus.c
arch/sparc64/kernel/pci_common.c
arch/sparc64/kernel/pci_psycho.c
arch/sparc64/kernel/pci_sabre.c
arch/sparc64/kernel/pci_schizo.c
arch/sparc64/kernel/power.c
arch/sparc64/kernel/prom.c
arch/sparc64/kernel/stacktrace.c
arch/sparc64/kernel/sys_sparc32.c
arch/sparc64/kernel/systbls.S
arch/sparc64/kernel/time.c
drivers/bluetooth/bcm203x.c
drivers/bluetooth/bfusb.c
drivers/bluetooth/bpa10x.c
drivers/bluetooth/btusb.c
drivers/bluetooth/hci_usb.c
drivers/char/pcmcia/synclink_cs.c
drivers/char/synclink.c
drivers/char/synclink_gt.c
drivers/char/synclinkmp.c
drivers/dma/ioat_dma.c
drivers/input/serio/i8042-sparcio.h
drivers/net/3c523.c
drivers/net/3c527.c
drivers/net/3c59x.c
drivers/net/8390.c
drivers/net/8390p.c
drivers/net/Kconfig
drivers/net/atlx/atl1.c
drivers/net/atp.c
drivers/net/bnx2x_main.c
drivers/net/bonding/bond_3ad.c
drivers/net/bonding/bond_main.c
drivers/net/bonding/bond_sysfs.c
drivers/net/de620.c
drivers/net/dm9000.c
drivers/net/e1000e/e1000.h
drivers/net/e1000e/ethtool.c
drivers/net/e1000e/netdev.c
drivers/net/e1000e/param.c
drivers/net/eepro.c
drivers/net/eth16i.c
drivers/net/forcedeth.c
drivers/net/fs_enet/mac-fcc.c
drivers/net/gianfar.c
drivers/net/hamradio/mkiss.c
drivers/net/igb/e1000_82575.c
drivers/net/igb/e1000_82575.h
drivers/net/igb/e1000_defines.h
drivers/net/igb/e1000_hw.h
drivers/net/igb/e1000_mac.c
drivers/net/igb/e1000_mac.h
drivers/net/igb/e1000_regs.h
drivers/net/igb/igb_main.c
drivers/net/lp486e.c
drivers/net/meth.c
drivers/net/myri10ge/myri10ge.c
drivers/net/myri10ge/myri10ge_mcp.h
drivers/net/myri10ge/myri10ge_mcp_gen_header.h
drivers/net/netxen/netxen_nic.h
drivers/net/netxen/netxen_nic_ctx.c
drivers/net/netxen/netxen_nic_ethtool.c
drivers/net/netxen/netxen_nic_hdr.h
drivers/net/netxen/netxen_nic_hw.c
drivers/net/netxen/netxen_nic_hw.h
drivers/net/netxen/netxen_nic_init.c
drivers/net/netxen/netxen_nic_main.c
drivers/net/netxen/netxen_nic_niu.c
drivers/net/netxen/netxen_nic_phan_reg.h
drivers/net/ni5010.c
drivers/net/ni52.c
drivers/net/qla3xxx.c
drivers/net/qla3xxx.h
drivers/net/sh_eth.c
drivers/net/sh_eth.h
drivers/net/sky2.c
drivers/net/sky2.h
drivers/net/sun3_82586.c
drivers/net/usb/pegasus.c
drivers/net/via-velocity.c
drivers/net/via-velocity.h
drivers/net/wan/Kconfig
drivers/net/wan/Makefile
drivers/net/wan/cosa.c
drivers/net/wan/dscc4.c
drivers/net/wan/farsync.c
drivers/net/wan/farsync.h
drivers/net/wan/hdlc.c
drivers/net/wan/hdlc_cisco.c
drivers/net/wan/hdlc_fr.c
drivers/net/wan/hdlc_ppp.c
drivers/net/wan/hdlc_raw.c
drivers/net/wan/hdlc_raw_eth.c
drivers/net/wan/hdlc_x25.c
drivers/net/wan/hostess_sv11.c
drivers/net/wan/lmc/lmc.h
drivers/net/wan/lmc/lmc_debug.c
drivers/net/wan/lmc/lmc_debug.h
drivers/net/wan/lmc/lmc_ioctl.h
drivers/net/wan/lmc/lmc_main.c
drivers/net/wan/lmc/lmc_media.c
drivers/net/wan/lmc/lmc_proto.c
drivers/net/wan/lmc/lmc_proto.h
drivers/net/wan/lmc/lmc_var.h
drivers/net/wan/pc300.h
drivers/net/wan/pc300_drv.c
drivers/net/wan/sealevel.c
drivers/net/wan/syncppp.c
drivers/net/wan/z85230.c
drivers/net/wan/z85230.h
drivers/net/wireless/Kconfig
drivers/net/wireless/Makefile
drivers/net/wireless/ath5k/base.c
drivers/net/wireless/ath9k/Kconfig [new file with mode: 0644]
drivers/net/wireless/ath9k/Makefile [new file with mode: 0644]
drivers/net/wireless/ath9k/ath9k.h [new file with mode: 0644]
drivers/net/wireless/ath9k/beacon.c [new file with mode: 0644]
drivers/net/wireless/ath9k/core.c [new file with mode: 0644]
drivers/net/wireless/ath9k/core.h [new file with mode: 0644]
drivers/net/wireless/ath9k/hw.c [new file with mode: 0644]
drivers/net/wireless/ath9k/hw.h [new file with mode: 0644]
drivers/net/wireless/ath9k/initvals.h [new file with mode: 0644]
drivers/net/wireless/ath9k/main.c [new file with mode: 0644]
drivers/net/wireless/ath9k/phy.c [new file with mode: 0644]
drivers/net/wireless/ath9k/phy.h [new file with mode: 0644]
drivers/net/wireless/ath9k/rc.c [new file with mode: 0644]
drivers/net/wireless/ath9k/rc.h [new file with mode: 0644]
drivers/net/wireless/ath9k/recv.c [new file with mode: 0644]
drivers/net/wireless/ath9k/reg.h [new file with mode: 0644]
drivers/net/wireless/ath9k/regd.c [new file with mode: 0644]
drivers/net/wireless/ath9k/regd.h [new file with mode: 0644]
drivers/net/wireless/ath9k/regd_common.h [new file with mode: 0644]
drivers/net/wireless/ath9k/xmit.c [new file with mode: 0644]
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl-debug.h
drivers/net/wireless/iwlwifi/iwl-tx.c
drivers/net/wireless/orinoco.c
drivers/net/wireless/p54/p54.h
drivers/net/wireless/p54/p54common.c
drivers/net/wireless/rt2x00/rt2x00mac.c
drivers/net/wireless/wavelan.c
drivers/net/wireless/wavelan_cs.c
drivers/net/xen-netfront.c
drivers/usb/host/ehci-q.c
fs/nfsd/nfs4proc.c
include/linux/dm9000.h
include/linux/ethtool.h
include/linux/list.h
include/net/request_sock.h
include/net/syncppp.h
net/bluetooth/bnep/core.c
net/core/dev.c
net/core/pktgen.c
net/dccp/dccp.h
net/dccp/minisocks.c
net/ipv4/esp4.c
net/ipv4/route.c
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_minisocks.c
net/ipv4/xfrm4_mode_beet.c
net/ipv6/esp6.c
net/ipv6/route.c
net/ipv6/tcp_ipv6.c
net/ipv6/xfrm6_mode_beet.c
net/mac80211/main.c
net/mac80211/mesh.h
net/mac80211/mesh_hwmp.c
net/mac80211/mesh_pathtbl.c
net/mac80211/rx.c
net/mac80211/tx.c
net/netfilter/nf_conntrack_core.c
net/netfilter/nf_conntrack_standalone.c
net/sched/act_api.c
net/sched/sch_api.c
net/wanrouter/wanmain.c

index 42c75ba..a42a8a4 100644 (file)
        device to be used as both a tty interface and as a synchronous 
        controller is a project for Linux post the 2.4 release
   </para>
-  <para>
-       The support code handles most common card configurations and
-       supports running both Cisco HDLC and Synchronous PPP. With extra
-       glue the frame relay and X.25 protocols can also be used with this
-       driver.
-  </para>
   </chapter>
   
   <chapter id="Driver_Modes">
   <para>
        If you wish to use the network interface facilities of the driver,
        then you need to attach a network device to each channel that is
-       present and in use. In addition to use the SyncPPP and Cisco HDLC
+       present and in use. In addition to use the generic HDLC
        you need to follow some additional plumbing rules. They may seem 
        complex but a look at the example hostess_sv11 driver should
        reassure you.
   </para>
   <para>
        The network device used for each channel should be pointed to by
-       the netdevice field of each channel. The dev-&gt; priv field of the
+       the netdevice field of each channel. The hdlc-&gt; priv field of the
        network device points to your private data - you will need to be
-       able to find your ppp device from this. In addition to use the
-       sync ppp layer the private data must start with a void * pointer
-       to the syncppp structures.
+       able to find your private data from this.
   </para>
   <para>
        The way most drivers approach this particular problem is to
        create a structure holding the Z8530 device definition and
-       put that and the syncppp pointer into the private field of
-       the network device. The network device fields of the channels
-       then point back to the network devices. The ppp_device can also
-       be put in the private structure conveniently.
+       put that into the private field of the network device. The
+       network device fields of the channels then point back to the
+       network devices.
   </para>
   <para>
-       If you wish to use the synchronous ppp then you need to attach
-       the syncppp layer to the network device. You should do this before
-       you register the network device. The
-       <function>sppp_attach</function> requires that the first void *
-       pointer in your private data is pointing to an empty struct
-       ppp_device. The function fills in the initial data for the
-       ppp/hdlc layer.
+       If you wish to use the generic HDLC then you need to register
+       the HDLC device.
   </para>
   <para>
        Before you register your network device you will also need to
        buffer in sk_buff format and queues it for transmission. The
        caller must provide the entire packet with the exception of the
        bitstuffing and CRC. This is normally done by the caller via
-       the syncppp interface layer. It returns 0 if the buffer has been 
-        queued and non zero values  for queue full. If the function accepts 
-       the buffer it becomes property of the Z8530 layer and the caller 
-       should not free it. 
+       the generic HDLC interface layer. It returns 0 if the buffer has been
+       queued and non zero values for queue full. If the function accepts
+       the buffer it becomes property of the Z8530 layer and the caller
+       should not free it.
   </para>
   <para>
        The function <function>z8530_get_stats</function> returns a pointer
index d072a0a..5084539 100644 (file)
@@ -725,6 +725,15 @@ L: linux-wireless@vger.kernel.org
 L:     ath5k-devel@lists.ath5k.org
 S:     Maintained
 
+ATHEROS ATH9K WIRELESS DRIVER
+P:     Luis R. Rodriguez
+M:     lrodriguez@atheros.com
+P:     Jouni Malinen
+M:     jmalinen@atheros.com
+L:     linux-wireless@vger.kernel.org
+L:     ath9k-devel@lists.ath9k.org
+S:     Supported
+
 ATI_REMOTE2 DRIVER
 P:     Ville Syrjala
 M:     syrjala@sci.fi
diff --git a/arch/powerpc/.gitignore b/arch/powerpc/.gitignore
deleted file mode 100644 (file)
index a1a869c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-include
diff --git a/arch/sh/include/asm/sh_eth.h b/arch/sh/include/asm/sh_eth.h
new file mode 100644 (file)
index 0000000..bb83258
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef __ASM_SH_ETH_H__
+#define __ASM_SH_ETH_H__
+
+enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_ENDIAN};
+
+struct sh_eth_plat_data {
+       int phy;
+       int edmac_endian;
+};
+
+#endif
index 29cb7df..f91f0b2 100644 (file)
@@ -12,9 +12,9 @@
 #ifndef _LINUX_IOPORT_H
 #include <linux/ioport.h>
 #endif
+#include <linux/of_device.h>
 #include <asm/oplib.h>
 #include <asm/prom.h>
-#include <asm/of_device.h>
 
 struct linux_ebus_child {
        struct linux_ebus_child         *next;
index fcc62b9..14c6a11 100644 (file)
@@ -8,9 +8,10 @@
 #ifndef __SPARC64_EBUS_H
 #define __SPARC64_EBUS_H
 
+#include <linux/of_device.h>
+
 #include <asm/oplib.h>
 #include <asm/prom.h>
-#include <asm/of_device.h>
 
 struct linux_ebus_child {
        struct linux_ebus_child         *next;
index 93a262c..2348ab9 100644 (file)
@@ -13,9 +13,6 @@
  *
  */
 
-/* This is just here during the transition */
-#include <linux/of_platform.h>
-
 extern struct bus_type ebus_bus_type;
 extern struct bus_type sbus_bus_type;
 
index 7818b25..d983062 100644 (file)
@@ -6,9 +6,10 @@
 #ifndef _ASM_SPARC64_PARPORT_H
 #define _ASM_SPARC64_PARPORT_H 1
 
+#include <linux/of_device.h>
+
 #include <asm/ebus.h>
 #include <asm/ns87303.h>
-#include <asm/of_device.h>
 #include <asm/prom.h>
 
 #define PARPORT_PC_MAX_PORTS   PARPORT_MAX
index 77b5d3a..a7b4fa2 100644 (file)
@@ -9,10 +9,10 @@
 
 #include <linux/dma-mapping.h>
 #include <linux/ioport.h>
+#include <linux/of_device.h>
 
 #include <asm/oplib.h>
 #include <asm/prom.h>
-#include <asm/of_device.h>
 #include <asm/scatterlist.h>
 
 /* We scan which devices are on the SBus using the PROM node device
index 0e16b6d..b606c14 100644 (file)
@@ -8,10 +8,10 @@
 
 #include <linux/dma-mapping.h>
 #include <linux/ioport.h>
+#include <linux/of_device.h>
 
 #include <asm/oplib.h>
 #include <asm/prom.h>
-#include <asm/of_device.h>
 #include <asm/iommu.h>
 #include <asm/scatterlist.h>
 
index 4879609..2a8a847 100644 (file)
 #include <linux/pci.h>         /* struct pci_dev */
 #include <linux/proc_fs.h>
 #include <linux/scatterlist.h>
+#include <linux/of_device.h>
 
 #include <asm/io.h>
 #include <asm/vaddrs.h>
 #include <asm/oplib.h>
 #include <asm/prom.h>
-#include <asm/of_device.h>
 #include <asm/sbus.h>
 #include <asm/page.h>
 #include <asm/pgalloc.h>
index ab3dd0b..0762f5d 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/pci.h>
 #include <linux/ioport.h>
 #include <linux/profile.h>
+#include <linux/of_device.h>
 
 #include <asm/oplib.h>
 #include <asm/timer.h>
@@ -40,7 +41,6 @@
 #include <asm/sun4paddr.h>
 #include <asm/page.h>
 #include <asm/pcic.h>
-#include <asm/of_device.h>
 #include <asm/irq_regs.h>
 
 #include "irq.h"
index c55f029..dd5c7bf 100644 (file)
@@ -9,9 +9,9 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/ioport.h>
+#include <linux/of_device.h>
 
 #include <asm/prom.h>
-#include <asm/of_device.h>
 #include <asm/io.h>
 #include <asm/auxio.h>
 
index 4d58d7c..60d36d1 100644 (file)
 #include <linux/interrupt.h>
 #include <linux/delay.h>
 #include <linux/pci.h>
+#include <linux/of_device.h>
 
 #include <asm/system.h>
 #include <asm/page.h>
 #include <asm/ebus.h>
 #include <asm/oplib.h>
 #include <asm/prom.h>
-#include <asm/of_device.h>
 #include <asm/bpp.h>
 #include <asm/irq.h>
 #include <asm/io.h>
index 19fa621..09a5ec2 100644 (file)
@@ -8,9 +8,9 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/device.h>
+#include <linux/of_device.h>
 
 #include <asm/prom.h>
-#include <asm/of_device.h>
 #include <asm/oplib.h>
 
 #include "pci_impl.h"
index 994dbe0..ef5fe29 100644 (file)
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
+#include <linux/of_device.h>
 
 #include <asm/iommu.h>
 #include <asm/irq.h>
 #include <asm/starfire.h>
 #include <asm/prom.h>
-#include <asm/of_device.h>
 #include <asm/oplib.h>
 
 #include "pci_impl.h"
index 4c34195..ade5184 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
+#include <linux/of_device.h>
 
 #include <asm/apb.h>
 #include <asm/iommu.h>
@@ -18,7 +19,6 @@
 #include <asm/smp.h>
 #include <asm/oplib.h>
 #include <asm/prom.h>
-#include <asm/of_device.h>
 
 #include "pci_impl.h"
 #include "iommu_common.h"
index 615edd9..9248c67 100644 (file)
@@ -9,13 +9,13 @@
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
+#include <linux/of_device.h>
 
 #include <asm/iommu.h>
 #include <asm/irq.h>
 #include <asm/upa.h>
 #include <asm/pstate.h>
 #include <asm/prom.h>
-#include <asm/of_device.h>
 #include <asm/oplib.h>
 
 #include "pci_impl.h"
index eae8ca2..3bb987a 100644 (file)
 #include <linux/pm.h>
 #include <linux/syscalls.h>
 #include <linux/reboot.h>
+#include <linux/of_device.h>
 
 #include <asm/system.h>
 #include <asm/auxio.h>
 #include <asm/prom.h>
-#include <asm/of_device.h>
 #include <asm/io.h>
 #include <asm/sstate.h>
 #include <asm/reboot.h>
index ed03a18..3c048ac 100644 (file)
@@ -21,9 +21,9 @@
 #include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/lmb.h>
+#include <linux/of_device.h>
 
 #include <asm/prom.h>
-#include <asm/of_device.h>
 #include <asm/oplib.h>
 #include <asm/irq.h>
 #include <asm/asi.h>
index b3e3737..e9d7f06 100644 (file)
@@ -26,13 +26,15 @@ void save_stack_trace(struct stack_trace *trace)
 
                /* Bogus frame pointer? */
                if (fp < (thread_base + sizeof(struct thread_info)) ||
-                   fp >= (thread_base + THREAD_SIZE))
+                   fp > (thread_base + THREAD_SIZE - sizeof(struct sparc_stackf)))
                        break;
 
                sf = (struct sparc_stackf *) fp;
                regs = (struct pt_regs *) (sf + 1);
 
-               if ((regs->magic & ~0x1ff) == PT_REGS_MAGIC) {
+               if (((unsigned long)regs <=
+                    (thread_base + THREAD_SIZE - sizeof(*regs))) &&
+                   (regs->magic & ~0x1ff) == PT_REGS_MAGIC) {
                        if (!(regs->tstate & TSTATE_PRIV))
                                break;
                        pc = regs->tpc;
index 97b77fb..3d11853 100644 (file)
 #include <asm/mmu_context.h>
 #include <asm/compat_signal.h>
 
-asmlinkage long sys32_chown16(const char __user * filename, u16 user, u16 group)
-{
-       return sys_chown(filename, low2highuid(user), low2highgid(group));
-}
-
-asmlinkage long sys32_lchown16(const char __user * filename, u16 user, u16 group)
-{
-       return sys_lchown(filename, low2highuid(user), low2highgid(group));
-}
-
-asmlinkage long sys32_fchown16(unsigned int fd, u16 user, u16 group)
-{
-       return sys_fchown(fd, low2highuid(user), low2highgid(group));
-}
-
-asmlinkage long sys32_setregid16(u16 rgid, u16 egid)
-{
-       return sys_setregid(low2highgid(rgid), low2highgid(egid));
-}
-
-asmlinkage long sys32_setgid16(u16 gid)
-{
-       return sys_setgid((gid_t)gid);
-}
-
-asmlinkage long sys32_setreuid16(u16 ruid, u16 euid)
-{
-       return sys_setreuid(low2highuid(ruid), low2highuid(euid));
-}
-
-asmlinkage long sys32_setuid16(u16 uid)
-{
-       return sys_setuid((uid_t)uid);
-}
-
-asmlinkage long sys32_setresuid16(u16 ruid, u16 euid, u16 suid)
-{
-       return sys_setresuid(low2highuid(ruid), low2highuid(euid),
-               low2highuid(suid));
-}
-
-asmlinkage long sys32_getresuid16(u16 __user *ruid, u16 __user *euid, u16 __user *suid)
-{
-       int retval;
-
-       if (!(retval = put_user(high2lowuid(current->uid), ruid)) &&
-           !(retval = put_user(high2lowuid(current->euid), euid)))
-               retval = put_user(high2lowuid(current->suid), suid);
-
-       return retval;
-}
-
-asmlinkage long sys32_setresgid16(u16 rgid, u16 egid, u16 sgid)
-{
-       return sys_setresgid(low2highgid(rgid), low2highgid(egid),
-               low2highgid(sgid));
-}
-
-asmlinkage long sys32_getresgid16(u16 __user *rgid, u16 __user *egid, u16 __user *sgid)
-{
-       int retval;
-
-       if (!(retval = put_user(high2lowgid(current->gid), rgid)) &&
-           !(retval = put_user(high2lowgid(current->egid), egid)))
-               retval = put_user(high2lowgid(current->sgid), sgid);
-
-       return retval;
-}
-
-asmlinkage long sys32_setfsuid16(u16 uid)
-{
-       return sys_setfsuid((uid_t)uid);
-}
-
-asmlinkage long sys32_setfsgid16(u16 gid)
-{
-       return sys_setfsgid((gid_t)gid);
-}
-
-static int groups16_to_user(u16 __user *grouplist, struct group_info *group_info)
-{
-       int i;
-       u16 group;
-
-       for (i = 0; i < group_info->ngroups; i++) {
-               group = (u16)GROUP_AT(group_info, i);
-               if (put_user(group, grouplist+i))
-                       return -EFAULT;
-       }
-
-       return 0;
-}
-
-static int groups16_from_user(struct group_info *group_info, u16 __user *grouplist)
-{
-       int i;
-       u16 group;
-
-       for (i = 0; i < group_info->ngroups; i++) {
-               if (get_user(group, grouplist+i))
-                       return  -EFAULT;
-               GROUP_AT(group_info, i) = (gid_t)group;
-       }
-
-       return 0;
-}
-
-asmlinkage long sys32_getgroups16(int gidsetsize, u16 __user *grouplist)
-{
-       int i;
-
-       if (gidsetsize < 0)
-               return -EINVAL;
-
-       get_group_info(current->group_info);
-       i = current->group_info->ngroups;
-       if (gidsetsize) {
-               if (i > gidsetsize) {
-                       i = -EINVAL;
-                       goto out;
-               }
-               if (groups16_to_user(grouplist, current->group_info)) {
-                       i = -EFAULT;
-                       goto out;
-               }
-       }
-out:
-       put_group_info(current->group_info);
-       return i;
-}
-
-asmlinkage long sys32_setgroups16(int gidsetsize, u16 __user *grouplist)
-{
-       struct group_info *group_info;
-       int retval;
-
-       if (!capable(CAP_SETGID))
-               return -EPERM;
-       if ((unsigned)gidsetsize > NGROUPS_MAX)
-               return -EINVAL;
-
-       group_info = groups_alloc(gidsetsize);
-       if (!group_info)
-               return -ENOMEM;
-       retval = groups16_from_user(group_info, grouplist);
-       if (retval) {
-               put_group_info(group_info);
-               return retval;
-       }
-
-       retval = set_current_groups(group_info);
-       put_group_info(group_info);
-
-       return retval;
-}
-
-asmlinkage long sys32_getuid16(void)
-{
-       return high2lowuid(current->uid);
-}
-
-asmlinkage long sys32_geteuid16(void)
-{
-       return high2lowuid(current->euid);
-}
-
-asmlinkage long sys32_getgid16(void)
-{
-       return high2lowgid(current->gid);
-}
-
-asmlinkage long sys32_getegid16(void)
-{
-       return high2lowgid(current->egid);
-}
-
 /* 32-bit timeval and related flotsam.  */
 
 static inline long put_tv32(struct compat_timeval __user *o, struct timeval *i)
index 1095bf4..0fdbf3b 100644 (file)
 sys_call_table32:
 /*0*/  .word sys_restart_syscall, sys32_exit, sys_fork, sys_read, sys_write
 /*5*/  .word sys32_open, sys_close, sys32_wait4, sys32_creat, sys_link
-/*10*/  .word sys_unlink, sunos_execv, sys_chdir, sys32_chown16, sys32_mknod
-/*15*/ .word sys_chmod, sys32_lchown16, sparc_brk, sys32_perfctr, sys32_lseek
-/*20*/ .word sys_getpid, sys_capget, sys_capset, sys32_setuid16, sys32_getuid16
+/*10*/  .word sys_unlink, sunos_execv, sys_chdir, sys_chown16, sys32_mknod
+/*15*/ .word sys_chmod, sys_lchown16, sparc_brk, sys32_perfctr, sys32_lseek
+/*20*/ .word sys_getpid, sys_capget, sys_capset, sys_setuid16, sys_getuid16
 /*25*/ .word sys32_vmsplice, compat_sys_ptrace, sys_alarm, sys32_sigaltstack, sys32_pause
 /*30*/ .word compat_sys_utime, sys_lchown, sys_fchown, sys32_access, sys32_nice
        .word sys_chown, sys_sync, sys32_kill, compat_sys_newstat, sys32_sendfile
 /*40*/ .word compat_sys_newlstat, sys_dup, sys_pipe, compat_sys_times, sys_getuid
-       .word sys32_umount, sys32_setgid16, sys32_getgid16, sys32_signal, sys32_geteuid16
-/*50*/ .word sys32_getegid16, sys_acct, sys_nis_syscall, sys_getgid, compat_sys_ioctl
+       .word sys32_umount, sys_setgid16, sys_getgid16, sys32_signal, sys_geteuid16
+/*50*/ .word sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, compat_sys_ioctl
        .word sys32_reboot, sys32_mmap2, sys_symlink, sys32_readlink, sys32_execve
 /*60*/ .word sys32_umask, sys_chroot, compat_sys_newfstat, compat_sys_fstat64, sys_getpagesize
        .word sys32_msync, sys_vfork, sys32_pread64, sys32_pwrite64, sys_geteuid
 /*70*/ .word sys_getegid, sys_mmap, sys_setreuid, sys_munmap, sys_mprotect
-       .word sys_madvise, sys_vhangup, sys32_truncate64, sys_mincore, sys32_getgroups16
-/*80*/ .word sys32_setgroups16, sys_getpgrp, sys32_setgroups, sys32_setitimer, sys32_ftruncate64
+       .word sys_madvise, sys_vhangup, sys32_truncate64, sys_mincore, sys_getgroups16
+/*80*/ .word sys_setgroups16, sys_getpgrp, sys32_setgroups, sys32_setitimer, sys32_ftruncate64
        .word sys32_swapon, sys32_getitimer, sys_setuid, sys32_sethostname, sys_setgid
 /*90*/ .word sys_dup2, sys_setfsuid, compat_sys_fcntl, sys32_select, sys_setfsgid
        .word sys_fsync, sys32_setpriority, sys_nis_syscall, sys_nis_syscall, sys_nis_syscall
@@ -42,8 +42,8 @@ sys_call_table32:
        .word compat_sys_rt_sigtimedwait, sys32_rt_sigqueueinfo, compat_sys_rt_sigsuspend, sys_setresuid, sys_getresuid
 /*110*/        .word sys_setresgid, sys_getresgid, sys_setregid, sys_nis_syscall, sys_nis_syscall
        .word sys32_getgroups, sys32_gettimeofday, sys32_getrusage, sys_nis_syscall, sys_getcwd
-/*120*/        .word compat_sys_readv, compat_sys_writev, sys32_settimeofday, sys32_fchown16, sys_fchmod
-       .word sys_nis_syscall, sys32_setreuid16, sys32_setregid16, sys_rename, sys_truncate
+/*120*/        .word compat_sys_readv, compat_sys_writev, sys32_settimeofday, sys_fchown16, sys_fchmod
+       .word sys_nis_syscall, sys_setreuid16, sys_setregid16, sys_rename, sys_truncate
 /*130*/        .word sys_ftruncate, sys_flock, compat_sys_lstat64, sys_nis_syscall, sys_nis_syscall
        .word sys_nis_syscall, sys32_mkdir, sys_rmdir, compat_sys_utimes, compat_sys_stat64
 /*140*/        .word sys32_sendfile64, sys_nis_syscall, sys32_futex, sys_gettid, compat_sys_getrlimit
@@ -63,7 +63,7 @@ sys_call_table32:
 /*210*/        .word sys32_fadvise64_64, sys32_tgkill, sys32_waitpid, sys_swapoff, compat_sys_sysinfo
        .word compat_sys_ipc, sys32_sigreturn, sys_clone, sys32_ioprio_get, compat_sys_adjtimex
 /*220*/        .word sys32_sigprocmask, sys_ni_syscall, sys32_delete_module, sys_ni_syscall, sys32_getpgid
-       .word sys32_bdflush, sys32_sysfs, sys_nis_syscall, sys32_setfsuid16, sys32_setfsgid16
+       .word sys32_bdflush, sys32_sysfs, sys_nis_syscall, sys_setfsuid16, sys_setfsgid16
 /*230*/        .word sys32_select, compat_sys_time, sys32_splice, compat_sys_stime, compat_sys_statfs64
        .word compat_sys_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys32_mlockall
 /*240*/        .word sys_munlockall, sys32_sched_setparam, sys32_sched_getparam, sys32_sched_setscheduler, sys32_sched_getscheduler
index a0c6a97..cc16fdc 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/kernel_stat.h>
 #include <linux/clockchips.h>
 #include <linux/clocksource.h>
+#include <linux/of_device.h>
 
 #include <asm/oplib.h>
 #include <asm/mostek.h>
@@ -40,7 +41,6 @@
 #include <asm/irq.h>
 #include <asm/io.h>
 #include <asm/prom.h>
-#include <asm/of_device.h>
 #include <asm/starfire.h>
 #include <asm/smp.h>
 #include <asm/sections.h>
index 8919ccf..ee40201 100644 (file)
@@ -42,9 +42,7 @@
 #define BT_DBG(D...)
 #endif
 
-#define VERSION "1.1"
-
-static int ignore = 0;
+#define VERSION "1.2"
 
 static struct usb_device_id bcm203x_table[] = {
        /* Broadcom Blutonium (BCM2033) */
@@ -175,7 +173,7 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id
 
        BT_DBG("intf %p id %p", intf, id);
 
-       if (ignore || (intf->cur_altsetting->desc.bInterfaceNumber != 0))
+       if (intf->cur_altsetting->desc.bInterfaceNumber != 0)
                return -ENODEV;
 
        data = kzalloc(sizeof(*data), GFP_KERNEL);
@@ -300,9 +298,6 @@ static void __exit bcm203x_exit(void)
 module_init(bcm203x_init);
 module_exit(bcm203x_exit);
 
-module_param(ignore, bool, 0644);
-MODULE_PARM_DESC(ignore, "Ignore devices from the matching table");
-
 MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
 MODULE_DESCRIPTION("Broadcom Blutonium firmware driver ver " VERSION);
 MODULE_VERSION(VERSION);
index 0c211ad..90a0946 100644 (file)
@@ -43,9 +43,7 @@
 #define BT_DBG(D...)
 #endif
 
-#define VERSION "1.1"
-
-static int ignore = 0;
+#define VERSION "1.2"
 
 static struct usb_driver bfusb_driver;
 
@@ -656,9 +654,6 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i
 
        BT_DBG("intf %p id %p", intf, id);
 
-       if (ignore)
-               return -ENODEV;
-
        /* Check number of endpoints */
        if (intf->cur_altsetting->desc.bNumEndpoints < 2)
                return -EIO;
@@ -795,9 +790,6 @@ static void __exit bfusb_exit(void)
 module_init(bfusb_init);
 module_exit(bfusb_exit);
 
-module_param(ignore, bool, 0644);
-MODULE_PARM_DESC(ignore, "Ignore devices from the matching table");
-
 MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
 MODULE_DESCRIPTION("BlueFRITZ! USB driver ver " VERSION);
 MODULE_VERSION(VERSION);
index 3b28658..1e55a65 100644 (file)
@@ -40,9 +40,7 @@
 #define BT_DBG(D...)
 #endif
 
-#define VERSION "0.9"
-
-static int ignore = 0;
+#define VERSION "0.10"
 
 static struct usb_device_id bpa10x_table[] = {
        /* Tektronix BPA 100/105 (Digianswer) */
@@ -460,9 +458,6 @@ static int bpa10x_probe(struct usb_interface *intf, const struct usb_device_id *
 
        BT_DBG("intf %p id %p", intf, id);
 
-       if (ignore)
-               return -ENODEV;
-
        if (intf->cur_altsetting->desc.bInterfaceNumber != 0)
                return -ENODEV;
 
@@ -546,9 +541,6 @@ static void __exit bpa10x_exit(void)
 module_init(bpa10x_init);
 module_exit(bpa10x_exit);
 
-module_param(ignore, bool, 0644);
-MODULE_PARM_DESC(ignore, "Ignore devices from the matching table");
-
 MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
 MODULE_DESCRIPTION("Digianswer Bluetooth USB driver ver " VERSION);
 MODULE_VERSION(VERSION);
index 12e1089..95ae9ba 100644 (file)
 #define BT_DBG(D...)
 #endif
 
-#define VERSION "0.1"
+#define VERSION "0.2"
+
+static int ignore_dga;
+static int ignore_csr;
+static int ignore_sniffer;
+static int disable_scofix;
+static int force_scofix;
+static int reset;
+
+static struct usb_driver btusb_driver;
+
+#define BTUSB_IGNORE           0x01
+#define BTUSB_RESET            0x02
+#define BTUSB_DIGIANSWER       0x04
+#define BTUSB_CSR              0x08
+#define BTUSB_SNIFFER          0x10
+#define BTUSB_BCM92035         0x20
+#define BTUSB_BROKEN_ISOC      0x40
+#define BTUSB_WRONG_SCO_MTU    0x80
 
 static struct usb_device_id btusb_table[] = {
        /* Generic Bluetooth USB device */
        { USB_DEVICE_INFO(0xe0, 0x01, 0x01) },
 
+       /* AVM BlueFRITZ! USB v2.0 */
+       { USB_DEVICE(0x057c, 0x3800) },
+
+       /* Bluetooth Ultraport Module from IBM */
+       { USB_DEVICE(0x04bf, 0x030a) },
+
+       /* ALPS Modules with non-standard id */
+       { USB_DEVICE(0x044e, 0x3001) },
+       { USB_DEVICE(0x044e, 0x3002) },
+
+       /* Ericsson with non-standard id */
+       { USB_DEVICE(0x0bdb, 0x1002) },
+
+       /* Canyon CN-BTU1 with HID interfaces */
+       { USB_DEVICE(0x0c10, 0x0000), .driver_info = BTUSB_RESET },
+
        { }     /* Terminating entry */
 };
 
 MODULE_DEVICE_TABLE(usb, btusb_table);
 
 static struct usb_device_id blacklist_table[] = {
+       /* CSR BlueCore devices */
+       { USB_DEVICE(0x0a12, 0x0001), .driver_info = BTUSB_CSR },
+
+       /* Broadcom BCM2033 without firmware */
+       { USB_DEVICE(0x0a5c, 0x2033), .driver_info = BTUSB_IGNORE },
+
+       /* Broadcom BCM2035 */
+       { USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
+       { USB_DEVICE(0x0a5c, 0x200a), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
+
+       /* Broadcom BCM2045 */
+       { USB_DEVICE(0x0a5c, 0x2039), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
+       { USB_DEVICE(0x0a5c, 0x2101), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
+
+       /* Broadcom BCM2046 */
+       { USB_DEVICE(0x0a5c, 0x2151), .driver_info = BTUSB_RESET },
+
+       /* IBM/Lenovo ThinkPad with Broadcom chip */
+       { USB_DEVICE(0x0a5c, 0x201e), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
+       { USB_DEVICE(0x0a5c, 0x2110), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
+
+       /* Targus ACB10US */
+       { USB_DEVICE(0x0a5c, 0x2100), .driver_info = BTUSB_RESET },
+
+       /* ANYCOM Bluetooth USB-200 and USB-250 */
+       { USB_DEVICE(0x0a5c, 0x2111), .driver_info = BTUSB_RESET },
+
+       /* HP laptop with Broadcom chip */
+       { USB_DEVICE(0x03f0, 0x171d), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
+
+       /* Dell laptop with Broadcom chip */
+       { USB_DEVICE(0x413c, 0x8126), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
+
+       /* Dell Wireless 370 */
+       { USB_DEVICE(0x413c, 0x8156), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
+
+       /* Dell Wireless 410 */
+       { USB_DEVICE(0x413c, 0x8152), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
+
+       /* Microsoft Wireless Transceiver for Bluetooth 2.0 */
+       { USB_DEVICE(0x045e, 0x009c), .driver_info = BTUSB_RESET },
+
+       /* Kensington Bluetooth USB adapter */
+       { USB_DEVICE(0x047d, 0x105d), .driver_info = BTUSB_RESET },
+       { USB_DEVICE(0x047d, 0x105e), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
+
+       /* ISSC Bluetooth Adapter v3.1 */
+       { USB_DEVICE(0x1131, 0x1001), .driver_info = BTUSB_RESET },
+
+       /* RTX Telecom based adapters with buggy SCO support */
+       { USB_DEVICE(0x0400, 0x0807), .driver_info = BTUSB_BROKEN_ISOC },
+       { USB_DEVICE(0x0400, 0x080a), .driver_info = BTUSB_BROKEN_ISOC },
+
+       /* CONWISE Technology based adapters with buggy SCO support */
+       { USB_DEVICE(0x0e5e, 0x6622), .driver_info = BTUSB_BROKEN_ISOC },
+
+       /* Belkin F8T012 and F8T013 devices */
+       { USB_DEVICE(0x050d, 0x0012), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
+       { USB_DEVICE(0x050d, 0x0013), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
+
+       /* Digianswer devices */
+       { USB_DEVICE(0x08fd, 0x0001), .driver_info = BTUSB_DIGIANSWER },
+       { USB_DEVICE(0x08fd, 0x0002), .driver_info = BTUSB_IGNORE },
+
+       /* CSR BlueCore Bluetooth Sniffer */
+       { USB_DEVICE(0x0a12, 0x0002), .driver_info = BTUSB_SNIFFER },
+
+       /* Frontline ComProbe Bluetooth Sniffer */
+       { USB_DEVICE(0x16d3, 0x0002), .driver_info = BTUSB_SNIFFER },
+
        { }     /* Terminating entry */
 };
 
@@ -433,6 +537,7 @@ static int btusb_probe(struct usb_interface *intf,
 
        BT_DBG("intf %p id %p", intf, id);
 
+       /* interface numbers are hardcoded in the spec */
        if (intf->cur_altsetting->desc.bInterfaceNumber != 0)
                return -ENODEV;
 
@@ -443,6 +548,18 @@ static int btusb_probe(struct usb_interface *intf,
                        id = match;
        }
 
+       if (id->driver_info == BTUSB_IGNORE)
+               return -ENODEV;
+
+       if (ignore_dga && id->driver_info & BTUSB_DIGIANSWER)
+               return -ENODEV;
+
+       if (ignore_csr && id->driver_info & BTUSB_CSR)
+               return -ENODEV;
+
+       if (ignore_sniffer && id->driver_info & BTUSB_SNIFFER)
+               return -ENODEV;
+
        data = kzalloc(sizeof(*data), GFP_KERNEL);
        if (!data)
                return -ENOMEM;
@@ -503,7 +620,31 @@ static int btusb_probe(struct usb_interface *intf,
 
        hdev->owner = THIS_MODULE;
 
-       set_bit(HCI_QUIRK_RESET_ON_INIT, &hdev->quirks);
+       if (reset || id->driver_info & BTUSB_RESET)
+               set_bit(HCI_QUIRK_RESET_ON_INIT, &hdev->quirks);
+
+       if (force_scofix || id->driver_info & BTUSB_WRONG_SCO_MTU) {
+               if (!disable_scofix)
+                       set_bit(HCI_QUIRK_FIXUP_BUFFER_SIZE, &hdev->quirks);
+       }
+
+       if (id->driver_info & BTUSB_SNIFFER) {
+               struct usb_device *udev = interface_to_usbdev(intf);
+
+               if (le16_to_cpu(udev->descriptor.bcdDevice) > 0x997)
+                       set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks);
+       }
+
+       if (id->driver_info & BTUSB_BCM92035) {
+               unsigned char cmd[] = { 0x3b, 0xfc, 0x01, 0x00 };
+               struct sk_buff *skb;
+
+               skb = bt_skb_alloc(sizeof(cmd), GFP_KERNEL);
+               if (skb) {
+                       memcpy(skb_put(skb, sizeof(cmd)), cmd, sizeof(cmd));
+                       skb_queue_tail(&hdev->driver_init, skb);
+               }
+       }
 
        err = hci_register_dev(hdev);
        if (err < 0) {
@@ -558,6 +699,24 @@ static void __exit btusb_exit(void)
 module_init(btusb_init);
 module_exit(btusb_exit);
 
+module_param(ignore_dga, bool, 0644);
+MODULE_PARM_DESC(ignore_dga, "Ignore devices with id 08fd:0001");
+
+module_param(ignore_csr, bool, 0644);
+MODULE_PARM_DESC(ignore_csr, "Ignore devices with id 0a12:0001");
+
+module_param(ignore_sniffer, bool, 0644);
+MODULE_PARM_DESC(ignore_sniffer, "Ignore devices with id 0a12:0002");
+
+module_param(disable_scofix, bool, 0644);
+MODULE_PARM_DESC(disable_scofix, "Disable fixup of wrong SCO buffer size");
+
+module_param(force_scofix, bool, 0644);
+MODULE_PARM_DESC(force_scofix, "Force fixup of wrong SCO buffers size");
+
+module_param(reset, bool, 0644);
+MODULE_PARM_DESC(reset, "Send HCI reset command on initialization");
+
 MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
 MODULE_DESCRIPTION("Generic Bluetooth USB driver ver " VERSION);
 MODULE_VERSION(VERSION);
index c33bb59..e397572 100644 (file)
@@ -62,7 +62,6 @@
 #define URB_ZERO_PACKET 0
 #endif
 
-static int ignore;
 static int ignore_dga;
 static int ignore_csr;
 static int ignore_sniffer;
@@ -74,7 +73,7 @@ static int reset;
 static int isoc = 2;
 #endif
 
-#define VERSION "2.9"
+#define VERSION "2.10"
 
 static struct usb_driver hci_usb_driver; 
 
@@ -801,7 +800,7 @@ static int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id
                        id = match;
        }
 
-       if (ignore || id->driver_info & HCI_IGNORE)
+       if (id->driver_info & HCI_IGNORE)
                return -ENODEV;
 
        if (ignore_dga && id->driver_info & HCI_DIGIANSWER)
@@ -1108,9 +1107,6 @@ static void __exit hci_usb_exit(void)
 module_init(hci_usb_init);
 module_exit(hci_usb_exit);
 
-module_param(ignore, bool, 0644);
-MODULE_PARM_DESC(ignore, "Ignore devices from the matching table");
-
 module_param(ignore_dga, bool, 0644);
 MODULE_PARM_DESC(ignore_dga, "Ignore devices with id 08fd:0001");
 
index d1fceab..c240562 100644 (file)
@@ -232,7 +232,6 @@ typedef struct _mgslpc_info {
 
        /* SPPP/Cisco HDLC device parts */
        int netcount;
-       int dosyncppp;
        spinlock_t netlock;
 
 #if SYNCLINK_GENERIC_HDLC
@@ -459,13 +458,11 @@ static int ttymajor=0;
 
 static int debug_level = 0;
 static int maxframe[MAX_DEVICE_COUNT] = {0,};
-static int dosyncppp[MAX_DEVICE_COUNT] = {1,1,1,1};
 
 module_param(break_on_load, bool, 0);
 module_param(ttymajor, int, 0);
 module_param(debug_level, int, 0);
 module_param_array(maxframe, int, NULL, 0);
-module_param_array(dosyncppp, int, NULL, 0);
 
 MODULE_LICENSE("GPL");
 
@@ -2915,7 +2912,6 @@ static void mgslpc_add_device(MGSLPC_INFO *info)
        if (info->line < MAX_DEVICE_COUNT) {
                if (maxframe[info->line])
                        info->max_frame_size = maxframe[info->line];
-               info->dosyncppp = dosyncppp[info->line];
        }
 
        mgslpc_device_count++;
index ef6706f..500f517 100644 (file)
@@ -304,7 +304,6 @@ struct mgsl_struct {
 
        /* generic HDLC device parts */
        int netcount;
-       int dosyncppp;
        spinlock_t netlock;
 
 #if SYNCLINK_GENERIC_HDLC
@@ -868,7 +867,6 @@ static int irq[MAX_ISA_DEVICES];
 static int dma[MAX_ISA_DEVICES];
 static int debug_level;
 static int maxframe[MAX_TOTAL_DEVICES];
-static int dosyncppp[MAX_TOTAL_DEVICES];
 static int txdmabufs[MAX_TOTAL_DEVICES];
 static int txholdbufs[MAX_TOTAL_DEVICES];
        
@@ -879,7 +877,6 @@ module_param_array(irq, int, NULL, 0);
 module_param_array(dma, int, NULL, 0);
 module_param(debug_level, int, 0);
 module_param_array(maxframe, int, NULL, 0);
-module_param_array(dosyncppp, int, NULL, 0);
 module_param_array(txdmabufs, int, NULL, 0);
 module_param_array(txholdbufs, int, NULL, 0);
 
@@ -4258,7 +4255,6 @@ static void mgsl_add_device( struct mgsl_struct *info )
        if (info->line < MAX_TOTAL_DEVICES) {
                if (maxframe[info->line])
                        info->max_frame_size = maxframe[info->line];
-               info->dosyncppp = dosyncppp[info->line];
 
                if (txdmabufs[info->line]) {
                        info->num_tx_dma_buffers = txdmabufs[info->line];
index 3e90589..509c89a 100644 (file)
@@ -128,17 +128,14 @@ static int slgt_device_count;
 static int ttymajor;
 static int debug_level;
 static int maxframe[MAX_DEVICES];
-static int dosyncppp[MAX_DEVICES];
 
 module_param(ttymajor, int, 0);
 module_param(debug_level, int, 0);
 module_param_array(maxframe, int, NULL, 0);
-module_param_array(dosyncppp, int, NULL, 0);
 
 MODULE_PARM_DESC(ttymajor, "TTY major device number override: 0=auto assigned");
 MODULE_PARM_DESC(debug_level, "Debug syslog output: 0=disabled, 1 to 5=increasing detail");
 MODULE_PARM_DESC(maxframe, "Maximum frame size used by device (4096 to 65535)");
-MODULE_PARM_DESC(dosyncppp, "Enable synchronous net device, 0=disable 1=enable");
 
 /*
  * tty support and callbacks
@@ -349,7 +346,6 @@ struct slgt_info {
        /* SPPP/Cisco HDLC device parts */
 
        int netcount;
-       int dosyncppp;
        spinlock_t netlock;
 #if SYNCLINK_GENERIC_HDLC
        struct net_device *netdev;
@@ -3405,7 +3401,6 @@ static void add_device(struct slgt_info *info)
        if (info->line < MAX_DEVICES) {
                if (maxframe[info->line])
                        info->max_frame_size = maxframe[info->line];
-               info->dosyncppp = dosyncppp[info->line];
        }
 
        slgt_device_count++;
index c0490cb..6bdb44f 100644 (file)
@@ -270,7 +270,6 @@ typedef struct _synclinkmp_info {
 
        /* SPPP/Cisco HDLC device parts */
        int netcount;
-       int dosyncppp;
        spinlock_t netlock;
 
 #if SYNCLINK_GENERIC_HDLC
@@ -469,13 +468,11 @@ static int ttymajor = 0;
  */
 static int debug_level = 0;
 static int maxframe[MAX_DEVICES] = {0,};
-static int dosyncppp[MAX_DEVICES] = {0,};
 
 module_param(break_on_load, bool, 0);
 module_param(ttymajor, int, 0);
 module_param(debug_level, int, 0);
 module_param_array(maxframe, int, NULL, 0);
-module_param_array(dosyncppp, int, NULL, 0);
 
 static char *driver_name = "SyncLink MultiPort driver";
 static char *driver_version = "$Revision: 4.38 $";
@@ -3752,7 +3749,6 @@ static void add_device(SLMP_INFO *info)
        if (info->line < MAX_DEVICES) {
                if (maxframe[info->line])
                        info->max_frame_size = maxframe[info->line];
-               info->dosyncppp = dosyncppp[info->line];
        }
 
        synclinkmp_device_count++;
index a52156e..bc8c6e3 100644 (file)
@@ -551,7 +551,7 @@ static dma_cookie_t ioat1_tx_submit(struct dma_async_tx_descriptor *tx)
        /* write address into NextDescriptor field of last desc in chain */
        to_ioat_desc(ioat_chan->used_desc.prev)->hw->next =
                                                        first->async_tx.phys;
-       __list_splice(&new_chain, ioat_chan->used_desc.prev);
+       list_splice_tail(&new_chain, &ioat_chan->used_desc);
 
        ioat_chan->dmacount += desc_count;
        ioat_chan->pending += desc_count;
index d9ca558..66bafe3 100644 (file)
@@ -41,6 +41,8 @@ static inline void i8042_write_command(int val)
        writeb(val, kbd_iobase + 0x64UL);
 }
 
+#ifdef CONFIG_PCI
+
 #define OBP_PS2KBD_NAME1       "kb_ps2"
 #define OBP_PS2KBD_NAME2       "keyboard"
 #define OBP_PS2MS_NAME1                "kdmouse"
@@ -101,9 +103,6 @@ static struct of_platform_driver sparc_i8042_driver = {
 
 static int __init i8042_platform_init(void)
 {
-#ifndef CONFIG_PCI
-       return -ENODEV;
-#else
        struct device_node *root = of_find_node_by_path("/");
 
        if (!strcmp(root->name, "SUNW,JavaStation-1")) {
@@ -131,17 +130,25 @@ static int __init i8042_platform_init(void)
        i8042_reset = 1;
 
        return 0;
-#endif /* CONFIG_PCI */
 }
 
 static inline void i8042_platform_exit(void)
 {
-#ifdef CONFIG_PCI
        struct device_node *root = of_find_node_by_path("/");
 
        if (strcmp(root->name, "SUNW,JavaStation-1"))
                of_unregister_driver(&sparc_i8042_driver);
-#endif
 }
 
+#else /* !CONFIG_PCI */
+static int __init i8042_platform_init(void)
+{
+       return -ENODEV;
+}
+
+static inline void i8042_platform_exit(void)
+{
+}
+#endif /* !CONFIG_PCI */
+
 #endif /* _I8042_SPARCIO_H */
index dc6e474..e2ce41d 100644 (file)
@@ -640,10 +640,8 @@ static int init586(struct net_device *dev)
        cfg_cmd->time_low = 0x00;
        cfg_cmd->time_high = 0xf2;
        cfg_cmd->promisc = 0;
-       if (dev->flags & (IFF_ALLMULTI | IFF_PROMISC)) {
+       if (dev->flags & (IFF_ALLMULTI | IFF_PROMISC))
                cfg_cmd->promisc = 1;
-               dev->flags |= IFF_PROMISC;
-       }
        cfg_cmd->carr_coll = 0x00;
 
        p->scb->cbl_offset = make16(cfg_cmd);
index 6aca0c6..abc84f7 100644 (file)
@@ -1521,14 +1521,11 @@ static void do_mc32_set_multicast_list(struct net_device *dev, int retry)
        struct mc32_local *lp = netdev_priv(dev);
        u16 filt = (1<<2); /* Save Bad Packets, for stats purposes */
 
-       if (dev->flags&IFF_PROMISC)
+       if ((dev->flags&IFF_PROMISC) ||
+           (dev->flags&IFF_ALLMULTI) ||
+           dev->mc_count > 10)
                /* Enable promiscuous mode */
                filt |= 1;
-       else if((dev->flags&IFF_ALLMULTI) || dev->mc_count > 10)
-       {
-               dev->flags|=IFF_PROMISC;
-               filt |= 1;
-       }
        else if(dev->mc_count)
        {
                unsigned char block[62];
index 8db4e6b..491ee16 100644 (file)
@@ -1692,12 +1692,14 @@ vortex_open(struct net_device *dev)
                        vp->rx_ring[i].next = cpu_to_le32(vp->rx_ring_dma + sizeof(struct boom_rx_desc) * (i+1));
                        vp->rx_ring[i].status = 0;      /* Clear complete bit. */
                        vp->rx_ring[i].length = cpu_to_le32(PKT_BUF_SZ | LAST_FRAG);
-                       skb = dev_alloc_skb(PKT_BUF_SZ);
+
+                       skb = __netdev_alloc_skb(dev, PKT_BUF_SZ + NET_IP_ALIGN,
+                                                GFP_KERNEL);
                        vp->rx_skbuff[i] = skb;
                        if (skb == NULL)
                                break;                  /* Bad news!  */
-                       skb->dev = dev;                 /* Mark as being used by this device. */
-                       skb_reserve(skb, 2);    /* Align IP on 16 byte boundaries */
+
+                       skb_reserve(skb, NET_IP_ALIGN); /* Align IP on 16 byte boundaries */
                        vp->rx_ring[i].addr = cpu_to_le32(pci_map_single(VORTEX_PCI(vp), skb->data, PKT_BUF_SZ, PCI_DMA_FROMDEVICE));
                }
                if (i != RX_RING_SIZE) {
@@ -2538,7 +2540,7 @@ boomerang_rx(struct net_device *dev)
                struct sk_buff *skb;
                entry = vp->dirty_rx % RX_RING_SIZE;
                if (vp->rx_skbuff[entry] == NULL) {
-                       skb = dev_alloc_skb(PKT_BUF_SZ);
+                       skb = netdev_alloc_skb(dev, PKT_BUF_SZ + NET_IP_ALIGN);
                        if (skb == NULL) {
                                static unsigned long last_jif;
                                if (time_after(jiffies, last_jif + 10 * HZ)) {
@@ -2549,8 +2551,8 @@ boomerang_rx(struct net_device *dev)
                                        mod_timer(&vp->rx_oom_timer, RUN_AT(HZ * 1));
                                break;                  /* Bad news!  */
                        }
-                       skb->dev = dev;                 /* Mark as being used by this device. */
-                       skb_reserve(skb, 2);    /* Align IP on 16 byte boundaries */
+
+                       skb_reserve(skb, NET_IP_ALIGN);
                        vp->rx_ring[entry].addr = cpu_to_le32(pci_map_single(VORTEX_PCI(vp), skb->data, PKT_BUF_SZ, PCI_DMA_FROMDEVICE));
                        vp->rx_skbuff[entry] = skb;
                }
index dc5d258..f72a2e8 100644 (file)
@@ -9,42 +9,39 @@ int ei_open(struct net_device *dev)
 {
        return __ei_open(dev);
 }
+EXPORT_SYMBOL(ei_open);
 
 int ei_close(struct net_device *dev)
 {
        return __ei_close(dev);
 }
+EXPORT_SYMBOL(ei_close);
 
 irqreturn_t ei_interrupt(int irq, void *dev_id)
 {
        return __ei_interrupt(irq, dev_id);
 }
+EXPORT_SYMBOL(ei_interrupt);
 
 #ifdef CONFIG_NET_POLL_CONTROLLER
 void ei_poll(struct net_device *dev)
 {
        __ei_poll(dev);
 }
+EXPORT_SYMBOL(ei_poll);
 #endif
 
 struct net_device *__alloc_ei_netdev(int size)
 {
        return ____alloc_ei_netdev(size);
 }
+EXPORT_SYMBOL(__alloc_ei_netdev);
 
 void NS8390_init(struct net_device *dev, int startp)
 {
        __NS8390_init(dev, startp);
 }
-
-EXPORT_SYMBOL(ei_open);
-EXPORT_SYMBOL(ei_close);
-EXPORT_SYMBOL(ei_interrupt);
-#ifdef CONFIG_NET_POLL_CONTROLLER
-EXPORT_SYMBOL(ei_poll);
-#endif
 EXPORT_SYMBOL(NS8390_init);
-EXPORT_SYMBOL(__alloc_ei_netdev);
 
 #if defined(MODULE)
 
index 71f1988..4c6eea4 100644 (file)
@@ -4,9 +4,9 @@ static const char version[] =
     "8390p.c:v1.10cvs 9/23/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
 
 #define ei_inb(_p)     inb(_p)
-#define ei_outb(_v,_p) outb(_v,_p)
+#define ei_outb(_v, _p)        outb(_v, _p)
 #define ei_inb_p(_p)   inb_p(_p)
-#define ei_outb_p(_v,_p) outb_p(_v,_p)
+#define ei_outb_p(_v, _p) outb_p(_v, _p)
 
 #include "lib8390.c"
 
@@ -14,42 +14,39 @@ int eip_open(struct net_device *dev)
 {
        return __ei_open(dev);
 }
+EXPORT_SYMBOL(eip_open);
 
 int eip_close(struct net_device *dev)
 {
        return __ei_close(dev);
 }
+EXPORT_SYMBOL(eip_close);
 
 irqreturn_t eip_interrupt(int irq, void *dev_id)
 {
        return __ei_interrupt(irq, dev_id);
 }
+EXPORT_SYMBOL(eip_interrupt);
 
 #ifdef CONFIG_NET_POLL_CONTROLLER
 void eip_poll(struct net_device *dev)
 {
        __ei_poll(dev);
 }
+EXPORT_SYMBOL(eip_poll);
 #endif
 
 struct net_device *__alloc_eip_netdev(int size)
 {
        return ____alloc_ei_netdev(size);
 }
+EXPORT_SYMBOL(__alloc_eip_netdev);
 
 void NS8390p_init(struct net_device *dev, int startp)
 {
-       return __NS8390_init(dev, startp);
+       __NS8390_init(dev, startp);
 }
-
-EXPORT_SYMBOL(eip_open);
-EXPORT_SYMBOL(eip_close);
-EXPORT_SYMBOL(eip_interrupt);
-#ifdef CONFIG_NET_POLL_CONTROLLER
-EXPORT_SYMBOL(eip_poll);
-#endif
 EXPORT_SYMBOL(NS8390p_init);
-EXPORT_SYMBOL(__alloc_eip_netdev);
 
 #if defined(MODULE)
 
index 8a03875..4b4cb2b 100644 (file)
@@ -510,14 +510,15 @@ config STNIC
 config SH_ETH
        tristate "Renesas SuperH Ethernet support"
        depends on SUPERH && \
-               (CPU_SUBTYPE_SH7710 || CPU_SUBTYPE_SH7712 || CPU_SUBTYPE_SH7763)
+               (CPU_SUBTYPE_SH7710 || CPU_SUBTYPE_SH7712 || CPU_SUBTYPE_SH7763 || \
+                CPU_SUBTYPE_SH7619)
        select CRC32
        select MII
        select MDIO_BITBANG
        select PHYLIB
        help
          Renesas SuperH Ethernet device driver.
-         This driver support SH7710, SH7712 and SH7763.
+         This driver support SH7710, SH7712, SH7763 and SH7619.
 
 config SUNLANCE
        tristate "Sun LANCE support"
index f12e3d1..e6a7bb7 100644 (file)
@@ -1790,6 +1790,17 @@ static void atl1_rx_checksum(struct atl1_adapter *adapter,
 {
        struct pci_dev *pdev = adapter->pdev;
 
+       /*
+        * The L1 hardware contains a bug that erroneously sets the
+        * PACKET_FLAG_ERR and ERR_FLAG_L4_CHKSUM bits whenever a
+        * fragmented IP packet is received, even though the packet
+        * is perfectly valid and its checksum is correct. There's
+        * no way to distinguish between one of these good packets
+        * and a packet that actually contains a TCP/UDP checksum
+        * error, so all we can do is allow it to be handed up to
+        * the higher layers and let it be sorted out there.
+        */
+
        skb->ip_summed = CHECKSUM_NONE;
 
        if (unlikely(rrd->pkt_flg & PACKET_FLAG_ERR)) {
@@ -1816,14 +1827,6 @@ static void atl1_rx_checksum(struct atl1_adapter *adapter,
                return;
        }
 
-       /* IPv4, but hardware thinks its checksum is wrong */
-       if (netif_msg_rx_err(adapter))
-               dev_printk(KERN_DEBUG, &pdev->dev,
-                       "hw csum wrong, pkt_flag:%x, err_flag:%x\n",
-                       rrd->pkt_flg, rrd->err_flg);
-       skb->ip_summed = CHECKSUM_COMPLETE;
-       skb->csum = htons(rrd->xsz.xsum_sz.rx_chksum);
-       adapter->hw_csum_err++;
        return;
 }
 
index 3d44333..c10cd80 100644 (file)
@@ -854,14 +854,9 @@ static void set_rx_mode_8002(struct net_device *dev)
        struct net_local *lp = netdev_priv(dev);
        long ioaddr = dev->base_addr;
 
-       if ( dev->mc_count > 0 || (dev->flags & (IFF_ALLMULTI|IFF_PROMISC))) {
-               /* We must make the kernel realise we had to move
-                *      into promisc mode or we start all out war on
-                *      the cable. - AC
-                */
-               dev->flags|=IFF_PROMISC;
+       if (dev->mc_count > 0 || (dev->flags & (IFF_ALLMULTI|IFF_PROMISC)))
                lp->addr_mode = CMR2h_PROMISC;
-       } else
+       else
                lp->addr_mode = CMR2h_Normal;
        write_reg_high(ioaddr, CMR2, lp->addr_mode);
 }
index af251a5..272a4bd 100644 (file)
@@ -7202,7 +7202,7 @@ static void __devinit bnx2x_link_settings_requested(struct bnx2x *bp)
        bp->link_params.req_flow_ctrl = (bp->port.link_config &
                                         PORT_FEATURE_FLOW_CONTROL_MASK);
        if ((bp->link_params.req_flow_ctrl == FLOW_CTRL_AUTO) &&
-           (!bp->port.supported & SUPPORTED_Autoneg))
+           !(bp->port.supported & SUPPORTED_Autoneg))
                bp->link_params.req_flow_ctrl = FLOW_CTRL_NONE;
 
        BNX2X_DEV_INFO("req_line_speed %d  req_duplex %d  req_flow_ctrl 0x%x"
index ebb539e..6106660 100644 (file)
@@ -2107,6 +2107,7 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
                        aggregator = __get_first_agg(port);
                        ad_agg_selection_logic(aggregator);
                }
+               bond_3ad_set_carrier(bond);
        }
 
        // for each port run the state machines
index a641eea..c792138 100644 (file)
@@ -2223,272 +2223,217 @@ static int bond_slave_info_query(struct net_device *bond_dev, struct ifslave *in
 
 /*-------------------------------- Monitoring -------------------------------*/
 
-/*
- * if !have_locks, return nonzero if a failover is necessary.  if
- * have_locks, do whatever failover activities are needed.
- *
- * This is to separate the inspection and failover steps for locking
- * purposes; failover requires rtnl, but acquiring it for every
- * inspection is undesirable, so a wrapper first does inspection, and
- * the acquires the necessary locks and calls again to perform
- * failover if needed.  Since all locks are dropped, a complete
- * restart is needed between calls.
- */
-static int __bond_mii_monitor(struct bonding *bond, int have_locks)
-{
-       struct slave *slave, *oldcurrent;
-       int do_failover = 0;
-       int i;
-
-       if (bond->slave_cnt == 0)
-               goto out;
 
-       /* we will try to read the link status of each of our slaves, and
-        * set their IFF_RUNNING flag appropriately. For each slave not
-        * supporting MII status, we won't do anything so that a user-space
-        * program could monitor the link itself if needed.
-        */
-
-       read_lock(&bond->curr_slave_lock);
-       oldcurrent = bond->curr_active_slave;
-       read_unlock(&bond->curr_slave_lock);
+static int bond_miimon_inspect(struct bonding *bond)
+{
+       struct slave *slave;
+       int i, link_state, commit = 0;
 
        bond_for_each_slave(bond, slave, i) {
-               struct net_device *slave_dev = slave->dev;
-               int link_state;
-               u16 old_speed = slave->speed;
-               u8 old_duplex = slave->duplex;
+               slave->new_link = BOND_LINK_NOCHANGE;
 
-               link_state = bond_check_dev_link(bond, slave_dev, 0);
+               link_state = bond_check_dev_link(bond, slave->dev, 0);
 
                switch (slave->link) {
-               case BOND_LINK_UP:      /* the link was up */
-                       if (link_state == BMSR_LSTATUS) {
-                               if (!oldcurrent) {
-                                       if (!have_locks)
-                                               return 1;
-                                       do_failover = 1;
-                               }
-                               break;
-                       } else { /* link going down */
-                               slave->link  = BOND_LINK_FAIL;
-                               slave->delay = bond->params.downdelay;
-
-                               if (slave->link_failure_count < UINT_MAX) {
-                                       slave->link_failure_count++;
-                               }
+               case BOND_LINK_UP:
+                       if (link_state)
+                               continue;
 
-                               if (bond->params.downdelay) {
-                                       printk(KERN_INFO DRV_NAME
-                                              ": %s: link status down for %s "
-                                              "interface %s, disabling it in "
-                                              "%d ms.\n",
-                                              bond->dev->name,
-                                              IS_UP(slave_dev)
-                                              ? ((bond->params.mode == BOND_MODE_ACTIVEBACKUP)
-                                                 ? ((slave == oldcurrent)
-                                                    ? "active " : "backup ")
-                                                 : "")
-                                              : "idle ",
-                                              slave_dev->name,
-                                              bond->params.downdelay * bond->params.miimon);
-                               }
+                       slave->link = BOND_LINK_FAIL;
+                       slave->delay = bond->params.downdelay;
+                       if (slave->delay) {
+                               printk(KERN_INFO DRV_NAME
+                                      ": %s: link status down for %s"
+                                      "interface %s, disabling it in %d ms.\n",
+                                      bond->dev->name,
+                                      (bond->params.mode ==
+                                       BOND_MODE_ACTIVEBACKUP) ?
+                                      ((slave->state == BOND_STATE_ACTIVE) ?
+                                       "active " : "backup ") : "",
+                                      slave->dev->name,
+                                      bond->params.downdelay * bond->params.miimon);
                        }
-                       /* no break ! fall through the BOND_LINK_FAIL test to
-                          ensure proper action to be taken
-                       */
-               case BOND_LINK_FAIL:    /* the link has just gone down */
-                       if (link_state != BMSR_LSTATUS) {
-                               /* link stays down */
-                               if (slave->delay <= 0) {
-                                       if (!have_locks)
-                                               return 1;
-
-                                       /* link down for too long time */
-                                       slave->link = BOND_LINK_DOWN;
-
-                                       /* in active/backup mode, we must
-                                        * completely disable this interface
-                                        */
-                                       if ((bond->params.mode == BOND_MODE_ACTIVEBACKUP) ||
-                                           (bond->params.mode == BOND_MODE_8023AD)) {
-                                               bond_set_slave_inactive_flags(slave);
-                                       }
-
-                                       printk(KERN_INFO DRV_NAME
-                                              ": %s: link status definitely "
-                                              "down for interface %s, "
-                                              "disabling it\n",
-                                              bond->dev->name,
-                                              slave_dev->name);
-
-                                       /* notify ad that the link status has changed */
-                                       if (bond->params.mode == BOND_MODE_8023AD) {
-                                               bond_3ad_handle_link_change(slave, BOND_LINK_DOWN);
-                                       }
-
-                                       if ((bond->params.mode == BOND_MODE_TLB) ||
-                                           (bond->params.mode == BOND_MODE_ALB)) {
-                                               bond_alb_handle_link_change(bond, slave, BOND_LINK_DOWN);
-                                       }
-
-                                       if (slave == oldcurrent) {
-                                               do_failover = 1;
-                                       }
-                               } else {
-                                       slave->delay--;
-                               }
-                       } else {
-                               /* link up again */
-                               slave->link  = BOND_LINK_UP;
+                       /*FALLTHRU*/
+               case BOND_LINK_FAIL:
+                       if (link_state) {
+                               /*
+                                * recovered before downdelay expired
+                                */
+                               slave->link = BOND_LINK_UP;
                                slave->jiffies = jiffies;
                                printk(KERN_INFO DRV_NAME
                                       ": %s: link status up again after %d "
                                       "ms for interface %s.\n",
                                       bond->dev->name,
-                                      (bond->params.downdelay - slave->delay) * bond->params.miimon,
-                                      slave_dev->name);
+                                      (bond->params.downdelay - slave->delay) *
+                                      bond->params.miimon,
+                                      slave->dev->name);
+                               continue;
                        }
-                       break;
-               case BOND_LINK_DOWN:    /* the link was down */
-                       if (link_state != BMSR_LSTATUS) {
-                               /* the link stays down, nothing more to do */
-                               break;
-                       } else {        /* link going up */
-                               slave->link  = BOND_LINK_BACK;
-                               slave->delay = bond->params.updelay;
 
-                               if (bond->params.updelay) {
-                                       /* if updelay == 0, no need to
-                                          advertise about a 0 ms delay */
-                                       printk(KERN_INFO DRV_NAME
-                                              ": %s: link status up for "
-                                              "interface %s, enabling it "
-                                              "in %d ms.\n",
-                                              bond->dev->name,
-                                              slave_dev->name,
-                                              bond->params.updelay * bond->params.miimon);
-                               }
+                       if (slave->delay <= 0) {
+                               slave->new_link = BOND_LINK_DOWN;
+                               commit++;
+                               continue;
                        }
-                       /* no break ! fall through the BOND_LINK_BACK state in
-                          case there's something to do.
-                       */
-               case BOND_LINK_BACK:    /* the link has just come back */
-                       if (link_state != BMSR_LSTATUS) {
-                               /* link down again */
-                               slave->link  = BOND_LINK_DOWN;
 
+                       slave->delay--;
+                       break;
+
+               case BOND_LINK_DOWN:
+                       if (!link_state)
+                               continue;
+
+                       slave->link = BOND_LINK_BACK;
+                       slave->delay = bond->params.updelay;
+
+                       if (slave->delay) {
+                               printk(KERN_INFO DRV_NAME
+                                      ": %s: link status up for "
+                                      "interface %s, enabling it in %d ms.\n",
+                                      bond->dev->name, slave->dev->name,
+                                      bond->params.updelay *
+                                      bond->params.miimon);
+                       }
+                       /*FALLTHRU*/
+               case BOND_LINK_BACK:
+                       if (!link_state) {
+                               slave->link = BOND_LINK_DOWN;
                                printk(KERN_INFO DRV_NAME
                                       ": %s: link status down again after %d "
                                       "ms for interface %s.\n",
                                       bond->dev->name,
-                                      (bond->params.updelay - slave->delay) * bond->params.miimon,
-                                      slave_dev->name);
-                       } else {
-                               /* link stays up */
-                               if (slave->delay == 0) {
-                                       if (!have_locks)
-                                               return 1;
-
-                                       /* now the link has been up for long time enough */
-                                       slave->link = BOND_LINK_UP;
-                                       slave->jiffies = jiffies;
-
-                                       if (bond->params.mode == BOND_MODE_8023AD) {
-                                               /* prevent it from being the active one */
-                                               slave->state = BOND_STATE_BACKUP;
-                                       } else if (bond->params.mode != BOND_MODE_ACTIVEBACKUP) {
-                                               /* make it immediately active */
-                                               slave->state = BOND_STATE_ACTIVE;
-                                       } else if (slave != bond->primary_slave) {
-                                               /* prevent it from being the active one */
-                                               slave->state = BOND_STATE_BACKUP;
-                                       }
+                                      (bond->params.updelay - slave->delay) *
+                                      bond->params.miimon,
+                                      slave->dev->name);
 
-                                       printk(KERN_INFO DRV_NAME
-                                              ": %s: link status definitely "
-                                              "up for interface %s.\n",
-                                              bond->dev->name,
-                                              slave_dev->name);
-
-                                       /* notify ad that the link status has changed */
-                                       if (bond->params.mode == BOND_MODE_8023AD) {
-                                               bond_3ad_handle_link_change(slave, BOND_LINK_UP);
-                                       }
-
-                                       if ((bond->params.mode == BOND_MODE_TLB) ||
-                                           (bond->params.mode == BOND_MODE_ALB)) {
-                                               bond_alb_handle_link_change(bond, slave, BOND_LINK_UP);
-                                       }
-
-                                       if ((!oldcurrent) ||
-                                           (slave == bond->primary_slave)) {
-                                               do_failover = 1;
-                                       }
-                               } else {
-                                       slave->delay--;
-                               }
+                               continue;
                        }
+
+                       if (slave->delay <= 0) {
+                               slave->new_link = BOND_LINK_UP;
+                               commit++;
+                               continue;
+                       }
+
+                       slave->delay--;
                        break;
-               default:
-                       /* Should not happen */
-                       printk(KERN_ERR DRV_NAME
-                              ": %s: Error: %s Illegal value (link=%d)\n",
-                              bond->dev->name,
-                              slave->dev->name,
-                              slave->link);
-                       goto out;
-               } /* end of switch (slave->link) */
+               }
+       }
 
-               bond_update_speed_duplex(slave);
+       return commit;
+}
 
-               if (bond->params.mode == BOND_MODE_8023AD) {
-                       if (old_speed != slave->speed) {
-                               bond_3ad_adapter_speed_changed(slave);
-                       }
+static void bond_miimon_commit(struct bonding *bond)
+{
+       struct slave *slave;
+       int i;
+
+       bond_for_each_slave(bond, slave, i) {
+               switch (slave->new_link) {
+               case BOND_LINK_NOCHANGE:
+                       continue;
+
+               case BOND_LINK_UP:
+                       slave->link = BOND_LINK_UP;
+                       slave->jiffies = jiffies;
 
-                       if (old_duplex != slave->duplex) {
-                               bond_3ad_adapter_duplex_changed(slave);
+                       if (bond->params.mode == BOND_MODE_8023AD) {
+                               /* prevent it from being the active one */
+                               slave->state = BOND_STATE_BACKUP;
+                       } else if (bond->params.mode != BOND_MODE_ACTIVEBACKUP) {
+                               /* make it immediately active */
+                               slave->state = BOND_STATE_ACTIVE;
+                       } else if (slave != bond->primary_slave) {
+                               /* prevent it from being the active one */
+                               slave->state = BOND_STATE_BACKUP;
                        }
-               }
 
-       } /* end of for */
+                       printk(KERN_INFO DRV_NAME
+                              ": %s: link status definitely "
+                              "up for interface %s.\n",
+                              bond->dev->name, slave->dev->name);
 
-       if (do_failover) {
-               ASSERT_RTNL();
+                       /* notify ad that the link status has changed */
+                       if (bond->params.mode == BOND_MODE_8023AD)
+                               bond_3ad_handle_link_change(slave, BOND_LINK_UP);
 
-               write_lock_bh(&bond->curr_slave_lock);
+                       if ((bond->params.mode == BOND_MODE_TLB) ||
+                           (bond->params.mode == BOND_MODE_ALB))
+                               bond_alb_handle_link_change(bond, slave,
+                                                           BOND_LINK_UP);
 
-               bond_select_active_slave(bond);
+                       if (!bond->curr_active_slave ||
+                           (slave == bond->primary_slave))
+                               goto do_failover;
 
-               write_unlock_bh(&bond->curr_slave_lock);
+                       continue;
 
-       } else
-               bond_set_carrier(bond);
+               case BOND_LINK_DOWN:
+                       slave->link = BOND_LINK_DOWN;
 
-out:
-       return 0;
+                       if (bond->params.mode == BOND_MODE_ACTIVEBACKUP ||
+                           bond->params.mode == BOND_MODE_8023AD)
+                               bond_set_slave_inactive_flags(slave);
+
+                       printk(KERN_INFO DRV_NAME
+                              ": %s: link status definitely down for "
+                              "interface %s, disabling it\n",
+                              bond->dev->name, slave->dev->name);
+
+                       if (bond->params.mode == BOND_MODE_8023AD)
+                               bond_3ad_handle_link_change(slave,
+                                                           BOND_LINK_DOWN);
+
+                       if (bond->params.mode == BOND_MODE_TLB ||
+                           bond->params.mode == BOND_MODE_ALB)
+                               bond_alb_handle_link_change(bond, slave,
+                                                           BOND_LINK_DOWN);
+
+                       if (slave == bond->curr_active_slave)
+                               goto do_failover;
+
+                       continue;
+
+               default:
+                       printk(KERN_ERR DRV_NAME
+                              ": %s: invalid new link %d on slave %s\n",
+                              bond->dev->name, slave->new_link,
+                              slave->dev->name);
+                       slave->new_link = BOND_LINK_NOCHANGE;
+
+                       continue;
+               }
+
+do_failover:
+               ASSERT_RTNL();
+               write_lock_bh(&bond->curr_slave_lock);
+               bond_select_active_slave(bond);
+               write_unlock_bh(&bond->curr_slave_lock);
+       }
+
+       bond_set_carrier(bond);
 }
 
 /*
  * bond_mii_monitor
  *
  * Really a wrapper that splits the mii monitor into two phases: an
- * inspection, then (if inspection indicates something needs to be
- * done) an acquisition of appropriate locks followed by another pass
- * to implement whatever link state changes are indicated.
+ * inspection, then (if inspection indicates something needs to be done)
+ * an acquisition of appropriate locks followed by a commit phase to
+ * implement whatever link state changes are indicated.
  */
 void bond_mii_monitor(struct work_struct *work)
 {
        struct bonding *bond = container_of(work, struct bonding,
                                            mii_work.work);
-       unsigned long delay;
 
        read_lock(&bond->lock);
-       if (bond->kill_timers) {
-               read_unlock(&bond->lock);
-               return;
-       }
+       if (bond->kill_timers)
+               goto out;
+
+       if (bond->slave_cnt == 0)
+               goto re_arm;
 
        if (bond->send_grat_arp) {
                read_lock(&bond->curr_slave_lock);
@@ -2496,19 +2441,24 @@ void bond_mii_monitor(struct work_struct *work)
                read_unlock(&bond->curr_slave_lock);
        }
 
-       if (__bond_mii_monitor(bond, 0)) {
+       if (bond_miimon_inspect(bond)) {
                read_unlock(&bond->lock);
                rtnl_lock();
                read_lock(&bond->lock);
-               __bond_mii_monitor(bond, 1);
+
+               bond_miimon_commit(bond);
+
                read_unlock(&bond->lock);
                rtnl_unlock();  /* might sleep, hold no other locks */
                read_lock(&bond->lock);
        }
 
-       delay = msecs_to_jiffies(bond->params.miimon);
+re_arm:
+       if (bond->params.miimon)
+               queue_delayed_work(bond->wq, &bond->mii_work,
+                                  msecs_to_jiffies(bond->params.miimon));
+out:
        read_unlock(&bond->lock);
-       queue_delayed_work(bond->wq, &bond->mii_work, delay);
 }
 
 static __be32 bond_glean_dev_ip(struct net_device *dev)
index 6caac0f..3bdb473 100644 (file)
@@ -350,9 +350,6 @@ static ssize_t bonding_store_slaves(struct device *d,
                if (dev) {
                        printk(KERN_INFO DRV_NAME ": %s: Removing slave %s\n",
                                bond->dev->name, dev->name);
-                       if (bond->setup_by_slave)
-                               res = bond_release_and_destroy(bond->dev, dev);
-                       else
                                res = bond_release(bond->dev, dev);
                        if (res) {
                                ret = res;
index 3f5190c..d454e14 100644 (file)
@@ -488,13 +488,6 @@ static void de620_set_multicast_list(struct net_device *dev)
 {
        if (dev->mc_count || dev->flags&(IFF_ALLMULTI|IFF_PROMISC))
        { /* Enable promiscuous mode */
-               /*
-                *      We must make the kernel realise we had to move
-                *      into promisc mode or we start all out war on
-                *      the cable. - AC
-                */
-               dev->flags|=IFF_PROMISC;
-
                de620_set_register(dev, W_TCR, (TCR_DEF & ~RXPBM) | RXALL);
        }
        else
index 0b0f1c4..f42c23f 100644 (file)
@@ -1374,6 +1374,11 @@ dm9000_probe(struct platform_device *pdev)
        for (i = 0; i < 6; i += 2)
                dm9000_read_eeprom(db, i / 2, ndev->dev_addr+i);
 
+       if (!is_valid_ether_addr(ndev->dev_addr) && pdata != NULL) {
+               mac_src = "platform data";
+               memcpy(ndev->dev_addr, pdata->dev_addr, 6);
+       }
+
        if (!is_valid_ether_addr(ndev->dev_addr)) {
                /* try reading from mac */
                
index 4a4f62e..cf57050 100644 (file)
 
 struct e1000_info;
 
-#define ndev_printk(level, netdev, format, arg...) \
-       printk(level "%s: " format, (netdev)->name, ## arg)
+#define e_printk(level, adapter, format, arg...) \
+       printk(level "%s: %s: " format, pci_name(adapter->pdev), \
+              adapter->netdev->name, ## arg)
 
 #ifdef DEBUG
-#define ndev_dbg(netdev, format, arg...) \
-       ndev_printk(KERN_DEBUG , netdev, format, ## arg)
+#define e_dbg(format, arg...) \
+       e_printk(KERN_DEBUG , adapter, format, ## arg)
 #else
-#define ndev_dbg(netdev, format, arg...) do { (void)(netdev); } while (0)
+#define e_dbg(format, arg...) do { (void)(adapter); } while (0)
 #endif
 
-#define ndev_err(netdev, format, arg...) \
-       ndev_printk(KERN_ERR , netdev, format, ## arg)
-#define ndev_info(netdev, format, arg...) \
-       ndev_printk(KERN_INFO , netdev, format, ## arg)
-#define ndev_warn(netdev, format, arg...) \
-       ndev_printk(KERN_WARNING , netdev, format, ## arg)
-#define ndev_notice(netdev, format, arg...) \
-       ndev_printk(KERN_NOTICE , netdev, format, ## arg)
+#define e_err(format, arg...) \
+       e_printk(KERN_ERR, adapter, format, ## arg)
+#define e_info(format, arg...) \
+       e_printk(KERN_INFO, adapter, format, ## arg)
+#define e_warn(format, arg...) \
+       e_printk(KERN_WARNING, adapter, format, ## arg)
+#define e_notice(format, arg...) \
+       e_printk(KERN_NOTICE, adapter, format, ## arg)
 
 
 /* Tx/Rx descriptor defines */
@@ -283,10 +284,6 @@ struct e1000_adapter {
        unsigned long led_status;
 
        unsigned int flags;
-
-       /* for ioport free */
-       int bars;
-       int need_ioport;
 };
 
 struct e1000_info {
index 9350564..cf9679f 100644 (file)
@@ -189,8 +189,7 @@ static int e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx)
        /* Fiber NICs only allow 1000 gbps Full duplex */
        if ((adapter->hw.phy.media_type == e1000_media_type_fiber) &&
                spddplx != (SPEED_1000 + DUPLEX_FULL)) {
-               ndev_err(adapter->netdev, "Unsupported Speed/Duplex "
-                        "configuration\n");
+               e_err("Unsupported Speed/Duplex configuration\n");
                return -EINVAL;
        }
 
@@ -213,8 +212,7 @@ static int e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx)
                break;
        case SPEED_1000 + DUPLEX_HALF: /* not supported */
        default:
-               ndev_err(adapter->netdev, "Unsupported Speed/Duplex "
-                        "configuration\n");
+               e_err("Unsupported Speed/Duplex configuration\n");
                return -EINVAL;
        }
        return 0;
@@ -231,8 +229,8 @@ static int e1000_set_settings(struct net_device *netdev,
         * cannot be changed
         */
        if (e1000_check_reset_block(hw)) {
-               ndev_err(netdev, "Cannot change link "
-                        "characteristics when SoL/IDER is active.\n");
+               e_err("Cannot change link characteristics when SoL/IDER is "
+                     "active.\n");
                return -EINVAL;
        }
 
@@ -380,8 +378,7 @@ static int e1000_set_tso(struct net_device *netdev, u32 data)
                netdev->features &= ~NETIF_F_TSO6;
        }
 
-       ndev_info(netdev, "TSO is %s\n",
-                 data ? "Enabled" : "Disabled");
+       e_info("TSO is %s\n", data ? "Enabled" : "Disabled");
        adapter->flags |= FLAG_TSO_FORCE;
        return 0;
 }
@@ -722,10 +719,9 @@ static bool reg_pattern_test(struct e1000_adapter *adapter, u64 *data,
                                      (test[pat] & write));
                val = E1000_READ_REG_ARRAY(&adapter->hw, reg, offset);
                if (val != (test[pat] & write & mask)) {
-                       ndev_err(adapter->netdev, "pattern test reg %04X "
-                                "failed: got 0x%08X expected 0x%08X\n",
-                                reg + offset,
-                                val, (test[pat] & write & mask));
+                       e_err("pattern test reg %04X failed: got 0x%08X "
+                             "expected 0x%08X\n", reg + offset, val,
+                             (test[pat] & write & mask));
                        *data = reg;
                        return 1;
                }
@@ -740,9 +736,8 @@ static bool reg_set_and_check(struct e1000_adapter *adapter, u64 *data,
        __ew32(&adapter->hw, reg, write & mask);
        val = __er32(&adapter->hw, reg);
        if ((write & mask) != (val & mask)) {
-               ndev_err(adapter->netdev, "set/check reg %04X test failed: "
-                        "got 0x%08X expected 0x%08X\n", reg, (val & mask),
-                        (write & mask));
+               e_err("set/check reg %04X test failed: got 0x%08X "
+                     "expected 0x%08X\n", reg, (val & mask), (write & mask));
                *data = reg;
                return 1;
        }
@@ -766,7 +761,6 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data)
 {
        struct e1000_hw *hw = &adapter->hw;
        struct e1000_mac_info *mac = &adapter->hw.mac;
-       struct net_device *netdev = adapter->netdev;
        u32 value;
        u32 before;
        u32 after;
@@ -799,8 +793,8 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data)
        ew32(STATUS, toggle);
        after = er32(STATUS) & toggle;
        if (value != after) {
-               ndev_err(netdev, "failed STATUS register test got: "
-                        "0x%08X expected: 0x%08X\n", after, value);
+               e_err("failed STATUS register test got: 0x%08X expected: "
+                     "0x%08X\n", after, value);
                *data = 1;
                return 1;
        }
@@ -903,8 +897,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
                *data = 1;
                return -1;
        }
-       ndev_info(netdev, "testing %s interrupt\n",
-                 (shared_int ? "shared" : "unshared"));
+       e_info("testing %s interrupt\n", (shared_int ? "shared" : "unshared"));
 
        /* Disable all the interrupts */
        ew32(IMC, 0xFFFFFFFF);
@@ -1526,8 +1519,7 @@ static int e1000_loopback_test(struct e1000_adapter *adapter, u64 *data)
         * sessions are active
         */
        if (e1000_check_reset_block(&adapter->hw)) {
-               ndev_err(adapter->netdev, "Cannot do PHY loopback test "
-                        "when SoL/IDER is active.\n");
+               e_err("Cannot do PHY loopback test when SoL/IDER is active.\n");
                *data = 0;
                goto out;
        }
@@ -1612,7 +1604,7 @@ static void e1000_diag_test(struct net_device *netdev,
                forced_speed_duplex = adapter->hw.mac.forced_speed_duplex;
                autoneg = adapter->hw.mac.autoneg;
 
-               ndev_info(netdev, "offline testing starting\n");
+               e_info("offline testing starting\n");
 
                /*
                 * Link test performed before hardware reset so autoneg doesn't
@@ -1658,7 +1650,7 @@ static void e1000_diag_test(struct net_device *netdev,
                if (if_running)
                        dev_open(netdev);
        } else {
-               ndev_info(netdev, "online testing starting\n");
+               e_info("online testing starting\n");
                /* Online tests */
                if (e1000_link_test(adapter, &data[4]))
                        eth_test->flags |= ETH_TEST_FL_FAILED;
@@ -1694,8 +1686,8 @@ static void e1000_get_wol(struct net_device *netdev,
                wol->supported &= ~WAKE_UCAST;
 
                if (adapter->wol & E1000_WUFC_EX)
-                       ndev_err(netdev, "Interface does not support "
-                                "directed (unicast) frame wake-up packets\n");
+                       e_err("Interface does not support directed (unicast) "
+                             "frame wake-up packets\n");
        }
 
        if (adapter->wol & E1000_WUFC_EX)
index d136778..05b0b2f 100644 (file)
@@ -484,8 +484,8 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
                 * packet, also make sure the frame isn't just CRC only */
                if (!(status & E1000_RXD_STAT_EOP) || (length <= 4)) {
                        /* All receives must fit into a single buffer */
-                       ndev_dbg(netdev, "%s: Receive packet consumed "
-                                "multiple buffers\n", netdev->name);
+                       e_dbg("%s: Receive packet consumed multiple buffers\n",
+                             netdev->name);
                        /* recycle */
                        buffer_info->skb = skb;
                        goto next_desc;
@@ -576,28 +576,26 @@ static void e1000_print_tx_hang(struct e1000_adapter *adapter)
        unsigned int i = tx_ring->next_to_clean;
        unsigned int eop = tx_ring->buffer_info[i].next_to_watch;
        struct e1000_tx_desc *eop_desc = E1000_TX_DESC(*tx_ring, eop);
-       struct net_device *netdev = adapter->netdev;
 
        /* detected Tx unit hang */
-       ndev_err(netdev,
-                "Detected Tx Unit Hang:\n"
-                "  TDH                  <%x>\n"
-                "  TDT                  <%x>\n"
-                "  next_to_use          <%x>\n"
-                "  next_to_clean        <%x>\n"
-                "buffer_info[next_to_clean]:\n"
-                "  time_stamp           <%lx>\n"
-                "  next_to_watch        <%x>\n"
-                "  jiffies              <%lx>\n"
-                "  next_to_watch.status <%x>\n",
-                readl(adapter->hw.hw_addr + tx_ring->head),
-                readl(adapter->hw.hw_addr + tx_ring->tail),
-                tx_ring->next_to_use,
-                tx_ring->next_to_clean,
-                tx_ring->buffer_info[eop].time_stamp,
-                eop,
-                jiffies,
-                eop_desc->upper.fields.status);
+       e_err("Detected Tx Unit Hang:\n"
+             "  TDH                  <%x>\n"
+             "  TDT                  <%x>\n"
+             "  next_to_use          <%x>\n"
+             "  next_to_clean        <%x>\n"
+             "buffer_info[next_to_clean]:\n"
+             "  time_stamp           <%lx>\n"
+             "  next_to_watch        <%x>\n"
+             "  jiffies              <%lx>\n"
+             "  next_to_watch.status <%x>\n",
+             readl(adapter->hw.hw_addr + tx_ring->head),
+             readl(adapter->hw.hw_addr + tx_ring->tail),
+             tx_ring->next_to_use,
+             tx_ring->next_to_clean,
+             tx_ring->buffer_info[eop].time_stamp,
+             eop,
+             jiffies,
+             eop_desc->upper.fields.status);
 }
 
 /**
@@ -747,8 +745,8 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
                buffer_info->dma = 0;
 
                if (!(staterr & E1000_RXD_STAT_EOP)) {
-                       ndev_dbg(netdev, "%s: Packet Split buffers didn't pick "
-                                "up the full packet\n", netdev->name);
+                       e_dbg("%s: Packet Split buffers didn't pick up the "
+                             "full packet\n", netdev->name);
                        dev_kfree_skb_irq(skb);
                        goto next_desc;
                }
@@ -761,8 +759,8 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter,
                length = le16_to_cpu(rx_desc->wb.middle.length0);
 
                if (!length) {
-                       ndev_dbg(netdev, "%s: Last part of the packet spanning"
-                                " multiple descriptors\n", netdev->name);
+                       e_dbg("%s: Last part of the packet spanning multiple "
+                             "descriptors\n", netdev->name);
                        dev_kfree_skb_irq(skb);
                        goto next_desc;
                }
@@ -1011,7 +1009,7 @@ static bool e1000_clean_jumbo_rx_irq(struct e1000_adapter *adapter,
 
                /* eth type trans needs skb->data to point to something */
                if (!pskb_may_pull(skb, ETH_HLEN)) {
-                       ndev_err(netdev, "pskb_may_pull failed.\n");
+                       e_err("pskb_may_pull failed.\n");
                        dev_kfree_skb(skb);
                        goto next_desc;
                }
@@ -1251,10 +1249,8 @@ static int e1000_request_irq(struct e1000_adapter *adapter)
        err = request_irq(adapter->pdev->irq, handler, irq_flags, netdev->name,
                          netdev);
        if (err) {
-               ndev_err(netdev,
-                      "Unable to allocate %s interrupt (return: %d)\n",
-                       adapter->flags & FLAG_MSI_ENABLED ? "MSI":"INTx",
-                       err);
+               e_err("Unable to allocate %s interrupt (return: %d)\n",
+                     adapter->flags & FLAG_MSI_ENABLED ? "MSI":"INTx", err);
                if (adapter->flags & FLAG_MSI_ENABLED)
                        pci_disable_msi(adapter->pdev);
        }
@@ -1395,8 +1391,7 @@ int e1000e_setup_tx_resources(struct e1000_adapter *adapter)
        return 0;
 err:
        vfree(tx_ring->buffer_info);
-       ndev_err(adapter->netdev,
-       "Unable to allocate memory for the transmit descriptor ring\n");
+       e_err("Unable to allocate memory for the transmit descriptor ring\n");
        return err;
 }
 
@@ -1450,8 +1445,7 @@ err_pages:
        }
 err:
        vfree(rx_ring->buffer_info);
-       ndev_err(adapter->netdev,
-       "Unable to allocate memory for the transmit descriptor ring\n");
+       e_err("Unable to allocate memory for the transmit descriptor ring\n");
        return err;
 }
 
@@ -2450,13 +2444,13 @@ void e1000e_reset(struct e1000_adapter *adapter)
         * For parts with AMT enabled, let the firmware know
         * that the network interface is in control
         */
-       if ((adapter->flags & FLAG_HAS_AMT) && e1000e_check_mng_mode(hw))
+       if (adapter->flags & FLAG_HAS_AMT)
                e1000_get_hw_control(adapter);
 
        ew32(WUC, 0);
 
        if (mac->ops.init_hw(hw))
-               ndev_err(adapter->netdev, "Hardware Error\n");
+               e_err("Hardware Error\n");
 
        e1000_update_mng_vlan(adapter);
 
@@ -2591,7 +2585,7 @@ static int __devinit e1000_sw_init(struct e1000_adapter *adapter)
        return 0;
 
 err:
-       ndev_err(netdev, "Unable to allocate memory for queues\n");
+       e_err("Unable to allocate memory for queues\n");
        kfree(adapter->rx_ring);
        kfree(adapter->tx_ring);
        return -ENOMEM;
@@ -2640,8 +2634,7 @@ static int e1000_open(struct net_device *netdev)
         * If AMT is enabled, let the firmware know that the network
         * interface is now open
         */
-       if ((adapter->flags & FLAG_HAS_AMT) &&
-           e1000e_check_mng_mode(&adapter->hw))
+       if (adapter->flags & FLAG_HAS_AMT)
                e1000_get_hw_control(adapter);
 
        /*
@@ -2719,8 +2712,7 @@ static int e1000_close(struct net_device *netdev)
         * If AMT is enabled, let the firmware know that the network
         * interface is now closed
         */
-       if ((adapter->flags & FLAG_HAS_AMT) &&
-           e1000e_check_mng_mode(&adapter->hw))
+       if (adapter->flags & FLAG_HAS_AMT)
                e1000_release_hw_control(adapter);
 
        return 0;
@@ -2917,8 +2909,7 @@ static void e1000_phy_read_status(struct e1000_adapter *adapter)
                ret_val |= e1e_rphy(hw, PHY_1000T_STATUS, &phy->stat1000);
                ret_val |= e1e_rphy(hw, PHY_EXT_STATUS, &phy->estatus);
                if (ret_val)
-                       ndev_warn(adapter->netdev,
-                                 "Error reading PHY register\n");
+                       e_warn("Error reading PHY register\n");
        } else {
                /*
                 * Do not read PHY registers if link is not up
@@ -2943,18 +2934,16 @@ static void e1000_phy_read_status(struct e1000_adapter *adapter)
 static void e1000_print_link_info(struct e1000_adapter *adapter)
 {
        struct e1000_hw *hw = &adapter->hw;
-       struct net_device *netdev = adapter->netdev;
        u32 ctrl = er32(CTRL);
 
-       ndev_info(netdev,
-               "Link is Up %d Mbps %s, Flow Control: %s\n",
-               adapter->link_speed,
-               (adapter->link_duplex == FULL_DUPLEX) ?
-                               "Full Duplex" : "Half Duplex",
-               ((ctrl & E1000_CTRL_TFCE) && (ctrl & E1000_CTRL_RFCE)) ?
-                               "RX/TX" :
-               ((ctrl & E1000_CTRL_RFCE) ? "RX" :
-               ((ctrl & E1000_CTRL_TFCE) ? "TX" : "None" )));
+       e_info("Link is Up %d Mbps %s, Flow Control: %s\n",
+              adapter->link_speed,
+              (adapter->link_duplex == FULL_DUPLEX) ?
+                               "Full Duplex" : "Half Duplex",
+              ((ctrl & E1000_CTRL_TFCE) && (ctrl & E1000_CTRL_RFCE)) ?
+                               "RX/TX" :
+              ((ctrl & E1000_CTRL_RFCE) ? "RX" :
+              ((ctrl & E1000_CTRL_TFCE) ? "TX" : "None" )));
 }
 
 static bool e1000_has_link(struct e1000_adapter *adapter)
@@ -2994,8 +2983,7 @@ static bool e1000_has_link(struct e1000_adapter *adapter)
        if ((ret_val == E1000_ERR_PHY) && (hw->phy.type == e1000_phy_igp_3) &&
            (er32(CTRL) & E1000_PHY_CTRL_GBE_DISABLE)) {
                /* See e1000_kmrn_lock_loss_workaround_ich8lan() */
-               ndev_info(adapter->netdev,
-                         "Gigabit has been disabled, downgrading speed\n");
+               e_info("Gigabit has been disabled, downgrading speed\n");
        }
 
        return link_active;
@@ -3096,8 +3084,7 @@ static void e1000_watchdog_task(struct work_struct *work)
                                switch (adapter->link_speed) {
                                case SPEED_10:
                                case SPEED_100:
-                                       ndev_info(netdev,
-                                       "10/100 speed: disabling TSO\n");
+                                       e_info("10/100 speed: disabling TSO\n");
                                        netdev->features &= ~NETIF_F_TSO;
                                        netdev->features &= ~NETIF_F_TSO6;
                                        break;
@@ -3130,7 +3117,7 @@ static void e1000_watchdog_task(struct work_struct *work)
                if (netif_carrier_ok(netdev)) {
                        adapter->link_speed = 0;
                        adapter->link_duplex = 0;
-                       ndev_info(netdev, "Link is Down\n");
+                       e_info("Link is Down\n");
                        netif_carrier_off(netdev);
                        netif_tx_stop_all_queues(netdev);
                        if (!test_bit(__E1000_DOWN, &adapter->state))
@@ -3604,8 +3591,7 @@ static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 
                        pull_size = min((unsigned int)4, skb->data_len);
                        if (!__pskb_pull_tail(skb, pull_size)) {
-                               ndev_err(netdev,
-                                        "__pskb_pull_tail failed.\n");
+                               e_err("__pskb_pull_tail failed.\n");
                                dev_kfree_skb_any(skb);
                                return NETDEV_TX_OK;
                        }
@@ -3737,25 +3723,25 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
 
        if ((max_frame < ETH_ZLEN + ETH_FCS_LEN) ||
            (max_frame > MAX_JUMBO_FRAME_SIZE)) {
-               ndev_err(netdev, "Invalid MTU setting\n");
+               e_err("Invalid MTU setting\n");
                return -EINVAL;
        }
 
        /* Jumbo frame size limits */
        if (max_frame > ETH_FRAME_LEN + ETH_FCS_LEN) {
                if (!(adapter->flags & FLAG_HAS_JUMBO_FRAMES)) {
-                       ndev_err(netdev, "Jumbo Frames not supported.\n");
+                       e_err("Jumbo Frames not supported.\n");
                        return -EINVAL;
                }
                if (adapter->hw.phy.type == e1000_phy_ife) {
-                       ndev_err(netdev, "Jumbo Frames not supported.\n");
+                       e_err("Jumbo Frames not supported.\n");
                        return -EINVAL;
                }
        }
 
 #define MAX_STD_JUMBO_FRAME_SIZE 9234
        if (max_frame > MAX_STD_JUMBO_FRAME_SIZE) {
-               ndev_err(netdev, "MTU > 9216 not supported.\n");
+               e_err("MTU > 9216 not supported.\n");
                return -EINVAL;
        }
 
@@ -3792,8 +3778,7 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu)
                adapter->rx_buffer_len = ETH_FRAME_LEN + VLAN_HLEN
                                         + ETH_FCS_LEN;
 
-       ndev_info(netdev, "changing MTU from %d to %d\n",
-               netdev->mtu, new_mtu);
+       e_info("changing MTU from %d to %d\n", netdev->mtu, new_mtu);
        netdev->mtu = new_mtu;
 
        if (netif_running(netdev))
@@ -4006,10 +3991,7 @@ static int e1000_resume(struct pci_dev *pdev)
        pci_restore_state(pdev);
        e1000e_disable_l1aspm(pdev);
 
-       if (adapter->need_ioport)
-               err = pci_enable_device(pdev);
-       else
-               err = pci_enable_device_mem(pdev);
+       err = pci_enable_device_mem(pdev);
        if (err) {
                dev_err(&pdev->dev,
                        "Cannot enable PCI device from suspend\n");
@@ -4043,7 +4025,7 @@ static int e1000_resume(struct pci_dev *pdev)
         * is up.  For all other cases, let the f/w know that the h/w is now
         * under the control of the driver.
         */
-       if (!(adapter->flags & FLAG_HAS_AMT) || !e1000e_check_mng_mode(&adapter->hw))
+       if (!(adapter->flags & FLAG_HAS_AMT))
                e1000_get_hw_control(adapter);
 
        return 0;
@@ -4111,10 +4093,7 @@ static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev)
        int err;
 
        e1000e_disable_l1aspm(pdev);
-       if (adapter->need_ioport)
-               err = pci_enable_device(pdev);
-       else
-               err = pci_enable_device_mem(pdev);
+       err = pci_enable_device_mem(pdev);
        if (err) {
                dev_err(&pdev->dev,
                        "Cannot re-enable PCI device after reset.\n");
@@ -4162,8 +4141,7 @@ static void e1000_io_resume(struct pci_dev *pdev)
         * is up.  For all other cases, let the f/w know that the h/w is now
         * under the control of the driver.
         */
-       if (!(adapter->flags & FLAG_HAS_AMT) ||
-           !e1000e_check_mng_mode(&adapter->hw))
+       if (!(adapter->flags & FLAG_HAS_AMT))
                e1000_get_hw_control(adapter);
 
 }
@@ -4175,36 +4153,40 @@ static void e1000_print_device_info(struct e1000_adapter *adapter)
        u32 pba_num;
 
        /* print bus type/speed/width info */
-       ndev_info(netdev, "(PCI Express:2.5GB/s:%s) "
-                 "%02x:%02x:%02x:%02x:%02x:%02x\n",
-                 /* bus width */
-                ((hw->bus.width == e1000_bus_width_pcie_x4) ? "Width x4" :
-                 "Width x1"),
-                 /* MAC address */
-                 netdev->dev_addr[0], netdev->dev_addr[1],
-                 netdev->dev_addr[2], netdev->dev_addr[3],
-                 netdev->dev_addr[4], netdev->dev_addr[5]);
-       ndev_info(netdev, "Intel(R) PRO/%s Network Connection\n",
-                 (hw->phy.type == e1000_phy_ife)
-                  ? "10/100" : "1000");
+       e_info("(PCI Express:2.5GB/s:%s) %02x:%02x:%02x:%02x:%02x:%02x\n",
+              /* bus width */
+              ((hw->bus.width == e1000_bus_width_pcie_x4) ? "Width x4" :
+               "Width x1"),
+              /* MAC address */
+              netdev->dev_addr[0], netdev->dev_addr[1],
+              netdev->dev_addr[2], netdev->dev_addr[3],
+              netdev->dev_addr[4], netdev->dev_addr[5]);
+       e_info("Intel(R) PRO/%s Network Connection\n",
+              (hw->phy.type == e1000_phy_ife) ? "10/100" : "1000");
        e1000e_read_pba_num(hw, &pba_num);
-       ndev_info(netdev, "MAC: %d, PHY: %d, PBA No: %06x-%03x\n",
-                 hw->mac.type, hw->phy.type,
-                 (pba_num >> 8), (pba_num & 0xff));
+       e_info("MAC: %d, PHY: %d, PBA No: %06x-%03x\n",
+              hw->mac.type, hw->phy.type, (pba_num >> 8), (pba_num & 0xff));
 }
 
-/**
- * e1000e_is_need_ioport - determine if an adapter needs ioport resources or not
- * @pdev: PCI device information struct
- *
- * Returns true if an adapters needs ioport resources
- **/
-static int e1000e_is_need_ioport(struct pci_dev *pdev)
+static void e1000_eeprom_checks(struct e1000_adapter *adapter)
 {
-       switch (pdev->device) {
-       /* Currently there are no adapters that need ioport resources */
-       default:
-               return false;
+       struct e1000_hw *hw = &adapter->hw;
+       int ret_val;
+       u16 buf = 0;
+
+       if (hw->mac.type != e1000_82573)
+               return;
+
+       ret_val = e1000_read_nvm(hw, NVM_INIT_CONTROL2_REG, 1, &buf);
+       if (!(le16_to_cpu(buf) & (1 << 0))) {
+               /* Deep Smart Power Down (DSPD) */
+               e_warn("Warning: detected DSPD enabled in EEPROM\n");
+       }
+
+       ret_val = e1000_read_nvm(hw, NVM_INIT_3GIO_3, 1, &buf);
+       if (le16_to_cpu(buf) & (3 << 2)) {
+               /* ASPM enable */
+               e_warn("Warning: detected ASPM enabled in EEPROM\n");
        }
 }
 
@@ -4233,19 +4215,10 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
        int i, err, pci_using_dac;
        u16 eeprom_data = 0;
        u16 eeprom_apme_mask = E1000_EEPROM_APME;
-       int bars, need_ioport;
 
        e1000e_disable_l1aspm(pdev);
 
-       /* do not allocate ioport bars when not needed */
-       need_ioport = e1000e_is_need_ioport(pdev);
-       if (need_ioport) {
-               bars = pci_select_bars(pdev, IORESOURCE_MEM | IORESOURCE_IO);
-               err = pci_enable_device(pdev);
-       } else {
-               bars = pci_select_bars(pdev, IORESOURCE_MEM);
-               err = pci_enable_device_mem(pdev);
-       }
+       err = pci_enable_device_mem(pdev);
        if (err)
                return err;
 
@@ -4268,7 +4241,9 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
                }
        }
 
-       err = pci_request_selected_regions(pdev, bars, e1000e_driver_name);
+       err = pci_request_selected_regions(pdev,
+                                         pci_select_bars(pdev, IORESOURCE_MEM),
+                                         e1000e_driver_name);
        if (err)
                goto err_pci_reg;
 
@@ -4293,8 +4268,6 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
        adapter->hw.adapter = adapter;
        adapter->hw.mac.type = ei->mac;
        adapter->msg_enable = (1 << NETIF_MSG_DRV | NETIF_MSG_PROBE) - 1;
-       adapter->bars = bars;
-       adapter->need_ioport = need_ioport;
 
        mmio_start = pci_resource_start(pdev, 0);
        mmio_len = pci_resource_len(pdev, 0);
@@ -4366,8 +4339,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
        }
 
        if (e1000_check_reset_block(&adapter->hw))
-               ndev_info(netdev,
-                         "PHY reset is blocked due to SOL/IDER session.\n");
+               e_info("PHY reset is blocked due to SOL/IDER session.\n");
 
        netdev->features = NETIF_F_SG |
                           NETIF_F_HW_CSUM |
@@ -4411,25 +4383,26 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
                if (e1000_validate_nvm_checksum(&adapter->hw) >= 0)
                        break;
                if (i == 2) {
-                       ndev_err(netdev, "The NVM Checksum Is Not Valid\n");
+                       e_err("The NVM Checksum Is Not Valid\n");
                        err = -EIO;
                        goto err_eeprom;
                }
        }
 
+       e1000_eeprom_checks(adapter);
+
        /* copy the MAC address out of the NVM */
        if (e1000e_read_mac_addr(&adapter->hw))
-               ndev_err(netdev, "NVM Read Error while reading MAC address\n");
+               e_err("NVM Read Error while reading MAC address\n");
 
        memcpy(netdev->dev_addr, adapter->hw.mac.addr, netdev->addr_len);
        memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len);
 
        if (!is_valid_ether_addr(netdev->perm_addr)) {
-               ndev_err(netdev, "Invalid MAC Address: "
-                        "%02x:%02x:%02x:%02x:%02x:%02x\n",
-                        netdev->perm_addr[0], netdev->perm_addr[1],
-                        netdev->perm_addr[2], netdev->perm_addr[3],
-                        netdev->perm_addr[4], netdev->perm_addr[5]);
+               e_err("Invalid MAC Address: %02x:%02x:%02x:%02x:%02x:%02x\n",
+                     netdev->perm_addr[0], netdev->perm_addr[1],
+                     netdev->perm_addr[2], netdev->perm_addr[3],
+                     netdev->perm_addr[4], netdev->perm_addr[5]);
                err = -EIO;
                goto err_eeprom;
        }
@@ -4499,8 +4472,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
         * is up.  For all other cases, let the f/w know that the h/w is now
         * under the control of the driver.
         */
-       if (!(adapter->flags & FLAG_HAS_AMT) ||
-           !e1000e_check_mng_mode(&adapter->hw))
+       if (!(adapter->flags & FLAG_HAS_AMT))
                e1000_get_hw_control(adapter);
 
        /* tell the stack to leave us alone until e1000_open() is called */
@@ -4517,24 +4489,25 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
        return 0;
 
 err_register:
-err_hw_init:
-       e1000_release_hw_control(adapter);
+       if (!(adapter->flags & FLAG_HAS_AMT))
+               e1000_release_hw_control(adapter);
 err_eeprom:
        if (!e1000_check_reset_block(&adapter->hw))
                e1000_phy_hw_reset(&adapter->hw);
+err_hw_init:
 
-       if (adapter->hw.flash_address)
-               iounmap(adapter->hw.flash_address);
-
-err_flashmap:
        kfree(adapter->tx_ring);
        kfree(adapter->rx_ring);
 err_sw_init:
+       if (adapter->hw.flash_address)
+               iounmap(adapter->hw.flash_address);
+err_flashmap:
        iounmap(adapter->hw.hw_addr);
 err_ioremap:
        free_netdev(netdev);
 err_alloc_etherdev:
-       pci_release_selected_regions(pdev, bars);
+       pci_release_selected_regions(pdev,
+                                    pci_select_bars(pdev, IORESOURCE_MEM));
 err_pci_reg:
 err_dma:
        pci_disable_device(pdev);
@@ -4582,7 +4555,8 @@ static void __devexit e1000_remove(struct pci_dev *pdev)
        iounmap(adapter->hw.hw_addr);
        if (adapter->hw.flash_address)
                iounmap(adapter->hw.flash_address);
-       pci_release_selected_regions(pdev, adapter->bars);
+       pci_release_selected_regions(pdev,
+                                    pci_select_bars(pdev, IORESOURCE_MEM));
 
        free_netdev(netdev);
 
index a66b92e..8effc31 100644 (file)
@@ -27,6 +27,7 @@
 *******************************************************************************/
 
 #include <linux/netdevice.h>
+#include <linux/pci.h>
 
 #include "e1000.h"
 
@@ -162,17 +163,16 @@ static int __devinit e1000_validate_option(unsigned int *value,
        case enable_option:
                switch (*value) {
                case OPTION_ENABLED:
-                       ndev_info(adapter->netdev, "%s Enabled\n", opt->name);
+                       e_info("%s Enabled\n", opt->name);
                        return 0;
                case OPTION_DISABLED:
-                       ndev_info(adapter->netdev, "%s Disabled\n", opt->name);
+                       e_info("%s Disabled\n", opt->name);
                        return 0;
                }
                break;
        case range_option:
                if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) {
-                       ndev_info(adapter->netdev,
-                                       "%s set to %i\n", opt->name, *value);
+                       e_info("%s set to %i\n", opt->name, *value);
                        return 0;
                }
                break;
@@ -184,8 +184,7 @@ static int __devinit e1000_validate_option(unsigned int *value,
                        ent = &opt->arg.l.p[i];
                        if (*value == ent->i) {
                                if (ent->str[0] != '\0')
-                                       ndev_info(adapter->netdev, "%s\n",
-                                                 ent->str);
+                                       e_info("%s\n", ent->str);
                                return 0;
                        }
                }
@@ -195,8 +194,8 @@ static int __devinit e1000_validate_option(unsigned int *value,
                BUG();
        }
 
-       ndev_info(adapter->netdev, "Invalid %s value specified (%i) %s\n",
-              opt->name, *value, opt->err);
+       e_info("Invalid %s value specified (%i) %s\n", opt->name, *value,
+              opt->err);
        *value = opt->def;
        return -1;
 }
@@ -213,13 +212,11 @@ static int __devinit e1000_validate_option(unsigned int *value,
 void __devinit e1000e_check_options(struct e1000_adapter *adapter)
 {
        struct e1000_hw *hw = &adapter->hw;
-       struct net_device *netdev = adapter->netdev;
        int bd = adapter->bd_number;
 
        if (bd >= E1000_MAX_NIC) {
-               ndev_notice(netdev,
-                      "Warning: no configuration for board #%i\n", bd);
-               ndev_notice(netdev, "Using defaults for all values\n");
+               e_notice("Warning: no configuration for board #%i\n", bd);
+               e_notice("Using defaults for all values\n");
        }
 
        { /* Transmit Interrupt Delay */
@@ -313,19 +310,15 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
                        adapter->itr = InterruptThrottleRate[bd];
                        switch (adapter->itr) {
                        case 0:
-                               ndev_info(netdev, "%s turned off\n",
-                                       opt.name);
+                               e_info("%s turned off\n", opt.name);
                                break;
                        case 1:
-                               ndev_info(netdev,
-                                         "%s set to dynamic mode\n",
-                                         opt.name);
+                               e_info("%s set to dynamic mode\n", opt.name);
                                adapter->itr_setting = adapter->itr;
                                adapter->itr = 20000;
                                break;
                        case 3:
-                               ndev_info(netdev,
-                                       "%s set to dynamic conservative mode\n",
+                               e_info("%s set to dynamic conservative mode\n",
                                        opt.name);
                                adapter->itr_setting = adapter->itr;
                                adapter->itr = 20000;
index 56f5049..1f11350 100644 (file)
@@ -1283,14 +1283,6 @@ set_multicast_list(struct net_device *dev)
 
        if (dev->flags&(IFF_ALLMULTI|IFF_PROMISC) || dev->mc_count > 63)
        {
-               /*
-                *      We must make the kernel realise we had to move
-                *      into promisc mode or we start all out war on
-                *      the cable. If it was a promisc request the
-                *      flag is already set. If not we assert it.
-                */
-               dev->flags|=IFF_PROMISC;
-
                eepro_sw2bank2(ioaddr); /* be CAREFUL, BANK 2 now */
                mode = inb(ioaddr + REG2);
                outb(mode | PRMSC_Mode, ioaddr + REG2);
index e3dd8b1..bee8b3f 100644 (file)
@@ -1356,7 +1356,6 @@ static void eth16i_multicast(struct net_device *dev)
 
        if(dev->mc_count || dev->flags&(IFF_ALLMULTI|IFF_PROMISC))
        {
-               dev->flags|=IFF_PROMISC;        /* Must do this */
                outb(3, ioaddr + RECEIVE_MODE_REG);
        } else {
                outb(2, ioaddr + RECEIVE_MODE_REG);
index 01b38b0..053971e 100644 (file)
  * Hardware access:
  */
 
-#define DEV_NEED_TIMERIRQ          0x00001  /* set the timer irq flag in the irq mask */
-#define DEV_NEED_LINKTIMER         0x00002  /* poll link settings. Relies on the timer irq */
-#define DEV_HAS_LARGEDESC          0x00004  /* device supports jumbo frames and needs packet format 2 */
-#define DEV_HAS_HIGH_DMA           0x00008  /* device supports 64bit dma */
-#define DEV_HAS_CHECKSUM           0x00010  /* device supports tx and rx checksum offloads */
-#define DEV_HAS_VLAN               0x00020  /* device supports vlan tagging and striping */
-#define DEV_HAS_MSI                0x00040  /* device supports MSI */
-#define DEV_HAS_MSI_X              0x00080  /* device supports MSI-X */
-#define DEV_HAS_POWER_CNTRL        0x00100  /* device supports power savings */
-#define DEV_HAS_STATISTICS_V1      0x00200  /* device supports hw statistics version 1 */
-#define DEV_HAS_STATISTICS_V2      0x00400  /* device supports hw statistics version 2 */
-#define DEV_HAS_TEST_EXTENDED      0x00800  /* device supports extended diagnostic test */
-#define DEV_HAS_MGMT_UNIT          0x01000  /* device supports management unit */
-#define DEV_HAS_CORRECT_MACADDR    0x02000  /* device supports correct mac address order */
-#define DEV_HAS_COLLISION_FIX      0x04000  /* device supports tx collision fix */
-#define DEV_HAS_PAUSEFRAME_TX_V1   0x08000  /* device supports tx pause frames version 1 */
-#define DEV_HAS_PAUSEFRAME_TX_V2   0x10000  /* device supports tx pause frames version 2 */
-#define DEV_HAS_PAUSEFRAME_TX_V3   0x20000  /* device supports tx pause frames version 3 */
-#define DEV_NEED_TX_LIMIT          0x40000  /* device needs to limit tx */
-#define DEV_HAS_GEAR_MODE          0x80000  /* device supports gear mode */
+#define DEV_NEED_TIMERIRQ          0x000001  /* set the timer irq flag in the irq mask */
+#define DEV_NEED_LINKTIMER         0x000002  /* poll link settings. Relies on the timer irq */
+#define DEV_HAS_LARGEDESC          0x000004  /* device supports jumbo frames and needs packet format 2 */
+#define DEV_HAS_HIGH_DMA           0x000008  /* device supports 64bit dma */
+#define DEV_HAS_CHECKSUM           0x000010  /* device supports tx and rx checksum offloads */
+#define DEV_HAS_VLAN               0x000020  /* device supports vlan tagging and striping */
+#define DEV_HAS_MSI                0x000040  /* device supports MSI */
+#define DEV_HAS_MSI_X              0x000080  /* device supports MSI-X */
+#define DEV_HAS_POWER_CNTRL        0x000100  /* device supports power savings */
+#define DEV_HAS_STATISTICS_V1      0x000200  /* device supports hw statistics version 1 */
+#define DEV_HAS_STATISTICS_V2      0x000400  /* device supports hw statistics version 2 */
+#define DEV_HAS_STATISTICS_V3      0x000800  /* device supports hw statistics version 3 */
+#define DEV_HAS_TEST_EXTENDED      0x001000  /* device supports extended diagnostic test */
+#define DEV_HAS_MGMT_UNIT          0x002000  /* device supports management unit */
+#define DEV_HAS_CORRECT_MACADDR    0x004000  /* device supports correct mac address order */
+#define DEV_HAS_COLLISION_FIX      0x008000  /* device supports tx collision fix */
+#define DEV_HAS_PAUSEFRAME_TX_V1   0x010000  /* device supports tx pause frames version 1 */
+#define DEV_HAS_PAUSEFRAME_TX_V2   0x020000  /* device supports tx pause frames version 2 */
+#define DEV_HAS_PAUSEFRAME_TX_V3   0x040000  /* device supports tx pause frames version 3 */
+#define DEV_NEED_TX_LIMIT          0x080000  /* device needs to limit tx */
+#define DEV_HAS_GEAR_MODE          0x100000  /* device supports gear mode */
 
 enum {
        NvRegIrqStatus = 0x000,
@@ -248,6 +249,8 @@ enum {
 #define NVREG_TX_PAUSEFRAME_ENABLE_V1  0x01800010
 #define NVREG_TX_PAUSEFRAME_ENABLE_V2  0x056003f0
 #define NVREG_TX_PAUSEFRAME_ENABLE_V3  0x09f00880
+       NvRegTxPauseFrameLimit = 0x174,
+#define NVREG_TX_PAUSEFRAMELIMIT_ENABLE        0x00010000
        NvRegMIIStatus = 0x180,
 #define NVREG_MIISTAT_ERROR            0x0001
 #define NVREG_MIISTAT_LINKCHANGE       0x0008
@@ -270,6 +273,9 @@ enum {
 #define NVREG_MIICTL_WRITE     0x00400
 #define NVREG_MIICTL_ADDRSHIFT 5
        NvRegMIIData = 0x194,
+       NvRegTxUnicast = 0x1a0,
+       NvRegTxMulticast = 0x1a4,
+       NvRegTxBroadcast = 0x1a8,
        NvRegWakeUpFlags = 0x200,
 #define NVREG_WAKEUPFLAGS_VAL          0x7770
 #define NVREG_WAKEUPFLAGS_BUSYSHIFT    24
@@ -402,6 +408,7 @@ union ring_type {
 #define NV_RX_FRAMINGERR       (1<<29)
 #define NV_RX_ERROR            (1<<30)
 #define NV_RX_AVAIL            (1<<31)
+#define NV_RX_ERROR_MASK       (NV_RX_ERROR1|NV_RX_ERROR2|NV_RX_ERROR3|NV_RX_ERROR4|NV_RX_CRCERR|NV_RX_OVERFLOW|NV_RX_FRAMINGERR)
 
 #define NV_RX2_CHECKSUMMASK    (0x1C000000)
 #define NV_RX2_CHECKSUM_IP     (0x10000000)
@@ -419,6 +426,7 @@ union ring_type {
 /* error and avail are the same for both */
 #define NV_RX2_ERROR           (1<<30)
 #define NV_RX2_AVAIL           (1<<31)
+#define NV_RX2_ERROR_MASK      (NV_RX2_ERROR1|NV_RX2_ERROR2|NV_RX2_ERROR3|NV_RX2_ERROR4|NV_RX2_CRCERR|NV_RX2_OVERFLOW|NV_RX2_FRAMINGERR)
 
 #define NV_RX3_VLAN_TAG_PRESENT (1<<16)
 #define NV_RX3_VLAN_TAG_MASK   (0x0000FFFF)
@@ -616,7 +624,12 @@ static const struct nv_ethtool_str nv_estats_str[] = {
        { "rx_bytes" },
        { "tx_pause" },
        { "rx_pause" },
-       { "rx_drop_frame" }
+       { "rx_drop_frame" },
+
+       /* version 3 stats */
+       { "tx_unicast" },
+       { "tx_multicast" },
+       { "tx_broadcast" }
 };
 
 struct nv_ethtool_stats {
@@ -652,9 +665,15 @@ struct nv_ethtool_stats {
        u64 tx_pause;
        u64 rx_pause;
        u64 rx_drop_frame;
+
+       /* version 3 stats */
+       u64 tx_unicast;
+       u64 tx_multicast;
+       u64 tx_broadcast;
 };
 
-#define NV_DEV_STATISTICS_V2_COUNT (sizeof(struct nv_ethtool_stats)/sizeof(u64))
+#define NV_DEV_STATISTICS_V3_COUNT (sizeof(struct nv_ethtool_stats)/sizeof(u64))
+#define NV_DEV_STATISTICS_V2_COUNT (NV_DEV_STATISTICS_V3_COUNT - 3)
 #define NV_DEV_STATISTICS_V1_COUNT (NV_DEV_STATISTICS_V2_COUNT - 6)
 
 /* diagnostics */
@@ -1628,6 +1647,12 @@ static void nv_get_hw_stats(struct net_device *dev)
                np->estats.rx_pause += readl(base + NvRegRxPause);
                np->estats.rx_drop_frame += readl(base + NvRegRxDropFrame);
        }
+
+       if (np->driver_data & DEV_HAS_STATISTICS_V3) {
+               np->estats.tx_unicast += readl(base + NvRegTxUnicast);
+               np->estats.tx_multicast += readl(base + NvRegTxMulticast);
+               np->estats.tx_broadcast += readl(base + NvRegTxBroadcast);
+       }
 }
 
 /*
@@ -1641,7 +1666,7 @@ static struct net_device_stats *nv_get_stats(struct net_device *dev)
        struct fe_priv *np = netdev_priv(dev);
 
        /* If the nic supports hw counters then retrieve latest values */
-       if (np->driver_data & (DEV_HAS_STATISTICS_V1|DEV_HAS_STATISTICS_V2)) {
+       if (np->driver_data & (DEV_HAS_STATISTICS_V1|DEV_HAS_STATISTICS_V2|DEV_HAS_STATISTICS_V3)) {
                nv_get_hw_stats(dev);
 
                /* copy to net_device stats */
@@ -2632,7 +2657,7 @@ static int nv_rx_process(struct net_device *dev, int limit)
                        if (likely(flags & NV_RX_DESCRIPTORVALID)) {
                                len = flags & LEN_MASK_V1;
                                if (unlikely(flags & NV_RX_ERROR)) {
-                                       if (flags & NV_RX_ERROR4) {
+                                       if ((flags & NV_RX_ERROR_MASK) == NV_RX_ERROR4) {
                                                len = nv_getlen(dev, skb->data, len);
                                                if (len < 0) {
                                                        dev->stats.rx_errors++;
@@ -2641,7 +2666,7 @@ static int nv_rx_process(struct net_device *dev, int limit)
                                                }
                                        }
                                        /* framing errors are soft errors */
-                                       else if (flags & NV_RX_FRAMINGERR) {
+                                       else if ((flags & NV_RX_ERROR_MASK) == NV_RX_FRAMINGERR) {
                                                if (flags & NV_RX_SUBSTRACT1) {
                                                        len--;
                                                }
@@ -2667,7 +2692,7 @@ static int nv_rx_process(struct net_device *dev, int limit)
                        if (likely(flags & NV_RX2_DESCRIPTORVALID)) {
                                len = flags & LEN_MASK_V2;
                                if (unlikely(flags & NV_RX2_ERROR)) {
-                                       if (flags & NV_RX2_ERROR4) {
+                                       if ((flags & NV_RX2_ERROR_MASK) == NV_RX2_ERROR4) {
                                                len = nv_getlen(dev, skb->data, len);
                                                if (len < 0) {
                                                        dev->stats.rx_errors++;
@@ -2676,7 +2701,7 @@ static int nv_rx_process(struct net_device *dev, int limit)
                                                }
                                        }
                                        /* framing errors are soft errors */
-                                       else if (flags & NV_RX2_FRAMINGERR) {
+                                       else if ((flags & NV_RX2_ERROR_MASK) == NV_RX2_FRAMINGERR) {
                                                if (flags & NV_RX2_SUBSTRACT1) {
                                                        len--;
                                                }
@@ -2766,7 +2791,7 @@ static int nv_rx_process_optimized(struct net_device *dev, int limit)
                if (likely(flags & NV_RX2_DESCRIPTORVALID)) {
                        len = flags & LEN_MASK_V2;
                        if (unlikely(flags & NV_RX2_ERROR)) {
-                               if (flags & NV_RX2_ERROR4) {
+                               if ((flags & NV_RX2_ERROR_MASK) == NV_RX2_ERROR4) {
                                        len = nv_getlen(dev, skb->data, len);
                                        if (len < 0) {
                                                dev_kfree_skb(skb);
@@ -2774,7 +2799,7 @@ static int nv_rx_process_optimized(struct net_device *dev, int limit)
                                        }
                                }
                                /* framing errors are soft errors */
-                               else if (flags & NV_RX2_FRAMINGERR) {
+                               else if ((flags & NV_RX2_ERROR_MASK) == NV_RX2_FRAMINGERR) {
                                        if (flags & NV_RX2_SUBSTRACT1) {
                                                len--;
                                        }
@@ -3053,8 +3078,11 @@ static void nv_update_pause(struct net_device *dev, u32 pause_flags)
                        u32 pause_enable = NVREG_TX_PAUSEFRAME_ENABLE_V1;
                        if (np->driver_data & DEV_HAS_PAUSEFRAME_TX_V2)
                                pause_enable = NVREG_TX_PAUSEFRAME_ENABLE_V2;
-                       if (np->driver_data & DEV_HAS_PAUSEFRAME_TX_V3)
+                       if (np->driver_data & DEV_HAS_PAUSEFRAME_TX_V3) {
                                pause_enable = NVREG_TX_PAUSEFRAME_ENABLE_V3;
+                               /* limit the number of tx pause frames to a default of 8 */
+                               writel(readl(base + NvRegTxPauseFrameLimit)|NVREG_TX_PAUSEFRAMELIMIT_ENABLE, base + NvRegTxPauseFrameLimit);
+                       }
                        writel(pause_enable,  base + NvRegTxPauseFrame);
                        writel(regmisc|NVREG_MISC1_PAUSE_TX, base + NvRegMisc1);
                        np->pause_flags |= NV_PAUSEFRAME_TX_ENABLE;
@@ -4740,6 +4768,8 @@ static int nv_get_sset_count(struct net_device *dev, int sset)
                        return NV_DEV_STATISTICS_V1_COUNT;
                else if (np->driver_data & DEV_HAS_STATISTICS_V2)
                        return NV_DEV_STATISTICS_V2_COUNT;
+               else if (np->driver_data & DEV_HAS_STATISTICS_V3)
+                       return NV_DEV_STATISTICS_V3_COUNT;
                else
                        return 0;
        default:
@@ -5324,7 +5354,7 @@ static int nv_open(struct net_device *dev)
                mod_timer(&np->oom_kick, jiffies + OOM_REFILL);
 
        /* start statistics timer */
-       if (np->driver_data & (DEV_HAS_STATISTICS_V1|DEV_HAS_STATISTICS_V2))
+       if (np->driver_data & (DEV_HAS_STATISTICS_V1|DEV_HAS_STATISTICS_V2|DEV_HAS_STATISTICS_V3))
                mod_timer(&np->stats_poll,
                        round_jiffies(jiffies + STATS_INTERVAL));
 
@@ -5428,7 +5458,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
        if (err < 0)
                goto out_disable;
 
-       if (id->driver_data & (DEV_HAS_VLAN|DEV_HAS_MSI_X|DEV_HAS_POWER_CNTRL|DEV_HAS_STATISTICS_V2))
+       if (id->driver_data & (DEV_HAS_VLAN|DEV_HAS_MSI_X|DEV_HAS_POWER_CNTRL|DEV_HAS_STATISTICS_V2|DEV_HAS_STATISTICS_V3))
                np->register_size = NV_PCI_REGSZ_VER3;
        else if (id->driver_data & DEV_HAS_STATISTICS_V1)
                np->register_size = NV_PCI_REGSZ_VER2;
@@ -6083,35 +6113,35 @@ static struct pci_device_id pci_tbl[] = {
        },
        {       /* MCP77 Ethernet Controller */
                PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_32),
-               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V2|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE,
+               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V2|DEV_HAS_STATISTICS_V3|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE,
        },
        {       /* MCP77 Ethernet Controller */
                PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_33),
-               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V2|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE,
+               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V2|DEV_HAS_STATISTICS_V3|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE,
        },
        {       /* MCP77 Ethernet Controller */
                PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_34),
-               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V2|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE,
+               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V2|DEV_HAS_STATISTICS_V3|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE,
        },
        {       /* MCP77 Ethernet Controller */
                PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_35),
-               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V2|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE,
+               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V2|DEV_HAS_STATISTICS_V3|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE,
        },
        {       /* MCP79 Ethernet Controller */
                PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_36),
-               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE,
+               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V3|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE,
        },
        {       /* MCP79 Ethernet Controller */
                PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_37),
-               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE,
+               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V3|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE,
        },
        {       /* MCP79 Ethernet Controller */
                PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_38),
-               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE,
+               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V3|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE,
        },
        {       /* MCP79 Ethernet Controller */
                PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_39),
-               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE,
+               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V3|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE,
        },
        {0,},
 };
index 0a97fc2..1c7ef81 100644 (file)
@@ -126,7 +126,7 @@ out:
 #define FCC_NAPI_RX_EVENT_MSK  (FCC_ENET_RXF | FCC_ENET_RXB)
 #define FCC_RX_EVENT           (FCC_ENET_RXF)
 #define FCC_TX_EVENT           (FCC_ENET_TXB)
-#define FCC_ERR_EVENT_MSK      (FCC_ENET_TXE | FCC_ENET_BSY)
+#define FCC_ERR_EVENT_MSK      (FCC_ENET_TXE)
 
 static int setup_data(struct net_device *dev)
 {
index b8394cf..ca6cf6e 100644 (file)
@@ -414,9 +414,7 @@ static int gfar_suspend(struct platform_device *pdev, pm_message_t state)
                spin_unlock(&priv->rxlock);
                spin_unlock_irqrestore(&priv->txlock, flags);
 
-#ifdef CONFIG_GFAR_NAPI
                napi_disable(&priv->napi);
-#endif
 
                if (magic_packet) {
                        /* Enable interrupt on Magic Packet */
@@ -469,9 +467,7 @@ static int gfar_resume(struct platform_device *pdev)
 
        netif_device_attach(dev);
 
-#ifdef CONFIG_GFAR_NAPI
        napi_enable(&priv->napi);
-#endif
 
        return 0;
 }
index 3249df5..b8e25c4 100644 (file)
@@ -548,7 +548,7 @@ static int ax_xmit(struct sk_buff *skb, struct net_device *dev)
                }
 
                printk(KERN_ERR "mkiss: %s: transmit timed out, %s?\n", dev->name,
-                      (ax->tty->ops->chars_in_buffer(ax->tty) || ax->xleft) ?
+                      (tty_chars_in_buffer(ax->tty) || ax->xleft) ?
                       "bad line quality" : "driver error");
 
                ax->xleft = 0;
index e098f23..bb823ac 100644 (file)
@@ -850,7 +850,7 @@ void igb_update_mc_addr_list_82575(struct e1000_hw *hw,
        for (; mc_addr_count > 0; mc_addr_count--) {
                hash_value = igb_hash_mc_addr(hw, mc_addr_list);
                hw_dbg("Hash value = 0x%03X\n", hash_value);
-               hw->mac.ops.mta_set(hw, hash_value);
+               igb_mta_set(hw, hash_value);
                mc_addr_list += ETH_ALEN;
        }
 }
@@ -1136,6 +1136,12 @@ static s32 igb_setup_fiber_serdes_link_82575(struct e1000_hw *hw)
                       E1000_PCS_LCTL_FORCE_LINK;     /* Force Link */
                hw_dbg("Configuring Forced Link; PCS_LCTL = 0x%08X\n", reg);
        }
+
+       if (hw->mac.type == e1000_82576) {
+               reg |= E1000_PCS_LCTL_FORCE_FCTRL;
+               igb_force_mac_fc(hw);
+       }
+
        wr32(E1000_PCS_LCTL, reg);
 
        return 0;
@@ -1232,70 +1238,6 @@ out:
 }
 
 /**
- *  igb_translate_register_82576 - Translate the proper register offset
- *  @reg: e1000 register to be read
- *
- *  Registers in 82576 are located in different offsets than other adapters
- *  even though they function in the same manner.  This function takes in
- *  the name of the register to read and returns the correct offset for
- *  82576 silicon.
- **/
-u32 igb_translate_register_82576(u32 reg)
-{
-       /*
-        * Some of the Kawela registers are located at different
-        * offsets than they are in older adapters.
-        * Despite the difference in location, the registers
-        * function in the same manner.
-        */
-       switch (reg) {
-       case E1000_TDBAL(0):
-               reg = 0x0E000;
-               break;
-       case E1000_TDBAH(0):
-               reg = 0x0E004;
-               break;
-       case E1000_TDLEN(0):
-               reg = 0x0E008;
-               break;
-       case E1000_TDH(0):
-               reg = 0x0E010;
-               break;
-       case E1000_TDT(0):
-               reg = 0x0E018;
-               break;
-       case E1000_TXDCTL(0):
-               reg = 0x0E028;
-               break;
-       case E1000_RDBAL(0):
-               reg = 0x0C000;
-               break;
-       case E1000_RDBAH(0):
-               reg = 0x0C004;
-               break;
-       case E1000_RDLEN(0):
-               reg = 0x0C008;
-               break;
-       case E1000_RDH(0):
-               reg = 0x0C010;
-               break;
-       case E1000_RDT(0):
-               reg = 0x0C018;
-               break;
-       case E1000_RXDCTL(0):
-               reg = 0x0C028;
-               break;
-       case E1000_SRRCTL(0):
-               reg = 0x0C00C;
-               break;
-       default:
-               break;
-       }
-
-       return reg;
-}
-
-/**
  *  igb_reset_init_script_82575 - Inits HW defaults after reset
  *  @hw: pointer to the HW structure
  *
index 2f848e5..c1928b5 100644 (file)
@@ -28,7 +28,6 @@
 #ifndef _E1000_82575_H_
 #define _E1000_82575_H_
 
-u32 igb_translate_register_82576(u32 reg);
 void igb_update_mc_addr_list_82575(struct e1000_hw*, u8*, u32, u32, u32);
 extern void igb_shutdown_fiber_serdes_link_82575(struct e1000_hw *hw);
 extern void igb_rx_fifo_flush_82575(struct e1000_hw *hw);
index afdba3c..ce70068 100644 (file)
 #define E1000_PCS_LCTL_FDV_FULL          8
 #define E1000_PCS_LCTL_FSD               0x10
 #define E1000_PCS_LCTL_FORCE_LINK        0x20
+#define E1000_PCS_LCTL_FORCE_FCTRL       0x80
 #define E1000_PCS_LCTL_AN_ENABLE         0x10000
 #define E1000_PCS_LCTL_AN_RESTART        0x20000
 #define E1000_PCS_LCTL_AN_TIMEOUT        0x40000
index 19fa4ee..a65ccc3 100644 (file)
@@ -420,7 +420,6 @@ struct e1000_mac_operations {
        void (*rar_set)(struct e1000_hw *, u8 *, u32);
        s32  (*read_mac_addr)(struct e1000_hw *);
        s32  (*get_speed_and_duplex)(struct e1000_hw *, u16 *, u16 *);
-       void (*mta_set)(struct e1000_hw *, u32);
 };
 
 struct e1000_phy_operations {
index 20408aa..e18747c 100644 (file)
@@ -144,34 +144,6 @@ void igb_write_vfta(struct e1000_hw *hw, u32 offset, u32 value)
 }
 
 /**
- *  igb_init_rx_addrs - Initialize receive address's
- *  @hw: pointer to the HW structure
- *  @rar_count: receive address registers
- *
- *  Setups the receive address registers by setting the base receive address
- *  register to the devices MAC address and clearing all the other receive
- *  address registers to 0.
- **/
-void igb_init_rx_addrs(struct e1000_hw *hw, u16 rar_count)
-{
-       u32 i;
-
-       /* Setup the receive address */
-       hw_dbg("Programming MAC Address into RAR[0]\n");
-
-       hw->mac.ops.rar_set(hw, hw->mac.addr, 0);
-
-       /* Zero out the other (rar_entry_count - 1) receive addresses */
-       hw_dbg("Clearing RAR[1-%u]\n", rar_count-1);
-       for (i = 1; i < rar_count; i++) {
-               array_wr32(E1000_RA, (i << 1), 0);
-               wrfl();
-               array_wr32(E1000_RA, ((i << 1) + 1), 0);
-               wrfl();
-       }
-}
-
-/**
  *  igb_check_alt_mac_addr - Check for alternate MAC addr
  *  @hw: pointer to the HW structure
  *
@@ -271,7 +243,7 @@ void igb_rar_set(struct e1000_hw *hw, u8 *addr, u32 index)
  *  current value is read, the new bit is OR'd in and the new value is
  *  written back into the register.
  **/
-static void igb_mta_set(struct e1000_hw *hw, u32 hash_value)
+void igb_mta_set(struct e1000_hw *hw, u32 hash_value)
 {
        u32 hash_bit, hash_reg, mta;
 
@@ -297,60 +269,6 @@ static void igb_mta_set(struct e1000_hw *hw, u32 hash_value)
 }
 
 /**
- *  igb_update_mc_addr_list - Update Multicast addresses
- *  @hw: pointer to the HW structure
- *  @mc_addr_list: array of multicast addresses to program
- *  @mc_addr_count: number of multicast addresses to program
- *  @rar_used_count: the first RAR register free to program
- *  @rar_count: total number of supported Receive Address Registers
- *
- *  Updates the Receive Address Registers and Multicast Table Array.
- *  The caller must have a packed mc_addr_list of multicast addresses.
- *  The parameter rar_count will usually be hw->mac.rar_entry_count
- *  unless there are workarounds that change this.
- **/
-void igb_update_mc_addr_list(struct e1000_hw *hw,
-                              u8 *mc_addr_list, u32 mc_addr_count,
-                              u32 rar_used_count, u32 rar_count)
-{
-       u32 hash_value;
-       u32 i;
-
-       /*
-        * Load the first set of multicast addresses into the exact
-        * filters (RAR).  If there are not enough to fill the RAR
-        * array, clear the filters.
-        */
-       for (i = rar_used_count; i < rar_count; i++) {
-               if (mc_addr_count) {
-                       hw->mac.ops.rar_set(hw, mc_addr_list, i);
-                       mc_addr_count--;
-                       mc_addr_list += ETH_ALEN;
-               } else {
-                       array_wr32(E1000_RA, i << 1, 0);
-                       wrfl();
-                       array_wr32(E1000_RA, (i << 1) + 1, 0);
-                       wrfl();
-               }
-       }
-
-       /* Clear the old settings from the MTA */
-       hw_dbg("Clearing MTA\n");
-       for (i = 0; i < hw->mac.mta_reg_count; i++) {
-               array_wr32(E1000_MTA, i, 0);
-               wrfl();
-       }
-
-       /* Load any remaining multicast addresses into the hash table. */
-       for (; mc_addr_count > 0; mc_addr_count--) {
-               hash_value = igb_hash_mc_addr(hw, mc_addr_list);
-               hw_dbg("Hash value = 0x%03X\n", hash_value);
-               igb_mta_set(hw, hash_value);
-               mc_addr_list += ETH_ALEN;
-       }
-}
-
-/**
  *  igb_hash_mc_addr - Generate a multicast hash value
  *  @hw: pointer to the HW structure
  *  @mc_addr: pointer to a multicast address
index dc2f8cc..cbee6af 100644 (file)
@@ -51,9 +51,6 @@ s32  igb_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed,
                                       u16 *duplex);
 s32  igb_id_led_init(struct e1000_hw *hw);
 s32  igb_led_off(struct e1000_hw *hw);
-void igb_update_mc_addr_list(struct e1000_hw *hw,
-                              u8 *mc_addr_list, u32 mc_addr_count,
-                              u32 rar_used_count, u32 rar_count);
 s32  igb_setup_link(struct e1000_hw *hw);
 s32  igb_validate_mdi_setting(struct e1000_hw *hw);
 s32  igb_write_8bit_ctrl_reg(struct e1000_hw *hw, u32 reg,
@@ -62,7 +59,7 @@ s32  igb_write_8bit_ctrl_reg(struct e1000_hw *hw, u32 reg,
 void igb_clear_hw_cntrs_base(struct e1000_hw *hw);
 void igb_clear_vfta(struct e1000_hw *hw);
 void igb_config_collision_dist(struct e1000_hw *hw);
-void igb_init_rx_addrs(struct e1000_hw *hw, u16 rar_count);
+void igb_mta_set(struct e1000_hw *hw, u32 hash_value);
 void igb_put_hw_semaphore(struct e1000_hw *hw);
 void igb_rar_set(struct e1000_hw *hw, u8 *addr, u32 index);
 s32  igb_check_alt_mac_addr(struct e1000_hw *hw);
index b95093d..95523af 100644 (file)
 #define E1000_RETA(_i)  (0x05C00 + ((_i) * 4))
 #define E1000_RSSRK(_i) (0x05C80 + ((_i) * 4)) /* RSS Random Key - RW Array */
 
-#define E1000_REGISTER(a, reg) (((a)->mac.type < e1000_82576) \
-                               ? reg : e1000_translate_register_82576(reg))
-
 #define wr32(reg, value) (writel(value, hw->hw_addr + reg))
 #define rd32(reg) (readl(hw->hw_addr + reg))
 #define wrfl() ((void)rd32(E1000_STATUS))
index b602c4d..8f66e15 100644 (file)
@@ -311,7 +311,7 @@ static void igb_assign_vector(struct igb_adapter *adapter, int rx_queue,
                array_wr32(E1000_MSIXBM(0), msix_vector, msixbm);
                break;
        case e1000_82576:
-               /* Kawela uses a table-based method for assigning vectors.
+               /* The 82576 uses a table-based method for assigning vectors.
                   Each queue has a single entry in the table to which we write
                   a vector number along with a "valid" bit.  Sadly, the layout
                   of the table is somewhat counterintuitive. */
@@ -720,28 +720,6 @@ static void igb_get_hw_control(struct igb_adapter *adapter)
                        ctrl_ext | E1000_CTRL_EXT_DRV_LOAD);
 }
 
-static void igb_init_manageability(struct igb_adapter *adapter)
-{
-       struct e1000_hw *hw = &adapter->hw;
-
-       if (adapter->en_mng_pt) {
-               u32 manc2h = rd32(E1000_MANC2H);
-               u32 manc = rd32(E1000_MANC);
-
-               /* enable receiving management packets to the host */
-               /* this will probably generate destination unreachable messages
-                * from the host OS, but the packets will be handled on SMBUS */
-               manc |= E1000_MANC_EN_MNG2HOST;
-#define E1000_MNG2HOST_PORT_623 (1 << 5)
-#define E1000_MNG2HOST_PORT_664 (1 << 6)
-               manc2h |= E1000_MNG2HOST_PORT_623;
-               manc2h |= E1000_MNG2HOST_PORT_664;
-               wr32(E1000_MANC2H, manc2h);
-
-               wr32(E1000_MANC, manc);
-       }
-}
-
 /**
  * igb_configure - configure the hardware for RX and TX
  * @adapter: private board structure
@@ -755,7 +733,6 @@ static void igb_configure(struct igb_adapter *adapter)
        igb_set_multi(netdev);
 
        igb_restore_vlan(adapter);
-       igb_init_manageability(adapter);
 
        igb_configure_tx(adapter);
        igb_setup_rctl(adapter);
@@ -1372,7 +1349,8 @@ static void __devexit igb_remove(struct pci_dev *pdev)
 
        unregister_netdev(netdev);
 
-       if (!igb_check_reset_block(&adapter->hw))
+       if (adapter->hw.phy.ops.reset_phy &&
+           !igb_check_reset_block(&adapter->hw))
                adapter->hw.phy.ops.reset_phy(&adapter->hw);
 
        igb_remove_device(&adapter->hw);
@@ -4523,8 +4501,6 @@ static void igb_io_resume(struct pci_dev *pdev)
        struct net_device *netdev = pci_get_drvdata(pdev);
        struct igb_adapter *adapter = netdev_priv(netdev);
 
-       igb_init_manageability(adapter);
-
        if (netif_running(netdev)) {
                if (igb_up(adapter)) {
                        dev_err(&pdev->dev, "igb_up failed after reset\n");
index 591a7e4..83fa9d8 100644 (file)
@@ -1272,8 +1272,6 @@ static void set_multicast_list(struct net_device *dev) {
                        return;
                }
                if (dev->mc_count == 0 && !(dev->flags & (IFF_PROMISC | IFF_ALLMULTI))) {
-                       if (dev->flags & IFF_ALLMULTI)
-                               dev->flags |= IFF_PROMISC;
                        lp->i596_config[8] &= ~0x01;
                } else {
                        lp->i596_config[8] |= 0x01;
index 4cb364e..0a97c26 100644 (file)
@@ -100,7 +100,7 @@ static inline void load_eaddr(struct net_device *dev)
        DPRINTK("Loading MAC Address: %s\n", print_mac(mac, dev->dev_addr));
        macaddr = 0;
        for (i = 0; i < 6; i++)
-               macaddr |= dev->dev_addr[i] << ((5 - i) * 8);
+               macaddr |= (u64)dev->dev_addr[i] << ((5 - i) * 8);
 
        mace->eth.mac_addr = macaddr;
 }
index 3ab0e52..f1de38f 100644 (file)
@@ -3699,6 +3699,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                dev_err(&pdev->dev, "Error %d setting DMA mask\n", status);
                goto abort_with_netdev;
        }
+       (void)pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK);
        mgp->cmd = dma_alloc_coherent(&pdev->dev, sizeof(*mgp->cmd),
                                      &mgp->cmd_bus, GFP_KERNEL);
        if (mgp->cmd == NULL)
index fdbeeee..9937210 100644 (file)
@@ -101,6 +101,8 @@ struct mcp_kreq_ether_recv {
 #define        MXGEFW_ETH_SEND_3       0x2c0000
 #define        MXGEFW_ETH_RECV_SMALL   0x300000
 #define        MXGEFW_ETH_RECV_BIG     0x340000
+#define        MXGEFW_ETH_SEND_GO      0x380000
+#define        MXGEFW_ETH_SEND_STOP    0x3C0000
 
 #define        MXGEFW_ETH_SEND(n)              (0x200000 + (((n) & 0x03) * 0x40000))
 #define        MXGEFW_ETH_SEND_OFFSET(n)       (MXGEFW_ETH_SEND(n) - MXGEFW_ETH_SEND_4)
@@ -120,6 +122,11 @@ enum myri10ge_mcp_cmd_type {
         * MXGEFW_CMD_RESET is issued */
 
        MXGEFW_CMD_SET_INTRQ_DMA,
+       /* data0 = LSW of the host address
+        * data1 = MSW of the host address
+        * data2 = slice number if multiple slices are used
+        */
+
        MXGEFW_CMD_SET_BIG_BUFFER_SIZE, /* in bytes, power of 2 */
        MXGEFW_CMD_SET_SMALL_BUFFER_SIZE,       /* in bytes */
 
@@ -129,6 +136,8 @@ enum myri10ge_mcp_cmd_type {
        MXGEFW_CMD_GET_SEND_OFFSET,
        MXGEFW_CMD_GET_SMALL_RX_OFFSET,
        MXGEFW_CMD_GET_BIG_RX_OFFSET,
+       /* data0 = slice number if multiple slices are used */
+
        MXGEFW_CMD_GET_IRQ_ACK_OFFSET,
        MXGEFW_CMD_GET_IRQ_DEASSERT_OFFSET,
 
@@ -200,7 +209,12 @@ enum myri10ge_mcp_cmd_type {
        MXGEFW_CMD_SET_STATS_DMA_V2,
        /* data0, data1 = bus addr,
         * data2 = sizeof(struct mcp_irq_data) from driver point of view, allows
-        * adding new stuff to mcp_irq_data without changing the ABI */
+        * adding new stuff to mcp_irq_data without changing the ABI
+        *
+        * If multiple slices are used, data2 contains both the size of the
+        * structure (in the lower 16 bits) and the slice number
+        * (in the upper 16 bits).
+        */
 
        MXGEFW_CMD_UNALIGNED_TEST,
        /* same than DMA_TEST (same args) but abort with UNALIGNED on unaligned
@@ -222,13 +236,18 @@ enum myri10ge_mcp_cmd_type {
        MXGEFW_CMD_GET_MAX_RSS_QUEUES,
        MXGEFW_CMD_ENABLE_RSS_QUEUES,
        /* data0 = number of slices n (0, 1, ..., n-1) to enable
-        * data1 = interrupt mode.
-        * 0=share one INTx/MSI, 1=use one MSI-X per queue.
+        * data1 = interrupt mode | use of multiple transmit queues.
+        * 0=share one INTx/MSI.
+        * 1=use one MSI-X per queue.
         * If all queues share one interrupt, the driver must have set
         * RSS_SHARED_INTERRUPT_DMA before enabling queues.
+        * 2=enable both receive and send queues.
+        * Without this bit set, only one send queue (slice 0's send queue)
+        * is enabled.  The receive queues are always enabled.
         */
-#define MXGEFW_SLICE_INTR_MODE_SHARED 0
-#define MXGEFW_SLICE_INTR_MODE_ONE_PER_SLICE 1
+#define MXGEFW_SLICE_INTR_MODE_SHARED          0x0
+#define MXGEFW_SLICE_INTR_MODE_ONE_PER_SLICE   0x1
+#define MXGEFW_SLICE_ENABLE_MULTIPLE_TX_QUEUES 0x2
 
        MXGEFW_CMD_GET_RSS_SHARED_INTERRUPT_MASK_OFFSET,
        MXGEFW_CMD_SET_RSS_SHARED_INTERRUPT_DMA,
@@ -250,10 +269,13 @@ enum myri10ge_mcp_cmd_type {
         * 2: TCP_IPV4        (required by RSS)
         * 3: IPV4 | TCP_IPV4 (required by RSS)
         * 4: source port
+        * 5: source port + destination port
         */
 #define MXGEFW_RSS_HASH_TYPE_IPV4      0x1
 #define MXGEFW_RSS_HASH_TYPE_TCP_IPV4  0x2
 #define MXGEFW_RSS_HASH_TYPE_SRC_PORT  0x4
+#define MXGEFW_RSS_HASH_TYPE_SRC_DST_PORT 0x5
+#define MXGEFW_RSS_HASH_TYPE_MAX 0x5
 
        MXGEFW_CMD_GET_MAX_TSO6_HDR_SIZE,
        /* Return data = the max. size of the entire headers of a IPv6 TSO packet.
@@ -329,6 +351,20 @@ enum myri10ge_mcp_cmd_type {
 
        MXGEFW_CMD_GET_DCA_OFFSET,
        /* offset of dca control for WDMAs */
+
+       /* VMWare NetQueue commands */
+       MXGEFW_CMD_NETQ_GET_FILTERS_PER_QUEUE,
+       MXGEFW_CMD_NETQ_ADD_FILTER,
+       /* data0 = filter_id << 16 | queue << 8 | type */
+       /* data1 = MS4 of MAC Addr */
+       /* data2 = LS2_MAC << 16 | VLAN_tag */
+       MXGEFW_CMD_NETQ_DEL_FILTER,
+       /* data0 = filter_id */
+       MXGEFW_CMD_NETQ_QUERY1,
+       MXGEFW_CMD_NETQ_QUERY2,
+       MXGEFW_CMD_NETQ_QUERY3,
+       MXGEFW_CMD_NETQ_QUERY4,
+
 };
 
 enum myri10ge_mcp_cmd_status {
@@ -381,4 +417,10 @@ struct mcp_irq_data {
        u8 valid;
 };
 
+/* definitions for NETQ filter type */
+#define MXGEFW_NETQ_FILTERTYPE_NONE 0
+#define MXGEFW_NETQ_FILTERTYPE_MACADDR 1
+#define MXGEFW_NETQ_FILTERTYPE_VLAN 2
+#define MXGEFW_NETQ_FILTERTYPE_VLANMACADDR 3
+
 #endif                         /* __MYRI10GE_MCP_H__ */
index 07d65c2..a8662ea 100644 (file)
@@ -35,7 +35,7 @@ struct mcp_gen_header {
        unsigned char mcp_index;
        unsigned char disable_rabbit;
        unsigned char unaligned_tlp;
-       unsigned char pad1;
+       unsigned char pcie_link_algo;
        unsigned counters_addr;
        unsigned copy_block_info;       /* for small mcps loaded with "lload -d" */
        unsigned short handoff_id_major;        /* must be equal */
index 8e73661..93a7b9b 100644 (file)
@@ -508,6 +508,8 @@ typedef enum {
        NETXEN_BRDTYPE_P3_10000_BASE_T = 0x0027,
        NETXEN_BRDTYPE_P3_XG_LOM = 0x0028,
        NETXEN_BRDTYPE_P3_4_GB_MM = 0x0029,
+       NETXEN_BRDTYPE_P3_10G_SFP_CT = 0x002a,
+       NETXEN_BRDTYPE_P3_10G_SFP_QT = 0x002b,
        NETXEN_BRDTYPE_P3_10G_CX4 = 0x0031,
        NETXEN_BRDTYPE_P3_10G_XFP = 0x0032
 
@@ -1170,6 +1172,36 @@ typedef struct {
        nx_nic_intr_coalesce_data_t     irq;
 } nx_nic_intr_coalesce_t;
 
+#define NX_HOST_REQUEST                0x13
+#define NX_NIC_REQUEST         0x14
+
+#define NX_MAC_EVENT           0x1
+
+enum {
+       NX_NIC_H2C_OPCODE_START = 0,
+       NX_NIC_H2C_OPCODE_CONFIG_RSS,
+       NX_NIC_H2C_OPCODE_CONFIG_RSS_TBL,
+       NX_NIC_H2C_OPCODE_CONFIG_INTR_COALESCE,
+       NX_NIC_H2C_OPCODE_CONFIG_LED,
+       NX_NIC_H2C_OPCODE_CONFIG_PROMISCUOUS,
+       NX_NIC_H2C_OPCODE_CONFIG_L2_MAC,
+       NX_NIC_H2C_OPCODE_LRO_REQUEST,
+       NX_NIC_H2C_OPCODE_GET_SNMP_STATS,
+       NX_NIC_H2C_OPCODE_PROXY_START_REQUEST,
+       NX_NIC_H2C_OPCODE_PROXY_STOP_REQUEST,
+       NX_NIC_H2C_OPCODE_PROXY_SET_MTU,
+       NX_NIC_H2C_OPCODE_PROXY_SET_VPORT_MISS_MODE,
+       NX_H2P_OPCODE_GET_FINGER_PRINT_REQUEST,
+       NX_H2P_OPCODE_INSTALL_LICENSE_REQUEST,
+       NX_H2P_OPCODE_GET_LICENSE_CAPABILITY_REQUEST,
+       NX_NIC_H2C_OPCODE_GET_NET_STATS,
+       NX_NIC_H2C_OPCODE_LAST
+};
+
+#define VPORT_MISS_MODE_DROP           0 /* drop all unmatched */
+#define VPORT_MISS_MODE_ACCEPT_ALL     1 /* accept all packets */
+#define VPORT_MISS_MODE_ACCEPT_MULTI   2 /* accept unmatched multicast */
+
 typedef struct {
        u64 qhdr;
        u64 req_hdr;
@@ -1288,7 +1320,7 @@ struct netxen_adapter {
        int (*disable_phy_interrupts) (struct netxen_adapter *);
        int (*macaddr_set) (struct netxen_adapter *, netxen_ethernet_macaddr_t);
        int (*set_mtu) (struct netxen_adapter *, int);
-       int (*set_promisc) (struct netxen_adapter *, netxen_niu_prom_mode_t);
+       int (*set_promisc) (struct netxen_adapter *, u32);
        int (*phy_read) (struct netxen_adapter *, long reg, u32 *);
        int (*phy_write) (struct netxen_adapter *, long reg, u32 val);
        int (*init_port) (struct netxen_adapter *, int);
@@ -1465,9 +1497,10 @@ int netxen_process_cmd_ring(struct netxen_adapter *adapter);
 u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctx, int max);
 void netxen_p2_nic_set_multi(struct net_device *netdev);
 void netxen_p3_nic_set_multi(struct net_device *netdev);
+int netxen_p3_nic_set_promisc(struct netxen_adapter *adapter, u32);
 int netxen_config_intr_coalesce(struct netxen_adapter *adapter);
 
-u32 nx_fw_cmd_set_mtu(struct netxen_adapter *adapter, u32 mtu);
+int nx_fw_cmd_set_mtu(struct netxen_adapter *adapter, int mtu);
 int netxen_nic_change_mtu(struct net_device *netdev, int new_mtu);
 
 int netxen_nic_set_mac(struct net_device *netdev, void *p);
@@ -1502,7 +1535,9 @@ static const struct netxen_brdinfo netxen_boards[] = {
        {NETXEN_BRDTYPE_P3_10G_SFP_PLUS, 2, "Dual XGb SFP+ LP"},
        {NETXEN_BRDTYPE_P3_10000_BASE_T, 1, "XGB 10G BaseT LP"},
        {NETXEN_BRDTYPE_P3_XG_LOM,  2, "Dual XGb LOM"},
-       {NETXEN_BRDTYPE_P3_4_GB_MM, 4, "Quad GB - March Madness"},
+       {NETXEN_BRDTYPE_P3_4_GB_MM, 4, "NX3031 Gigabit Ethernet"},
+       {NETXEN_BRDTYPE_P3_10G_SFP_CT, 2, "NX3031 10 Gigabit Ethernet"},
+       {NETXEN_BRDTYPE_P3_10G_SFP_QT, 2, "Quanta Dual XGb SFP+"},
        {NETXEN_BRDTYPE_P3_10G_CX4, 2, "Reference Dual CX4 Option"},
        {NETXEN_BRDTYPE_P3_10G_XFP, 1, "Reference Single XFP Option"}
 };
index 64babc5..64b5164 100644 (file)
@@ -145,8 +145,8 @@ netxen_issue_cmd(struct netxen_adapter *adapter,
        return rcode;
 }
 
-u32
-nx_fw_cmd_set_mtu(struct netxen_adapter *adapter, u32 mtu)
+int
+nx_fw_cmd_set_mtu(struct netxen_adapter *adapter, int mtu)
 {
        u32 rcode = NX_RCODE_SUCCESS;
        struct netxen_recv_context *recv_ctx = &adapter->recv_ctx[0];
@@ -160,7 +160,10 @@ nx_fw_cmd_set_mtu(struct netxen_adapter *adapter, u32 mtu)
                                0,
                                NX_CDRP_CMD_SET_MTU);
 
-       return rcode;
+       if (rcode != NX_RCODE_SUCCESS)
+               return -EIO;
+
+       return 0;
 }
 
 static int
index 48ee06b..4ad3e08 100644 (file)
@@ -140,18 +140,33 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
                if (netif_running(dev)) {
                        ecmd->speed = adapter->link_speed;
                        ecmd->duplex = adapter->link_duplex;
-               } else
-                       return -EIO;    /* link absent */
+                       ecmd->autoneg = adapter->link_autoneg;
+               }
+
        } else if (adapter->ahw.board_type == NETXEN_NIC_XGBE) {
-               ecmd->supported = (SUPPORTED_TP |
-                                  SUPPORTED_1000baseT_Full |
-                                  SUPPORTED_10000baseT_Full);
-               ecmd->advertising = (ADVERTISED_TP |
-                                    ADVERTISED_1000baseT_Full |
-                                    ADVERTISED_10000baseT_Full);
+               u32 val;
+
+               adapter->hw_read_wx(adapter, NETXEN_PORT_MODE_ADDR, &val, 4);
+               if (val == NETXEN_PORT_MODE_802_3_AP) {
+                       ecmd->supported = SUPPORTED_1000baseT_Full;
+                       ecmd->advertising = ADVERTISED_1000baseT_Full;
+               } else {
+                       ecmd->supported = SUPPORTED_10000baseT_Full;
+                       ecmd->advertising = ADVERTISED_10000baseT_Full;
+               }
+
                ecmd->port = PORT_TP;
 
-               ecmd->speed = SPEED_10000;
+               if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) {
+                       u16 pcifn = adapter->ahw.pci_func;
+
+                       adapter->hw_read_wx(adapter,
+                               P3_LINK_SPEED_REG(pcifn), &val, 4);
+                       ecmd->speed = P3_LINK_SPEED_MHZ *
+                                       P3_LINK_SPEED_VAL(pcifn, val);
+               } else
+                       ecmd->speed = SPEED_10000;
+
                ecmd->duplex = DUPLEX_FULL;
                ecmd->autoneg = AUTONEG_DISABLE;
        } else
@@ -192,6 +207,8 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
                break;
        case NETXEN_BRDTYPE_P2_SB31_10G:
        case NETXEN_BRDTYPE_P3_10G_SFP_PLUS:
+       case NETXEN_BRDTYPE_P3_10G_SFP_CT:
+       case NETXEN_BRDTYPE_P3_10G_SFP_QT:
        case NETXEN_BRDTYPE_P3_10G_XFP:
                ecmd->supported |= SUPPORTED_FIBRE;
                ecmd->advertising |= ADVERTISED_FIBRE;
index 3ce13e4..e8e8d73 100644 (file)
@@ -724,6 +724,13 @@ enum {
 #define XG_LINK_STATE_P3(pcifn,val) \
        (((val) >> ((pcifn) * 4)) & XG_LINK_STATE_P3_MASK)
 
+#define P3_LINK_SPEED_MHZ      100
+#define P3_LINK_SPEED_MASK     0xff
+#define P3_LINK_SPEED_REG(pcifn)       \
+       (CRB_PF_LINK_SPEED_1 + (((pcifn) / 4) * 4))
+#define P3_LINK_SPEED_VAL(pcifn, reg)  \
+       (((reg) >> (8 * ((pcifn) & 0x3))) & P3_LINK_SPEED_MASK)
+
 #define NETXEN_CAM_RAM_BASE    (NETXEN_CRB_CAM + 0x02000)
 #define NETXEN_CAM_RAM(reg)    (NETXEN_CAM_RAM_BASE + (reg))
 #define NETXEN_FW_VERSION_MAJOR (NETXEN_CAM_RAM(0x150))
@@ -836,9 +843,11 @@ enum {
 
 #define PCIE_SETUP_FUNCTION    (0x12040)
 #define PCIE_SETUP_FUNCTION2   (0x12048)
+#define PCIE_MISCCFG_RC         (0x1206c)
 #define PCIE_TGT_SPLIT_CHICKEN (0x12080)
 #define PCIE_CHICKEN3          (0x120c8)
 
+#define ISR_INT_STATE_REG       (NETXEN_PCIX_PS_REG(PCIE_MISCCFG_RC))
 #define PCIE_MAX_MASTER_SPLIT  (0x14048)
 
 #define NETXEN_PORT_MODE_NONE          0
@@ -854,6 +863,7 @@ enum {
 #define NETXEN_CAM_RAM_DMA_WATCHDOG_CTRL               (0x14)
 
 #define        ISR_MSI_INT_TRIGGER(FUNC) (NETXEN_PCIX_PS_REG(PCIX_MSI_F(FUNC)))
+#define ISR_LEGACY_INT_TRIGGERED(VAL)  (((VAL) & 0x300) == 0x200)
 
 /*
  * PCI Interrupt Vector Values.
index 96a3bc6..9aa20f9 100644 (file)
@@ -285,14 +285,7 @@ static unsigned crb_hub_agt[64] =
 #define ADDR_IN_RANGE(addr, low, high) \
        (((addr) <= (high)) && ((addr) >= (low)))
 
-#define NETXEN_MAX_MTU         8000 + NETXEN_ENET_HEADER_SIZE + NETXEN_ETH_FCS_SIZE
-#define NETXEN_MIN_MTU         64
-#define NETXEN_ETH_FCS_SIZE     4
-#define NETXEN_ENET_HEADER_SIZE 14
 #define NETXEN_WINDOW_ONE      0x2000000 /*CRB Window: bit 25 of CRB address */
-#define NETXEN_FIRMWARE_LEN    ((16 * 1024) / 4)
-#define NETXEN_NIU_HDRSIZE     (0x1 << 6)
-#define NETXEN_NIU_TLRSIZE     (0x1 << 5)
 
 #define NETXEN_NIC_ZERO_PAUSE_ADDR     0ULL
 #define NETXEN_NIC_UNIT_PAUSE_ADDR     0x200ULL
@@ -541,9 +534,6 @@ netxen_send_cmd_descs(struct netxen_adapter *adapter,
        return 0;
 }
 
-#define NIC_REQUEST            0x14
-#define NETXEN_MAC_EVENT       0x1
-
 static int nx_p3_sre_macaddr_change(struct net_device *dev,
                u8 *addr, unsigned op)
 {
@@ -553,8 +543,8 @@ static int nx_p3_sre_macaddr_change(struct net_device *dev,
        int rv;
 
        memset(&req, 0, sizeof(nx_nic_req_t));
-       req.qhdr |= (NIC_REQUEST << 23);
-       req.req_hdr |= NETXEN_MAC_EVENT;
+       req.qhdr |= (NX_NIC_REQUEST << 23);
+       req.req_hdr |= NX_MAC_EVENT;
        req.req_hdr |= ((u64)adapter->portnum << 16);
        mac_req.op = op;
        memcpy(&mac_req.mac_addr, addr, 6);
@@ -575,31 +565,35 @@ void netxen_p3_nic_set_multi(struct net_device *netdev)
        nx_mac_list_t *cur, *next, *del_list, *add_list = NULL;
        struct dev_mc_list *mc_ptr;
        u8 bcast_addr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
-
-       adapter->set_promisc(adapter, NETXEN_NIU_PROMISC_MODE);
-
-       /*
-        * Programming mac addresses will automaticly enabling L2 filtering.
-        * HW will replace timestamp with L2 conid when L2 filtering is
-        * enabled. This causes problem for LSA. Do not enabling L2 filtering
-        * until that problem is fixed.
-        */
-       if ((netdev->flags & IFF_PROMISC) ||
-                       (netdev->mc_count > adapter->max_mc_count))
-               return;
+       u32 mode = VPORT_MISS_MODE_DROP;
 
        del_list = adapter->mac_list;
        adapter->mac_list = NULL;
 
        nx_p3_nic_add_mac(adapter, netdev->dev_addr, &add_list, &del_list);
+       nx_p3_nic_add_mac(adapter, bcast_addr, &add_list, &del_list);
+
+       if (netdev->flags & IFF_PROMISC) {
+               mode = VPORT_MISS_MODE_ACCEPT_ALL;
+               goto send_fw_cmd;
+       }
+
+       if ((netdev->flags & IFF_ALLMULTI) ||
+                       (netdev->mc_count > adapter->max_mc_count)) {
+               mode = VPORT_MISS_MODE_ACCEPT_MULTI;
+               goto send_fw_cmd;
+       }
+
        if (netdev->mc_count > 0) {
-               nx_p3_nic_add_mac(adapter, bcast_addr, &add_list, &del_list);
                for (mc_ptr = netdev->mc_list; mc_ptr;
                     mc_ptr = mc_ptr->next) {
                        nx_p3_nic_add_mac(adapter, mc_ptr->dmi_addr,
                                          &add_list, &del_list);
                }
        }
+
+send_fw_cmd:
+       adapter->set_promisc(adapter, mode);
        for (cur = del_list; cur;) {
                nx_p3_sre_macaddr_change(netdev, cur->mac_addr, NETXEN_MAC_DEL);
                next = cur->next;
@@ -615,6 +609,21 @@ void netxen_p3_nic_set_multi(struct net_device *netdev)
        }
 }
 
+int netxen_p3_nic_set_promisc(struct netxen_adapter *adapter, u32 mode)
+{
+       nx_nic_req_t req;
+
+       memset(&req, 0, sizeof(nx_nic_req_t));
+
+       req.qhdr |= (NX_HOST_REQUEST << 23);
+       req.req_hdr |= NX_NIC_H2C_OPCODE_PROXY_SET_VPORT_MISS_MODE;
+       req.req_hdr |= ((u64)adapter->portnum << 16);
+       req.words[0] = cpu_to_le64(mode);
+
+       return netxen_send_cmd_descs(adapter,
+                               (struct cmd_desc_type0 *)&req, 1);
+}
+
 #define        NETXEN_CONFIG_INTR_COALESCE     3
 
 /*
@@ -627,7 +636,7 @@ int netxen_config_intr_coalesce(struct netxen_adapter *adapter)
 
        memset(&req, 0, sizeof(nx_nic_req_t));
 
-       req.qhdr |= (NIC_REQUEST << 23);
+       req.qhdr |= (NX_NIC_REQUEST << 23);
        req.req_hdr |= NETXEN_CONFIG_INTR_COALESCE;
        req.req_hdr |= ((u64)adapter->portnum << 16);
 
@@ -653,6 +662,7 @@ int netxen_nic_change_mtu(struct net_device *netdev, int mtu)
 {
        struct netxen_adapter *adapter = netdev_priv(netdev);
        int max_mtu;
+       int rc = 0;
 
        if (NX_IS_REVISION_P3(adapter->ahw.revision_id))
                max_mtu = P3_MAX_MTU;
@@ -666,16 +676,12 @@ int netxen_nic_change_mtu(struct net_device *netdev, int mtu)
        }
 
        if (adapter->set_mtu)
-               adapter->set_mtu(adapter, mtu);
-       netdev->mtu = mtu;
+               rc = adapter->set_mtu(adapter, mtu);
 
-       mtu += MTU_FUDGE_FACTOR;
-       if (NX_IS_REVISION_P3(adapter->ahw.revision_id))
-               nx_fw_cmd_set_mtu(adapter, mtu);
-       else if (adapter->set_mtu)
-               adapter->set_mtu(adapter, mtu);
+       if (!rc)
+               netdev->mtu = mtu;
 
-       return 0;
+       return rc;
 }
 
 int netxen_is_flash_supported(struct netxen_adapter *adapter)
@@ -1411,7 +1417,8 @@ static int netxen_nic_pci_mem_read_direct(struct netxen_adapter *adapter,
                (netxen_nic_pci_is_same_window(adapter, off+size-1) == 0)) {
                write_unlock_irqrestore(&adapter->adapter_lock, flags);
                printk(KERN_ERR "%s out of bound pci memory access. "
-                       "offset is 0x%llx\n", netxen_nic_driver_name, off);
+                       "offset is 0x%llx\n", netxen_nic_driver_name,
+                       (unsigned long long)off);
                return -1;
        }
 
@@ -1484,7 +1491,8 @@ netxen_nic_pci_mem_write_direct(struct netxen_adapter *adapter, u64 off,
                (netxen_nic_pci_is_same_window(adapter, off+size-1) == 0)) {
                write_unlock_irqrestore(&adapter->adapter_lock, flags);
                printk(KERN_ERR "%s out of bound pci memory access. "
-                       "offset is 0x%llx\n", netxen_nic_driver_name, off);
+                       "offset is 0x%llx\n", netxen_nic_driver_name,
+                       (unsigned long long)off);
                return -1;
        }
 
@@ -2016,6 +2024,8 @@ int netxen_nic_get_board_info(struct netxen_adapter *adapter)
        case NETXEN_BRDTYPE_P3_10G_CX4_LP:
        case NETXEN_BRDTYPE_P3_IMEZ:
        case NETXEN_BRDTYPE_P3_10G_SFP_PLUS:
+       case NETXEN_BRDTYPE_P3_10G_SFP_CT:
+       case NETXEN_BRDTYPE_P3_10G_SFP_QT:
        case NETXEN_BRDTYPE_P3_10G_XFP:
        case NETXEN_BRDTYPE_P3_10000_BASE_T:
 
@@ -2034,6 +2044,7 @@ int netxen_nic_get_board_info(struct netxen_adapter *adapter)
        default:
                printk("%s: Unknown(%x)\n", netxen_nic_driver_name,
                       boardinfo->board_type);
+               rv = -ENODEV;
                break;
        }
 
@@ -2044,6 +2055,7 @@ int netxen_nic_get_board_info(struct netxen_adapter *adapter)
 
 int netxen_nic_set_mtu_gb(struct netxen_adapter *adapter, int new_mtu)
 {
+       new_mtu += MTU_FUDGE_FACTOR;
        netxen_nic_write_w0(adapter,
                NETXEN_NIU_GB_MAX_FRAME_SIZE(adapter->physical_port),
                new_mtu);
@@ -2052,7 +2064,7 @@ int netxen_nic_set_mtu_gb(struct netxen_adapter *adapter, int new_mtu)
 
 int netxen_nic_set_mtu_xgb(struct netxen_adapter *adapter, int new_mtu)
 {
-       new_mtu += NETXEN_NIU_HDRSIZE + NETXEN_NIU_TLRSIZE;
+       new_mtu += MTU_FUDGE_FACTOR;
        if (adapter->physical_port == 0)
                netxen_nic_write_w0(adapter, NETXEN_NIU_XGE_MAX_FRAME_SIZE,
                                new_mtu);
@@ -2074,12 +2086,22 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter)
        __u32 status;
        __u32 autoneg;
        __u32 mode;
+       __u32 port_mode;
 
        netxen_nic_read_w0(adapter, NETXEN_NIU_MODE, &mode);
        if (netxen_get_niu_enable_ge(mode)) {   /* Gb 10/100/1000 Mbps mode */
+
+               adapter->hw_read_wx(adapter,
+                               NETXEN_PORT_MODE_ADDR, &port_mode, 4);
+               if (port_mode == NETXEN_PORT_MODE_802_3_AP) {
+                       adapter->link_speed   = SPEED_1000;
+                       adapter->link_duplex  = DUPLEX_FULL;
+                       adapter->link_autoneg = AUTONEG_DISABLE;
+                       return;
+               }
+
                if (adapter->phy_read
-                   && adapter->
-                   phy_read(adapter,
+                   && adapter->phy_read(adapter,
                             NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS,
                             &status) == 0) {
                        if (netxen_get_phy_link(status)) {
@@ -2109,8 +2131,7 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter)
                                        break;
                                }
                                if (adapter->phy_read
-                                   && adapter->
-                                   phy_read(adapter,
+                                   && adapter->phy_read(adapter,
                                             NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG,
                                             &autoneg) != 0)
                                        adapter->link_autoneg = autoneg;
index b8e0030..aae737d 100644 (file)
@@ -419,12 +419,9 @@ typedef enum {
 #define netxen_get_niu_enable_ge(config_word)  \
                _netxen_crb_get_bit(config_word, 1)
 
-/* Promiscous mode options (GbE mode only) */
-typedef enum {
-       NETXEN_NIU_PROMISC_MODE = 0,
-       NETXEN_NIU_NON_PROMISC_MODE,
-       NETXEN_NIU_ALLMULTI_MODE
-} netxen_niu_prom_mode_t;
+#define NETXEN_NIU_NON_PROMISC_MODE    0
+#define NETXEN_NIU_PROMISC_MODE                1
+#define NETXEN_NIU_ALLMULTI_MODE       2
 
 /*
  * NIU GB Drop CRC Register
@@ -471,9 +468,9 @@ typedef enum {
 
 /* Set promiscuous mode for a GbE interface */
 int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter,
-                                   netxen_niu_prom_mode_t mode);
+                                   u32 mode);
 int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter,
-                                      netxen_niu_prom_mode_t mode);
+                                      u32 mode);
 
 /* set the MAC address for a given MAC */
 int netxen_niu_macaddr_set(struct netxen_adapter *adapter,
index 01ab31b..519fc86 100644 (file)
@@ -364,6 +364,11 @@ void netxen_initialize_adapter_ops(struct netxen_adapter *adapter)
        default:
                break;
        }
+
+       if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) {
+               adapter->set_mtu = nx_fw_cmd_set_mtu;
+               adapter->set_promisc = netxen_p3_nic_set_promisc;
+       }
 }
 
 /*
index 91d209a..7615c71 100644 (file)
@@ -166,7 +166,8 @@ static void netxen_nic_disable_int(struct netxen_adapter *adapter)
        if (!NETXEN_IS_MSI_FAMILY(adapter)) {
                do {
                        adapter->pci_write_immediate(adapter,
-                                       ISR_INT_TARGET_STATUS, 0xffffffff);
+                                       adapter->legacy_intr.tgt_status_reg,
+                                       0xffffffff);
                        mask = adapter->pci_read_immediate(adapter,
                                        ISR_INT_VECTOR);
                        if (!(mask & 0x80))
@@ -175,7 +176,7 @@ static void netxen_nic_disable_int(struct netxen_adapter *adapter)
                } while (--retries);
 
                if (!retries) {
-                       printk(KERN_NOTICE "%s: Failed to disable interrupt completely\n",
+                       printk(KERN_NOTICE "%s: Failed to disable interrupt\n",
                                        netxen_nic_driver_name);
                }
        } else {
@@ -190,8 +191,6 @@ static void netxen_nic_enable_int(struct netxen_adapter *adapter)
 {
        u32 mask;
 
-       DPRINTK(1, INFO, "Entered ISR Enable \n");
-
        if (adapter->intr_scheme != -1 &&
                adapter->intr_scheme != INTR_SCHEME_PERPORT) {
                switch (adapter->ahw.board_type) {
@@ -213,16 +212,13 @@ static void netxen_nic_enable_int(struct netxen_adapter *adapter)
 
        if (!NETXEN_IS_MSI_FAMILY(adapter)) {
                mask = 0xbff;
-               if (adapter->intr_scheme != -1 &&
-                       adapter->intr_scheme != INTR_SCHEME_PERPORT) {
+               if (adapter->intr_scheme == INTR_SCHEME_PERPORT)
+                       adapter->pci_write_immediate(adapter,
+                               adapter->legacy_intr.tgt_mask_reg, mask);
+               else
                        adapter->pci_write_normalize(adapter,
                                        CRB_INT_VECTOR, 0);
-               }
-               adapter->pci_write_immediate(adapter,
-                               ISR_INT_TARGET_MASK, mask);
        }
-
-       DPRINTK(1, INFO, "Done with enable Int\n");
 }
 
 static int nx_set_dma_mask(struct netxen_adapter *adapter, uint8_t revision_id)
@@ -284,6 +280,8 @@ static void netxen_check_options(struct netxen_adapter *adapter)
        case NETXEN_BRDTYPE_P3_10G_CX4_LP:
        case NETXEN_BRDTYPE_P3_IMEZ:
        case NETXEN_BRDTYPE_P3_10G_SFP_PLUS:
+       case NETXEN_BRDTYPE_P3_10G_SFP_QT:
+       case NETXEN_BRDTYPE_P3_10G_SFP_CT:
        case NETXEN_BRDTYPE_P3_10G_XFP:
        case NETXEN_BRDTYPE_P3_10000_BASE_T:
                adapter->msix_supported = !!use_msi_x;
@@ -301,6 +299,10 @@ static void netxen_check_options(struct netxen_adapter *adapter)
        case NETXEN_BRDTYPE_P3_REF_QG:
        case NETXEN_BRDTYPE_P3_4_GB:
        case NETXEN_BRDTYPE_P3_4_GB_MM:
+               adapter->msix_supported = 0;
+               adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_10G;
+               break;
+
        case NETXEN_BRDTYPE_P2_SB35_4G:
        case NETXEN_BRDTYPE_P2_SB31_2G:
                adapter->msix_supported = 0;
@@ -700,13 +702,10 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        adapter->status   &= ~NETXEN_NETDEV_STATUS;
        adapter->rx_csum = 1;
        adapter->mc_enabled = 0;
-       if (NX_IS_REVISION_P3(revision_id)) {
+       if (NX_IS_REVISION_P3(revision_id))
                adapter->max_mc_count = 38;
-               adapter->max_rds_rings = 2;
-       } else {
+       else
                adapter->max_mc_count = 16;
-               adapter->max_rds_rings = 3;
-       }
 
        netdev->open               = netxen_nic_open;
        netdev->stop               = netxen_nic_close;
@@ -779,10 +778,6 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                if (adapter->portnum == 0)
                        first_driver = 1;
        }
-       adapter->crb_addr_cmd_producer = crb_cmd_producer[adapter->portnum];
-       adapter->crb_addr_cmd_consumer = crb_cmd_consumer[adapter->portnum];
-       netxen_nic_update_cmd_producer(adapter, 0);
-       netxen_nic_update_cmd_consumer(adapter, 0);
 
        if (first_driver) {
                first_boot = adapter->pci_read_normalize(adapter,
@@ -1053,6 +1048,11 @@ static int netxen_nic_open(struct net_device *netdev)
                        return -EIO;
                }
 
+               if (adapter->fw_major < 4)
+                       adapter->max_rds_rings = 3;
+               else
+                       adapter->max_rds_rings = 2;
+
                err = netxen_alloc_sw_resources(adapter);
                if (err) {
                        printk(KERN_ERR "%s: Error in setting sw resources\n",
@@ -1074,10 +1074,10 @@ static int netxen_nic_open(struct net_device *netdev)
                                crb_cmd_producer[adapter->portnum];
                        adapter->crb_addr_cmd_consumer =
                                crb_cmd_consumer[adapter->portnum];
-               }
 
-               netxen_nic_update_cmd_producer(adapter, 0);
-               netxen_nic_update_cmd_consumer(adapter, 0);
+                       netxen_nic_update_cmd_producer(adapter, 0);
+                       netxen_nic_update_cmd_consumer(adapter, 0);
+               }
 
                for (ctx = 0; ctx < MAX_RCV_CTX; ++ctx) {
                        for (ring = 0; ring < adapter->max_rds_rings; ring++)
@@ -1113,9 +1113,7 @@ static int netxen_nic_open(struct net_device *netdev)
        netxen_nic_set_link_parameters(adapter);
 
        netdev->set_multicast_list(netdev);
-       if (NX_IS_REVISION_P3(adapter->ahw.revision_id))
-               nx_fw_cmd_set_mtu(adapter, netdev->mtu);
-       else
+       if (adapter->set_mtu)
                adapter->set_mtu(adapter, netdev->mtu);
 
        mod_timer(&adapter->watchdog_timer, jiffies);
@@ -1410,20 +1408,17 @@ static void netxen_nic_handle_phy_intr(struct netxen_adapter *adapter)
 
        port = adapter->physical_port;
 
-       if (adapter->ahw.board_type == NETXEN_NIC_GBE) {
-               val = adapter->pci_read_normalize(adapter, CRB_XG_STATE);
-               linkup = (val >> port) & 1;
+       if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) {
+               val = adapter->pci_read_normalize(adapter, CRB_XG_STATE_P3);
+               val = XG_LINK_STATE_P3(adapter->ahw.pci_func, val);
+               linkup = (val == XG_LINK_UP_P3);
        } else {
-               if (adapter->fw_major < 4) {
-                       val = adapter->pci_read_normalize(adapter,
-                                       CRB_XG_STATE);
+               val = adapter->pci_read_normalize(adapter, CRB_XG_STATE);
+               if (adapter->ahw.board_type == NETXEN_NIC_GBE)
+                       linkup = (val >> port) & 1;
+               else {
                        val = (val >> port*8) & 0xff;
                        linkup = (val == XG_LINK_UP);
-               } else {
-                       val = adapter->pci_read_normalize(adapter,
-                               CRB_XG_STATE_P3);
-                       val = XG_LINK_STATE_P3(adapter->ahw.pci_func, val);
-                       linkup = (val == XG_LINK_UP_P3);
                }
        }
 
@@ -1535,15 +1530,33 @@ static irqreturn_t netxen_intr(int irq, void *data)
        struct netxen_adapter *adapter = data;
        u32 our_int = 0;
 
-       our_int = adapter->pci_read_normalize(adapter, CRB_INT_VECTOR);
-       /* not our interrupt */
-       if ((our_int & (0x80 << adapter->portnum)) == 0)
+       u32 status = 0;
+
+       status = adapter->pci_read_immediate(adapter, ISR_INT_VECTOR);
+
+       if (!(status & adapter->legacy_intr.int_vec_bit))
                return IRQ_NONE;
 
-       if (adapter->intr_scheme == INTR_SCHEME_PERPORT) {
-               /* claim interrupt */
-               adapter->pci_write_normalize(adapter, CRB_INT_VECTOR,
+       if (adapter->ahw.revision_id >= NX_P3_B1) {
+               /* check interrupt state machine, to be sure */
+               status = adapter->pci_read_immediate(adapter,
+                               ISR_INT_STATE_REG);
+               if (!ISR_LEGACY_INT_TRIGGERED(status))
+                       return IRQ_NONE;
+
+       } else if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) {
+
+               our_int = adapter->pci_read_normalize(adapter, CRB_INT_VECTOR);
+               /* not our interrupt */
+               if ((our_int & (0x80 << adapter->portnum)) == 0)
+                       return IRQ_NONE;
+
+               if (adapter->intr_scheme == INTR_SCHEME_PERPORT) {
+                       /* claim interrupt */
+                       adapter->pci_write_normalize(adapter,
+                               CRB_INT_VECTOR,
                                our_int & ~((u32)(0x80 << adapter->portnum)));
+               }
        }
 
        netxen_handle_int(adapter);
index 4cb8f4a..27f07f6 100644 (file)
@@ -610,6 +610,9 @@ int netxen_niu_macaddr_set(struct netxen_adapter *adapter,
        int i;
        DECLARE_MAC_BUF(mac);
 
+       if (NX_IS_REVISION_P3(adapter->ahw.revision_id))
+               return 0;
+
        for (i = 0; i < 10; i++) {
                temp[0] = temp[1] = 0;
                memcpy(temp + 2, addr, 2);
@@ -727,6 +730,9 @@ int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter)
        __u32 mac_cfg0;
        u32 port = adapter->physical_port;
 
+       if (NX_IS_REVISION_P3(adapter->ahw.revision_id))
+               return 0;
+
        if (port > NETXEN_NIU_MAX_GBE_PORTS)
                return -EINVAL;
        mac_cfg0 = 0;
@@ -743,6 +749,9 @@ int netxen_niu_disable_xg_port(struct netxen_adapter *adapter)
        __u32 mac_cfg;
        u32 port = adapter->physical_port;
 
+       if (NX_IS_REVISION_P3(adapter->ahw.revision_id))
+               return 0;
+
        if (port > NETXEN_NIU_MAX_XG_PORTS)
                return -EINVAL;
 
@@ -755,7 +764,7 @@ int netxen_niu_disable_xg_port(struct netxen_adapter *adapter)
 
 /* Set promiscuous mode for a GbE interface */
 int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter,
-                                   netxen_niu_prom_mode_t mode)
+               u32 mode)
 {
        __u32 reg;
        u32 port = adapter->physical_port;
@@ -819,6 +828,9 @@ int netxen_niu_xg_macaddr_set(struct netxen_adapter *adapter,
        u8 temp[4];
        u32 val;
 
+       if (NX_IS_REVISION_P3(adapter->ahw.revision_id))
+               return 0;
+
        if ((phy < 0) || (phy > NETXEN_NIU_MAX_XG_PORTS))
                return -EIO;
 
@@ -894,7 +906,7 @@ int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter,
 #endif  /*  0  */
 
 int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter,
-                                      netxen_niu_prom_mode_t mode)
+               u32 mode)
 {
        __u32 reg;
        u32 port = adapter->physical_port;
index 3bfa51b..83e5ee5 100644 (file)
@@ -95,8 +95,8 @@
 #define CRB_HOST_STS_PROD           NETXEN_NIC_REG(0xdc)
 #define CRB_HOST_STS_CONS           NETXEN_NIC_REG(0xe0)
 #define CRB_PEG_CMD_PROD            NETXEN_NIC_REG(0xe4)
-#define CRB_PEG_CMD_CONS            NETXEN_NIC_REG(0xe8)
-#define CRB_HOST_BUFFER_PROD        NETXEN_NIC_REG(0xec)
+#define CRB_PF_LINK_SPEED_1         NETXEN_NIC_REG(0xe8)
+#define CRB_PF_LINK_SPEED_2         NETXEN_NIC_REG(0xec)
 #define CRB_HOST_BUFFER_CONS        NETXEN_NIC_REG(0xf0)
 #define CRB_JUMBO_BUFFER_PROD       NETXEN_NIC_REG(0xf4)
 #define CRB_JUMBO_BUFFER_CONS       NETXEN_NIC_REG(0xf8)
index a20005c..8e0ca9f 100644 (file)
@@ -648,7 +648,6 @@ static void ni5010_set_multicast_list(struct net_device *dev)
        PRINTK2((KERN_DEBUG "%s: entering set_multicast_list\n", dev->name));
 
        if (dev->flags&IFF_PROMISC || dev->flags&IFF_ALLMULTI || dev->mc_list) {
-               dev->flags |= IFF_PROMISC;
                outb(RMD_PROMISC, EDLC_RMODE); /* Enable promiscuous mode */
                PRINTK((KERN_DEBUG "%s: Entering promiscuous mode\n", dev->name));
        } else {
index a316dcc..b9a882d 100644 (file)
@@ -621,7 +621,7 @@ static int init586(struct net_device *dev)
                if (num_addrs > len) {
                        printk(KERN_ERR "%s: switching to promisc. mode\n",
                                dev->name);
-                       dev->flags |= IFF_PROMISC;
+                       writeb(0x01, &cfg_cmd->promisc);
                }
        }
        if (dev->flags & IFF_PROMISC)
index e82b37b..3cdd07c 100644 (file)
@@ -38,7 +38,7 @@
 
 #define DRV_NAME       "qla3xxx"
 #define DRV_STRING     "QLogic ISP3XXX Network Driver"
-#define DRV_VERSION    "v2.03.00-k4"
+#define DRV_VERSION    "v2.03.00-k5"
 #define PFX            DRV_NAME " "
 
 static const char ql3xxx_driver_name[] = DRV_NAME;
@@ -3495,8 +3495,6 @@ static void ql_set_mac_info(struct ql3_adapter *qdev)
        case ISP_CONTROL_FN0_NET:
                qdev->mac_index = 0;
                qdev->mac_ob_opcode = OUTBOUND_MAC_IOCB | func_number;
-               qdev->tcp_ob_opcode = OUTBOUND_TCP_IOCB | func_number;
-               qdev->update_ob_opcode = UPDATE_NCB_IOCB | func_number;
                qdev->mb_bit_mask = FN0_MA_BITS_MASK;
                qdev->PHYAddr = PORT0_PHY_ADDRESS;
                if (port_status & PORT_STATUS_SM0)
@@ -3508,8 +3506,6 @@ static void ql_set_mac_info(struct ql3_adapter *qdev)
        case ISP_CONTROL_FN1_NET:
                qdev->mac_index = 1;
                qdev->mac_ob_opcode = OUTBOUND_MAC_IOCB | func_number;
-               qdev->tcp_ob_opcode = OUTBOUND_TCP_IOCB | func_number;
-               qdev->update_ob_opcode = UPDATE_NCB_IOCB | func_number;
                qdev->mb_bit_mask = FN1_MA_BITS_MASK;
                qdev->PHYAddr = PORT1_PHY_ADDRESS;
                if (port_status & PORT_STATUS_SM1)
@@ -3730,14 +3726,6 @@ static int ql3xxx_open(struct net_device *ndev)
        return (ql_adapter_up(qdev));
 }
 
-static void ql3xxx_set_multicast_list(struct net_device *ndev)
-{
-       /*
-        * We are manually parsing the list in the net_device structure.
-        */
-       return;
-}
-
 static int ql3xxx_set_mac_address(struct net_device *ndev, void *p)
 {
        struct ql3_adapter *qdev = (struct ql3_adapter *)netdev_priv(ndev);
@@ -4007,7 +3995,11 @@ static int __devinit ql3xxx_probe(struct pci_dev *pdev,
        ndev->open = ql3xxx_open;
        ndev->hard_start_xmit = ql3xxx_send;
        ndev->stop = ql3xxx_close;
-       ndev->set_multicast_list = ql3xxx_set_multicast_list;
+       /* ndev->set_multicast_list
+        * This device is one side of a two-function adapter
+        * (NIC and iSCSI).  Promiscuous mode setting/clearing is
+        * not allowed from the NIC side.
+        */
        SET_ETHTOOL_OPS(ndev, &ql3xxx_ethtool_ops);
        ndev->set_mac_address = ql3xxx_set_mac_address;
        ndev->tx_timeout = ql3xxx_tx_timeout;
@@ -4040,9 +4032,6 @@ static int __devinit ql3xxx_probe(struct pci_dev *pdev,
 
        ndev->tx_queue_len = NUM_REQ_Q_ENTRIES;
 
-       /* Turn off support for multicasting */
-       ndev->flags &= ~IFF_MULTICAST;
-
        /* Record PCI bus information. */
        ql_get_board_info(qdev);
 
index 58a086f..7113e71 100644 (file)
 
 #define OPCODE_OB_MAC_IOCB_FN0          0x01
 #define OPCODE_OB_MAC_IOCB_FN2          0x21
-#define OPCODE_OB_TCP_IOCB_FN0          0x03
-#define OPCODE_OB_TCP_IOCB_FN2          0x23
-#define OPCODE_UPDATE_NCB_IOCB_FN0      0x00
-#define OPCODE_UPDATE_NCB_IOCB_FN2      0x20
 
-#define OPCODE_UPDATE_NCB_IOCB      0xF0
 #define OPCODE_IB_MAC_IOCB          0xF9
 #define OPCODE_IB_3032_MAC_IOCB     0x09
 #define OPCODE_IB_IP_IOCB           0xFA
 #define OPCODE_IB_3032_IP_IOCB      0x0A
-#define OPCODE_IB_TCP_IOCB          0xFB
-#define OPCODE_DUMP_PROTO_IOCB      0xFE
-#define OPCODE_BUFFER_ALERT_IOCB    0xFB
 
 #define OPCODE_FUNC_ID_MASK                 0x30
 #define OUTBOUND_MAC_IOCB                   0x01       /* plus function bits */
-#define OUTBOUND_TCP_IOCB                   0x03       /* plus function bits */
-#define UPDATE_NCB_IOCB                     0x00       /* plus function bits */
 
 #define FN0_MA_BITS_MASK    0x00
 #define FN1_MA_BITS_MASK    0x80
@@ -159,75 +149,6 @@ struct ob_ip_iocb_rsp {
        __le32 reserved2;
 };
 
-struct ob_tcp_iocb_req {
-       u8 opcode;
-
-       u8 flags0;
-#define OB_TCP_IOCB_REQ_P       0x80
-#define OB_TCP_IOCB_REQ_CI      0x20
-#define OB_TCP_IOCB_REQ_H       0x10
-#define OB_TCP_IOCB_REQ_LN      0x08
-#define OB_TCP_IOCB_REQ_K       0x04
-#define OB_TCP_IOCB_REQ_D       0x02
-#define OB_TCP_IOCB_REQ_I       0x01
-
-       u8 flags1;
-#define OB_TCP_IOCB_REQ_OSM     0x40
-#define OB_TCP_IOCB_REQ_URG     0x20
-#define OB_TCP_IOCB_REQ_ACK     0x10
-#define OB_TCP_IOCB_REQ_PSH     0x08
-#define OB_TCP_IOCB_REQ_RST     0x04
-#define OB_TCP_IOCB_REQ_SYN     0x02
-#define OB_TCP_IOCB_REQ_FIN     0x01
-
-       u8 options_len;
-#define OB_TCP_IOCB_REQ_OMASK   0xF0
-#define OB_TCP_IOCB_REQ_SHIFT   4
-
-       __le32 transaction_id;
-       __le32 data_len;
-       __le32 hncb_ptr_low;
-       __le32 hncb_ptr_high;
-       __le32 buf_addr0_low;
-       __le32 buf_addr0_high;
-       __le32 buf_0_len;
-       __le32 buf_addr1_low;
-       __le32 buf_addr1_high;
-       __le32 buf_1_len;
-       __le32 buf_addr2_low;
-       __le32 buf_addr2_high;
-       __le32 buf_2_len;
-       __le32 time_stamp;
-       __le32 reserved1;
-};
-
-struct ob_tcp_iocb_rsp {
-       u8 opcode;
-
-       u8 flags0;
-#define OB_TCP_IOCB_RSP_C       0x20
-#define OB_TCP_IOCB_RSP_H       0x10
-#define OB_TCP_IOCB_RSP_LN      0x08
-#define OB_TCP_IOCB_RSP_K       0x04
-#define OB_TCP_IOCB_RSP_D       0x02
-#define OB_TCP_IOCB_RSP_I       0x01
-
-       u8 flags1;
-#define OB_TCP_IOCB_RSP_E       0x10
-#define OB_TCP_IOCB_RSP_W       0x08
-#define OB_TCP_IOCB_RSP_P       0x04
-#define OB_TCP_IOCB_RSP_T       0x02
-#define OB_TCP_IOCB_RSP_F       0x01
-
-       u8 state;
-#define OB_TCP_IOCB_RSP_SMASK   0xF0
-#define OB_TCP_IOCB_RSP_SHIFT   4
-
-       __le32 transaction_id;
-       __le32 local_ncb_ptr;
-       __le32 reserved0;
-};
-
 struct ib_ip_iocb_rsp {
        u8 opcode;
 #define IB_IP_IOCB_RSP_3032_V   0x80
@@ -256,25 +177,6 @@ struct ib_ip_iocb_rsp {
        __le32 ial_high;
 };
 
-struct ib_tcp_iocb_rsp {
-       u8 opcode;
-       u8 flags;
-#define IB_TCP_IOCB_RSP_P       0x80
-#define IB_TCP_IOCB_RSP_T       0x40
-#define IB_TCP_IOCB_RSP_D       0x20
-#define IB_TCP_IOCB_RSP_N       0x10
-#define IB_TCP_IOCB_RSP_IP      0x03
-#define IB_TCP_FLAG_MASK        0xf0
-#define IB_TCP_FLAG_IOCB_SYN    0x00
-
-#define TCP_IB_RSP_FLAGS(x) (x->flags & ~IB_TCP_FLAG_MASK)
-
-       __le16 length;
-       __le32 hncb_ref_num;
-       __le32 ial_low;
-       __le32 ial_high;
-};
-
 struct net_rsp_iocb {
        u8 opcode;
        u8 flags;
@@ -1266,20 +1168,13 @@ struct ql3_adapter {
        u32 small_buf_release_cnt;
        u32 small_buf_total_size;
 
-       /* ISR related, saves status for DPC. */
-       u32 control_status;
-
        struct eeprom_data nvram_data;
-       struct timer_list ioctl_timer;
        u32 port_link_state;
-       u32 last_rsp_offset;
 
        /* 4022 specific */
        u32 mac_index;          /* Driver's MAC number can be 0 or 1 for first and second networking functions respectively */
        u32 PHYAddr;            /* Address of PHY 0x1e00 Port 0 and 0x1f00 Port 1 */
        u32 mac_ob_opcode;      /* Opcode to use on mac transmission */
-       u32 tcp_ob_opcode;      /* Opcode to use on tcp transmission */
-       u32 update_ob_opcode;   /* Opcode to use for updating NCB */
        u32 mb_bit_mask;        /* MA Bits mask to use on transmission */
        u32 numPorts;
        struct workqueue_struct *workqueue;
index 6a06b95..25e62cf 100644 (file)
 
 #include "sh_eth.h"
 
+/* CPU <-> EDMAC endian convert */
+static inline __u32 cpu_to_edmac(struct sh_eth_private *mdp, u32 x)
+{
+       switch (mdp->edmac_endian) {
+       case EDMAC_LITTLE_ENDIAN:
+               return cpu_to_le32(x);
+       case EDMAC_BIG_ENDIAN:
+               return cpu_to_be32(x);
+       }
+       return x;
+}
+
+static inline __u32 edmac_to_cpu(struct sh_eth_private *mdp, u32 x)
+{
+       switch (mdp->edmac_endian) {
+       case EDMAC_LITTLE_ENDIAN:
+               return le32_to_cpu(x);
+       case EDMAC_BIG_ENDIAN:
+               return be32_to_cpu(x);
+       }
+       return x;
+}
+
 /*
  * Program the hardware MAC address from dev->dev_addr.
  */
@@ -240,7 +263,7 @@ static void sh_eth_ring_format(struct net_device *ndev)
                /* RX descriptor */
                rxdesc = &mdp->rx_ring[i];
                rxdesc->addr = (u32)skb->data & ~0x3UL;
-               rxdesc->status = cpu_to_le32(RD_RACT | RD_RFP);
+               rxdesc->status = cpu_to_edmac(mdp, RD_RACT | RD_RFP);
 
                /* The size of the buffer is 16 byte boundary. */
                rxdesc->buffer_length = (mdp->rx_buf_sz + 16) & ~0x0F;
@@ -262,7 +285,7 @@ static void sh_eth_ring_format(struct net_device *ndev)
        mdp->dirty_rx = (u32) (i - RX_RING_SIZE);
 
        /* Mark the last entry as wrapping the ring. */
-       rxdesc->status |= cpu_to_le32(RD_RDEL);
+       rxdesc->status |= cpu_to_edmac(mdp, RD_RDEL);
 
        memset(mdp->tx_ring, 0, tx_ringsize);
 
@@ -270,10 +293,10 @@ static void sh_eth_ring_format(struct net_device *ndev)
        for (i = 0; i < TX_RING_SIZE; i++) {
                mdp->tx_skbuff[i] = NULL;
                txdesc = &mdp->tx_ring[i];
-               txdesc->status = cpu_to_le32(TD_TFP);
+               txdesc->status = cpu_to_edmac(mdp, TD_TFP);
                txdesc->buffer_length = 0;
                if (i == 0) {
-                       /* Rx descriptor address set */
+                       /* Tx descriptor address set */
                        ctrl_outl((u32)txdesc, ioaddr + TDLAR);
 #if defined(CONFIG_CPU_SUBTYPE_SH7763)
                        ctrl_outl((u32)txdesc, ioaddr + TDFAR);
@@ -281,13 +304,13 @@ static void sh_eth_ring_format(struct net_device *ndev)
                }
        }
 
-       /* Rx descriptor address set */
+       /* Tx descriptor address set */
 #if defined(CONFIG_CPU_SUBTYPE_SH7763)
        ctrl_outl((u32)txdesc, ioaddr + TDFXR);
        ctrl_outl(0x1, ioaddr + TDFFR);
 #endif
 
-       txdesc->status |= cpu_to_le32(TD_TDLE);
+       txdesc->status |= cpu_to_edmac(mdp, TD_TDLE);
 }
 
 /* Get skb and descriptor buffer */
@@ -455,7 +478,7 @@ static int sh_eth_txfree(struct net_device *ndev)
        for (; mdp->cur_tx - mdp->dirty_tx > 0; mdp->dirty_tx++) {
                entry = mdp->dirty_tx % TX_RING_SIZE;
                txdesc = &mdp->tx_ring[entry];
-               if (txdesc->status & cpu_to_le32(TD_TACT))
+               if (txdesc->status & cpu_to_edmac(mdp, TD_TACT))
                        break;
                /* Free the original skb. */
                if (mdp->tx_skbuff[entry]) {
@@ -463,9 +486,9 @@ static int sh_eth_txfree(struct net_device *ndev)
                        mdp->tx_skbuff[entry] = NULL;
                        freeNum++;
                }
-               txdesc->status = cpu_to_le32(TD_TFP);
+               txdesc->status = cpu_to_edmac(mdp, TD_TFP);
                if (entry >= TX_RING_SIZE - 1)
-                       txdesc->status |= cpu_to_le32(TD_TDLE);
+                       txdesc->status |= cpu_to_edmac(mdp, TD_TDLE);
 
                mdp->stats.tx_packets++;
                mdp->stats.tx_bytes += txdesc->buffer_length;
@@ -486,8 +509,8 @@ static int sh_eth_rx(struct net_device *ndev)
        u32 desc_status, reserve = 0;
 
        rxdesc = &mdp->rx_ring[entry];
-       while (!(rxdesc->status & cpu_to_le32(RD_RACT))) {
-               desc_status = le32_to_cpu(rxdesc->status);
+       while (!(rxdesc->status & cpu_to_edmac(mdp, RD_RACT))) {
+               desc_status = edmac_to_cpu(mdp, rxdesc->status);
                pkt_len = rxdesc->frame_length;
 
                if (--boguscnt < 0)
@@ -522,7 +545,7 @@ static int sh_eth_rx(struct net_device *ndev)
                        mdp->stats.rx_packets++;
                        mdp->stats.rx_bytes += pkt_len;
                }
-               rxdesc->status |= cpu_to_le32(RD_RACT);
+               rxdesc->status |= cpu_to_edmac(mdp, RD_RACT);
                entry = (++mdp->cur_rx) % RX_RING_SIZE;
        }
 
@@ -552,10 +575,10 @@ static int sh_eth_rx(struct net_device *ndev)
                }
                if (entry >= RX_RING_SIZE - 1)
                        rxdesc->status |=
-                               cpu_to_le32(RD_RACT | RD_RFP | RD_RDEL);
+                               cpu_to_edmac(mdp, RD_RACT | RD_RFP | RD_RDEL);
                else
                        rxdesc->status |=
-                               cpu_to_le32(RD_RACT | RD_RFP);
+                               cpu_to_edmac(mdp, RD_RACT | RD_RFP);
        }
 
        /* Restart Rx engine if stopped. */
@@ -931,9 +954,9 @@ static int sh_eth_start_xmit(struct sk_buff *skb, struct net_device *ndev)
                txdesc->buffer_length = skb->len;
 
        if (entry >= TX_RING_SIZE - 1)
-               txdesc->status |= cpu_to_le32(TD_TACT | TD_TDLE);
+               txdesc->status |= cpu_to_edmac(mdp, TD_TACT | TD_TDLE);
        else
-               txdesc->status |= cpu_to_le32(TD_TACT);
+               txdesc->status |= cpu_to_edmac(mdp, TD_TACT);
 
        mdp->cur_tx++;
 
@@ -1159,6 +1182,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
        struct resource *res;
        struct net_device *ndev = NULL;
        struct sh_eth_private *mdp;
+       struct sh_eth_plat_data *pd;
 
        /* get base addr */
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -1196,8 +1220,11 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
        mdp = netdev_priv(ndev);
        spin_lock_init(&mdp->lock);
 
+       pd = (struct sh_eth_plat_data *)(pdev->dev.platform_data);
        /* get PHY ID */
-       mdp->phy_id = (int)pdev->dev.platform_data;
+       mdp->phy_id = pd->phy;
+       /* EDMAC endian */
+       mdp->edmac_endian = pd->edmac_endian;
 
        /* set function */
        ndev->open = sh_eth_open;
@@ -1217,12 +1244,16 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
 
        /* First device only init */
        if (!devno) {
+#if defined(ARSTR)
                /* reset device */
                ctrl_outl(ARSTR_ARSTR, ARSTR);
                mdelay(1);
+#endif
 
+#if defined(SH_TSU_ADDR)
                /* TSU init (Init only)*/
                sh_eth_tsu_init(SH_TSU_ADDR);
+#endif
        }
 
        /* network device register */
@@ -1240,8 +1271,8 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
               ndev->name, CARDNAME, (u32) ndev->base_addr);
 
        for (i = 0; i < 5; i++)
-               printk(KERN_INFO "%02X:", ndev->dev_addr[i]);
-       printk(KERN_INFO "%02X, IRQ %d.\n", ndev->dev_addr[i], ndev->irq);
+               printk("%02X:", ndev->dev_addr[i]);
+       printk("%02X, IRQ %d.\n", ndev->dev_addr[i], ndev->irq);
 
        platform_set_drvdata(pdev, ndev);
 
index 45ad1b0..73bc718 100644 (file)
@@ -30,6 +30,8 @@
 #include <linux/netdevice.h>
 #include <linux/phy.h>
 
+#include <asm/sh_eth.h>
+
 #define CARDNAME       "sh-eth"
 #define TX_TIMEOUT     (5*HZ)
 #define TX_RING_SIZE   64      /* Tx ring size */
 
 #else /* CONFIG_CPU_SUBTYPE_SH7763 */
 # define RX_OFFSET 2   /* skb offset */
+#ifndef CONFIG_CPU_SUBTYPE_SH7619
 /* Chip base address */
 # define SH_TSU_ADDR  0xA7000804
 # define ARSTR           0xA7000800
-
+#endif
 /* Chip Registers */
 /* E-DMAC */
 # define EDMR  0x0000
@@ -384,7 +387,11 @@ enum FCFTR_BIT {
        FCFTR_RFD1 = 0x00000002, FCFTR_RFD0 = 0x00000001,
 };
 #define FIFO_F_D_RFF   (FCFTR_RFF2|FCFTR_RFF1|FCFTR_RFF0)
+#ifndef CONFIG_CPU_SUBTYPE_SH7619
 #define FIFO_F_D_RFD   (FCFTR_RFD2|FCFTR_RFD1|FCFTR_RFD0)
+#else
+#define FIFO_F_D_RFD   (FCFTR_RFD0)
+#endif
 
 /* Transfer descriptor bit */
 enum TD_STS_BIT {
@@ -414,8 +421,10 @@ enum FELIC_MODE_BIT {
 #ifdef CONFIG_CPU_SUBTYPE_SH7763
 #define ECMR_CHG_DM    (ECMR_TRCCM | ECMR_RZPF | ECMR_ZPF |\
                        ECMR_PFR | ECMR_RXF | ECMR_TXF | ECMR_MCT)
+#elif CONFIG_CPU_SUBTYPE_SH7619
+#define ECMR_CHG_DM    (ECMR_ZPF | ECMR_PFR | ECMR_RXF | ECMR_TXF)
 #else
-#define ECMR_CHG_DM    (ECMR_ZPF | ECMR_PFR ECMR_RXF | ECMR_TXF | ECMR_MCT)
+#define ECMR_CHG_DM    (ECMR_ZPF | ECMR_PFR | ECMR_RXF | ECMR_TXF | ECMR_MCT)
 #endif
 
 /* ECSR */
@@ -485,7 +494,11 @@ enum RPADIR_BIT {
 
 /* FDR */
 enum FIFO_SIZE_BIT {
+#ifndef CONFIG_CPU_SUBTYPE_SH7619
        FIFO_SIZE_T = 0x00000700, FIFO_SIZE_R = 0x00000007,
+#else
+       FIFO_SIZE_T = 0x00000100, FIFO_SIZE_R = 0x00000001,
+#endif
 };
 enum phy_offsets {
        PHY_CTRL = 0, PHY_STAT = 1, PHY_IDT1 = 2, PHY_IDT2 = 3,
@@ -601,7 +614,7 @@ struct sh_eth_txdesc {
 #endif
        u32 addr;               /* TD2 */
        u32 pad1;               /* padding data */
-};
+} __attribute__((aligned(2), packed));
 
 /*
  * The sh ether Rx buffer descriptors.
@@ -618,7 +631,7 @@ struct sh_eth_rxdesc {
 #endif
        u32 addr;               /* RD2 */
        u32 pad0;               /* padding data */
-};
+} __attribute__((aligned(2), packed));
 
 struct sh_eth_private {
        dma_addr_t rx_desc_dma;
@@ -633,6 +646,7 @@ struct sh_eth_private {
        u32 cur_rx, dirty_rx;   /* Producer/consumer ring indices */
        u32 cur_tx, dirty_tx;
        u32 rx_buf_sz;          /* Based on MTU+slack. */
+       int edmac_endian;
        /* MII transceiver section. */
        u32 phy_id;                                     /* PHY ID */
        struct mii_bus *mii_bus;        /* MDIO bus control */
index 5257cf4..7d29edc 100644 (file)
@@ -275,86 +275,6 @@ static void sky2_power_aux(struct sky2_hw *hw)
                             PC_VAUX_ON | PC_VCC_OFF));
 }
 
-static void sky2_power_state(struct sky2_hw *hw, pci_power_t state)
-{
-       u16 power_control = sky2_pci_read16(hw, hw->pm_cap + PCI_PM_CTRL);
-       int pex = pci_find_capability(hw->pdev, PCI_CAP_ID_EXP);
-       u32 reg;
-
-       sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
-
-       switch (state) {
-       case PCI_D0:
-               break;
-
-       case PCI_D1:
-               power_control |= 1;
-               break;
-
-       case PCI_D2:
-               power_control |= 2;
-               break;
-
-       case PCI_D3hot:
-       case PCI_D3cold:
-               power_control |= 3;
-               if (hw->flags & SKY2_HW_ADV_POWER_CTL) {
-                       /* additional power saving measurements */
-                       reg = sky2_pci_read32(hw, PCI_DEV_REG4);
-
-                       /* set gating core clock for LTSSM in L1 state */
-                       reg |= P_PEX_LTSSM_STAT(P_PEX_LTSSM_L1_STAT) |
-                               /* auto clock gated scheme controlled by CLKREQ */
-                               P_ASPM_A1_MODE_SELECT |
-                               /* enable Gate Root Core Clock */
-                               P_CLK_GATE_ROOT_COR_ENA;
-
-                       if (pex && (hw->flags & SKY2_HW_CLK_POWER)) {
-                               /* enable Clock Power Management (CLKREQ) */
-                               u16 ctrl = sky2_pci_read16(hw, pex + PCI_EXP_DEVCTL);
-
-                               ctrl |= PCI_EXP_DEVCTL_AUX_PME;
-                               sky2_pci_write16(hw, pex + PCI_EXP_DEVCTL, ctrl);
-                       } else
-                               /* force CLKREQ Enable in Our4 (A1b only) */
-                               reg |= P_ASPM_FORCE_CLKREQ_ENA;
-
-                       /* set Mask Register for Release/Gate Clock */
-                       sky2_pci_write32(hw, PCI_DEV_REG5,
-                                        P_REL_PCIE_EXIT_L1_ST | P_GAT_PCIE_ENTER_L1_ST |
-                                        P_REL_PCIE_RX_EX_IDLE | P_GAT_PCIE_RX_EL_IDLE |
-                                        P_REL_GPHY_LINK_UP | P_GAT_GPHY_LINK_DOWN);
-               } else
-                       sky2_write8(hw, B28_Y2_ASF_STAT_CMD, Y2_ASF_CLK_HALT);
-
-               /* put CPU into reset state */
-               sky2_write8(hw,  B28_Y2_ASF_STAT_CMD, HCU_CCSR_ASF_RESET);
-               if (hw->chip_id == CHIP_ID_YUKON_SUPR && hw->chip_rev == CHIP_REV_YU_SU_A0)
-                       /* put CPU into halt state */
-                       sky2_write8(hw, B28_Y2_ASF_STAT_CMD, HCU_CCSR_ASF_HALTED);
-
-               if (pex && !(hw->flags & SKY2_HW_RAM_BUFFER)) {
-                       reg = sky2_pci_read32(hw, PCI_DEV_REG1);
-                       /* force to PCIe L1 */
-                       reg |= PCI_FORCE_PEX_L1;
-                       sky2_pci_write32(hw, PCI_DEV_REG1, reg);
-               }
-               break;
-
-       default:
-               dev_warn(&hw->pdev->dev, PFX "Invalid power state (%d) ",
-                      state);
-               return;
-       }
-
-       power_control |= PCI_PM_CTRL_PME_ENABLE;
-       /* Finally, set the new power state. */
-       sky2_pci_write32(hw, hw->pm_cap + PCI_PM_CTRL, power_control);
-
-       sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
-       sky2_pci_read32(hw, B0_CTST);
-}
-
 static void sky2_gmac_reset(struct sky2_hw *hw, unsigned port)
 {
        u16 reg;
@@ -709,6 +629,11 @@ static void sky2_phy_power_up(struct sky2_hw *hw, unsigned port)
        sky2_pci_write32(hw, PCI_DEV_REG1, reg1);
        sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
        sky2_pci_read32(hw, PCI_DEV_REG1);
+
+       if (hw->chip_id == CHIP_ID_YUKON_FE)
+               gm_phy_write(hw, port, PHY_MARV_CTRL, PHY_CT_ANE);
+       else if (hw->flags & SKY2_HW_ADV_POWER_CTL)
+               sky2_write8(hw, SK_REG(port, GPHY_CTRL), GPC_RST_CLR);
 }
 
 static void sky2_phy_power_down(struct sky2_hw *hw, unsigned port)
@@ -2855,10 +2780,6 @@ static int __devinit sky2_init(struct sky2_hw *hw)
                hw->flags = SKY2_HW_GIGABIT
                        | SKY2_HW_NEWER_PHY
                        | SKY2_HW_ADV_POWER_CTL;
-
-               /* check for Rev. A1 dev 4200 */
-               if (sky2_read16(hw, Q_ADDR(Q_XA1, Q_WM)) == 0)
-                       hw->flags |= SKY2_HW_CLK_POWER;
                break;
 
        case CHIP_ID_YUKON_EX:
@@ -2914,12 +2835,6 @@ static int __devinit sky2_init(struct sky2_hw *hw)
        if (hw->pmd_type == 'L' || hw->pmd_type == 'S' || hw->pmd_type == 'P')
                hw->flags |= SKY2_HW_FIBRE_PHY;
 
-       hw->pm_cap = pci_find_capability(hw->pdev, PCI_CAP_ID_PM);
-       if (hw->pm_cap == 0) {
-               dev_err(&hw->pdev->dev, "cannot find PowerManagement capability\n");
-               return -EIO;
-       }
-
        hw->ports = 1;
        t8 = sky2_read8(hw, B2_Y2_HW_RES);
        if ((t8 & CFG_DUAL_MAC_MSK) == CFG_DUAL_MAC_MSK) {
@@ -4512,7 +4427,7 @@ static int sky2_suspend(struct pci_dev *pdev, pm_message_t state)
 
        pci_save_state(pdev);
        pci_enable_wake(pdev, pci_choose_state(pdev, state), wol);
-       sky2_power_state(hw, pci_choose_state(pdev, state));
+       pci_set_power_state(pdev, pci_choose_state(pdev, state));
 
        return 0;
 }
@@ -4525,7 +4440,9 @@ static int sky2_resume(struct pci_dev *pdev)
        if (!hw)
                return 0;
 
-       sky2_power_state(hw, PCI_D0);
+       err = pci_set_power_state(pdev, PCI_D0);
+       if (err)
+               goto out;
 
        err = pci_restore_state(pdev);
        if (err)
@@ -4595,7 +4512,7 @@ static void sky2_shutdown(struct pci_dev *pdev)
        pci_enable_wake(pdev, PCI_D3cold, wol);
 
        pci_disable_device(pdev);
-       sky2_power_state(hw, PCI_D3hot);
+       pci_set_power_state(pdev, PCI_D3hot);
 }
 
 static struct pci_driver sky2_driver = {
index 4d9c4a1..92fb24b 100644 (file)
@@ -2072,9 +2072,7 @@ struct sky2_hw {
 #define SKY2_HW_NEW_LE         0x00000020      /* new LSOv2 format */
 #define SKY2_HW_AUTO_TX_SUM    0x00000040      /* new IP decode for Tx */
 #define SKY2_HW_ADV_POWER_CTL  0x00000080      /* additional PHY power regs */
-#define SKY2_HW_CLK_POWER      0x00000100      /* clock power management */
 
-       int                  pm_cap;
        u8                   chip_id;
        u8                   chip_rev;
        u8                   pmd_type;
index 9b2a7f7..e531302 100644 (file)
@@ -425,14 +425,11 @@ static int init586(struct net_device *dev)
                int len = ((char *) p->iscp - (char *) ptr - 8) / 6;
                if(num_addrs > len)     {
                        printk("%s: switching to promisc. mode\n",dev->name);
-                       dev->flags|=IFF_PROMISC;
+                       cfg_cmd->promisc = 1;
                }
        }
        if(dev->flags&IFF_PROMISC)
-       {
-                        cfg_cmd->promisc=1;
-                        dev->flags|=IFF_PROMISC;
-       }
+               cfg_cmd->promisc = 1;
        cfg_cmd->carr_coll      = 0x00;
 
        p->scb->cbl_offset      = make16(cfg_cmd);
index b588c89..a84ba48 100644 (file)
@@ -1285,6 +1285,21 @@ static void check_carrier(struct work_struct *work)
        }
 }
 
+static int pegasus_blacklisted(struct usb_device *udev)
+{
+       struct usb_device_descriptor *udd = &udev->descriptor;
+
+       /* Special quirk to keep the driver from handling the Belkin Bluetooth
+        * dongle which happens to have the same ID.
+        */
+       if ((udd->idVendor == VENDOR_BELKIN && udd->idProduct == 0x0121) &&
+           (udd->bDeviceClass == USB_CLASS_WIRELESS_CONTROLLER) &&
+           (udd->bDeviceProtocol == 1))
+               return 1;
+
+       return 0;
+}
+
 static int pegasus_probe(struct usb_interface *intf,
                         const struct usb_device_id *id)
 {
@@ -1296,6 +1311,12 @@ static int pegasus_probe(struct usb_interface *intf,
        DECLARE_MAC_BUF(mac);
 
        usb_get_dev(dev);
+
+       if (pegasus_blacklisted(dev)) {
+               res = -ENODEV;
+               goto out;
+       }
+
        net = alloc_etherdev(sizeof(struct pegasus));
        if (!net) {
                dev_err(&intf->dev, "can't allocate %s\n", "device");
index 370ce30..007c129 100644 (file)
@@ -662,6 +662,10 @@ static void velocity_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid
         spin_unlock_irq(&vptr->lock);
 }
 
+static void velocity_init_rx_ring_indexes(struct velocity_info *vptr)
+{
+       vptr->rx.dirty = vptr->rx.filled = vptr->rx.curr = 0;
+}
 
 /**
  *     velocity_rx_reset       -       handle a receive reset
@@ -677,16 +681,16 @@ static void velocity_rx_reset(struct velocity_info *vptr)
        struct mac_regs __iomem * regs = vptr->mac_regs;
        int i;
 
-       vptr->rd_dirty = vptr->rd_filled = vptr->rd_curr = 0;
+       velocity_init_rx_ring_indexes(vptr);
 
        /*
         *      Init state, all RD entries belong to the NIC
         */
        for (i = 0; i < vptr->options.numrx; ++i)
-               vptr->rd_ring[i].rdesc0.len |= OWNED_BY_NIC;
+               vptr->rx.ring[i].rdesc0.len |= OWNED_BY_NIC;
 
        writew(vptr->options.numrx, &regs->RBRDU);
-       writel(vptr->rd_pool_dma, &regs->RDBaseLo);
+       writel(vptr->rx.pool_dma, &regs->RDBaseLo);
        writew(0, &regs->RDIdx);
        writew(vptr->options.numrx - 1, &regs->RDCSize);
 }
@@ -779,15 +783,15 @@ static void velocity_init_registers(struct velocity_info *vptr,
 
                vptr->int_mask = INT_MASK_DEF;
 
-               writel(vptr->rd_pool_dma, &regs->RDBaseLo);
+               writel(vptr->rx.pool_dma, &regs->RDBaseLo);
                writew(vptr->options.numrx - 1, &regs->RDCSize);
                mac_rx_queue_run(regs);
                mac_rx_queue_wake(regs);
 
                writew(vptr->options.numtx - 1, &regs->TDCSize);
 
-               for (i = 0; i < vptr->num_txq; i++) {
-                       writel(vptr->td_pool_dma[i], &regs->TDBaseLo[i]);
+               for (i = 0; i < vptr->tx.numq; i++) {
+                       writel(vptr->tx.pool_dma[i], &regs->TDBaseLo[i]);
                        mac_tx_queue_run(regs, i);
                }
 
@@ -1047,7 +1051,7 @@ static void __devinit velocity_init_info(struct pci_dev *pdev,
 
        vptr->pdev = pdev;
        vptr->chip_id = info->chip_id;
-       vptr->num_txq = info->txqueue;
+       vptr->tx.numq = info->txqueue;
        vptr->multicast_limit = MCAM_SIZE;
        spin_lock_init(&vptr->lock);
        INIT_LIST_HEAD(&vptr->list);
@@ -1093,14 +1097,14 @@ static int __devinit velocity_get_pci_info(struct velocity_info *vptr, struct pc
 }
 
 /**
- *     velocity_init_rings     -       set up DMA rings
+ *     velocity_init_dma_rings -       set up DMA rings
  *     @vptr: Velocity to set up
  *
  *     Allocate PCI mapped DMA rings for the receive and transmit layer
  *     to use.
  */
 
-static int velocity_init_rings(struct velocity_info *vptr)
+static int velocity_init_dma_rings(struct velocity_info *vptr)
 {
        struct velocity_opt *opt = &vptr->options;
        const unsigned int rx_ring_size = opt->numrx * sizeof(struct rx_desc);
@@ -1116,7 +1120,7 @@ static int velocity_init_rings(struct velocity_info *vptr)
         * pci_alloc_consistent() fulfills the requirement for 64 bytes
         * alignment
         */
-       pool = pci_alloc_consistent(pdev, tx_ring_size * vptr->num_txq +
+       pool = pci_alloc_consistent(pdev, tx_ring_size * vptr->tx.numq +
                                    rx_ring_size, &pool_dma);
        if (!pool) {
                dev_err(&pdev->dev, "%s : DMA memory allocation failed.\n",
@@ -1124,15 +1128,15 @@ static int velocity_init_rings(struct velocity_info *vptr)
                return -ENOMEM;
        }
 
-       vptr->rd_ring = pool;
-       vptr->rd_pool_dma = pool_dma;
+       vptr->rx.ring = pool;
+       vptr->rx.pool_dma = pool_dma;
 
        pool += rx_ring_size;
        pool_dma += rx_ring_size;
 
-       for (i = 0; i < vptr->num_txq; i++) {
-               vptr->td_rings[i] = pool;
-               vptr->td_pool_dma[i] = pool_dma;
+       for (i = 0; i < vptr->tx.numq; i++) {
+               vptr->tx.rings[i] = pool;
+               vptr->tx.pool_dma[i] = pool_dma;
                pool += tx_ring_size;
                pool_dma += tx_ring_size;
        }
@@ -1141,18 +1145,18 @@ static int velocity_init_rings(struct velocity_info *vptr)
 }
 
 /**
- *     velocity_free_rings     -       free PCI ring pointers
+ *     velocity_free_dma_rings -       free PCI ring pointers
  *     @vptr: Velocity to free from
  *
  *     Clean up the PCI ring buffers allocated to this velocity.
  */
 
-static void velocity_free_rings(struct velocity_info *vptr)
+static void velocity_free_dma_rings(struct velocity_info *vptr)
 {
        const int size = vptr->options.numrx * sizeof(struct rx_desc) +
-               vptr->options.numtx * sizeof(struct tx_desc) * vptr->num_txq;
+               vptr->options.numtx * sizeof(struct tx_desc) * vptr->tx.numq;
 
-       pci_free_consistent(vptr->pdev, size, vptr->rd_ring, vptr->rd_pool_dma);
+       pci_free_consistent(vptr->pdev, size, vptr->rx.ring, vptr->rx.pool_dma);
 }
 
 static void velocity_give_many_rx_descs(struct velocity_info *vptr)
@@ -1164,44 +1168,44 @@ static void velocity_give_many_rx_descs(struct velocity_info *vptr)
         * RD number must be equal to 4X per hardware spec
         * (programming guide rev 1.20, p.13)
         */
-       if (vptr->rd_filled < 4)
+       if (vptr->rx.filled < 4)
                return;
 
        wmb();
 
-       unusable = vptr->rd_filled & 0x0003;
-       dirty = vptr->rd_dirty - unusable;
-       for (avail = vptr->rd_filled & 0xfffc; avail; avail--) {
+       unusable = vptr->rx.filled & 0x0003;
+       dirty = vptr->rx.dirty - unusable;
+       for (avail = vptr->rx.filled & 0xfffc; avail; avail--) {
                dirty = (dirty > 0) ? dirty - 1 : vptr->options.numrx - 1;
-               vptr->rd_ring[dirty].rdesc0.len |= OWNED_BY_NIC;
+               vptr->rx.ring[dirty].rdesc0.len |= OWNED_BY_NIC;
        }
 
-       writew(vptr->rd_filled & 0xfffc, &regs->RBRDU);
-       vptr->rd_filled = unusable;
+       writew(vptr->rx.filled & 0xfffc, &regs->RBRDU);
+       vptr->rx.filled = unusable;
 }
 
 static int velocity_rx_refill(struct velocity_info *vptr)
 {
-       int dirty = vptr->rd_dirty, done = 0;
+       int dirty = vptr->rx.dirty, done = 0;
 
        do {
-               struct rx_desc *rd = vptr->rd_ring + dirty;
+               struct rx_desc *rd = vptr->rx.ring + dirty;
 
                /* Fine for an all zero Rx desc at init time as well */
                if (rd->rdesc0.len & OWNED_BY_NIC)
                        break;
 
-               if (!vptr->rd_info[dirty].skb) {
+               if (!vptr->rx.info[dirty].skb) {
                        if (velocity_alloc_rx_buf(vptr, dirty) < 0)
                                break;
                }
                done++;
                dirty = (dirty < vptr->options.numrx - 1) ? dirty + 1 : 0;
-       } while (dirty != vptr->rd_curr);
+       } while (dirty != vptr->rx.curr);
 
        if (done) {
-               vptr->rd_dirty = dirty;
-               vptr->rd_filled += done;
+               vptr->rx.dirty = dirty;
+               vptr->rx.filled += done;
        }
 
        return done;
@@ -1209,7 +1213,7 @@ static int velocity_rx_refill(struct velocity_info *vptr)
 
 static void velocity_set_rxbufsize(struct velocity_info *vptr, int mtu)
 {
-       vptr->rx_buf_sz = (mtu <= ETH_DATA_LEN) ? PKT_BUF_SZ : mtu + 32;
+       vptr->rx.buf_sz = (mtu <= ETH_DATA_LEN) ? PKT_BUF_SZ : mtu + 32;
 }
 
 /**
@@ -1224,12 +1228,12 @@ static int velocity_init_rd_ring(struct velocity_info *vptr)
 {
        int ret = -ENOMEM;
 
-       vptr->rd_info = kcalloc(vptr->options.numrx,
+       vptr->rx.info = kcalloc(vptr->options.numrx,
                                sizeof(struct velocity_rd_info), GFP_KERNEL);
-       if (!vptr->rd_info)
+       if (!vptr->rx.info)
                goto out;
 
-       vptr->rd_filled = vptr->rd_dirty = vptr->rd_curr = 0;
+       velocity_init_rx_ring_indexes(vptr);
 
        if (velocity_rx_refill(vptr) != vptr->options.numrx) {
                VELOCITY_PRT(MSG_LEVEL_ERR, KERN_ERR
@@ -1255,18 +1259,18 @@ static void velocity_free_rd_ring(struct velocity_info *vptr)
 {
        int i;
 
-       if (vptr->rd_info == NULL)
+       if (vptr->rx.info == NULL)
                return;
 
        for (i = 0; i < vptr->options.numrx; i++) {
-               struct velocity_rd_info *rd_info = &(vptr->rd_info[i]);
-               struct rx_desc *rd = vptr->rd_ring + i;
+               struct velocity_rd_info *rd_info = &(vptr->rx.info[i]);
+               struct rx_desc *rd = vptr->rx.ring + i;
 
                memset(rd, 0, sizeof(*rd));
 
                if (!rd_info->skb)
                        continue;
-               pci_unmap_single(vptr->pdev, rd_info->skb_dma, vptr->rx_buf_sz,
+               pci_unmap_single(vptr->pdev, rd_info->skb_dma, vptr->rx.buf_sz,
                                 PCI_DMA_FROMDEVICE);
                rd_info->skb_dma = (dma_addr_t) NULL;
 
@@ -1274,8 +1278,8 @@ static void velocity_free_rd_ring(struct velocity_info *vptr)
                rd_info->skb = NULL;
        }
 
-       kfree(vptr->rd_info);
-       vptr->rd_info = NULL;
+       kfree(vptr->rx.info);
+       vptr->rx.info = NULL;
 }
 
 /**
@@ -1293,19 +1297,19 @@ static int velocity_init_td_ring(struct velocity_info *vptr)
        unsigned int j;
 
        /* Init the TD ring entries */
-       for (j = 0; j < vptr->num_txq; j++) {
-               curr = vptr->td_pool_dma[j];
+       for (j = 0; j < vptr->tx.numq; j++) {
+               curr = vptr->tx.pool_dma[j];
 
-               vptr->td_infos[j] = kcalloc(vptr->options.numtx,
+               vptr->tx.infos[j] = kcalloc(vptr->options.numtx,
                                            sizeof(struct velocity_td_info),
                                            GFP_KERNEL);
-               if (!vptr->td_infos[j]) {
+               if (!vptr->tx.infos[j]) {
                        while(--j >= 0)
-  &nbs