Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 195150
b: refs/heads/master
c: ec497b3
h: refs/heads/master
v: v3
  • Loading branch information
Peter Meerwald authored and David S. Miller committed May 18, 2010
1 parent e9cfb1f commit 2cadae9
Show file tree
Hide file tree
Showing 2 changed files with 15 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: fe92afedee23e1d91f0133360a24d2bf48270739
refs/heads/master: ec497b32c311b1e1aac22a76d294d24285d06331
17 changes: 14 additions & 3 deletions trunk/drivers/net/bfin_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -980,12 +980,25 @@ static int bfin_mac_hard_start_xmit(struct sk_buff *skb,
return NETDEV_TX_OK;
}

#define RX_ERROR_MASK (RX_LONG | RX_ALIGN | RX_CRC | RX_LEN | \
RX_FRAG | RX_ADDR | RX_DMAO | RX_PHY | RX_LATE | RX_RANGE)

static void bfin_mac_rx(struct net_device *dev)
{
struct sk_buff *skb, *new_skb;
unsigned short len;
struct bfin_mac_local *lp __maybe_unused = netdev_priv(dev);

/* check if frame status word reports an error condition
* we which case we simply drop the packet
*/
if (current_rx_ptr->status.status_word & RX_ERROR_MASK) {
printk(KERN_NOTICE DRV_NAME
": rx: receive error - packet dropped\n");
dev->stats.rx_dropped++;
goto out;
}

/* allocate a new skb for next time receive */
skb = current_rx_ptr->skb;

Expand Down Expand Up @@ -1024,11 +1037,9 @@ static void bfin_mac_rx(struct net_device *dev)
netif_rx(skb);
dev->stats.rx_packets++;
dev->stats.rx_bytes += len;
out:
current_rx_ptr->status.status_word = 0x00000000;
current_rx_ptr = current_rx_ptr->next;

out:
return;
}

/* interrupt routine to handle rx and error signal */
Expand Down

0 comments on commit 2cadae9

Please sign in to comment.