Print this page
3014 Intel X540 Support (fix lint)

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/ixgbe/ixgbe_x540.c
          +++ new/usr/src/uts/common/io/ixgbe/ixgbe_x540.c
↓ open down ↓ 148 lines elided ↑ open up ↑
 149  149   *  @hw: pointer to hardware structure
 150  150   *  @speed: pointer to link speed
 151  151   *  @autoneg: TRUE when autoneg or autotry is enabled
 152  152   *
 153  153   *  Determines the link capabilities by reading the AUTOC register.
 154  154   **/
 155  155  s32 ixgbe_get_link_capabilities_X540(struct ixgbe_hw *hw,
 156  156                                       ixgbe_link_speed *speed,
 157  157                                       bool *autoneg)
 158  158  {
 159      -        ixgbe_get_copper_link_capabilities_generic(hw, speed, autoneg);
 160      -
 161      -        return IXGBE_SUCCESS;
      159 +        return ixgbe_get_copper_link_capabilities_generic(hw, speed, autoneg);
 162  160  }
 163  161  
 164  162  /**
 165  163   *  ixgbe_get_media_type_X540 - Get media type
 166  164   *  @hw: pointer to hardware structure
 167  165   *
 168  166   *  Returns the media type (fiber, copper, backplane)
 169  167   **/
 170  168  enum ixgbe_media_type ixgbe_get_media_type_X540(struct ixgbe_hw *hw)
 171  169  {
↓ open down ↓ 393 lines elided ↑ open up ↑
 565  563          }
 566  564  
 567  565          if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) ==
 568  566              IXGBE_SUCCESS) {
 569  567                  checksum = hw->eeprom.ops.calc_checksum(hw);
 570  568  
 571  569                  /*
 572  570                   * Do not use hw->eeprom.ops.read because we do not want to take
 573  571                   * the synchronization semaphores twice here.
 574  572                  */
 575      -                ixgbe_read_eerd_generic(hw, IXGBE_EEPROM_CHECKSUM,
      573 +                status = ixgbe_read_eerd_generic(hw, IXGBE_EEPROM_CHECKSUM,
 576  574                                          &read_checksum);
 577  575  
 578      -                /*
 579      -                 * Verify read checksum from EEPROM is the same as
 580      -                 * calculated checksum
 581      -                 */
 582      -                if (read_checksum != checksum)
 583      -                        status = IXGBE_ERR_EEPROM_CHECKSUM;
      576 +                if (status == IXGBE_SUCCESS) {
      577 +                        /*
      578 +                         * Verify read checksum from EEPROM is the same as
      579 +                         * calculated checksum
      580 +                         */
      581 +                        if (read_checksum != checksum)
      582 +                                status = IXGBE_ERR_EEPROM_CHECKSUM;
 584  583  
 585      -                /* If the user cares, return the calculated checksum */
 586      -                if (checksum_val)
 587      -                        *checksum_val = checksum;
      584 +                        /* If the user cares, return the calculated checksum */
      585 +                        if (checksum_val)
      586 +                                *checksum_val = checksum;
      587 +                }
 588  588          } else {
 589  589                  status = IXGBE_ERR_SWFW_SYNC;
 590  590          }
 591  591  
 592  592          hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM);
 593  593  out:
 594  594          return status;
 595  595  }
 596  596  
 597  597  /**
↓ open down ↓ 207 lines elided ↑ open up ↑
 805  805   *  Releases the SWFW semaphore through the SW_FW_SYNC register
 806  806   *  for the specified function (CSR, PHY0, PHY1, EVM, Flash)
 807  807   **/
 808  808  void ixgbe_release_swfw_sync_X540(struct ixgbe_hw *hw, u16 mask)
 809  809  {
 810  810          u32 swfw_sync;
 811  811          u32 swmask = mask;
 812  812  
 813  813          DEBUGFUNC("ixgbe_release_swfw_sync_X540");
 814  814  
 815      -        ixgbe_get_swfw_sync_semaphore(hw);
      815 +        (void) ixgbe_get_swfw_sync_semaphore(hw);
 816  816  
 817  817          swfw_sync = IXGBE_READ_REG(hw, IXGBE_SWFW_SYNC);
 818  818          swfw_sync &= ~swmask;
 819  819          IXGBE_WRITE_REG(hw, IXGBE_SWFW_SYNC, swfw_sync);
 820  820  
 821  821          ixgbe_release_swfw_sync_semaphore(hw);
 822  822          msec_delay(5);
 823  823  }
 824  824  
 825  825  /**
↓ open down ↓ 150 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX