From owner-freebsd-drivers@freebsd.org Sun Mar 22 05:21:08 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 03A6A27723C; Sun, 22 Mar 2020 05:21:08 +0000 (UTC) (envelope-from rajfbsd@gmail.com) Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48lQpV65NVz4WDG; Sun, 22 Mar 2020 05:21:06 +0000 (UTC) (envelope-from rajfbsd@gmail.com) Received: by mail-wr1-x434.google.com with SMTP id j17so8981148wru.13; Sat, 21 Mar 2020 22:21:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=esIcIld/4dxS4Q7Q2Hd+Oki6LmCOr8OltakdKnu8BI4=; b=CuLXI+QyBy8a6QyygSzZLUn+co7fjcdaiuyox4+O+c/kCyOeXtfKpvgnf637EfEP9u IdcCOihGT+z9LB4tU5DOYx9uTGuAQmHBgGNgk1MOilxfXE8lF4l9SH4n4X/fFVJTEk/q meUmdQ6k2aEMFHwkygfTPm4ZPDcDMsEfRtf5tB1E78PiDAaz0j+u9/5MCbMqsfDVgj3y XGd7dWsWS4JkIKCzJ+LPxCKg7yn74xFL0LcX46KbjShJJZoRNxHCDyd3Utw/Yqb7GU/6 pkJ8erxBSD5/GeABgetia1RWFjScelZ8au7fdpnyvcThUc1IcwnQzFsSRqUV9pncwwV5 75iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=esIcIld/4dxS4Q7Q2Hd+Oki6LmCOr8OltakdKnu8BI4=; b=UHpHoCUWqs4FYRNbuieeJm4AxshMku0D26qloAdCrGAUWo8G+qgd3WR1K1x1qrZc6V AHNKeJU9dgwu07EPv3583cuQLxB8HdhRfpurdJuBFxtu3+c+czQk97eYB+tE8AHp3fO4 ZMoUEHblEhoNlzmJ3/FxThlZ8q2Ghu8CSvNor5LX5qFfz30z/Up+t9MdU9Z0FapGGLMx E2pHMmcWrDcCAF32JZOcwsrq2+K6OzcJ9Du3vTjKkT5lpFukBi/SdNf+lOdPwx6l74t7 znwdXim6zghi5ciUKxaQkg2cRAfI14W43nnd71k4j+JqpR4ifaY4MbAhZBwp+NUIAu5t VONQ== X-Gm-Message-State: ANhLgQ2HMoQe94S2CZpZ7zfqoy7X1/5Ptv2SwExcS6KEPErqANnfxKsA iGcueyjYGURPEhV25ZFdyoCrcpRyAub4j9e0DMmAFw== X-Google-Smtp-Source: ADFU+vvVecpt+k2fKLubONIqrvdjUvkAZwUk+Q9hCtqoMFggLornhGDrP80UuH+Lu3QSnO6WXiJyRNFwZkNeQkgGLaY= X-Received: by 2002:a5d:4d07:: with SMTP id z7mr20694876wrt.89.1584854464778; Sat, 21 Mar 2020 22:21:04 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Rajesh Kumar Date: Sun, 22 Mar 2020 10:50:51 +0530 Message-ID: Subject: Re: How to build a out-of-box network module with RSS To: freebsd-drivers@freebsd.org, FreeBSD Hackers X-Rspamd-Queue-Id: 48lQpV65NVz4WDG X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=CuLXI+Qy; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of rajfbsd@gmail.com designates 2a00:1450:4864:20::434 as permitted sender) smtp.mailfrom=rajfbsd@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE_FREEMAIL(0.00)[]; IP_SCORE(0.00)[ip: (-9.40), ipnet: 2a00:1450::/32(-2.39), asn: 15169(-0.74), country: US(-0.05)]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[4.3.4.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Sun, 22 Mar 2020 05:21:08 -0000 Hi, Any thoughts about how to build a out-of-box network module with RSS enabled? Thanks, Rajesh. On Fri, Mar 20, 2020 at 11:34 AM Rajesh Kumar wrote: > Hi, > > I am writing a network driver. I am trying to test with RSS feature. I see > the default kernel config doesn't have RSS included. So, I built a custom > kernel with the following options set and installed the kernel with a > different name > > options PCBGROUP > options RSS > > After booting to the custom kernel, I am trying to build my network module > with opt_rss.h in my makefile. But I don't see "#define RSS 1" in > opt_rss.h in my module object directory. But I see it defined the custom > kernel OBJ directory. > > So, should I build my network modules as inbuilt module to have it work > with RSS? Or anyway I can build my module out-of-box with RSS? > > Please let me know if any details needed. > > Thanks, > Rajesh. > From owner-freebsd-drivers@freebsd.org Sun Mar 22 08:35:19 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 D4ACF27AC22; Sun, 22 Mar 2020 08:35:19 +0000 (UTC) (envelope-from rajfbsd@gmail.com) Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48lW6Z6F1lz4HMl; Sun, 22 Mar 2020 08:35:18 +0000 (UTC) (envelope-from rajfbsd@gmail.com) Received: by mail-wm1-x343.google.com with SMTP id z18so2085368wmk.2; Sun, 22 Mar 2020 01:35:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=EYIQJb1muH+DqawygoCbMbt+0ntrkdsrjLtRTAPbABY=; b=lSn5i/47yfFEj+ZJgRSikBSxwXN+qpUqogBM5IX0LeAoshqVNU+BJTRNUNt2t+PIRm tOf+S83fVh3rKB8cGXQ9CzBW3Y2Wf/ioWuS6XD56o3WxrgTBdFhUGShDyKcf4xy9lDNf imaCrrmONk+Muh2ubxIPpIaLOGYouivETp6dceMxVdN1iFpABO0NK1kA+4HRHsfziEjt IzejI0I/HYj37lUH0teUlEsDhNlgbDYHp+erTpvHoNkE9ksntkAZzfuteyOR6+3/rNhU 8rilhusJi6XqKl32LNaH8XpiL1YMXoLr3scdUVxh97h9vIcNTs8MmvtBlnR3rbTJfDaM ccFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=EYIQJb1muH+DqawygoCbMbt+0ntrkdsrjLtRTAPbABY=; b=XJ/+qMPEBPpQQwpaRR+eGUJp16+Igu3THNBXjIl7KQvBMPJDS1vzUkXXDdr6w1PWiR Soi73L0tZIcJZ/0mdrueci3KlMAVmldTXXZvf5zyJN2sJI2JQRZ25OQq4PprMCrBBvG8 LaLuAbaI2LLgm6zryCUfe/OqA0aQQnPAMwTtQd0LsLXRKGNYOYSbrPkY0fbb0uZdJJog +nYsXh/zF/1aceYUsiKebcZUIUCGrK5ubAkCiRLdocJcte5xGejQ3oZdEJlLodsAHqfB cY4sflwjFEynOLjsSfqY4itCO7tWubHi0jVCqiHaOBW9h+zwdw5xvxH4GTK8U4/gauDT YPuQ== X-Gm-Message-State: ANhLgQ25uRH4NceJ8NWd8HIISE0SNHi0WammXJuI6VGPl+dWN4lQAARs fFq0I2ZwNRzT5NiTIVcnrVRUizFqkHFMdvdLca1mS8zR X-Google-Smtp-Source: ADFU+vvbT6ihRx18N1JVvH1QHNTmkLlgiOFAQ8bmp0r4Vi+1HYmlcT/+6kWc+5K7SJP1nbsGKe+u94xbRTwkHiyPn18= X-Received: by 2002:a1c:f607:: with SMTP id w7mr5994970wmc.162.1584866117019; Sun, 22 Mar 2020 01:35:17 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Rajesh Kumar Date: Sun, 22 Mar 2020 14:05:02 +0530 Message-ID: Subject: Re: How to build a out-of-box network module with RSS To: freebsd-drivers@freebsd.org, FreeBSD Hackers X-Rspamd-Queue-Id: 48lW6Z6F1lz4HMl X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=lSn5i/47; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of rajfbsd@gmail.com designates 2a00:1450:4864:20::343 as permitted sender) smtp.mailfrom=rajfbsd@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE_FREEMAIL(0.00)[]; IP_SCORE(0.00)[ip: (2.94), ipnet: 2a00:1450::/32(-2.39), asn: 15169(-0.72), country: US(-0.05)]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[3.4.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Sun, 22 Mar 2020 08:35:19 -0000 Hi Konstantin, > Set KERNBUILDDIR env (or make) variable to the full path of the > build directory for your custom kernel. Thanks for your inputs. I tried setting the KERNBUILDDIR, but seems still it's not taking the opt_rss.h properly. Not sure I am missing something. I built and installed the custom kernel from a directory "freebsd_12_kern" with the sys/amd64/conf/GENERIC added with the PCBGROUP and RSS options. I see the following obj directory */usr/obj/root/freebsd_12_kern/amd64.amd64/sys/GENERIC* -> where opt_rss.h file has RSS defined. After that, I tried to build my network module from another directory "freebsd_12_dev" as below *freebsd_12_dev/sys/modules/netgbe # make KERNBUILDDIR= /usr/obj/root/freebsd_12_kern/amd64.amd64/sys/GENERIC * which generates the following object module directory */usr/obj/root/freebsd_12_dev/amd64.amd64/sys/modules/netgbe* -> where opt_rss.h file has RSS NOT defined. Am I missing something? or doing something wrong? Thanks, Rajesh On Sun, Mar 22, 2020 at 10:50 AM Rajesh Kumar wrote: > Hi, > > Any thoughts about how to build a out-of-box network module with RSS > enabled? > > Thanks, > Rajesh. > > On Fri, Mar 20, 2020 at 11:34 AM Rajesh Kumar wrote: > >> Hi, >> >> I am writing a network driver. I am trying to test with RSS feature. I >> see the default kernel config doesn't have RSS included. So, I built a >> custom kernel with the following options set and installed the kernel with >> a different name >> >> options PCBGROUP >> options RSS >> >> After booting to the custom kernel, I am trying to build my network >> module with opt_rss.h in my makefile. But I don't see "#define RSS 1" in >> opt_rss.h in my module object directory. But I see it defined the custom >> kernel OBJ directory. >> >> So, should I build my network modules as inbuilt module to have it work >> with RSS? Or anyway I can build my module out-of-box with RSS? >> >> Please let me know if any details needed. >> >> Thanks, >> Rajesh. >> > From owner-freebsd-drivers@freebsd.org Sun Mar 22 11:39:12 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 D5D7727E6E8; Sun, 22 Mar 2020 11:39:12 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48lbBm2VBWz4Ypj; Sun, 22 Mar 2020 11:39:12 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 02MBcviq069340 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 22 Mar 2020 13:39:00 +0200 (EET) (envelope-from kib@freebsd.org) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 02MBcviq069340 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 02MBcvln069339; Sun, 22 Mar 2020 13:38:57 +0200 (EET) (envelope-from kib@freebsd.org) X-Authentication-Warning: tom.home: kostik set sender to kib@freebsd.org using -f Date: Sun, 22 Mar 2020 13:38:57 +0200 From: Konstantin Belousov To: Rajesh Kumar Cc: freebsd-drivers@freebsd.org, FreeBSD Hackers Subject: Re: How to build a out-of-box network module with RSS Message-ID: <20200322113857.GU1992@kib.kiev.ua> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 48lbBm2VBWz4Ypj X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [1.74 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_SPAM_LONG(0.99)[0.987,0]; NEURAL_SPAM_MEDIUM(0.75)[0.748,0]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] 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: Sun, 22 Mar 2020 11:39:12 -0000 On Sun, Mar 22, 2020 at 02:05:02PM +0530, Rajesh Kumar wrote: > Hi Konstantin, > > > Set KERNBUILDDIR env (or make) variable to the full path of the > > build directory for your custom kernel. > > Thanks for your inputs. I tried setting the KERNBUILDDIR, but seems still > it's not taking the opt_rss.h properly. Not sure I am missing something. > > I built and installed the custom kernel from a directory "freebsd_12_kern" > with the sys/amd64/conf/GENERIC added with the PCBGROUP and RSS options. I > see the following obj directory > > */usr/obj/root/freebsd_12_kern/amd64.amd64/sys/GENERIC* -> where opt_rss.h > file has RSS defined. > > After that, I tried to build my network module from another directory > "freebsd_12_dev" as below > > *freebsd_12_dev/sys/modules/netgbe # make KERNBUILDDIR= > /usr/obj/root/freebsd_12_kern/amd64.amd64/sys/GENERIC * > > which generates the following object module directory > > */usr/obj/root/freebsd_12_dev/amd64.amd64/sys/modules/netgbe* -> where > opt_rss.h file has RSS NOT defined. opt_rss.h must not be generated in the module build directory. The point of KERNBUILDDIR is that it is taken from the kernel config dir. > > Am I missing something? or doing something wrong? No idea. > > Thanks, > Rajesh > > On Sun, Mar 22, 2020 at 10:50 AM Rajesh Kumar wrote: > > > Hi, > > > > Any thoughts about how to build a out-of-box network module with RSS > > enabled? > > > > Thanks, > > Rajesh. > > > > On Fri, Mar 20, 2020 at 11:34 AM Rajesh Kumar wrote: > > > >> Hi, > >> > >> I am writing a network driver. I am trying to test with RSS feature. I > >> see the default kernel config doesn't have RSS included. So, I built a > >> custom kernel with the following options set and installed the kernel with > >> a different name > >> > >> options PCBGROUP > >> options RSS > >> > >> After booting to the custom kernel, I am trying to build my network > >> module with opt_rss.h in my makefile. But I don't see "#define RSS 1" in > >> opt_rss.h in my module object directory. But I see it defined the custom > >> kernel OBJ directory. > >> > >> So, should I build my network modules as inbuilt module to have it work > >> with RSS? Or anyway I can build my module out-of-box with RSS? > >> > >> Please let me know if any details needed. > >> > >> Thanks, > >> Rajesh. > >> > > > _______________________________________________ > freebsd-drivers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-drivers > To unsubscribe, send any mail to "freebsd-drivers-unsubscribe@freebsd.org" From owner-freebsd-drivers@freebsd.org Sun Mar 22 13:20:36 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 5C34E261179; Sun, 22 Mar 2020 13:20:36 +0000 (UTC) (envelope-from rajfbsd@gmail.com) Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48ldRm1pzrz4cqG; Sun, 22 Mar 2020 13:20:36 +0000 (UTC) (envelope-from rajfbsd@gmail.com) Received: by mail-wr1-x431.google.com with SMTP id h9so13194808wrc.8; Sun, 22 Mar 2020 06:20:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YpzLvzaut23noywhqJdtiWc3XYASm+UtjTOBaFX89DM=; b=L7yO71rUvwYjY3T8vzdTCABmr8Xgb+AsU2lMmloRmYPrME7gogcqdeLdwCMCGzSjtO dTBAhc9acfJjVBEBxDp0zRPYiH4AM2e3cNT/8wDjAQwxAoL3brzv2w8dchhWXoxjelD9 6khy6CoVuVLNT/JUT6eUQXGfBZCqdlwGcl5aDQH24joz7GrMx7p69kYPISCCLQi4ndAk oPdb3T8W+1HdmU0pHQYMnSMr7jutbIvtv8ceklVgZOyskf2D17yIHc6wYRVqy6+nvDBp EZ4SLu4pA6h8IT3FU+5ye3Mth8lVzG+e/KKFqKHzt7/NWdxZkjMUpGFjn22eAYfxEv/O Ed4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YpzLvzaut23noywhqJdtiWc3XYASm+UtjTOBaFX89DM=; b=hWR5TrqnHyyGUie71JximDMvPRWj+PbI3h8IiMGlDxeei246X5beJ2CR10Vb35R4gg Fm10TIisoOFGfePxZfxSvNRONKD38mDflLHOh55n2ahNEzgKOL56HGeOj6RxfIXtwDBC kTgBwfwIk1mqwvBjrwvvweZpqBx7Uw1jqDXszAjoqYtFagcZf4USufTUeSrv/U5KRf11 pywe8hTj5kZAGFawBJuuwg6mTy9Llm/FZXODcscR/HsV6z5rHHI9EByFycW1k//HkDhh fGJvot5IX6i593p5xgRV4iDAekBMGAaL2rYJIunob15eXxRyz6LAZrMHvtNRkg5goejW twMQ== X-Gm-Message-State: ANhLgQ1LAGvbPPe3DkYHznpBZrK8gTq3ghqKwVTa8/PQ2mUgcscfIKpP UFAhATvTpjX7Xlm0qmTJD4rXSnyO2QTV7ned31kVqw== X-Google-Smtp-Source: ADFU+vsVY6wSauu4AujpXdE1+TMWEh2nwhLsz+zTaa/tNoQEwtZ4saVI3VUnBog8r4O3C9EujviTanHv5NCOcBZ8R6I= X-Received: by 2002:a5d:674f:: with SMTP id l15mr5044002wrw.196.1584883234286; Sun, 22 Mar 2020 06:20:34 -0700 (PDT) MIME-Version: 1.0 References: <20200322113857.GU1992@kib.kiev.ua> In-Reply-To: <20200322113857.GU1992@kib.kiev.ua> From: Rajesh Kumar Date: Sun, 22 Mar 2020 18:50:22 +0530 Message-ID: Subject: Re: How to build a out-of-box network module with RSS To: Konstantin Belousov Cc: freebsd-drivers@freebsd.org, FreeBSD Hackers X-Rspamd-Queue-Id: 48ldRm1pzrz4cqG X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.96 / 15.00]; NEURAL_HAM_MEDIUM(-0.97)[-0.971,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-0.99)[-0.993,0] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Sun, 22 Mar 2020 13:20:36 -0000 Ok. Thanks for your inputs Konstantin. I will do some more tests to see how I can use that and will update the thread if I could figure out. On Sun, Mar 22, 2020 at 5:09 PM Konstantin Belousov wrote: > On Sun, Mar 22, 2020 at 02:05:02PM +0530, Rajesh Kumar wrote: > > Hi Konstantin, > > > > > Set KERNBUILDDIR env (or make) variable to the full path of the > > > build directory for your custom kernel. > > > > Thanks for your inputs. I tried setting the KERNBUILDDIR, but seems still > > it's not taking the opt_rss.h properly. Not sure I am missing something. > > > > I built and installed the custom kernel from a directory > "freebsd_12_kern" > > with the sys/amd64/conf/GENERIC added with the PCBGROUP and RSS > options. I > > see the following obj directory > > > > */usr/obj/root/freebsd_12_kern/amd64.amd64/sys/GENERIC* -> where > opt_rss.h > > file has RSS defined. > > > > After that, I tried to build my network module from another directory > > "freebsd_12_dev" as below > > > > *freebsd_12_dev/sys/modules/netgbe # make KERNBUILDDIR= > > /usr/obj/root/freebsd_12_kern/amd64.amd64/sys/GENERIC * > > > > which generates the following object module directory > > > > */usr/obj/root/freebsd_12_dev/amd64.amd64/sys/modules/netgbe* -> where > > opt_rss.h file has RSS NOT defined. > opt_rss.h must not be generated in the module build directory. The point > of KERNBUILDDIR is that it is taken from the kernel config dir. > > > > > Am I missing something? or doing something wrong? > No idea. > > > > > Thanks, > > Rajesh > > > > On Sun, Mar 22, 2020 at 10:50 AM Rajesh Kumar wrote: > > > > > Hi, > > > > > > Any thoughts about how to build a out-of-box network module with RSS > > > enabled? > > > > > > Thanks, > > > Rajesh. > > > > > > On Fri, Mar 20, 2020 at 11:34 AM Rajesh Kumar > wrote: > > > > > >> Hi, > > >> > > >> I am writing a network driver. I am trying to test with RSS feature. I > > >> see the default kernel config doesn't have RSS included. So, I built > a > > >> custom kernel with the following options set and installed the kernel > with > > >> a different name > > >> > > >> options PCBGROUP > > >> options RSS > > >> > > >> After booting to the custom kernel, I am trying to build my network > > >> module with opt_rss.h in my makefile. But I don't see "#define RSS > 1" in > > >> opt_rss.h in my module object directory. But I see it defined the > custom > > >> kernel OBJ directory. > > >> > > >> So, should I build my network modules as inbuilt module to have it > work > > >> with RSS? Or anyway I can build my module out-of-box with RSS? > > >> > > >> Please let me know if any details needed. > > >> > > >> Thanks, > > >> Rajesh. > > >> > > > > > _______________________________________________ > > freebsd-drivers@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-drivers > > To unsubscribe, send any mail to " > freebsd-drivers-unsubscribe@freebsd.org" > From owner-freebsd-drivers@freebsd.org Wed Mar 25 01:38:03 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 CD0E8271602 for ; Wed, 25 Mar 2020 01:38:03 +0000 (UTC) (envelope-from igor.vilhalba@outlook.com) Received: from NAM04-CO1-obe.outbound.protection.outlook.com (mail-oln040092010054.outbound.protection.outlook.com [40.92.10.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48n9jW0P2dz46vY for ; Wed, 25 Mar 2020 01:37:50 +0000 (UTC) (envelope-from igor.vilhalba@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nk3vz6NBj+n/fURRCnZJpejHXwVcSWx5nUVXpb0pUQcOD990/uc5s4Jrd2xhCND6tWj5mj/4WtUsMWoly1I+O0oGqDHhjqlMYnogmr95U8nEUMP7NEehBZ2YWLS99T6SkgsNFWKgTJOFqYXmHAyF9mIvIT4OwK1NbpPgnzSxu2bwoLxBzaRmNE8rO6bdCJlVf4TqJy3LXxa1hsp/RTn1kQ+Jw/fox63HhQlvH8tXXnZpdhtW3XzY9k0++Gf0LwQReS68HKkHKxNeYtBQIf6m2QbrGZDM3+BPRKgi3vIk1i4I7DnX0+/4EW9+9rWXuX/fx7SzScLO8M9VkHptofyWOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3VdQ/JQW2xPMim8zCOFf8hkkhRYNRphd6qm/vUDzZ8k=; b=ZbYKI7KhG/ZKmghcgRai5fKe9+CRMxQ8i9IPeAaUHXsl8KNHcNcjxrrdonNOn8RH80e9eZfipn9bx2AQHEO2sjGGz+UqCrzl0l+SMS6U7xNty3wq6tKNtRr44L373x4EQNIazxcstwWX2UJ6kxvQNhgUyTNpQTpOJueZa4NTCrEDIEpLsfg8AVDtIrdlyKgTM8vbxhlQV6FzNz7GWyzl9RSiq+JTc1e+nCF2vGOL3Tn2EtnDnVmZpNRtToA5wXWNLknmeLIMTYhvN/dehJ8GwBnF2LDxDeM3WOxuFHFqyAMs5CheBWolsaI6an3RlDSLHN44PzmLUL55tYeEqhINCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3VdQ/JQW2xPMim8zCOFf8hkkhRYNRphd6qm/vUDzZ8k=; b=jBP6R86nBzlxLcPUvDmBxJqbBcUj6ZgsfSl5kjPY8UpqfGUy1FeX2+Rahfs2JhQuy/b9+kmdlxwBDRxczxgoTm9FQV9BfX66PR9j0uCZwiDOjC96NLLPZSt4OrF3ZmI+xUvzutiOSf9d5G/JlOaKT3Zcb/uePULDjet1+OAe3psPu0wiLctlBqotRkTdJ+da0kjhgLvk9HTaaM4o+pTTrLfEf1clnar4hOCfEx2CncAf0y9orUJNwurPy4mSJXcaYrR9B5JZ5DlnprxJttDfJcZr1gS/L8837gCr10/joaPIeUfx7glRXP35cG1yqrm83wE5HD/pijeZXciXP/1Gxw== Received: from BN3NAM04FT062.eop-NAM04.prod.protection.outlook.com (10.152.92.53) by BN3NAM04HT169.eop-NAM04.prod.protection.outlook.com (10.152.92.189) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.13; Wed, 25 Mar 2020 01:37:42 +0000 Received: from CY4PR22MB0198.namprd22.prod.outlook.com (10.152.92.52) by BN3NAM04FT062.mail.protection.outlook.com (10.152.92.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.13 via Frontend Transport; Wed, 25 Mar 2020 01:37:42 +0000 Received: from CY4PR22MB0198.namprd22.prod.outlook.com ([fe80::218c:39dc:78e4:e939]) by CY4PR22MB0198.namprd22.prod.outlook.com ([fe80::218c:39dc:78e4:e939%11]) with mapi id 15.20.2835.023; Wed, 25 Mar 2020 01:37:42 +0000 From: Igor Vilhalba To: "freebsd-drivers@freebsd.org" Subject: Getting started at writting device drivers for FreeBSD Thread-Topic: Getting started at writting device drivers for FreeBSD Thread-Index: AQHWAkS5bxaSA2ElnEGBeg6lMuQJMA== Date: Wed, 25 Mar 2020 01:37:42 +0000 Message-ID: Accept-Language: pt-BR, en-US Content-Language: pt-BR X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:8FA4C82C04D115F75CE27D215B1CC693F2B976241ED87574E2897C233234B8F4; UpperCasedChecksum:B1752DAF64E3031CA57FC0DAB623003FD9FAC05C82CF8B5942FC59FD4AC8762B; SizeAsReceived:6720; Count:42 x-tmn: [okfqO9Vu9ueKKLP/7XxnNu+Si95pQ4LX] x-ms-publictraffictype: Email x-incomingheadercount: 42 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: d041171f-dd86-4041-af94-08d7d05d1c73 x-ms-traffictypediagnostic: BN3NAM04HT169: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: wuxhcxXBrJTY/kD4cRRJGaXQ+7Sn1hu5qyICTR2DJFmoihUJOiQl1x7ekxeMHftGlzmu8QS+591YfZUTp/yL/6U4/R1kdDbIfSrgEldmxZiREqN2mfA5eEw2oWWNEkNCuPfDFIhorHIdxmr8hT9z2kogS+BRNXV3kFp3DoXWsVEhfEH+gUSPcs/5XHjMFbV69xPibRTePpkLY+03TJck+vINlkYZsNe3H+2oI6TWqV8= x-ms-exchange-antispam-messagedata: H37dGOc4gLUijYEPdFZ2ql1RhJcrysfrpY1bkNwC8XGSt1NgA994bmPHf2WbvYHrik446c7cs1Sumir+5P9HL0zttCc2GQi0U0qgs3qff3t7TQaf9rgiJ0pdJ+hQDfznCCAbVZ6rROTCWQANKsWizQ== x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: d041171f-dd86-4041-af94-08d7d05d1c73 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Mar 2020 01:37:42.3494 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3NAM04HT169 X-Rspamd-Queue-Id: 48n9jW0P2dz46vY X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=outlook.com header.s=selector1 header.b=jBP6R86n; dmarc=pass (policy=none) header.from=outlook.com; spf=pass (mx1.freebsd.org: domain of igor.vilhalba@outlook.com designates 40.92.10.54 as permitted sender) smtp.mailfrom=igor.vilhalba@outlook.com X-Spamd-Result: default: False [-4.00 / 15.00]; MIME_TRACE(0.00)[0:+,1:+,2:~]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[outlook.com:s=selector1]; URIBL_BLOCKED(0.00)[outlook.com.multi.uribl.com,stackexchange.com.multi.uribl.com]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:40.92.0.0/15]; FREEMAIL_FROM(0.00)[outlook.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE_FREEMAIL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[4]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[outlook.com:+]; DMARC_POLICY_ALLOW(-0.50)[outlook.com,none]; RCVD_IN_DNSWL_NONE(0.00)[54.10.92.40.list.dnswl.org : 127.0.3.0]; TO_DN_EQ_ADDR_ALL(0.00)[]; IP_SCORE(0.00)[ipnet: 40.64.0.0/10(-3.75), asn: 8075(-3.12), country: US(-0.05)]; RWL_MAILSPIKE_POSSIBLE(0.00)[54.10.92.40.rep.mailspike.net : 127.0.0.17]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_ENVFROM(0.00)[outlook.com]; ASN(0.00)[asn:8075, ipnet:40.64.0.0/10, country:US]; ARC_ALLOW(-1.00)[i=1]; DWL_DNSWL_NONE(0.00)[outlook.com.dwl.dnswl.org : 127.0.3.0] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Wed, 25 Mar 2020 01:38:03 -0000 Hello everyone! I asked the following at Stack Exchange and was told to try mailing you f= or solving this: " I just decided to give FreeBSD a try last week and found out that my wire= less card (Ralink rt3290) isn't supported. I am good at C - and I know I have to for this task - and am very fond of A= ssembly, so I am thinking about writing a driver for ir. However, I have absolutely no experience with driver programming and would = like to know your opinion about whether it is feasible or not to do so. I d= on't know if it helps, but all of the three Linux distros I have installed = (Arch, Manjaro and openSUSE) have all the necessary drivers for my machine. I recently found out that I have a huge interest how the computer and the O= Ses (mainly *nix) work so I am willing to study deeply any good reading mat= erial you can point out for me. Also, if you have any advices and/or experi= ence in the field, I will be grateful for your help. Thank you very much for your attention and help! I really appreciate it. " Thank you in advance! Igor de Araujo Vilhalba From owner-freebsd-drivers@freebsd.org Wed Mar 25 01:53:45 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 CC3BB271F0B for ; Wed, 25 Mar 2020 01:53:45 +0000 (UTC) (envelope-from stephen.wall@redcom.com) Received: from smtp1.redcom.com (smtp1.redcom.com [192.86.3.143]) by mx1.freebsd.org (Postfix) with ESMTP id 48nB3m267Tz4D4S for ; Wed, 25 Mar 2020 01:53:40 +0000 (UTC) (envelope-from stephen.wall@redcom.com) Received: from localhost (localhost [127.0.0.1]) by smtp1.redcom.com (Postfix) with ESMTP id 36D41A11F for ; Tue, 24 Mar 2020 21:53:31 -0400 (EDT) X-Virus-Scanned: amavisd-new at redcom.com Received: from smtp1.redcom.com ([127.0.0.1]) by localhost (smtp1.redcom.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vrpuEyZxiWGp for ; Tue, 24 Mar 2020 21:53:22 -0400 (EDT) Received: from pie.redcom.com (pie [192.168.33.15]) by smtp1.redcom.com (Postfix) with ESMTP id 3A8F5A11E for ; Tue, 24 Mar 2020 21:53:22 -0400 (EDT) Received: from exch-03.redcom.com (exch-03.redcom.com [192.168.32.32]) by pie.redcom.com (8.11.7p1+Sun/8.10.2) with ESMTP id 02P1rMl29585 for ; Tue, 24 Mar 2020 21:53:22 -0400 (EDT) Received: from exch-03.redcom.com (fd00::8549:68c0:3d5f:ee62) by exch-03.redcom.com (fd00::8549:68c0:3d5f:ee62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.330.5; Tue, 24 Mar 2020 21:53:22 -0400 Received: from exch-03.redcom.com ([fe80::a442:ce34:c9c8:268f]) by exch-03.redcom.com ([fe80::a442:ce34:c9c8:268f%3]) with mapi id 15.02.0330.010; Tue, 24 Mar 2020 21:53:22 -0400 From: "Wall, Stephen" To: "freebsd-drivers@freebsd.org" Subject: Sending data packets to USB bulk endpoint Thread-Topic: Sending data packets to USB bulk endpoint Thread-Index: AdYCR/iL46k17/e8QeqVMbLCCQEh4Q== Date: Wed, 25 Mar 2020 01:53:21 +0000 Message-ID: <14d06ca2f98e42eca84e9b0d0df8b39e@redcom.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [192.168.84.20] MIME-Version: 1.0 X-Rspamd-Queue-Id: 48nB3m267Tz4D4S X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of stephen.wall@redcom.com designates 192.86.3.143 as permitted sender) smtp.mailfrom=stephen.wall@redcom.com X-Spamd-Result: default: False [-3.13 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.988,0]; HAS_XOIP(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:192.86.3.143/32]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/related,multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-drivers@freebsd.org]; DMARC_NA(0.00)[redcom.com]; RCPT_COUNT_ONE(0.00)[1]; URIBL_BLOCKED(0.00)[redcom.com.multi.uribl.com]; IP_SCORE(-0.94)[ip: (-2.45), ipnet: 192.86.3.0/24(-1.22), asn: 46679(-0.98), country: US(-0.05)]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; RCVD_IN_DNSWL_NONE(0.00)[143.3.86.192.list.dnswl.org : 127.0.10.0]; TO_DN_EQ_ADDR_ALL(0.00)[]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:~,4:~]; ASN(0.00)[asn:46679, ipnet:192.86.3.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_SEVEN(0.00)[7] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Wed, 25 Mar 2020 01:53:46 -0000 I posted this on the FreeBSD Drivers forum, got no response, so I'm trying = here. I am working on a driver to support a Silicon Labs I2S to USB bridge. Besid= es the audio portion, the chip supports a bulk endpoint which uses a docume= nted packet format to read & control 16 GPIO pins, and to pass messages to = & from an I2C bus. I have not previously worked with USB, or FreeBSD driver= s. I'm been handed a partially complete codebase - the audio stream works -= and I'm trying to get the GPIO controls working. My intent is to use ioctl= () calls to read and set the pins. Creating an entry in /dev and the associated character device structure for= the GPIO control is pretty straightforward. Where I'm getting stuck is try= ing to figure out how to get the messages I am creating in the driver down = to the bulk endpoint - the USB driver code is a bit overwhelming to a newco= mer, and I can't seem to find a function that fits "send this block of data= to this endpoint". The only way I've seen for interacting with bulk endpoi= nts is to write a driver based on usb_fifo_methods rather than cdevsw (per = "FreeBSD Device Drivers", chapter 15), which does not seem to fit what I'm = trying to do. I would appreciate any pointers experienced driver developers could give me= to get where I'm trying to go with this - either the name of the function = I'm looking for, or some other was to get that functionality. Thanks. - Steve -- Stephen Wall Senior Staff Software Engineer 585.924.7550 [https://www.redcom.com/images/email/REDCOM-Logo.png] REDCOM Laboratories, Inc. One Redcom Center Victor, NY 14564-0995 www.redcom.com DUNS 09-166-5919 | CAGE 1U548 Woman Owned Small Business From owner-freebsd-drivers@freebsd.org Wed Mar 25 06:08:43 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 37BB22773E8 for ; Wed, 25 Mar 2020 06:08:43 +0000 (UTC) (envelope-from m.e.sanliturk@gmail.com) Received: from mail-ot1-x336.google.com (mail-ot1-x336.google.com [IPv6:2607:f8b0:4864:20::336]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48nHjr6f8pz4ndk for ; Wed, 25 Mar 2020 06:08:32 +0000 (UTC) (envelope-from m.e.sanliturk@gmail.com) Received: by mail-ot1-x336.google.com with SMTP id k26so945273otr.2 for ; Tue, 24 Mar 2020 23:08:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RilUXGDUq7kVlPxEJDVWu/xx6vCuhgDO+dxOT2iUVF0=; b=oRtVwY0FTzta9Ze5tLPie7I8vvs2L2H5h20hIEhkLPWHReUeDZNfT16gCNiwVew8j7 NWZyTIgGl8uzpgsYk4z9roi1xgCXdCm2YXzdAgqgHKwjg2XzDuLDmX3fmuTkn6W8XetV SSLmSd9bT6NUPY4VpxbtRJCIQ5dEAe79BMrtiIUHKmF6uVvC0va3OmMbn9R/lm9Uqbfc AIYxjQKNycqJe0BZtjqTyFgzf76RhUbZlntGQddXAwCtRpKt552wo20l8MsliLJQncP/ /f9vDHJ/X/JX/5FYLohU8XoJf4En1gHNX+39U8C/L4NYgBJ9xTs9xxnC6i/EEqR+Ygjn 0ENQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RilUXGDUq7kVlPxEJDVWu/xx6vCuhgDO+dxOT2iUVF0=; b=ZLl1CifzqmLOrjtSHrRIzXyim461J2yFIhr3/D7lLayki6w+rhR2GqzJquoyBlLByp jRgK1+q02WMGXN71yPjShQOQDZ3M+TcuDUuikV2OXaIsBfOKu7HgXSYTGbmEF5tsQ0J2 48Pov1gm9hP5kaP0uGENJZMkn31uTNEzT1Uxh2/Pi9lztjzNu7xjgfE2FgXrxqzHEB0F FGE+DigvMk8d6cPYcFyzzpp4g5C/7u9WaJrrsy5UcS6kZWL/QjRGSlnlJT8DyAomW3ky zzgxsq0If3hvGeAUZpiqT4xVfo9sqbiW0Y26pxvxsbQBRAyQinY97oQt5saMfYrkuGDP 4Mzw== X-Gm-Message-State: ANhLgQ02TE6FAC7Zih8MLfOzLKJ/9hGuHuefUmwhBq3DnvEiCStBWIJl FjEH6lIAbh2WoOI70XAK7ikmLgxSBkwjsViLitAFN0kV X-Google-Smtp-Source: ADFU+vsXsBHx3CLSc0JONUauhKH5qkGfm7TXMoRy1MxIttTXpWWl93zS9HDrpcNQ8nu66RbzSyp5H5HWIX0LC0Z372Y= X-Received: by 2002:a05:6830:23a3:: with SMTP id m3mr1258113ots.265.1585116504305; Tue, 24 Mar 2020 23:08:24 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Mehmet Erol Sanliturk Date: Wed, 25 Mar 2020 09:07:47 +0300 Message-ID: Subject: Re: Getting started at writting device drivers for FreeBSD To: Igor Vilhalba Cc: "freebsd-drivers@freebsd.org" X-Rspamd-Queue-Id: 48nHjr6f8pz4ndk X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=oRtVwY0F; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mesanliturk@gmail.com designates 2607:f8b0:4864:20::336 as permitted sender) smtp.mailfrom=mesanliturk@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FREEMAIL_TO(0.00)[outlook.com]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.00)[ip: (-8.45), ipnet: 2607:f8b0::/32(-0.38), asn: 15169(-0.48), country: US(-0.05)]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; URIBL_BLOCKED(0.00)[nostarch.com.multi.uribl.com,stackexchange.com.multi.uribl.com]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-drivers@freebsd.org]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[6.3.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Wed, 25 Mar 2020 06:08:43 -0000 On Wed, Mar 25, 2020 at 4:39 AM Igor Vilhalba wrote: > Hello everyone! I asked the following at Stack Exchange< > https://unix.stackexchange.com/questions/574768/get-started-at-writing-device-drivers-for-freebsd?noredirect=1#comment1070055_574768> > and was told to try mailing you for solving this: > > " I just decided to give FreeBSD a try last week and found out that my > wireless card (Ralink rt3290) isn't supported. > > I am good at C - and I know I have to for this task - and am very fond of > Assembly, so I am thinking about writing a driver for ir. > However, I have absolutely no experience with driver programming and would > like to know your opinion about whether it is feasible or not to do so. I > don't know if it helps, but all of the three Linux distros I have installed > (Arch, Manjaro and openSUSE) have all the necessary drivers for my machine. > > I recently found out that I have a huge interest how the computer and the > OSes (mainly *nix) work so I am willing to study deeply any good reading > material you can point out for me. Also, if you have any advices and/or > experience in the field, I will be grateful for your help. > > Thank you very much for your attention and help! I really appreciate it. " > > Thank you in advance! > > Igor de Araujo Vilhalba > _______________________________________________ > I do not know whether the following book may be useful for you : https://nostarch.com/bsddrivers.htm FreeBSD Device Drivers A Guide for the Intrepid by Joseph Kong May 2012, 352 pp. ISBN-13: 978-1-59327-204-3 Mehmet Erol Sanliturk From owner-freebsd-drivers@freebsd.org Thu Mar 26 00:24:06 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 EADF1268B28 for ; Thu, 26 Mar 2020 00:24:05 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gate2.funkthat.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48nm1f5hMgz4Zsn for ; Thu, 26 Mar 2020 00:23:50 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.15.2/8.15.2) with ESMTPS id 02Q0NdtR012811 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 25 Mar 2020 17:23:39 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.15.2/8.15.2/Submit) id 02Q0Ncui012808; Wed, 25 Mar 2020 17:23:38 -0700 (PDT) (envelope-from jmg) Date: Wed, 25 Mar 2020 17:23:38 -0700 From: John-Mark Gurney To: "Wall, Stephen" Cc: "freebsd-drivers@freebsd.org" Subject: Re: Sending data packets to USB bulk endpoint Message-ID: <20200326002338.GS4213@funkthat.com> Mail-Followup-To: "Wall, Stephen" , "freebsd-drivers@freebsd.org" References: <14d06ca2f98e42eca84e9b0d0df8b39e@redcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <14d06ca2f98e42eca84e9b0d0df8b39e@redcom.com> X-Operating-System: FreeBSD 11.3-STABLE amd64 X-PGP-Fingerprint: D87A 235F FB71 1F3F 55B7 ED9B D5FF 5A51 C0AC 3D65 X-Files: The truth is out there X-URL: https://www.funkthat.com/ X-Resume: https://www.funkthat.com/~jmg/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (gold.funkthat.com [127.0.0.1]); Wed, 25 Mar 2020 17:23:39 -0700 (PDT) X-Rspamd-Queue-Id: 48nm1f5hMgz4Zsn X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of jmg@gold.funkthat.com has no SPF policy when checking 208.87.223.18) smtp.mailfrom=jmg@gold.funkthat.com X-Spamd-Result: default: False [-0.35 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-0.61)[-0.615,0]; RBL_NIXSPAM_FAIL(0.00)[18.223.87.208.ix.dnsbl.manitu.net:query timed out]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[funkthat.com]; AUTH_NA(1.00)[]; RBL_VIRUSFREE_UNKNOWN_FAIL(0.00)[18.223.87.208.bip.virusfree.cz:query timed out]; NEURAL_HAM_LONG(-0.54)[-0.544,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(-0.39)[ip: (-1.01), ipnet: 208.87.216.0/21(-0.51), asn: 32354(-0.41), country: US(-0.05)]; RCPT_COUNT_TWO(0.00)[2]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[jmg@funkthat.com,jmg@gold.funkthat.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:32354, ipnet:208.87.216.0/21, country:US]; FROM_NEQ_ENVFROM(0.00)[jmg@funkthat.com,jmg@gold.funkthat.com]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] 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: Thu, 26 Mar 2020 00:24:06 -0000 Wall, Stephen wrote this message on Wed, Mar 25, 2020 at 01:53 +0000: > I posted this on the FreeBSD Drivers forum, got no response, so I'm trying here. > > I am working on a driver to support a Silicon Labs I2S to USB bridge. Besides the audio portion, the chip supports a bulk endpoint which uses a documented packet format to read & control 16 GPIO pins, and to pass messages to & from an I2C bus. I have not previously worked with USB, or FreeBSD drivers. I'm been handed a partially complete codebase - the audio stream works - and I'm trying to get the GPIO controls working. My intent is to use ioctl() calls to read and set the pins. > > Creating an entry in /dev and the associated character device structure for the GPIO control is pretty straightforward. Where I'm getting stuck is trying to figure out how to get the messages I am creating in the driver down to the bulk endpoint - the USB driver code is a bit overwhelming to a newcomer, and I can't seem to find a function that fits "send this block of data to this endpoint". The only way I've seen for interacting with bulk endpoints is to write a driver based on usb_fifo_methods rather than cdevsw (per "FreeBSD Device Drivers", chapter 15), which does not seem to fit what I'm trying to do. > > I would appreciate any pointers experienced driver developers could give me to get where I'm trying to go with this - either the name of the function I'm looking for, or some other was to get that functionality. Is there a specific reason you want a native kernel driver instead of using something like libusb + cuse4bsd? Also, have you looked at usbdi(9)? It looks like it contains the information on how to setup a transfer w/ the buffer, and use that. https://www.freebsd.org/cgi/man.cgi?query=usbdi&manpath=FreeBSD+12.1-RELEASE+and+Ports -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-freebsd-drivers@freebsd.org Thu Mar 26 00:59:08 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 5231C26A077 for ; Thu, 26 Mar 2020 00:59:08 +0000 (UTC) (envelope-from stephen.wall@redcom.com) Received: from smtp1.redcom.com (smtp1.redcom.com [192.86.3.143]) by mx1.freebsd.org (Postfix) with ESMTP id 48nmp53YkMz3KtF for ; Thu, 26 Mar 2020 00:58:52 +0000 (UTC) (envelope-from stephen.wall@redcom.com) Received: from localhost (localhost [127.0.0.1]) by smtp1.redcom.com (Postfix) with ESMTP id C2117A1B5; Wed, 25 Mar 2020 20:58:44 -0400 (EDT) X-Virus-Scanned: amavisd-new at redcom.com Received: from smtp1.redcom.com ([127.0.0.1]) by localhost (smtp1.redcom.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id A4C+tHRyFiNc; Wed, 25 Mar 2020 20:58:42 -0400 (EDT) Received: from pie.redcom.com (pie [192.168.33.15]) by smtp1.redcom.com (Postfix) with ESMTP id 532FFA11E; Wed, 25 Mar 2020 20:58:42 -0400 (EDT) Received: from exch-03.redcom.com (exch-03.redcom.com [192.168.32.32]) by pie.redcom.com (8.11.7p1+Sun/8.10.2) with ESMTP id 02Q0wfl00109; Wed, 25 Mar 2020 20:58:41 -0400 (EDT) Received: from exch-03.redcom.com (fd00::8549:68c0:3d5f:ee62) by exch-03.redcom.com (fd00::8549:68c0:3d5f:ee62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.330.5; Wed, 25 Mar 2020 20:58:41 -0400 Received: from exch-03.redcom.com ([fe80::a442:ce34:c9c8:268f]) by exch-03.redcom.com ([fe80::a442:ce34:c9c8:268f%3]) with mapi id 15.02.0330.010; Wed, 25 Mar 2020 20:58:41 -0400 From: "Wall, Stephen" To: John-Mark Gurney CC: "freebsd-drivers@freebsd.org" Subject: RE: Sending data packets to USB bulk endpoint Thread-Topic: Sending data packets to USB bulk endpoint Thread-Index: AdYCR/iL46k17/e8QeqVMbLCCQEh4QA3lnYAAAeDR0A= Date: Thu, 26 Mar 2020 00:58:41 +0000 Message-ID: References: <14d06ca2f98e42eca84e9b0d0df8b39e@redcom.com> <20200326002338.GS4213@funkthat.com> In-Reply-To: <20200326002338.GS4213@funkthat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.84.20] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Rspamd-Queue-Id: 48nmp53YkMz3KtF X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of stephen.wall@redcom.com designates 192.86.3.143 as permitted sender) smtp.mailfrom=stephen.wall@redcom.com X-Spamd-Result: default: False [-3.25 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; HAS_XOIP(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:192.86.3.143/32]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[redcom.com]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[143.3.86.192.list.dnswl.org : 127.0.10.0]; IP_SCORE(-1.05)[ip: (-2.75), ipnet: 192.86.3.0/24(-1.38), asn: 46679(-1.10), country: US(-0.05)]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:46679, ipnet:192.86.3.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_SEVEN(0.00)[7] 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: Thu, 26 Mar 2020 00:59:08 -0000 > From: John-Mark Gurney > > Is there a specific reason you want a native kernel driver instead of > using something like libusb + cuse4bsd? Don't know what cuse4bsd is, I'll look into it. Is that going to be as str= aightforward as ioctl() calls for the GPIOs, and is it going to handle the = audio streams (to/from) well? > Also, have you looked at usbdi(9)? It looks like it contains the > information on how to setup a transfer w/ the buffer, and use that. >=20 > https://www.freebsd.org/cgi/man.cgi?query=3Dusbdi&manpath=3DFreeBSD+12.1- > RELEASE+and+Ports Thanks, I'll look at that. -spw From owner-freebsd-drivers@freebsd.org Thu Mar 26 18:36:53 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 F3AE22A6612; Thu, 26 Mar 2020 18:36:52 +0000 (UTC) (envelope-from rajfbsd@gmail.com) Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48pDGd15WMz4LK0; Thu, 26 Mar 2020 18:36:40 +0000 (UTC) (envelope-from rajfbsd@gmail.com) Received: by mail-wm1-x344.google.com with SMTP id m3so8334657wmi.0; Thu, 26 Mar 2020 11:36:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=X1eOnV1cHXGZHIcY2UD6eBxdPH/F4X7TS8hpS0WktgI=; b=Qji7iDrNfK0b6yTrLvUs1jqQJTA16apLRM1oII2A1K5uRwGfFJWgUKzAz0DeOkhPuy dlEfBgFXgUQ/heDXRUmVJpYIl9jibtfsnVEGoevMaN4NMsVRnq5450O1ZJtkw6cxj8G2 qigdUo3jun5ZnG6+4ZmqU6QI+I28D/ODUXw27CGnmdM4/YfRltKXzF00Ng9KcrJmCNqH AjSBtwIKJG6dNyJV905ykDLrb1fabi7Ui7UFYp24cK1yvGnRoh2s2MvKAbgJSo0OYxXi ouywLbLItkUiR6hfnafeyMPML+n3sEOpQ07LNoVgHF5cVtLw2JpFhmB3IeATcQc5Fh+m sB8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=X1eOnV1cHXGZHIcY2UD6eBxdPH/F4X7TS8hpS0WktgI=; b=E2WmmcSRLsOVoCDFfTJFy7TcwAbqc2Z/rWhaTsdUKBW77ljMYnkehOJAxYqbrWJBEZ VCQ4Y0jA1ghNkafKp7VpimxC+NUsfuJ7xfxFvSit4N9GGnFUMWOc5YFyWbUHCFrDJWb6 D483y/z3MjUqlsOK7BV0jZ4UiAheoRkGtfTE4gCVs8R2cXhMOwJBZLfotJU1Dz68ZSVn OOPsvFxru6G5x7PdNbG8fM9SpdaBadJCxhfd5Yp8TLLuRTcspkNLgHYEsQ9V4L0tzhoJ /BzpI/GifmisR5IJiBQNzyFyCSTDWQhZXQI08Tjmji09nzLfd4Eb9RPM8y4tVlyaYKz4 p3rw== X-Gm-Message-State: ANhLgQ1nd5GiNxOigD4TDmp5QzVSFzmVgPYqJpfFdWNdunpDPylKczVG a239rt6bNOwFjJBKeARxopJgUDebP/hbis/9sx+Eiw== X-Google-Smtp-Source: ADFU+vuQI2BY2pHD4WTLpkLjRC+tck7psDia+Rh3gQAwuxsJ+pc/invlavZjkqURleuqXTfRDPa9JT9JvQd4qZJJ5bs= X-Received: by 2002:a7b:c091:: with SMTP id r17mr1282287wmh.178.1585247793667; Thu, 26 Mar 2020 11:36:33 -0700 (PDT) MIME-Version: 1.0 From: Rajesh Kumar Date: Fri, 27 Mar 2020 00:06:21 +0530 Message-ID: Subject: Does FreeBSD has a generic PHY library as in Linux? To: freebsd-drivers@freebsd.org, FreeBSD Hackers X-Rspamd-Queue-Id: 48pDGd15WMz4LK0 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=Qji7iDrN; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of rajfbsd@gmail.com designates 2a00:1450:4864:20::344 as permitted sender) smtp.mailfrom=rajfbsd@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE_FREEMAIL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; IP_SCORE(0.00)[ip: (2.54), ipnet: 2a00:1450::/32(-2.38), asn: 15169(-0.48), country: US(-0.05)]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[4.4.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Thu, 26 Mar 2020 18:36:54 -0000 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? Thanks, Rajesh. From owner-freebsd-drivers@freebsd.org Fri Mar 27 18:19:16 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 9B4A227CD63; Fri, 27 Mar 2020 18:19:16 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: from mail-ua1-x943.google.com (mail-ua1-x943.google.com [IPv6:2607:f8b0:4864:20::943]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48pqqt1x7Cz4R6D; Fri, 27 Mar 2020 18:19:05 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: by mail-ua1-x943.google.com with SMTP id f9so3856093uaq.8; Fri, 27 Mar 2020 11:19:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=D8ty1rPs8gG8K1p4AyCqMOWB2QDSV3icSCEtgZkoR6E=; b=NTD5TwmS3IiWphib1ANl93Jwss32wij1vJcFI0sdzcTxpnTQA8azaPb13NzTkOS9Cy 4Dm+t7ZqizOwLSHWHYLjc3oEWfQf5KrsAFue8IC45uJ8rSIC98gci2Yrap85YXzxxOyx QFARoy5dsgysm61+/FoWxZRXF/IVa0MbfCSIpVhgBV+sCY755LKknn8WMPTt3yvN3ymu otCByvp7KFqkZ6WaQzWmbgbvE4Ssc3ei/DpFpqfbuYfQ2ntxLVJuQblE7Ts149wI+qsT 9UNR3JUKchdIHpWRTjqCHs3HbccEV0pbkAEpatGOxWZ2w9EJ75QsD2y11cDv+dynoPDo WSww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=D8ty1rPs8gG8K1p4AyCqMOWB2QDSV3icSCEtgZkoR6E=; b=cEHkMn0GxAftXufQGKtKv83bJmhHvdRHdHghfGPGjpXJ63jWO3CaiwhUHMw0oRYy4n Kq7sPzM4DULK6HzUO8MYypEQi1K0HvZP2lUJHniOxo21fihHwAMcRX2A7hn8tZLQeanw qVkxuI6ODyMpnODXrvQyOh0ERKgw909Y2c0waoQ5K+aarKombBahkqyazEntKBN66J9a rUz7q9Ru527PA2qpfS33sjfrRkFEbNY1n/vitLfnbSAMY3CEBQMSpTsHm+/uhxrdLn6x slM+wW3biUPaluFJcx8f3HcQm8N0m5tVk9ydlDo39h67NcOgDMYFByiyhF2ByrIeahZm cvOA== X-Gm-Message-State: AGi0PuYeC2ZwzGlLM1Q9eI+byoUHKPF5T2ATuN9wXxp6gbDQVhtfTfXX vhg0hxKkbDRpFfvB2g+bGP0p8RBAODJcEq1+NkqtzQ== X-Google-Smtp-Source: ADFU+vtPVaFt/wY/opM5qhgDhhiNUrRrDpoiit6ZkeM9BdIZ477VNN5Mo0cN3MMGREWjaBotpXxSM3v15+SE5kHvMRI= X-Received: by 2002:a25:7c2:: with SMTP id 185mr90954ybh.44.1585332788979; Fri, 27 Mar 2020 11:13:08 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:a291:0:0:0:0:0 with HTTP; Fri, 27 Mar 2020 11:13:08 -0700 (PDT) In-Reply-To: References: From: Oliver Pinter Date: Fri, 27 Mar 2020 19:13:08 +0100 Message-ID: Subject: Re: Does FreeBSD has a generic PHY library as in Linux? To: Rajesh Kumar Cc: "freebsd-drivers@freebsd.org" , FreeBSD Hackers X-Rspamd-Queue-Id: 48pqqt1x7Cz4R6D X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=NTD5TwmS; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of oliverpntr@gmail.com designates 2607:f8b0:4864:20::943 as permitted sender) smtp.mailfrom=oliverpntr@gmail.com X-Spamd-Result: default: False [-0.98 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; URI_COUNT_ODD(1.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.980,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; IP_SCORE(0.00)[ip: (1.16), ipnet: 2607:f8b0::/32(-0.37), asn: 15169(-0.47), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[3.4.9.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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:19:17 -0000 On Thursday, March 26, 2020, Rajesh Kumar wrote: > 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? I'm not 100% confident, there is an "iflib" in the kernel. > > Thanks, > Rajesh. > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > From owner-freebsd-drivers@freebsd.org Fri Mar 27 18:32:29 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 7478227D6EF for ; Fri, 27 Mar 2020 18:32:29 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48pr7B549hz4WcD for ; Fri, 27 Mar 2020 18:32:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x741.google.com with SMTP id 139so1996938qkd.9 for ; Fri, 27 Mar 2020 11:32:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PncNjIig3pdO9QqkN7QWW5pu+unC9/8O1VhwVphVW/o=; b=hZaX621lmvub61tuxpYA3mUV7XqYKNZR6ufaw6aj0Ua72GJqxRDj/KTXspoa0Cnm0X NuTKNB810EouME7uHCvlmJ6S8UEKvS36qcB4wTEKpnB++jCx/N1qB4XCUah5bE8frJ9F wvT4h7JrgqUN6s+NQKi7rng2ZlNo1qA/7Il6QJgZVSzyFaHys8DRVZ9OwryOqLmyNo4J Te/CfgocVVxJItTqeOSx7+0kmTEYyacKC8XPLdF3ds3vRfZ1KmeW5Diw9M3SM1gUrFbK XERR/Iq4sQBGidcRrlsPsNvi66n+k2Lb5XaPPtTgTojQ3ASxcEuvGdVVpSZ8eV3TsuSI mtNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PncNjIig3pdO9QqkN7QWW5pu+unC9/8O1VhwVphVW/o=; b=ew1CocFZT9ayPzthQGd7dyU+qwmmzqswl5a00DjqIekWTBIFFktfT3hrOYwheg0ZBq BkXLXBu0NdCyxJ39KEk1z2rrbTph+gs0bXUh8OPmpFZnZRzwGP6afug3tFUGTQMkIAfT 16WZ6c0aB2gMO4xVkVQ/+TJZNe/ecjpvrbnGbtve1+7aLYaijsLayS+RXTtlU+zu40JP B5018zUA/7YAyudFIU1MRILzuLyo1tQ6huBW2R8tQ9kEP3vkfALKubxHbkJghvWW/dGO VEOImRGEVlFofmZgC8CKFV0y1WS5OT91Evih/0DNLyOHE9z11atzIIKMsI+jl74a14TU VkYQ== X-Gm-Message-State: ANhLgQ1izsPFYGYpqLjNaJW1tajz8V0hJNs790//KPklwo8n9alpsWOq DS/mjyfdg/GzWCqYhQaofBfHr4P07REuOcnjqyojBw== X-Google-Smtp-Source: ADFU+vt8KH9iJFzAhlAi30MD1+mHFld4mZWWwWlRcq3nd1czNr+cTP2rxBDAW/gjVPq4ZS/gLhWyjq9iBun7OPnDXKA= X-Received: by 2002:a05:620a:22ef:: with SMTP id p15mr638914qki.495.1585333935255; Fri, 27 Mar 2020 11:32:15 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Warner Losh Date: Fri, 27 Mar 2020 12:32:03 -0600 Message-ID: Subject: Re: Does FreeBSD has a generic PHY library as in Linux? To: Rajesh Kumar Cc: freebsd-drivers@freebsd.org, FreeBSD Hackers X-Rspamd-Queue-Id: 48pr7B549hz4WcD X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=hZaX621l; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::741) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-0.09 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.92)[-0.921,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; IP_SCORE(-0.17)[ip: (0.02), ipnet: 2607:f8b0::/32(-0.37), asn: 15169(-0.47), country: US(-0.05)]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-drivers@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; URI_COUNT_ODD(1.00)[3]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[1.4.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; FREEMAIL_TO(0.00)[gmail.com]; SUBJECT_ENDS_QUESTION(1.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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:32:29 -0000 On Thu, Mar 26, 2020, 12:38 PM Rajesh Kumar wrote: > 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? > Miibus does all that for FreeBSD. Warner Thanks, > Rajesh. > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > 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 From owner-freebsd-drivers@freebsd.org Sat Mar 28 11:02:28 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 C9996278045; Sat, 28 Mar 2020 11:02:28 +0000 (UTC) (envelope-from rajfbsd@gmail.com) Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48qG5c0TYJz4bBZ; Sat, 28 Mar 2020 11:02:27 +0000 (UTC) (envelope-from rajfbsd@gmail.com) Received: by mail-wr1-x444.google.com with SMTP id h15so14807966wrx.9; Sat, 28 Mar 2020 04:02:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=An3x10ookyGo6pKxX+/6xQXEd5JCzt7gaFKZxKboIEw=; b=ZyPv1ZvETJyGouYUcjJiWoCZCN7IXlV103iq6rYwzVMvTtXSZfdj4dTQ+oXGvaf3S8 IJeBKGxHFv7uE8R7LENd0dSTnAWxb3RVcUD8jiZrDCK8wJ4F7b+a8czEjO9zyXHjYx4/ ICzbNlrzs3igJokzrbn+97/xpbZKn4cZFSEOndvPhuxHvf1uJQVzllhHYNz7Bx/eI07u einafJI4R1J/vuRCswHx5bl8hoUmI/ENuFEeU2HTBq5HHa1y+7YQCpODZrSg0X9Utcfy tYbW2yD1mmHohHxocACVAMHJSwVsXErLQ+WhH2fh9bNMLZam6X/Ifc11AFIMtCKVDqrZ QssQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=An3x10ookyGo6pKxX+/6xQXEd5JCzt7gaFKZxKboIEw=; b=BvxnQjqc06aO3hHAl/PFvG5I6hKBbTkzgR59GT7AP516ufL0A+HL3aze0DnHsvxPOf lZc8QRmmht2S2xS0i59dSbWltHk/fexFIZ4vP1xQnl0zRrhNRKSx5uPRcREajsMRBop5 4iyNh7DWQjOLfdKsY/xspSDdMQ0L8zB5eCYWtI/QpTrd5caYdHttBV52NlPOhC4GDeo7 PT+itX+NJyDD2CQLeNH6zzgcLIs3Bn+OtLaCG22NHNP9fqnI0gsi8XwLNe/MIWB3MpyX TCPtMQraQ3orhig1jki1aSR1rWzgfQszwiX3vmDOSIEi4osz+ZihI5VNb4aFMFH2yy/4 IrbQ== X-Gm-Message-State: ANhLgQ0rIAH7cbTmzhnre/q5nsa56AI3gvg9s5rjQCgZsKG19eiw3DBp QBeN/bPM3KKUZL94olhU/7RNyLgKfIWDPBbV2AQs5g== X-Google-Smtp-Source: ADFU+vuylKidjjZW3FbZ4IngKu2UE5HDWyrUBOwzPDL+e+8eLSjwupTE4XHwQ5ce0yR1zhH1G/zoXyP/AgjjodVJgLw= X-Received: by 2002:a05:6000:1c4:: with SMTP id t4mr4192123wrx.89.1585393337575; Sat, 28 Mar 2020 04:02:17 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Rajesh Kumar Date: Sat, 28 Mar 2020 16:32:06 +0530 Message-ID: Subject: Re: Does FreeBSD has a generic PHY library as in Linux? To: =?UTF-8?B?U3RlZmFuIEXDn2Vy?= Cc: freebsd-drivers@freebsd.org, FreeBSD Hackers X-Rspamd-Queue-Id: 48qG5c0TYJz4bBZ X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Sat, 28 Mar 2020 11:02:29 -0000 Thank you all for the response . I will go through the MIIBUS stuff and come back if I have any questions. Thanks, Rajesh. On Sat, Mar 28, 2020 at 12:18 AM Stefan E=C3=9Fer wrote: > Am 26.03.20 um 19:36 schrieb Rajesh Kumar: > > Hi, > > > > I am porting a network driver from Linux to FreeBSD. The driver in Lin= ux > > 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 shoul= d > > 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 >