* Re: [BK PATCHES] 2.6.x net driver fixes
[not found] ` <40F58EFD.7080904@pobox.com>
@ 2004-07-14 21:28 ` Linus Torvalds
0 siblings, 0 replies; 13+ messages in thread
From: Linus Torvalds @ 2004-07-14 21:28 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Andrew Morton, netdev
On Wed, 14 Jul 2004, Jeff Garzik wrote:
> >
> > The weaker ordering constraint is called "read_barrier_depends()", and
> > should be a no-op on all but alpha. Would you want to use that to fix the
> > alpha case too?
>
> What would the proper fix be?
>
> rmb();
> read_barrier_depends();
No, just a
index = *indexpointer;
read_barrier_depends();
data = dataptr[index];
which on most architectures is a no-op, but in case the hardware might do
data or address speculation, and needs a dependent load barrier, it will
do the right thing.
For stuff that isn't data dependent, you have to use the full rmb(), which
obviously isn't a no-op on most setups.
Linus
^ permalink raw reply [flat|nested] 13+ messages in thread
* [BK PATCHES] 2.6.x net driver fixes
@ 2004-09-04 2:56 Jeff Garzik
0 siblings, 0 replies; 13+ messages in thread
From: Jeff Garzik @ 2004-09-04 2:56 UTC (permalink / raw)
To: akpm, torvalds; +Cc: netdev
Please do a
bk pull bk://gkernel.bkbits.net/net-drivers-2.6
This will update the following files:
drivers/net/3c527.c | 13 ++----
drivers/net/8139cp.c | 2 -
drivers/net/forcedeth.c | 78 +++++++++++++++++++++++++++--------------
drivers/net/r8169.c | 2 -
drivers/net/wireless/airo.c | 1
drivers/net/wireless/wavelan.c | 11 +++--
6 files changed, 66 insertions(+), 41 deletions(-)
through these ChangeSets:
<manfred@colorfullife.com> (04/09/03 1.2021)
[PATCH] fix media detection for nForce 2 nics
attached is a patch that polls the media setting for non GigE nForce
nics:
Without polling, media changes are not autodetected. This is fatal,
because the nic initialization is asynchroneous, thus "modprobe;ifup"
resulted in a dead network connection. The attached patch fixes that
problem.
It's a repost of a patch I sent around three weeks ago: you objected
that I rely on the nic irq instead of a software timer. I've documented
why this is ok.
<akpm@osdl.org> (04/09/03 1.2020)
[PATCH] airo build fix
drivers/net/wireless/airo.c: In function `issuecommand':
drivers/net/wireless/airo.c:3812: warning: implicit declaration of function `kernel_locked'
*** Warning: "kernel_locked" [drivers/net/wireless/airo.ko] undefined!
Signed-off-by: Andrew Morton <akpm@osdl.org>
<davej@redhat.com> (04/09/03 1.2019)
[PATCH] wavelan uninitalised var.
This seems a little odd, printing out the value of a variable
we haven't read yet.
Signed-off-by: Dave Jones <davej@redhat.com>
<davej@redhat.com> (04/09/03 1.2018)
[PATCH] 3c527 possible oops.
If the alloc_skb() fails, we dereference it in the skb_reserve() call.
Move the skb_reserve() call to after the NULL check.
Also clean up some CodingStyle violations whilst in the vicinity.
Signed-off-by: Dave Jones <davej@redhat.com>
<jgarzik@pobox.com> (04/08/31 1.1860.2.1)
[netdrvr 8139cp,r8169] fix dma_addr_t sizeof test
diff -Nru a/drivers/net/3c527.c b/drivers/net/3c527.c
--- a/drivers/net/3c527.c 2004-09-03 22:20:03 -04:00
+++ b/drivers/net/3c527.c 2004-09-03 22:20:03 -04:00
@@ -751,18 +751,15 @@
rx_base=lp->rx_chain;
- for(i=0; i<RX_RING_LEN; i++)
- {
+ for(i=0; i<RX_RING_LEN; i++) {
lp->rx_ring[i].skb=alloc_skb(1532, GFP_KERNEL);
- skb_reserve(lp->rx_ring[i].skb, 18);
-
- if(lp->rx_ring[i].skb==NULL)
- {
- for(;i>=0;i--)
+ if (lp->rx_ring[i].skb==NULL) {
+ for (;i>=0;i--)
kfree_skb(lp->rx_ring[i].skb);
return -ENOBUFS;
}
-
+ skb_reserve(lp->rx_ring[i].skb, 18);
+
p=isa_bus_to_virt(lp->base+rx_base);
p->control=0;
diff -Nru a/drivers/net/8139cp.c b/drivers/net/8139cp.c
--- a/drivers/net/8139cp.c 2004-09-03 22:20:03 -04:00
+++ b/drivers/net/8139cp.c 2004-09-03 22:20:03 -04:00
@@ -1698,7 +1698,7 @@
}
/* Configure DMA attributes. */
- if ((sizeof(dma_addr_t) > 32) &&
+ if ((sizeof(dma_addr_t) > 4) &&
!pci_set_consistent_dma_mask(pdev, 0xffffffffffffffffULL) &&
!pci_set_dma_mask(pdev, 0xffffffffffffffffULL)) {
pci_using_dac = 1;
diff -Nru a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
--- a/drivers/net/forcedeth.c 2004-09-03 22:20:03 -04:00
+++ b/drivers/net/forcedeth.c 2004-09-03 22:20:03 -04:00
@@ -75,6 +75,7 @@
* added CK804/MCP04 device IDs, code fixes
* for registers, link status and other minor fixes.
* 0.28: 21 Jun 2004: Big cleanup, making driver mostly endian safe
+ * 0.29: 31 Aug 2004: Add backup timer for link change notification.
*
* Known bugs:
* We suspect that on some hardware no TX done interrupts are generated.
@@ -86,7 +87,7 @@
* DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few
* superfluous timer interrupts from the nic.
*/
-#define FORCEDETH_VERSION "0.28"
+#define FORCEDETH_VERSION "0.29"
#define DRV_NAME "forcedeth"
#include <linux/module.h>
@@ -120,10 +121,11 @@
* Hardware access:
*/
-#define DEV_NEED_LASTPACKET1 0x0001
-#define DEV_IRQMASK_1 0x0002
-#define DEV_IRQMASK_2 0x0004
-#define DEV_NEED_TIMERIRQ 0x0008
+#define DEV_NEED_LASTPACKET1 0x0001 /* set LASTPACKET1 in tx flags */
+#define DEV_IRQMASK_1 0x0002 /* use NVREG_IRQMASK_WANTED_1 for irq mask */
+#define DEV_IRQMASK_2 0x0004 /* use NVREG_IRQMASK_WANTED_2 for irq mask */
+#define DEV_NEED_TIMERIRQ 0x0008 /* set the timer irq flag in the irq mask */
+#define DEV_NEED_LINKTIMER 0x0010 /* poll link settings. Relies on the timer irq */
enum {
NvRegIrqStatus = 0x000,
@@ -367,6 +369,7 @@
#define OOM_REFILL (1+HZ/20)
#define POLL_WAIT (1+HZ/100)
+#define LINK_TIMEOUT (3*HZ)
#define DESC_VER_1 0x0
#define DESC_VER_2 0x02100
@@ -446,6 +449,11 @@
struct timer_list oom_kick;
struct timer_list nic_poll;
+ /* media detection workaround.
+ * Locking: Within irq hander or disable_irq+spin_lock(&np->lock);
+ */
+ int need_linktimer;
+ unsigned long link_timeout;
/*
* tx specific fields.
*/
@@ -1384,6 +1392,25 @@
return retval;
}
+static void nv_linkchange(struct net_device *dev)
+{
+ if (nv_update_linkspeed(dev)) {
+ if (netif_carrier_ok(dev)) {
+ nv_stop_rx(dev);
+ } else {
+ netif_carrier_on(dev);
+ printk(KERN_INFO "%s: link up.\n", dev->name);
+ }
+ nv_start_rx(dev);
+ } else {
+ if (netif_carrier_ok(dev)) {
+ netif_carrier_off(dev);
+ printk(KERN_INFO "%s: link down.\n", dev->name);
+ nv_stop_rx(dev);
+ }
+ }
+}
+
static void nv_link_irq(struct net_device *dev)
{
u8 *base = get_hwbase(dev);
@@ -1391,25 +1418,10 @@
miistat = readl(base + NvRegMIIStatus);
writel(NVREG_MIISTAT_MASK, base + NvRegMIIStatus);
- dprintk(KERN_DEBUG "%s: link change notification, status 0x%x.\n", dev->name, miistat);
+ dprintk(KERN_INFO "%s: link change irq, status 0x%x.\n", dev->name, miistat);
- if (miistat & (NVREG_MIISTAT_LINKCHANGE)) {
- if (nv_update_linkspeed(dev)) {
- if (netif_carrier_ok(dev)) {
- nv_stop_rx(dev);
- } else {
- netif_carrier_on(dev);
- printk(KERN_INFO "%s: link up.\n", dev->name);
- }
- nv_start_rx(dev);
- } else {
- if (netif_carrier_ok(dev)) {
- netif_carrier_off(dev);
- printk(KERN_INFO "%s: link down.\n", dev->name);
- nv_stop_rx(dev);
- }
- }
- }
+ if (miistat & (NVREG_MIISTAT_LINKCHANGE))
+ nv_linkchange(dev);
dprintk(KERN_DEBUG "%s: link change notification done.\n", dev->name);
}
@@ -1452,6 +1464,12 @@
nv_link_irq(dev);
spin_unlock(&np->lock);
}
+ if (np->need_linktimer && time_after(jiffies, np->link_timeout)) {
+ spin_lock(&np->lock);
+ nv_linkchange(dev);
+ spin_unlock(&np->lock);
+ np->link_timeout = jiffies + LINK_TIMEOUT;
+ }
if (events & (NVREG_IRQ_TX_ERR)) {
dprintk(KERN_DEBUG "%s: received irq with events 0x%x. Probably TX fail.\n",
dev->name, events);
@@ -1816,6 +1834,14 @@
np->irqmask = NVREG_IRQMASK_WANTED_2;
if (id->driver_data & DEV_NEED_TIMERIRQ)
np->irqmask |= NVREG_IRQ_TIMER;
+ if (id->driver_data & DEV_NEED_LINKTIMER) {
+ dprintk(KERN_INFO "%s: link timer on.\n", pci_name(pci_dev));
+ np->need_linktimer = 1;
+ np->link_timeout = jiffies + LINK_TIMEOUT;
+ } else {
+ dprintk(KERN_INFO "%s: link timer off.\n", pci_name(pci_dev));
+ np->need_linktimer = 0;
+ }
/* find a suitable phy */
for (i = 1; i < 32; i++) {
@@ -1909,21 +1935,21 @@
.device = PCI_DEVICE_ID_NVIDIA_NVENET_1,
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
- .driver_data = DEV_IRQMASK_1|DEV_NEED_TIMERIRQ,
+ .driver_data = DEV_IRQMASK_1|DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER,
},
{ /* nForce2 Ethernet Controller */
.vendor = PCI_VENDOR_ID_NVIDIA,
.device = PCI_DEVICE_ID_NVIDIA_NVENET_2,
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
- .driver_data = DEV_NEED_LASTPACKET1|DEV_IRQMASK_2|DEV_NEED_TIMERIRQ,
+ .driver_data = DEV_NEED_LASTPACKET1|DEV_IRQMASK_2|DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER,
},
{ /* nForce3 Ethernet Controller */
.vendor = PCI_VENDOR_ID_NVIDIA,
.device = PCI_DEVICE_ID_NVIDIA_NVENET_3,
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
- .driver_data = DEV_NEED_LASTPACKET1|DEV_IRQMASK_2|DEV_NEED_TIMERIRQ,
+ .driver_data = DEV_NEED_LASTPACKET1|DEV_IRQMASK_2|DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER,
},
{ /* nForce3 Ethernet Controller */
.vendor = PCI_VENDOR_ID_NVIDIA,
diff -Nru a/drivers/net/r8169.c b/drivers/net/r8169.c
--- a/drivers/net/r8169.c 2004-09-03 22:20:03 -04:00
+++ b/drivers/net/r8169.c 2004-09-03 22:20:03 -04:00
@@ -983,7 +983,7 @@
tp->cp_cmd = PCIMulRW | RxChkSum;
- if ((sizeof(dma_addr_t) > 32) &&
+ if ((sizeof(dma_addr_t) > 4) &&
!pci_set_dma_mask(pdev, DMA_64BIT_MASK))
tp->cp_cmd |= PCIDAC;
else {
diff -Nru a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
--- a/drivers/net/wireless/airo.c 2004-09-03 22:20:03 -04:00
+++ b/drivers/net/wireless/airo.c 2004-09-03 22:20:03 -04:00
@@ -25,6 +25,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/proc_fs.h>
+#include <linux/smp_lock.h>
#include <linux/sched.h>
#include <linux/ptrace.h>
diff -Nru a/drivers/net/wireless/wavelan.c b/drivers/net/wireless/wavelan.c
--- a/drivers/net/wireless/wavelan.c 2004-09-03 22:20:03 -04:00
+++ b/drivers/net/wireless/wavelan.c 2004-09-03 22:20:03 -04:00
@@ -3822,17 +3822,18 @@
if ((hasr & HASR_MMC_INTR) && (lp->hacr & HACR_MMC_INT_ENABLE)) {
u8 dce_status;
-#ifdef DEBUG_INTERRUPT_ERROR
- printk(KERN_INFO
- "%s: wavelan_interrupt(): unexpected mmc interrupt: status 0x%04x.\n",
- dev->name, dce_status);
-#endif
/*
* Interrupt from the modem management controller.
* This will clear it -- ignored for now.
*/
mmc_read(ioaddr, mmroff(0, mmr_dce_status), &dce_status,
sizeof(dce_status));
+
+#ifdef DEBUG_INTERRUPT_ERROR
+ printk(KERN_INFO
+ "%s: wavelan_interrupt(): unexpected mmc interrupt: status 0x%04x.\n",
+ dev->name, dce_status);
+#endif
}
/* Check if not controller interrupt */
^ permalink raw reply [flat|nested] 13+ messages in thread
* [BK PATCHES] 2.6.x net driver fixes
@ 2004-10-04 22:08 Jeff Garzik
0 siblings, 0 replies; 13+ messages in thread
From: Jeff Garzik @ 2004-10-04 22:08 UTC (permalink / raw)
To: Andrew Morton, Linus Torvalds; +Cc: netdev
Got a big queue waiting for 2.6.9 release...
Please do a
bk pull bk://gkernel.bkbits.net/net-drivers-2.6
This will update the following files:
drivers/net/3c59x.c | 7 ++++
drivers/net/tokenring/Kconfig | 3 +
drivers/net/tokenring/olympic.c | 63 +++++++++++-----------------------------
drivers/net/via-velocity.c | 60 +++++++++++++++++++-------------------
drivers/net/via-velocity.h | 7 +---
5 files changed, 60 insertions(+), 80 deletions(-)
through these ChangeSets:
<romieu@fr.zoreil.com> (04/10/04 1.2057)
[PATCH] via-velocity: comment fixes
Comment fixes.
Signed-off-by: Tejun Heo <tj@home-tj.org>
<romieu@fr.zoreil.com> (04/10/04 1.2056)
[PATCH] via-velocity: wrong buffer offset in velocity_init_td_ring()
Buffer offset calculation was incorrect in velocity_init_td_ring().
This didn't cause any trouble because we only use the first td ring.
Signed-off-by: Tejun Heo <tj@home-tj.org>
<romieu@fr.zoreil.com> (04/10/04 1.2055)
[PATCH] via-velocity: removal of incomplete endianness handling
Removed cpu_to_le32 call on OWNED_BY_NIC. This will produce 0x01000000 on
big endian machines while rdesc0.owner still evaluates to 0x00000000 or
0x00000001. BTW, unless we reorder bit fields on big endian machines or
use u32's and cpu_to_le32'd bit mask macros, current code won't work on big
endian machines.
Signed-off-by: Tejun Heo <tj@home-tj.org>
<romieu@fr.zoreil.com> (04/10/04 1.2054)
[PATCH] via-velocity: early invocation of init_cam_filter()
In velocity_init_registers(), init_cam_filter() clears mCAMmask which
might have been set by set_multi() (not sure if this can ever occur).
Modified to invoke init_cam_filter() first. Also, clear_isr() is called
twice. Removed the first invocation.
In velocity_found1(), there was a unneeded assignment from vptr to
dev->priv. Removed.
Signed-off-by: Tejun Heo <tj@home-tj.org>
<romieu@fr.zoreil.com> (04/10/04 1.2053)
[PATCH] via-velocity: received ring wrong index and missing barriers
There were several receive ring related bugs.
In velocity_give_many_rx_descs(), index calculation was incorrect.
This and bugs in velocity_rx_srv() described in the following paragraph
caused packet loss, truncation and infinite error interrupt generation.
In velocity_rx_srv(), velocity_rx_refill() could be called without any
dirty slot. With proper timing, This can result in refilling yet
unreceived packets and pushing dirty pointer ahead of the current pointer.
And vptr->rd_curr which is used by velocity_rx_refill() was updated after
calling velocity_rx_refill() thus screwing receive descriptor ring.
Also, between checking owner and reading the packet, rmb() is missing.
Signed-off-by: Tejun Heo <tj@home-tj.org>
<romieu@fr.zoreil.com> (04/10/04 1.2052)
[PATCH] via-velocity: velocity_give_rx_desc() removal
In velocity_give_rx_desc(), there should be a wmb() between resetting the
first four bytes of rdesc0 and setting owner. As resetting the first four
bytes isn't necessary, I just removed the function and directly set owner.
Another rationale for removing the function:
The function doesn't handle synchronization. We should do wmb() before
calling the function. So, I think using bare assignment makes the fact
more explicit.
Signed-off-by: Tejun Heo <tj@home-tj.org>
<romieu@fr.zoreil.com> (04/10/04 1.2051)
[PATCH] via-velocity: removal of unused velocity_info.xmit_lock
Removed unused velocity_info.xmit_lock.
Signed-off-by: Tejun Heo <tj@home-tj.org>
<romieu@fr.zoreil.com> (04/10/04 1.2050)
[PATCH] via-velocity: properly manage the count of adapters
velocity_nics wasn't managed properly.
Signed-off-by: Tejun Heo <tj@home-tj.org>
<nhorman@redhat.com> (04/10/04 1.2009.4.3)
[PATCH] olympic driver: fix kernel oops on lobe fault
Hey-
I had submitted this awhile ago and after it didn't appear to get
accepted, I found that I had boned the submission format pretty bad. So I'm
making another pass at it. Its the same patch, applies cleanly to 2.6.9-rc3,
and it fixes the oops that olympic driver encounters when it gets a lobe fault.
I've tested it, with good results.
Thanks
Neil
Signed-off-by: Neil Horman <nhorman@redhat.com>
<alan@redhat.com> (04/09/30 1.2009.4.2)
[PATCH] 3c59x: add invalid MAC address check
<bunk@fs.tum.de> (04/09/20 1.1923.1.6)
[PATCH] TMS380TR must select FW_LOADER
I got the following compile error with CONFIG_FW_LOADER=n:
<-- snip -->
...
LD .tmp_vmlinux1
drivers/built-in.o(.text+0x297944): In function `tms380tr_reset_adapter':
: undefined reference to `request_firmware'
drivers/built-in.o(.text+0x297aaf): In function `tms380tr_reset_adapter':
: undefined reference to `release_firmware'
drivers/built-in.o(.text+0x297af9): In function `tms380tr_reset_adapter':
: undefined reference to `release_firmware'
make: *** [.tmp_vmlinux1] Error 1
<-- snip -->
CONFIG_TMS380TR must select FW_LOADER (and therefore depend on HOTPLUG).
Signed-off-by: Adrian Bunk <bunk@fs.tum.de>
diff -Nru a/drivers/net/3c59x.c b/drivers/net/3c59x.c
--- a/drivers/net/3c59x.c 2004-10-04 18:07:46 -04:00
+++ b/drivers/net/3c59x.c 2004-10-04 18:07:46 -04:00
@@ -1297,6 +1297,13 @@
for (i = 0; i < 6; i++)
printk("%c%2.2x", i ? ':' : ' ', dev->dev_addr[i]);
}
+ /* Unfortunately an all zero eeprom passes the checksum and this
+ gets found in the wild in failure cases. Crypto is hard 8) */
+ if (!is_valid_ether_addr(dev->dev_addr)) {
+ retval = -EINVAL;
+ printk(KERN_ERR "*** EEPROM MAC address is invalid.\n");
+ goto free_ring; /* With every pack */
+ }
EL3WINDOW(2);
for (i = 0; i < 6; i++)
outb(dev->dev_addr[i], ioaddr + i);
diff -Nru a/drivers/net/tokenring/Kconfig b/drivers/net/tokenring/Kconfig
--- a/drivers/net/tokenring/Kconfig 2004-10-04 18:07:46 -04:00
+++ b/drivers/net/tokenring/Kconfig 2004-10-04 18:07:46 -04:00
@@ -84,7 +84,8 @@
config TMS380TR
tristate "Generic TMS380 Token Ring ISA/PCI adapter support"
- depends on TR && (PCI || ISA)
+ depends on TR && (PCI || ISA) && HOTPLUG
+ select FW_LOADER
---help---
This driver provides generic support for token ring adapters
based on the Texas Instruments TMS380 series chipsets. This
diff -Nru a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c
--- a/drivers/net/tokenring/olympic.c 2004-10-04 18:07:46 -04:00
+++ b/drivers/net/tokenring/olympic.c 2004-10-04 18:07:46 -04:00
@@ -221,6 +221,8 @@
olympic_priv = dev->priv ;
+ spin_lock_init(&olympic_priv->olympic_lock) ;
+
init_waitqueue_head(&olympic_priv->srb_wait);
init_waitqueue_head(&olympic_priv->trb_wait);
#if OLYMPIC_DEBUG
@@ -311,7 +313,6 @@
}
}
- spin_lock_init(&olympic_priv->olympic_lock) ;
/* Needed for cardbus */
if(!(readl(olympic_mmio+BCTL) & BCTL_MODE_INDICATOR)) {
@@ -442,6 +443,8 @@
DECLARE_WAITQUEUE(wait,current) ;
+ olympic_init(dev);
+
if(request_irq(dev->irq, &olympic_interrupt, SA_SHIRQ , "olympic", dev)) {
return -EAGAIN;
}
@@ -898,7 +901,10 @@
int i;
for(i=0;i<OLYMPIC_RX_RING_SIZE;i++) {
- dev_kfree_skb_irq(olympic_priv->rx_ring_skb[olympic_priv->rx_status_last_received]);
+ if (olympic_priv->rx_ring_skb[olympic_priv->rx_status_last_received] != NULL) {
+ dev_kfree_skb_irq(olympic_priv->rx_ring_skb[olympic_priv->rx_status_last_received]);
+ olympic_priv->rx_ring_skb[olympic_priv->rx_status_last_received] = NULL;
+ }
if (olympic_priv->olympic_rx_ring[olympic_priv->rx_status_last_received].buffer != 0xdeadbeef) {
pci_unmap_single(olympic_priv->pdev,
le32_to_cpu(olympic_priv->olympic_rx_ring[olympic_priv->rx_status_last_received].buffer),
@@ -944,9 +950,6 @@
/* Hotswap gives us this on removal */
if (sisr == 0xffffffff) {
printk(KERN_WARNING "%s: Hotswap adapter removal.\n",dev->name) ;
- olympic_freemem(dev) ;
- free_irq(dev->irq, dev) ;
- dev->stop = NULL ;
spin_unlock(&olympic_priv->olympic_lock) ;
return IRQ_NONE;
}
@@ -961,9 +964,7 @@
printk(KERN_ERR "The adapter must be reset to clear this condition.\n") ;
printk(KERN_ERR "Please report this error to the driver maintainer and/\n") ;
printk(KERN_ERR "or the linux-tr mailing list.\n") ;
- olympic_freemem(dev) ;
- free_irq(dev->irq, dev) ;
- dev->stop = NULL ;
+ wake_up_interruptible(&olympic_priv->srb_wait);
spin_unlock(&olympic_priv->olympic_lock) ;
return IRQ_HANDLED;
} /* SISR_ERR */
@@ -1006,9 +1007,6 @@
writel(readl(olympic_mmio+LAPWWC),olympic_mmio+LAPA);
adapter_check_area = olympic_priv->olympic_lap + ((readl(olympic_mmio+LAPWWC)) & (~0xf800)) ;
printk(KERN_WARNING "%s: Bytes %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",dev->name, readb(adapter_check_area+0), readb(adapter_check_area+1), readb(adapter_check_area+2), readb(adapter_check_area+3), readb(adapter_check_area+4), readb(adapter_check_area+5), readb(adapter_check_area+6), readb(adapter_check_area+7)) ;
- olympic_freemem(dev) ;
- free_irq(dev->irq, dev) ;
- dev->stop = NULL ;
spin_unlock(&olympic_priv->olympic_lock) ;
return IRQ_HANDLED;
} /* SISR_ADAPTER_CHECK */
@@ -1094,34 +1092,32 @@
writeb(0,srb+1);
writeb(OLYMPIC_CLEAR_RET_CODE,srb+2);
+ add_wait_queue(&olympic_priv->srb_wait,&wait) ;
+ set_current_state(TASK_INTERRUPTIBLE) ;
+
spin_lock_irqsave(&olympic_priv->olympic_lock,flags);
olympic_priv->srb_queued=1;
writel(LISR_SRB_CMD,olympic_mmio+LISR_SUM);
spin_unlock_irqrestore(&olympic_priv->olympic_lock,flags);
-
- t = jiffies ;
-
- add_wait_queue(&olympic_priv->srb_wait,&wait) ;
- set_current_state(TASK_INTERRUPTIBLE) ;
while(olympic_priv->srb_queued) {
- schedule() ;
+
+ t = schedule_timeout(60*HZ);
+
if(signal_pending(current)) {
printk(KERN_WARNING "%s: SRB timed out.\n",dev->name);
printk(KERN_WARNING "SISR=%x MISR=%x\n",readl(olympic_mmio+SISR),readl(olympic_mmio+LISR));
olympic_priv->srb_queued=0;
break;
}
- if ((jiffies-t) > 60*HZ) {
+
+ if (t == 0) {
printk(KERN_WARNING "%s: SRB timed out. May not be fatal. \n",dev->name) ;
- olympic_priv->srb_queued=0;
- break ;
}
- set_current_state(TASK_INTERRUPTIBLE) ;
+ olympic_priv->srb_queued=0;
}
remove_wait_queue(&olympic_priv->srb_wait,&wait) ;
- set_current_state(TASK_RUNNING) ;
olympic_priv->rx_status_last_received++;
olympic_priv->rx_status_last_received&=OLYMPIC_RX_RING_SIZE-1;
@@ -1513,29 +1509,6 @@
writel(readl(olympic_mmio+BCTL)&~(3<<13),olympic_mmio+BCTL);
netif_stop_queue(dev);
olympic_priv->srb = readw(olympic_priv->olympic_lap + LAPWWO) ;
- for(i=0;i<OLYMPIC_RX_RING_SIZE;i++) {
- dev_kfree_skb_irq(olympic_priv->rx_ring_skb[olympic_priv->rx_status_last_received]);
- if (olympic_priv->olympic_rx_ring[olympic_priv->rx_status_last_received].buffer != 0xdeadbeef) {
- pci_unmap_single(olympic_priv->pdev,
- le32_to_cpu(olympic_priv->olympic_rx_ring[olympic_priv->rx_status_last_received].buffer),
- olympic_priv->pkt_buf_sz, PCI_DMA_FROMDEVICE);
- }
- olympic_priv->rx_status_last_received++;
- olympic_priv->rx_status_last_received&=OLYMPIC_RX_RING_SIZE-1;
- }
- /* unmap rings */
- pci_unmap_single(olympic_priv->pdev, olympic_priv->rx_status_ring_dma_addr,
- sizeof(struct olympic_rx_status) * OLYMPIC_RX_RING_SIZE, PCI_DMA_FROMDEVICE);
- pci_unmap_single(olympic_priv->pdev, olympic_priv->rx_ring_dma_addr,
- sizeof(struct olympic_rx_desc) * OLYMPIC_RX_RING_SIZE, PCI_DMA_TODEVICE);
-
- pci_unmap_single(olympic_priv->pdev, olympic_priv->tx_status_ring_dma_addr,
- sizeof(struct olympic_tx_status) * OLYMPIC_TX_RING_SIZE, PCI_DMA_FROMDEVICE);
- pci_unmap_single(olympic_priv->pdev, olympic_priv->tx_ring_dma_addr,
- sizeof(struct olympic_tx_desc) * OLYMPIC_TX_RING_SIZE, PCI_DMA_TODEVICE);
-
- free_irq(dev->irq,dev);
- dev->stop=NULL;
printk(KERN_WARNING "%s: Adapter has been closed \n", dev->name) ;
} /* If serious error */
diff -Nru a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
--- a/drivers/net/via-velocity.c 2004-10-04 18:07:46 -04:00
+++ b/drivers/net/via-velocity.c 2004-10-04 18:07:46 -04:00
@@ -359,6 +359,8 @@
pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
free_netdev(dev);
+
+ velocity_nics--;
}
/**
@@ -462,7 +464,7 @@
{
struct mac_regs * regs = vptr->mac_regs;
- /* T urn on MCFG_PQEN, turn off MCFG_RTGOPT */
+ /* Turn on MCFG_PQEN, turn off MCFG_RTGOPT */
WORD_REG_BITS_SET(MCFG_PQEN, MCFG_RTGOPT, ®s->MCFG);
WORD_REG_BITS_ON(MCFG_VIDFR, ®s->MCFG);
@@ -490,12 +492,6 @@
}
}
-static inline void velocity_give_rx_desc(struct rx_desc *rd)
-{
- *(u32 *)&rd->rdesc0 = 0;
- rd->rdesc0.owner = cpu_to_le32(OWNED_BY_NIC);
-}
-
/**
* velocity_rx_reset - handle a receive reset
* @vptr: velocity we are resetting
@@ -516,7 +512,7 @@
* Init state, all RD entries belong to the NIC
*/
for (i = 0; i < vptr->options.numrx; ++i)
- velocity_give_rx_desc(vptr->rd_ring + i);
+ vptr->rd_ring[i].rdesc0.owner = OWNED_BY_NIC;
writew(vptr->options.numrx, ®s->RBRDU);
writel(vptr->rd_pool_dma, ®s->RDBaseLo);
@@ -591,11 +587,16 @@
writeb(WOLCFG_SAM | WOLCFG_SAB, ®s->WOLCFGSet);
/*
- * Bback off algorithm use original IEEE standard
+ * Back off algorithm use original IEEE standard
*/
BYTE_REG_BITS_SET(CFGB_OFSET, (CFGB_CRANDOM | CFGB_CAP | CFGB_MBA | CFGB_BAKOPT), ®s->CFGB);
/*
+ * Init CAM filter
+ */
+ velocity_init_cam_filter(vptr);
+
+ /*
* Set packet filter: Receive directed and broadcast address
*/
velocity_set_multi(vptr->dev);
@@ -619,8 +620,6 @@
mac_tx_queue_run(regs, i);
}
- velocity_init_cam_filter(vptr);
-
init_flow_control_register(vptr);
writel(CR0_STOP, ®s->CR0Clr);
@@ -628,7 +627,6 @@
mii_status = velocity_get_opt_media_mode(vptr);
netif_stop_queue(vptr->dev);
- mac_clear_isr(regs);
mii_init(vptr, mii_status);
@@ -695,7 +693,7 @@
struct mac_regs * regs;
int ret = -ENOMEM;
- if (velocity_nics++ >= MAX_UNITS) {
+ if (velocity_nics >= MAX_UNITS) {
printk(KERN_NOTICE VELOCITY_NAME ": already found %d NICs.\n",
velocity_nics);
return -ENODEV;
@@ -727,7 +725,6 @@
vptr->dev = dev;
- dev->priv = vptr;
dev->irq = pdev->irq;
ret = pci_enable_device(pdev);
@@ -762,7 +759,7 @@
dev->dev_addr[i] = readb(®s->PAR[i]);
- velocity_get_options(&vptr->options, velocity_nics - 1, dev->name);
+ velocity_get_options(&vptr->options, velocity_nics, dev->name);
/*
* Mask out the options cannot be set to the chip
@@ -817,6 +814,7 @@
spin_unlock_irqrestore(&velocity_dev_list_lock, flags);
}
#endif
+ velocity_nics++;
out:
return ret;
@@ -869,10 +867,7 @@
vptr->io_size = info->io_size;
vptr->num_txq = info->txqueue;
vptr->multicast_limit = MCAM_SIZE;
-
spin_lock_init(&vptr->lock);
- spin_lock_init(&vptr->xmit_lock);
-
INIT_LIST_HEAD(&vptr->list);
}
@@ -1024,11 +1019,11 @@
wmb();
- unusable = vptr->rd_filled | 0x0003;
- dirty = vptr->rd_dirty - unusable + 1;
+ unusable = vptr->rd_filled & 0x0003;
+ dirty = vptr->rd_dirty - unusable;
for (avail = vptr->rd_filled & 0xfffc; avail; avail--) {
dirty = (dirty > 0) ? dirty - 1 : vptr->options.numrx - 1;
- velocity_give_rx_desc(vptr->rd_ring + dirty);
+ vptr->rd_ring[dirty].rdesc0.owner = OWNED_BY_NIC;
}
writew(vptr->rd_filled & 0xfffc, ®s->RBRDU);
@@ -1043,7 +1038,7 @@
struct rx_desc *rd = vptr->rd_ring + dirty;
/* Fine for an all zero Rx desc at init time as well */
- if (rd->rdesc0.owner == cpu_to_le32(OWNED_BY_NIC))
+ if (rd->rdesc0.owner == OWNED_BY_NIC)
break;
if (!vptr->rd_info[dirty].skb) {
@@ -1096,7 +1091,7 @@
}
/**
- * velocity_free_rd_ring - set up receive ring
+ * velocity_free_rd_ring - free receive ring
* @vptr: velocity to clean up
*
* Free the receive buffers for each ring slot and any
@@ -1161,8 +1156,10 @@
for (i = 0; i < vptr->options.numtx; i++, curr += sizeof(struct tx_desc)) {
td = &(vptr->td_rings[j][i]);
td_info = &(vptr->td_infos[j][i]);
- td_info->buf = vptr->tx_bufs + (i + j) * PKT_BUF_SZ;
- td_info->buf_dma = vptr->tx_bufs_dma + (i + j) * PKT_BUF_SZ;
+ td_info->buf = vptr->tx_bufs +
+ (j * vptr->options.numtx + i) * PKT_BUF_SZ;
+ td_info->buf_dma = vptr->tx_bufs_dma +
+ (j * vptr->options.numtx + i) * PKT_BUF_SZ;
}
vptr->td_tail[j] = vptr->td_curr[j] = vptr->td_used[j] = 0;
}
@@ -1238,15 +1235,17 @@
int rd_curr = vptr->rd_curr;
int works = 0;
- while (1) {
+ do {
struct rx_desc *rd = vptr->rd_ring + rd_curr;
- if (!vptr->rd_info[rd_curr].skb || (works++ > 15))
+ if (!vptr->rd_info[rd_curr].skb)
break;
if (rd->rdesc0.owner == OWNED_BY_NIC)
break;
+ rmb();
+
/*
* Don't drop CE or RL error frame although RXOK is off
*/
@@ -1269,14 +1268,15 @@
rd_curr++;
if (rd_curr >= vptr->options.numrx)
rd_curr = 0;
- }
+ } while (++works <= 15);
- if (velocity_rx_refill(vptr) < 0) {
+ vptr->rd_curr = rd_curr;
+
+ if (works > 0 && velocity_rx_refill(vptr) < 0) {
VELOCITY_PRT(MSG_LEVEL_ERR, KERN_ERR
"%s: rx buf allocation failure\n", vptr->dev->name);
}
- vptr->rd_curr = rd_curr;
VAR_USED(stats);
return works;
}
diff -Nru a/drivers/net/via-velocity.h b/drivers/net/via-velocity.h
--- a/drivers/net/via-velocity.h 2004-10-04 18:07:46 -04:00
+++ b/drivers/net/via-velocity.h 2004-10-04 18:07:46 -04:00
@@ -1319,7 +1319,7 @@
/* disable CAMEN */
writeb(0, ®s->CAMADDR);
- /* Select CAM mask */
+ /* Select mar */
BYTE_REG_BITS_SET(CAMCR_PS_MAR, CAMCR_PS1 | CAMCR_PS0, ®s->CAMCR);
}
@@ -1360,7 +1360,7 @@
writeb(0, ®s->CAMADDR);
- /* Select CAM mask */
+ /* Select mar */
BYTE_REG_BITS_SET(CAMCR_PS_MAR, CAMCR_PS1 | CAMCR_PS0, ®s->CAMCR);
}
@@ -1401,7 +1401,7 @@
writeb(0, ®s->CAMADDR);
- /* Select CAM mask */
+ /* Select mar */
BYTE_REG_BITS_SET(CAMCR_PS_MAR, CAMCR_PS1 | CAMCR_PS0, ®s->CAMCR);
}
@@ -1792,7 +1792,6 @@
u8 mCAMmask[(MCAM_SIZE / 8)];
spinlock_t lock;
- spinlock_t xmit_lock;
int wol_opts;
u8 wol_passwd[6];
^ permalink raw reply [flat|nested] 13+ messages in thread
* [BK PATCHES] 2.6.x net driver fixes
@ 2004-10-18 23:52 Jeff Garzik
0 siblings, 0 replies; 13+ messages in thread
From: Jeff Garzik @ 2004-10-18 23:52 UTC (permalink / raw)
To: Andrew Morton, Linus Torvalds; +Cc: netdev
Please do a
bk pull bk://gkernel.bkbits.net/net-drivers-2.6
This will update the following files:
drivers/net/typhoon.c | 1 +
drivers/net/wan/cycx_x25.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
through these ChangeSets:
<viro@www.linux.org.uk> (04/10/16 1.2201)
[PATCH] 64bit fix in cycx_x25.c
comparing u32 with ~0UL is wrong
Signed-off-by: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
<viro@parcelfarce.linux.theplanet.co.uk> (04/10/15 1.2200)
[PATCH] typhoon.c missing include
DMA_32BIT_MASK is declared in linux/dma-mapping.h; not all platforms get
it from already included headers, so we need explicit include here (fixes
breakage at least on alpha and sparc64).
Signed-off-by: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
diff -Nru a/drivers/net/typhoon.c b/drivers/net/typhoon.c
--- a/drivers/net/typhoon.c 2004-10-18 19:14:46 -04:00
+++ b/drivers/net/typhoon.c 2004-10-18 19:14:46 -04:00
@@ -114,6 +114,7 @@
#include <linux/in6.h>
#include <asm/checksum.h>
#include <linux/version.h>
+#include <linux/dma-mapping.h>
#include "typhoon.h"
#include "typhoon-firmware.h"
diff -Nru a/drivers/net/wan/cycx_x25.c b/drivers/net/wan/cycx_x25.c
--- a/drivers/net/wan/cycx_x25.c 2004-10-18 19:14:46 -04:00
+++ b/drivers/net/wan/cycx_x25.c 2004-10-18 19:14:46 -04:00
@@ -1195,7 +1195,7 @@
remotelen = strlen(chan->addr);
u8 key;
- if (card->u.x.connection_keys == ~0UL) {
+ if (card->u.x.connection_keys == ~0U) {
printk(KERN_INFO "%s: too many simultaneous connection "
"requests!\n", card->devname);
return -EAGAIN;
^ permalink raw reply [flat|nested] 13+ messages in thread
* [BK PATCHES] 2.6.x net driver fixes
@ 2004-11-08 2:32 Jeff Garzik
0 siblings, 0 replies; 13+ messages in thread
From: Jeff Garzik @ 2004-11-08 2:32 UTC (permalink / raw)
To: Andrew Morton, Linus Torvalds; +Cc: netdev
Please do a
bk pull bk://gkernel.bkbits.net/net-drivers-2.6
This will update the following files:
drivers/net/Kconfig | 2 +-
drivers/net/hamradio/hdlcdrv.c | 2 --
2 files changed, 1 insertion(+), 3 deletions(-)
through these ChangeSets:
<miltonm@realtime.net> (04/11/06 1.2473)
[PATCH] hamradio/hdlcdrv: undo duplicat patch application
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
<miltonm@realtime.net> (04/11/06 1.2472)
[PATCH] net/Kconfig: undo duplicate patch application
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
diff -Nru a/drivers/net/Kconfig b/drivers/net/Kconfig
--- a/drivers/net/Kconfig 2004-11-07 21:31:54 -05:00
+++ b/drivers/net/Kconfig 2004-11-07 21:31:54 -05:00
@@ -1681,7 +1681,7 @@
(e.g. VT8235).
To compile this driver as a module, choose M here. The module
- will be called via-velocity.
+ will be called via-rhine.
config VIA_RHINE_MMIO
bool "Use MMIO instead of PIO"
diff -Nru a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c
--- a/drivers/net/hamradio/hdlcdrv.c 2004-11-07 21:31:54 -05:00
+++ b/drivers/net/hamradio/hdlcdrv.c 2004-11-07 21:31:54 -05:00
@@ -549,8 +549,6 @@
netif_stop_queue(dev);
- netif_stop_queue(dev);
-
if (s->ops && s->ops->close)
i = s->ops->close(dev);
if (s->skb)
^ permalink raw reply [flat|nested] 13+ messages in thread
* [BK PATCHES] 2.6.x net driver fixes
@ 2004-11-11 22:44 Jeff Garzik
0 siblings, 0 replies; 13+ messages in thread
From: Jeff Garzik @ 2004-11-11 22:44 UTC (permalink / raw)
To: Andrew Morton, Linus Torvalds; +Cc: netdev, linux-kernel
Please do a
bk pull bk://gkernel.bkbits.net/net-drivers-2.6
This will update the following files:
drivers/net/bonding/bond_main.c | 15 +++++++++++----
drivers/net/bonding/bonding.h | 4 ++--
drivers/net/e1000/e1000_main.c | 4 +++-
drivers/net/ixgb/ixgb_main.c | 13 +++++++------
net/core/netpoll.c | 4 ++--
5 files changed, 25 insertions(+), 15 deletions(-)
through these ChangeSets:
<akpm@osdl.org> (04/11/11 1.2090)
[PATCH] Fix for 802.3ad shutdown issue
The patch below fixes a problem with shutting down 802.3ad bonds on the 2.6
kernel. Taking the interface down or removing the module causes a stack
dump if spinlock debugging is enabled. This patch was generated from the
2.6.9 kernel.
This patch has been peer reviewed by our Linux software engineering team,
and the fix has been verified by our test labs.
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
<akpm@osdl.org> (04/11/11 1.2089)
[PATCH] ixgb: fix ixgb_intr looping checks
This patch undoes a change that we believe will impact performance
adversely, by creating possibly too long a delay between servicing
completions. The comment pretty much explains it. We need to call both
cleanup routines each pass through the loop, this time we have a comment
explaining why.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
<akpm@osdl.org> (04/11/11 1.2088)
[PATCH] E1000 stop working after resume
Obviously pci_enable_device should be called after pci_restore_state.
Signed-off-by: Li Shaohua <shaohua.li@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
<akpm@osdl.org> (04/11/11 1.2087)
[PATCH] netpoll: fix null ifa_list pointer dereference
This fixes a bug where netpoll can dereference a null ifa_list pointer when
not supplied an IP address at module load and the interface is up but no IP
is configured.
Bonus: unrelated netif_running cleanup
Signed-off by: Jeff Moyer <jmoyer@redhat.com>
Signed-off by: Matt Mackall <mpm@selenic.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
diff -Nru a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
--- a/drivers/net/bonding/bond_main.c 2004-11-11 17:43:44 -05:00
+++ b/drivers/net/bonding/bond_main.c 2004-11-11 17:43:44 -05:00
@@ -469,6 +469,13 @@
* * Add support for VLAN hardware acceleration capable slaves.
* * Add capability to tag self generated packets in ALB/TLB modes.
* Set version to 2.6.0.
+ * 2004/10/29 - Mitch Williams <mitch.a.williams at intel dot com>
+ * - Fixed bug when unloading module while using 802.3ad. If
+ * spinlock debugging is turned on, this causes a stack dump.
+ * Solution is to move call to dev_remove_pack outside of the
+ * spinlock.
+ * Set version to 2.6.1.
+ *
*/
//#define BONDING_DEBUG 1
@@ -3566,14 +3573,14 @@
{
struct bonding *bond = bond_dev->priv;
- write_lock_bh(&bond->lock);
-
- bond_mc_list_destroy(bond);
-
if (bond->params.mode == BOND_MODE_8023AD) {
/* Unregister the receive of LACPDUs */
bond_unregister_lacpdu(bond);
}
+
+ write_lock_bh(&bond->lock);
+
+ bond_mc_list_destroy(bond);
/* signal timers not to re-arm */
bond->kill_timers = 1;
diff -Nru a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
--- a/drivers/net/bonding/bonding.h 2004-11-11 17:43:44 -05:00
+++ b/drivers/net/bonding/bonding.h 2004-11-11 17:43:44 -05:00
@@ -36,8 +36,8 @@
#include "bond_3ad.h"
#include "bond_alb.h"
-#define DRV_VERSION "2.6.0"
-#define DRV_RELDATE "January 14, 2004"
+#define DRV_VERSION "2.6.1"
+#define DRV_RELDATE "October 29, 2004"
#define DRV_NAME "bonding"
#define DRV_DESCRIPTION "Ethernet Channel Bonding Driver"
diff -Nru a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
--- a/drivers/net/e1000/e1000_main.c 2004-11-11 17:43:44 -05:00
+++ b/drivers/net/e1000/e1000_main.c 2004-11-11 17:43:44 -05:00
@@ -2885,9 +2885,11 @@
struct e1000_adapter *adapter = netdev->priv;
uint32_t manc, ret;
- ret = pci_enable_device(pdev);
pci_set_power_state(pdev, 0);
pci_restore_state(pdev);
+ ret = pci_enable_device(pdev);
+ if (pdev->is_busmaster)
+ pci_set_master(pdev);
pci_enable_wake(pdev, 3, 0);
pci_enable_wake(pdev, 4, 0); /* 4 == D3 cold */
diff -Nru a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
--- a/drivers/net/ixgb/ixgb_main.c 2004-11-11 17:43:44 -05:00
+++ b/drivers/net/ixgb/ixgb_main.c 2004-11-11 17:43:44 -05:00
@@ -1613,13 +1613,14 @@
__netif_rx_schedule(netdev);
}
#else
- for (i = 0; i < IXGB_MAX_INTR; i++)
- if (ixgb_clean_rx_irq(adapter) == FALSE)
+ /* yes, that is actually a & and it is meant to make sure that
+ * every pass through this for loop checks both receive and
+ * transmit queues for completed descriptors, intended to
+ * avoid starvation issues and assist tx/rx fairness. */
+ for(i = 0; i < IXGB_MAX_INTR; i++)
+ if(!ixgb_clean_rx_irq(adapter) &
+ !ixgb_clean_tx_irq(adapter))
break;
- for (i = 0; i < IXGB_MAX_INTR; i++)
- if (ixgb_clean_tx_irq(adapter) == FALSE)
- break;
-
/* if RAIDC:EN == 1 and ICR:RXDMT0 == 1, we need to
* set IMS:RXDMT0 to 1 to restart the RBD timer (POLL)
*/
diff -Nru a/net/core/netpoll.c b/net/core/netpoll.c
--- a/net/core/netpoll.c 2004-11-11 17:43:44 -05:00
+++ b/net/core/netpoll.c 2004-11-11 17:43:44 -05:00
@@ -565,7 +565,7 @@
goto release;
}
- if (!(ndev->flags & IFF_UP)) {
+ if (!netif_running(ndev)) {
unsigned short oflags;
unsigned long atmost, atleast;
@@ -611,7 +611,7 @@
rcu_read_lock();
in_dev = __in_dev_get(ndev);
- if (!in_dev) {
+ if (!in_dev || !in_dev->ifa_list) {
rcu_read_unlock();
printk(KERN_ERR "%s: no IP address for %s, aborting\n",
np->name, np->dev_name);
^ permalink raw reply [flat|nested] 13+ messages in thread
* [BK PATCHES] 2.6.x net driver fixes
@ 2004-11-24 21:02 Jeff Garzik
0 siblings, 0 replies; 13+ messages in thread
From: Jeff Garzik @ 2004-11-24 21:02 UTC (permalink / raw)
To: Andrew Morton, Linus Torvalds; +Cc: netdev
Please do a
bk pull bk://gkernel.bkbits.net/net-drivers-2.6
This will update the following files:
arch/m68k/configs/atari_defconfig | 3 ++-
arch/m68k/configs/hp300_defconfig | 4 ++--
drivers/net/e100.c | 18 ++++++++++--------
drivers/net/hplance.c | 27 +++++++++++++++++----------
drivers/net/ibmveth.c | 2 +-
drivers/net/pcnet32.c | 7 ++++++-
drivers/net/tulip/21142.c | 2 +-
drivers/net/tulip/eeprom.c | 1 +
drivers/net/tulip/interrupt.c | 2 +-
drivers/net/tulip/media.c | 1 +
drivers/net/tulip/pnic.c | 1 +
drivers/net/tulip/pnic2.c | 2 +-
drivers/net/tulip/timer.c | 1 +
drivers/net/tulip/tulip.h | 15 ++++++++++++++-
drivers/net/tulip/tulip_core.c | 2 +-
15 files changed, 60 insertions(+), 28 deletions(-)
through these ChangeSets:
Andrew Morton:
o e100: early reset fix
Don Fry:
o pcnet32: added pci_disable_device
Geert Uytterhoeven:
o M68k: Update HP300 defconfig (enable DIO and HP Lance Ethernet)
o M68k HP Lance Ethernet: Fix leaks on probe/removal
o M68k: Update Atari defconfig (enable Ethernet and MII)
John W. Linville:
o tulip: make tulip_stop_rxtx() wait for DMA to fully stop
Santiago Leon:
o make ibmveth link always up
diff -Nru a/arch/m68k/configs/atari_defconfig b/arch/m68k/configs/atari_defconfig
--- a/arch/m68k/configs/atari_defconfig 2004-11-24 15:49:50 -05:00
+++ b/arch/m68k/configs/atari_defconfig 2004-11-24 15:49:50 -05:00
@@ -430,7 +430,8 @@
#
# Ethernet (10 or 100Mbit)
#
-# CONFIG_NET_ETHERNET is not set
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=m
CONFIG_ATARILANCE=m
#
diff -Nru a/arch/m68k/configs/hp300_defconfig b/arch/m68k/configs/hp300_defconfig
--- a/arch/m68k/configs/hp300_defconfig 2004-11-24 15:49:50 -05:00
+++ b/arch/m68k/configs/hp300_defconfig 2004-11-24 15:49:50 -05:00
@@ -65,7 +65,7 @@
# CONFIG_APOLLO is not set
# CONFIG_VME is not set
CONFIG_HP300=y
-# CONFIG_DIO is not set
+CONFIG_DIO=y
# CONFIG_SUN3X is not set
# CONFIG_Q40 is not set
@@ -404,7 +404,7 @@
#
CONFIG_NET_ETHERNET=y
CONFIG_MII=m
-# CONFIG_HPLANCE is not set
+CONFIG_HPLANCE=y
#
# Ethernet (1000 Mbit)
diff -Nru a/drivers/net/e100.c b/drivers/net/e100.c
--- a/drivers/net/e100.c 2004-11-24 15:49:50 -05:00
+++ b/drivers/net/e100.c 2004-11-24 15:49:50 -05:00
@@ -2204,22 +2204,24 @@
goto err_out_disable_pdev;
}
+ nic->csr = ioremap(pci_resource_start(pdev, 0), sizeof(struct csr));
+ if(!nic->csr) {
+ DPRINTK(PROBE, ERR, "Cannot map device registers, aborting.\n");
+ err = -ENOMEM;
+ goto err_out_free_res;
+ }
+
+ e100_hw_reset(nic);
+
pci_set_master(pdev);
if((err = pci_set_dma_mask(pdev, 0xFFFFFFFFULL))) {
DPRINTK(PROBE, ERR, "No usable DMA configuration, aborting.\n");
- goto err_out_free_res;
+ goto err_out_iounmap;
}
SET_MODULE_OWNER(netdev);
SET_NETDEV_DEV(netdev, &pdev->dev);
-
- nic->csr = ioremap(pci_resource_start(pdev, 0), sizeof(struct csr));
- if(!nic->csr) {
- DPRINTK(PROBE, ERR, "Cannot map device registers, aborting.\n");
- err = -ENOMEM;
- goto err_out_free_res;
- }
if(ent->driver_data)
nic->flags |= ich;
diff -Nru a/drivers/net/hplance.c b/drivers/net/hplance.c
--- a/drivers/net/hplance.c 2004-11-24 15:49:50 -05:00
+++ b/drivers/net/hplance.c 2004-11-24 15:49:50 -05:00
@@ -76,25 +76,31 @@
const struct dio_device_id *ent)
{
struct net_device *dev;
- int err;
+ int err = -ENOMEM;
dev = alloc_etherdev(sizeof(struct hplance_private));
if (!dev)
- return -ENOMEM;
+ goto out;
- if (!request_mem_region(d->resource.start, d->resource.end-d->resource.start, d->name))
- return -EBUSY;
+ err = -EBUSY;
+ if (!request_mem_region(dio_resource_start(d),
+ dio_resource_len(d), d->name))
+ goto out_free_netdev;
- SET_MODULE_OWNER(dev);
-
hplance_init(dev, d);
err = register_netdev(dev);
- if (err) {
- free_netdev(dev);
- return err;
- }
+ if (err)
+ goto out_release_mem_region;
+
dio_set_drvdata(d, dev);
return 0;
+
+ out_release_mem_region:
+ release_mem_region(dio_resource_start(d), dio_resource_len(d));
+ out_free_netdev:
+ free_netdev(dev);
+ out:
+ return err;
}
static void __devexit hplance_remove_one(struct dio_dev *d)
@@ -102,6 +108,7 @@
struct net_device *dev = dio_get_drvdata(d);
unregister_netdev(dev);
+ release_mem_region(dio_resource_start(d), dio_resource_len(d));
free_netdev(dev);
}
diff -Nru a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
--- a/drivers/net/ibmveth.c 2004-11-24 15:49:50 -05:00
+++ b/drivers/net/ibmveth.c 2004-11-24 15:49:50 -05:00
@@ -598,7 +598,7 @@
}
static u32 netdev_get_link(struct net_device *dev) {
- return 0;
+ return 1;
}
static struct ethtool_ops netdev_ethtool_ops = {
diff -Nru a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
--- a/drivers/net/pcnet32.c 2004-11-24 15:49:50 -05:00
+++ b/drivers/net/pcnet32.c 2004-11-24 15:49:50 -05:00
@@ -1010,7 +1010,11 @@
return -EBUSY;
}
- return pcnet32_probe1(ioaddr, 1, pdev);
+ err = pcnet32_probe1(ioaddr, 1, pdev);
+ if (err < 0) {
+ pci_disable_device(pdev);
+ }
+ return err;
}
@@ -2249,6 +2253,7 @@
release_region(dev->base_addr, PCNET32_TOTAL_SIZE);
pci_free_consistent(lp->pci_dev, sizeof(*lp), lp, lp->dma_addr);
free_netdev(dev);
+ pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
}
}
diff -Nru a/drivers/net/tulip/21142.c b/drivers/net/tulip/21142.c
--- a/drivers/net/tulip/21142.c 2004-11-24 15:49:50 -05:00
+++ b/drivers/net/tulip/21142.c 2004-11-24 15:49:50 -05:00
@@ -14,9 +14,9 @@
*/
-#include "tulip.h"
#include <linux/pci.h>
#include <linux/delay.h>
+#include "tulip.h"
static u16 t21142_csr13[] = { 0x0001, 0x0009, 0x0009, 0x0000, 0x0001, };
diff -Nru a/drivers/net/tulip/eeprom.c b/drivers/net/tulip/eeprom.c
--- a/drivers/net/tulip/eeprom.c 2004-11-24 15:49:50 -05:00
+++ b/drivers/net/tulip/eeprom.c 2004-11-24 15:49:50 -05:00
@@ -14,6 +14,7 @@
*/
+#include <linux/pci.h>
#include "tulip.h"
#include <linux/init.h>
#include <asm/unaligned.h>
diff -Nru a/drivers/net/tulip/interrupt.c b/drivers/net/tulip/interrupt.c
--- a/drivers/net/tulip/interrupt.c 2004-11-24 15:49:50 -05:00
+++ b/drivers/net/tulip/interrupt.c 2004-11-24 15:49:50 -05:00
@@ -14,10 +14,10 @@
*/
+#include <linux/pci.h>
#include "tulip.h"
#include <linux/config.h>
#include <linux/etherdevice.h>
-#include <linux/pci.h>
int tulip_rx_copybreak;
unsigned int tulip_max_interrupt_work;
diff -Nru a/drivers/net/tulip/media.c b/drivers/net/tulip/media.c
--- a/drivers/net/tulip/media.c 2004-11-24 15:49:50 -05:00
+++ b/drivers/net/tulip/media.c 2004-11-24 15:49:50 -05:00
@@ -18,6 +18,7 @@
#include <linux/mii.h>
#include <linux/init.h>
#include <linux/delay.h>
+#include <linux/pci.h>
#include "tulip.h"
diff -Nru a/drivers/net/tulip/pnic.c b/drivers/net/tulip/pnic.c
--- a/drivers/net/tulip/pnic.c 2004-11-24 15:49:50 -05:00
+++ b/drivers/net/tulip/pnic.c 2004-11-24 15:49:50 -05:00
@@ -15,6 +15,7 @@
*/
#include <linux/kernel.h>
+#include <linux/pci.h>
#include "tulip.h"
diff -Nru a/drivers/net/tulip/pnic2.c b/drivers/net/tulip/pnic2.c
--- a/drivers/net/tulip/pnic2.c 2004-11-24 15:49:50 -05:00
+++ b/drivers/net/tulip/pnic2.c 2004-11-24 15:49:50 -05:00
@@ -76,8 +76,8 @@
-#include "tulip.h"
#include <linux/pci.h>
+#include "tulip.h"
#include <linux/delay.h>
diff -Nru a/drivers/net/tulip/timer.c b/drivers/net/tulip/timer.c
--- a/drivers/net/tulip/timer.c 2004-11-24 15:49:50 -05:00
+++ b/drivers/net/tulip/timer.c 2004-11-24 15:49:50 -05:00
@@ -14,6 +14,7 @@
*/
+#include <linux/pci.h>
#include "tulip.h"
diff -Nru a/drivers/net/tulip/tulip.h b/drivers/net/tulip/tulip.h
--- a/drivers/net/tulip/tulip.h 2004-11-24 15:49:50 -05:00
+++ b/drivers/net/tulip/tulip.h 2004-11-24 15:49:50 -05:00
@@ -149,6 +149,9 @@
TxIntr = 0x01,
};
+/* bit mask for CSR5 TX/RX process state */
+#define CSR5_TS 0x00700000
+#define CSR5_RS 0x000e0000
enum tulip_mode_bits {
TxThreshold = (1 << 22),
@@ -460,9 +463,19 @@
u32 csr6 = ioread32(ioaddr + CSR6);
if (csr6 & RxTx) {
+ unsigned i=1300/10;
iowrite32(csr6 & ~RxTx, ioaddr + CSR6);
barrier();
- (void) ioread32(ioaddr + CSR6); /* mmio sync */
+ /* wait until in-flight frame completes.
+ * Max time @ 10BT: 1500*8b/10Mbps == 1200us (+ 100us margin)
+ * Typically expect this loop to end in < 50 us on 100BT.
+ */
+ while (--i && (ioread32(ioaddr + CSR5) & (CSR5_TS|CSR5_RS)))
+ udelay(10);
+
+ if (!i)
+ printk(KERN_DEBUG "%s: tulip_stop_rxtx() failed\n",
+ tp->pdev->slot_name);
}
}
diff -Nru a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
--- a/drivers/net/tulip/tulip_core.c 2004-11-24 15:49:50 -05:00
+++ b/drivers/net/tulip/tulip_core.c 2004-11-24 15:49:50 -05:00
@@ -26,8 +26,8 @@
#include <linux/module.h>
-#include "tulip.h"
#include <linux/pci.h>
+#include "tulip.h"
#include <linux/init.h>
#include <linux/etherdevice.h>
#include <linux/delay.h>
^ permalink raw reply [flat|nested] 13+ messages in thread
* [BK PATCHES] 2.6.x net driver fixes
@ 2005-01-27 23:45 Jeff Garzik
0 siblings, 0 replies; 13+ messages in thread
From: Jeff Garzik @ 2005-01-27 23:45 UTC (permalink / raw)
To: Andrew Morton, Linus Torvalds; +Cc: Netdev
[-- Attachment #1: Type: text/plain, Size: 0 bytes --]
[-- Attachment #2: changelog.txt --]
[-- Type: text/plain, Size: 674 bytes --]
Please do a
bk pull bk://gkernel.bkbits.net/net-drivers-2.6
This will update the following files:
drivers/net/e100.c | 1
drivers/net/gianfar.c | 8 +--
drivers/net/skfp/skfddi.c | 116 ++++++++++++++++++--------------------------
drivers/net/tulip/de2104x.c | 1
4 files changed, 56 insertions(+), 70 deletions(-)
through these ChangeSets:
<galak:freescale.com>:
o netdrv gianfar: Fix usage of gfar_read in debug code
Alexander Viro:
o de2104x: Fixes breakage in getting MAC address
Stephen Hemminger:
o (2/2) skfddi: netdev_priv and cast cleanup
o (1/2) skfddi: initialization
Steven Rostedt:
o e100 locking up netconsole
[-- Attachment #3: patch --]
[-- Type: text/plain, Size: 10586 bytes --]
diff -Nru a/drivers/net/e100.c b/drivers/net/e100.c
--- a/drivers/net/e100.c 2005-01-27 18:44:48 -05:00
+++ b/drivers/net/e100.c 2005-01-27 18:44:48 -05:00
@@ -1630,6 +1630,7 @@
struct nic *nic = netdev_priv(netdev);
e100_disable_irq(nic);
e100_intr(nic->pdev->irq, netdev, NULL);
+ e100_tx_clean(nic);
e100_enable_irq(nic);
}
#endif
diff -Nru a/drivers/net/gianfar.c b/drivers/net/gianfar.c
--- a/drivers/net/gianfar.c 2005-01-27 18:44:48 -05:00
+++ b/drivers/net/gianfar.c 2005-01-27 18:44:48 -05:00
@@ -1190,8 +1190,8 @@
} else {
#ifdef VERBOSE_GFAR_ERRORS
printk(KERN_DEBUG "%s: receive called twice (%x)[%x]\n",
- dev->name, gfar_read(priv->regs->ievent),
- gfar_read(priv->regs->imask));
+ dev->name, gfar_read(&priv->regs->ievent),
+ gfar_read(&priv->regs->imask));
#endif
}
#else
@@ -1415,7 +1415,7 @@
#ifdef VERBOSE_GFAR_ERRORS
printk(KERN_DEBUG "%s: busy error (rhalt: %x)\n", dev->name,
- gfar_read(priv->regs->rstat));
+ gfar_read(&priv->regs->rstat));
#endif
}
if (events & IEVENT_BABR) {
@@ -1793,7 +1793,7 @@
#ifdef VERBOSE_GFAR_ERRORS
printk(KERN_DEBUG "%s: busy error (rhalt: %x)\n", dev->name,
- gfar_read(priv->regs->rstat));
+ gfar_read(&priv->regs->rstat));
#endif
}
if (events & IEVENT_BABR) {
diff -Nru a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c
--- a/drivers/net/skfp/skfddi.c 2005-01-27 18:44:48 -05:00
+++ b/drivers/net/skfp/skfddi.c 2005-01-27 18:44:48 -05:00
@@ -169,8 +169,6 @@
#define PRINTK(s, args...)
#endif // DRIVERDEBUG
-#define PRIV(dev) (&(((struct s_smc *)dev->priv)->os))
-
/*
* =================
* = skfp_init_one =
@@ -205,7 +203,6 @@
{
struct net_device *dev;
struct s_smc *smc; /* board pointer */
- unsigned long port, len;
void __iomem *mem;
int err;
@@ -216,62 +213,43 @@
err = pci_enable_device(pdev);
if (err)
+ return err;
+
+ err = pci_request_regions(pdev, "skfddi");
+ if (err)
goto err_out1;
+ pci_set_master(pdev);
#ifdef MEM_MAPPED_IO
if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
printk(KERN_ERR "skfp: region is not an MMIO resource\n");
err = -EIO;
- goto err_out1;
+ goto err_out2;
}
- port = pci_resource_start(pdev, 0);
- len = pci_resource_len(pdev, 0);
- if (len < 0x4000) {
- printk(KERN_ERR "skfp: Invalid PCI region size: %lu\n", len);
- err = -EIO;
- goto err_out1;
- }
+ mem = ioremap(pci_resource_start(pdev, 0), 0x4000);
#else
if (!(pci_resource_flags(pdev, 1) & IO_RESOURCE_IO)) {
printk(KERN_ERR "skfp: region is not PIO resource\n");
err = -EIO;
- goto err_out1;
+ goto err_out2;
}
- port = pci_resource_start(pdev, 1);
- len = pci_resource_len(pdev, 1);
- if (len < FP_IO_LEN) {
- printk(KERN_ERR "skfp: Invalid PCI region size: %d\n",
- io_len);
+ mem = ioport_map(pci_resource_start(pdev, 1), FP_IO_LEN);
+#endif
+ if (!mem) {
+ printk(KERN_ERR "skfp: Unable to map register, "
+ "FDDI adapter will be disabled.\n");
err = -EIO;
- goto err_out1;
+ goto err_out2;
}
-#endif
- err = pci_request_regions(pdev, "skfddi");
- if (err)
- goto err_out1;
-
- pci_set_master(pdev);
dev = alloc_fddidev(sizeof(struct s_smc));
if (!dev) {
printk(KERN_ERR "skfp: Unable to allocate fddi device, "
"FDDI adapter will be disabled.\n");
err = -ENOMEM;
- goto err_out2;
- }
-
-#ifdef MEM_MAPPED_IO
- mem = ioremap(port, len);
-#else
- mem =ioport_map(port, len);
-#endif
- if (!mem) {
- printk(KERN_ERR "skfp: Unable to map register, "
- "FDDI adapter will be disabled.\n");
- err = -EIO;
goto err_out3;
}
@@ -289,7 +267,7 @@
SET_NETDEV_DEV(dev, &pdev->dev);
/* Initialize board structure with bus-specific info */
- smc = (struct s_smc *) dev->priv;
+ smc = netdev_priv(dev);
smc->os.dev = dev;
smc->os.bus_type = SK_BUS_TYPE_PCI;
smc->os.pdev = *pdev;
@@ -331,16 +309,17 @@
pci_free_consistent(pdev, MAX_FRAME_SIZE,
smc->os.LocalRxBuffer, smc->os.LocalRxBufferDMA);
err_out4:
+ free_netdev(dev);
+err_out3:
#ifdef MEM_MAPPED_IO
- iounmap(smc->hw.iop);
+ iounmap(mem);
#else
- ioport_unmap(smc->hw.iop);
+ ioport_unmap(mem);
#endif
-err_out3:
- free_netdev(dev);
err_out2:
pci_release_regions(pdev);
err_out1:
+ pci_disable_device(pdev);
return err;
}
@@ -350,7 +329,7 @@
static void __devexit skfp_remove_one(struct pci_dev *pdev)
{
struct net_device *p = pci_get_drvdata(pdev);
- struct s_smc *lp = p->priv;
+ struct s_smc *lp = netdev_priv(p);
unregister_netdev(p);
@@ -376,6 +355,7 @@
pci_release_regions(pdev);
free_netdev(p);
+ pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
}
@@ -406,8 +386,8 @@
*/
static int skfp_driver_init(struct net_device *dev)
{
- struct s_smc *smc = (struct s_smc *) dev->priv;
- skfddi_priv *bp = PRIV(dev);
+ struct s_smc *smc = netdev_priv(dev);
+ skfddi_priv *bp = &smc->os;
int err = -EIO;
PRINTK(KERN_INFO "entering skfp_driver_init\n");
@@ -513,7 +493,7 @@
*/
static int skfp_open(struct net_device *dev)
{
- struct s_smc *smc = (struct s_smc *) dev->priv;
+ struct s_smc *smc = netdev_priv(dev);
int err;
PRINTK(KERN_INFO "entering skfp_open\n");
@@ -580,8 +560,8 @@
*/
static int skfp_close(struct net_device *dev)
{
- struct s_smc *smc = (struct s_smc *) dev->priv;
- skfddi_priv *bp = PRIV(dev);
+ struct s_smc *smc = netdev_priv(dev);
+ skfddi_priv *bp = &smc->os;
CLI_FBI();
smt_reset_defaults(smc, 1);
@@ -640,15 +620,15 @@
{
struct net_device *dev = (struct net_device *) dev_id;
struct s_smc *smc; /* private board structure pointer */
- skfddi_priv *bp = PRIV(dev);
-
+ skfddi_priv *bp;
if (dev == NULL) {
printk("%s: irq %d for unknown device\n", dev->name, irq);
return IRQ_NONE;
}
- smc = (struct s_smc *) dev->priv;
+ smc = netdev_priv(dev);
+ bp = &smc->os;
// IRQs enabled or disabled ?
if (inpd(ADDR(B0_IMSK)) == 0) {
@@ -710,7 +690,7 @@
*/
struct net_device_stats *skfp_ctl_get_stats(struct net_device *dev)
{
- struct s_smc *bp = (struct s_smc *) dev->priv;
+ struct s_smc *bp = netdev_priv(dev);
/* Fill the bp->stats structure with driver-maintained counters */
@@ -874,7 +854,8 @@
*/
static void skfp_ctl_set_multicast_list(struct net_device *dev)
{
- skfddi_priv *bp = PRIV(dev);
+ struct s_smc *smc = netdev_priv(dev);
+ skfddi_priv *bp = &smc->os;
unsigned long Flags;
spin_lock_irqsave(&bp->DriverLock, Flags);
@@ -887,7 +868,7 @@
static void skfp_ctl_set_multicast_list_wo_lock(struct net_device *dev)
{
- struct s_smc *smc = (struct s_smc *) dev->priv;
+ struct s_smc *smc = netdev_priv(dev);
struct dev_mc_list *dmi; /* ptr to multicast addr entry */
int i;
@@ -970,9 +951,9 @@
*/
static int skfp_ctl_set_mac_address(struct net_device *dev, void *addr)
{
- struct s_smc *smc = (struct s_smc *) dev->priv;
+ struct s_smc *smc = netdev_priv(dev);
struct sockaddr *p_sockaddr = (struct sockaddr *) addr;
- skfddi_priv *bp = (skfddi_priv *) & smc->os;
+ skfddi_priv *bp = &smc->os;
unsigned long Flags;
@@ -1010,12 +991,14 @@
static int skfp_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
- skfddi_priv *lp = PRIV(dev);
+ struct s_smc *smc = netdev_priv(dev);
+ skfddi_priv *lp = &smc->os;
struct s_skfp_ioctl ioc;
int status = 0;
if (copy_from_user(&ioc, rq->ifr_data, sizeof(struct s_skfp_ioctl)))
return -EFAULT;
+
switch (ioc.cmd) {
case SKFP_GET_STATS: /* Get the driver statistics */
ioc.len = sizeof(lp->MacStat);
@@ -1088,7 +1071,8 @@
*/
static int skfp_send_pkt(struct sk_buff *skb, struct net_device *dev)
{
- skfddi_priv *bp = PRIV(dev);
+ struct s_smc *smc = netdev_priv(dev);
+ skfddi_priv *bp = &smc->os;
PRINTK(KERN_INFO "skfp_send_pkt\n");
@@ -1115,7 +1099,7 @@
}
bp->QueueSkb--;
skb_queue_tail(&bp->SendSkbQueue, skb);
- send_queued_packets((struct s_smc *) dev->priv);
+ send_queued_packets(netdev_priv(dev));
if (bp->QueueSkb == 0) {
netif_stop_queue(dev);
}
@@ -1150,7 +1134,7 @@
*/
static void send_queued_packets(struct s_smc *smc)
{
- skfddi_priv *bp = (skfddi_priv *) & smc->os;
+ skfddi_priv *bp = &smc->os;
struct sk_buff *skb;
unsigned char fc;
int queue;
@@ -1322,7 +1306,7 @@
************************/
void llc_restart_tx(struct s_smc *smc)
{
- skfddi_priv *bp = (skfddi_priv *) & smc->os;
+ skfddi_priv *bp = &smc->os;
PRINTK(KERN_INFO "[llc_restart_tx]\n");
@@ -1506,7 +1490,7 @@
* unmap first, the hardware module could read inconsistent data.
*/
if (flag & DMA_WR) {
- skfddi_priv *bp = (skfddi_priv *) & smc->os;
+ skfddi_priv *bp = &smc->os;
volatile struct s_smt_fp_rxd *r = &descr->r;
/* If SKB is NULL, we used the local buffer. */
@@ -1620,7 +1604,7 @@
void mac_drv_rx_complete(struct s_smc *smc, volatile struct s_smt_fp_rxd *rxd,
int frag_count, int len)
{
- skfddi_priv *bp = (skfddi_priv *) & smc->os;
+ skfddi_priv *bp = &smc->os;
struct sk_buff *skb;
unsigned char *virt, *cp;
unsigned short ri;
@@ -1752,7 +1736,7 @@
printk("fddi: Multi-fragment requeue!\n");
- MaxFrameSize = ((skfddi_priv *) & smc->os)->MaxFrameSize;
+ MaxFrameSize = smc->os.MaxFrameSize;
src_rxd = rxd;
for (; frag_count > 0; frag_count--) {
next_rxd = src_rxd->rxd_next;
@@ -1828,7 +1812,7 @@
// Walk through the list of free receive buffers, passing receive
// buffers to the HWM as long as RXDs are available.
- MaxFrameSize = ((skfddi_priv *) & smc->os)->MaxFrameSize;
+ MaxFrameSize = smc->os.MaxFrameSize;
// Check if there is any RXD left.
while (HWM_GET_RX_FREE(smc) > 0) {
PRINTK(KERN_INFO ".\n");
@@ -1897,7 +1881,7 @@
for (; frag_count > 0; frag_count--) {
skb = rxd->rxd_os.skb;
if (skb != NULL) {
- skfddi_priv *bp = (skfddi_priv *) & smc->os;
+ skfddi_priv *bp = &smc->os;
int MaxFrameSize = bp->MaxFrameSize;
pci_unmap_single(&bp->pdev, rxd->rxd_os.dma_addr,
@@ -1964,7 +1948,7 @@
memcpy(skb->data, look_ahead, len);
// deliver frame to system
- skb->protocol = fddi_type_trans(skb, ((skfddi_priv *) & smc->os)->dev);
+ skb->protocol = fddi_type_trans(skb, smc->os.dev);
skb->dev->last_rx = jiffies;
netif_rx(skb);
diff -Nru a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
--- a/drivers/net/tulip/de2104x.c 2005-01-27 18:44:48 -05:00
+++ b/drivers/net/tulip/de2104x.c 2005-01-27 18:44:48 -05:00
@@ -1703,6 +1703,7 @@
value = dr32(ROMCmd);
while (value < 0 && --boguscnt > 0);
de->dev->dev_addr[i] = value;
+ udelay(1);
if (boguscnt <= 0)
printk(KERN_WARNING PFX "timeout reading 21040 MAC address byte %u\n", i);
}
^ permalink raw reply [flat|nested] 13+ messages in thread
* [BK PATCHES] 2.6.x net driver fixes
@ 2005-02-13 20:18 Jeff Garzik
0 siblings, 0 replies; 13+ messages in thread
From: Jeff Garzik @ 2005-02-13 20:18 UTC (permalink / raw)
To: Andrew Morton, Linus Torvalds; +Cc: Netdev
[-- Attachment #1: Type: text/plain, Size: 0 bytes --]
[-- Attachment #2: changelog.txt --]
[-- Type: text/plain, Size: 2914 bytes --]
Please do a
bk pull bk://gkernel.bkbits.net/net-drivers-2.6
This will update the following files:
drivers/net/ibm_emac/ibm_emac_core.c | 8 +-
drivers/net/ibm_emac/ibm_emac_core.h | 2
drivers/net/tulip/de2104x.c | 4 -
drivers/net/wan/dscc4.c | 117 ++++++++++++++++++-----------------
4 files changed, 67 insertions(+), 64 deletions(-)
through these ChangeSets:
<mporter@kernel.crashing.org> (05/02/13 1.2033)
[PATCH] emac: fix mdio delay
Fixes MDIO delay. Please apply.
Signed-off-by: Ralph Siemsen <ralphs@netwinder.org>
Signed-off-by: Matt Porter <mporter@kernel.crashing.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
<mporter@kernel.crashing.org> (05/02/13 1.2032)
[PATCH] emac: fix jumbo frame support
Fixes a bug in RX buffer allocation so that jumbo size skbs are
allocated when the MTU size is changed. Also removes the deprecated
restore_flags() call. Please apply.
Signed-off-by: Matt Porter <mporter@kernel.crashing.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
<bjorn-helgaas@comcast.net> (05/02/11 1.2031)
[PATCH] de214x.c uses uninitialized pci_dev->irq
Don't use pci_dev->irq until after pci_enable_device().
Andy Esten reported that his NIC stopped working in
2.6.10 because of this problem.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
<romieu@fr.zoreil.com> (05/01/27 1.1966.102.5)
[PATCH] dscc4: removal of unneeded variable
Removal of unneeded variable and more spaces for my eyes.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
<romieu@fr.zoreil.com> (05/01/27 1.1966.102.4)
[PATCH] dscc4: removal of unneeded casts
Removal of unneeded casts.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
<romieu@fr.zoreil.com> (05/01/27 1.1966.102.3)
[PATCH] dscc4: error status checking and pci janitoring
Error status checking and PCI janitoring
- propagation of the error code;
- pci_request_region use in dscc4_init_one;
- missing pci_disable_device() added to the error path;
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
<romieu@fr.zoreil.com> (05/01/27 1.1966.102.2)
[PATCH] dscc4: code factorisation
Small code factorization.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
<romieu@fr.zoreil.com> (05/01/27 1.1966.102.1)
[PATCH] dscc4: use of uncompletely initialized struct
dscc4_set_quartz() is issued with an argument in an unitialized state and
the kernel does not like it.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
[-- Attachment #3: patch --]
[-- Type: text/plain, Size: 8858 bytes --]
diff -Nru a/drivers/net/ibm_emac/ibm_emac_core.c b/drivers/net/ibm_emac/ibm_emac_core.c
--- a/drivers/net/ibm_emac/ibm_emac_core.c 2005-02-13 15:18:01 -05:00
+++ b/drivers/net/ibm_emac/ibm_emac_core.c 2005-02-13 15:18:01 -05:00
@@ -475,8 +475,9 @@
out_be32(&emacp->em0stacr, stacr);
- while (((stacr = in_be32(&emacp->em0stacr) & EMAC_STACR_OC) == 0)
- && (count++ < 5000))
+ count = 0;
+ while ((((stacr = in_be32(&emacp->em0stacr)) & EMAC_STACR_OC) == 0)
+ && (count++ < MDIO_DELAY))
udelay(1);
MDIO_DEBUG((" (count was %d)\n", count));
@@ -912,7 +913,6 @@
PKT_DEBUG(("emac_start_xmit() stopping queue\n"));
netif_stop_queue(dev);
spin_unlock_irqrestore(&fep->lock, flags);
- restore_flags(flags);
return -EBUSY;
}
@@ -1281,7 +1281,7 @@
/* Format the receive descriptor ring. */
ep->rx_slot = 0;
/* Default is MTU=1500 + Ethernet overhead */
- ep->rx_buffer_size = ENET_DEF_BUF_SIZE;
+ ep->rx_buffer_size = dev->mtu + ENET_HEADER_SIZE + ENET_FCS_SIZE;
emac_rx_fill(dev, 0);
if (ep->rx_slot != 0) {
printk(KERN_ERR
diff -Nru a/drivers/net/ibm_emac/ibm_emac_core.h b/drivers/net/ibm_emac/ibm_emac_core.h
--- a/drivers/net/ibm_emac/ibm_emac_core.h 2005-02-13 15:18:01 -05:00
+++ b/drivers/net/ibm_emac/ibm_emac_core.h 2005-02-13 15:18:01 -05:00
@@ -77,8 +77,6 @@
#define ENET_HEADER_SIZE 14
#define ENET_FCS_SIZE 4
-#define ENET_DEF_MTU_SIZE 1500
-#define ENET_DEF_BUF_SIZE (ENET_DEF_MTU_SIZE + ENET_HEADER_SIZE + ENET_FCS_SIZE)
#define EMAC_MIN_FRAME 64
#define EMAC_MAX_FRAME 9018
#define EMAC_MIN_MTU (EMAC_MIN_FRAME - ENET_HEADER_SIZE - ENET_FCS_SIZE)
diff -Nru a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
--- a/drivers/net/tulip/de2104x.c 2005-02-13 15:18:01 -05:00
+++ b/drivers/net/tulip/de2104x.c 2005-02-13 15:18:01 -05:00
@@ -1960,8 +1960,6 @@
dev->tx_timeout = de_tx_timeout;
dev->watchdog_timeo = TX_TIMEOUT;
- dev->irq = pdev->irq;
-
de = dev->priv;
de->de21040 = ent->driver_data == 0 ? 1 : 0;
de->pdev = pdev;
@@ -1996,6 +1994,8 @@
pdev->irq, pci_name(pdev));
goto err_out_res;
}
+
+ dev->irq = pdev->irq;
/* obtain and check validity of PCI I/O address */
pciaddr = pci_resource_start(pdev, 1);
diff -Nru a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c
--- a/drivers/net/wan/dscc4.c 2005-02-13 15:18:01 -05:00
+++ b/drivers/net/wan/dscc4.c 2005-02-13 15:18:01 -05:00
@@ -691,7 +691,7 @@
root = ppriv->root;
for (i = 0; i < dev_per_card; i++)
- unregister_hdlc_device(dscc4_to_dev(&root[i]));
+ unregister_hdlc_device(dscc4_to_dev(root + i));
pci_set_drvdata(pdev, NULL);
@@ -706,33 +706,36 @@
{
struct dscc4_pci_priv *priv;
struct dscc4_dev_priv *dpriv;
- static int cards_found = 0;
void __iomem *ioaddr;
- int i;
+ int i, rc;
printk(KERN_DEBUG "%s", version);
- if (pci_enable_device(pdev))
- goto err_out;
- if (!request_mem_region(pci_resource_start(pdev, 0),
- pci_resource_len(pdev, 0), "registers")) {
+ rc = pci_enable_device(pdev);
+ if (rc < 0)
+ goto out;
+
+ rc = pci_request_region(pdev, 0, "registers");
+ if (rc < 0) {
printk(KERN_ERR "%s: can't reserve MMIO region (regs)\n",
DRV_NAME);
- goto err_out;
+ goto err_disable_0;
}
- if (!request_mem_region(pci_resource_start(pdev, 1),
- pci_resource_len(pdev, 1), "LBI interface")) {
+ rc = pci_request_region(pdev, 1, "LBI interface");
+ if (rc < 0) {
printk(KERN_ERR "%s: can't reserve MMIO region (lbi)\n",
DRV_NAME);
- goto err_out_free_mmio_region0;
+ goto err_free_mmio_region_1;
}
+
ioaddr = ioremap(pci_resource_start(pdev, 0),
pci_resource_len(pdev, 0));
if (!ioaddr) {
printk(KERN_ERR "%s: cannot remap MMIO region %lx @ %lx\n",
DRV_NAME, pci_resource_len(pdev, 0),
pci_resource_start(pdev, 0));
- goto err_out_free_mmio_region;
+ rc = -EIO;
+ goto err_free_mmio_regions_2;
}
printk(KERN_DEBUG "Siemens DSCC4, MMIO at %#lx (regs), %#lx (lbi), IRQ %d\n",
pci_resource_start(pdev, 0),
@@ -742,14 +745,16 @@
pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0xf8);
pci_set_master(pdev);
- if (dscc4_found1(pdev, ioaddr))
- goto err_out_iounmap;
+ rc = dscc4_found1(pdev, ioaddr);
+ if (rc < 0)
+ goto err_iounmap_3;
- priv = (struct dscc4_pci_priv *)pci_get_drvdata(pdev);
+ priv = pci_get_drvdata(pdev);
- if (request_irq(pdev->irq, &dscc4_irq, SA_SHIRQ, DRV_NAME, priv->root)){
+ rc = request_irq(pdev->irq, dscc4_irq, SA_SHIRQ, DRV_NAME, priv->root);
+ if (rc < 0) {
printk(KERN_WARNING "%s: IRQ %d busy\n", DRV_NAME, pdev->irq);
- goto err_out_free1;
+ goto err_release_4;
}
/* power up/little endian/dma core controlled via lrda/ltda */
@@ -769,9 +774,11 @@
priv->iqcfg = (u32 *) pci_alloc_consistent(pdev,
IRQ_RING_SIZE*sizeof(u32), &priv->iqcfg_dma);
if (!priv->iqcfg)
- goto err_out_free_irq;
+ goto err_free_irq_5;
writel(priv->iqcfg_dma, ioaddr + IQCFG);
+ rc = -ENOMEM;
+
/*
* SCC 0-3 private rx/tx irq structures
* IQRX/TXi needs to be set soon. Learned it the hard way...
@@ -781,7 +788,7 @@
dpriv->iqtx = (u32 *) pci_alloc_consistent(pdev,
IRQ_RING_SIZE*sizeof(u32), &dpriv->iqtx_dma);
if (!dpriv->iqtx)
- goto err_out_free_iqtx;
+ goto err_free_iqtx_6;
writel(dpriv->iqtx_dma, ioaddr + IQTX0 + i*4);
}
for (i = 0; i < dev_per_card; i++) {
@@ -789,7 +796,7 @@
dpriv->iqrx = (u32 *) pci_alloc_consistent(pdev,
IRQ_RING_SIZE*sizeof(u32), &dpriv->iqrx_dma);
if (!dpriv->iqrx)
- goto err_out_free_iqrx;
+ goto err_free_iqrx_7;
writel(dpriv->iqrx_dma, ioaddr + IQRX0 + i*4);
}
@@ -804,17 +811,18 @@
writel(0xff200001, ioaddr + GCMDR);
- cards_found++;
- return 0;
+ rc = 0;
+out:
+ return rc;
-err_out_free_iqrx:
+err_free_iqrx_7:
while (--i >= 0) {
dpriv = priv->root + i;
pci_free_consistent(pdev, IRQ_RING_SIZE*sizeof(u32),
dpriv->iqrx, dpriv->iqrx_dma);
}
i = dev_per_card;
-err_out_free_iqtx:
+err_free_iqtx_6:
while (--i >= 0) {
dpriv = priv->root + i;
pci_free_consistent(pdev, IRQ_RING_SIZE*sizeof(u32),
@@ -822,20 +830,19 @@
}
pci_free_consistent(pdev, IRQ_RING_SIZE*sizeof(u32), priv->iqcfg,
priv->iqcfg_dma);
-err_out_free_irq:
+err_free_irq_5:
free_irq(pdev->irq, priv->root);
-err_out_free1:
+err_release_4:
dscc4_free1(pdev);
-err_out_iounmap:
+err_iounmap_3:
iounmap (ioaddr);
-err_out_free_mmio_region:
- release_mem_region(pci_resource_start(pdev, 1),
- pci_resource_len(pdev, 1));
-err_out_free_mmio_region0:
- release_mem_region(pci_resource_start(pdev, 0),
- pci_resource_len(pdev, 0));
-err_out:
- return -ENODEV;
+err_free_mmio_regions_2:
+ pci_release_region(pdev, 1);
+err_free_mmio_region_1:
+ pci_release_region(pdev, 0);
+err_disable_0:
+ pci_disable_device(pdev);
+ goto out;
};
/*
@@ -882,8 +889,7 @@
struct dscc4_dev_priv *root;
int i, ret = -ENOMEM;
- root = (struct dscc4_dev_priv *)
- kmalloc(dev_per_card*sizeof(*root), GFP_KERNEL);
+ root = kmalloc(dev_per_card*sizeof(*root), GFP_KERNEL);
if (!root) {
printk(KERN_ERR "%s: can't allocate data\n", DRV_NAME);
goto err_out;
@@ -892,22 +898,17 @@
for (i = 0; i < dev_per_card; i++) {
root[i].dev = alloc_hdlcdev(root + i);
- if (!root[i].dev) {
- while (i--)
- free_netdev(root[i].dev);
+ if (!root[i].dev)
goto err_free_dev;
- }
}
- ppriv = (struct dscc4_pci_priv *) kmalloc(sizeof(*ppriv), GFP_KERNEL);
+ ppriv = kmalloc(sizeof(*ppriv), GFP_KERNEL);
if (!ppriv) {
printk(KERN_ERR "%s: can't allocate private data\n", DRV_NAME);
- goto err_free_dev2;
+ goto err_free_dev;
}
memset(ppriv, 0, sizeof(struct dscc4_pci_priv));
- ret = dscc4_set_quartz(root, quartz);
- if (ret < 0)
- goto err_free_priv;
+
ppriv->root = root;
spin_lock_init(&ppriv->lock);
@@ -951,20 +952,24 @@
goto err_unregister;
}
}
+
+ ret = dscc4_set_quartz(root, quartz);
+ if (ret < 0)
+ goto err_unregister;
+
pci_set_drvdata(pdev, ppriv);
return ret;
err_unregister:
- while (--i >= 0) {
+ while (i-- > 0) {
dscc4_release_ring(root + i);
- unregister_hdlc_device(dscc4_to_dev(&root[i]));
+ unregister_hdlc_device(dscc4_to_dev(root + i));
}
-err_free_priv:
kfree(ppriv);
-err_free_dev2:
- for (i = 0; i < dev_per_card; i++)
- free_netdev(root[i].dev);
+ i = dev_per_card;
err_free_dev:
+ while (i-- > 0)
+ free_netdev(root[i].dev);
kfree(root);
err_out:
return ret;
@@ -1998,10 +2003,10 @@
iounmap(ioaddr);
- release_mem_region(pci_resource_start(pdev, 1),
- pci_resource_len(pdev, 1));
- release_mem_region(pci_resource_start(pdev, 0),
- pci_resource_len(pdev, 0));
+ pci_release_region(pdev, 1);
+ pci_release_region(pdev, 0);
+
+ pci_disable_device(pdev);
}
static int dscc4_hdlc_attach(struct net_device *dev, unsigned short encoding,
^ permalink raw reply [flat|nested] 13+ messages in thread
* [BK PATCHES] 2.6.x net driver fixes
@ 2005-02-21 2:30 Jeff Garzik
0 siblings, 0 replies; 13+ messages in thread
From: Jeff Garzik @ 2005-02-21 2:30 UTC (permalink / raw)
To: Andrew Morton, Linus Torvalds; +Cc: Netdev
[-- Attachment #1: Type: text/plain, Size: 34 bytes --]
see attached changelog and patch.
[-- Attachment #2: changelog.txt --]
[-- Type: text/plain, Size: 1980 bytes --]
Please do a
bk pull bk://gkernel.bkbits.net/net-drivers-2.6
This will update the following files:
drivers/net/natsemi.c | 4 +++-
drivers/net/s2io.c | 5 +++++
drivers/net/wireless/strip.c | 4 ++--
3 files changed, 10 insertions(+), 3 deletions(-)
through these ChangeSets:
<Gary.Spiess@Intermec.com> (05/02/20 1.2078)
[PATCH] natsemi long cable fix
This is a minor modification to the previous patch submission that does
not assume the default contents of the DSPCFG register are zero.
When used with Revision D of the DP83815, the "Recommended Registers
Configuration" from page 78 of the DP83815 data sheet is not entirely
compatible with the driver's "short cable patch". When the DSPCFG
register is written with the value suggested in the document, then
do_cable_magic() can't read the DSP coefficient and determines that all
cables attached to the DP83815D are 'short', regardless of actual
length. Short cables (< 30m) cause do_cable_magic to enable additional
attenuation to reduce CRC and idle errors. If the extra attenuation is
unintentionally enabled for long cables (> 50m?), they will not operate
properly. The National Semiconductor driver, 'dp83815.c' from
http://www.national.com/appinfo/networks/files/linux_2_4.tar.gz was used
as a basis for this modification.
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
<ravinandan.arakali@neterion.com> (05/02/20 1.2077)
[PATCH] S2io: Multicast fix
Attached is the patch to address the incorrect programming of
individual multicast address into the NIC.
Signed-off-by: Ravinandan Arakali <ravinandan.arakali@neterion.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
<akpm@osdl.org> (05/02/20 1.2076)
[PATCH] strip.c build fix
Someone added a new dev_set_mac_address() to netdevice.h
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
[-- Attachment #3: patch --]
[-- Type: text/plain, Size: 2528 bytes --]
diff -Nru a/drivers/net/natsemi.c b/drivers/net/natsemi.c
--- a/drivers/net/natsemi.c 2005-02-20 21:30:01 -05:00
+++ b/drivers/net/natsemi.c 2005-02-20 21:30:01 -05:00
@@ -441,6 +441,7 @@
#define DSPCFG_VAL 0x5040
#define SDCFG_VAL 0x008c /* set voltage thresholds for Signal Detect */
#define DSPCFG_LOCK 0x20 /* coefficient lock bit in DSPCFG */
+#define DSPCFG_COEF 0x1000 /* see coefficient (in TSTDAT) bit in DSPCFG */
#define TSTDAT_FIXED 0xe8 /* magic number for bad coefficients */
/* misc PCI space registers */
@@ -1243,7 +1244,8 @@
writew(1, ioaddr + PGSEL);
writew(PMDCSR_VAL, ioaddr + PMDCSR);
writew(TSTDAT_VAL, ioaddr + TSTDAT);
- np->dspcfg = DSPCFG_VAL;
+ np->dspcfg = (np->srr <= SRR_DP83815_C)?
+ DSPCFG_VAL : (DSPCFG_COEF | readw(ioaddr + DSPCFG));
writew(np->dspcfg, ioaddr + DSPCFG);
writew(SDCFG_VAL, ioaddr + SDCFG);
writew(0, ioaddr + PGSEL);
diff -Nru a/drivers/net/s2io.c b/drivers/net/s2io.c
--- a/drivers/net/s2io.c 2005-02-20 21:30:01 -05:00
+++ b/drivers/net/s2io.c 2005-02-20 21:30:01 -05:00
@@ -3025,6 +3025,8 @@
for (i = 0; i < prev_cnt; i++) {
writeq(RMAC_ADDR_DATA0_MEM_ADDR(dis_addr),
&bar0->rmac_addr_data0_mem);
+ writeq(RMAC_ADDR_DATA1_MEM_MASK(0ULL),
+ &bar0->rmac_addr_data1_mem);
val64 = RMAC_ADDR_CMD_MEM_WE |
RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |
RMAC_ADDR_CMD_MEM_OFFSET
@@ -3049,8 +3051,11 @@
mac_addr |= mclist->dmi_addr[j];
mac_addr <<= 8;
}
+ mac_addr >>= 8;
writeq(RMAC_ADDR_DATA0_MEM_ADDR(mac_addr),
&bar0->rmac_addr_data0_mem);
+ writeq(RMAC_ADDR_DATA1_MEM_MASK(0ULL),
+ &bar0->rmac_addr_data1_mem);
val64 = RMAC_ADDR_CMD_MEM_WE |
RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD |
diff -Nru a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c
--- a/drivers/net/wireless/strip.c 2005-02-20 21:30:01 -05:00
+++ b/drivers/net/wireless/strip.c 2005-02-20 21:30:01 -05:00
@@ -2398,7 +2398,7 @@
return 0;
}
-static int dev_set_mac_address(struct net_device *dev, void *addr)
+static int strip_set_mac_address(struct net_device *dev, void *addr)
{
struct strip *strip_info = (struct strip *) (dev->priv);
struct sockaddr *sa = addr;
@@ -2552,7 +2552,7 @@
dev->hard_start_xmit = strip_xmit;
dev->hard_header = strip_header;
dev->rebuild_header = strip_rebuild_header;
- dev->set_mac_address = dev_set_mac_address;
+ dev->set_mac_address = strip_set_mac_address;
dev->get_stats = strip_get_stats;
dev->change_mtu = strip_change_mtu;
}
^ permalink raw reply [flat|nested] 13+ messages in thread
* [BK PATCHES] 2.6.x net driver fixes
@ 2005-03-12 4:33 Jeff Garzik
0 siblings, 0 replies; 13+ messages in thread
From: Jeff Garzik @ 2005-03-12 4:33 UTC (permalink / raw)
To: Andrew Morton, Linus Torvalds; +Cc: Netdev, Linux Kernel
[-- Attachment #1: Type: text/plain, Size: 0 bytes --]
[-- Attachment #2: net-drivers.txt --]
[-- Type: text/plain, Size: 790 bytes --]
Please do a
bk pull bk://gkernel.bkbits.net/net-drivers-2.6
This will update the following files:
drivers/net/lance.c | 1 +
drivers/net/r8169.c | 17 ++++++++++-------
drivers/net/sk98lin/skge.c | 2 +-
drivers/net/tulip/media.c | 4 ++--
drivers/net/tulip/tulip_core.c | 21 ++++++++++++---------
drivers/net/typhoon-firmware.h | 2 +-
6 files changed, 27 insertions(+), 20 deletions(-)
through these ChangeSets:
<apatard:mandrakesoft.com>:
o sk98lin driver: fix driver name string
Adrian Bunk:
o drivers/net/typhoon: make a firmware image static
Alan Cox:
o ac bits for ULI ethernet missing from 2.6.11
François Romieu:
o Fix r8169: panic on 2.6.11
Matthew Wilcox:
o Lance needs delay.h
[-- Attachment #3: net-drivers.patch --]
[-- Type: text/x-patch, Size: 4917 bytes --]
diff -Nru a/drivers/net/lance.c b/drivers/net/lance.c
--- a/drivers/net/lance.c 2005-03-11 23:31:46 -05:00
+++ b/drivers/net/lance.c 2005-03-11 23:31:46 -05:00
@@ -47,6 +47,7 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/string.h>
+#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/slab.h>
diff -Nru a/drivers/net/r8169.c b/drivers/net/r8169.c
--- a/drivers/net/r8169.c 2005-03-11 23:31:46 -05:00
+++ b/drivers/net/r8169.c 2005-03-11 23:31:46 -05:00
@@ -1683,16 +1683,19 @@
rtl8169_make_unusable_by_asic(desc);
}
-static inline void rtl8169_return_to_asic(struct RxDesc *desc, int rx_buf_sz)
+static inline void rtl8169_mark_to_asic(struct RxDesc *desc, u32 rx_buf_sz)
{
- desc->opts1 |= cpu_to_le32(DescOwn + rx_buf_sz);
+ u32 eor = le32_to_cpu(desc->opts1) & RingEnd;
+
+ desc->opts1 = cpu_to_le32(DescOwn | eor | rx_buf_sz);
}
-static inline void rtl8169_give_to_asic(struct RxDesc *desc, dma_addr_t mapping,
- int rx_buf_sz)
+static inline void rtl8169_map_to_asic(struct RxDesc *desc, dma_addr_t mapping,
+ u32 rx_buf_sz)
{
desc->addr = cpu_to_le64(mapping);
- desc->opts1 |= cpu_to_le32(DescOwn + rx_buf_sz);
+ wmb();
+ rtl8169_mark_to_asic(desc, rx_buf_sz);
}
static int rtl8169_alloc_rx_skb(struct pci_dev *pdev, struct sk_buff **sk_buff,
@@ -1712,7 +1715,7 @@
mapping = pci_map_single(pdev, skb->tail, rx_buf_sz,
PCI_DMA_FROMDEVICE);
- rtl8169_give_to_asic(desc, mapping, rx_buf_sz);
+ rtl8169_map_to_asic(desc, mapping, rx_buf_sz);
out:
return ret;
@@ -2150,7 +2153,7 @@
skb_reserve(skb, NET_IP_ALIGN);
eth_copy_and_sum(skb, sk_buff[0]->tail, pkt_size, 0);
*sk_buff = skb;
- rtl8169_return_to_asic(desc, rx_buf_sz);
+ rtl8169_mark_to_asic(desc, rx_buf_sz);
ret = 0;
}
}
diff -Nru a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c
--- a/drivers/net/sk98lin/skge.c 2005-03-11 23:31:46 -05:00
+++ b/drivers/net/sk98lin/skge.c 2005-03-11 23:31:46 -05:00
@@ -5155,7 +5155,7 @@
MODULE_DEVICE_TABLE(pci, skge_pci_tbl);
static struct pci_driver skge_driver = {
- .name = "skge",
+ .name = "sk98lin",
.id_table = skge_pci_tbl,
.probe = skge_probe_one,
.remove = __devexit_p(skge_remove_one),
diff -Nru a/drivers/net/tulip/media.c b/drivers/net/tulip/media.c
--- a/drivers/net/tulip/media.c 2005-03-11 23:31:46 -05:00
+++ b/drivers/net/tulip/media.c 2005-03-11 23:31:46 -05:00
@@ -88,7 +88,7 @@
value = ioread32(ioaddr + CSR9);
iowrite32(value & 0xFFEFFFFF, ioaddr + CSR9);
- value = (phy_id << 21) | (location << 16) | 0x80000000;
+ value = (phy_id << 21) | (location << 16) | 0x08000000;
iowrite32(value, ioaddr + CSR10);
while(--i > 0) {
@@ -166,7 +166,7 @@
value = ioread32(ioaddr + CSR9);
iowrite32(value & 0xFFEFFFFF, ioaddr + CSR9);
- value = (phy_id << 21) | (location << 16) | 0x40000000 | (val & 0xFFFF);
+ value = (phy_id << 21) | (location << 16) | 0x04000000 | (val & 0xFFFF);
iowrite32(value, ioaddr + CSR10);
while(--i > 0) {
diff -Nru a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
--- a/drivers/net/tulip/tulip_core.c 2005-03-11 23:31:46 -05:00
+++ b/drivers/net/tulip/tulip_core.c 2005-03-11 23:31:46 -05:00
@@ -1102,15 +1102,18 @@
entry = tp->cur_tx++ % TX_RING_SIZE;
if (entry != 0) {
- /* Avoid a chip errata by prefixing a dummy entry. */
- tp->tx_buffers[entry].skb = NULL;
- tp->tx_buffers[entry].mapping = 0;
- tp->tx_ring[entry].length =
- (entry == TX_RING_SIZE-1) ? cpu_to_le32(DESC_RING_WRAP) : 0;
- tp->tx_ring[entry].buffer1 = 0;
- /* Must set DescOwned later to avoid race with chip */
- dummy = entry;
- entry = tp->cur_tx++ % TX_RING_SIZE;
+ /* Avoid a chip errata by prefixing a dummy entry. Don't do
+ this on the ULI526X as it triggers a different problem */
+ if (!(tp->chip_id == ULI526X && (tp->revision = 0x40 || tp->revision == 0x50))) {
+ tp->tx_buffers[entry].skb = NULL;
+ tp->tx_buffers[entry].mapping = 0;
+ tp->tx_ring[entry].length =
+ (entry == TX_RING_SIZE-1) ? cpu_to_le32(DESC_RING_WRAP) : 0;
+ tp->tx_ring[entry].buffer1 = 0;
+ /* Must set DescOwned later to avoid race with chip */
+ dummy = entry;
+ entry = tp->cur_tx++ % TX_RING_SIZE;
+ }
}
tp->tx_buffers[entry].skb = NULL;
diff -Nru a/drivers/net/typhoon-firmware.h b/drivers/net/typhoon-firmware.h
--- a/drivers/net/typhoon-firmware.h 2005-03-11 23:31:46 -05:00
+++ b/drivers/net/typhoon-firmware.h 2005-03-11 23:31:46 -05:00
@@ -32,7 +32,7 @@
*/
/* ver 03.001.008 */
-const u8 typhoon_firmware_image[] = {
+static const u8 typhoon_firmware_image[] = {
0x54, 0x59, 0x50, 0x48, 0x4f, 0x4f, 0x4e, 0x00, 0x02, 0x00, 0x00, 0x00,
0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xcb, 0x99, 0xb1, 0xd4,
0x4c, 0xb8, 0xd0, 0x4b, 0x32, 0x02, 0xd4, 0xee, 0x73, 0x7e, 0x0b, 0x13,
^ permalink raw reply [flat|nested] 13+ messages in thread
* [BK PATCHES] 2.6.x net driver fixes
@ 2005-03-29 21:04 Jeff Garzik
0 siblings, 0 replies; 13+ messages in thread
From: Jeff Garzik @ 2005-03-29 21:04 UTC (permalink / raw)
To: Andrew Morton, Linus Torvalds; +Cc: Netdev, Linux Kernel
[-- Attachment #1: Type: text/plain, Size: 0 bytes --]
[-- Attachment #2: changelog.txt --]
[-- Type: text/plain, Size: 1365 bytes --]
Please do a
bk pull bk://gkernel.bkbits.net/net-drivers-2.6
This will update the following files:
MAINTAINERS | 7 ++++---
drivers/net/8139too.c | 8 ++++++--
drivers/net/Kconfig | 5 +++--
drivers/net/arcnet/arcnet.c | 4 ++--
drivers/net/bonding/bond_alb.c | 4 +++-
drivers/net/depca.c | 2 +-
drivers/net/mii.c | 9 ++++++---
drivers/net/sis900.c | 2 ++
drivers/net/sk98lin/skethtool.c | 3 ---
drivers/net/via-velocity.c | 6 ++++--
drivers/net/wireless/airo.c | 2 +-
11 files changed, 32 insertions(+), 20 deletions(-)
through these ChangeSets:
<komurojun-mbn:nifty.com>:
o net/Kconfig: remove unsupported network adapter names
Adrian Bunk:
o drivers/net/wireless/airo.c: correct a wrong check
o drivers/net/sis900.c: fix a warning
Andres Salomon:
o fix pci_disable_device in 8139too
Andrew Morton:
o bonding needs inet
Dale Farnsworth:
o mii: GigE support bug fixes
Daniele Venzano:
o Maintainer change for the sis900 driver
Domen Puncer:
o net/sk98lin: remove duplicate delay
John W. Linville:
o bonding: avoid tx balance for IGMP (alb/tlb mode)
Mikael Pettersson:
o drivers/net/depca.c gcc4 fix
o drivers/net/arcnet/arcnet.c gcc4 fixes
Pavel Machek:
o Fix suspend/resume on via-velocity
[-- Attachment #3: patch --]
[-- Type: text/plain, Size: 8248 bytes --]
diff -Nru a/MAINTAINERS b/MAINTAINERS
--- a/MAINTAINERS 2005-03-29 15:49:53 -05:00
+++ b/MAINTAINERS 2005-03-29 15:49:54 -05:00
@@ -2044,10 +2044,11 @@
S: Maintained
SIS 900/7016 FAST ETHERNET DRIVER
-P: Ollie Lho
-M: ollie@sis.com.tw
+P: Daniele Venzano
+M: venza@brownhat.org
+W: http://www.brownhat.org/sis900.html
L: linux-net@vger.kernel.org
-S: Supported
+S: Maintained
SIS FRAMEBUFFER DRIVER
P: Thomas Winischhofer
diff -Nru a/drivers/net/8139too.c b/drivers/net/8139too.c
--- a/drivers/net/8139too.c 2005-03-29 15:49:53 -05:00
+++ b/drivers/net/8139too.c 2005-03-29 15:49:53 -05:00
@@ -749,7 +749,6 @@
pci_release_regions (pdev);
free_netdev(dev);
- pci_disable_device(pdev);
pci_set_drvdata (pdev, NULL);
}
@@ -778,7 +777,7 @@
struct net_device *dev;
struct rtl8139_private *tp;
u8 tmp8;
- int rc;
+ int rc, disable_dev_on_err = 0;
unsigned int i;
unsigned long pio_start, pio_end, pio_flags, pio_len;
unsigned long mmio_start, mmio_end, mmio_flags, mmio_len;
@@ -850,6 +849,7 @@
rc = pci_request_regions (pdev, "8139too");
if (rc)
goto err_out;
+ disable_dev_on_err = 1;
/* enable PCI bus-mastering */
pci_set_master (pdev);
@@ -935,6 +935,8 @@
err_out:
__rtl8139_cleanup_dev (dev);
+ if (disable_dev_on_err)
+ pci_disable_device (pdev);
return rc;
}
@@ -1112,6 +1114,7 @@
err_out:
__rtl8139_cleanup_dev (dev);
+ pci_disable_device (pdev);
return i;
}
@@ -1125,6 +1128,7 @@
unregister_netdev (dev);
__rtl8139_cleanup_dev (dev);
+ pci_disable_device (pdev);
}
diff -Nru a/drivers/net/Kconfig b/drivers/net/Kconfig
--- a/drivers/net/Kconfig 2005-03-29 15:49:54 -05:00
+++ b/drivers/net/Kconfig 2005-03-29 15:49:54 -05:00
@@ -44,6 +44,7 @@
config BONDING
tristate "Bonding driver support"
depends on NETDEVICES
+ depends on INET
---help---
Say 'Y' or 'M' if you wish to be able to 'bond' multiple Ethernet
Channels together. This is called 'Etherchannel' by Cisco,
@@ -612,7 +613,7 @@
will be called 3c507.
config EL3
- tristate "3c509/3c529 (MCA)/3c569B (98)/3c579 \"EtherLink III\" support"
+ tristate "3c509/3c529 (MCA)/3c579 \"EtherLink III\" support"
depends on NET_VENDOR_3COM && (ISA || EISA || MCA)
---help---
If you have a network (Ethernet) card belonging to the 3Com
@@ -876,7 +877,7 @@
source "drivers/net/tulip/Kconfig"
config AT1700
- tristate "AT1700/1720/RE1000Plus(C-Bus) support (EXPERIMENTAL)"
+ tristate "AT1700/1720 support (EXPERIMENTAL)"
depends on NET_ETHERNET && (ISA || MCA_LEGACY) && EXPERIMENTAL
select CRC32
---help---
diff -Nru a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c
--- a/drivers/net/arcnet/arcnet.c 2005-03-29 15:49:54 -05:00
+++ b/drivers/net/arcnet/arcnet.c 2005-03-29 15:49:54 -05:00
@@ -253,7 +253,7 @@
BUGLVL(D_DURING) {
BUGMSG(D_DURING, "release_arcbuf: freed #%d; buffer queue is now: ",
bufnum);
- for (i = lp->next_buf; i != lp->first_free_buf; i = ++i % 5)
+ for (i = lp->next_buf; i != lp->first_free_buf; i = (i+1) % 5)
BUGMSG2(D_DURING, "#%d ", lp->buf_queue[i]);
BUGMSG2(D_DURING, "\n");
}
@@ -289,7 +289,7 @@
BUGLVL(D_DURING) {
BUGMSG(D_DURING, "get_arcbuf: got #%d; buffer queue is now: ", buf);
- for (i = lp->next_buf; i != lp->first_free_buf; i = ++i % 5)
+ for (i = lp->next_buf; i != lp->first_free_buf; i = (i+1) % 5)
BUGMSG2(D_DURING, "#%d ", lp->buf_queue[i]);
BUGMSG2(D_DURING, "\n");
}
diff -Nru a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
--- a/drivers/net/bonding/bond_alb.c 2005-03-29 15:49:54 -05:00
+++ b/drivers/net/bonding/bond_alb.c 2005-03-29 15:49:54 -05:00
@@ -54,6 +54,7 @@
#include <linux/if_ether.h>
#include <linux/if_bonding.h>
#include <linux/if_vlan.h>
+#include <linux/in.h>
#include <net/ipx.h>
#include <net/arp.h>
#include <asm/byteorder.h>
@@ -1300,7 +1301,8 @@
switch (ntohs(skb->protocol)) {
case ETH_P_IP:
if ((memcmp(eth_data->h_dest, mac_bcast, ETH_ALEN) == 0) ||
- (skb->nh.iph->daddr == ip_bcast)) {
+ (skb->nh.iph->daddr == ip_bcast) ||
+ (skb->nh.iph->protocol == IPPROTO_IGMP)) {
do_tx_balance = 0;
break;
}
diff -Nru a/drivers/net/depca.c b/drivers/net/depca.c
--- a/drivers/net/depca.c 2005-03-29 15:49:53 -05:00
+++ b/drivers/net/depca.c 2005-03-29 15:49:53 -05:00
@@ -1827,7 +1827,7 @@
/* set up the buffer descriptors */
len = (skb->len < ETH_ZLEN) ? ETH_ZLEN : skb->len;
- for (i = entry; i != end; i = (++i) & lp->txRingMask) {
+ for (i = entry; i != end; i = (i+1) & lp->txRingMask) {
/* clean out flags */
writel(readl(&lp->tx_ring[i].base) & ~T_FLAGS, &lp->tx_ring[i].base);
writew(0x0000, &lp->tx_ring[i].misc); /* clears other error flags */
diff -Nru a/drivers/net/mii.c b/drivers/net/mii.c
--- a/drivers/net/mii.c 2005-03-29 15:49:53 -05:00
+++ b/drivers/net/mii.c 2005-03-29 15:49:53 -05:00
@@ -43,6 +43,9 @@
(SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full |
SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full |
SUPPORTED_Autoneg | SUPPORTED_TP | SUPPORTED_MII);
+ if (mii->supports_gmii)
+ ecmd->supported |= SUPPORTED_1000baseT_Half |
+ SUPPORTED_1000baseT_Full;
/* only supports twisted-pair */
ecmd->port = PORT_MII;
@@ -100,7 +103,7 @@
} else {
ecmd->autoneg = AUTONEG_DISABLE;
- ecmd->speed = ((bmcr2 & BMCR_SPEED1000 &&
+ ecmd->speed = ((bmcr & BMCR_SPEED1000 &&
(bmcr & BMCR_SPEED100) == 0) ? SPEED_1000 :
(bmcr & BMCR_SPEED100) ? SPEED_100 : SPEED_10);
ecmd->duplex = (bmcr & BMCR_FULLDPLX) ? DUPLEX_FULL : DUPLEX_HALF;
@@ -163,9 +166,9 @@
tmp |= ADVERTISE_100FULL;
if (mii->supports_gmii) {
if (ecmd->advertising & ADVERTISED_1000baseT_Half)
- advert2 |= ADVERTISE_1000HALF;
+ tmp2 |= ADVERTISE_1000HALF;
if (ecmd->advertising & ADVERTISED_1000baseT_Full)
- advert2 |= ADVERTISE_1000FULL;
+ tmp2 |= ADVERTISE_1000FULL;
}
if (advert != tmp) {
mii->mdio_write(dev, mii->phy_id, MII_ADVERTISE, tmp);
diff -Nru a/drivers/net/sis900.c b/drivers/net/sis900.c
--- a/drivers/net/sis900.c 2005-03-29 15:49:53 -05:00
+++ b/drivers/net/sis900.c 2005-03-29 15:49:53 -05:00
@@ -196,7 +196,9 @@
MODULE_PARM_DESC(max_interrupt_work, "SiS 900/7016 maximum events handled per interrupt");
MODULE_PARM_DESC(sis900_debug, "SiS 900/7016 bitmapped debugging message level");
+#ifdef CONFIG_NET_POLL_CONTROLLER
static void sis900_poll(struct net_device *dev);
+#endif
static int sis900_open(struct net_device *net_dev);
static int sis900_mii_probe (struct net_device * net_dev);
static void sis900_init_rxfilter (struct net_device * net_dev);
diff -Nru a/drivers/net/sk98lin/skethtool.c b/drivers/net/sk98lin/skethtool.c
--- a/drivers/net/sk98lin/skethtool.c 2005-03-29 15:49:54 -05:00
+++ b/drivers/net/sk98lin/skethtool.c 2005-03-29 15:49:54 -05:00
@@ -437,9 +437,6 @@
pAC->LedsOn = 0;
mod_timer(&pAC->BlinkTimer, jiffies);
msleep_interruptible(data * 1000);
-
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(data * HZ);
del_timer_sync(&pAC->BlinkTimer);
toggleLeds(pNet, 0);
diff -Nru a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
--- a/drivers/net/via-velocity.c 2005-03-29 15:49:54 -05:00
+++ b/drivers/net/via-velocity.c 2005-03-29 15:49:54 -05:00
@@ -3212,7 +3212,8 @@
static int velocity_suspend(struct pci_dev *pdev, pm_message_t state)
{
- struct velocity_info *vptr = pci_get_drvdata(pdev);
+ struct net_device *dev = pci_get_drvdata(pdev);
+ struct velocity_info *vptr = netdev_priv(dev);
unsigned long flags;
if(!netif_running(vptr->dev))
@@ -3245,7 +3246,8 @@
static int velocity_resume(struct pci_dev *pdev)
{
- struct velocity_info *vptr = pci_get_drvdata(pdev);
+ struct net_device *dev = pci_get_drvdata(pdev);
+ struct velocity_info *vptr = netdev_priv(dev);
unsigned long flags;
int i;
diff -Nru a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
--- a/drivers/net/wireless/airo.c 2005-03-29 15:49:53 -05:00
+++ b/drivers/net/wireless/airo.c 2005-03-29 15:49:53 -05:00
@@ -3440,7 +3440,7 @@
/* Make sure we got something */
if (rxd.rdy && rxd.valid == 0) {
len = rxd.len + 12;
- if (len < 12 && len > 2048)
+ if (len < 12 || len > 2048)
goto badrx;
skb = dev_alloc_skb(len);
^ permalink raw reply [flat|nested] 13+ messages in thread
* [BK PATCHES] 2.6.x net driver fixes
@ 2005-03-31 1:59 Jeff Garzik
0 siblings, 0 replies; 13+ messages in thread
From: Jeff Garzik @ 2005-03-31 1:59 UTC (permalink / raw)
To: Andrew Morton, Linus Torvalds; +Cc: Netdev, Linux Kernel
[-- Attachment #1: Type: text/plain, Size: 0 bytes --]
[-- Attachment #2: changelog.txt --]
[-- Type: text/plain, Size: 1093 bytes --]
Please do a
bk pull bk://gkernel.bkbits.net/net-drivers-2.6
This will update the following files:
drivers/net/b44.c | 36 +++---
drivers/net/b44.h | 3
drivers/net/e1000/e1000.h | 1
drivers/net/e1000/e1000_main.c | 21 +++
drivers/net/macsonic.c | 1
drivers/net/pcnet32.c | 3
drivers/net/s2io-regs.h | 2
drivers/net/s2io.c | 245 +++++++++++++++++++----------------------
drivers/net/s2io.h | 119 -------------------
include/linux/pci_ids.h | 2
10 files changed, 167 insertions(+), 266 deletions(-)
through these ChangeSets:
<fthain:telegraphics.com.au>:
o fix Jazzsonic driver build on m68k
John W. Linville:
o e1000: add MODULE_VERSION
o b44: allocate tx bounce bufs as needed
o e1000: flush work queues on remove
o e1000: avoid sleeping in watchdog timer context
Ravinandan Arakali:
o S2io: Changed copyright and added support for Xframe II
o S2io: h/w initialization fixes
o S2io: Statistics fix
Steven HARDY:
o pcnet32: 79C975 fiber fix
[-- Attachment #3: patch --]
[-- Type: text/plain, Size: 22916 bytes --]
diff -Nru a/drivers/net/b44.c b/drivers/net/b44.c
--- a/drivers/net/b44.c 2005-03-30 20:58:14 -05:00
+++ b/drivers/net/b44.c 2005-03-30 20:58:14 -05:00
@@ -907,6 +907,7 @@
static int b44_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct b44 *bp = netdev_priv(dev);
+ struct sk_buff *bounce_skb;
dma_addr_t mapping;
u32 len, entry, ctrl;
@@ -922,15 +923,31 @@
return 1;
}
- entry = bp->tx_prod;
mapping = pci_map_single(bp->pdev, skb->data, len, PCI_DMA_TODEVICE);
if(mapping+len > B44_DMA_MASK) {
/* Chip can't handle DMA to/from >1GB, use bounce buffer */
- pci_unmap_single(bp->pdev, mapping, len,PCI_DMA_TODEVICE);
- memcpy(bp->tx_bufs+entry*TX_PKT_BUF_SZ,skb->data,skb->len);
- mapping = pci_map_single(bp->pdev, bp->tx_bufs+entry*TX_PKT_BUF_SZ, len, PCI_DMA_TODEVICE);
+ pci_unmap_single(bp->pdev, mapping, len, PCI_DMA_TODEVICE);
+
+ bounce_skb = __dev_alloc_skb(TX_PKT_BUF_SZ,
+ GFP_ATOMIC|GFP_DMA);
+ if (!bounce_skb)
+ return NETDEV_TX_BUSY;
+
+ mapping = pci_map_single(bp->pdev, bounce_skb->data,
+ len, PCI_DMA_TODEVICE);
+ if(mapping+len > B44_DMA_MASK) {
+ pci_unmap_single(bp->pdev, mapping,
+ len, PCI_DMA_TODEVICE);
+ dev_kfree_skb_any(bounce_skb);
+ return NETDEV_TX_BUSY;
+ }
+
+ memcpy(skb_put(bounce_skb, len), skb->data, skb->len);
+ dev_kfree_skb_any(skb);
+ skb = bounce_skb;
}
+ entry = bp->tx_prod;
bp->tx_buffers[entry].skb = skb;
pci_unmap_addr_set(&bp->tx_buffers[entry], mapping, mapping);
@@ -1077,11 +1094,6 @@
bp->tx_ring, bp->tx_ring_dma);
bp->tx_ring = NULL;
}
- if (bp->tx_bufs) {
- pci_free_consistent(bp->pdev, B44_TX_RING_SIZE * TX_PKT_BUF_SZ,
- bp->tx_bufs, bp->tx_bufs_dma);
- bp->tx_bufs = NULL;
- }
}
/*
@@ -1103,12 +1115,6 @@
if (!bp->tx_buffers)
goto out_err;
memset(bp->tx_buffers, 0, size);
-
- size = B44_TX_RING_SIZE * TX_PKT_BUF_SZ;
- bp->tx_bufs = pci_alloc_consistent(bp->pdev, size, &bp->tx_bufs_dma);
- if (!bp->tx_bufs)
- goto out_err;
- memset(bp->tx_bufs, 0, size);
size = DMA_TABLE_BYTES;
bp->rx_ring = pci_alloc_consistent(bp->pdev, size, &bp->rx_ring_dma);
diff -Nru a/drivers/net/b44.h b/drivers/net/b44.h
--- a/drivers/net/b44.h 2005-03-30 20:58:14 -05:00
+++ b/drivers/net/b44.h 2005-03-30 20:58:14 -05:00
@@ -383,7 +383,6 @@
struct ring_info *rx_buffers;
struct ring_info *tx_buffers;
- unsigned char *tx_bufs;
u32 dma_offset;
u32 flags;
@@ -415,7 +414,7 @@
struct pci_dev *pdev;
struct net_device *dev;
- dma_addr_t rx_ring_dma, tx_ring_dma,tx_bufs_dma;
+ dma_addr_t rx_ring_dma, tx_ring_dma;
u32 rx_pending;
u32 tx_pending;
diff -Nru a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
--- a/drivers/net/e1000/e1000.h 2005-03-30 20:58:14 -05:00
+++ b/drivers/net/e1000/e1000.h 2005-03-30 20:58:14 -05:00
@@ -203,6 +203,7 @@
spinlock_t stats_lock;
atomic_t irq_sem;
struct work_struct tx_timeout_task;
+ struct work_struct watchdog_task;
uint8_t fc_autoneg;
struct timer_list blink_timer;
diff -Nru a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
--- a/drivers/net/e1000/e1000_main.c 2005-03-30 20:58:14 -05:00
+++ b/drivers/net/e1000/e1000_main.c 2005-03-30 20:58:14 -05:00
@@ -65,7 +65,8 @@
#else
#define DRIVERNAPI "-NAPI"
#endif
-char e1000_driver_version[] = "5.7.6-k2"DRIVERNAPI;
+#define DRV_VERSION "5.7.6-k2"DRIVERNAPI
+char e1000_driver_version[] = DRV_VERSION;
char e1000_copyright[] = "Copyright (c) 1999-2004 Intel Corporation.";
/* e1000_pci_tbl - PCI Device ID Table
@@ -142,6 +143,7 @@
static void e1000_set_multi(struct net_device *netdev);
static void e1000_update_phy_info(unsigned long data);
static void e1000_watchdog(unsigned long data);
+static void e1000_watchdog_task(struct e1000_adapter *adapter);
static void e1000_82547_tx_fifo_stall(unsigned long data);
static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev);
static struct net_device_stats * e1000_get_stats(struct net_device *netdev);
@@ -210,6 +212,7 @@
MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>");
MODULE_DESCRIPTION("Intel(R) PRO/1000 Network Driver");
MODULE_LICENSE("GPL");
+MODULE_VERSION(DRV_VERSION);
static int debug = NETIF_MSG_DRV | NETIF_MSG_PROBE;
module_param(debug, int, 0);
@@ -574,6 +577,9 @@
adapter->watchdog_timer.function = &e1000_watchdog;
adapter->watchdog_timer.data = (unsigned long) adapter;
+ INIT_WORK(&adapter->watchdog_task,
+ (void (*)(void *))e1000_watchdog_task, adapter);
+
init_timer(&adapter->phy_info_timer);
adapter->phy_info_timer.function = &e1000_update_phy_info;
adapter->phy_info_timer.data = (unsigned long) adapter;
@@ -660,6 +666,8 @@
struct e1000_adapter *adapter = netdev->priv;
uint32_t manc;
+ flush_scheduled_work();
+
if(adapter->hw.mac_type >= e1000_82540 &&
adapter->hw.media_type == e1000_media_type_copper) {
manc = E1000_READ_REG(&adapter->hw, MANC);
@@ -1529,13 +1537,20 @@
/**
* e1000_watchdog - Timer Call-back
- * @data: pointer to netdev cast into an unsigned long
+ * @data: pointer to adapter cast into an unsigned long
**/
-
static void
e1000_watchdog(unsigned long data)
{
struct e1000_adapter *adapter = (struct e1000_adapter *) data;
+
+ /* Do the rest outside of interrupt context */
+ schedule_work(&adapter->watchdog_task);
+}
+
+static void
+e1000_watchdog_task(struct e1000_adapter *adapter)
+{
struct net_device *netdev = adapter->netdev;
struct e1000_desc_ring *txdr = &adapter->tx_ring;
uint32_t link;
diff -Nru a/drivers/net/macsonic.c b/drivers/net/macsonic.c
--- a/drivers/net/macsonic.c 2005-03-30 20:58:14 -05:00
+++ b/drivers/net/macsonic.c 2005-03-30 20:58:14 -05:00
@@ -638,6 +638,7 @@
#define vdma_free(baz)
#define sonic_chiptomem(bat) (bat)
#define PHYSADDR(quux) (quux)
+#define CPHYSADDR(quux) (quux)
#define sonic_request_irq request_irq
#define sonic_free_irq free_irq
diff -Nru a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
--- a/drivers/net/pcnet32.c 2005-03-30 20:58:14 -05:00
+++ b/drivers/net/pcnet32.c 2005-03-30 20:58:14 -05:00
@@ -1351,7 +1351,8 @@
printk(KERN_INFO "%s: registered as %s\n", dev->name, lp->name);
cards_found++;
- a->write_bcr(ioaddr, 2, 0x1002); /* enable LED writes */
+ /* enable LED writes */
+ a->write_bcr(ioaddr, 2, a->read_bcr(ioaddr, 2) | 0x1000);
return 0;
diff -Nru a/drivers/net/s2io-regs.h b/drivers/net/s2io-regs.h
--- a/drivers/net/s2io-regs.h 2005-03-30 20:58:14 -05:00
+++ b/drivers/net/s2io-regs.h 2005-03-30 20:58:14 -05:00
@@ -1,6 +1,6 @@
/************************************************************************
* regs.h: A Linux PCI-X Ethernet driver for S2IO 10GbE Server NIC
- * Copyright 2002 Raghavendra Koushik (raghavendra.koushik@s2io.com)
+ * Copyright(c) 2002-2005 Neterion Inc.
* This software may be used and distributed according to the terms of
* the GNU General Public License (GPL), incorporated herein by reference.
diff -Nru a/drivers/net/s2io.c b/drivers/net/s2io.c
--- a/drivers/net/s2io.c 2005-03-30 20:58:14 -05:00
+++ b/drivers/net/s2io.c 2005-03-30 20:58:14 -05:00
@@ -1,6 +1,6 @@
/************************************************************************
* s2io.c: A Linux PCI-X Ethernet driver for S2IO 10GbE Server NIC
- * Copyright(c) 2002-2005 S2IO Technologies
+ * Copyright(c) 2002-2005 Neterion Inc.
* This software may be used and distributed according to the terms of
* the GNU General Public License (GPL), incorporated herein by reference.
@@ -66,7 +66,7 @@
/* S2io Driver name & version. */
static char s2io_driver_name[] = "s2io";
-static char s2io_driver_version[] = "Version 1.7.5.1";
+static char s2io_driver_version[] = "Version 1.7.7.1";
/*
* Cards with following subsystem_id have a link state indication
@@ -245,6 +245,10 @@
PCI_ANY_ID, PCI_ANY_ID},
{PCI_VENDOR_ID_S2IO, PCI_DEVICE_ID_S2IO_UNI,
PCI_ANY_ID, PCI_ANY_ID},
+ {PCI_VENDOR_ID_S2IO, PCI_DEVICE_ID_HERC_WIN,
+ PCI_ANY_ID, PCI_ANY_ID},
+ {PCI_VENDOR_ID_S2IO, PCI_DEVICE_ID_HERC_UNI,
+ PCI_ANY_ID, PCI_ANY_ID},
{0,}
};
@@ -620,79 +624,15 @@
mac_info_t *mac_control;
struct config_param *config;
int mdio_cnt = 0, dtx_cnt = 0;
- unsigned long long print_var, mem_share;
+ unsigned long long mem_share;
mac_control = &nic->mac_control;
config = &nic->config;
- /*
- * Set proper endian settings and verify the same by
- * reading the PIF Feed-back register.
- */
-#ifdef __BIG_ENDIAN
- /*
- * The device by default set to a big endian format, so
- * a big endian driver need not set anything.
- */
- writeq(0xffffffffffffffffULL, &bar0->swapper_ctrl);
- val64 = (SWAPPER_CTRL_PIF_R_FE |
- SWAPPER_CTRL_PIF_R_SE |
- SWAPPER_CTRL_PIF_W_FE |
- SWAPPER_CTRL_PIF_W_SE |
- SWAPPER_CTRL_TXP_FE |
- SWAPPER_CTRL_TXP_SE |
- SWAPPER_CTRL_TXD_R_FE |
- SWAPPER_CTRL_TXD_W_FE |
- SWAPPER_CTRL_TXF_R_FE |
- SWAPPER_CTRL_RXD_R_FE |
- SWAPPER_CTRL_RXD_W_FE |
- SWAPPER_CTRL_RXF_W_FE |
- SWAPPER_CTRL_XMSI_FE |
- SWAPPER_CTRL_XMSI_SE |
- SWAPPER_CTRL_STATS_FE | SWAPPER_CTRL_STATS_SE);
- writeq(val64, &bar0->swapper_ctrl);
-#else
- /*
- * Initially we enable all bits to make it accessible by
- * the driver, then we selectively enable only those bits
- * that we want to set.
- */
- writeq(0xffffffffffffffffULL, &bar0->swapper_ctrl);
- val64 = (SWAPPER_CTRL_PIF_R_FE |
- SWAPPER_CTRL_PIF_R_SE |
- SWAPPER_CTRL_PIF_W_FE |
- SWAPPER_CTRL_PIF_W_SE |
- SWAPPER_CTRL_TXP_FE |
- SWAPPER_CTRL_TXP_SE |
- SWAPPER_CTRL_TXD_R_FE |
- SWAPPER_CTRL_TXD_R_SE |
- SWAPPER_CTRL_TXD_W_FE |
- SWAPPER_CTRL_TXD_W_SE |
- SWAPPER_CTRL_TXF_R_FE |
- SWAPPER_CTRL_RXD_R_FE |
- SWAPPER_CTRL_RXD_R_SE |
- SWAPPER_CTRL_RXD_W_FE |
- SWAPPER_CTRL_RXD_W_SE |
- SWAPPER_CTRL_RXF_W_FE |
- SWAPPER_CTRL_XMSI_FE |
- SWAPPER_CTRL_XMSI_SE |
- SWAPPER_CTRL_STATS_FE | SWAPPER_CTRL_STATS_SE);
- writeq(val64, &bar0->swapper_ctrl);
-#endif
-
- /*
- * Verifying if endian settings are accurate by
- * reading a feedback register.
- */
- val64 = readq(&bar0->pif_rd_swapper_fb);
- if (val64 != 0x0123456789ABCDEFULL) {
- /* Endian settings are incorrect, calls for another dekko. */
- print_var = (unsigned long long) val64;
- DBG_PRINT(INIT_DBG, "%s: Endian settings are wrong",
- dev->name);
- DBG_PRINT(ERR_DBG, ", feedback read %llx\n", print_var);
-
- return FAILURE;
+ /* Initialize swapper control register */
+ if (s2io_set_swapper(nic)) {
+ DBG_PRINT(ERR_DBG,"ERROR: Setting Swapper failed\n");
+ return -1;
}
/* Remove XGXS from reset state */
@@ -920,11 +860,15 @@
* Initializing the Transmit and Receive Traffic Interrupt
* Scheme.
*/
- /* TTI Initialization */
- val64 = TTI_DATA1_MEM_TX_TIMER_VAL(0xFFF) |
+ /* TTI Initialization. Default Tx timer gets us about
+ * 250 interrupts per sec. Continuous interrupts are enabled
+ * by default.
+ */
+ val64 = TTI_DATA1_MEM_TX_TIMER_VAL(0x2078) |
TTI_DATA1_MEM_TX_URNG_A(0xA) |
TTI_DATA1_MEM_TX_URNG_B(0x10) |
- TTI_DATA1_MEM_TX_URNG_C(0x30) | TTI_DATA1_MEM_TX_TIMER_AC_EN;
+ TTI_DATA1_MEM_TX_URNG_C(0x30) | TTI_DATA1_MEM_TX_TIMER_AC_EN |
+ TTI_DATA1_MEM_TX_TIMER_CI_EN;
writeq(val64, &bar0->tti_data1_mem);
val64 = TTI_DATA2_MEM_TX_UFC_A(0x10) |
@@ -2508,23 +2452,74 @@
{
struct net_device *dev = sp->dev;
XENA_dev_config_t __iomem *bar0 = sp->bar0;
- u64 val64;
+ u64 val64, valt, valr;
/*
* Set proper endian settings and verify the same by reading
* the PIF Feed-back register.
*/
+
+ val64 = readq(&bar0->pif_rd_swapper_fb);
+ if (val64 != 0x0123456789ABCDEFULL) {
+ int i = 0;
+ u64 value[] = { 0xC30000C3C30000C3ULL, /* FE=1, SE=1 */
+ 0x8100008181000081ULL, /* FE=1, SE=0 */
+ 0x4200004242000042ULL, /* FE=0, SE=1 */
+ 0}; /* FE=0, SE=0 */
+
+ while(i<4) {
+ writeq(value[i], &bar0->swapper_ctrl);
+ val64 = readq(&bar0->pif_rd_swapper_fb);
+ if (val64 == 0x0123456789ABCDEFULL)
+ break;
+ i++;
+ }
+ if (i == 4) {
+ DBG_PRINT(ERR_DBG, "%s: Endian settings are wrong, ",
+ dev->name);
+ DBG_PRINT(ERR_DBG, "feedback read %llx\n",
+ (unsigned long long) val64);
+ return FAILURE;
+ }
+ valr = value[i];
+ } else {
+ valr = readq(&bar0->swapper_ctrl);
+ }
+
+ valt = 0x0123456789ABCDEFULL;
+ writeq(valt, &bar0->xmsi_address);
+ val64 = readq(&bar0->xmsi_address);
+
+ if(val64 != valt) {
+ int i = 0;
+ u64 value[] = { 0x00C3C30000C3C300ULL, /* FE=1, SE=1 */
+ 0x0081810000818100ULL, /* FE=1, SE=0 */
+ 0x0042420000424200ULL, /* FE=0, SE=1 */
+ 0}; /* FE=0, SE=0 */
+
+ while(i<4) {
+ writeq((value[i] | valr), &bar0->swapper_ctrl);
+ writeq(valt, &bar0->xmsi_address);
+ val64 = readq(&bar0->xmsi_address);
+ if(val64 == valt)
+ break;
+ i++;
+ }
+ if(i == 4) {
+ DBG_PRINT(ERR_DBG, "Write failed, Xmsi_addr ");
+ DBG_PRINT(ERR_DBG, "reads:0x%llx\n",val64);
+ return FAILURE;
+ }
+ }
+ val64 = readq(&bar0->swapper_ctrl);
+ val64 &= 0xFFFF000000000000ULL;
+
#ifdef __BIG_ENDIAN
/*
* The device by default set to a big endian format, so a
* big endian driver need not set anything.
*/
- writeq(0xffffffffffffffffULL, &bar0->swapper_ctrl);
- val64 = (SWAPPER_CTRL_PIF_R_FE |
- SWAPPER_CTRL_PIF_R_SE |
- SWAPPER_CTRL_PIF_W_FE |
- SWAPPER_CTRL_PIF_W_SE |
- SWAPPER_CTRL_TXP_FE |
+ val64 |= (SWAPPER_CTRL_TXP_FE |
SWAPPER_CTRL_TXP_SE |
SWAPPER_CTRL_TXD_R_FE |
SWAPPER_CTRL_TXD_W_FE |
@@ -2542,12 +2537,7 @@
* driver, then we selectively enable only those bits that
* we want to set.
*/
- writeq(0xffffffffffffffffULL, &bar0->swapper_ctrl);
- val64 = (SWAPPER_CTRL_PIF_R_FE |
- SWAPPER_CTRL_PIF_R_SE |
- SWAPPER_CTRL_PIF_W_FE |
- SWAPPER_CTRL_PIF_W_SE |
- SWAPPER_CTRL_TXP_FE |
+ val64 |= (SWAPPER_CTRL_TXP_FE |
SWAPPER_CTRL_TXP_SE |
SWAPPER_CTRL_TXD_R_FE |
SWAPPER_CTRL_TXD_R_SE |
@@ -2564,6 +2554,7 @@
SWAPPER_CTRL_STATS_FE | SWAPPER_CTRL_STATS_SE);
writeq(val64, &bar0->swapper_ctrl);
#endif
+ val64 = readq(&bar0->swapper_ctrl);
/*
* Verifying if endian settings are accurate by reading a
@@ -3920,45 +3911,45 @@
nic_t *sp = dev->priv;
StatInfo_t *stat_info = sp->mac_control.stats_info;
- tmp_stats[i++] = stat_info->tmac_frms;
- tmp_stats[i++] = stat_info->tmac_data_octets;
- tmp_stats[i++] = stat_info->tmac_drop_frms;
- tmp_stats[i++] = stat_info->tmac_mcst_frms;
- tmp_stats[i++] = stat_info->tmac_bcst_frms;
- tmp_stats[i++] = stat_info->tmac_pause_ctrl_frms;
- tmp_stats[i++] = stat_info->tmac_any_err_frms;
- tmp_stats[i++] = stat_info->tmac_vld_ip_octets;
- tmp_stats[i++] = stat_info->tmac_vld_ip;
- tmp_stats[i++] = stat_info->tmac_drop_ip;
- tmp_stats[i++] = stat_info->tmac_icmp;
- tmp_stats[i++] = stat_info->tmac_rst_tcp;
- tmp_stats[i++] = stat_info->tmac_tcp;
- tmp_stats[i++] = stat_info->tmac_udp;
- tmp_stats[i++] = stat_info->rmac_vld_frms;
- tmp_stats[i++] = stat_info->rmac_data_octets;
- tmp_stats[i++] = stat_info->rmac_fcs_err_frms;
- tmp_stats[i++] = stat_info->rmac_drop_frms;
- tmp_stats[i++] = stat_info->rmac_vld_mcst_frms;
- tmp_stats[i++] = stat_info->rmac_vld_bcst_frms;
- tmp_stats[i++] = stat_info->rmac_in_rng_len_err_frms;
- tmp_stats[i++] = stat_info->rmac_long_frms;
- tmp_stats[i++] = stat_info->rmac_pause_ctrl_frms;
- tmp_stats[i++] = stat_info->rmac_discarded_frms;
- tmp_stats[i++] = stat_info->rmac_usized_frms;
- tmp_stats[i++] = stat_info->rmac_osized_frms;
- tmp_stats[i++] = stat_info->rmac_frag_frms;
- tmp_stats[i++] = stat_info->rmac_jabber_frms;
- tmp_stats[i++] = stat_info->rmac_ip;
- tmp_stats[i++] = stat_info->rmac_ip_octets;
- tmp_stats[i++] = stat_info->rmac_hdr_err_ip;
- tmp_stats[i++] = stat_info->rmac_drop_ip;
- tmp_stats[i++] = stat_info->rmac_icmp;
- tmp_stats[i++] = stat_info->rmac_tcp;
- tmp_stats[i++] = stat_info->rmac_udp;
- tmp_stats[i++] = stat_info->rmac_err_drp_udp;
- tmp_stats[i++] = stat_info->rmac_pause_cnt;
- tmp_stats[i++] = stat_info->rmac_accepted_ip;
- tmp_stats[i++] = stat_info->rmac_err_tcp;
+ tmp_stats[i++] = le32_to_cpu(stat_info->tmac_frms);
+ tmp_stats[i++] = le32_to_cpu(stat_info->tmac_data_octets);
+ tmp_stats[i++] = le64_to_cpu(stat_info->tmac_drop_frms);
+ tmp_stats[i++] = le32_to_cpu(stat_info->tmac_mcst_frms);
+ tmp_stats[i++] = le32_to_cpu(stat_info->tmac_bcst_frms);
+ tmp_stats[i++] = le64_to_cpu(stat_info->tmac_pause_ctrl_frms);
+ tmp_stats[i++] = le32_to_cpu(stat_info->tmac_any_err_frms);
+ tmp_stats[i++] = le64_to_cpu(stat_info->tmac_vld_ip_octets);
+ tmp_stats[i++] = le32_to_cpu(stat_info->tmac_vld_ip);
+ tmp_stats[i++] = le32_to_cpu(stat_info->tmac_drop_ip);
+ tmp_stats[i++] = le32_to_cpu(stat_info->tmac_icmp);
+ tmp_stats[i++] = le32_to_cpu(stat_info->tmac_rst_tcp);
+ tmp_stats[i++] = le64_to_cpu(stat_info->tmac_tcp);
+ tmp_stats[i++] = le32_to_cpu(stat_info->tmac_udp);
+ tmp_stats[i++] = le32_to_cpu(stat_info->rmac_vld_frms);
+ tmp_stats[i++] = le32_to_cpu(stat_info->rmac_data_octets);
+ tmp_stats[i++] = le64_to_cpu(stat_info->rmac_fcs_err_frms);
+ tmp_stats[i++] = le64_to_cpu(stat_info->rmac_drop_frms);
+ tmp_stats[i++] = le32_to_cpu(stat_info->rmac_vld_mcst_frms);
+ tmp_stats[i++] = le32_to_cpu(stat_info->rmac_vld_bcst_frms);
+ tmp_stats[i++] = le32_to_cpu(stat_info->rmac_in_rng_len_err_frms);
+ tmp_stats[i++] = le64_to_cpu(stat_info->rmac_long_frms);
+ tmp_stats[i++] = le64_to_cpu(stat_info->rmac_pause_ctrl_frms);
+ tmp_stats[i++] = le32_to_cpu(stat_info->rmac_discarded_frms);
+ tmp_stats[i++] = le32_to_cpu(stat_info->rmac_usized_frms);
+ tmp_stats[i++] = le32_to_cpu(stat_info->rmac_osized_frms);
+ tmp_stats[i++] = le32_to_cpu(stat_info->rmac_frag_frms);
+ tmp_stats[i++] = le32_to_cpu(stat_info->rmac_jabber_frms);
+ tmp_stats[i++] = le32_to_cpu(stat_info->rmac_ip);
+ tmp_stats[i++] = le64_to_cpu(stat_info->rmac_ip_octets);
+ tmp_stats[i++] = le32_to_cpu(stat_info->rmac_hdr_err_ip);
+ tmp_stats[i++] = le32_to_cpu(stat_info->rmac_drop_ip);
+ tmp_stats[i++] = le32_to_cpu(stat_info->rmac_icmp);
+ tmp_stats[i++] = le64_to_cpu(stat_info->rmac_tcp);
+ tmp_stats[i++] = le32_to_cpu(stat_info->rmac_udp);
+ tmp_stats[i++] = le32_to_cpu(stat_info->rmac_err_drp_udp);
+ tmp_stats[i++] = le32_to_cpu(stat_info->rmac_pause_cnt);
+ tmp_stats[i++] = le32_to_cpu(stat_info->rmac_accepted_ip);
+ tmp_stats[i++] = le32_to_cpu(stat_info->rmac_err_tcp);
}
static int s2io_ethtool_get_regs_len(struct net_device *dev)
@@ -4547,7 +4538,7 @@
&(sp->pcix_cmd));
}
-MODULE_AUTHOR("Raghavendra Koushik <raghavendra.koushik@s2io.com>");
+MODULE_AUTHOR("Raghavendra Koushik <raghavendra.koushik@neterion.com>");
MODULE_LICENSE("GPL");
module_param(tx_fifo_num, int, 0);
module_param_array(tx_fifo_len, int, NULL, 0);
diff -Nru a/drivers/net/s2io.h b/drivers/net/s2io.h
--- a/drivers/net/s2io.h 2005-03-30 20:58:14 -05:00
+++ b/drivers/net/s2io.h 2005-03-30 20:58:14 -05:00
@@ -1,6 +1,6 @@
/************************************************************************
* s2io.h: A Linux PCI-X Ethernet driver for S2IO 10GbE Server NIC
- * Copyright 2002 Raghavendra Koushik (raghavendra.koushik@s2io.com)
+ * Copyright(c) 2002-2005 Neterion Inc.
* This software may be used and distributed according to the terms of
* the GNU General Public License (GPL), incorporated herein by reference.
@@ -73,121 +73,6 @@
/* The statistics block of Xena */
typedef struct stat_block {
-#ifdef __BIG_ENDIAN
-/* Tx MAC statistics counters. */
- u32 tmac_frms;
- u32 tmac_data_octets;
- u64 tmac_drop_frms;
- u32 tmac_mcst_frms;
- u32 tmac_bcst_frms;
- u64 tmac_pause_ctrl_frms;
- u32 tmac_ttl_octets;
- u32 tmac_ucst_frms;
- u32 tmac_nucst_frms;
- u32 tmac_any_err_frms;
- u64 tmac_ttl_less_fb_octets;
- u64 tmac_vld_ip_octets;
- u32 tmac_vld_ip;
- u32 tmac_drop_ip;
- u32 tmac_icmp;
- u32 tmac_rst_tcp;
- u64 tmac_tcp;
- u32 tmac_udp;
- u32 reserved_0;
-
-/* Rx MAC Statistics counters. */
- u32 rmac_vld_frms;
- u32 rmac_data_octets;
- u64 rmac_fcs_err_frms;
- u64 rmac_drop_frms;
- u32 rmac_vld_mcst_frms;
- u32 rmac_vld_bcst_frms;
- u32 rmac_in_rng_len_err_frms;
- u32 rmac_out_rng_len_err_frms;
- u64 rmac_long_frms;
- u64 rmac_pause_ctrl_frms;
- u64 rmac_unsup_ctrl_frms;
- u32 rmac_ttl_octets;
- u32 rmac_accepted_ucst_frms;
- u32 rmac_accepted_nucst_frms;
- u32 rmac_discarded_frms;
- u32 rmac_drop_events;
- u32 reserved_1;
- u64 rmac_ttl_less_fb_octets;
- u64 rmac_ttl_frms;
- u64 reserved_2;
- u32 reserved_3;
- u32 rmac_usized_frms;
- u32 rmac_osized_frms;
- u32 rmac_frag_frms;
- u32 rmac_jabber_frms;
- u32 reserved_4;
- u64 rmac_ttl_64_frms;
- u64 rmac_ttl_65_127_frms;
- u64 reserved_5;
- u64 rmac_ttl_128_255_frms;
- u64 rmac_ttl_256_511_frms;
- u64 reserved_6;
- u64 rmac_ttl_512_1023_frms;
- u64 rmac_ttl_1024_1518_frms;
- u32 reserved_7;
- u32 rmac_ip;
- u64 rmac_ip_octets;
- u32 rmac_hdr_err_ip;
- u32 rmac_drop_ip;
- u32 rmac_icmp;
- u32 reserved_8;
- u64 rmac_tcp;
- u32 rmac_udp;
- u32 rmac_err_drp_udp;
- u64 rmac_xgmii_err_sym;
- u64 rmac_frms_q0;
- u64 rmac_frms_q1;
- u64 rmac_frms_q2;
- u64 rmac_frms_q3;
- u64 rmac_frms_q4;
- u64 rmac_frms_q5;
- u64 rmac_frms_q6;
- u64 rmac_frms_q7;
- u16 rmac_full_q0;
- u16 rmac_full_q1;
- u16 rmac_full_q2;
- u16 rmac_full_q3;
- u16 rmac_full_q4;
- u16 rmac_full_q5;
- u16 rmac_full_q6;
- u16 rmac_full_q7;
- u32 rmac_pause_cnt;
- u32 reserved_9;
- u64 rmac_xgmii_data_err_cnt;
- u64 rmac_xgmii_ctrl_err_cnt;
- u32 rmac_accepted_ip;
- u32 rmac_err_tcp;
-
-/* PCI/PCI-X Read transaction statistics. */
- u32 rd_req_cnt;
- u32 new_rd_req_cnt;
- u32 new_rd_req_rtry_cnt;
- u32 rd_rtry_cnt;
- u32 wr_rtry_rd_ack_cnt;
-
-/* PCI/PCI-X write transaction statistics. */
- u32 wr_req_cnt;
- u32 new_wr_req_cnt;
- u32 new_wr_req_rtry_cnt;
- u32 wr_rtry_cnt;
- u32 wr_disc_cnt;
- u32 rd_rtry_wr_ack_cnt;
-
-/* DMA Transaction statistics. */
- u32 txp_wr_cnt;
- u32 txd_rd_cnt;
- u32 txd_wr_cnt;
- u32 rxd_rd_cnt;
- u32 rxd_wr_cnt;
- u32 txf_rd_cnt;
- u32 rxf_wr_cnt;
-#else
/* Tx MAC statistics counters. */
u32 tmac_data_octets;
u32 tmac_frms;
@@ -301,7 +186,6 @@
u32 rxd_rd_cnt;
u32 rxf_wr_cnt;
u32 txf_rd_cnt;
-#endif
} StatInfo_t;
/* Structures representing different init time configuration
@@ -869,6 +753,7 @@
static int verify_xena_quiescence(u64 val64, int flag);
static struct ethtool_ops netdev_ethtool_ops;
static void s2io_set_link(unsigned long data);
+static int s2io_set_swapper(nic_t * sp);
static void s2io_card_down(nic_t * nic);
static int s2io_card_up(nic_t * nic);
diff -Nru a/include/linux/pci_ids.h b/include/linux/pci_ids.h
--- a/include/linux/pci_ids.h 2005-03-30 20:58:14 -05:00
+++ b/include/linux/pci_ids.h 2005-03-30 20:58:14 -05:00
@@ -2159,6 +2159,8 @@
#define PCI_VENDOR_ID_S2IO 0x17d5
#define PCI_DEVICE_ID_S2IO_WIN 0x5731
#define PCI_DEVICE_ID_S2IO_UNI 0x5831
+#define PCI_DEVICE_ID_HERC_WIN 0x5732
+#define PCI_DEVICE_ID_HERC_UNI 0x5832
#define PCI_VENDOR_ID_INFINICON 0x1820
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2005-03-31 1:59 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-31 1:59 [BK PATCHES] 2.6.x net driver fixes Jeff Garzik
-- strict thread matches above, loose matches on Subject: below --
2005-03-29 21:04 Jeff Garzik
2005-03-12 4:33 Jeff Garzik
2005-02-21 2:30 Jeff Garzik
2005-02-13 20:18 Jeff Garzik
2005-01-27 23:45 Jeff Garzik
2004-11-24 21:02 Jeff Garzik
2004-11-11 22:44 Jeff Garzik
2004-11-08 2:32 Jeff Garzik
2004-10-18 23:52 Jeff Garzik
2004-10-04 22:08 Jeff Garzik
2004-09-04 2:56 Jeff Garzik
[not found] <20040714192706.GA24447@havoc.gtf.org>
[not found] ` <Pine.LNX.4.58.0407141229480.20824@ppc970.osdl.org>
[not found] ` <40F58EFD.7080904@pobox.com>
2004-07-14 21:28 ` Linus Torvalds
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).