Commit e99f168c authored by Johannes Berg's avatar Johannes Berg Committed by Reinette Chatre

iwlagn: remove write-only variables

Updating the variables last_rx_rssi, last_tsf
and last_beacon_time needs a lot of code but
they are not actually used in iwlagn (only in
3945) so we can move them to the 3945 specific
data.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
parent a4c8b2a6
...@@ -946,7 +946,7 @@ void iwl3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id) ...@@ -946,7 +946,7 @@ void iwl3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id)
spin_unlock_irqrestore(&rs_sta->lock, flags); spin_unlock_irqrestore(&rs_sta->lock, flags);
rssi = priv->last_rx_rssi; rssi = priv->_3945.last_rx_rssi;
if (rssi == 0) if (rssi == 0)
rssi = IWL_MIN_RSSI_VAL; rssi = IWL_MIN_RSSI_VAL;
......
...@@ -705,9 +705,10 @@ static void iwl3945_rx_reply_rx(struct iwl_priv *priv, ...@@ -705,9 +705,10 @@ static void iwl3945_rx_reply_rx(struct iwl_priv *priv,
iwl_dbg_log_rx_data_frame(priv, le16_to_cpu(rx_hdr->len), header); iwl_dbg_log_rx_data_frame(priv, le16_to_cpu(rx_hdr->len), header);
if (network_packet) { if (network_packet) {
priv->last_beacon_time = le32_to_cpu(rx_end->beacon_timestamp); priv->_3945.last_beacon_time =
priv->last_tsf = le64_to_cpu(rx_end->timestamp); le32_to_cpu(rx_end->beacon_timestamp);
priv->last_rx_rssi = rx_status.signal; priv->_3945.last_tsf = le64_to_cpu(rx_end->timestamp);
priv->_3945.last_rx_rssi = rx_status.signal;
priv->last_rx_noise = rx_status.noise; priv->last_rx_noise = rx_status.noise;
} }
......
...@@ -2956,12 +2956,8 @@ static ssize_t rs_sta_dbgfs_rate_scale_data_read(struct file *file, ...@@ -2956,12 +2956,8 @@ static ssize_t rs_sta_dbgfs_rate_scale_data_read(struct file *file,
desc += sprintf(buff+desc, desc += sprintf(buff+desc,
"Bit Rate= %d Mb/s\n", "Bit Rate= %d Mb/s\n",
iwl_rates[lq_sta->last_txrate_idx].ieee >> 1); iwl_rates[lq_sta->last_txrate_idx].ieee >> 1);
desc += sprintf(buff+desc, desc += sprintf(buff+desc, "Noise Level= %d dBm\n",
"Signal Level= %d dBm\tNoise Level= %d dBm\n", priv->last_rx_noise);
priv->last_rx_rssi, priv->last_rx_noise);
desc += sprintf(buff+desc,
"Tsf= 0x%llx\tBeacon time= 0x%08X\n",
priv->last_tsf, priv->last_beacon_time);
ret = simple_read_from_buffer(user_buf, count, ppos, buff, desc); ret = simple_read_from_buffer(user_buf, count, ppos, buff, desc);
return ret; return ret;
......
...@@ -1197,7 +1197,6 @@ struct iwl_priv { ...@@ -1197,7 +1197,6 @@ struct iwl_priv {
unsigned long status; unsigned long status;
int last_rx_rssi; /* From Rx packet statistics */
int last_rx_noise; /* From beacon statistics */ int last_rx_noise; /* From beacon statistics */
/* counts mgmt, ctl, and data packets */ /* counts mgmt, ctl, and data packets */
...@@ -1244,10 +1243,6 @@ struct iwl_priv { ...@@ -1244,10 +1243,6 @@ struct iwl_priv {
u8 mac80211_registered; u8 mac80211_registered;
/* Rx'd packet timing information */
u32 last_beacon_time;
u64 last_tsf;
/* eeprom -- this is in the card's little endian byte order */ /* eeprom -- this is in the card's little endian byte order */
u8 *eeprom; u8 *eeprom;
int nvm_device_type; int nvm_device_type;
...@@ -1274,6 +1269,11 @@ struct iwl_priv { ...@@ -1274,6 +1269,11 @@ struct iwl_priv {
struct iwl3945_notif_statistics statistics; struct iwl3945_notif_statistics statistics;
u32 sta_supp_rates; u32 sta_supp_rates;
int last_rx_rssi; /* From Rx packet statistics */
/* Rx'd packet timing information */
u32 last_beacon_time;
u64 last_tsf;
} _3945; } _3945;
#endif #endif
#if defined(CONFIG_IWLAGN) || defined(CONFIG_IWLAGN_MODULE) #if defined(CONFIG_IWLAGN) || defined(CONFIG_IWLAGN_MODULE)
......
...@@ -1036,24 +1036,6 @@ static void iwl_pass_packet_to_mac80211(struct iwl_priv *priv, ...@@ -1036,24 +1036,6 @@ static void iwl_pass_packet_to_mac80211(struct iwl_priv *priv,
rxb->page = NULL; rxb->page = NULL;
} }
/* This is necessary only for a number of statistics, see the caller. */
static int iwl_is_network_packet(struct iwl_priv *priv,
struct ieee80211_hdr *header)
{
/* Filter incoming packets to determine if they are targeted toward
* this network, discarding packets coming from ourselves */
switch (priv->iw_mode) {
case NL80211_IFTYPE_ADHOC: /* Header: Dest. | Source | BSSID */
/* packets to our IBSS update information */
return !compare_ether_addr(header->addr3, priv->bssid);
case NL80211_IFTYPE_STATION: /* Header: Dest. | AP{BSSID} | Source */
/* packets to our IBSS update information */
return !compare_ether_addr(header->addr2, priv->bssid);
default:
return 1;
}
}
/* Called for REPLY_RX (legacy ABG frames), or /* Called for REPLY_RX (legacy ABG frames), or
* REPLY_RX_MPDU_CMD (HT high-throughput N frames). */ * REPLY_RX_MPDU_CMD (HT high-throughput N frames). */
void iwl_rx_reply_rx(struct iwl_priv *priv, void iwl_rx_reply_rx(struct iwl_priv *priv,
...@@ -1190,12 +1172,6 @@ void iwl_rx_reply_rx(struct iwl_priv *priv, ...@@ -1190,12 +1172,6 @@ void iwl_rx_reply_rx(struct iwl_priv *priv,
if (rate_n_flags & RATE_MCS_SGI_MSK) if (rate_n_flags & RATE_MCS_SGI_MSK)
rx_status.flag |= RX_FLAG_SHORT_GI; rx_status.flag |= RX_FLAG_SHORT_GI;
if (iwl_is_network_packet(priv, header)) {
priv->last_rx_rssi = rx_status.signal;
priv->last_beacon_time = priv->ucode_beacon_time;
priv->last_tsf = le64_to_cpu(phy_res->timestamp);
}
iwl_pass_packet_to_mac80211(priv, header, len, ampdu_status, iwl_pass_packet_to_mac80211(priv, header, len, ampdu_status,
rxb, &rx_status); rxb, &rx_status);
} }
......
...@@ -753,7 +753,7 @@ static int iwl3945_get_measurement(struct iwl_priv *priv, ...@@ -753,7 +753,7 @@ static int iwl3945_get_measurement(struct iwl_priv *priv,
if (iwl_is_associated(priv)) if (iwl_is_associated(priv))
add_time = add_time =
iwl3945_usecs_to_beacons( iwl3945_usecs_to_beacons(
le64_to_cpu(params->start_time) - priv->last_tsf, le64_to_cpu(params->start_time) - priv->_3945.last_tsf,
le16_to_cpu(priv->rxon_timing.beacon_interval)); le16_to_cpu(priv->rxon_timing.beacon_interval));
memset(&spectrum, 0, sizeof(spectrum)); memset(&spectrum, 0, sizeof(spectrum));
...@@ -767,7 +767,7 @@ static int iwl3945_get_measurement(struct iwl_priv *priv, ...@@ -767,7 +767,7 @@ static int iwl3945_get_measurement(struct iwl_priv *priv,
if (iwl_is_associated(priv)) if (iwl_is_associated(priv))
spectrum.start_time = spectrum.start_time =
iwl3945_add_beacon_time(priv->last_beacon_time, iwl3945_add_beacon_time(priv->_3945.last_beacon_time,
add_time, add_time,
le16_to_cpu(priv->rxon_timing.beacon_interval)); le16_to_cpu(priv->rxon_timing.beacon_interval));
else else
...@@ -3590,7 +3590,7 @@ static ssize_t store_measurement(struct device *d, ...@@ -3590,7 +3590,7 @@ static ssize_t store_measurement(struct device *d,
struct iwl_priv *priv = dev_get_drvdata(d); struct iwl_priv *priv = dev_get_drvdata(d);
struct ieee80211_measurement_params params = { struct ieee80211_measurement_params params = {
.channel = le16_to_cpu(priv->active_rxon.channel), .channel = le16_to_cpu(priv->active_rxon.channel),
.start_time = cpu_to_le64(priv->last_tsf), .start_time = cpu_to_le64(priv->_3945.last_tsf),
.duration = cpu_to_le16(1), .duration = cpu_to_le16(1),
}; };
u8 type = IWL_MEASURE_BASIC; u8 type = IWL_MEASURE_BASIC;
......
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