Print this page
Import some changes from FreeBSD (details later, this is quick-n-dirty for now).

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/ixgbe/ixgbe_common.c
          +++ new/usr/src/uts/common/io/ixgbe/ixgbe_common.c
   1    1  /******************************************************************************
   2    2  
   3      -  Copyright (c) 2001-2012, Intel Corporation 
        3 +  Copyright (c) 2001-2013, Intel Corporation 
   4    4    All rights reserved.
   5    5    
   6    6    Redistribution and use in source and binary forms, with or without 
   7    7    modification, are permitted provided that the following conditions are met:
   8    8    
   9    9     1. Redistributions of source code must retain the above copyright notice, 
  10   10        this list of conditions and the following disclaimer.
  11   11    
  12   12     2. Redistributions in binary form must reproduce the above copyright 
  13   13        notice, this list of conditions and the following disclaimer in the 
↓ open down ↓ 126 lines elided ↑ open up ↑
 140  140  
 141  141  /**
 142  142   *  ixgbe_device_supports_autoneg_fc - Check if phy supports autoneg flow
 143  143   *  control
 144  144   *  @hw: pointer to hardware structure
 145  145   *
 146  146   *  There are several phys that do not support autoneg flow control. This
 147  147   *  function check the device id to see if the associated phy supports
 148  148   *  autoneg flow control.
 149  149   **/
 150      -static s32 ixgbe_device_supports_autoneg_fc(struct ixgbe_hw *hw)
      150 +s32 ixgbe_device_supports_autoneg_fc(struct ixgbe_hw *hw)
 151  151  {
 152  152  
 153  153          DEBUGFUNC("ixgbe_device_supports_autoneg_fc");
 154  154  
 155  155          switch (hw->device_id) {
      156 +        case IXGBE_DEV_ID_82599_T3_LOM:
 156  157          case IXGBE_DEV_ID_X540T:
 157      -        case IXGBE_DEV_ID_X540T1:
 158  158                  return IXGBE_SUCCESS;
 159      -        case IXGBE_DEV_ID_82599_T3_LOM:
 160      -                return IXGBE_SUCCESS;
 161  159          default:
 162  160                  return IXGBE_ERR_FC_NOT_SUPPORTED;
 163  161          }
 164  162  }
 165  163  
 166  164  /**
 167  165   *  ixgbe_setup_fc - Set up flow control
 168  166   *  @hw: pointer to hardware structure
 169  167   *
 170  168   *  Called at init time to set up flow control.
 171  169   **/
 172  170  static s32 ixgbe_setup_fc(struct ixgbe_hw *hw)
 173  171  {
 174  172          s32 ret_val = IXGBE_SUCCESS;
 175  173          u32 reg = 0, reg_bp = 0;
 176  174          u16 reg_cu = 0;
      175 +        bool got_lock = FALSE;
 177  176  
 178  177          DEBUGFUNC("ixgbe_setup_fc");
 179  178  
 180  179          /*
 181  180           * Validate the requested mode.  Strict IEEE mode does not allow
 182  181           * ixgbe_fc_rx_pause because it will cause us to fail at UNH.
 183  182           */
 184  183          if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) {
 185  184                  DEBUGOUT("ixgbe_fc_rx_pause not valid in strict IEEE mode\n");
 186  185                  ret_val = IXGBE_ERR_INVALID_LINK_SETTINGS;
↓ open down ↓ 6 lines elided ↑ open up ↑
 193  192           */
 194  193          if (hw->fc.requested_mode == ixgbe_fc_default)
 195  194                  hw->fc.requested_mode = ixgbe_fc_full;
 196  195  
 197  196          /*
 198  197           * Set up the 1G and 10G flow control advertisement registers so the
 199  198           * HW will be able to do fc autoneg once the cable is plugged in.  If
 200  199           * we link at 10G, the 1G advertisement is harmless and vice versa.
 201  200           */
 202  201          switch (hw->phy.media_type) {
      202 +        case ixgbe_media_type_fiber_fixed:
 203  203          case ixgbe_media_type_fiber:
 204  204          case ixgbe_media_type_backplane:
 205  205                  reg = IXGBE_READ_REG(hw, IXGBE_PCS1GANA);
 206  206                  reg_bp = IXGBE_READ_REG(hw, IXGBE_AUTOC);
 207  207                  break;
 208  208          case ixgbe_media_type_copper:
 209  209                  hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_ADVT,
 210  210                                       IXGBE_MDIO_AUTO_NEG_DEV_TYPE, &reg_cu);
 211  211                  break;
 212  212          default:
↓ open down ↓ 76 lines elided ↑ open up ↑
 289  289                  DEBUGOUT1("Set up FC; PCS1GLCTL = 0x%08X\n", reg);
 290  290          }
 291  291  
 292  292          /*
 293  293           * AUTOC restart handles negotiation of 1G and 10G on backplane
 294  294           * and copper. There is no need to set the PCS1GCTL register.
 295  295           *
 296  296           */
 297  297          if (hw->phy.media_type == ixgbe_media_type_backplane) {
 298  298                  reg_bp |= IXGBE_AUTOC_AN_RESTART;
      299 +                /* Need the SW/FW semaphore around AUTOC writes if 82599 and
      300 +                 * LESM is on, likewise reset_pipeline requries the lock as
      301 +                 * it also writes AUTOC.
      302 +                 */
      303 +                if ((hw->mac.type == ixgbe_mac_82599EB) &&
      304 +                    ixgbe_verify_lesm_fw_enabled_82599(hw)) {
      305 +                        ret_val = hw->mac.ops.acquire_swfw_sync(hw,
      306 +                                                        IXGBE_GSSR_MAC_CSR_SM);
      307 +                        if (ret_val != IXGBE_SUCCESS) {
      308 +                                ret_val = IXGBE_ERR_SWFW_SYNC;
      309 +                                goto out;
      310 +                        }
      311 +                        got_lock = TRUE;
      312 +                }
      313 +
 299  314                  IXGBE_WRITE_REG(hw, IXGBE_AUTOC, reg_bp);
      315 +                if (hw->mac.type == ixgbe_mac_82599EB)
      316 +                        (void) ixgbe_reset_pipeline_82599(hw);
      317 +
      318 +                if (got_lock)
      319 +                        hw->mac.ops.release_swfw_sync(hw,
      320 +                                                      IXGBE_GSSR_MAC_CSR_SM);
 300  321          } else if ((hw->phy.media_type == ixgbe_media_type_copper) &&
 301  322                      (ixgbe_device_supports_autoneg_fc(hw) == IXGBE_SUCCESS)) {
 302  323                  hw->phy.ops.write_reg(hw, IXGBE_MDIO_AUTO_NEG_ADVT,
 303  324                                        IXGBE_MDIO_AUTO_NEG_DEV_TYPE, reg_cu);
 304  325          }
 305  326  
 306  327          DEBUGOUT1("Set up FC; IXGBE_AUTOC = 0x%08X\n", reg);
 307  328  out:
 308  329          return ret_val;
 309  330  }
↓ open down ↓ 362 lines elided ↑ open up ↑
 672  693          if (ret_val) {
 673  694                  DEBUGOUT("NVM Read Error\n");
 674  695                  return ret_val;
 675  696          }
 676  697          *pba_num |= data;
 677  698  
 678  699          return IXGBE_SUCCESS;
 679  700  }
 680  701  
 681  702  /**
      703 + *  ixgbe_read_pba_raw
      704 + *  @hw: pointer to the HW structure
      705 + *  @eeprom_buf: optional pointer to EEPROM image
      706 + *  @eeprom_buf_size: size of EEPROM image in words
      707 + *  @max_pba_block_size: PBA block size limit
      708 + *  @pba: pointer to output PBA structure
      709 + *
      710 + *  Reads PBA from EEPROM image when eeprom_buf is not NULL.
      711 + *  Reads PBA from physical EEPROM device when eeprom_buf is NULL.
      712 + *
      713 + **/
      714 +s32 ixgbe_read_pba_raw(struct ixgbe_hw *hw, u16 *eeprom_buf,
      715 +                       u32 eeprom_buf_size, u16 max_pba_block_size,
      716 +                       struct ixgbe_pba *pba)
      717 +{
      718 +        s32 ret_val;
      719 +        u16 pba_block_size;
      720 +
      721 +        if (pba == NULL)
      722 +                return IXGBE_ERR_PARAM;
      723 +
      724 +        if (eeprom_buf == NULL) {
      725 +                ret_val = hw->eeprom.ops.read_buffer(hw, IXGBE_PBANUM0_PTR, 2,
      726 +                                                     &pba->word[0]);
      727 +                if (ret_val)
      728 +                        return ret_val;
      729 +        } else {
      730 +                if (eeprom_buf_size > IXGBE_PBANUM1_PTR) {
      731 +                        pba->word[0] = eeprom_buf[IXGBE_PBANUM0_PTR];
      732 +                        pba->word[1] = eeprom_buf[IXGBE_PBANUM1_PTR];
      733 +                } else {
      734 +                        return IXGBE_ERR_PARAM;
      735 +                }
      736 +        }
      737 +
      738 +        if (pba->word[0] == IXGBE_PBANUM_PTR_GUARD) {
      739 +                if (pba->pba_block == NULL)
      740 +                        return IXGBE_ERR_PARAM;
      741 +
      742 +                ret_val = ixgbe_get_pba_block_size(hw, eeprom_buf,
      743 +                                                   eeprom_buf_size,
      744 +                                                   &pba_block_size);
      745 +                if (ret_val)
      746 +                        return ret_val;
      747 +
      748 +                if (pba_block_size > max_pba_block_size)
      749 +                        return IXGBE_ERR_PARAM;
      750 +
      751 +                if (eeprom_buf == NULL) {
      752 +                        ret_val = hw->eeprom.ops.read_buffer(hw, pba->word[1],
      753 +                                                             pba_block_size,
      754 +                                                             pba->pba_block);
      755 +                        if (ret_val)
      756 +                                return ret_val;
      757 +                } else {
      758 +                        if (eeprom_buf_size > (u32)(pba->word[1] +
      759 +                                              pba->pba_block[0])) {
      760 +                                (void) memcpy(pba->pba_block,
      761 +                                       &eeprom_buf[pba->word[1]],
      762 +                                       pba_block_size * sizeof(u16));
      763 +                        } else {
      764 +                                return IXGBE_ERR_PARAM;
      765 +                        }
      766 +                }
      767 +        }
      768 +
      769 +        return IXGBE_SUCCESS;
      770 +}
      771 +
      772 +/**
      773 + *  ixgbe_write_pba_raw
      774 + *  @hw: pointer to the HW structure
      775 + *  @eeprom_buf: optional pointer to EEPROM image
      776 + *  @eeprom_buf_size: size of EEPROM image in words
      777 + *  @pba: pointer to PBA structure
      778 + *
      779 + *  Writes PBA to EEPROM image when eeprom_buf is not NULL.
      780 + *  Writes PBA to physical EEPROM device when eeprom_buf is NULL.
      781 + *
      782 + **/
      783 +s32 ixgbe_write_pba_raw(struct ixgbe_hw *hw, u16 *eeprom_buf,
      784 +                        u32 eeprom_buf_size, struct ixgbe_pba *pba)
      785 +{
      786 +        s32 ret_val;
      787 +
      788 +        if (pba == NULL)
      789 +                return IXGBE_ERR_PARAM;
      790 +
      791 +        if (eeprom_buf == NULL) {
      792 +                ret_val = hw->eeprom.ops.write_buffer(hw, IXGBE_PBANUM0_PTR, 2,
      793 +                                                      &pba->word[0]);
      794 +                if (ret_val)
      795 +                        return ret_val;
      796 +        } else {
      797 +                if (eeprom_buf_size > IXGBE_PBANUM1_PTR) {
      798 +                        eeprom_buf[IXGBE_PBANUM0_PTR] = pba->word[0];
      799 +                        eeprom_buf[IXGBE_PBANUM1_PTR] = pba->word[1];
      800 +                } else {
      801 +                        return IXGBE_ERR_PARAM;
      802 +                }
      803 +        }
      804 +
      805 +        if (pba->word[0] == IXGBE_PBANUM_PTR_GUARD) {
      806 +                if (pba->pba_block == NULL)
      807 +                        return IXGBE_ERR_PARAM;
      808 +
      809 +                if (eeprom_buf == NULL) {
      810 +                        ret_val = hw->eeprom.ops.write_buffer(hw, pba->word[1],
      811 +                                                              pba->pba_block[0],
      812 +                                                              pba->pba_block);
      813 +                        if (ret_val)
      814 +                                return ret_val;
      815 +                } else {
      816 +                        if (eeprom_buf_size > (u32)(pba->word[1] +
      817 +                                              pba->pba_block[0])) {
      818 +                                (void) memcpy(&eeprom_buf[pba->word[1]],
      819 +                                       pba->pba_block,
      820 +                                       pba->pba_block[0] * sizeof(u16));
      821 +                        } else {
      822 +                                return IXGBE_ERR_PARAM;
      823 +                        }
      824 +                }
      825 +        }
      826 +
      827 +        return IXGBE_SUCCESS;
      828 +}
      829 +
      830 +/**
      831 + *  ixgbe_get_pba_block_size
      832 + *  @hw: pointer to the HW structure
      833 + *  @eeprom_buf: optional pointer to EEPROM image
      834 + *  @eeprom_buf_size: size of EEPROM image in words
      835 + *  @pba_data_size: pointer to output variable
      836 + *
      837 + *  Returns the size of the PBA block in words. Function operates on EEPROM
      838 + *  image if the eeprom_buf pointer is not NULL otherwise it accesses physical
      839 + *  EEPROM device.
      840 + *
      841 + **/
      842 +s32 ixgbe_get_pba_block_size(struct ixgbe_hw *hw, u16 *eeprom_buf,
      843 +                             u32 eeprom_buf_size, u16 *pba_block_size)
      844 +{
      845 +        s32 ret_val;
      846 +        u16 pba_word[2];
      847 +        u16 length;
      848 +
      849 +        DEBUGFUNC("ixgbe_get_pba_block_size");
      850 +
      851 +        if (eeprom_buf == NULL) {
      852 +                ret_val = hw->eeprom.ops.read_buffer(hw, IXGBE_PBANUM0_PTR, 2,
      853 +                                                     &pba_word[0]);
      854 +                if (ret_val)
      855 +                        return ret_val;
      856 +        } else {
      857 +                if (eeprom_buf_size > IXGBE_PBANUM1_PTR) {
      858 +                        pba_word[0] = eeprom_buf[IXGBE_PBANUM0_PTR];
      859 +                        pba_word[1] = eeprom_buf[IXGBE_PBANUM1_PTR];
      860 +                } else {
      861 +                        return IXGBE_ERR_PARAM;
      862 +                }
      863 +        }
      864 +
      865 +        if (pba_word[0] == IXGBE_PBANUM_PTR_GUARD) {
      866 +                if (eeprom_buf == NULL) {
      867 +                        ret_val = hw->eeprom.ops.read(hw, pba_word[1] + 0,
      868 +                                                      &length);
      869 +                        if (ret_val)
      870 +                                return ret_val;
      871 +                } else {
      872 +                        if (eeprom_buf_size > pba_word[1])
      873 +                                length = eeprom_buf[pba_word[1] + 0];
      874 +                        else
      875 +                                return IXGBE_ERR_PARAM;
      876 +                }
      877 +
      878 +                if (length == 0xFFFF || length == 0)
      879 +                        return IXGBE_ERR_PBA_SECTION;
      880 +        } else {
      881 +                /* PBA number in legacy format, there is no PBA Block. */
      882 +                length = 0;
      883 +        }
      884 +
      885 +        if (pba_block_size != NULL)
      886 +                *pba_block_size = length;
      887 +
      888 +        return IXGBE_SUCCESS;
      889 +}
      890 +
      891 +/**
 682  892   *  ixgbe_get_mac_addr_generic - Generic get MAC address
 683  893   *  @hw: pointer to hardware structure
 684  894   *  @mac_addr: Adapter MAC address
 685  895   *
 686  896   *  Reads the adapter's MAC address from first Receive Address Register (RAR0)
 687  897   *  A reset of the adapter must be performed prior to calling this function
 688  898   *  in order for the MAC address to have been loaded from the EEPROM into RAR0
 689  899   **/
 690  900  s32 ixgbe_get_mac_addr_generic(struct ixgbe_hw *hw, u8 *mac_addr)
 691  901  {
↓ open down ↓ 570 lines elided ↑ open up ↑
1262 1472                  status = IXGBE_ERR_INVALID_ARGUMENT;
1263 1473                  goto out;
1264 1474          }
1265 1475  
1266 1476          if (offset >= hw->eeprom.word_size) {
1267 1477                  status = IXGBE_ERR_EEPROM;
1268 1478                  goto out;
1269 1479          }
1270 1480  
1271 1481          for (i = 0; i < words; i++) {
1272      -                eerd = ((offset + i) << IXGBE_EEPROM_RW_ADDR_SHIFT) +
     1482 +                eerd = ((offset + i) << IXGBE_EEPROM_RW_ADDR_SHIFT) |
1273 1483                         IXGBE_EEPROM_RW_REG_START;
1274 1484  
1275 1485                  IXGBE_WRITE_REG(hw, IXGBE_EERD, eerd);
1276 1486                  status = ixgbe_poll_eerd_eewr_done(hw, IXGBE_NVM_POLL_READ);
1277 1487  
1278 1488                  if (status == IXGBE_SUCCESS) {
1279 1489                          data[i] = (IXGBE_READ_REG(hw, IXGBE_EERD) >>
1280 1490                                     IXGBE_EEPROM_RW_REG_DATA);
1281 1491                  } else {
1282 1492                          DEBUGOUT("Eeprom read timed out\n");
↓ open down ↓ 1429 lines elided ↑ open up ↑
2712 2922           */
2713 2923          if (hw->fc.disable_fc_autoneg)
2714 2924                  goto out;
2715 2925  
2716 2926          hw->mac.ops.check_link(hw, &speed, &link_up, FALSE);
2717 2927          if (!link_up)
2718 2928                  goto out;
2719 2929  
2720 2930          switch (hw->phy.media_type) {
2721 2931          /* Autoneg flow control on fiber adapters */
     2932 +        case ixgbe_media_type_fiber_fixed:
2722 2933          case ixgbe_media_type_fiber:
2723 2934                  if (speed == IXGBE_LINK_SPEED_1GB_FULL)
2724 2935                          ret_val = ixgbe_fc_autoneg_fiber(hw);
2725 2936                  break;
2726 2937  
2727 2938          /* Autoneg flow control on backplane adapters */
2728 2939          case ixgbe_media_type_backplane:
2729 2940                  ret_val = ixgbe_fc_autoneg_backplane(hw);
2730 2941                  break;
2731 2942  
↓ open down ↓ 226 lines elided ↑ open up ↑
2958 3169   *  ixgbe_blink_led_start_generic - Blink LED based on index.
2959 3170   *  @hw: pointer to hardware structure
2960 3171   *  @index: led number to blink
2961 3172   **/
2962 3173  s32 ixgbe_blink_led_start_generic(struct ixgbe_hw *hw, u32 index)
2963 3174  {
2964 3175          ixgbe_link_speed speed = 0;
2965 3176          bool link_up = 0;
2966 3177          u32 autoc_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC);
2967 3178          u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
     3179 +        s32 ret_val = IXGBE_SUCCESS;
2968 3180  
2969 3181          DEBUGFUNC("ixgbe_blink_led_start_generic");
2970 3182  
2971 3183          /*
2972 3184           * Link must be up to auto-blink the LEDs;
2973 3185           * Force it if link is down.
2974 3186           */
2975 3187          hw->mac.ops.check_link(hw, &speed, &link_up, FALSE);
2976 3188  
2977 3189          if (!link_up) {
     3190 +                /* Need the SW/FW semaphore around AUTOC writes if 82599 and
     3191 +                 * LESM is on.
     3192 +                 */
     3193 +                bool got_lock = FALSE;
     3194 +                if ((hw->mac.type == ixgbe_mac_82599EB) &&
     3195 +                    ixgbe_verify_lesm_fw_enabled_82599(hw)) {
     3196 +                        ret_val = hw->mac.ops.acquire_swfw_sync(hw,
     3197 +                                                        IXGBE_GSSR_MAC_CSR_SM);
     3198 +                        if (ret_val != IXGBE_SUCCESS) {
     3199 +                                ret_val = IXGBE_ERR_SWFW_SYNC;
     3200 +                                goto out;
     3201 +                        }
     3202 +                        got_lock = TRUE;
     3203 +                }
     3204 +
2978 3205                  autoc_reg |= IXGBE_AUTOC_AN_RESTART;
2979 3206                  autoc_reg |= IXGBE_AUTOC_FLU;
2980 3207                  IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc_reg);
2981 3208                  IXGBE_WRITE_FLUSH(hw);
     3209 +
     3210 +                if (got_lock)
     3211 +                        hw->mac.ops.release_swfw_sync(hw,
     3212 +                                                      IXGBE_GSSR_MAC_CSR_SM);
2982 3213                  msec_delay(10);
2983 3214          }
2984 3215  
2985 3216          led_reg &= ~IXGBE_LED_MODE_MASK(index);
2986 3217          led_reg |= IXGBE_LED_BLINK(index);
2987 3218          IXGBE_WRITE_REG(hw, IXGBE_LEDCTL, led_reg);
2988 3219          IXGBE_WRITE_FLUSH(hw);
2989 3220  
2990      -        return IXGBE_SUCCESS;
     3221 +out:
     3222 +        return ret_val;
2991 3223  }
2992 3224  
2993 3225  /**
2994 3226   *  ixgbe_blink_led_stop_generic - Stop blinking LED based on index.
2995 3227   *  @hw: pointer to hardware structure
2996 3228   *  @index: led number to stop blinking
2997 3229   **/
2998 3230  s32 ixgbe_blink_led_stop_generic(struct ixgbe_hw *hw, u32 index)
2999 3231  {
3000 3232          u32 autoc_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC);
3001 3233          u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
     3234 +        s32 ret_val = IXGBE_SUCCESS;
     3235 +        bool got_lock = FALSE;
3002 3236  
3003 3237          DEBUGFUNC("ixgbe_blink_led_stop_generic");
     3238 +        /* Need the SW/FW semaphore around AUTOC writes if 82599 and
     3239 +         * LESM is on.
     3240 +         */
     3241 +        if ((hw->mac.type == ixgbe_mac_82599EB) &&
     3242 +            ixgbe_verify_lesm_fw_enabled_82599(hw)) {
     3243 +                ret_val = hw->mac.ops.acquire_swfw_sync(hw,
     3244 +                                                IXGBE_GSSR_MAC_CSR_SM);
     3245 +                if (ret_val != IXGBE_SUCCESS) {
     3246 +                        ret_val = IXGBE_ERR_SWFW_SYNC;
     3247 +                        goto out;
     3248 +                }
     3249 +                got_lock = TRUE;
     3250 +        }
3004 3251  
3005 3252  
3006 3253          autoc_reg &= ~IXGBE_AUTOC_FLU;
3007 3254          autoc_reg |= IXGBE_AUTOC_AN_RESTART;
3008 3255          IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc_reg);
3009 3256  
     3257 +        if (hw->mac.type == ixgbe_mac_82599EB)
     3258 +                (void) ixgbe_reset_pipeline_82599(hw);
     3259 +
     3260 +        if (got_lock)
     3261 +                hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_MAC_CSR_SM);
     3262 +
3010 3263          led_reg &= ~IXGBE_LED_MODE_MASK(index);
3011 3264          led_reg &= ~IXGBE_LED_BLINK(index);
3012 3265          led_reg |= IXGBE_LED_LINK_ACTIVE << IXGBE_LED_MODE_SHIFT(index);
3013 3266          IXGBE_WRITE_REG(hw, IXGBE_LEDCTL, led_reg);
3014 3267          IXGBE_WRITE_FLUSH(hw);
3015 3268  
3016      -        return IXGBE_SUCCESS;
     3269 +out:
     3270 +        return ret_val;
3017 3271  }
3018 3272  
3019 3273  /**
3020 3274   *  ixgbe_get_san_mac_addr_offset - Get SAN MAC address offset from the EEPROM
3021 3275   *  @hw: pointer to hardware structure
3022 3276   *  @san_mac_offset: SAN MAC address offset
3023 3277   *
3024 3278   *  This function will read the EEPROM location for the SAN MAC address
3025 3279   *  pointer, and returns the value at that location.  This is used in both
3026 3280   *  get and set mac_addr routines.
↓ open down ↓ 848 lines elided ↑ open up ↑
3875 4129  
3876 4130  }
3877 4131  
3878 4132  /**
3879 4133   *  ixgbe_calculate_checksum - Calculate checksum for buffer
3880 4134   *  @buffer: pointer to EEPROM
3881 4135   *  @length: size of EEPROM to calculate a checksum for
3882 4136   *  Calculates the checksum for some buffer on a specified length.  The
3883 4137   *  checksum calculated is returned.
3884 4138   **/
3885      -static u8 ixgbe_calculate_checksum(u8 *buffer, u32 length)
     4139 +u8 ixgbe_calculate_checksum(u8 *buffer, u32 length)
3886 4140  {
3887 4141          u32 i;
3888 4142          u8 sum = 0;
3889 4143  
3890 4144          DEBUGFUNC("ixgbe_calculate_checksum");
3891 4145  
3892 4146          if (!buffer)
3893 4147                  return 0;
3894 4148  
3895 4149          for (i = 0; i < length; i++)
↓ open down ↓ 5 lines elided ↑ open up ↑
3901 4155  /**
3902 4156   *  ixgbe_host_interface_command - Issue command to manageability block
3903 4157   *  @hw: pointer to the HW structure
3904 4158   *  @buffer: contains the command to write and where the return status will
3905 4159   *   be placed
3906 4160   *  @length: length of buffer, must be multiple of 4 bytes
3907 4161   *
3908 4162   *  Communicates with the manageability block.  On success return IXGBE_SUCCESS
3909 4163   *  else return IXGBE_ERR_HOST_INTERFACE_COMMAND.
3910 4164   **/
3911      -static s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,
3912      -                                        u32 length)
     4165 +s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,
     4166 +                                 u32 length)
3913 4167  {
3914 4168          u32 hicr, i, bi;
3915 4169          u32 hdr_size = sizeof(struct ixgbe_hic_hdr);
3916 4170          u8 buf_len, dword_len;
3917 4171  
3918 4172          s32 ret_val = IXGBE_SUCCESS;
3919 4173  
3920 4174          DEBUGFUNC("ixgbe_host_interface_command");
3921 4175  
3922 4176          if (length == 0 || length & 0x3 ||
↓ open down ↓ 240 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX