Deleted Added
full compact
ixgbe_api.c (225736) ixgbe_api.c (235528)
1/******************************************************************************
2
1/******************************************************************************
2
3 Copyright (c) 2001-2010, Intel Corporation
3 Copyright (c) 2001-2012, Intel Corporation
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8
9 1. Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer.
11

--- 13 unchanged lines hidden (view full) ---

25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
31
32******************************************************************************/
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8
9 1. Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer.
11

--- 13 unchanged lines hidden (view full) ---

25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
31
32******************************************************************************/
33/*$FreeBSD: stable/9/sys/dev/ixgbe/ixgbe_api.c 215911 2010-11-26 22:46:32Z jfv $*/
33/*$FreeBSD: stable/9/sys/dev/ixgbe/ixgbe_api.c 235528 2012-05-17 00:06:54Z jfv $*/
34
35#include "ixgbe_api.h"
36#include "ixgbe_common.h"
37
34
35#include "ixgbe_api.h"
36#include "ixgbe_common.h"
37
38extern s32 ixgbe_init_ops_82598(struct ixgbe_hw *hw);
39extern s32 ixgbe_init_ops_82599(struct ixgbe_hw *hw);
40extern s32 ixgbe_init_ops_vf(struct ixgbe_hw *hw);
41
42/**
43 * ixgbe_init_shared_code - Initialize the shared code
44 * @hw: pointer to hardware structure
45 *
46 * This will assign function pointers and assign the MAC type and PHY code.
47 * Does not touch the hardware. This function must be called prior to any
48 * other function in the shared code. The ixgbe_hw structure should be
49 * memset to 0 prior to calling this function. The following fields in

--- 15 unchanged lines hidden (view full) ---

65 switch (hw->mac.type) {
66 case ixgbe_mac_82598EB:
67 status = ixgbe_init_ops_82598(hw);
68 break;
69 case ixgbe_mac_82599EB:
70 status = ixgbe_init_ops_82599(hw);
71 break;
72 case ixgbe_mac_82599_vf:
38/**
39 * ixgbe_init_shared_code - Initialize the shared code
40 * @hw: pointer to hardware structure
41 *
42 * This will assign function pointers and assign the MAC type and PHY code.
43 * Does not touch the hardware. This function must be called prior to any
44 * other function in the shared code. The ixgbe_hw structure should be
45 * memset to 0 prior to calling this function. The following fields in

--- 15 unchanged lines hidden (view full) ---

61 switch (hw->mac.type) {
62 case ixgbe_mac_82598EB:
63 status = ixgbe_init_ops_82598(hw);
64 break;
65 case ixgbe_mac_82599EB:
66 status = ixgbe_init_ops_82599(hw);
67 break;
68 case ixgbe_mac_82599_vf:
69 case ixgbe_mac_X540_vf:
73 status = ixgbe_init_ops_vf(hw);
74 break;
70 status = ixgbe_init_ops_vf(hw);
71 break;
72 case ixgbe_mac_X540:
73 status = ixgbe_init_ops_X540(hw);
74 break;
75 default:
76 status = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
77 break;
78 }
79
80 return status;
81}
82

--- 25 unchanged lines hidden (view full) ---

108 case IXGBE_DEV_ID_82598EB_XF_LR:
109 case IXGBE_DEV_ID_82598EB_SFP_LOM:
110 hw->mac.type = ixgbe_mac_82598EB;
111 break;
112 case IXGBE_DEV_ID_82599_KX4:
113 case IXGBE_DEV_ID_82599_KX4_MEZZ:
114 case IXGBE_DEV_ID_82599_XAUI_LOM:
115 case IXGBE_DEV_ID_82599_COMBO_BACKPLANE:
75 default:
76 status = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
77 break;
78 }
79
80 return status;
81}
82

--- 25 unchanged lines hidden (view full) ---

108 case IXGBE_DEV_ID_82598EB_XF_LR:
109 case IXGBE_DEV_ID_82598EB_SFP_LOM:
110 hw->mac.type = ixgbe_mac_82598EB;
111 break;
112 case IXGBE_DEV_ID_82599_KX4:
113 case IXGBE_DEV_ID_82599_KX4_MEZZ:
114 case IXGBE_DEV_ID_82599_XAUI_LOM:
115 case IXGBE_DEV_ID_82599_COMBO_BACKPLANE:
116 case IXGBE_DEV_ID_82599_KR:
116 case IXGBE_DEV_ID_82599_SFP:
117 case IXGBE_DEV_ID_82599_BACKPLANE_FCOE:
118 case IXGBE_DEV_ID_82599_SFP_FCOE:
117 case IXGBE_DEV_ID_82599_SFP:
118 case IXGBE_DEV_ID_82599_BACKPLANE_FCOE:
119 case IXGBE_DEV_ID_82599_SFP_FCOE:
120 case IXGBE_DEV_ID_82599_SFP_EM:
121 case IXGBE_DEV_ID_82599EN_SFP:
119 case IXGBE_DEV_ID_82599_CX4:
120 case IXGBE_DEV_ID_82599_T3_LOM:
121 hw->mac.type = ixgbe_mac_82599EB;
122 break;
123 case IXGBE_DEV_ID_82599_VF:
124 hw->mac.type = ixgbe_mac_82599_vf;
125 break;
122 case IXGBE_DEV_ID_82599_CX4:
123 case IXGBE_DEV_ID_82599_T3_LOM:
124 hw->mac.type = ixgbe_mac_82599EB;
125 break;
126 case IXGBE_DEV_ID_82599_VF:
127 hw->mac.type = ixgbe_mac_82599_vf;
128 break;
129 case IXGBE_DEV_ID_X540_VF:
130 hw->mac.type = ixgbe_mac_X540_vf;
131 break;
132 case IXGBE_DEV_ID_X540T:
133 hw->mac.type = ixgbe_mac_X540;
134 break;
126 default:
127 ret_val = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
128 break;
129 }
130 } else {
131 ret_val = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
132 }
133
134 DEBUGOUT2("ixgbe_set_mac_type found mac: %d, returns: %d\n",
135 default:
136 ret_val = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
137 break;
138 }
139 } else {
140 ret_val = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
141 }
142
143 DEBUGOUT2("ixgbe_set_mac_type found mac: %d, returns: %d\n",
135 hw->mac.type, ret_val);
144 hw->mac.type, ret_val);
136 return ret_val;
137}
138
139/**
140 * ixgbe_init_hw - Initialize the hardware
141 * @hw: pointer to hardware structure
142 *
143 * Initialize the hardware by resetting and then starting the hardware
144 **/
145s32 ixgbe_init_hw(struct ixgbe_hw *hw)
146{
147 return ixgbe_call_func(hw, hw->mac.ops.init_hw, (hw),
145 return ret_val;
146}
147
148/**
149 * ixgbe_init_hw - Initialize the hardware
150 * @hw: pointer to hardware structure
151 *
152 * Initialize the hardware by resetting and then starting the hardware
153 **/
154s32 ixgbe_init_hw(struct ixgbe_hw *hw)
155{
156 return ixgbe_call_func(hw, hw->mac.ops.init_hw, (hw),
148 IXGBE_NOT_IMPLEMENTED);
157 IXGBE_NOT_IMPLEMENTED);
149}
150
151/**
152 * ixgbe_reset_hw - Performs a hardware reset
153 * @hw: pointer to hardware structure
154 *
155 * Resets the hardware by resetting the transmit and receive units, masks and
156 * clears all interrupts, performs a PHY reset, and performs a MAC reset
157 **/
158s32 ixgbe_reset_hw(struct ixgbe_hw *hw)
159{
160 return ixgbe_call_func(hw, hw->mac.ops.reset_hw, (hw),
158}
159
160/**
161 * ixgbe_reset_hw - Performs a hardware reset
162 * @hw: pointer to hardware structure
163 *
164 * Resets the hardware by resetting the transmit and receive units, masks and
165 * clears all interrupts, performs a PHY reset, and performs a MAC reset
166 **/
167s32 ixgbe_reset_hw(struct ixgbe_hw *hw)
168{
169 return ixgbe_call_func(hw, hw->mac.ops.reset_hw, (hw),
161 IXGBE_NOT_IMPLEMENTED);
170 IXGBE_NOT_IMPLEMENTED);
162}
163
164/**
165 * ixgbe_start_hw - Prepares hardware for Rx/Tx
166 * @hw: pointer to hardware structure
167 *
168 * Starts the hardware by filling the bus info structure and media type,
169 * clears all on chip counters, initializes receive address registers,
170 * multicast table, VLAN filter table, calls routine to setup link and
171 * flow control settings, and leaves transmit and receive units disabled
172 * and uninitialized.
173 **/
174s32 ixgbe_start_hw(struct ixgbe_hw *hw)
175{
176 return ixgbe_call_func(hw, hw->mac.ops.start_hw, (hw),
171}
172
173/**
174 * ixgbe_start_hw - Prepares hardware for Rx/Tx
175 * @hw: pointer to hardware structure
176 *
177 * Starts the hardware by filling the bus info structure and media type,
178 * clears all on chip counters, initializes receive address registers,
179 * multicast table, VLAN filter table, calls routine to setup link and
180 * flow control settings, and leaves transmit and receive units disabled
181 * and uninitialized.
182 **/
183s32 ixgbe_start_hw(struct ixgbe_hw *hw)
184{
185 return ixgbe_call_func(hw, hw->mac.ops.start_hw, (hw),
177 IXGBE_NOT_IMPLEMENTED);
186 IXGBE_NOT_IMPLEMENTED);
178}
179
180/**
181 * ixgbe_enable_relaxed_ordering - Enables tx relaxed ordering,
182 * which is disabled by default in ixgbe_start_hw();
183 *
184 * @hw: pointer to hardware structure
185 *

--- 10 unchanged lines hidden (view full) ---

196 * @hw: pointer to hardware structure
197 *
198 * Clears all hardware statistics counters by reading them from the hardware
199 * Statistics counters are clear on read.
200 **/
201s32 ixgbe_clear_hw_cntrs(struct ixgbe_hw *hw)
202{
203 return ixgbe_call_func(hw, hw->mac.ops.clear_hw_cntrs, (hw),
187}
188
189/**
190 * ixgbe_enable_relaxed_ordering - Enables tx relaxed ordering,
191 * which is disabled by default in ixgbe_start_hw();
192 *
193 * @hw: pointer to hardware structure
194 *

--- 10 unchanged lines hidden (view full) ---

205 * @hw: pointer to hardware structure
206 *
207 * Clears all hardware statistics counters by reading them from the hardware
208 * Statistics counters are clear on read.
209 **/
210s32 ixgbe_clear_hw_cntrs(struct ixgbe_hw *hw)
211{
212 return ixgbe_call_func(hw, hw->mac.ops.clear_hw_cntrs, (hw),
204 IXGBE_NOT_IMPLEMENTED);
213 IXGBE_NOT_IMPLEMENTED);
205}
206
207/**
208 * ixgbe_get_media_type - Get media type
209 * @hw: pointer to hardware structure
210 *
211 * Returns the media type (fiber, copper, backplane)
212 **/
213enum ixgbe_media_type ixgbe_get_media_type(struct ixgbe_hw *hw)
214{
215 return ixgbe_call_func(hw, hw->mac.ops.get_media_type, (hw),
214}
215
216/**
217 * ixgbe_get_media_type - Get media type
218 * @hw: pointer to hardware structure
219 *
220 * Returns the media type (fiber, copper, backplane)
221 **/
222enum ixgbe_media_type ixgbe_get_media_type(struct ixgbe_hw *hw)
223{
224 return ixgbe_call_func(hw, hw->mac.ops.get_media_type, (hw),
216 ixgbe_media_type_unknown);
225 ixgbe_media_type_unknown);
217}
218
219/**
220 * ixgbe_get_mac_addr - Get MAC address
221 * @hw: pointer to hardware structure
222 * @mac_addr: Adapter MAC address
223 *
224 * Reads the adapter's MAC address from the first Receive Address Register
225 * (RAR0) A reset of the adapter must have been performed prior to calling
226 * this function in order for the MAC address to have been loaded from the
227 * EEPROM into RAR0
228 **/
229s32 ixgbe_get_mac_addr(struct ixgbe_hw *hw, u8 *mac_addr)
230{
231 return ixgbe_call_func(hw, hw->mac.ops.get_mac_addr,
226}
227
228/**
229 * ixgbe_get_mac_addr - Get MAC address
230 * @hw: pointer to hardware structure
231 * @mac_addr: Adapter MAC address
232 *
233 * Reads the adapter's MAC address from the first Receive Address Register
234 * (RAR0) A reset of the adapter must have been performed prior to calling
235 * this function in order for the MAC address to have been loaded from the
236 * EEPROM into RAR0
237 **/
238s32 ixgbe_get_mac_addr(struct ixgbe_hw *hw, u8 *mac_addr)
239{
240 return ixgbe_call_func(hw, hw->mac.ops.get_mac_addr,
232 (hw, mac_addr), IXGBE_NOT_IMPLEMENTED);
241 (hw, mac_addr), IXGBE_NOT_IMPLEMENTED);
233}
234
235/**
236 * ixgbe_get_san_mac_addr - Get SAN MAC address
237 * @hw: pointer to hardware structure
238 * @san_mac_addr: SAN MAC address
239 *
240 * Reads the SAN MAC address from the EEPROM, if it's available. This is
241 * per-port, so set_lan_id() must be called before reading the addresses.
242 **/
243s32 ixgbe_get_san_mac_addr(struct ixgbe_hw *hw, u8 *san_mac_addr)
244{
245 return ixgbe_call_func(hw, hw->mac.ops.get_san_mac_addr,
242}
243
244/**
245 * ixgbe_get_san_mac_addr - Get SAN MAC address
246 * @hw: pointer to hardware structure
247 * @san_mac_addr: SAN MAC address
248 *
249 * Reads the SAN MAC address from the EEPROM, if it's available. This is
250 * per-port, so set_lan_id() must be called before reading the addresses.
251 **/
252s32 ixgbe_get_san_mac_addr(struct ixgbe_hw *hw, u8 *san_mac_addr)
253{
254 return ixgbe_call_func(hw, hw->mac.ops.get_san_mac_addr,
246 (hw, san_mac_addr), IXGBE_NOT_IMPLEMENTED);
255 (hw, san_mac_addr), IXGBE_NOT_IMPLEMENTED);
247}
248
249/**
250 * ixgbe_set_san_mac_addr - Write a SAN MAC address
251 * @hw: pointer to hardware structure
252 * @san_mac_addr: SAN MAC address
253 *
254 * Writes A SAN MAC address to the EEPROM.
255 **/
256s32 ixgbe_set_san_mac_addr(struct ixgbe_hw *hw, u8 *san_mac_addr)
257{
258 return ixgbe_call_func(hw, hw->mac.ops.set_san_mac_addr,
256}
257
258/**
259 * ixgbe_set_san_mac_addr - Write a SAN MAC address
260 * @hw: pointer to hardware structure
261 * @san_mac_addr: SAN MAC address
262 *
263 * Writes A SAN MAC address to the EEPROM.
264 **/
265s32 ixgbe_set_san_mac_addr(struct ixgbe_hw *hw, u8 *san_mac_addr)
266{
267 return ixgbe_call_func(hw, hw->mac.ops.set_san_mac_addr,
259 (hw, san_mac_addr), IXGBE_NOT_IMPLEMENTED);
268 (hw, san_mac_addr), IXGBE_NOT_IMPLEMENTED);
260}
261
262/**
263 * ixgbe_get_device_caps - Get additional device capabilities
264 * @hw: pointer to hardware structure
265 * @device_caps: the EEPROM word for device capabilities
266 *
267 * Reads the extra device capabilities from the EEPROM
268 **/
269s32 ixgbe_get_device_caps(struct ixgbe_hw *hw, u16 *device_caps)
270{
271 return ixgbe_call_func(hw, hw->mac.ops.get_device_caps,
269}
270
271/**
272 * ixgbe_get_device_caps - Get additional device capabilities
273 * @hw: pointer to hardware structure
274 * @device_caps: the EEPROM word for device capabilities
275 *
276 * Reads the extra device capabilities from the EEPROM
277 **/
278s32 ixgbe_get_device_caps(struct ixgbe_hw *hw, u16 *device_caps)
279{
280 return ixgbe_call_func(hw, hw->mac.ops.get_device_caps,
272 (hw, device_caps), IXGBE_NOT_IMPLEMENTED);
281 (hw, device_caps), IXGBE_NOT_IMPLEMENTED);
273}
274
275/**
276 * ixgbe_get_wwn_prefix - Get alternative WWNN/WWPN prefix from the EEPROM
277 * @hw: pointer to hardware structure
278 * @wwnn_prefix: the alternative WWNN prefix
279 * @wwpn_prefix: the alternative WWPN prefix
280 *
281 * This function will read the EEPROM from the alternative SAN MAC address
282 * block to check the support for the alternative WWNN/WWPN prefix support.
283 **/
284s32 ixgbe_get_wwn_prefix(struct ixgbe_hw *hw, u16 *wwnn_prefix,
282}
283
284/**
285 * ixgbe_get_wwn_prefix - Get alternative WWNN/WWPN prefix from the EEPROM
286 * @hw: pointer to hardware structure
287 * @wwnn_prefix: the alternative WWNN prefix
288 * @wwpn_prefix: the alternative WWPN prefix
289 *
290 * This function will read the EEPROM from the alternative SAN MAC address
291 * block to check the support for the alternative WWNN/WWPN prefix support.
292 **/
293s32 ixgbe_get_wwn_prefix(struct ixgbe_hw *hw, u16 *wwnn_prefix,
285 u16 *wwpn_prefix)
294 u16 *wwpn_prefix)
286{
287 return ixgbe_call_func(hw, hw->mac.ops.get_wwn_prefix,
295{
296 return ixgbe_call_func(hw, hw->mac.ops.get_wwn_prefix,
288 (hw, wwnn_prefix, wwpn_prefix),
289 IXGBE_NOT_IMPLEMENTED);
297 (hw, wwnn_prefix, wwpn_prefix),
298 IXGBE_NOT_IMPLEMENTED);
290}
291
292/**
293 * ixgbe_get_fcoe_boot_status - Get FCOE boot status from EEPROM
294 * @hw: pointer to hardware structure
295 * @bs: the fcoe boot status
296 *
297 * This function will read the FCOE boot status from the iSCSI FCOE block
298 **/
299s32 ixgbe_get_fcoe_boot_status(struct ixgbe_hw *hw, u16 *bs)
300{
301 return ixgbe_call_func(hw, hw->mac.ops.get_fcoe_boot_status,
299}
300
301/**
302 * ixgbe_get_fcoe_boot_status - Get FCOE boot status from EEPROM
303 * @hw: pointer to hardware structure
304 * @bs: the fcoe boot status
305 *
306 * This function will read the FCOE boot status from the iSCSI FCOE block
307 **/
308s32 ixgbe_get_fcoe_boot_status(struct ixgbe_hw *hw, u16 *bs)
309{
310 return ixgbe_call_func(hw, hw->mac.ops.get_fcoe_boot_status,
302 (hw, bs),
303 IXGBE_NOT_IMPLEMENTED);
311 (hw, bs),
312 IXGBE_NOT_IMPLEMENTED);
304}
305
306/**
307 * ixgbe_get_bus_info - Set PCI bus info
308 * @hw: pointer to hardware structure
309 *
310 * Sets the PCI bus info (speed, width, type) within the ixgbe_hw structure
311 **/
312s32 ixgbe_get_bus_info(struct ixgbe_hw *hw)
313{
314 return ixgbe_call_func(hw, hw->mac.ops.get_bus_info, (hw),
313}
314
315/**
316 * ixgbe_get_bus_info - Set PCI bus info
317 * @hw: pointer to hardware structure
318 *
319 * Sets the PCI bus info (speed, width, type) within the ixgbe_hw structure
320 **/
321s32 ixgbe_get_bus_info(struct ixgbe_hw *hw)
322{
323 return ixgbe_call_func(hw, hw->mac.ops.get_bus_info, (hw),
315 IXGBE_NOT_IMPLEMENTED);
324 IXGBE_NOT_IMPLEMENTED);
316}
317
318/**
319 * ixgbe_get_num_of_tx_queues - Get Tx queues
320 * @hw: pointer to hardware structure
321 *
322 * Returns the number of transmit queues for the given adapter.
323 **/

--- 20 unchanged lines hidden (view full) ---

344 * Sets the adapter_stopped flag within ixgbe_hw struct. Clears interrupts,
345 * disables transmit and receive units. The adapter_stopped flag is used by
346 * the shared code and drivers to determine if the adapter is in a stopped
347 * state and should not touch the hardware.
348 **/
349s32 ixgbe_stop_adapter(struct ixgbe_hw *hw)
350{
351 return ixgbe_call_func(hw, hw->mac.ops.stop_adapter, (hw),
325}
326
327/**
328 * ixgbe_get_num_of_tx_queues - Get Tx queues
329 * @hw: pointer to hardware structure
330 *
331 * Returns the number of transmit queues for the given adapter.
332 **/

--- 20 unchanged lines hidden (view full) ---

353 * Sets the adapter_stopped flag within ixgbe_hw struct. Clears interrupts,
354 * disables transmit and receive units. The adapter_stopped flag is used by
355 * the shared code and drivers to determine if the adapter is in a stopped
356 * state and should not touch the hardware.
357 **/
358s32 ixgbe_stop_adapter(struct ixgbe_hw *hw)
359{
360 return ixgbe_call_func(hw, hw->mac.ops.stop_adapter, (hw),
352 IXGBE_NOT_IMPLEMENTED);
361 IXGBE_NOT_IMPLEMENTED);
353}
354
355/**
356 * ixgbe_read_pba_string - Reads part number string from EEPROM
357 * @hw: pointer to hardware structure
358 * @pba_num: stores the part number string from the EEPROM
359 * @pba_num_size: part number string buffer length
360 *
361 * Reads the part number string from the EEPROM.
362 **/
363s32 ixgbe_read_pba_string(struct ixgbe_hw *hw, u8 *pba_num, u32 pba_num_size)
364{
365 return ixgbe_read_pba_string_generic(hw, pba_num, pba_num_size);
366}
367
368/**
362}
363
364/**
365 * ixgbe_read_pba_string - Reads part number string from EEPROM
366 * @hw: pointer to hardware structure
367 * @pba_num: stores the part number string from the EEPROM
368 * @pba_num_size: part number string buffer length
369 *
370 * Reads the part number string from the EEPROM.
371 **/
372s32 ixgbe_read_pba_string(struct ixgbe_hw *hw, u8 *pba_num, u32 pba_num_size)
373{
374 return ixgbe_read_pba_string_generic(hw, pba_num, pba_num_size);
375}
376
377/**
369 * ixgbe_read_pba_length - Reads part number string length from EEPROM
370 * @hw: pointer to hardware structure
371 * @pba_num_size: part number string buffer length
372 *
373 * Reads the part number length from the EEPROM.
374 * Returns expected buffer size in pba_num_size.
375 **/
376s32 ixgbe_read_pba_length(struct ixgbe_hw *hw, u32 *pba_num_size)
377{
378 return ixgbe_read_pba_length_generic(hw, pba_num_size);
379}
380
381/**
382 * ixgbe_read_pba_num - Reads part number from EEPROM
383 * @hw: pointer to hardware structure
384 * @pba_num: stores the part number from the EEPROM
385 *
386 * Reads the part number from the EEPROM.
387 **/
388s32 ixgbe_read_pba_num(struct ixgbe_hw *hw, u32 *pba_num)
389{

--- 7 unchanged lines hidden (view full) ---

397 * Determines the physical layer module found on the current adapter.
398 **/
399s32 ixgbe_identify_phy(struct ixgbe_hw *hw)
400{
401 s32 status = IXGBE_SUCCESS;
402
403 if (hw->phy.type == ixgbe_phy_unknown) {
404 status = ixgbe_call_func(hw, hw->phy.ops.identify, (hw),
378 * ixgbe_read_pba_num - Reads part number from EEPROM
379 * @hw: pointer to hardware structure
380 * @pba_num: stores the part number from the EEPROM
381 *
382 * Reads the part number from the EEPROM.
383 **/
384s32 ixgbe_read_pba_num(struct ixgbe_hw *hw, u32 *pba_num)
385{

--- 7 unchanged lines hidden (view full) ---

393 * Determines the physical layer module found on the current adapter.
394 **/
395s32 ixgbe_identify_phy(struct ixgbe_hw *hw)
396{
397 s32 status = IXGBE_SUCCESS;
398
399 if (hw->phy.type == ixgbe_phy_unknown) {
400 status = ixgbe_call_func(hw, hw->phy.ops.identify, (hw),
405 IXGBE_NOT_IMPLEMENTED);
401 IXGBE_NOT_IMPLEMENTED);
406 }
407
408 return status;
409}
410
411/**
412 * ixgbe_reset_phy - Perform a PHY reset
413 * @hw: pointer to hardware structure

--- 4 unchanged lines hidden (view full) ---

418
419 if (hw->phy.type == ixgbe_phy_unknown) {
420 if (ixgbe_identify_phy(hw) != IXGBE_SUCCESS)
421 status = IXGBE_ERR_PHY;
422 }
423
424 if (status == IXGBE_SUCCESS) {
425 status = ixgbe_call_func(hw, hw->phy.ops.reset, (hw),
402 }
403
404 return status;
405}
406
407/**
408 * ixgbe_reset_phy - Perform a PHY reset
409 * @hw: pointer to hardware structure

--- 4 unchanged lines hidden (view full) ---

414
415 if (hw->phy.type == ixgbe_phy_unknown) {
416 if (ixgbe_identify_phy(hw) != IXGBE_SUCCESS)
417 status = IXGBE_ERR_PHY;
418 }
419
420 if (status == IXGBE_SUCCESS) {
421 status = ixgbe_call_func(hw, hw->phy.ops.reset, (hw),
426 IXGBE_NOT_IMPLEMENTED);
422 IXGBE_NOT_IMPLEMENTED);
427 }
428 return status;
429}
430
431/**
432 * ixgbe_get_phy_firmware_version -
433 * @hw: pointer to hardware structure
434 * @firmware_version: pointer to firmware version
435 **/
436s32 ixgbe_get_phy_firmware_version(struct ixgbe_hw *hw, u16 *firmware_version)
437{
438 s32 status = IXGBE_SUCCESS;
439
440 status = ixgbe_call_func(hw, hw->phy.ops.get_firmware_version,
423 }
424 return status;
425}
426
427/**
428 * ixgbe_get_phy_firmware_version -
429 * @hw: pointer to hardware structure
430 * @firmware_version: pointer to firmware version
431 **/
432s32 ixgbe_get_phy_firmware_version(struct ixgbe_hw *hw, u16 *firmware_version)
433{
434 s32 status = IXGBE_SUCCESS;
435
436 status = ixgbe_call_func(hw, hw->phy.ops.get_firmware_version,
441 (hw, firmware_version),
442 IXGBE_NOT_IMPLEMENTED);
437 (hw, firmware_version),
438 IXGBE_NOT_IMPLEMENTED);
443 return status;
444}
445
446/**
447 * ixgbe_read_phy_reg - Read PHY register
448 * @hw: pointer to hardware structure
449 * @reg_addr: 32 bit address of PHY register to read
450 * @phy_data: Pointer to read data from PHY register
451 *
452 * Reads a value from a specified PHY register
453 **/
454s32 ixgbe_read_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type,
439 return status;
440}
441
442/**
443 * ixgbe_read_phy_reg - Read PHY register
444 * @hw: pointer to hardware structure
445 * @reg_addr: 32 bit address of PHY register to read
446 * @phy_data: Pointer to read data from PHY register
447 *
448 * Reads a value from a specified PHY register
449 **/
450s32 ixgbe_read_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type,
455 u16 *phy_data)
451 u16 *phy_data)
456{
457 if (hw->phy.id == 0)
458 ixgbe_identify_phy(hw);
459
460 return ixgbe_call_func(hw, hw->phy.ops.read_reg, (hw, reg_addr,
452{
453 if (hw->phy.id == 0)
454 ixgbe_identify_phy(hw);
455
456 return ixgbe_call_func(hw, hw->phy.ops.read_reg, (hw, reg_addr,
461 device_type, phy_data), IXGBE_NOT_IMPLEMENTED);
457 device_type, phy_data), IXGBE_NOT_IMPLEMENTED);
462}
463
464/**
465 * ixgbe_write_phy_reg - Write PHY register
466 * @hw: pointer to hardware structure
467 * @reg_addr: 32 bit PHY register to write
468 * @phy_data: Data to write to the PHY register
469 *
470 * Writes a value to specified PHY register
471 **/
472s32 ixgbe_write_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type,
458}
459
460/**
461 * ixgbe_write_phy_reg - Write PHY register
462 * @hw: pointer to hardware structure
463 * @reg_addr: 32 bit PHY register to write
464 * @phy_data: Data to write to the PHY register
465 *
466 * Writes a value to specified PHY register
467 **/
468s32 ixgbe_write_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type,
473 u16 phy_data)
469 u16 phy_data)
474{
475 if (hw->phy.id == 0)
476 ixgbe_identify_phy(hw);
477
478 return ixgbe_call_func(hw, hw->phy.ops.write_reg, (hw, reg_addr,
470{
471 if (hw->phy.id == 0)
472 ixgbe_identify_phy(hw);
473
474 return ixgbe_call_func(hw, hw->phy.ops.write_reg, (hw, reg_addr,
479 device_type, phy_data), IXGBE_NOT_IMPLEMENTED);
475 device_type, phy_data), IXGBE_NOT_IMPLEMENTED);
480}
481
482/**
483 * ixgbe_setup_phy_link - Restart PHY autoneg
484 * @hw: pointer to hardware structure
485 *
486 * Restart autonegotiation and PHY and waits for completion.
487 **/
488s32 ixgbe_setup_phy_link(struct ixgbe_hw *hw)
489{
490 return ixgbe_call_func(hw, hw->phy.ops.setup_link, (hw),
476}
477
478/**
479 * ixgbe_setup_phy_link - Restart PHY autoneg
480 * @hw: pointer to hardware structure
481 *
482 * Restart autonegotiation and PHY and waits for completion.
483 **/
484s32 ixgbe_setup_phy_link(struct ixgbe_hw *hw)
485{
486 return ixgbe_call_func(hw, hw->phy.ops.setup_link, (hw),
491 IXGBE_NOT_IMPLEMENTED);
487 IXGBE_NOT_IMPLEMENTED);
492}
493
494/**
495 * ixgbe_check_phy_link - Determine link and speed status
496 * @hw: pointer to hardware structure
497 *
498 * Reads a PHY register to determine if link is up and the current speed for
499 * the PHY.
500 **/
501s32 ixgbe_check_phy_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
488}
489
490/**
491 * ixgbe_check_phy_link - Determine link and speed status
492 * @hw: pointer to hardware structure
493 *
494 * Reads a PHY register to determine if link is up and the current speed for
495 * the PHY.
496 **/
497s32 ixgbe_check_phy_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
502 bool *link_up)
498 bool *link_up)
503{
504 return ixgbe_call_func(hw, hw->phy.ops.check_link, (hw, speed,
499{
500 return ixgbe_call_func(hw, hw->phy.ops.check_link, (hw, speed,
505 link_up), IXGBE_NOT_IMPLEMENTED);
501 link_up), IXGBE_NOT_IMPLEMENTED);
506}
507
508/**
509 * ixgbe_setup_phy_link_speed - Set auto advertise
510 * @hw: pointer to hardware structure
511 * @speed: new link speed
512 * @autoneg: TRUE if autonegotiation enabled
513 *
514 * Sets the auto advertised capabilities
515 **/
516s32 ixgbe_setup_phy_link_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed,
502}
503
504/**
505 * ixgbe_setup_phy_link_speed - Set auto advertise
506 * @hw: pointer to hardware structure
507 * @speed: new link speed
508 * @autoneg: TRUE if autonegotiation enabled
509 *
510 * Sets the auto advertised capabilities
511 **/
512s32 ixgbe_setup_phy_link_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed,
517 bool autoneg,
518 bool autoneg_wait_to_complete)
513 bool autoneg,
514 bool autoneg_wait_to_complete)
519{
520 return ixgbe_call_func(hw, hw->phy.ops.setup_link_speed, (hw, speed,
515{
516 return ixgbe_call_func(hw, hw->phy.ops.setup_link_speed, (hw, speed,
521 autoneg, autoneg_wait_to_complete),
522 IXGBE_NOT_IMPLEMENTED);
517 autoneg, autoneg_wait_to_complete),
518 IXGBE_NOT_IMPLEMENTED);
523}
524
525/**
526 * ixgbe_check_link - Get link and speed status
527 * @hw: pointer to hardware structure
528 *
529 * Reads the links register to determine if link is up and the current speed
530 **/
531s32 ixgbe_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
519}
520
521/**
522 * ixgbe_check_link - Get link and speed status
523 * @hw: pointer to hardware structure
524 *
525 * Reads the links register to determine if link is up and the current speed
526 **/
527s32 ixgbe_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
532 bool *link_up, bool link_up_wait_to_complete)
528 bool *link_up, bool link_up_wait_to_complete)
533{
534 return ixgbe_call_func(hw, hw->mac.ops.check_link, (hw, speed,
529{
530 return ixgbe_call_func(hw, hw->mac.ops.check_link, (hw, speed,
535 link_up, link_up_wait_to_complete),
536 IXGBE_NOT_IMPLEMENTED);
531 link_up, link_up_wait_to_complete),
532 IXGBE_NOT_IMPLEMENTED);
537}
538
539/**
540 * ixgbe_disable_tx_laser - Disable Tx laser
541 * @hw: pointer to hardware structure
542 *
543 * If the driver needs to disable the laser on SFI optics.
544 **/

--- 34 unchanged lines hidden (view full) ---

579 * @hw: pointer to hardware structure
580 * @speed: new link speed
581 * @autoneg: TRUE if autonegotiation enabled
582 *
583 * Configures link settings. Restarts the link.
584 * Performs autonegotiation if needed.
585 **/
586s32 ixgbe_setup_link(struct ixgbe_hw *hw, ixgbe_link_speed speed,
533}
534
535/**
536 * ixgbe_disable_tx_laser - Disable Tx laser
537 * @hw: pointer to hardware structure
538 *
539 * If the driver needs to disable the laser on SFI optics.
540 **/

--- 34 unchanged lines hidden (view full) ---

575 * @hw: pointer to hardware structure
576 * @speed: new link speed
577 * @autoneg: TRUE if autonegotiation enabled
578 *
579 * Configures link settings. Restarts the link.
580 * Performs autonegotiation if needed.
581 **/
582s32 ixgbe_setup_link(struct ixgbe_hw *hw, ixgbe_link_speed speed,
587 bool autoneg,
588 bool autoneg_wait_to_complete)
583 bool autoneg,
584 bool autoneg_wait_to_complete)
589{
590 return ixgbe_call_func(hw, hw->mac.ops.setup_link, (hw, speed,
585{
586 return ixgbe_call_func(hw, hw->mac.ops.setup_link, (hw, speed,
591 autoneg, autoneg_wait_to_complete),
592 IXGBE_NOT_IMPLEMENTED);
587 autoneg, autoneg_wait_to_complete),
588 IXGBE_NOT_IMPLEMENTED);
593}
594
595/**
596 * ixgbe_get_link_capabilities - Returns link capabilities
597 * @hw: pointer to hardware structure
598 *
599 * Determines the link capabilities of the current configuration.
600 **/
601s32 ixgbe_get_link_capabilities(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
589}
590
591/**
592 * ixgbe_get_link_capabilities - Returns link capabilities
593 * @hw: pointer to hardware structure
594 *
595 * Determines the link capabilities of the current configuration.
596 **/
597s32 ixgbe_get_link_capabilities(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
602 bool *autoneg)
598 bool *autoneg)
603{
604 return ixgbe_call_func(hw, hw->mac.ops.get_link_capabilities, (hw,
599{
600 return ixgbe_call_func(hw, hw->mac.ops.get_link_capabilities, (hw,
605 speed, autoneg), IXGBE_NOT_IMPLEMENTED);
601 speed, autoneg), IXGBE_NOT_IMPLEMENTED);
606}
607
608/**
609 * ixgbe_led_on - Turn on LEDs
610 * @hw: pointer to hardware structure
611 * @index: led number to turn on
612 *
613 * Turns on the software controllable LEDs.
614 **/
615s32 ixgbe_led_on(struct ixgbe_hw *hw, u32 index)
616{
617 return ixgbe_call_func(hw, hw->mac.ops.led_on, (hw, index),
602}
603
604/**
605 * ixgbe_led_on - Turn on LEDs
606 * @hw: pointer to hardware structure
607 * @index: led number to turn on
608 *
609 * Turns on the software controllable LEDs.
610 **/
611s32 ixgbe_led_on(struct ixgbe_hw *hw, u32 index)
612{
613 return ixgbe_call_func(hw, hw->mac.ops.led_on, (hw, index),
618 IXGBE_NOT_IMPLEMENTED);
614 IXGBE_NOT_IMPLEMENTED);
619}
620
621/**
622 * ixgbe_led_off - Turn off LEDs
623 * @hw: pointer to hardware structure
624 * @index: led number to turn off
625 *
626 * Turns off the software controllable LEDs.
627 **/
628s32 ixgbe_led_off(struct ixgbe_hw *hw, u32 index)
629{
630 return ixgbe_call_func(hw, hw->mac.ops.led_off, (hw, index),
615}
616
617/**
618 * ixgbe_led_off - Turn off LEDs
619 * @hw: pointer to hardware structure
620 * @index: led number to turn off
621 *
622 * Turns off the software controllable LEDs.
623 **/
624s32 ixgbe_led_off(struct ixgbe_hw *hw, u32 index)
625{
626 return ixgbe_call_func(hw, hw->mac.ops.led_off, (hw, index),
631 IXGBE_NOT_IMPLEMENTED);
627 IXGBE_NOT_IMPLEMENTED);
632}
633
634/**
635 * ixgbe_blink_led_start - Blink LEDs
636 * @hw: pointer to hardware structure
637 * @index: led number to blink
638 *
639 * Blink LED based on index.
640 **/
641s32 ixgbe_blink_led_start(struct ixgbe_hw *hw, u32 index)
642{
643 return ixgbe_call_func(hw, hw->mac.ops.blink_led_start, (hw, index),
628}
629
630/**
631 * ixgbe_blink_led_start - Blink LEDs
632 * @hw: pointer to hardware structure
633 * @index: led number to blink
634 *
635 * Blink LED based on index.
636 **/
637s32 ixgbe_blink_led_start(struct ixgbe_hw *hw, u32 index)
638{
639 return ixgbe_call_func(hw, hw->mac.ops.blink_led_start, (hw, index),
644 IXGBE_NOT_IMPLEMENTED);
640 IXGBE_NOT_IMPLEMENTED);
645}
646
647/**
648 * ixgbe_blink_led_stop - Stop blinking LEDs
649 * @hw: pointer to hardware structure
650 *
651 * Stop blinking LED based on index.
652 **/
653s32 ixgbe_blink_led_stop(struct ixgbe_hw *hw, u32 index)
654{
655 return ixgbe_call_func(hw, hw->mac.ops.blink_led_stop, (hw, index),
641}
642
643/**
644 * ixgbe_blink_led_stop - Stop blinking LEDs
645 * @hw: pointer to hardware structure
646 *
647 * Stop blinking LED based on index.
648 **/
649s32 ixgbe_blink_led_stop(struct ixgbe_hw *hw, u32 index)
650{
651 return ixgbe_call_func(hw, hw->mac.ops.blink_led_stop, (hw, index),
656 IXGBE_NOT_IMPLEMENTED);
652 IXGBE_NOT_IMPLEMENTED);
657}
658
659/**
660 * ixgbe_init_eeprom_params - Initialize EEPROM parameters
661 * @hw: pointer to hardware structure
662 *
663 * Initializes the EEPROM parameters ixgbe_eeprom_info within the
664 * ixgbe_hw struct in order to set up EEPROM access.
665 **/
666s32 ixgbe_init_eeprom_params(struct ixgbe_hw *hw)
667{
668 return ixgbe_call_func(hw, hw->eeprom.ops.init_params, (hw),
653}
654
655/**
656 * ixgbe_init_eeprom_params - Initialize EEPROM parameters
657 * @hw: pointer to hardware structure
658 *
659 * Initializes the EEPROM parameters ixgbe_eeprom_info within the
660 * ixgbe_hw struct in order to set up EEPROM access.
661 **/
662s32 ixgbe_init_eeprom_params(struct ixgbe_hw *hw)
663{
664 return ixgbe_call_func(hw, hw->eeprom.ops.init_params, (hw),
669 IXGBE_NOT_IMPLEMENTED);
665 IXGBE_NOT_IMPLEMENTED);
670}
671
672
673/**
674 * ixgbe_write_eeprom - Write word to EEPROM
675 * @hw: pointer to hardware structure
676 * @offset: offset within the EEPROM to be written to
677 * @data: 16 bit word to be written to the EEPROM
678 *
679 * Writes 16 bit value to EEPROM. If ixgbe_eeprom_update_checksum is not
680 * called after this function, the EEPROM will most likely contain an
681 * invalid checksum.
682 **/
683s32 ixgbe_write_eeprom(struct ixgbe_hw *hw, u16 offset, u16 data)
684{
685 return ixgbe_call_func(hw, hw->eeprom.ops.write, (hw, offset, data),
666}
667
668
669/**
670 * ixgbe_write_eeprom - Write word to EEPROM
671 * @hw: pointer to hardware structure
672 * @offset: offset within the EEPROM to be written to
673 * @data: 16 bit word to be written to the EEPROM
674 *
675 * Writes 16 bit value to EEPROM. If ixgbe_eeprom_update_checksum is not
676 * called after this function, the EEPROM will most likely contain an
677 * invalid checksum.
678 **/
679s32 ixgbe_write_eeprom(struct ixgbe_hw *hw, u16 offset, u16 data)
680{
681 return ixgbe_call_func(hw, hw->eeprom.ops.write, (hw, offset, data),
686 IXGBE_NOT_IMPLEMENTED);
682 IXGBE_NOT_IMPLEMENTED);
687}
688
689/**
683}
684
685/**
686 * ixgbe_write_eeprom_buffer - Write word(s) to EEPROM
687 * @hw: pointer to hardware structure
688 * @offset: offset within the EEPROM to be written to
689 * @data: 16 bit word(s) to be written to the EEPROM
690 * @words: number of words
691 *
692 * Writes 16 bit word(s) to EEPROM. If ixgbe_eeprom_update_checksum is not
693 * called after this function, the EEPROM will most likely contain an
694 * invalid checksum.
695 **/
696s32 ixgbe_write_eeprom_buffer(struct ixgbe_hw *hw, u16 offset, u16 words,
697 u16 *data)
698{
699 return ixgbe_call_func(hw, hw->eeprom.ops.write_buffer,
700 (hw, offset, words, data),
701 IXGBE_NOT_IMPLEMENTED);
702}
703
704/**
690 * ixgbe_read_eeprom - Read word from EEPROM
691 * @hw: pointer to hardware structure
692 * @offset: offset within the EEPROM to be read
693 * @data: read 16 bit value from EEPROM
694 *
695 * Reads 16 bit value from EEPROM
696 **/
697s32 ixgbe_read_eeprom(struct ixgbe_hw *hw, u16 offset, u16 *data)
698{
699 return ixgbe_call_func(hw, hw->eeprom.ops.read, (hw, offset, data),
705 * ixgbe_read_eeprom - Read word from EEPROM
706 * @hw: pointer to hardware structure
707 * @offset: offset within the EEPROM to be read
708 * @data: read 16 bit value from EEPROM
709 *
710 * Reads 16 bit value from EEPROM
711 **/
712s32 ixgbe_read_eeprom(struct ixgbe_hw *hw, u16 offset, u16 *data)
713{
714 return ixgbe_call_func(hw, hw->eeprom.ops.read, (hw, offset, data),
700 IXGBE_NOT_IMPLEMENTED);
715 IXGBE_NOT_IMPLEMENTED);
701}
702
703/**
716}
717
718/**
719 * ixgbe_read_eeprom_buffer - Read word(s) from EEPROM
720 * @hw: pointer to hardware structure
721 * @offset: offset within the EEPROM to be read
722 * @data: read 16 bit word(s) from EEPROM
723 * @words: number of words
724 *
725 * Reads 16 bit word(s) from EEPROM
726 **/
727s32 ixgbe_read_eeprom_buffer(struct ixgbe_hw *hw, u16 offset,
728 u16 words, u16 *data)
729{
730 return ixgbe_call_func(hw, hw->eeprom.ops.read_buffer,
731 (hw, offset, words, data),
732 IXGBE_NOT_IMPLEMENTED);
733}
734
735/**
704 * ixgbe_validate_eeprom_checksum - Validate EEPROM checksum
705 * @hw: pointer to hardware structure
706 * @checksum_val: calculated checksum
707 *
708 * Performs checksum calculation and validates the EEPROM checksum
709 **/
710s32 ixgbe_validate_eeprom_checksum(struct ixgbe_hw *hw, u16 *checksum_val)
711{
712 return ixgbe_call_func(hw, hw->eeprom.ops.validate_checksum,
736 * ixgbe_validate_eeprom_checksum - Validate EEPROM checksum
737 * @hw: pointer to hardware structure
738 * @checksum_val: calculated checksum
739 *
740 * Performs checksum calculation and validates the EEPROM checksum
741 **/
742s32 ixgbe_validate_eeprom_checksum(struct ixgbe_hw *hw, u16 *checksum_val)
743{
744 return ixgbe_call_func(hw, hw->eeprom.ops.validate_checksum,
713 (hw, checksum_val), IXGBE_NOT_IMPLEMENTED);
745 (hw, checksum_val), IXGBE_NOT_IMPLEMENTED);
714}
715
716/**
717 * ixgbe_eeprom_update_checksum - Updates the EEPROM checksum
718 * @hw: pointer to hardware structure
719 **/
720s32 ixgbe_update_eeprom_checksum(struct ixgbe_hw *hw)
721{
722 return ixgbe_call_func(hw, hw->eeprom.ops.update_checksum, (hw),
746}
747
748/**
749 * ixgbe_eeprom_update_checksum - Updates the EEPROM checksum
750 * @hw: pointer to hardware structure
751 **/
752s32 ixgbe_update_eeprom_checksum(struct ixgbe_hw *hw)
753{
754 return ixgbe_call_func(hw, hw->eeprom.ops.update_checksum, (hw),
723 IXGBE_NOT_IMPLEMENTED);
755 IXGBE_NOT_IMPLEMENTED);
724}
725
726/**
727 * ixgbe_insert_mac_addr - Find a RAR for this mac address
728 * @hw: pointer to hardware structure
729 * @addr: Address to put into receive address register
730 * @vmdq: VMDq pool to assign
731 *
732 * Puts an ethernet address into a receive address register, or
733 * finds the rar that it is aleady in; adds to the pool list
734 **/
735s32 ixgbe_insert_mac_addr(struct ixgbe_hw *hw, u8 *addr, u32 vmdq)
736{
737 return ixgbe_call_func(hw, hw->mac.ops.insert_mac_addr,
756}
757
758/**
759 * ixgbe_insert_mac_addr - Find a RAR for this mac address
760 * @hw: pointer to hardware structure
761 * @addr: Address to put into receive address register
762 * @vmdq: VMDq pool to assign
763 *
764 * Puts an ethernet address into a receive address register, or
765 * finds the rar that it is aleady in; adds to the pool list
766 **/
767s32 ixgbe_insert_mac_addr(struct ixgbe_hw *hw, u8 *addr, u32 vmdq)
768{
769 return ixgbe_call_func(hw, hw->mac.ops.insert_mac_addr,
738 (hw, addr, vmdq),
770 (hw, addr, vmdq),
739 IXGBE_NOT_IMPLEMENTED);
740}
741
742/**
743 * ixgbe_set_rar - Set Rx address register
744 * @hw: pointer to hardware structure
745 * @index: Receive address register to write
746 * @addr: Address to put into receive address register
747 * @vmdq: VMDq "set"
748 * @enable_addr: set flag that address is active
749 *
750 * Puts an ethernet address into a receive address register.
751 **/
752s32 ixgbe_set_rar(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq,
771 IXGBE_NOT_IMPLEMENTED);
772}
773
774/**
775 * ixgbe_set_rar - Set Rx address register
776 * @hw: pointer to hardware structure
777 * @index: Receive address register to write
778 * @addr: Address to put into receive address register
779 * @vmdq: VMDq "set"
780 * @enable_addr: set flag that address is active
781 *
782 * Puts an ethernet address into a receive address register.
783 **/
784s32 ixgbe_set_rar(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq,
753 u32 enable_addr)
785 u32 enable_addr)
754{
755 return ixgbe_call_func(hw, hw->mac.ops.set_rar, (hw, index, addr, vmdq,
786{
787 return ixgbe_call_func(hw, hw->mac.ops.set_rar, (hw, index, addr, vmdq,
756 enable_addr), IXGBE_NOT_IMPLEMENTED);
788 enable_addr), IXGBE_NOT_IMPLEMENTED);
757}
758
759/**
760 * ixgbe_clear_rar - Clear Rx address register
761 * @hw: pointer to hardware structure
762 * @index: Receive address register to write
763 *
764 * Puts an ethernet address into a receive address register.
765 **/
766s32 ixgbe_clear_rar(struct ixgbe_hw *hw, u32 index)
767{
768 return ixgbe_call_func(hw, hw->mac.ops.clear_rar, (hw, index),
789}
790
791/**
792 * ixgbe_clear_rar - Clear Rx address register
793 * @hw: pointer to hardware structure
794 * @index: Receive address register to write
795 *
796 * Puts an ethernet address into a receive address register.
797 **/
798s32 ixgbe_clear_rar(struct ixgbe_hw *hw, u32 index)
799{
800 return ixgbe_call_func(hw, hw->mac.ops.clear_rar, (hw, index),
769 IXGBE_NOT_IMPLEMENTED);
801 IXGBE_NOT_IMPLEMENTED);
770}
771
772/**
773 * ixgbe_set_vmdq - Associate a VMDq index with a receive address
774 * @hw: pointer to hardware structure
775 * @rar: receive address register index to associate with VMDq index
776 * @vmdq: VMDq set or pool index
777 **/
778s32 ixgbe_set_vmdq(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
779{
780 return ixgbe_call_func(hw, hw->mac.ops.set_vmdq, (hw, rar, vmdq),
802}
803
804/**
805 * ixgbe_set_vmdq - Associate a VMDq index with a receive address
806 * @hw: pointer to hardware structure
807 * @rar: receive address register index to associate with VMDq index
808 * @vmdq: VMDq set or pool index
809 **/
810s32 ixgbe_set_vmdq(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
811{
812 return ixgbe_call_func(hw, hw->mac.ops.set_vmdq, (hw, rar, vmdq),
781 IXGBE_NOT_IMPLEMENTED);
813 IXGBE_NOT_IMPLEMENTED);
782}
783
784/**
785 * ixgbe_clear_vmdq - Disassociate a VMDq index from a receive address
786 * @hw: pointer to hardware structure
787 * @rar: receive address register index to disassociate with VMDq index
788 * @vmdq: VMDq set or pool index
789 **/
790s32 ixgbe_clear_vmdq(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
791{
792 return ixgbe_call_func(hw, hw->mac.ops.clear_vmdq, (hw, rar, vmdq),
814}
815
816/**
817 * ixgbe_clear_vmdq - Disassociate a VMDq index from a receive address
818 * @hw: pointer to hardware structure
819 * @rar: receive address register index to disassociate with VMDq index
820 * @vmdq: VMDq set or pool index
821 **/
822s32 ixgbe_clear_vmdq(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
823{
824 return ixgbe_call_func(hw, hw->mac.ops.clear_vmdq, (hw, rar, vmdq),
793 IXGBE_NOT_IMPLEMENTED);
825 IXGBE_NOT_IMPLEMENTED);
794}
795
796/**
797 * ixgbe_init_rx_addrs - Initializes receive address filters.
798 * @hw: pointer to hardware structure
799 *
800 * Places the MAC address in receive address register 0 and clears the rest
801 * of the receive address registers. Clears the multicast table. Assumes
802 * the receiver is in reset when the routine is called.
803 **/
804s32 ixgbe_init_rx_addrs(struct ixgbe_hw *hw)
805{
806 return ixgbe_call_func(hw, hw->mac.ops.init_rx_addrs, (hw),
826}
827
828/**
829 * ixgbe_init_rx_addrs - Initializes receive address filters.
830 * @hw: pointer to hardware structure
831 *
832 * Places the MAC address in receive address register 0 and clears the rest
833 * of the receive address registers. Clears the multicast table. Assumes
834 * the receiver is in reset when the routine is called.
835 **/
836s32 ixgbe_init_rx_addrs(struct ixgbe_hw *hw)
837{
838 return ixgbe_call_func(hw, hw->mac.ops.init_rx_addrs, (hw),
807 IXGBE_NOT_IMPLEMENTED);
839 IXGBE_NOT_IMPLEMENTED);
808}
809
810/**
811 * ixgbe_get_num_rx_addrs - Returns the number of RAR entries.
812 * @hw: pointer to hardware structure
813 **/
814u32 ixgbe_get_num_rx_addrs(struct ixgbe_hw *hw)
815{

--- 7 unchanged lines hidden (view full) ---

823 * @addr_count: number of addresses
824 * @func: iterator function to walk the multicast address list
825 *
826 * The given list replaces any existing list. Clears the secondary addrs from
827 * receive address registers. Uses unused receive address registers for the
828 * first secondary addresses, and falls back to promiscuous mode as needed.
829 **/
830s32 ixgbe_update_uc_addr_list(struct ixgbe_hw *hw, u8 *addr_list,
840}
841
842/**
843 * ixgbe_get_num_rx_addrs - Returns the number of RAR entries.
844 * @hw: pointer to hardware structure
845 **/
846u32 ixgbe_get_num_rx_addrs(struct ixgbe_hw *hw)
847{

--- 7 unchanged lines hidden (view full) ---

855 * @addr_count: number of addresses
856 * @func: iterator function to walk the multicast address list
857 *
858 * The given list replaces any existing list. Clears the secondary addrs from
859 * receive address registers. Uses unused receive address registers for the
860 * first secondary addresses, and falls back to promiscuous mode as needed.
861 **/
862s32 ixgbe_update_uc_addr_list(struct ixgbe_hw *hw, u8 *addr_list,
831 u32 addr_count, ixgbe_mc_addr_itr func)
863 u32 addr_count, ixgbe_mc_addr_itr func)
832{
833 return ixgbe_call_func(hw, hw->mac.ops.update_uc_addr_list, (hw,
864{
865 return ixgbe_call_func(hw, hw->mac.ops.update_uc_addr_list, (hw,
834 addr_list, addr_count, func),
835 IXGBE_NOT_IMPLEMENTED);
866 addr_list, addr_count, func),
867 IXGBE_NOT_IMPLEMENTED);
836}
837
838/**
839 * ixgbe_update_mc_addr_list - Updates the MAC's list of multicast addresses
840 * @hw: pointer to hardware structure
841 * @mc_addr_list: the list of new multicast addresses
842 * @mc_addr_count: number of addresses
843 * @func: iterator function to walk the multicast address list
844 *
845 * The given list replaces any existing list. Clears the MC addrs from receive
846 * address registers and the multicast table. Uses unused receive address
847 * registers for the first multicast addresses, and hashes the rest into the
848 * multicast table.
849 **/
850s32 ixgbe_update_mc_addr_list(struct ixgbe_hw *hw, u8 *mc_addr_list,
868}
869
870/**
871 * ixgbe_update_mc_addr_list - Updates the MAC's list of multicast addresses
872 * @hw: pointer to hardware structure
873 * @mc_addr_list: the list of new multicast addresses
874 * @mc_addr_count: number of addresses
875 * @func: iterator function to walk the multicast address list
876 *
877 * The given list replaces any existing list. Clears the MC addrs from receive
878 * address registers and the multicast table. Uses unused receive address
879 * registers for the first multicast addresses, and hashes the rest into the
880 * multicast table.
881 **/
882s32 ixgbe_update_mc_addr_list(struct ixgbe_hw *hw, u8 *mc_addr_list,
851 u32 mc_addr_count, ixgbe_mc_addr_itr func)
883 u32 mc_addr_count, ixgbe_mc_addr_itr func,
884 bool clear)
852{
853 return ixgbe_call_func(hw, hw->mac.ops.update_mc_addr_list, (hw,
885{
886 return ixgbe_call_func(hw, hw->mac.ops.update_mc_addr_list, (hw,
854 mc_addr_list, mc_addr_count, func),
855 IXGBE_NOT_IMPLEMENTED);
887 mc_addr_list, mc_addr_count, func, clear),
888 IXGBE_NOT_IMPLEMENTED);
856}
857
858/**
859 * ixgbe_enable_mc - Enable multicast address in RAR
860 * @hw: pointer to hardware structure
861 *
862 * Enables multicast address in RAR and the use of the multicast hash table.
863 **/
864s32 ixgbe_enable_mc(struct ixgbe_hw *hw)
865{
866 return ixgbe_call_func(hw, hw->mac.ops.enable_mc, (hw),
889}
890
891/**
892 * ixgbe_enable_mc - Enable multicast address in RAR
893 * @hw: pointer to hardware structure
894 *
895 * Enables multicast address in RAR and the use of the multicast hash table.
896 **/
897s32 ixgbe_enable_mc(struct ixgbe_hw *hw)
898{
899 return ixgbe_call_func(hw, hw->mac.ops.enable_mc, (hw),
867 IXGBE_NOT_IMPLEMENTED);
900 IXGBE_NOT_IMPLEMENTED);
868}
869
870/**
871 * ixgbe_disable_mc - Disable multicast address in RAR
872 * @hw: pointer to hardware structure
873 *
874 * Disables multicast address in RAR and the use of the multicast hash table.
875 **/
876s32 ixgbe_disable_mc(struct ixgbe_hw *hw)
877{
878 return ixgbe_call_func(hw, hw->mac.ops.disable_mc, (hw),
901}
902
903/**
904 * ixgbe_disable_mc - Disable multicast address in RAR
905 * @hw: pointer to hardware structure
906 *
907 * Disables multicast address in RAR and the use of the multicast hash table.
908 **/
909s32 ixgbe_disable_mc(struct ixgbe_hw *hw)
910{
911 return ixgbe_call_func(hw, hw->mac.ops.disable_mc, (hw),
879 IXGBE_NOT_IMPLEMENTED);
912 IXGBE_NOT_IMPLEMENTED);
880}
881
882/**
883 * ixgbe_clear_vfta - Clear VLAN filter table
884 * @hw: pointer to hardware structure
885 *
886 * Clears the VLAN filer table, and the VMDq index associated with the filter
887 **/
888s32 ixgbe_clear_vfta(struct ixgbe_hw *hw)
889{
890 return ixgbe_call_func(hw, hw->mac.ops.clear_vfta, (hw),
913}
914
915/**
916 * ixgbe_clear_vfta - Clear VLAN filter table
917 * @hw: pointer to hardware structure
918 *
919 * Clears the VLAN filer table, and the VMDq index associated with the filter
920 **/
921s32 ixgbe_clear_vfta(struct ixgbe_hw *hw)
922{
923 return ixgbe_call_func(hw, hw->mac.ops.clear_vfta, (hw),
891 IXGBE_NOT_IMPLEMENTED);
924 IXGBE_NOT_IMPLEMENTED);
892}
893
894/**
895 * ixgbe_set_vfta - Set VLAN filter table
896 * @hw: pointer to hardware structure
897 * @vlan: VLAN id to write to VLAN filter
898 * @vind: VMDq output index that maps queue to VLAN id in VFTA
899 * @vlan_on: boolean flag to turn on/off VLAN in VFTA
900 *
901 * Turn on/off specified VLAN in the VLAN filter table.
902 **/
903s32 ixgbe_set_vfta(struct ixgbe_hw *hw, u32 vlan, u32 vind, bool vlan_on)
904{
905 return ixgbe_call_func(hw, hw->mac.ops.set_vfta, (hw, vlan, vind,
925}
926
927/**
928 * ixgbe_set_vfta - Set VLAN filter table
929 * @hw: pointer to hardware structure
930 * @vlan: VLAN id to write to VLAN filter
931 * @vind: VMDq output index that maps queue to VLAN id in VFTA
932 * @vlan_on: boolean flag to turn on/off VLAN in VFTA
933 *
934 * Turn on/off specified VLAN in the VLAN filter table.
935 **/
936s32 ixgbe_set_vfta(struct ixgbe_hw *hw, u32 vlan, u32 vind, bool vlan_on)
937{
938 return ixgbe_call_func(hw, hw->mac.ops.set_vfta, (hw, vlan, vind,
906 vlan_on), IXGBE_NOT_IMPLEMENTED);
939 vlan_on), IXGBE_NOT_IMPLEMENTED);
907}
908
909/**
940}
941
942/**
943 * ixgbe_set_vlvf - Set VLAN Pool Filter
944 * @hw: pointer to hardware structure
945 * @vlan: VLAN id to write to VLAN filter
946 * @vind: VMDq output index that maps queue to VLAN id in VFVFB
947 * @vlan_on: boolean flag to turn on/off VLAN in VFVF
948 * @vfta_changed: pointer to boolean flag which indicates whether VFTA
949 * should be changed
950 *
951 * Turn on/off specified bit in VLVF table.
952 **/
953s32 ixgbe_set_vlvf(struct ixgbe_hw *hw, u32 vlan, u32 vind, bool vlan_on,
954 bool *vfta_changed)
955{
956 return ixgbe_call_func(hw, hw->mac.ops.set_vlvf, (hw, vlan, vind,
957 vlan_on, vfta_changed), IXGBE_NOT_IMPLEMENTED);
958}
959
960/**
910 * ixgbe_fc_enable - Enable flow control
911 * @hw: pointer to hardware structure
912 * @packetbuf_num: packet buffer number (0-7)
913 *
914 * Configures the flow control settings based on SW configuration.
915 **/
916s32 ixgbe_fc_enable(struct ixgbe_hw *hw, s32 packetbuf_num)
917{
918 return ixgbe_call_func(hw, hw->mac.ops.fc_enable, (hw, packetbuf_num),
961 * ixgbe_fc_enable - Enable flow control
962 * @hw: pointer to hardware structure
963 * @packetbuf_num: packet buffer number (0-7)
964 *
965 * Configures the flow control settings based on SW configuration.
966 **/
967s32 ixgbe_fc_enable(struct ixgbe_hw *hw, s32 packetbuf_num)
968{
969 return ixgbe_call_func(hw, hw->mac.ops.fc_enable, (hw, packetbuf_num),
919 IXGBE_NOT_IMPLEMENTED);
970 IXGBE_NOT_IMPLEMENTED);
920}
921
922/**
971}
972
973/**
974 * ixgbe_set_fw_drv_ver - Try to send the driver version number FW
975 * @hw: pointer to hardware structure
976 * @maj: driver major number to be sent to firmware
977 * @min: driver minor number to be sent to firmware
978 * @build: driver build number to be sent to firmware
979 * @ver: driver version number to be sent to firmware
980 **/
981s32 ixgbe_set_fw_drv_ver(struct ixgbe_hw *hw, u8 maj, u8 min, u8 build,
982 u8 ver)
983{
984 return ixgbe_call_func(hw, hw->mac.ops.set_fw_drv_ver, (hw, maj, min,
985 build, ver), IXGBE_NOT_IMPLEMENTED);
986}
987
988
989/**
923 * ixgbe_read_analog_reg8 - Reads 8 bit analog register
924 * @hw: pointer to hardware structure
925 * @reg: analog register to read
926 * @val: read value
927 *
928 * Performs write operation to analog register specified.
929 **/
930s32 ixgbe_read_analog_reg8(struct ixgbe_hw *hw, u32 reg, u8 *val)
931{
932 return ixgbe_call_func(hw, hw->mac.ops.read_analog_reg8, (hw, reg,
990 * ixgbe_read_analog_reg8 - Reads 8 bit analog register
991 * @hw: pointer to hardware structure
992 * @reg: analog register to read
993 * @val: read value
994 *
995 * Performs write operation to analog register specified.
996 **/
997s32 ixgbe_read_analog_reg8(struct ixgbe_hw *hw, u32 reg, u8 *val)
998{
999 return ixgbe_call_func(hw, hw->mac.ops.read_analog_reg8, (hw, reg,
933 val), IXGBE_NOT_IMPLEMENTED);
1000 val), IXGBE_NOT_IMPLEMENTED);
934}
935
936/**
937 * ixgbe_write_analog_reg8 - Writes 8 bit analog register
938 * @hw: pointer to hardware structure
939 * @reg: analog register to write
940 * @val: value to write
941 *
942 * Performs write operation to Atlas analog register specified.
943 **/
944s32 ixgbe_write_analog_reg8(struct ixgbe_hw *hw, u32 reg, u8 val)
945{
946 return ixgbe_call_func(hw, hw->mac.ops.write_analog_reg8, (hw, reg,
1001}
1002
1003/**
1004 * ixgbe_write_analog_reg8 - Writes 8 bit analog register
1005 * @hw: pointer to hardware structure
1006 * @reg: analog register to write
1007 * @val: value to write
1008 *
1009 * Performs write operation to Atlas analog register specified.
1010 **/
1011s32 ixgbe_write_analog_reg8(struct ixgbe_hw *hw, u32 reg, u8 val)
1012{
1013 return ixgbe_call_func(hw, hw->mac.ops.write_analog_reg8, (hw, reg,
947 val), IXGBE_NOT_IMPLEMENTED);
1014 val), IXGBE_NOT_IMPLEMENTED);
948}
949
950/**
951 * ixgbe_init_uta_tables - Initializes Unicast Table Arrays.
952 * @hw: pointer to hardware structure
953 *
954 * Initializes the Unicast Table Arrays to zero on device load. This
955 * is part of the Rx init addr execution path.
956 **/
957s32 ixgbe_init_uta_tables(struct ixgbe_hw *hw)
958{
959 return ixgbe_call_func(hw, hw->mac.ops.init_uta_tables, (hw),
1015}
1016
1017/**
1018 * ixgbe_init_uta_tables - Initializes Unicast Table Arrays.
1019 * @hw: pointer to hardware structure
1020 *
1021 * Initializes the Unicast Table Arrays to zero on device load. This
1022 * is part of the Rx init addr execution path.
1023 **/
1024s32 ixgbe_init_uta_tables(struct ixgbe_hw *hw)
1025{
1026 return ixgbe_call_func(hw, hw->mac.ops.init_uta_tables, (hw),
960 IXGBE_NOT_IMPLEMENTED);
1027 IXGBE_NOT_IMPLEMENTED);
961}
962
963/**
964 * ixgbe_read_i2c_byte - Reads 8 bit word over I2C at specified device address
965 * @hw: pointer to hardware structure
966 * @byte_offset: byte offset to read
967 * @data: value read
968 *
969 * Performs byte read operation to SFP module's EEPROM over I2C interface.
970 **/
971s32 ixgbe_read_i2c_byte(struct ixgbe_hw *hw, u8 byte_offset, u8 dev_addr,
1028}
1029
1030/**
1031 * ixgbe_read_i2c_byte - Reads 8 bit word over I2C at specified device address
1032 * @hw: pointer to hardware structure
1033 * @byte_offset: byte offset to read
1034 * @data: value read
1035 *
1036 * Performs byte read operation to SFP module's EEPROM over I2C interface.
1037 **/
1038s32 ixgbe_read_i2c_byte(struct ixgbe_hw *hw, u8 byte_offset, u8 dev_addr,
972 u8 *data)
1039 u8 *data)
973{
974 return ixgbe_call_func(hw, hw->phy.ops.read_i2c_byte, (hw, byte_offset,
1040{
1041 return ixgbe_call_func(hw, hw->phy.ops.read_i2c_byte, (hw, byte_offset,
975 dev_addr, data), IXGBE_NOT_IMPLEMENTED);
1042 dev_addr, data), IXGBE_NOT_IMPLEMENTED);
976}
977
978/**
979 * ixgbe_write_i2c_byte - Writes 8 bit word over I2C
980 * @hw: pointer to hardware structure
981 * @byte_offset: byte offset to write
982 * @data: value to write
983 *
984 * Performs byte write operation to SFP module's EEPROM over I2C interface
985 * at a specified device address.
986 **/
987s32 ixgbe_write_i2c_byte(struct ixgbe_hw *hw, u8 byte_offset, u8 dev_addr,
1043}
1044
1045/**
1046 * ixgbe_write_i2c_byte - Writes 8 bit word over I2C
1047 * @hw: pointer to hardware structure
1048 * @byte_offset: byte offset to write
1049 * @data: value to write
1050 *
1051 * Performs byte write operation to SFP module's EEPROM over I2C interface
1052 * at a specified device address.
1053 **/
1054s32 ixgbe_write_i2c_byte(struct ixgbe_hw *hw, u8 byte_offset, u8 dev_addr,
988 u8 data)
1055 u8 data)
989{
990 return ixgbe_call_func(hw, hw->phy.ops.write_i2c_byte, (hw, byte_offset,
1056{
1057 return ixgbe_call_func(hw, hw->phy.ops.write_i2c_byte, (hw, byte_offset,
991 dev_addr, data), IXGBE_NOT_IMPLEMENTED);
1058 dev_addr, data), IXGBE_NOT_IMPLEMENTED);
992}
993
994/**
995 * ixgbe_write_i2c_eeprom - Writes 8 bit EEPROM word over I2C interface
996 * @hw: pointer to hardware structure
997 * @byte_offset: EEPROM byte offset to write
998 * @eeprom_data: value to write
999 *
1000 * Performs byte write operation to SFP module's EEPROM over I2C interface.
1001 **/
1002s32 ixgbe_write_i2c_eeprom(struct ixgbe_hw *hw,
1059}
1060
1061/**
1062 * ixgbe_write_i2c_eeprom - Writes 8 bit EEPROM word over I2C interface
1063 * @hw: pointer to hardware structure
1064 * @byte_offset: EEPROM byte offset to write
1065 * @eeprom_data: value to write
1066 *
1067 * Performs byte write operation to SFP module's EEPROM over I2C interface.
1068 **/
1069s32 ixgbe_write_i2c_eeprom(struct ixgbe_hw *hw,
1003 u8 byte_offset, u8 eeprom_data)
1070 u8 byte_offset, u8 eeprom_data)
1004{
1005 return ixgbe_call_func(hw, hw->phy.ops.write_i2c_eeprom,
1071{
1072 return ixgbe_call_func(hw, hw->phy.ops.write_i2c_eeprom,
1006 (hw, byte_offset, eeprom_data),
1007 IXGBE_NOT_IMPLEMENTED);
1073 (hw, byte_offset, eeprom_data),
1074 IXGBE_NOT_IMPLEMENTED);
1008}
1009
1010/**
1011 * ixgbe_read_i2c_eeprom - Reads 8 bit EEPROM word over I2C interface
1012 * @hw: pointer to hardware structure
1013 * @byte_offset: EEPROM byte offset to read
1014 * @eeprom_data: value read
1015 *
1016 * Performs byte read operation to SFP module's EEPROM over I2C interface.
1017 **/
1018s32 ixgbe_read_i2c_eeprom(struct ixgbe_hw *hw, u8 byte_offset, u8 *eeprom_data)
1019{
1020 return ixgbe_call_func(hw, hw->phy.ops.read_i2c_eeprom,
1075}
1076
1077/**
1078 * ixgbe_read_i2c_eeprom - Reads 8 bit EEPROM word over I2C interface
1079 * @hw: pointer to hardware structure
1080 * @byte_offset: EEPROM byte offset to read
1081 * @eeprom_data: value read
1082 *
1083 * Performs byte read operation to SFP module's EEPROM over I2C interface.
1084 **/
1085s32 ixgbe_read_i2c_eeprom(struct ixgbe_hw *hw, u8 byte_offset, u8 *eeprom_data)
1086{
1087 return ixgbe_call_func(hw, hw->phy.ops.read_i2c_eeprom,
1021 (hw, byte_offset, eeprom_data),
1022 IXGBE_NOT_IMPLEMENTED);
1088 (hw, byte_offset, eeprom_data),
1089 IXGBE_NOT_IMPLEMENTED);
1023}
1024
1025/**
1026 * ixgbe_get_supported_physical_layer - Returns physical layer type
1027 * @hw: pointer to hardware structure
1028 *
1029 * Determines physical layer capabilities of the current configuration.
1030 **/
1031u32 ixgbe_get_supported_physical_layer(struct ixgbe_hw *hw)
1032{
1033 return ixgbe_call_func(hw, hw->mac.ops.get_supported_physical_layer,
1090}
1091
1092/**
1093 * ixgbe_get_supported_physical_layer - Returns physical layer type
1094 * @hw: pointer to hardware structure
1095 *
1096 * Determines physical layer capabilities of the current configuration.
1097 **/
1098u32 ixgbe_get_supported_physical_layer(struct ixgbe_hw *hw)
1099{
1100 return ixgbe_call_func(hw, hw->mac.ops.get_supported_physical_layer,
1034 (hw), IXGBE_PHYSICAL_LAYER_UNKNOWN);
1101 (hw), IXGBE_PHYSICAL_LAYER_UNKNOWN);
1035}
1036
1037/**
1038 * ixgbe_enable_rx_dma - Enables Rx DMA unit, dependant on device specifics
1039 * @hw: pointer to hardware structure
1040 * @regval: bitfield to write to the Rx DMA register
1041 *
1042 * Enables the Rx DMA unit of the device.
1043 **/
1044s32 ixgbe_enable_rx_dma(struct ixgbe_hw *hw, u32 regval)
1045{
1046 return ixgbe_call_func(hw, hw->mac.ops.enable_rx_dma,
1102}
1103
1104/**
1105 * ixgbe_enable_rx_dma - Enables Rx DMA unit, dependant on device specifics
1106 * @hw: pointer to hardware structure
1107 * @regval: bitfield to write to the Rx DMA register
1108 *
1109 * Enables the Rx DMA unit of the device.
1110 **/
1111s32 ixgbe_enable_rx_dma(struct ixgbe_hw *hw, u32 regval)
1112{
1113 return ixgbe_call_func(hw, hw->mac.ops.enable_rx_dma,
1047 (hw, regval), IXGBE_NOT_IMPLEMENTED);
1114 (hw, regval), IXGBE_NOT_IMPLEMENTED);
1048}
1049
1050/**
1115}
1116
1117/**
1118 * ixgbe_disable_sec_rx_path - Stops the receive data path
1119 * @hw: pointer to hardware structure
1120 *
1121 * Stops the receive data path.
1122 **/
1123s32 ixgbe_disable_sec_rx_path(struct ixgbe_hw *hw)
1124{
1125 return ixgbe_call_func(hw, hw->mac.ops.disable_sec_rx_path,
1126 (hw), IXGBE_NOT_IMPLEMENTED);
1127}
1128
1129/**
1130 * ixgbe_enable_sec_rx_path - Enables the receive data path
1131 * @hw: pointer to hardware structure
1132 *
1133 * Enables the receive data path.
1134 **/
1135s32 ixgbe_enable_sec_rx_path(struct ixgbe_hw *hw)
1136{
1137 return ixgbe_call_func(hw, hw->mac.ops.enable_sec_rx_path,
1138 (hw), IXGBE_NOT_IMPLEMENTED);
1139}
1140
1141/**
1051 * ixgbe_acquire_swfw_semaphore - Acquire SWFW semaphore
1052 * @hw: pointer to hardware structure
1053 * @mask: Mask to specify which semaphore to acquire
1054 *
1055 * Acquires the SWFW semaphore through SW_FW_SYNC register for the specified
1056 * function (CSR, PHY0, PHY1, EEPROM, Flash)
1057 **/
1058s32 ixgbe_acquire_swfw_semaphore(struct ixgbe_hw *hw, u16 mask)
1059{
1060 return ixgbe_call_func(hw, hw->mac.ops.acquire_swfw_sync,
1142 * ixgbe_acquire_swfw_semaphore - Acquire SWFW semaphore
1143 * @hw: pointer to hardware structure
1144 * @mask: Mask to specify which semaphore to acquire
1145 *
1146 * Acquires the SWFW semaphore through SW_FW_SYNC register for the specified
1147 * function (CSR, PHY0, PHY1, EEPROM, Flash)
1148 **/
1149s32 ixgbe_acquire_swfw_semaphore(struct ixgbe_hw *hw, u16 mask)
1150{
1151 return ixgbe_call_func(hw, hw->mac.ops.acquire_swfw_sync,
1061 (hw, mask), IXGBE_NOT_IMPLEMENTED);
1152 (hw, mask), IXGBE_NOT_IMPLEMENTED);
1062}
1063
1064/**
1065 * ixgbe_release_swfw_semaphore - Release SWFW semaphore
1066 * @hw: pointer to hardware structure
1067 * @mask: Mask to specify which semaphore to release
1068 *
1069 * Releases the SWFW semaphore through SW_FW_SYNC register for the specified
1070 * function (CSR, PHY0, PHY1, EEPROM, Flash)
1071 **/
1072void ixgbe_release_swfw_semaphore(struct ixgbe_hw *hw, u16 mask)
1073{
1074 if (hw->mac.ops.release_swfw_sync)
1075 hw->mac.ops.release_swfw_sync(hw, mask);
1076}
1077
1153}
1154
1155/**
1156 * ixgbe_release_swfw_semaphore - Release SWFW semaphore
1157 * @hw: pointer to hardware structure
1158 * @mask: Mask to specify which semaphore to release
1159 *
1160 * Releases the SWFW semaphore through SW_FW_SYNC register for the specified
1161 * function (CSR, PHY0, PHY1, EEPROM, Flash)
1162 **/
1163void ixgbe_release_swfw_semaphore(struct ixgbe_hw *hw, u16 mask)
1164{
1165 if (hw->mac.ops.release_swfw_sync)
1166 hw->mac.ops.release_swfw_sync(hw, mask);
1167}
1168