Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -946,7 +946,7 @@ void iwl3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id)

	spin_unlock_irqrestore(&rs_sta->lock, flags);

	rssi = priv->last_rx_rssi;
	rssi = priv->_3945.last_rx_rssi;
	if (rssi == 0)
		rssi = IWL_MIN_RSSI_VAL;

+4 −3
Original line number Diff line number Diff line
@@ -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);

	if (network_packet) {
		priv->last_beacon_time = le32_to_cpu(rx_end->beacon_timestamp);
		priv->last_tsf = le64_to_cpu(rx_end->timestamp);
		priv->last_rx_rssi = rx_status.signal;
		priv->_3945.last_beacon_time =
			le32_to_cpu(rx_end->beacon_timestamp);
		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;
	}

+2 −6
Original line number Diff line number Diff line
@@ -2956,12 +2956,8 @@ static ssize_t rs_sta_dbgfs_rate_scale_data_read(struct file *file,
		desc += sprintf(buff+desc,
				"Bit Rate= %d Mb/s\n",
				iwl_rates[lq_sta->last_txrate_idx].ieee >> 1);
	desc += sprintf(buff+desc,
			"Signal Level= %d dBm\tNoise Level= %d dBm\n",
			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);
	desc += sprintf(buff+desc, "Noise Level= %d dBm\n",
			priv->last_rx_noise);

	ret = simple_read_from_buffer(user_buf, count, ppos, buff, desc);
	return ret;
+5 −5
Original line number Diff line number Diff line
@@ -1197,7 +1197,6 @@ struct iwl_priv {

	unsigned long status;

	int last_rx_rssi;	/* From Rx packet statistics */
	int last_rx_noise;	/* From beacon statistics */

	/* counts mgmt, ctl, and data packets */
@@ -1244,10 +1243,6 @@ struct iwl_priv {

	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 */
	u8 *eeprom;
	int    nvm_device_type;
@@ -1274,6 +1269,11 @@ struct iwl_priv {
			struct iwl3945_notif_statistics statistics;

			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;
#endif
#if defined(CONFIG_IWLAGN) || defined(CONFIG_IWLAGN_MODULE)
+0 −24
Original line number Diff line number Diff line
@@ -1036,24 +1036,6 @@ static void iwl_pass_packet_to_mac80211(struct iwl_priv *priv,
	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
 * REPLY_RX_MPDU_CMD (HT high-throughput N frames). */
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)
		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,
				    rxb, &rx_status);
}
Loading