From owner-freebsd-wireless@freebsd.org Sat Sep 2 08:11:03 2017 Return-Path: Delivered-To: freebsd-wireless@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12DD3E06325 for ; Sat, 2 Sep 2017 08:11:03 +0000 (UTC) (envelope-from mueller6722@twc.com) Received: from dnvrco-oedge-vip.email.rr.com (dnvrco-outbound-snat.email.rr.com [107.14.73.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "dnvrco-oedge-vip.email.rr.com", Issuer "dnvrco-oedge-vip.email.rr.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id EB5507CEA0 for ; Sat, 2 Sep 2017 08:11:02 +0000 (UTC) (envelope-from mueller6722@twc.com) Received: from [74.134.208.22] ([74.134.208.22:58754] helo=localhost) by dnvrco-omsmta03 (envelope-from ) (ecelerity 3.6.9.48312 r(Core:3.6.9.0)) with ESMTP id F1/BE-31699-F876AA95; Sat, 02 Sep 2017 08:10:55 +0000 Date: Sat, 02 Sep 2017 08:10:49 +0000 Message-ID: From: "Thomas Mueller" To: freebsd-wireless@freebsd.org Subject: Re: Adding wifi source code References: <68.D0.25924.050D9A95@dnvrco-omsmta02> X-RR-Connecting-IP: 107.14.64.88:25 X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Sep 2017 08:11:03 -0000 > Here's a pdf giving a decent overview: > https://www.bsdcan.org/2006/papers/freebsd.device.driver.slides.pdf > But, the FreeBSD handbook also goes over the process as well. > https://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/driverbasics.html > For the guy that took Linux drivers, you might want to look into the Linux > Emulator, that would be the easiest path especially if those Linux drivers > includes a lot of Linux specific headers. > The NetBSD drivers should be a bit easier to port. > Best, > Owen I downloaded it but haven't read yet. Actually, it's the arch-handbook, not in the regular FreeBSD handbook. Thanks for the leads! > I was planning on also porting over the Atheros AR9271 driver from NetBSD > (athn(4) /usr/src/sys/dev/usb/if_athn_usb.c), but not until I finish the > current device I am working on. It might not be for a while though. There > is likely a lot of shared code with ath(4) on FreeBSD > (/usr/src/sys/dev/athn). NetBSD seems to separate all code between USB and > PCI, whereas FreeBSD combines drivers. Let me know if I can help out, as I > already own this device and would be willing to test out code or > troubleshoot with you. > I am currently working on another driver from Linux to FreeBSD. The core > concepts are the same, but a lot of code is in different order. FreeBSD > drivers have an attach function that assign function pointers to the softc > struct. The Linux equivalent is in DRIVERNAME_ops. In my case, this: > http://src.illumos.org/source/xref/linux-master/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.c#224 > Hope this helps. But yes, would love to work on AR9271! What is the rtl8188ee? Maybe I'd recognize the brand and model. I have Hiro H50191, which uses rsu driver. That last URL looks like something related to Illumos and OpenIndiana. My Atheros AR9271 is (quasi-)USB, an inseparable part of the motherboard in contrast to the Hiro H50191 which is a USB-stick wireless adapter. It has sometimes worked on NetBSD, but more often would fail to load firmware. On latest NetBSD-current, it stops the kernel from booting unless I disable it or comment out in kernel config. GENERIC kernel reboots immediately without showing any messages. OpenBSD also has AR9271 driver and Realtek re. I have NetBSD installations but no OpenBSD. I would like, at first, if possible, when I have a driver to build, to build the module rather than the whole kernel every time. I am familiar with C and C++ but think I need to brush up. Any online leads/references? Tom