xref: /freebsd/sys/dev/e1000/e1000_82543.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_82543_H_
368cfa0ad2SJack F Vogel #define _E1000_82543_H_
378cfa0ad2SJack F Vogel 
388cfa0ad2SJack F Vogel #define PHY_PREAMBLE		0xFFFFFFFF
398cfa0ad2SJack F Vogel #define PHY_PREAMBLE_SIZE	32
408cfa0ad2SJack F Vogel #define PHY_SOF			0x1
418cfa0ad2SJack F Vogel #define PHY_OP_READ		0x2
428cfa0ad2SJack F Vogel #define PHY_OP_WRITE		0x1
438cfa0ad2SJack F Vogel #define PHY_TURNAROUND		0x2
448cfa0ad2SJack F Vogel 
458cfa0ad2SJack F Vogel #define TBI_COMPAT_ENABLED	0x1 /* Global "knob" for the workaround */
468cfa0ad2SJack F Vogel /* If TBI_COMPAT_ENABLED, then this is the current state (on/off) */
478cfa0ad2SJack F Vogel #define TBI_SBP_ENABLED		0x2
488cfa0ad2SJack F Vogel 
498cfa0ad2SJack F Vogel void e1000_tbi_adjust_stats_82543(struct e1000_hw *hw,
508cfa0ad2SJack F Vogel 				  struct e1000_hw_stats *stats,
518cfa0ad2SJack F Vogel 				  u32 frame_len, u8 *mac_addr,
528cfa0ad2SJack F Vogel 				  u32 max_frame_size);
538cfa0ad2SJack F Vogel void e1000_set_tbi_compatibility_82543(struct e1000_hw *hw,
548cfa0ad2SJack F Vogel 				       bool state);
558cfa0ad2SJack F Vogel bool e1000_tbi_sbp_enabled_82543(struct e1000_hw *hw);
568cfa0ad2SJack F Vogel 
578cfa0ad2SJack F Vogel #endif
58