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

Commit b3f87385 authored by Dedy Lansky's avatar Dedy Lansky Committed by Maya Erez
Browse files

wil6210: support FW RSSI reporting



New FW supports reporting RSSI signal in dBm.
Report RSSI to kernel in case FW has this capability.

Change-Id: I85fdae2e92a38cfb7ab9a5f97dcf363add51b959
Signed-off-by: default avatarDedy Lansky <qca_dlansky@qca.qualcomm.com>
Signed-off-by: default avatarMaya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
Git-commit: 30868f5d4413759ba82c0703290f2483402fea39
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git


Signed-off-by: default avatarMaya Erez <merez@codeaurora.org>
parent 1d9aee75
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -350,12 +350,12 @@ int wil_cid_fill_sinfo(struct wil6210_priv *wil, int cid,

	wil_dbg_wmi(wil, "Link status for CID %d: {\n"
		    "  MCS %d TSF 0x%016llx\n"
		    "  BF status 0x%08x SNR 0x%08x SQI %d%%\n"
		    "  BF status 0x%08x RSSI %d SQI %d%%\n"
		    "  Tx Tpt %d goodput %d Rx goodput %d\n"
		    "  Sectors(rx:tx) my %d:%d peer %d:%d\n""}\n",
		    cid, le16_to_cpu(reply.evt.bf_mcs),
		    le64_to_cpu(reply.evt.tsf), reply.evt.status,
		    le32_to_cpu(reply.evt.snr_val),
		    reply.evt.rssi,
		    reply.evt.sqi,
		    le32_to_cpu(reply.evt.tx_tpt),
		    le32_to_cpu(reply.evt.tx_goodput),
@@ -389,6 +389,10 @@ int wil_cid_fill_sinfo(struct wil6210_priv *wil, int cid,

	if (test_bit(wil_status_fwconnected, wil->status)) {
		sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
		if (test_bit(WMI_FW_CAPABILITY_RSSI_REPORTING,
			     wil->fw_capabilities))
			sinfo->signal = reply.evt.rssi;
		else
			sinfo->signal = reply.evt.sqi;
	}

@@ -1875,7 +1879,7 @@ static void wil_wiphy_init(struct wiphy *wiphy)

	wiphy->bands[NL80211_BAND_60GHZ] = &wil_band_60ghz;

	/* TODO: figure this out */
	/* may change after reading FW capabilities */
	wiphy->signal_type = CFG80211_SIGNAL_TYPE_UNSPEC;

	wiphy->cipher_suites = wil_cipher_suites;
+2 −0
Original line number Diff line number Diff line
@@ -1021,6 +1021,7 @@ static int wil_bf_debugfs_show(struct seq_file *s, void *data)
			   "  TSF = 0x%016llx\n"
			   "  TxMCS = %2d TxTpt = %4d\n"
			   "  SQI = %4d\n"
			   "  RSSI = %4d\n"
			   "  Status = 0x%08x %s\n"
			   "  Sectors(rx:tx) my %2d:%2d peer %2d:%2d\n"
			   "  Goodput(rx:tx) %4d:%4d\n"
@@ -1030,6 +1031,7 @@ static int wil_bf_debugfs_show(struct seq_file *s, void *data)
			   le16_to_cpu(reply.evt.bf_mcs),
			   le32_to_cpu(reply.evt.tx_tpt),
			   reply.evt.sqi,
			   reply.evt.rssi,
			   status, wil_bfstatus_str(status),
			   le16_to_cpu(reply.evt.my_rx_sector),
			   le16_to_cpu(reply.evt.my_tx_sector),
+3 −0
Original line number Diff line number Diff line
@@ -84,6 +84,9 @@ void wil_set_capabilities(struct wil6210_priv *wil)

	/* extract FW capabilities from file without loading the FW */
	wil_request_firmware(wil, wil->wil_fw_name, false);

	if (test_bit(WMI_FW_CAPABILITY_RSSI_REPORTING, wil->fw_capabilities))
		wil_to_wiphy(wil)->signal_type = CFG80211_SIGNAL_TYPE_MBM;
}

void wil_disable_irq(struct wil6210_priv *wil)
+6 −3
Original line number Diff line number Diff line
@@ -382,12 +382,15 @@ static void wmi_evt_rx_mgmt(struct wil6210_priv *wil, int id, void *d, int len)
	ch_no = data->info.channel + 1;
	freq = ieee80211_channel_to_frequency(ch_no, NL80211_BAND_60GHZ);
	channel = ieee80211_get_channel(wiphy, freq);
	if (test_bit(WMI_FW_CAPABILITY_RSSI_REPORTING, wil->fw_capabilities))
		signal = 100 * data->info.rssi;
	else
		signal = data->info.sqi;
	d_status = le16_to_cpu(data->info.status);
	fc = rx_mgmt_frame->frame_control;

	wil_dbg_wmi(wil, "MGMT Rx: channel %d MCS %d SNR %d SQI %d%%\n",
		    data->info.channel, data->info.mcs, data->info.snr,
	wil_dbg_wmi(wil, "MGMT Rx: channel %d MCS %d RSSI %d SQI %d%%\n",
		    data->info.channel, data->info.mcs, data->info.rssi,
		    data->info.sqi);
	wil_dbg_wmi(wil, "status 0x%04x len %d fc 0x%04x\n", d_status, d_len,
		    le16_to_cpu(fc));
+4 −2
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@ enum wmi_fw_capability {
	WMI_FW_CAPABILITY_WMI_ONLY		= 5,
	WMI_FW_CAPABILITY_THERMAL_THROTTLING	= 7,
	WMI_FW_CAPABILITY_D3_SUSPEND		= 8,
	WMI_FW_CAPABILITY_RSSI_REPORTING	= 12,
	WMI_FW_CAPABILITY_MAX,
};

@@ -1306,7 +1307,8 @@ struct wmi_notify_req_done_event {
	/* beamforming status, 0: fail; 1: OK; 2: retrying */
	__le32 status;
	__le64 tsf;
	__le32 snr_val;
	s8 rssi;
	u8 reserved0[3];
	__le32 tx_tpt;
	__le32 tx_goodput;
	__le32 rx_goodput;
@@ -1602,7 +1604,7 @@ struct wmi_get_ssid_event {
/* wmi_rx_mgmt_info */
struct wmi_rx_mgmt_info {
	u8 mcs;
	s8 snr;
	s8 rssi;
	u8 range;
	u8 sqi;
	__le16 stype;