summaryrefslogtreecommitdiffstats
path: root/drivers/net/niu.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-01-09 08:05:12 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-01-09 08:05:12 -0800
commitfd0b45dfd1858c6b49d06355a460bcf36d654c06 (patch)
tree85386a76355b398b7f452b737af4ab48f116677a /drivers/net/niu.c
parentfcfd50afb6e94c8cf121ca4e7e3e7166bae7c6aa (diff)
parent1c9b7aa1eb40ab708ef3242f74b9a61487623168 (diff)
downloadblackbird-op-linux-fd0b45dfd1858c6b49d06355a460bcf36d654c06.tar.gz
blackbird-op-linux-fd0b45dfd1858c6b49d06355a460bcf36d654c06.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (36 commits) [ATM]: Check IP header validity in mpc_send_packet [IPV6]: IPV6_MULTICAST_IF setting is ignored on link-local connect() [CONNECTOR]: Don't touch queue dev after decrement of ref count. [SOCK]: Adds a rcu_dereference() in sk_filter [XFRM]: xfrm_algo_clone() allocates too much memory [FORCEDETH]: Fix reversing the MAC address on suspend. [NET]: mcs7830 passes msecs instead of jiffies to usb_control_msg [LRO] Fix lro_mgr->features checks [NET]: Clone the sk_buff 'iif' field in __skb_clone() [IPV4] ROUTE: ip_rt_dump() is unecessary slow [NET]: kaweth was forgotten in msec switchover of usb_start_wait_urb [NET] Intel ethernet drivers: update MAINTAINERS [NET]: Make ->poll() breakout consistent in Intel ethernet drivers. [NET]: Stop polling when napi_disable() is pending. [NET]: Fix drivers to handle napi_disable() disabling interrupts. [NETXEN]: Fix ->poll() done logic. mac80211: return an error when SIWRATE doesn't match any rate ssb: Fix probing of PCI cores if PCI and PCIE core is available [NET]: Do not check netif_running() and carrier state in ->poll() [NET]: Add NAPI_STATE_DISABLE. ...
Diffstat (limited to 'drivers/net/niu.c')
-rw-r--r--drivers/net/niu.c43
1 files changed, 29 insertions, 14 deletions
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index abfc61c3a38c..9a0c6d3adfe9 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -33,8 +33,8 @@
#define DRV_MODULE_NAME "niu"
#define PFX DRV_MODULE_NAME ": "
-#define DRV_MODULE_VERSION "0.5"
-#define DRV_MODULE_RELDATE "October 5, 2007"
+#define DRV_MODULE_VERSION "0.6"
+#define DRV_MODULE_RELDATE "January 5, 2008"
static char version[] __devinitdata =
DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
@@ -2241,6 +2241,8 @@ static int niu_process_rx_pkt(struct niu *np, struct rx_ring_info *rp)
skb->protocol = eth_type_trans(skb, np->dev);
netif_receive_skb(skb);
+ np->dev->last_rx = jiffies;
+
return num_rcr;
}
@@ -2508,15 +2510,19 @@ static int niu_rx_error(struct niu *np, struct rx_ring_info *rp)
u64 stat = nr64(RX_DMA_CTL_STAT(rp->rx_channel));
int err = 0;
- dev_err(np->device, PFX "%s: RX channel %u error, stat[%llx]\n",
- np->dev->name, rp->rx_channel, (unsigned long long) stat);
-
- niu_log_rxchan_errors(np, rp, stat);
if (stat & (RX_DMA_CTL_STAT_CHAN_FATAL |
RX_DMA_CTL_STAT_PORT_FATAL))
err = -EINVAL;
+ if (err) {
+ dev_err(np->device, PFX "%s: RX channel %u error, stat[%llx]\n",
+ np->dev->name, rp->rx_channel,
+ (unsigned long long) stat);
+
+ niu_log_rxchan_errors(np, rp, stat);
+ }
+
nw64(RX_DMA_CTL_STAT(rp->rx_channel),
stat & RX_DMA_CTL_WRITE_CLEAR_ERRS);
@@ -2749,13 +2755,16 @@ static int niu_device_error(struct niu *np)
return -ENODEV;
}
-static int niu_slowpath_interrupt(struct niu *np, struct niu_ldg *lp)
+static int niu_slowpath_interrupt(struct niu *np, struct niu_ldg *lp,
+ u64 v0, u64 v1, u64 v2)
{
- u64 v0 = lp->v0;
- u64 v1 = lp->v1;
- u64 v2 = lp->v2;
+
int i, err = 0;
+ lp->v0 = v0;
+ lp->v1 = v1;
+ lp->v2 = v2;
+
if (v1 & 0x00000000ffffffffULL) {
u32 rx_vec = (v1 & 0xffffffff);
@@ -2764,8 +2773,13 @@ static int niu_slowpath_interrupt(struct niu *np, struct niu_ldg *lp)
if (rx_vec & (1 << rp->rx_channel)) {
int r = niu_rx_error(np, rp);
- if (r)
+ if (r) {
err = r;
+ } else {
+ if (!v0)
+ nw64(RX_DMA_CTL_STAT(rp->rx_channel),
+ RX_DMA_CTL_STAT_MEX);
+ }
}
}
}
@@ -2803,7 +2817,7 @@ static int niu_slowpath_interrupt(struct niu *np, struct niu_ldg *lp)
if (err)
niu_enable_interrupts(np, 0);
- return -EINVAL;
+ return err;
}
static void niu_rxchan_intr(struct niu *np, struct rx_ring_info *rp,
@@ -2905,7 +2919,7 @@ static irqreturn_t niu_interrupt(int irq, void *dev_id)
}
if (unlikely((v0 & ((u64)1 << LDN_MIF)) || v1 || v2)) {
- int err = niu_slowpath_interrupt(np, lp);
+ int err = niu_slowpath_interrupt(np, lp, v0, v1, v2);
if (err)
goto out;
}
@@ -5194,7 +5208,8 @@ static int niu_start_xmit(struct sk_buff *skb, struct net_device *dev)
}
kfree_skb(skb);
skb = skb_new;
- }
+ } else
+ skb_orphan(skb);
align = ((unsigned long) skb->data & (16 - 1));
headroom = align + sizeof(struct tx_pkt_hdr);
OpenPOWER on IntegriCloud