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

Commit 22050706 authored by Ashish Kumar Dhanotiya's avatar Ashish Kumar Dhanotiya Committed by snandini
Browse files

qcacld-3.0: Update rssi on connect big data logging

Currently driver does not update rssi on connect, driver
only updates rssi on get_station command. If driver does
not receive get_station command between connect and disconnect
in that case driver will send invalid rssi value to userspace
as part of the big data logging command.
For example, in current scenario if station is connected to an ap
and if this station moves away which will change the rssi and
finally it will result in disconnect because of low rssi, at this
time rssi value stored in driver will be the value corresponding
to the last connection(low rssi). Now if this station connects to
some other ap and this connection fails at EAPOL so for this
connection driver will not receive any get station command and
it will not update rssi corresponding to the second ap and when
driver receives big data stats command it will give incorrect rssi
value of previous ap (low rssi).

To address above issue update rssi in host driver at connect
time also.

Change-Id: Ieac4b42033e8ad011e36384b0cd52a2c1f0a352e
CRs-Fixed: 2798813
parent 66fc012d
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -3026,6 +3026,7 @@ hdd_association_completion_handler(struct hdd_adapter *adapter,
	struct net_device *dev = adapter->dev;
	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
	struct hdd_station_ctx *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
	int8_t snr = 0;
	QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE;
	uint8_t *reqRsnIe;
	uint32_t reqRsnLength = DOT11F_IE_RSN_MAX_LEN, ie_len;
@@ -3049,6 +3050,23 @@ hdd_association_completion_handler(struct hdd_adapter *adapter,
		return QDF_STATUS_E_NULL_VALUE;
	}

	hdd_get_rssi_snr_by_bssid(adapter, sta_ctx->conn_info.bssid.bytes,
				  &adapter->rssi, &snr);

	/* If RSSi is reported as positive then it is invalid */
	if (adapter->rssi > 0) {
		hdd_debug_rl("RSSI invalid %d", adapter->rssi);
		adapter->rssi = 0;
	}

	hdd_debug("snr: %d, rssi: %d", snr, adapter->rssi);

	sta_ctx->conn_info.signal = adapter->rssi;
	sta_ctx->conn_info.noise =
		sta_ctx->conn_info.signal - snr;
	sta_ctx->cache_conn_info.signal = sta_ctx->conn_info.signal;
	sta_ctx->cache_conn_info.noise = sta_ctx->conn_info.noise;

	/*
	 * reset scan reject params if connection is success or we received
	 * final failure from CSR after trying with all APs.