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

Commit 039432d3 authored by Dedy Lansky's avatar Dedy Lansky Committed by Alexei Avshalom Lazar
Browse files

wil6210: support IPA offload



Add support for data path IPA offload in AP mode. Highlights of IPA
offload mode:
Upon start_ap, wil6210 registers with IPA driver and passes Rx ring
info. Upon client connect, wil6210 notifies IPA driver and passes Tx
ring info.
Rx and Tx rings are allocated by wil6210 and later processed by IPA
uC and GSI.
Tx broadcast ring is not offloaded and is processed by wil6210 using
polling timer.
Two Tx status rings are used - one for all unicast and another for
broadcast.
MSI is routed to IPA uC. IPA handles Rx/Tx interrupts. MISC interrupt
is routed back from IPA uC to wil6210 using callback function.

New module param ipa_offload controls this feature, disabled by
default.

Change-Id: I9169401342a9478ca9aa032e8c96b13031778e3a
Signed-off-by: default avatarDedy Lansky <dlansky@codeaurora.org>
Signed-off-by: default avatarAlexei Avshalom Lazar <ailizaro@codeaurora.org>
parent ba429541
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -53,3 +53,12 @@ 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_IPA
	bool "wil6210 IPA offload support"
	depends on WIL6210
	depends on ARCH_QCOM
	default y
	help
	  Say Y here to enable wil6210 driver support for data path
	  IPA offload
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ wil6210-y += ethtool.o
wil6210-y += wil_crash_dump.o
wil6210-y += p2p.o
wil6210-y += ftm.o
wil6210-$(CONFIG_WIL6210_IPA) += ipa.o

# for tracing framework to find trace.h
CFLAGS_trace.o := -I$(src)
+31 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@
#include "wmi.h"
#include "ftm.h"
#include "fw.h"
#include "ipa.h"

#define WIL_MAX_ROC_DURATION_MS 5000
#define WIL_BRD_SUFFIX_CN "CN"
@@ -2161,7 +2162,22 @@ static int _wil_cfg80211_start_ap(struct wiphy *wiphy,
	mutex_lock(&wil->mutex);

	if (!wil_has_other_active_ifaces(wil, ndev, true, false)) {
		if (wil->ipa_handle) {
			wil_ipa_uninit(wil->ipa_handle);
			wil->ipa_handle = NULL;
		}

		__wil_down(wil);

		if (wil_ipa_offload()) {
			wil->ipa_handle = wil_ipa_init(wil);
			if (!wil->ipa_handle) {
				wil_err(wil, "wil_ipa_init failed\n");
				rc = -ENOMEM;
				goto out;
			}
		}

		rc = __wil_up(wil);
		if (rc)
			goto out;
@@ -2184,6 +2200,12 @@ static int _wil_cfg80211_start_ap(struct wiphy *wiphy,
	memcpy(vif->ssid, ssid, ssid_len);
	vif->ssid_len = ssid_len;

	if (wil->ipa_handle) {
		rc = wil_ipa_start_ap(wil->ipa_handle);
		if (rc)
			goto out;
	}

	netif_carrier_on(ndev);
	if (!wil_has_other_active_ifaces(wil, ndev, false, true))
		wil6210_bus_request(wil, WIL_MAX_BUS_REQUEST_KBPS);
@@ -2206,6 +2228,11 @@ static int _wil_cfg80211_start_ap(struct wiphy *wiphy,
	if (!wil_has_other_active_ifaces(wil, ndev, false, true))
		wil6210_bus_request(wil, WIL_DEFAULT_BUS_REQUEST_KBPS);
out:
	if (rc && wil->ipa_handle) {
		wil_ipa_uninit(wil->ipa_handle);
		wil->ipa_handle = NULL;
	}

	mutex_unlock(&wil->mutex);
	return rc;
}
@@ -2396,6 +2423,10 @@ static int wil_cfg80211_stop_ap(struct wiphy *wiphy,
	memset(vif->gtk, 0, WMI_MAX_KEY_LEN);
	vif->gtk_len = 0;

	if (wil->ipa_handle) {
		wil_ipa_uninit(wil->ipa_handle);
		wil->ipa_handle = NULL;
	}
	if (last)
		__wil_down(wil);
	else
+5 −2
Original line number Diff line number Diff line
@@ -224,6 +224,9 @@ void wil_configure_interrupt_moderation_edma(struct wil6210_priv *wil)
	/* Update RX and TX moderation */
	moderation = wil->rx_max_burst_duration |
		(WIL_EDMA_AGG_WATERMARK << WIL_EDMA_AGG_WATERMARK_POS);
	if (wil->ipa_handle)
		/* additional int per client, for Tx desc ring */
		num_int_lines += max_assoc_sta;
	for (i = 0; i < num_int_lines; i++)
		wil_w(wil, i * 4 + RGF_INT_CTRL_INT_GEN_CFG, moderation);

@@ -531,7 +534,7 @@ static bool wil_validate_mbox_regs(struct wil6210_priv *wil)
	return true;
}

static irqreturn_t wil6210_irq_misc(int irq, void *cookie)
irqreturn_t wil6210_irq_misc(int irq, void *cookie)
{
	struct wil6210_priv *wil = cookie;
	u32 isr;
@@ -600,7 +603,7 @@ static irqreturn_t wil6210_irq_misc(int irq, void *cookie)
	}
}

static irqreturn_t wil6210_irq_misc_thread(int irq, void *cookie)
irqreturn_t wil6210_irq_misc_thread(int irq, void *cookie)
{
	struct wil6210_priv *wil = cookie;
	u32 isr = wil->isr_misc;
+982 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading