tailq: remove static slots
[dpdk.git] / lib / librte_pmd_ixgbe / ixgbe_82599_bypass.c
index 97f883c..12cc01d 100644 (file)
@@ -1,13 +1,13 @@
 /*-
  *   BSD LICENSE
- * 
- *   Copyright(c) 2010-2013 Intel Corporation. All rights reserved.
+ *
+ *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
  *   All rights reserved.
- * 
+ *
  *   Redistribution and use in source and binary forms, with or without
  *   modification, are permitted provided that the following conditions
  *   are met:
- * 
+ *
  *     * Redistributions of source code must retain the above copyright
  *       notice, this list of conditions and the following disclaimer.
  *     * Redistributions in binary form must reproduce the above copyright
@@ -17,7 +17,7 @@
  *     * Neither the name of Intel Corporation nor the names of its
  *       contributors may be used to endorse or promote products derived
  *       from this software without specific prior written permission.
- * 
+ *
  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -63,7 +63,7 @@ ixgbe_set_fiber_fixed_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed)
                rs = IXGBE_SFF_SOFT_RS_SELECT_1G;
                break;
        default:
-               DEBUGOUT("Invalid fixed module speed\n");
+               PMD_DRV_LOG(ERR, "Invalid fixed module speed");
                return;
        }
 
@@ -72,7 +72,7 @@ ixgbe_set_fiber_fixed_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed)
                                           IXGBE_I2C_EEPROM_DEV_ADDR2,
                                           &eeprom_data);
        if (status) {
-               DEBUGOUT("Failed to read Rx Rate Select RS0\n");
+               PMD_DRV_LOG(ERR, "Failed to read Rx Rate Select RS0");
                goto out;
        }
 
@@ -82,7 +82,7 @@ ixgbe_set_fiber_fixed_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed)
                                            IXGBE_I2C_EEPROM_DEV_ADDR2,
                                            eeprom_data);
        if (status) {
-               DEBUGOUT("Failed to write Rx Rate Select RS0\n");
+               PMD_DRV_LOG(ERR, "Failed to write Rx Rate Select RS0");
                goto out;
        }
 
@@ -91,7 +91,7 @@ ixgbe_set_fiber_fixed_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed)
                                           IXGBE_I2C_EEPROM_DEV_ADDR2,
                                           &eeprom_data);
        if (status) {
-               DEBUGOUT("Failed to read Rx Rate Select RS1\n");
+               PMD_DRV_LOG(ERR, "Failed to read Rx Rate Select RS1");
                goto out;
        }
 
@@ -101,7 +101,7 @@ ixgbe_set_fiber_fixed_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed)
                                            IXGBE_I2C_EEPROM_DEV_ADDR2,
                                            eeprom_data);
        if (status) {
-               DEBUGOUT("Failed to write Rx Rate Select RS1\n");
+               PMD_DRV_LOG(ERR, "Failed to write Rx Rate Select RS1");
                goto out;
        }
 out:
@@ -112,14 +112,13 @@ out:
  *  ixgbe_setup_mac_link_multispeed_fixed_fiber - Set MAC link speed
  *  @hw: pointer to hardware structure
  *  @speed: new link speed
- *  @autoneg: true if autonegotiation enabled
  *  @autoneg_wait_to_complete: true when waiting for completion is needed
  *
  *  Set the link speed in the AUTOC register and restarts link.
  **/
 static s32
 ixgbe_setup_mac_link_multispeed_fixed_fiber(struct ixgbe_hw *hw,
-                                    ixgbe_link_speed speed, bool autoneg,
+                                    ixgbe_link_speed speed,
                                     bool autoneg_wait_to_complete)
 {
        s32 status = IXGBE_SUCCESS;
@@ -131,7 +130,7 @@ ixgbe_setup_mac_link_multispeed_fixed_fiber(struct ixgbe_hw *hw,
        bool link_up = false;
        bool negotiation;
 
-       DEBUGFUNC("");
+       PMD_INIT_FUNC_TRACE();
 
        /* Mask off requested but non-supported speeds */
        status = ixgbe_get_link_capabilities(hw, &link_speed, &negotiation);
@@ -157,7 +156,7 @@ ixgbe_setup_mac_link_multispeed_fixed_fiber(struct ixgbe_hw *hw,
                        goto out;
                /* Set the module link speed */
                ixgbe_set_fiber_fixed_speed(hw, IXGBE_LINK_SPEED_10GB_FULL);
-                                           
+
                /* Set the module link speed */
                esdp_reg |= (IXGBE_ESDP_SDP5_DIR | IXGBE_ESDP_SDP5);
                IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg);
@@ -168,7 +167,6 @@ ixgbe_setup_mac_link_multispeed_fixed_fiber(struct ixgbe_hw *hw,
 
                status = ixgbe_setup_mac_link_82599(hw,
                                                    IXGBE_LINK_SPEED_10GB_FULL,
-                                                   autoneg,
                                                    autoneg_wait_to_complete);
                if (status != IXGBE_SUCCESS)
                        return status;
@@ -211,13 +209,12 @@ ixgbe_setup_mac_link_multispeed_fixed_fiber(struct ixgbe_hw *hw,
 
                /* Set the module link speed */
                ixgbe_set_fiber_fixed_speed(hw, IXGBE_LINK_SPEED_1GB_FULL);
-                                                   
+
                /* Allow module to change analog characteristics (10G->1G) */
                msec_delay(40);
 
                status = ixgbe_setup_mac_link_82599(hw,
                                                    IXGBE_LINK_SPEED_1GB_FULL,
-                                                   autoneg,
                                                    autoneg_wait_to_complete);
                if (status != IXGBE_SUCCESS)
                        return status;
@@ -244,7 +241,7 @@ ixgbe_setup_mac_link_multispeed_fixed_fiber(struct ixgbe_hw *hw,
         */
        if (speedcnt > 1)
                status = ixgbe_setup_mac_link_multispeed_fixed_fiber(hw,
-                       highest_link_speed, autoneg, autoneg_wait_to_complete);
+                       highest_link_speed, autoneg_wait_to_complete);
 
 out:
        /* Set autoneg_advertised value based on input link speed */
@@ -259,25 +256,12 @@ out:
        return status;
 }
 
-/*
- * Wrapper around ND functions to support BYPASS nic.
- */
-s32
-ixgbe_bypass_init_shared_code(struct ixgbe_hw *hw)
-{
-       if (hw->device_id == IXGBE_DEV_ID_82599_BYPASS) {
-               hw->mac.type = ixgbe_mac_82599EB;
-       }
-
-       return (ixgbe_init_shared_code(hw));
-}
-
 static enum ixgbe_media_type
 ixgbe_bypass_get_media_type(struct ixgbe_hw *hw)
 {
        enum ixgbe_media_type media_type;
 
-       DEBUGFUNC("");
+       PMD_INIT_FUNC_TRACE();
 
        if (hw->device_id == IXGBE_DEV_ID_82599_BYPASS) {
                media_type = ixgbe_media_type_fiber;
@@ -287,11 +271,32 @@ ixgbe_bypass_get_media_type(struct ixgbe_hw *hw)
        return (media_type);
 }
 
+/*
+ * Wrapper around shared code (base driver) to support BYPASS nic.
+ */
+s32
+ixgbe_bypass_init_shared_code(struct ixgbe_hw *hw)
+{
+       s32 ret_val;
+
+       if (hw->device_id == IXGBE_DEV_ID_82599_BYPASS) {
+               hw->mac.type = ixgbe_mac_82599EB;
+       }
+
+       ret_val = ixgbe_init_shared_code(hw);
+       if (hw->device_id == IXGBE_DEV_ID_82599_BYPASS) {
+               hw->mac.ops.get_media_type = &ixgbe_bypass_get_media_type;
+               ixgbe_init_mac_link_ops_82599(hw);
+       }
+
+       return ret_val;
+}
+
 s32
 ixgbe_bypass_init_hw(struct ixgbe_hw *hw)
 {
        int rc;
-       
+
        if ((rc  = ixgbe_init_hw(hw)) == 0 &&
                        hw->device_id == IXGBE_DEV_ID_82599_BYPASS) {