enic: add device ids
[dpdk.git] / lib / librte_pmd_e1000 / e1000 / e1000_80003es2lan.c
index c53873a..72692d9 100644 (file)
@@ -1,6 +1,6 @@
 /*******************************************************************************
 
-Copyright (c) 2001-2012, Intel Corporation
+Copyright (c) 2001-2014, Intel Corporation
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -31,16 +31,12 @@ POSSIBILITY OF SUCH DAMAGE.
 
 ***************************************************************************/
 
-/*
- * 80003ES2LAN Gigabit Ethernet Controller (Copper)
+/* 80003ES2LAN Gigabit Ethernet Controller (Copper)
  * 80003ES2LAN Gigabit Ethernet Controller (Serdes)
  */
 
 #include "e1000_api.h"
 
-STATIC s32  e1000_init_phy_params_80003es2lan(struct e1000_hw *hw);
-STATIC s32  e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw);
-STATIC s32  e1000_init_mac_params_80003es2lan(struct e1000_hw *hw);
 STATIC s32  e1000_acquire_phy_80003es2lan(struct e1000_hw *hw);
 STATIC void e1000_release_phy_80003es2lan(struct e1000_hw *hw);
 STATIC s32  e1000_acquire_nvm_80003es2lan(struct e1000_hw *hw);
@@ -62,26 +58,24 @@ STATIC s32  e1000_reset_hw_80003es2lan(struct e1000_hw *hw);
 STATIC s32  e1000_init_hw_80003es2lan(struct e1000_hw *hw);
 STATIC s32  e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw);
 STATIC void e1000_clear_hw_cntrs_80003es2lan(struct e1000_hw *hw);
-static s32  e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask);
-static s32  e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex);
-static s32  e1000_cfg_kmrn_1000_80003es2lan(struct e1000_hw *hw);
-static s32  e1000_cfg_on_link_up_80003es2lan(struct e1000_hw *hw);
-static s32  e1000_read_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
+STATIC s32  e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask);
+STATIC s32  e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex);
+STATIC s32  e1000_cfg_kmrn_1000_80003es2lan(struct e1000_hw *hw);
+STATIC s32  e1000_cfg_on_link_up_80003es2lan(struct e1000_hw *hw);
+STATIC s32  e1000_read_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
                                            u16 *data);
-static s32  e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
+STATIC s32  e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
                                             u16 data);
-static s32  e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw);
-static void e1000_initialize_hw_bits_80003es2lan(struct e1000_hw *hw);
-static void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask);
+STATIC void e1000_initialize_hw_bits_80003es2lan(struct e1000_hw *hw);
+STATIC void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask);
 STATIC s32  e1000_read_mac_addr_80003es2lan(struct e1000_hw *hw);
 STATIC void e1000_power_down_phy_copper_80003es2lan(struct e1000_hw *hw);
 
-/*
- * A table for the GG82563 cable length where the range is defined
+/* A table for the GG82563 cable length where the range is defined
  * with a lower bound at "index" and the upper bound at
  * "index + 5".
  */
-static const u16 e1000_gg82563_cable_length_table[] = {
+STATIC const u16 e1000_gg82563_cable_length_table[] = {
        0, 60, 115, 150, 150, 60, 115, 150, 180, 180, 0xFF };
 #define GG82563_CABLE_LENGTH_TABLE_SIZE \
                (sizeof(e1000_gg82563_cable_length_table) / \
@@ -172,8 +166,7 @@ STATIC s32 e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw)
        size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >>
                     E1000_EECD_SIZE_EX_SHIFT);
 
-       /*
-        * Added to a constant, "size" becomes the left-shift value
+       /* Added to a constant, "size" becomes the left-shift value
         * for setting word_size.
         */
        size += NVM_WORD_SIZE_BASE_SHIFT;
@@ -405,7 +398,7 @@ STATIC void e1000_release_nvm_80003es2lan(struct e1000_hw *hw)
  *  Acquire the SW/FW semaphore to access the PHY or NVM.  The mask
  *  will also specify which port we're acquiring the lock for.
  **/
-static s32 e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
+STATIC s32 e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
 {
        u32 swfw_sync;
        u32 swmask = mask;
@@ -423,8 +416,7 @@ static s32 e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
                if (!(swfw_sync & (fwmask | swmask)))
                        break;
 
-               /*
-                * Firmware currently using resource (fwmask)
+               /* Firmware currently using resource (fwmask)
                 * or other software thread using resource (swmask)
                 */
                e1000_put_hw_semaphore_generic(hw);
@@ -453,7 +445,7 @@ static s32 e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
  *  Release the SW/FW semaphore used to access the PHY or NVM.  The mask
  *  will also specify which port we're releasing the lock for.
  **/
-static void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
+STATIC void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
 {
        u32 swfw_sync;
 
@@ -494,8 +486,7 @@ STATIC s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
        if ((offset & MAX_PHY_REG_ADDRESS) < GG82563_MIN_ALT_REG) {
                page_select = GG82563_PHY_PAGE_SELECT;
        } else {
-               /*
-                * Use Alternative Page Select register to access
+               /* Use Alternative Page Select register to access
                 * registers 30 and 31
                 */
                page_select = GG82563_PHY_PAGE_SELECT_ALT;
@@ -509,8 +500,7 @@ STATIC s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
        }
 
        if (hw->dev_spec._80003es2lan.mdic_wa_enable) {
-               /*
-                * The "ready" bit in the MDIC register may be incorrectly set
+               /* The "ready" bit in the MDIC register may be incorrectly set
                 * before the device has completed the "Page Select" MDI
                 * transaction.  So we wait 200us after each MDI command...
                 */
@@ -567,8 +557,7 @@ STATIC s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
        if ((offset & MAX_PHY_REG_ADDRESS) < GG82563_MIN_ALT_REG) {
                page_select = GG82563_PHY_PAGE_SELECT;
        } else {
-               /*
-                * Use Alternative Page Select register to access
+               /* Use Alternative Page Select register to access
                 * registers 30 and 31
                 */
                page_select = GG82563_PHY_PAGE_SELECT_ALT;
@@ -582,8 +571,7 @@ STATIC s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
        }
 
        if (hw->dev_spec._80003es2lan.mdic_wa_enable) {
-               /*
-                * The "ready" bit in the MDIC register may be incorrectly set
+               /* The "ready" bit in the MDIC register may be incorrectly set
                 * before the device has completed the "Page Select" MDI
                 * transaction.  So we wait 200us after each MDI command...
                 */
@@ -681,8 +669,7 @@ STATIC s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
        if (!(hw->phy.ops.read_reg))
                return E1000_SUCCESS;
 
-       /*
-        * Clear Auto-Crossover to force MDI manually.  M88E1000 requires MDI
+       /* Clear Auto-Crossover to force MDI manually.  M88E1000 requires MDI
         * forced whenever speed and duplex are forced.
         */
        ret_val = hw->phy.ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
@@ -720,8 +707,7 @@ STATIC s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
                        return ret_val;
 
                if (!link) {
-                       /*
-                        * We didn't get link.
+                       /* We didn't get link.
                         * Reset the DSP and cross our fingers.
                         */
                        ret_val = e1000_phy_reset_dsp_generic(hw);
@@ -741,8 +727,7 @@ STATIC s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
        if (ret_val)
                return ret_val;
 
-       /*
-        * Resetting the phy means we need to verify the TX_CLK corresponds
+       /* Resetting the phy means we need to verify the TX_CLK corresponds
         * to the link speed.  10Mbps -> 2.5MHz, else 25MHz.
         */
        phy_data &= ~GG82563_MSCR_TX_CLK_MASK;
@@ -751,8 +736,7 @@ STATIC s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
        else
                phy_data |= GG82563_MSCR_TX_CLK_100MBPS_25;
 
-       /*
-        * In addition, we must re-enable CRS on Tx for both half and full
+       /* In addition, we must re-enable CRS on Tx for both half and full
         * duplex.
         */
        phy_data |= GG82563_MSCR_ASSERT_CRS_ON_TX;
@@ -772,7 +756,7 @@ STATIC s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
 STATIC s32 e1000_get_cable_length_80003es2lan(struct e1000_hw *hw)
 {
        struct e1000_phy_info *phy = &hw->phy;
-       s32 ret_val = E1000_SUCCESS;
+       s32 ret_val;
        u16 phy_data, index;
 
        DEBUGFUNC("e1000_get_cable_length_80003es2lan");
@@ -839,8 +823,7 @@ STATIC s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
 
        DEBUGFUNC("e1000_reset_hw_80003es2lan");
 
-       /*
-        * Prevent the PCI-E bus from sticking if there is no TLP connection
+       /* Prevent the PCI-E bus from sticking if there is no TLP connection
         * on the last TLP read/write transaction when MAC is reset.
         */
        ret_val = e1000_disable_pcie_master_generic(hw);
@@ -859,13 +842,18 @@ STATIC s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
        ctrl = E1000_READ_REG(hw, E1000_CTRL);
 
        ret_val = e1000_acquire_phy_80003es2lan(hw);
+       if (ret_val)
+               return ret_val;
+
        DEBUGOUT("Issuing a global reset to MAC\n");
        E1000_WRITE_REG(hw, E1000_CTRL, ctrl | E1000_CTRL_RST);
        e1000_release_phy_80003es2lan(hw);
 
        /* Disable IBIST slave mode (far-end loopback) */
-       e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
-                                       &kum_reg_data);
+       ret_val = e1000_read_kmrn_reg_80003es2lan(hw,
+                               E1000_KMRNCTRLSTA_INBAND_PARAM, &kum_reg_data);
+       if (ret_val)
+               return ret_val;
        kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE;
        e1000_write_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
                                        kum_reg_data);
@@ -902,9 +890,9 @@ STATIC s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
 
        /* Initialize identification LED */
        ret_val = mac->ops.id_led_init(hw);
+       /* An error is not fatal and we should not stop init due to this */
        if (ret_val)
                DEBUGOUT("Error initializing identification LED\n");
-               /* This is not fatal and we should not stop init due to this */
 
        /* Disabling VLAN filtering */
        DEBUGOUT("Initializing the IEEE VLAN\n");
@@ -920,6 +908,8 @@ STATIC s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
 
        /* Setup link and flow control */
        ret_val = mac->ops.setup_link(hw);
+       if (ret_val)
+               return ret_val;
 
        /* Disable IBIST slave mode (far-end loopback) */
        e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
@@ -930,14 +920,14 @@ STATIC s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
 
        /* Set the transmit descriptor write-back policy */
        reg_data = E1000_READ_REG(hw, E1000_TXDCTL(0));
-       reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH) |
-                  E1000_TXDCTL_FULL_TX_DESC_WB | E1000_TXDCTL_COUNT_DESC;
+       reg_data = ((reg_data & ~E1000_TXDCTL_WTHRESH) |
+                   E1000_TXDCTL_FULL_TX_DESC_WB | E1000_TXDCTL_COUNT_DESC);
        E1000_WRITE_REG(hw, E1000_TXDCTL(0), reg_data);
 
        /* ...for both queues. */
        reg_data = E1000_READ_REG(hw, E1000_TXDCTL(1));
-       reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH) |
-                  E1000_TXDCTL_FULL_TX_DESC_WB | E1000_TXDCTL_COUNT_DESC;
+       reg_data = ((reg_data & ~E1000_TXDCTL_WTHRESH) |
+                   E1000_TXDCTL_FULL_TX_DESC_WB | E1000_TXDCTL_COUNT_DESC);
        E1000_WRITE_REG(hw, E1000_TXDCTL(1), reg_data);
 
        /* Enable retransmit on late collisions */
@@ -964,18 +954,16 @@ STATIC s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
        /* default to true to enable the MDIC W/A */
        hw->dev_spec._80003es2lan.mdic_wa_enable = true;
 
-       ret_val = e1000_read_kmrn_reg_80003es2lan(hw,
-                                                E1000_KMRNCTRLSTA_OFFSET >>
-                                                E1000_KMRNCTRLSTA_OFFSET_SHIFT,
-                                                &i);
+       ret_val =
+           e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_OFFSET >>
+                                           E1000_KMRNCTRLSTA_OFFSET_SHIFT, &i);
        if (!ret_val) {
                if ((i & E1000_KMRNCTRLSTA_OPMODE_MASK) ==
                     E1000_KMRNCTRLSTA_OPMODE_INBAND_MDIO)
                        hw->dev_spec._80003es2lan.mdic_wa_enable = false;
        }
 
-       /*
-        * Clear all of the statistics registers (clear on read).  It is
+       /* Clear all of the statistics registers (clear on read).  It is
         * important that we do this after we have tried to establish link
         * because the symbol error count will increment wildly if there
         * is no link.
@@ -991,7 +979,7 @@ STATIC s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
  *
  *  Initializes required hardware-dependent bits needed for normal operation.
  **/
-static void e1000_initialize_hw_bits_80003es2lan(struct e1000_hw *hw)
+STATIC void e1000_initialize_hw_bits_80003es2lan(struct e1000_hw *hw)
 {
        u32 reg;
 
@@ -1022,8 +1010,7 @@ static void e1000_initialize_hw_bits_80003es2lan(struct e1000_hw *hw)
                reg |= (1 << 28);
        E1000_WRITE_REG(hw, E1000_TARC(1), reg);
 
-       /*
-        * Disable IPv6 extension header parsing because some malformed
+       /* Disable IPv6 extension header parsing because some malformed
         * IPv6 headers can hang the Rx.
         */
        reg = E1000_READ_REG(hw, E1000_RFCTL);
@@ -1039,11 +1026,11 @@ static void e1000_initialize_hw_bits_80003es2lan(struct e1000_hw *hw)
  *
  *  Setup some GG82563 PHY registers for obtaining link
  **/
-static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
+STATIC s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
 {
        struct e1000_phy_info *phy = &hw->phy;
        s32 ret_val;
-       u32 ctrl_ext;
+       u32 reg;
        u16 data;
 
        DEBUGFUNC("e1000_copper_link_setup_gg82563_80003es2lan");
@@ -1060,8 +1047,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
        if (ret_val)
                return ret_val;
 
-       /*
-        * Options:
+       /* Options:
         *   MDI/MDI-X = 0 (default)
         *   0 - Auto for all speeds
         *   1 - MDI mode
@@ -1087,8 +1073,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
                break;
        }
 
-       /*
-        * Options:
+       /* Options:
         *   disable_polarity_correction = 0 (default)
         *       Automatic Correction for Reversed Cable Polarity
         *   0 - Disabled
@@ -1110,20 +1095,19 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
        }
 
        /* Bypass Rx and Tx FIFO's */
-       ret_val = e1000_write_kmrn_reg_80003es2lan(hw,
-                                       E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL,
-                                       E1000_KMRNCTRLSTA_FIFO_CTRL_RX_BYPASS |
-                                       E1000_KMRNCTRLSTA_FIFO_CTRL_TX_BYPASS);
+       reg = E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL;
+       data = (E1000_KMRNCTRLSTA_FIFO_CTRL_RX_BYPASS |
+               E1000_KMRNCTRLSTA_FIFO_CTRL_TX_BYPASS);
+       ret_val = e1000_write_kmrn_reg_80003es2lan(hw, reg, data);
        if (ret_val)
                return ret_val;
 
-       ret_val = e1000_read_kmrn_reg_80003es2lan(hw,
-                               E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE, &data);
+       reg = E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE;
+       ret_val = e1000_read_kmrn_reg_80003es2lan(hw, reg, &data);
        if (ret_val)
                return ret_val;
        data |= E1000_KMRNCTRLSTA_OPMODE_E_IDLE;
-       ret_val = e1000_write_kmrn_reg_80003es2lan(hw,
-                               E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE, data);
+       ret_val = e1000_write_kmrn_reg_80003es2lan(hw, reg, data);
        if (ret_val)
                return ret_val;
 
@@ -1136,16 +1120,15 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
        if (ret_val)
                return ret_val;
 
-       ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT);
-       ctrl_ext &= ~(E1000_CTRL_EXT_LINK_MODE_MASK);
-       E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext);
+       reg = E1000_READ_REG(hw, E1000_CTRL_EXT);
+       reg &= ~E1000_CTRL_EXT_LINK_MODE_MASK;
+       E1000_WRITE_REG(hw, E1000_CTRL_EXT, reg);
 
        ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_PWR_MGMT_CTRL, &data);
        if (ret_val)
                return ret_val;
 
-       /*
-        * Do not init these registers when the HW is in IAMT mode, since the
+       /* Do not init these registers when the HW is in IAMT mode, since the
         * firmware will have already initialized them.  We only initialize
         * them if the HW is not in IAMT mode.
         */
@@ -1169,8 +1152,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
                        return ret_val;
        }
 
-       /*
-        * Workaround: Disable padding in Kumeran interface in the MAC
+       /* Workaround: Disable padding in Kumeran interface in the MAC
         * and in the PHY to avoid CRC errors.
         */
        ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_INBAND_CTRL, &data);
@@ -1205,8 +1187,7 @@ STATIC s32 e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw)
        ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX);
        E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
 
-       /*
-        * Set the mac to wait the maximum time between each
+       /* Set the mac to wait the maximum time between each
         * iteration and increase the max iterations when
         * polling the phy; this fixes erroneous timeouts at 10Mbps.
         */
@@ -1223,13 +1204,17 @@ STATIC s32 e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw)
                                                   reg_data);
        if (ret_val)
                return ret_val;
-       ret_val = e1000_read_kmrn_reg_80003es2lan(hw,
-                               E1000_KMRNCTRLSTA_OFFSET_INB_CTRL, &reg_data);
+       ret_val =
+           e1000_read_kmrn_reg_80003es2lan(hw,
+                                           E1000_KMRNCTRLSTA_OFFSET_INB_CTRL,
+                                           &reg_data);
        if (ret_val)
                return ret_val;
        reg_data |= E1000_KMRNCTRLSTA_INB_CTRL_DIS_PADDING;
-       ret_val = e1000_write_kmrn_reg_80003es2lan(hw,
-                               E1000_KMRNCTRLSTA_OFFSET_INB_CTRL, reg_data);
+       ret_val =
+           e1000_write_kmrn_reg_80003es2lan(hw,
+                                            E1000_KMRNCTRLSTA_OFFSET_INB_CTRL,
+                                            reg_data);
        if (ret_val)
                return ret_val;
 
@@ -1248,7 +1233,7 @@ STATIC s32 e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw)
  *  Configure the KMRN interface by applying last minute quirks for
  *  10/100 operation.
  **/
-static s32 e1000_cfg_on_link_up_80003es2lan(struct e1000_hw *hw)
+STATIC s32 e1000_cfg_on_link_up_80003es2lan(struct e1000_hw *hw)
 {
        s32 ret_val = E1000_SUCCESS;
        u16 speed;
@@ -1279,7 +1264,7 @@ static s32 e1000_cfg_on_link_up_80003es2lan(struct e1000_hw *hw)
  *  Configure the KMRN interface by applying last minute quirks for
  *  10/100 operation.
  **/
-static s32 e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex)
+STATIC s32 e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex)
 {
        s32 ret_val;
        u32 tipg;
@@ -1289,9 +1274,10 @@ static s32 e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex)
        DEBUGFUNC("e1000_configure_kmrn_for_10_100");
 
        reg_data = E1000_KMRNCTRLSTA_HD_CTRL_10_100_DEFAULT;
-       ret_val = e1000_write_kmrn_reg_80003es2lan(hw,
-                                      E1000_KMRNCTRLSTA_OFFSET_HD_CTRL,
-                                      reg_data);
+       ret_val =
+           e1000_write_kmrn_reg_80003es2lan(hw,
+                                            E1000_KMRNCTRLSTA_OFFSET_HD_CTRL,
+                                            reg_data);
        if (ret_val)
                return ret_val;
 
@@ -1329,7 +1315,7 @@ static s32 e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex)
  *  Configure the KMRN interface by applying last minute quirks for
  *  gigabit operation.
  **/
-static s32 e1000_cfg_kmrn_1000_80003es2lan(struct e1000_hw *hw)
+STATIC s32 e1000_cfg_kmrn_1000_80003es2lan(struct e1000_hw *hw)
 {
        s32 ret_val;
        u16 reg_data, reg_data2;
@@ -1339,8 +1325,10 @@ static s32 e1000_cfg_kmrn_1000_80003es2lan(struct e1000_hw *hw)
        DEBUGFUNC("e1000_configure_kmrn_for_1000");
 
        reg_data = E1000_KMRNCTRLSTA_HD_CTRL_1000_DEFAULT;
-       ret_val = e1000_write_kmrn_reg_80003es2lan(hw,
-                               E1000_KMRNCTRLSTA_OFFSET_HD_CTRL, reg_data);
+       ret_val =
+           e1000_write_kmrn_reg_80003es2lan(hw,
+                                            E1000_KMRNCTRLSTA_OFFSET_HD_CTRL,
+                                            reg_data);
        if (ret_val)
                return ret_val;
 
@@ -1378,11 +1366,11 @@ static s32 e1000_cfg_kmrn_1000_80003es2lan(struct e1000_hw *hw)
  *  using the kumeran interface.  The information retrieved is stored in data.
  *  Release the semaphore before exiting.
  **/
-static s32 e1000_read_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
+STATIC s32 e1000_read_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
                                           u16 *data)
 {
        u32 kmrnctrlsta;
-       s32 ret_val = E1000_SUCCESS;
+       s32 ret_val;
 
        DEBUGFUNC("e1000_read_kmrn_reg_80003es2lan");
 
@@ -1415,11 +1403,11 @@ static s32 e1000_read_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
  *  at the offset using the kumeran interface.  Release semaphore
  *  before exiting.
  **/
-static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
+STATIC s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
                                            u16 data)
 {
        u32 kmrnctrlsta;
-       s32 ret_val = E1000_SUCCESS;
+       s32 ret_val;
 
        DEBUGFUNC("e1000_write_kmrn_reg_80003es2lan");
 
@@ -1445,12 +1433,11 @@ static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
  **/
 STATIC s32 e1000_read_mac_addr_80003es2lan(struct e1000_hw *hw)
 {
-       s32 ret_val = E1000_SUCCESS;
+       s32 ret_val;
 
        DEBUGFUNC("e1000_read_mac_addr_80003es2lan");
 
-       /*
-        * If there's an alternate MAC address place it in RAR0
+       /* If there's an alternate MAC address place it in RAR0
         * so that it will override the Si installed default perm
         * address.
         */