ixgbe_api.c revision 190873
1179055Sjfv/******************************************************************************
2171384Sjfv
3190873Sjfv  Copyright (c) 2001-2009, Intel Corporation
4171384Sjfv  All rights reserved.
5171384Sjfv
6171384Sjfv  Redistribution and use in source and binary forms, with or without
7171384Sjfv  modification, are permitted provided that the following conditions are met:
8171384Sjfv
9171384Sjfv   1. Redistributions of source code must retain the above copyright notice,
10171384Sjfv      this list of conditions and the following disclaimer.
11171384Sjfv
12171384Sjfv   2. Redistributions in binary form must reproduce the above copyright
13171384Sjfv      notice, this list of conditions and the following disclaimer in the
14171384Sjfv      documentation and/or other materials provided with the distribution.
15171384Sjfv
16171384Sjfv   3. Neither the name of the Intel Corporation nor the names of its
17171384Sjfv      contributors may be used to endorse or promote products derived from
18171384Sjfv      this software without specific prior written permission.
19171384Sjfv
20171384Sjfv  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21171384Sjfv  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22171384Sjfv  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23171384Sjfv  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24171384Sjfv  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25171384Sjfv  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26171384Sjfv  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27171384Sjfv  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28171384Sjfv  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29171384Sjfv  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30171384Sjfv  POSSIBILITY OF SUCH DAMAGE.
31171384Sjfv
32179055Sjfv******************************************************************************/
33179055Sjfv/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_api.c 190873 2009-04-10 00:22:48Z jfv $*/
34171384Sjfv
35171384Sjfv#include "ixgbe_api.h"
36171384Sjfv#include "ixgbe_common.h"
37171384Sjfv
38179055Sjfvextern s32 ixgbe_init_ops_82598(struct ixgbe_hw *hw);
39190873Sjfvextern s32 ixgbe_init_ops_82599(struct ixgbe_hw *hw);
40171384Sjfv
41171384Sjfv/**
42171384Sjfv *  ixgbe_init_shared_code - Initialize the shared code
43171384Sjfv *  @hw: pointer to hardware structure
44171384Sjfv *
45171384Sjfv *  This will assign function pointers and assign the MAC type and PHY code.
46171384Sjfv *  Does not touch the hardware. This function must be called prior to any
47171384Sjfv *  other function in the shared code. The ixgbe_hw structure should be
48171384Sjfv *  memset to 0 prior to calling this function.  The following fields in
49171384Sjfv *  hw structure should be filled in prior to calling this function:
50171384Sjfv *  hw_addr, back, device_id, vendor_id, subsystem_device_id,
51185352Sjfv *  subsystem_vendor_id, and revision_id
52171384Sjfv **/
53171384Sjfvs32 ixgbe_init_shared_code(struct ixgbe_hw *hw)
54171384Sjfv{
55172043Sjfv	s32 status;
56171384Sjfv
57171384Sjfv	/*
58172043Sjfv	 * Set the mac type
59172043Sjfv	 */
60172043Sjfv	ixgbe_set_mac_type(hw);
61172043Sjfv
62172043Sjfv	switch (hw->mac.type) {
63172043Sjfv	case ixgbe_mac_82598EB:
64179055Sjfv		status = ixgbe_init_ops_82598(hw);
65172043Sjfv		break;
66190873Sjfv	case ixgbe_mac_82599EB:
67190873Sjfv		status = ixgbe_init_ops_82599(hw);
68190873Sjfv		break;
69172043Sjfv	default:
70172043Sjfv		status = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
71172043Sjfv		break;
72172043Sjfv	}
73172043Sjfv
74172043Sjfv	return status;
75172043Sjfv}
76172043Sjfv
77172043Sjfv/**
78172043Sjfv *  ixgbe_set_mac_type - Sets MAC type
79172043Sjfv *  @hw: pointer to the HW structure
80172043Sjfv *
81172043Sjfv *  This function sets the mac type of the adapter based on the
82172043Sjfv *  vendor ID and device ID stored in the hw structure.
83172043Sjfv **/
84172043Sjfvs32 ixgbe_set_mac_type(struct ixgbe_hw *hw)
85172043Sjfv{
86172043Sjfv	s32 ret_val = IXGBE_SUCCESS;
87172043Sjfv
88179055Sjfv	DEBUGFUNC("ixgbe_set_mac_type\n");
89172043Sjfv
90171384Sjfv	if (hw->vendor_id == IXGBE_INTEL_VENDOR_ID) {
91171384Sjfv		switch (hw->device_id) {
92185352Sjfv		case IXGBE_DEV_ID_82598:
93190873Sjfv		case IXGBE_DEV_ID_82598_BX:
94171384Sjfv		case IXGBE_DEV_ID_82598AF_SINGLE_PORT:
95171384Sjfv		case IXGBE_DEV_ID_82598AF_DUAL_PORT:
96179055Sjfv		case IXGBE_DEV_ID_82598AT:
97172043Sjfv		case IXGBE_DEV_ID_82598EB_CX4:
98179055Sjfv		case IXGBE_DEV_ID_82598_CX4_DUAL_PORT:
99185352Sjfv		case IXGBE_DEV_ID_82598_DA_DUAL_PORT:
100185352Sjfv		case IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM:
101179055Sjfv		case IXGBE_DEV_ID_82598EB_XF_LR:
102185352Sjfv		case IXGBE_DEV_ID_82598EB_SFP_LOM:
103172043Sjfv			hw->mac.type = ixgbe_mac_82598EB;
104171384Sjfv			break;
105190873Sjfv		case IXGBE_DEV_ID_82599_KX4:
106190873Sjfv		case IXGBE_DEV_ID_82599_SFP:
107190873Sjfv		case IXGBE_DEV_ID_82599_CX4:
108190873Sjfv			hw->mac.type = ixgbe_mac_82599EB;
109190873Sjfv			break;
110171384Sjfv		default:
111172043Sjfv			ret_val = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
112171384Sjfv			break;
113171384Sjfv		}
114172043Sjfv	} else {
115172043Sjfv		ret_val = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
116171384Sjfv	}
117171384Sjfv
118179055Sjfv	DEBUGOUT2("ixgbe_set_mac_type found mac: %d, returns: %d\n",
119179055Sjfv	          hw->mac.type, ret_val);
120172043Sjfv	return ret_val;
121171384Sjfv}
122171384Sjfv
123171384Sjfv/**
124171384Sjfv *  ixgbe_init_hw - Initialize the hardware
125171384Sjfv *  @hw: pointer to hardware structure
126171384Sjfv *
127171384Sjfv *  Initialize the hardware by resetting and then starting the hardware
128171384Sjfv **/
129171384Sjfvs32 ixgbe_init_hw(struct ixgbe_hw *hw)
130171384Sjfv{
131179055Sjfv	return ixgbe_call_func(hw, hw->mac.ops.init_hw, (hw),
132179055Sjfv	                       IXGBE_NOT_IMPLEMENTED);
133171384Sjfv}
134171384Sjfv
135171384Sjfv/**
136171384Sjfv *  ixgbe_reset_hw - Performs a hardware reset
137171384Sjfv *  @hw: pointer to hardware structure
138171384Sjfv *
139171384Sjfv *  Resets the hardware by resetting the transmit and receive units, masks and
140171384Sjfv *  clears all interrupts, performs a PHY reset, and performs a MAC reset
141171384Sjfv **/
142171384Sjfvs32 ixgbe_reset_hw(struct ixgbe_hw *hw)
143171384Sjfv{
144179055Sjfv	return ixgbe_call_func(hw, hw->mac.ops.reset_hw, (hw),
145179055Sjfv	                       IXGBE_NOT_IMPLEMENTED);
146171384Sjfv}
147171384Sjfv
148171384Sjfv/**
149179055Sjfv *  ixgbe_start_hw - Prepares hardware for Rx/Tx
150171384Sjfv *  @hw: pointer to hardware structure
151171384Sjfv *
152171384Sjfv *  Starts the hardware by filling the bus info structure and media type,
153171384Sjfv *  clears all on chip counters, initializes receive address registers,
154171384Sjfv *  multicast table, VLAN filter table, calls routine to setup link and
155171384Sjfv *  flow control settings, and leaves transmit and receive units disabled
156171384Sjfv *  and uninitialized.
157171384Sjfv **/
158171384Sjfvs32 ixgbe_start_hw(struct ixgbe_hw *hw)
159171384Sjfv{
160179055Sjfv	return ixgbe_call_func(hw, hw->mac.ops.start_hw, (hw),
161179055Sjfv	                       IXGBE_NOT_IMPLEMENTED);
162171384Sjfv}
163171384Sjfv
164171384Sjfv/**
165171384Sjfv *  ixgbe_clear_hw_cntrs - Clear hardware counters
166171384Sjfv *  @hw: pointer to hardware structure
167171384Sjfv *
168171384Sjfv *  Clears all hardware statistics counters by reading them from the hardware
169171384Sjfv *  Statistics counters are clear on read.
170171384Sjfv **/
171171384Sjfvs32 ixgbe_clear_hw_cntrs(struct ixgbe_hw *hw)
172171384Sjfv{
173179055Sjfv	return ixgbe_call_func(hw, hw->mac.ops.clear_hw_cntrs, (hw),
174179055Sjfv	                       IXGBE_NOT_IMPLEMENTED);
175171384Sjfv}
176171384Sjfv
177171384Sjfv/**
178171384Sjfv *  ixgbe_get_media_type - Get media type
179171384Sjfv *  @hw: pointer to hardware structure
180171384Sjfv *
181171384Sjfv *  Returns the media type (fiber, copper, backplane)
182171384Sjfv **/
183171384Sjfvenum ixgbe_media_type ixgbe_get_media_type(struct ixgbe_hw *hw)
184171384Sjfv{
185179055Sjfv	return ixgbe_call_func(hw, hw->mac.ops.get_media_type, (hw),
186179055Sjfv	                       ixgbe_media_type_unknown);
187171384Sjfv}
188171384Sjfv
189171384Sjfv/**
190171384Sjfv *  ixgbe_get_mac_addr - Get MAC address
191171384Sjfv *  @hw: pointer to hardware structure
192171384Sjfv *  @mac_addr: Adapter MAC address
193171384Sjfv *
194171384Sjfv *  Reads the adapter's MAC address from the first Receive Address Register
195179055Sjfv *  (RAR0) A reset of the adapter must have been performed prior to calling
196179055Sjfv *  this function in order for the MAC address to have been loaded from the
197179055Sjfv *  EEPROM into RAR0
198171384Sjfv **/
199171384Sjfvs32 ixgbe_get_mac_addr(struct ixgbe_hw *hw, u8 *mac_addr)
200171384Sjfv{
201179055Sjfv	return ixgbe_call_func(hw, hw->mac.ops.get_mac_addr,
202179055Sjfv	                       (hw, mac_addr), IXGBE_NOT_IMPLEMENTED);
203171384Sjfv}
204171384Sjfv
205171384Sjfv/**
206190873Sjfv *  ixgbe_get_san_mac_addr - Get SAN MAC address
207190873Sjfv *  @hw: pointer to hardware structure
208190873Sjfv *  @san_mac_addr: SAN MAC address
209190873Sjfv *
210190873Sjfv *  Reads the SAN MAC address from the EEPROM, if it's available.  This is
211190873Sjfv *  per-port, so set_lan_id() must be called before reading the addresses.
212190873Sjfv **/
213190873Sjfvs32 ixgbe_get_san_mac_addr(struct ixgbe_hw *hw, u8 *san_mac_addr)
214190873Sjfv{
215190873Sjfv	return ixgbe_call_func(hw, hw->mac.ops.get_san_mac_addr,
216190873Sjfv	                       (hw, san_mac_addr), IXGBE_NOT_IMPLEMENTED);
217190873Sjfv}
218190873Sjfv
219190873Sjfv/**
220190873Sjfv *  ixgbe_set_san_mac_addr - Write a SAN MAC address
221190873Sjfv *  @hw: pointer to hardware structure
222190873Sjfv *  @san_mac_addr: SAN MAC address
223190873Sjfv *
224190873Sjfv *  Writes A SAN MAC address to the EEPROM.
225190873Sjfv **/
226190873Sjfvs32 ixgbe_set_san_mac_addr(struct ixgbe_hw *hw, u8 *san_mac_addr)
227190873Sjfv{
228190873Sjfv	return ixgbe_call_func(hw, hw->mac.ops.set_san_mac_addr,
229190873Sjfv	                       (hw, san_mac_addr), IXGBE_NOT_IMPLEMENTED);
230190873Sjfv}
231190873Sjfv
232190873Sjfv/**
233190873Sjfv *  ixgbe_get_device_caps - Get additional device capabilities
234190873Sjfv *  @hw: pointer to hardware structure
235190873Sjfv *  @device_caps: the EEPROM word for device capabilities
236190873Sjfv *
237190873Sjfv *  Reads the extra device capabilities from the EEPROM
238190873Sjfv **/
239190873Sjfvs32 ixgbe_get_device_caps(struct ixgbe_hw *hw, u16 *device_caps)
240190873Sjfv{
241190873Sjfv	return ixgbe_call_func(hw, hw->mac.ops.get_device_caps,
242190873Sjfv	                       (hw, device_caps), IXGBE_NOT_IMPLEMENTED);
243190873Sjfv}
244190873Sjfv
245190873Sjfv/**
246171384Sjfv *  ixgbe_get_bus_info - Set PCI bus info
247171384Sjfv *  @hw: pointer to hardware structure
248171384Sjfv *
249171384Sjfv *  Sets the PCI bus info (speed, width, type) within the ixgbe_hw structure
250171384Sjfv **/
251171384Sjfvs32 ixgbe_get_bus_info(struct ixgbe_hw *hw)
252171384Sjfv{
253179055Sjfv	return ixgbe_call_func(hw, hw->mac.ops.get_bus_info, (hw),
254179055Sjfv	                       IXGBE_NOT_IMPLEMENTED);
255171384Sjfv}
256171384Sjfv
257171384Sjfv/**
258179055Sjfv *  ixgbe_get_num_of_tx_queues - Get Tx queues
259171384Sjfv *  @hw: pointer to hardware structure
260171384Sjfv *
261171384Sjfv *  Returns the number of transmit queues for the given adapter.
262171384Sjfv **/
263171384Sjfvu32 ixgbe_get_num_of_tx_queues(struct ixgbe_hw *hw)
264171384Sjfv{
265179055Sjfv	return hw->mac.max_tx_queues;
266171384Sjfv}
267171384Sjfv
268171384Sjfv/**
269179055Sjfv *  ixgbe_get_num_of_rx_queues - Get Rx queues
270171384Sjfv *  @hw: pointer to hardware structure
271171384Sjfv *
272171384Sjfv *  Returns the number of receive queues for the given adapter.
273171384Sjfv **/
274171384Sjfvu32 ixgbe_get_num_of_rx_queues(struct ixgbe_hw *hw)
275171384Sjfv{
276179055Sjfv	return hw->mac.max_rx_queues;
277171384Sjfv}
278171384Sjfv
279171384Sjfv/**
280179055Sjfv *  ixgbe_stop_adapter - Disable Rx/Tx units
281171384Sjfv *  @hw: pointer to hardware structure
282171384Sjfv *
283171384Sjfv *  Sets the adapter_stopped flag within ixgbe_hw struct. Clears interrupts,
284171384Sjfv *  disables transmit and receive units. The adapter_stopped flag is used by
285171384Sjfv *  the shared code and drivers to determine if the adapter is in a stopped
286171384Sjfv *  state and should not touch the hardware.
287171384Sjfv **/
288171384Sjfvs32 ixgbe_stop_adapter(struct ixgbe_hw *hw)
289171384Sjfv{
290179055Sjfv	return ixgbe_call_func(hw, hw->mac.ops.stop_adapter, (hw),
291179055Sjfv	                       IXGBE_NOT_IMPLEMENTED);
292171384Sjfv}
293171384Sjfv
294171384Sjfv/**
295179055Sjfv *  ixgbe_read_pba_num - Reads part number from EEPROM
296179055Sjfv *  @hw: pointer to hardware structure
297179055Sjfv *  @pba_num: stores the part number from the EEPROM
298179055Sjfv *
299179055Sjfv *  Reads the part number from the EEPROM.
300179055Sjfv **/
301179055Sjfvs32 ixgbe_read_pba_num(struct ixgbe_hw *hw, u32 *pba_num)
302179055Sjfv{
303179055Sjfv	return ixgbe_read_pba_num_generic(hw, pba_num);
304179055Sjfv}
305179055Sjfv
306179055Sjfv/**
307171384Sjfv *  ixgbe_identify_phy - Get PHY type
308171384Sjfv *  @hw: pointer to hardware structure
309171384Sjfv *
310171384Sjfv *  Determines the physical layer module found on the current adapter.
311171384Sjfv **/
312171384Sjfvs32 ixgbe_identify_phy(struct ixgbe_hw *hw)
313171384Sjfv{
314171384Sjfv	s32 status = IXGBE_SUCCESS;
315171384Sjfv
316171384Sjfv	if (hw->phy.type == ixgbe_phy_unknown) {
317171384Sjfv		status = ixgbe_call_func(hw,
318179055Sjfv		                         hw->phy.ops.identify,
319179055Sjfv		                         (hw),
320179055Sjfv		                         IXGBE_NOT_IMPLEMENTED);
321171384Sjfv	}
322171384Sjfv
323171384Sjfv	return status;
324171384Sjfv}
325171384Sjfv
326171384Sjfv/**
327171384Sjfv *  ixgbe_reset_phy - Perform a PHY reset
328171384Sjfv *  @hw: pointer to hardware structure
329171384Sjfv **/
330171384Sjfvs32 ixgbe_reset_phy(struct ixgbe_hw *hw)
331171384Sjfv{
332171384Sjfv	s32 status = IXGBE_SUCCESS;
333171384Sjfv
334171384Sjfv	if (hw->phy.type == ixgbe_phy_unknown) {
335185352Sjfv		if (ixgbe_identify_phy(hw) != IXGBE_SUCCESS)
336185352Sjfv			status = IXGBE_ERR_PHY;
337171384Sjfv	}
338171384Sjfv
339171384Sjfv	if (status == IXGBE_SUCCESS) {
340179055Sjfv		status = ixgbe_call_func(hw, hw->phy.ops.reset, (hw),
341179055Sjfv		                         IXGBE_NOT_IMPLEMENTED);
342171384Sjfv	}
343171384Sjfv	return status;
344171384Sjfv}
345171384Sjfv
346171384Sjfv/**
347179055Sjfv *  ixgbe_get_phy_firmware_version -
348179055Sjfv *  @hw: pointer to hardware structure
349179055Sjfv *  @firmware_version: pointer to firmware version
350179055Sjfv **/
351179055Sjfvs32 ixgbe_get_phy_firmware_version(struct ixgbe_hw *hw, u16 *firmware_version)
352179055Sjfv{
353179055Sjfv	s32 status = IXGBE_SUCCESS;
354179055Sjfv
355179055Sjfv	status = ixgbe_call_func(hw, hw->phy.ops.get_firmware_version,
356179055Sjfv	                         (hw, firmware_version),
357179055Sjfv	                         IXGBE_NOT_IMPLEMENTED);
358179055Sjfv	return status;
359179055Sjfv}
360179055Sjfv
361179055Sjfv/**
362171384Sjfv *  ixgbe_read_phy_reg - Read PHY register
363171384Sjfv *  @hw: pointer to hardware structure
364171384Sjfv *  @reg_addr: 32 bit address of PHY register to read
365171384Sjfv *  @phy_data: Pointer to read data from PHY register
366171384Sjfv *
367171384Sjfv *  Reads a value from a specified PHY register
368171384Sjfv **/
369171384Sjfvs32 ixgbe_read_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type,
370179055Sjfv                       u16 *phy_data)
371171384Sjfv{
372190873Sjfv	if (hw->phy.id == 0)
373190873Sjfv		ixgbe_identify_phy(hw);
374190873Sjfv
375179055Sjfv	return ixgbe_call_func(hw, hw->phy.ops.read_reg, (hw, reg_addr,
376179055Sjfv	                       device_type, phy_data), IXGBE_NOT_IMPLEMENTED);
377171384Sjfv}
378171384Sjfv
379171384Sjfv/**
380171384Sjfv *  ixgbe_write_phy_reg - Write PHY register
381171384Sjfv *  @hw: pointer to hardware structure
382171384Sjfv *  @reg_addr: 32 bit PHY register to write
383171384Sjfv *  @phy_data: Data to write to the PHY register
384171384Sjfv *
385171384Sjfv *  Writes a value to specified PHY register
386171384Sjfv **/
387171384Sjfvs32 ixgbe_write_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type,
388179055Sjfv                        u16 phy_data)
389171384Sjfv{
390190873Sjfv	if (hw->phy.id == 0)
391190873Sjfv		ixgbe_identify_phy(hw);
392190873Sjfv
393179055Sjfv	return ixgbe_call_func(hw, hw->phy.ops.write_reg, (hw, reg_addr,
394179055Sjfv	                       device_type, phy_data), IXGBE_NOT_IMPLEMENTED);
395179055Sjfv}
396171384Sjfv
397179055Sjfv/**
398179055Sjfv *  ixgbe_setup_phy_link - Restart PHY autoneg
399179055Sjfv *  @hw: pointer to hardware structure
400179055Sjfv *
401179055Sjfv *  Restart autonegotiation and PHY and waits for completion.
402179055Sjfv **/
403179055Sjfvs32 ixgbe_setup_phy_link(struct ixgbe_hw *hw)
404179055Sjfv{
405179055Sjfv	return ixgbe_call_func(hw, hw->phy.ops.setup_link, (hw),
406179055Sjfv	                       IXGBE_NOT_IMPLEMENTED);
407179055Sjfv}
408171384Sjfv
409179055Sjfv/**
410179055Sjfv *  ixgbe_check_phy_link - Determine link and speed status
411179055Sjfv *  @hw: pointer to hardware structure
412179055Sjfv *
413179055Sjfv *  Reads a PHY register to determine if link is up and the current speed for
414179055Sjfv *  the PHY.
415179055Sjfv **/
416179055Sjfvs32 ixgbe_check_phy_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
417179055Sjfv                         bool *link_up)
418179055Sjfv{
419179055Sjfv	return ixgbe_call_func(hw, hw->phy.ops.check_link, (hw, speed,
420179055Sjfv	                       link_up), IXGBE_NOT_IMPLEMENTED);
421171384Sjfv}
422171384Sjfv
423171384Sjfv/**
424179055Sjfv *  ixgbe_setup_phy_link_speed - Set auto advertise
425179055Sjfv *  @hw: pointer to hardware structure
426179055Sjfv *  @speed: new link speed
427179055Sjfv *  @autoneg: TRUE if autonegotiation enabled
428179055Sjfv *
429179055Sjfv *  Sets the auto advertised capabilities
430179055Sjfv **/
431179055Sjfvs32 ixgbe_setup_phy_link_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed,
432179055Sjfv                               bool autoneg,
433179055Sjfv                               bool autoneg_wait_to_complete)
434179055Sjfv{
435179055Sjfv	return ixgbe_call_func(hw, hw->phy.ops.setup_link_speed, (hw, speed,
436179055Sjfv	                       autoneg, autoneg_wait_to_complete),
437179055Sjfv	                       IXGBE_NOT_IMPLEMENTED);
438179055Sjfv}
439179055Sjfv
440179055Sjfv/**
441171384Sjfv *  ixgbe_setup_link - Configure link settings
442171384Sjfv *  @hw: pointer to hardware structure
443171384Sjfv *
444171384Sjfv *  Configures link settings based on values in the ixgbe_hw struct.
445171384Sjfv *  Restarts the link.  Performs autonegotiation if needed.
446171384Sjfv **/
447171384Sjfvs32 ixgbe_setup_link(struct ixgbe_hw *hw)
448171384Sjfv{
449179055Sjfv	return ixgbe_call_func(hw, hw->mac.ops.setup_link, (hw),
450179055Sjfv	                       IXGBE_NOT_IMPLEMENTED);
451171384Sjfv}
452171384Sjfv
453171384Sjfv/**
454171384Sjfv *  ixgbe_check_link - Get link and speed status
455171384Sjfv *  @hw: pointer to hardware structure
456171384Sjfv *
457171384Sjfv *  Reads the links register to determine if link is up and the current speed
458171384Sjfv **/
459171384Sjfvs32 ixgbe_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
460179055Sjfv                     bool *link_up, bool link_up_wait_to_complete)
461171384Sjfv{
462179055Sjfv	return ixgbe_call_func(hw, hw->mac.ops.check_link, (hw, speed,
463179055Sjfv	                       link_up, link_up_wait_to_complete),
464179055Sjfv	                       IXGBE_NOT_IMPLEMENTED);
465171384Sjfv}
466171384Sjfv
467171384Sjfv/**
468171384Sjfv *  ixgbe_setup_link_speed - Set link speed
469171384Sjfv *  @hw: pointer to hardware structure
470171384Sjfv *  @speed: new link speed
471171384Sjfv *  @autoneg: TRUE if autonegotiation enabled
472171384Sjfv *
473171384Sjfv *  Set the link speed and restarts the link.
474171384Sjfv **/
475171384Sjfvs32 ixgbe_setup_link_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed,
476179055Sjfv                           bool autoneg,
477179055Sjfv                           bool autoneg_wait_to_complete)
478171384Sjfv{
479179055Sjfv	return ixgbe_call_func(hw, hw->mac.ops.setup_link_speed, (hw, speed,
480179055Sjfv	                       autoneg, autoneg_wait_to_complete),
481179055Sjfv	                       IXGBE_NOT_IMPLEMENTED);
482171384Sjfv}
483171384Sjfv
484171384Sjfv/**
485179055Sjfv *  ixgbe_get_link_capabilities - Returns link capabilities
486171384Sjfv *  @hw: pointer to hardware structure
487171384Sjfv *
488179055Sjfv *  Determines the link capabilities of the current configuration.
489171384Sjfv **/
490179055Sjfvs32 ixgbe_get_link_capabilities(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
491179055Sjfv                                bool *autoneg)
492171384Sjfv{
493179055Sjfv	return ixgbe_call_func(hw, hw->mac.ops.get_link_capabilities, (hw,
494179055Sjfv	                       speed, autoneg), IXGBE_NOT_IMPLEMENTED);
495171384Sjfv}
496171384Sjfv
497171384Sjfv/**
498179055Sjfv *  ixgbe_led_on - Turn on LEDs
499171384Sjfv *  @hw: pointer to hardware structure
500171384Sjfv *  @index: led number to turn on
501171384Sjfv *
502171384Sjfv *  Turns on the software controllable LEDs.
503171384Sjfv **/
504171384Sjfvs32 ixgbe_led_on(struct ixgbe_hw *hw, u32 index)
505171384Sjfv{
506179055Sjfv	return ixgbe_call_func(hw, hw->mac.ops.led_on, (hw, index),
507179055Sjfv	                       IXGBE_NOT_IMPLEMENTED);
508171384Sjfv}
509171384Sjfv
510171384Sjfv/**
511179055Sjfv *  ixgbe_led_off - Turn off LEDs
512171384Sjfv *  @hw: pointer to hardware structure
513171384Sjfv *  @index: led number to turn off
514171384Sjfv *
515171384Sjfv *  Turns off the software controllable LEDs.
516171384Sjfv **/
517171384Sjfvs32 ixgbe_led_off(struct ixgbe_hw *hw, u32 index)
518171384Sjfv{
519179055Sjfv	return ixgbe_call_func(hw, hw->mac.ops.led_off, (hw, index),
520179055Sjfv	                       IXGBE_NOT_IMPLEMENTED);
521171384Sjfv}
522171384Sjfv
523171384Sjfv/**
524179055Sjfv *  ixgbe_blink_led_start - Blink LEDs
525171384Sjfv *  @hw: pointer to hardware structure
526171384Sjfv *  @index: led number to blink
527171384Sjfv *
528171384Sjfv *  Blink LED based on index.
529171384Sjfv **/
530171384Sjfvs32 ixgbe_blink_led_start(struct ixgbe_hw *hw, u32 index)
531171384Sjfv{
532179055Sjfv	return ixgbe_call_func(hw, hw->mac.ops.blink_led_start, (hw, index),
533179055Sjfv	                       IXGBE_NOT_IMPLEMENTED);
534171384Sjfv}
535171384Sjfv
536171384Sjfv/**
537179055Sjfv *  ixgbe_blink_led_stop - Stop blinking LEDs
538171384Sjfv *  @hw: pointer to hardware structure
539171384Sjfv *
540171384Sjfv *  Stop blinking LED based on index.
541171384Sjfv **/
542171384Sjfvs32 ixgbe_blink_led_stop(struct ixgbe_hw *hw, u32 index)
543171384Sjfv{
544179055Sjfv	return ixgbe_call_func(hw, hw->mac.ops.blink_led_stop, (hw, index),
545179055Sjfv	                       IXGBE_NOT_IMPLEMENTED);
546171384Sjfv}
547171384Sjfv
548171384Sjfv/**
549179055Sjfv *  ixgbe_init_eeprom_params - Initialize EEPROM parameters
550171384Sjfv *  @hw: pointer to hardware structure
551171384Sjfv *
552171384Sjfv *  Initializes the EEPROM parameters ixgbe_eeprom_info within the
553171384Sjfv *  ixgbe_hw struct in order to set up EEPROM access.
554171384Sjfv **/
555171384Sjfvs32 ixgbe_init_eeprom_params(struct ixgbe_hw *hw)
556171384Sjfv{
557179055Sjfv	return ixgbe_call_func(hw, hw->eeprom.ops.init_params, (hw),
558179055Sjfv	                       IXGBE_NOT_IMPLEMENTED);
559171384Sjfv}
560171384Sjfv
561171384Sjfv
562171384Sjfv/**
563171384Sjfv *  ixgbe_write_eeprom - Write word to EEPROM
564171384Sjfv *  @hw: pointer to hardware structure
565171384Sjfv *  @offset: offset within the EEPROM to be written to
566171384Sjfv *  @data: 16 bit word to be written to the EEPROM
567171384Sjfv *
568171384Sjfv *  Writes 16 bit value to EEPROM. If ixgbe_eeprom_update_checksum is not
569171384Sjfv *  called after this function, the EEPROM will most likely contain an
570171384Sjfv *  invalid checksum.
571171384Sjfv **/
572171384Sjfvs32 ixgbe_write_eeprom(struct ixgbe_hw *hw, u16 offset, u16 data)
573171384Sjfv{
574179055Sjfv	return ixgbe_call_func(hw, hw->eeprom.ops.write, (hw, offset, data),
575179055Sjfv	                       IXGBE_NOT_IMPLEMENTED);
576171384Sjfv}
577171384Sjfv
578171384Sjfv/**
579171384Sjfv *  ixgbe_read_eeprom - Read word from EEPROM
580171384Sjfv *  @hw: pointer to hardware structure
581171384Sjfv *  @offset: offset within the EEPROM to be read
582171384Sjfv *  @data: read 16 bit value from EEPROM
583171384Sjfv *
584171384Sjfv *  Reads 16 bit value from EEPROM
585171384Sjfv **/
586171384Sjfvs32 ixgbe_read_eeprom(struct ixgbe_hw *hw, u16 offset, u16 *data)
587171384Sjfv{
588179055Sjfv	return ixgbe_call_func(hw, hw->eeprom.ops.read, (hw, offset, data),
589179055Sjfv	                       IXGBE_NOT_IMPLEMENTED);
590171384Sjfv}
591171384Sjfv
592171384Sjfv/**
593171384Sjfv *  ixgbe_validate_eeprom_checksum - Validate EEPROM checksum
594171384Sjfv *  @hw: pointer to hardware structure
595171384Sjfv *  @checksum_val: calculated checksum
596171384Sjfv *
597171384Sjfv *  Performs checksum calculation and validates the EEPROM checksum
598171384Sjfv **/
599171384Sjfvs32 ixgbe_validate_eeprom_checksum(struct ixgbe_hw *hw, u16 *checksum_val)
600171384Sjfv{
601179055Sjfv	return ixgbe_call_func(hw, hw->eeprom.ops.validate_checksum,
602179055Sjfv	                       (hw, checksum_val), IXGBE_NOT_IMPLEMENTED);
603171384Sjfv}
604171384Sjfv
605171384Sjfv/**
606171384Sjfv *  ixgbe_eeprom_update_checksum - Updates the EEPROM checksum
607171384Sjfv *  @hw: pointer to hardware structure
608171384Sjfv **/
609171384Sjfvs32 ixgbe_update_eeprom_checksum(struct ixgbe_hw *hw)
610171384Sjfv{
611179055Sjfv	return ixgbe_call_func(hw, hw->eeprom.ops.update_checksum, (hw),
612179055Sjfv	                       IXGBE_NOT_IMPLEMENTED);
613171384Sjfv}
614171384Sjfv
615171384Sjfv/**
616190873Sjfv *  ixgbe_insert_mac_addr - Find a RAR for this mac address
617190873Sjfv *  @hw: pointer to hardware structure
618190873Sjfv *  @addr: Address to put into receive address register
619190873Sjfv *  @vmdq: VMDq pool to assign
620190873Sjfv *
621190873Sjfv *  Puts an ethernet address into a receive address register, or
622190873Sjfv *  finds the rar that it is aleady in; adds to the pool list
623190873Sjfv **/
624190873Sjfvs32 ixgbe_insert_mac_addr(struct ixgbe_hw *hw, u8 *addr, u32 vmdq)
625190873Sjfv{
626190873Sjfv	return ixgbe_call_func(hw, hw->mac.ops.insert_mac_addr,
627190873Sjfv	                       (hw, addr, vmdq),
628190873Sjfv			       IXGBE_NOT_IMPLEMENTED);
629190873Sjfv}
630190873Sjfv
631190873Sjfv/**
632179055Sjfv *  ixgbe_set_rar - Set Rx address register
633171384Sjfv *  @hw: pointer to hardware structure
634179055Sjfv *  @index: Receive address register to write
635171384Sjfv *  @addr: Address to put into receive address register
636179055Sjfv *  @vmdq: VMDq "set"
637171384Sjfv *  @enable_addr: set flag that address is active
638171384Sjfv *
639171384Sjfv *  Puts an ethernet address into a receive address register.
640171384Sjfv **/
641179055Sjfvs32 ixgbe_set_rar(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq,
642179055Sjfv                  u32 enable_addr)
643171384Sjfv{
644179055Sjfv	return ixgbe_call_func(hw, hw->mac.ops.set_rar, (hw, index, addr, vmdq,
645179055Sjfv	                       enable_addr), IXGBE_NOT_IMPLEMENTED);
646171384Sjfv}
647171384Sjfv
648171384Sjfv/**
649181003Sjfv *  ixgbe_clear_rar - Clear Rx address register
650181003Sjfv *  @hw: pointer to hardware structure
651181003Sjfv *  @index: Receive address register to write
652181003Sjfv *
653181003Sjfv *  Puts an ethernet address into a receive address register.
654181003Sjfv **/
655181003Sjfvs32 ixgbe_clear_rar(struct ixgbe_hw *hw, u32 index)
656181003Sjfv{
657181003Sjfv	return ixgbe_call_func(hw, hw->mac.ops.clear_rar, (hw, index),
658181003Sjfv	                       IXGBE_NOT_IMPLEMENTED);
659181003Sjfv}
660181003Sjfv
661181003Sjfv/**
662179055Sjfv *  ixgbe_set_vmdq - Associate a VMDq index with a receive address
663179055Sjfv *  @hw: pointer to hardware structure
664179055Sjfv *  @rar: receive address register index to associate with VMDq index
665179055Sjfv *  @vmdq: VMDq set or pool index
666179055Sjfv **/
667179055Sjfvs32 ixgbe_set_vmdq(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
668179055Sjfv{
669179055Sjfv	return ixgbe_call_func(hw, hw->mac.ops.set_vmdq, (hw, rar, vmdq),
670179055Sjfv	                       IXGBE_NOT_IMPLEMENTED);
671179055Sjfv}
672179055Sjfv
673179055Sjfv/**
674181003Sjfv *  ixgbe_clear_vmdq - Disassociate a VMDq index from a receive address
675181003Sjfv *  @hw: pointer to hardware structure
676181003Sjfv *  @rar: receive address register index to disassociate with VMDq index
677181003Sjfv *  @vmdq: VMDq set or pool index
678181003Sjfv **/
679181003Sjfvs32 ixgbe_clear_vmdq(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
680181003Sjfv{
681181003Sjfv	return ixgbe_call_func(hw, hw->mac.ops.clear_vmdq, (hw, rar, vmdq),
682181003Sjfv	                       IXGBE_NOT_IMPLEMENTED);
683181003Sjfv}
684181003Sjfv
685181003Sjfv/**
686171384Sjfv *  ixgbe_init_rx_addrs - Initializes receive address filters.
687171384Sjfv *  @hw: pointer to hardware structure
688171384Sjfv *
689171384Sjfv *  Places the MAC address in receive address register 0 and clears the rest
690179055Sjfv *  of the receive address registers. Clears the multicast table. Assumes
691171384Sjfv *  the receiver is in reset when the routine is called.
692171384Sjfv **/
693171384Sjfvs32 ixgbe_init_rx_addrs(struct ixgbe_hw *hw)
694171384Sjfv{
695179055Sjfv	return ixgbe_call_func(hw, hw->mac.ops.init_rx_addrs, (hw),
696179055Sjfv	                       IXGBE_NOT_IMPLEMENTED);
697171384Sjfv}
698171384Sjfv
699171384Sjfv/**
700171384Sjfv *  ixgbe_get_num_rx_addrs - Returns the number of RAR entries.
701171384Sjfv *  @hw: pointer to hardware structure
702171384Sjfv **/
703171384Sjfvu32 ixgbe_get_num_rx_addrs(struct ixgbe_hw *hw)
704171384Sjfv{
705179055Sjfv	return hw->mac.num_rar_entries;
706171384Sjfv}
707171384Sjfv
708171384Sjfv/**
709179055Sjfv *  ixgbe_update_uc_addr_list - Updates the MAC's list of secondary addresses
710179055Sjfv *  @hw: pointer to hardware structure
711179055Sjfv *  @addr_list: the list of new multicast addresses
712179055Sjfv *  @addr_count: number of addresses
713179055Sjfv *  @func: iterator function to walk the multicast address list
714179055Sjfv *
715179055Sjfv *  The given list replaces any existing list. Clears the secondary addrs from
716179055Sjfv *  receive address registers. Uses unused receive address registers for the
717179055Sjfv *  first secondary addresses, and falls back to promiscuous mode as needed.
718179055Sjfv **/
719179055Sjfvs32 ixgbe_update_uc_addr_list(struct ixgbe_hw *hw, u8 *addr_list,
720179055Sjfv                              u32 addr_count, ixgbe_mc_addr_itr func)
721179055Sjfv{
722179055Sjfv	return ixgbe_call_func(hw, hw->mac.ops.update_uc_addr_list, (hw,
723179055Sjfv	                       addr_list, addr_count, func),
724179055Sjfv	                       IXGBE_NOT_IMPLEMENTED);
725179055Sjfv}
726179055Sjfv
727179055Sjfv/**
728171384Sjfv *  ixgbe_update_mc_addr_list - Updates the MAC's list of multicast addresses
729171384Sjfv *  @hw: pointer to hardware structure
730171384Sjfv *  @mc_addr_list: the list of new multicast addresses
731171384Sjfv *  @mc_addr_count: number of addresses
732179055Sjfv *  @func: iterator function to walk the multicast address list
733171384Sjfv *
734171384Sjfv *  The given list replaces any existing list. Clears the MC addrs from receive
735179055Sjfv *  address registers and the multicast table. Uses unused receive address
736171384Sjfv *  registers for the first multicast addresses, and hashes the rest into the
737171384Sjfv *  multicast table.
738171384Sjfv **/
739171384Sjfvs32 ixgbe_update_mc_addr_list(struct ixgbe_hw *hw, u8 *mc_addr_list,
740179055Sjfv                              u32 mc_addr_count, ixgbe_mc_addr_itr func)
741171384Sjfv{
742179055Sjfv	return ixgbe_call_func(hw, hw->mac.ops.update_mc_addr_list, (hw,
743179055Sjfv	                       mc_addr_list, mc_addr_count, func),
744179055Sjfv	                       IXGBE_NOT_IMPLEMENTED);
745171384Sjfv}
746171384Sjfv
747171384Sjfv/**
748171384Sjfv *  ixgbe_enable_mc - Enable multicast address in RAR
749171384Sjfv *  @hw: pointer to hardware structure
750171384Sjfv *
751171384Sjfv *  Enables multicast address in RAR and the use of the multicast hash table.
752171384Sjfv **/
753171384Sjfvs32 ixgbe_enable_mc(struct ixgbe_hw *hw)
754171384Sjfv{
755179055Sjfv	return ixgbe_call_func(hw, hw->mac.ops.enable_mc, (hw),
756179055Sjfv	                       IXGBE_NOT_IMPLEMENTED);
757171384Sjfv}
758171384Sjfv
759171384Sjfv/**
760171384Sjfv *  ixgbe_disable_mc - Disable multicast address in RAR
761171384Sjfv *  @hw: pointer to hardware structure
762171384Sjfv *
763171384Sjfv *  Disables multicast address in RAR and the use of the multicast hash table.
764171384Sjfv **/
765171384Sjfvs32 ixgbe_disable_mc(struct ixgbe_hw *hw)
766171384Sjfv{
767179055Sjfv	return ixgbe_call_func(hw, hw->mac.ops.disable_mc, (hw),
768179055Sjfv	                       IXGBE_NOT_IMPLEMENTED);
769171384Sjfv}
770171384Sjfv
771171384Sjfv/**
772171384Sjfv *  ixgbe_clear_vfta - Clear VLAN filter table
773171384Sjfv *  @hw: pointer to hardware structure
774171384Sjfv *
775171384Sjfv *  Clears the VLAN filer table, and the VMDq index associated with the filter
776171384Sjfv **/
777171384Sjfvs32 ixgbe_clear_vfta(struct ixgbe_hw *hw)
778171384Sjfv{
779179055Sjfv	return ixgbe_call_func(hw, hw->mac.ops.clear_vfta, (hw),
780179055Sjfv	                       IXGBE_NOT_IMPLEMENTED);
781171384Sjfv}
782171384Sjfv
783171384Sjfv/**
784171384Sjfv *  ixgbe_set_vfta - Set VLAN filter table
785171384Sjfv *  @hw: pointer to hardware structure
786171384Sjfv *  @vlan: VLAN id to write to VLAN filter
787171384Sjfv *  @vind: VMDq output index that maps queue to VLAN id in VFTA
788171384Sjfv *  @vlan_on: boolean flag to turn on/off VLAN in VFTA
789171384Sjfv *
790171384Sjfv *  Turn on/off specified VLAN in the VLAN filter table.
791171384Sjfv **/
792171384Sjfvs32 ixgbe_set_vfta(struct ixgbe_hw *hw, u32 vlan, u32 vind, bool vlan_on)
793171384Sjfv{
794179055Sjfv	return ixgbe_call_func(hw, hw->mac.ops.set_vfta, (hw, vlan, vind,
795179055Sjfv	                       vlan_on), IXGBE_NOT_IMPLEMENTED);
796171384Sjfv}
797171384Sjfv
798171384Sjfv/**
799190873Sjfv *  ixgbe_fc_enable - Enable flow control
800171384Sjfv *  @hw: pointer to hardware structure
801171384Sjfv *  @packetbuf_num: packet buffer number (0-7)
802171384Sjfv *
803171384Sjfv *  Configures the flow control settings based on SW configuration.
804171384Sjfv **/
805190873Sjfvs32 ixgbe_fc_enable(struct ixgbe_hw *hw, s32 packetbuf_num)
806171384Sjfv{
807190873Sjfv	return ixgbe_call_func(hw, hw->mac.ops.fc_enable, (hw, packetbuf_num),
808179055Sjfv	                       IXGBE_NOT_IMPLEMENTED);
809171384Sjfv}
810171384Sjfv
811172043Sjfv/**
812172043Sjfv *  ixgbe_read_analog_reg8 - Reads 8 bit analog register
813172043Sjfv *  @hw: pointer to hardware structure
814172043Sjfv *  @reg: analog register to read
815172043Sjfv *  @val: read value
816172043Sjfv *
817172043Sjfv *  Performs write operation to analog register specified.
818172043Sjfv **/
819172043Sjfvs32 ixgbe_read_analog_reg8(struct ixgbe_hw *hw, u32 reg, u8 *val)
820172043Sjfv{
821179055Sjfv	return ixgbe_call_func(hw, hw->mac.ops.read_analog_reg8, (hw, reg,
822179055Sjfv	                       val), IXGBE_NOT_IMPLEMENTED);
823172043Sjfv}
824172043Sjfv
825172043Sjfv/**
826172043Sjfv *  ixgbe_write_analog_reg8 - Writes 8 bit analog register
827172043Sjfv *  @hw: pointer to hardware structure
828172043Sjfv *  @reg: analog register to write
829172043Sjfv *  @val: value to write
830172043Sjfv *
831172043Sjfv *  Performs write operation to Atlas analog register specified.
832172043Sjfv **/
833172043Sjfvs32 ixgbe_write_analog_reg8(struct ixgbe_hw *hw, u32 reg, u8 val)
834172043Sjfv{
835179055Sjfv	return ixgbe_call_func(hw, hw->mac.ops.write_analog_reg8, (hw, reg,
836179055Sjfv	                       val), IXGBE_NOT_IMPLEMENTED);
837172043Sjfv}
838172043Sjfv
839181003Sjfv/**
840181003Sjfv *  ixgbe_init_uta_tables - Initializes Unicast Table Arrays.
841181003Sjfv *  @hw: pointer to hardware structure
842181003Sjfv *
843185352Sjfv *  Initializes the Unicast Table Arrays to zero on device load.  This
844185352Sjfv *  is part of the Rx init addr execution path.
845181003Sjfv **/
846181003Sjfvs32 ixgbe_init_uta_tables(struct ixgbe_hw *hw)
847181003Sjfv{
848181003Sjfv	return ixgbe_call_func(hw, hw->mac.ops.init_uta_tables, (hw),
849181003Sjfv	                       IXGBE_NOT_IMPLEMENTED);
850181003Sjfv}
851185352Sjfv
852185352Sjfv/**
853190873Sjfv *  ixgbe_read_i2c_byte - Reads 8 bit word over I2C at specified device address
854190873Sjfv *  @hw: pointer to hardware structure
855190873Sjfv *  @byte_offset: byte offset to read
856190873Sjfv *  @data: value read
857190873Sjfv *
858190873Sjfv *  Performs byte read operation to SFP module's EEPROM over I2C interface.
859190873Sjfv **/
860190873Sjfvs32 ixgbe_read_i2c_byte(struct ixgbe_hw *hw, u8 byte_offset, u8 dev_addr,
861190873Sjfv                        u8 *data)
862190873Sjfv{
863190873Sjfv	return ixgbe_call_func(hw, hw->phy.ops.read_i2c_byte, (hw, byte_offset,
864190873Sjfv	                       dev_addr, data), IXGBE_NOT_IMPLEMENTED);
865190873Sjfv}
866190873Sjfv
867190873Sjfv/**
868190873Sjfv *  ixgbe_write_i2c_byte - Writes 8 bit word over I2C
869190873Sjfv *  @hw: pointer to hardware structure
870190873Sjfv *  @byte_offset: byte offset to write
871190873Sjfv *  @data: value to write
872190873Sjfv *
873190873Sjfv *  Performs byte write operation to SFP module's EEPROM over I2C interface
874190873Sjfv *  at a specified device address.
875190873Sjfv **/
876190873Sjfvs32 ixgbe_write_i2c_byte(struct ixgbe_hw *hw, u8 byte_offset, u8 dev_addr,
877190873Sjfv                         u8 data)
878190873Sjfv{
879190873Sjfv	return ixgbe_call_func(hw, hw->phy.ops.write_i2c_byte, (hw, byte_offset,
880190873Sjfv	                       dev_addr, data), IXGBE_NOT_IMPLEMENTED);
881190873Sjfv}
882190873Sjfv
883190873Sjfv/**
884190873Sjfv *  ixgbe_write_i2c_eeprom - Writes 8 bit EEPROM word over I2C interface
885190873Sjfv *  @hw: pointer to hardware structure
886190873Sjfv *  @byte_offset: EEPROM byte offset to write
887190873Sjfv *  @eeprom_data: value to write
888190873Sjfv *
889190873Sjfv *  Performs byte write operation to SFP module's EEPROM over I2C interface.
890190873Sjfv **/
891190873Sjfvs32 ixgbe_write_i2c_eeprom(struct ixgbe_hw *hw,
892190873Sjfv                           u8 byte_offset, u8 eeprom_data)
893190873Sjfv{
894190873Sjfv	return ixgbe_call_func(hw, hw->phy.ops.write_i2c_eeprom,
895190873Sjfv	                       (hw, byte_offset, eeprom_data),
896190873Sjfv	                       IXGBE_NOT_IMPLEMENTED);
897190873Sjfv}
898190873Sjfv
899190873Sjfv/**
900185352Sjfv *  ixgbe_read_i2c_eeprom - Reads 8 bit EEPROM word over I2C interface
901185352Sjfv *  @hw: pointer to hardware structure
902185352Sjfv *  @byte_offset: EEPROM byte offset to read
903185352Sjfv *  @eeprom_data: value read
904185352Sjfv *
905185352Sjfv *  Performs byte read operation to SFP module's EEPROM over I2C interface.
906185352Sjfv **/
907185352Sjfvs32 ixgbe_read_i2c_eeprom(struct ixgbe_hw *hw, u8 byte_offset, u8 *eeprom_data)
908185352Sjfv{
909185352Sjfv	return ixgbe_call_func(hw, hw->phy.ops.read_i2c_eeprom,
910185352Sjfv	                      (hw, byte_offset, eeprom_data),
911185352Sjfv	                      IXGBE_NOT_IMPLEMENTED);
912185352Sjfv}
913185352Sjfv
914185352Sjfv/**
915185352Sjfv *  ixgbe_get_supported_physical_layer - Returns physical layer type
916185352Sjfv *  @hw: pointer to hardware structure
917185352Sjfv *
918185352Sjfv *  Determines physical layer capabilities of the current configuration.
919185352Sjfv **/
920185352Sjfvu32 ixgbe_get_supported_physical_layer(struct ixgbe_hw *hw)
921185352Sjfv{
922185352Sjfv	return ixgbe_call_func(hw, hw->mac.ops.get_supported_physical_layer,
923185352Sjfv	                       (hw), IXGBE_PHYSICAL_LAYER_UNKNOWN);
924185352Sjfv}
925190873Sjfv
926190873Sjfv/**
927190873Sjfv *  ixgbe_enable_rx_dma - Enables Rx DMA unit, dependant on device specifics
928190873Sjfv *  @hw: pointer to hardware structure
929190873Sjfv *  @regval: bitfield to write to the Rx DMA register
930190873Sjfv *
931190873Sjfv *  Enables the Rx DMA unit of the device.
932190873Sjfv **/
933190873Sjfvs32 ixgbe_enable_rx_dma(struct ixgbe_hw *hw, u32 regval)
934190873Sjfv{
935190873Sjfv	return ixgbe_call_func(hw, hw->mac.ops.enable_rx_dma,
936190873Sjfv	                       (hw, regval), IXGBE_NOT_IMPLEMENTED);
937190873Sjfv}
938