Received: by 2002:a05:7412:a9a3:b0:f9:327e:43ab with SMTP id o35csp138263rdh; Mon, 18 Dec 2023 06:37:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IFbtwYz4FgGkT06Lh3CBGuMxAJIvN9MrYNBvVgQESx1zc2N4lt6TjgfnpnwohDGH7WORKOG X-Received: by 2002:a17:907:9408:b0:a01:9d8b:db17 with SMTP id dk8-20020a170907940800b00a019d8bdb17mr11422611ejc.15.1702910243328; Mon, 18 Dec 2023 06:37:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702910243; cv=none; d=google.com; s=arc-20160816; b=H7rRQV4LlniTyXjhJdo6MDCr0NboobkUHDThO9OHsKBYa+6Lt/F8mYj+wR/ej31e67 VsY/EkhPtbzOlmE6ayhUuAS5ApdkgMyPV5mAn9fxcrOymdPS9t+9ME6lVMmBzo9DvMR5 9ua9DT4/qWTZcV0+QApnJKUv0tVRtxmujJtpYLUgbqfWAkSAVFlqJmOmoigWr7qSXXBG dcP93dHNaSvMrPFPxH/c+JBOutaerdO2CerUaUz4oLZyaPh+nb3XSmJPqf+zKQOpWIVq UGwjC377/LRKLxRRfooOZ5eoPWwdt+CWVAJB3SVFBB5pCK9bDtYWvin/Y07SHcxoSSsu JC4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:dkim-signature:dkim-signature:from; bh=+/9bjab4Pb/DvS+T4bTTKjNF+6+c/Gp5dxRtBRfAUz8=; fh=KsoNWtazjfstHns8t6UZ1pulwZL69aEO39vRs0LPvyo=; b=V4I+U7Xa4WpJWSesraQH+mJylJKHPPWeJYMIhzyJojiOqTrW0GYckUS+04MEV81YN+ tWLz6liNPovoRBVq0jKdXMxIm5iGb4MreCy/769j5qeN4G1Qrepm1HoNn3abmPqPCSjA 7iUowSvFDlNezmhoXb15zJJBG+OZfL42FvzXdgS5zWm6nCp+4w7UHmygYXebJjTM2+WF dsT6gyR8qAXdGmoq2j+ukcTwYCIrBeWiqBdOTnG44ZhN1Ml3619Nl2LXfyKl1RU007Hf tfDPLwNCY/jFoYp8HZJ8mWcs0w86AQ91W0gmL2bVYqevCphx/kNJpTEM+ssn7L0O9m6W lPwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=R5KDsR1t; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=INtMqkuv; spf=pass (google.com: domain of linux-wireless+bounces-913-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-913-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id jt11-20020a170906dfcb00b00a23513c830asi1170001ejc.1042.2023.12.18.06.37.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 06:37:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-913-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=R5KDsR1t; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=INtMqkuv; spf=pass (google.com: domain of linux-wireless+bounces-913-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-913-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7BE4B1F23E39 for ; Mon, 18 Dec 2023 14:37:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F19363788C; Mon, 18 Dec 2023 14:37:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="R5KDsR1t"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="INtMqkuv" X-Original-To: linux-wireless@vger.kernel.org Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6CC983786A for ; Mon, 18 Dec 2023 14:37:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Martin Kaistra DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1702910227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+/9bjab4Pb/DvS+T4bTTKjNF+6+c/Gp5dxRtBRfAUz8=; b=R5KDsR1tA2uz3WNkTLgftZGrCKdlwUX70/XwMCFcxa2kPlMLFIZcvhrBRG1gtOM4VMuABa aahg4utE+4MOHsgMd2n3LIMD1PUArEEOkMU8c7O1hw8W6pr4y/yfoTuD6dVl5MMpmXrLHV juE2/faTeuLBKIduUD5zVRIgzxT6erC2wfMpzS8gLHbamYDr0jucXsBourMoSPUgAtvza1 k7qkF5p2PKHVIKEIMTkJP+jEIuRgD1hc8z7XVi/j9k7RD7NConkoNOEyfHilrYqvLbiPDs KDEtFaYCog50wOOq529BztXEULqKXEeFXw2Pgw/44ervpG3TD0BoEoyYgigRGw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1702910227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+/9bjab4Pb/DvS+T4bTTKjNF+6+c/Gp5dxRtBRfAUz8=; b=INtMqkuvE/aOnzLfhw8IHPceq3+dnnZDNdYSRRzjFJ5sC0LX2EnNIl5voXGFH4iSjz7Wqn 8Q1t8t13ZFG3NBDw== To: linux-wireless@vger.kernel.org Cc: Jes Sorensen , Kalle Valo , Ping-Ke Shih , Bitterblue Smith , Sebastian Andrzej Siewior Subject: [PATCH 02/20] wifi: rtl8xxxu: prepare supporting two virtual interfaces Date: Mon, 18 Dec 2023 15:36:27 +0100 Message-Id: <20231218143645.433356-3-martin.kaistra@linutronix.de> In-Reply-To: <20231218143645.433356-1-martin.kaistra@linutronix.de> References: <20231218143645.433356-1-martin.kaistra@linutronix.de> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To prepare for concurrent mode, add an array ("vifs") to rtl8xxxu_priv to keep track of both interfaces. Keep the old priv->vif as long there are still users of it and let priv->vifs[0] point to the same location. Signed-off-by: Martin Kaistra --- drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 2 ++ drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h index 4695fb4e2d2db..b63fe084de92b 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h @@ -1897,6 +1897,8 @@ struct rtl8xxxu_priv { * is supported and no iface_combinations are provided. */ struct ieee80211_vif *vif; + + struct ieee80211_vif *vifs[2]; struct delayed_work ra_watchdog; struct work_struct c2hcmd_work; struct sk_buff_head c2hcmd_queue; diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c index 2dbed43ef22a5..5b7c20970a973 100644 --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c @@ -6569,10 +6569,12 @@ static int rtl8xxxu_add_interface(struct ieee80211_hw *hw, int ret; u8 val8; - if (!priv->vif) + if (!priv->vif) { priv->vif = vif; - else + priv->vifs[0] = vif; + } else { return -EOPNOTSUPP; + } switch (vif->type) { case NL80211_IFTYPE_STATION: @@ -6622,8 +6624,10 @@ static void rtl8xxxu_remove_interface(struct ieee80211_hw *hw, dev_dbg(&priv->udev->dev, "%s\n", __func__); - if (priv->vif) + if (priv->vif) { priv->vif = NULL; + priv->vifs[0] = NULL; + } } static int rtl8xxxu_config(struct ieee80211_hw *hw, u32 changed) -- 2.39.2