Print this page
2038 Add in I350 and ET2 support into igb
Reviewed by: Dan McDonald <danmcd@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/igb/igb_main.c
          +++ new/usr/src/uts/common/io/igb/igb_main.c
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23      - * Copyright(c) 2007-2010 Intel Corporation. All rights reserved.
       23 + * Copyright (c) 2007-2012 Intel Corporation. All rights reserved.
  24   24   */
  25   25  
  26   26  /*
  27   27   * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  28   28   */
  29   29  
  30   30  #include "igb_sw.h"
  31   31  
  32   32  static char ident[] = "Intel 1Gb Ethernet";
  33      -static char igb_version[] = "igb 1.1.17";
       33 +static char igb_version[] = "igb 1.1.18";
  34   34  
  35   35  /*
  36   36   * Local function protoypes
  37   37   */
  38   38  static int igb_register_mac(igb_t *);
  39   39  static int igb_identify_hardware(igb_t *);
  40   40  static int igb_regs_map(igb_t *);
  41   41  static void igb_init_properties(igb_t *);
  42   42  static int igb_init_driver_settings(igb_t *);
  43   43  static void igb_init_locks(igb_t *);
↓ open down ↓ 234 lines elided ↑ open up ↑
 278  278          igb_setup_msix_82580,
 279  279  
 280  280          /* capabilities */
 281  281          (IGB_FLAG_HAS_DCA |     /* capability flags */
 282  282          IGB_FLAG_VMDQ_POOL |
 283  283          IGB_FLAG_NEED_CTX_IDX),
 284  284  
 285  285          0xffe00000              /* mask for RXDCTL register */
 286  286  };
 287  287  
      288 +static adapter_info_t igb_i350_cap = {
      289 +        /* limits */
      290 +        8,              /* maximum number of rx queues */
      291 +        1,              /* minimum number of rx queues */
      292 +        4,              /* default number of rx queues */
      293 +        8,              /* maximum number of tx queues */
      294 +        1,              /* minimum number of tx queues */
      295 +        4,              /* default number of tx queues */
      296 +        65535,          /* maximum interrupt throttle rate */
      297 +        0,              /* minimum interrupt throttle rate */
      298 +        200,            /* default interrupt throttle rate */
      299 +
      300 +        /* function pointers */
      301 +        igb_enable_adapter_interrupts_82580,
      302 +        igb_setup_msix_82580,
      303 +
      304 +        /* capabilities */
      305 +        (IGB_FLAG_HAS_DCA |     /* capability flags */
      306 +        IGB_FLAG_VMDQ_POOL |
      307 +        IGB_FLAG_NEED_CTX_IDX),
      308 +
      309 +        0xffe00000              /* mask for RXDCTL register */
      310 +};
      311 +
 288  312  /*
 289  313   * Module Initialization Functions
 290  314   */
 291  315  
 292  316  int
 293  317  _init(void)
 294  318  {
 295  319          int status;
 296  320  
 297  321          mac_init_ops(&igb_dev_ops, MODULE_NAME);
↓ open down ↓ 212 lines elided ↑ open up ↑
 510  534           */
 511  535          if (igb_enable_intrs(igb) != IGB_SUCCESS) {
 512  536                  igb_error(igb, "Failed to enable DDI interrupts");
 513  537                  goto attach_fail;
 514  538          }
 515  539          igb->attach_progress |= ATTACH_PROGRESS_ENABLE_INTR;
 516  540  
 517  541          igb_log(igb, "%s", igb_version);
 518  542          atomic_or_32(&igb->igb_state, IGB_INITIALIZED);
 519  543  
      544 +        /*
      545 +         * Newer models have Energy Efficient Ethernet, let's disable this by
      546 +         * default.
      547 +         */
      548 +        if (igb->hw.mac.type == e1000_i350)
      549 +                (void) e1000_set_eee_i350(&igb->hw);
      550 +
 520  551          return (DDI_SUCCESS);
 521  552  
 522  553  attach_fail:
 523  554          igb_unconfigure(devinfo, igb);
 524  555          return (DDI_FAILURE);
 525  556  }
 526  557  
 527  558  /*
 528  559   * igb_detach - driver detach
 529  560   *
↓ open down ↓ 299 lines elided ↑ open up ↑
 829  860          switch (hw->mac.type) {
 830  861          case e1000_82575:
 831  862                  igb->capab = &igb_82575_cap;
 832  863                  break;
 833  864          case e1000_82576:
 834  865                  igb->capab = &igb_82576_cap;
 835  866                  break;
 836  867          case e1000_82580:
 837  868                  igb->capab = &igb_82580_cap;
 838  869                  break;
      870 +        case e1000_i350:
      871 +                igb->capab = &igb_i350_cap;
      872 +                break;
 839  873          default:
 840  874                  return (IGB_FAILURE);
 841  875          }
 842  876  
 843  877          return (IGB_SUCCESS);
 844  878  }
 845  879  
 846  880  /*
 847  881   * igb_regs_map - Map the device registers
 848  882   */
↓ open down ↓ 843 lines elided ↑ open up ↑
1692 1726           * The interrupts must be enabled after the driver state is START
1693 1727           */
1694 1728          igb->capab->enable_intr(igb);
1695 1729  
1696 1730          if (igb_check_acc_handle(igb->osdep.cfg_handle) != DDI_FM_OK)
1697 1731                  goto start_failure;
1698 1732  
1699 1733          if (igb_check_acc_handle(igb->osdep.reg_handle) != DDI_FM_OK)
1700 1734                  goto start_failure;
1701 1735  
     1736 +        if (igb->hw.mac.type == e1000_i350)
     1737 +                (void) e1000_set_eee_i350(&igb->hw);
     1738 +
1702 1739          for (i = igb->num_tx_rings - 1; i >= 0; i--)
1703 1740                  mutex_exit(&igb->tx_rings[i].tx_lock);
1704 1741          for (i = igb->num_rx_rings - 1; i >= 0; i--)
1705 1742                  mutex_exit(&igb->rx_rings[i].rx_lock);
1706 1743  
1707 1744          return (IGB_SUCCESS);
1708 1745  
1709 1746  start_failure:
1710 1747          for (i = igb->num_tx_rings - 1; i >= 0; i--)
1711 1748                  mutex_exit(&igb->tx_rings[i].tx_lock);
↓ open down ↓ 3477 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX