Print this page
3014 Intel X540 Support (fix lint)

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/ixgbe/ixgbe_82598.c
          +++ new/usr/src/uts/common/io/ixgbe/ixgbe_82598.c
↓ open down ↓ 712 lines elided ↑ open up ↑
 713  713   *  @speed: new link speed
 714  714   *  @autoneg: TRUE if autonegotiation enabled
 715  715   *  @autoneg_wait_to_complete: TRUE when waiting for completion is needed
 716  716   *
 717  717   *  Set the link speed in the AUTOC register and restarts link.
 718  718   **/
 719  719  static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw,
 720  720                                        ixgbe_link_speed speed, bool autoneg,
 721  721                                        bool autoneg_wait_to_complete)
 722  722  {
 723      -        s32 status = IXGBE_SUCCESS;
      723 +        s32 status;
 724  724          ixgbe_link_speed link_capabilities = IXGBE_LINK_SPEED_UNKNOWN;
 725  725          u32 curr_autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC);
 726  726          u32 autoc = curr_autoc;
 727  727          u32 link_mode = autoc & IXGBE_AUTOC_LMS_MASK;
 728  728  
 729  729          DEBUGFUNC("ixgbe_setup_mac_link_82598");
 730  730  
 731  731          /* Check to see if speed passed in is supported. */
 732      -        ixgbe_get_link_capabilities(hw, &link_capabilities, &autoneg);
      732 +        status = ixgbe_get_link_capabilities(hw, &link_capabilities, &autoneg);
      733 +        if (status != IXGBE_SUCCESS)
      734 +                return (status);
 733  735          speed &= link_capabilities;
 734  736  
 735  737          if (speed == IXGBE_LINK_SPEED_UNKNOWN)
 736  738                  status = IXGBE_ERR_LINK_SETUP;
 737  739  
 738  740          /* Set KX4/KX support according to speed requested */
 739  741          else if (link_mode == IXGBE_AUTOC_LMS_KX4_AN ||
 740  742                   link_mode == IXGBE_AUTOC_LMS_KX4_AN_1G_AN) {
 741  743                  autoc &= ~IXGBE_AUTOC_KX4_KX_SUPP_MASK;
 742  744                  if (speed & IXGBE_LINK_SPEED_10GB_FULL)
↓ open down ↓ 32 lines elided ↑ open up ↑
 775  777                                           bool autoneg,
 776  778                                           bool autoneg_wait_to_complete)
 777  779  {
 778  780          s32 status;
 779  781  
 780  782          DEBUGFUNC("ixgbe_setup_copper_link_82598");
 781  783  
 782  784          /* Setup the PHY according to input speed */
 783  785          status = hw->phy.ops.setup_link_speed(hw, speed, autoneg,
 784  786                                                autoneg_wait_to_complete);
 785      -        /* Set up MAC */
 786      -        ixgbe_start_mac_link_82598(hw, autoneg_wait_to_complete);
      787 +        if (status == IXGBE_SUCCESS) {
      788 +                /* Set up MAC */
      789 +                status =
      790 +                    ixgbe_start_mac_link_82598(hw, autoneg_wait_to_complete);
      791 +        }
 787  792  
 788  793          return status;
 789  794  }
 790  795  
 791  796  /**
 792  797   *  ixgbe_reset_hw_82598 - Performs hardware reset
 793  798   *  @hw: pointer to hardware structure
 794  799   *
 795  800   *  Resets the hardware by resetting the transmit and receive units, masks and
 796  801   *  clears all interrupts, performing a PHY reset, and performing a link (MAC)
↓ open down ↓ 553 lines elided ↑ open up ↑
1350 1355          /* Setup Rx packet buffer sizes */
1351 1356          switch (strategy) {
1352 1357          case PBA_STRATEGY_WEIGHTED:
1353 1358                  /* Setup the first four at 80KB */
1354 1359                  rxpktsize = IXGBE_RXPBSIZE_80KB;
1355 1360                  for (; i < 4; i++)
1356 1361                          IXGBE_WRITE_REG(hw, IXGBE_RXPBSIZE(i), rxpktsize);
1357 1362                  /* Setup the last four at 48KB...don't re-init i */
1358 1363                  rxpktsize = IXGBE_RXPBSIZE_48KB;
1359 1364                  /* Fall Through */
     1365 +                /* FALLTHRU */
1360 1366          case PBA_STRATEGY_EQUAL:
1361 1367          default:
1362 1368                  /* Divide the remaining Rx packet buffer evenly among the TCs */
1363 1369                  for (; i < IXGBE_MAX_PACKET_BUFFERS; i++)
1364 1370                          IXGBE_WRITE_REG(hw, IXGBE_RXPBSIZE(i), rxpktsize);
1365 1371                  break;
1366 1372          }
1367 1373  
1368 1374          /* Setup Tx packet buffer sizes */
1369 1375          for (i = 0; i < IXGBE_MAX_PACKET_BUFFERS; i++)
1370 1376                  IXGBE_WRITE_REG(hw, IXGBE_TXPBSIZE(i), IXGBE_TXPBSIZE_40KB);
1371      -
1372      -        return;
1373 1377  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX