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_api.c
          +++ new/usr/src/uts/common/io/ixgbe/ixgbe_api.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 ↓ 70 lines elided ↑ open up ↑
  84   84   *
  85   85   *  This function sets the mac type of the adapter based on the
  86   86   *  vendor ID and device ID stored in the hw structure.
  87   87   **/
  88   88  s32 ixgbe_set_mac_type(struct ixgbe_hw *hw)
  89   89  {
  90   90          s32 ret_val = IXGBE_SUCCESS;
  91   91  
  92   92          DEBUGFUNC("ixgbe_set_mac_type\n");
  93   93  
  94      -        if (hw->vendor_id == IXGBE_INTEL_VENDOR_ID) {
  95      -                switch (hw->device_id) {
  96      -                case IXGBE_DEV_ID_82598:
  97      -                case IXGBE_DEV_ID_82598_BX:
  98      -                case IXGBE_DEV_ID_82598AF_SINGLE_PORT:
  99      -                case IXGBE_DEV_ID_82598AF_DUAL_PORT:
 100      -                case IXGBE_DEV_ID_82598AT:
 101      -                case IXGBE_DEV_ID_82598AT2:
 102      -                case IXGBE_DEV_ID_82598EB_CX4:
 103      -                case IXGBE_DEV_ID_82598_CX4_DUAL_PORT:
 104      -                case IXGBE_DEV_ID_82598_DA_DUAL_PORT:
 105      -                case IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM:
 106      -                case IXGBE_DEV_ID_82598EB_XF_LR:
 107      -                case IXGBE_DEV_ID_82598EB_SFP_LOM:
 108      -                        hw->mac.type = ixgbe_mac_82598EB;
 109      -                        break;
 110      -                case IXGBE_DEV_ID_82599_KX4:
 111      -                case IXGBE_DEV_ID_82599_KX4_MEZZ:
 112      -                case IXGBE_DEV_ID_82599_XAUI_LOM:
 113      -                case IXGBE_DEV_ID_82599_COMBO_BACKPLANE:
 114      -                case IXGBE_DEV_ID_82599_KR:
 115      -                case IXGBE_DEV_ID_82599_SFP:
 116      -                case IXGBE_DEV_ID_82599_BACKPLANE_FCOE:
 117      -                case IXGBE_DEV_ID_82599_SFP_FCOE:
 118      -                case IXGBE_DEV_ID_82599_SFP_EM:
 119      -                case IXGBE_DEV_ID_82599_SFP_SF2:
 120      -                case IXGBE_DEV_ID_82599EN_SFP:
 121      -                case IXGBE_DEV_ID_82599_CX4:
 122      -                case IXGBE_DEV_ID_82599_T3_LOM:
 123      -                        hw->mac.type = ixgbe_mac_82599EB;
 124      -                        break;
 125      -                case IXGBE_DEV_ID_82599_VF:
 126      -                        hw->mac.type = ixgbe_mac_82599_vf;
 127      -                        break;
 128      -                case IXGBE_DEV_ID_X540_VF:
 129      -                        hw->mac.type = ixgbe_mac_X540_vf;
 130      -                        break;
 131      -                case IXGBE_DEV_ID_X540T:
 132      -                case IXGBE_DEV_ID_X540T1:
 133      -                        hw->mac.type = ixgbe_mac_X540;
 134      -                        break;
 135      -                default:
 136      -                        ret_val = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
 137      -                        break;
 138      -                }
 139      -        } else {
       94 +        switch (hw->device_id) {
       95 +        case IXGBE_DEV_ID_82598:
       96 +        case IXGBE_DEV_ID_82598_BX:
       97 +        case IXGBE_DEV_ID_82598AF_SINGLE_PORT:
       98 +        case IXGBE_DEV_ID_82598AF_DUAL_PORT:
       99 +        case IXGBE_DEV_ID_82598AT:
      100 +        case IXGBE_DEV_ID_82598AT2:
      101 +        case IXGBE_DEV_ID_82598EB_CX4:
      102 +        case IXGBE_DEV_ID_82598_CX4_DUAL_PORT:
      103 +        case IXGBE_DEV_ID_82598_DA_DUAL_PORT:
      104 +        case IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM:
      105 +        case IXGBE_DEV_ID_82598EB_XF_LR:
      106 +        case IXGBE_DEV_ID_82598EB_SFP_LOM:
      107 +                hw->mac.type = ixgbe_mac_82598EB;
      108 +                break;
      109 +        case IXGBE_DEV_ID_82599_KX4:
      110 +        case IXGBE_DEV_ID_82599_KX4_MEZZ:
      111 +        case IXGBE_DEV_ID_82599_XAUI_LOM:
      112 +        case IXGBE_DEV_ID_82599_COMBO_BACKPLANE:
      113 +        case IXGBE_DEV_ID_82599_KR:
      114 +        case IXGBE_DEV_ID_82599_SFP:
      115 +        case IXGBE_DEV_ID_82599_BACKPLANE_FCOE:
      116 +        case IXGBE_DEV_ID_82599_SFP_FCOE:
      117 +        case IXGBE_DEV_ID_82599_SFP_EM:
      118 +        case IXGBE_DEV_ID_82599_SFP_SF2:
      119 +        case IXGBE_DEV_ID_82599_SFP_SF_QP:
      120 +        case IXGBE_DEV_ID_82599EN_SFP:
      121 +        case IXGBE_DEV_ID_82599_CX4:
      122 +        case IXGBE_DEV_ID_82599_BYPASS:
      123 +        case IXGBE_DEV_ID_82599_T3_LOM:
      124 +                hw->mac.type = ixgbe_mac_82599EB;
      125 +                break;
      126 +        case IXGBE_DEV_ID_82599_VF:
      127 +        case IXGBE_DEV_ID_82599_VF_HV:
      128 +                hw->mac.type = ixgbe_mac_82599_vf;
      129 +                break;
      130 +        case IXGBE_DEV_ID_X540_VF:
      131 +        case IXGBE_DEV_ID_X540_VF_HV:
      132 +                hw->mac.type = ixgbe_mac_X540_vf;
      133 +                break;
      134 +        case IXGBE_DEV_ID_X540T:
      135 +        case IXGBE_DEV_ID_X540_BYPASS:
      136 +                hw->mac.type = ixgbe_mac_X540;
      137 +                break;
      138 +        default:
 140  139                  ret_val = IXGBE_ERR_DEVICE_NOT_SUPPORTED;
      140 +                break;
 141  141          }
 142  142  
 143  143          DEBUGOUT2("ixgbe_set_mac_type found mac: %d, returns: %d\n",
 144  144                    hw->mac.type, ret_val);
 145  145          return ret_val;
 146  146  }
 147  147  
 148  148  /**
 149  149   *  ixgbe_init_hw - Initialize the hardware
 150  150   *  @hw: pointer to hardware structure
↓ open down ↓ 364 lines elided ↑ open up ↑
 515  515                           bool *link_up)
 516  516  {
 517  517          return ixgbe_call_func(hw, hw->phy.ops.check_link, (hw, speed,
 518  518                                 link_up), IXGBE_NOT_IMPLEMENTED);
 519  519  }
 520  520  
 521  521  /**
 522  522   *  ixgbe_setup_phy_link_speed - Set auto advertise
 523  523   *  @hw: pointer to hardware structure
 524  524   *  @speed: new link speed
 525      - *  @autoneg: TRUE if autonegotiation enabled
 526  525   *
 527  526   *  Sets the auto advertised capabilities
 528  527   **/
 529  528  s32 ixgbe_setup_phy_link_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed,
 530      -                               bool autoneg,
 531  529                                 bool autoneg_wait_to_complete)
 532  530  {
 533  531          return ixgbe_call_func(hw, hw->phy.ops.setup_link_speed, (hw, speed,
 534      -                               autoneg, autoneg_wait_to_complete),
      532 +                               autoneg_wait_to_complete),
 535  533                                 IXGBE_NOT_IMPLEMENTED);
 536  534  }
 537  535  
 538  536  /**
 539  537   *  ixgbe_check_link - Get link and speed status
 540  538   *  @hw: pointer to hardware structure
 541  539   *
 542  540   *  Reads the links register to determine if link is up and the current speed
 543  541   **/
 544  542  s32 ixgbe_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
↓ open down ↓ 39 lines elided ↑ open up ↑
 584  582  void ixgbe_flap_tx_laser(struct ixgbe_hw *hw)
 585  583  {
 586  584          if (hw->mac.ops.flap_tx_laser)
 587  585                  hw->mac.ops.flap_tx_laser(hw);
 588  586  }
 589  587  
 590  588  /**
 591  589   *  ixgbe_setup_link - Set link speed
 592  590   *  @hw: pointer to hardware structure
 593  591   *  @speed: new link speed
 594      - *  @autoneg: TRUE if autonegotiation enabled
 595  592   *
 596  593   *  Configures link settings.  Restarts the link.
 597  594   *  Performs autonegotiation if needed.
 598  595   **/
 599  596  s32 ixgbe_setup_link(struct ixgbe_hw *hw, ixgbe_link_speed speed,
 600      -                     bool autoneg,
 601  597                       bool autoneg_wait_to_complete)
 602  598  {
 603  599          return ixgbe_call_func(hw, hw->mac.ops.setup_link, (hw, speed,
 604      -                               autoneg, autoneg_wait_to_complete),
      600 +                               autoneg_wait_to_complete),
 605  601                                 IXGBE_NOT_IMPLEMENTED);
 606  602  }
 607  603  
 608  604  /**
 609  605   *  ixgbe_get_link_capabilities - Returns link capabilities
 610  606   *  @hw: pointer to hardware structure
 611  607   *
 612  608   *  Determines the link capabilities of the current configuration.
 613  609   **/
 614  610  s32 ixgbe_get_link_capabilities(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
↓ open down ↓ 582 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX