ixgbe/base: improve error handling
[dpdk.git] / lib / librte_pmd_ixgbe / ixgbe / ixgbe_api.c
1 /*******************************************************************************
2
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
12  2. Redistributions in binary form must reproduce the above copyright
13     notice, this list of conditions and the following disclaimer in the
14     documentation and/or other materials provided with the distribution.
15
16  3. Neither the name of the Intel Corporation nor the names of its
17     contributors may be used to endorse or promote products derived from
18     this software without specific prior written permission.
19
20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
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
34 #include "ixgbe_api.h"
35 #include "ixgbe_common.h"
36 #ident "$Id: ixgbe_api.c,v 1.187 2012/11/08 10:11:52 jtkirshe Exp $"
37
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
46  *  hw structure should be filled in prior to calling this function:
47  *  hw_addr, back, device_id, vendor_id, subsystem_device_id,
48  *  subsystem_vendor_id, and revision_id
49  **/
50 s32 ixgbe_init_shared_code(struct ixgbe_hw *hw)
51 {
52         s32 status;
53
54         DEBUGFUNC("ixgbe_init_shared_code");
55
56         /*
57          * Set the mac type
58          */
59         ixgbe_set_mac_type(hw);
60
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_X540:
69                 status = ixgbe_init_ops_X540(hw);
70                 break;
71         case ixgbe_mac_82599_vf:
72         case ixgbe_mac_X540_vf:
73                 status = ixgbe_init_ops_vf(hw);
74                 break;
75         default:
76                 status = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
77                 break;
78         }
79
80         return status;
81 }
82
83 /**
84  *  ixgbe_set_mac_type - Sets MAC type
85  *  @hw: pointer to the HW structure
86  *
87  *  This function sets the mac type of the adapter based on the
88  *  vendor ID and device ID stored in the hw structure.
89  **/
90 s32 ixgbe_set_mac_type(struct ixgbe_hw *hw)
91 {
92         s32 ret_val = IXGBE_SUCCESS;
93
94         DEBUGFUNC("ixgbe_set_mac_type\n");
95
96         if (hw->vendor_id != IXGBE_INTEL_VENDOR_ID) {
97                 ERROR_REPORT2(IXGBE_ERROR_UNSUPPORTED,
98                              "Unsupported vendor id: %x", hw->vendor_id);
99                 return IXGBE_ERR_DEVICE_NOT_SUPPORTED;
100         }
101
102         switch (hw->device_id) {
103         case IXGBE_DEV_ID_82598:
104         case IXGBE_DEV_ID_82598_BX:
105         case IXGBE_DEV_ID_82598AF_SINGLE_PORT:
106         case IXGBE_DEV_ID_82598AF_DUAL_PORT:
107         case IXGBE_DEV_ID_82598AT:
108         case IXGBE_DEV_ID_82598AT2:
109         case IXGBE_DEV_ID_82598EB_CX4:
110         case IXGBE_DEV_ID_82598_CX4_DUAL_PORT:
111         case IXGBE_DEV_ID_82598_DA_DUAL_PORT:
112         case IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM:
113         case IXGBE_DEV_ID_82598EB_XF_LR:
114         case IXGBE_DEV_ID_82598EB_SFP_LOM:
115                 hw->mac.type = ixgbe_mac_82598EB;
116                 break;
117         case IXGBE_DEV_ID_82599_KX4:
118         case IXGBE_DEV_ID_82599_KX4_MEZZ:
119         case IXGBE_DEV_ID_82599_XAUI_LOM:
120         case IXGBE_DEV_ID_82599_COMBO_BACKPLANE:
121         case IXGBE_DEV_ID_82599_KR:
122         case IXGBE_DEV_ID_82599_SFP:
123         case IXGBE_DEV_ID_82599_BACKPLANE_FCOE:
124         case IXGBE_DEV_ID_82599_SFP_FCOE:
125         case IXGBE_DEV_ID_82599_SFP_EM:
126         case IXGBE_DEV_ID_82599_SFP_SF2:
127         case IXGBE_DEV_ID_82599_SFP_SF_QP:
128         case IXGBE_DEV_ID_82599EN_SFP:
129         case IXGBE_DEV_ID_82599_CX4:
130         case IXGBE_DEV_ID_82599_T3_LOM:
131                 hw->mac.type = ixgbe_mac_82599EB;
132                 break;
133         case IXGBE_DEV_ID_82599_VF:
134         case IXGBE_DEV_ID_82599_VF_HV:
135                 hw->mac.type = ixgbe_mac_82599_vf;
136                 break;
137         case IXGBE_DEV_ID_X540_VF:
138         case IXGBE_DEV_ID_X540_VF_HV:
139                 hw->mac.type = ixgbe_mac_X540_vf;
140                 break;
141         case IXGBE_DEV_ID_X540T:
142         case IXGBE_DEV_ID_X540T1:
143                 hw->mac.type = ixgbe_mac_X540;
144                 break;
145         default:
146                 ret_val = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
147                 ERROR_REPORT2(IXGBE_ERROR_UNSUPPORTED,
148                              "Unsupported device id: %x",
149                              hw->device_id);
150                 break;
151         }
152
153         DEBUGOUT2("ixgbe_set_mac_type found mac: %d, returns: %d\n",
154                   hw->mac.type, ret_val);
155         return ret_val;
156 }
157
158 /**
159  *  ixgbe_init_hw - Initialize the hardware
160  *  @hw: pointer to hardware structure
161  *
162  *  Initialize the hardware by resetting and then starting the hardware
163  **/
164 s32 ixgbe_init_hw(struct ixgbe_hw *hw)
165 {
166         return ixgbe_call_func(hw, hw->mac.ops.init_hw, (hw),
167                                IXGBE_NOT_IMPLEMENTED);
168 }
169
170 /**
171  *  ixgbe_reset_hw - Performs a hardware reset
172  *  @hw: pointer to hardware structure
173  *
174  *  Resets the hardware by resetting the transmit and receive units, masks and
175  *  clears all interrupts, performs a PHY reset, and performs a MAC reset
176  **/
177 s32 ixgbe_reset_hw(struct ixgbe_hw *hw)
178 {
179         return ixgbe_call_func(hw, hw->mac.ops.reset_hw, (hw),
180                                IXGBE_NOT_IMPLEMENTED);
181 }
182
183 /**
184  *  ixgbe_start_hw - Prepares hardware for Rx/Tx
185  *  @hw: pointer to hardware structure
186  *
187  *  Starts the hardware by filling the bus info structure and media type,
188  *  clears all on chip counters, initializes receive address registers,
189  *  multicast table, VLAN filter table, calls routine to setup link and
190  *  flow control settings, and leaves transmit and receive units disabled
191  *  and uninitialized.
192  **/
193 s32 ixgbe_start_hw(struct ixgbe_hw *hw)
194 {
195         return ixgbe_call_func(hw, hw->mac.ops.start_hw, (hw),
196                                IXGBE_NOT_IMPLEMENTED);
197 }
198
199 /**
200  *  ixgbe_enable_relaxed_ordering - Enables tx relaxed ordering,
201  *  which is disabled by default in ixgbe_start_hw();
202  *
203  *  @hw: pointer to hardware structure
204  *
205  *   Enable relaxed ordering;
206  **/
207 void ixgbe_enable_relaxed_ordering(struct ixgbe_hw *hw)
208 {
209         if (hw->mac.ops.enable_relaxed_ordering)
210                 hw->mac.ops.enable_relaxed_ordering(hw);
211 }
212
213 /**
214  *  ixgbe_clear_hw_cntrs - Clear hardware counters
215  *  @hw: pointer to hardware structure
216  *
217  *  Clears all hardware statistics counters by reading them from the hardware
218  *  Statistics counters are clear on read.
219  **/
220 s32 ixgbe_clear_hw_cntrs(struct ixgbe_hw *hw)
221 {
222         return ixgbe_call_func(hw, hw->mac.ops.clear_hw_cntrs, (hw),
223                                IXGBE_NOT_IMPLEMENTED);
224 }
225
226 /**
227  *  ixgbe_get_media_type - Get media type
228  *  @hw: pointer to hardware structure
229  *
230  *  Returns the media type (fiber, copper, backplane)
231  **/
232 enum ixgbe_media_type ixgbe_get_media_type(struct ixgbe_hw *hw)
233 {
234         return ixgbe_call_func(hw, hw->mac.ops.get_media_type, (hw),
235                                ixgbe_media_type_unknown);
236 }
237
238 /**
239  *  ixgbe_get_mac_addr - Get MAC address
240  *  @hw: pointer to hardware structure
241  *  @mac_addr: Adapter MAC address
242  *
243  *  Reads the adapter's MAC address from the first Receive Address Register
244  *  (RAR0) A reset of the adapter must have been performed prior to calling
245  *  this function in order for the MAC address to have been loaded from the
246  *  EEPROM into RAR0
247  **/
248 s32 ixgbe_get_mac_addr(struct ixgbe_hw *hw, u8 *mac_addr)
249 {
250         return ixgbe_call_func(hw, hw->mac.ops.get_mac_addr,
251                                (hw, mac_addr), IXGBE_NOT_IMPLEMENTED);
252 }
253
254 /**
255  *  ixgbe_get_san_mac_addr - Get SAN MAC address
256  *  @hw: pointer to hardware structure
257  *  @san_mac_addr: SAN MAC address
258  *
259  *  Reads the SAN MAC address from the EEPROM, if it's available.  This is
260  *  per-port, so set_lan_id() must be called before reading the addresses.
261  **/
262 s32 ixgbe_get_san_mac_addr(struct ixgbe_hw *hw, u8 *san_mac_addr)
263 {
264         return ixgbe_call_func(hw, hw->mac.ops.get_san_mac_addr,
265                                (hw, san_mac_addr), IXGBE_NOT_IMPLEMENTED);
266 }
267
268 /**
269  *  ixgbe_set_san_mac_addr - Write a SAN MAC address
270  *  @hw: pointer to hardware structure
271  *  @san_mac_addr: SAN MAC address
272  *
273  *  Writes A SAN MAC address to the EEPROM.
274  **/
275 s32 ixgbe_set_san_mac_addr(struct ixgbe_hw *hw, u8 *san_mac_addr)
276 {
277         return ixgbe_call_func(hw, hw->mac.ops.set_san_mac_addr,
278                                (hw, san_mac_addr), IXGBE_NOT_IMPLEMENTED);
279 }
280
281 /**
282  *  ixgbe_get_device_caps - Get additional device capabilities
283  *  @hw: pointer to hardware structure
284  *  @device_caps: the EEPROM word for device capabilities
285  *
286  *  Reads the extra device capabilities from the EEPROM
287  **/
288 s32 ixgbe_get_device_caps(struct ixgbe_hw *hw, u16 *device_caps)
289 {
290         return ixgbe_call_func(hw, hw->mac.ops.get_device_caps,
291                                (hw, device_caps), IXGBE_NOT_IMPLEMENTED);
292 }
293
294 /**
295  *  ixgbe_get_wwn_prefix - Get alternative WWNN/WWPN prefix from the EEPROM
296  *  @hw: pointer to hardware structure
297  *  @wwnn_prefix: the alternative WWNN prefix
298  *  @wwpn_prefix: the alternative WWPN prefix
299  *
300  *  This function will read the EEPROM from the alternative SAN MAC address
301  *  block to check the support for the alternative WWNN/WWPN prefix support.
302  **/
303 s32 ixgbe_get_wwn_prefix(struct ixgbe_hw *hw, u16 *wwnn_prefix,
304                          u16 *wwpn_prefix)
305 {
306         return ixgbe_call_func(hw, hw->mac.ops.get_wwn_prefix,
307                                (hw, wwnn_prefix, wwpn_prefix),
308                                IXGBE_NOT_IMPLEMENTED);
309 }
310
311 /**
312  *  ixgbe_get_fcoe_boot_status -  Get FCOE boot status from EEPROM
313  *  @hw: pointer to hardware structure
314  *  @bs: the fcoe boot status
315  *
316  *  This function will read the FCOE boot status from the iSCSI FCOE block
317  **/
318 s32 ixgbe_get_fcoe_boot_status(struct ixgbe_hw *hw, u16 *bs)
319 {
320         return ixgbe_call_func(hw, hw->mac.ops.get_fcoe_boot_status,
321                                (hw, bs),
322                                IXGBE_NOT_IMPLEMENTED);
323 }
324
325 /**
326  *  ixgbe_get_bus_info - Set PCI bus info
327  *  @hw: pointer to hardware structure
328  *
329  *  Sets the PCI bus info (speed, width, type) within the ixgbe_hw structure
330  **/
331 s32 ixgbe_get_bus_info(struct ixgbe_hw *hw)
332 {
333         return ixgbe_call_func(hw, hw->mac.ops.get_bus_info, (hw),
334                                IXGBE_NOT_IMPLEMENTED);
335 }
336
337 /**
338  *  ixgbe_get_num_of_tx_queues - Get Tx queues
339  *  @hw: pointer to hardware structure
340  *
341  *  Returns the number of transmit queues for the given adapter.
342  **/
343 u32 ixgbe_get_num_of_tx_queues(struct ixgbe_hw *hw)
344 {
345         return hw->mac.max_tx_queues;
346 }
347
348 /**
349  *  ixgbe_get_num_of_rx_queues - Get Rx queues
350  *  @hw: pointer to hardware structure
351  *
352  *  Returns the number of receive queues for the given adapter.
353  **/
354 u32 ixgbe_get_num_of_rx_queues(struct ixgbe_hw *hw)
355 {
356         return hw->mac.max_rx_queues;
357 }
358
359 /**
360  *  ixgbe_stop_adapter - Disable Rx/Tx units
361  *  @hw: pointer to hardware structure
362  *
363  *  Sets the adapter_stopped flag within ixgbe_hw struct. Clears interrupts,
364  *  disables transmit and receive units. The adapter_stopped flag is used by
365  *  the shared code and drivers to determine if the adapter is in a stopped
366  *  state and should not touch the hardware.
367  **/
368 s32 ixgbe_stop_adapter(struct ixgbe_hw *hw)
369 {
370         return ixgbe_call_func(hw, hw->mac.ops.stop_adapter, (hw),
371                                IXGBE_NOT_IMPLEMENTED);
372 }
373
374 /**
375  *  ixgbe_read_pba_string - Reads part number string from EEPROM
376  *  @hw: pointer to hardware structure
377  *  @pba_num: stores the part number string from the EEPROM
378  *  @pba_num_size: part number string buffer length
379  *
380  *  Reads the part number string from the EEPROM.
381  **/
382 s32 ixgbe_read_pba_string(struct ixgbe_hw *hw, u8 *pba_num, u32 pba_num_size)
383 {
384         return ixgbe_read_pba_string_generic(hw, pba_num, pba_num_size);
385 }
386
387 /**
388  *  ixgbe_read_pba_num - Reads part number from EEPROM
389  *  @hw: pointer to hardware structure
390  *  @pba_num: stores the part number from the EEPROM
391  *
392  *  Reads the part number from the EEPROM.
393  **/
394 s32 ixgbe_read_pba_num(struct ixgbe_hw *hw, u32 *pba_num)
395 {
396         return ixgbe_read_pba_num_generic(hw, pba_num);
397 }
398
399 /**
400  *  ixgbe_identify_phy - Get PHY type
401  *  @hw: pointer to hardware structure
402  *
403  *  Determines the physical layer module found on the current adapter.
404  **/
405 s32 ixgbe_identify_phy(struct ixgbe_hw *hw)
406 {
407         s32 status = IXGBE_SUCCESS;
408
409         if (hw->phy.type == ixgbe_phy_unknown) {
410                 status = ixgbe_call_func(hw, hw->phy.ops.identify, (hw),
411                                          IXGBE_NOT_IMPLEMENTED);
412         }
413
414         return status;
415 }
416
417 /**
418  *  ixgbe_reset_phy - Perform a PHY reset
419  *  @hw: pointer to hardware structure
420  **/
421 s32 ixgbe_reset_phy(struct ixgbe_hw *hw)
422 {
423         s32 status = IXGBE_SUCCESS;
424
425         if (hw->phy.type == ixgbe_phy_unknown) {
426                 if (ixgbe_identify_phy(hw) != IXGBE_SUCCESS)
427                         status = IXGBE_ERR_PHY;
428         }
429
430         if (status == IXGBE_SUCCESS) {
431                 status = ixgbe_call_func(hw, hw->phy.ops.reset, (hw),
432                                          IXGBE_NOT_IMPLEMENTED);
433         }
434         return status;
435 }
436
437 /**
438  *  ixgbe_get_phy_firmware_version -
439  *  @hw: pointer to hardware structure
440  *  @firmware_version: pointer to firmware version
441  **/
442 s32 ixgbe_get_phy_firmware_version(struct ixgbe_hw *hw, u16 *firmware_version)
443 {
444         s32 status = IXGBE_SUCCESS;
445
446         status = ixgbe_call_func(hw, hw->phy.ops.get_firmware_version,
447                                  (hw, firmware_version),
448                                  IXGBE_NOT_IMPLEMENTED);
449         return status;
450 }
451
452 /**
453  *  ixgbe_read_phy_reg - Read PHY register
454  *  @hw: pointer to hardware structure
455  *  @reg_addr: 32 bit address of PHY register to read
456  *  @phy_data: Pointer to read data from PHY register
457  *
458  *  Reads a value from a specified PHY register
459  **/
460 s32 ixgbe_read_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type,
461                        u16 *phy_data)
462 {
463         if (hw->phy.id == 0)
464                 ixgbe_identify_phy(hw);
465
466         return ixgbe_call_func(hw, hw->phy.ops.read_reg, (hw, reg_addr,
467                                device_type, phy_data), IXGBE_NOT_IMPLEMENTED);
468 }
469
470 /**
471  *  ixgbe_write_phy_reg - Write PHY register
472  *  @hw: pointer to hardware structure
473  *  @reg_addr: 32 bit PHY register to write
474  *  @phy_data: Data to write to the PHY register
475  *
476  *  Writes a value to specified PHY register
477  **/
478 s32 ixgbe_write_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type,
479                         u16 phy_data)
480 {
481         if (hw->phy.id == 0)
482                 ixgbe_identify_phy(hw);
483
484         return ixgbe_call_func(hw, hw->phy.ops.write_reg, (hw, reg_addr,
485                                device_type, phy_data), IXGBE_NOT_IMPLEMENTED);
486 }
487
488 /**
489  *  ixgbe_setup_phy_link - Restart PHY autoneg
490  *  @hw: pointer to hardware structure
491  *
492  *  Restart autonegotiation and PHY and waits for completion.
493  **/
494 s32 ixgbe_setup_phy_link(struct ixgbe_hw *hw)
495 {
496         return ixgbe_call_func(hw, hw->phy.ops.setup_link, (hw),
497                                IXGBE_NOT_IMPLEMENTED);
498 }
499
500 /**
501  *  ixgbe_check_phy_link - Determine link and speed status
502  *  @hw: pointer to hardware structure
503  *
504  *  Reads a PHY register to determine if link is up and the current speed for
505  *  the PHY.
506  **/
507 s32 ixgbe_check_phy_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
508                          bool *link_up)
509 {
510         return ixgbe_call_func(hw, hw->phy.ops.check_link, (hw, speed,
511                                link_up), IXGBE_NOT_IMPLEMENTED);
512 }
513
514 /**
515  *  ixgbe_setup_phy_link_speed - Set auto advertise
516  *  @hw: pointer to hardware structure
517  *  @speed: new link speed
518  *  @autoneg: true if autonegotiation enabled
519  *
520  *  Sets the auto advertised capabilities
521  **/
522 s32 ixgbe_setup_phy_link_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed,
523                                bool autoneg,
524                                bool autoneg_wait_to_complete)
525 {
526         return ixgbe_call_func(hw, hw->phy.ops.setup_link_speed, (hw, speed,
527                                autoneg, autoneg_wait_to_complete),
528                                IXGBE_NOT_IMPLEMENTED);
529 }
530
531 /**
532  *  ixgbe_check_link - Get link and speed status
533  *  @hw: pointer to hardware structure
534  *
535  *  Reads the links register to determine if link is up and the current speed
536  **/
537 s32 ixgbe_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
538                      bool *link_up, bool link_up_wait_to_complete)
539 {
540         return ixgbe_call_func(hw, hw->mac.ops.check_link, (hw, speed,
541                                link_up, link_up_wait_to_complete),
542                                IXGBE_NOT_IMPLEMENTED);
543 }
544
545 /**
546  *  ixgbe_disable_tx_laser - Disable Tx laser
547  *  @hw: pointer to hardware structure
548  *
549  *  If the driver needs to disable the laser on SFI optics.
550  **/
551 void ixgbe_disable_tx_laser(struct ixgbe_hw *hw)
552 {
553         if (hw->mac.ops.disable_tx_laser)
554                 hw->mac.ops.disable_tx_laser(hw);
555 }
556
557 /**
558  *  ixgbe_enable_tx_laser - Enable Tx laser
559  *  @hw: pointer to hardware structure
560  *
561  *  If the driver needs to enable the laser on SFI optics.
562  **/
563 void ixgbe_enable_tx_laser(struct ixgbe_hw *hw)
564 {
565         if (hw->mac.ops.enable_tx_laser)
566                 hw->mac.ops.enable_tx_laser(hw);
567 }
568
569 /**
570  *  ixgbe_flap_tx_laser - flap Tx laser to start autotry process
571  *  @hw: pointer to hardware structure
572  *
573  *  When the driver changes the link speeds that it can support then
574  *  flap the tx laser to alert the link partner to start autotry
575  *  process on its end.
576  **/
577 void ixgbe_flap_tx_laser(struct ixgbe_hw *hw)
578 {
579         if (hw->mac.ops.flap_tx_laser)
580                 hw->mac.ops.flap_tx_laser(hw);
581 }
582
583 /**
584  *  ixgbe_setup_link - Set link speed
585  *  @hw: pointer to hardware structure
586  *  @speed: new link speed
587  *  @autoneg: true if autonegotiation enabled
588  *
589  *  Configures link settings.  Restarts the link.
590  *  Performs autonegotiation if needed.
591  **/
592 s32 ixgbe_setup_link(struct ixgbe_hw *hw, ixgbe_link_speed speed,
593                      bool autoneg,
594                      bool autoneg_wait_to_complete)
595 {
596         return ixgbe_call_func(hw, hw->mac.ops.setup_link, (hw, speed,
597                                autoneg, autoneg_wait_to_complete),
598                                IXGBE_NOT_IMPLEMENTED);
599 }
600
601 /**
602  *  ixgbe_get_link_capabilities - Returns link capabilities
603  *  @hw: pointer to hardware structure
604  *
605  *  Determines the link capabilities of the current configuration.
606  **/
607 s32 ixgbe_get_link_capabilities(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
608                                 bool *autoneg)
609 {
610         return ixgbe_call_func(hw, hw->mac.ops.get_link_capabilities, (hw,
611                                speed, autoneg), IXGBE_NOT_IMPLEMENTED);
612 }
613
614 /**
615  *  ixgbe_led_on - Turn on LEDs
616  *  @hw: pointer to hardware structure
617  *  @index: led number to turn on
618  *
619  *  Turns on the software controllable LEDs.
620  **/
621 s32 ixgbe_led_on(struct ixgbe_hw *hw, u32 index)
622 {
623         return ixgbe_call_func(hw, hw->mac.ops.led_on, (hw, index),
624                                IXGBE_NOT_IMPLEMENTED);
625 }
626
627 /**
628  *  ixgbe_led_off - Turn off LEDs
629  *  @hw: pointer to hardware structure
630  *  @index: led number to turn off
631  *
632  *  Turns off the software controllable LEDs.
633  **/
634 s32 ixgbe_led_off(struct ixgbe_hw *hw, u32 index)
635 {
636         return ixgbe_call_func(hw, hw->mac.ops.led_off, (hw, index),
637                                IXGBE_NOT_IMPLEMENTED);
638 }
639
640 /**
641  *  ixgbe_blink_led_start - Blink LEDs
642  *  @hw: pointer to hardware structure
643  *  @index: led number to blink
644  *
645  *  Blink LED based on index.
646  **/
647 s32 ixgbe_blink_led_start(struct ixgbe_hw *hw, u32 index)
648 {
649         return ixgbe_call_func(hw, hw->mac.ops.blink_led_start, (hw, index),
650                                IXGBE_NOT_IMPLEMENTED);
651 }
652
653 /**
654  *  ixgbe_blink_led_stop - Stop blinking LEDs
655  *  @hw: pointer to hardware structure
656  *
657  *  Stop blinking LED based on index.
658  **/
659 s32 ixgbe_blink_led_stop(struct ixgbe_hw *hw, u32 index)
660 {
661         return ixgbe_call_func(hw, hw->mac.ops.blink_led_stop, (hw, index),
662                                IXGBE_NOT_IMPLEMENTED);
663 }
664
665 /**
666  *  ixgbe_init_eeprom_params - Initialize EEPROM parameters
667  *  @hw: pointer to hardware structure
668  *
669  *  Initializes the EEPROM parameters ixgbe_eeprom_info within the
670  *  ixgbe_hw struct in order to set up EEPROM access.
671  **/
672 s32 ixgbe_init_eeprom_params(struct ixgbe_hw *hw)
673 {
674         return ixgbe_call_func(hw, hw->eeprom.ops.init_params, (hw),
675                                IXGBE_NOT_IMPLEMENTED);
676 }
677
678
679 /**
680  *  ixgbe_write_eeprom - Write word to EEPROM
681  *  @hw: pointer to hardware structure
682  *  @offset: offset within the EEPROM to be written to
683  *  @data: 16 bit word to be written to the EEPROM
684  *
685  *  Writes 16 bit value to EEPROM. If ixgbe_eeprom_update_checksum is not
686  *  called after this function, the EEPROM will most likely contain an
687  *  invalid checksum.
688  **/
689 s32 ixgbe_write_eeprom(struct ixgbe_hw *hw, u16 offset, u16 data)
690 {
691         return ixgbe_call_func(hw, hw->eeprom.ops.write, (hw, offset, data),
692                                IXGBE_NOT_IMPLEMENTED);
693 }
694
695 /**
696  *  ixgbe_write_eeprom_buffer - Write word(s) to EEPROM
697  *  @hw: pointer to hardware structure
698  *  @offset: offset within the EEPROM to be written to
699  *  @data: 16 bit word(s) to be written to the EEPROM
700  *  @words: number of words
701  *
702  *  Writes 16 bit word(s) to EEPROM. If ixgbe_eeprom_update_checksum is not
703  *  called after this function, the EEPROM will most likely contain an
704  *  invalid checksum.
705  **/
706 s32 ixgbe_write_eeprom_buffer(struct ixgbe_hw *hw, u16 offset, u16 words,
707                               u16 *data)
708 {
709         return ixgbe_call_func(hw, hw->eeprom.ops.write_buffer,
710                                (hw, offset, words, data),
711                                IXGBE_NOT_IMPLEMENTED);
712 }
713
714 /**
715  *  ixgbe_read_eeprom - Read word from EEPROM
716  *  @hw: pointer to hardware structure
717  *  @offset: offset within the EEPROM to be read
718  *  @data: read 16 bit value from EEPROM
719  *
720  *  Reads 16 bit value from EEPROM
721  **/
722 s32 ixgbe_read_eeprom(struct ixgbe_hw *hw, u16 offset, u16 *data)
723 {
724         return ixgbe_call_func(hw, hw->eeprom.ops.read, (hw, offset, data),
725                                IXGBE_NOT_IMPLEMENTED);
726 }
727
728 /**
729  *  ixgbe_read_eeprom_buffer - Read word(s) from EEPROM
730  *  @hw: pointer to hardware structure
731  *  @offset: offset within the EEPROM to be read
732  *  @data: read 16 bit word(s) from EEPROM
733  *  @words: number of words
734  *
735  *  Reads 16 bit word(s) from EEPROM
736  **/
737 s32 ixgbe_read_eeprom_buffer(struct ixgbe_hw *hw, u16 offset,
738                              u16 words, u16 *data)
739 {
740         return ixgbe_call_func(hw, hw->eeprom.ops.read_buffer,
741                                (hw, offset, words, data),
742                                IXGBE_NOT_IMPLEMENTED);
743 }
744
745 /**
746  *  ixgbe_validate_eeprom_checksum - Validate EEPROM checksum
747  *  @hw: pointer to hardware structure
748  *  @checksum_val: calculated checksum
749  *
750  *  Performs checksum calculation and validates the EEPROM checksum
751  **/
752 s32 ixgbe_validate_eeprom_checksum(struct ixgbe_hw *hw, u16 *checksum_val)
753 {
754         return ixgbe_call_func(hw, hw->eeprom.ops.validate_checksum,
755                                (hw, checksum_val), IXGBE_NOT_IMPLEMENTED);
756 }
757
758 /**
759  *  ixgbe_eeprom_update_checksum - Updates the EEPROM checksum
760  *  @hw: pointer to hardware structure
761  **/
762 s32 ixgbe_update_eeprom_checksum(struct ixgbe_hw *hw)
763 {
764         return ixgbe_call_func(hw, hw->eeprom.ops.update_checksum, (hw),
765                                IXGBE_NOT_IMPLEMENTED);
766 }
767
768 /**
769  *  ixgbe_insert_mac_addr - Find a RAR for this mac address
770  *  @hw: pointer to hardware structure
771  *  @addr: Address to put into receive address register
772  *  @vmdq: VMDq pool to assign
773  *
774  *  Puts an ethernet address into a receive address register, or
775  *  finds the rar that it is aleady in; adds to the pool list
776  **/
777 s32 ixgbe_insert_mac_addr(struct ixgbe_hw *hw, u8 *addr, u32 vmdq)
778 {
779         return ixgbe_call_func(hw, hw->mac.ops.insert_mac_addr,
780                                (hw, addr, vmdq),
781                                IXGBE_NOT_IMPLEMENTED);
782 }
783
784 /**
785  *  ixgbe_set_rar - Set Rx address register
786  *  @hw: pointer to hardware structure
787  *  @index: Receive address register to write
788  *  @addr: Address to put into receive address register
789  *  @vmdq: VMDq "set"
790  *  @enable_addr: set flag that address is active
791  *
792  *  Puts an ethernet address into a receive address register.
793  **/
794 s32 ixgbe_set_rar(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq,
795                   u32 enable_addr)
796 {
797         return ixgbe_call_func(hw, hw->mac.ops.set_rar, (hw, index, addr, vmdq,
798                                enable_addr), IXGBE_NOT_IMPLEMENTED);
799 }
800
801 /**
802  *  ixgbe_clear_rar - Clear Rx address register
803  *  @hw: pointer to hardware structure
804  *  @index: Receive address register to write
805  *
806  *  Puts an ethernet address into a receive address register.
807  **/
808 s32 ixgbe_clear_rar(struct ixgbe_hw *hw, u32 index)
809 {
810         return ixgbe_call_func(hw, hw->mac.ops.clear_rar, (hw, index),
811                                IXGBE_NOT_IMPLEMENTED);
812 }
813
814 /**
815  *  ixgbe_set_vmdq - Associate a VMDq index with a receive address
816  *  @hw: pointer to hardware structure
817  *  @rar: receive address register index to associate with VMDq index
818  *  @vmdq: VMDq set or pool index
819  **/
820 s32 ixgbe_set_vmdq(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
821 {
822         return ixgbe_call_func(hw, hw->mac.ops.set_vmdq, (hw, rar, vmdq),
823                                IXGBE_NOT_IMPLEMENTED);
824
825 }
826
827 /**
828  *  ixgbe_set_vmdq_san_mac - Associate VMDq index 127 with a receive address
829  *  @hw: pointer to hardware structure
830  *  @vmdq: VMDq default pool index
831  **/
832 s32 ixgbe_set_vmdq_san_mac(struct ixgbe_hw *hw, u32 vmdq)
833 {
834         return ixgbe_call_func(hw, hw->mac.ops.set_vmdq_san_mac,
835                                (hw, vmdq), IXGBE_NOT_IMPLEMENTED);
836 }
837
838 /**
839  *  ixgbe_clear_vmdq - Disassociate a VMDq index from a receive address
840  *  @hw: pointer to hardware structure
841  *  @rar: receive address register index to disassociate with VMDq index
842  *  @vmdq: VMDq set or pool index
843  **/
844 s32 ixgbe_clear_vmdq(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
845 {
846         return ixgbe_call_func(hw, hw->mac.ops.clear_vmdq, (hw, rar, vmdq),
847                                IXGBE_NOT_IMPLEMENTED);
848 }
849
850 /**
851  *  ixgbe_init_rx_addrs - Initializes receive address filters.
852  *  @hw: pointer to hardware structure
853  *
854  *  Places the MAC address in receive address register 0 and clears the rest
855  *  of the receive address registers. Clears the multicast table. Assumes
856  *  the receiver is in reset when the routine is called.
857  **/
858 s32 ixgbe_init_rx_addrs(struct ixgbe_hw *hw)
859 {
860         return ixgbe_call_func(hw, hw->mac.ops.init_rx_addrs, (hw),
861                                IXGBE_NOT_IMPLEMENTED);
862 }
863
864 /**
865  *  ixgbe_get_num_rx_addrs - Returns the number of RAR entries.
866  *  @hw: pointer to hardware structure
867  **/
868 u32 ixgbe_get_num_rx_addrs(struct ixgbe_hw *hw)
869 {
870         return hw->mac.num_rar_entries;
871 }
872
873 /**
874  *  ixgbe_update_uc_addr_list - Updates the MAC's list of secondary addresses
875  *  @hw: pointer to hardware structure
876  *  @addr_list: the list of new multicast addresses
877  *  @addr_count: number of addresses
878  *  @func: iterator function to walk the multicast address list
879  *
880  *  The given list replaces any existing list. Clears the secondary addrs from
881  *  receive address registers. Uses unused receive address registers for the
882  *  first secondary addresses, and falls back to promiscuous mode as needed.
883  **/
884 s32 ixgbe_update_uc_addr_list(struct ixgbe_hw *hw, u8 *addr_list,
885                               u32 addr_count, ixgbe_mc_addr_itr func)
886 {
887         return ixgbe_call_func(hw, hw->mac.ops.update_uc_addr_list, (hw,
888                                addr_list, addr_count, func),
889                                IXGBE_NOT_IMPLEMENTED);
890 }
891
892 /**
893  *  ixgbe_update_mc_addr_list - Updates the MAC's list of multicast addresses
894  *  @hw: pointer to hardware structure
895  *  @mc_addr_list: the list of new multicast addresses
896  *  @mc_addr_count: number of addresses
897  *  @func: iterator function to walk the multicast address list
898  *
899  *  The given list replaces any existing list. Clears the MC addrs from receive
900  *  address registers and the multicast table. Uses unused receive address
901  *  registers for the first multicast addresses, and hashes the rest into the
902  *  multicast table.
903  **/
904 s32 ixgbe_update_mc_addr_list(struct ixgbe_hw *hw, u8 *mc_addr_list,
905                               u32 mc_addr_count, ixgbe_mc_addr_itr func,
906                               bool clear)
907 {
908         return ixgbe_call_func(hw, hw->mac.ops.update_mc_addr_list, (hw,
909                                mc_addr_list, mc_addr_count, func, clear),
910                                IXGBE_NOT_IMPLEMENTED);
911 }
912
913 /**
914  *  ixgbe_enable_mc - Enable multicast address in RAR
915  *  @hw: pointer to hardware structure
916  *
917  *  Enables multicast address in RAR and the use of the multicast hash table.
918  **/
919 s32 ixgbe_enable_mc(struct ixgbe_hw *hw)
920 {
921         return ixgbe_call_func(hw, hw->mac.ops.enable_mc, (hw),
922                                IXGBE_NOT_IMPLEMENTED);
923 }
924
925 /**
926  *  ixgbe_disable_mc - Disable multicast address in RAR
927  *  @hw: pointer to hardware structure
928  *
929  *  Disables multicast address in RAR and the use of the multicast hash table.
930  **/
931 s32 ixgbe_disable_mc(struct ixgbe_hw *hw)
932 {
933         return ixgbe_call_func(hw, hw->mac.ops.disable_mc, (hw),
934                                IXGBE_NOT_IMPLEMENTED);
935 }
936
937 /**
938  *  ixgbe_clear_vfta - Clear VLAN filter table
939  *  @hw: pointer to hardware structure
940  *
941  *  Clears the VLAN filer table, and the VMDq index associated with the filter
942  **/
943 s32 ixgbe_clear_vfta(struct ixgbe_hw *hw)
944 {
945         return ixgbe_call_func(hw, hw->mac.ops.clear_vfta, (hw),
946                                IXGBE_NOT_IMPLEMENTED);
947 }
948
949 /**
950  *  ixgbe_set_vfta - Set VLAN filter table
951  *  @hw: pointer to hardware structure
952  *  @vlan: VLAN id to write to VLAN filter
953  *  @vind: VMDq output index that maps queue to VLAN id in VFTA
954  *  @vlan_on: boolean flag to turn on/off VLAN in VFTA
955  *
956  *  Turn on/off specified VLAN in the VLAN filter table.
957  **/
958 s32 ixgbe_set_vfta(struct ixgbe_hw *hw, u32 vlan, u32 vind, bool vlan_on)
959 {
960         return ixgbe_call_func(hw, hw->mac.ops.set_vfta, (hw, vlan, vind,
961                                vlan_on), IXGBE_NOT_IMPLEMENTED);
962 }
963
964 /**
965  *  ixgbe_set_vlvf - Set VLAN Pool Filter
966  *  @hw: pointer to hardware structure
967  *  @vlan: VLAN id to write to VLAN filter
968  *  @vind: VMDq output index that maps queue to VLAN id in VFVFB
969  *  @vlan_on: boolean flag to turn on/off VLAN in VFVF
970  *  @vfta_changed: pointer to boolean flag which indicates whether VFTA
971  *                 should be changed
972  *
973  *  Turn on/off specified bit in VLVF table.
974  **/
975 s32 ixgbe_set_vlvf(struct ixgbe_hw *hw, u32 vlan, u32 vind, bool vlan_on,
976                     bool *vfta_changed)
977 {
978         return ixgbe_call_func(hw, hw->mac.ops.set_vlvf, (hw, vlan, vind,
979                                vlan_on, vfta_changed), IXGBE_NOT_IMPLEMENTED);
980 }
981
982 /**
983  *  ixgbe_fc_enable - Enable flow control
984  *  @hw: pointer to hardware structure
985  *
986  *  Configures the flow control settings based on SW configuration.
987  **/
988 s32 ixgbe_fc_enable(struct ixgbe_hw *hw)
989 {
990         return ixgbe_call_func(hw, hw->mac.ops.fc_enable, (hw),
991                                IXGBE_NOT_IMPLEMENTED);
992 }
993
994 /**
995  * ixgbe_set_fw_drv_ver - Try to send the driver version number FW
996  * @hw: pointer to hardware structure
997  * @maj: driver major number to be sent to firmware
998  * @min: driver minor number to be sent to firmware
999  * @build: driver build number to be sent to firmware
1000  * @ver: driver version number to be sent to firmware
1001  **/
1002 s32 ixgbe_set_fw_drv_ver(struct ixgbe_hw *hw, u8 maj, u8 min, u8 build,
1003                          u8 ver)
1004 {
1005         return ixgbe_call_func(hw, hw->mac.ops.set_fw_drv_ver, (hw, maj, min,
1006                                build, ver), IXGBE_NOT_IMPLEMENTED);
1007 }
1008
1009
1010
1011
1012 /**
1013  *  ixgbe_read_analog_reg8 - Reads 8 bit analog register
1014  *  @hw: pointer to hardware structure
1015  *  @reg: analog register to read
1016  *  @val: read value
1017  *
1018  *  Performs write operation to analog register specified.
1019  **/
1020 s32 ixgbe_read_analog_reg8(struct ixgbe_hw *hw, u32 reg, u8 *val)
1021 {
1022         return ixgbe_call_func(hw, hw->mac.ops.read_analog_reg8, (hw, reg,
1023                                val), IXGBE_NOT_IMPLEMENTED);
1024 }
1025
1026 /**
1027  *  ixgbe_write_analog_reg8 - Writes 8 bit analog register
1028  *  @hw: pointer to hardware structure
1029  *  @reg: analog register to write
1030  *  @val: value to write
1031  *
1032  *  Performs write operation to Atlas analog register specified.
1033  **/
1034 s32 ixgbe_write_analog_reg8(struct ixgbe_hw *hw, u32 reg, u8 val)
1035 {
1036         return ixgbe_call_func(hw, hw->mac.ops.write_analog_reg8, (hw, reg,
1037                                val), IXGBE_NOT_IMPLEMENTED);
1038 }
1039
1040 /**
1041  *  ixgbe_init_uta_tables - Initializes Unicast Table Arrays.
1042  *  @hw: pointer to hardware structure
1043  *
1044  *  Initializes the Unicast Table Arrays to zero on device load.  This
1045  *  is part of the Rx init addr execution path.
1046  **/
1047 s32 ixgbe_init_uta_tables(struct ixgbe_hw *hw)
1048 {
1049         return ixgbe_call_func(hw, hw->mac.ops.init_uta_tables, (hw),
1050                                IXGBE_NOT_IMPLEMENTED);
1051 }
1052
1053 /**
1054  *  ixgbe_read_i2c_byte - Reads 8 bit word over I2C at specified device address
1055  *  @hw: pointer to hardware structure
1056  *  @byte_offset: byte offset to read
1057  *  @data: value read
1058  *
1059  *  Performs byte read operation to SFP module's EEPROM over I2C interface.
1060  **/
1061 s32 ixgbe_read_i2c_byte(struct ixgbe_hw *hw, u8 byte_offset, u8 dev_addr,
1062                         u8 *data)
1063 {
1064         return ixgbe_call_func(hw, hw->phy.ops.read_i2c_byte, (hw, byte_offset,
1065                                dev_addr, data), IXGBE_NOT_IMPLEMENTED);
1066 }
1067
1068 /**
1069  *  ixgbe_write_i2c_byte - Writes 8 bit word over I2C
1070  *  @hw: pointer to hardware structure
1071  *  @byte_offset: byte offset to write
1072  *  @data: value to write
1073  *
1074  *  Performs byte write operation to SFP module's EEPROM over I2C interface
1075  *  at a specified device address.
1076  **/
1077 s32 ixgbe_write_i2c_byte(struct ixgbe_hw *hw, u8 byte_offset, u8 dev_addr,
1078                          u8 data)
1079 {
1080         return ixgbe_call_func(hw, hw->phy.ops.write_i2c_byte, (hw, byte_offset,
1081                                dev_addr, data), IXGBE_NOT_IMPLEMENTED);
1082 }
1083
1084 /**
1085  *  ixgbe_write_i2c_eeprom - Writes 8 bit EEPROM word over I2C interface
1086  *  @hw: pointer to hardware structure
1087  *  @byte_offset: EEPROM byte offset to write
1088  *  @eeprom_data: value to write
1089  *
1090  *  Performs byte write operation to SFP module's EEPROM over I2C interface.
1091  **/
1092 s32 ixgbe_write_i2c_eeprom(struct ixgbe_hw *hw,
1093                            u8 byte_offset, u8 eeprom_data)
1094 {
1095         return ixgbe_call_func(hw, hw->phy.ops.write_i2c_eeprom,
1096                                (hw, byte_offset, eeprom_data),
1097                                IXGBE_NOT_IMPLEMENTED);
1098 }
1099
1100 /**
1101  *  ixgbe_read_i2c_eeprom - Reads 8 bit EEPROM word over I2C interface
1102  *  @hw: pointer to hardware structure
1103  *  @byte_offset: EEPROM byte offset to read
1104  *  @eeprom_data: value read
1105  *
1106  *  Performs byte read operation to SFP module's EEPROM over I2C interface.
1107  **/
1108 s32 ixgbe_read_i2c_eeprom(struct ixgbe_hw *hw, u8 byte_offset, u8 *eeprom_data)
1109 {
1110         return ixgbe_call_func(hw, hw->phy.ops.read_i2c_eeprom,
1111                               (hw, byte_offset, eeprom_data),
1112                               IXGBE_NOT_IMPLEMENTED);
1113 }
1114
1115 /**
1116  *  ixgbe_get_supported_physical_layer - Returns physical layer type
1117  *  @hw: pointer to hardware structure
1118  *
1119  *  Determines physical layer capabilities of the current configuration.
1120  **/
1121 u32 ixgbe_get_supported_physical_layer(struct ixgbe_hw *hw)
1122 {
1123         return ixgbe_call_func(hw, hw->mac.ops.get_supported_physical_layer,
1124                                (hw), IXGBE_PHYSICAL_LAYER_UNKNOWN);
1125 }
1126
1127 /**
1128  *  ixgbe_enable_rx_dma - Enables Rx DMA unit, dependent on device specifics
1129  *  @hw: pointer to hardware structure
1130  *  @regval: bitfield to write to the Rx DMA register
1131  *
1132  *  Enables the Rx DMA unit of the device.
1133  **/
1134 s32 ixgbe_enable_rx_dma(struct ixgbe_hw *hw, u32 regval)
1135 {
1136         return ixgbe_call_func(hw, hw->mac.ops.enable_rx_dma,
1137                                (hw, regval), IXGBE_NOT_IMPLEMENTED);
1138 }
1139
1140 /**
1141  *  ixgbe_disable_sec_rx_path - Stops the receive data path
1142  *  @hw: pointer to hardware structure
1143  *
1144  *  Stops the receive data path.
1145  **/
1146 s32 ixgbe_disable_sec_rx_path(struct ixgbe_hw *hw)
1147 {
1148         return ixgbe_call_func(hw, hw->mac.ops.disable_sec_rx_path,
1149                                 (hw), IXGBE_NOT_IMPLEMENTED);
1150 }
1151
1152 /**
1153  *  ixgbe_enable_sec_rx_path - Enables the receive data path
1154  *  @hw: pointer to hardware structure
1155  *
1156  *  Enables the receive data path.
1157  **/
1158 s32 ixgbe_enable_sec_rx_path(struct ixgbe_hw *hw)
1159 {
1160         return ixgbe_call_func(hw, hw->mac.ops.enable_sec_rx_path,
1161                                 (hw), IXGBE_NOT_IMPLEMENTED);
1162 }
1163
1164 /**
1165  *  ixgbe_acquire_swfw_semaphore - Acquire SWFW semaphore
1166  *  @hw: pointer to hardware structure
1167  *  @mask: Mask to specify which semaphore to acquire
1168  *
1169  *  Acquires the SWFW semaphore through SW_FW_SYNC register for the specified
1170  *  function (CSR, PHY0, PHY1, EEPROM, Flash)
1171  **/
1172 s32 ixgbe_acquire_swfw_semaphore(struct ixgbe_hw *hw, u16 mask)
1173 {
1174         return ixgbe_call_func(hw, hw->mac.ops.acquire_swfw_sync,
1175                                (hw, mask), IXGBE_NOT_IMPLEMENTED);
1176 }
1177
1178 /**
1179  *  ixgbe_release_swfw_semaphore - Release SWFW semaphore
1180  *  @hw: pointer to hardware structure
1181  *  @mask: Mask to specify which semaphore to release
1182  *
1183  *  Releases the SWFW semaphore through SW_FW_SYNC register for the specified
1184  *  function (CSR, PHY0, PHY1, EEPROM, Flash)
1185  **/
1186 void ixgbe_release_swfw_semaphore(struct ixgbe_hw *hw, u16 mask)
1187 {
1188         if (hw->mac.ops.release_swfw_sync)
1189                 hw->mac.ops.release_swfw_sync(hw, mask);
1190 }
1191