xref: /onnv-gate/usr/src/uts/common/io/ixgbe/ixgbe_api.c (revision 13006:22e6d3edaab5)
16621Sbt150084 /*
26621Sbt150084  * CDDL HEADER START
36621Sbt150084  *
46621Sbt150084  * The contents of this file are subject to the terms of the
56621Sbt150084  * Common Development and Distribution License (the "License").
66621Sbt150084  * You may not use this file except in compliance with the License.
76621Sbt150084  *
86621Sbt150084  * You can obtain a copy of the license at:
96621Sbt150084  *      http://www.opensolaris.org/os/licensing.
106621Sbt150084  * See the License for the specific language governing permissions
116621Sbt150084  * and limitations under the License.
126621Sbt150084  *
136621Sbt150084  * When using or redistributing this file, you may do so under the
146621Sbt150084  * License only. No other modification of this header is permitted.
156621Sbt150084  *
166621Sbt150084  * If applicable, add the following below this CDDL HEADER, with the
176621Sbt150084  * fields enclosed by brackets "[]" replaced with your own identifying
186621Sbt150084  * information: Portions Copyright [yyyy] [name of copyright owner]
196621Sbt150084  *
206621Sbt150084  * CDDL HEADER END
216621Sbt150084  */
226621Sbt150084 
236621Sbt150084 /*
24*13006SChenlu.Chen@Sun.COM  * Copyright(c) 2007-2010 Intel Corporation. All rights reserved.
256621Sbt150084  */
266621Sbt150084 
27*13006SChenlu.Chen@Sun.COM /*
28*13006SChenlu.Chen@Sun.COM  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
29*13006SChenlu.Chen@Sun.COM  */
30*13006SChenlu.Chen@Sun.COM 
31*13006SChenlu.Chen@Sun.COM /* IntelVersion: 1.140 scm_061610_003709 */
326621Sbt150084 
336621Sbt150084 #include "ixgbe_api.h"
346621Sbt150084 #include "ixgbe_common.h"
356621Sbt150084 
366621Sbt150084 extern s32 ixgbe_init_ops_82598(struct ixgbe_hw *hw);
379353SSamuel.Tu@Sun.COM extern s32 ixgbe_init_ops_82599(struct ixgbe_hw *hw);
386621Sbt150084 
396621Sbt150084 /*
406621Sbt150084  * ixgbe_init_shared_code - Initialize the shared code
416621Sbt150084  * @hw: pointer to hardware structure
426621Sbt150084  *
436621Sbt150084  * This will assign function pointers and assign the MAC type and PHY code.
446621Sbt150084  * Does not touch the hardware. This function must be called prior to any
456621Sbt150084  * other function in the shared code. The ixgbe_hw structure should be
466621Sbt150084  * memset to 0 prior to calling this function.  The following fields in
476621Sbt150084  * hw structure should be filled in prior to calling this function:
486621Sbt150084  * hw_addr, back, device_id, vendor_id, subsystem_device_id,
499353SSamuel.Tu@Sun.COM  * subsystem_vendor_id, and revision_id
506621Sbt150084  */
516621Sbt150084 s32
ixgbe_init_shared_code(struct ixgbe_hw * hw)526621Sbt150084 ixgbe_init_shared_code(struct ixgbe_hw *hw)
536621Sbt150084 {
546621Sbt150084 	s32 status;
556621Sbt150084 
5610998SChenlu.Chen@Sun.COM 	DEBUGFUNC("ixgbe_init_shared_code");
5710998SChenlu.Chen@Sun.COM 
586621Sbt150084 	/*
596621Sbt150084 	 * Set the mac type
606621Sbt150084 	 */
616621Sbt150084 	(void) ixgbe_set_mac_type(hw);
626621Sbt150084 
636621Sbt150084 	switch (hw->mac.type) {
646621Sbt150084 	case ixgbe_mac_82598EB:
656621Sbt150084 		status = ixgbe_init_ops_82598(hw);
666621Sbt150084 		break;
679353SSamuel.Tu@Sun.COM 	case ixgbe_mac_82599EB:
689353SSamuel.Tu@Sun.COM 		status = ixgbe_init_ops_82599(hw);
699353SSamuel.Tu@Sun.COM 		break;
706621Sbt150084 	default:
716621Sbt150084 		status = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
726621Sbt150084 		break;
736621Sbt150084 	}
746621Sbt150084 
756621Sbt150084 	return (status);
766621Sbt150084 }
776621Sbt150084 
786621Sbt150084 /*
796621Sbt150084  * ixgbe_set_mac_type - Sets MAC type
806621Sbt150084  * @hw: pointer to the HW structure
816621Sbt150084  *
826621Sbt150084  * This function sets the mac type of the adapter based on the
836621Sbt150084  * vendor ID and device ID stored in the hw structure.
846621Sbt150084  */
856621Sbt150084 s32
ixgbe_set_mac_type(struct ixgbe_hw * hw)866621Sbt150084 ixgbe_set_mac_type(struct ixgbe_hw *hw)
876621Sbt150084 {
886621Sbt150084 	s32 ret_val = IXGBE_SUCCESS;
896621Sbt150084 
908490SPaul.Guo@Sun.COM 	DEBUGFUNC("ixgbe_set_mac_type\n");
916621Sbt150084 
926621Sbt150084 	if (hw->vendor_id == IXGBE_INTEL_VENDOR_ID) {
936621Sbt150084 		switch (hw->device_id) {
949353SSamuel.Tu@Sun.COM 		case IXGBE_DEV_ID_82598:
959353SSamuel.Tu@Sun.COM 		case IXGBE_DEV_ID_82598_BX:
966621Sbt150084 		case IXGBE_DEV_ID_82598AF_SINGLE_PORT:
976621Sbt150084 		case IXGBE_DEV_ID_82598AF_DUAL_PORT:
988490SPaul.Guo@Sun.COM 		case IXGBE_DEV_ID_82598AT:
9910998SChenlu.Chen@Sun.COM 		case IXGBE_DEV_ID_82598AT2:
1006621Sbt150084 		case IXGBE_DEV_ID_82598EB_CX4:
1016621Sbt150084 		case IXGBE_DEV_ID_82598_CX4_DUAL_PORT:
1028490SPaul.Guo@Sun.COM 		case IXGBE_DEV_ID_82598_DA_DUAL_PORT:
1038490SPaul.Guo@Sun.COM 		case IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM:
1046621Sbt150084 		case IXGBE_DEV_ID_82598EB_XF_LR:
1058490SPaul.Guo@Sun.COM 		case IXGBE_DEV_ID_82598EB_SFP_LOM:
1066621Sbt150084 			hw->mac.type = ixgbe_mac_82598EB;
1076621Sbt150084 			break;
1089353SSamuel.Tu@Sun.COM 		case IXGBE_DEV_ID_82599_KX4:
10910998SChenlu.Chen@Sun.COM 		case IXGBE_DEV_ID_82599_KX4_MEZZ:
11010305SPaul.Guo@Sun.COM 		case IXGBE_DEV_ID_82599_XAUI_LOM:
11110998SChenlu.Chen@Sun.COM 		case IXGBE_DEV_ID_82599_COMBO_BACKPLANE:
11212003SPaul.Guo@Sun.COM 		case IXGBE_DEV_ID_82599_KR:
1139353SSamuel.Tu@Sun.COM 		case IXGBE_DEV_ID_82599_SFP:
11410998SChenlu.Chen@Sun.COM 		case IXGBE_DEV_ID_82599_SFP_EM:
1159353SSamuel.Tu@Sun.COM 		case IXGBE_DEV_ID_82599_CX4:
116*13006SChenlu.Chen@Sun.COM 		case IXGBE_DEV_ID_82599_T3_LOM:
1179353SSamuel.Tu@Sun.COM 			hw->mac.type = ixgbe_mac_82599EB;
1189353SSamuel.Tu@Sun.COM 			break;
1196621Sbt150084 		default:
1206621Sbt150084 			ret_val = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
1216621Sbt150084 			break;
1226621Sbt150084 		}
1236621Sbt150084 	} else {
1246621Sbt150084 		ret_val = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
1256621Sbt150084 	}
1266621Sbt150084 
1278490SPaul.Guo@Sun.COM 	DEBUGOUT2("ixgbe_set_mac_type found mac: %d, returns: %d\n",
1288490SPaul.Guo@Sun.COM 	    hw->mac.type, ret_val);
1298490SPaul.Guo@Sun.COM 
1306621Sbt150084 	return (ret_val);
1316621Sbt150084 }
1326621Sbt150084 
1336621Sbt150084 /*
1346621Sbt150084  * ixgbe_init_hw - Initialize the hardware
1356621Sbt150084  * @hw: pointer to hardware structure
1366621Sbt150084  *
1376621Sbt150084  * Initialize the hardware by resetting and then starting the hardware
1386621Sbt150084  */
1396621Sbt150084 s32
ixgbe_init_hw(struct ixgbe_hw * hw)1406621Sbt150084 ixgbe_init_hw(struct ixgbe_hw *hw)
1416621Sbt150084 {
1426621Sbt150084 	return ixgbe_call_func(hw, hw->mac.ops.init_hw, (hw),
1436621Sbt150084 	    IXGBE_NOT_IMPLEMENTED);
1446621Sbt150084 }
1456621Sbt150084 
1466621Sbt150084 /*
1476621Sbt150084  * ixgbe_reset_hw - Performs a hardware reset
1486621Sbt150084  * @hw: pointer to hardware structure
1496621Sbt150084  *
1506621Sbt150084  * Resets the hardware by resetting the transmit and receive units, masks and
1516621Sbt150084  * clears all interrupts, performs a PHY reset, and performs a MAC reset
1526621Sbt150084  */
1536621Sbt150084 s32
ixgbe_reset_hw(struct ixgbe_hw * hw)1546621Sbt150084 ixgbe_reset_hw(struct ixgbe_hw *hw)
1556621Sbt150084 {
1566621Sbt150084 	return ixgbe_call_func(hw, hw->mac.ops.reset_hw, (hw),
1576621Sbt150084 	    IXGBE_NOT_IMPLEMENTED);
1586621Sbt150084 }
1596621Sbt150084 
1606621Sbt150084 /*
1616621Sbt150084  * ixgbe_start_hw - Prepares hardware for Rx/Tx
1626621Sbt150084  * @hw: pointer to hardware structure
1636621Sbt150084  *
1646621Sbt150084  * Starts the hardware by filling the bus info structure and media type,
1656621Sbt150084  * clears all on chip counters, initializes receive address registers,
1666621Sbt150084  * multicast table, VLAN filter table, calls routine to setup link and
1676621Sbt150084  * flow control settings, and leaves transmit and receive units disabled
1686621Sbt150084  * and uninitialized.
1696621Sbt150084  */
1706621Sbt150084 s32
ixgbe_start_hw(struct ixgbe_hw * hw)1716621Sbt150084 ixgbe_start_hw(struct ixgbe_hw *hw)
1726621Sbt150084 {
1736621Sbt150084 	return ixgbe_call_func(hw, hw->mac.ops.start_hw, (hw),
1746621Sbt150084 	    IXGBE_NOT_IMPLEMENTED);
1756621Sbt150084 }
1766621Sbt150084 
1776621Sbt150084 /*
17812003SPaul.Guo@Sun.COM  * ixgbe_enable_relaxed_ordering - Enables tx relaxed ordering,
17912003SPaul.Guo@Sun.COM  * which is disabled by default in ixgbe_start_hw();
18012003SPaul.Guo@Sun.COM  *
18112003SPaul.Guo@Sun.COM  * @hw: pointer to hardware structure
18212003SPaul.Guo@Sun.COM  *
18312003SPaul.Guo@Sun.COM  * Enable relaxed ordering;
18412003SPaul.Guo@Sun.COM  */
18512003SPaul.Guo@Sun.COM void
ixgbe_enable_relaxed_ordering(struct ixgbe_hw * hw)18612003SPaul.Guo@Sun.COM ixgbe_enable_relaxed_ordering(struct ixgbe_hw *hw)
18712003SPaul.Guo@Sun.COM {
18812003SPaul.Guo@Sun.COM 	if (hw->mac.ops.enable_relaxed_ordering)
18912003SPaul.Guo@Sun.COM 		hw->mac.ops.enable_relaxed_ordering(hw);
19012003SPaul.Guo@Sun.COM }
19112003SPaul.Guo@Sun.COM 
19212003SPaul.Guo@Sun.COM /*
1936621Sbt150084  * ixgbe_clear_hw_cntrs - Clear hardware counters
1946621Sbt150084  * @hw: pointer to hardware structure
1956621Sbt150084  *
1966621Sbt150084  * Clears all hardware statistics counters by reading them from the hardware
1976621Sbt150084  * Statistics counters are clear on read.
1986621Sbt150084  */
1996621Sbt150084 s32
ixgbe_clear_hw_cntrs(struct ixgbe_hw * hw)2006621Sbt150084 ixgbe_clear_hw_cntrs(struct ixgbe_hw *hw)
2016621Sbt150084 {
2026621Sbt150084 	return ixgbe_call_func(hw, hw->mac.ops.clear_hw_cntrs, (hw),
2036621Sbt150084 	    IXGBE_NOT_IMPLEMENTED);
2046621Sbt150084 }
2056621Sbt150084 
2066621Sbt150084 /*
2076621Sbt150084  * ixgbe_get_media_type - Get media type
2086621Sbt150084  * @hw: pointer to hardware structure
2096621Sbt150084  *
2106621Sbt150084  * Returns the media type (fiber, copper, backplane)
2116621Sbt150084  */
2126621Sbt150084 enum ixgbe_media_type
ixgbe_get_media_type(struct ixgbe_hw * hw)2136621Sbt150084 ixgbe_get_media_type(struct ixgbe_hw *hw)
2146621Sbt150084 {
2156621Sbt150084 	return ixgbe_call_func(hw, hw->mac.ops.get_media_type, (hw),
2166621Sbt150084 	    ixgbe_media_type_unknown);
2176621Sbt150084 }
2186621Sbt150084 
2196621Sbt150084 /*
2206621Sbt150084  * ixgbe_get_mac_addr - Get MAC address
2216621Sbt150084  * @hw: pointer to hardware structure
2226621Sbt150084  * @mac_addr: Adapter MAC address
2236621Sbt150084  *
2246621Sbt150084  * Reads the adapter's MAC address from the first Receive Address Register
2256621Sbt150084  * (RAR0) A reset of the adapter must have been performed prior to calling
2266621Sbt150084  * this function in order for the MAC address to have been loaded from the
2276621Sbt150084  * EEPROM into RAR0
2286621Sbt150084  */
2296621Sbt150084 s32
ixgbe_get_mac_addr(struct ixgbe_hw * hw,u8 * mac_addr)2306621Sbt150084 ixgbe_get_mac_addr(struct ixgbe_hw *hw, u8 *mac_addr)
2316621Sbt150084 {
2326621Sbt150084 	return ixgbe_call_func(hw, hw->mac.ops.get_mac_addr,
2336621Sbt150084 	    (hw, mac_addr), IXGBE_NOT_IMPLEMENTED);
2346621Sbt150084 }
2356621Sbt150084 
2366621Sbt150084 /*
2379353SSamuel.Tu@Sun.COM  * ixgbe_get_san_mac_addr - Get SAN MAC address
2389353SSamuel.Tu@Sun.COM  * @hw: pointer to hardware structure
2399353SSamuel.Tu@Sun.COM  * @san_mac_addr: SAN MAC address
2409353SSamuel.Tu@Sun.COM  *
2419353SSamuel.Tu@Sun.COM  * Reads the SAN MAC address from the EEPROM, if it's available.  This is
2429353SSamuel.Tu@Sun.COM  * per-port, so set_lan_id() must be called before reading the addresses.
2439353SSamuel.Tu@Sun.COM  */
2449353SSamuel.Tu@Sun.COM s32
ixgbe_get_san_mac_addr(struct ixgbe_hw * hw,u8 * san_mac_addr)2459353SSamuel.Tu@Sun.COM ixgbe_get_san_mac_addr(struct ixgbe_hw *hw, u8 *san_mac_addr)
2469353SSamuel.Tu@Sun.COM {
2479353SSamuel.Tu@Sun.COM 	return ixgbe_call_func(hw, hw->mac.ops.get_san_mac_addr,
2489353SSamuel.Tu@Sun.COM 	    (hw, san_mac_addr), IXGBE_NOT_IMPLEMENTED);
2499353SSamuel.Tu@Sun.COM }
2509353SSamuel.Tu@Sun.COM 
2519353SSamuel.Tu@Sun.COM /*
2529353SSamuel.Tu@Sun.COM  * ixgbe_set_san_mac_addr - Write a SAN MAC address
2539353SSamuel.Tu@Sun.COM  * @hw: pointer to hardware structure
2549353SSamuel.Tu@Sun.COM  * @san_mac_addr: SAN MAC address
2559353SSamuel.Tu@Sun.COM  *
2569353SSamuel.Tu@Sun.COM  * Writes A SAN MAC address to the EEPROM.
2579353SSamuel.Tu@Sun.COM  */
2589353SSamuel.Tu@Sun.COM s32
ixgbe_set_san_mac_addr(struct ixgbe_hw * hw,u8 * san_mac_addr)2599353SSamuel.Tu@Sun.COM ixgbe_set_san_mac_addr(struct ixgbe_hw *hw, u8 *san_mac_addr)
2609353SSamuel.Tu@Sun.COM {
2619353SSamuel.Tu@Sun.COM 	return ixgbe_call_func(hw, hw->mac.ops.set_san_mac_addr,
2629353SSamuel.Tu@Sun.COM 	    (hw, san_mac_addr), IXGBE_NOT_IMPLEMENTED);
2639353SSamuel.Tu@Sun.COM }
2649353SSamuel.Tu@Sun.COM 
2659353SSamuel.Tu@Sun.COM /*
2669353SSamuel.Tu@Sun.COM  * ixgbe_get_device_caps - Get additional device capabilities
2679353SSamuel.Tu@Sun.COM  * @hw: pointer to hardware structure
2689353SSamuel.Tu@Sun.COM  * @device_caps: the EEPROM word for device capabilities
2699353SSamuel.Tu@Sun.COM  *
2709353SSamuel.Tu@Sun.COM  * Reads the extra device capabilities from the EEPROM
2719353SSamuel.Tu@Sun.COM  */
2729353SSamuel.Tu@Sun.COM s32
ixgbe_get_device_caps(struct ixgbe_hw * hw,u16 * device_caps)2739353SSamuel.Tu@Sun.COM ixgbe_get_device_caps(struct ixgbe_hw *hw, u16 *device_caps)
2749353SSamuel.Tu@Sun.COM {
2759353SSamuel.Tu@Sun.COM 	return ixgbe_call_func(hw, hw->mac.ops.get_device_caps,
2769353SSamuel.Tu@Sun.COM 	    (hw, device_caps), IXGBE_NOT_IMPLEMENTED);
2779353SSamuel.Tu@Sun.COM }
2789353SSamuel.Tu@Sun.COM 
2799353SSamuel.Tu@Sun.COM /*
28010998SChenlu.Chen@Sun.COM  * ixgbe_get_wwn_prefix - Get alternative WWNN/WWPN prefix from the EEPROM
28110998SChenlu.Chen@Sun.COM  * @hw: pointer to hardware structure
28210998SChenlu.Chen@Sun.COM  * @wwnn_prefix: the alternative WWNN prefix
28310998SChenlu.Chen@Sun.COM  * @wwpn_prefix: the alternative WWPN prefix
28410998SChenlu.Chen@Sun.COM  *
28510998SChenlu.Chen@Sun.COM  * This function will read the EEPROM from the alternative SAN MAC address
28610998SChenlu.Chen@Sun.COM  * block to check the support for the alternative WWNN/WWPN prefix support.
28710998SChenlu.Chen@Sun.COM  */
28810998SChenlu.Chen@Sun.COM s32
ixgbe_get_wwn_prefix(struct ixgbe_hw * hw,u16 * wwnn_prefix,u16 * wwpn_prefix)28910998SChenlu.Chen@Sun.COM ixgbe_get_wwn_prefix(struct ixgbe_hw *hw, u16 *wwnn_prefix, u16 *wwpn_prefix)
29010998SChenlu.Chen@Sun.COM {
29110998SChenlu.Chen@Sun.COM 	return ixgbe_call_func(hw, hw->mac.ops.get_wwn_prefix,
29210998SChenlu.Chen@Sun.COM 	    (hw, wwnn_prefix, wwpn_prefix), IXGBE_NOT_IMPLEMENTED);
29310998SChenlu.Chen@Sun.COM }
29410998SChenlu.Chen@Sun.COM 
29510998SChenlu.Chen@Sun.COM /*
296*13006SChenlu.Chen@Sun.COM  * ixgbe_get_fcoe_boot_status -  Get FCOE boot status from EEPROM
297*13006SChenlu.Chen@Sun.COM  * @hw: pointer to hardware structure
298*13006SChenlu.Chen@Sun.COM  * @bs: the fcoe boot status
299*13006SChenlu.Chen@Sun.COM  *
300*13006SChenlu.Chen@Sun.COM  * This function will read the FCOE boot status from the iSCSI FCOE block
301*13006SChenlu.Chen@Sun.COM  */
302*13006SChenlu.Chen@Sun.COM s32
ixgbe_get_fcoe_boot_status(struct ixgbe_hw * hw,u16 * bs)303*13006SChenlu.Chen@Sun.COM ixgbe_get_fcoe_boot_status(struct ixgbe_hw *hw, u16 *bs)
304*13006SChenlu.Chen@Sun.COM {
305*13006SChenlu.Chen@Sun.COM 	return ixgbe_call_func(hw, hw->mac.ops.get_fcoe_boot_status,
306*13006SChenlu.Chen@Sun.COM 	    (hw, bs), IXGBE_NOT_IMPLEMENTED);
307*13006SChenlu.Chen@Sun.COM }
308*13006SChenlu.Chen@Sun.COM 
309*13006SChenlu.Chen@Sun.COM /*
3106621Sbt150084  * ixgbe_get_bus_info - Set PCI bus info
3116621Sbt150084  * @hw: pointer to hardware structure
3126621Sbt150084  *
3136621Sbt150084  * Sets the PCI bus info (speed, width, type) within the ixgbe_hw structure
3146621Sbt150084  */
3156621Sbt150084 s32
ixgbe_get_bus_info(struct ixgbe_hw * hw)3166621Sbt150084 ixgbe_get_bus_info(struct ixgbe_hw *hw)
3176621Sbt150084 {
3186621Sbt150084 	return ixgbe_call_func(hw, hw->mac.ops.get_bus_info, (hw),
3196621Sbt150084 	    IXGBE_NOT_IMPLEMENTED);
3206621Sbt150084 }
3216621Sbt150084 
3226621Sbt150084 /*
3236621Sbt150084  * ixgbe_get_num_of_tx_queues - Get Tx queues
3246621Sbt150084  * @hw: pointer to hardware structure
3256621Sbt150084  *
3266621Sbt150084  * Returns the number of transmit queues for the given adapter.
3276621Sbt150084  */
3286621Sbt150084 u32
ixgbe_get_num_of_tx_queues(struct ixgbe_hw * hw)3296621Sbt150084 ixgbe_get_num_of_tx_queues(struct ixgbe_hw *hw)
3306621Sbt150084 {
3316621Sbt150084 	return (hw->mac.max_tx_queues);
3326621Sbt150084 }
3336621Sbt150084 
3346621Sbt150084 /*
3356621Sbt150084  * ixgbe_get_num_of_rx_queues - Get Rx queues
3366621Sbt150084  * @hw: pointer to hardware structure
3376621Sbt150084  *
3386621Sbt150084  * Returns the number of receive queues for the given adapter.
3396621Sbt150084  */
3406621Sbt150084 u32
ixgbe_get_num_of_rx_queues(struct ixgbe_hw * hw)3416621Sbt150084 ixgbe_get_num_of_rx_queues(struct ixgbe_hw *hw)
3426621Sbt150084 {
3436621Sbt150084 	return (hw->mac.max_rx_queues);
3446621Sbt150084 }
3456621Sbt150084 
3466621Sbt150084 /*
3476621Sbt150084  * ixgbe_stop_adapter - Disable Rx/Tx units
3486621Sbt150084  * @hw: pointer to hardware structure
3496621Sbt150084  *
3506621Sbt150084  * Sets the adapter_stopped flag within ixgbe_hw struct. Clears interrupts,
3516621Sbt150084  * disables transmit and receive units. The adapter_stopped flag is used by
3526621Sbt150084  * the shared code and drivers to determine if the adapter is in a stopped
3536621Sbt150084  * state and should not touch the hardware.
3546621Sbt150084  */
3556621Sbt150084 s32
ixgbe_stop_adapter(struct ixgbe_hw * hw)3566621Sbt150084 ixgbe_stop_adapter(struct ixgbe_hw *hw)
3576621Sbt150084 {
3586621Sbt150084 	return ixgbe_call_func(hw, hw->mac.ops.stop_adapter, (hw),
3596621Sbt150084 	    IXGBE_NOT_IMPLEMENTED);
3606621Sbt150084 }
3616621Sbt150084 
3626621Sbt150084 /*
3636621Sbt150084  * ixgbe_read_pba_num - Reads part number from EEPROM
3646621Sbt150084  * @hw: pointer to hardware structure
3656621Sbt150084  * @pba_num: stores the part number from the EEPROM
3666621Sbt150084  *
3676621Sbt150084  * Reads the part number from the EEPROM.
3686621Sbt150084  */
3696621Sbt150084 s32
ixgbe_read_pba_num(struct ixgbe_hw * hw,u32 * pba_num)3706621Sbt150084 ixgbe_read_pba_num(struct ixgbe_hw *hw, u32 *pba_num)
3716621Sbt150084 {
3726621Sbt150084 	return (ixgbe_read_pba_num_generic(hw, pba_num));
3736621Sbt150084 }
3746621Sbt150084 
3756621Sbt150084 /*
3766621Sbt150084  * ixgbe_identify_phy - Get PHY type
3776621Sbt150084  * @hw: pointer to hardware structure
3786621Sbt150084  *
3796621Sbt150084  * Determines the physical layer module found on the current adapter.
3806621Sbt150084  */
3816621Sbt150084 s32
ixgbe_identify_phy(struct ixgbe_hw * hw)3826621Sbt150084 ixgbe_identify_phy(struct ixgbe_hw *hw)
3836621Sbt150084 {
3846621Sbt150084 	s32 status = IXGBE_SUCCESS;
3856621Sbt150084 
3866621Sbt150084 	if (hw->phy.type == ixgbe_phy_unknown) {
3876621Sbt150084 		status = ixgbe_call_func(hw,
3886621Sbt150084 		    hw->phy.ops.identify,
3896621Sbt150084 		    (hw),
3906621Sbt150084 		    IXGBE_NOT_IMPLEMENTED);
3916621Sbt150084 	}
3926621Sbt150084 
3936621Sbt150084 	return (status);
3946621Sbt150084 }
3956621Sbt150084 
3966621Sbt150084 /*
3976621Sbt150084  * ixgbe_reset_phy - Perform a PHY reset
3986621Sbt150084  * @hw: pointer to hardware structure
3996621Sbt150084  */
4006621Sbt150084 s32
ixgbe_reset_phy(struct ixgbe_hw * hw)4016621Sbt150084 ixgbe_reset_phy(struct ixgbe_hw *hw)
4026621Sbt150084 {
4036621Sbt150084 	s32 status = IXGBE_SUCCESS;
4046621Sbt150084 
4056621Sbt150084 	if (hw->phy.type == ixgbe_phy_unknown) {
4066621Sbt150084 		if (ixgbe_identify_phy(hw) != IXGBE_SUCCESS) {
4076621Sbt150084 			status = IXGBE_ERR_PHY;
4086621Sbt150084 		}
4096621Sbt150084 	}
4106621Sbt150084 
4116621Sbt150084 	if (status == IXGBE_SUCCESS) {
4126621Sbt150084 		status = ixgbe_call_func(hw, hw->phy.ops.reset, (hw),
4136621Sbt150084 		    IXGBE_NOT_IMPLEMENTED);
4146621Sbt150084 	}
4156621Sbt150084 	return (status);
4166621Sbt150084 }
4176621Sbt150084 
4186621Sbt150084 /*
4198490SPaul.Guo@Sun.COM  * ixgbe_get_phy_firmware_version -
4208490SPaul.Guo@Sun.COM  * @hw: pointer to hardware structure
4218490SPaul.Guo@Sun.COM  * @firmware_version: pointer to firmware version
4228490SPaul.Guo@Sun.COM  */
4238490SPaul.Guo@Sun.COM s32
ixgbe_get_phy_firmware_version(struct ixgbe_hw * hw,u16 * firmware_version)4248490SPaul.Guo@Sun.COM ixgbe_get_phy_firmware_version(struct ixgbe_hw *hw, u16 *firmware_version)
4258490SPaul.Guo@Sun.COM {
4268490SPaul.Guo@Sun.COM 	s32 status = IXGBE_SUCCESS;
4278490SPaul.Guo@Sun.COM 
4288490SPaul.Guo@Sun.COM 	status = ixgbe_call_func(hw, hw->phy.ops.get_firmware_version,
4298490SPaul.Guo@Sun.COM 	    (hw, firmware_version), IXGBE_NOT_IMPLEMENTED);
4308490SPaul.Guo@Sun.COM 	return (status);
4318490SPaul.Guo@Sun.COM }
4328490SPaul.Guo@Sun.COM 
4338490SPaul.Guo@Sun.COM /*
4346621Sbt150084  * ixgbe_read_phy_reg - Read PHY register
4356621Sbt150084  * @hw: pointer to hardware structure
4366621Sbt150084  * @reg_addr: 32 bit address of PHY register to read
4376621Sbt150084  * @phy_data: Pointer to read data from PHY register
4386621Sbt150084  *
4396621Sbt150084  * Reads a value from a specified PHY register
4406621Sbt150084  */
4416621Sbt150084 s32
ixgbe_read_phy_reg(struct ixgbe_hw * hw,u32 reg_addr,u32 device_type,u16 * phy_data)4426621Sbt150084 ixgbe_read_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type,
4436621Sbt150084 	u16 *phy_data)
4446621Sbt150084 {
4459353SSamuel.Tu@Sun.COM 	if (hw->phy.id == 0)
4469353SSamuel.Tu@Sun.COM 		(void) ixgbe_identify_phy(hw);
4479353SSamuel.Tu@Sun.COM 
4486621Sbt150084 	return ixgbe_call_func(hw, hw->phy.ops.read_reg, (hw, reg_addr,
4496621Sbt150084 	    device_type, phy_data), IXGBE_NOT_IMPLEMENTED);
4506621Sbt150084 }
4516621Sbt150084 
4526621Sbt150084 /*
4536621Sbt150084  * ixgbe_write_phy_reg - Write PHY register
4546621Sbt150084  * @hw: pointer to hardware structure
4556621Sbt150084  * @reg_addr: 32 bit PHY register to write
4566621Sbt150084  * @phy_data: Data to write to the PHY register
4576621Sbt150084  *
4586621Sbt150084  * Writes a value to specified PHY register
4596621Sbt150084  */
ixgbe_write_phy_reg(struct ixgbe_hw * hw,u32 reg_addr,u32 device_type,u16 phy_data)4606621Sbt150084 s32 ixgbe_write_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type,
4616621Sbt150084     u16 phy_data)
4626621Sbt150084 {
4639353SSamuel.Tu@Sun.COM 	if (hw->phy.id == 0)
4649353SSamuel.Tu@Sun.COM 		(void) ixgbe_identify_phy(hw);
4659353SSamuel.Tu@Sun.COM 
4666621Sbt150084 	return ixgbe_call_func(hw, hw->phy.ops.write_reg, (hw, reg_addr,
4676621Sbt150084 	    device_type, phy_data), IXGBE_NOT_IMPLEMENTED);
4686621Sbt150084 }
4696621Sbt150084 
4706621Sbt150084 /*
4716621Sbt150084  * ixgbe_setup_phy_link - Restart PHY autoneg
4726621Sbt150084  * @hw: pointer to hardware structure
4736621Sbt150084  *
4746621Sbt150084  * Restart autonegotiation and PHY and waits for completion.
4756621Sbt150084  */
4766621Sbt150084 s32
ixgbe_setup_phy_link(struct ixgbe_hw * hw)4776621Sbt150084 ixgbe_setup_phy_link(struct ixgbe_hw *hw)
4786621Sbt150084 {
4796621Sbt150084 	return ixgbe_call_func(hw, hw->phy.ops.setup_link, (hw),
4806621Sbt150084 	    IXGBE_NOT_IMPLEMENTED);
4816621Sbt150084 }
4826621Sbt150084 
4836621Sbt150084 /*
4848490SPaul.Guo@Sun.COM  * ixgbe_check_phy_link - Determine link and speed status
4858490SPaul.Guo@Sun.COM  * @hw: pointer to hardware structure
4868490SPaul.Guo@Sun.COM  *
4878490SPaul.Guo@Sun.COM  * Reads a PHY register to determine if link is up and the current speed for
4888490SPaul.Guo@Sun.COM  * the PHY.
4898490SPaul.Guo@Sun.COM  */
ixgbe_check_phy_link(struct ixgbe_hw * hw,ixgbe_link_speed * speed,bool * link_up)4908490SPaul.Guo@Sun.COM s32 ixgbe_check_phy_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
4918490SPaul.Guo@Sun.COM     bool *link_up)
4928490SPaul.Guo@Sun.COM {
4938490SPaul.Guo@Sun.COM 	return ixgbe_call_func(hw, hw->phy.ops.check_link, (hw, speed,
4948490SPaul.Guo@Sun.COM 	    link_up), IXGBE_NOT_IMPLEMENTED);
4958490SPaul.Guo@Sun.COM }
4968490SPaul.Guo@Sun.COM 
4978490SPaul.Guo@Sun.COM /*
4986621Sbt150084  * ixgbe_setup_phy_link_speed - Set auto advertise
4996621Sbt150084  * @hw: pointer to hardware structure
5006621Sbt150084  * @speed: new link speed
5018490SPaul.Guo@Sun.COM  * @autoneg: true if autonegotiation enabled
5026621Sbt150084  *
5036621Sbt150084  * Sets the auto advertised capabilities
5046621Sbt150084  */
5056621Sbt150084 s32
ixgbe_setup_phy_link_speed(struct ixgbe_hw * hw,ixgbe_link_speed speed,bool autoneg,bool autoneg_wait_to_complete)5066621Sbt150084 ixgbe_setup_phy_link_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed,
5076621Sbt150084     bool autoneg,
5086621Sbt150084     bool autoneg_wait_to_complete)
5096621Sbt150084 {
5106621Sbt150084 	return ixgbe_call_func(hw, hw->phy.ops.setup_link_speed, (hw, speed,
5116621Sbt150084 	    autoneg, autoneg_wait_to_complete),
5126621Sbt150084 	    IXGBE_NOT_IMPLEMENTED);
5136621Sbt150084 }
5146621Sbt150084 
5156621Sbt150084 /*
5166621Sbt150084  * ixgbe_check_link - Get link and speed status
5176621Sbt150084  * @hw: pointer to hardware structure
5186621Sbt150084  *
5196621Sbt150084  * Reads the links register to determine if link is up and the current speed
5206621Sbt150084  */
5216621Sbt150084 s32
ixgbe_check_link(struct ixgbe_hw * hw,ixgbe_link_speed * speed,bool * link_up,bool link_up_wait_to_complete)5226621Sbt150084 ixgbe_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
5238490SPaul.Guo@Sun.COM     bool *link_up, bool link_up_wait_to_complete)
5246621Sbt150084 {
5256621Sbt150084 	return ixgbe_call_func(hw, hw->mac.ops.check_link, (hw, speed,
5268490SPaul.Guo@Sun.COM 	    link_up, link_up_wait_to_complete), IXGBE_NOT_IMPLEMENTED);
5276621Sbt150084 }
5286621Sbt150084 
5296621Sbt150084 /*
530*13006SChenlu.Chen@Sun.COM  * ixgbe_disable_tx_laser - Disable Tx laser
531*13006SChenlu.Chen@Sun.COM  * @hw: pointer to hardware structure
532*13006SChenlu.Chen@Sun.COM  *
533*13006SChenlu.Chen@Sun.COM  * If the driver needs to disable the laser on SFI optics.
534*13006SChenlu.Chen@Sun.COM  */
535*13006SChenlu.Chen@Sun.COM void
ixgbe_disable_tx_laser(struct ixgbe_hw * hw)536*13006SChenlu.Chen@Sun.COM ixgbe_disable_tx_laser(struct ixgbe_hw *hw)
537*13006SChenlu.Chen@Sun.COM {
538*13006SChenlu.Chen@Sun.COM 	if (hw->mac.ops.disable_tx_laser)
539*13006SChenlu.Chen@Sun.COM 		hw->mac.ops.disable_tx_laser(hw);
540*13006SChenlu.Chen@Sun.COM }
541*13006SChenlu.Chen@Sun.COM 
542*13006SChenlu.Chen@Sun.COM /*
543*13006SChenlu.Chen@Sun.COM  * ixgbe_enable_tx_laser - Enable Tx laser
544*13006SChenlu.Chen@Sun.COM  * @hw: pointer to hardware structure
545*13006SChenlu.Chen@Sun.COM  *
546*13006SChenlu.Chen@Sun.COM  * If the driver needs to enable the laser on SFI optics.
547*13006SChenlu.Chen@Sun.COM  */
548*13006SChenlu.Chen@Sun.COM void
ixgbe_enable_tx_laser(struct ixgbe_hw * hw)549*13006SChenlu.Chen@Sun.COM ixgbe_enable_tx_laser(struct ixgbe_hw *hw)
550*13006SChenlu.Chen@Sun.COM {
551*13006SChenlu.Chen@Sun.COM 	if (hw->mac.ops.enable_tx_laser)
552*13006SChenlu.Chen@Sun.COM 		hw->mac.ops.enable_tx_laser(hw);
553*13006SChenlu.Chen@Sun.COM }
554*13006SChenlu.Chen@Sun.COM 
555*13006SChenlu.Chen@Sun.COM /*
556*13006SChenlu.Chen@Sun.COM  * ixgbe_flap_tx_laser - flap Tx laser to start autotry process
557*13006SChenlu.Chen@Sun.COM  * @hw: pointer to hardware structure
558*13006SChenlu.Chen@Sun.COM  *
559*13006SChenlu.Chen@Sun.COM  * When the driver changes the link speeds that it can support then
560*13006SChenlu.Chen@Sun.COM  * flap the tx laser to alert the link partner to start autotry
561*13006SChenlu.Chen@Sun.COM  * process on its end.
562*13006SChenlu.Chen@Sun.COM  */
563*13006SChenlu.Chen@Sun.COM void
ixgbe_flap_tx_laser(struct ixgbe_hw * hw)564*13006SChenlu.Chen@Sun.COM ixgbe_flap_tx_laser(struct ixgbe_hw *hw)
565*13006SChenlu.Chen@Sun.COM {
566*13006SChenlu.Chen@Sun.COM 	if (hw->mac.ops.flap_tx_laser)
567*13006SChenlu.Chen@Sun.COM 		hw->mac.ops.flap_tx_laser(hw);
568*13006SChenlu.Chen@Sun.COM }
569*13006SChenlu.Chen@Sun.COM 
570*13006SChenlu.Chen@Sun.COM /*
57110998SChenlu.Chen@Sun.COM  * ixgbe_setup_link - Set link speed
5726621Sbt150084  * @hw: pointer to hardware structure
5736621Sbt150084  * @speed: new link speed
5748490SPaul.Guo@Sun.COM  * @autoneg: true if autonegotiation enabled
5756621Sbt150084  *
57610998SChenlu.Chen@Sun.COM  * Configures link settings.  Restarts the link.
57710998SChenlu.Chen@Sun.COM  * Performs autonegotiation if needed.
5786621Sbt150084  */
ixgbe_setup_link(struct ixgbe_hw * hw,ixgbe_link_speed speed,bool autoneg,bool autoneg_wait_to_complete)57910998SChenlu.Chen@Sun.COM s32 ixgbe_setup_link(struct ixgbe_hw *hw, ixgbe_link_speed speed,
5806621Sbt150084     bool autoneg,
5816621Sbt150084     bool autoneg_wait_to_complete)
5826621Sbt150084 {
58310998SChenlu.Chen@Sun.COM 	return ixgbe_call_func(hw, hw->mac.ops.setup_link, (hw, speed,
5846621Sbt150084 	    autoneg, autoneg_wait_to_complete),
5856621Sbt150084 	    IXGBE_NOT_IMPLEMENTED);
5866621Sbt150084 }
5876621Sbt150084 
5886621Sbt150084 /*
5896621Sbt150084  * ixgbe_get_link_capabilities - Returns link capabilities
5906621Sbt150084  * @hw: pointer to hardware structure
5916621Sbt150084  *
5926621Sbt150084  * Determines the link capabilities of the current configuration.
5936621Sbt150084  */
5946621Sbt150084 s32
ixgbe_get_link_capabilities(struct ixgbe_hw * hw,ixgbe_link_speed * speed,bool * autoneg)5956621Sbt150084 ixgbe_get_link_capabilities(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
5966621Sbt150084     bool *autoneg)
5976621Sbt150084 {
5986621Sbt150084 	return ixgbe_call_func(hw, hw->mac.ops.get_link_capabilities, (hw,
5996621Sbt150084 	    speed, autoneg), IXGBE_NOT_IMPLEMENTED);
6006621Sbt150084 }
6016621Sbt150084 
6026621Sbt150084 /*
6036621Sbt150084  * ixgbe_led_on - Turn on LEDs
6046621Sbt150084  * @hw: pointer to hardware structure
6056621Sbt150084  * @index: led number to turn on
6066621Sbt150084  *
6076621Sbt150084  * Turns on the software controllable LEDs.
6086621Sbt150084  */
6096621Sbt150084 s32
ixgbe_led_on(struct ixgbe_hw * hw,u32 index)6106621Sbt150084 ixgbe_led_on(struct ixgbe_hw *hw, u32 index)
6116621Sbt150084 {
6126621Sbt150084 	return ixgbe_call_func(hw, hw->mac.ops.led_on, (hw, index),
6136621Sbt150084 	    IXGBE_NOT_IMPLEMENTED);
6146621Sbt150084 }
6156621Sbt150084 
6166621Sbt150084 /*
6176621Sbt150084  * ixgbe_led_off - Turn off LEDs
6186621Sbt150084  * @hw: pointer to hardware structure
6196621Sbt150084  * @index: led number to turn off
6206621Sbt150084  *
6216621Sbt150084  * Turns off the software controllable LEDs.
6226621Sbt150084  */
6236621Sbt150084 s32
ixgbe_led_off(struct ixgbe_hw * hw,u32 index)6246621Sbt150084 ixgbe_led_off(struct ixgbe_hw *hw, u32 index)
6256621Sbt150084 {
6266621Sbt150084 	return ixgbe_call_func(hw, hw->mac.ops.led_off, (hw, index),
6276621Sbt150084 	    IXGBE_NOT_IMPLEMENTED);
6286621Sbt150084 }
6296621Sbt150084 
6306621Sbt150084 /*
6316621Sbt150084  * ixgbe_blink_led_start - Blink LEDs
6326621Sbt150084  * @hw: pointer to hardware structure
6336621Sbt150084  * @index: led number to blink
6346621Sbt150084  *
6356621Sbt150084  * Blink LED based on index.
6366621Sbt150084  */
6376621Sbt150084 s32
ixgbe_blink_led_start(struct ixgbe_hw * hw,u32 index)6386621Sbt150084 ixgbe_blink_led_start(struct ixgbe_hw *hw, u32 index)
6396621Sbt150084 {
6406621Sbt150084 	return ixgbe_call_func(hw, hw->mac.ops.blink_led_start, (hw, index),
6416621Sbt150084 	    IXGBE_NOT_IMPLEMENTED);
6426621Sbt150084 }
6436621Sbt150084 
6446621Sbt150084 /*
6456621Sbt150084  * ixgbe_blink_led_stop - Stop blinking LEDs
6466621Sbt150084  * @hw: pointer to hardware structure
6476621Sbt150084  *
6486621Sbt150084  * Stop blinking LED based on index.
6496621Sbt150084  */
6506621Sbt150084 s32
ixgbe_blink_led_stop(struct ixgbe_hw * hw,u32 index)6516621Sbt150084 ixgbe_blink_led_stop(struct ixgbe_hw *hw, u32 index)
6526621Sbt150084 {
6536621Sbt150084 	return ixgbe_call_func(hw, hw->mac.ops.blink_led_stop, (hw, index),
6546621Sbt150084 	    IXGBE_NOT_IMPLEMENTED);
6556621Sbt150084 }
6566621Sbt150084 
6576621Sbt150084 /*
6586621Sbt150084  * ixgbe_init_eeprom_params - Initialize EEPROM parameters
6596621Sbt150084  * @hw: pointer to hardware structure
6606621Sbt150084  *
6616621Sbt150084  * Initializes the EEPROM parameters ixgbe_eeprom_info within the
6626621Sbt150084  * ixgbe_hw struct in order to set up EEPROM access.
6636621Sbt150084  */
6646621Sbt150084 s32
ixgbe_init_eeprom_params(struct ixgbe_hw * hw)6656621Sbt150084 ixgbe_init_eeprom_params(struct ixgbe_hw *hw)
6666621Sbt150084 {
6676621Sbt150084 	return ixgbe_call_func(hw, hw->eeprom.ops.init_params, (hw),
6686621Sbt150084 	    IXGBE_NOT_IMPLEMENTED);
6696621Sbt150084 }
6706621Sbt150084 
6716621Sbt150084 
6726621Sbt150084 /*
6736621Sbt150084  * ixgbe_write_eeprom - Write word to EEPROM
6746621Sbt150084  * @hw: pointer to hardware structure
6756621Sbt150084  * @offset: offset within the EEPROM to be written to
6766621Sbt150084  * @data: 16 bit word to be written to the EEPROM
6776621Sbt150084  *
6786621Sbt150084  * Writes 16 bit value to EEPROM. If ixgbe_eeprom_update_checksum is not
6796621Sbt150084  * called after this function, the EEPROM will most likely contain an
6806621Sbt150084  * invalid checksum.
6816621Sbt150084  */
6826621Sbt150084 s32
ixgbe_write_eeprom(struct ixgbe_hw * hw,u16 offset,u16 data)6836621Sbt150084 ixgbe_write_eeprom(struct ixgbe_hw *hw, u16 offset, u16 data)
6846621Sbt150084 {
6856621Sbt150084 	return ixgbe_call_func(hw, hw->eeprom.ops.write, (hw, offset, data),
6866621Sbt150084 	    IXGBE_NOT_IMPLEMENTED);
6876621Sbt150084 }
6886621Sbt150084 
6896621Sbt150084 /*
6906621Sbt150084  * ixgbe_read_eeprom - Read word from EEPROM
6916621Sbt150084  * @hw: pointer to hardware structure
6926621Sbt150084  * @offset: offset within the EEPROM to be read
6936621Sbt150084  * @data: read 16 bit value from EEPROM
6946621Sbt150084  *
6956621Sbt150084  * Reads 16 bit value from EEPROM
6966621Sbt150084  */
6976621Sbt150084 s32
ixgbe_read_eeprom(struct ixgbe_hw * hw,u16 offset,u16 * data)6986621Sbt150084 ixgbe_read_eeprom(struct ixgbe_hw *hw, u16 offset, u16 *data)
6996621Sbt150084 {
7006621Sbt150084 	return ixgbe_call_func(hw, hw->eeprom.ops.read, (hw, offset, data),
7016621Sbt150084 	    IXGBE_NOT_IMPLEMENTED);
7026621Sbt150084 }
7036621Sbt150084 
7046621Sbt150084 /*
7056621Sbt150084  * ixgbe_validate_eeprom_checksum - Validate EEPROM checksum
7066621Sbt150084  * @hw: pointer to hardware structure
7076621Sbt150084  * @checksum_val: calculated checksum
7086621Sbt150084  *
7096621Sbt150084  * Performs checksum calculation and validates the EEPROM checksum
7106621Sbt150084  */
7116621Sbt150084 s32
ixgbe_validate_eeprom_checksum(struct ixgbe_hw * hw,u16 * checksum_val)7126621Sbt150084 ixgbe_validate_eeprom_checksum(struct ixgbe_hw *hw, u16 *checksum_val)
7136621Sbt150084 {
7146621Sbt150084 	return ixgbe_call_func(hw, hw->eeprom.ops.validate_checksum,
7156621Sbt150084 	    (hw, checksum_val), IXGBE_NOT_IMPLEMENTED);
7166621Sbt150084 }
7176621Sbt150084 
7186621Sbt150084 /*
7196621Sbt150084  * ixgbe_eeprom_update_checksum - Updates the EEPROM checksum
7206621Sbt150084  * @hw: pointer to hardware structure
7216621Sbt150084  */
7226621Sbt150084 s32
ixgbe_update_eeprom_checksum(struct ixgbe_hw * hw)7236621Sbt150084 ixgbe_update_eeprom_checksum(struct ixgbe_hw *hw)
7246621Sbt150084 {
7256621Sbt150084 	return ixgbe_call_func(hw, hw->eeprom.ops.update_checksum, (hw),
7266621Sbt150084 	    IXGBE_NOT_IMPLEMENTED);
7276621Sbt150084 }
7286621Sbt150084 
7296621Sbt150084 /*
7309353SSamuel.Tu@Sun.COM  * ixgbe_insert_mac_addr - Find a RAR for this mac address
7319353SSamuel.Tu@Sun.COM  * @hw: pointer to hardware structure
7329353SSamuel.Tu@Sun.COM  * @addr: Address to put into receive address register
7339353SSamuel.Tu@Sun.COM  * @vmdq: VMDq pool to assign
7349353SSamuel.Tu@Sun.COM  *
7359353SSamuel.Tu@Sun.COM  * Puts an ethernet address into a receive address register, or
7369353SSamuel.Tu@Sun.COM  * finds the rar that it is aleady in; adds to the pool list
7379353SSamuel.Tu@Sun.COM  */
7389353SSamuel.Tu@Sun.COM s32
ixgbe_insert_mac_addr(struct ixgbe_hw * hw,u8 * addr,u32 vmdq)7399353SSamuel.Tu@Sun.COM ixgbe_insert_mac_addr(struct ixgbe_hw *hw, u8 *addr, u32 vmdq)
7409353SSamuel.Tu@Sun.COM {
7419353SSamuel.Tu@Sun.COM 	return ixgbe_call_func(hw, hw->mac.ops.insert_mac_addr,
7429353SSamuel.Tu@Sun.COM 	    (hw, addr, vmdq), IXGBE_NOT_IMPLEMENTED);
7439353SSamuel.Tu@Sun.COM }
7449353SSamuel.Tu@Sun.COM 
7459353SSamuel.Tu@Sun.COM /*
7466621Sbt150084  * ixgbe_set_rar - Set Rx address register
7476621Sbt150084  * @hw: pointer to hardware structure
7486621Sbt150084  * @index: Receive address register to write
7496621Sbt150084  * @addr: Address to put into receive address register
7506621Sbt150084  * @vmdq: VMDq "set"
7516621Sbt150084  * @enable_addr: set flag that address is active
7526621Sbt150084  *
7536621Sbt150084  * Puts an ethernet address into a receive address register.
7546621Sbt150084  */
7556621Sbt150084 s32
ixgbe_set_rar(struct ixgbe_hw * hw,u32 index,u8 * addr,u32 vmdq,u32 enable_addr)7566621Sbt150084 ixgbe_set_rar(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq,
7576621Sbt150084     u32 enable_addr)
7586621Sbt150084 {
7596621Sbt150084 	return ixgbe_call_func(hw, hw->mac.ops.set_rar, (hw, index, addr, vmdq,
7606621Sbt150084 	    enable_addr), IXGBE_NOT_IMPLEMENTED);
7616621Sbt150084 }
7626621Sbt150084 
7636621Sbt150084 /*
7648490SPaul.Guo@Sun.COM  * ixgbe_clear_rar - Clear Rx address register
7658490SPaul.Guo@Sun.COM  * @hw: pointer to hardware structure
7668490SPaul.Guo@Sun.COM  * @index: Receive address register to write
7678490SPaul.Guo@Sun.COM  *
7688490SPaul.Guo@Sun.COM  * Puts an ethernet address into a receive address register.
7698490SPaul.Guo@Sun.COM  */
7708490SPaul.Guo@Sun.COM s32
ixgbe_clear_rar(struct ixgbe_hw * hw,u32 index)7718490SPaul.Guo@Sun.COM ixgbe_clear_rar(struct ixgbe_hw *hw, u32 index)
7728490SPaul.Guo@Sun.COM {
7738490SPaul.Guo@Sun.COM 	return ixgbe_call_func(hw, hw->mac.ops.clear_rar, (hw, index),
7748490SPaul.Guo@Sun.COM 	    IXGBE_NOT_IMPLEMENTED);
7758490SPaul.Guo@Sun.COM }
7768490SPaul.Guo@Sun.COM 
7778490SPaul.Guo@Sun.COM /*
7786621Sbt150084  * ixgbe_set_vmdq - Associate a VMDq index with a receive address
7796621Sbt150084  * @hw: pointer to hardware structure
7806621Sbt150084  * @rar: receive address register index to associate with VMDq index
7816621Sbt150084  * @vmdq: VMDq set or pool index
7826621Sbt150084  */
7836621Sbt150084 s32
ixgbe_set_vmdq(struct ixgbe_hw * hw,u32 rar,u32 vmdq)7846621Sbt150084 ixgbe_set_vmdq(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
7856621Sbt150084 {
7866621Sbt150084 	return ixgbe_call_func(hw, hw->mac.ops.set_vmdq, (hw, rar, vmdq),
7876621Sbt150084 	    IXGBE_NOT_IMPLEMENTED);
7886621Sbt150084 }
7896621Sbt150084 
7906621Sbt150084 /*
7918490SPaul.Guo@Sun.COM  * ixgbe_clear_vmdq - Disassociate a VMDq index from a receive address
7928490SPaul.Guo@Sun.COM  * @hw: pointer to hardware structure
7938490SPaul.Guo@Sun.COM  * @rar: receive address register index to disassociate with VMDq index
7948490SPaul.Guo@Sun.COM  * @vmdq: VMDq set or pool index
7958490SPaul.Guo@Sun.COM  */
7968490SPaul.Guo@Sun.COM s32
ixgbe_clear_vmdq(struct ixgbe_hw * hw,u32 rar,u32 vmdq)7978490SPaul.Guo@Sun.COM ixgbe_clear_vmdq(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
7988490SPaul.Guo@Sun.COM {
7998490SPaul.Guo@Sun.COM 	return ixgbe_call_func(hw, hw->mac.ops.clear_vmdq, (hw, rar, vmdq),
8008490SPaul.Guo@Sun.COM 	    IXGBE_NOT_IMPLEMENTED);
8018490SPaul.Guo@Sun.COM }
8028490SPaul.Guo@Sun.COM 
8038490SPaul.Guo@Sun.COM /*
8046621Sbt150084  * ixgbe_init_rx_addrs - Initializes receive address filters.
8056621Sbt150084  * @hw: pointer to hardware structure
8066621Sbt150084  *
8076621Sbt150084  * Places the MAC address in receive address register 0 and clears the rest
8086621Sbt150084  * of the receive address registers. Clears the multicast table. Assumes
8096621Sbt150084  * the receiver is in reset when the routine is called.
8106621Sbt150084  */
8116621Sbt150084 s32
ixgbe_init_rx_addrs(struct ixgbe_hw * hw)8126621Sbt150084 ixgbe_init_rx_addrs(struct ixgbe_hw *hw)
8136621Sbt150084 {
8146621Sbt150084 	return ixgbe_call_func(hw, hw->mac.ops.init_rx_addrs, (hw),
8156621Sbt150084 	    IXGBE_NOT_IMPLEMENTED);
8166621Sbt150084 }
8176621Sbt150084 
8186621Sbt150084 /*
8196621Sbt150084  * ixgbe_get_num_rx_addrs - Returns the number of RAR entries.
8206621Sbt150084  * @hw: pointer to hardware structure
8216621Sbt150084  */
8226621Sbt150084 u32
ixgbe_get_num_rx_addrs(struct ixgbe_hw * hw)8236621Sbt150084 ixgbe_get_num_rx_addrs(struct ixgbe_hw *hw)
8246621Sbt150084 {
8256621Sbt150084 	return (hw->mac.num_rar_entries);
8266621Sbt150084 }
8276621Sbt150084 
8286621Sbt150084 /*
8296621Sbt150084  * ixgbe_update_uc_addr_list - Updates the MAC's list of secondary addresses
8306621Sbt150084  * @hw: pointer to hardware structure
8316621Sbt150084  * @addr_list: the list of new multicast addresses
8326621Sbt150084  * @addr_count: number of addresses
8336621Sbt150084  * @func: iterator function to walk the multicast address list
8346621Sbt150084  *
8356621Sbt150084  * The given list replaces any existing list. Clears the secondary addrs from
8366621Sbt150084  * receive address registers. Uses unused receive address registers for the
8376621Sbt150084  * first secondary addresses, and falls back to promiscuous mode as needed.
8386621Sbt150084  */
8396621Sbt150084 s32
ixgbe_update_uc_addr_list(struct ixgbe_hw * hw,u8 * addr_list,u32 addr_count,ixgbe_mc_addr_itr func)8406621Sbt150084 ixgbe_update_uc_addr_list(struct ixgbe_hw *hw, u8 *addr_list,
8416621Sbt150084     u32 addr_count, ixgbe_mc_addr_itr func)
8426621Sbt150084 {
8436621Sbt150084 	return ixgbe_call_func(hw, hw->mac.ops.update_uc_addr_list, (hw,
8446621Sbt150084 	    addr_list, addr_count, func),
8456621Sbt150084 	    IXGBE_NOT_IMPLEMENTED);
8466621Sbt150084 }
8476621Sbt150084 
8486621Sbt150084 /*
8496621Sbt150084  * ixgbe_update_mc_addr_list - Updates the MAC's list of multicast addresses
8506621Sbt150084  * @hw: pointer to hardware structure
8516621Sbt150084  * @mc_addr_list: the list of new multicast addresses
8526621Sbt150084  * @mc_addr_count: number of addresses
8536621Sbt150084  * @func: iterator function to walk the multicast address list
8546621Sbt150084  *
8556621Sbt150084  * The given list replaces any existing list. Clears the MC addrs from receive
8566621Sbt150084  * address registers and the multicast table. Uses unused receive address
8576621Sbt150084  * registers for the first multicast addresses, and hashes the rest into the
8586621Sbt150084  * multicast table.
8596621Sbt150084  */
8606621Sbt150084 s32
ixgbe_update_mc_addr_list(struct ixgbe_hw * hw,u8 * mc_addr_list,u32 mc_addr_count,ixgbe_mc_addr_itr func)8616621Sbt150084 ixgbe_update_mc_addr_list(struct ixgbe_hw *hw, u8 *mc_addr_list,
8626621Sbt150084     u32 mc_addr_count, ixgbe_mc_addr_itr func)
8636621Sbt150084 {
8646621Sbt150084 	return ixgbe_call_func(hw, hw->mac.ops.update_mc_addr_list, (hw,
8656621Sbt150084 	    mc_addr_list, mc_addr_count, func),
8666621Sbt150084 	    IXGBE_NOT_IMPLEMENTED);
8676621Sbt150084 }
8686621Sbt150084 
8696621Sbt150084 /*
8706621Sbt150084  * ixgbe_enable_mc - Enable multicast address in RAR
8716621Sbt150084  * @hw: pointer to hardware structure
8726621Sbt150084  *
8736621Sbt150084  * Enables multicast address in RAR and the use of the multicast hash table.
8746621Sbt150084  */
8756621Sbt150084 s32
ixgbe_enable_mc(struct ixgbe_hw * hw)8766621Sbt150084 ixgbe_enable_mc(struct ixgbe_hw *hw)
8776621Sbt150084 {
8786621Sbt150084 	return ixgbe_call_func(hw, hw->mac.ops.enable_mc, (hw),
8796621Sbt150084 	    IXGBE_NOT_IMPLEMENTED);
8806621Sbt150084 }
8816621Sbt150084 
8826621Sbt150084 /*
8836621Sbt150084  * ixgbe_disable_mc - Disable multicast address in RAR
8846621Sbt150084  * @hw: pointer to hardware structure
8856621Sbt150084  *
8866621Sbt150084  * Disables multicast address in RAR and the use of the multicast hash table.
8876621Sbt150084  */
8886621Sbt150084 s32
ixgbe_disable_mc(struct ixgbe_hw * hw)8896621Sbt150084 ixgbe_disable_mc(struct ixgbe_hw *hw)
8906621Sbt150084 {
8916621Sbt150084 	return ixgbe_call_func(hw, hw->mac.ops.disable_mc, (hw),
8926621Sbt150084 	    IXGBE_NOT_IMPLEMENTED);
8936621Sbt150084 }
8946621Sbt150084 
8956621Sbt150084 /*
8966621Sbt150084  * ixgbe_clear_vfta - Clear VLAN filter table
8976621Sbt150084  * @hw: pointer to hardware structure
8986621Sbt150084  *
8996621Sbt150084  * Clears the VLAN filer table, and the VMDq index associated with the filter
9006621Sbt150084  */
9016621Sbt150084 s32
ixgbe_clear_vfta(struct ixgbe_hw * hw)9026621Sbt150084 ixgbe_clear_vfta(struct ixgbe_hw *hw)
9036621Sbt150084 {
9046621Sbt150084 	return ixgbe_call_func(hw, hw->mac.ops.clear_vfta, (hw),
9056621Sbt150084 	    IXGBE_NOT_IMPLEMENTED);
9066621Sbt150084 }
9076621Sbt150084 
9086621Sbt150084 /*
9096621Sbt150084  * ixgbe_set_vfta - Set VLAN filter table
9106621Sbt150084  * @hw: pointer to hardware structure
9116621Sbt150084  * @vlan: VLAN id to write to VLAN filter
9126621Sbt150084  * @vind: VMDq output index that maps queue to VLAN id in VFTA
9136621Sbt150084  * @vlan_on: boolean flag to turn on/off VLAN in VFTA
9146621Sbt150084  *
9156621Sbt150084  * Turn on/off specified VLAN in the VLAN filter table.
9166621Sbt150084  */
9176621Sbt150084 s32
ixgbe_set_vfta(struct ixgbe_hw * hw,u32 vlan,u32 vind,bool vlan_on)9186621Sbt150084 ixgbe_set_vfta(struct ixgbe_hw *hw, u32 vlan, u32 vind, bool vlan_on)
9196621Sbt150084 {
9206621Sbt150084 	return ixgbe_call_func(hw, hw->mac.ops.set_vfta, (hw, vlan, vind,
9216621Sbt150084 	    vlan_on), IXGBE_NOT_IMPLEMENTED);
9226621Sbt150084 }
9236621Sbt150084 
9246621Sbt150084 /*
9259353SSamuel.Tu@Sun.COM  * ixgbe_fc_enable - Enable flow control
9266621Sbt150084  * @hw: pointer to hardware structure
9276621Sbt150084  * @packetbuf_num: packet buffer number (0-7)
9286621Sbt150084  *
9296621Sbt150084  * Configures the flow control settings based on SW configuration.
9306621Sbt150084  */
9316621Sbt150084 s32
ixgbe_fc_enable(struct ixgbe_hw * hw,s32 packetbuf_num)9329353SSamuel.Tu@Sun.COM ixgbe_fc_enable(struct ixgbe_hw *hw, s32 packetbuf_num)
9336621Sbt150084 {
9349353SSamuel.Tu@Sun.COM 	return ixgbe_call_func(hw, hw->mac.ops.fc_enable, (hw, packetbuf_num),
9356621Sbt150084 	    IXGBE_NOT_IMPLEMENTED);
9366621Sbt150084 }
9376621Sbt150084 
9386621Sbt150084 /*
9396621Sbt150084  * ixgbe_read_analog_reg8 - Reads 8 bit analog register
9406621Sbt150084  * @hw: pointer to hardware structure
9416621Sbt150084  * @reg: analog register to read
9426621Sbt150084  * @val: read value
9436621Sbt150084  *
9446621Sbt150084  * Performs write operation to analog register specified.
9456621Sbt150084  */
9466621Sbt150084 s32
ixgbe_read_analog_reg8(struct ixgbe_hw * hw,u32 reg,u8 * val)9476621Sbt150084 ixgbe_read_analog_reg8(struct ixgbe_hw *hw, u32 reg, u8 *val)
9486621Sbt150084 {
9496621Sbt150084 	return ixgbe_call_func(hw, hw->mac.ops.read_analog_reg8, (hw, reg,
9506621Sbt150084 	    val), IXGBE_NOT_IMPLEMENTED);
9516621Sbt150084 }
9526621Sbt150084 
9536621Sbt150084 /*
9546621Sbt150084  * ixgbe_write_analog_reg8 - Writes 8 bit analog register
9556621Sbt150084  * @hw: pointer to hardware structure
9566621Sbt150084  * @reg: analog register to write
9576621Sbt150084  * @val: value to write
9586621Sbt150084  *
9596621Sbt150084  * Performs write operation to Atlas analog register specified.
9606621Sbt150084  */
9616621Sbt150084 s32
ixgbe_write_analog_reg8(struct ixgbe_hw * hw,u32 reg,u8 val)9626621Sbt150084 ixgbe_write_analog_reg8(struct ixgbe_hw *hw, u32 reg, u8 val)
9636621Sbt150084 {
9646621Sbt150084 	return ixgbe_call_func(hw, hw->mac.ops.write_analog_reg8, (hw, reg,
9656621Sbt150084 	    val), IXGBE_NOT_IMPLEMENTED);
9666621Sbt150084 }
9678490SPaul.Guo@Sun.COM 
9688490SPaul.Guo@Sun.COM /*
9698490SPaul.Guo@Sun.COM  * ixgbe_init_uta_tables - Initializes Unicast Table Arrays.
9708490SPaul.Guo@Sun.COM  * @hw: pointer to hardware structure
9718490SPaul.Guo@Sun.COM  *
9728490SPaul.Guo@Sun.COM  * Initializes the Unicast Table Arrays to zero on device load.  This
9738490SPaul.Guo@Sun.COM  * is part of the Rx init addr execution path.
9748490SPaul.Guo@Sun.COM  */
9758490SPaul.Guo@Sun.COM s32
ixgbe_init_uta_tables(struct ixgbe_hw * hw)9768490SPaul.Guo@Sun.COM ixgbe_init_uta_tables(struct ixgbe_hw *hw)
9778490SPaul.Guo@Sun.COM {
9788490SPaul.Guo@Sun.COM 	return ixgbe_call_func(hw, hw->mac.ops.init_uta_tables, (hw),
9798490SPaul.Guo@Sun.COM 	    IXGBE_NOT_IMPLEMENTED);
9808490SPaul.Guo@Sun.COM }
9818490SPaul.Guo@Sun.COM 
9828490SPaul.Guo@Sun.COM /*
9839353SSamuel.Tu@Sun.COM  * ixgbe_read_i2c_byte - Reads 8 bit word over I2C at specified device address
9849353SSamuel.Tu@Sun.COM  * @hw: pointer to hardware structure
9859353SSamuel.Tu@Sun.COM  * @byte_offset: byte offset to read
9869353SSamuel.Tu@Sun.COM  * @data: value read
9879353SSamuel.Tu@Sun.COM  *
9889353SSamuel.Tu@Sun.COM  * Performs byte read operation to SFP module's EEPROM over I2C interface.
9899353SSamuel.Tu@Sun.COM  */
9909353SSamuel.Tu@Sun.COM s32
ixgbe_read_i2c_byte(struct ixgbe_hw * hw,u8 byte_offset,u8 dev_addr,u8 * data)9919353SSamuel.Tu@Sun.COM ixgbe_read_i2c_byte(struct ixgbe_hw *hw, u8 byte_offset, u8 dev_addr,
9929353SSamuel.Tu@Sun.COM     u8 *data)
9939353SSamuel.Tu@Sun.COM {
9949353SSamuel.Tu@Sun.COM 	return ixgbe_call_func(hw, hw->phy.ops.read_i2c_byte, (hw, byte_offset,
9959353SSamuel.Tu@Sun.COM 	    dev_addr, data), IXGBE_NOT_IMPLEMENTED);
9969353SSamuel.Tu@Sun.COM }
9979353SSamuel.Tu@Sun.COM 
9989353SSamuel.Tu@Sun.COM /*
9999353SSamuel.Tu@Sun.COM  * ixgbe_write_i2c_byte - Writes 8 bit word over I2C
10009353SSamuel.Tu@Sun.COM  * @hw: pointer to hardware structure
10019353SSamuel.Tu@Sun.COM  * @byte_offset: byte offset to write
10029353SSamuel.Tu@Sun.COM  * @data: value to write
10039353SSamuel.Tu@Sun.COM  *
10049353SSamuel.Tu@Sun.COM  * Performs byte write operation to SFP module's EEPROM over I2C interface
10059353SSamuel.Tu@Sun.COM  * at a specified device address.
10069353SSamuel.Tu@Sun.COM  */
10079353SSamuel.Tu@Sun.COM s32
ixgbe_write_i2c_byte(struct ixgbe_hw * hw,u8 byte_offset,u8 dev_addr,u8 data)10089353SSamuel.Tu@Sun.COM ixgbe_write_i2c_byte(struct ixgbe_hw *hw, u8 byte_offset, u8 dev_addr,
10099353SSamuel.Tu@Sun.COM     u8 data)
10109353SSamuel.Tu@Sun.COM {
10119353SSamuel.Tu@Sun.COM 	return ixgbe_call_func(hw, hw->phy.ops.write_i2c_byte,
10129353SSamuel.Tu@Sun.COM 	    (hw, byte_offset, dev_addr, data), IXGBE_NOT_IMPLEMENTED);
10139353SSamuel.Tu@Sun.COM }
10149353SSamuel.Tu@Sun.COM 
10159353SSamuel.Tu@Sun.COM /*
10169353SSamuel.Tu@Sun.COM  * ixgbe_write_i2c_eeprom - Writes 8 bit EEPROM word over I2C interface
10179353SSamuel.Tu@Sun.COM  * @hw: pointer to hardware structure
10189353SSamuel.Tu@Sun.COM  * @byte_offset: EEPROM byte offset to write
10199353SSamuel.Tu@Sun.COM  * @eeprom_data: value to write
10209353SSamuel.Tu@Sun.COM  *
10219353SSamuel.Tu@Sun.COM  * Performs byte write operation to SFP module's EEPROM over I2C interface.
10229353SSamuel.Tu@Sun.COM  */
10239353SSamuel.Tu@Sun.COM s32
ixgbe_write_i2c_eeprom(struct ixgbe_hw * hw,u8 byte_offset,u8 eeprom_data)10249353SSamuel.Tu@Sun.COM ixgbe_write_i2c_eeprom(struct ixgbe_hw *hw, u8 byte_offset, u8 eeprom_data)
10259353SSamuel.Tu@Sun.COM {
10269353SSamuel.Tu@Sun.COM 	return ixgbe_call_func(hw, hw->phy.ops.write_i2c_eeprom,
10279353SSamuel.Tu@Sun.COM 	    (hw, byte_offset, eeprom_data), IXGBE_NOT_IMPLEMENTED);
10289353SSamuel.Tu@Sun.COM }
10299353SSamuel.Tu@Sun.COM 
10309353SSamuel.Tu@Sun.COM /*
10318490SPaul.Guo@Sun.COM  * ixgbe_read_i2c_eeprom - Reads 8 bit EEPROM word over I2C interface
10328490SPaul.Guo@Sun.COM  * @hw: pointer to hardware structure
10338490SPaul.Guo@Sun.COM  * @byte_offset: EEPROM byte offset to read
10348490SPaul.Guo@Sun.COM  * @eeprom_data: value read
10358490SPaul.Guo@Sun.COM  *
10368490SPaul.Guo@Sun.COM  * Performs byte read operation to SFP module's EEPROM over I2C interface.
10378490SPaul.Guo@Sun.COM  */
10388490SPaul.Guo@Sun.COM s32
ixgbe_read_i2c_eeprom(struct ixgbe_hw * hw,u8 byte_offset,u8 * eeprom_data)10398490SPaul.Guo@Sun.COM ixgbe_read_i2c_eeprom(struct ixgbe_hw *hw, u8 byte_offset, u8 *eeprom_data)
10408490SPaul.Guo@Sun.COM {
10418490SPaul.Guo@Sun.COM 	return ixgbe_call_func(hw, hw->phy.ops.read_i2c_eeprom,
10429353SSamuel.Tu@Sun.COM 	    (hw, byte_offset, eeprom_data), IXGBE_NOT_IMPLEMENTED);
10438490SPaul.Guo@Sun.COM }
10448490SPaul.Guo@Sun.COM 
10458490SPaul.Guo@Sun.COM /*
10468490SPaul.Guo@Sun.COM  * ixgbe_get_supported_physical_layer - Returns physical layer type
10478490SPaul.Guo@Sun.COM  * @hw: pointer to hardware structure
10488490SPaul.Guo@Sun.COM  *
10498490SPaul.Guo@Sun.COM  * Determines physical layer capabilities of the current configuration.
10508490SPaul.Guo@Sun.COM  */
10519353SSamuel.Tu@Sun.COM u32
ixgbe_get_supported_physical_layer(struct ixgbe_hw * hw)10528490SPaul.Guo@Sun.COM ixgbe_get_supported_physical_layer(struct ixgbe_hw *hw)
10538490SPaul.Guo@Sun.COM {
10548490SPaul.Guo@Sun.COM 	return ixgbe_call_func(hw, hw->mac.ops.get_supported_physical_layer,
10558490SPaul.Guo@Sun.COM 	    (hw), IXGBE_NOT_IMPLEMENTED);
10568490SPaul.Guo@Sun.COM }
10579353SSamuel.Tu@Sun.COM 
10589353SSamuel.Tu@Sun.COM /*
10599353SSamuel.Tu@Sun.COM  * ixgbe_enable_rx_dma - Enables Rx DMA unit, dependant on device specifics
10609353SSamuel.Tu@Sun.COM  * @hw: pointer to hardware structure
10619353SSamuel.Tu@Sun.COM  * @regval: bitfield to write to the Rx DMA register
10629353SSamuel.Tu@Sun.COM  *
10639353SSamuel.Tu@Sun.COM  * Enables the Rx DMA unit of the device.
10649353SSamuel.Tu@Sun.COM  */
10659353SSamuel.Tu@Sun.COM s32
ixgbe_enable_rx_dma(struct ixgbe_hw * hw,u32 regval)10669353SSamuel.Tu@Sun.COM ixgbe_enable_rx_dma(struct ixgbe_hw *hw, u32 regval)
10679353SSamuel.Tu@Sun.COM {
10689353SSamuel.Tu@Sun.COM 	return ixgbe_call_func(hw, hw->mac.ops.enable_rx_dma,
10699353SSamuel.Tu@Sun.COM 	    (hw, regval), IXGBE_NOT_IMPLEMENTED);
10709353SSamuel.Tu@Sun.COM }
107110305SPaul.Guo@Sun.COM 
107210305SPaul.Guo@Sun.COM /*
107310305SPaul.Guo@Sun.COM  * ixgbe_acquire_swfw_semaphore - Acquire SWFW semaphore
107410305SPaul.Guo@Sun.COM  * @hw: pointer to hardware structure
107510305SPaul.Guo@Sun.COM  * @mask: Mask to specify which semaphore to acquire
107610305SPaul.Guo@Sun.COM  *
107710305SPaul.Guo@Sun.COM  * Acquires the SWFW semaphore through SW_FW_SYNC register for the specified
107810305SPaul.Guo@Sun.COM  * function (CSR, PHY0, PHY1, EEPROM, Flash)
107910305SPaul.Guo@Sun.COM  */
108010305SPaul.Guo@Sun.COM s32
ixgbe_acquire_swfw_semaphore(struct ixgbe_hw * hw,u16 mask)108110305SPaul.Guo@Sun.COM ixgbe_acquire_swfw_semaphore(struct ixgbe_hw *hw, u16 mask)
108210305SPaul.Guo@Sun.COM {
108310305SPaul.Guo@Sun.COM 	return ixgbe_call_func(hw, hw->mac.ops.acquire_swfw_sync,
108410305SPaul.Guo@Sun.COM 	    (hw, mask), IXGBE_NOT_IMPLEMENTED);
108510305SPaul.Guo@Sun.COM }
108610305SPaul.Guo@Sun.COM 
108710305SPaul.Guo@Sun.COM /*
108810305SPaul.Guo@Sun.COM  * ixgbe_release_swfw_semaphore - Release SWFW semaphore
108910305SPaul.Guo@Sun.COM  * @hw: pointer to hardware structure
109010305SPaul.Guo@Sun.COM  * @mask: Mask to specify which semaphore to release
109110305SPaul.Guo@Sun.COM  *
109210305SPaul.Guo@Sun.COM  * Releases the SWFW semaphore through SW_FW_SYNC register for the specified
109310305SPaul.Guo@Sun.COM  * function (CSR, PHY0, PHY1, EEPROM, Flash)
109410305SPaul.Guo@Sun.COM  */
109510305SPaul.Guo@Sun.COM void
ixgbe_release_swfw_semaphore(struct ixgbe_hw * hw,u16 mask)109610305SPaul.Guo@Sun.COM ixgbe_release_swfw_semaphore(struct ixgbe_hw *hw, u16 mask)
109710305SPaul.Guo@Sun.COM {
109810305SPaul.Guo@Sun.COM 	if (hw->mac.ops.release_swfw_sync)
109910305SPaul.Guo@Sun.COM 		hw->mac.ops.release_swfw_sync(hw, mask);
110010305SPaul.Guo@Sun.COM }
1101