xref: /freebsd/sys/dev/e1000/e1000_api.c (revision e760e292ae8fb467c034ee73935e257a740a0bd8)
18cfa0ad2SJack F Vogel /******************************************************************************
28cfa0ad2SJack F Vogel 
37c669ab6SSean Bruno   Copyright (c) 2001-2015, Intel Corporation
48cfa0ad2SJack F Vogel   All rights reserved.
58cfa0ad2SJack F Vogel 
68cfa0ad2SJack F Vogel   Redistribution and use in source and binary forms, with or without
78cfa0ad2SJack F Vogel   modification, are permitted provided that the following conditions are met:
88cfa0ad2SJack F Vogel 
98cfa0ad2SJack F Vogel    1. Redistributions of source code must retain the above copyright notice,
108cfa0ad2SJack F Vogel       this list of conditions and the following disclaimer.
118cfa0ad2SJack F Vogel 
128cfa0ad2SJack F Vogel    2. Redistributions in binary form must reproduce the above copyright
138cfa0ad2SJack F Vogel       notice, this list of conditions and the following disclaimer in the
148cfa0ad2SJack F Vogel       documentation and/or other materials provided with the distribution.
158cfa0ad2SJack F Vogel 
168cfa0ad2SJack F Vogel    3. Neither the name of the Intel Corporation nor the names of its
178cfa0ad2SJack F Vogel       contributors may be used to endorse or promote products derived from
188cfa0ad2SJack F Vogel       this software without specific prior written permission.
198cfa0ad2SJack F Vogel 
208cfa0ad2SJack F Vogel   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
218cfa0ad2SJack F Vogel   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
228cfa0ad2SJack F Vogel   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
238cfa0ad2SJack F Vogel   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
248cfa0ad2SJack F Vogel   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
258cfa0ad2SJack F Vogel   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
268cfa0ad2SJack F Vogel   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
278cfa0ad2SJack F Vogel   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
288cfa0ad2SJack F Vogel   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
298cfa0ad2SJack F Vogel   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
308cfa0ad2SJack F Vogel   POSSIBILITY OF SUCH DAMAGE.
318cfa0ad2SJack F Vogel 
328cfa0ad2SJack F Vogel ******************************************************************************/
338cfa0ad2SJack F Vogel /*$FreeBSD$*/
348cfa0ad2SJack F Vogel 
358cfa0ad2SJack F Vogel #include "e1000_api.h"
368cfa0ad2SJack F Vogel 
378cfa0ad2SJack F Vogel /**
388cfa0ad2SJack F Vogel  *  e1000_init_mac_params - Initialize MAC function pointers
398cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
408cfa0ad2SJack F Vogel  *
418cfa0ad2SJack F Vogel  *  This function initializes the function pointers for the MAC
428cfa0ad2SJack F Vogel  *  set of functions.  Called by drivers or by e1000_setup_init_funcs.
438cfa0ad2SJack F Vogel  **/
448cfa0ad2SJack F Vogel s32 e1000_init_mac_params(struct e1000_hw *hw)
458cfa0ad2SJack F Vogel {
468cfa0ad2SJack F Vogel 	s32 ret_val = E1000_SUCCESS;
478cfa0ad2SJack F Vogel 
488cfa0ad2SJack F Vogel 	if (hw->mac.ops.init_params) {
498cfa0ad2SJack F Vogel 		ret_val = hw->mac.ops.init_params(hw);
508cfa0ad2SJack F Vogel 		if (ret_val) {
518cfa0ad2SJack F Vogel 			DEBUGOUT("MAC Initialization Error\n");
528cfa0ad2SJack F Vogel 			goto out;
538cfa0ad2SJack F Vogel 		}
548cfa0ad2SJack F Vogel 	} else {
558cfa0ad2SJack F Vogel 		DEBUGOUT("mac.init_mac_params was NULL\n");
568cfa0ad2SJack F Vogel 		ret_val = -E1000_ERR_CONFIG;
578cfa0ad2SJack F Vogel 	}
588cfa0ad2SJack F Vogel 
598cfa0ad2SJack F Vogel out:
608cfa0ad2SJack F Vogel 	return ret_val;
618cfa0ad2SJack F Vogel }
628cfa0ad2SJack F Vogel 
638cfa0ad2SJack F Vogel /**
648cfa0ad2SJack F Vogel  *  e1000_init_nvm_params - Initialize NVM function pointers
658cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
668cfa0ad2SJack F Vogel  *
678cfa0ad2SJack F Vogel  *  This function initializes the function pointers for the NVM
688cfa0ad2SJack F Vogel  *  set of functions.  Called by drivers or by e1000_setup_init_funcs.
698cfa0ad2SJack F Vogel  **/
708cfa0ad2SJack F Vogel s32 e1000_init_nvm_params(struct e1000_hw *hw)
718cfa0ad2SJack F Vogel {
728cfa0ad2SJack F Vogel 	s32 ret_val = E1000_SUCCESS;
738cfa0ad2SJack F Vogel 
748cfa0ad2SJack F Vogel 	if (hw->nvm.ops.init_params) {
758cfa0ad2SJack F Vogel 		ret_val = hw->nvm.ops.init_params(hw);
768cfa0ad2SJack F Vogel 		if (ret_val) {
778cfa0ad2SJack F Vogel 			DEBUGOUT("NVM Initialization Error\n");
788cfa0ad2SJack F Vogel 			goto out;
798cfa0ad2SJack F Vogel 		}
808cfa0ad2SJack F Vogel 	} else {
818cfa0ad2SJack F Vogel 		DEBUGOUT("nvm.init_nvm_params was NULL\n");
828cfa0ad2SJack F Vogel 		ret_val = -E1000_ERR_CONFIG;
838cfa0ad2SJack F Vogel 	}
848cfa0ad2SJack F Vogel 
858cfa0ad2SJack F Vogel out:
868cfa0ad2SJack F Vogel 	return ret_val;
878cfa0ad2SJack F Vogel }
888cfa0ad2SJack F Vogel 
898cfa0ad2SJack F Vogel /**
908cfa0ad2SJack F Vogel  *  e1000_init_phy_params - Initialize PHY function pointers
918cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
928cfa0ad2SJack F Vogel  *
938cfa0ad2SJack F Vogel  *  This function initializes the function pointers for the PHY
948cfa0ad2SJack F Vogel  *  set of functions.  Called by drivers or by e1000_setup_init_funcs.
958cfa0ad2SJack F Vogel  **/
968cfa0ad2SJack F Vogel s32 e1000_init_phy_params(struct e1000_hw *hw)
978cfa0ad2SJack F Vogel {
988cfa0ad2SJack F Vogel 	s32 ret_val = E1000_SUCCESS;
998cfa0ad2SJack F Vogel 
1008cfa0ad2SJack F Vogel 	if (hw->phy.ops.init_params) {
1018cfa0ad2SJack F Vogel 		ret_val = hw->phy.ops.init_params(hw);
1028cfa0ad2SJack F Vogel 		if (ret_val) {
1038cfa0ad2SJack F Vogel 			DEBUGOUT("PHY Initialization Error\n");
1048cfa0ad2SJack F Vogel 			goto out;
1058cfa0ad2SJack F Vogel 		}
1068cfa0ad2SJack F Vogel 	} else {
1078cfa0ad2SJack F Vogel 		DEBUGOUT("phy.init_phy_params was NULL\n");
1088cfa0ad2SJack F Vogel 		ret_val =  -E1000_ERR_CONFIG;
1098cfa0ad2SJack F Vogel 	}
1108cfa0ad2SJack F Vogel 
1118cfa0ad2SJack F Vogel out:
1128cfa0ad2SJack F Vogel 	return ret_val;
1138cfa0ad2SJack F Vogel }
1148cfa0ad2SJack F Vogel 
115b8270585SJack F Vogel /**
116b8270585SJack F Vogel  *  e1000_init_mbx_params - Initialize mailbox function pointers
117b8270585SJack F Vogel  *  @hw: pointer to the HW structure
118b8270585SJack F Vogel  *
119b8270585SJack F Vogel  *  This function initializes the function pointers for the PHY
120b8270585SJack F Vogel  *  set of functions.  Called by drivers or by e1000_setup_init_funcs.
121b8270585SJack F Vogel  **/
122b8270585SJack F Vogel s32 e1000_init_mbx_params(struct e1000_hw *hw)
123b8270585SJack F Vogel {
124b8270585SJack F Vogel 	s32 ret_val = E1000_SUCCESS;
125b8270585SJack F Vogel 
126b8270585SJack F Vogel 	if (hw->mbx.ops.init_params) {
127b8270585SJack F Vogel 		ret_val = hw->mbx.ops.init_params(hw);
128b8270585SJack F Vogel 		if (ret_val) {
129b8270585SJack F Vogel 			DEBUGOUT("Mailbox Initialization Error\n");
130b8270585SJack F Vogel 			goto out;
131b8270585SJack F Vogel 		}
132b8270585SJack F Vogel 	} else {
133b8270585SJack F Vogel 		DEBUGOUT("mbx.init_mbx_params was NULL\n");
134b8270585SJack F Vogel 		ret_val =  -E1000_ERR_CONFIG;
135b8270585SJack F Vogel 	}
136b8270585SJack F Vogel 
137b8270585SJack F Vogel out:
138b8270585SJack F Vogel 	return ret_val;
139b8270585SJack F Vogel }
140d035aa2dSJack F Vogel 
1418cfa0ad2SJack F Vogel /**
1428cfa0ad2SJack F Vogel  *  e1000_set_mac_type - Sets MAC type
1438cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
1448cfa0ad2SJack F Vogel  *
1458cfa0ad2SJack F Vogel  *  This function sets the mac type of the adapter based on the
1468cfa0ad2SJack F Vogel  *  device ID stored in the hw structure.
1478cfa0ad2SJack F Vogel  *  MUST BE FIRST FUNCTION CALLED (explicitly or through
1488cfa0ad2SJack F Vogel  *  e1000_setup_init_funcs()).
1498cfa0ad2SJack F Vogel  **/
1508cfa0ad2SJack F Vogel s32 e1000_set_mac_type(struct e1000_hw *hw)
1518cfa0ad2SJack F Vogel {
1528cfa0ad2SJack F Vogel 	struct e1000_mac_info *mac = &hw->mac;
1538cfa0ad2SJack F Vogel 	s32 ret_val = E1000_SUCCESS;
1548cfa0ad2SJack F Vogel 
1558cfa0ad2SJack F Vogel 	DEBUGFUNC("e1000_set_mac_type");
1568cfa0ad2SJack F Vogel 
1578cfa0ad2SJack F Vogel 	switch (hw->device_id) {
1588cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82542:
1598cfa0ad2SJack F Vogel 		mac->type = e1000_82542;
1608cfa0ad2SJack F Vogel 		break;
1618cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82543GC_FIBER:
1628cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82543GC_COPPER:
1638cfa0ad2SJack F Vogel 		mac->type = e1000_82543;
1648cfa0ad2SJack F Vogel 		break;
1658cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82544EI_COPPER:
1668cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82544EI_FIBER:
1678cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82544GC_COPPER:
1688cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82544GC_LOM:
1698cfa0ad2SJack F Vogel 		mac->type = e1000_82544;
1708cfa0ad2SJack F Vogel 		break;
1718cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82540EM:
1728cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82540EM_LOM:
1738cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82540EP:
1748cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82540EP_LOM:
1758cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82540EP_LP:
1768cfa0ad2SJack F Vogel 		mac->type = e1000_82540;
1778cfa0ad2SJack F Vogel 		break;
1788cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82545EM_COPPER:
1798cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82545EM_FIBER:
1808cfa0ad2SJack F Vogel 		mac->type = e1000_82545;
1818cfa0ad2SJack F Vogel 		break;
1828cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82545GM_COPPER:
1838cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82545GM_FIBER:
1848cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82545GM_SERDES:
1858cfa0ad2SJack F Vogel 		mac->type = e1000_82545_rev_3;
1868cfa0ad2SJack F Vogel 		break;
1878cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82546EB_COPPER:
1888cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82546EB_FIBER:
1898cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82546EB_QUAD_COPPER:
1908cfa0ad2SJack F Vogel 		mac->type = e1000_82546;
1918cfa0ad2SJack F Vogel 		break;
1928cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82546GB_COPPER:
1938cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82546GB_FIBER:
1948cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82546GB_SERDES:
1958cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82546GB_PCIE:
1968cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82546GB_QUAD_COPPER:
1978cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3:
1988cfa0ad2SJack F Vogel 		mac->type = e1000_82546_rev_3;
1998cfa0ad2SJack F Vogel 		break;
2008cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82541EI:
2018cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82541EI_MOBILE:
2028cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82541ER_LOM:
2038cfa0ad2SJack F Vogel 		mac->type = e1000_82541;
2048cfa0ad2SJack F Vogel 		break;
2058cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82541ER:
2068cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82541GI:
2078cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82541GI_LF:
2088cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82541GI_MOBILE:
2098cfa0ad2SJack F Vogel 		mac->type = e1000_82541_rev_2;
2108cfa0ad2SJack F Vogel 		break;
2118cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82547EI:
2128cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82547EI_MOBILE:
2138cfa0ad2SJack F Vogel 		mac->type = e1000_82547;
2148cfa0ad2SJack F Vogel 		break;
2158cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82547GI:
2168cfa0ad2SJack F Vogel 		mac->type = e1000_82547_rev_2;
2178cfa0ad2SJack F Vogel 		break;
2188cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82571EB_COPPER:
2198cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82571EB_FIBER:
2208cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82571EB_SERDES:
2218cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82571EB_SERDES_DUAL:
2228cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82571EB_SERDES_QUAD:
2238cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82571EB_QUAD_COPPER:
2248cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82571PT_QUAD_COPPER:
2258cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82571EB_QUAD_FIBER:
2268cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82571EB_QUAD_COPPER_LP:
2278cfa0ad2SJack F Vogel 		mac->type = e1000_82571;
2288cfa0ad2SJack F Vogel 		break;
2298cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82572EI:
2308cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82572EI_COPPER:
2318cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82572EI_FIBER:
2328cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82572EI_SERDES:
2338cfa0ad2SJack F Vogel 		mac->type = e1000_82572;
2348cfa0ad2SJack F Vogel 		break;
2358cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82573E:
2368cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82573E_IAMT:
2378cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82573L:
2388cfa0ad2SJack F Vogel 		mac->type = e1000_82573;
2398cfa0ad2SJack F Vogel 		break;
2408cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82574L:
2419d81738fSJack F Vogel 	case E1000_DEV_ID_82574LA:
2428cfa0ad2SJack F Vogel 		mac->type = e1000_82574;
2438cfa0ad2SJack F Vogel 		break;
2449d81738fSJack F Vogel 	case E1000_DEV_ID_82583V:
2459d81738fSJack F Vogel 		mac->type = e1000_82583;
2469d81738fSJack F Vogel 		break;
2478cfa0ad2SJack F Vogel 	case E1000_DEV_ID_80003ES2LAN_COPPER_DPT:
2488cfa0ad2SJack F Vogel 	case E1000_DEV_ID_80003ES2LAN_SERDES_DPT:
2498cfa0ad2SJack F Vogel 	case E1000_DEV_ID_80003ES2LAN_COPPER_SPT:
2508cfa0ad2SJack F Vogel 	case E1000_DEV_ID_80003ES2LAN_SERDES_SPT:
2518cfa0ad2SJack F Vogel 		mac->type = e1000_80003es2lan;
2528cfa0ad2SJack F Vogel 		break;
2538cfa0ad2SJack F Vogel 	case E1000_DEV_ID_ICH8_IFE:
2548cfa0ad2SJack F Vogel 	case E1000_DEV_ID_ICH8_IFE_GT:
2558cfa0ad2SJack F Vogel 	case E1000_DEV_ID_ICH8_IFE_G:
2568cfa0ad2SJack F Vogel 	case E1000_DEV_ID_ICH8_IGP_M:
2578cfa0ad2SJack F Vogel 	case E1000_DEV_ID_ICH8_IGP_M_AMT:
2588cfa0ad2SJack F Vogel 	case E1000_DEV_ID_ICH8_IGP_AMT:
2598cfa0ad2SJack F Vogel 	case E1000_DEV_ID_ICH8_IGP_C:
2604edd8523SJack F Vogel 	case E1000_DEV_ID_ICH8_82567V_3:
2618cfa0ad2SJack F Vogel 		mac->type = e1000_ich8lan;
2628cfa0ad2SJack F Vogel 		break;
2638cfa0ad2SJack F Vogel 	case E1000_DEV_ID_ICH9_IFE:
2648cfa0ad2SJack F Vogel 	case E1000_DEV_ID_ICH9_IFE_GT:
2658cfa0ad2SJack F Vogel 	case E1000_DEV_ID_ICH9_IFE_G:
2668cfa0ad2SJack F Vogel 	case E1000_DEV_ID_ICH9_IGP_M:
2678cfa0ad2SJack F Vogel 	case E1000_DEV_ID_ICH9_IGP_M_AMT:
2688cfa0ad2SJack F Vogel 	case E1000_DEV_ID_ICH9_IGP_M_V:
2698cfa0ad2SJack F Vogel 	case E1000_DEV_ID_ICH9_IGP_AMT:
2708cfa0ad2SJack F Vogel 	case E1000_DEV_ID_ICH9_BM:
2718cfa0ad2SJack F Vogel 	case E1000_DEV_ID_ICH9_IGP_C:
2728cfa0ad2SJack F Vogel 	case E1000_DEV_ID_ICH10_R_BM_LM:
2738cfa0ad2SJack F Vogel 	case E1000_DEV_ID_ICH10_R_BM_LF:
2748cfa0ad2SJack F Vogel 	case E1000_DEV_ID_ICH10_R_BM_V:
2758cfa0ad2SJack F Vogel 		mac->type = e1000_ich9lan;
2768cfa0ad2SJack F Vogel 		break;
2778cfa0ad2SJack F Vogel 	case E1000_DEV_ID_ICH10_D_BM_LM:
2788cfa0ad2SJack F Vogel 	case E1000_DEV_ID_ICH10_D_BM_LF:
2797d9119bdSJack F Vogel 	case E1000_DEV_ID_ICH10_D_BM_V:
2808cfa0ad2SJack F Vogel 		mac->type = e1000_ich10lan;
2818cfa0ad2SJack F Vogel 		break;
2829d81738fSJack F Vogel 	case E1000_DEV_ID_PCH_D_HV_DM:
2839d81738fSJack F Vogel 	case E1000_DEV_ID_PCH_D_HV_DC:
2849d81738fSJack F Vogel 	case E1000_DEV_ID_PCH_M_HV_LM:
2859d81738fSJack F Vogel 	case E1000_DEV_ID_PCH_M_HV_LC:
2869d81738fSJack F Vogel 		mac->type = e1000_pchlan;
2879d81738fSJack F Vogel 		break;
2887d9119bdSJack F Vogel 	case E1000_DEV_ID_PCH2_LV_LM:
2897d9119bdSJack F Vogel 	case E1000_DEV_ID_PCH2_LV_V:
2907d9119bdSJack F Vogel 		mac->type = e1000_pch2lan;
2917d9119bdSJack F Vogel 		break;
2926ab6bfe3SJack F Vogel 	case E1000_DEV_ID_PCH_LPT_I217_LM:
2936ab6bfe3SJack F Vogel 	case E1000_DEV_ID_PCH_LPT_I217_V:
2946ab6bfe3SJack F Vogel 	case E1000_DEV_ID_PCH_LPTLP_I218_LM:
2956ab6bfe3SJack F Vogel 	case E1000_DEV_ID_PCH_LPTLP_I218_V:
2968cc64f1eSJack F Vogel 	case E1000_DEV_ID_PCH_I218_LM2:
2978cc64f1eSJack F Vogel 	case E1000_DEV_ID_PCH_I218_V2:
2988cc64f1eSJack F Vogel 	case E1000_DEV_ID_PCH_I218_LM3:
2998cc64f1eSJack F Vogel 	case E1000_DEV_ID_PCH_I218_V3:
3006ab6bfe3SJack F Vogel 		mac->type = e1000_pch_lpt;
3016ab6bfe3SJack F Vogel 		break;
302c80429ceSEric Joyner 	case E1000_DEV_ID_PCH_SPT_I219_LM:
303c80429ceSEric Joyner 	case E1000_DEV_ID_PCH_SPT_I219_V:
304c80429ceSEric Joyner 	case E1000_DEV_ID_PCH_SPT_I219_LM2:
305c80429ceSEric Joyner 	case E1000_DEV_ID_PCH_SPT_I219_V2:
306c80429ceSEric Joyner 	case E1000_DEV_ID_PCH_LBG_I219_LM3:
307*e760e292SSean Bruno 	case E1000_DEV_ID_PCH_SPT_I219_LM4:
308*e760e292SSean Bruno 	case E1000_DEV_ID_PCH_SPT_I219_V4:
309*e760e292SSean Bruno 	case E1000_DEV_ID_PCH_SPT_I219_LM5:
310*e760e292SSean Bruno 	case E1000_DEV_ID_PCH_SPT_I219_V5:
311c80429ceSEric Joyner 		mac->type = e1000_pch_spt;
312c80429ceSEric Joyner 		break;
3138cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82575EB_COPPER:
3148cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82575EB_FIBER_SERDES:
3158cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82575GB_QUAD_COPPER:
3168cfa0ad2SJack F Vogel 		mac->type = e1000_82575;
3178cfa0ad2SJack F Vogel 		break;
3188cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82576:
3198cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82576_FIBER:
3208cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82576_SERDES:
3218cfa0ad2SJack F Vogel 	case E1000_DEV_ID_82576_QUAD_COPPER:
3227d9119bdSJack F Vogel 	case E1000_DEV_ID_82576_QUAD_COPPER_ET2:
323d035aa2dSJack F Vogel 	case E1000_DEV_ID_82576_NS:
3244edd8523SJack F Vogel 	case E1000_DEV_ID_82576_NS_SERDES:
3259d81738fSJack F Vogel 	case E1000_DEV_ID_82576_SERDES_QUAD:
3268cfa0ad2SJack F Vogel 		mac->type = e1000_82576;
3278cfa0ad2SJack F Vogel 		break;
3284edd8523SJack F Vogel 	case E1000_DEV_ID_82580_COPPER:
3294edd8523SJack F Vogel 	case E1000_DEV_ID_82580_FIBER:
3304edd8523SJack F Vogel 	case E1000_DEV_ID_82580_SERDES:
3314edd8523SJack F Vogel 	case E1000_DEV_ID_82580_SGMII:
3324edd8523SJack F Vogel 	case E1000_DEV_ID_82580_COPPER_DUAL:
3337d9119bdSJack F Vogel 	case E1000_DEV_ID_82580_QUAD_FIBER:
334ffdb071aSJack F Vogel 	case E1000_DEV_ID_DH89XXCC_SGMII:
335ffdb071aSJack F Vogel 	case E1000_DEV_ID_DH89XXCC_SERDES:
336f0ecc46dSJack F Vogel 	case E1000_DEV_ID_DH89XXCC_BACKPLANE:
337f0ecc46dSJack F Vogel 	case E1000_DEV_ID_DH89XXCC_SFP:
3384edd8523SJack F Vogel 		mac->type = e1000_82580;
3394edd8523SJack F Vogel 		break;
340f0ecc46dSJack F Vogel 	case E1000_DEV_ID_I350_COPPER:
341f0ecc46dSJack F Vogel 	case E1000_DEV_ID_I350_FIBER:
342f0ecc46dSJack F Vogel 	case E1000_DEV_ID_I350_SERDES:
343f0ecc46dSJack F Vogel 	case E1000_DEV_ID_I350_SGMII:
3444dab5c37SJack F Vogel 	case E1000_DEV_ID_I350_DA4:
345f0ecc46dSJack F Vogel 		mac->type = e1000_i350;
346f0ecc46dSJack F Vogel 		break;
3477609433eSJack F Vogel 	case E1000_DEV_ID_I210_COPPER_FLASHLESS:
3487609433eSJack F Vogel 	case E1000_DEV_ID_I210_SERDES_FLASHLESS:
349ab5d0362SJack F Vogel 	case E1000_DEV_ID_I210_COPPER:
350ab5d0362SJack F Vogel 	case E1000_DEV_ID_I210_COPPER_OEM1:
351ab5d0362SJack F Vogel 	case E1000_DEV_ID_I210_COPPER_IT:
352ab5d0362SJack F Vogel 	case E1000_DEV_ID_I210_FIBER:
353ab5d0362SJack F Vogel 	case E1000_DEV_ID_I210_SERDES:
354ab5d0362SJack F Vogel 	case E1000_DEV_ID_I210_SGMII:
355ab5d0362SJack F Vogel 		mac->type = e1000_i210;
356ab5d0362SJack F Vogel 		break;
357ab5d0362SJack F Vogel 	case E1000_DEV_ID_I211_COPPER:
358ab5d0362SJack F Vogel 		mac->type = e1000_i211;
359ab5d0362SJack F Vogel 		break;
360b8270585SJack F Vogel 	case E1000_DEV_ID_82576_VF:
3616ab6bfe3SJack F Vogel 	case E1000_DEV_ID_82576_VF_HV:
362b8270585SJack F Vogel 		mac->type = e1000_vfadapt;
363b8270585SJack F Vogel 		break;
364f0ecc46dSJack F Vogel 	case E1000_DEV_ID_I350_VF:
3656ab6bfe3SJack F Vogel 	case E1000_DEV_ID_I350_VF_HV:
366f0ecc46dSJack F Vogel 		mac->type = e1000_vfadapt_i350;
367f0ecc46dSJack F Vogel 		break;
3686ab6bfe3SJack F Vogel 
3697609433eSJack F Vogel 	case E1000_DEV_ID_I354_BACKPLANE_1GBPS:
3707609433eSJack F Vogel 	case E1000_DEV_ID_I354_SGMII:
3717609433eSJack F Vogel 	case E1000_DEV_ID_I354_BACKPLANE_2_5GBPS:
3727609433eSJack F Vogel 		mac->type = e1000_i354;
3737609433eSJack F Vogel 		break;
3748cfa0ad2SJack F Vogel 	default:
3758cfa0ad2SJack F Vogel 		/* Should never have loaded on this device */
3768cfa0ad2SJack F Vogel 		ret_val = -E1000_ERR_MAC_INIT;
3778cfa0ad2SJack F Vogel 		break;
3788cfa0ad2SJack F Vogel 	}
3798cfa0ad2SJack F Vogel 
3808cfa0ad2SJack F Vogel 	return ret_val;
3818cfa0ad2SJack F Vogel }
3828cfa0ad2SJack F Vogel 
3838cfa0ad2SJack F Vogel /**
3848cfa0ad2SJack F Vogel  *  e1000_setup_init_funcs - Initializes function pointers
3858cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
3868cfa0ad2SJack F Vogel  *  @init_device: TRUE will initialize the rest of the function pointers
3878cfa0ad2SJack F Vogel  *		  getting the device ready for use.  FALSE will only set
3888cfa0ad2SJack F Vogel  *		  MAC type and the function pointers for the other init
3898cfa0ad2SJack F Vogel  *		  functions.  Passing FALSE will not generate any hardware
3908cfa0ad2SJack F Vogel  *		  reads or writes.
3918cfa0ad2SJack F Vogel  *
3928cfa0ad2SJack F Vogel  *  This function must be called by a driver in order to use the rest
3938cfa0ad2SJack F Vogel  *  of the 'shared' code files. Called by drivers only.
3948cfa0ad2SJack F Vogel  **/
3958cfa0ad2SJack F Vogel s32 e1000_setup_init_funcs(struct e1000_hw *hw, bool init_device)
3968cfa0ad2SJack F Vogel {
3978cfa0ad2SJack F Vogel 	s32 ret_val;
3988cfa0ad2SJack F Vogel 
3998cfa0ad2SJack F Vogel 	/* Can't do much good without knowing the MAC type. */
4008cfa0ad2SJack F Vogel 	ret_val = e1000_set_mac_type(hw);
4018cfa0ad2SJack F Vogel 	if (ret_val) {
4028cfa0ad2SJack F Vogel 		DEBUGOUT("ERROR: MAC type could not be set properly.\n");
4038cfa0ad2SJack F Vogel 		goto out;
4048cfa0ad2SJack F Vogel 	}
4058cfa0ad2SJack F Vogel 
4068cfa0ad2SJack F Vogel 	if (!hw->hw_addr) {
4078cfa0ad2SJack F Vogel 		DEBUGOUT("ERROR: Registers not mapped\n");
4088cfa0ad2SJack F Vogel 		ret_val = -E1000_ERR_CONFIG;
4098cfa0ad2SJack F Vogel 		goto out;
4108cfa0ad2SJack F Vogel 	}
4118cfa0ad2SJack F Vogel 
4128cfa0ad2SJack F Vogel 	/*
4138cfa0ad2SJack F Vogel 	 * Init function pointers to generic implementations. We do this first
4148cfa0ad2SJack F Vogel 	 * allowing a driver module to override it afterward.
4158cfa0ad2SJack F Vogel 	 */
4168cfa0ad2SJack F Vogel 	e1000_init_mac_ops_generic(hw);
4178cfa0ad2SJack F Vogel 	e1000_init_phy_ops_generic(hw);
4188cfa0ad2SJack F Vogel 	e1000_init_nvm_ops_generic(hw);
419b8270585SJack F Vogel 	e1000_init_mbx_ops_generic(hw);
4208cfa0ad2SJack F Vogel 
4218cfa0ad2SJack F Vogel 	/*
4228cfa0ad2SJack F Vogel 	 * Set up the init function pointers. These are functions within the
4238cfa0ad2SJack F Vogel 	 * adapter family file that sets up function pointers for the rest of
4248cfa0ad2SJack F Vogel 	 * the functions in that family.
4258cfa0ad2SJack F Vogel 	 */
4268cfa0ad2SJack F Vogel 	switch (hw->mac.type) {
4278cfa0ad2SJack F Vogel 	case e1000_82542:
4288cfa0ad2SJack F Vogel 		e1000_init_function_pointers_82542(hw);
4298cfa0ad2SJack F Vogel 		break;
4308cfa0ad2SJack F Vogel 	case e1000_82543:
4318cfa0ad2SJack F Vogel 	case e1000_82544:
4328cfa0ad2SJack F Vogel 		e1000_init_function_pointers_82543(hw);
4338cfa0ad2SJack F Vogel 		break;
4348cfa0ad2SJack F Vogel 	case e1000_82540:
4358cfa0ad2SJack F Vogel 	case e1000_82545:
4368cfa0ad2SJack F Vogel 	case e1000_82545_rev_3:
4378cfa0ad2SJack F Vogel 	case e1000_82546:
4388cfa0ad2SJack F Vogel 	case e1000_82546_rev_3:
4398cfa0ad2SJack F Vogel 		e1000_init_function_pointers_82540(hw);
4408cfa0ad2SJack F Vogel 		break;
4418cfa0ad2SJack F Vogel 	case e1000_82541:
4428cfa0ad2SJack F Vogel 	case e1000_82541_rev_2:
4438cfa0ad2SJack F Vogel 	case e1000_82547:
4448cfa0ad2SJack F Vogel 	case e1000_82547_rev_2:
4458cfa0ad2SJack F Vogel 		e1000_init_function_pointers_82541(hw);
4468cfa0ad2SJack F Vogel 		break;
4478cfa0ad2SJack F Vogel 	case e1000_82571:
4488cfa0ad2SJack F Vogel 	case e1000_82572:
4498cfa0ad2SJack F Vogel 	case e1000_82573:
4508cfa0ad2SJack F Vogel 	case e1000_82574:
4519d81738fSJack F Vogel 	case e1000_82583:
4528cfa0ad2SJack F Vogel 		e1000_init_function_pointers_82571(hw);
4538cfa0ad2SJack F Vogel 		break;
4548cfa0ad2SJack F Vogel 	case e1000_80003es2lan:
4558cfa0ad2SJack F Vogel 		e1000_init_function_pointers_80003es2lan(hw);
4568cfa0ad2SJack F Vogel 		break;
4578cfa0ad2SJack F Vogel 	case e1000_ich8lan:
4588cfa0ad2SJack F Vogel 	case e1000_ich9lan:
4598cfa0ad2SJack F Vogel 	case e1000_ich10lan:
4609d81738fSJack F Vogel 	case e1000_pchlan:
4617d9119bdSJack F Vogel 	case e1000_pch2lan:
4626ab6bfe3SJack F Vogel 	case e1000_pch_lpt:
463c80429ceSEric Joyner 	case e1000_pch_spt:
4648cfa0ad2SJack F Vogel 		e1000_init_function_pointers_ich8lan(hw);
4658cfa0ad2SJack F Vogel 		break;
4668cfa0ad2SJack F Vogel 	case e1000_82575:
4678cfa0ad2SJack F Vogel 	case e1000_82576:
4684edd8523SJack F Vogel 	case e1000_82580:
469f0ecc46dSJack F Vogel 	case e1000_i350:
4707609433eSJack F Vogel 	case e1000_i354:
4718cfa0ad2SJack F Vogel 		e1000_init_function_pointers_82575(hw);
4728cfa0ad2SJack F Vogel 		break;
473ab5d0362SJack F Vogel 	case e1000_i210:
474ab5d0362SJack F Vogel 	case e1000_i211:
475ab5d0362SJack F Vogel 		e1000_init_function_pointers_i210(hw);
476ab5d0362SJack F Vogel 		break;
477b8270585SJack F Vogel 	case e1000_vfadapt:
478b8270585SJack F Vogel 		e1000_init_function_pointers_vf(hw);
479b8270585SJack F Vogel 		break;
480f0ecc46dSJack F Vogel 	case e1000_vfadapt_i350:
481f0ecc46dSJack F Vogel 		e1000_init_function_pointers_vf(hw);
482f0ecc46dSJack F Vogel 		break;
4838cfa0ad2SJack F Vogel 	default:
4848cfa0ad2SJack F Vogel 		DEBUGOUT("Hardware not supported\n");
4858cfa0ad2SJack F Vogel 		ret_val = -E1000_ERR_CONFIG;
4868cfa0ad2SJack F Vogel 		break;
4878cfa0ad2SJack F Vogel 	}
4888cfa0ad2SJack F Vogel 
4898cfa0ad2SJack F Vogel 	/*
4908cfa0ad2SJack F Vogel 	 * Initialize the rest of the function pointers. These require some
4918cfa0ad2SJack F Vogel 	 * register reads/writes in some cases.
4928cfa0ad2SJack F Vogel 	 */
4938cfa0ad2SJack F Vogel 	if (!(ret_val) && init_device) {
4948cfa0ad2SJack F Vogel 		ret_val = e1000_init_mac_params(hw);
4958cfa0ad2SJack F Vogel 		if (ret_val)
4968cfa0ad2SJack F Vogel 			goto out;
4978cfa0ad2SJack F Vogel 
4988cfa0ad2SJack F Vogel 		ret_val = e1000_init_nvm_params(hw);
4998cfa0ad2SJack F Vogel 		if (ret_val)
5008cfa0ad2SJack F Vogel 			goto out;
5018cfa0ad2SJack F Vogel 
5028cfa0ad2SJack F Vogel 		ret_val = e1000_init_phy_params(hw);
5038cfa0ad2SJack F Vogel 		if (ret_val)
5048cfa0ad2SJack F Vogel 			goto out;
505b8270585SJack F Vogel 
506b8270585SJack F Vogel 		ret_val = e1000_init_mbx_params(hw);
507b8270585SJack F Vogel 		if (ret_val)
508b8270585SJack F Vogel 			goto out;
5098cfa0ad2SJack F Vogel 	}
5108cfa0ad2SJack F Vogel 
5118cfa0ad2SJack F Vogel out:
5128cfa0ad2SJack F Vogel 	return ret_val;
5138cfa0ad2SJack F Vogel }
5148cfa0ad2SJack F Vogel 
5158cfa0ad2SJack F Vogel /**
5168cfa0ad2SJack F Vogel  *  e1000_get_bus_info - Obtain bus information for adapter
5178cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
5188cfa0ad2SJack F Vogel  *
5198cfa0ad2SJack F Vogel  *  This will obtain information about the HW bus for which the
5208cfa0ad2SJack F Vogel  *  adapter is attached and stores it in the hw structure. This is a
5218cfa0ad2SJack F Vogel  *  function pointer entry point called by drivers.
5228cfa0ad2SJack F Vogel  **/
5238cfa0ad2SJack F Vogel s32 e1000_get_bus_info(struct e1000_hw *hw)
5248cfa0ad2SJack F Vogel {
5258cfa0ad2SJack F Vogel 	if (hw->mac.ops.get_bus_info)
5268cfa0ad2SJack F Vogel 		return hw->mac.ops.get_bus_info(hw);
5278cfa0ad2SJack F Vogel 
5288cfa0ad2SJack F Vogel 	return E1000_SUCCESS;
5298cfa0ad2SJack F Vogel }
5308cfa0ad2SJack F Vogel 
5318cfa0ad2SJack F Vogel /**
5328cfa0ad2SJack F Vogel  *  e1000_clear_vfta - Clear VLAN filter table
5338cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
5348cfa0ad2SJack F Vogel  *
5358cfa0ad2SJack F Vogel  *  This clears the VLAN filter table on the adapter. This is a function
5368cfa0ad2SJack F Vogel  *  pointer entry point called by drivers.
5378cfa0ad2SJack F Vogel  **/
5388cfa0ad2SJack F Vogel void e1000_clear_vfta(struct e1000_hw *hw)
5398cfa0ad2SJack F Vogel {
5408cfa0ad2SJack F Vogel 	if (hw->mac.ops.clear_vfta)
5418cfa0ad2SJack F Vogel 		hw->mac.ops.clear_vfta(hw);
5428cfa0ad2SJack F Vogel }
5438cfa0ad2SJack F Vogel 
5448cfa0ad2SJack F Vogel /**
5458cfa0ad2SJack F Vogel  *  e1000_write_vfta - Write value to VLAN filter table
5468cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
5478cfa0ad2SJack F Vogel  *  @offset: the 32-bit offset in which to write the value to.
5488cfa0ad2SJack F Vogel  *  @value: the 32-bit value to write at location offset.
5498cfa0ad2SJack F Vogel  *
5508cfa0ad2SJack F Vogel  *  This writes a 32-bit value to a 32-bit offset in the VLAN filter
5518cfa0ad2SJack F Vogel  *  table. This is a function pointer entry point called by drivers.
5528cfa0ad2SJack F Vogel  **/
5538cfa0ad2SJack F Vogel void e1000_write_vfta(struct e1000_hw *hw, u32 offset, u32 value)
5548cfa0ad2SJack F Vogel {
5558cfa0ad2SJack F Vogel 	if (hw->mac.ops.write_vfta)
5568cfa0ad2SJack F Vogel 		hw->mac.ops.write_vfta(hw, offset, value);
5578cfa0ad2SJack F Vogel }
5588cfa0ad2SJack F Vogel 
5598cfa0ad2SJack F Vogel /**
5608cfa0ad2SJack F Vogel  *  e1000_update_mc_addr_list - Update Multicast addresses
5618cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
5628cfa0ad2SJack F Vogel  *  @mc_addr_list: array of multicast addresses to program
5638cfa0ad2SJack F Vogel  *  @mc_addr_count: number of multicast addresses to program
5648cfa0ad2SJack F Vogel  *
565d035aa2dSJack F Vogel  *  Updates the Multicast Table Array.
5668cfa0ad2SJack F Vogel  *  The caller must have a packed mc_addr_list of multicast addresses.
5678cfa0ad2SJack F Vogel  **/
5688cfa0ad2SJack F Vogel void e1000_update_mc_addr_list(struct e1000_hw *hw, u8 *mc_addr_list,
569d035aa2dSJack F Vogel 			       u32 mc_addr_count)
5708cfa0ad2SJack F Vogel {
5718cfa0ad2SJack F Vogel 	if (hw->mac.ops.update_mc_addr_list)
572d035aa2dSJack F Vogel 		hw->mac.ops.update_mc_addr_list(hw, mc_addr_list,
573d035aa2dSJack F Vogel 						mc_addr_count);
5748cfa0ad2SJack F Vogel }
5758cfa0ad2SJack F Vogel 
5768cfa0ad2SJack F Vogel /**
5778cfa0ad2SJack F Vogel  *  e1000_force_mac_fc - Force MAC flow control
5788cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
5798cfa0ad2SJack F Vogel  *
5808cfa0ad2SJack F Vogel  *  Force the MAC's flow control settings. Currently no func pointer exists
5818cfa0ad2SJack F Vogel  *  and all implementations are handled in the generic version of this
5828cfa0ad2SJack F Vogel  *  function.
5838cfa0ad2SJack F Vogel  **/
5848cfa0ad2SJack F Vogel s32 e1000_force_mac_fc(struct e1000_hw *hw)
5858cfa0ad2SJack F Vogel {
5868cfa0ad2SJack F Vogel 	return e1000_force_mac_fc_generic(hw);
5878cfa0ad2SJack F Vogel }
5888cfa0ad2SJack F Vogel 
5898cfa0ad2SJack F Vogel /**
5908cfa0ad2SJack F Vogel  *  e1000_check_for_link - Check/Store link connection
5918cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
5928cfa0ad2SJack F Vogel  *
5938cfa0ad2SJack F Vogel  *  This checks the link condition of the adapter and stores the
5948cfa0ad2SJack F Vogel  *  results in the hw->mac structure. This is a function pointer entry
5958cfa0ad2SJack F Vogel  *  point called by drivers.
5968cfa0ad2SJack F Vogel  **/
5978cfa0ad2SJack F Vogel s32 e1000_check_for_link(struct e1000_hw *hw)
5988cfa0ad2SJack F Vogel {
5998cfa0ad2SJack F Vogel 	if (hw->mac.ops.check_for_link)
6008cfa0ad2SJack F Vogel 		return hw->mac.ops.check_for_link(hw);
6018cfa0ad2SJack F Vogel 
6028cfa0ad2SJack F Vogel 	return -E1000_ERR_CONFIG;
6038cfa0ad2SJack F Vogel }
6048cfa0ad2SJack F Vogel 
6058cfa0ad2SJack F Vogel /**
6068cfa0ad2SJack F Vogel  *  e1000_check_mng_mode - Check management mode
6078cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
6088cfa0ad2SJack F Vogel  *
6098cfa0ad2SJack F Vogel  *  This checks if the adapter has manageability enabled.
6108cfa0ad2SJack F Vogel  *  This is a function pointer entry point called by drivers.
6118cfa0ad2SJack F Vogel  **/
6128cfa0ad2SJack F Vogel bool e1000_check_mng_mode(struct e1000_hw *hw)
6138cfa0ad2SJack F Vogel {
6148cfa0ad2SJack F Vogel 	if (hw->mac.ops.check_mng_mode)
6158cfa0ad2SJack F Vogel 		return hw->mac.ops.check_mng_mode(hw);
6168cfa0ad2SJack F Vogel 
6178cfa0ad2SJack F Vogel 	return FALSE;
6188cfa0ad2SJack F Vogel }
6198cfa0ad2SJack F Vogel 
6208cfa0ad2SJack F Vogel /**
6218cfa0ad2SJack F Vogel  *  e1000_mng_write_dhcp_info - Writes DHCP info to host interface
6228cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
6238cfa0ad2SJack F Vogel  *  @buffer: pointer to the host interface
6248cfa0ad2SJack F Vogel  *  @length: size of the buffer
6258cfa0ad2SJack F Vogel  *
6268cfa0ad2SJack F Vogel  *  Writes the DHCP information to the host interface.
6278cfa0ad2SJack F Vogel  **/
6288cfa0ad2SJack F Vogel s32 e1000_mng_write_dhcp_info(struct e1000_hw *hw, u8 *buffer, u16 length)
6298cfa0ad2SJack F Vogel {
6308cfa0ad2SJack F Vogel 	return e1000_mng_write_dhcp_info_generic(hw, buffer, length);
6318cfa0ad2SJack F Vogel }
6328cfa0ad2SJack F Vogel 
6338cfa0ad2SJack F Vogel /**
6348cfa0ad2SJack F Vogel  *  e1000_reset_hw - Reset hardware
6358cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
6368cfa0ad2SJack F Vogel  *
6378cfa0ad2SJack F Vogel  *  This resets the hardware into a known state. This is a function pointer
6388cfa0ad2SJack F Vogel  *  entry point called by drivers.
6398cfa0ad2SJack F Vogel  **/
6408cfa0ad2SJack F Vogel s32 e1000_reset_hw(struct e1000_hw *hw)
6418cfa0ad2SJack F Vogel {
6428cfa0ad2SJack F Vogel 	if (hw->mac.ops.reset_hw)
6438cfa0ad2SJack F Vogel 		return hw->mac.ops.reset_hw(hw);
6448cfa0ad2SJack F Vogel 
6458cfa0ad2SJack F Vogel 	return -E1000_ERR_CONFIG;
6468cfa0ad2SJack F Vogel }
6478cfa0ad2SJack F Vogel 
6488cfa0ad2SJack F Vogel /**
6498cfa0ad2SJack F Vogel  *  e1000_init_hw - Initialize hardware
6508cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
6518cfa0ad2SJack F Vogel  *
6528cfa0ad2SJack F Vogel  *  This inits the hardware readying it for operation. This is a function
6538cfa0ad2SJack F Vogel  *  pointer entry point called by drivers.
6548cfa0ad2SJack F Vogel  **/
6558cfa0ad2SJack F Vogel s32 e1000_init_hw(struct e1000_hw *hw)
6568cfa0ad2SJack F Vogel {
6578cfa0ad2SJack F Vogel 	if (hw->mac.ops.init_hw)
6588cfa0ad2SJack F Vogel 		return hw->mac.ops.init_hw(hw);
6598cfa0ad2SJack F Vogel 
6608cfa0ad2SJack F Vogel 	return -E1000_ERR_CONFIG;
6618cfa0ad2SJack F Vogel }
6628cfa0ad2SJack F Vogel 
6638cfa0ad2SJack F Vogel /**
6648cfa0ad2SJack F Vogel  *  e1000_setup_link - Configures link and flow control
6658cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
6668cfa0ad2SJack F Vogel  *
6678cfa0ad2SJack F Vogel  *  This configures link and flow control settings for the adapter. This
6688cfa0ad2SJack F Vogel  *  is a function pointer entry point called by drivers. While modules can
6698cfa0ad2SJack F Vogel  *  also call this, they probably call their own version of this function.
6708cfa0ad2SJack F Vogel  **/
6718cfa0ad2SJack F Vogel s32 e1000_setup_link(struct e1000_hw *hw)
6728cfa0ad2SJack F Vogel {
6738cfa0ad2SJack F Vogel 	if (hw->mac.ops.setup_link)
6748cfa0ad2SJack F Vogel 		return hw->mac.ops.setup_link(hw);
6758cfa0ad2SJack F Vogel 
6768cfa0ad2SJack F Vogel 	return -E1000_ERR_CONFIG;
6778cfa0ad2SJack F Vogel }
6788cfa0ad2SJack F Vogel 
6798cfa0ad2SJack F Vogel /**
6808cfa0ad2SJack F Vogel  *  e1000_get_speed_and_duplex - Returns current speed and duplex
6818cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
6828cfa0ad2SJack F Vogel  *  @speed: pointer to a 16-bit value to store the speed
6838cfa0ad2SJack F Vogel  *  @duplex: pointer to a 16-bit value to store the duplex.
6848cfa0ad2SJack F Vogel  *
6858cfa0ad2SJack F Vogel  *  This returns the speed and duplex of the adapter in the two 'out'
6868cfa0ad2SJack F Vogel  *  variables passed in. This is a function pointer entry point called
6878cfa0ad2SJack F Vogel  *  by drivers.
6888cfa0ad2SJack F Vogel  **/
6898cfa0ad2SJack F Vogel s32 e1000_get_speed_and_duplex(struct e1000_hw *hw, u16 *speed, u16 *duplex)
6908cfa0ad2SJack F Vogel {
6918cfa0ad2SJack F Vogel 	if (hw->mac.ops.get_link_up_info)
6928cfa0ad2SJack F Vogel 		return hw->mac.ops.get_link_up_info(hw, speed, duplex);
6938cfa0ad2SJack F Vogel 
6948cfa0ad2SJack F Vogel 	return -E1000_ERR_CONFIG;
6958cfa0ad2SJack F Vogel }
6968cfa0ad2SJack F Vogel 
6978cfa0ad2SJack F Vogel /**
6988cfa0ad2SJack F Vogel  *  e1000_setup_led - Configures SW controllable LED
6998cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
7008cfa0ad2SJack F Vogel  *
7018cfa0ad2SJack F Vogel  *  This prepares the SW controllable LED for use and saves the current state
7028cfa0ad2SJack F Vogel  *  of the LED so it can be later restored. This is a function pointer entry
7038cfa0ad2SJack F Vogel  *  point called by drivers.
7048cfa0ad2SJack F Vogel  **/
7058cfa0ad2SJack F Vogel s32 e1000_setup_led(struct e1000_hw *hw)
7068cfa0ad2SJack F Vogel {
7078cfa0ad2SJack F Vogel 	if (hw->mac.ops.setup_led)
7088cfa0ad2SJack F Vogel 		return hw->mac.ops.setup_led(hw);
7098cfa0ad2SJack F Vogel 
7108cfa0ad2SJack F Vogel 	return E1000_SUCCESS;
7118cfa0ad2SJack F Vogel }
7128cfa0ad2SJack F Vogel 
7138cfa0ad2SJack F Vogel /**
7148cfa0ad2SJack F Vogel  *  e1000_cleanup_led - Restores SW controllable LED
7158cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
7168cfa0ad2SJack F Vogel  *
7178cfa0ad2SJack F Vogel  *  This restores the SW controllable LED to the value saved off by
7188cfa0ad2SJack F Vogel  *  e1000_setup_led. This is a function pointer entry point called by drivers.
7198cfa0ad2SJack F Vogel  **/
7208cfa0ad2SJack F Vogel s32 e1000_cleanup_led(struct e1000_hw *hw)
7218cfa0ad2SJack F Vogel {
7228cfa0ad2SJack F Vogel 	if (hw->mac.ops.cleanup_led)
7238cfa0ad2SJack F Vogel 		return hw->mac.ops.cleanup_led(hw);
7248cfa0ad2SJack F Vogel 
7258cfa0ad2SJack F Vogel 	return E1000_SUCCESS;
7268cfa0ad2SJack F Vogel }
7278cfa0ad2SJack F Vogel 
7288cfa0ad2SJack F Vogel /**
7298cfa0ad2SJack F Vogel  *  e1000_blink_led - Blink SW controllable LED
7308cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
7318cfa0ad2SJack F Vogel  *
7328cfa0ad2SJack F Vogel  *  This starts the adapter LED blinking. Request the LED to be setup first
7338cfa0ad2SJack F Vogel  *  and cleaned up after. This is a function pointer entry point called by
7348cfa0ad2SJack F Vogel  *  drivers.
7358cfa0ad2SJack F Vogel  **/
7368cfa0ad2SJack F Vogel s32 e1000_blink_led(struct e1000_hw *hw)
7378cfa0ad2SJack F Vogel {
7388cfa0ad2SJack F Vogel 	if (hw->mac.ops.blink_led)
7398cfa0ad2SJack F Vogel 		return hw->mac.ops.blink_led(hw);
7408cfa0ad2SJack F Vogel 
7418cfa0ad2SJack F Vogel 	return E1000_SUCCESS;
7428cfa0ad2SJack F Vogel }
7438cfa0ad2SJack F Vogel 
7448cfa0ad2SJack F Vogel /**
745d035aa2dSJack F Vogel  *  e1000_id_led_init - store LED configurations in SW
746d035aa2dSJack F Vogel  *  @hw: pointer to the HW structure
747d035aa2dSJack F Vogel  *
748d035aa2dSJack F Vogel  *  Initializes the LED config in SW. This is a function pointer entry point
749d035aa2dSJack F Vogel  *  called by drivers.
750d035aa2dSJack F Vogel  **/
751d035aa2dSJack F Vogel s32 e1000_id_led_init(struct e1000_hw *hw)
752d035aa2dSJack F Vogel {
753d035aa2dSJack F Vogel 	if (hw->mac.ops.id_led_init)
754d035aa2dSJack F Vogel 		return hw->mac.ops.id_led_init(hw);
755d035aa2dSJack F Vogel 
756d035aa2dSJack F Vogel 	return E1000_SUCCESS;
757d035aa2dSJack F Vogel }
758d035aa2dSJack F Vogel 
759d035aa2dSJack F Vogel /**
7608cfa0ad2SJack F Vogel  *  e1000_led_on - Turn on SW controllable LED
7618cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
7628cfa0ad2SJack F Vogel  *
7638cfa0ad2SJack F Vogel  *  Turns the SW defined LED on. This is a function pointer entry point
7648cfa0ad2SJack F Vogel  *  called by drivers.
7658cfa0ad2SJack F Vogel  **/
7668cfa0ad2SJack F Vogel s32 e1000_led_on(struct e1000_hw *hw)
7678cfa0ad2SJack F Vogel {
7688cfa0ad2SJack F Vogel 	if (hw->mac.ops.led_on)
7698cfa0ad2SJack F Vogel 		return hw->mac.ops.led_on(hw);
7708cfa0ad2SJack F Vogel 
7718cfa0ad2SJack F Vogel 	return E1000_SUCCESS;
7728cfa0ad2SJack F Vogel }
7738cfa0ad2SJack F Vogel 
7748cfa0ad2SJack F Vogel /**
7758cfa0ad2SJack F Vogel  *  e1000_led_off - Turn off SW controllable LED
7768cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
7778cfa0ad2SJack F Vogel  *
7788cfa0ad2SJack F Vogel  *  Turns the SW defined LED off. This is a function pointer entry point
7798cfa0ad2SJack F Vogel  *  called by drivers.
7808cfa0ad2SJack F Vogel  **/
7818cfa0ad2SJack F Vogel s32 e1000_led_off(struct e1000_hw *hw)
7828cfa0ad2SJack F Vogel {
7838cfa0ad2SJack F Vogel 	if (hw->mac.ops.led_off)
7848cfa0ad2SJack F Vogel 		return hw->mac.ops.led_off(hw);
7858cfa0ad2SJack F Vogel 
7868cfa0ad2SJack F Vogel 	return E1000_SUCCESS;
7878cfa0ad2SJack F Vogel }
7888cfa0ad2SJack F Vogel 
7898cfa0ad2SJack F Vogel /**
7908cfa0ad2SJack F Vogel  *  e1000_reset_adaptive - Reset adaptive IFS
7918cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
7928cfa0ad2SJack F Vogel  *
7938cfa0ad2SJack F Vogel  *  Resets the adaptive IFS. Currently no func pointer exists and all
7948cfa0ad2SJack F Vogel  *  implementations are handled in the generic version of this function.
7958cfa0ad2SJack F Vogel  **/
7968cfa0ad2SJack F Vogel void e1000_reset_adaptive(struct e1000_hw *hw)
7978cfa0ad2SJack F Vogel {
7988cfa0ad2SJack F Vogel 	e1000_reset_adaptive_generic(hw);
7998cfa0ad2SJack F Vogel }
8008cfa0ad2SJack F Vogel 
8018cfa0ad2SJack F Vogel /**
8028cfa0ad2SJack F Vogel  *  e1000_update_adaptive - Update adaptive IFS
8038cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
8048cfa0ad2SJack F Vogel  *
8058cfa0ad2SJack F Vogel  *  Updates adapter IFS. Currently no func pointer exists and all
8068cfa0ad2SJack F Vogel  *  implementations are handled in the generic version of this function.
8078cfa0ad2SJack F Vogel  **/
8088cfa0ad2SJack F Vogel void e1000_update_adaptive(struct e1000_hw *hw)
8098cfa0ad2SJack F Vogel {
8108cfa0ad2SJack F Vogel 	e1000_update_adaptive_generic(hw);
8118cfa0ad2SJack F Vogel }
8128cfa0ad2SJack F Vogel 
8138cfa0ad2SJack F Vogel /**
8148cfa0ad2SJack F Vogel  *  e1000_disable_pcie_master - Disable PCI-Express master access
8158cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
8168cfa0ad2SJack F Vogel  *
8178cfa0ad2SJack F Vogel  *  Disables PCI-Express master access and verifies there are no pending
8188cfa0ad2SJack F Vogel  *  requests. Currently no func pointer exists and all implementations are
8198cfa0ad2SJack F Vogel  *  handled in the generic version of this function.
8208cfa0ad2SJack F Vogel  **/
8218cfa0ad2SJack F Vogel s32 e1000_disable_pcie_master(struct e1000_hw *hw)
8228cfa0ad2SJack F Vogel {
8238cfa0ad2SJack F Vogel 	return e1000_disable_pcie_master_generic(hw);
8248cfa0ad2SJack F Vogel }
8258cfa0ad2SJack F Vogel 
8268cfa0ad2SJack F Vogel /**
8278cfa0ad2SJack F Vogel  *  e1000_config_collision_dist - Configure collision distance
8288cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
8298cfa0ad2SJack F Vogel  *
8308cfa0ad2SJack F Vogel  *  Configures the collision distance to the default value and is used
8318cfa0ad2SJack F Vogel  *  during link setup.
8328cfa0ad2SJack F Vogel  **/
8338cfa0ad2SJack F Vogel void e1000_config_collision_dist(struct e1000_hw *hw)
8348cfa0ad2SJack F Vogel {
8358cfa0ad2SJack F Vogel 	if (hw->mac.ops.config_collision_dist)
8368cfa0ad2SJack F Vogel 		hw->mac.ops.config_collision_dist(hw);
8378cfa0ad2SJack F Vogel }
8388cfa0ad2SJack F Vogel 
8398cfa0ad2SJack F Vogel /**
8408cfa0ad2SJack F Vogel  *  e1000_rar_set - Sets a receive address register
8418cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
8428cfa0ad2SJack F Vogel  *  @addr: address to set the RAR to
8438cfa0ad2SJack F Vogel  *  @index: the RAR to set
8448cfa0ad2SJack F Vogel  *
8458cfa0ad2SJack F Vogel  *  Sets a Receive Address Register (RAR) to the specified address.
8468cfa0ad2SJack F Vogel  **/
8478cc64f1eSJack F Vogel int e1000_rar_set(struct e1000_hw *hw, u8 *addr, u32 index)
8488cfa0ad2SJack F Vogel {
8498cfa0ad2SJack F Vogel 	if (hw->mac.ops.rar_set)
8508cc64f1eSJack F Vogel 		return hw->mac.ops.rar_set(hw, addr, index);
8518cc64f1eSJack F Vogel 
8528cc64f1eSJack F Vogel 	return E1000_SUCCESS;
8538cfa0ad2SJack F Vogel }
8548cfa0ad2SJack F Vogel 
8558cfa0ad2SJack F Vogel /**
8568cfa0ad2SJack F Vogel  *  e1000_validate_mdi_setting - Ensures valid MDI/MDIX SW state
8578cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
8588cfa0ad2SJack F Vogel  *
8598cfa0ad2SJack F Vogel  *  Ensures that the MDI/MDIX SW state is valid.
8608cfa0ad2SJack F Vogel  **/
8618cfa0ad2SJack F Vogel s32 e1000_validate_mdi_setting(struct e1000_hw *hw)
8628cfa0ad2SJack F Vogel {
8638cfa0ad2SJack F Vogel 	if (hw->mac.ops.validate_mdi_setting)
8648cfa0ad2SJack F Vogel 		return hw->mac.ops.validate_mdi_setting(hw);
8658cfa0ad2SJack F Vogel 
8668cfa0ad2SJack F Vogel 	return E1000_SUCCESS;
8678cfa0ad2SJack F Vogel }
8688cfa0ad2SJack F Vogel 
8698cfa0ad2SJack F Vogel /**
8708cfa0ad2SJack F Vogel  *  e1000_hash_mc_addr - Determines address location in multicast table
8718cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
8728cfa0ad2SJack F Vogel  *  @mc_addr: Multicast address to hash.
8738cfa0ad2SJack F Vogel  *
8748cfa0ad2SJack F Vogel  *  This hashes an address to determine its location in the multicast
8758cfa0ad2SJack F Vogel  *  table. Currently no func pointer exists and all implementations
8768cfa0ad2SJack F Vogel  *  are handled in the generic version of this function.
8778cfa0ad2SJack F Vogel  **/
8788cfa0ad2SJack F Vogel u32 e1000_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr)
8798cfa0ad2SJack F Vogel {
8808cfa0ad2SJack F Vogel 	return e1000_hash_mc_addr_generic(hw, mc_addr);
8818cfa0ad2SJack F Vogel }
8828cfa0ad2SJack F Vogel 
8838cfa0ad2SJack F Vogel /**
8848cfa0ad2SJack F Vogel  *  e1000_enable_tx_pkt_filtering - Enable packet filtering on TX
8858cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
8868cfa0ad2SJack F Vogel  *
8878cfa0ad2SJack F Vogel  *  Enables packet filtering on transmit packets if manageability is enabled
8888cfa0ad2SJack F Vogel  *  and host interface is enabled.
8898cfa0ad2SJack F Vogel  *  Currently no func pointer exists and all implementations are handled in the
8908cfa0ad2SJack F Vogel  *  generic version of this function.
8918cfa0ad2SJack F Vogel  **/
8928cfa0ad2SJack F Vogel bool e1000_enable_tx_pkt_filtering(struct e1000_hw *hw)
8938cfa0ad2SJack F Vogel {
8948cfa0ad2SJack F Vogel 	return e1000_enable_tx_pkt_filtering_generic(hw);
8958cfa0ad2SJack F Vogel }
8968cfa0ad2SJack F Vogel 
8978cfa0ad2SJack F Vogel /**
8988cfa0ad2SJack F Vogel  *  e1000_mng_host_if_write - Writes to the manageability host interface
8998cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
9008cfa0ad2SJack F Vogel  *  @buffer: pointer to the host interface buffer
9018cfa0ad2SJack F Vogel  *  @length: size of the buffer
9028cfa0ad2SJack F Vogel  *  @offset: location in the buffer to write to
9038cfa0ad2SJack F Vogel  *  @sum: sum of the data (not checksum)
9048cfa0ad2SJack F Vogel  *
9058cfa0ad2SJack F Vogel  *  This function writes the buffer content at the offset given on the host if.
9068cfa0ad2SJack F Vogel  *  It also does alignment considerations to do the writes in most efficient
9078cfa0ad2SJack F Vogel  *  way.  Also fills up the sum of the buffer in *buffer parameter.
9088cfa0ad2SJack F Vogel  **/
9098cfa0ad2SJack F Vogel s32 e1000_mng_host_if_write(struct e1000_hw *hw, u8 *buffer, u16 length,
9108cfa0ad2SJack F Vogel 			    u16 offset, u8 *sum)
9118cfa0ad2SJack F Vogel {
9126ab6bfe3SJack F Vogel 	return e1000_mng_host_if_write_generic(hw, buffer, length, offset, sum);
9138cfa0ad2SJack F Vogel }
9148cfa0ad2SJack F Vogel 
9158cfa0ad2SJack F Vogel /**
9168cfa0ad2SJack F Vogel  *  e1000_mng_write_cmd_header - Writes manageability command header
9178cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
9188cfa0ad2SJack F Vogel  *  @hdr: pointer to the host interface command header
9198cfa0ad2SJack F Vogel  *
9208cfa0ad2SJack F Vogel  *  Writes the command header after does the checksum calculation.
9218cfa0ad2SJack F Vogel  **/
9228cfa0ad2SJack F Vogel s32 e1000_mng_write_cmd_header(struct e1000_hw *hw,
9238cfa0ad2SJack F Vogel 			       struct e1000_host_mng_command_header *hdr)
9248cfa0ad2SJack F Vogel {
9256ab6bfe3SJack F Vogel 	return e1000_mng_write_cmd_header_generic(hw, hdr);
9268cfa0ad2SJack F Vogel }
9278cfa0ad2SJack F Vogel 
9288cfa0ad2SJack F Vogel /**
9298cfa0ad2SJack F Vogel  *  e1000_mng_enable_host_if - Checks host interface is enabled
9308cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
9318cfa0ad2SJack F Vogel  *
9328cfa0ad2SJack F Vogel  *  Returns E1000_success upon success, else E1000_ERR_HOST_INTERFACE_COMMAND
9338cfa0ad2SJack F Vogel  *
9348cfa0ad2SJack F Vogel  *  This function checks whether the HOST IF is enabled for command operation
9358cfa0ad2SJack F Vogel  *  and also checks whether the previous command is completed.  It busy waits
9368cfa0ad2SJack F Vogel  *  in case of previous command is not completed.
9378cfa0ad2SJack F Vogel  **/
9388cfa0ad2SJack F Vogel s32 e1000_mng_enable_host_if(struct e1000_hw *hw)
9398cfa0ad2SJack F Vogel {
9406ab6bfe3SJack F Vogel 	return e1000_mng_enable_host_if_generic(hw);
9418cfa0ad2SJack F Vogel }
9428cfa0ad2SJack F Vogel 
9438cfa0ad2SJack F Vogel /**
944e373323fSSean Bruno  *  e1000_set_obff_timer - Set Optimized Buffer Flush/Fill timer
945e373323fSSean Bruno  *  @hw: pointer to the HW structure
946e373323fSSean Bruno  *  @itr: u32 indicating itr value
947e373323fSSean Bruno  *
948e373323fSSean Bruno  *  Set the OBFF timer based on the given interrupt rate.
949e373323fSSean Bruno  **/
950e373323fSSean Bruno s32 e1000_set_obff_timer(struct e1000_hw *hw, u32 itr)
951e373323fSSean Bruno {
952e373323fSSean Bruno 	if (hw->mac.ops.set_obff_timer)
953e373323fSSean Bruno 		return hw->mac.ops.set_obff_timer(hw, itr);
954e373323fSSean Bruno 
955e373323fSSean Bruno 	return E1000_SUCCESS;
956e373323fSSean Bruno }
957e373323fSSean Bruno 
958e373323fSSean Bruno /**
9598cfa0ad2SJack F Vogel  *  e1000_check_reset_block - Verifies PHY can be reset
9608cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
9618cfa0ad2SJack F Vogel  *
9628cfa0ad2SJack F Vogel  *  Checks if the PHY is in a state that can be reset or if manageability
9638cfa0ad2SJack F Vogel  *  has it tied up. This is a function pointer entry point called by drivers.
9648cfa0ad2SJack F Vogel  **/
9658cfa0ad2SJack F Vogel s32 e1000_check_reset_block(struct e1000_hw *hw)
9668cfa0ad2SJack F Vogel {
9678cfa0ad2SJack F Vogel 	if (hw->phy.ops.check_reset_block)
9688cfa0ad2SJack F Vogel 		return hw->phy.ops.check_reset_block(hw);
9698cfa0ad2SJack F Vogel 
9708cfa0ad2SJack F Vogel 	return E1000_SUCCESS;
9718cfa0ad2SJack F Vogel }
9728cfa0ad2SJack F Vogel 
9738cfa0ad2SJack F Vogel /**
9748cfa0ad2SJack F Vogel  *  e1000_read_phy_reg - Reads PHY register
9758cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
9768cfa0ad2SJack F Vogel  *  @offset: the register to read
9778cfa0ad2SJack F Vogel  *  @data: the buffer to store the 16-bit read.
9788cfa0ad2SJack F Vogel  *
9798cfa0ad2SJack F Vogel  *  Reads the PHY register and returns the value in data.
9808cfa0ad2SJack F Vogel  *  This is a function pointer entry point called by drivers.
9818cfa0ad2SJack F Vogel  **/
9828cfa0ad2SJack F Vogel s32 e1000_read_phy_reg(struct e1000_hw *hw, u32 offset, u16 *data)
9838cfa0ad2SJack F Vogel {
9848cfa0ad2SJack F Vogel 	if (hw->phy.ops.read_reg)
9858cfa0ad2SJack F Vogel 		return hw->phy.ops.read_reg(hw, offset, data);
9868cfa0ad2SJack F Vogel 
9878cfa0ad2SJack F Vogel 	return E1000_SUCCESS;
9888cfa0ad2SJack F Vogel }
9898cfa0ad2SJack F Vogel 
9908cfa0ad2SJack F Vogel /**
9918cfa0ad2SJack F Vogel  *  e1000_write_phy_reg - Writes PHY register
9928cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
9938cfa0ad2SJack F Vogel  *  @offset: the register to write
9948cfa0ad2SJack F Vogel  *  @data: the value to write.
9958cfa0ad2SJack F Vogel  *
9968cfa0ad2SJack F Vogel  *  Writes the PHY register at offset with the value in data.
9978cfa0ad2SJack F Vogel  *  This is a function pointer entry point called by drivers.
9988cfa0ad2SJack F Vogel  **/
9998cfa0ad2SJack F Vogel s32 e1000_write_phy_reg(struct e1000_hw *hw, u32 offset, u16 data)
10008cfa0ad2SJack F Vogel {
10018cfa0ad2SJack F Vogel 	if (hw->phy.ops.write_reg)
10028cfa0ad2SJack F Vogel 		return hw->phy.ops.write_reg(hw, offset, data);
10038cfa0ad2SJack F Vogel 
10048cfa0ad2SJack F Vogel 	return E1000_SUCCESS;
10058cfa0ad2SJack F Vogel }
10068cfa0ad2SJack F Vogel 
10078cfa0ad2SJack F Vogel /**
10088cfa0ad2SJack F Vogel  *  e1000_release_phy - Generic release PHY
10098cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
10108cfa0ad2SJack F Vogel  *
10118cfa0ad2SJack F Vogel  *  Return if silicon family does not require a semaphore when accessing the
10128cfa0ad2SJack F Vogel  *  PHY.
10138cfa0ad2SJack F Vogel  **/
10148cfa0ad2SJack F Vogel void e1000_release_phy(struct e1000_hw *hw)
10158cfa0ad2SJack F Vogel {
10168cfa0ad2SJack F Vogel 	if (hw->phy.ops.release)
10178cfa0ad2SJack F Vogel 		hw->phy.ops.release(hw);
10188cfa0ad2SJack F Vogel }
10198cfa0ad2SJack F Vogel 
10208cfa0ad2SJack F Vogel /**
10218cfa0ad2SJack F Vogel  *  e1000_acquire_phy - Generic acquire PHY
10228cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
10238cfa0ad2SJack F Vogel  *
10248cfa0ad2SJack F Vogel  *  Return success if silicon family does not require a semaphore when
10258cfa0ad2SJack F Vogel  *  accessing the PHY.
10268cfa0ad2SJack F Vogel  **/
10278cfa0ad2SJack F Vogel s32 e1000_acquire_phy(struct e1000_hw *hw)
10288cfa0ad2SJack F Vogel {
10298cfa0ad2SJack F Vogel 	if (hw->phy.ops.acquire)
10308cfa0ad2SJack F Vogel 		return hw->phy.ops.acquire(hw);
10318cfa0ad2SJack F Vogel 
10328cfa0ad2SJack F Vogel 	return E1000_SUCCESS;
10338cfa0ad2SJack F Vogel }
10348cfa0ad2SJack F Vogel 
10358cfa0ad2SJack F Vogel /**
1036daf9197cSJack F Vogel  *  e1000_cfg_on_link_up - Configure PHY upon link up
1037daf9197cSJack F Vogel  *  @hw: pointer to the HW structure
1038daf9197cSJack F Vogel  **/
1039daf9197cSJack F Vogel s32 e1000_cfg_on_link_up(struct e1000_hw *hw)
1040daf9197cSJack F Vogel {
1041daf9197cSJack F Vogel 	if (hw->phy.ops.cfg_on_link_up)
1042daf9197cSJack F Vogel 		return hw->phy.ops.cfg_on_link_up(hw);
1043daf9197cSJack F Vogel 
1044daf9197cSJack F Vogel 	return E1000_SUCCESS;
1045daf9197cSJack F Vogel }
1046daf9197cSJack F Vogel 
1047daf9197cSJack F Vogel /**
10488cfa0ad2SJack F Vogel  *  e1000_read_kmrn_reg - Reads register using Kumeran interface
10498cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
10508cfa0ad2SJack F Vogel  *  @offset: the register to read
10518cfa0ad2SJack F Vogel  *  @data: the location to store the 16-bit value read.
10528cfa0ad2SJack F Vogel  *
10538cfa0ad2SJack F Vogel  *  Reads a register out of the Kumeran interface. Currently no func pointer
10548cfa0ad2SJack F Vogel  *  exists and all implementations are handled in the generic version of
10558cfa0ad2SJack F Vogel  *  this function.
10568cfa0ad2SJack F Vogel  **/
10578cfa0ad2SJack F Vogel s32 e1000_read_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 *data)
10588cfa0ad2SJack F Vogel {
10598cfa0ad2SJack F Vogel 	return e1000_read_kmrn_reg_generic(hw, offset, data);
10608cfa0ad2SJack F Vogel }
10618cfa0ad2SJack F Vogel 
10628cfa0ad2SJack F Vogel /**
10638cfa0ad2SJack F Vogel  *  e1000_write_kmrn_reg - Writes register using Kumeran interface
10648cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
10658cfa0ad2SJack F Vogel  *  @offset: the register to write
10668cfa0ad2SJack F Vogel  *  @data: the value to write.
10678cfa0ad2SJack F Vogel  *
10688cfa0ad2SJack F Vogel  *  Writes a register to the Kumeran interface. Currently no func pointer
10698cfa0ad2SJack F Vogel  *  exists and all implementations are handled in the generic version of
10708cfa0ad2SJack F Vogel  *  this function.
10718cfa0ad2SJack F Vogel  **/
10728cfa0ad2SJack F Vogel s32 e1000_write_kmrn_reg(struct e1000_hw *hw, u32 offset, u16 data)
10738cfa0ad2SJack F Vogel {
10748cfa0ad2SJack F Vogel 	return e1000_write_kmrn_reg_generic(hw, offset, data);
10758cfa0ad2SJack F Vogel }
10768cfa0ad2SJack F Vogel 
10778cfa0ad2SJack F Vogel /**
10788cfa0ad2SJack F Vogel  *  e1000_get_cable_length - Retrieves cable length estimation
10798cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
10808cfa0ad2SJack F Vogel  *
10818cfa0ad2SJack F Vogel  *  This function estimates the cable length and stores them in
10828cfa0ad2SJack F Vogel  *  hw->phy.min_length and hw->phy.max_length. This is a function pointer
10838cfa0ad2SJack F Vogel  *  entry point called by drivers.
10848cfa0ad2SJack F Vogel  **/
10858cfa0ad2SJack F Vogel s32 e1000_get_cable_length(struct e1000_hw *hw)
10868cfa0ad2SJack F Vogel {
10878cfa0ad2SJack F Vogel 	if (hw->phy.ops.get_cable_length)
10888cfa0ad2SJack F Vogel 		return hw->phy.ops.get_cable_length(hw);
10898cfa0ad2SJack F Vogel 
10908cfa0ad2SJack F Vogel 	return E1000_SUCCESS;
10918cfa0ad2SJack F Vogel }
10928cfa0ad2SJack F Vogel 
10938cfa0ad2SJack F Vogel /**
10948cfa0ad2SJack F Vogel  *  e1000_get_phy_info - Retrieves PHY information from registers
10958cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
10968cfa0ad2SJack F Vogel  *
10978cfa0ad2SJack F Vogel  *  This function gets some information from various PHY registers and
10988cfa0ad2SJack F Vogel  *  populates hw->phy values with it. This is a function pointer entry
10998cfa0ad2SJack F Vogel  *  point called by drivers.
11008cfa0ad2SJack F Vogel  **/
11018cfa0ad2SJack F Vogel s32 e1000_get_phy_info(struct e1000_hw *hw)
11028cfa0ad2SJack F Vogel {
11038cfa0ad2SJack F Vogel 	if (hw->phy.ops.get_info)
11048cfa0ad2SJack F Vogel 		return hw->phy.ops.get_info(hw);
11058cfa0ad2SJack F Vogel 
11068cfa0ad2SJack F Vogel 	return E1000_SUCCESS;
11078cfa0ad2SJack F Vogel }
11088cfa0ad2SJack F Vogel 
11098cfa0ad2SJack F Vogel /**
11108cfa0ad2SJack F Vogel  *  e1000_phy_hw_reset - Hard PHY reset
11118cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
11128cfa0ad2SJack F Vogel  *
11138cfa0ad2SJack F Vogel  *  Performs a hard PHY reset. This is a function pointer entry point called
11148cfa0ad2SJack F Vogel  *  by drivers.
11158cfa0ad2SJack F Vogel  **/
11168cfa0ad2SJack F Vogel s32 e1000_phy_hw_reset(struct e1000_hw *hw)
11178cfa0ad2SJack F Vogel {
11188cfa0ad2SJack F Vogel 	if (hw->phy.ops.reset)
11198cfa0ad2SJack F Vogel 		return hw->phy.ops.reset(hw);
11208cfa0ad2SJack F Vogel 
11218cfa0ad2SJack F Vogel 	return E1000_SUCCESS;
11228cfa0ad2SJack F Vogel }
11238cfa0ad2SJack F Vogel 
11248cfa0ad2SJack F Vogel /**
11258cfa0ad2SJack F Vogel  *  e1000_phy_commit - Soft PHY reset
11268cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
11278cfa0ad2SJack F Vogel  *
11288cfa0ad2SJack F Vogel  *  Performs a soft PHY reset on those that apply. This is a function pointer
11298cfa0ad2SJack F Vogel  *  entry point called by drivers.
11308cfa0ad2SJack F Vogel  **/
11318cfa0ad2SJack F Vogel s32 e1000_phy_commit(struct e1000_hw *hw)
11328cfa0ad2SJack F Vogel {
11338cfa0ad2SJack F Vogel 	if (hw->phy.ops.commit)
11348cfa0ad2SJack F Vogel 		return hw->phy.ops.commit(hw);
11358cfa0ad2SJack F Vogel 
11368cfa0ad2SJack F Vogel 	return E1000_SUCCESS;
11378cfa0ad2SJack F Vogel }
11388cfa0ad2SJack F Vogel 
11398cfa0ad2SJack F Vogel /**
11408cfa0ad2SJack F Vogel  *  e1000_set_d0_lplu_state - Sets low power link up state for D0
11418cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
11428cfa0ad2SJack F Vogel  *  @active: boolean used to enable/disable lplu
11438cfa0ad2SJack F Vogel  *
11448cfa0ad2SJack F Vogel  *  Success returns 0, Failure returns 1
11458cfa0ad2SJack F Vogel  *
11468cfa0ad2SJack F Vogel  *  The low power link up (lplu) state is set to the power management level D0
11478cfa0ad2SJack F Vogel  *  and SmartSpeed is disabled when active is TRUE, else clear lplu for D0
11488cfa0ad2SJack F Vogel  *  and enable Smartspeed.  LPLU and Smartspeed are mutually exclusive.  LPLU
11498cfa0ad2SJack F Vogel  *  is used during Dx states where the power conservation is most important.
11508cfa0ad2SJack F Vogel  *  During driver activity, SmartSpeed should be enabled so performance is
11518cfa0ad2SJack F Vogel  *  maintained.  This is a function pointer entry point called by drivers.
11528cfa0ad2SJack F Vogel  **/
11538cfa0ad2SJack F Vogel s32 e1000_set_d0_lplu_state(struct e1000_hw *hw, bool active)
11548cfa0ad2SJack F Vogel {
11558cfa0ad2SJack F Vogel 	if (hw->phy.ops.set_d0_lplu_state)
11568cfa0ad2SJack F Vogel 		return hw->phy.ops.set_d0_lplu_state(hw, active);
11578cfa0ad2SJack F Vogel 
11588cfa0ad2SJack F Vogel 	return E1000_SUCCESS;
11598cfa0ad2SJack F Vogel }
11608cfa0ad2SJack F Vogel 
11618cfa0ad2SJack F Vogel /**
11628cfa0ad2SJack F Vogel  *  e1000_set_d3_lplu_state - Sets low power link up state for D3
11638cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
11648cfa0ad2SJack F Vogel  *  @active: boolean used to enable/disable lplu
11658cfa0ad2SJack F Vogel  *
11668cfa0ad2SJack F Vogel  *  Success returns 0, Failure returns 1
11678cfa0ad2SJack F Vogel  *
11688cfa0ad2SJack F Vogel  *  The low power link up (lplu) state is set to the power management level D3
11698cfa0ad2SJack F Vogel  *  and SmartSpeed is disabled when active is TRUE, else clear lplu for D3
11708cfa0ad2SJack F Vogel  *  and enable Smartspeed.  LPLU and Smartspeed are mutually exclusive.  LPLU
11718cfa0ad2SJack F Vogel  *  is used during Dx states where the power conservation is most important.
11728cfa0ad2SJack F Vogel  *  During driver activity, SmartSpeed should be enabled so performance is
11738cfa0ad2SJack F Vogel  *  maintained.  This is a function pointer entry point called by drivers.
11748cfa0ad2SJack F Vogel  **/
11758cfa0ad2SJack F Vogel s32 e1000_set_d3_lplu_state(struct e1000_hw *hw, bool active)
11768cfa0ad2SJack F Vogel {
11778cfa0ad2SJack F Vogel 	if (hw->phy.ops.set_d3_lplu_state)
11788cfa0ad2SJack F Vogel 		return hw->phy.ops.set_d3_lplu_state(hw, active);
11798cfa0ad2SJack F Vogel 
11808cfa0ad2SJack F Vogel 	return E1000_SUCCESS;
11818cfa0ad2SJack F Vogel }
11828cfa0ad2SJack F Vogel 
11838cfa0ad2SJack F Vogel /**
11848cfa0ad2SJack F Vogel  *  e1000_read_mac_addr - Reads MAC address
11858cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
11868cfa0ad2SJack F Vogel  *
11878cfa0ad2SJack F Vogel  *  Reads the MAC address out of the adapter and stores it in the HW structure.
11888cfa0ad2SJack F Vogel  *  Currently no func pointer exists and all implementations are handled in the
11898cfa0ad2SJack F Vogel  *  generic version of this function.
11908cfa0ad2SJack F Vogel  **/
11918cfa0ad2SJack F Vogel s32 e1000_read_mac_addr(struct e1000_hw *hw)
11928cfa0ad2SJack F Vogel {
11938cfa0ad2SJack F Vogel 	if (hw->mac.ops.read_mac_addr)
11948cfa0ad2SJack F Vogel 		return hw->mac.ops.read_mac_addr(hw);
11958cfa0ad2SJack F Vogel 
11968cfa0ad2SJack F Vogel 	return e1000_read_mac_addr_generic(hw);
11978cfa0ad2SJack F Vogel }
11988cfa0ad2SJack F Vogel 
11998cfa0ad2SJack F Vogel /**
12007d9119bdSJack F Vogel  *  e1000_read_pba_string - Read device part number string
12017d9119bdSJack F Vogel  *  @hw: pointer to the HW structure
12027d9119bdSJack F Vogel  *  @pba_num: pointer to device part number
12037d9119bdSJack F Vogel  *  @pba_num_size: size of part number buffer
12047d9119bdSJack F Vogel  *
12057d9119bdSJack F Vogel  *  Reads the product board assembly (PBA) number from the EEPROM and stores
12067d9119bdSJack F Vogel  *  the value in pba_num.
12077d9119bdSJack F Vogel  *  Currently no func pointer exists and all implementations are handled in the
12087d9119bdSJack F Vogel  *  generic version of this function.
12097d9119bdSJack F Vogel  **/
12107d9119bdSJack F Vogel s32 e1000_read_pba_string(struct e1000_hw *hw, u8 *pba_num, u32 pba_num_size)
12117d9119bdSJack F Vogel {
12127d9119bdSJack F Vogel 	return e1000_read_pba_string_generic(hw, pba_num, pba_num_size);
12137d9119bdSJack F Vogel }
12147d9119bdSJack F Vogel 
12157d9119bdSJack F Vogel /**
12167d9119bdSJack F Vogel  *  e1000_read_pba_length - Read device part number string length
12177d9119bdSJack F Vogel  *  @hw: pointer to the HW structure
12187d9119bdSJack F Vogel  *  @pba_num_size: size of part number buffer
12197d9119bdSJack F Vogel  *
12207d9119bdSJack F Vogel  *  Reads the product board assembly (PBA) number length from the EEPROM and
12217d9119bdSJack F Vogel  *  stores the value in pba_num.
12227d9119bdSJack F Vogel  *  Currently no func pointer exists and all implementations are handled in the
12237d9119bdSJack F Vogel  *  generic version of this function.
12247d9119bdSJack F Vogel  **/
12257d9119bdSJack F Vogel s32 e1000_read_pba_length(struct e1000_hw *hw, u32 *pba_num_size)
12267d9119bdSJack F Vogel {
12277d9119bdSJack F Vogel 	return e1000_read_pba_length_generic(hw, pba_num_size);
12287d9119bdSJack F Vogel }
12297d9119bdSJack F Vogel 
12307d9119bdSJack F Vogel /**
12318cfa0ad2SJack F Vogel  *  e1000_validate_nvm_checksum - Verifies NVM (EEPROM) checksum
12328cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
12338cfa0ad2SJack F Vogel  *
12348cfa0ad2SJack F Vogel  *  Validates the NVM checksum is correct. This is a function pointer entry
12358cfa0ad2SJack F Vogel  *  point called by drivers.
12368cfa0ad2SJack F Vogel  **/
12378cfa0ad2SJack F Vogel s32 e1000_validate_nvm_checksum(struct e1000_hw *hw)
12388cfa0ad2SJack F Vogel {
12398cfa0ad2SJack F Vogel 	if (hw->nvm.ops.validate)
12408cfa0ad2SJack F Vogel 		return hw->nvm.ops.validate(hw);
12418cfa0ad2SJack F Vogel 
12428cfa0ad2SJack F Vogel 	return -E1000_ERR_CONFIG;
12438cfa0ad2SJack F Vogel }
12448cfa0ad2SJack F Vogel 
12458cfa0ad2SJack F Vogel /**
12468cfa0ad2SJack F Vogel  *  e1000_update_nvm_checksum - Updates NVM (EEPROM) checksum
12478cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
12488cfa0ad2SJack F Vogel  *
12498cfa0ad2SJack F Vogel  *  Updates the NVM checksum. Currently no func pointer exists and all
12508cfa0ad2SJack F Vogel  *  implementations are handled in the generic version of this function.
12518cfa0ad2SJack F Vogel  **/
12528cfa0ad2SJack F Vogel s32 e1000_update_nvm_checksum(struct e1000_hw *hw)
12538cfa0ad2SJack F Vogel {
12548cfa0ad2SJack F Vogel 	if (hw->nvm.ops.update)
12558cfa0ad2SJack F Vogel 		return hw->nvm.ops.update(hw);
12568cfa0ad2SJack F Vogel 
12578cfa0ad2SJack F Vogel 	return -E1000_ERR_CONFIG;
12588cfa0ad2SJack F Vogel }
12598cfa0ad2SJack F Vogel 
12608cfa0ad2SJack F Vogel /**
12618cfa0ad2SJack F Vogel  *  e1000_reload_nvm - Reloads EEPROM
12628cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
12638cfa0ad2SJack F Vogel  *
12648cfa0ad2SJack F Vogel  *  Reloads the EEPROM by setting the "Reinitialize from EEPROM" bit in the
12658cfa0ad2SJack F Vogel  *  extended control register.
12668cfa0ad2SJack F Vogel  **/
12678cfa0ad2SJack F Vogel void e1000_reload_nvm(struct e1000_hw *hw)
12688cfa0ad2SJack F Vogel {
12698cfa0ad2SJack F Vogel 	if (hw->nvm.ops.reload)
12708cfa0ad2SJack F Vogel 		hw->nvm.ops.reload(hw);
12718cfa0ad2SJack F Vogel }
12728cfa0ad2SJack F Vogel 
12738cfa0ad2SJack F Vogel /**
12748cfa0ad2SJack F Vogel  *  e1000_read_nvm - Reads NVM (EEPROM)
12758cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
12768cfa0ad2SJack F Vogel  *  @offset: the word offset to read
12778cfa0ad2SJack F Vogel  *  @words: number of 16-bit words to read
12788cfa0ad2SJack F Vogel  *  @data: pointer to the properly sized buffer for the data.
12798cfa0ad2SJack F Vogel  *
12808cfa0ad2SJack F Vogel  *  Reads 16-bit chunks of data from the NVM (EEPROM). This is a function
12818cfa0ad2SJack F Vogel  *  pointer entry point called by drivers.
12828cfa0ad2SJack F Vogel  **/
12838cfa0ad2SJack F Vogel s32 e1000_read_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
12848cfa0ad2SJack F Vogel {
12858cfa0ad2SJack F Vogel 	if (hw->nvm.ops.read)
12868cfa0ad2SJack F Vogel 		return hw->nvm.ops.read(hw, offset, words, data);
12878cfa0ad2SJack F Vogel 
12888cfa0ad2SJack F Vogel 	return -E1000_ERR_CONFIG;
12898cfa0ad2SJack F Vogel }
12908cfa0ad2SJack F Vogel 
12918cfa0ad2SJack F Vogel /**
12928cfa0ad2SJack F Vogel  *  e1000_write_nvm - Writes to NVM (EEPROM)
12938cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
12948cfa0ad2SJack F Vogel  *  @offset: the word offset to read
12958cfa0ad2SJack F Vogel  *  @words: number of 16-bit words to write
12968cfa0ad2SJack F Vogel  *  @data: pointer to the properly sized buffer for the data.
12978cfa0ad2SJack F Vogel  *
12988cfa0ad2SJack F Vogel  *  Writes 16-bit chunks of data to the NVM (EEPROM). This is a function
12998cfa0ad2SJack F Vogel  *  pointer entry point called by drivers.
13008cfa0ad2SJack F Vogel  **/
13018cfa0ad2SJack F Vogel s32 e1000_write_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
13028cfa0ad2SJack F Vogel {
13038cfa0ad2SJack F Vogel 	if (hw->nvm.ops.write)
13048cfa0ad2SJack F Vogel 		return hw->nvm.ops.write(hw, offset, words, data);
13058cfa0ad2SJack F Vogel 
13068cfa0ad2SJack F Vogel 	return E1000_SUCCESS;
13078cfa0ad2SJack F Vogel }
13088cfa0ad2SJack F Vogel 
13098cfa0ad2SJack F Vogel /**
13108cfa0ad2SJack F Vogel  *  e1000_write_8bit_ctrl_reg - Writes 8bit Control register
13118cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
13128cfa0ad2SJack F Vogel  *  @reg: 32bit register offset
13138cfa0ad2SJack F Vogel  *  @offset: the register to write
13148cfa0ad2SJack F Vogel  *  @data: the value to write.
13158cfa0ad2SJack F Vogel  *
13168cfa0ad2SJack F Vogel  *  Writes the PHY register at offset with the value in data.
13178cfa0ad2SJack F Vogel  *  This is a function pointer entry point called by drivers.
13188cfa0ad2SJack F Vogel  **/
13198cfa0ad2SJack F Vogel s32 e1000_write_8bit_ctrl_reg(struct e1000_hw *hw, u32 reg, u32 offset,
13208cfa0ad2SJack F Vogel 			      u8 data)
13218cfa0ad2SJack F Vogel {
13228cfa0ad2SJack F Vogel 	return e1000_write_8bit_ctrl_reg_generic(hw, reg, offset, data);
13238cfa0ad2SJack F Vogel }
13248cfa0ad2SJack F Vogel 
13258cfa0ad2SJack F Vogel /**
13268cfa0ad2SJack F Vogel  * e1000_power_up_phy - Restores link in case of PHY power down
13278cfa0ad2SJack F Vogel  * @hw: pointer to the HW structure
13288cfa0ad2SJack F Vogel  *
13298cfa0ad2SJack F Vogel  * The phy may be powered down to save power, to turn off link when the
13308cfa0ad2SJack F Vogel  * driver is unloaded, or wake on lan is not enabled (among others).
13318cfa0ad2SJack F Vogel  **/
13328cfa0ad2SJack F Vogel void e1000_power_up_phy(struct e1000_hw *hw)
13338cfa0ad2SJack F Vogel {
13348cfa0ad2SJack F Vogel 	if (hw->phy.ops.power_up)
13358cfa0ad2SJack F Vogel 		hw->phy.ops.power_up(hw);
13368cfa0ad2SJack F Vogel 
13378cfa0ad2SJack F Vogel 	e1000_setup_link(hw);
13388cfa0ad2SJack F Vogel }
13398cfa0ad2SJack F Vogel 
13408cfa0ad2SJack F Vogel /**
13418cfa0ad2SJack F Vogel  * e1000_power_down_phy - Power down PHY
13428cfa0ad2SJack F Vogel  * @hw: pointer to the HW structure
13438cfa0ad2SJack F Vogel  *
13448cfa0ad2SJack F Vogel  * The phy may be powered down to save power, to turn off link when the
13458cfa0ad2SJack F Vogel  * driver is unloaded, or wake on lan is not enabled (among others).
13468cfa0ad2SJack F Vogel  **/
13478cfa0ad2SJack F Vogel void e1000_power_down_phy(struct e1000_hw *hw)
13488cfa0ad2SJack F Vogel {
13498cfa0ad2SJack F Vogel 	if (hw->phy.ops.power_down)
13508cfa0ad2SJack F Vogel 		hw->phy.ops.power_down(hw);
13518cfa0ad2SJack F Vogel }
13528cfa0ad2SJack F Vogel 
13538cfa0ad2SJack F Vogel /**
1354a69ed8dfSJack F Vogel  *  e1000_power_up_fiber_serdes_link - Power up serdes link
1355a69ed8dfSJack F Vogel  *  @hw: pointer to the HW structure
1356a69ed8dfSJack F Vogel  *
1357a69ed8dfSJack F Vogel  *  Power on the optics and PCS.
1358a69ed8dfSJack F Vogel  **/
1359a69ed8dfSJack F Vogel void e1000_power_up_fiber_serdes_link(struct e1000_hw *hw)
1360a69ed8dfSJack F Vogel {
1361a69ed8dfSJack F Vogel 	if (hw->mac.ops.power_up_serdes)
1362a69ed8dfSJack F Vogel 		hw->mac.ops.power_up_serdes(hw);
1363a69ed8dfSJack F Vogel }
1364a69ed8dfSJack F Vogel 
1365a69ed8dfSJack F Vogel /**
13668cfa0ad2SJack F Vogel  *  e1000_shutdown_fiber_serdes_link - Remove link during power down
13678cfa0ad2SJack F Vogel  *  @hw: pointer to the HW structure
13688cfa0ad2SJack F Vogel  *
13698cfa0ad2SJack F Vogel  *  Shutdown the optics and PCS on driver unload.
13708cfa0ad2SJack F Vogel  **/
13718cfa0ad2SJack F Vogel void e1000_shutdown_fiber_serdes_link(struct e1000_hw *hw)
13728cfa0ad2SJack F Vogel {
13738cfa0ad2SJack F Vogel 	if (hw->mac.ops.shutdown_serdes)
13748cfa0ad2SJack F Vogel 		hw->mac.ops.shutdown_serdes(hw);
13758cfa0ad2SJack F Vogel }
13768cfa0ad2SJack F Vogel 
1377