Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90291
b: refs/heads/master
c: 19758be
h: refs/heads/master
i:
  90289: bed0f02
  90287: 27c4137
v: v3
  • Loading branch information
Tomas Winkler authored and John W. Linville committed Mar 25, 2008
1 parent b56ddab commit ad7655c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 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: c79dd5b5bc5a65822cdc9d571032c469ad7577d5
refs/heads/master: 19758bef09abe9d2a14575ffb6f686947e97fcb1
9 changes: 9 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-4965.c
Original file line number Diff line number Diff line change
Expand Up @@ -3337,6 +3337,14 @@ static void iwl4965_add_radiotap(struct iwl_priv *priv,
stats->flag |= RX_FLAG_RADIOTAP;
}

static void iwl_update_rx_stats(struct iwl_priv *priv, u16 fc, u16 len)
{
/* 0 - mgmt, 1 - cnt, 2 - data */
int idx = (fc & IEEE80211_FCTL_FTYPE) >> 2;
priv->rx_stats[idx].cnt++;
priv->rx_stats[idx].bytes += len;
}

static void iwl4965_handle_data_packet(struct iwl_priv *priv, int is_data,
int include_phy,
struct iwl4965_rx_mem_buffer *rxb,
Expand Down Expand Up @@ -3406,6 +3414,7 @@ static void iwl4965_handle_data_packet(struct iwl_priv *priv, int is_data,
if (priv->add_radiotap)
iwl4965_add_radiotap(priv, rxb->skb, rx_start, stats, ampdu_status);

iwl_update_rx_stats(priv, le16_to_cpu(hdr->frame_control), len);
ieee80211_rx_irqsafe(priv->hw, rxb->skb, stats);
priv->alloc_rxb_skb--;
rxb->skb = NULL;
Expand Down
6 changes: 6 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-4965.h
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,12 @@ struct iwl_priv {
int last_rx_rssi; /* From Rx packet statisitics */
int last_rx_noise; /* From beacon statistics */

/* counts mgmt, ctl, and data packets */
struct traffic_stats {
u32 cnt;
u64 bytes;
} tx_stats[3], rx_stats[3];

struct iwl4965_power_mgr power_data;

struct iwl4965_notif_statistics statistics;
Expand Down
10 changes: 9 additions & 1 deletion trunk/drivers/net/wireless/iwlwifi/iwl4965-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -2529,7 +2529,13 @@ static void iwl4965_build_tx_cmd_basic(struct iwl_priv *priv,
cmd->cmd.tx.tx_flags = tx_flags;
cmd->cmd.tx.next_frame_len = 0;
}

static void iwl_update_tx_stats(struct iwl_priv *priv, u16 fc, u16 len)
{
/* 0 - mgmt, 1 - cnt, 2 - data */
int idx = (fc & IEEE80211_FCTL_FTYPE) >> 2;
priv->tx_stats[idx].cnt++;
priv->tx_stats[idx].bytes += len;
}
/**
* iwl4965_get_sta_id - Find station's index within station table
*
Expand Down Expand Up @@ -2776,6 +2782,8 @@ static int iwl4965_tx_skb(struct iwl_priv *priv,
/* set is_hcca to 0; it probably will never be implemented */
iwl4965_hw_build_tx_cmd_rate(priv, out_cmd, ctl, hdr, sta_id, 0);

iwl_update_tx_stats(priv, fc, len);

scratch_phys = txcmd_phys + sizeof(struct iwl4965_cmd_header) +
offsetof(struct iwl4965_tx_cmd, scratch);
out_cmd->cmd.tx.dram_lsb_ptr = cpu_to_le32(scratch_phys);
Expand Down

0 comments on commit ad7655c

Please sign in to comment.