Print this page
4431 igb support for I354
4616 igb has uninitialized kstats

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/e1000api/e1000_82575.c
          +++ new/usr/src/uts/common/io/e1000api/e1000_82575.c
↓ open down ↓ 136 lines elided ↑ open up ↑
 137  137          DEBUGFUNC("e1000_sgmii_uses_mdio_82575");
 138  138  
 139  139          switch (hw->mac.type) {
 140  140          case e1000_82575:
 141  141          case e1000_82576:
 142  142                  reg = E1000_READ_REG(hw, E1000_MDIC);
 143  143                  ext_mdio = !!(reg & E1000_MDIC_DEST);
 144  144                  break;
 145  145          case e1000_82580:
 146  146          case e1000_i350:
      147 +        case e1000_i354:
 147  148          case e1000_i210:
 148  149          case e1000_i211:
 149  150                  reg = E1000_READ_REG(hw, E1000_MDICNFG);
 150  151                  ext_mdio = !!(reg & E1000_MDICNFG_EXT_MDIO);
 151  152                  break;
 152  153          default:
 153  154                  break;
 154  155          }
 155  156          return ext_mdio;
 156  157  }
↓ open down ↓ 43 lines elided ↑ open up ↑
 200  201          E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext);
 201  202          e1000_reset_mdicnfg_82580(hw);
 202  203  
 203  204          if (e1000_sgmii_active_82575(hw) && !e1000_sgmii_uses_mdio_82575(hw)) {
 204  205                  phy->ops.read_reg = e1000_read_phy_reg_sgmii_82575;
 205  206                  phy->ops.write_reg = e1000_write_phy_reg_sgmii_82575;
 206  207          } else {
 207  208                  switch (hw->mac.type) {
 208  209                  case e1000_82580:
 209  210                  case e1000_i350:
      211 +                case e1000_i354:
 210  212                          phy->ops.read_reg = e1000_read_phy_reg_82580;
 211  213                          phy->ops.write_reg = e1000_write_phy_reg_82580;
 212  214                          break;
 213  215                  case e1000_i210:
 214  216                  case e1000_i211:
 215  217                          phy->ops.read_reg = e1000_read_phy_reg_gs40g;
 216  218                          phy->ops.write_reg = e1000_write_phy_reg_gs40g;
 217  219                          break;
 218  220                  default:
 219  221                          phy->ops.read_reg = e1000_read_phy_reg_igp;
 220  222                          phy->ops.write_reg = e1000_write_phy_reg_igp;
 221  223                  }
 222  224          }
 223  225  
 224  226          /* Set phy->phy_addr and phy->id. */
 225  227          ret_val = e1000_get_phy_id_82575(hw);
 226  228  
 227  229          /* Verify phy id and set remaining function pointers */
 228  230          switch (phy->id) {
      231 +        case M88E1543_E_PHY_ID:
      232 +        case M88E1512_E_PHY_ID:
 229  233          case I347AT4_E_PHY_ID:
 230  234          case M88E1112_E_PHY_ID:
 231  235          case M88E1340M_E_PHY_ID:
 232  236          case M88E1111_I_PHY_ID:
 233  237                  phy->type               = e1000_phy_m88;
 234  238                  phy->ops.check_polarity = e1000_check_polarity_m88;
 235  239                  phy->ops.get_info       = e1000_get_phy_info_m88;
 236      -                if (phy->id == I347AT4_E_PHY_ID ||
 237      -                    phy->id == M88E1112_E_PHY_ID ||
 238      -                    phy->id == M88E1340M_E_PHY_ID)
      240 +                switch (phy->id) {
      241 +                case I347AT4_E_PHY_ID:
      242 +                case M88E1112_E_PHY_ID:
      243 +                case M88E1340M_E_PHY_ID:
      244 +                case M88E1543_E_PHY_ID:
      245 +                case M88E1512_E_PHY_ID:
 239  246                          phy->ops.get_cable_length =
 240  247                                           e1000_get_cable_length_m88_gen2;
 241      -                else
      248 +                default:
 242  249                          phy->ops.get_cable_length = e1000_get_cable_length_m88;
      250 +                }
 243  251                  phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_m88;
 244  252                  break;
 245  253          case IGP03E1000_E_PHY_ID:
 246  254          case IGP04E1000_E_PHY_ID:
 247  255                  phy->type = e1000_phy_igp_3;
 248  256                  phy->ops.check_polarity = e1000_check_polarity_igp;
 249  257                  phy->ops.get_info = e1000_get_phy_info_igp;
 250  258                  phy->ops.get_cable_length = e1000_get_cable_length_igp_2;
 251  259                  phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_igp;
 252  260                  phy->ops.set_d0_lplu_state = e1000_set_d0_lplu_state_82575;
↓ open down ↓ 95 lines elided ↑ open up ↑
 348  356          nvm->ops.update = e1000_update_nvm_checksum_generic;
 349  357          nvm->ops.valid_led_default = e1000_valid_led_default_82575;
 350  358  
 351  359          /* override generic family function pointers for specific descendants */
 352  360          switch (hw->mac.type) {
 353  361          case e1000_82580:
 354  362                  nvm->ops.validate = e1000_validate_nvm_checksum_82580;
 355  363                  nvm->ops.update = e1000_update_nvm_checksum_82580;
 356  364                  break;
 357  365          case e1000_i350:
      366 +        case e1000_i354:
 358  367                  nvm->ops.validate = e1000_validate_nvm_checksum_i350;
 359  368                  nvm->ops.update = e1000_update_nvm_checksum_i350;
 360  369                  break;
 361  370          default:
 362  371                  break;
 363  372          }
 364  373  
 365  374          return E1000_SUCCESS;
 366  375  }
 367  376  
↓ open down ↓ 13 lines elided ↑ open up ↑
 381  390          /* Set mta register count */
 382  391          mac->mta_reg_count = 128;
 383  392          /* Set uta register count */
 384  393          mac->uta_reg_count = (hw->mac.type == e1000_82575) ? 0 : 128;
 385  394          /* Set rar entry count */
 386  395          mac->rar_entry_count = E1000_RAR_ENTRIES_82575;
 387  396          if (mac->type == e1000_82576)
 388  397                  mac->rar_entry_count = E1000_RAR_ENTRIES_82576;
 389  398          if (mac->type == e1000_82580)
 390  399                  mac->rar_entry_count = E1000_RAR_ENTRIES_82580;
 391      -        if (mac->type == e1000_i350)
      400 +        if (mac->type == e1000_i350 || mac->type == e1000_i354)
 392  401                  mac->rar_entry_count = E1000_RAR_ENTRIES_I350;
 393  402  
 394      -        /* Enable EEE default settings for EEE supported devices */
      403 +        /* Disable EEE default settings for EEE supported devices */
 395  404          if (mac->type >= e1000_i350)
 396  405                  dev_spec->eee_disable = TRUE;
 397  406  
 398  407          /* Allow a single clear of the SW semaphore on I210 and newer */
 399  408          if (mac->type >= e1000_i210)
 400  409                  dev_spec->clear_semaphore_once = TRUE;
 401  410  
 402  411          /* Set if part includes ASF firmware */
 403  412          mac->asf_firmware_present = TRUE;
 404  413          /* FWSM register */
↓ open down ↓ 24 lines elided ↑ open up ↑
 429  438          /* physical interface power up */
 430  439          mac->ops.power_up_serdes = e1000_power_up_serdes_link_82575;
 431  440          /* check for link */
 432  441          mac->ops.check_for_link = e1000_check_for_link_82575;
 433  442          /* read mac address */
 434  443          mac->ops.read_mac_addr = e1000_read_mac_addr_82575;
 435  444          /* configure collision distance */
 436  445          mac->ops.config_collision_dist = e1000_config_collision_dist_82575;
 437  446          /* multicast address update */
 438  447          mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_generic;
 439      -        if (mac->type == e1000_i350) {
      448 +        if (mac->type == e1000_i350 || mac->type == e1000_i354) {
 440  449                  /* writing VFTA */
 441  450                  mac->ops.write_vfta = e1000_write_vfta_i350;
 442  451                  /* clearing VFTA */
 443  452                  mac->ops.clear_vfta = e1000_clear_vfta_i350;
 444  453          } else {
 445  454                  /* writing VFTA */
 446  455                  mac->ops.write_vfta = e1000_write_vfta_generic;
 447  456                  /* clearing VFTA */
 448  457                  mac->ops.clear_vfta = e1000_clear_vfta_generic;
 449  458          }
↓ open down ↓ 165 lines elided ↑ open up ↑
 615  624  static s32 e1000_get_phy_id_82575(struct e1000_hw *hw)
 616  625  {
 617  626          struct e1000_phy_info *phy = &hw->phy;
 618  627          s32  ret_val = E1000_SUCCESS;
 619  628          u16 phy_id;
 620  629          u32 ctrl_ext;
 621  630          u32 mdic;
 622  631  
 623  632          DEBUGFUNC("e1000_get_phy_id_82575");
 624  633  
      634 +        /* some i354 devices need an extra read for phy id */
      635 +        if (hw->mac.type == e1000_i354)
      636 +                e1000_get_phy_id(hw);
      637 +
 625  638          /*
 626  639           * For SGMII PHYs, we try the list of possible addresses until
 627  640           * we find one that works.  For non-SGMII PHYs
 628  641           * (e.g. integrated copper PHYs), an address of 1 should
 629  642           * work.  The result of this function should mean phy->phy_addr
 630  643           * and phy->id are set correctly.
 631  644           */
 632  645          if (!e1000_sgmii_active_82575(hw)) {
 633  646                  phy->addr = 1;
 634  647                  ret_val = e1000_get_phy_id(hw);
↓ open down ↓ 3 lines elided ↑ open up ↑
 638  651          if (e1000_sgmii_uses_mdio_82575(hw)) {
 639  652                  switch (hw->mac.type) {
 640  653                  case e1000_82575:
 641  654                  case e1000_82576:
 642  655                          mdic = E1000_READ_REG(hw, E1000_MDIC);
 643  656                          mdic &= E1000_MDIC_PHY_MASK;
 644  657                          phy->addr = mdic >> E1000_MDIC_PHY_SHIFT;
 645  658                          break;
 646  659                  case e1000_82580:
 647  660                  case e1000_i350:
      661 +                case e1000_i354:
 648  662                  case e1000_i210:
 649  663                  case e1000_i211:
 650  664                          mdic = E1000_READ_REG(hw, E1000_MDICNFG);
 651  665                          mdic &= E1000_MDICNFG_PHY_MASK;
 652  666                          phy->addr = mdic >> E1000_MDICNFG_PHY_SHIFT;
 653  667                          break;
 654  668                  default:
 655  669                          ret_val = -E1000_ERR_PHY;
 656  670                          goto out;
 657  671                          break;
↓ open down ↓ 550 lines elided ↑ open up ↑
1208 1222   *  @duplex: stores the current duplex
1209 1223   *
1210 1224   *  Using the physical coding sub-layer (PCS), retrieve the current speed and
1211 1225   *  duplex, then store the values in the pointers provided.
1212 1226   **/
1213 1227  static s32 e1000_get_pcs_speed_and_duplex_82575(struct e1000_hw *hw,
1214 1228                                                  u16 *speed, u16 *duplex)
1215 1229  {
1216 1230          struct e1000_mac_info *mac = &hw->mac;
1217 1231          u32 pcs;
     1232 +        u32 status;
1218 1233  
1219 1234          DEBUGFUNC("e1000_get_pcs_speed_and_duplex_82575");
1220 1235  
1221 1236          /*
1222 1237           * Read the PCS Status register for link state. For non-copper mode,
1223 1238           * the status register is not accurate. The PCS status register is
1224 1239           * used instead.
1225 1240           */
1226 1241          pcs = E1000_READ_REG(hw, E1000_PCS_LSTAT);
1227 1242  
↓ open down ↓ 10 lines elided ↑ open up ↑
1238 1253                          *speed = SPEED_100;
1239 1254                  else
1240 1255                          *speed = SPEED_10;
1241 1256  
1242 1257                  /* Detect and store PCS duplex */
1243 1258                  if (pcs & E1000_PCS_LSTS_DUPLEX_FULL)
1244 1259                          *duplex = FULL_DUPLEX;
1245 1260                  else
1246 1261                          *duplex = HALF_DUPLEX;
1247 1262  
     1263 +                /* Check if it is an I354 2.5Gb backplane connection. */
     1264 +                if (mac->type == e1000_i354) {
     1265 +                        status = E1000_READ_REG(hw, E1000_STATUS);
     1266 +                        if ((status & E1000_STATUS_2P5_SKU) &&
     1267 +                            !(status & E1000_STATUS_2P5_SKU_OVER)) {
     1268 +                                *speed = SPEED_2500;
     1269 +                                *duplex = FULL_DUPLEX;
     1270 +                                DEBUGOUT("2500 Mbs, ");
     1271 +                                DEBUGOUT("Full Duplex\n");
     1272 +                        }
     1273 +                }
     1274 +
1248 1275          } else {
1249 1276                  mac->serdes_has_link = FALSE;
1250 1277                  *speed = 0;
1251 1278                  *duplex = 0;
1252 1279          }
1253 1280  
1254 1281          return E1000_SUCCESS;
1255 1282  }
1256 1283  
1257 1284  /**
↓ open down ↓ 165 lines elided ↑ open up ↑
1423 1450          s32 ret_val;
1424 1451          u32 phpm_reg;
1425 1452  
1426 1453          DEBUGFUNC("e1000_setup_copper_link_82575");
1427 1454  
1428 1455          ctrl = E1000_READ_REG(hw, E1000_CTRL);
1429 1456          ctrl |= E1000_CTRL_SLU;
1430 1457          ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX);
1431 1458          E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
1432 1459  
1433      -        /* Clear Go Link Disconnect bit */
1434      -        if (hw->mac.type >= e1000_82580) {
     1460 +        /* Clear Go Link Disconnect bit on supported devices */
     1461 +        switch (hw->mac.type) {
     1462 +        case e1000_82580:
     1463 +        case e1000_i350:
     1464 +        case e1000_i210:
     1465 +        case e1000_i211:
1435 1466                  phpm_reg = E1000_READ_REG(hw, E1000_82580_PHY_POWER_MGMT);
1436 1467                  phpm_reg &= ~E1000_82580_PM_GO_LINKD;
1437 1468                  E1000_WRITE_REG(hw, E1000_82580_PHY_POWER_MGMT, phpm_reg);
     1469 +                break;
     1470 +        default:
     1471 +                break;
1438 1472          }
1439 1473  
1440 1474          ret_val = e1000_setup_serdes_link_82575(hw);
1441 1475          if (ret_val)
1442 1476                  goto out;
1443 1477  
1444 1478          if (e1000_sgmii_active_82575(hw)) {
1445 1479                  /* allow time for SFP cage time to power up phy */
1446 1480                  msec_delay(300);
1447 1481  
↓ open down ↓ 677 lines elided ↑ open up ↑
2125 2159  /**
2126 2160   *  e1000_vmdq_set_anti_spoofing_pf - enable or disable anti-spoofing
2127 2161   *  @hw: pointer to the hardware struct
2128 2162   *  @enable: state to enter, either enabled or disabled
2129 2163   *  @pf: Physical Function pool - do not set anti-spoofing for the PF
2130 2164   *
2131 2165   *  enables/disables L2 switch anti-spoofing functionality.
2132 2166   **/
2133 2167  void e1000_vmdq_set_anti_spoofing_pf(struct e1000_hw *hw, bool enable, int pf)
2134 2168  {
2135      -        u32 dtxswc;
     2169 +        u32 reg_val, reg_offset;
2136 2170  
2137 2171          switch (hw->mac.type) {
2138 2172          case e1000_82576:
2139      -                dtxswc = E1000_READ_REG(hw, E1000_DTXSWC);
2140      -                if (enable) {
2141      -                        dtxswc |= (E1000_DTXSWC_MAC_SPOOF_MASK |
2142      -                                   E1000_DTXSWC_VLAN_SPOOF_MASK);
2143      -                        /* The PF can spoof - it has to in order to
2144      -                         * support emulation mode NICs */
2145      -                        dtxswc ^= (1 << pf | 1 << (pf +
2146      -                                   E1000_DTXSWC_VLAN_SPOOF_SHIFT));
2147      -                } else {
2148      -                        dtxswc &= ~(E1000_DTXSWC_MAC_SPOOF_MASK |
2149      -                                    E1000_DTXSWC_VLAN_SPOOF_MASK);
2150      -                }
2151      -                E1000_WRITE_REG(hw, E1000_DTXSWC, dtxswc);
     2173 +                reg_offset = E1000_DTXSWC;
2152 2174                  break;
2153 2175          case e1000_i350:
2154      -                dtxswc = E1000_READ_REG(hw, E1000_TXSWC);
2155      -                if (enable) {
2156      -                        dtxswc |= (E1000_DTXSWC_MAC_SPOOF_MASK |
2157      -                                   E1000_DTXSWC_VLAN_SPOOF_MASK);
2158      -                        /* The PF can spoof - it has to in order to
2159      -                         * support emulation mode NICs
2160      -                         */
2161      -                        dtxswc ^= (1 << pf | 1 << (pf +
2162      -                                   E1000_DTXSWC_VLAN_SPOOF_SHIFT));
2163      -                } else {
2164      -                        dtxswc &= ~(E1000_DTXSWC_MAC_SPOOF_MASK |
2165      -                                    E1000_DTXSWC_VLAN_SPOOF_MASK);
2166      -                }
2167      -                E1000_WRITE_REG(hw, E1000_TXSWC, dtxswc);
2168      -        default:
     2176 +        case e1000_i354:
     2177 +                reg_offset = E1000_TXSWC;
2169 2178                  break;
     2179 +        default:
     2180 +                return;
2170 2181          }
     2182 +        reg_val = E1000_READ_REG(hw, reg_offset);
     2183 +        if (enable) {
     2184 +                reg_val |= (E1000_DTXSWC_MAC_SPOOF_MASK |
     2185 +                           E1000_DTXSWC_VLAN_SPOOF_MASK);
     2186 +                /* The PF can spoof - it has to in order to
     2187 +                 * support emulation mode NICs
     2188 +                 */
     2189 +                reg_val ^= (1 << pf | 1 << (pf + MAX_NUM_VFS));
     2190 +        } else {
     2191 +                reg_val &= ~(E1000_DTXSWC_MAC_SPOOF_MASK |
     2192 +                            E1000_DTXSWC_VLAN_SPOOF_MASK);
     2193 +        }
     2194 +        E1000_WRITE_REG(hw, reg_offset, reg_val);
2171 2195  }
2172 2196  
2173 2197  /**
2174 2198   *  e1000_vmdq_set_loopback_pf - enable or disable vmdq loopback
2175 2199   *  @hw: pointer to the hardware struct
2176 2200   *  @enable: state to enter, either enabled or disabled
2177 2201   *
2178 2202   *  enables/disables L2 switch loopback functionality.
2179 2203   **/
2180 2204  void e1000_vmdq_set_loopback_pf(struct e1000_hw *hw, bool enable)
↓ open down ↓ 3 lines elided ↑ open up ↑
2184 2208          switch (hw->mac.type) {
2185 2209          case e1000_82576:
2186 2210                  dtxswc = E1000_READ_REG(hw, E1000_DTXSWC);
2187 2211                  if (enable)
2188 2212                          dtxswc |= E1000_DTXSWC_VMDQ_LOOPBACK_EN;
2189 2213                  else
2190 2214                          dtxswc &= ~E1000_DTXSWC_VMDQ_LOOPBACK_EN;
2191 2215                  E1000_WRITE_REG(hw, E1000_DTXSWC, dtxswc);
2192 2216                  break;
2193 2217          case e1000_i350:
     2218 +        case e1000_i354:
2194 2219                  dtxswc = E1000_READ_REG(hw, E1000_TXSWC);
2195 2220                  if (enable)
2196 2221                          dtxswc |= E1000_DTXSWC_VMDQ_LOOPBACK_EN;
2197 2222                  else
2198 2223                          dtxswc &= ~E1000_DTXSWC_VMDQ_LOOPBACK_EN;
2199 2224                  E1000_WRITE_REG(hw, E1000_TXSWC, dtxswc);
2200 2225                  break;
2201 2226          default:
2202 2227                  /* Currently no other hardware supports loopback */
2203 2228                  break;
↓ open down ↓ 477 lines elided ↑ open up ↑
2681 2706                            E1000_EEER_LPI_FC);
2682 2707          }
2683 2708          E1000_WRITE_REG(hw, E1000_IPCNFG, ipcnfg);
2684 2709          E1000_WRITE_REG(hw, E1000_EEER, eeer);
2685 2710          E1000_READ_REG(hw, E1000_IPCNFG);
2686 2711          E1000_READ_REG(hw, E1000_EEER);
2687 2712  out:
2688 2713  
2689 2714          return ret_val;
2690 2715  }
     2716 +
     2717 +/**
     2718 + *  e1000_set_eee_i354 - Enable/disable EEE support
     2719 + *  @hw: pointer to the HW structure
     2720 + *
     2721 + *  Enable/disable EEE legacy mode based on setting in dev_spec structure.
     2722 + *
     2723 + **/
     2724 +s32 e1000_set_eee_i354(struct e1000_hw *hw)
     2725 +{
     2726 +        struct e1000_phy_info *phy = &hw->phy;
     2727 +        s32 ret_val = E1000_SUCCESS;
     2728 +        u16 phy_data;
     2729 +
     2730 +        DEBUGFUNC("e1000_set_eee_i354");
     2731 +
     2732 +        if ((hw->phy.media_type != e1000_media_type_copper) ||
     2733 +            ((phy->id != M88E1543_E_PHY_ID) &&
     2734 +            (phy->id != M88E1512_E_PHY_ID)))
     2735 +                goto out;
     2736 +
     2737 +        if (!hw->dev_spec._82575.eee_disable) {
     2738 +                /* Switch to PHY page 18. */
     2739 +                ret_val = phy->ops.write_reg(hw, E1000_M88E1543_PAGE_ADDR, 18);
     2740 +                if (ret_val)
     2741 +                        goto out;
     2742 +
     2743 +                ret_val = phy->ops.read_reg(hw, E1000_M88E1543_EEE_CTRL_1,
     2744 +                                            &phy_data);
     2745 +                if (ret_val)
     2746 +                        goto out;
     2747 +
     2748 +                phy_data |= E1000_M88E1543_EEE_CTRL_1_MS;
     2749 +                ret_val = phy->ops.write_reg(hw, E1000_M88E1543_EEE_CTRL_1,
     2750 +                                             phy_data);
     2751 +                if (ret_val)
     2752 +                        goto out;
     2753 +
     2754 +                /* Return the PHY to page 0. */
     2755 +                ret_val = phy->ops.write_reg(hw, E1000_M88E1543_PAGE_ADDR, 0);
     2756 +                if (ret_val)
     2757 +                        goto out;
     2758 +
     2759 +                /* Turn on EEE advertisement. */
     2760 +                ret_val = e1000_read_xmdio_reg(hw, E1000_EEE_ADV_ADDR_I354,
     2761 +                                               E1000_EEE_ADV_DEV_I354,
     2762 +                                               &phy_data);
     2763 +                if (ret_val)
     2764 +                        goto out;
     2765 +
     2766 +                phy_data |= E1000_EEE_ADV_100_SUPPORTED |
     2767 +                            E1000_EEE_ADV_1000_SUPPORTED;
     2768 +                ret_val = e1000_write_xmdio_reg(hw, E1000_EEE_ADV_ADDR_I354,
     2769 +                                                E1000_EEE_ADV_DEV_I354,
     2770 +                                                phy_data);
     2771 +        } else {
     2772 +                /* Turn off EEE advertisement. */
     2773 +                ret_val = e1000_read_xmdio_reg(hw, E1000_EEE_ADV_ADDR_I354,
     2774 +                                               E1000_EEE_ADV_DEV_I354,
     2775 +                                               &phy_data);
     2776 +                if (ret_val)
     2777 +                        goto out;
     2778 +
     2779 +                phy_data &= ~(E1000_EEE_ADV_100_SUPPORTED |
     2780 +                              E1000_EEE_ADV_1000_SUPPORTED);
     2781 +                ret_val = e1000_write_xmdio_reg(hw, E1000_EEE_ADV_ADDR_I354,
     2782 +                                                E1000_EEE_ADV_DEV_I354,
     2783 +                                                phy_data);
     2784 +        }
     2785 +
     2786 +out:
     2787 +        return ret_val;
     2788 +}
     2789 +
     2790 +/**
     2791 + *  e1000_get_eee_status_i354 - Get EEE status
     2792 + *  @hw: pointer to the HW structure
     2793 + *  @status: EEE status
     2794 + *
     2795 + *  Get EEE status by guessing based on whether Tx or Rx LPI indications have
     2796 + *  been received.
     2797 + **/
     2798 +s32 e1000_get_eee_status_i354(struct e1000_hw *hw, bool *status)
     2799 +{
     2800 +        struct e1000_phy_info *phy = &hw->phy;
     2801 +        s32 ret_val = E1000_SUCCESS;
     2802 +        u16 phy_data;
     2803 +
     2804 +        DEBUGFUNC("e1000_get_eee_status_i354");
     2805 +
     2806 +        /* Check if EEE is supported on this device. */
     2807 +        if ((hw->phy.media_type != e1000_media_type_copper) ||
     2808 +            ((phy->id != M88E1543_E_PHY_ID) &&
     2809 +             (phy->id != M88E1512_E_PHY_ID)))
     2810 +                goto out;
     2811 +
     2812 +        ret_val = e1000_read_xmdio_reg(hw, E1000_PCS_STATUS_ADDR_I354,
     2813 +                                       E1000_PCS_STATUS_DEV_I354,
     2814 +                                       &phy_data);
     2815 +        if (ret_val)
     2816 +                goto out;
     2817 +
     2818 +        *status = phy_data & (E1000_PCS_STATUS_TX_LPI_RCVD |
     2819 +                              E1000_PCS_STATUS_RX_LPI_RCVD) ? TRUE : FALSE;
     2820 +
     2821 +out:
     2822 +        return ret_val;
     2823 +}
2691 2824  
2692 2825  /* Due to a hw errata, if the host tries to  configure the VFTA register
2693 2826   * while performing queries from the BMC or DMA, then the VFTA in some
2694 2827   * cases won't be written.
2695 2828   */
2696 2829  
2697 2830  /**
2698 2831   *  e1000_clear_vfta_i350 - Clear VLAN filter table
2699 2832   *  @hw: pointer to the HW structure
2700 2833   *
↓ open down ↓ 589 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX