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

Commit c04b29c0 authored by Ahmad Masri's avatar Ahmad Masri Committed by Maya Erez
Browse files

wil6210: support up to 20 stations in AP mode



New FW added support for upto 20 clients in AP mode. Change the driver
to support this as well. FW reports it's max supported associations in
WMI_READY_EVENT. Some WMI commands/events use cidxtid field which is
limited to 16 cids. Use new cid/tid fields instead.

For Rx packets cid from rx descriptor is limited to 3 bits (0..7),
to find the real cid, compare transmitter address with the stored
stations mac address in the driver sta array.

EDMA FW still supports 8 stations. Extending the support to 20
stations will come later.

Signed-off-by: default avatarAhmad Masri <amasri@codeaurora.org>
Signed-off-by: default avatarMaya Erez <merez@codeaurora.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Git-commit: bf0353a67491c220189ec2ce598d0f54af0e9c17
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git


[merez@codeaurora.org: SPDX license conflict]
Change-Id: I081a73e5aa791292957a55a0e1ecd8f508daa57d
Signed-off-by: default avatarMaya Erez <merez@codeaurora.org>
parent 0645469a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -658,7 +658,7 @@ static int wil_find_cid_by_idx(struct wil6210_priv *wil, u8 mid, int idx)
{
	int i;

	for (i = 0; i < ARRAY_SIZE(wil->sta); i++) {
	for (i = 0; i < max_assoc_sta; i++) {
		if (wil->sta[i].status == wil_sta_unused)
			continue;
		if (wil->sta[i].mid != mid)
@@ -3390,7 +3390,7 @@ static int wil_rf_sector_set_selected(struct wiphy *wiphy,
			wil, vif->mid, WMI_INVALID_RF_SECTOR_INDEX,
			sector_type, WIL_CID_ALL);
		if (rc == -EINVAL) {
			for (i = 0; i < WIL6210_MAX_CID; i++) {
			for (i = 0; i < max_assoc_sta; i++) {
				if (wil->sta[i].mid != vif->mid)
					continue;
				rc = wil_rf_sector_wmi_set_selected(
+10 −10
Original line number Diff line number Diff line
@@ -151,7 +151,7 @@ static int wil_ring_debugfs_show(struct seq_file *s, void *data)

			snprintf(name, sizeof(name), "tx_%2d", i);

			if (cid < WIL6210_MAX_CID)
			if (cid < max_assoc_sta)
				seq_printf(s,
					   "\n%pM CID %d TID %d 1x%s BACK([%u] %u TU A%s) [%3d|%3d] idle %s\n",
					   wil->sta[cid].addr, cid, tid,
@@ -844,14 +844,14 @@ static ssize_t wil_write_back(struct file *file, const char __user *buf,
				"BACK: del_rx require at least 2 params\n");
			return -EINVAL;
		}
		if (p1 < 0 || p1 >= WIL6210_MAX_CID) {
		if (p1 < 0 || p1 >= max_assoc_sta) {
			wil_err(wil, "BACK: invalid CID %d\n", p1);
			return -EINVAL;
		}
		if (rc < 4)
			p3 = WLAN_REASON_QSTA_LEAVE_QBSS;
		sta = &wil->sta[p1];
		wmi_delba_rx(wil, sta->mid, mk_cidxtid(p1, p2), p3);
		wmi_delba_rx(wil, sta->mid, p1, p2, p3);
	} else {
		wil_err(wil, "BACK: Unrecognized command \"%s\"\n", cmd);
		return -EINVAL;
@@ -1330,7 +1330,7 @@ static int wil_bf_debugfs_show(struct seq_file *s, void *data)

	memset(&reply, 0, sizeof(reply));

	for (i = 0; i < ARRAY_SIZE(wil->sta); i++) {
	for (i = 0; i < max_assoc_sta; i++) {
		u32 status;

		cmd.cid = i;
@@ -1460,7 +1460,7 @@ static int wil_link_debugfs_show(struct seq_file *s, void *data)
	if (!sinfo)
		return -ENOMEM;

	for (i = 0; i < ARRAY_SIZE(wil->sta); i++) {
	for (i = 0; i < max_assoc_sta; i++) {
		struct wil_sta_info *p = &wil->sta[i];
		char *status = "unknown";
		struct wil6210_vif *vif;
@@ -1684,7 +1684,7 @@ __acquires(&p->tid_rx_lock) __releases(&p->tid_rx_lock)
	struct wil6210_priv *wil = s->private;
	int i, tid, mcs;

	for (i = 0; i < ARRAY_SIZE(wil->sta); i++) {
	for (i = 0; i < max_assoc_sta; i++) {
		struct wil_sta_info *p = &wil->sta[i];
		char *status = "unknown";
		u8 aid = 0;
@@ -1815,7 +1815,7 @@ __acquires(&p->tid_rx_lock) __releases(&p->tid_rx_lock)
	struct wil6210_priv *wil = s->private;
	int i, bin;

	for (i = 0; i < ARRAY_SIZE(wil->sta); i++) {
	for (i = 0; i < max_assoc_sta; i++) {
		struct wil_sta_info *p = &wil->sta[i];
		char *status = "unknown";
		u8 aid = 0;
@@ -1904,7 +1904,7 @@ static ssize_t wil_tx_latency_write(struct file *file, const char __user *buf,
		size_t sz = sizeof(u64) * WIL_NUM_LATENCY_BINS;

		wil->tx_latency_res = val;
		for (i = 0; i < ARRAY_SIZE(wil->sta); i++) {
		for (i = 0; i < max_assoc_sta; i++) {
			struct wil_sta_info *sta = &wil->sta[i];

			kfree(sta->tx_latency_bins);
@@ -1989,7 +1989,7 @@ static void wil_link_stats_debugfs_show_vif(struct wil6210_vif *vif,
	}

	seq_printf(s, "TSF %lld\n", vif->fw_stats_tsf);
	for (i = 0; i < ARRAY_SIZE(wil->sta); i++) {
	for (i = 0; i < max_assoc_sta; i++) {
		if (wil->sta[i].status == wil_sta_unused)
			continue;
		if (wil->sta[i].mid != vif->mid)
@@ -2605,7 +2605,7 @@ void wil6210_debugfs_remove(struct wil6210_priv *wil)
	wil->debug = NULL;

	kfree(wil->dbg_data.data_arr);
	for (i = 0; i < ARRAY_SIZE(wil->sta); i++)
	for (i = 0; i < max_assoc_sta; i++)
		kfree(wil->sta[i].tx_latency_bins);

	/* free pmc memory without sending command to fw, as it will
+4 −4
Original line number Diff line number Diff line
@@ -230,7 +230,7 @@ static bool wil_vif_is_connected(struct wil6210_priv *wil, u8 mid)
{
	int i;

	for (i = 0; i < WIL6210_MAX_CID; i++) {
	for (i = 0; i < max_assoc_sta; i++) {
		if (wil->sta[i].mid == mid &&
		    wil->sta[i].status == wil_sta_connected)
			return true;
@@ -334,7 +334,7 @@ static void _wil6210_disconnect_complete(struct wil6210_vif *vif,
			wil_disconnect_cid_complete(vif, cid, reason_code);
	} else { /* all */
		wil_dbg_misc(wil, "Disconnect complete all\n");
		for (cid = 0; cid < WIL6210_MAX_CID; cid++)
		for (cid = 0; cid < max_assoc_sta; cid++)
			wil_disconnect_cid_complete(vif, cid, reason_code);
	}

@@ -448,7 +448,7 @@ static void _wil6210_disconnect(struct wil6210_vif *vif, const u8 *bssid,
			wil_disconnect_cid(vif, cid, reason_code);
	} else { /* all */
		wil_dbg_misc(wil, "Disconnect all\n");
		for (cid = 0; cid < WIL6210_MAX_CID; cid++)
		for (cid = 0; cid < max_assoc_sta; cid++)
			wil_disconnect_cid(vif, cid, reason_code);
	}

@@ -1959,7 +1959,7 @@ int wil_find_cid(struct wil6210_priv *wil, u8 mid, const u8 *mac)
	int i;
	int rc = -ENOENT;

	for (i = 0; i < ARRAY_SIZE(wil->sta); i++) {
	for (i = 0; i < max_assoc_sta; i++) {
		if (wil->sta[i].mid == mid &&
		    wil->sta[i].status != wil_sta_unused &&
		    ether_addr_equal(wil->sta[i].addr, mac)) {
+3 −5
Original line number Diff line number Diff line
@@ -296,8 +296,8 @@ static u16 wil_agg_size(struct wil6210_priv *wil, u16 req_agg_wsize)
}

/* Block Ack - Rx side (recipient) */
int wil_addba_rx_request(struct wil6210_priv *wil, u8 mid,
			 u8 cidxtid, u8 dialog_token, __le16 ba_param_set,
int wil_addba_rx_request(struct wil6210_priv *wil, u8 mid, u8 cid, u8 tid,
			 u8 dialog_token, __le16 ba_param_set,
			 __le16 ba_timeout, __le16 ba_seq_ctrl)
__acquires(&sta->tid_rx_lock) __releases(&sta->tid_rx_lock)
{
@@ -305,7 +305,6 @@ __acquires(&sta->tid_rx_lock) __releases(&sta->tid_rx_lock)
	u16 agg_timeout = le16_to_cpu(ba_timeout);
	u16 seq_ctrl = le16_to_cpu(ba_seq_ctrl);
	struct wil_sta_info *sta;
	u8 cid, tid;
	u16 agg_wsize = 0;
	/* bit 0: A-MSDU supported
	 * bit 1: policy (should be 0 for us)
@@ -324,10 +323,9 @@ __acquires(&sta->tid_rx_lock) __releases(&sta->tid_rx_lock)
	int rc = 0;

	might_sleep();
	parse_cidxtid(cidxtid, &cid, &tid);

	/* sanity checks */
	if (cid >= WIL6210_MAX_CID) {
	if (cid >= max_assoc_sta) {
		wil_err(wil, "BACK: invalid CID %d\n", cid);
		rc = -EINVAL;
		goto out;
+2 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2016 Qualcomm Atheros, Inc.
 * Copyright (c) 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
@@ -181,7 +182,7 @@ TRACE_EVENT(wil6210_rx,
		__entry->seq = wil_rxdesc_seq(d);
		__entry->mcs = wil_rxdesc_mcs(d);
	),
	TP_printk("index %d len %d mid %d cid %d tid %d mcs %d seq 0x%03x"
	TP_printk("index %d len %d mid %d cid (%%8) %d tid %d mcs %d seq 0x%03x"
		  " type 0x%1x subtype 0x%1x", __entry->index, __entry->len,
		  __entry->mid, __entry->cid, __entry->tid, __entry->mcs,
		  __entry->seq, __entry->type, __entry->subtype)
Loading