Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp433955rdb; Mon, 29 Jan 2024 06:54:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IEGMjCLu6Fs1rHryJSMArPe10hmbTLZxieNw8fs6iL+y/H6gmJ1owMrDemp3qKCAQbkvjOV X-Received: by 2002:a17:902:da89:b0:1d8:b8df:79da with SMTP id j9-20020a170902da8900b001d8b8df79damr2541077plx.18.1706540050765; Mon, 29 Jan 2024 06:54:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706540050; cv=pass; d=google.com; s=arc-20160816; b=kWPzk22/FGzx5tSt6dbUqA2RDDE3f/j87iQ5Xrnk+AD+wVI2lNuoNEILxb0S6bqR3C R8aXOrzzcgKuBLxarjSImvpuN/6X5OCCZXOM5WCLSfJeLnI6NA+YQAn2VTCzL7+H+mSH ImzKjDEOHjDft81K8w80xSujw7tPHIcRKCWYpwHbZds/QkIIdnCzMBmWrESxxmLXAi/h 7QFRtyPpYBHMH42FU8XMZVihaEa4QSnE55TpK6x1EMj1qVxfhNtfoOubKneNGldVNV+o DDCWMPIZjpQDhDhpc9PgZSZ/5KKMLE9wwTsmqEg5F0otjVkgKNd9YTvRvKeLc6PALyxp ML0w== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=8XL8jkUO+vnlYnABb9sAmsqhoLg/QQh+QfwYGm1J6NI=; fh=6rNoI9d21kETv+yT3LoZga5P0n00FCNVfLCOV4GnmWM=; b=xH8i7zJ6Z7JEUFfzuG+daoAn+R7D5EY1zWpamRVK0hR4U+Lq1RfuX5lMPj5zi7RKiD HHLEkPitGlWCD7E7UBekPnz2ncco8euRCcm8/lFxSYF4S2ibMZpG3woCLoaznChi/3aE e4ZqJjXmdz2qh8KyCIuw0/xQX4sZDefHseph9aQoIMx1N3bwk1OIAhCSMJ+L2Bjuu8Rw OYZpEOVdR2gkgv1Ba0f9yCafUe/6FiLOs/XMZmbfwMHDWeEDs8F3c9yWdGz1BWaIjtk5 JfiYByXUEMVxEEy4wcvXMg2KkryfPxY6s5WSdm3LzxhMuSifBeUNmEbUaZt8Dx8t8a1D rebQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b="C8q/pmMZ"; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-2675-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2675-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net X-Forwarded-Encrypted: i=1; AJvYcCV2IBpi9YkA3q4OxY/dHBZjbATtFwdX/3pVtJ93xinw13YJiRmWmEB2neBw4jBWwDSrGLxbKbdan2IfC/SjjENrZ1VauzH6kyL9FO5tyg== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id r10-20020a170903014a00b001d8d6c1fcb4si2250776plc.91.2024.01.29.06.54.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 06:54:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-2675-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b="C8q/pmMZ"; arc=pass (i=1 spf=pass spfdomain=sipsolutions.net dkim=pass dkdomain=sipsolutions.net dmarc=pass fromdomain=sipsolutions.net); spf=pass (google.com: domain of linux-wireless+bounces-2675-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2675-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 6E90F283D5B for ; Mon, 29 Jan 2024 14:54:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B481152E0F; Mon, 29 Jan 2024 14:54:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b="C8q/pmMZ" X-Original-To: linux-wireless@vger.kernel.org Received: from sipsolutions.net (s3.sipsolutions.net [168.119.38.16]) (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 6342E152DFE for ; Mon, 29 Jan 2024 14:54:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.38.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706540050; cv=none; b=TUBTnU8hJvVdyFgmhtbliBEz6Dmr+7hNcjaEEFACmPjFdjeo//6g54W/+EcajRqmR9ZdewVBhyloFLGLmfwit4O0lhLpjfOKMuEIxYrtiwgfywut/9UxLnS4aricEuL7Ka1YrkHXK+SYVfh4L7UoNSQ/ItRvQz4n1Bw+pkw+htU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706540050; c=relaxed/simple; bh=TCOjIhCZ+EKfpk8ywioP7Uho+Pf8OFvys0J8lXO9xhw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=AjrwJYFfu9nv43vbccYyFqsn2ps5V4YTZ1QqUobFiWIWHPZjCFxzftkshxdZZ4B/a0et+YLnuSvddG4ydfltC9+ClQyfyrydS0UAgWI42X3f8MhAKl9oPzUtjNMF/XO17s2OgtbmqzHoajqQ2qUgpddudT19ODJ95ZKpP8OWSRk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net; spf=pass smtp.mailfrom=sipsolutions.net; dkim=pass (2048-bit key) header.d=sipsolutions.net header.i=@sipsolutions.net header.b=C8q/pmMZ; arc=none smtp.client-ip=168.119.38.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sipsolutions.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sipsolutions.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Message-ID:Date:Subject:Cc:To:From:Content-Type:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-To:Resent-Cc: Resent-Message-ID:In-Reply-To:References; bh=8XL8jkUO+vnlYnABb9sAmsqhoLg/QQh+QfwYGm1J6NI=; t=1706540047; x=1707749647; b=C8q/pmMZJppNcgu0qk1LJeA0AVL5yN7NULkIZ/pkPKxi3X9KnDBsAKbqF8s0HDM008lPjAsblYl 0vU/g2h2dtKSaSRvqwyhlgJwOWMW5Uyf3oUADaRbUP1Y+bO8SseOlM0xWQyQjkJ9ygLBDTFwFnCbE eCEw7rRcCtNmtXDTzu5N9QxEdB5uxuM20jlrxaMULqNTFo4uuRJi0TL/qFWmpiP2THgLeawbRaBkX uZFG+ypcYDoaKXGDgAS3Xv2zNt++F8gImCAzb6VMD4GFsLVufs65OqoLqiZcUGB84LS2x5IpdAe7z hjjNlP8pcgUNS3gQhXZ1WHdNhdy7fj7elZVw==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1rUT1Q-00000004tMO-0gZL; Mon, 29 Jan 2024 15:54:04 +0100 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: Johannes Berg Subject: [PATCH] wifi: mac80211: fix driver debugfs for vif type change Date: Mon, 29 Jan 2024 15:54:02 +0100 Message-ID: <20240129155402.7311a36ffeeb.I18df02bbeb685d4250911de5ffbaf090f60c3803@changeid> X-Mailer: git-send-email 2.43.0 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: Johannes Berg If a driver implements the change_interface() method, we switch interface type without taking the interface down, but still will recreate the debugfs for it since it's a new type. As such, we should use the ieee80211_debugfs_recreate_netdev() function here to also recreate the driver's files, if it is indeed from a type change while up. Signed-off-by: Johannes Berg --- net/mac80211/debugfs_netdev.c | 4 ++-- net/mac80211/debugfs_netdev.h | 5 ----- net/mac80211/iface.c | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c index dce5606ed66d..68596ef78b15 100644 --- a/net/mac80211/debugfs_netdev.c +++ b/net/mac80211/debugfs_netdev.c @@ -997,8 +997,8 @@ static void add_link_files(struct ieee80211_link_data *link, } } -void ieee80211_debugfs_add_netdev(struct ieee80211_sub_if_data *sdata, - bool mld_vif) +static void ieee80211_debugfs_add_netdev(struct ieee80211_sub_if_data *sdata, + bool mld_vif) { char buf[10+IFNAMSIZ]; diff --git a/net/mac80211/debugfs_netdev.h b/net/mac80211/debugfs_netdev.h index b226b1aae88a..a02ec0a413f6 100644 --- a/net/mac80211/debugfs_netdev.h +++ b/net/mac80211/debugfs_netdev.h @@ -11,8 +11,6 @@ #include "ieee80211_i.h" #ifdef CONFIG_MAC80211_DEBUGFS -void ieee80211_debugfs_add_netdev(struct ieee80211_sub_if_data *sdata, - bool mld_vif); void ieee80211_debugfs_remove_netdev(struct ieee80211_sub_if_data *sdata); void ieee80211_debugfs_rename_netdev(struct ieee80211_sub_if_data *sdata); void ieee80211_debugfs_recreate_netdev(struct ieee80211_sub_if_data *sdata, @@ -24,9 +22,6 @@ void ieee80211_link_debugfs_remove(struct ieee80211_link_data *link); void ieee80211_link_debugfs_drv_add(struct ieee80211_link_data *link); void ieee80211_link_debugfs_drv_remove(struct ieee80211_link_data *link); #else -static inline void ieee80211_debugfs_add_netdev( - struct ieee80211_sub_if_data *sdata, bool mld_vif) -{} static inline void ieee80211_debugfs_remove_netdev( struct ieee80211_sub_if_data *sdata) {} diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index e4e7c0b38cb6..11c4caa4748e 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -1783,7 +1783,7 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata, /* need to do this after the switch so vif.type is correct */ ieee80211_link_setup(&sdata->deflink); - ieee80211_debugfs_add_netdev(sdata, false); + ieee80211_debugfs_recreate_netdev(sdata, false); } static int ieee80211_runtime_change_iftype(struct ieee80211_sub_if_data *sdata, -- 2.43.0