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