From patchwork Sat Jan 28 12:58:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alvin_=C5=A0ipraga?= X-Patchwork-Id: 49854 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1336489wrn; Sat, 28 Jan 2023 05:17:20 -0800 (PST) X-Google-Smtp-Source: AMrXdXuNiWJ5uWCp2usAOViaaZiXiUtiKy3kIcFarDhhAlsO/gWL02TBAYWAlPuqPrqUwR6z7i1g X-Received: by 2002:a05:6a21:7888:b0:ad:bd57:a02 with SMTP id bf8-20020a056a21788800b000adbd570a02mr54280448pzc.5.1674911840000; Sat, 28 Jan 2023 05:17:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674911839; cv=none; d=google.com; s=arc-20160816; b=DUk55YqaHHStsAnjebvncOz2ktqaPQeuo/OonF8Yst4y8IODNYcIWF8aePz3t13/IU 9/jn6anXLocz3Kcd8fTTMEd73pwtQcr6gdNTe8mgcv12xZh7uQUyqVNNcEosApbK0T7E U71D5Rvg9GgVVUT8wEo7fq6H+Ysf2o0iOugxbdJYNwENgCwh/EVZmAoL01gsybLU1VjQ 9tJAIhMbpFED68znBrclLaHw5PbWkggeNNcVCXs/UnJRgJPrLSM25nIkoVEXqECPXU1X c9rD3bMG9gv19/i1MT5P4xz4ekNZM9swIiEjd/9yNl5gOGIKWkT/9fjKYOuv5kK+vEAM OlBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TGiVQCAPVenbpU4R0UlRE+cCXkPIO6idXxOzj44qmV0=; b=UwGTy/iULLIQiz0wTUhwp2lBMOEGdFNIZ0puyCkWb+hNYQHCrhZeTjUuXl1o8YiENe 1QBvMx6D1UUuqcfu1DLysuyWTJax97jxIwphjZ/Org3a2w/EZ0qPTsKNEikEDu0ISJJk reei7c9G789cNjnSd2imTaOqepp8ZwHONe3Gxvu77XnxppHT4tBOSEzHpLicVMzave4f ZXEqBuj5NsDmbVAUh7gEDEud7ndabYRYH6ciqFxecMY49kB5KrKqEGrvylr6FZHvs2dK HDbdCgzeK5vcXSHBEtXBPCrnF47m2gvFb8gzHdUYvwDdTICcXBEEp16cElamAXaXtMQP vECQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@pqrs.dk header.s=google header.b=NOXp64Pl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p16-20020a637f50000000b004e3f0dd60e9si1500633pgn.551.2023.01.28.05.17.06; Sat, 28 Jan 2023 05:17:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=temperror (no key for signature) header.i=@pqrs.dk header.s=google header.b=NOXp64Pl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233675AbjA1M7H (ORCPT + 99 others); Sat, 28 Jan 2023 07:59:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232174AbjA1M7C (ORCPT ); Sat, 28 Jan 2023 07:59:02 -0500 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC2115356C for ; Sat, 28 Jan 2023 04:58:59 -0800 (PST) Received: by mail-ej1-x62b.google.com with SMTP id k4so14880888eje.1 for ; Sat, 28 Jan 2023 04:58:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pqrs.dk; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TGiVQCAPVenbpU4R0UlRE+cCXkPIO6idXxOzj44qmV0=; b=NOXp64PlL5aJZuCGG3Li4mElZSQPvkCcefvyvXKv9nPVd6S3pcAfkwiyzC+wIXY3uH jkjpScv813kZjRxrzQKJgJnRVuCFI9SeHPF0JSR6LbDmD7fyzD5jKtoZ+kMsGophMV2N dUKG2OsauDDEoZn2ACy4S+i+Hfd1A0U64rCjA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=TGiVQCAPVenbpU4R0UlRE+cCXkPIO6idXxOzj44qmV0=; b=Ddxm/Lehz72W2jJosivwrVmp9PwiS1Ogax75LefKOMdySzhNdyMvauPlgZhqxKBteo urWfl3k+tm2Y58PWPHC0Lv5bbRArN3KM+LMyrUP/328h4mluPmJcsD6BxFDjH7n8RlOb zA6Ti0qHvdRCLiBmkA/BNwBGZux/QHoHzyZb2wPqRT39SuoTVeDKFE6nDtsOBZCMWio0 Zz+algO1x6pwDYPgTd47Y4rz/mbHm2tNGX4tHF5ZVbahKR39teXh1ZiXpYEXjWEBOdth S487KF3OFkwCmc82tLRZ8TDbx7ZKpZgfbirq6dvz17Yz/SI+9vJ3ZwN8wGxp9oMZgQfP ORKw== X-Gm-Message-State: AFqh2krwzLF0P9EmQMIFinf/ajgzF4lcwDui30WYGuStmTMi5IXJLEG5 1UrQ+dtT0hodidvpL8kYoNqH4w== X-Received: by 2002:a17:906:3f87:b0:809:c1f4:ea09 with SMTP id b7-20020a1709063f8700b00809c1f4ea09mr41433760ejj.69.1674910738479; Sat, 28 Jan 2023 04:58:58 -0800 (PST) Received: from localhost.localdomain (80.71.142.18.ipv4.parknet.dk. [80.71.142.18]) by smtp.gmail.com with ESMTPSA id f25-20020a170906139900b0087b3d555d2esm2730051ejc.33.2023.01.28.04.58.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Jan 2023 04:58:58 -0800 (PST) From: =?utf-8?q?Alvin_=C5=A0ipraga?= To: Johannes Berg , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: =?utf-8?q?Alvin_=C5=A0ipraga?= , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 next 2/2] wifi: nl80211: add MLO_LINK_ID to CMD_STOP_AP event Date: Sat, 28 Jan 2023 13:58:44 +0100 Message-Id: <20230128125844.2407135-2-alvin@pqrs.dk> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230128125844.2407135-1-alvin@pqrs.dk> References: <20230128125844.2407135-1-alvin@pqrs.dk> MIME-Version: 1.0 X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756272357368502020?= X-GMAIL-MSGID: =?utf-8?q?1756272357368502020?= From: Alvin Šipraga nl80211_send_ap_stopped() can be called multiple times on the same netdev for each link when using Multi-Link Operation. Add the MLO_LINK_ID attribute to the event to allow userspace to distinguish which link the event is for. Signed-off-by: Alvin Šipraga --- v1 -> v2: new patch --- net/wireless/ap.c | 2 +- net/wireless/nl80211.c | 6 ++++-- net/wireless/nl80211.h | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/net/wireless/ap.c b/net/wireless/ap.c index e68923200018..0962770303b2 100644 --- a/net/wireless/ap.c +++ b/net/wireless/ap.c @@ -39,7 +39,7 @@ static int ___cfg80211_stop_ap(struct cfg80211_registered_device *rdev, wdev->u.ap.ssid_len = 0; rdev_set_qos_map(rdev, dev, NULL); if (notify) - nl80211_send_ap_stopped(wdev); + nl80211_send_ap_stopped(wdev, link_id); /* Should we apply the grace period during beaconing interface * shutdown also? diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 7370ddf84fd3..fd231e37ea9d 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -19701,7 +19701,7 @@ void cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp) } EXPORT_SYMBOL(cfg80211_crit_proto_stopped); -void nl80211_send_ap_stopped(struct wireless_dev *wdev) +void nl80211_send_ap_stopped(struct wireless_dev *wdev, unsigned int link_id) { struct wiphy *wiphy = wdev->wiphy; struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); @@ -19719,7 +19719,9 @@ void nl80211_send_ap_stopped(struct wireless_dev *wdev) if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || nla_put_u32(msg, NL80211_ATTR_IFINDEX, wdev->netdev->ifindex) || nla_put_u64_64bit(msg, NL80211_ATTR_WDEV, wdev_id(wdev), - NL80211_ATTR_PAD)) + NL80211_ATTR_PAD) || + (wdev->valid_links && + nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, link_id))) goto out; genlmsg_end(msg, hdr); diff --git a/net/wireless/nl80211.h b/net/wireless/nl80211.h index ba9457e94c43..0278d817bb02 100644 --- a/net/wireless/nl80211.h +++ b/net/wireless/nl80211.h @@ -114,7 +114,7 @@ nl80211_radar_notify(struct cfg80211_registered_device *rdev, enum nl80211_radar_event event, struct net_device *netdev, gfp_t gfp); -void nl80211_send_ap_stopped(struct wireless_dev *wdev); +void nl80211_send_ap_stopped(struct wireless_dev *wdev, unsigned int link_id); void cfg80211_rdev_free_coalesce(struct cfg80211_registered_device *rdev);