From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 765311FBC for ; Tue, 25 Jul 2023 02:44:58 +0000 (UTC) Received: from smtpbgbr1.qq.com (smtpbgbr1.qq.com [54.207.19.206]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18E9A19AD for ; Mon, 24 Jul 2023 19:44:29 -0700 (PDT) X-QQ-mid:Yeas43t1690252906t971t64959 Received: from 3DB253DBDE8942B29385B9DFB0B7E889 (jiawenwu@trustnetic.com [183.128.134.159]) X-QQ-SSF:00400000000000F0FQF000000000000 From: =?utf-8?b?Smlhd2VuIFd1?= X-BIZMAIL-ID: 886477351447398798 To: "'Russell King \(Oracle\)'" Cc: , , , , References: <20230724102341.10401-1-jiawenwu@trustnetic.com> <20230724102341.10401-7-jiawenwu@trustnetic.com> In-Reply-To: Subject: RE: [PATCH net-next 6/7] net: txgbe: support copper NIC with external PHY Date: Tue, 25 Jul 2023 10:41:46 +0800 Message-ID: <03d201d9bea1$8dc4d740$a94e85c0$@trustnetic.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQJQc7ZImbL9NUPTrDJxH1gVz1U29QJ+Bk4MARxYyuauv4Vi4A== Content-Language: zh-cn X-QQ-SENDSIZE: 520 Feedback-ID: Yeas:trustnetic.com:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FROM_EXCESS_BASE64, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net On Monday, July 24, 2023 6:43 PM, Russell King (Oracle) wrote: > On Mon, Jul 24, 2023 at 06:23:40PM +0800, Jiawen Wu wrote: > > @@ -22,6 +25,9 @@ static int txgbe_get_link_ksettings(struct net_device *netdev, > > { > > struct txgbe *txgbe = netdev_to_txgbe(netdev); > > > > + if (txgbe->wx->media_type == sp_media_copper) > > + return phy_ethtool_get_link_ksettings(netdev, cmd); > > Why? If a PHY is attached via phylink, then phylink will automatically > forward the call below to phylib. No, there is no phylink implemented for sp_media_copper. > > + > > return phylink_ethtool_ksettings_get(txgbe->phylink, cmd); > > If you implement it correctly, you also don't need two entirely > separate paths to configure the MAC/PCS for the results of the PHY's > negotiation, because phylink gives you a _generic_ set of interfaces > between whatever is downstream from the MAC and the MAC. For sp_media_copper, only mii bus is registered for attaching PHY. Most MAC/PCS configuration is done in firmware, so it is not necessary to implement phylink as sp_media_fiber.