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

Commit 1442cc9a authored by Dedy Lansky's avatar Dedy Lansky Committed by Lior David
Browse files

wil6210: drop RX probe reponses with low SNR



FW now reports SNR for RX management frames.
Drop probe responses with SNR lower than the configured threshold.

Change-Id: Ife1863b07aebe5cb6097420290c0c10b590c2da1
Signed-off-by: default avatarDedy Lansky <dlansky@codeaurora.org>
CRs-Fixed: 2143032
Signed-off-by: default avatarAlexei Avshalom Lazar <ailizaro@codeaurora.org>
[liord@codeaurora.org: fix merge conflicts]
Signed-off-by: default avatarLior David <liord@codeaurora.org>
parent 027a0c85
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -777,7 +777,7 @@ static void wmi_evt_rx_mgmt(struct wil6210_vif *vif, int id, void *d, int len)
	s32 signal;
	__le16 fc;
	u32 d_len;
	u16 d_status;
	s16 snr;

	if (flen < 0) {
		wil_err(wil, "MGMT Rx: short event, len %d\n", len);
@@ -799,13 +799,13 @@ static void wmi_evt_rx_mgmt(struct wil6210_vif *vif, int id, void *d, int len)
		signal = 100 * data->info.rssi;
	else
		signal = data->info.sqi;
	d_status = le16_to_cpu(data->info.status);
	snr = le16_to_cpu(data->info.snr); /* 1/4 dB units */
	fc = rx_mgmt_frame->frame_control;

	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,
	wil_dbg_wmi(wil, "snr %ddB len %d fc 0x%04x\n", snr / 4, d_len,
		    le16_to_cpu(fc));
	wil_dbg_wmi(wil, "qid %d mid %d cid %d\n",
		    data->info.qid, data->info.mid, data->info.cid);
@@ -833,6 +833,11 @@ static void wmi_evt_rx_mgmt(struct wil6210_vif *vif, int id, void *d, int len)

		wil_dbg_wmi(wil, "Capability info : 0x%04x\n", cap);

		if (wil->snr_thresh.enabled && snr < wil->snr_thresh.omni) {
			wil_dbg_wmi(wil, "snr below threshold. dropping\n");
			return;
		}

		bss = cfg80211_inform_bss_frame(wiphy, channel, rx_mgmt_frame,
						d_len, signal, GFP_KERNEL);
		if (bss) {
+1 −1
Original line number Diff line number Diff line
@@ -2369,7 +2369,7 @@ struct wmi_rx_mgmt_info {
	u8 range;
	u8 sqi;
	__le16 stype;
	__le16 status;
	__le16 snr;
	__le32 len;
	/* Not resolved when == 0xFFFFFFFF == > Broadcast to all MIDS */
	u8 qid;