Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp272423rdb; Thu, 21 Dec 2023 08:44:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IEr8fdKy/GYCkBxKkd8/L8z/HwHO2V1FOqABtLEq7+I5COauqYla/0wtBT6kQ3q9jdWFMj2 X-Received: by 2002:ac8:5ac8:0:b0:427:867b:85c1 with SMTP id d8-20020ac85ac8000000b00427867b85c1mr3870545qtd.122.1703177059954; Thu, 21 Dec 2023 08:44:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703177059; cv=none; d=google.com; s=arc-20160816; b=r/HPW8T+Lc6vtT50LMHu5oHJERHO4VvOmipR6ykUwlU6EW+sYgy0mEsAGxKjq+fjPo cklsCY0wM7DP0B3/oQY2JrQoOfcnP7U86Z1yES4qgAkdT7iZOigi6n95SHSp/2sjkTH2 w+0ULEe32GELcWfNs0vIS4w8Nf8NICyATNA4/DoOGvUjrU67TIPepW0c2l9zUaC4c+TB JWymj4QhgzxWJxZAVUMzum0rNzRLK0BqSZ/NNy4OQj/5U+ew4DZzxCZXRhs/lJma88px iNpb6ET6nvA3j6o5usnnp0PNJQC3GBL7LIizcM2M4WdGl4YAkNVW3mhZWnBtTkYMPKNT AiDw== 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=Fk7Kko4B9PudLljWtuEpsME8A5xybPiUqopIYUAP8Co=; fh=KsoNWtazjfstHns8t6UZ1pulwZL69aEO39vRs0LPvyo=; b=PBObsvJMxlKv1GhkbGhnIkDiSZKRySu0oA5SXZ6YZVNJr1U4A/dmm5PWJ3JxUNa7Pt v7vyPwLyVEwzvRjmog2kNkSU7Ln6bpw1MKrihhR+Z3tHaqMxjIc29iwS/7uM4hgFXC64 p8IgcORIqLQlOO0j/rvsTrR4xjOF7hTwOyu8sTNsJ2fOBdddT+8kgC+0l+yJJphgG+5P mtRyklfG3o915tcx6FFEjL9CzOTs7clC7dEQvGMuzNNOn+eXyEg+sFyz7oKZMvFsvbHW z3Wu5nsTBPJBpb0nrkS22N9G0B3Q28wQpYCFaLR0UNgdOF/riWVS8g3S9CiOrfCI3vAg GrSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ehR82CWT; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-wireless+bounces-1152-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1152-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h15-20020ac85e0f000000b0042790d5bf24si2538166qtx.771.2023.12.21.08.44.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 08:44:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1152-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ehR82CWT; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-wireless+bounces-1152-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1152-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id AE9141C25A86 for ; Thu, 21 Dec 2023 16:44:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6DF3558211; Thu, 21 Dec 2023 16:44:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ehR82CWT"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="KPGdEM8E" 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 05DC955E73 for ; Thu, 21 Dec 2023 16:44:10 +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=1703177042; 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=Fk7Kko4B9PudLljWtuEpsME8A5xybPiUqopIYUAP8Co=; b=ehR82CWTDO+W+39fktCuhSCHx4jLryJRdjboJdY11fnf6lCIyq1FbsKqnhPbMfPms4nKol F5uJzoGJt8lFR2lRZHYhblxvEq7StfrTW6C6ZIad99yC56c3F800go3GPs+9sulJEYxfO5 zbqn1JcUcUW6JH/dCmet0Tld07WTu1GaLUrpaEY7nO/I8hyS3Ad155wgAXGc0LO250LRxP zR29pCZuUUVu41IIYevIh7m98hCwl8ADRc2J1Cv3AzyNdll3DXZynC7PboJJ9dI1oeHPMN WaR5hTO2CPwTEDxl7rjfKJ1A1QXWYPETSbAF2e2LRy6W08WvezS4Vn4Iq06kUg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1703177042; 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=Fk7Kko4B9PudLljWtuEpsME8A5xybPiUqopIYUAP8Co=; b=KPGdEM8EuuJlxeKMSsEyZUgZf5UkZuBdeIhuoMi4Bl7+h9H1G6jHujCGlWLWpz1w3BInz2 Q7djI+TXDI5i+HBw== To: linux-wireless@vger.kernel.org Cc: Jes Sorensen , Kalle Valo , Ping-Ke Shih , Bitterblue Smith , Sebastian Andrzej Siewior Subject: [PATCH v2 02/21] wifi: rtl8xxxu: prepare supporting two virtual interfaces Date: Thu, 21 Dec 2023 17:43:34 +0100 Message-Id: <20231221164353.603258-3-martin.kaistra@linutronix.de> In-Reply-To: <20231221164353.603258-1-martin.kaistra@linutronix.de> References: <20231221164353.603258-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 Reviewed-by: Ping-Ke Shih --- 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