From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C0011C76196 for ; Wed, 29 Mar 2023 01:58:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=W9N3bY5RHVs1aNzzOpeoOVcXHOa+mGcOzTjG0souTOU=; b=EI5KrUQJ2JFcpx 0ZfMDgZHYgRZ/8IA6l6u6gfgFfJkGApY3L1tb+uP7wLQbfVDYoAMStJF1MTqhgKz5iXC9GXLHgE+D xfHZka2Xkc7AaN6ayzITccbDAt3Wiie1P3rXP5fOuLd96KYGYKklIPHuETCk9fr5n8weDcY2g2p0/ jIssntK/JlTWgiRAUR2ullT4iEszuU2sK0jagtwwnzF6hnhvAczUB0V6d2+FwKVQNBhd17030JSn0 QzlD4v1n4QGriPm8U6QCn7WZRVsEcCFWoR9C1iGA6BOMsuI5yYq9YJA01IjRPXJh/3Q1wwqe/5zHU tE75Z9PJAg1I3ehw9Yqw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1phL47-00GJEu-12; Wed, 29 Mar 2023 01:57:31 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1phL44-00GJDr-1R for linux-arm-kernel@lists.infradead.org; Wed, 29 Mar 2023 01:57:30 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1C32AB81EBC; Wed, 29 Mar 2023 01:57:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08E95C433EF; Wed, 29 Mar 2023 01:57:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680055041; bh=Ht1onyfcmzOw2qKX1pJ8D5vEoEK4zHwhkFnjwVJVLG0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dTjfxYX88Y0GCwguIOU1z+LJD7YjITgEt48phbqGQKQ0v7xyRPUlWTGG8ljYZGMPx 0/x+CHkbC2HY8yFmHVsbqndOTDL9ByGVqxLl5kIcAIJ07W8qkrfxenDnG02z9jXb+u wV2AVnB88zfjoRmbnN5IAOwoihywT6e3CPTesZchHWA/NGIKggHkutdwnfwqI7HSgN JjCcMNvpZTTGEdKJGCSu8gvk3QFYEeiQ78wiStgkfqmlgF1jolj31mAn7D0CJHwZ3k IxIrVltQ/5gkNK2cmhSvvF/EiHa8lg5j29FiLgRu3cDDK86Hm39L/zdsGXriOLWaRF OBtsV1EKoVnsQ== Date: Tue, 28 Mar 2023 18:57:20 -0700 From: Jakub Kicinski To: linux@armlinux.org.uk Cc: Michael Sit Wei Hong , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Paolo Abeni , Maxime Coquelin , Ong Boon Leong , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Looi Hong Aun , Voon Weifeng , Lai Peter Jun Ann Subject: Re: [PATCH net v3 1/3] net: phylink: add phylink_expects_phy() method Message-ID: <20230328185720.6239e4a7@kernel.org> In-Reply-To: <20230324081656.2969663-2-michael.wei.hong.sit@intel.com> References: <20230324081656.2969663-1-michael.wei.hong.sit@intel.com> <20230324081656.2969663-2-michael.wei.hong.sit@intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230328_185728_823302_CCE8923B X-CRM114-Status: GOOD ( 17.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, 24 Mar 2023 16:16:54 +0800 Michael Sit Wei Hong wrote: > Provide phylink_expects_phy() to allow MAC drivers to check if it > is expecting a PHY to attach to. Since fixed-linked setups do not > need to attach to a PHY. > > Provides a boolean value as to if the MAC should expect a PHY. > returns true if a PHY is expected. > > Signed-off-by: Michael Sit Wei Hong Russell, looks good? > diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c > index 1a2f074685fa..5c2bd1370993 100644 > --- a/drivers/net/phy/phylink.c > +++ b/drivers/net/phy/phylink.c > @@ -1586,6 +1586,19 @@ void phylink_destroy(struct phylink *pl) > } > EXPORT_SYMBOL_GPL(phylink_destroy); > > +/** > + * phylink_expects_phy() - Determine if phylink expects a phy to be attached > + * @pl: a pointer to a &struct phylink returned from phylink_create() > + * > + * Fixed-link mode does not need a PHY, returns a boolean value to check if > + * phylink will be expecting a PHY to attach. > + */ > +bool phylink_expects_phy(struct phylink *pl) > +{ > + return pl->cfg_link_an_mode != MLO_AN_FIXED; > +} > +EXPORT_SYMBOL_GPL(phylink_expects_phy); > + > static void phylink_phy_change(struct phy_device *phydev, bool up) > { > struct phylink *pl = phydev->phylink; > diff --git a/include/linux/phylink.h b/include/linux/phylink.h > index c492c26202b5..637698ed5cb6 100644 > --- a/include/linux/phylink.h > +++ b/include/linux/phylink.h > @@ -574,6 +574,7 @@ struct phylink *phylink_create(struct phylink_config *, struct fwnode_handle *, > phy_interface_t iface, > const struct phylink_mac_ops *mac_ops); > void phylink_destroy(struct phylink *); > +bool phylink_expects_phy(struct phylink *pl); > > int phylink_connect_phy(struct phylink *, struct phy_device *); > int phylink_of_phy_connect(struct phylink *, struct device_node *, u32 flags); _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel