Print this page
3014 Intel X540 Support (fix lint)

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/ixgbe/ixgbe_api.c
          +++ new/usr/src/uts/common/io/ixgbe/ixgbe_api.c
↓ open down ↓ 48 lines elided ↑ open up ↑
  49   49   **/
  50   50  s32 ixgbe_init_shared_code(struct ixgbe_hw *hw)
  51   51  {
  52   52          s32 status;
  53   53  
  54   54          DEBUGFUNC("ixgbe_init_shared_code");
  55   55  
  56   56          /*
  57   57           * Set the mac type
  58   58           */
  59      -        ixgbe_set_mac_type(hw);
       59 +        status = ixgbe_set_mac_type(hw);
       60 +        if (status != IXGBE_SUCCESS)
       61 +                return (status);
  60   62  
  61   63          switch (hw->mac.type) {
  62   64          case ixgbe_mac_82598EB:
  63   65                  status = ixgbe_init_ops_82598(hw);
  64   66                  break;
  65   67          case ixgbe_mac_82599EB:
  66   68                  status = ixgbe_init_ops_82599(hw);
  67   69                  break;
  68   70          case ixgbe_mac_X540:
  69   71                  status = ixgbe_init_ops_X540(hw);
↓ open down ↓ 371 lines elided ↑ open up ↑
 441  443   *  ixgbe_read_phy_reg - Read PHY register
 442  444   *  @hw: pointer to hardware structure
 443  445   *  @reg_addr: 32 bit address of PHY register to read
 444  446   *  @phy_data: Pointer to read data from PHY register
 445  447   *
 446  448   *  Reads a value from a specified PHY register
 447  449   **/
 448  450  s32 ixgbe_read_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type,
 449  451                         u16 *phy_data)
 450  452  {
      453 +        s32 status;
      454 +
 451  455          if (hw->phy.id == 0)
 452      -                ixgbe_identify_phy(hw);
      456 +                status = ixgbe_identify_phy(hw);
      457 +        else
      458 +                status = IXGBE_SUCCESS;
 453  459  
 454      -        return ixgbe_call_func(hw, hw->phy.ops.read_reg, (hw, reg_addr,
 455      -                               device_type, phy_data), IXGBE_NOT_IMPLEMENTED);
      460 +        if (status == IXGBE_SUCCESS) {
      461 +                status = ixgbe_call_func(hw, hw->phy.ops.read_reg,
      462 +                    (hw, reg_addr, device_type, phy_data),
      463 +                    IXGBE_NOT_IMPLEMENTED);
      464 +        }
      465 +        return (status);
 456  466  }
 457  467  
 458  468  /**
 459  469   *  ixgbe_write_phy_reg - Write PHY register
 460  470   *  @hw: pointer to hardware structure
 461  471   *  @reg_addr: 32 bit PHY register to write
 462  472   *  @phy_data: Data to write to the PHY register
 463  473   *
 464  474   *  Writes a value to specified PHY register
 465  475   **/
 466  476  s32 ixgbe_write_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type,
 467  477                          u16 phy_data)
 468  478  {
      479 +        s32 status;
      480 +
 469  481          if (hw->phy.id == 0)
 470      -                ixgbe_identify_phy(hw);
      482 +                status = ixgbe_identify_phy(hw);
      483 +        else
      484 +                status = IXGBE_SUCCESS;
 471  485  
 472      -        return ixgbe_call_func(hw, hw->phy.ops.write_reg, (hw, reg_addr,
 473      -                               device_type, phy_data), IXGBE_NOT_IMPLEMENTED);
      486 +        if (status == IXGBE_SUCCESS) {
      487 +                status = ixgbe_call_func(hw, hw->phy.ops.write_reg,
      488 +                    (hw, reg_addr, device_type, phy_data),
      489 +                    IXGBE_NOT_IMPLEMENTED);
      490 +        }
      491 +
      492 +        return status;
 474  493  }
 475  494  
 476  495  /**
 477  496   *  ixgbe_setup_phy_link - Restart PHY autoneg
 478  497   *  @hw: pointer to hardware structure
 479  498   *
 480  499   *  Restart autonegotiation and PHY and waits for completion.
 481  500   **/
 482  501  s32 ixgbe_setup_phy_link(struct ixgbe_hw *hw)
 483  502  {
↓ open down ↓ 694 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX