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

Commit ebf0d90d authored by Stanislaw Gruszka's avatar Stanislaw Gruszka
Browse files

iwlegacy: s/statistics/stats/

parent b73bb5f1
Loading
Loading
Loading
Loading
+45 −45
Original line number Diff line number Diff line
@@ -29,22 +29,22 @@
#include "iwl-3945-debugfs.h"


static int il3945_statistics_flag(struct il_priv *il, char *buf, int bufsz)
static int il3945_stats_flag(struct il_priv *il, char *buf, int bufsz)
{
	int p = 0;

	p += scnprintf(buf + p, bufsz - p, "Statistics Flag(0x%X):\n",
		       le32_to_cpu(il->_3945.statistics.flag));
	if (le32_to_cpu(il->_3945.statistics.flag) &
		       le32_to_cpu(il->_3945.stats.flag));
	if (le32_to_cpu(il->_3945.stats.flag) &
			UCODE_STATISTICS_CLEAR_MSK)
		p += scnprintf(buf + p, bufsz - p,
			       "\tStatistics have been cleared\n");
	p += scnprintf(buf + p, bufsz - p, "\tOperational Frequency: %s\n",
		       (le32_to_cpu(il->_3945.statistics.flag) &
		       (le32_to_cpu(il->_3945.stats.flag) &
			UCODE_STATISTICS_FREQUENCY_MSK)
			? "2.4 GHz" : "5.2 GHz");
	p += scnprintf(buf + p, bufsz - p, "\tTGj Narrow Band: %s\n",
		       (le32_to_cpu(il->_3945.statistics.flag) &
		       (le32_to_cpu(il->_3945.stats.flag) &
			UCODE_STATISTICS_NARROW_BAND_MSK)
			? "enabled" : "disabled");
	return p;
@@ -57,14 +57,14 @@ ssize_t il3945_ucode_rx_stats_read(struct file *file,
	struct il_priv *il = file->private_data;
	int pos = 0;
	char *buf;
	int bufsz = sizeof(struct iwl39_statistics_rx_phy) * 40 +
		    sizeof(struct iwl39_statistics_rx_non_phy) * 40 + 400;
	int bufsz = sizeof(struct iwl39_stats_rx_phy) * 40 +
		    sizeof(struct iwl39_stats_rx_non_phy) * 40 + 400;
	ssize_t ret;
	struct iwl39_statistics_rx_phy *ofdm, *accum_ofdm, *delta_ofdm,
	struct iwl39_stats_rx_phy *ofdm, *accum_ofdm, *delta_ofdm,
					*max_ofdm;
	struct iwl39_statistics_rx_phy *cck, *accum_cck, *delta_cck, *max_cck;
	struct iwl39_statistics_rx_non_phy *general, *accum_general;
	struct iwl39_statistics_rx_non_phy *delta_general, *max_general;
	struct iwl39_stats_rx_phy *cck, *accum_cck, *delta_cck, *max_cck;
	struct iwl39_stats_rx_non_phy *general, *accum_general;
	struct iwl39_stats_rx_non_phy *delta_general, *max_general;

	if (!il_is_alive(il))
		return -EAGAIN;
@@ -77,23 +77,23 @@ ssize_t il3945_ucode_rx_stats_read(struct file *file,

	/*
	 * The statistic information display here is based on
	 * the last statistics notification from uCode
	 * the last stats notification from uCode
	 * might not reflect the current uCode activity
	 */
	ofdm = &il->_3945.statistics.rx.ofdm;
	cck = &il->_3945.statistics.rx.cck;
	general = &il->_3945.statistics.rx.general;
	accum_ofdm = &il->_3945.accum_statistics.rx.ofdm;
	accum_cck = &il->_3945.accum_statistics.rx.cck;
	accum_general = &il->_3945.accum_statistics.rx.general;
	delta_ofdm = &il->_3945.delta_statistics.rx.ofdm;
	delta_cck = &il->_3945.delta_statistics.rx.cck;
	delta_general = &il->_3945.delta_statistics.rx.general;
	ofdm = &il->_3945.stats.rx.ofdm;
	cck = &il->_3945.stats.rx.cck;
	general = &il->_3945.stats.rx.general;
	accum_ofdm = &il->_3945.accum_stats.rx.ofdm;
	accum_cck = &il->_3945.accum_stats.rx.cck;
	accum_general = &il->_3945.accum_stats.rx.general;
	delta_ofdm = &il->_3945.delta_stats.rx.ofdm;
	delta_cck = &il->_3945.delta_stats.rx.cck;
	delta_general = &il->_3945.delta_stats.rx.general;
	max_ofdm = &il->_3945.max_delta.rx.ofdm;
	max_cck = &il->_3945.max_delta.rx.cck;
	max_general = &il->_3945.max_delta.rx.general;

	pos += il3945_statistics_flag(il, buf, bufsz);
	pos += il3945_stats_flag(il, buf, bufsz);
	pos += scnprintf(buf + pos, bufsz - pos, "%-32s     current"
			 "acumulative       delta         max\n",
			 "Statistics_Rx - OFDM:");
@@ -332,9 +332,9 @@ ssize_t il3945_ucode_tx_stats_read(struct file *file,
	struct il_priv *il = file->private_data;
	int pos = 0;
	char *buf;
	int bufsz = (sizeof(struct iwl39_statistics_tx) * 48) + 250;
	int bufsz = (sizeof(struct iwl39_stats_tx) * 48) + 250;
	ssize_t ret;
	struct iwl39_statistics_tx *tx, *accum_tx, *delta_tx, *max_tx;
	struct iwl39_stats_tx *tx, *accum_tx, *delta_tx, *max_tx;

	if (!il_is_alive(il))
		return -EAGAIN;
@@ -347,14 +347,14 @@ ssize_t il3945_ucode_tx_stats_read(struct file *file,

	/*
	 * The statistic information display here is based on
	 * the last statistics notification from uCode
	 * the last stats notification from uCode
	 * might not reflect the current uCode activity
	 */
	tx = &il->_3945.statistics.tx;
	accum_tx = &il->_3945.accum_statistics.tx;
	delta_tx = &il->_3945.delta_statistics.tx;
	tx = &il->_3945.stats.tx;
	accum_tx = &il->_3945.accum_stats.tx;
	delta_tx = &il->_3945.delta_stats.tx;
	max_tx = &il->_3945.max_delta.tx;
	pos += il3945_statistics_flag(il, buf, bufsz);
	pos += il3945_stats_flag(il, buf, bufsz);
	pos += scnprintf(buf + pos, bufsz - pos, "%-32s     current"
			 "acumulative       delta         max\n",
			 "Statistics_Tx:");
@@ -428,12 +428,12 @@ ssize_t il3945_ucode_general_stats_read(struct file *file,
	struct il_priv *il = file->private_data;
	int pos = 0;
	char *buf;
	int bufsz = sizeof(struct iwl39_statistics_general) * 10 + 300;
	int bufsz = sizeof(struct iwl39_stats_general) * 10 + 300;
	ssize_t ret;
	struct iwl39_statistics_general *general, *accum_general;
	struct iwl39_statistics_general *delta_general, *max_general;
	struct statistics_dbg *dbg, *accum_dbg, *delta_dbg, *max_dbg;
	struct iwl39_statistics_div *div, *accum_div, *delta_div, *max_div;
	struct iwl39_stats_general *general, *accum_general;
	struct iwl39_stats_general *delta_general, *max_general;
	struct stats_dbg *dbg, *accum_dbg, *delta_dbg, *max_dbg;
	struct iwl39_stats_div *div, *accum_div, *delta_div, *max_div;

	if (!il_is_alive(il))
		return -EAGAIN;
@@ -446,22 +446,22 @@ ssize_t il3945_ucode_general_stats_read(struct file *file,

	/*
	 * The statistic information display here is based on
	 * the last statistics notification from uCode
	 * the last stats notification from uCode
	 * might not reflect the current uCode activity
	 */
	general = &il->_3945.statistics.general;
	dbg = &il->_3945.statistics.general.dbg;
	div = &il->_3945.statistics.general.div;
	accum_general = &il->_3945.accum_statistics.general;
	delta_general = &il->_3945.delta_statistics.general;
	general = &il->_3945.stats.general;
	dbg = &il->_3945.stats.general.dbg;
	div = &il->_3945.stats.general.div;
	accum_general = &il->_3945.accum_stats.general;
	delta_general = &il->_3945.delta_stats.general;
	max_general = &il->_3945.max_delta.general;
	accum_dbg = &il->_3945.accum_statistics.general.dbg;
	delta_dbg = &il->_3945.delta_statistics.general.dbg;
	accum_dbg = &il->_3945.accum_stats.general.dbg;
	delta_dbg = &il->_3945.delta_stats.general.dbg;
	max_dbg = &il->_3945.max_delta.general.dbg;
	accum_div = &il->_3945.accum_statistics.general.div;
	delta_div = &il->_3945.delta_statistics.general.div;
	accum_div = &il->_3945.accum_stats.general.div;
	delta_div = &il->_3945.delta_stats.general.div;
	max_div = &il->_3945.max_delta.general.div;
	pos += il3945_statistics_flag(il, buf, bufsz);
	pos += il3945_stats_flag(il, buf, bufsz);
	pos += scnprintf(buf + pos, bufsz - pos, "%-32s     current"
			 "acumulative       delta         max\n",
			 "Statistics_General:");
+1 −1
Original line number Diff line number Diff line
@@ -158,7 +158,7 @@ static int il3945_rate_scale_flush_windows(struct il3945_rs_sta *rs_sta)
	/*
	 * For each rate, if we have collected data on that rate
	 * and it has been more than IL_RATE_WIN_FLUSH
	 * since we flushed, clear out the gathered statistics
	 * since we flushed, clear out the gathered stats
	 */
	for (i = 0; i < IL_RATE_COUNT_3945; i++) {
		if (!rs_sta->win[i].counter)
+22 −22
Original line number Diff line number Diff line
@@ -362,7 +362,7 @@ static void il3945_rx_reply_tx(struct il_priv *il,
 *
 *****************************************************************************/
#ifdef CONFIG_IWLEGACY_DEBUGFS
static void il3945_accumulative_statistics(struct il_priv *il,
static void il3945_accumulative_stats(struct il_priv *il,
					    __le32 *stats)
{
	int i;
@@ -370,12 +370,12 @@ static void il3945_accumulative_statistics(struct il_priv *il,
	u32 *accum_stats;
	u32 *delta, *max_delta;

	prev_stats = (__le32 *)&il->_3945.statistics;
	accum_stats = (u32 *)&il->_3945.accum_statistics;
	delta = (u32 *)&il->_3945.delta_statistics;
	prev_stats = (__le32 *)&il->_3945.stats;
	accum_stats = (u32 *)&il->_3945.accum_stats;
	delta = (u32 *)&il->_3945.delta_stats;
	max_delta = (u32 *)&il->_3945.max_delta;

	for (i = sizeof(__le32); i < sizeof(struct il3945_notif_statistics);
	for (i = sizeof(__le32); i < sizeof(struct il3945_notif_stats);
	     i += sizeof(__le32), stats++, prev_stats++, delta++,
	     max_delta++, accum_stats++) {
		if (le32_to_cpu(*stats) > le32_to_cpu(*prev_stats)) {
@@ -387,30 +387,30 @@ static void il3945_accumulative_statistics(struct il_priv *il,
		}
	}

	/* reset accumulative statistics for "no-counter" type statistics */
	il->_3945.accum_statistics.general.temperature =
		il->_3945.statistics.general.temperature;
	il->_3945.accum_statistics.general.ttl_timestamp =
		il->_3945.statistics.general.ttl_timestamp;
	/* reset accumulative stats for "no-counter" type stats */
	il->_3945.accum_stats.general.temperature =
		il->_3945.stats.general.temperature;
	il->_3945.accum_stats.general.ttl_timestamp =
		il->_3945.stats.general.ttl_timestamp;
}
#endif

void il3945_hw_rx_statistics(struct il_priv *il,
void il3945_hw_rx_stats(struct il_priv *il,
		struct il_rx_buf *rxb)
{
	struct il_rx_pkt *pkt = rxb_addr(rxb);

	D_RX("Statistics notification received (%d vs %d).\n",
		     (int)sizeof(struct il3945_notif_statistics),
		     (int)sizeof(struct il3945_notif_stats),
		     le32_to_cpu(pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK);
#ifdef CONFIG_IWLEGACY_DEBUGFS
	il3945_accumulative_statistics(il, (__le32 *)&pkt->u.raw);
	il3945_accumulative_stats(il, (__le32 *)&pkt->u.raw);
#endif

	memcpy(&il->_3945.statistics, pkt->u.raw, sizeof(il->_3945.statistics));
	memcpy(&il->_3945.stats, pkt->u.raw, sizeof(il->_3945.stats));
}

void il3945_reply_statistics(struct il_priv *il,
void il3945_reply_stats(struct il_priv *il,
			      struct il_rx_buf *rxb)
{
	struct il_rx_pkt *pkt = rxb_addr(rxb);
@@ -418,16 +418,16 @@ void il3945_reply_statistics(struct il_priv *il,

	if (le32_to_cpu(*flag) & UCODE_STATISTICS_CLEAR_MSK) {
#ifdef CONFIG_IWLEGACY_DEBUGFS
		memset(&il->_3945.accum_statistics, 0,
			sizeof(struct il3945_notif_statistics));
		memset(&il->_3945.delta_statistics, 0,
			sizeof(struct il3945_notif_statistics));
		memset(&il->_3945.accum_stats, 0,
			sizeof(struct il3945_notif_stats));
		memset(&il->_3945.delta_stats, 0,
			sizeof(struct il3945_notif_stats));
		memset(&il->_3945.max_delta, 0,
			sizeof(struct il3945_notif_statistics));
			sizeof(struct il3945_notif_stats));
#endif
		D_RX("Statistics have been cleared\n");
	}
	il3945_hw_rx_statistics(il, rxb);
	il3945_hw_rx_stats(il, rxb);
}


@@ -437,7 +437,7 @@ void il3945_reply_statistics(struct il_priv *il,
 *
 ******************************************************************************/

/* This is necessary only for a number of statistics, see the caller. */
/* This is necessary only for a number of stats, see the caller. */
static int il3945_is_network_packet(struct il_priv *il,
		struct ieee80211_hdr *header)
{
+3 −3
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ extern const struct pci_device_id il3945_hw_card_ids[];

/* Default noise level to report when noise measurement is not available.
 *   This may be because we're:
 *   1)  Not associated (4965, no beacon statistics being sent to driver)
 *   1)  Not associated (4965, no beacon stats being sent to driver)
 *   2)  Scanning (noise measurement does not apply to associated channel)
 *   3)  Receiving CCK (3945 delivers noise info only for OFDM frames)
 * Use default noise value of -127 ... this is below the range of measurable
@@ -258,9 +258,9 @@ void il3945_hw_build_tx_cmd_rate(struct il_priv *il,
				  int sta_id, int tx_id);
extern int il3945_hw_reg_send_txpower(struct il_priv *il);
extern int il3945_hw_reg_set_txpower(struct il_priv *il, s8 power);
extern void il3945_hw_rx_statistics(struct il_priv *il,
extern void il3945_hw_rx_stats(struct il_priv *il,
				 struct il_rx_buf *rxb);
void il3945_reply_statistics(struct il_priv *il,
void il3945_reply_stats(struct il_priv *il,
			      struct il_rx_buf *rxb);
extern void il3945_disable_events(struct il_priv *il);
extern int il4965_get_temperature(const struct il_priv *il);
+18 −18
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@
 * INIT calibrations framework
 *****************************************************************************/

struct statistics_general_data {
struct stats_general_data {
	u32 beacon_silence_rssi_a;
	u32 beacon_silence_rssi_b;
	u32 beacon_silence_rssi_c;
@@ -106,7 +106,7 @@ void il4965_calib_free_results(struct il_priv *il)
static int il4965_sens_energy_cck(struct il_priv *il,
				   u32 norm_fa,
				   u32 rx_enable_time,
				   struct statistics_general_data *rx_info)
				   struct stats_general_data *rx_info)
{
	u32 max_nrg_cck = 0;
	int i = 0;
@@ -509,10 +509,10 @@ void il4965_sensitivity_calibration(struct il_priv *il, void *resp)
	u32 norm_fa_ofdm;
	u32 norm_fa_cck;
	struct il_sensitivity_data *data = NULL;
	struct statistics_rx_non_phy *rx_info;
	struct statistics_rx_phy *ofdm, *cck;
	struct stats_rx_non_phy *rx_info;
	struct stats_rx_phy *ofdm, *cck;
	unsigned long flags;
	struct statistics_general_data statis;
	struct stats_general_data statis;

	if (il->disable_sens_cal)
		return;
@@ -526,9 +526,9 @@ void il4965_sensitivity_calibration(struct il_priv *il, void *resp)

	spin_lock_irqsave(&il->lock, flags);

	rx_info = &(((struct il_notif_statistics *)resp)->rx.general);
	ofdm = &(((struct il_notif_statistics *)resp)->rx.ofdm);
	cck = &(((struct il_notif_statistics *)resp)->rx.cck);
	rx_info = &(((struct il_notif_stats *)resp)->rx.general);
	ofdm = &(((struct il_notif_stats *)resp)->rx.ofdm);
	cck = &(((struct il_notif_stats *)resp)->rx.cck);

	if (rx_info->interference_data_flag != INTERFERENCE_DATA_AVAILABLE) {
		D_CALIB("<< invalid data.\n");
@@ -565,9 +565,9 @@ void il4965_sensitivity_calibration(struct il_priv *il, void *resp)
		return;
	}

	/* These statistics increase monotonically, and do not reset
	/* These stats increase monotonically, and do not reset
	 *   at each beacon.  Calculate difference from last value, or just
	 *   use the new statistics value if it has reset or wrapped around. */
	 *   use the new stats value if it has reset or wrapped around. */
	if (data->last_bad_plcp_cnt_cck > bad_plcp_cck)
		data->last_bad_plcp_cnt_cck = bad_plcp_cck;
	else {
@@ -793,7 +793,7 @@ static void il4965_gain_computation(struct il_priv *il,


/*
 * Accumulate 16 beacons of signal and noise statistics for each of
 * Accumulate 16 beacons of signal and noise stats for each of
 *   3 receivers/antennas/rx-chains, then figure out:
 * 1)  Which antennas are connected.
 * 2)  Differential rx gain settings to balance the 3 receivers.
@@ -818,7 +818,7 @@ void il4965_chain_noise_calibration(struct il_priv *il, void *stat_resp)
	u8 rxon_band24;
	u8 stat_band24;
	unsigned long flags;
	struct statistics_rx_non_phy *rx_info;
	struct stats_rx_non_phy *rx_info;

	struct il_rxon_context *ctx = &il->ctx;

@@ -839,7 +839,7 @@ void il4965_chain_noise_calibration(struct il_priv *il, void *stat_resp)

	spin_lock_irqsave(&il->lock, flags);

	rx_info = &(((struct il_notif_statistics *)stat_resp)->
	rx_info = &(((struct il_notif_stats *)stat_resp)->
		      rx.general);

	if (rx_info->interference_data_flag != INTERFERENCE_DATA_AVAILABLE) {
@@ -851,10 +851,10 @@ void il4965_chain_noise_calibration(struct il_priv *il, void *stat_resp)
	rxon_band24 = !!(ctx->staging.flags & RXON_FLG_BAND_24G_MSK);
	rxon_chnum = le16_to_cpu(ctx->staging.channel);

	stat_band24 = !!(((struct il_notif_statistics *)
	stat_band24 = !!(((struct il_notif_stats *)
			 stat_resp)->flag &
			 STATISTICS_REPLY_FLG_BAND_24G_MSK);
	stat_chnum = le32_to_cpu(((struct il_notif_statistics *)
	stat_chnum = le32_to_cpu(((struct il_notif_stats *)
				 stat_resp)->flag) >> 16;

	/* Make sure we accumulate data for just the associated channel
@@ -867,7 +867,7 @@ void il4965_chain_noise_calibration(struct il_priv *il, void *stat_resp)
	}

	/*
	 *  Accumulate beacon statistics values across
	 *  Accumulate beacon stats values across
	 * "chain_noise_num_beacons"
	 */
	chain_noise_a = le32_to_cpu(rx_info->beacon_silence_rssi_a) &
@@ -960,7 +960,7 @@ void il4965_reset_run_time_calib(struct il_priv *il)
		il->chain_noise_data.delta_gain_code[i] =
				CHAIN_NOISE_DELTA_GAIN_INIT_VAL;

	/* Ask for statistics now, the uCode will send notification
	/* Ask for stats now, the uCode will send notification
	 * periodically after association */
	il_send_statistics_request(il, CMD_ASYNC, true);
	il_send_stats_request(il, CMD_ASYNC, true);
}
Loading