hrev51993 adds 2 changesets to branch 'master'
old head: 52d1e933539592ac333b9bcc15339d7d3e254f64
new head: e1c961d028af9e7d5684e55eb2c143167f90fd01
overview:
https://git.haiku-os.org/haiku/log/?qt=range&q=e1c961d028af+%5E52d1e9335395
----------------------------------------------------------------------------
9ac815126911: ipro1000: Delete the old BeOS driver.
"Where we're going, we don't need BeOS drivers..."
e1c961d028af: network: Update comments in Jamfile with respect to ethernet
driver upgrades.
[ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]
----------------------------------------------------------------------------
27 files changed, 7 insertions(+), 13690 deletions(-)
src/add-ons/kernel/drivers/network/Jamfile | 14 +-
.../kernel/drivers/network/ipro1000/Jamfile | 29 -
.../kernel/drivers/network/ipro1000/LICENSE | 29 -
.../kernel/drivers/network/ipro1000/README | 351 --
.../kernel/drivers/network/ipro1000/debug.h | 76 -
.../drivers/network/ipro1000/dev/e1000/LICENSE | 31 -
.../drivers/network/ipro1000/dev/e1000/README | 406 --
.../kernel/drivers/network/ipro1000/device.c | 404 --
.../kernel/drivers/network/ipro1000/device.h | 57 -
.../kernel/drivers/network/ipro1000/driver.c | 219 -
.../kernel/drivers/network/ipro1000/driver.h | 33 -
.../kernel/drivers/network/ipro1000/if_compat.c | 260 -
.../kernel/drivers/network/ipro1000/if_compat.h | 303 --
.../kernel/drivers/network/ipro1000/if_em.c | 2968 ----------
.../kernel/drivers/network/ipro1000/if_em.h | 340 --
.../kernel/drivers/network/ipro1000/if_em_hw.c | 5063 ------------------
.../kernel/drivers/network/ipro1000/if_em_hw.h | 2120 --------
.../drivers/network/ipro1000/if_em_osdep.c | 175 -
.../drivers/network/ipro1000/if_em_osdep.h | 243 -
.../drivers/network/ipro1000/ipro1000.settings | 14 -
.../kernel/drivers/network/ipro1000/mempool.c | 143 -
.../kernel/drivers/network/ipro1000/mempool.h | 31 -
.../kernel/drivers/network/ipro1000/setup.h | 26 -
.../kernel/drivers/network/ipro1000/timer.c | 215 -
.../kernel/drivers/network/ipro1000/timer.h | 44 -
.../kernel/drivers/network/ipro1000/util.c | 69 -
.../kernel/drivers/network/ipro1000/util.h | 34 -
############################################################################
Commit: 9ac815126911098f9cd7ff4dc98c050520feb3d9
URL: https://git.haiku-os.org/haiku/commit/?id=9ac815126911
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Fri Jun 8 03:07:48 2018 UTC
ipro1000: Delete the old BeOS driver.
"Where we're going, we don't need BeOS drivers..."
----------------------------------------------------------------------------
diff --git a/src/add-ons/kernel/drivers/network/ipro1000/Jamfile
b/src/add-ons/kernel/drivers/network/ipro1000/Jamfile
index 2e28b00a30..f39212d533 100644
--- a/src/add-ons/kernel/drivers/network/ipro1000/Jamfile
+++ b/src/add-ons/kernel/drivers/network/ipro1000/Jamfile
@@ -1,32 +1,3 @@
SubDir HAIKU_TOP src add-ons kernel drivers network ipro1000 ;
-SetSubDirSupportedPlatformsBeOSCompatible ;
-
-# For ether_driver.h
-UsePrivateHeaders net ;
-
-KernelAddon beos_ipro1000 :
- driver.c
- device.c
- if_compat.c
- if_em.c
- if_em_hw.c
- if_em_osdep.c
- mempool.c
- timer.c
- util.c
- ;
-
-# Installation
-
-HaikuInstall install-networking : /boot/home/config/add-ons/kernel/drivers/bin
:
- beos_ipro1000
-;
-
-HaikuInstallRelSymLink install-networking :
/boot/home/config/add-ons/kernel/drivers/dev/net :
- <installed>beos_ipro1000 :
- installed-symlink
-;
-
SubInclude HAIKU_TOP src add-ons kernel drivers network ipro1000 dev ;
-
diff --git a/src/add-ons/kernel/drivers/network/ipro1000/LICENSE
b/src/add-ons/kernel/drivers/network/ipro1000/LICENSE
deleted file mode 100644
index 71290f3544..0000000000
--- a/src/add-ons/kernel/drivers/network/ipro1000/LICENSE
+++ /dev/null
@@ -1,29 +0,0 @@
-$FreeBSD: /repoman/r/ncvs/src/sys/dev/em/LICENSE,v 1.1.2.2 2003/04/04 18:39:28
pdeuskar Exp $
-Copyright (c) 2001-2003, Intel Corporation
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- 3. Neither the name of the Intel Corporation nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
diff --git a/src/add-ons/kernel/drivers/network/ipro1000/README
b/src/add-ons/kernel/drivers/network/ipro1000/README
deleted file mode 100644
index 56ed9711a0..0000000000
--- a/src/add-ons/kernel/drivers/network/ipro1000/README
+++ /dev/null
@@ -1,351 +0,0 @@
-$FreeBSD: /repoman/r/ncvs/src/sys/dev/em/README,v 1.1.2.8 2003/09/03 16:36:45
pdeuskar Exp $
-FreeBSD* Driver for the Intel(R) PRO/1000 Family of Adapters
-============================================================
-
-July 24, 2003
-
-
-Contents
-========
-
-- Overview
-- Supported Adapters
-- Building and Installation
-- Speed and Duplex Configuration
-- Additional Configurations
-- Known Limitations
-- Support
-- License
-
-
-Overview
-========
-
-This file describes the FreeBSD* driver, version 1.7.x, for the Intel(R)
-PRO/1000 Family of Adapters. This driver has been developed for use with
-FreeBSD, version 4.7.
-
-For questions related to hardware requirements, refer to the documentation
-supplied with your Intel PRO/1000 adapter. All hardware requirements listed
-apply to use with FreeBSD.
-
-
-Supported Adapters
-==================
-
-The following Intel network adapters are compatible with the drivers in this
-release:
-
- Controller Adapter Name Board IDs
- ---------- ------------ ---------
-
- 82542 PRO/1000 Gigabit Server Adapter 700262-xxx, 717037-xxx
-
- 82543 PRO/1000 F Server Adapter 738640-xxx, A38888-xxx,
- A06512-xxx
-
- 82543 PRO/1000 T Server Adapter A19845-xxx, A33948-xxx
-
- 82544 PRO/1000 XT Server Adapter A51580-xxx
-
- 82544 PRO/1000 XF Server Adapter A50484-xxx
-
- 82544 PRO/1000 T Desktop Adapter A62947-xxx
-
- 82540 PRO/1000 MT Desktop Adapter A78408-xxx
-
- 82541 PRO/1000 MT Desktop Adapter C91016-xxx
-
- 82545 PRO/1000 MT Server Adapter A92165-xxx
-
- 82545 PRO/1000 MF Server Adapter A91622-xxx
-
- 82545 PRO/1000 MF Server Adapter(LX) A91624-xxx
-
- 82546 PRO/1000 MT Dual Port Server Adapter A92111-xxx
-
- 82546 PRO/1000 MF Dual Port Server Adapter A91620-xxx
-
- 82546EB PRO/1000 MT Quad Port Server Adapter C11227-xxx
-
- 82547 PRO/1000 CT Network Connection
-
-
-To verify your Intel adapter is supported, find the board ID number on the
-adapter. Look for a label that has a barcode and a number in the format of
-123456-001 (six digits hyphen three digits). Match this to the list of
-numbers above.
-
-For more information on how to identify your adapter, go to the Adapter &
-Driver ID Guide at:
-
- http://support.intel.com/support/network/adapter/pro100/21397.htm
-
-For the latest Intel network drivers for FreeBSD, see:
-
- http://appsr.intel.com/scripts-df/support_intel.asp
-
-
-Building and Installation
-=========================
-
-NOTE: The driver can be installed as a dynamic loadable kernel module or
- compiled into the kernel. You must have kernel sources installed in
- order to compile the driver module.
-
-In the instructions below, x.x.x is the driver version as indicated in the
-name of the driver tar file.
-
-1. Move the base driver tar file to the directory of your choice. For
- example, use /home/username/em or /usr/local/src/em.
-
-2. Untar/unzip the archive:
-
- tar xvfz em-x.x.x.tar.gz
-
- This will create an em-x.x.x directory.
-
-3. To create a loadable module, perform the following steps.
- NOTE: To compile the driver into the kernel, go directly to step 4.
-
- a. To compile the module
-
- cd em-x.x.x
- make
-
- b. To install the compiled module in system directory:
-
- make install
-
- c. If you want the driver to load automatically when the system is
booted:
-
- 1. Follow steps a, and b above to compile and install the module
- 2. Edit /boot/loader.conf, and add the following line:
-
- if_em_load="YES"
-
-4. To compile the driver into the kernel:
-
- cd em-x.x.x/src
-
- cp if_em* /usr/src/sys/dev/em
-
- cp Makefile.kernel /usr/src/sys/modules/em/Makefile
-
- Edit the /usr/src/sys/conf/files.i386 file, and add the following lines:
-
- dev/em/if_em.c optional em
-
- dev/em/if_em_hw.c optional em
-
- Remove the following lines from the /usr/src/sys/conf/files.i386 file,
- if they exist:
-
- dev/em/if_em_fxhw.c optional em
- dev/em/if_em_phy.c optional em
-
- Edit the kernel configuration file (i.e., GENERIC or MYKERNEL) in
- /usr/src/sys/i386/conf, and ensure the following line is present:
-
- device em
-
- Compile and install the kernel. The system must be rebooted for the kernel
- updates to take effect. For additional information on compiling the
- kernel, consult the FreeBSD operating system documentation.
-
-5. To assign an IP address to the interface, enter the following:
-
- ifconfig em<interface_num> <IP_address>
-
-6. Verify that the interface works. Enter the following, where <IP_address>
- is the IP address for another machine on the same subnet as the interface
- that is being tested:
-
- ping <IP_address>
-
-7. To configure the IP address to remain after reboot, edit /etc/rc.conf,
- and create the appropriate ifconfig_em<interface_num>�entry:
-
- ifconfig_em<interface_num>="<ifconfig_settings>"
-
- Example usage:
-
- ifconfig_em0="inet 192.168.10.1 netmask 255.255.255.0"
-
- NOTE: For assistance, see the ifconfig man page.
-
-
-Speed and Duplex Configuration
-==============================
-
-By default, the adapter auto-negotiates the speed and duplex of the
-connection. If there is a specific need, the ifconfig utility can be used to
-configure the speed and duplex settings on the adapter. Example usage:
-
- ifconfig em<interface_num> <IP_address> media 100baseTX mediaopt
- full-duplex
-
- NOTE: Only use mediaopt to set the driver to full-duplex. If mediaopt is
- not specified and you are not running at gigabit speed, the driver
- defaults to half-duplex.
-
-
-This driver supports the following media type options:
-
- autoselect - Enables auto-negotiation for speed and duplex.
-
- 10baseT/UTP - Sets speed to 10 Mbps. Use the ifconfig mediaopt
- option to select full-duplex mode.
-
- 100baseTX - Sets speed to 100 Mbps. Use the ifconfig mediaopt
- option to select full-duplex mode.
-
- 1000baseTX - Sets speed to 1000 Mbps. In this case, the driver
- supports only full-duplex mode.
-
- 1000baseSX - Sets speed to 1000 Mbps. In this case, the driver
- supports only full-duplex mode.
-
-For more information on the ifconfig utility, see the ifconfig man page.
-
-
-Additional Configurations
-=========================
-
-The driver supports Transmit/Receive Checksum Offload and Jumbo Frames on
-all but the 82542-based adapters. For specific adapters, refer to the
-Supported Adapters section.
-
- Jumbo Frames
- ------------
- To enable Jumbo Frames, use the ifconfig utility to increase the MTU
- beyond 1500 bytes.
-
- NOTES: Only enable Jumbo Frames if your network infrastructure supports
- them.
-
- The Jumbo Frames setting on the switch must be set to at least
- 22 bytes larger than that of the adapter.
-
- The Jumbo Frames MTU range for Intel Adapters is 1500 to 16114. The default
- MTU range is 1500. To modify the setting, enter the following:
-
- ifconfig em<interface_num> <hostname or IP address> mtu 9000
-
- To confirm an interface's MTU value, use the ifconfig command. To confirm
- the MTU used between two specific devices, use:
-
- route get <destination_IP_address>
-
- VLANs
- -----
- To create a new VLAN pseudo-interface:
-
- ifconfig <vlan_name> create
-
- To associate the VLAN pseudo-interface with a physical interface and
- assign a VLAN ID, IP address, and netmask:
-
- ifconfig <vlan_name> <ip_address> netmask <subnet_mask> vlan
- <vlan_id> vlandev <physical_interface>
-
- Example:
-
- ifconfig vlan10 10.0.0.1 netmask 255.255.255.0 vlan10 vlandev em0
-
- In this example, all packets will be marked on egress with 802.1Q VLAN
- tags, specifying a VLAN ID of 10.
-
- To remove a VLAN pseudo-interface:
-
- ifconfig <vlan_name> destroy
-
- Polling
- -------
- To enable polling in the driver, add the following options to the kernel
- configuration, and then recompile the kernel:
-
- options DEVICE_POLLING
- options HZ=1000
-
- At runtime, use the following command to turn on polling mode. Similarly,
- turn off polling mode by setting the variable to 0:
-
- sysctl kern.polling.enable=1
-
-
- NOTES: DEVICE POLLING is only valid for non-SMP kernels.
-
- The driver has to be built into the kernel for DEVICE POLLING to be
- enabled in the driver.
-
-
-Known Limitations
-=================
-
- There are known performance issues with this driver when running UDP traffic
- with Jumbo Frames. Intel recommends not using Jumbo Frames for UDP traffic.
-
-
- 82541/82547 can't link or is slow to link with some link partners
- -----------------------------------------------------------------
-
- There is a known compatibility issue with 82541/82547 and some switches
- where link will not be established, or will be slow to establish. In
- particular, these switches are known to be incompatible with 82541/82547:
-
- Planex FXG-08TE
- I-O Data ETG-SH8
-
- To workaround the issue, the driver can be compiled with an override of the
- PHY's master/slave setting. Forcing master or forcing slave mode will
- improve time-to-link.
-
- Edit ./em.x.x.x/src/if_em.h to remove the #define EM_MASTER_SLAVE
- from within the comments.
-
- /* #define EM_MASTER_SLAVE 2 */
- #define EM_MASTER_SLAVE 2
-
- Use one of the following options.
- 0 = Hardware default
- 1 = Master mode
- 2 = Slave mode
- 3 = Auto master/slave
-
- Recompile the module (refer to step 3 above)
- a. To compile the module
-
- cd em-x.x.x
- make clean
- make
-
- b. To install the compiled module in system directory:
-
- make install
-
-
-Support
-=======
-
-For general information and support, go to the Intel support website at:
-
- http://support.intel.com
-
-If an issue is identified with the released source code on the supported
-kernel with a supported adapter, email the specific information related to
-the issue to freebsdnic@xxxxxxxxxxxxxxxxx.
-
-
-License
-=======
-
-This software program is released under the terms of a license agreement
-between you ('Licensee') and Intel. Do not use or load this software or any
-associated materials (collectively, the 'Software') until you have carefully
-read the full terms and conditions of the LICENSE located in this software
-package. By loading or using the Software, you agree to the terms of this
-Agreement. If you do not agree with the terms of this Agreement, do not
-install or use the Software.
-
-* Other names and brands may be claimed as the property of others.
diff --git a/src/add-ons/kernel/drivers/network/ipro1000/debug.h
b/src/add-ons/kernel/drivers/network/ipro1000/debug.h
deleted file mode 100644
index 15abdabc3b..0000000000
--- a/src/add-ons/kernel/drivers/network/ipro1000/debug.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* Intel PRO/1000 Family Driver
- * Copyright (C) 2004 Marcus Overhagen <marcus@xxxxxxxxxxxx>. All rights
reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notice appear in all copies, and that both the
- * copyright notice and this permission notice appear in supporting
documentation.
- *
- * Marcus Overhagen makes no representations about the suitability of this
software
- * for any purpose. It is provided "as is" without express or implied warranty.
- *
- * MARCUS OVERHAGEN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
MARCUS
- * OVERHAGEN BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-#ifndef __DEBUG_H
-#define __DEBUG_H
-
-#include <KernelExport.h>
-
-#ifdef DEBUG
-
- /* Set these to 1 to enable debugging */
- #define DEBUG_DEVICE 0
- #define DEBUG_INIT 0
- #define DEBUG_IOCTL 0
- #define DEBUG_HW 0
- #define DEBUG_FUNC_CALLS 0
- #define DEBUG_DISPLAY_STATS 1
-
- #define ASSERT(a) if (a)
; else panic("ipro1000: ASSERT failed, " #a)
- #define DEBUGFUNC(S) if
(DEBUG_FUNC_CALLS) dprintf("ipro1000: " S "\n")
- #define DEVICE_DEBUGOUT(S) if
(DEBUG_DEVICE) dprintf("ipro1000: " S "\n")
- #define DEVICE_DEBUGOUT1(S,A) if (DEBUG_DEVICE)
dprintf("ipro1000: " S "\n", A)
- #define DEVICE_DEBUGOUT2(S,A,B) if (DEBUG_DEVICE)
dprintf("ipro1000: " S "\n", A, B)
- #define INIT_DEBUGOUT(S) if (DEBUG_INIT)
dprintf("ipro1000: " S "\n")
- #define INIT_DEBUGOUT1(S,A) if (DEBUG_INIT)
dprintf("ipro1000: " S "\n", A)
- #define INIT_DEBUGOUT2(S,A,B) if (DEBUG_INIT)
dprintf("ipro1000: " S "\n", A, B)
- #define INIT_DEBUGOUT3(S,A,B,C) if (DEBUG_INIT)
dprintf("ipro1000: " S "\n", A, B, C)
- #define INIT_DEBUGOUT7(S,A,B,C,D,E,F,G) if (DEBUG_INIT)
dprintf("ipro1000: " S "\n", A,B,C,D,E,F,G)
- #define IOCTL_DEBUGOUT(S) if (DEBUG_IOCTL)
dprintf("ipro1000: " S "\n")
- #define IOCTL_DEBUGOUT1(S,A) if (DEBUG_IOCTL)
dprintf("ipro1000: " S "\n", A)
- #define IOCTL_DEBUGOUT2(S,A,B) if (DEBUG_IOCTL)
dprintf("ipro1000: " S "\n", A, B)
- #define HW_DEBUGOUT(S) if (DEBUG_HW)
dprintf("ipro1000: " S "\n")
- #define HW_DEBUGOUT1(S,A) if (DEBUG_HW)
dprintf("ipro1000: " S "\n", A)
- #define HW_DEBUGOUT2(S,A,B) if (DEBUG_HW)
dprintf("ipro1000: " S "\n", A, B)
- #define HW_DEBUGOUT7(S,A,B,C,D,E,F,G) if (DEBUG_HW)
dprintf("ipro1000: " S "\n", A,B,C,D,E,F,G)
-#else
- #define DEBUG_DISPLAY_STATS 0
- #define DEBUGFUNC(S)
- #define DEVICE_DEBUGOUT(S)
- #define DEVICE_DEBUGOUT1(S,A)
- #define DEVICE_DEBUGOUT2(S,A,B)
- #define INIT_DEBUGOUT(S)
- #define INIT_DEBUGOUT1(S,A)
- #define INIT_DEBUGOUT2(S,A,B)
- #define INIT_DEBUGOUT3(S,A,B,C)
- #define INIT_DEBUGOUT7(S,A,B,C,D,E,F,G)
- #define IOCTL_DEBUGOUT(S)
- #define IOCTL_DEBUGOUT1(S,A)
- #define IOCTL_DEBUGOUT2(S,A,B)
- #define HW_DEBUGOUT(S)
- #define HW_DEBUGOUT1(S,A)
- #define HW_DEBUGOUT2(S,A,B)
- #define HW_DEBUGOUT7(S,A,B,C,D,E,F,G)
- #define ASSERT(a)
-#endif
-
-#define ERROROUT(S)
dprintf("ipro1000: ERROR " S "\n")
-#define ERROROUT1(S,A) dprintf("ipro1000:
ERROR " S "\n", A)
-#define ERROROUT3(S,A,B,C) dprintf("ipro1000:
ERROR " S "\n", A,B,C)
-
-#endif
diff --git a/src/add-ons/kernel/drivers/network/ipro1000/dev/e1000/LICENSE
b/src/add-ons/kernel/drivers/network/ipro1000/dev/e1000/LICENSE
deleted file mode 100644
index f70a7cbd4a..0000000000
--- a/src/add-ons/kernel/drivers/network/ipro1000/dev/e1000/LICENSE
+++ /dev/null
@@ -1,31 +0,0 @@
-$FreeBSD$
-
- Copyright (c) 2001-2010, Intel Corporation
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- 3. Neither the name of the Intel Corporation nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-
diff --git a/src/add-ons/kernel/drivers/network/ipro1000/dev/e1000/README
b/src/add-ons/kernel/drivers/network/ipro1000/dev/e1000/README
deleted file mode 100644
index c0abeacccf..0000000000
--- a/src/add-ons/kernel/drivers/network/ipro1000/dev/e1000/README
+++ /dev/null
@@ -1,406 +0,0 @@
-$FreeBSD$
-FreeBSD* Driver for Intel Network Connection
-=============================================
-
-May 30, 2007
-
-
-Contents
-========
-
-- Overview
-- Identifying Your Adapter
-- Building and Installation
-- Speed and Duplex Configuration
-- Additional Configurations
-- Known Limitations
-- Support
-- License
-
-
-Overview
-========
-
-This file describes the FreeBSD* driver for Intel Network Connection.
-This driver has been developed for use with FreeBSD, Release 7.x.
-
-For questions related to hardware requirements, refer to the documentation
-supplied with your Gigabit adapter. All hardware requirements listed
-apply to use with FreeBSD.
-
-
-Identifying Your Adapter
-========================
-
-For information on how to identify your adapter, go to the Adapter &
-Driver ID Guide at:
-
-http://support.intel.com/support/network/sb/cs-012904.htm
-
-
-For the latest Intel network drivers for FreeBSD, see:
-
-http://downloadfinder.intel.com/scripts-df-external/support_intel.aspx
-
-
-NOTE: Mobile adapters are not fully supported.
-NOTE: The Intel(R) 82562v 10/100 Network Connection only provides 10/100
-support.
-
-Building and Installation
-=========================
-
-NOTE: The driver can be installed as a dynamic loadable kernel module or
- compiled into the kernel. You must have kernel sources installed in
- order to compile the driver module.
-
-In the instructions below, x.x.x is the driver version as indicated in the
-name of the driver tar file.
-
-1. Move the base driver tar file to the directory of your choice. For
- example, use /home/username/em or /usr/local/src/em.
-
-2. Untar/unzip the archive:
-
- tar xzvf em-x.x.x.tar.gz
-
- This will create an em-x.x.x directory.
-
-3. To create a loadable module, perform the following steps.
- NOTE: To compile the driver into the kernel, go directly to step 4.
-
- a. To compile the module
-
- cd em-x.x.x
- make
-
- b. To install the compiled module to the system directory:
-
- make install
-
- c. If you want the driver to load automatically when the system is
booted:
-
- 1. Edit /boot/loader.conf, and add the following line:
-
- if_em_load="YES"
-
-4. To compile the driver into the kernel, enter:
-
- cd em-x.x.x/src
- cp *.[ch] /usr/src/sys/dev/em
-
- Edit the kernel configuration file (i.e., GENERIC or MYKERNEL) in
- /usr/src/sys/i386/conf, and ensure the following line is present:
-
- device em
-
- Compile and install the kernel. The system must be rebooted for the
- kernel updates to take effect. For additional information on compiling
- the kernel, consult the FreeBSD operating system documentation.
-
-5. To assign an IP address to the interface, enter the following:
-
- ifconfig em<interface_num> <IP_address>
-
-6. Verify that the interface works. Enter the following, where <IP_address>
- is the IP address for another machine on the same subnet as the interface
- that is being tested:
-
- ping <IP_address>
-
-7. To configure the IP address to remain after reboot, edit /etc/rc.conf,
- and create the appropriate ifconfig_em<interface_num>entry:
-
- ifconfig_em<interface_num>="<ifconfig_settings>"
-
- Example usage:
-
- ifconfig_em0="inet 192.168.10.1 netmask 255.255.255.0"
-
- NOTE: For assistance, see the ifconfig man page.
-
-
-Speed and Duplex Configuration
-==============================
-
-By default, the adapter auto-negotiates the speed and duplex of the
-connection. If there is a specific need, the ifconfig utility can be used to
-configure the speed and duplex settings on the adapter. Example usage:
-
- ifconfig em<interface_num> <IP_address> media 100baseTX mediaopt
- full-duplex
-
- NOTE: Only use mediaopt to set the driver to full-duplex. If mediaopt is
- not specified and you are not running at gigabit speed, the driver
- defaults to half-duplex.
-
-If the interface is currently forced to 100 full duplex, in order to change
-to half duplex you must use this command:
-
- ifconfig em<interface_num> <IP_address> media 100baseTX -mediaopt
- full-duplex
-
-
-This driver supports the following media type options:
-
- autoselect - Enables auto-negotiation for speed and duplex.
-
- 10baseT/UTP - Sets speed to 10 Mbps. Use the ifconfig mediaopt
- option to select full-duplex mode.
-
- 100baseTX - Sets speed to 100 Mbps. Use the ifconfig mediaopt
- option to select full-duplex mode.
-
- 1000baseTX - Sets speed to 1000 Mbps. In this case, the driver
- supports only full-duplex mode.
-
- 1000baseSX - Sets speed to 1000 Mbps. In this case, the driver
- supports only full-duplex mode.
-
-For more information on the ifconfig utility, see the ifconfig man page.
-
-
-Additional Configurations
-=========================
-
-The driver supports Transmit/Receive Checksum Offload and Jumbo Frames on
-all but the 82542-based adapters. For specific adapters, refer to the
-Identifying Your Adapter section.
-
- Jumbo Frames
- ------------
- To enable Jumbo Frames, use the ifconfig utility to set the Maximum
- Transport Unit (MTU) frame size above its default of 1500 bytes.
-
- The Jumbo Frames MTU range for Intel Adapters is 1500 to 16110. To modify
- the setting, enter the following:
-
- ifconfig em<interface_num> <hostname or IP address> mtu 9000
-
- To confirm the MTU used between two specific devices, use:
-
- route get <destination_IP_address>
-
- Notes:
-
- - Only enable Jumbo Frames if your network infrastructure supports them.
-
- - To enable Jumbo Frames, increase the MTU size on the interface beyond
- 1500.
-
- - The Jumbo Frames setting on the switch must be set to at least 22 bytes
- larger than that of the MTU.
-
- - The maximum MTU setting for Jumbo Frames is 16110. This value coincides
- with the maximum Jumbo Frames size of 16128.
-
- - Some Intel gigabit adapters that support Jumbo Frames have a frame size
- limit of 9238 bytes, with a corresponding MTU size limit of 9216 bytes.
- The adapters with this limitation are based on the Intel(R) 82571EB,
- 82572EI, 82573L, 82566, 82562, and 80003ES2LAN controller. These
- correspond to the following product names:
- Intel(R) PRO/1000 PT Server Adapter
- Intel(R) PRO/1000 PT Desktop Adapter
- Intel(R) PRO/1000 PT Network Connection
- Intel(R) PRO/1000 PT Dual Port Server Adapter
- Intel(R) PRO/1000 PT Dual Port Network Connection
- Intel(R) PRO/1000 PT Quad Port Server Adapter
- Intel(R) PRO/1000 PF Quad Port Server Adapter
- Intel(R) PRO/1000 PF Server Adapter
- Intel(R) PRO/1000 PF Network Connection
- Intel(R) PRO/1000 PF Dual Port Server Adapter
- Intel(R) PRO/1000 PB Server Connection
- Intel(R) PRO/1000 PL Network Connection
- Intel(R) PRO/1000 EB Network Connection with I/O Acceleration
- Intel(R) PRO/1000 EB Backplane Connection with I/O Acceleration
- Intel(R) 82566DM-2 Gigabit Network Connection
-
- - Adapters based on the Intel(R) 82542 and 82573V/E controller do not
- support Jumbo Frames. These correspond to the following product names:
- Intel(R) PRO/1000 Gigabit Server Adapter
- Intel(R) PRO/1000 PM Network Connection
-
- - Using Jumbo Frames at 10 or 100 Mbps may result in poor performance or
- loss of link.
-
- - The following adapters do not support Jumbo Frames:
- Intel(R) 82562V 10/100 Network Connection
- Intel(R) 82566DM Gigabit Network Connection
- Intel(R) 82566DC Gigabit Network Connection
- Intel(R) 82566MM Gigabit Network Connection
- Intel(R) 82566MC Gigabit Network Connection
- Intel(R) 82562GT 10/100 Network Connection
- Intel(R) 82562G 10/100 Network Connection
- Intel(R) 82566DC-2 Gigabit Network Connection
- Intel(R) 82562V-2 10/100 Network Connection
- Intel(R) 82562G-2 10/100 Network Connection
- Intel(R) 82562GT-2 10/100 Network Connection
-
- VLANs
- -----
- To create a new VLAN interface:
-
- ifconfig <vlan_name> create
-
- To associate the VLAN interface with a physical interface and
- assign a VLAN ID, IP address, and netmask:
-
- ifconfig <vlan_name> <ip_address> netmask <subnet_mask> vlan
- <vlan_id> vlandev <physical_interface>
-
- Example:
-
- ifconfig vlan10 10.0.0.1 netmask 255.255.255.0 vlan 10 vlandev em0
-
- In this example, all packets will be marked on egress with 802.1Q VLAN
- tags, specifying a VLAN ID of 10.
-
- To remove a VLAN interface:
-
- Intel Network Connection ifconfig <vlan_name> destroy
-
-
- Polling
- -------
-
- To enable polling in the driver, add the following options to the kernel
- configuration, and then recompile the kernel:
-
- options DEVICE_POLLING
- options HZ=1000
-
- At runtime use:
- ifconfig emX polling (to turn polling on)
- and:
- ifconfig emX -polling (to turn it off)
-
-
- Checksum Offload
- ----------------
- Checksum offloading is not supported on 82542 Gigabit adapters.
-
- Checksum offloading supports both TCP and UDP packets and is
- supported for both transmit and receive.
-
- Checksum offloading can be enabled or disabled using ifconfig.
- Both transmit and receive offloading will be either enabled or
- disabled together. You cannot enable/disable one without the other.
-
- To enable checksum offloading:
-
- ifconfig <interface_num> rxcsum
-
- To disable checksum offloading:
-
- ifconfig <interface_num> -rxcsum
-
- To confirm the current setting:
-
- ifconfig <interface_num>
-
- Look for the presence or absence of the following line:
-
- options=3 <RXCSUM,TXCSUM>
-
- See the ifconfig man page for further information.
-
-
- TSO
- ---
- The FreeBSD driver offers support for TSO (TCP Segmentation Offload).
-
- You can enable/disable it in two ways/places:
-
- - sysctl net.inet.tcp.tso=0 (or 1 to enable it)
-
- Doing this disables TSO in the stack and will affect all adapters.
-
- - ifconfig emX -tso
-
- Doing this will disable TSO only for this adapter.
-
- To enable:
-
- - ifconfig emX tso
-
- NOTES: By default only PCI-Express adapters are ENABLED to do TSO. Others
- can be enabled by the user at their own risk
- TSO is not supported on 82547 and 82544-based adapters, as well as older
adapters.
-
-
-Known Limitations
-=================
-
- Detected Tx Unit Hang in Quad Port Adapters
- -------------------------------------------
-
- In some cases ports 3 and 4 wont pass traffic. Ports 1 and 2 don't show
- any errors and will pass traffic.
-
- This issue MAY be resolved by updating to the latest BIOS. You can
- check your system's BIOS by downloading the Linux Firmware Developer Kit
- that can be obtained at http://www.linuxfirmwarekit.org/
-
-
- There are known performance issues with this driver when running UDP traffic
- with Jumbo Frames.
- ----------------------------------------------------------------------------
-
- 82541/82547 can't link or is slow to link with some link partners
- -----------------------------------------------------------------
-
- There is a known compatibility issue where time to link is slow or link is
not
- established between 82541/82547 controllers and some switches. Known
switches
- include:
- Planex FXG-08TE
- I-O Data ETG-SH8
- Netgear GS105v3
-
- The driver can be compiled with the following changes:
-
- Edit ./em.x.x.x/src/if_em.h to change the #define EM_MASTER_SLAVE
- For example, change from:
-
- #define EM_MASTER_SLAVE e1000_ms_hw_default
- to:
- #define EM_MASTER_SLAVE 2
-
- Use one of the following options:
- 1 = Master mode
- 2 = Slave mode
- 3 = Auto master/slave
- Setting 2 is recommended.
-
- Recompile the module:
- a. To compile the module
- cd em-x.x.x
- make clean
- make
-
- b. To install the compiled module in system directory:
- make install
-
-
-Support
-=======
-
-For general information and support, go to the Intel support website at:
-
- http://support.intel.com
-
-If an issue is identified, support is through email only at:
-freebsd@xxxxxxxxx
-
-
-License
-=======
-
-This software program is released under the terms of a license agreement
-between you ('Licensee') and Intel. Do not use or load this software or any
-associated materials (collectively, the 'Software') until you have carefully
-read the full terms and conditions of the LICENSE located in this software
-package. By loading or using the Software, you agree to the terms of this
-Agreement. If you do not agree with the terms of this Agreement, do not
-install or use the Software.
-
-* Other names and brands may be claimed as the property of others.
diff --git a/src/add-ons/kernel/drivers/network/ipro1000/device.c
b/src/add-ons/kernel/drivers/network/ipro1000/device.c
deleted file mode 100644
index e15c4e4c15..0000000000
--- a/src/add-ons/kernel/drivers/network/ipro1000/device.c
+++ /dev/null
@@ -1,404 +0,0 @@
-/* Intel PRO/1000 Family Driver
- * Copyright (C) 2004 Marcus Overhagen <marcus@xxxxxxxxxxxx>. All rights
reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notice appear in all copies, and that both the
- * copyright notice and this permission notice appear in supporting
documentation.
- *
- * Marcus Overhagen makes no representations about the suitability of this
software
- * for any purpose. It is provided "as is" without express or implied warranty.
- *
- * MARCUS OVERHAGEN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
MARCUS
- * OVERHAGEN BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-
-#include "debug.h"
-#include "device.h"
-#include "driver.h"
-#include "util.h"
-#include "if_em.h"
-#include "if_compat.h"
-
-#include <KernelExport.h>
-#include <driver_settings.h>
-
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#ifdef HAIKU_TARGET_PLATFORM_HAIKU
-# include <net/if_media.h>
-#endif
-
-#undef malloc
-#undef free
-
-static int32 gOpenMask = 0;
-
-int em_attach(device_t);
-int em_detach(device_t);
-void em_media_status(struct ifnet *, struct ifmediareq *);
-
-
-static void
-ipro1000_read_settings(ipro1000_device *device)
-{
- void *handle;
- const char *param;
- int mtu;
-
- handle = load_driver_settings("ipro1000");
- if (!handle)
- return;
-
- param = get_driver_parameter(handle, "mtu", "-1", "-1");
- mtu = atoi(param);
- if (mtu >= 50 && mtu <= 1500)
- device->maxframesize = mtu + ENET_HEADER_SIZE;
- else if (mtu != -1)
- dprintf("ipro1000: unsupported mtu setting '%s' ignored\n",
param);
-
- unload_driver_settings(handle);
-}
-
-
-status_t
-ipro1000_open(const char *name, uint32 flags, void** cookie)
-{
- ipro1000_device *device;
- char *deviceName;
- int dev_id;
- int mask;
-
- DEVICE_DEBUGOUT("ipro1000_open()");
-
- for (dev_id = 0; (deviceName = gDevNameList[dev_id]) != NULL; dev_id++)
{
- if (!strcmp(name, deviceName))
- break;
- }
- if (deviceName == NULL) {
- ERROROUT("invalid device name");
- return B_ERROR;
- }
-
- // allow only one concurrent access
- mask = 1 << dev_id;
- if (atomic_or(&gOpenMask, mask) & mask)
- return B_BUSY;
-
- *cookie = device = (ipro1000_device *)malloc(sizeof(ipro1000_device));
- if (!device) {
- atomic_and(&gOpenMask, ~(1 << dev_id));
- return B_NO_MEMORY;
- }
-
- memset(device, 0, sizeof(*device));
-
- device->devId = dev_id;
- device->pciInfo = gDevList[dev_id];
- device->nonblocking = (flags & O_NONBLOCK) ? true : false;
- device->closed = false;
-
- device->pciBus = device->pciInfo->bus;
- device->pciDev = device->pciInfo->device;
- device->pciFunc = device->pciInfo->function;
- device->adapter = 0;
- device->maxframesize = 1514; // XXX is MAXIMUM_ETHERNET_FRAME_SIZE =
1518 too much?
-
-#ifdef HAIKU_TARGET_PLATFORM_HAIKU
- device->linkChangeSem = -1;
-#endif
-
- ipro1000_read_settings(device);
-
- if (em_attach(device) != 0) {
- DEVICE_DEBUGOUT("em_attach failed");
- goto err;
- }
-
- return B_OK;
-
-err:
- free(device);
- atomic_and(&gOpenMask, ~(1 << dev_id));
- return B_ERROR;
-}
-
-
-status_t
-ipro1000_close(void* cookie)
-{
- ipro1000_device *device = (ipro1000_device *)cookie;
- struct ifnet *ifp = &device->adapter->interface_data.ac_if;
- DEVICE_DEBUGOUT("ipro1000_close()");
-
- device->closed = true;
- release_sem(ifp->if_rcv_sem);
-
- return B_OK;
-}
-
-
-status_t
-ipro1000_free(void* cookie)
-{
- ipro1000_device *device = (ipro1000_device *)cookie;
- DEVICE_DEBUGOUT("ipro1000_free()");
-
- if (em_detach(device) != 0) {
- DEVICE_DEBUGOUT("em_detach failed");
- }
-
- free(device);
- atomic_and(&gOpenMask, ~(1 << device->devId));
- return B_OK;
-}
-
-
-status_t
-ipro1000_read(void* cookie, off_t position, void *buf, size_t* num_bytes)
-{
- ipro1000_device *device = (ipro1000_device *)cookie;
- struct ifnet *ifp = &device->adapter->interface_data.ac_if;
- struct mbuf *mb;
- status_t stat;
- int len;
-
-// DEVICE_DEBUGOUT("ipro1000_read() enter");
-
- if (device->closed) {
- DEVICE_DEBUGOUT("ipro1000_read() interrupted 1");
- return B_INTERRUPTED;
- }
-retry:
- stat = acquire_sem_etc(ifp->if_rcv_sem, 1, B_CAN_INTERRUPT |
(device->nonblocking ? B_TIMEOUT : 0), 0);
- if (device->closed) {
- // DEVICE_DEBUGOUT("ipro1000_read() interrupted 2"); //
net_server will crash if we print this (race condition in net_server?)
- return B_INTERRUPTED;
- }
- if (stat == B_WOULD_BLOCK) {
- DEVICE_DEBUGOUT("ipro1000_read() would block (OK 0 bytes)");
- *num_bytes = 0;
- return B_OK;
- }
- if (stat != B_OK) {
- DEVICE_DEBUGOUT("ipro1000_read() error");
- return B_ERROR;
- }
-
- IF_DEQUEUE(&ifp->if_rcv, mb);
- if (!mb) {
- ERROROUT("ipro1000_read() mbuf not ready");
- goto retry;
- }
-
- len = mb->m_len;
- if (len < 0)
- len = 0;
- if (len > (int)*num_bytes)
- len = *num_bytes;
-
- memcpy(buf, mtod(mb, uint8 *), len); // XXX this is broken for jumbo
frames
- *num_bytes = len;
-
- m_freem(mb);
-
-// DEVICE_DEBUGOUT1("ipro1000_read() leave, %d bytes", len);
- return B_OK;
-}
-
-
-status_t
-ipro1000_write(void* cookie, off_t position, const void* buffer, size_t*
num_bytes)
-{
-// bigtime_t t = system_time();
- ipro1000_device *device = (ipro1000_device *)cookie;
- struct ifnet *ifp = &device->adapter->interface_data.ac_if;
- struct mbuf *mb;
-
-// DEVICE_DEBUGOUT("ipro1000_write() enter");
-
- // allocate mbuf
- for (;;) {
- MGETHDR(mb, M_DONTWAIT, MT_DATA);
- if (mb)
- break;
- snooze(700);
- if (device->closed)
- return B_INTERRUPTED;
- }
-
-// DEVICE_DEBUGOUT("ipro1000_write() 1");
-
- // allocate memory
- for (;;) {
- MCLGET(mb, M_DONTWAIT);
- if (mb->m_flags & M_EXT)
- break;
- snooze(700);
- if (device->closed) {
- m_freem(mb);
- return B_INTERRUPTED;
- }
- }
-
-// DEVICE_DEBUGOUT("ipro1000_write() 2");
-
- // copy data
- mb->m_len = *num_bytes;
- if (mb->m_len > MCLBYTES)
- mb->m_len = MCLBYTES;
- memcpy(mtod(mb, uint8 *), buffer, mb->m_len);
-
-// DEVICE_DEBUGOUT("ipro1000_write() 3");
-
- // add mbuf to send queue
- IF_APPEND(&ifp->if_snd, mb);
-
-// DEVICE_DEBUGOUT("ipro1000_write() 4");
-
- // wait for output available
- while (ifp->if_flags & IFF_OACTIVE) {
- snooze(700);
- if (device->closed)
- return B_INTERRUPTED;
- }
-
-// DEVICE_DEBUGOUT("ipro1000_write() 5");
-
- // send everything (if still required)
- if (ifp->if_snd.ifq_head != NULL)
- ifp->if_start(ifp);
-
-// while (ifp->if_snd.ifq_head != NULL) {
-// ifp->if_start(ifp);
-// if (ifp->if_snd.ifq_head != NULL) {
-// snooze(1000);
-// if (device->closed)
-// return B_INTERRUPTED;
-// }
-// }
-
-// t = system_time() - t;
-
-// if (t > 20)
-// DEVICE_DEBUGOUT("write %Ld", t);
-
-// DEVICE_DEBUGOUT("ipro1000_write() finished");
-
- return B_OK;
-}
-
-
-static struct ifnet *
-device_ifp(ipro1000_device *device)
-{
- return &device->adapter->interface_data.ac_if;
-}
-
-
-status_t
-ipro1000_control(void *cookie, uint32 op, void *arg, size_t len)
-{
- ipro1000_device *device = (ipro1000_device *)cookie;
-
- switch (op) {
- case ETHER_INIT:
- DEVICE_DEBUGOUT("ipro1000_control() ETHER_INIT");
- return B_OK;
-
- case ETHER_GETADDR:
- DEVICE_DEBUGOUT("ipro1000_control() ETHER_GETADDR");
- memcpy(arg, &device->macaddr, sizeof(device->macaddr));
- return B_OK;
-
- case ETHER_NONBLOCK:
- if (*(int32 *)arg) {
- DEVICE_DEBUGOUT("non blocking mode on");
- device->nonblocking = true;
- } else {
- DEVICE_DEBUGOUT("non blocking mode off");
- device->nonblocking = false;
- }
- return B_OK;
-
- case ETHER_ADDMULTI:
- case ETHER_REMMULTI:
- {
- struct ifnet *ifp = device_ifp(device);
- struct sockaddr_dl address;
-
- if (len != ETHER_ADDR_LEN)
- return EINVAL;
-
- memset(&address, 0, sizeof(address));
- address.sdl_family = AF_LINK;
- memcpy(LLADDR(&address), arg, ETHER_ADDR_LEN);
-
- if (op == ETHER_ADDMULTI)
- return ether_add_multi(ifp, (struct sockaddr
*)&address);
- else
- return ether_rem_multi(ifp, (struct sockaddr
*)&address);
- }
-
- case ETHER_SETPROMISC:
- if (*(int32 *)arg) {
- DEVICE_DEBUGOUT("promiscuous mode on not
supported");
- } else {
- DEVICE_DEBUGOUT("promiscuous mode off");
- }
- return B_OK;
-
- case ETHER_GETFRAMESIZE:
- DEVICE_DEBUGOUT2("ipro1000_control()
ETHER_GETFRAMESIZE, framesize = %d (MTU = %d)", device->maxframesize,
device->maxframesize - ENET_HEADER_SIZE);
- *(uint32*)arg = device->maxframesize;
- return B_OK;
-
-#ifdef HAIKU_TARGET_PLATFORM_HAIKU
- case ETHER_GET_LINK_STATE:
- {
- struct ifmediareq mediareq;
- ether_link_state_t state;
-
- if (len < sizeof(ether_link_state_t))
- return ENOBUFS;
-
- em_media_status(device_ifp(device), &mediareq);
-
- state.media = mediareq.ifm_active;
- if (mediareq.ifm_status & IFM_ACTIVE)
- state.media |= IFM_ACTIVE;
- if (mediareq.ifm_active & IFM_10_T)
- state.speed = 10000000;
- else if (mediareq.ifm_active & IFM_100_TX)
- state.speed = 100000000;
- else
- state.speed = 1000000000;
- state.quality = 1000;
-
- return user_memcpy(arg, &state,
sizeof(ether_link_state_t));
- }
-
- case ETHER_SET_LINK_STATE_SEM:
- {
- if (user_memcpy(&device->linkChangeSem, arg,
sizeof(sem_id)) < B_OK) {
- device->linkChangeSem = -1;
- return B_BAD_ADDRESS;
- }
- return B_OK;
- }
-#endif
-
- default:
- DEVICE_DEBUGOUT("ipro1000_control() Invalid command");
- break;
- }
-
- return B_BAD_VALUE;
-}
diff --git a/src/add-ons/kernel/drivers/network/ipro1000/device.h
b/src/add-ons/kernel/drivers/network/ipro1000/device.h
deleted file mode 100644
index 4a7ca32ee6..0000000000
--- a/src/add-ons/kernel/drivers/network/ipro1000/device.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Intel PRO/1000 Family Driver
- * Copyright (C) 2004 Marcus Overhagen <marcus@xxxxxxxxxxxx>. All rights
reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notice appear in all copies, and that both the
- * copyright notice and this permission notice appear in supporting
documentation.
- *
- * Marcus Overhagen makes no representations about the suitability of this
software
- * for any purpose. It is provided "as is" without express or implied warranty.
- *
- * MARCUS OVERHAGEN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
MARCUS
- * OVERHAGEN BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-#ifndef __DEVICE_H
-#define __DEVICE_H
-
-#include <PCI.h>
-#include "setup.h"
-
-extern pci_module_info *gPci;
-
-status_t ipro1000_open(const char *name, uint32 flags, void** cookie);
-status_t ipro1000_read(void* cookie, off_t position, void *buf, size_t*
num_bytes);
-status_t ipro1000_write(void* cookie, off_t position, const void* buffer,
size_t* num_bytes);
-status_t ipro1000_control(void *cookie, uint32 op, void *arg, size_t len);
-status_t ipro1000_close(void* cookie);
-status_t ipro1000_free(void* cookie);
-
-struct adapter;
-
-typedef struct device {
- int devId;
- pci_info * pciInfo;
-
- struct adapter * adapter;
- uint8 pciBus;
- uint8 pciDev;
- uint8 pciFunc;
- void * regAddr;
-
- volatile bool nonblocking;
- volatile bool closed;
-
- uint32 maxframesize; // 14 bytes header + MTU
- uint8 macaddr[6];
-
-#ifdef HAIKU_TARGET_PLATFORM_HAIKU
- sem_id linkChangeSem;
-#endif
-} ipro1000_device;
-
-#endif
diff --git a/src/add-ons/kernel/drivers/network/ipro1000/driver.c
b/src/add-ons/kernel/drivers/network/ipro1000/driver.c
deleted file mode 100644
index 028e0ca73e..0000000000
--- a/src/add-ons/kernel/drivers/network/ipro1000/driver.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/* Intel PRO/1000 Family Driver
- * Copyright (C) 2004 Marcus Overhagen <marcus@xxxxxxxxxxxx>. All rights
reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notice appear in all copies, and that both the
- * copyright notice and this permission notice appear in supporting
documentation.
- *
- * Marcus Overhagen makes no representations about the suitability of this
software
- * for any purpose. It is provided "as is" without express or implied warranty.
- *
- * MARCUS OVERHAGEN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
MARCUS
- * OVERHAGEN BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-#include <KernelExport.h>
-#include <Errors.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "debug.h"
-#include "timer.h"
-#include "device.h"
-#include "driver.h"
-#include "mempool.h"
-
-int32 api_version = B_CUR_DRIVER_API_VERSION;
-
-pci_module_info *gPci;
-
-char* gDevNameList[MAX_CARDS + 1];
-pci_info *gDevList[MAX_CARDS];
-
-static const char *
-identify_device(const pci_info *info)
-{
- if (info->vendor_id != 0x8086)
- return 0;
- switch (info->device_id) {
- case 0x1000: return "82542";
- case 0x1001: return "82543GC FIBER";
- case 0x1004: return "82543GC COPPER";
- case 0x1008: return "82544EI COPPER";
- case 0x1009: return "82544EI FIBER";
- case 0x100C: return "82544GC COPPER";
- case 0x100D: return "82544GC LOM";
- case 0x100E: return "82540EM";
- case 0x100F: return "82545EM COPPER";
- case 0x1010: return "82546EB COPPER";
- case 0x1011: return "82545EM FIBER";
- case 0x1012: return "82546EB FIBER";
- case 0x1013: return "82541EI";
- case 0x1014: return "unknown 1014";
- case 0x1015: return "82540EM LOM";
- case 0x1016: return "82540EP LOM";
- case 0x1017: return "82540EP";
- case 0x1018: return "82541EI MOBILE";
- case 0x1019: return "82547EI";
- case 0x101A: return "unknown 101A";
- case 0x101D: return "82546EB QUAD COPPER";
- case 0x101E: return "82540EP LP";
- case 0x1026: return "82545GM COPPER";
- case 0x1027: return "82545GM FIBER";
- case 0x1028: return "82545GM SERDES";
- case 0x1075: return "82547GI";
- case 0x1076: return "82541GI";
- case 0x1077: return "82541GI MOBILE";
- case 0x1078: return "82541ER";
- case 0x1079: return "82546GB COPPER";
- case 0x107A: return "82546GB FIBER";
- case 0x107B: return "82546GB SERDES";
- case 0x107C: return "82541PI";
- default: return 0;
- }
-}
-
-status_t
-init_hardware(void)
-{
- pci_module_info *pci;
- pci_info info;
- status_t res;
- int i;
-
- INIT_DEBUGOUT("init_hardware()");
-
- if (get_module(B_PCI_MODULE_NAME, (module_info **)&pci) < B_OK)
- return B_ERROR;
- for (res = B_ERROR, i = 0; pci->get_nth_pci_info(i, &info) == B_OK;
i++) {
- if (identify_device(&info)) {
- res = B_OK;
- break;
- }
- }
- put_module(B_PCI_MODULE_NAME);
-
- return res;
-}
-
-
-status_t
-init_driver(void)
-{
- struct pci_info *item;
- int index;
- int cards;
-
-#ifdef DEBUG
- set_dprintf_enabled(true);
- load_driver_symbols("ipro1000");
-#endif
-
- dprintf("ipro1000: " INFO "\n");
-
- item = (pci_info *)malloc(sizeof(pci_info));
- if (!item)
- return B_NO_MEMORY;
-
- if (get_module(B_PCI_MODULE_NAME, (module_info **)&gPci) < B_OK) {
- free(item);
- return B_ERROR;
- }
-
- for (cards = 0, index = 0; gPci->get_nth_pci_info(index++, item) ==
B_OK; ) {
- const char *info = identify_device(item);
- if (info) {
- char name[64];
- sprintf(name, "net/ipro1000/%d", cards);
- dprintf("ipro1000: /dev/%s is a %s\n", name, info);
- gDevList[cards] = item;
- gDevNameList[cards] = strdup(name);
- gDevNameList[cards + 1] = NULL;
- cards++;
- item = (pci_info *)malloc(sizeof(pci_info));
- if (!item)
- goto err_outofmem;
- if (cards == MAX_CARDS)
- break;
- }
- }
-
- free(item);
-
- if (!cards)
- goto err_cards;
-
- if (initialize_timer() != B_OK) {
- ERROROUT("timer init failed");
- goto err_timer;
- }
-
- if (mempool_init(cards * 768) != B_OK) {
- ERROROUT("mempool init failed");
- goto err_mempool;
- }
-
- return B_OK;
-
-err_mempool:
- terminate_timer();
-err_timer:
-err_cards:
-err_outofmem:
- for (index = 0; index < cards; index++) {
- free(gDevList[index]);
- free(gDevNameList[index]);
- }
- put_module(B_PCI_MODULE_NAME);
- return B_ERROR;
-}
-
-
-void
-uninit_driver(void)
-{
- int32 i;
-
- INIT_DEBUGOUT("uninit_driver()");
-
- terminate_timer();
-
- mempool_exit();
-
- for (i = 0; gDevNameList[i] != NULL; i++) {
- free(gDevList[i]);
- free(gDevNameList[i]);
- }
-
- put_module(B_PCI_MODULE_NAME);
-}
-
-
-device_hooks
-gDeviceHooks = {
- ipro1000_open,
- ipro1000_close,
- ipro1000_free,
- ipro1000_control,
- ipro1000_read,
- ipro1000_write,
-};
-
-
-const char**
-publish_devices()
-{
- return (const char**)gDevNameList;
-}
-
-
-device_hooks*
-find_device(const char* name)
-{
- return &gDeviceHooks;
-}
diff --git a/src/add-ons/kernel/drivers/network/ipro1000/driver.h
b/src/add-ons/kernel/drivers/network/ipro1000/driver.h
deleted file mode 100644
index 72a28c33e0..0000000000
--- a/src/add-ons/kernel/drivers/network/ipro1000/driver.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Intel PRO/1000 Family Driver
- * Copyright (C) 2004 Marcus Overhagen <marcus@xxxxxxxxxxxx>. All rights
reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notice appear in all copies, and that both the
- * copyright notice and this permission notice appear in supporting
documentation.
- *
- * Marcus Overhagen makes no representations about the suitability of this
software
- * for any purpose. It is provided "as is" without express or implied warranty.
- *
- * MARCUS OVERHAGEN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
MARCUS
- * OVERHAGEN BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-#ifndef __DRIVER_H
-#define __DRIVER_H
-
-#include <Drivers.h>
-#include <PCI.h>
-#include "ether_driver.h"
-
-#define MAX_CARDS 8
-
-extern pci_module_info *gPci;
-
-extern char* gDevNameList[];
-extern pci_info *gDevList[];
-
-#endif
diff --git a/src/add-ons/kernel/drivers/network/ipro1000/if_compat.c
b/src/add-ons/kernel/drivers/network/ipro1000/if_compat.c
deleted file mode 100644
index eade03d592..0000000000
--- a/src/add-ons/kernel/drivers/network/ipro1000/if_compat.c
+++ /dev/null
@@ -1,260 +0,0 @@
-/* Intel PRO/1000 Family Driver
- * Copyright (C) 2004 Marcus Overhagen <marcus@xxxxxxxxxxxx>. All rights
reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notice appear in all copies, and that both the
- * copyright notice and this permission notice appear in supporting
documentation.
- *
- * Marcus Overhagen makes no representations about the suitability of this
software
- * for any purpose. It is provided "as is" without express or implied warranty.
- *
- * MARCUS OVERHAGEN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
MARCUS
- * OVERHAGEN BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-#include "if_compat.h"
-#include "if_em.h"
-#include "device.h"
-#include "debug.h"
-#include "mempool.h"
-
-#undef malloc
-#undef free
-
-spinlock mbuf_lock = 0;
-
-struct mbuf *
-m_gethdr(int how, int type)
-{
- struct mbuf *m = mbuf_pool_get();
- if (!m)
- return m;
- memset(m, 0, sizeof(m));
- m->m_flags = M_PKTHDR;
- return m;
-}
-
-void
-m_clget(struct mbuf * m, int how)
-{
-// TRACE("m_clget\n");
-
- m->m_ext.ext_buf = chunk_pool_get();
- m->m_data = m->m_ext.ext_buf;
- if (m->m_ext.ext_buf)
- m->m_flags |= M_EXT;
-}
-
-void
-m_adj(struct mbuf *mp, int bytes)
-{
- mp->m_data = (char *)mp->m_data + bytes;
-}
-
-void
-m_freem(struct mbuf *mp)
-{
- struct mbuf *m, *c;
-// TRACE("m_freem\n");
-
- for (m = mp; m; ) {
- if (m->m_flags & M_EXT)
- chunk_pool_put(m->m_ext.ext_buf);
- c = m;
- m = m->m_next;
- mbuf_pool_put(c);
- }
-}
-
-static void
-ether_input(struct ifnet *ifp, struct mbuf *m)
-{
-/*
- uint8 *buf;
- int len;
-
- buf = mtod(m, uint8 *);
- len = m->m_len;
- TRACE("ether_input: received packet with %d bytes\n", len);
- TRACE("%02x %02x %02x %02x . %02x %02x %02x %02x . %02x %02x %02x %02x
\n",
- buf[0], buf[1], buf[2], buf[3], buf[4], buf[5],
- buf[6], buf[7], buf[8], buf[8], buf[10], buf[11]);
-
- m_freem(m);
- return;
-*/
-
- IF_APPEND(&ifp->if_rcv, m);
- release_sem_etc(ifp->if_rcv_sem, 1, B_DO_NOT_RESCHEDULE);
-}
-
-void
-ether_ifattach(struct ifnet *ifp, const uint8 *etheraddr)
-{
- ipro1000_device *dev = ifp->if_softc->dev;
-
- INIT_DEBUGOUT("ether_ifattach");
-
- TAILQ_INIT(&ifp->if_multiaddrs);
-
- memcpy(dev->macaddr, etheraddr, 6);
-
- ifp->if_input = ether_input;
-
- ifp->if_rcv_sem = create_sem(0, "ifp->if_rcv_sem");
- set_sem_owner(ifp->if_rcv_sem, B_SYSTEM_TEAM);
-
- INIT_DEBUGOUT("calling if_init...");
- ifp->if_init(ifp->if_softc);
- INIT_DEBUGOUT("done calling if_init!");
-}
-
-
-static struct ifmultiaddr *
-ether_find_multi(struct ifnet *ifp, const struct sockaddr *_address)
-{
- const struct sockaddr_dl *address = (const struct sockaddr_dl
*)_address;
- struct ifmultiaddr *ifma;
-
- TAILQ_FOREACH (ifma, &ifp->if_multiaddrs, ifma_link) {
- if (memcmp(LLADDR(address),
- LLADDR((struct sockaddr_dl *)ifma->ifma_addr),
- ETHER_ADDR_LEN) == 0)
- return ifma;
- }
-
- return NULL;
-}
-
-
-int
-ether_add_multi(struct ifnet *ifp, const struct sockaddr *address)
-{
- struct ifmultiaddr *addr = ether_find_multi(ifp, address);
-
- if (addr != NULL) {
- addr->ifma_refcount++;
- return 0;
- }
-
- addr = (struct ifmultiaddr *)malloc(sizeof(struct ifmultiaddr));
- if (addr == NULL)
- return ENOBUFS;
-
- memcpy(&addr->ifma_addr_storage, address, sizeof(struct sockaddr_dl));
- addr->ifma_addr = (struct sockaddr *)&addr->ifma_addr_storage;
-
- addr->ifma_refcount = 1;
-
- TAILQ_INSERT_HEAD(&ifp->if_multiaddrs, addr, ifma_link);
-
- return ifp->if_ioctl(ifp, SIOCADDMULTI, NULL);
-}
-
-
-static void
-ether_delete_multi(struct ifnet *ifp, struct ifmultiaddr *ifma)
-{
- TAILQ_REMOVE(&ifp->if_multiaddrs, ifma, ifma_link);
- free(ifma);
-}
-
-
-int
-ether_rem_multi(struct ifnet *ifp, const struct sockaddr *address)
-{
- struct ifmultiaddr *addr = ether_find_multi(ifp, address);
- if (addr == NULL)
- return EADDRNOTAVAIL;
-
- addr->ifma_refcount--;
- if (addr->ifma_refcount == 0) {
- ether_delete_multi(ifp, addr);
- return ifp->if_ioctl(ifp, SIOCDELMULTI, NULL);
- }
-
- return 0;
-}
-
-
-void
-ether_ifdetach(struct ifnet *ifp)
-{
- struct ifmultiaddr *ifma, *next;
-
- INIT_DEBUGOUT("ether_ifdetach");
-
- delete_sem(ifp->if_rcv_sem);
-
- TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, next)
- ether_delete_multi(ifp, ifma);
-}
-
-struct mbuf *
-if_dequeue(struct if_queue *queue)
-{
- cpu_status s;
- struct mbuf *m;
-
-// TRACE("IF_DEQUEUE\n");
-
- s = disable_interrupts();
- acquire_spinlock(&mbuf_lock);
-
- m = (struct mbuf *) queue->ifq_head;
- if (m) {
- queue->ifq_head = m->m_nextq;
- if (!queue->ifq_head)
- queue->ifq_tail = 0;
- m->m_nextq = 0;
- }
-
- release_spinlock(&mbuf_lock);
- restore_interrupts(s);
-
- return m;
-}
-
-void
-if_prepend(struct if_queue *queue, struct mbuf *mb)
-{
- cpu_status s;
-// TRACE("IF_PREPEND\n");
-
- s = disable_interrupts();
- acquire_spinlock(&mbuf_lock);
-
- mb->m_nextq = (struct mbuf *) queue->ifq_head;
- queue->ifq_head = mb;
- if (!queue->ifq_tail)
- queue->ifq_tail = mb;
-
- release_spinlock(&mbuf_lock);
- restore_interrupts(s);
-}
-
-void
-if_append(struct if_queue *queue, struct mbuf *mb)
-{
- cpu_status s;
-// TRACE("IF_APPEND\n");
-
- s = disable_interrupts();
- acquire_spinlock(&mbuf_lock);
-
- mb->m_nextq = 0;
- if (!queue->ifq_tail) {
- queue->ifq_tail = mb;
- queue->ifq_head = mb;
- } else {
- queue->ifq_tail->m_nextq = mb;
- queue->ifq_tail = mb;
- }
-
- release_spinlock(&mbuf_lock);
- restore_interrupts(s);
-}
diff --git a/src/add-ons/kernel/drivers/network/ipro1000/if_compat.h
b/src/add-ons/kernel/drivers/network/ipro1000/if_compat.h
deleted file mode 100644
index 4d73dca6e6..0000000000
--- a/src/add-ons/kernel/drivers/network/ipro1000/if_compat.h
+++ /dev/null
@@ -1,303 +0,0 @@
-/* Intel PRO/1000 Family Driver
- * Copyright (C) 2004 Marcus Overhagen <marcus@xxxxxxxxxxxx>. All rights
reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notice appear in all copies, and that both the
- * copyright notice and this permission notice appear in supporting
documentation.
- *
- * Marcus Overhagen makes no representations about the suitability of this
software
- * for any purpose. It is provided "as is" without express or implied warranty.
- *
- * MARCUS OVERHAGEN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
MARCUS
- * OVERHAGEN BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-#ifndef __IF_COMPAT_H
-#define __IF_COMPAT_H
-
-#include <OS.h>
-#include <net/if.h>
-#include <net/if_dl.h>
-#include <net/if_media.h>
-
-#include "if_em_osdep.h" // for TAILQ_...
-
-#define __FreeBSD_version 500001
-
-#define IFF_RUNNING 0x10000
-#define IFF_OACTIVE 0x20000
-
-#define IFCAP_HWCSUM 0x0001
-#define IFCAP_VLAN_HWTAGGING 0x0002
-#define IFCAP_VLAN_MTU 0x0004
-#define IFCAP_TXCSUM 0x0010
-#define IFCAP_RXCSUM 0x0020
-
-#ifdef HAIKU_TARGET_PLATFORM_HAIKU
-# define IFM_AVALID 0
-# define IFM_FDX IFM_FULL_DUPLEX
-# define IFM_HDX IFM_HALF_DUPLEX
-# define IFM_1000_TX IFM_1000_T
-#else
-# define IFM_ACTIVE 0x0001
-# define IFM_FDX 0x0002
-# define IFM_HDX 0x0004
-# define IFM_10_T 0x0008
-# define IFM_100_TX 0x0010
-# define IFM_1000_T 0x0020
-# define IFM_1000_TX 0x0040
-# define IFM_1000_SX 0x0080
-# define IFM_ETHER 0x0100
-# define IFM_AUTO 0x0200
-# define IFM_AVALID 0x0400
-# define IFM_GMASK (IFM_FDX | IFM_HDX)
-# define IFM_TYPE_MASK (IFM_ETHER)
-# define IFM_SUBTYPE_MASK \
- (IFM_AUTO | IFM_1000_SX | IFM_1000_TX | IFM_1000_T | IFM_100_TX
| IFM_10_T)
-# define IFM_TYPE(media) ((media) & IFM_TYPE_MASK)
-# define IFM_SUBTYPE(media) ((media) & IFM_SUBTYPE_MASK)
-#endif
-
-#define CSUM_TCP 0x0001 // ifnet::if_hwassist
-#define CSUM_UDP 0x0002 // ifnet::if_hwassist
-#define CSUM_IP_CHECKED 0x0004
-#define CSUM_IP_VALID 0x0008
-#define CSUM_DATA_VALID 0x0010
-#define CSUM_PSEUDO_HDR 0x0020
-
-#define ETHER_ADDR_LEN 6 /* length of an Ethernet address */
-#define ETHER_TYPE_LEN 2 /* length of the Ethernet type field */
-#define ETHER_CRC_LEN 4 /* length of the Ethernet CRC */
-#define ETHER_HDR_LEN (ETHER_ADDR_LEN*2+ETHER_TYPE_LEN)
-#define ETHER_MIN_LEN 64 /* minimum frame len, including CRC */
-#define ETHER_MAX_LEN 1518 /* maximum frame len, including CRC */
-#define ETHER_MAX_LEN_JUMBO 9018 /* max jumbo frame len, including CRC
*/
-#define ETHER_VLAN_ENCAP_LEN 4 /* len of 802.1Q VLAN encapsulation */
-#define ETHERMTU ETHER_MAX_LEN_JUMBO
-#define IP_HEADER_SIZE 20
-#define OFFSETOF_IPHDR_SUM 10
-#define OFFSETOF_TCPHDR_SUM 16
-#define OFFSETOF_UDPHDR_SUM 6
-
-
-// vlan stuff is not supported
-#define ETHERTYPE_VLAN 0x8100
-#define VLAN_INPUT_TAG(a, b, c, d)
-#define VLAN_TAG_VALUE(mtag) 0
-#define VLAN_OUTPUT_TAG(ifp, m_head) 0
-
-
-// BPF listener not supported
-#define BPF_MTAP(a, b)
-
-
-// sysctl stuff is not supported
-#define sysctl_ctx_init(a)
-#define sysctl_ctx_free(a)
-#define SYSCTL_HANDLER_ARGS void
-#define SYSCTL_ADD_NODE(a, b, c, d, e, f, g) \
- (struct sysctl_oid *) 1
-#define SYSCTL_ADD_PROC(a, b, c, d, e, f, g, h, i, j)
-
-struct sysctl_ctx_list
-{
-};
-
-struct sysctl_oid
-{
-};
-
-
-struct adapter;
-struct ifnet;
-struct mbuf;
-
-
-struct ifmedia
-{
- uint32 ifm_media;
-};
-
-struct if_queue
-{
- volatile struct mbuf * ifq_head;
- volatile struct mbuf * ifq_tail;
- int ifq_maxlen; // ignored
-};
-
-typedef void (*if_start)(struct ifnet *);
-typedef int (*if_ioctl)(struct ifnet *, u_long, caddr_t);
-typedef void (*if_watchdog)(struct ifnet *);
-typedef void (*if_init)(void *);
-typedef void (*if_input)(struct ifnet *, struct mbuf *);
-
-struct m_pkthdr
-{
- int len;
- int csum_flags;
- uint16 csum_data;
- struct ifnet * rcvif; // set by receive int
-};
-
-struct m_ext
-{
- void *ext_buf;
-};
-
-struct mbuf
-{
- struct mbuf * m_next; // next buffer in chain (e.g. for
jumboframes)
- struct mbuf * m_nextq; // next buffer in queue
- int m_len;
- int m_flags;
- void * m_data;
- struct m_pkthdr m_pkthdr;
- struct m_ext m_ext;
-};
-
-#define M_DONTWAIT 0x01
-#define M_EXT 0x02
-#define M_PKTHDR 0x04
-#define MT_DATA 1
-#define MCLBYTES 2048
-
-struct mbuf *m_gethdr(int how, int type);
-
-// Allocate and return a single M_PKTHDR mbuf. NULL is returned on failure.
-#define MGETHDR(mb, how, type) ((mb) = m_gethdr((how), (type)))
-
-void m_clget(struct mbuf * mb, int how);
-
-// Fetch a single mbuf cluster and attach it to an existing mbuf. If
-// successfull, configures the provided mbuf to have mbuf->m_ext.ext_buf
-// pointing to the cluster, and sets the M_EXT bit in the mbuf's flags.
-// The M_EXT bit is not set on failure
-#define MCLGET(mb, how) m_clget((mb), (how))
-
-struct mbuf *if_dequeue(struct if_queue *queue);
-
-void if_prepend(struct if_queue *queue, struct mbuf *mb);
-void if_append(struct if_queue *queue, struct mbuf *mb);
-
-#define IF_DEQUEUE(queue, mb) ((mb) = if_dequeue((queue)))
-#define IF_PREPEND(queue, mb) if_prepend((queue), (mb))
-#define IF_APPEND(queue, mb) if_append((queue), (mb))
-
-void m_adj(struct mbuf *mp, int bytes);
-void m_freem(struct mbuf *mp);
-
-#define mtod(m, t) ((t)((m)->m_data))
-
-void ether_ifattach(struct ifnet *ifp, const uint8 *etheraddr);
-void ether_ifdetach(struct ifnet *ifp);
-
-int ether_add_multi(struct ifnet *ifp, const struct sockaddr *address);
-int ether_rem_multi(struct ifnet *ifp, const struct sockaddr *address);
-
-TAILQ_HEAD(ifmultihead, ifmultiaddr);
-
-struct ifmultiaddr
-{
- TAILQ_ENTRY(ifmultiaddr) ifma_link;
- struct sockaddr *ifma_addr;
- int ifma_refcount;
-
- /* private */
- struct sockaddr_dl ifma_addr_storage;
-};
-
-struct if_data
-{
- int ifi_hdrlen;
-};
-
-struct ether_vlan_header
-{
- uint8 evl_dhost[ETHER_ADDR_LEN];
- uint8 evl_shost[ETHER_ADDR_LEN];
- uint16 evl_encap_proto;
- uint16 evl_tag;
- uint16 evl_proto;
-};
-
-struct ifnet
-{
- const char *if_name;
-
- struct adapter *if_softc;
-
- int if_unit;
- int if_mtu;
- volatile uint32 if_flags;
- uint32 if_capabilities;
- uint32 if_hwassist;
- uint32 if_capenable;
- uint64 if_baudrate;
- int64 if_timer;
-
- uint64 if_ibytes;
- uint64 if_obytes;
- uint64 if_imcasts;
- uint64 if_collisions;
- uint64 if_ierrors;
- uint64 if_oerrors;
- uint64 if_ipackets;
- uint64 if_opackets;
-
- struct if_queue if_snd; // send queue
- struct if_queue if_rcv; // recveive queue
-
- sem_id if_rcv_sem;
-
- struct if_data if_data;
- struct ifmultihead if_multiaddrs;
-
- if_start if_start;
- if_ioctl if_ioctl;
- if_watchdog if_watchdog;
- if_init if_init;
- if_input if_input;
-
-
- void *if_output; // unused
- #define ether_output 0
-};
-
-struct arpcom
-{
- struct ifnet ac_if;
- uint8 ac_enaddr[ETHER_ADDR_LEN];
-};
-
-#define device_get_softc(dev) \
- (dev->adapter ? dev->adapter : (dev->adapter = (struct adapter
*)malloc(sizeof(struct adapter), 0, 0)))
-
-#define device_get_unit(dev) \
- dev->devId
-
-enum { // ioctl commands
- SIOCSIFADDR = 0x7000,
- SIOCGIFADDR,
- SIOCSIFMTU,
- SIOCSIFFLAGS,
- SIOCADDMULTI,
- SIOCDELMULTI,
- SIOCSIFMEDIA,
- SIOCGIFMEDIA,
- SIOCSIFCAP,
-};
-
-// used for media properties
-#define ifmedia_init(a, b, c, d)
-#define ifmedia_add(a, b, c, d)
-#define ifmedia_set(a, b)
-#define ifmedia_ioctl(ifp, ifr, media, command) 0
-
-// called for SIOCxIFADDR (Get/Set Interface Addr)
-#define ether_ioctl(ifp, command, data)
-
-#endif // __IF_COMPAT_H
diff --git a/src/add-ons/kernel/drivers/network/ipro1000/if_em.c
b/src/add-ons/kernel/drivers/network/ipro1000/if_em.c
deleted file mode 100644
index bd6f1aae62..0000000000
--- a/src/add-ons/kernel/drivers/network/ipro1000/if_em.c
+++ /dev/null
@@ -1,2968 +0,0 @@
-/**************************************************************************
-
-Copyright (c) 2001-2003, Intel Corporation
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- 3. Neither the name of the Intel Corporation nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-
-***************************************************************************/
-
-/*$FreeBSD: /repoman/r/ncvs/src/sys/dev/em/if_em.c,v 1.2.2.19 2004/04/22
22:03:26 ru Exp $*/
-
-#include "debug.h"
-#include "if_em.h"
-#include "util.h"
-
-
-/*********************************************************************
- * Function prototypes
- *********************************************************************/
-int em_attach(device_t);
-int em_detach(device_t);
-static int32 em_intr(void *);
-static int32 event_handler(void *);
-static int start_event_thread(struct adapter *);
-static void stop_event_thread(struct adapter *);
-static void em_start(struct ifnet *);
-static int em_ioctl(struct ifnet *, u_long, caddr_t);
-static void em_watchdog(struct ifnet *);
-static void em_init(void *);
-static void em_stop(void *);
-void em_media_status(struct ifnet *, struct ifmediareq *);
-//static int em_media_change(struct ifnet *);
-static void em_identify_hardware(struct adapter *);
-static int em_allocate_pci_resources(struct adapter *);
-static void em_free_pci_resources(struct adapter *);
-static void em_local_timer(void *);
-static int em_hardware_init(struct adapter *);
-static void em_setup_interface(device_t, struct adapter *);
-static int em_setup_transmit_structures(struct adapter *);
-static void em_initialize_transmit_unit(struct adapter *);
-static int em_setup_receive_structures(struct adapter *);
-static void em_initialize_receive_unit(struct adapter *);
-static void em_enable_intr(struct adapter *);
-static void em_disable_intr(struct adapter *);
-static void em_free_transmit_structures(struct adapter *);
-static void em_free_receive_structures(struct adapter *);
-static void em_update_stats_counters(struct adapter *);
-static void em_clean_transmit_interrupts(struct adapter *);
-static int em_allocate_receive_structures(struct adapter *);
-static int em_allocate_transmit_structures(struct adapter *);
-static void em_process_receive_interrupts(struct adapter *, int);
-static void em_receive_checksum(struct adapter *,
- struct em_rx_desc *,
- struct mbuf *);
-static void em_transmit_checksum_setup(struct adapter *,
- struct mbuf *,
- u_int32_t *,
- u_int32_t *);
-static void em_set_promisc(struct adapter *);
-static void em_disable_promisc(struct adapter *);
-static void em_set_multi(struct adapter *);
-static void em_print_hw_stats(struct adapter *);
-static void em_print_link_status(struct adapter *);
-static int em_get_buf(int i, struct adapter *,
- struct mbuf *);
-static void em_enable_vlans(struct adapter *);
-static int em_encap(struct adapter *, struct mbuf *);
-static void em_smartspeed(struct adapter *);
-static int em_82547_fifo_workaround(struct adapter *, int);
-static void em_82547_update_fifo_head(struct adapter *, int);
-static int em_82547_tx_fifo_reset(struct adapter *);
-static void em_82547_move_tail(void *arg);
-static void em_print_debug_info(struct adapter *);
-static int em_is_valid_ether_addr(u_int8_t *);
-//static int em_sysctl_stats(SYSCTL_HANDLER_ARGS);
-//static int em_sysctl_debug_info(SYSCTL_HANDLER_ARGS);
-static u_int32_t em_fill_descriptors (u_int64_t address,
- u_int32_t length,
- PDESC_ARRAY desc_array);
-//static int em_sysctl_int_delay(SYSCTL_HANDLER_ARGS);
-static void em_add_int_delay_sysctl(struct adapter *, const char *,
- const char *, struct em_int_delay_info *,
- int, int);
-
-/*********************************************************************
- * Tunable default values.
- *********************************************************************/
-
-#define E1000_TICKS_TO_USECS(ticks) ((1024 * (ticks) + 500) / 1000)
-#define E1000_USECS_TO_TICKS(usecs) ((1000 * (usecs) + 512) / 1024)
-
-static int em_tx_int_delay_dflt = E1000_TICKS_TO_USECS(EM_TIDV);
-static int em_rx_int_delay_dflt = E1000_TICKS_TO_USECS(EM_RDTR);
-static int em_tx_abs_int_delay_dflt = E1000_TICKS_TO_USECS(EM_TADV);
-static int em_rx_abs_int_delay_dflt = E1000_TICKS_TO_USECS(EM_RADV);
-
-TUNABLE_INT("hw.em.tx_int_delay", &em_tx_int_delay_dflt);
-TUNABLE_INT("hw.em.rx_int_delay", &em_rx_int_delay_dflt);
-TUNABLE_INT("hw.em.tx_abs_int_delay", &em_tx_abs_int_delay_dflt);
-TUNABLE_INT("hw.em.rx_abs_int_delay", &em_rx_abs_int_delay_dflt);
-
-/* sysctl vars */
-/*
-SYSCTL_INT(_hw, OID_AUTO, em_tx_int_delay, CTLFLAG_RD, &em_tx_int_delay_dflt,
0,
- "Transmit interrupt delay");
-SYSCTL_INT(_hw, OID_AUTO, em_rx_int_delay, CTLFLAG_RD, &em_rx_int_delay_dflt,
0,
- "Receive interrupt delay");
-SYSCTL_INT(_hw, OID_AUTO, em_tx_abs_int_delay, CTLFLAG_RD,
&em_tx_abs_int_delay_dflt,
- 0, "Transmit absolute interrupt delay");
-SYSCTL_INT(_hw, OID_AUTO, em_rx_ans_int_delay, CTLFLAG_RD,
&em_rx_abs_int_delay_dflt,
- 0,
- "Receive absolute interrupt delay");
-*/
-
-/*********************************************************************
- * Device initialization routine
- *
- * The attach entry point is called when the driver is being loaded.
- * This routine identifies the type of hardware, allocates all resources
- * and initializes the hardware.
- *
- * return 0 on success, positive on failure
- *********************************************************************/
-
-int
-em_attach(device_t dev)
-{
- struct adapter * adapter;
- int s;
- int tsize, rsize;
- int error = 0;
-
- INIT_DEBUGOUT("em_attach: begin");
- s = splimp();
-
- /* Allocate, clear, and link in our adapter structure */
- if (!(adapter = device_get_softc(dev))) {
- ERROROUT("adapter structure allocation failed");
- splx(s);
- return(ENOMEM);
- }
- bzero(adapter, sizeof(struct adapter ));
- adapter->dev = dev;
- adapter->osdep.dev = dev;
- adapter->unit = device_get_unit(dev);
-
- /* SYSCTL stuff */
- sysctl_ctx_init(&adapter->sysctl_ctx);
- adapter->sysctl_tree = SYSCTL_ADD_NODE(&adapter->sysctl_ctx,
- SYSCTL_STATIC_CHILDREN(_hw),
- OID_AUTO,
- device_get_nameunit(dev),
- CTLFLAG_RD,
- 0, "");
- if (adapter->sysctl_tree == NULL) {
- error = EIO;
- goto err_sysctl;
- }
-
- SYSCTL_ADD_PROC(&adapter->sysctl_ctx,
- SYSCTL_CHILDREN(adapter->sysctl_tree),
- OID_AUTO, "debug_info", CTLTYPE_INT|CTLFLAG_RW,
- (void *)adapter, 0,
- em_sysctl_debug_info, "I", "Debug Information");
-
- SYSCTL_ADD_PROC(&adapter->sysctl_ctx,
- SYSCTL_CHILDREN(adapter->sysctl_tree),
- OID_AUTO, "stats", CTLTYPE_INT|CTLFLAG_RW,
- (void *)adapter, 0,
- em_sysctl_stats, "I", "Statistics");
-
- callout_handle_init(&adapter->timer_handle);
- callout_handle_init(&adapter->tx_fifo_timer_handle);
-
- /* create event processing thread */
- if (start_event_thread(adapter) < 0) {
- error = EIO;
- goto err_event;
- }
-
- /* Determine hardware revision */
- em_identify_hardware(adapter);
-
- /* Set up some sysctls for the tunable interrupt delays */
- em_add_int_delay_sysctl(adapter, "rx_int_delay",
- "receive interrupt delay in usecs", &adapter->rx_int_delay,
- E1000_REG_OFFSET(&adapter->hw, RDTR), em_rx_int_delay_dflt);
- em_add_int_delay_sysctl(adapter, "tx_int_delay",
- "transmit interrupt delay in usecs", &adapter->tx_int_delay,
- E1000_REG_OFFSET(&adapter->hw, TIDV), em_tx_int_delay_dflt);
- if (adapter->hw.mac_type >= em_82540) {
- em_add_int_delay_sysctl(adapter, "rx_abs_int_delay",
- "receive interrupt delay limit in usecs",
- &adapter->rx_abs_int_delay,
- E1000_REG_OFFSET(&adapter->hw, RADV),
- em_rx_abs_int_delay_dflt);
- em_add_int_delay_sysctl(adapter, "tx_abs_int_delay",
- "transmit interrupt delay limit in usecs",
[ *** diff truncated: 11341 lines dropped *** ]
############################################################################
Revision: hrev51993
Commit: e1c961d028af9e7d5684e55eb2c143167f90fd01
URL: https://git.haiku-os.org/haiku/commit/?id=e1c961d028af
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Fri Jun 8 03:26:44 2018 UTC
network: Update comments in Jamfile with respect to ethernet driver upgrades.
----------------------------------------------------------------------------