Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Jun 2018 09:16:50 +0000
From:      "Thomas Mueller" <mueller6722@twc.com>
To:        freebsd-wireless@freebsd.org
Subject:   Re: Haiku's usage of the FreeBSD net80211 stack and drivers
References:  <CAEesM77h45EcKPBN4h7REhG==d=3CzVbjyVj6wKTzrD-dw_MiA@mail.gmail.com>

| previous in thread | raw e-mail | index | archive | help
from waddlesplash:

I remember you from the Haiku lists!

> I'm one of the developers of the Haiku operating system [1]. For those
> who are unfamiliar, it's a free and open-source reimplementation &
> continuation of BeOS. We have our own kernel and driver stack,
> initially (~2003) forked from the NewOS kernel, but now very
> substantially diverged in both structure and essence from it.
        
> Most of our network stack (buffers, TCP, UDP, etc.) is a work of our
> own creation. However, we are still a pretty small team, so for
> network drivers we have (since 2010) a compatibility layer for FreeBSD
> network drivers. This layer essentially implements all of the FreeBSD
> KPIs (ifnet, busdma, mbuf, etc.) that network drivers use. We've
> fallen behind a bit; until earlier this year we were still using said
> drivers from FreeBSD 9, but we're finally rectifying that now.
        
> To make a (very) long story short, I have indeed managed to sync
> FreeBSD 11.1's net80211 code as well as the iwn driver and make them
> work on Haiku, with many thanks to the assistance of various people
> from EFnet#freebsd-wifi. Upon hearing that we had Haiku-specific
> patches to said code, Adrian suggested he'd like to look at them,
> mentioning that he'd also potentially like to de-FreeBSDify net80211,
> and directed me to this mailing list.
        
> The specific changes which might be candidates for merging into
> FreeBSD are as follows:

>  1. no *SYSINIT() -- our runtime loader doesn't support it, and we
> have no plans / otherwise need for it, so instead we call all
> functions that SYSINIT would manually in the appropriate location.
>  2. ieee80211req_scan_result now contains a complete
> ieee80211_channel, not just the freq and flags (we use this in
> userland)
>  3. NULL checks on dst in ieee80211_output(), as we pass in NULL from
> our hooks code in some places
>  4. casts so the header files can compile as C++ (ieee80211_haiku is a
> .cpp not a .c so we can use Haiku kernel routines which are C++)
>  5. calling ieee80211_vap_xmitpkt instead of iv_output in
> ieee80211_output(), as our iv_output is pretty much ethernet/IFQ_DRV
> queue-only.
>  6. Behavioral change to ieee80211_check_scan: default to
> IEEE80211_SCAN_NOJOIN if we are not explicitly looking for a SSID
>  7. Behavioral change to ieee80211_ioctl_setmlme relating to
> wpa_supplicant behavior (see lengthy comment in the diff)
        
> The complete diff (minus ieee80211_haiku) can be found here: [2]
> (Disregard the stuff blacking out counter(9) usage -- the manpage for
> it said that it was non-atomic and had some specific behavior re.
> interrupts so I deferred looking into it, but it looks like that's an
> implementation detail; I'll probably implement it on our end as an
> atomic.)

> The patchset isn't too large, so even if none of these get merged,
> it's not really a huge burden on our end. The harder part is always
> the KPI changes that get made, as our compatibility layer makes a lot
> of assumptions about net80211 and driver behavior (e.g. the
> ieee80211com / IFQ_DRV removal took me quite a while and a good amount
> of assistance to figure out.)
        
> Anyway, thanks for the help so far, and thanks for a (mostly) portable
> net80211 stack!

-waddlesplash

Are these imports from FreeBSD only for wireless, or would they also be for wired Ethernet?

On one computer, my Ethernet worked with Haiku R1A4 (November 2012) but does not work with FreeBSD, and there was no Ethernet driver in FreeBSD < 10.0.  (re for Realtek 8111E).

I notice an update in that driver in FreeBSD-current but apparently not in 11-STABLE.

I have not rebuilt FreeBSD since then but want to (preferably current rather than stable) to see if it works.

I was able to use wireless (Hiro H50191 with rsu) on that computer with FreeBSD.  NetBSD had no problem with that Ethernet, but dhcpcd doesn't work, and I have to use ifconfig directly.

I also need to see how to boot FreeBSD in UEFI mode to see if it will be more stable that way (and NetBSD too).

But a greater concern now is to cross-compile the Linux toolchains; then I can build a Linux system and hopefully have a chance at cross-compiling Haiku.

Tom




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?>