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

Commit 7f6c562d authored by Hante Meuleman's avatar Hante Meuleman Committed by John W. Linville
Browse files

brcmfmac: fix get rssi by clearing getvar struct.



The function brcmf_cfg80211_get_station requests the RSSI from
the device. The complete structure used needs to be cleared
before sending the request to firmware. Otherwise the request
fails filling the logs with "Could not get rssi (-2)" messages.

Reviewed-by: default avatarArend Van Spriel <arend@broadcom.com>
Reviewed-by: default avatarFranky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: default avatarHante Meuleman <meuleman@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 2e875acd
Loading
Loading
Loading
Loading
+8 −7
Original line number Original line Diff line number Diff line
@@ -1876,17 +1876,18 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *ndev,
	}
	}


	if (test_bit(WL_STATUS_CONNECTED, &cfg_priv->status)) {
	if (test_bit(WL_STATUS_CONNECTED, &cfg_priv->status)) {
		scb_val.val = cpu_to_le32(0);
		memset(&scb_val, 0, sizeof(scb_val));
		err = brcmf_exec_dcmd(ndev, BRCMF_C_GET_RSSI, &scb_val,
		err = brcmf_exec_dcmd(ndev, BRCMF_C_GET_RSSI, &scb_val,
				      sizeof(struct brcmf_scb_val_le));
				      sizeof(struct brcmf_scb_val_le));
		if (err)
		if (err) {
			WL_ERR("Could not get rssi (%d)\n", err);
			WL_ERR("Could not get rssi (%d)\n", err);

		} else {
			rssi = le32_to_cpu(scb_val.val);
			rssi = le32_to_cpu(scb_val.val);
			sinfo->filled |= STATION_INFO_SIGNAL;
			sinfo->filled |= STATION_INFO_SIGNAL;
			sinfo->signal = rssi;
			sinfo->signal = rssi;
			WL_CONN("RSSI %d dBm\n", rssi);
			WL_CONN("RSSI %d dBm\n", rssi);
		}
		}
	}


done:
done:
	WL_TRACE("Exit\n");
	WL_TRACE("Exit\n");