Reduce diff against FreeBSD r280181.

This commit is contained in:
msaitoh 2015-08-13 10:03:37 +00:00
parent 7d14271c4e
commit 76e03c6b0b
5 changed files with 38 additions and 33 deletions

View File

@ -59,7 +59,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe.c 279805 2015-03-09 10:29:15Z araujo $*/
/*$NetBSD: ixgbe.c,v 1.34 2015/08/13 04:56:43 msaitoh Exp $*/
/*$NetBSD: ixgbe.c,v 1.35 2015/08/13 10:03:37 msaitoh Exp $*/
#include "opt_inet.h"
#include "opt_inet6.h"
@ -136,15 +136,15 @@ static int ixgbe_detach(device_t, int);
#if 0
static int ixgbe_shutdown(device_t);
#endif
#if IXGBE_LEGACY_TX
#ifdef IXGBE_LEGACY_TX
static void ixgbe_start(struct ifnet *);
static void ixgbe_start_locked(struct tx_ring *, struct ifnet *);
#else
#else /* ! IXGBE_LEGACY_TX */
static int ixgbe_mq_start(struct ifnet *, struct mbuf *);
static int ixgbe_mq_start_locked(struct ifnet *, struct tx_ring *);
static void ixgbe_qflush(struct ifnet *);
static void ixgbe_deferred_mq_start(void *);
#endif
static void ixgbe_deferred_mq_start(void *, int);
#endif /* IXGBE_LEGACY_TX */
static int ixgbe_ioctl(struct ifnet *, u_long, void *);
static void ixgbe_ifstop(struct ifnet *, int);
static int ixgbe_init(struct ifnet *);
@ -338,7 +338,7 @@ SYSCTL_INT("hw.ixgbe.rxd", &ixgbe_rxd);
** of unsupported SFP+ modules, note that
** doing so you are on your own :)
*/
static int allow_unsupported_sfp = true;
static int allow_unsupported_sfp = false;
SYSCTL_INT("hw.ix.unsupported_sfp", &allow_unsupported_sfp);
/*
@ -608,8 +608,7 @@ ixgbe_attach(device_t parent, device_t dev, void *aux)
*/
adapter->sfp_probe = TRUE;
error = 0;
} else if ((error == IXGBE_ERR_SFP_NOT_SUPPORTED)
&& (hw->allow_unsupported_sfp == false)) {
} else if (error == IXGBE_ERR_SFP_NOT_SUPPORTED) {
aprint_error_dev(dev,"Unsupported SFP+ module detected!\n");
error = EIO;
goto err_late;
@ -1094,7 +1093,7 @@ ixgbe_mq_start_locked(struct ifnet *ifp, struct tx_ring *txr)
* Called from a taskqueue to drain queued transmit packets.
*/
static void
ixgbe_deferred_mq_start(void *arg)
ixgbe_deferred_mq_start(void *arg, int pending)
{
struct tx_ring *txr = arg;
struct adapter *adapter = txr->adapter;
@ -1341,7 +1340,7 @@ ixgbe_init_locked(struct adapter *adapter)
/* Enable Fan Failure Interrupt */
gpie |= IXGBE_SDP1_GPIEN;
/* Add for Thermal detection */
/* Add for Module detection */
if (hw->mac.type == ixgbe_mac_82599EB)
gpie |= IXGBE_SDP2_GPIEN;
@ -1638,6 +1637,7 @@ ixgbe_legacy_irq(void *arg)
bool more = false;
u32 reg_eicr;
reg_eicr = IXGBE_READ_REG(hw, IXGBE_EICR);
adapter->stats.legint.ev_count++;
@ -2669,6 +2669,7 @@ ixgbe_allocate_msix(struct adapter *adapter, const struct pci_attach_args *pa)
que->msix = vector;
adapter->que_mask |= (u64)(1 << que->msix);
#ifdef RSS
/*
* The queue ID is used as the RSS layer bucket ID.
* We look up the queue ID -> RSS CPU ID and select
* that.
@ -2677,7 +2678,7 @@ ixgbe_allocate_msix(struct adapter *adapter, const struct pci_attach_args *pa)
#else
/*
* Bind the msix vector, and thus the
* ring to the corresponding cpu.
* rings to the corresponding cpu.
*
* This just happens to match the default RSS round-robin
* bucket -> queue -> CPU allocation.
@ -4112,6 +4113,7 @@ ixgbe_refresh_mbufs(struct rx_ring *rxr, int limit)
mp = rxbuf->buf;
mp->m_pkthdr.len = mp->m_len = rxr->mbuf_sz;
/* If we're dealing with an mbuf that was copied rather
* than replaced, there's no need to go through busdma.
*/
@ -4823,6 +4825,7 @@ ixgbe_rx_discard(struct rx_ring *rxr, int i)
rbuf = &rxr->rx_buffers[i];
/*
** With advanced descriptors the writeback
** clobbers the buffer addrs, so its easier
@ -4830,6 +4833,7 @@ ixgbe_rx_discard(struct rx_ring *rxr, int i)
** the normal refresh path to get new buffers
** and mapping.
*/
if (rbuf->buf != NULL) {/* Partial chain ? */
rbuf->fmp->m_flags |= M_PKTHDR;
m_freem(rbuf->fmp);
@ -4973,7 +4977,6 @@ ixgbe_rxeof(struct ix_queue *que)
** that determines what we are
*/
sendmp = rbuf->fmp;
if (sendmp != NULL) { /* secondary frag */
rbuf->buf = rbuf->fmp = NULL;
mp->m_flags &= ~M_PKTHDR;
@ -5007,6 +5010,7 @@ ixgbe_rxeof(struct ix_queue *que)
sendmp->m_pkthdr.len = mp->m_len;
}
++processed;
/* Pass the head pointer on */
if (eop == 0) {
nbuf->fmp = sendmp;
@ -5234,6 +5238,7 @@ ixgbe_setup_vlan_hw_support(struct adapter *adapter)
struct rx_ring *rxr;
u32 ctrl;
/*
** We get here thru init_locked, meaning
** a soft reset, this has already cleared
@ -5258,7 +5263,6 @@ ixgbe_setup_vlan_hw_support(struct adapter *adapter)
if ((ec->ec_capenable & ETHERCAP_VLAN_HWFILTER) == 0)
return;
/*
** A soft reset zero's out the VFTA, so
** we need to repopulate it now.
@ -6390,7 +6394,7 @@ ixgbe_set_advertise(SYSCTLFN_ARGS)
else if (adapter->advertise == 3)
speed = IXGBE_LINK_SPEED_1GB_FULL |
IXGBE_LINK_SPEED_10GB_FULL;
else {/* bogus value */
else { /* bogus value */
adapter->advertise = last;
return (EINVAL);
}

View File

@ -31,7 +31,7 @@
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_api.c 251964 2013-06-18 21:28:19Z jfv $*/
/*$NetBSD: ixgbe_api.c,v 1.8 2015/08/05 04:08:44 msaitoh Exp $*/
/*$NetBSD: ixgbe_api.c,v 1.9 2015/08/13 10:03:38 msaitoh Exp $*/
#include "ixgbe_api.h"
#include "ixgbe_common.h"

View File

@ -31,7 +31,7 @@
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_api.h 251964 2013-06-18 21:28:19Z jfv $*/
/*$NetBSD: ixgbe_api.h,v 1.5 2015/08/05 04:08:44 msaitoh Exp $*/
/*$NetBSD: ixgbe_api.h,v 1.6 2015/08/13 10:03:38 msaitoh Exp $*/
#ifndef _IXGBE_API_H_
#define _IXGBE_API_H_
@ -39,6 +39,7 @@
#include "ixgbe_type.h"
void ixgbe_dcb_get_rtrup2tc(struct ixgbe_hw *hw, u8 *map);
s32 ixgbe_init_shared_code(struct ixgbe_hw *hw);
extern s32 ixgbe_init_ops_82598(struct ixgbe_hw *hw);

View File

@ -31,7 +31,7 @@
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_type.h 251964 2013-06-18 21:28:19Z jfv $*/
/*$NetBSD: ixgbe_type.h,v 1.12 2015/08/13 04:56:43 msaitoh Exp $*/
/*$NetBSD: ixgbe_type.h,v 1.13 2015/08/13 10:03:38 msaitoh Exp $*/
#ifndef _IXGBE_TYPE_H_
#define _IXGBE_TYPE_H_
@ -136,7 +136,6 @@
#define IXGBE_DEV_ID_X540_VF_HV 0x1530
#define IXGBE_DEV_ID_X540_BYPASS 0x155C
/* General Registers */
#define IXGBE_CTRL 0x00000
#define IXGBE_STATUS 0x00008
@ -343,7 +342,6 @@
#define IXGBE_RSSRK(_i) (0x05C80 + ((_i) * 4)) /* 10 of these (0-9) */
/* Flow Director registers */
#define IXGBE_FDIRCTRL 0x0EE00
#define IXGBE_FDIRHKEY 0x0EE68
@ -645,7 +643,6 @@
#define IXGBE_RTTBCNRD 0x0498C
/* FCoE DMA Context Registers */
#define IXGBE_FCPTRL 0x02410 /* FC User Desc. PTR Low */
#define IXGBE_FCPTRH 0x02414 /* FC USer Desc. PTR High */
@ -3315,6 +3312,7 @@ struct ixgbe_hw {
#define IXGBE_ERR_OUT_OF_MEM -34
#define IXGBE_ERR_FEATURE_NOT_SUPPORTED -36
#define IXGBE_ERR_EEPROM_PROTECTED_REGION -37
#define IXGBE_NOT_IMPLEMENTED 0x7FFFFFFF
#endif /* _IXGBE_TYPE_H_ */

View File

@ -31,7 +31,7 @@
******************************************************************************/
/*$FreeBSD: head/sys/dev/ixgbe/ixv.c 275358 2014-12-01 11:45:24Z hselasky $*/
/*$NetBSD: ixv.c,v 1.11 2015/08/13 04:56:43 msaitoh Exp $*/
/*$NetBSD: ixv.c,v 1.12 2015/08/13 10:03:38 msaitoh Exp $*/
#include "opt_inet.h"
#include "opt_inet6.h"
@ -461,7 +461,7 @@ ixv_attach(device_t parent, device_t dev, void *aux)
ixv_init_stats(adapter);
/* Register for VLAN events */
#if 0 /* XXX msaitoh delete after write? */
#if 0 /* XXX delete after write? */
adapter->vlan_attach = EVENTHANDLER_REGISTER(vlan_config,
ixv_register_vlan, adapter, EVENTHANDLER_PRI_FIRST);
adapter->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig,
@ -690,7 +690,7 @@ ixv_mq_start_locked(struct ifnet *ifp, struct tx_ring *txr, struct mbuf *m)
ixv_txeof(txr);
enqueued = 0;
if (m == NULL) {
if (m != NULL) {
err = drbr_dequeue(ifp, txr->br, m);
if (err) {
return (err);
@ -1872,6 +1872,7 @@ ixv_free_pci_resources(struct adapter * adapter)
adapter->osdep.ihs[i]);
}
/* Clean the Legacy or Link interrupt last */
if (adapter->mbxvec) /* we are doing MSIX */
rid = adapter->mbxvec + 1;
@ -2468,7 +2469,7 @@ ixv_free_transmit_buffers(struct tx_ring *txr)
/*********************************************************************
*
* Advanced Context Descriptor setup for VLAN or L4 CSUM
* Advanced Context Descriptor setup for VLAN or CSUM
*
**********************************************************************/
@ -3662,6 +3663,7 @@ ixv_rx_checksum(u32 staterr, struct mbuf * mp, u32 ptype,
u8 errors = (u8) (staterr >> 24);
#if 0
bool sctp = FALSE;
if ((ptype & IXGBE_RXDADV_PKTTYPE_ETQF) == 0 &&
(ptype & IXGBE_RXDADV_PKTTYPE_SCTP) != 0)
sctp = TRUE;