Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 18777
b: refs/heads/master
c: b44cd57
h: refs/heads/master
i:
  18775: b1d0639
v: v3
  • Loading branch information
Dale Farnsworth authored and Jeff Garzik committed Jan 17, 2006
1 parent b876385 commit b42a374
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 16e0301831767ee1b8e5e022cc08e76f9f8a8938
refs/heads/master: b44cd572623cb6a931a947d9108595517fd945f8
12 changes: 9 additions & 3 deletions trunk/drivers/net/mv643xx_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@
/* Constants */
#define VLAN_HLEN 4
#define FCS_LEN 4
#define WRAP NET_IP_ALIGN + ETH_HLEN + VLAN_HLEN + FCS_LEN
#define DMA_ALIGN 8 /* hw requires 8-byte alignment */
#define HW_IP_ALIGN 2 /* hw aligns IP header */
#define WRAP HW_IP_ALIGN + ETH_HLEN + VLAN_HLEN + FCS_LEN
#define RX_SKB_SIZE ((dev->mtu + WRAP + 7) & ~0x7)

#define INT_CAUSE_UNMASK_ALL 0x0007ffff
Expand Down Expand Up @@ -173,15 +175,19 @@ static void mv643xx_eth_rx_task(void *data)
struct mv643xx_private *mp = netdev_priv(dev);
struct pkt_info pkt_info;
struct sk_buff *skb;
int unaligned;

if (test_and_set_bit(0, &mp->rx_task_busy))
panic("%s: Error in test_set_bit / clear_bit", dev->name);

while (mp->rx_ring_skbs < (mp->rx_ring_size - 5)) {
skb = dev_alloc_skb(RX_SKB_SIZE);
skb = dev_alloc_skb(RX_SKB_SIZE + DMA_ALIGN);
if (!skb)
break;
mp->rx_ring_skbs++;
unaligned = (u32)skb->data & (DMA_ALIGN - 1);
if (unaligned)
skb_reserve(skb, DMA_ALIGN - unaligned);
pkt_info.cmd_sts = ETH_RX_ENABLE_INTERRUPT;
pkt_info.byte_cnt = RX_SKB_SIZE;
pkt_info.buf_ptr = dma_map_single(NULL, skb->data, RX_SKB_SIZE,
Expand All @@ -192,7 +198,7 @@ static void mv643xx_eth_rx_task(void *data)
"%s: Error allocating RX Ring\n", dev->name);
break;
}
skb_reserve(skb, 2);
skb_reserve(skb, HW_IP_ALIGN);
}
clear_bit(0, &mp->rx_task_busy);
/*
Expand Down

0 comments on commit b42a374

Please sign in to comment.