Chargement du reste de cette comparaison.

Untitled diff

Créé Le diff n'expire jamais
1 suppression
686 lignes
3 ajouts
688 lignes
/*-
/*-
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 1997, 1998, 1999, 2001
* Copyright (c) 1997, 1998, 1999, 2001
* Bill Paul <wpaul@windriver.com>. All rights reserved.
* Bill Paul <wpaul@windriver.com>. All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* modification, are permitted provided that the following conditions
* are met:
* are met:
* 1. Redistributions of source code must retain the above copyright
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* must display the following acknowledgement:
* This product includes software developed by Bill Paul.
* This product includes software developed by Bill Paul.
* 4. Neither the name of the author nor the names of any co-contributors
* 4. Neither the name of the author nor the names of any co-contributors
* may be used to endorse or promote products derived from this software
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* without specific prior written permission.
*
*
* THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
* THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
* ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
* THE POSSIBILITY OF SUCH DAMAGE.
*/
*/


#include <sys/cdefs.h>
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: stable/11/sys/dev/bge/if_bge.c 301103 2016-06-01 05:15:11Z sephe $");
__FBSDID("$FreeBSD$");


/*
/*
* Broadcom BCM57xx(x)/BCM590x NetXtreme and NetLink family Ethernet driver
* Broadcom BCM57xx(x)/BCM590x NetXtreme and NetLink family Ethernet driver
*
*
* The Broadcom BCM5700 is based on technology originally developed by
* The Broadcom BCM5700 is based on technology originally developed by
* Alteon Networks as part of the Tigon I and Tigon II Gigabit Ethernet
* Alteon Networks as part of the Tigon I and Tigon II Gigabit Ethernet
* MAC chips. The BCM5700, sometimes referred to as the Tigon III, has
* MAC chips. The BCM5700, sometimes referred to as the Tigon III, has
* two on-board MIPS R4000 CPUs and can have as much as 16MB of external
* two on-board MIPS R4000 CPUs and can have as much as 16MB of external
* SSRAM. The BCM5700 supports TCP, UDP and IP checksum offload, jumbo
* SSRAM. The BCM5700 supports TCP, UDP and IP checksum offload, jumbo
* frames, highly configurable RX filtering, and 16 RX and TX queues
* frames, highly configurable RX filtering, and 16 RX and TX queues
* (which, along with RX filter rules, can be used for QOS applications).
* (which, along with RX filter rules, can be used for QOS applications).
* Other features, such as TCP segmentation, may be available as part
* Other features, such as TCP segmentation, may be available as part
* of value-added firmware updates. Unlike the Tigon I and Tigon II,
* of value-added firmware updates. Unlike the Tigon I and Tigon II,
* firmware images can be stored in hardware and need not be compiled
* firmware images can be stored in hardware and need not be compiled
* into the driver.
* into the driver.
*
*
* The BCM5700 supports the PCI v2.2 and PCI-X v1.0 standards, and will
* The BCM5700 supports the PCI v2.2 and PCI-X v1.0 standards, and will
* function in a 32-bit/64-bit 33/66Mhz bus, or a 64-bit/133Mhz bus.
* function in a 32-bit/64-bit 33/66Mhz bus, or a 64-bit/133Mhz bus.
*
*
* The BCM5701 is a single-chip solution incorporating both the BCM5700
* The BCM5701 is a single-chip solution incorporating both the BCM5700
* MAC and a BCM5401 10/100/1000 PHY. Unlike the BCM5700, the BCM5701
* MAC and a BCM5401 10/100/1000 PHY. Unlike the BCM5700, the BCM5701
* does not support external SSRAM.
* does not support external SSRAM.
*
*
* Broadcom also produces a variation of the BCM5700 under the "Altima"
* Broadcom also produces a variation of the BCM5700 under the "Altima"
* brand name, which is functionally similar but lacks PCI-X support.
* brand name, which is functionally similar but lacks PCI-X support.
*
*
* Without external SSRAM, you can only have at most 4 TX rings,
* Without external SSRAM, you can only have at most 4 TX rings,
* and the use of the mini RX ring is disabled. This seems to imply
* and the use of the mini RX ring is disabled. This seems to imply
* that these features are simply not available on the BCM5701. As a
* that these features are simply not available on the BCM5701. As a
* result, this driver does not implement any support for the mini RX
* result, this driver does not implement any support for the mini RX
* ring.
* ring.
*/
*/


#ifdef HAVE_KERNEL_OPTION_HEADERS
#ifdef HAVE_KERNEL_OPTION_HEADERS
#include "opt_device_polling.h"
#include "opt_device_polling.h"
#endif
#endif


#include <sys/param.h>
#include <sys/param.h>
#include <sys/endian.h>
#include <sys/endian.h>
#include <sys/systm.h>
#include <sys/systm.h>
#include <sys/sockio.h>
#include <sys/sockio.h>
#include <sys/mbuf.h>
#include <sys/mbuf.h>
#include <sys/malloc.h>
#include <sys/malloc.h>
#include <sys/kernel.h>
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/module.h>
#include <sys/socket.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
#include <sys/sysctl.h>
#include <sys/taskqueue.h>
#include <sys/taskqueue.h>


#include <net/if.h>
#include <net/if.h>
#include <net/if_var.h>
#include <net/if_var.h>
#include <net/if_arp.h>
#include <net/if_arp.h>
#include <net/ethernet.h>
#include <net/ethernet.h>
#include <net/if_dl.h>
#include <net/if_dl.h>
#include <net/if_media.h>
#include <net/if_media.h>


#include <net/bpf.h>
#include <net/bpf.h>


#include <net/if_types.h>
#include <net/if_types.h>
#include <net/if_vlan_var.h>
#include <net/if_vlan_var.h>


#include <netinet/in_systm.h>
#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>
#include <netinet/tcp.h>