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

Commit 3e0fa505 authored by Assaf Krauss's avatar Assaf Krauss Committed by Luca Coelho
Browse files

iwlwifi: mvm: Fix tof debugfs formats (dec vs. hex)



Make some input formats more natural, e.g. bandwidth and periods
are more natural in decimal than in hexadecimal.

Signed-off-by: default avatarAssaf Krauss <assaf.krauss@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent bb743609
Loading
Loading
Loading
Loading
+21 −19
Original line number Original line Diff line number Diff line
@@ -913,11 +913,11 @@ static ssize_t iwl_dbgfs_tof_range_request_write(struct ieee80211_vif *vif,
		u8 *mac = ap.bssid;
		u8 *mac = ap.bssid;
		unsigned int i;
		unsigned int i;


		if (sscanf(data, "%u %hhd %hhx %hhx"
		if (sscanf(data, "%u %hhd %hhd %hhd"
			   "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx"
			   "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx"
			   "%hhx %hhx %hx"
			   "%hhd %hhd %hd"
			   "%hhx %hhx %x"
			   "%hhd %hhd %d"
			   "%hhx %hhx %hhx %hhx",
			   "%hhx %hhd %hhd %hhd",
			   &i, &ap.channel_num, &ap.bandwidth,
			   &i, &ap.channel_num, &ap.bandwidth,
			   &ap.ctrl_ch_position,
			   &ap.ctrl_ch_position,
			   mac, mac + 1, mac + 2, mac + 3, mac + 4, mac + 5,
			   mac, mac + 1, mac + 2, mac + 3, mac + 4, mac + 5,
@@ -994,16 +994,18 @@ static ssize_t iwl_dbgfs_tof_range_request_read(struct file *file,
		struct iwl_tof_range_req_ap_entry *ap = &cmd->ap[i];
		struct iwl_tof_range_req_ap_entry *ap = &cmd->ap[i];


		pos += scnprintf(buf + pos, bufsz - pos,
		pos += scnprintf(buf + pos, bufsz - pos,
				"ap %.2d: channel_num=%hhx bw=%hhx"
				"ap %.2d: channel_num=%hhd bw=%hhd"
				" control=%hhx bssid=%pM type=%hhx"
				" control=%hhd bssid=%pM type=%hhd"
				" num_of_bursts=%hhx burst_period=%hx ftm=%hhx"
				" num_of_bursts=%hhd burst_period=%hd ftm=%hhd"
				" retries=%hhx tsf_delta=%x location_req=%hhx "
				" retries=%hhd tsf_delta=%d"
				" asap=%hhx enable=%hhx rssi=%hhx\n",
				" tsf_delta_direction=%hhd location_req=0x%hhx "
				" asap=%hhd enable=%hhd rssi=%hhd\n",
				i, ap->channel_num, ap->bandwidth,
				i, ap->channel_num, ap->bandwidth,
				ap->ctrl_ch_position, ap->bssid,
				ap->ctrl_ch_position, ap->bssid,
				ap->measure_type, ap->num_of_bursts,
				ap->measure_type, ap->num_of_bursts,
				ap->burst_period, ap->samples_per_burst,
				ap->burst_period, ap->samples_per_burst,
				ap->retries_per_sample, ap->tsf_delta,
				ap->retries_per_sample, ap->tsf_delta,
				ap->tsf_delta_direction,
				ap->location_req, ap->asap_mode,
				ap->location_req, ap->asap_mode,
				ap->enable_dyn_ack, ap->rssi);
				ap->enable_dyn_ack, ap->rssi);
	}
	}
@@ -1099,18 +1101,18 @@ static ssize_t iwl_dbgfs_tof_range_req_ext_read(struct file *file,
	mutex_lock(&mvm->mutex);
	mutex_lock(&mvm->mutex);


	pos += scnprintf(buf + pos, bufsz - pos,
	pos += scnprintf(buf + pos, bufsz - pos,
			 "tsf_timer_offset_msec = %hx\n",
			 "tsf_timer_offset_msec = %hd\n",
			 cmd->tsf_timer_offset_msec);
			 cmd->tsf_timer_offset_msec);
	pos += scnprintf(buf + pos, bufsz - pos, "min_delta_ftm = %hhx\n",
	pos += scnprintf(buf + pos, bufsz - pos, "min_delta_ftm = %hhd\n",
			 cmd->min_delta_ftm);
			 cmd->min_delta_ftm);
	pos += scnprintf(buf + pos, bufsz - pos,
	pos += scnprintf(buf + pos, bufsz - pos,
			 "ftm_format_and_bw20M = %hhx\n",
			 "ftm_format_and_bw20M = %hhd\n",
			 cmd->ftm_format_and_bw20M);
			 cmd->ftm_format_and_bw20M);
	pos += scnprintf(buf + pos, bufsz - pos,
	pos += scnprintf(buf + pos, bufsz - pos,
			 "ftm_format_and_bw40M = %hhx\n",
			 "ftm_format_and_bw40M = %hhd\n",
			 cmd->ftm_format_and_bw40M);
			 cmd->ftm_format_and_bw40M);
	pos += scnprintf(buf + pos, bufsz - pos,
	pos += scnprintf(buf + pos, bufsz - pos,
			 "ftm_format_and_bw80M = %hhx\n",
			 "ftm_format_and_bw80M = %hhd\n",
			 cmd->ftm_format_and_bw80M);
			 cmd->ftm_format_and_bw80M);


	mutex_unlock(&mvm->mutex);
	mutex_unlock(&mvm->mutex);
@@ -1205,11 +1207,11 @@ static ssize_t iwl_dbgfs_tof_range_response_read(struct file *file,
		struct iwl_tof_range_rsp_ap_entry_ntfy *ap = &cmd->ap[i];
		struct iwl_tof_range_rsp_ap_entry_ntfy *ap = &cmd->ap[i];


		pos += scnprintf(buf + pos, bufsz - pos,
		pos += scnprintf(buf + pos, bufsz - pos,
				"ap %.2d: bssid=%pM status=%hhx bw=%hhx"
				"ap %.2d: bssid=%pM status=%hhd bw=%hhd"
				" rtt=%x rtt_var=%x rtt_spread=%x"
				" rtt=%d rtt_var=%d rtt_spread=%d"
				" rssi=%hhx  rssi_spread=%hhx"
				" rssi=%hhd  rssi_spread=%hhd"
				" range=%x range_var=%x"
				" range=%d range_var=%d"
				" time_stamp=%x\n",
				" time_stamp=%d\n",
				i, ap->bssid, ap->measure_status,
				i, ap->bssid, ap->measure_status,
				ap->measure_bw,
				ap->measure_bw,
				ap->rtt, ap->rtt_variance, ap->rtt_spread,
				ap->rtt, ap->rtt_variance, ap->rtt_spread,