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

Commit 8d4be323 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge changes...

Merge changes Idd374f80,Ife1863b0,I091a6b61,I3962487b,I3f86f231,I4220c551,Ia46fe269,I7afcf86a,I6990cc0e,Ic1084f0b into msm-next

* changes:
  wil6210: add ioctl interface
  wil6210: drop RX probe reponses with low SNR
  wil6210: add sysfs for setting connect SNR threshold
  wil6210: support AOA in FTM session
  wil6210: potential buffer overflow in wmi_evt_aoa_meas
  wil6210: send uevent when creating sysfs files
  wil6210: add option to ignore OTA regulatory hints
  wil6210: add sysfs file for enable/disable fst link loss
  wil6210: add sysfs for thermal throttling configuration
  wil6210: NOC time-out fixes
parents 0b843134 7603b2b6
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -52,3 +52,14 @@ config WIL6210_DEBUGFS
	  option if you are interested in debugging the driver.

	  If unsure, say Y to make it easier to debug problems.

config WIL6210_WRITE_IOCTL
	bool "wil6210 write ioctl to the device"
	depends on WIL6210
	default y
	---help---
	  Say Y here to allow write-access from user-space to
	  the device memory through ioctl. This is useful for
	  debugging purposes only.

	  If unsure, say N.
+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ wil6210-y += interrupt.o
wil6210-y += txrx.o
wil6210-y += debug.o
wil6210-y += rx_reorder.o
wil6210-y += ioctl.o
wil6210-y += fw.o
wil6210-y += pm.o
wil6210-y += pmc.o
+9 −0
Original line number Diff line number Diff line
@@ -33,6 +33,10 @@ static struct wiphy_wowlan_support wil_wowlan_support = {
};
#endif

static bool ignore_reg_hints = true;
module_param(ignore_reg_hints, bool, 0444);
MODULE_PARM_DESC(ignore_reg_hints, " Ignore OTA regulatory hints (Default: true)");

#define CHAN60G(_channel, _flags) {				\
	.band			= NL80211_BAND_60GHZ,		\
	.center_freq		= 56160 + (2160 * (_channel)),	\
@@ -1886,6 +1890,11 @@ static void wil_wiphy_init(struct wiphy *wiphy)
	wiphy->vendor_events = wil_nl80211_vendor_events;
	wiphy->n_vendor_events = ARRAY_SIZE(wil_nl80211_vendor_events);

	if (ignore_reg_hints) {
		wiphy->regulatory_flags |= REGULATORY_DISABLE_BEACON_HINTS;
		wiphy->regulatory_flags |= REGULATORY_COUNTRY_IE_IGNORE;
	}

#ifdef CONFIG_PM
	wiphy->wowlan = &wil_wowlan_support;
#endif
+39 −6
Original line number Diff line number Diff line
@@ -38,6 +38,9 @@
/* initial token to use on non-secure FTM measurement */
#define WIL_TOF_FTM_DEFAULT_INITIAL_TOKEN	2

/* maximum AOA burst period, limited by FW */
#define WIL_AOA_MAX_BURST_PERIOD	255

#define WIL_TOF_FTM_MAX_LCI_LENGTH		(240)
#define WIL_TOF_FTM_MAX_LCR_LENGTH		(240)

@@ -62,6 +65,7 @@ nla_policy wil_nl80211_ftm_peer_policy[
	[QCA_WLAN_VENDOR_ATTR_FTM_PEER_MEAS_FLAGS] = { .type = NLA_U32 },
	[QCA_WLAN_VENDOR_ATTR_FTM_PEER_MEAS_PARAMS] = { .type = NLA_NESTED },
	[QCA_WLAN_VENDOR_ATTR_FTM_PEER_SECURE_TOKEN_ID] = { .type = NLA_U8 },
	[QCA_WLAN_VENDOR_ATTR_FTM_PEER_AOA_BURST_PERIOD] = { .type = NLA_U16 },
	[QCA_WLAN_VENDOR_ATTR_FTM_PEER_FREQ] = { .type = NLA_U32 },
};

@@ -315,8 +319,8 @@ wil_ftm_cfg80211_start_session(struct wil6210_priv *wil,
	struct wmi_tof_session_start_cmd *cmd;

	mutex_lock(&wil->ftm.lock);
	if (wil->ftm.session_started) {
		wil_err(wil, "FTM session already running\n");
	if (wil->ftm.session_started || wil->ftm.aoa_started) {
		wil_err(wil, "FTM or AOA session already running\n");
		rc = -EAGAIN;
		goto out;
	}
@@ -360,6 +364,7 @@ wil_ftm_cfg80211_start_session(struct wil6210_priv *wil,
	}

	cmd->session_id = cpu_to_le32(WIL_FTM_FW_SESSION_ID);
	cmd->aoa_type = request->aoa_type;
	cmd->num_of_dest = cpu_to_le16(request->n_peers);
	for (i = 0; i < request->n_peers; i++) {
		ether_addr_copy(cmd->ftm_dest_info[i].dst_mac,
@@ -402,6 +407,8 @@ wil_ftm_cfg80211_start_session(struct wil6210_priv *wil,
			request->peers[i].params.burst_duration;
		cmd->ftm_dest_info[i].burst_period =
			cpu_to_le16(request->peers[i].params.burst_period);
		cmd->ftm_dest_info[i].num_burst_per_aoa_meas =
			request->peers[i].aoa_burst_period;
	}

	rc = wmi_send(wil, WMI_TOF_SESSION_START_CMDID, cmd, cmd_len);
@@ -487,8 +494,8 @@ wil_aoa_cfg80211_start_measurement(struct wil6210_priv *wil,

	mutex_lock(&wil->ftm.lock);

	if (wil->ftm.aoa_started) {
		wil_err(wil, "AOA measurement already running\n");
	if (wil->ftm.aoa_started || wil->ftm.session_started) {
		wil_err(wil, "AOA or FTM measurement already running\n");
		rc = -EAGAIN;
		goto out;
	}
@@ -529,8 +536,8 @@ void wil_aoa_cfg80211_meas_result(struct wil6210_priv *wil,

	mutex_lock(&wil->ftm.lock);

	if (!wil->ftm.aoa_started) {
		wil_info(wil, "AOA not started, not sending result\n");
	if (!wil->ftm.aoa_started && !wil->ftm.session_started) {
		wil_info(wil, "AOA/FTM not started, not sending result\n");
		goto out;
	}

@@ -683,6 +690,10 @@ void wil_aoa_evt_meas(struct wil6210_priv *wil,
	int data_len = len - offsetof(struct wmi_aoa_meas_event, meas_data);
	struct wil_aoa_meas_result *res;

	if (data_len < 0) {
		wil_err(wil, "AOA event too short (%d)\n", len);
		return;
	}
	data_len = min_t(int, le16_to_cpu(evt->length), data_len);

	res = kmalloc(sizeof(*res) + data_len, GFP_KERNEL);
@@ -754,6 +765,7 @@ int wil_ftm_start_session(struct wiphy *wiphy, struct wireless_dev *wdev,
	struct nlattr *tb2[QCA_WLAN_VENDOR_ATTR_FTM_PEER_MAX + 1];
	struct nlattr *peer;
	int rc, n_peers = 0, index = 0, tmp;
	u32 aoa_type = 0;

	if (!test_bit(WMI_FW_CAPABILITY_FTM, wil->fw_capabilities))
		return -ENOTSUPP;
@@ -775,6 +787,14 @@ int wil_ftm_start_session(struct wiphy *wiphy, struct wireless_dev *wdev,
		return -EINVAL;
	}

	if (tb[QCA_WLAN_VENDOR_ATTR_AOA_TYPE]) {
		aoa_type = nla_get_u32(tb[QCA_WLAN_VENDOR_ATTR_AOA_TYPE]);
		if (aoa_type >= QCA_WLAN_VENDOR_ATTR_AOA_TYPE_MAX) {
			wil_err(wil, "invalid AOA type: %d\n", aoa_type);
			return -EINVAL;
		}
	}

	nla_for_each_nested(peer, tb[QCA_WLAN_VENDOR_ATTR_FTM_MEAS_PEERS],
			    tmp)
		n_peers++;
@@ -798,6 +818,7 @@ int wil_ftm_start_session(struct wiphy *wiphy, struct wireless_dev *wdev,

	request->session_cookie =
		nla_get_u64(tb[QCA_WLAN_VENDOR_ATTR_FTM_SESSION_COOKIE]);
	request->aoa_type = aoa_type;
	request->n_peers = n_peers;
	nla_for_each_nested(peer, tb[QCA_WLAN_VENDOR_ATTR_FTM_MEAS_PEERS],
			    tmp) {
@@ -826,6 +847,18 @@ int wil_ftm_start_session(struct wiphy *wiphy, struct wireless_dev *wdev,
		if (tb2[QCA_WLAN_VENDOR_ATTR_FTM_PEER_SECURE_TOKEN_ID])
			request->peers[index].secure_token_id = nla_get_u8(
			   tb2[QCA_WLAN_VENDOR_ATTR_FTM_PEER_SECURE_TOKEN_ID]);
		if (tb2[QCA_WLAN_VENDOR_ATTR_FTM_PEER_AOA_BURST_PERIOD]) {
			request->peers[index].aoa_burst_period = nla_get_u16(
			  tb2[QCA_WLAN_VENDOR_ATTR_FTM_PEER_AOA_BURST_PERIOD]);
			if (request->peers[index].aoa_burst_period >
			    WIL_AOA_MAX_BURST_PERIOD) {
				wil_err(wil, "Invalid AOA burst period at index: %d\n",
					index);
				rc = -EINVAL;
				goto out;
			}
		}

		rc = wil_ftm_parse_meas_params(
			wil,
			tb2[QCA_WLAN_VENDOR_ATTR_FTM_PEER_MEAS_PARAMS],
+2 −0
Original line number Diff line number Diff line
@@ -437,12 +437,14 @@ struct wil_ftm_meas_peer_info {
	u32 flags; /* enum qca_wlan_vendor_attr_ftm_peer_meas_flags */
	struct wil_ftm_meas_params params;
	u8 secure_token_id;
	u16 aoa_burst_period; /* 0 if no AOA, >0 every <value> bursts */
};

/* session request, passed to wil_ftm_cfg80211_start_session */
struct wil_ftm_session_request {
	u64 session_cookie;
	u32 n_peers;
	u32 aoa_type; /* enum qca_wlan_vendor_attr_aoa_type */
	/* keep last, variable size according to n_peers */
	struct wil_ftm_meas_peer_info peers[0];
};
Loading