Module Name: src Committed By: martin Date: Sat Apr 14 10:25:12 UTC 2018
Modified Files: src/sys/dev/pci/ixgbe [netbsd-8]: if_bypass.c if_fdir.c if_sriov.c ix_txrx.c ixgbe.c ixgbe.h ixgbe_82598.c ixgbe_82598.h ixgbe_82599.c ixgbe_82599.h ixgbe_api.c ixgbe_api.h ixgbe_common.c ixgbe_common.h ixgbe_dcb.c ixgbe_dcb.h ixgbe_dcb_82598.c ixgbe_dcb_82598.h ixgbe_dcb_82599.c ixgbe_dcb_82599.h ixgbe_fdir.h ixgbe_mbx.c ixgbe_mbx.h ixgbe_osdep.c ixgbe_osdep.h ixgbe_phy.c ixgbe_phy.h ixgbe_rss.h ixgbe_sriov.h ixgbe_type.h ixgbe_vf.c ixgbe_vf.h ixgbe_x540.c ixgbe_x540.h ixgbe_x550.c ixv.c Log Message: Pull up following revision(s) (requested by msaitoh in ticket #750): sys/dev/pci/ixgbe/ixgbe_x540.h: revision 1.8 sys/dev/pci/ixgbe/ixgbe_82598.c: revision 1.11 sys/dev/pci/ixgbe/ixgbe_dcb_82599.c: revision 1.6 sys/dev/pci/ixgbe/ixgbe_82598.c: revision 1.12 sys/dev/pci/ixgbe/ixgbe_dcb_82599.c: revision 1.7 sys/dev/pci/ixgbe/ixgbe_dcb_82598.h: revision 1.6 sys/dev/pci/ixgbe/ixgbe_fdir.h: revision 1.2 sys/dev/pci/ixgbe/ixgbe_dcb_82599.h: revision 1.6 sys/dev/pci/ixgbe/ixgbe_dcb_82598.c: revision 1.6 sys/dev/pci/ixgbe/ixgbe_82599.c: revision 1.18 sys/dev/pci/ixgbe/if_sriov.c: revision 1.3 sys/dev/pci/ixgbe/ixgbe_dcb_82598.c: revision 1.7 sys/dev/pci/ixgbe/ixgbe_82599.c: revision 1.19 sys/dev/pci/ixgbe/ixgbe_mbx.h: revision 1.13 sys/dev/pci/ixgbe/ixgbe_dcb.c: revision 1.7 sys/dev/pci/ixgbe/ixgbe_api.c: revision 1.19 sys/dev/pci/ixgbe/ixgbe_vf.c: revision 1.16 sys/dev/pci/ixgbe/ixgbe_dcb.c: revision 1.8 sys/dev/pci/ixgbe/ixgbe_vf.c: revision 1.17 sys/dev/pci/ixgbe/ixgbe_dcb.h: revision 1.6 sys/dev/pci/ixgbe/if_bypass.c: revision 1.4 sys/dev/pci/ixgbe/ixv.c: revision 1.91 sys/dev/pci/ixgbe/ixgbe_rss.h: revision 1.4 sys/dev/pci/ixgbe/ixv.c: revision 1.92 sys/dev/pci/ixgbe/ixv.c: revision 1.93 sys/dev/pci/ixgbe/ixgbe_osdep.c: revision 1.4 sys/dev/pci/ixgbe/ixgbe_common.h: revision 1.12 sys/dev/pci/ixgbe/ixgbe_common.h: revision 1.13 sys/dev/pci/ixgbe/ixgbe_api.h: revision 1.13 sys/dev/pci/ixgbe/ixgbe_x550.c: revision 1.12 sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.33 sys/dev/pci/ixgbe/if_fdir.c: revision 1.2 sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.34 sys/dev/pci/ixgbe/ix_txrx.c: revision 1.39 sys/dev/pci/ixgbe/ixgbe_vf.h: revision 1.13 sys/dev/pci/ixgbe/ixgbe_api.c: revision 1.20 sys/dev/pci/ixgbe/ixgbe_sriov.h: revision 1.3 sys/dev/pci/ixgbe/ixgbe_common.c: revision 1.21 sys/dev/pci/ixgbe/ixgbe_osdep.h: revision 1.21 sys/dev/pci/ixgbe/ixgbe_common.c: revision 1.22 sys/dev/pci/ixgbe/ixgbe_82599.h: revision 1.7 sys/dev/pci/ixgbe/ixgbe.c: revision 1.144 sys/dev/pci/ixgbe/ixgbe.c: revision 1.145 sys/dev/pci/ixgbe/ixgbe_phy.c: revision 1.16 sys/dev/pci/ixgbe/ixgbe.c: revision 1.146 sys/dev/pci/ixgbe/ixgbe_phy.c: revision 1.17 sys/dev/pci/ixgbe/ixgbe_82598.h: revision 1.8 sys/dev/pci/ixgbe/ixgbe.h: revision 1.41 sys/dev/pci/ixgbe/ixgbe_mbx.c: revision 1.10 sys/dev/pci/ixgbe/ixgbe_x540.c: revision 1.14 sys/dev/pci/ixgbe/ixgbe_x540.c: revision 1.15 sys/dev/pci/ixgbe/ixgbe_phy.h: revision 1.11 Sync with the remaining part of FreeBSD r328265 except sfp_reinit stuff: - Always schedule module intterrupt in ixgbe_config_link() when a device is SFP+ based. - Use not loop index but txr->me in ixv_initialize_{transmit,receive}_units(). It's required for VMDQ but NetBSD doesn't use it, so it's not a bug in NetBSD. - Simplify ixgbe_bp_wd_set(). No functional change. - Whitespace. Sync with FreeBSD r331224 except ixv_if_update_admin_status()'s change: - Fix length of reading buffer when the command is Read Flash in ixgbe_host_interface_command(). - Add missing start_hw() call in ixv_init_locked(). This is not a real bug because start_hw just set hw->adapter_stopped to false and anyone refer it. - Style change. - Update comment. Read sc_if_flags after taking core lock. Same as if_wm.c rev. 1.418. To generate a diff of this commit: cvs rdiff -u -r1.2.4.3 -r1.2.4.4 src/sys/dev/pci/ixgbe/if_bypass.c cvs rdiff -u -r1.1.4.2 -r1.1.4.3 src/sys/dev/pci/ixgbe/if_fdir.c \ src/sys/dev/pci/ixgbe/ixgbe_fdir.h cvs rdiff -u -r1.1.4.3 -r1.1.4.4 src/sys/dev/pci/ixgbe/if_sriov.c \ src/sys/dev/pci/ixgbe/ixgbe_sriov.h cvs rdiff -u -r1.24.2.9 -r1.24.2.10 src/sys/dev/pci/ixgbe/ix_txrx.c cvs rdiff -u -r1.88.2.16 -r1.88.2.17 src/sys/dev/pci/ixgbe/ixgbe.c cvs rdiff -u -r1.24.6.9 -r1.24.6.10 src/sys/dev/pci/ixgbe/ixgbe.h cvs rdiff -u -r1.8.8.1 -r1.8.8.2 src/sys/dev/pci/ixgbe/ixgbe_82598.c \ src/sys/dev/pci/ixgbe/ixgbe_phy.h cvs rdiff -u -r1.5.8.1 -r1.5.8.2 src/sys/dev/pci/ixgbe/ixgbe_82598.h \ src/sys/dev/pci/ixgbe/ixgbe_x540.h cvs rdiff -u -r1.14.8.2 -r1.14.8.3 src/sys/dev/pci/ixgbe/ixgbe_82599.c cvs rdiff -u -r1.4.8.1 -r1.4.8.2 src/sys/dev/pci/ixgbe/ixgbe_82599.h \ src/sys/dev/pci/ixgbe/ixgbe_dcb.c cvs rdiff -u -r1.15.8.2 -r1.15.8.3 src/sys/dev/pci/ixgbe/ixgbe_api.c cvs rdiff -u -r1.9.8.2 -r1.9.8.3 src/sys/dev/pci/ixgbe/ixgbe_api.h cvs rdiff -u -r1.13.2.3 -r1.13.2.4 src/sys/dev/pci/ixgbe/ixgbe_common.c cvs rdiff -u -r1.7.8.3 -r1.7.8.4 src/sys/dev/pci/ixgbe/ixgbe_common.h cvs rdiff -u -r1.3.8.1 -r1.3.8.2 src/sys/dev/pci/ixgbe/ixgbe_dcb.h \ src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c \ src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.h \ src/sys/dev/pci/ixgbe/ixgbe_dcb_82599.c \ src/sys/dev/pci/ixgbe/ixgbe_dcb_82599.h cvs rdiff -u -r1.6.8.1 -r1.6.8.2 src/sys/dev/pci/ixgbe/ixgbe_mbx.c cvs rdiff -u -r1.10.8.1 -r1.10.8.2 src/sys/dev/pci/ixgbe/ixgbe_mbx.h cvs rdiff -u -r1.1.12.2 -r1.1.12.3 src/sys/dev/pci/ixgbe/ixgbe_osdep.c cvs rdiff -u -r1.17.6.2 -r1.17.6.3 src/sys/dev/pci/ixgbe/ixgbe_osdep.h cvs rdiff -u -r1.11.6.2 -r1.11.6.3 src/sys/dev/pci/ixgbe/ixgbe_phy.c cvs rdiff -u -r1.2.2.3 -r1.2.2.4 src/sys/dev/pci/ixgbe/ixgbe_rss.h cvs rdiff -u -r1.22.2.4 -r1.22.2.5 src/sys/dev/pci/ixgbe/ixgbe_type.h cvs rdiff -u -r1.12.8.1 -r1.12.8.2 src/sys/dev/pci/ixgbe/ixgbe_vf.c cvs rdiff -u -r1.8.6.2 -r1.8.6.3 src/sys/dev/pci/ixgbe/ixgbe_vf.h cvs rdiff -u -r1.9.6.2 -r1.9.6.3 src/sys/dev/pci/ixgbe/ixgbe_x540.c cvs rdiff -u -r1.5.6.3 -r1.5.6.4 src/sys/dev/pci/ixgbe/ixgbe_x550.c cvs rdiff -u -r1.56.2.13 -r1.56.2.14 src/sys/dev/pci/ixgbe/ixv.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/ixgbe/if_bypass.c diff -u src/sys/dev/pci/ixgbe/if_bypass.c:1.2.4.3 src/sys/dev/pci/ixgbe/if_bypass.c:1.2.4.4 --- src/sys/dev/pci/ixgbe/if_bypass.c:1.2.4.3 Fri Mar 30 12:07:34 2018 +++ src/sys/dev/pci/ixgbe/if_bypass.c Sat Apr 14 10:25:11 2018 @@ -30,7 +30,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/if_bypass.c 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/if_bypass.c 327031 2017-12-20 18:15:06Z erj $*/ #include "ixgbe.h" @@ -168,13 +168,13 @@ ixgbe_bp_set_state(SYSCTLFN_ARGS) error = hw->mac.ops.bypass_rw(hw, BYPASS_PAGE_CTL0, &state); ixgbe_bypass_mutex_clear(adapter); - if (error) + if (error != 0) return (error); state = (state >> BYPASS_STATUS_OFF_SHIFT) & 0x3; node.sysctl_data = &state; error = sysctl_lookup(SYSCTLFN_CALL(&node)); - if ((error) || (newp == NULL)) + if ((error != 0) || (newp == NULL)) return (error); /* Sanity check new state */ @@ -452,7 +452,7 @@ ixgbe_bp_wd_set(SYSCTLFN_ARGS) struct ixgbe_hw *hw = &adapter->hw; int error, tmp; static int timeout = 0; - u32 mask, arg = BYPASS_PAGE_CTL0; + u32 mask, arg; /* Get the current hardware value */ ixgbe_bypass_mutex_enter(adapter); @@ -472,48 +472,38 @@ ixgbe_bp_wd_set(SYSCTLFN_ARGS) if ((error) || (newp == NULL)) return (error); - mask = BYPASS_WDT_ENABLE_M; + arg = 0x1 << BYPASS_WDT_ENABLE_SHIFT; + mask = BYPASS_WDT_ENABLE_M | BYPASS_WDT_VALUE_M; switch (timeout) { case 0: /* disables the timer */ + arg = BYPASS_PAGE_CTL0; + mask = BYPASS_WDT_ENABLE_M; break; case 1: - arg = BYPASS_WDT_1_5 << BYPASS_WDT_TIME_SHIFT; - arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT; - mask |= BYPASS_WDT_VALUE_M; + arg |= BYPASS_WDT_1_5 << BYPASS_WDT_TIME_SHIFT; break; case 2: - arg = BYPASS_WDT_2 << BYPASS_WDT_TIME_SHIFT; - arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT; - mask |= BYPASS_WDT_VALUE_M; + arg |= BYPASS_WDT_2 << BYPASS_WDT_TIME_SHIFT; break; case 3: - arg = BYPASS_WDT_3 << BYPASS_WDT_TIME_SHIFT; - arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT; - mask |= BYPASS_WDT_VALUE_M; + arg |= BYPASS_WDT_3 << BYPASS_WDT_TIME_SHIFT; break; case 4: - arg = BYPASS_WDT_4 << BYPASS_WDT_TIME_SHIFT; - arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT; - mask |= BYPASS_WDT_VALUE_M; + arg |= BYPASS_WDT_4 << BYPASS_WDT_TIME_SHIFT; break; case 8: - arg = BYPASS_WDT_8 << BYPASS_WDT_TIME_SHIFT; - arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT; - mask |= BYPASS_WDT_VALUE_M; + arg |= BYPASS_WDT_8 << BYPASS_WDT_TIME_SHIFT; break; case 16: - arg = BYPASS_WDT_16 << BYPASS_WDT_TIME_SHIFT; - arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT; - mask |= BYPASS_WDT_VALUE_M; + arg |= BYPASS_WDT_16 << BYPASS_WDT_TIME_SHIFT; break; case 32: - arg = BYPASS_WDT_32 << BYPASS_WDT_TIME_SHIFT; - arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT; - mask |= BYPASS_WDT_VALUE_M; + arg |= BYPASS_WDT_32 << BYPASS_WDT_TIME_SHIFT; break; default: return (EINVAL); } + /* Set the new watchdog */ ixgbe_bypass_mutex_enter(adapter); error = hw->mac.ops.bypass_set(hw, BYPASS_PAGE_CTL0, mask, arg); @@ -559,7 +549,8 @@ ixgbe_bp_wd_reset(SYSCTLFN_ARGS) error = IXGBE_BYPASS_FW_WRITE_FAILURE; break; } - if (hw->mac.ops.bypass_rw(hw, BYPASS_PAGE_CTL1, &reset_wd)) { + error = hw->mac.ops.bypass_rw(hw, BYPASS_PAGE_CTL1, &reset_wd); + if (error != 0) { error = IXGBE_ERR_INVALID_ARGUMENT; break; } @@ -724,7 +715,7 @@ ixgbe_bp_log(SYSCTLFN_ARGS) /* Another log command can now run */ while (atomic_cas_uint(&adapter->bypass.log, 1, 0) == 0) usec_delay(3000); - return(error); + return (error); unlock_err: ixgbe_bypass_mutex_clear(adapter); @@ -745,9 +736,9 @@ ixgbe_bypass_init(struct adapter *adapte { struct ixgbe_hw *hw = &adapter->hw; device_t dev = adapter->dev; - u32 mask, value, sec, year; struct sysctllog **log; const struct sysctlnode *rnode, *cnode; + u32 mask, value, sec, year; if (!(adapter->feat_cap & IXGBE_FEATURE_BYPASS)) return; @@ -825,7 +816,5 @@ ixgbe_bypass_init(struct adapter *adapte ixgbe_bp_wd_reset, 0, (void *)adapter, 0, CTL_CREATE, CTL_EOL); adapter->feat_en |= IXGBE_FEATURE_BYPASS; - - return; } /* ixgbe_bypass_init */ Index: src/sys/dev/pci/ixgbe/if_fdir.c diff -u src/sys/dev/pci/ixgbe/if_fdir.c:1.1.4.2 src/sys/dev/pci/ixgbe/if_fdir.c:1.1.4.3 --- src/sys/dev/pci/ixgbe/if_fdir.c:1.1.4.2 Thu Dec 21 19:28:54 2017 +++ src/sys/dev/pci/ixgbe/if_fdir.c Sat Apr 14 10:25:11 2018 @@ -30,7 +30,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/if_fdir.c 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/if_fdir.c 327031 2017-12-20 18:15:06Z erj $*/ #include "ixgbe.h" Index: src/sys/dev/pci/ixgbe/ixgbe_fdir.h diff -u src/sys/dev/pci/ixgbe/ixgbe_fdir.h:1.1.4.2 src/sys/dev/pci/ixgbe/ixgbe_fdir.h:1.1.4.3 --- src/sys/dev/pci/ixgbe/ixgbe_fdir.h:1.1.4.2 Thu Dec 21 19:28:54 2017 +++ src/sys/dev/pci/ixgbe/ixgbe_fdir.h Sat Apr 14 10:25:11 2018 @@ -30,7 +30,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_fdir.h 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_fdir.h 327031 2017-12-20 18:15:06Z erj $*/ #ifndef _IXGBE_FDIR_H_ #define _IXGBE_FDIR_H_ Index: src/sys/dev/pci/ixgbe/if_sriov.c diff -u src/sys/dev/pci/ixgbe/if_sriov.c:1.1.4.3 src/sys/dev/pci/ixgbe/if_sriov.c:1.1.4.4 --- src/sys/dev/pci/ixgbe/if_sriov.c:1.1.4.3 Fri Mar 30 12:07:34 2018 +++ src/sys/dev/pci/ixgbe/if_sriov.c Sat Apr 14 10:25:11 2018 @@ -30,7 +30,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/if_sriov.c 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/if_sriov.c 327031 2017-12-20 18:15:06Z erj $*/ #include "ixgbe.h" #include "ixgbe_sriov.h" @@ -90,26 +90,26 @@ ixgbe_align_all_queue_indices(struct ada /* Support functions for SR-IOV/VF management */ static inline void -ixgbe_send_vf_msg(struct ixgbe_hw *hw, struct ixgbe_vf *vf, u32 msg) +ixgbe_send_vf_msg(struct adapter *adapter, struct ixgbe_vf *vf, u32 msg) { if (vf->flags & IXGBE_VF_CTS) msg |= IXGBE_VT_MSGTYPE_CTS; - hw->mbx.ops.write(hw, &msg, 1, vf->pool); + adapter->hw.mbx.ops.write(&adapter->hw, &msg, 1, vf->pool); } static inline void ixgbe_send_vf_ack(struct adapter *adapter, struct ixgbe_vf *vf, u32 msg) { msg &= IXGBE_VT_MSG_MASK; - ixgbe_send_vf_msg(&adapter->hw, vf, msg | IXGBE_VT_MSGTYPE_ACK); + ixgbe_send_vf_msg(adapter, vf, msg | IXGBE_VT_MSGTYPE_ACK); } static inline void ixgbe_send_vf_nack(struct adapter *adapter, struct ixgbe_vf *vf, u32 msg) { msg &= IXGBE_VT_MSG_MASK; - ixgbe_send_vf_msg(&adapter->hw, vf, msg | IXGBE_VT_MSGTYPE_NACK); + ixgbe_send_vf_msg(adapter, vf, msg | IXGBE_VT_MSGTYPE_NACK); } static inline void @@ -205,7 +205,7 @@ ixgbe_ping_all_vfs(struct adapter *adapt for (int i = 0; i < adapter->num_vfs; i++) { vf = &adapter->vfs[i]; if (vf->flags & IXGBE_VF_ACTIVE) - ixgbe_send_vf_msg(&adapter->hw, vf, IXGBE_PF_CONTROL_MSG); + ixgbe_send_vf_msg(adapter, vf, IXGBE_PF_CONTROL_MSG); } } /* ixgbe_ping_all_vfs */ @@ -775,7 +775,7 @@ ixgbe_init_vf(struct adapter *adapter, s ixgbe_vf_enable_transmit(adapter, vf); ixgbe_vf_enable_receive(adapter, vf); - ixgbe_send_vf_msg(&adapter->hw, vf, IXGBE_PF_CONTROL_MSG); + ixgbe_send_vf_msg(adapter, vf, IXGBE_PF_CONTROL_MSG); } /* ixgbe_init_vf */ void Index: src/sys/dev/pci/ixgbe/ixgbe_sriov.h diff -u src/sys/dev/pci/ixgbe/ixgbe_sriov.h:1.1.4.3 src/sys/dev/pci/ixgbe/ixgbe_sriov.h:1.1.4.4 --- src/sys/dev/pci/ixgbe/ixgbe_sriov.h:1.1.4.3 Fri Mar 30 12:07:34 2018 +++ src/sys/dev/pci/ixgbe/ixgbe_sriov.h Sat Apr 14 10:25:11 2018 @@ -30,7 +30,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_sriov.h 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_sriov.h 327031 2017-12-20 18:15:06Z erj $*/ #ifndef _IXGBE_SRIOV_H_ @@ -57,7 +57,7 @@ #define IXGBE_VF_GET_QUEUES_RESP_LEN 5 -#define IXGBE_API_VER_1_0 0 +#define IXGBE_API_VER_1_0 0 #define IXGBE_API_VER_2_0 1 /* Solaris API. Not supported. */ #define IXGBE_API_VER_1_1 2 #define IXGBE_API_VER_UNKNOWN UINT16_MAX Index: src/sys/dev/pci/ixgbe/ix_txrx.c diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.9 src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.10 --- src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.9 Wed Apr 4 16:18:49 2018 +++ src/sys/dev/pci/ixgbe/ix_txrx.c Sat Apr 14 10:25:11 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ix_txrx.c,v 1.24.2.9 2018/04/04 16:18:49 martin Exp $ */ +/* $NetBSD: ix_txrx.c,v 1.24.2.10 2018/04/14 10:25:11 martin Exp $ */ /****************************************************************************** @@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ix_txrx.c 321476 2017-07-25 14:38:30Z sbruno $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ix_txrx.c 327031 2017-12-20 18:15:06Z erj $*/ /* * Copyright (c) 2011 The NetBSD Foundation, Inc. Index: src/sys/dev/pci/ixgbe/ixgbe.c diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.16 src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.17 --- src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.16 Wed Apr 4 16:18:49 2018 +++ src/sys/dev/pci/ixgbe/ixgbe.c Sat Apr 14 10:25:11 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe.c,v 1.88.2.16 2018/04/04 16:18:49 martin Exp $ */ +/* $NetBSD: ixgbe.c,v 1.88.2.17 2018/04/14 10:25:11 martin Exp $ */ /****************************************************************************** @@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 320916 2017-07-12 17:35:32Z sbruno $*/ +/*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 331224 2018-03-19 20:55:05Z erj $*/ /* * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -80,7 +80,7 @@ /************************************************************************ * Driver version ************************************************************************/ -char ixgbe_driver_version[] = "3.2.12-k"; +char ixgbe_driver_version[] = "4.0.1-k"; /************************************************************************ @@ -669,7 +669,6 @@ ixgbe_initialize_receive_units(struct ad IXGBE_WRITE_REG(hw, IXGBE_RXCSUM, rxcsum); - return; } /* ixgbe_initialize_receive_units */ /************************************************************************ @@ -680,9 +679,10 @@ ixgbe_initialize_transmit_units(struct a { struct tx_ring *txr = adapter->tx_rings; struct ixgbe_hw *hw = &adapter->hw; + int i; /* Setup the Base and Length of the Tx Descriptor Ring */ - for (int i = 0; i < adapter->num_queues; i++, txr++) { + for (i = 0; i < adapter->num_queues; i++, txr++) { u64 tdba = txr->txdma.dma_paddr; u32 txctrl = 0; int j = txr->me; @@ -827,7 +827,7 @@ ixgbe_attach(device_t parent, device_t d /* * Initialize the shared code */ - if (ixgbe_init_shared_code(hw)) { + if (ixgbe_init_shared_code(hw) != 0) { aprint_error_dev(dev, "Unable to initialize the shared code\n"); error = ENXIO; goto err_out; @@ -1466,23 +1466,23 @@ ixgbe_is_sfp(struct ixgbe_hw *hw) switch (hw->mac.type) { case ixgbe_mac_82598EB: if (hw->phy.type == ixgbe_phy_nl) - return TRUE; - return FALSE; + return (TRUE); + return (FALSE); case ixgbe_mac_82599EB: switch (hw->mac.ops.get_media_type(hw)) { case ixgbe_media_type_fiber: case ixgbe_media_type_fiber_qsfp: - return TRUE; + return (TRUE); default: - return FALSE; + return (FALSE); } case ixgbe_mac_X550EM_x: case ixgbe_mac_X550EM_a: if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) - return TRUE; - return FALSE; + return (TRUE); + return (FALSE); default: - return FALSE; + return (FALSE); } } /* ixgbe_is_sfp */ @@ -1500,16 +1500,14 @@ ixgbe_config_link(struct adapter *adapte if (sfp) { if (hw->phy.multispeed_fiber) { - hw->mac.ops.setup_sfp(hw); ixgbe_enable_tx_laser(hw); kpreempt_disable(); softint_schedule(adapter->msf_si); kpreempt_enable(); - } else { - kpreempt_disable(); - softint_schedule(adapter->mod_si); - kpreempt_enable(); } + kpreempt_disable(); + softint_schedule(adapter->mod_si); + kpreempt_enable(); } else { struct ifmedia *ifm = &adapter->media; @@ -1517,7 +1515,7 @@ ixgbe_config_link(struct adapter *adapte err = ixgbe_check_link(hw, &adapter->link_speed, &adapter->link_up, FALSE); if (err) - goto out; + return; /* * Check if it's the first call. If it's the first call, @@ -1529,14 +1527,12 @@ ixgbe_config_link(struct adapter *adapte err = hw->mac.ops.get_link_capabilities(hw, &autoneg, &negotiate); if (err) - goto out; + return; if (hw->mac.ops.setup_link) err = hw->mac.ops.setup_link(hw, autoneg, adapter->link_up); } -out: - return; } /* ixgbe_config_link */ /************************************************************************ @@ -1695,6 +1691,7 @@ ixgbe_add_hw_stats(struct adapter *adapt struct ixgbe_hw *hw = &adapter->hw; struct ixgbe_hw_stats *stats = &adapter->stats.pf; const char *xname = device_xname(dev); + int i; /* Driver Statistics */ evcnt_attach_dynamic(&adapter->efbig_tx_dma_setup, EVCNT_TYPE_MISC, @@ -1726,7 +1723,7 @@ ixgbe_add_hw_stats(struct adapter *adapt evcnt_attach_dynamic(&adapter->phy_sicount, EVCNT_TYPE_INTR, NULL, xname, "external PHY softint"); - for (int i = 0; i < adapter->num_queues; i++, rxr++, txr++) { + for (i = 0; i < adapter->num_queues; i++, rxr++, txr++) { #ifdef LRO struct lro_ctrl *lro = &rxr->lro; #endif /* LRO */ @@ -2312,7 +2309,6 @@ ixgbe_get_slot_info(struct adapter *adap device_t dev = adapter->dev; struct ixgbe_hw *hw = &adapter->hw; u32 offset; -// struct ixgbe_mac_info *mac = &hw->mac; u16 link; int bus_info_valid = TRUE; @@ -2789,7 +2785,7 @@ ixgbe_media_change(struct ifnet *ifp) return (EINVAL); if (hw->phy.media_type == ixgbe_media_type_backplane) - return (ENODEV); + return (EPERM); /* * We don't actually need to check against the supported @@ -3049,8 +3045,7 @@ ixgbe_eitr_write(struct ix_queue *que, u else itr |= IXGBE_EITR_CNT_WDIS; - IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITR(que->msix), - itr); + IXGBE_WRITE_REG(&adapter->hw, IXGBE_EITR(que->msix), itr); } @@ -3722,7 +3717,7 @@ ixgbe_init_locked(struct adapter *adapte u32 txdctl, mhadd; u32 rxdctl, rxctrl; u32 ctrl_ext; - int err = 0; + int i, j, err; /* XXX check IFF_UP and IFF_RUNNING, power-saving state! */ @@ -3760,7 +3755,9 @@ ixgbe_init_locked(struct adapter *adapte } ixgbe_init_hw(hw); + ixgbe_initialize_iov(adapter); + ixgbe_initialize_transmit_units(adapter); /* Setup Multicast table */ @@ -3795,7 +3792,7 @@ ixgbe_init_locked(struct adapter *adapte } /* Now enable all the queues */ - for (int i = 0; i < adapter->num_queues; i++) { + for (i = 0; i < adapter->num_queues; i++) { txr = &adapter->tx_rings[i]; txdctl = IXGBE_READ_REG(hw, IXGBE_TXDCTL(txr->me)); txdctl |= IXGBE_TXDCTL_ENABLE; @@ -3812,7 +3809,7 @@ ixgbe_init_locked(struct adapter *adapte IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(txr->me), txdctl); } - for (int i = 0, j = 0; i < adapter->num_queues; i++) { + for (i = 0; i < adapter->num_queues; i++) { rxr = &adapter->rx_rings[i]; rxdctl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(rxr->me)); if (hw->mac.type == ixgbe_mac_82598EB) { @@ -3826,7 +3823,7 @@ ixgbe_init_locked(struct adapter *adapte } rxdctl |= IXGBE_RXDCTL_ENABLE; IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(rxr->me), rxdctl); - for (; j < 10; j++) { + for (j = 0; j < 10; j++) { if (IXGBE_READ_REG(hw, IXGBE_RXDCTL(rxr->me)) & IXGBE_RXDCTL_ENABLE) break; @@ -3874,7 +3871,7 @@ ixgbe_init_locked(struct adapter *adapte callout_reset(&adapter->timer, hz, ixgbe_local_timer, adapter); - /* Set up MSI-X routing */ + /* Set up MSI/MSI-X routing */ if (adapter->feat_en & IXGBE_FEATURE_MSIX) { ixgbe_configure_ivars(adapter); /* Set up auto-mask */ @@ -3908,6 +3905,9 @@ ixgbe_init_locked(struct adapter *adapte /* Set moderation on the Link interrupt */ IXGBE_WRITE_REG(hw, IXGBE_EITR(adapter->vector), IXGBE_LINK_ITR); + /* Enable power to the phy. */ + ixgbe_set_phy_power(hw, TRUE); + /* Config/Enable Link */ ixgbe_config_link(adapter); @@ -4601,6 +4601,7 @@ ixgbe_update_link_status(struct adapter /* Update DMA coalescing config */ ixgbe_config_dmac(adapter); if_link_state_change(ifp, LINK_STATE_UP); + if (adapter->feat_en & IXGBE_FEATURE_SRIOV) ixgbe_ping_all_vfs(adapter); } @@ -4725,7 +4726,6 @@ ixgbe_enable_intr(struct adapter *adapte IXGBE_WRITE_FLUSH(hw); - return; } /* ixgbe_enable_intr */ /************************************************************************ @@ -4895,8 +4895,6 @@ ixgbe_free_pciintr_resources(struct adap adapter->osdep.nintrs); adapter->osdep.intrs = NULL; } - - return; } /* ixgbe_free_pciintr_resources */ /************************************************************************ @@ -4914,7 +4912,6 @@ ixgbe_free_pci_resources(struct adapter adapter->osdep.mem_size); } - return; } /* ixgbe_free_pci_resources */ /************************************************************************ @@ -5763,10 +5760,11 @@ ixgbe_ifflags_cb(struct ethercom *ec) { struct ifnet *ifp = &ec->ec_if; struct adapter *adapter = ifp->if_softc; - int change = ifp->if_flags ^ adapter->if_flags, rc = 0; + int change, rc = 0; IXGBE_CORE_LOCK(adapter); + change = ifp->if_flags ^ adapter->if_flags; if (change != 0) adapter->if_flags = ifp->if_flags; Index: src/sys/dev/pci/ixgbe/ixgbe.h diff -u src/sys/dev/pci/ixgbe/ixgbe.h:1.24.6.9 src/sys/dev/pci/ixgbe/ixgbe.h:1.24.6.10 --- src/sys/dev/pci/ixgbe/ixgbe.h:1.24.6.9 Wed Apr 4 16:18:49 2018 +++ src/sys/dev/pci/ixgbe/ixgbe.h Sat Apr 14 10:25:12 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe.h,v 1.24.6.9 2018/04/04 16:18:49 martin Exp $ */ +/* $NetBSD: ixgbe.h,v 1.24.6.10 2018/04/14 10:25:12 martin Exp $ */ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause @@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe.h 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe.h 327031 2017-12-20 18:15:06Z erj $*/ /* * Copyright (c) 2011 The NetBSD Foundation, Inc. Index: src/sys/dev/pci/ixgbe/ixgbe_82598.c diff -u src/sys/dev/pci/ixgbe/ixgbe_82598.c:1.8.8.1 src/sys/dev/pci/ixgbe/ixgbe_82598.c:1.8.8.2 --- src/sys/dev/pci/ixgbe/ixgbe_82598.c:1.8.8.1 Thu Dec 21 19:28:54 2017 +++ src/sys/dev/pci/ixgbe/ixgbe_82598.c Sat Apr 14 10:25:11 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe_82598.c,v 1.8.8.1 2017/12/21 19:28:54 snj Exp $ */ +/* $NetBSD: ixgbe_82598.c,v 1.8.8.2 2018/04/14 10:25:11 martin Exp $ */ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause @@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_82598.c 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_82598.c 331224 2018-03-19 20:55:05Z erj $*/ #include "ixgbe_type.h" #include "ixgbe_82598.h" @@ -552,6 +552,7 @@ out: /** * ixgbe_start_mac_link_82598 - Configures MAC link settings * @hw: pointer to hardware structure + * @autoneg_wait_to_complete: TRUE when waiting for completion is needed * * Configures link settings based on values in the ixgbe_hw struct. * Restarts the link. Performs autonegotiation if needed. @@ -1209,7 +1210,7 @@ s32 ixgbe_read_i2c_eeprom_82598(struct i * ixgbe_read_i2c_sff8472_82598 - Reads 8 bit word over I2C interface. * @hw: pointer to hardware structure * @byte_offset: byte offset at address 0xA2 - * @eeprom_data: value read + * @sff8472_data: value read * * Performs 8 byte read operation to SFP module's SFF-8472 data over I2C **/ Index: src/sys/dev/pci/ixgbe/ixgbe_phy.h diff -u src/sys/dev/pci/ixgbe/ixgbe_phy.h:1.8.8.1 src/sys/dev/pci/ixgbe/ixgbe_phy.h:1.8.8.2 --- src/sys/dev/pci/ixgbe/ixgbe_phy.h:1.8.8.1 Thu Dec 21 19:28:54 2017 +++ src/sys/dev/pci/ixgbe/ixgbe_phy.h Sat Apr 14 10:25:12 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe_phy.h,v 1.8.8.1 2017/12/21 19:28:54 snj Exp $ */ +/* $NetBSD: ixgbe_phy.h,v 1.8.8.2 2018/04/14 10:25:12 martin Exp $ */ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause @@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_phy.h 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_phy.h 326022 2017-11-20 19:36:21Z pfg $*/ #ifndef _IXGBE_PHY_H_ #define _IXGBE_PHY_H_ Index: src/sys/dev/pci/ixgbe/ixgbe_82598.h diff -u src/sys/dev/pci/ixgbe/ixgbe_82598.h:1.5.8.1 src/sys/dev/pci/ixgbe/ixgbe_82598.h:1.5.8.2 --- src/sys/dev/pci/ixgbe/ixgbe_82598.h:1.5.8.1 Thu Dec 21 19:28:54 2017 +++ src/sys/dev/pci/ixgbe/ixgbe_82598.h Sat Apr 14 10:25:12 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe_82598.h,v 1.5.8.1 2017/12/21 19:28:54 snj Exp $ */ +/* $NetBSD: ixgbe_82598.h,v 1.5.8.2 2018/04/14 10:25:12 martin Exp $ */ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause @@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_82598.h 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_82598.h 326022 2017-11-20 19:36:21Z pfg $*/ #ifndef _IXGBE_82598_H_ #define _IXGBE_82598_H_ Index: src/sys/dev/pci/ixgbe/ixgbe_x540.h diff -u src/sys/dev/pci/ixgbe/ixgbe_x540.h:1.5.8.1 src/sys/dev/pci/ixgbe/ixgbe_x540.h:1.5.8.2 --- src/sys/dev/pci/ixgbe/ixgbe_x540.h:1.5.8.1 Thu Dec 21 19:28:54 2017 +++ src/sys/dev/pci/ixgbe/ixgbe_x540.h Sat Apr 14 10:25:11 2018 @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_x540.h 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_x540.h 326022 2017-11-20 19:36:21Z pfg $*/ #ifndef _IXGBE_X540_H_ #define _IXGBE_X540_H_ Index: src/sys/dev/pci/ixgbe/ixgbe_82599.c diff -u src/sys/dev/pci/ixgbe/ixgbe_82599.c:1.14.8.2 src/sys/dev/pci/ixgbe/ixgbe_82599.c:1.14.8.3 --- src/sys/dev/pci/ixgbe/ixgbe_82599.c:1.14.8.2 Wed Apr 4 16:18:49 2018 +++ src/sys/dev/pci/ixgbe/ixgbe_82599.c Sat Apr 14 10:25:11 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe_82599.c,v 1.14.8.2 2018/04/04 16:18:49 martin Exp $ */ +/* $NetBSD: ixgbe_82599.c,v 1.14.8.3 2018/04/14 10:25:11 martin Exp $ */ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause @@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_82599.c 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_82599.c 331224 2018-03-19 20:55:05Z erj $*/ #include "ixgbe_type.h" #include "ixgbe_82599.h" @@ -273,7 +273,7 @@ s32 prot_autoc_read_82599(struct ixgbe_h /** * prot_autoc_write_82599 - Hides MAC differences needed for AUTOC write * @hw: pointer to hardware structure - * @reg_val: value to write to AUTOC + * @autoc: value to write to AUTOC * @locked: bool to indicate whether the SW/FW lock was already taken by * previous proc_autoc_read_82599. * @@ -1380,6 +1380,7 @@ s32 ixgbe_init_fdir_signature_82599(stru s32 ixgbe_init_fdir_perfect_82599(struct ixgbe_hw *hw, u32 fdirctrl, bool cloud_mode) { + UNREFERENCED_1PARAMETER(cloud_mode); DEBUGFUNC("ixgbe_init_fdir_perfect_82599"); /* @@ -1468,7 +1469,8 @@ do { \ /** * ixgbe_atr_compute_sig_hash_82599 - Compute the signature hash - * @stream: input bitstream to compute the hash on + * @input: input bitstream to compute the hash on + * @common: compressed common input dword * * This function is almost identical to the function above but contains * several optimizations such as unwinding all of the loops, letting the @@ -1607,7 +1609,7 @@ do { \ /** * ixgbe_atr_compute_perfect_hash_82599 - Compute the perfect filter hash - * @atr_input: input bitstream to compute the hash on + * @input: input bitstream to compute the hash on * @input_mask: mask for the input bitstream * * This function serves two main purposes. First it applies the input_mask @@ -1708,6 +1710,7 @@ s32 ixgbe_fdir_set_input_mask_82599(stru u32 fdirm = IXGBE_FDIRM_DIPv6; u32 fdirtcpm; u32 fdirip6m; + UNREFERENCED_1PARAMETER(cloud_mode); DEBUGFUNC("ixgbe_fdir_set_atr_input_mask_82599"); /* @@ -1884,6 +1887,7 @@ s32 ixgbe_fdir_write_perfect_filter_8259 u32 addr_low, addr_high; u32 cloud_type = 0; s32 err; + UNREFERENCED_1PARAMETER(cloud_mode); DEBUGFUNC("ixgbe_fdir_write_perfect_filter_82599"); if (!cloud_mode) { @@ -2008,6 +2012,7 @@ s32 ixgbe_fdir_erase_perfect_filter_8259 * @input_mask: mask for the input bitstream * @soft_id: software index for the filters * @queue: queue index to direct traffic to + * @cloud_mode: unused * * Note that the caller to this function must lock before calling, since the * hardware writes must be protected from one another. @@ -2018,6 +2023,7 @@ s32 ixgbe_fdir_add_perfect_filter_82599( u16 soft_id, u8 queue, bool cloud_mode) { s32 err = IXGBE_ERR_CONFIG; + UNREFERENCED_1PARAMETER(cloud_mode); DEBUGFUNC("ixgbe_fdir_add_perfect_filter_82599"); @@ -2527,6 +2533,7 @@ reset_pipeline_out: * ixgbe_read_i2c_byte_82599 - Reads 8 bit word over I2C * @hw: pointer to hardware structure * @byte_offset: byte offset to read + * @dev_addr: address to read from * @data: value read * * Performs byte read operation to SFP module's EEPROM over I2C interface at @@ -2584,6 +2591,7 @@ release_i2c_access: * ixgbe_write_i2c_byte_82599 - Writes 8 bit word over I2C * @hw: pointer to hardware structure * @byte_offset: byte offset to write + * @dev_addr: address to read from * @data: value to write * * Performs byte write operation to SFP module's EEPROM over I2C interface at Index: src/sys/dev/pci/ixgbe/ixgbe_82599.h diff -u src/sys/dev/pci/ixgbe/ixgbe_82599.h:1.4.8.1 src/sys/dev/pci/ixgbe/ixgbe_82599.h:1.4.8.2 --- src/sys/dev/pci/ixgbe/ixgbe_82599.h:1.4.8.1 Thu Dec 21 19:28:54 2017 +++ src/sys/dev/pci/ixgbe/ixgbe_82599.h Sat Apr 14 10:25:11 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe_82599.h,v 1.4.8.1 2017/12/21 19:28:54 snj Exp $ */ +/* $NetBSD: ixgbe_82599.h,v 1.4.8.2 2018/04/14 10:25:11 martin Exp $ */ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause @@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_82599.h 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_82599.h 326022 2017-11-20 19:36:21Z pfg $*/ #ifndef _IXGBE_82599_H_ #define _IXGBE_82599_H_ Index: src/sys/dev/pci/ixgbe/ixgbe_dcb.c diff -u src/sys/dev/pci/ixgbe/ixgbe_dcb.c:1.4.8.1 src/sys/dev/pci/ixgbe/ixgbe_dcb.c:1.4.8.2 --- src/sys/dev/pci/ixgbe/ixgbe_dcb.c:1.4.8.1 Thu Dec 21 19:28:54 2017 +++ src/sys/dev/pci/ixgbe/ixgbe_dcb.c Sat Apr 14 10:25:11 2018 @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_dcb.c 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_dcb.c 331224 2018-03-19 20:55:05Z erj $*/ #include "ixgbe_type.h" @@ -45,6 +45,10 @@ * are the smallest unit programmable into the underlying * hardware. The IEEE 802.1Qaz specification do not use bandwidth * groups so this is much simplified from the CEE case. + * @bw: bandwidth index by traffic class + * @refill: refill credits index by traffic class + * @max: max credits by traffic class + * @max_frame_size: maximum frame size */ s32 ixgbe_dcb_calculate_tc_credits(u8 *bw, u16 *refill, u16 *max, int max_frame_size) @@ -79,8 +83,10 @@ s32 ixgbe_dcb_calculate_tc_credits(u8 *b /** * ixgbe_dcb_calculate_tc_credits_cee - Calculates traffic class credits - * @ixgbe_dcb_config: Struct containing DCB settings. - * @direction: Configuring either Tx or Rx. + * @hw: pointer to hardware structure + * @dcb_config: Struct containing DCB settings + * @max_frame_size: Maximum frame size + * @direction: Configuring either Tx or Rx * * This function calculates the credits allocated to each traffic class. * It should be called only after the rules are checked by Index: src/sys/dev/pci/ixgbe/ixgbe_api.c diff -u src/sys/dev/pci/ixgbe/ixgbe_api.c:1.15.8.2 src/sys/dev/pci/ixgbe/ixgbe_api.c:1.15.8.3 --- src/sys/dev/pci/ixgbe/ixgbe_api.c:1.15.8.2 Thu Dec 21 19:28:54 2017 +++ src/sys/dev/pci/ixgbe/ixgbe_api.c Sat Apr 14 10:25:11 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe_api.c,v 1.15.8.2 2017/12/21 19:28:54 snj Exp $ */ +/* $NetBSD: ixgbe_api.c,v 1.15.8.3 2018/04/14 10:25:11 martin Exp $ */ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause @@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_api.c 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_api.c 331224 2018-03-19 20:55:05Z erj $*/ #include "ixgbe_api.h" #include "ixgbe_common.h" @@ -523,6 +523,7 @@ s32 ixgbe_get_phy_firmware_version(struc * ixgbe_read_phy_reg - Read PHY register * @hw: pointer to hardware structure * @reg_addr: 32 bit address of PHY register to read + * @device_type: type of device you want to communicate with * @phy_data: Pointer to read data from PHY register * * Reads a value from a specified PHY register @@ -541,6 +542,7 @@ s32 ixgbe_read_phy_reg(struct ixgbe_hw * * ixgbe_write_phy_reg - Write PHY register * @hw: pointer to hardware structure * @reg_addr: 32 bit PHY register to write + * @device_type: type of device you want to communicate with * @phy_data: Data to write to the PHY register * * Writes a value to specified PHY register @@ -584,6 +586,8 @@ s32 ixgbe_setup_internal_phy(struct ixgb /** * ixgbe_check_phy_link - Determine link and speed status * @hw: pointer to hardware structure + * @speed: link speed + * @link_up: TRUE when link is up * * Reads a PHY register to determine if link is up and the current speed for * the PHY. @@ -599,6 +603,7 @@ s32 ixgbe_check_phy_link(struct ixgbe_hw * ixgbe_setup_phy_link_speed - Set auto advertise * @hw: pointer to hardware structure * @speed: new link speed + * @autoneg_wait_to_complete: TRUE when waiting for completion is needed * * Sets the auto advertised capabilities **/ @@ -624,6 +629,9 @@ s32 ixgbe_set_phy_power(struct ixgbe_hw /** * ixgbe_check_link - Get link and speed status * @hw: pointer to hardware structure + * @speed: pointer to link speed + * @link_up: TRUE when link is up + * @link_up_wait_to_complete: bool used to wait for link up or not * * Reads the links register to determine if link is up and the current speed **/ @@ -677,6 +685,7 @@ void ixgbe_flap_tx_laser(struct ixgbe_hw * ixgbe_setup_link - Set link speed * @hw: pointer to hardware structure * @speed: new link speed + * @autoneg_wait_to_complete: TRUE when waiting for completion is needed * * Configures link settings. Restarts the link. * Performs autonegotiation if needed. @@ -693,6 +702,7 @@ s32 ixgbe_setup_link(struct ixgbe_hw *hw * ixgbe_setup_mac_link - Set link speed * @hw: pointer to hardware structure * @speed: new link speed + * @autoneg_wait_to_complete: TRUE when waiting for completion is needed * * Configures link settings. Restarts the link. * Performs autonegotiation if needed. @@ -708,6 +718,8 @@ s32 ixgbe_setup_mac_link(struct ixgbe_hw /** * ixgbe_get_link_capabilities - Returns link capabilities * @hw: pointer to hardware structure + * @speed: link speed capabilities + * @autoneg: TRUE when autoneg or autotry is enabled * * Determines the link capabilities of the current configuration. **/ @@ -760,6 +772,7 @@ s32 ixgbe_blink_led_start(struct ixgbe_h /** * ixgbe_blink_led_stop - Stop blinking LEDs * @hw: pointer to hardware structure + * @index: led number to stop * * Stop blinking LED based on index. **/ @@ -1002,6 +1015,7 @@ s32 ixgbe_update_uc_addr_list(struct ixg * @mc_addr_list: the list of new multicast addresses * @mc_addr_count: number of addresses * @func: iterator function to walk the multicast address list + * @clear: flag, when set clears the table beforehand * * The given list replaces any existing list. Clears the MC addrs from receive * address registers and the multicast table. Uses unused receive address @@ -1192,7 +1206,7 @@ s32 ixgbe_setup_eee(struct ixgbe_hw *hw, /** * ixgbe_set_source_address_pruning - Enable/Disable source address pruning * @hw: pointer to hardware structure - * @enbale: enable or disable source address pruning + * @enable: enable or disable source address pruning * @pool: Rx pool - Rx pool to toggle source address pruning **/ void ixgbe_set_source_address_pruning(struct ixgbe_hw *hw, bool enable, Index: src/sys/dev/pci/ixgbe/ixgbe_api.h diff -u src/sys/dev/pci/ixgbe/ixgbe_api.h:1.9.8.2 src/sys/dev/pci/ixgbe/ixgbe_api.h:1.9.8.3 --- src/sys/dev/pci/ixgbe/ixgbe_api.h:1.9.8.2 Wed Apr 4 16:18:49 2018 +++ src/sys/dev/pci/ixgbe/ixgbe_api.h Sat Apr 14 10:25:11 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe_api.h,v 1.9.8.2 2018/04/04 16:18:49 martin Exp $ */ +/* $NetBSD: ixgbe_api.h,v 1.9.8.3 2018/04/14 10:25:11 martin Exp $ */ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause @@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_api.h 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_api.h 326022 2017-11-20 19:36:21Z pfg $*/ #ifndef _IXGBE_API_H_ #define _IXGBE_API_H_ Index: src/sys/dev/pci/ixgbe/ixgbe_common.c diff -u src/sys/dev/pci/ixgbe/ixgbe_common.c:1.13.2.3 src/sys/dev/pci/ixgbe/ixgbe_common.c:1.13.2.4 --- src/sys/dev/pci/ixgbe/ixgbe_common.c:1.13.2.3 Wed Apr 4 16:18:49 2018 +++ src/sys/dev/pci/ixgbe/ixgbe_common.c Sat Apr 14 10:25:11 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe_common.c,v 1.13.2.3 2018/04/04 16:18:49 martin Exp $ */ +/* $NetBSD: ixgbe_common.c,v 1.13.2.4 2018/04/14 10:25:11 martin Exp $ */ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause @@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_common.c 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_common.c 331224 2018-03-19 20:55:05Z erj $*/ #include "ixgbe_common.h" #include "ixgbe_phy.h" @@ -2123,6 +2123,7 @@ static void ixgbe_shift_out_eeprom_bits( /** * ixgbe_shift_in_eeprom_bits - Shift data bits in from the EEPROM * @hw: pointer to hardware structure + * @count: number of bits to shift **/ static u16 ixgbe_shift_in_eeprom_bits(struct ixgbe_hw *hw, u16 count) { @@ -2181,7 +2182,7 @@ static void ixgbe_raise_eeprom_clk(struc /** * ixgbe_lower_eeprom_clk - Lowers the EEPROM's clock input. * @hw: pointer to hardware structure - * @eecd: EECD's current value + * @eec: EEC's current value **/ static void ixgbe_lower_eeprom_clk(struct ixgbe_hw *hw, u32 *eec) { @@ -2561,6 +2562,7 @@ s32 ixgbe_init_rx_addrs_generic(struct i * ixgbe_add_uc_addr - Adds a secondary unicast address. * @hw: pointer to hardware structure * @addr: new address + * @vmdq: VMDq "set" or "pool" index * * Adds it to unused receive address register or goes into promiscuous mode. **/ @@ -2705,7 +2707,7 @@ static s32 ixgbe_mta_vector(struct ixgbe /** * ixgbe_set_mta - Set bit-vector in multicast table * @hw: pointer to hardware structure - * @hash_value: Multicast address hash value + * @mc_addr: Multicast address * * Sets the bit-vector in the multicast table. **/ @@ -3409,6 +3411,7 @@ s32 ixgbe_disable_sec_rx_path_generic(st /** * prot_autoc_read_generic - Hides MAC differences needed for AUTOC read * @hw: pointer to hardware structure + * @locked: bool to indicate whether the SW/FW lock was taken * @reg_val: Value we read from AUTOC * * The default case requires no protection so just to the register read. @@ -3935,6 +3938,9 @@ s32 ixgbe_init_uta_tables_generic(struct * ixgbe_find_vlvf_slot - find the vlanid or the first empty slot * @hw: pointer to hardware structure * @vlan: VLAN id to write to VLAN filter + * @vlvf_bypass: TRUE to find vlanid only, FALSE returns first empty slot if + * vlanid not found + * * * return the VLVF index where this VLAN id should be placed * @@ -4606,10 +4612,11 @@ s32 ixgbe_host_interface_command(struct u32 length, u32 timeout, bool return_data) { u32 hdr_size = sizeof(struct ixgbe_hic_hdr); - u16 dword_len; + struct ixgbe_hic_hdr *resp = (struct ixgbe_hic_hdr *)buffer; u16 buf_len; s32 status; u32 bi; + u32 dword_len; DEBUGFUNC("ixgbe_host_interface_command"); @@ -4639,8 +4646,23 @@ s32 ixgbe_host_interface_command(struct IXGBE_LE32_TO_CPUS(&buffer[bi]); } - /* If there is any thing in data position pull it in */ - buf_len = ((struct ixgbe_hic_hdr *)buffer)->buf_len; + /* + * If there is any thing in data position pull it in + * Read Flash command requires reading buffer length from + * two byes instead of one byte + */ + if (resp->cmd == 0x30) { + for (; bi < dword_len + 2; bi++) { + buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, + bi); + IXGBE_LE32_TO_CPUS(&buffer[bi]); + } + buf_len = (((u16)(resp->cmd_or_resp.ret_status) << 3) + & 0xF00) | resp->buf_len; + hdr_size += (2 << 2); + } else { + buf_len = resp->buf_len; + } if (!buf_len) goto rel_out; @@ -4672,6 +4694,8 @@ rel_out: * @minr: driver version minor number * @build: driver version build number * @sub: driver version sub build number + * @len: unused + * @driver_ver: unused * * Sends driver version number to firmware through the manageability * block. On success return IXGBE_SUCCESS Index: src/sys/dev/pci/ixgbe/ixgbe_common.h diff -u src/sys/dev/pci/ixgbe/ixgbe_common.h:1.7.8.3 src/sys/dev/pci/ixgbe/ixgbe_common.h:1.7.8.4 --- src/sys/dev/pci/ixgbe/ixgbe_common.h:1.7.8.3 Wed Apr 4 16:18:49 2018 +++ src/sys/dev/pci/ixgbe/ixgbe_common.h Sat Apr 14 10:25:11 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe_common.h,v 1.7.8.3 2018/04/04 16:18:49 martin Exp $ */ +/* $NetBSD: ixgbe_common.h,v 1.7.8.4 2018/04/14 10:25:11 martin Exp $ */ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause @@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_common.h 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_common.h 331224 2018-03-19 20:55:05Z erj $*/ #ifndef _IXGBE_COMMON_H_ #define _IXGBE_COMMON_H_ Index: src/sys/dev/pci/ixgbe/ixgbe_dcb.h diff -u src/sys/dev/pci/ixgbe/ixgbe_dcb.h:1.3.8.1 src/sys/dev/pci/ixgbe/ixgbe_dcb.h:1.3.8.2 --- src/sys/dev/pci/ixgbe/ixgbe_dcb.h:1.3.8.1 Thu Dec 21 19:28:54 2017 +++ src/sys/dev/pci/ixgbe/ixgbe_dcb.h Sat Apr 14 10:25:11 2018 @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_dcb.h 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_dcb.h 326022 2017-11-20 19:36:21Z pfg $*/ #ifndef _IXGBE_DCB_H_ #define _IXGBE_DCB_H_ Index: src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c diff -u src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c:1.3.8.1 src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c:1.3.8.2 --- src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c:1.3.8.1 Thu Dec 21 19:28:54 2017 +++ src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.c Sat Apr 14 10:25:11 2018 @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_dcb_82598.c 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_dcb_82598.c 331224 2018-03-19 20:55:05Z erj $*/ #include "ixgbe_type.h" @@ -112,7 +112,9 @@ s32 ixgbe_dcb_get_pfc_stats_82598(struct /** * ixgbe_dcb_config_rx_arbiter_82598 - Config Rx data arbiter * @hw: pointer to hardware structure - * @dcb_config: pointer to ixgbe_dcb_config structure + * @refill: refill credits index by traffic class + * @max: max credits index by traffic class + * @tsa: transmission selection algorithm indexed by traffic class * * Configure Rx Data Arbiter and credits for each traffic class. */ @@ -167,7 +169,10 @@ s32 ixgbe_dcb_config_rx_arbiter_82598(st /** * ixgbe_dcb_config_tx_desc_arbiter_82598 - Config Tx Desc. arbiter * @hw: pointer to hardware structure - * @dcb_config: pointer to ixgbe_dcb_config structure + * @refill: refill credits index by traffic class + * @max: max credits index by traffic class + * @bwg_id: bandwidth grouping indexed by traffic class + * @tsa: transmission selection algorithm indexed by traffic class * * Configure Tx Descriptor Arbiter and credits for each traffic class. */ @@ -211,7 +216,10 @@ s32 ixgbe_dcb_config_tx_desc_arbiter_825 /** * ixgbe_dcb_config_tx_data_arbiter_82598 - Config Tx data arbiter * @hw: pointer to hardware structure - * @dcb_config: pointer to ixgbe_dcb_config structure + * @refill: refill credits index by traffic class + * @max: max credits index by traffic class + * @bwg_id: bandwidth grouping indexed by traffic class + * @tsa: transmission selection algorithm indexed by traffic class * * Configure Tx Data Arbiter and credits for each traffic class. */ @@ -256,7 +264,7 @@ s32 ixgbe_dcb_config_tx_data_arbiter_825 /** * ixgbe_dcb_config_pfc_82598 - Config priority flow control * @hw: pointer to hardware structure - * @dcb_config: pointer to ixgbe_dcb_config structure + * @pfc_en: enabled pfc bitmask * * Configure Priority Flow Control for each traffic class. */ @@ -340,7 +348,11 @@ s32 ixgbe_dcb_config_tc_stats_82598(stru /** * ixgbe_dcb_hw_config_82598 - Config and enable DCB * @hw: pointer to hardware structure - * @dcb_config: pointer to ixgbe_dcb_config structure + * @link_speed: unused + * @refill: refill credits index by traffic class + * @max: max credits index by traffic class + * @bwg_id: bandwidth grouping indexed by traffic class + * @tsa: transmission selection algorithm indexed by traffic class * * Configure dcb settings and enable dcb mode. */ Index: src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.h diff -u src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.h:1.3.8.1 src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.h:1.3.8.2 --- src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.h:1.3.8.1 Thu Dec 21 19:28:54 2017 +++ src/sys/dev/pci/ixgbe/ixgbe_dcb_82598.h Sat Apr 14 10:25:11 2018 @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_dcb_82598.h 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_dcb_82598.h 326022 2017-11-20 19:36:21Z pfg $*/ #ifndef _IXGBE_DCB_82598_H_ #define _IXGBE_DCB_82598_H_ Index: src/sys/dev/pci/ixgbe/ixgbe_dcb_82599.c diff -u src/sys/dev/pci/ixgbe/ixgbe_dcb_82599.c:1.3.8.1 src/sys/dev/pci/ixgbe/ixgbe_dcb_82599.c:1.3.8.2 --- src/sys/dev/pci/ixgbe/ixgbe_dcb_82599.c:1.3.8.1 Thu Dec 21 19:28:54 2017 +++ src/sys/dev/pci/ixgbe/ixgbe_dcb_82599.c Sat Apr 14 10:25:11 2018 @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_dcb_82599.c 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_dcb_82599.c 331224 2018-03-19 20:55:05Z erj $*/ #include "ixgbe_type.h" @@ -111,7 +111,11 @@ s32 ixgbe_dcb_get_pfc_stats_82599(struct /** * ixgbe_dcb_config_rx_arbiter_82599 - Config Rx Data arbiter * @hw: pointer to hardware structure - * @dcb_config: pointer to ixgbe_dcb_config structure + * @refill: refill credits index by traffic class + * @max: max credits index by traffic class + * @bwg_id: bandwidth grouping indexed by traffic class + * @tsa: transmission selection algorithm indexed by traffic class + * @map: priority to tc assignments indexed by priority * * Configure Rx Packet Arbiter and credits for each traffic class. */ @@ -170,7 +174,10 @@ s32 ixgbe_dcb_config_rx_arbiter_82599(st /** * ixgbe_dcb_config_tx_desc_arbiter_82599 - Config Tx Desc. arbiter * @hw: pointer to hardware structure - * @dcb_config: pointer to ixgbe_dcb_config structure + * @refill: refill credits index by traffic class + * @max: max credits index by traffic class + * @bwg_id: bandwidth grouping indexed by traffic class + * @tsa: transmission selection algorithm indexed by traffic class * * Configure Tx Descriptor Arbiter and credits for each traffic class. */ @@ -215,7 +222,11 @@ s32 ixgbe_dcb_config_tx_desc_arbiter_825 /** * ixgbe_dcb_config_tx_data_arbiter_82599 - Config Tx Data arbiter * @hw: pointer to hardware structure - * @dcb_config: pointer to ixgbe_dcb_config structure + * @refill: refill credits index by traffic class + * @max: max credits index by traffic class + * @bwg_id: bandwidth grouping indexed by traffic class + * @tsa: transmission selection algorithm indexed by traffic class + * @map: priority to tc assignments indexed by priority * * Configure Tx Packet Arbiter and credits for each traffic class. */ @@ -363,6 +374,7 @@ s32 ixgbe_dcb_config_pfc_82599(struct ix /** * ixgbe_dcb_config_tc_stats_82599 - Config traffic class statistics * @hw: pointer to hardware structure + * @dcb_config: pointer to ixgbe_dcb_config structure * * Configure queue statistics registers, all queues belonging to same traffic * class uses a single set of queue statistics counters. @@ -573,7 +585,12 @@ s32 ixgbe_dcb_config_82599(struct ixgbe_ /** * ixgbe_dcb_hw_config_82599 - Configure and enable DCB * @hw: pointer to hardware structure - * @dcb_config: pointer to ixgbe_dcb_config structure + * @link_speed: unused + * @refill: refill credits index by traffic class + * @max: max credits index by traffic class + * @bwg_id: bandwidth grouping indexed by traffic class + * @tsa: transmission selection algorithm indexed by traffic class + * @map: priority to tc assignments indexed by priority * * Configure dcb settings and enable dcb mode. */ Index: src/sys/dev/pci/ixgbe/ixgbe_dcb_82599.h diff -u src/sys/dev/pci/ixgbe/ixgbe_dcb_82599.h:1.3.8.1 src/sys/dev/pci/ixgbe/ixgbe_dcb_82599.h:1.3.8.2 --- src/sys/dev/pci/ixgbe/ixgbe_dcb_82599.h:1.3.8.1 Thu Dec 21 19:28:54 2017 +++ src/sys/dev/pci/ixgbe/ixgbe_dcb_82599.h Sat Apr 14 10:25:11 2018 @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_dcb_82599.h 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_dcb_82599.h 326022 2017-11-20 19:36:21Z pfg $*/ #ifndef _IXGBE_DCB_82599_H_ #define _IXGBE_DCB_82599_H_ Index: src/sys/dev/pci/ixgbe/ixgbe_mbx.c diff -u src/sys/dev/pci/ixgbe/ixgbe_mbx.c:1.6.8.1 src/sys/dev/pci/ixgbe/ixgbe_mbx.c:1.6.8.2 --- src/sys/dev/pci/ixgbe/ixgbe_mbx.c:1.6.8.1 Thu Dec 21 19:28:54 2017 +++ src/sys/dev/pci/ixgbe/ixgbe_mbx.c Sat Apr 14 10:25:12 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe_mbx.c,v 1.6.8.1 2017/12/21 19:28:54 snj Exp $ */ +/* $NetBSD: ixgbe_mbx.c,v 1.6.8.2 2018/04/14 10:25:12 martin Exp $ */ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause @@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_mbx.c 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_mbx.c 326022 2017-11-20 19:36:21Z pfg $*/ #include "ixgbe_type.h" #include "ixgbe_mbx.h" Index: src/sys/dev/pci/ixgbe/ixgbe_mbx.h diff -u src/sys/dev/pci/ixgbe/ixgbe_mbx.h:1.10.8.1 src/sys/dev/pci/ixgbe/ixgbe_mbx.h:1.10.8.2 --- src/sys/dev/pci/ixgbe/ixgbe_mbx.h:1.10.8.1 Thu Dec 21 19:28:54 2017 +++ src/sys/dev/pci/ixgbe/ixgbe_mbx.h Sat Apr 14 10:25:11 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe_mbx.h,v 1.10.8.1 2017/12/21 19:28:54 snj Exp $ */ +/* $NetBSD: ixgbe_mbx.h,v 1.10.8.2 2018/04/14 10:25:11 martin Exp $ */ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause @@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_mbx.h 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_mbx.h 326022 2017-11-20 19:36:21Z pfg $*/ #ifndef _IXGBE_MBX_H_ #define _IXGBE_MBX_H_ Index: src/sys/dev/pci/ixgbe/ixgbe_osdep.c diff -u src/sys/dev/pci/ixgbe/ixgbe_osdep.c:1.1.12.2 src/sys/dev/pci/ixgbe/ixgbe_osdep.c:1.1.12.3 --- src/sys/dev/pci/ixgbe/ixgbe_osdep.c:1.1.12.2 Fri Mar 30 12:07:34 2018 +++ src/sys/dev/pci/ixgbe/ixgbe_osdep.c Sat Apr 14 10:25:11 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe_osdep.c,v 1.1.12.2 2018/03/30 12:07:34 martin Exp $ */ +/* $NetBSD: ixgbe_osdep.c,v 1.1.12.3 2018/04/14 10:25:11 martin Exp $ */ /****************************************************************************** @@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_osdep.c 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_osdep.c 327031 2017-12-20 18:15:06Z erj $*/ #include "ixgbe_osdep.h" #include "ixgbe.h" Index: src/sys/dev/pci/ixgbe/ixgbe_osdep.h diff -u src/sys/dev/pci/ixgbe/ixgbe_osdep.h:1.17.6.2 src/sys/dev/pci/ixgbe/ixgbe_osdep.h:1.17.6.3 --- src/sys/dev/pci/ixgbe/ixgbe_osdep.h:1.17.6.2 Fri Mar 30 12:07:34 2018 +++ src/sys/dev/pci/ixgbe/ixgbe_osdep.h Sat Apr 14 10:25:11 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe_osdep.h,v 1.17.6.2 2018/03/30 12:07:34 martin Exp $ */ +/* $NetBSD: ixgbe_osdep.h,v 1.17.6.3 2018/04/14 10:25:11 martin Exp $ */ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause @@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_osdep.h 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_osdep.h 327031 2017-12-20 18:15:06Z erj $*/ #ifndef _IXGBE_OSDEP_H_ #define _IXGBE_OSDEP_H_ Index: src/sys/dev/pci/ixgbe/ixgbe_phy.c diff -u src/sys/dev/pci/ixgbe/ixgbe_phy.c:1.11.6.2 src/sys/dev/pci/ixgbe/ixgbe_phy.c:1.11.6.3 --- src/sys/dev/pci/ixgbe/ixgbe_phy.c:1.11.6.2 Fri Mar 30 12:07:34 2018 +++ src/sys/dev/pci/ixgbe/ixgbe_phy.c Sat Apr 14 10:25:12 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe_phy.c,v 1.11.6.2 2018/03/30 12:07:34 martin Exp $ */ +/* $NetBSD: ixgbe_phy.c,v 1.11.6.3 2018/04/14 10:25:12 martin Exp $ */ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause @@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_phy.c 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_phy.c 331224 2018-03-19 20:55:05Z erj $*/ #include "ixgbe_api.h" #include "ixgbe_common.h" @@ -92,8 +92,8 @@ static s32 ixgbe_in_i2c_byte_ack(struct /** * ixgbe_ones_comp_byte_add - Perform one's complement addition - * @add1 - addend 1 - * @add2 - addend 2 + * @add1: addend 1 + * @add2: addend 2 * * Returns one's complement 8-bit sum. */ @@ -404,6 +404,7 @@ s32 ixgbe_check_reset_blocked(struct ixg /** * ixgbe_validate_phy_addr - Determines phy address is valid * @hw: pointer to hardware structure + * @phy_addr: PHY address * **/ bool ixgbe_validate_phy_addr(struct ixgbe_hw *hw, u32 phy_addr) @@ -581,6 +582,7 @@ out: * the SWFW lock * @hw: pointer to hardware structure * @reg_addr: 32 bit address of PHY register to read + * @device_type: 5 bit device type * @phy_data: Pointer to read data from PHY register **/ s32 ixgbe_read_phy_reg_mdi(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type, @@ -662,6 +664,7 @@ s32 ixgbe_read_phy_reg_mdi(struct ixgbe_ * using the SWFW lock - this function is needed in most cases * @hw: pointer to hardware structure * @reg_addr: 32 bit address of PHY register to read + * @device_type: 5 bit device type * @phy_data: Pointer to read data from PHY register **/ s32 ixgbe_read_phy_reg_generic(struct ixgbe_hw *hw, u32 reg_addr, @@ -899,6 +902,7 @@ s32 ixgbe_setup_phy_link_generic(struct * ixgbe_setup_phy_link_speed_generic - Sets the auto advertised capabilities * @hw: pointer to hardware structure * @speed: new link speed + * @autoneg_wait_to_complete: unused **/ s32 ixgbe_setup_phy_link_speed_generic(struct ixgbe_hw *hw, ixgbe_link_speed speed, @@ -1004,6 +1008,8 @@ s32 ixgbe_get_copper_link_capabilities_g /** * ixgbe_check_phy_link_tnx - Determine link and speed status * @hw: pointer to hardware structure + * @speed: current link speed + * @link_up: TRUE is link is up, FALSE otherwise * * Reads the VS1 register to determine if link is up and the current speed for * the PHY. @@ -1959,7 +1965,7 @@ s32 ixgbe_read_i2c_eeprom_generic(struct * ixgbe_read_i2c_sff8472_generic - Reads 8 bit word over I2C interface * @hw: pointer to hardware structure * @byte_offset: byte offset at address 0xA2 - * @eeprom_data: value read + * @sff8472_data: value read * * Performs byte read operation to SFP module's SFF-8472 data over I2C **/ @@ -2008,6 +2014,7 @@ static bool ixgbe_is_sfp_probe(struct ix * ixgbe_read_i2c_byte_generic_int - Reads 8 bit word over I2C * @hw: pointer to hardware structure * @byte_offset: byte offset to read + * @dev_addr: address to read from * @data: value read * @lock: TRUE if to take and release semaphore * @@ -2099,6 +2106,7 @@ fail: * ixgbe_read_i2c_byte_generic - Reads 8 bit word over I2C * @hw: pointer to hardware structure * @byte_offset: byte offset to read + * @dev_addr: address to read from * @data: value read * * Performs byte read operation to SFP module's EEPROM over I2C interface at @@ -2115,6 +2123,7 @@ s32 ixgbe_read_i2c_byte_generic(struct i * ixgbe_read_i2c_byte_generic_unlocked - Reads 8 bit word over I2C * @hw: pointer to hardware structure * @byte_offset: byte offset to read + * @dev_addr: address to read from * @data: value read * * Performs byte read operation to SFP module's EEPROM over I2C interface at @@ -2131,6 +2140,7 @@ s32 ixgbe_read_i2c_byte_generic_unlocked * ixgbe_write_i2c_byte_generic_int - Writes 8 bit word over I2C * @hw: pointer to hardware structure * @byte_offset: byte offset to write + * @dev_addr: address to write to * @data: value to write * @lock: TRUE if to take and release semaphore * @@ -2202,6 +2212,7 @@ fail: * ixgbe_write_i2c_byte_generic - Writes 8 bit word over I2C * @hw: pointer to hardware structure * @byte_offset: byte offset to write + * @dev_addr: address to write to * @data: value to write * * Performs byte write operation to SFP module's EEPROM over I2C interface at @@ -2218,6 +2229,7 @@ s32 ixgbe_write_i2c_byte_generic(struct * ixgbe_write_i2c_byte_generic_unlocked - Writes 8 bit word over I2C * @hw: pointer to hardware structure * @byte_offset: byte offset to write + * @dev_addr: address to write to * @data: value to write * * Performs byte write operation to SFP module's EEPROM over I2C interface at @@ -2600,6 +2612,7 @@ static bool ixgbe_get_i2c_data(struct ix { u32 data_oe_bit = IXGBE_I2C_DATA_OE_N_EN_BY_MAC(hw); bool data; + UNREFERENCED_1PARAMETER(hw); DEBUGFUNC("ixgbe_get_i2c_data"); Index: src/sys/dev/pci/ixgbe/ixgbe_rss.h diff -u src/sys/dev/pci/ixgbe/ixgbe_rss.h:1.2.2.3 src/sys/dev/pci/ixgbe/ixgbe_rss.h:1.2.2.4 --- src/sys/dev/pci/ixgbe/ixgbe_rss.h:1.2.2.3 Mon Feb 26 00:25:16 2018 +++ src/sys/dev/pci/ixgbe/ixgbe_rss.h Sat Apr 14 10:25:11 2018 @@ -30,7 +30,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_rss.h 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_rss.h 324518 2017-10-11 05:55:52Z sephe $*/ #ifndef _IXGBE_RSS_H_ #define _IXGBE_RSS_H_ Index: src/sys/dev/pci/ixgbe/ixgbe_type.h diff -u src/sys/dev/pci/ixgbe/ixgbe_type.h:1.22.2.4 src/sys/dev/pci/ixgbe/ixgbe_type.h:1.22.2.5 --- src/sys/dev/pci/ixgbe/ixgbe_type.h:1.22.2.4 Fri Mar 30 12:07:34 2018 +++ src/sys/dev/pci/ixgbe/ixgbe_type.h Sat Apr 14 10:25:11 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe_type.h,v 1.22.2.4 2018/03/30 12:07:34 martin Exp $ */ +/* $NetBSD: ixgbe_type.h,v 1.22.2.5 2018/04/14 10:25:11 martin Exp $ */ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause @@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_type.h 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_type.h 331224 2018-03-19 20:55:05Z erj $*/ #ifndef _IXGBE_TYPE_H_ #define _IXGBE_TYPE_H_ @@ -282,7 +282,6 @@ #define IXGBE_I2C_BB_EN_X550 0x00000100 #define IXGBE_I2C_BB_EN_X550EM_x IXGBE_I2C_BB_EN_X550 #define IXGBE_I2C_BB_EN_X550EM_a IXGBE_I2C_BB_EN_X550 - #define IXGBE_I2C_BB_EN_BY_MAC(_hw) IXGBE_BY_MAC((_hw), I2C_BB_EN) #define IXGBE_I2C_CLK_OE_N_EN 0 @@ -608,7 +607,6 @@ struct ixgbe_nvm_version { #define IXGBE_VXLANCTRL_VXLAN_UDPPORT_MASK 0x0000ffff /* VXLAN port */ #define IXGBE_VXLANCTRL_GENEVE_UDPPORT_MASK 0xffff0000 /* GENEVE port */ #define IXGBE_VXLANCTRL_ALL_UDPPORT_MASK 0xffffffff /* GENEVE/VXLAN */ - #define IXGBE_VXLANCTRL_GENEVE_UDPPORT_SHIFT 16 #define IXGBE_FHFT(_n) (0x09000 + ((_n) * 0x100)) /* Flex host filter table */ @@ -618,7 +616,6 @@ struct ixgbe_nvm_version { /* Four Flexible Filters are supported */ #define IXGBE_FLEXIBLE_FILTER_COUNT_MAX 4 - /* Six Flexible Filters are supported */ #define IXGBE_FLEXIBLE_FILTER_COUNT_MAX_6 6 /* Eight Flexible Filters are supported */ @@ -766,8 +763,6 @@ struct ixgbe_dmac_config { #define IXGBE_EEE_RX_LPI_STATUS 0x40000000 /* RX Link in LPI status */ #define IXGBE_EEE_TX_LPI_STATUS 0x80000000 /* TX Link in LPI status */ - - /* Security Control Registers */ #define IXGBE_SECTXCTRL 0x08800 #define IXGBE_SECTXSTAT 0x08804 @@ -905,7 +900,6 @@ struct ixgbe_dmac_config { #define IXGBE_RTTBCNRTT 0x05150 #define IXGBE_RTTBCNRD 0x0498C - /* FCoE DMA Context Registers */ /* FCoE Direct DMA Context */ #define IXGBE_FCDDC(_i, _j) (0x20000 + ((_i) * 0x4) + ((_j) * 0x10)) @@ -4366,7 +4360,6 @@ struct ixgbe_bypass_eeprom { #define BYPASS_LOG_EVENT_SHIFT 28 #define BYPASS_LOG_CLEAR_SHIFT 24 /* bit offset */ - #define IXGBE_FUSES0_GROUP(_i) (0x11158 + ((_i) * 4)) #define IXGBE_FUSES0_300MHZ (1 << 5) #define IXGBE_FUSES0_REV_MASK (3 << 6) Index: src/sys/dev/pci/ixgbe/ixgbe_vf.c diff -u src/sys/dev/pci/ixgbe/ixgbe_vf.c:1.12.8.1 src/sys/dev/pci/ixgbe/ixgbe_vf.c:1.12.8.2 --- src/sys/dev/pci/ixgbe/ixgbe_vf.c:1.12.8.1 Thu Dec 21 19:28:54 2017 +++ src/sys/dev/pci/ixgbe/ixgbe_vf.c Sat Apr 14 10:25:11 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe_vf.c,v 1.12.8.1 2017/12/21 19:28:54 snj Exp $ */ +/* $NetBSD: ixgbe_vf.c,v 1.12.8.2 2018/04/14 10:25:11 martin Exp $ */ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause @@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_vf.c 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_vf.c 331224 2018-03-19 20:55:05Z erj $*/ #include "ixgbe_api.h" @@ -380,6 +380,7 @@ s32 ixgbe_set_rar_vf(struct ixgbe_hw *hw * @mc_addr_list: array of multicast addresses to program * @mc_addr_count: number of multicast addresses to program * @next: caller supplied function to return next address in list + * @clear: unused * * Updates the Multicast Table Array. **/ @@ -513,8 +514,9 @@ u32 ixgbe_get_num_of_rx_queues_vf(struct } /** - * ixgbe_get_mac_addr_vf - Read device MAC address - * @hw: pointer to the HW structure + * ixgbe_get_mac_addr_vf - Read device MAC address + * @hw: pointer to the HW structure + * @mac_addr: the MAC address **/ s32 ixgbe_get_mac_addr_vf(struct ixgbe_hw *hw, u8 *mac_addr) { @@ -560,7 +562,6 @@ s32 ixgbevf_set_uc_addr_vf(struct ixgbe_ * ixgbe_setup_mac_link_vf - Setup MAC link settings * @hw: pointer to hardware structure * @speed: new link speed - * @autoneg: TRUE if autonegotiation enabled * @autoneg_wait_to_complete: TRUE when waiting for completion is needed * * Set the link speed in the AUTOC register and restarts link. Index: src/sys/dev/pci/ixgbe/ixgbe_vf.h diff -u src/sys/dev/pci/ixgbe/ixgbe_vf.h:1.8.6.2 src/sys/dev/pci/ixgbe/ixgbe_vf.h:1.8.6.3 --- src/sys/dev/pci/ixgbe/ixgbe_vf.h:1.8.6.2 Fri Mar 30 12:07:34 2018 +++ src/sys/dev/pci/ixgbe/ixgbe_vf.h Sat Apr 14 10:25:11 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe_vf.h,v 1.8.6.2 2018/03/30 12:07:34 martin Exp $ */ +/* $NetBSD: ixgbe_vf.h,v 1.8.6.3 2018/04/14 10:25:11 martin Exp $ */ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause @@ -33,7 +33,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_vf.h 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_vf.h 327031 2017-12-20 18:15:06Z erj $*/ #ifndef _IXGBE_VF_H_ #define _IXGBE_VF_H_ Index: src/sys/dev/pci/ixgbe/ixgbe_x540.c diff -u src/sys/dev/pci/ixgbe/ixgbe_x540.c:1.9.6.2 src/sys/dev/pci/ixgbe/ixgbe_x540.c:1.9.6.3 --- src/sys/dev/pci/ixgbe/ixgbe_x540.c:1.9.6.2 Fri Mar 30 12:07:34 2018 +++ src/sys/dev/pci/ixgbe/ixgbe_x540.c Sat Apr 14 10:25:12 2018 @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_x540.c 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_x540.c 331224 2018-03-19 20:55:05Z erj $*/ #include "ixgbe_x540.h" #include "ixgbe_type.h" Index: src/sys/dev/pci/ixgbe/ixgbe_x550.c diff -u src/sys/dev/pci/ixgbe/ixgbe_x550.c:1.5.6.3 src/sys/dev/pci/ixgbe/ixgbe_x550.c:1.5.6.4 --- src/sys/dev/pci/ixgbe/ixgbe_x550.c:1.5.6.3 Wed Apr 4 16:18:49 2018 +++ src/sys/dev/pci/ixgbe/ixgbe_x550.c Sat Apr 14 10:25:11 2018 @@ -30,7 +30,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_x550.c 320688 2017-07-05 17:27:03Z erj $*/ +/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_x550.c 331224 2018-03-19 20:55:05Z erj $*/ #include "ixgbe_x550.h" #include "ixgbe_x540.h" @@ -1841,6 +1841,8 @@ static s32 ixgbe_restart_an_internal_phy /** * ixgbe_setup_sgmii - Set up link for sgmii * @hw: pointer to hardware structure + * @speed: new link speed + * @autoneg_wait: TRUE when waiting for completion is needed */ static s32 ixgbe_setup_sgmii(struct ixgbe_hw *hw, ixgbe_link_speed speed, bool autoneg_wait) @@ -1908,6 +1910,8 @@ static s32 ixgbe_setup_sgmii(struct ixgb /** * ixgbe_setup_sgmii_fw - Set up link for internal PHY SGMII auto-negotiation * @hw: pointer to hardware structure + * @speed: new link speed + * @autoneg_wait: TRUE when waiting for completion is needed */ static s32 ixgbe_setup_sgmii_fw(struct ixgbe_hw *hw, ixgbe_link_speed speed, bool autoneg_wait) @@ -2776,6 +2780,8 @@ s32 ixgbe_setup_kr_x550em(struct ixgbe_h /** * ixgbe_setup_mac_link_sfp_x550em - Setup internal/external the PHY for SFP * @hw: pointer to hardware structure + * @speed: new link speed + * @autoneg_wait_to_complete: unused * * Configure the external PHY and the integrated KR PHY for SFP support. **/ @@ -2871,6 +2877,8 @@ static s32 ixgbe_setup_sfi_x550a(struct /** * ixgbe_setup_mac_link_sfp_x550a - Setup internal PHY for SFP * @hw: pointer to hardware structure + * @speed: new link speed + * @autoneg_wait_to_complete: unused * * Configure the the integrated PHY for SFP support. **/ @@ -3492,6 +3500,8 @@ out: * @ptr: pointer offset in eeprom * @size: size of section pointed by ptr, if 0 first word will be used as size * @csum: address of checksum to update + * @buffer: pointer to buffer containing calculated checksum + * @buffer_size: size of buffer * * Returns error status for any failure */ @@ -3863,6 +3873,7 @@ s32 ixgbe_get_bus_info_X550em(struct ixg /** * ixgbe_disable_rx_x550 - Disable RX unit + * @hw: pointer to hardware structure * * Enables the Rx DMA unit for x550 **/ @@ -4507,6 +4518,7 @@ static void ixgbe_release_swfw_sync_X550 * ixgbe_read_phy_reg_x550a - Reads specified PHY register * @hw: pointer to hardware structure * @reg_addr: 32 bit address of PHY register to read + * @device_type: 5 bit device type * @phy_data: Pointer to read data from PHY register * * Reads a value from a specified PHY register using the SWFW lock and PHY Index: src/sys/dev/pci/ixgbe/ixv.c diff -u src/sys/dev/pci/ixgbe/ixv.c:1.56.2.13 src/sys/dev/pci/ixgbe/ixv.c:1.56.2.14 --- src/sys/dev/pci/ixgbe/ixv.c:1.56.2.13 Wed Apr 4 16:18:49 2018 +++ src/sys/dev/pci/ixgbe/ixv.c Sat Apr 14 10:25:11 2018 @@ -1,4 +1,4 @@ -/*$NetBSD: ixv.c,v 1.56.2.13 2018/04/04 16:18:49 martin Exp $*/ +/*$NetBSD: ixv.c,v 1.56.2.14 2018/04/14 10:25:11 martin Exp $*/ /****************************************************************************** @@ -32,8 +32,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: head/sys/dev/ixgbe/if_ixv.c 320688 2017-07-05 17:27:03Z erj $*/ - +/*$FreeBSD: head/sys/dev/ixgbe/if_ixv.c 331224 2018-03-19 20:55:05Z erj $*/ #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -47,7 +46,7 @@ /************************************************************************ * Driver version ************************************************************************/ -char ixv_driver_version[] = "1.5.13-k"; +char ixv_driver_version[] = "2.0.1-k"; /************************************************************************ * PCI Device ID Table @@ -741,7 +740,7 @@ ixv_init_locked(struct adapter *adapter) hw->mac.ops.set_rar(hw, 0, hw->mac.addr, 0, IXGBE_RAH_AV); /* Get the latest mac address, User can use a LAA */ - memcpy(hw->mac.addr, CLLADDR(adapter->ifp->if_sadl), + memcpy(hw->mac.addr, CLLADDR(ifp->if_sadl), IXGBE_ETH_LENGTH_OF_ADDRESS); hw->mac.ops.set_rar(hw, 0, hw->mac.addr, 0, 1); @@ -754,6 +753,7 @@ ixv_init_locked(struct adapter *adapter) /* Reset VF and renegotiate mailbox API version */ hw->mac.ops.reset_hw(hw); + hw->mac.ops.start_hw(hw); error = ixv_negotiate_api(adapter); if (error) device_printf(dev, @@ -886,7 +886,7 @@ ixv_rearm_queues(struct adapter *adapter /************************************************************************ - * ixv_msix_que - MSI Queue Interrupt Service routine + * ixv_msix_que - MSI-X Queue Interrupt Service routine ************************************************************************/ static int ixv_msix_que(void *arg) @@ -1577,38 +1577,39 @@ ixv_initialize_transmit_units(struct ada { struct tx_ring *txr = adapter->tx_rings; struct ixgbe_hw *hw = &adapter->hw; + int i; - - for (int i = 0; i < adapter->num_queues; i++, txr++) { + for (i = 0; i < adapter->num_queues; i++, txr++) { u64 tdba = txr->txdma.dma_paddr; u32 txctrl, txdctl; + int j = txr->me; /* Set WTHRESH to 8, burst writeback */ - txdctl = IXGBE_READ_REG(hw, IXGBE_VFTXDCTL(i)); + txdctl = IXGBE_READ_REG(hw, IXGBE_VFTXDCTL(j)); txdctl |= (8 << 16); - IXGBE_WRITE_REG(hw, IXGBE_VFTXDCTL(i), txdctl); + IXGBE_WRITE_REG(hw, IXGBE_VFTXDCTL(j), txdctl); /* Set the HW Tx Head and Tail indices */ - IXGBE_WRITE_REG(&adapter->hw, IXGBE_VFTDH(i), 0); - IXGBE_WRITE_REG(&adapter->hw, IXGBE_VFTDT(i), 0); + IXGBE_WRITE_REG(&adapter->hw, IXGBE_VFTDH(j), 0); + IXGBE_WRITE_REG(&adapter->hw, IXGBE_VFTDT(j), 0); /* Set Tx Tail register */ - txr->tail = IXGBE_VFTDT(i); + txr->tail = IXGBE_VFTDT(j); /* Set Ring parameters */ - IXGBE_WRITE_REG(hw, IXGBE_VFTDBAL(i), + IXGBE_WRITE_REG(hw, IXGBE_VFTDBAL(j), (tdba & 0x00000000ffffffffULL)); - IXGBE_WRITE_REG(hw, IXGBE_VFTDBAH(i), (tdba >> 32)); - IXGBE_WRITE_REG(hw, IXGBE_VFTDLEN(i), + IXGBE_WRITE_REG(hw, IXGBE_VFTDBAH(j), (tdba >> 32)); + IXGBE_WRITE_REG(hw, IXGBE_VFTDLEN(j), adapter->num_tx_desc * sizeof(struct ixgbe_legacy_tx_desc)); - txctrl = IXGBE_READ_REG(hw, IXGBE_VFDCA_TXCTRL(i)); + txctrl = IXGBE_READ_REG(hw, IXGBE_VFDCA_TXCTRL(j)); txctrl &= ~IXGBE_DCA_TXCTRL_DESC_WRO_EN; - IXGBE_WRITE_REG(hw, IXGBE_VFDCA_TXCTRL(i), txctrl); + IXGBE_WRITE_REG(hw, IXGBE_VFDCA_TXCTRL(j), txctrl); /* Now enable */ - txdctl = IXGBE_READ_REG(hw, IXGBE_VFTXDCTL(i)); + txdctl = IXGBE_READ_REG(hw, IXGBE_VFTXDCTL(j)); txdctl |= IXGBE_TXDCTL_ENABLE; - IXGBE_WRITE_REG(hw, IXGBE_VFTXDCTL(i), txdctl); + IXGBE_WRITE_REG(hw, IXGBE_VFTXDCTL(j), txdctl); } return; @@ -1748,13 +1749,14 @@ ixv_initialize_receive_units(struct adap for (int i = 0; i < adapter->num_queues; i++, rxr++) { u64 rdba = rxr->rxdma.dma_paddr; u32 reg, rxdctl; + int j = rxr->me; /* Disable the queue */ - rxdctl = IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(i)); + rxdctl = IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(j)); rxdctl &= ~IXGBE_RXDCTL_ENABLE; - IXGBE_WRITE_REG(hw, IXGBE_VFRXDCTL(i), rxdctl); - for (int j = 0; j < 10; j++) { - if (IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(i)) & + IXGBE_WRITE_REG(hw, IXGBE_VFRXDCTL(j), rxdctl); + for (int k = 0; k < 10; k++) { + if (IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(j)) & IXGBE_RXDCTL_ENABLE) msec_delay(1); else @@ -1762,10 +1764,10 @@ ixv_initialize_receive_units(struct adap } wmb(); /* Setup the Base and Length of the Rx Descriptor Ring */ - IXGBE_WRITE_REG(hw, IXGBE_VFRDBAL(i), + IXGBE_WRITE_REG(hw, IXGBE_VFRDBAL(j), (rdba & 0x00000000ffffffffULL)); - IXGBE_WRITE_REG(hw, IXGBE_VFRDBAH(i), (rdba >> 32)); - IXGBE_WRITE_REG(hw, IXGBE_VFRDLEN(i), + IXGBE_WRITE_REG(hw, IXGBE_VFRDBAH(j), (rdba >> 32)); + IXGBE_WRITE_REG(hw, IXGBE_VFRDLEN(j), adapter->num_rx_desc * sizeof(union ixgbe_adv_rx_desc)); /* Reset the ring indices */ @@ -1773,21 +1775,21 @@ ixv_initialize_receive_units(struct adap IXGBE_WRITE_REG(hw, IXGBE_VFRDT(rxr->me), 0); /* Set up the SRRCTL register */ - reg = IXGBE_READ_REG(hw, IXGBE_VFSRRCTL(i)); + reg = IXGBE_READ_REG(hw, IXGBE_VFSRRCTL(j)); reg &= ~IXGBE_SRRCTL_BSIZEHDR_MASK; reg &= ~IXGBE_SRRCTL_BSIZEPKT_MASK; reg |= bufsz; reg |= IXGBE_SRRCTL_DESCTYPE_ADV_ONEBUF; - IXGBE_WRITE_REG(hw, IXGBE_VFSRRCTL(i), reg); + IXGBE_WRITE_REG(hw, IXGBE_VFSRRCTL(j), reg); /* Capture Rx Tail index */ rxr->tail = IXGBE_VFRDT(rxr->me); /* Do the queue enabling last */ rxdctl |= IXGBE_RXDCTL_ENABLE | IXGBE_RXDCTL_VME; - IXGBE_WRITE_REG(hw, IXGBE_VFRXDCTL(i), rxdctl); + IXGBE_WRITE_REG(hw, IXGBE_VFRXDCTL(j), rxdctl); for (int k = 0; k < 10; k++) { - if (IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(i)) & + if (IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(j)) & IXGBE_RXDCTL_ENABLE) break; msec_delay(1); @@ -2688,10 +2690,11 @@ ixv_ifflags_cb(struct ethercom *ec) { struct ifnet *ifp = &ec->ec_if; struct adapter *adapter = ifp->if_softc; - int change = ifp->if_flags ^ adapter->if_flags, rc = 0; + int change, rc = 0; IXGBE_CORE_LOCK(adapter); + change = ifp->if_flags ^ adapter->if_flags; if (change != 0) adapter->if_flags = ifp->if_flags;