Received: by 2002:ab2:6f44:0:b0:1fd:c486:4f03 with SMTP id l4csp130121lqq; Wed, 12 Jun 2024 20:05:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUMqmvi2hdpJjft+OMYM6qv9PeFI7aUELM0xeOZn05x2n1tool9P5+v/ni6AzU/nE5L67pkzziFvsRinFcil44kTdfwxsYRvr8egMuSnw== X-Google-Smtp-Source: AGHT+IErZ0LHLV6u/7Omsk2u5rZgJy1KMHumwDADCyxtQ3OXn3CyyW35ct4sKGgnUsMGWYbu/hnq X-Received: by 2002:a17:906:540a:b0:a6f:5165:fee7 with SMTP id a640c23a62f3a-a6f51660122mr89736766b.51.1718247941787; Wed, 12 Jun 2024 20:05:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718247941; cv=pass; d=google.com; s=arc-20160816; b=TcdR9cHu+j7A+/Wp7hjE3PIzVh5rCF7dCEMHEWjiWSE/ugb1JF6jGgPj4MJr9Ee+27 Q5zkkB9SObxqIUxwkTsXVTsbKyrbIMEKnEhi/OA0BuU5NYEmHy7z2up3RkYCLWcxGEkF NalUFUX3F3n2jU5Wgo+ZBfPruObCdTuV8JribT6NzdmNqHVl8MCEJh+GE/esliVCLc7x u8PYQa8D2J1Who2Om9J5ySmR7M95FJbFy+tMbTR9wXchFXGQzVaQW5U4d8TEwjj1Mu8P LcDXoSZHPGHaMomFABJURHmHxcDJgBe6rW15Y/7M43QtoEG1gpl371uxrZN7XgEXpK/D Wxsg== ARC-Message-Signature: i=2; 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:from; bh=MnZF05g1ossfZRm0FvsZx86VQptBSn3TL85vtMAglhw=; fh=dJOMhT+hsItJ4Yy38sjYcrsiS4636A5AZd7IPCfYoXI=; b=VG78Ed3zzcKTxiGK+4Aw3/5T/2z9F/gr2bSyA1Hdy93Pa0UpNFq1vMFryecCItkFAH vHm8zOzPL7BoCSWhgrZ3tpZ9UtLrkoORe1hxY1bObZBgTAoNw4vmzxYpMYN4FKb/GYbZ xmSnA9/KWwSsAIgY7QPI6Hb+ZZo7TpnhpIxKa0pyBDjiMdLLgy9RKscrtEL9P8Kw6vcD DptHK/XMpi1GDD8iMRWv3nHD4bR1jYX+YCI7Hkw5w0S0sBflTgesENgc63S4tdvZAv8N ZmV/0pj91OzWlwUaCzhTLZ9RYEj8m4ZjXQglVSHLozIPjOqLCJuS6ArjDaWBSa0tqZs/ Ii4Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-wireless+bounces-8953-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8953-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f56e812f1si19895466b.987.2024.06.12.20.05.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 20:05:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-8953-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; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-wireless+bounces-8953-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8953-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 566A41F22877 for ; Thu, 13 Jun 2024 03:05:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EF64612DD94; Thu, 13 Jun 2024 03:04:16 +0000 (UTC) X-Original-To: linux-wireless@vger.kernel.org Received: from mail-oo1-f50.google.com (mail-oo1-f50.google.com [209.85.161.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 85A0C132135 for ; Thu, 13 Jun 2024 03:04:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718247856; cv=none; b=m/O9YQxavFjhBK+1XQpsT8G1z1Q6tvDVaRn//qXLooqjCjbDLVRgAxpTQOHpXN33txKI47EdJiidSgQ8ZPl/DoaglG4kaAohjgOdmNdw+O3XdFVtVCvxmLdcKJHbDeaAU2vIhdTjdm5cwcHCmna9htRdJi6XbU7Dvnv3p+m9DI0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718247856; c=relaxed/simple; bh=yhpkMIYrrA8Cesx7a4+xLw+yb7LcyFCA4OPY69Kju1E=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=W6KeMyYYpeMsbJJ9IPy5iT+a5TFpcWsUQxo+lQt4qW5+P0WrTUnLl5FMIe4iqYYDHG0G/eMfA4f/s5sr38OL4voDB8ukNofy549iI0QX4kgMWrjdqcjx0+0POeutN0+2TcUzm2qu4tTFIt/9cRXhs5i5xrKt7REcEaWx3uMhZ6U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.161.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oo1-f50.google.com with SMTP id 006d021491bc7-5bb10cfe7daso36901eaf.2 for ; Wed, 12 Jun 2024 20:04:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718247855; x=1718852655; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MnZF05g1ossfZRm0FvsZx86VQptBSn3TL85vtMAglhw=; b=EtTGaYBrSPFgqyZH/wMEvhLVy5hKJnHyELcM14WfXflgNp0nyRfBAFf89+kVP9od8f 0CsE4sr6MkMd2LxSGuB04utIfJxXX6ZpwUzZ6bmUJA8FLJQ/hHYp4TygMAmFwruxckB6 c5kWMZZxWfzDOyRvJcjYjvb4oiXCqx1H8ppp3o5VuPpk5TiVnqTcyQh0OK8wWRiV7MrV KWahNzLMmGcRVu0v/aoJGiMVnuY2TRmbG7ypExPoy5D/AuAJkxIO9XTHJPe900KVQDmt Xu8h3jF8TWmVX0dR8ojkjaO5BRGXjBdXdGzV3krlTpj0LCVh9ew3PjMwbpcNSj9Na+o/ ngEg== X-Forwarded-Encrypted: i=1; AJvYcCWwtnahNNyxW3QazbNwMN6Yey9HPP965mMM/rS7mpg2TC2Xz48TWzq3vGAHit8cy3RDX53NtI3IYwJ/AQpJJkKyW/Pa1pECZY1Boc7dwvA= X-Gm-Message-State: AOJu0YzVnzIL7AYaZFuzRnELq32hRTqYOHvZz1GZr+wFyfTMOzqMuhFx PDjtx+9Qrj37QkJz0rAW0ggyD3z+WuyRYGSilcOLrIVn+0ISDEKi X-Received: by 2002:a4a:d196:0:b0:5bd:87a0:66d with SMTP id 006d021491bc7-5bd87a01b93mr287086eaf.1.1718247854625; Wed, 12 Jun 2024 20:04:14 -0700 (PDT) Received: from sean-ThinkPad-T450s.lan ([207.191.35.252]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5bd629263c5sm67685eaf.46.2024.06.12.20.04.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 20:04:13 -0700 (PDT) From: sean.wang@kernel.org To: nbd@nbd.name, lorenzo.bianconi@redhat.com Cc: sean.wang@mediatek.com, deren.wu@mediatek.com, mingyen.hsieh@mediatek.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH 43/47] wifi: mt76: mt7925: add mt7925_mac_link_sta_assoc to associate per-link STA Date: Wed, 12 Jun 2024 20:02:37 -0700 Message-Id: <20240613030241.5771-44-sean.wang@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240613030241.5771-1-sean.wang@kernel.org> References: <20240613030241.5771-1-sean.wang@kernel.org> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Sean Wang The mt7925_mac_link_sta_add function currently associates the per-link STA. We will extend this function when we implement the MLO functionality. This patch only includes structural changes and does not involve any logic changes. Signed-off-by: Sean Wang --- .../net/wireless/mediatek/mt76/mt7925/main.c | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c index 3911cf71462f..b159d26303ca 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c @@ -766,32 +766,43 @@ int mt7925_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif, } EXPORT_SYMBOL_GPL(mt7925_mac_sta_add); -void mt7925_mac_sta_assoc(struct mt76_dev *mdev, struct ieee80211_vif *vif, - struct ieee80211_sta *sta) +static void mt7925_mac_link_sta_assoc(struct mt76_dev *mdev, + struct ieee80211_vif *vif, + struct ieee80211_link_sta *link_sta) { struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76); - struct mt792x_sta *msta = (struct mt792x_sta *)sta->drv_priv; struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv; struct ieee80211_bss_conf *link_conf; + struct mt792x_link_sta *mlink; + struct mt792x_sta *msta; + + msta = (struct mt792x_sta *)link_sta->sta->drv_priv; + mlink = mt792x_sta_to_link(msta, link_sta->link_id); mt792x_mutex_acquire(dev); link_conf = mt792x_vif_to_bss_conf(vif, vif->bss_conf.link_id); - if (vif->type == NL80211_IFTYPE_STATION && !sta->tdls) + if (vif->type == NL80211_IFTYPE_STATION && !link_sta->sta->tdls) mt7925_mcu_add_bss_info(&dev->phy, mvif->bss_conf.mt76.ctx, - link_conf, &sta->deflink, true); + link_conf, link_sta, true); - ewma_avg_signal_init(&msta->deflink.avg_ack_signal); + ewma_avg_signal_init(&mlink->avg_ack_signal); - mt7925_mac_wtbl_update(dev, msta->deflink.wcid.idx, + mt7925_mac_wtbl_update(dev, mlink->wcid.idx, MT_WTBL_UPDATE_ADM_COUNT_CLEAR); - memset(msta->deflink.airtime_ac, 0, sizeof(msta->deflink.airtime_ac)); + memset(mlink->airtime_ac, 0, sizeof(mlink->airtime_ac)); - mt7925_mcu_sta_update(dev, &sta->deflink, vif, true, MT76_STA_INFO_STATE_ASSOC); + mt7925_mcu_sta_update(dev, link_sta, vif, true, MT76_STA_INFO_STATE_ASSOC); mt792x_mutex_release(dev); } + +void mt7925_mac_sta_assoc(struct mt76_dev *mdev, struct ieee80211_vif *vif, + struct ieee80211_sta *sta) +{ + mt7925_mac_link_sta_assoc(mdev, vif, &sta->deflink); +} EXPORT_SYMBOL_GPL(mt7925_mac_sta_assoc); void mt7925_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif, -- 2.34.1