diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-01-19 13:04:28 -0500 |
---|---|---|
committer | Reinette Chatre <reinette.chatre@intel.com> | 2010-03-09 19:03:53 -0500 |
commit | e99f168c7cc2f78c07c23250fe933362847cb3e0 (patch) | |
tree | 7bde44ba2bbe267a6ea2a9219129c6d9bb3d6302 /drivers/net/wireless/iwlwifi | |
parent | a4c8b2a692601de0a7bcb032b69f806050944dff (diff) |
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: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945-rs.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-dev.h | 10 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-rx.c | 24 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 6 |
6 files changed, 15 insertions, 42 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c index effdd3670da..b588cb69536 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c | |||
@@ -946,7 +946,7 @@ void iwl3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id) | |||
946 | 946 | ||
947 | spin_unlock_irqrestore(&rs_sta->lock, flags); | 947 | spin_unlock_irqrestore(&rs_sta->lock, flags); |
948 | 948 | ||
949 | rssi = priv->last_rx_rssi; | 949 | rssi = priv->_3945.last_rx_rssi; |
950 | if (rssi == 0) | 950 | if (rssi == 0) |
951 | rssi = IWL_MIN_RSSI_VAL; | 951 | rssi = IWL_MIN_RSSI_VAL; |
952 | 952 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index 867bd69270f..9a5a7b100e6 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
@@ -705,9 +705,10 @@ static void iwl3945_rx_reply_rx(struct iwl_priv *priv, | |||
705 | iwl_dbg_log_rx_data_frame(priv, le16_to_cpu(rx_hdr->len), header); | 705 | iwl_dbg_log_rx_data_frame(priv, le16_to_cpu(rx_hdr->len), header); |
706 | 706 | ||
707 | if (network_packet) { | 707 | if (network_packet) { |
708 | priv->last_beacon_time = le32_to_cpu(rx_end->beacon_timestamp); | 708 | priv->_3945.last_beacon_time = |
709 | priv->last_tsf = le64_to_cpu(rx_end->timestamp); | 709 | le32_to_cpu(rx_end->beacon_timestamp); |
710 | priv->last_rx_rssi = rx_status.signal; | 710 | priv->_3945.last_tsf = le64_to_cpu(rx_end->timestamp); |
711 | priv->_3945.last_rx_rssi = rx_status.signal; | ||
711 | priv->last_rx_noise = rx_status.noise; | 712 | priv->last_rx_noise = rx_status.noise; |
712 | } | 713 | } |
713 | 714 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c index 8bf7c20b9d3..696e668b801 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c | |||
@@ -2956,12 +2956,8 @@ static ssize_t rs_sta_dbgfs_rate_scale_data_read(struct file *file, | |||
2956 | desc += sprintf(buff+desc, | 2956 | desc += sprintf(buff+desc, |
2957 | "Bit Rate= %d Mb/s\n", | 2957 | "Bit Rate= %d Mb/s\n", |
2958 | iwl_rates[lq_sta->last_txrate_idx].ieee >> 1); | 2958 | iwl_rates[lq_sta->last_txrate_idx].ieee >> 1); |
2959 | desc += sprintf(buff+desc, | 2959 | desc += sprintf(buff+desc, "Noise Level= %d dBm\n", |
2960 | "Signal Level= %d dBm\tNoise Level= %d dBm\n", | 2960 | priv->last_rx_noise); |
2961 | priv->last_rx_rssi, priv->last_rx_noise); | ||
2962 | desc += sprintf(buff+desc, | ||
2963 | "Tsf= 0x%llx\tBeacon time= 0x%08X\n", | ||
2964 | priv->last_tsf, priv->last_beacon_time); | ||
2965 | 2961 | ||
2966 | ret = simple_read_from_buffer(user_buf, count, ppos, buff, desc); | 2962 | ret = simple_read_from_buffer(user_buf, count, ppos, buff, desc); |
2967 | return ret; | 2963 | return ret; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index f9210b78ffc..c277e4e8cf8 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -1197,7 +1197,6 @@ struct iwl_priv { | |||
1197 | 1197 | ||
1198 | unsigned long status; | 1198 | unsigned long status; |
1199 | 1199 | ||
1200 | int last_rx_rssi; /* From Rx packet statistics */ | ||
1201 | int last_rx_noise; /* From beacon statistics */ | 1200 | int last_rx_noise; /* From beacon statistics */ |
1202 | 1201 | ||
1203 | /* counts mgmt, ctl, and data packets */ | 1202 | /* counts mgmt, ctl, and data packets */ |
@@ -1244,10 +1243,6 @@ struct iwl_priv { | |||
1244 | 1243 | ||
1245 | u8 mac80211_registered; | 1244 | u8 mac80211_registered; |
1246 | 1245 | ||
1247 | /* Rx'd packet timing information */ | ||
1248 | u32 last_beacon_time; | ||
1249 | u64 last_tsf; | ||
1250 | |||
1251 | /* eeprom -- this is in the card's little endian byte order */ | 1246 | /* eeprom -- this is in the card's little endian byte order */ |
1252 | u8 *eeprom; | 1247 | u8 *eeprom; |
1253 | int nvm_device_type; | 1248 | int nvm_device_type; |
@@ -1274,6 +1269,11 @@ struct iwl_priv { | |||
1274 | struct iwl3945_notif_statistics statistics; | 1269 | struct iwl3945_notif_statistics statistics; |
1275 | 1270 | ||
1276 | u32 sta_supp_rates; | 1271 | u32 sta_supp_rates; |
1272 | int last_rx_rssi; /* From Rx packet statistics */ | ||
1273 | |||
1274 | /* Rx'd packet timing information */ | ||
1275 | u32 last_beacon_time; | ||
1276 | u64 last_tsf; | ||
1277 | } _3945; | 1277 | } _3945; |
1278 | #endif | 1278 | #endif |
1279 | #if defined(CONFIG_IWLAGN) || defined(CONFIG_IWLAGN_MODULE) | 1279 | #if defined(CONFIG_IWLAGN) || defined(CONFIG_IWLAGN_MODULE) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c index df257bc15f4..8116aa0d767 100644 --- a/drivers/net/wireless/iwlwifi/iwl-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-rx.c | |||
@@ -1036,24 +1036,6 @@ static void iwl_pass_packet_to_mac80211(struct iwl_priv *priv, | |||
1036 | rxb->page = NULL; | 1036 | rxb->page = NULL; |
1037 | } | 1037 | } |
1038 | 1038 | ||
1039 | /* This is necessary only for a number of statistics, see the caller. */ | ||
1040 | static int iwl_is_network_packet(struct iwl_priv *priv, | ||
1041 | struct ieee80211_hdr *header) | ||
1042 | { | ||
1043 | /* Filter incoming packets to determine if they are targeted toward | ||
1044 | * this network, discarding packets coming from ourselves */ | ||
1045 | switch (priv->iw_mode) { | ||
1046 | case NL80211_IFTYPE_ADHOC: /* Header: Dest. | Source | BSSID */ | ||
1047 | /* packets to our IBSS update information */ | ||
1048 | return !compare_ether_addr(header->addr3, priv->bssid); | ||
1049 | case NL80211_IFTYPE_STATION: /* Header: Dest. | AP{BSSID} | Source */ | ||
1050 | /* packets to our IBSS update information */ | ||
1051 | return !compare_ether_addr(header->addr2, priv->bssid); | ||
1052 | default: | ||
1053 | return 1; | ||
1054 | } | ||
1055 | } | ||
1056 | |||
1057 | /* Called for REPLY_RX (legacy ABG frames), or | 1039 | /* Called for REPLY_RX (legacy ABG frames), or |
1058 | * REPLY_RX_MPDU_CMD (HT high-throughput N frames). */ | 1040 | * REPLY_RX_MPDU_CMD (HT high-throughput N frames). */ |
1059 | void iwl_rx_reply_rx(struct iwl_priv *priv, | 1041 | void iwl_rx_reply_rx(struct iwl_priv *priv, |
@@ -1190,12 +1172,6 @@ void iwl_rx_reply_rx(struct iwl_priv *priv, | |||
1190 | if (rate_n_flags & RATE_MCS_SGI_MSK) | 1172 | if (rate_n_flags & RATE_MCS_SGI_MSK) |
1191 | rx_status.flag |= RX_FLAG_SHORT_GI; | 1173 | rx_status.flag |= RX_FLAG_SHORT_GI; |
1192 | 1174 | ||
1193 | if (iwl_is_network_packet(priv, header)) { | ||
1194 | priv->last_rx_rssi = rx_status.signal; | ||
1195 | priv->last_beacon_time = priv->ucode_beacon_time; | ||
1196 | priv->last_tsf = le64_to_cpu(phy_res->timestamp); | ||
1197 | } | ||
1198 | |||
1199 | iwl_pass_packet_to_mac80211(priv, header, len, ampdu_status, | 1175 | iwl_pass_packet_to_mac80211(priv, header, len, ampdu_status, |
1200 | rxb, &rx_status); | 1176 | rxb, &rx_status); |
1201 | } | 1177 | } |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 1b3a1ba4ed9..a825092fff9 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -753,7 +753,7 @@ static int iwl3945_get_measurement(struct iwl_priv *priv, | |||
753 | if (iwl_is_associated(priv)) | 753 | if (iwl_is_associated(priv)) |
754 | add_time = | 754 | add_time = |
755 | iwl3945_usecs_to_beacons( | 755 | iwl3945_usecs_to_beacons( |
756 | le64_to_cpu(params->start_time) - priv->last_tsf, | 756 | le64_to_cpu(params->start_time) - priv->_3945.last_tsf, |
757 | le16_to_cpu(priv->rxon_timing.beacon_interval)); | 757 | le16_to_cpu(priv->rxon_timing.beacon_interval)); |
758 | 758 | ||
759 | memset(&spectrum, 0, sizeof(spectrum)); | 759 | memset(&spectrum, 0, sizeof(spectrum)); |
@@ -767,7 +767,7 @@ static int iwl3945_get_measurement(struct iwl_priv *priv, | |||
767 | 767 | ||
768 | if (iwl_is_associated(priv)) | 768 | if (iwl_is_associated(priv)) |
769 | spectrum.start_time = | 769 | spectrum.start_time = |
770 | iwl3945_add_beacon_time(priv->last_beacon_time, | 770 | iwl3945_add_beacon_time(priv->_3945.last_beacon_time, |
771 | add_time, | 771 | add_time, |
772 | le16_to_cpu(priv->rxon_timing.beacon_interval)); | 772 | le16_to_cpu(priv->rxon_timing.beacon_interval)); |
773 | else | 773 | else |
@@ -3590,7 +3590,7 @@ static ssize_t store_measurement(struct device *d, | |||
3590 | struct iwl_priv *priv = dev_get_drvdata(d); | 3590 | struct iwl_priv *priv = dev_get_drvdata(d); |
3591 | struct ieee80211_measurement_params params = { | 3591 | struct ieee80211_measurement_params params = { |
3592 | .channel = le16_to_cpu(priv->active_rxon.channel), | 3592 | .channel = le16_to_cpu(priv->active_rxon.channel), |
3593 | .start_time = cpu_to_le64(priv->last_tsf), | 3593 | .start_time = cpu_to_le64(priv->_3945.last_tsf), |
3594 | .duration = cpu_to_le16(1), | 3594 | .duration = cpu_to_le16(1), |
3595 | }; | 3595 | }; |
3596 | u8 type = IWL_MEASURE_BASIC; | 3596 | u8 type = IWL_MEASURE_BASIC; |