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

Commit 77a29a8c authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "wil6210: support IPA offload"

parents 4f529614 039432d3
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)
+50 −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"
@@ -139,6 +140,8 @@ enum wil_nl_60g_evt_type {

enum wil_nl_60g_debug_cmd {
	NL_60G_DBG_FORCE_WMI_SEND,
	NL_60G_GEN_RADAR_ALLOC_BUFFER,
	NL_60G_GEN_FW_RESET,
};

struct wil_nl_60g_send_receive_wmi {
@@ -2159,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;
@@ -2182,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);
@@ -2204,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;
}
@@ -2394,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
@@ -3707,6 +3740,23 @@ static int wil_nl_60g_handle_cmd(struct wiphy *wiphy, struct wireless_dev *wdev,
			wil_dbg_wmi(wil, "force sending wmi commands %d\n",
				    wil->force_wmi_send);
			break;
		case NL_60G_GEN_FW_RESET:
			if (!test_bit(WMI_FW_CAPABILITY_WMI_ONLY,
				      wil->fw_capabilities)) {
				rc = -EOPNOTSUPP;
				break;
			}

			wil_dbg_misc(wil,
				     "NL_60G_GEN_FW_RESET, resetting...\n");

			mutex_lock(&wil->mutex);
			down_write(&wil->mem_lock);
			rc = wil_reset(wil, true);
			up_write(&wil->mem_lock);
			mutex_unlock(&wil->mutex);

			break;
		default:
			rc = -EINVAL;
			wil_err(wil, "invalid debug_cmd id %d",
+10 −17
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/interrupt.h>
@@ -44,7 +33,7 @@
				    (~(BIT_DMA_EP_RX_ICR_RX_HTRSH)))
#define WIL6210_IMC_TX		(BIT_DMA_EP_TX_ICR_TX_DONE | \
				BIT_DMA_EP_TX_ICR_TX_DONE_N(0))
#define WIL6210_IMC_TX_EDMA		BIT_TX_STATUS_IRQ
#define WIL6210_IMC_TX_EDMA		(0xFFFFFFFFUL)
#define WIL6210_IMC_RX_EDMA		BIT_RX_STATUS_IRQ
#define WIL6210_IMC_MISC_NO_HALP	(ISR_MISC_FW_READY | \
					 ISR_MISC_MBOX_EVT | \
@@ -226,6 +215,7 @@ void wil_unmask_irq(struct wil6210_priv *wil)
void wil_configure_interrupt_moderation_edma(struct wil6210_priv *wil)
{
	u32 moderation;
	int i, num_int_lines = 2 /* Rx + Tx status */;

	wil_s(wil, RGF_INT_GEN_IDLE_TIME_LIMIT, WIL_EDMA_IDLE_TIME_LIMIT_USEC);

@@ -234,8 +224,11 @@ 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);
	wil_w(wil, RGF_INT_CTRL_INT_GEN_CFG_0, moderation);
	wil_w(wil, RGF_INT_CTRL_INT_GEN_CFG_1, moderation);
	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);

	/* Treat special events as regular
	 * (set bit 0 to 0x1 and clear bits 1-8)
@@ -541,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;
@@ -610,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