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

Commit f51c69ff authored by Alexei Avshalom Lazar's avatar Alexei Avshalom Lazar
Browse files

wil6210: force EDMG channel through debugfs



Force EDMG (Enhanced Directional Multi-Gigabit) channel through debugfs
for debugging channel bonding feature.

Usage: echo <EDMG_CH> > force_edmg_channel

When force_edmg_channel is set, it will be used in connect and PCP start
commands.

Change-Id: Ia1e12cb8cf730dbb448fae47b40dfa11053567d0
Signed-off-by: default avatarAlexei Avshalom Lazar <ailizaro@codeaurora.org>
Signed-off-by: default avatarMaya Erez <merez@codeaurora.org>
[liord@codeaurora.org: fix merge conflicts, SPDX license]
Signed-off-by: default avatarLior David <liord@codeaurora.org>
parent 283c1dcd
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1510,6 +1510,16 @@ static int wil_cfg80211_connect(struct wiphy *wiphy,
	if (rc < 0)
		return rc;

	if (test_bit(WMI_FW_CAPABILITY_CHANNEL_BONDING, wil->fw_capabilities))
		if (wil->force_edmg_channel) {
			rc = wil_spec2wmi_ch(wil->force_edmg_channel,
					     &conn.edmg_channel);
			if (rc)
				wil_err(wil,
					"wmi channel for channel %d not found",
					wil->force_edmg_channel);
		}

	ether_addr_copy(conn.bssid, bss->bssid);
	ether_addr_copy(conn.dst_mac, bss->bssid);

+2 −12
Original line number Diff line number Diff line
// SPDX-License-Identifier: ISC
/*
 * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
 * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#include <linux/module.h>
@@ -2454,6 +2443,7 @@ static const struct dbg_off dbg_wil_off[] = {
	WIL_FIELD(tx_status_ring_order, 0644,	doff_u32),
	WIL_FIELD(rx_buff_id_count, 0644,	doff_u32),
	WIL_FIELD(amsdu_en, 0644,	doff_u8),
	WIL_FIELD(force_edmg_channel, 0644,	doff_u8),
	{},
};

+4 −0
Original line number Diff line number Diff line
@@ -1017,6 +1017,7 @@ struct wil6210_priv {
	u8 wakeup_trigger;
	struct wil_suspend_stats suspend_stats;
	struct wil_debugfs_data dbg_data;
	u8 force_edmg_channel;
	bool tx_latency; /* collect TX latency measurements */
	size_t tx_latency_res; /* bin resolution in usec */

@@ -1469,6 +1470,9 @@ int wil_wmi2spec_ch(u8 wmi_ch, u8 *spec_ch);
int wil_spec2wmi_ch(u8 spec_ch, u8 *wmi_ch);
void wil_update_supported_bands(struct wil6210_priv *wil);

int wil_wmi2spec_ch(u8 wmi_ch, u8 *spec_ch);
int wil_spec2wmi_ch(u8 spec_ch, u8 *wmi_ch);

int reverse_memcmp(const void *cs, const void *ct, size_t count);

/* WMI for enhanced DMA */
+21 −2
Original line number Diff line number Diff line
@@ -974,6 +974,7 @@ static void wmi_evt_connect(struct wil6210_vif *vif, int id, void *d, int len)
	struct wireless_dev *wdev = vif_to_wdev(vif);
	struct wmi_connect_event *evt = d;
	int ch; /* channel number */
	u8 spec_ch = 0; /* spec channel number */
	struct station_info *sinfo;
	u8 *assoc_req_ie, *assoc_resp_ie;
	size_t assoc_req_ielen, assoc_resp_ielen;
@@ -1001,8 +1002,16 @@ static void wmi_evt_connect(struct wil6210_vif *vif, int id, void *d, int len)
	}

	ch = evt->channel + 1;
	if (evt->edmg_channel &&
	    test_bit(WMI_FW_CAPABILITY_CHANNEL_BONDING, wil->fw_capabilities))
		wil_wmi2spec_ch(evt->edmg_channel, &spec_ch);
	if (spec_ch)
		wil_info(wil, "Connect %pM EDMG channel [%d] primary channel [%d] cid %d aid %d\n",
			 evt->bssid, spec_ch, ch, evt->cid, evt->aid);
	else
		wil_info(wil, "Connect %pM channel [%d] cid %d aid %d\n",
			 evt->bssid, ch, evt->cid, evt->aid);

	wil_hex_dump_wmi("connect AI : ", DUMP_PREFIX_OFFSET, 16, 1,
			 evt->assoc_info, len - sizeof(*evt), true);

@@ -2247,6 +2256,16 @@ int wmi_pcp_start(struct wil6210_vif *vif, int bi, u8 wmi_nettype,
		.evt = {.status = WMI_FW_STATUS_FAILURE},
	};

	if (test_bit(WMI_FW_CAPABILITY_CHANNEL_BONDING, wil->fw_capabilities))
		if (wil->force_edmg_channel) {
			rc = wil_spec2wmi_ch(wil->force_edmg_channel,
					     &cmd.edmg_channel);
			if (rc)
				wil_err(wil,
					"wmi channel for channel %d not found",
					wil->force_edmg_channel);
		}

	if (!vif->privacy)
		cmd.disable_sec = 1;