Commit f49c6e81 authored by Ujjal Roy's avatar Ujjal Roy Committed by John W. Linville

mwifiex: correct RX byte count statistics

The skb is modified in processing the RX packet. Save the original
packet length to a variable so that we can get the correct
statistics update.
Signed-off-by: default avatarUjjal Roy <royujjal@gmail.com>
Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ca8d6dfc
...@@ -191,6 +191,9 @@ int mwifiex_recv_packet(struct mwifiex_private *priv, struct sk_buff *skb) ...@@ -191,6 +191,9 @@ int mwifiex_recv_packet(struct mwifiex_private *priv, struct sk_buff *skb)
if (!skb) if (!skb)
return -1; return -1;
priv->stats.rx_bytes += skb->len;
priv->stats.rx_packets++;
skb->dev = priv->netdev; skb->dev = priv->netdev;
skb->protocol = eth_type_trans(skb, priv->netdev); skb->protocol = eth_type_trans(skb, priv->netdev);
skb->ip_summed = CHECKSUM_NONE; skb->ip_summed = CHECKSUM_NONE;
...@@ -217,8 +220,6 @@ int mwifiex_recv_packet(struct mwifiex_private *priv, struct sk_buff *skb) ...@@ -217,8 +220,6 @@ int mwifiex_recv_packet(struct mwifiex_private *priv, struct sk_buff *skb)
(skb->truesize > MWIFIEX_RX_DATA_BUF_SIZE)) (skb->truesize > MWIFIEX_RX_DATA_BUF_SIZE))
skb->truesize += (skb->len - MWIFIEX_RX_DATA_BUF_SIZE); skb->truesize += (skb->len - MWIFIEX_RX_DATA_BUF_SIZE);
priv->stats.rx_bytes += skb->len;
priv->stats.rx_packets++;
if (in_interrupt()) if (in_interrupt())
netif_rx(skb); netif_rx(skb);
else else
......
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