Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[safe/jmp/linux-2.6] / drivers / net / bnx2x_link.c
index 7897fe1..32e79c3 100644 (file)
@@ -14,6 +14,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/pci.h>
@@ -2592,16 +2594,11 @@ static void bnx2x_bcm8726_external_rom_boot(struct link_params *params)
        /* Need to wait 100ms after reset */
        msleep(100);
 
-       /* Set serial boot control for external load */
-       bnx2x_cl45_write(bp, port, ext_phy_type, ext_phy_addr,
-                      MDIO_PMA_DEVAD,
-                      MDIO_PMA_REG_MISC_CTRL1, 0x0001);
-
        /* Micro controller re-boot */
        bnx2x_cl45_write(bp, port, ext_phy_type, ext_phy_addr,
                       MDIO_PMA_DEVAD,
                       MDIO_PMA_REG_GEN_CTRL,
-                      MDIO_PMA_REG_GEN_CTRL_ROM_RESET_INTERNAL_MP);
+                      0x018B);
 
        /* Set soft reset */
        bnx2x_cl45_write(bp, port, ext_phy_type, ext_phy_addr,
@@ -2609,14 +2606,10 @@ static void bnx2x_bcm8726_external_rom_boot(struct link_params *params)
                       MDIO_PMA_REG_GEN_CTRL,
                       MDIO_PMA_REG_GEN_CTRL_ROM_MICRO_RESET);
 
-       /* Set PLL register value to be same like in P13 ver */
        bnx2x_cl45_write(bp, port, ext_phy_type, ext_phy_addr,
                       MDIO_PMA_DEVAD,
-                      MDIO_PMA_REG_PLL_CTRL,
-                      0x73A0);
+                      MDIO_PMA_REG_MISC_CTRL1, 0x0001);
 
-       /* Clear soft reset.
-       Will automatically reset micro-controller re-boot */
        bnx2x_cl45_write(bp, port, ext_phy_type, ext_phy_addr,
                       MDIO_PMA_DEVAD,
                       MDIO_PMA_REG_GEN_CTRL,
@@ -2996,11 +2989,8 @@ static u8 bnx2x_verify_sfp_module(struct link_params *params)
        else
                vendor_pn[SFP_EEPROM_PART_NO_SIZE] = '\0';
 
-       printk(KERN_INFO PFX  "Warning: "
-                        "Unqualified SFP+ module "
-                        "detected on %s, Port %d from %s part number %s\n"
-                       , bp->dev->name, params->port,
-                       vendor_name, vendor_pn);
+       netdev_info(bp->dev, "Warning: Unqualified SFP+ module detected, Port %d from %s part number %s\n",
+                   params->port, vendor_name, vendor_pn);
        return -EINVAL;
 }
 
@@ -3542,8 +3532,8 @@ static void bnx2x_8481_set_10G_led_mode(struct link_params *params,
                       MDIO_PMA_REG_8481_LINK_SIGNAL,
                       &val1);
        /* Set bit 2 to 0, and bits [1:0] to 10 */
-       val1 &= ~((1<<0) | (1<<2)); /* Clear bits 0,2*/
-       val1 |= (1<<1); /* Set bit 1 */
+       val1 &= ~((1<<0) | (1<<2) | (1<<7)); /* Clear bits 0,2,7*/
+       val1 |= ((1<<1) | (1<<6)); /* Set bit 1, 6 */
 
        bnx2x_cl45_write(bp, params->port,
                       ext_phy_type,
@@ -3577,36 +3567,19 @@ static void bnx2x_8481_set_10G_led_mode(struct link_params *params,
                       MDIO_PMA_REG_8481_LED2_MASK,
                       0);
 
-       /* LED3 (10G/1G/100/10G Activity) */
-       bnx2x_cl45_read(bp, params->port,
-                     ext_phy_type,
-                     ext_phy_addr,
-                     MDIO_PMA_DEVAD,
-                     MDIO_PMA_REG_8481_LINK_SIGNAL,
-                     &val1);
-       /* Enable blink based on source 4(Activity) */
-       val1 &= ~((1<<7) | (1<<8)); /* Clear bits 7,8 */
-       val1 |= (1<<6); /* Set only bit 6 */
+       /* Unmask LED3 for 10G link */
        bnx2x_cl45_write(bp, params->port,
                       ext_phy_type,
                       ext_phy_addr,
                       MDIO_PMA_DEVAD,
-                      MDIO_PMA_REG_8481_LINK_SIGNAL,
-                      val1);
-
-       bnx2x_cl45_read(bp, params->port,
-                     ext_phy_type,
-                     ext_phy_addr,
-                     MDIO_PMA_DEVAD,
                      MDIO_PMA_REG_8481_LED3_MASK,
-                     &val1);
-       val1 |= (1<<4); /* Unmask LED3 for 10G link */
+                      0x6);
        bnx2x_cl45_write(bp, params->port,
                       ext_phy_type,
                       ext_phy_addr,
                       MDIO_PMA_DEVAD,
-                      MDIO_PMA_REG_8481_LED3_MASK,
-                      val1);
+                      MDIO_PMA_REG_8481_LED3_BLINK,
+                      0);
 }
 
 
@@ -4485,17 +4458,12 @@ static u8 bnx2x_ext_phy_init(struct link_params *params, struct link_vars *vars)
                                    PORT_HW_CFG_SPEED_CAPABILITY_D0_10G) {
                                        DP(NETIF_MSG_LINK, "Advertising 10G\n");
                                        /* Restart autoneg for 10G*/
-                       bnx2x_cl45_read(bp, params->port,
-                                     ext_phy_type,
-                                     ext_phy_addr,
-                                     MDIO_AN_DEVAD,
-                                     MDIO_AN_REG_CTRL, &val);
-                       val |= 0x200;
+
                        bnx2x_cl45_write(bp, params->port,
                                       ext_phy_type,
                                       ext_phy_addr,
                                       MDIO_AN_DEVAD,
-                                      MDIO_AN_REG_CTRL, val);
+                                      MDIO_AN_REG_CTRL, 0x3200);
                                }
                        } else {
                                /* Force speed */
@@ -4748,8 +4716,8 @@ static u8 bnx2x_ext_phy_is_link_up(struct link_params *params,
                                      0xc809, &val1);
 
                        DP(NETIF_MSG_LINK, "8705 1.c809 val=0x%x\n", val1);
-                       ext_phy_link_up = ((rx_sd & 0x1) && (val1 & (1<<9))
-                                          && ((val1 & (1<<8)) == 0));
+                       ext_phy_link_up = ((rx_sd & 0x1) && (val1 & (1<<9)) &&
+                                          ((val1 & (1<<8)) == 0));
                        if (ext_phy_link_up)
                                vars->line_speed = SPEED_10000;
                        break;
@@ -4877,16 +4845,8 @@ static u8 bnx2x_ext_phy_is_link_up(struct link_params *params,
                                                     " has been detected on "
                                                     "port %d\n",
                                                 params->port);
-                                       printk(KERN_ERR PFX  "Error:  Power"
-                                                " fault on %s Port %d has"
-                                                " been detected and the"
-                                                " power to that SFP+ module"
-                                                " has been removed to prevent"
-                                                " failure of the card. Please"
-                                                " remove the SFP+ module and"
-                                                " restart the system to clear"
-                                                " this error.\n"
-                       , bp->dev->name, params->port);
+                                       netdev_err(bp->dev, "Error:  Power fault on Port %d has been detected and the power to that SFP+ module has been removed to prevent failure of the card. Please remove the SFP+ module and restart the system to clear this error.\n",
+                                                  params->port);
                                        /*
                                         * Disable all RX_ALARMs except for
                                         * mod_abs
@@ -6353,10 +6313,11 @@ static u8 bnx2x_update_link_up(struct link_params *params,
                bnx2x_bmac_enable(params, vars, 0);
                bnx2x_set_led(params, LED_MODE_OPER, SPEED_10000);
        } else {
-               bnx2x_emac_enable(params, vars, 0);
                rc = bnx2x_emac_program(params, vars->line_speed,
                                      vars->duplex);
 
+               bnx2x_emac_enable(params, vars, 0);
+
                /* AN complete? */
                if (gp_status & MDIO_AN_CL73_OR_37_COMPLETE) {
                        if (!(vars->phy_flags &