xref: /freebsd/sys/dev/e1000/e1000_82571.h (revision 71625ec9ad2a9bc8c09784fbd23b759830e0ee5f)
18cfa0ad2SJack F Vogel /******************************************************************************
27282444bSPedro F. Giffuni   SPDX-License-Identifier: BSD-3-Clause
38cfa0ad2SJack F Vogel 
4*702cac6cSKevin Bowling   Copyright (c) 2001-2020, Intel Corporation
58cfa0ad2SJack F Vogel   All rights reserved.
68cfa0ad2SJack F Vogel 
78cfa0ad2SJack F Vogel   Redistribution and use in source and binary forms, with or without
88cfa0ad2SJack F Vogel   modification, are permitted provided that the following conditions are met:
98cfa0ad2SJack F Vogel 
108cfa0ad2SJack F Vogel    1. Redistributions of source code must retain the above copyright notice,
118cfa0ad2SJack F Vogel       this list of conditions and the following disclaimer.
128cfa0ad2SJack F Vogel 
138cfa0ad2SJack F Vogel    2. Redistributions in binary form must reproduce the above copyright
148cfa0ad2SJack F Vogel       notice, this list of conditions and the following disclaimer in the
158cfa0ad2SJack F Vogel       documentation and/or other materials provided with the distribution.
168cfa0ad2SJack F Vogel 
178cfa0ad2SJack F Vogel    3. Neither the name of the Intel Corporation nor the names of its
188cfa0ad2SJack F Vogel       contributors may be used to endorse or promote products derived from
198cfa0ad2SJack F Vogel       this software without specific prior written permission.
208cfa0ad2SJack F Vogel 
218cfa0ad2SJack F Vogel   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
228cfa0ad2SJack F Vogel   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
238cfa0ad2SJack F Vogel   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
248cfa0ad2SJack F Vogel   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
258cfa0ad2SJack F Vogel   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
268cfa0ad2SJack F Vogel   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
278cfa0ad2SJack F Vogel   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
288cfa0ad2SJack F Vogel   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
298cfa0ad2SJack F Vogel   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
308cfa0ad2SJack F Vogel   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
318cfa0ad2SJack F Vogel   POSSIBILITY OF SUCH DAMAGE.
328cfa0ad2SJack F Vogel 
338cfa0ad2SJack F Vogel ******************************************************************************/
348cfa0ad2SJack F Vogel 
358cfa0ad2SJack F Vogel #ifndef _E1000_82571_H_
368cfa0ad2SJack F Vogel #define _E1000_82571_H_
378cfa0ad2SJack F Vogel 
388cfa0ad2SJack F Vogel #define ID_LED_RESERVED_F746	0xF746
398cfa0ad2SJack F Vogel #define ID_LED_DEFAULT_82573	((ID_LED_DEF1_DEF2 << 12) | \
408cfa0ad2SJack F Vogel 				 (ID_LED_OFF1_ON2  <<  8) | \
418cfa0ad2SJack F Vogel 				 (ID_LED_DEF1_DEF2 <<  4) | \
428cfa0ad2SJack F Vogel 				 (ID_LED_DEF1_DEF2))
438cfa0ad2SJack F Vogel 
448cfa0ad2SJack F Vogel #define E1000_GCR_L1_ACT_WITHOUT_L0S_RX	0x08000000
457d9119bdSJack F Vogel #define AN_RETRY_COUNT		5 /* Autoneg Retry Count value */
468cfa0ad2SJack F Vogel 
478cfa0ad2SJack F Vogel /* Intr Throttling - RW */
488cfa0ad2SJack F Vogel #define E1000_EITR_82574(_n)	(0x000E8 + (0x4 * (_n)))
498cfa0ad2SJack F Vogel 
508cfa0ad2SJack F Vogel #define E1000_EIAC_82574	0x000DC /* Ext. Interrupt Auto Clear - RW */
518cfa0ad2SJack F Vogel #define E1000_EIAC_MASK_82574	0x01F00000
528cfa0ad2SJack F Vogel 
53c80429ceSEric Joyner #define E1000_IVAR_INT_ALLOC_VALID	0x8
548cfa0ad2SJack F Vogel 
55c80429ceSEric Joyner /* Manageability Operation Mode mask */
56c80429ceSEric Joyner #define E1000_NVM_INIT_CTRL2_MNGM	0x6000
578cfa0ad2SJack F Vogel 
587d9119bdSJack F Vogel #define E1000_BASE1000T_STATUS		10
597d9119bdSJack F Vogel #define E1000_IDLE_ERROR_COUNT_MASK	0xFF
607d9119bdSJack F Vogel #define E1000_RECEIVE_ERROR_COUNTER	21
617d9119bdSJack F Vogel #define E1000_RECEIVE_ERROR_MAX		0xFFFF
627d9119bdSJack F Vogel bool e1000_check_phy_82574(struct e1000_hw *hw);
638cfa0ad2SJack F Vogel bool e1000_get_laa_state_82571(struct e1000_hw *hw);
648cfa0ad2SJack F Vogel void e1000_set_laa_state_82571(struct e1000_hw *hw, bool state);
658cfa0ad2SJack F Vogel 
668cfa0ad2SJack F Vogel #endif
67