diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2012-02-11 15:11:55 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2012-02-11 15:11:55 +0000 |
commit | 4ab419384e1f53e24dfa18c957103c92511087aa (patch) | |
tree | 622b252813872122ce77f6517fcbba6db831d185 /target/linux/ramips/files/drivers/net/ramips.c | |
parent | 8ecf5cdf0f4a23f9ed0323fb72efeb721fea4b49 (diff) | |
download | upstream-4ab419384e1f53e24dfa18c957103c92511087aa.tar.gz upstream-4ab419384e1f53e24dfa18c957103c92511087aa.tar.bz2 upstream-4ab419384e1f53e24dfa18c957103c92511087aa.zip |
ramips: raeth: add a temporary pktlen variable
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@30442 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ramips/files/drivers/net/ramips.c')
-rw-r--r-- | target/linux/ramips/files/drivers/net/ramips.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/target/linux/ramips/files/drivers/net/ramips.c b/target/linux/ramips/files/drivers/net/ramips.c index 84c9fe4af5..338d200bd7 100644 --- a/target/linux/ramips/files/drivers/net/ramips.c +++ b/target/linux/ramips/files/drivers/net/ramips.c @@ -269,22 +269,25 @@ ramips_eth_rx_hw(unsigned long ptr) while (max_rx) { struct sk_buff *rx_skb, *new_skb; + int pktlen; rx = (ramips_fe_rr(RAMIPS_RX_CALC_IDX0) + 1) % NUM_RX_DESC; if (!(priv->rx[rx].rxd2 & RX_DMA_DONE)) break; max_rx--; + rx_skb = priv->rx_skb[rx]; + pktlen = RX_DMA_PLEN0(priv->rx[rx].rxd2); + new_skb = netdev_alloc_skb(dev, MAX_RX_LENGTH + NET_IP_ALIGN); /* Reuse the buffer on allocation failures */ if (new_skb) { - rx_skb = priv->rx_skb[rx]; - skb_put(rx_skb, RX_DMA_PLEN0(priv->rx[rx].rxd2)); + skb_put(rx_skb, pktlen); rx_skb->dev = dev; rx_skb->protocol = eth_type_trans(rx_skb, dev); rx_skb->ip_summed = CHECKSUM_NONE; dev->stats.rx_packets++; - dev->stats.rx_bytes += rx_skb->len; + dev->stats.rx_bytes += pktlen; netif_rx(rx_skb); priv->rx_skb[rx] = new_skb; |