Commit e71ebd73 authored by Stephen Hemminger's avatar Stephen Hemminger

sky2: dont write status ring

It is more efficient not to write the status ring from the
processor and just read the active portion.
Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
parent 01bd7564
...@@ -1865,35 +1865,28 @@ static inline void sky2_tx_done(struct net_device *dev, u16 last) ...@@ -1865,35 +1865,28 @@ static inline void sky2_tx_done(struct net_device *dev, u16 last)
static int sky2_status_intr(struct sky2_hw *hw, int to_do) static int sky2_status_intr(struct sky2_hw *hw, int to_do)
{ {
int work_done = 0; int work_done = 0;
u16 hwidx = sky2_read16(hw, STAT_PUT_IDX);
rmb(); rmb();
for(;;) { while (hw->st_idx != hwidx) {
struct sky2_status_le *le = hw->st_le + hw->st_idx; struct sky2_status_le *le = hw->st_le + hw->st_idx;
struct net_device *dev; struct net_device *dev;
struct sky2_port *sky2; struct sky2_port *sky2;
struct sk_buff *skb; struct sk_buff *skb;
u32 status; u32 status;
u16 length; u16 length;
u8 link, opcode;
opcode = le->opcode;
if (!opcode)
break;
opcode &= ~HW_OWNER;
hw->st_idx = RING_NEXT(hw->st_idx, STATUS_RING_SIZE); hw->st_idx = RING_NEXT(hw->st_idx, STATUS_RING_SIZE);
le->opcode = 0;
link = le->link; BUG_ON(le->link >= 2);
BUG_ON(link >= 2); dev = hw->dev[le->link];
dev = hw->dev[link];
sky2 = netdev_priv(dev); sky2 = netdev_priv(dev);
length = le->length; length = le->length;
status = le->status; status = le->status;
switch (opcode) { switch (le->opcode & ~HW_OWNER) {
case OP_RXSTAT: case OP_RXSTAT:
skb = sky2_receive(sky2, length, status); skb = sky2_receive(sky2, length, status);
if (!skb) if (!skb)
...@@ -1944,8 +1937,8 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do) ...@@ -1944,8 +1937,8 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do)
default: default:
if (net_ratelimit()) if (net_ratelimit())
printk(KERN_WARNING PFX printk(KERN_WARNING PFX
"unknown status opcode 0x%x\n", opcode); "unknown status opcode 0x%x\n", le->opcode);
break; goto exit_loop;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment