mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-11-30 23:04:06 +02:00
ramips: raeth: add a temporary pktlen variable
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@30442 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
0e485dd80d
commit
cd69289b3e
@ -269,22 +269,25 @@ ramips_eth_rx_hw(unsigned long ptr)
|
|||||||
|
|
||||||
while (max_rx) {
|
while (max_rx) {
|
||||||
struct sk_buff *rx_skb, *new_skb;
|
struct sk_buff *rx_skb, *new_skb;
|
||||||
|
int pktlen;
|
||||||
|
|
||||||
rx = (ramips_fe_rr(RAMIPS_RX_CALC_IDX0) + 1) % NUM_RX_DESC;
|
rx = (ramips_fe_rr(RAMIPS_RX_CALC_IDX0) + 1) % NUM_RX_DESC;
|
||||||
if (!(priv->rx[rx].rxd2 & RX_DMA_DONE))
|
if (!(priv->rx[rx].rxd2 & RX_DMA_DONE))
|
||||||
break;
|
break;
|
||||||
max_rx--;
|
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);
|
new_skb = netdev_alloc_skb(dev, MAX_RX_LENGTH + NET_IP_ALIGN);
|
||||||
/* Reuse the buffer on allocation failures */
|
/* Reuse the buffer on allocation failures */
|
||||||
if (new_skb) {
|
if (new_skb) {
|
||||||
rx_skb = priv->rx_skb[rx];
|
skb_put(rx_skb, pktlen);
|
||||||
skb_put(rx_skb, RX_DMA_PLEN0(priv->rx[rx].rxd2));
|
|
||||||
rx_skb->dev = dev;
|
rx_skb->dev = dev;
|
||||||
rx_skb->protocol = eth_type_trans(rx_skb, dev);
|
rx_skb->protocol = eth_type_trans(rx_skb, dev);
|
||||||
rx_skb->ip_summed = CHECKSUM_NONE;
|
rx_skb->ip_summed = CHECKSUM_NONE;
|
||||||
dev->stats.rx_packets++;
|
dev->stats.rx_packets++;
|
||||||
dev->stats.rx_bytes += rx_skb->len;
|
dev->stats.rx_bytes += pktlen;
|
||||||
netif_rx(rx_skb);
|
netif_rx(rx_skb);
|
||||||
|
|
||||||
priv->rx_skb[rx] = new_skb;
|
priv->rx_skb[rx] = new_skb;
|
||||||
|
Loading…
Reference in New Issue
Block a user