From owner-freebsd-drivers@freebsd.org Fri Mar 27 18:48:02 2020 Return-Path: Delivered-To: freebsd-drivers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 89E2B27DF82; Fri, 27 Mar 2020 18:48:02 +0000 (UTC) (envelope-from se@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48prTD42s1z4cpq; Fri, 27 Mar 2020 18:48:00 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MBP-449.fritz.box (p200300CD5F0504008CB8021D07A0880B.dip0.t-ipconnect.de [IPv6:2003:cd:5f05:400:8cb8:21d:7a0:880b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 2843952F9; Fri, 27 Mar 2020 18:47:52 +0000 (UTC) (envelope-from se@freebsd.org) Subject: Re: Does FreeBSD has a generic PHY library as in Linux? To: Rajesh Kumar , freebsd-drivers@freebsd.org, FreeBSD Hackers References: From: =?UTF-8?Q?Stefan_E=c3=9fer?= Message-ID: Date: Fri, 27 Mar 2020 19:47:49 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Mar 2020 18:48:02 -0000 Am 26.03.20 um 19:36 schrieb Rajesh Kumar: > Hi, > > I am porting a network driver from Linux to FreeBSD. The driver in Linux > uses the PHY library (a generic wrapper) to access/config the PHY > registers. Do we have anything equivalent in FreeBSD? > > PHY library routines in Linux: > > get_phy_device > phy_device_register > phy_attach_direct > phy_start_aneg > etc., > > FreeBSD being a stable OS for networking and Storage, I assume it should > have something equivalent to this. Can anyone point to it? or any > documentation related to this? See https://wiki.freebsd.org/MIIBUS for initial information about the miibus driver that covers most PHYs supported by FreeBSD Ethernet devices. The miibus(4) man-page contains a list of devices that use this interface and which might be useful as examples for its use: https://www.freebsd.org/cgi/man.cgi?miibus(4) Regards, STefan