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

mwifiex: correct TX byte count statistics

The skb is modified in sending the TX 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 f49c6e81
...@@ -222,6 +222,7 @@ mwifiex_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, ...@@ -222,6 +222,7 @@ mwifiex_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
tx_info = MWIFIEX_SKB_TXCB(skb); tx_info = MWIFIEX_SKB_TXCB(skb);
tx_info->bss_num = priv->bss_num; tx_info->bss_num = priv->bss_num;
tx_info->bss_type = priv->bss_type; tx_info->bss_type = priv->bss_type;
tx_info->pkt_len = pkt_len;
mwifiex_form_mgmt_frame(skb, buf, len); mwifiex_form_mgmt_frame(skb, buf, len);
mwifiex_queue_tx_pkt(priv, skb); mwifiex_queue_tx_pkt(priv, skb);
......
...@@ -130,6 +130,7 @@ struct mwifiex_txinfo { ...@@ -130,6 +130,7 @@ struct mwifiex_txinfo {
u8 flags; u8 flags;
u8 bss_num; u8 bss_num;
u8 bss_type; u8 bss_type;
u32 pkt_len;
}; };
enum mwifiex_wmm_ac_e { enum mwifiex_wmm_ac_e {
......
...@@ -648,6 +648,7 @@ mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -648,6 +648,7 @@ mwifiex_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
tx_info = MWIFIEX_SKB_TXCB(skb); tx_info = MWIFIEX_SKB_TXCB(skb);
tx_info->bss_num = priv->bss_num; tx_info->bss_num = priv->bss_num;
tx_info->bss_type = priv->bss_type; tx_info->bss_type = priv->bss_type;
tx_info->pkt_len = skb->len;
/* Record the current time the packet was queued; used to /* Record the current time the packet was queued; used to
* determine the amount of time the packet was queued in * determine the amount of time the packet was queued in
......
...@@ -148,6 +148,7 @@ int mwifiex_send_null_packet(struct mwifiex_private *priv, u8 flags) ...@@ -148,6 +148,7 @@ int mwifiex_send_null_packet(struct mwifiex_private *priv, u8 flags)
tx_info = MWIFIEX_SKB_TXCB(skb); tx_info = MWIFIEX_SKB_TXCB(skb);
tx_info->bss_num = priv->bss_num; tx_info->bss_num = priv->bss_num;
tx_info->bss_type = priv->bss_type; tx_info->bss_type = priv->bss_type;
tx_info->pkt_len = data_len - (sizeof(struct txpd) + INTF_HEADER_LEN);
skb_reserve(skb, sizeof(struct txpd) + INTF_HEADER_LEN); skb_reserve(skb, sizeof(struct txpd) + INTF_HEADER_LEN);
skb_push(skb, sizeof(struct txpd)); skb_push(skb, sizeof(struct txpd));
......
...@@ -175,7 +175,7 @@ int mwifiex_write_data_complete(struct mwifiex_adapter *adapter, ...@@ -175,7 +175,7 @@ int mwifiex_write_data_complete(struct mwifiex_adapter *adapter,
mwifiex_set_trans_start(priv->netdev); mwifiex_set_trans_start(priv->netdev);
if (!status) { if (!status) {
priv->stats.tx_packets++; priv->stats.tx_packets++;
priv->stats.tx_bytes += skb->len; priv->stats.tx_bytes += tx_info->pkt_len;
if (priv->tx_timeout_cnt) if (priv->tx_timeout_cnt)
priv->tx_timeout_cnt = 0; priv->tx_timeout_cnt = 0;
} 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