History log of /haiku/src/libs/compat/freebsd_network/compat/sys/bus.h
Revision Date Author Comments
# 843a8ad7 18-Feb-2022 Augustin Cavalier <waddlesplash@gmail.com>

freebsd_network: Break bus macros out into a separate header.

Now copied directly from FreeBSD.

Also change copyright info of the main file, as the remaining parts have
almost entirely been written by me at this point.


# 3001575d 08-Jan-2019 Augustin Cavalier <waddlesplash@gmail.com>

freebsd_network: Add child drivers directly rather than finding symbols.

This method is much less error-prone than the prior one, as that required
the driver structure to have an exported symbol identical to its "name"
field, a fact that is usually true but not always (we've had an ifdef
in the atheroswifi driver for a while now due to this.)

So when we have it, we now just use the driver_t* directly, which
should push any of these problems from the run-time stage to the
compile-time stage. It's also a significant performance
improvement.


# 8267c193 29-Dec-2018 Augustin Cavalier <waddlesplash@gmail.com>

freebsd_network: Lots of additions and modifications for iflib.


# 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.


# db3f8e22 14-Jan-2013 Jerome Duval <jerome.duval@gmail.com>

bus_read_region_1: implement with bus_space_read_region_1


# 648db733 03-Jan-2013 Jérôme Duval <jerome.duval@gmail.com>

Update FreeBSD network drivers with the 9.1 release


# 8060e778 08-Feb-2012 Jérôme Duval <jerome.duval@gmail.com>

Network drivers are updated from FreeBSD 9.0

* updated drivers are 3com, ar81xx, atheros813x, attansic_l1, attansic_l2,
broadcom440x, broadcom570x, dec21xxx, ipro100, ipro1000, jmicron2x0,
marvell_yukon, nforce, rtl8139, rtl81xx, syskonnect, via_rhine, vt612x


# ff35fe1f 25-Jun-2011 Jérôme Duval <korli@users.berlios.de>

added some missing functions and definitions for FreeBSD 8.2


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


# 3d9728ba 10-Dec-2009 Colin Günther <coling@gmx.de>

* Changed definition of driver_intr_t to the way it is defined in FreeBSD.
The internal_intr structure needed to be adapted accordingly, otherwise it
would not compile anymore.
This definition is needed by the aironet (if_an.c) driver I'm currently
porting.
* Extending FreeBSD compat layer a bit in preparation of porting the remaining
wlan drivers.


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


# 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


# f90a5e34 07-Jul-2008 Michael Lotz <mmlr@mlotz.ch>

Adding bus_barrier macro to compatibility layer.

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


# 82edabb1 30-Nov-2007 Axel Dörfler <axeld@pinc-software.de>

Implemented device_detach(), and bus_generic_detach() - both are needed by
the updated mii code on destruction.


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


# 080b265a 29-Nov-2007 Axel Dörfler <axeld@pinc-software.de>

Completely renovated the FreeBSD compatibility layer:
* Removed NETDEV() and DEVNET() macros and functionality.
* The exported devices are now attached to ifnet objects only, therefore, the
ifnet object now has the receive queue, and everything else a device could
need.
* There is now a root device where everything else is attached, it currently
only holds the pci_info structure, so it's more or less a PCI child.
* This simplified the device handling a bit everywhere.
* We now attach drivers already in init_driver() - this is needed as drivers
may publish more than one interface when being attached.
* Implemented device_delete_child(), device_attach() (which bus_generic_attach()
now uses), device_is_attached(), and device_is_alive().
* Therefore, if_initname() does now the actual job of registering the devices.
* On open, if_init() is called which comes pretty close to what our open()
is supposed to do.
* Updated ukphy.c to the one from FreeBSD 7 where used (we should probably
move that into the compat layer, anyway).
* The MII driver array must now be NULL terminated; therefore you don't need
to specify the count anymore.
* Moved PCI code from compat.c to bus.c.
* Moved the driver code from device.c to driver.c.
* Removed superfluous init_compat_layer() function.
* Fixed a few bugs, a few things weren't brought down correctly.
* The rtl8139 interrupt routine now checks if it really was the cause of the
interrupt - this code is not tested, either, it may not work (which would
then require a work-around like I did for the 3com driver).
* The HAIKU_PROTECT_INTR_REGISTER in the rtl8139 driver was pretty much useless
which is why I removed it.
* Probably introduced a lot of new bugs, though - I haven't tested this code
at all yet. It will probably just crash :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23019 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


# 4b2286de 09-May-2007 Hugo Santos <hugosantos@nowhere.fake>

freebsd compat. layer: MII subsystem (needs testers, more to come).


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


# b6509511 09-May-2007 Hugo Santos <hugosantos@nowhere.fake>

freebsd compat. layer: split device structure to handle for miibus devices, added a new network_device.


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


# 2a275df5 09-May-2007 Hugo Santos <hugosantos@nowhere.fake>

freebsd compat. layer: a couple more definitions, minimal, mostly adding a new glue method to re-enable device interrupts since if_rl (rtl 8139) will require it.


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


# 0747d47e 08-May-2007 Hugo Santos <hugosantos@nowhere.fake>

freebsd compat. layer: added swi taskqueue and a couple more methods that if_xl needs. also marked some as unimplemented so its clearer what is left to be done.


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


# 25d42ceb 08-May-2007 Hugo Santos <hugosantos@nowhere.fake>

freebsd compat. layer: a few more definitions, preparing for a DMA-using driver.


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


# e1a99f77 06-May-2007 Hugo Santos <hugosantos@nowhere.fake>

freebsd compat. layer: use a thread for deferred interrupt handling. fixed a issue with bus_space_write_N. init the receive queue on device creation.


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


# 00212abe 04-May-2007 Hugo Santos <hugosantos@nowhere.fake>

freebsd compat. layer: a few more methods, preparing for pcnet


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


# 747c938b 04-May-2007 Hugo Santos <hugosantos@nowhere.fake>

freebsd compat. layer: now the glue code properly references the required methods so we have proper linkage with gcc 4


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


# 336ce703 04-May-2007 Hugo Santos <hugosantos@nowhere.fake>

freebsd compat. layer: some initial glue code


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


# ac156738 03-May-2007 Hugo Santos <hugosantos@nowhere.fake>

freebsd compat. layer: added freebsd's busdma implementation. we are still missing MII and the ifp/ether methods.


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


# 0490692a 02-May-2007 Hugo Santos <hugosantos@nowhere.fake>

freebsd compat. layer: resource allocation and interrupt setup


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20989 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


# db3f8e227bcf5bf6db82a5b7cd21a85a759d898e 14-Jan-2013 Jerome Duval <jerome.duval@gmail.com>

bus_read_region_1: implement with bus_space_read_region_1


# 648db7333e8d0ae6e0386ba1e71eafb6a793c97d 03-Jan-2013 Jérôme Duval <jerome.duval@gmail.com>

Update FreeBSD network drivers with the 9.1 release


# 8060e7787fa3f8e45f8a148e968d8f99ef094623 08-Feb-2012 Jérôme Duval <jerome.duval@gmail.com>

Network drivers are updated from FreeBSD 9.0

* updated drivers are 3com, ar81xx, atheros813x, attansic_l1, attansic_l2,
broadcom440x, broadcom570x, dec21xxx, ipro100, ipro1000, jmicron2x0,
marvell_yukon, nforce, rtl8139, rtl81xx, syskonnect, via_rhine, vt612x


# ff35fe1fdf212697254a7da012b3c7550c142393 25-Jun-2011 Jérôme Duval <korli@users.berlios.de>

added some missing functions and definitions for FreeBSD 8.2


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


# 3d9728baf9c8fe6c19a326606525a7af5349eb17 10-Dec-2009 Colin Günther <coling@gmx.de>

* Changed definition of driver_intr_t to the way it is defined in FreeBSD.
The internal_intr structure needed to be adapted accordingly, otherwise it
would not compile anymore.
This definition is needed by the aironet (if_an.c) driver I'm currently
porting.
* Extending FreeBSD compat layer a bit in preparation of porting the remaining
wlan drivers.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34620 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


# f90a5e346de727f273fd1ab9c2a2641eb3cc1404 07-Jul-2008 Michael Lotz <mmlr@mlotz.ch>

Adding bus_barrier macro to compatibility layer.

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


# 82edabb115e95c42279a6bf40517b4d9dfee0591 30-Nov-2007 Axel Dörfler <axeld@pinc-software.de>

Implemented device_detach(), and bus_generic_detach() - both are needed by
the updated mii code on destruction.


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


# 080b265acd2f9903dcaf3d1e5076b0ecb8c20c6c 29-Nov-2007 Axel Dörfler <axeld@pinc-software.de>

Completely renovated the FreeBSD compatibility layer:
* Removed NETDEV() and DEVNET() macros and functionality.
* The exported devices are now attached to ifnet objects only, therefore, the
ifnet object now has the receive queue, and everything else a device could
need.
* There is now a root device where everything else is attached, it currently
only holds the pci_info structure, so it's more or less a PCI child.
* This simplified the device handling a bit everywhere.
* We now attach drivers already in init_driver() - this is needed as drivers
may publish more than one interface when being attached.
* Implemented device_delete_child(), device_attach() (which bus_generic_attach()
now uses), device_is_attached(), and device_is_alive().
* Therefore, if_initname() does now the actual job of registering the devices.
* On open, if_init() is called which comes pretty close to what our open()
is supposed to do.
* Updated ukphy.c to the one from FreeBSD 7 where used (we should probably
move that into the compat layer, anyway).
* The MII driver array must now be NULL terminated; therefore you don't need
to specify the count anymore.
* Moved PCI code from compat.c to bus.c.
* Moved the driver code from device.c to driver.c.
* Removed superfluous init_compat_layer() function.
* Fixed a few bugs, a few things weren't brought down correctly.
* The rtl8139 interrupt routine now checks if it really was the cause of the
interrupt - this code is not tested, either, it may not work (which would
then require a work-around like I did for the 3com driver).
* The HAIKU_PROTECT_INTR_REGISTER in the rtl8139 driver was pretty much useless
which is why I removed it.
* Probably introduced a lot of new bugs, though - I haven't tested this code
at all yet. It will probably just crash :-)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23019 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


# 4b2286de8280643f2859b280d79fcbaf56f78cae 09-May-2007 Hugo Santos <hugosantos@nowhere.fake>

freebsd compat. layer: MII subsystem (needs testers, more to come).


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


# b650951128733ee316bb4c9b985b99363b2e72e8 09-May-2007 Hugo Santos <hugosantos@nowhere.fake>

freebsd compat. layer: split device structure to handle for miibus devices, added a new network_device.


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


# 2a275df505bbca8550b30cc6a92b86e6a3c94f2a 09-May-2007 Hugo Santos <hugosantos@nowhere.fake>

freebsd compat. layer: a couple more definitions, minimal, mostly adding a new glue method to re-enable device interrupts since if_rl (rtl 8139) will require it.


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


# 0747d47e40a090591b09e6fbf2c750ac7b2359dc 08-May-2007 Hugo Santos <hugosantos@nowhere.fake>

freebsd compat. layer: added swi taskqueue and a couple more methods that if_xl needs. also marked some as unimplemented so its clearer what is left to be done.


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


# 25d42ceb99f745c136482397667bc9ebb6bd5013 08-May-2007 Hugo Santos <hugosantos@nowhere.fake>

freebsd compat. layer: a few more definitions, preparing for a DMA-using driver.


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


# e1a99f77d48faf3bd1d0e007afebb96c34016893 06-May-2007 Hugo Santos <hugosantos@nowhere.fake>

freebsd compat. layer: use a thread for deferred interrupt handling. fixed a issue with bus_space_write_N. init the receive queue on device creation.


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


# 00212abe1c16a1cd1fdef6f0fddb2a67e48af934 04-May-2007 Hugo Santos <hugosantos@nowhere.fake>

freebsd compat. layer: a few more methods, preparing for pcnet


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


# 747c938b9b5f92da067800cd995378e20ba23760 04-May-2007 Hugo Santos <hugosantos@nowhere.fake>

freebsd compat. layer: now the glue code properly references the required methods so we have proper linkage with gcc 4


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


# 336ce7039c6658a6a6bbff64a4c8d756c28bcd45 04-May-2007 Hugo Santos <hugosantos@nowhere.fake>

freebsd compat. layer: some initial glue code


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


# ac156738e97ccf179f4baa62cd2b27af10d2876c 03-May-2007 Hugo Santos <hugosantos@nowhere.fake>

freebsd compat. layer: added freebsd's busdma implementation. we are still missing MII and the ifp/ether methods.


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


# 0490692add2c4fd629739feaff601d87c8b309d6 02-May-2007 Hugo Santos <hugosantos@nowhere.fake>

freebsd compat. layer: resource allocation and interrupt setup


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20989 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