Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp191114lfo; Tue, 17 May 2022 21:52:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQaHqzVUC/LA7s5X6zsank0pp6Fbmtr/T9W1LpSUdob0DUykHpDU90+XyZadMGEc/wiZ55 X-Received: by 2002:a17:902:a705:b0:156:9cc5:1d6f with SMTP id w5-20020a170902a70500b001569cc51d6fmr25298954plq.66.1652849538184; Tue, 17 May 2022 21:52:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652849538; cv=none; d=google.com; s=arc-20160816; b=uRGlxF7S9TOrqMyzW1s18d8S0JLeleH3MOcf2yAYfF/VXCwaDiijMF/M1qL5U5UCtG ryWPp5/AjNwsF7ep/AefhWBmURpTWmoOe8lqjb8ey+6y9ZiDLNL1N+xfiXc7OMYDvdjJ r3WptEPFRI5cx0LIhGXNdarvyQCv+PU193OwLaqpdb9JDK8CQx8DU58mKh85xO6ZhHRV m2YEgOyk/NSvgAMMhis5UWpLFQ8iC2acElmTGom8f8jzSteH9/qMnf/B+7MzayIyNrjl OO6AFYHAn5B1oINiEQX8OcplOyWynIYx+u2Xeu/NRJ+fTIFYpJVP/BANKDoPUhUgP5L+ oFWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=yjDZzYRlOEXaTeXKeiZ3BoDk5vWbzSf4BpCkz7w3naQ=; b=ASeYLglAlCiKeOnMzl/kB9a4+pbMxzavnV4x7ec+3rhpIai0GS13Msd0qzhVra5XaF T0mGQKvpLAcRMOCzN4eI+OYSpd6thkJTwzwwZjexZgztUpv3pP4K+uOgO/A3fBFfROfM lXlPPaputbRDvgwZEYShlR4IF6yyGwgPqG321ZsWDVbmu+QB3q3IiY1kc7OeHKVW1Pjt Lco44MqtsrlF2gi+wQMqjHmhzkSDNZ9rKLgAjytAaTR8qcwIy5Q3exQUYXPAuBHqeS40 4deFDMu/8KvbxjvQkuSItRsv1N5ml/fksdZiPSA2eSxPEKV+/3k8Vd8a+a2wrGcIw2uB lToA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@narfation.org header.s=20121 header.b="jZbXTZ3/"; spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=narfation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 17-20020a631751000000b003ab021cae7csi1068339pgx.663.2022.05.17.21.52.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 21:52:18 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@narfation.org header.s=20121 header.b="jZbXTZ3/"; spf=softfail (google.com: domain of transitioning linux-wireless-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=narfation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 407E8132774; Tue, 17 May 2022 21:01:07 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237752AbiEQL7f (ORCPT + 70 others); Tue, 17 May 2022 07:59:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344892AbiEQL6l (ORCPT ); Tue, 17 May 2022 07:58:41 -0400 X-Greylist: delayed 558 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 17 May 2022 04:58:38 PDT Received: from dvalin.narfation.org (dvalin.narfation.org [IPv6:2a00:17d8:100::8b1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CCE543AC9; Tue, 17 May 2022 04:58:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1652788156; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yjDZzYRlOEXaTeXKeiZ3BoDk5vWbzSf4BpCkz7w3naQ=; b=jZbXTZ3/5SfUMbKEfhbQrWkTEcL8yFUx+ikl6g30Nlu2m76LUTuOUBnBpqHhSbtDX1D8Vv vfDNbfsov68KP3/VLLSrOoMwgnaJrVRC6b/qSLdN1/Y89pk6cLuAgkNXUIH2Isg1WeIDQD 5ns148IgTVYW9qR130PUOy7zoApyzx8= From: Sven Eckelmann To: davem@davemloft.net, Jakub Kicinski Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com, Jakub Kicinski , johannes@sipsolutions.net, alex.aring@gmail.com, stefan@datenfreihafen.org, mareklindner@neomailbox.ch, sw@simonwunderlich.de, a@unstable.cc, linux-wireless@vger.kernel.org, linux-wpan@vger.kernel.org Subject: Re: [PATCH net-next] net: ifdefy the wireless pointers in struct net_device Date: Tue, 17 May 2022 13:49:13 +0200 Message-ID: <2780967.JztxfRx3z1@ripper> In-Reply-To: <20220516215638.1787257-1-kuba@kernel.org> References: <20220516215638.1787257-1-kuba@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart53318918.RGKOpMJsdz"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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-wireless@vger.kernel.org --nextPart53318918.RGKOpMJsdz Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii"; protected-headers="v1" From: Sven Eckelmann To: davem@davemloft.net, Jakub Kicinski Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com, Jakub Kicinski , johannes@sipsolutions.net, alex.aring@gmail.com, stefan@datenfreihafen.org, mareklindner@neomailbox.ch, sw@simonwunderlich.de, a@unstable.cc, linux-wireless@vger.kernel.org, linux-wpan@vger.kernel.org Subject: Re: [PATCH net-next] net: ifdefy the wireless pointers in struct net_device Date: Tue, 17 May 2022 13:49:13 +0200 Message-ID: <2780967.JztxfRx3z1@ripper> In-Reply-To: <20220516215638.1787257-1-kuba@kernel.org> References: <20220516215638.1787257-1-kuba@kernel.org> On Monday, 16 May 2022 23:56:38 CEST Jakub Kicinski wrote: > diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c > index 83fb51b6e299..15d2bb4cd301 100644 > --- a/net/batman-adv/hard-interface.c > +++ b/net/batman-adv/hard-interface.c > @@ -307,9 +307,11 @@ static bool batadv_is_cfg80211_netdev(struct net_device *net_device) > if (!net_device) > return false; > > +#if IS_ENABLED(CONFIG_WIRELESS) > /* cfg80211 drivers have to set ieee80211_ptr */ > if (net_device->ieee80211_ptr) > return true; > +#endif > > return false; > } Acked-by: Sven Eckelmann On Tuesday, 17 May 2022 09:48:24 CEST Johannes Berg wrote: > Something like the patch below might do that, but I haven't carefully > checked it yet, nor checked if there are any paths in mac80211/drivers > that might be doing this check - and it looks from Jakub's patch that > batman code would like to check this too. Yes, if something like netdev_is_wireless would be available then we could change it to: diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c index 35fadb924849..50a53e3364bf 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c @@ -294,26 +294,6 @@ static bool batadv_is_wext_netdev(struct net_device *net_device) return false; } -/** - * batadv_is_cfg80211_netdev() - check if the given net_device struct is a - * cfg80211 wifi interface - * @net_device: the device to check - * - * Return: true if the net device is a cfg80211 wireless device, false - * otherwise. - */ -static bool batadv_is_cfg80211_netdev(struct net_device *net_device) -{ - if (!net_device) - return false; - - /* cfg80211 drivers have to set ieee80211_ptr */ - if (net_device->ieee80211_ptr) - return true; - - return false; -} - /** * batadv_wifi_flags_evaluate() - calculate wifi flags for net_device * @net_device: the device to check @@ -328,7 +308,7 @@ static u32 batadv_wifi_flags_evaluate(struct net_device *net_device) if (batadv_is_wext_netdev(net_device)) wifi_flags |= BATADV_HARDIF_WIFI_WEXT_DIRECT; - if (batadv_is_cfg80211_netdev(net_device)) + if (netdev_is_wireless(net_device)) wifi_flags |= BATADV_HARDIF_WIFI_CFG80211_DIRECT; real_netdev = batadv_get_real_netdevice(net_device); @@ -341,7 +321,7 @@ static u32 batadv_wifi_flags_evaluate(struct net_device *net_device) if (batadv_is_wext_netdev(real_netdev)) wifi_flags |= BATADV_HARDIF_WIFI_WEXT_INDIRECT; - if (batadv_is_cfg80211_netdev(real_netdev)) + if (netdev_is_wireless(real_netdev)) wifi_flags |= BATADV_HARDIF_WIFI_CFG80211_INDIRECT; out: --nextPart53318918.RGKOpMJsdz Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF10rh2Elc9zjMuACXYcKB8Eme0YFAmKDi7kACgkQXYcKB8Em e0bh6g//ZaUMB74zvBCKHql+pln4FQ/wyUsj7/HF3gSU9MNG1qlDgzZn0kfAXplR ZlfIXj566nw7fezMDYzMoeJ+U4qrmAoa5gg1W2+4QlLXi08Z/7JjqoQjMgGpFWpS EqCT3L/qFpMkbV+iqSD9fsRC+4VWWA6quinU3tohEApW5Ibx5CDK1sDwjl+uVwJP eMegY4IixvtnH6xiZwZdhHIoXnAbJxnCMFpxWPzCk9DBkHtEgnS5G2iN2qVgJvlQ ++ePF9edttDqwFeGdjuQTvyiLyVEPwlJ1VC3DvoHJmBEwLcCxYcu1Vxm3nqiDECi Ok6bbHn+s7P7q+tSAsnaL9NqfZmZA57RV/MHlrPgCyXEgA7zeF4PjLsaJBMVmfha Cv/PVf6/GmFYwk9pSQ1iM5rwgfDToh+d/UXARY+iI+iRmkNwt9+GQQIXAErYDu1d ryGHKhyWHzA/FEMmirpM/ZNoF/5/FPvUyBLDeu0s9am12IvWsYnFG/fmY/DO4Rbp /kKkX6WMpeUXz/go3THp4KReClydP322fYHfsJYtmG1Yo+cjQ3CFPhKvXqeA8jno aqkqN7k4nAvgRY112IExUrLeT/433y4c2vnAeFv3ShxSgbG/nFyN0puPRasqcVWk uoJGwGAZ5bkVzGTkRI/iY2qTj2PXxPnzMDJev6KWww7Bq+ir0U8= =HphN -----END PGP SIGNATURE----- --nextPart53318918.RGKOpMJsdz--