History log of /haiku/src/libs/compat/freebsd_network/compat/sys/bus_dma.h
Revision Date Author Comments
# 231f740c 27-Jan-2023 Augustin Cavalier <waddlesplash@gmail.com>

openbsd_network & drivers: Implement the real bus_dmamem functions.

This required the addition of some slight modifications to the main
(FreeBSD compat) bus_dma implementation.

Allows some #ifdefs from iaxwifi/idualwifi to be dropped, and will
ease the porting of some future drivers.

Tested with idualwifi7260, seems to work as before.


# b12b802c 01-Jul-2022 Augustin Cavalier <waddlesplash@gmail.com>

freebsd_network: Add an extended bus_dmamap_sync API for partial syncs.

To preserve proper semantics with the OpenBSD layer, this is needed.


# d66ceb73 02-Jun-2022 Augustin Cavalier <waddlesplash@gmail.com>

freebsd_network: Implement bouncing and address validation in bus_dma.

This has been missing since the rewrite in 26b95c15f255904694ce8224b6f21f0b931a9cff.

Until now it seems to not have been a problem since buffer sizes
were generally small enough and did not cross page boundaries due
to alignment guarantees. However, now that we have enabled jumbo
frames by default, some drivers do hit DMA limits without bouncing,
as these frames cross pages.

So, now we implement a basic bouncing system. Unlike FreeBSD which
maintains a global "bounce pages" cache that it pulls from,
we use per-dmamap bounce buffers, lazily allocated only if needed.
I tested this by forcing all non-"prohibited" dmamaps to bounce all
transactions, and the rtl81xx driver still worked that way (though
not all drivers may as they have expectations about contiguously
allocated memory never getting bounced.)

This should fix #17763. Hopefully it will also fix #17766 as well.


# 26b95c15 22-Nov-2019 Augustin Cavalier <waddlesplash@gmail.com>

freebsd_network: Completely overhaul bus_dma implementation.

The old implementation was based on an ancient copy of the FreeBSD
busdma code for x86, and did not make a bunch of assumptions that
we make basically everywhere else (for instance, that we can request
arbitrarily-aligned contiguous physical memory from the VM.)

As a consequence, it had a significant amount of code devoted to
bounce pages, which are just a waste of resources on x86, and
for that matter, probably any other architecture Haiku will ever
be ported to. (Even if we do need to run on some system where
only a small portion of system memory can be accessed by devices,
likely we would reserve that memory for just this occasion anyway.)

I was initially under the impression that the bounce-pages code
never turned on, but apparently due to the "alignment" check
(and also the "Maxmem" check, which was to defined to 32KB...?!)
it does indeed activate on a variety of systems, and maybe
(in the case of drivers that do not call sync() properly) even
is the cause of some of our ported driver breakage.

The new implementation is pretty much optimized for Haiku,
and shares almost no code or structure with the old one (save
for a few functions that really only have one proper implementation.)

Tested with ipro1000 and rtl81xx. Regressions are more than possible,
so please don't hesitate to file bugs if your network driver now
fails to come up (or you get KDLs.)


# dba28784 24-Dec-2018 Augustin Cavalier <waddlesplash@gmail.com>

freebsd11_network -> freebsd_network.

FreeBSD 12 has no major changes to the ifnet KPIs that constitute a
source compatibility break, save a single one related to locking
which doesn't really apply to us, and so we don't need to create
a "freebsd12_network" directory to work through the upgrades.


# 14627e08 22-Oct-2009 Colin Günther <coling@gmx.de>

* reordering of headerfile inclusion to comply to FreeBSD 8
ordering.
this makes porting driver (especially wifi ones) more
convinient
* based on FreeBSD svn revision 196691

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33739 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 239239c8 25-Nov-2007 Axel Dörfler <axeld@pinc-software.de>

* Updated the FreeBSD compatibility layer for network drivers to FreeBSD 7
(RELENG_7_BP).
* There are many white spots, though, most notable PCI MSI(-X) support, and
jumbo frames.
* Fixed removing interrupts for the INTR_FAST case. Since FreeBSD 7 added
a new interrupt "filter" mechanism, we can finally report if the interface
was handled by a device or not (though only very few devices support this
yet).
* Updated the 3com, rtl8139, e1000, and via_rhine drivers to the latest code
base. They all compile, but I haven't tested them after the changes yet!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22991 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 750ddafd 02-May-2007 Hugo Santos <hugosantos@nowhere.fake>

initial work towards a FreeBSD network driver source level compatibility layer.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20985 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 14627e087b920676d05d45cec5f28688744e1fdb 22-Oct-2009 Colin Günther <coling@gmx.de>

* reordering of headerfile inclusion to comply to FreeBSD 8
ordering.
this makes porting driver (especially wifi ones) more
convinient
* based on FreeBSD svn revision 196691

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33739 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 239239c8a0c6a2671f8f236ba32abf03e78f0c27 25-Nov-2007 Axel Dörfler <axeld@pinc-software.de>

* Updated the FreeBSD compatibility layer for network drivers to FreeBSD 7
(RELENG_7_BP).
* There are many white spots, though, most notable PCI MSI(-X) support, and
jumbo frames.
* Fixed removing interrupts for the INTR_FAST case. Since FreeBSD 7 added
a new interrupt "filter" mechanism, we can finally report if the interface
was handled by a device or not (though only very few devices support this
yet).
* Updated the 3com, rtl8139, e1000, and via_rhine drivers to the latest code
base. They all compile, but I haven't tested them after the changes yet!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22991 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 750ddafd50d75eff1baf4e34ed5f037863fb9cdc 02-May-2007 Hugo Santos <hugosantos@nowhere.fake>

initial work towards a FreeBSD network driver source level compatibility layer.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20985 a95241bf-73f2-0310-859d-f6bbb57e9c96