History log of /haiku/src/libs/compat/freebsd_network/Jamfile
Revision Date Author Comments
# 869de36d 09-Oct-2023 Augustin Cavalier <waddlesplash@gmail.com>

freebsd_network: Remove the need for <kernel_c++_structs.h>.

Use sizeof()+roundup() to build a char[] of the correct size,
and add a static_assert to ensure it stays so.

The <kernel_c++_structs.h> header needs to have its dependency
manually declared, and not all consumers of this file properly
declared it as such. This then fixes a concurrent build problem.

Fixes #17965 as this was the only consumer of this header.


# 8548a4ad 12-May-2022 Augustin Cavalier <waddlesplash@gmail.com>

freebsd_network: Adaptations in preparation for the OpenBSD layer.

Most of these changes however add things that FreeBSD has (with a few
exceptions noted in comments) which the OpenBSD shim layer merely needs
to make use of.

(FreeBSD used to have support for IFF_NEEDSGIANT but removed it. The
support instated here is very similar to what FreeBSD used to have.)


# 423ee7c6 24-Feb-2022 Augustin Cavalier <waddlesplash@gmail.com>

freebsd_network: Adjust and rewrite attach code for USB support.

init_hardware now takes 2 devices arrays: one for PCI and one for USB
drivers, respectively.

The few drivers that have their own __haiku_handle_fbsd_drivers_list
are also adjusted at the same time.


# 462fb495 18-Feb-2022 Augustin Cavalier <waddlesplash@gmail.com>

freebsd_network: Clean up and break PCI methods out of bus.cpp.


# 33c03035 03-Feb-2022 Augustin Cavalier <waddlesplash@gmail.com>

freebsd_network: Rewrite ConditionVariable-using code.

The old code was not at all correct with respect to interlocking.
The new code should be, and is also much simpler.


# ec295973 30-Sep-2021 Augustin Cavalier <waddlesplash@gmail.com>

freebsd_network: Put MII and USB headers in the common generated directory.

They are not in any way architecture-specific. Simplifies the various driver Jamfiles.
This also paves the way for some upcoming changes that make the kernel always be built
with the non-legacy GCC...


# 3b3bcbf7 17-Apr-2021 Adrien Destugues <pulkomandy@pulkomandy.tk>

Update build packages repository

- Switch to Python3
- Switch to mawk instead of gawk
- Update ffmpeg (there are several new dependencies)
- Update ICU
- Fix various pre-existing problems with packages not being properly
declared for gcc2 (but somehow it ended up working)
- remove curl, subversion, mercurial

Confirmed that both nightly and release images are building fine on both
32 and 64bit. However, non-x86 architecture may require re-bootstrapping
to do a complete nightly or release image build (the minimal profile
should be fine)

Fixes #16751.

Change-Id: Iacac92923c4113b3e0a49a64b0b4cc1b8e2f5e2e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3871
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# e6076c6d 11-Oct-2020 Augustin Cavalier <waddlesplash@gmail.com>

freebsd_network: Define _KERNEL for C++ files too.

This also allows the removal of a function that is also in the cpufunc.h header.


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


# 56cb682b 22-Nov-2019 Augustin Cavalier <waddlesplash@gmail.com>

freebsd_network: Moderate reorganization.

* Rename device.c to device_hooks.c, as this is what it really contains.
* Rename compat.c to device.c, as it implements the generic "device"
related functions, both for compat layer internals and FreeBSD
public ones.
* Move malloc and related operations out of the now-device.c,
and place them in a new "malloc.cpp", which also incorporates
compat_cpp.cpp.

No functional change intended.


# 6ef670c3 03-Jan-2019 Augustin Cavalier <waddlesplash@gmail.com>

freebsd_network: Consolidate and unify SMP-related definitions.

Previously I implemented "curcpu" as ipro1000 used it, independent
of all the other SMP functions, as an optimization. Now, iflib
wants to use these functions all together, so they have to produce
consistent results.


# da60a673 01-Jan-2019 Augustin Cavalier <waddlesplash@gmail.com>

freebsd_network: Implement SYSINIT.

Based on the already-existing linkersets framework, which seems to
work pretty well for the atheroswifi driver, so it should work for
this case also.


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


# 5bb83200 13-Apr-2017 Adrien Destugues <pulkomandy@pulkomandy.tk>

Fix a few more uses of PAGE_SIZE


# 5774b5af 11-Jul-2012 Alex Smith <alex@alex-smith.me.uk>

C++ified remaining C users of arch_cpu.h.


# 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


# 76c4f839 15-Dec-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* priv.c -> priv.cpp
* Defined curthread to NULL. Using Haiku's struct thread is not acceptable
without proper locking and the only purpose ATM is to pass it to priv_check()
which ignores it anyway.


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


# e7c3a8ff 19-Jul-2010 Axel Dörfler <axeld@pinc-software.de>

Fixed a few regressions that were introduced during the last months:
* device_attach() must not load the network stack. Besides being completely
unbalanced, this was also one reason why the stack could not be unloaded
anymore. Instead, it's now done in compat_open(), as before.
* This also fixes network booting from FreeBSD drivers - the stack apparently
could not be initialized that early.
* Replaced the previous network stack based callout implementation with one
that mostly copies its functionality, but has no dependencies. Furthermore,
it runs at a higher priority (the one of the network timer should also be
revisited, though).
* Fixed mtx_owned() to work without KDEBUG as well. It's not a good idea to
introduce code that behaves completely different based on debug settings.
* Minor cleanup.


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


# c5e72271 21-Jun-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Reimplemented _kernel_contigmalloc() to support the physical address
restrictions.


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


# a22b78e6 04-Dec-2009 Colin Günther <coling@gmx.de>

Making use of the C++ structures in C only code feature introduced with
r34441. This allows to completely stick to FreeBSD's conditional cv_* function
semantics as 'struct cv' variables are freed automatically now.
This also gets rid of the dynamically de-/allocating of ConditionalVariables.
Thank you Ingo for helping me through this.


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


# cb89b085 30-Nov-2009 Colin Günther <coling@gmx.de>

* Completing the condition variable subsystem. Thanks to ingo for the heads
up.
* Removed the cv_waiters structure member as it is nowhere used in the network
subsytem by FreeBSD either.
* Removing the sleepqueue dummy functions completely, as Haiku's condition
variable subsystem is well suited for this purpose.
* This fixes the build, too, as it introduces the new implementation of pause
and _pause.
* Implementing the msleep and wakeup functions based on the condition variable
implementation.


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


# 44ec2ebd 18-Feb-2009 Karsten Heimrich <host.haiku@gmx.de>

* update freebsd compat with stubbed eventhandler
* get e1000 to compile
* remove dev/em from the build (might be removed later on)
* tested on VirtualBox (gcc2,gcc4), VMware(gcc4) and natively on
ThinkPad T500 (gcc4)

* courtesy of Michael Weirauch (emwe)



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


# 81915026 17-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

Make use of the new private B_NO_HANDLED_INFO in the FreeBSD compatibility layer
for now. This is a workaround and should be removed once we have proper
interrupt return values from FreeBSD drivers. Should work around interrupt
storms for shared interrupts with some network cards that use a FreeBSD driver.


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


# 86c86537 12-Nov-2008 Jérôme Duval <korli@users.berlios.de>

* generates miidevs.h with the freebsd awk script
* update net/if_media.h


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


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

* compat_open() still needs to get the stack module, as the callout
functionality needs it.
* callout_init_mtx() now initializes the timer manually, since the stack
might not have been loaded yet (since a device is now attached in
init_driver()).
* Minor other fixes; the FreeBSD compatibility layer should now be functional
again.
* Accidently put pci.c into the repository, but that was never meant to happen.


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


# 8b4ee93b 24-Nov-2007 Axel Dörfler <axeld@pinc-software.de>

Build fix; fbsd_ether.c did not compile anymore (but was not recompiled since
the wrong header was included).


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


# d8f9591f 30-Oct-2007 Axel Dörfler <axeld@pinc-software.de>

* Fixed the loop in bus_generic_attach() that I accidently broke with the previous commit.
* Calmed down the FreeBSD compatibility layer considerably.
* Now also sets the arpcom's ac_ifp field for completeness.


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


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

freebsd compat. layer: fixed a couple warnings, use KernelStaticLibrary as suggested by Ingo.


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


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

freebsd compat. layer: splited freebsd original code into own files.


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


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

freebsd compat. layer: couple fixes, sending now works with PCNET. enabled ifmedia_ioctl, and when opening a device, set it down, change media to ETHER/AUTO and set it back up so it sees a IFF_UP.


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


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

freebsd compat. layer: added mii placeholders, callout implementation.


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


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

freebsd compat. layer: ifnet and ethernet methods. missing MII and callout


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


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

freebsd compat. layer: added mbuf allocation and if_media support


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


# 522fc5d8 02-May-2007 Hugo Santos <hugosantos@nowhere.fake>

freebsd compat. layer, a few more methods.


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


# 5774b5afa4f73fb010a7b7af03a9aa5f6deaec93 11-Jul-2012 Alex Smith <alex@alex-smith.me.uk>

C++ified remaining C users of arch_cpu.h.


# 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


# 76c4f8396524f83538317b785b66ca1e591f18c3 15-Dec-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

* priv.c -> priv.cpp
* Defined curthread to NULL. Using Haiku's struct thread is not acceptable
without proper locking and the only purpose ATM is to pass it to priv_check()
which ignores it anyway.


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


# e7c3a8ffd7434cff9662772e1fd12d336b2073ec 19-Jul-2010 Axel Dörfler <axeld@pinc-software.de>

Fixed a few regressions that were introduced during the last months:
* device_attach() must not load the network stack. Besides being completely
unbalanced, this was also one reason why the stack could not be unloaded
anymore. Instead, it's now done in compat_open(), as before.
* This also fixes network booting from FreeBSD drivers - the stack apparently
could not be initialized that early.
* Replaced the previous network stack based callout implementation with one
that mostly copies its functionality, but has no dependencies. Furthermore,
it runs at a higher priority (the one of the network timer should also be
revisited, though).
* Fixed mtx_owned() to work without KDEBUG as well. It's not a good idea to
introduce code that behaves completely different based on debug settings.
* Minor cleanup.


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


# c5e722714e8806c40ecbce4adb7fafa2997cc544 21-Jun-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Reimplemented _kernel_contigmalloc() to support the physical address
restrictions.


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


# a22b78e6932d2ebbf4fb725568eb4d46b9d8a21f 04-Dec-2009 Colin Günther <coling@gmx.de>

Making use of the C++ structures in C only code feature introduced with
r34441. This allows to completely stick to FreeBSD's conditional cv_* function
semantics as 'struct cv' variables are freed automatically now.
This also gets rid of the dynamically de-/allocating of ConditionalVariables.
Thank you Ingo for helping me through this.


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


# cb89b085e32373e2b5cec80f8ea596a5524c34ea 30-Nov-2009 Colin Günther <coling@gmx.de>

* Completing the condition variable subsystem. Thanks to ingo for the heads
up.
* Removed the cv_waiters structure member as it is nowhere used in the network
subsytem by FreeBSD either.
* Removing the sleepqueue dummy functions completely, as Haiku's condition
variable subsystem is well suited for this purpose.
* This fixes the build, too, as it introduces the new implementation of pause
and _pause.
* Implementing the msleep and wakeup functions based on the condition variable
implementation.


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


# 44ec2ebd200f18741d00fb8a76ddfb85485541cd 18-Feb-2009 Karsten Heimrich <host.haiku@gmx.de>

* update freebsd compat with stubbed eventhandler
* get e1000 to compile
* remove dev/em from the build (might be removed later on)
* tested on VirtualBox (gcc2,gcc4), VMware(gcc4) and natively on
ThinkPad T500 (gcc4)

* courtesy of Michael Weirauch (emwe)



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


# 81915026c1ed4d0ad427b2e4397cc2b131c2a91f 17-Feb-2009 Michael Lotz <mmlr@mlotz.ch>

Make use of the new private B_NO_HANDLED_INFO in the FreeBSD compatibility layer
for now. This is a workaround and should be removed once we have proper
interrupt return values from FreeBSD drivers. Should work around interrupt
storms for shared interrupts with some network cards that use a FreeBSD driver.


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


# 86c86537bc6f03baf731b5579ac6edf1c3d256e4 12-Nov-2008 Jérôme Duval <korli@users.berlios.de>

* generates miidevs.h with the freebsd awk script
* update net/if_media.h


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


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

* compat_open() still needs to get the stack module, as the callout
functionality needs it.
* callout_init_mtx() now initializes the timer manually, since the stack
might not have been loaded yet (since a device is now attached in
init_driver()).
* Minor other fixes; the FreeBSD compatibility layer should now be functional
again.
* Accidently put pci.c into the repository, but that was never meant to happen.


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


# 8b4ee93be676fa051255c63ebe04af514cf18df8 24-Nov-2007 Axel Dörfler <axeld@pinc-software.de>

Build fix; fbsd_ether.c did not compile anymore (but was not recompiled since
the wrong header was included).


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


# d8f9591fa7ff318195cbe37367bbd11cb245b46f 30-Oct-2007 Axel Dörfler <axeld@pinc-software.de>

* Fixed the loop in bus_generic_attach() that I accidently broke with the previous commit.
* Calmed down the FreeBSD compatibility layer considerably.
* Now also sets the arpcom's ac_ifp field for completeness.


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


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

freebsd compat. layer: fixed a couple warnings, use KernelStaticLibrary as suggested by Ingo.


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


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

freebsd compat. layer: splited freebsd original code into own files.


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


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

freebsd compat. layer: couple fixes, sending now works with PCNET. enabled ifmedia_ioctl, and when opening a device, set it down, change media to ETHER/AUTO and set it back up so it sees a IFF_UP.


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


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

freebsd compat. layer: added mii placeholders, callout implementation.


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


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

freebsd compat. layer: ifnet and ethernet methods. missing MII and callout


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


# 82256564e26214c7041963436ea6ede7fdc9706e 02-May-2007 Hugo Santos <hugosantos@nowhere.fake>

freebsd compat. layer: added mbuf allocation and if_media support


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


# 522fc5d8456aecd1f82fca13df7cd5249c9b3096 02-May-2007 Hugo Santos <hugosantos@nowhere.fake>

freebsd compat. layer, a few more methods.


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