8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2007-2012 Intel Corporation. All rights reserved.
  24  */
  25 
  26 /*
  27  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  28  */
  29 
  30 #include "igb_sw.h"
  31 
  32 static char ident[] = "Intel 1Gb Ethernet";
  33 static char igb_version[] = "igb 1.1.18";
  34 
  35 /*
  36  * Local function protoypes
  37  */
  38 static int igb_register_mac(igb_t *);
  39 static int igb_identify_hardware(igb_t *);
  40 static int igb_regs_map(igb_t *);
  41 static void igb_init_properties(igb_t *);
  42 static int igb_init_driver_settings(igb_t *);
  43 static void igb_init_locks(igb_t *);
  44 static void igb_destroy_locks(igb_t *);
  45 static int igb_init_mac_address(igb_t *);
  46 static int igb_init(igb_t *);
  47 static int igb_init_adapter(igb_t *);
 
 
 106 static uint_t igb_intr_tx_other(void *, void *);
 107 static void igb_intr_rx_work(igb_rx_ring_t *);
 108 static void igb_intr_tx_work(igb_tx_ring_t *);
 109 static void igb_intr_link_work(igb_t *);
 110 static void igb_get_driver_control(struct e1000_hw *);
 111 static void igb_release_driver_control(struct e1000_hw *);
 112 
 113 static int igb_attach(dev_info_t *, ddi_attach_cmd_t);
 114 static int igb_detach(dev_info_t *, ddi_detach_cmd_t);
 115 static int igb_resume(dev_info_t *);
 116 static int igb_suspend(dev_info_t *);
 117 static int igb_quiesce(dev_info_t *);
 118 static void igb_unconfigure(dev_info_t *, igb_t *);
 119 static int igb_fm_error_cb(dev_info_t *, ddi_fm_error_t *,
 120     const void *);
 121 static void igb_fm_init(igb_t *);
 122 static void igb_fm_fini(igb_t *);
 123 static void igb_release_multicast(igb_t *);
 124 
 125 char *igb_priv_props[] = {
 126         "_tx_copy_thresh",
 127         "_tx_recycle_thresh",
 128         "_tx_overload_thresh",
 129         "_tx_resched_thresh",
 130         "_rx_copy_thresh",
 131         "_rx_limit_per_intr",
 132         "_intr_throttling",
 133         "_adv_pause_cap",
 134         "_adv_asym_pause_cap",
 135         NULL
 136 };
 137 
 138 static struct cb_ops igb_cb_ops = {
 139         nulldev,                /* cb_open */
 140         nulldev,                /* cb_close */
 141         nodev,                  /* cb_strategy */
 142         nodev,                  /* cb_print */
 143         nodev,                  /* cb_dump */
 144         nodev,                  /* cb_read */
 145         nodev,                  /* cb_write */
 
 | 
 
 
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2007-2012 Intel Corporation. All rights reserved.
  24  */
  25 
  26 /*
  27  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  28  * Copyright 2013, Nexenta Systems, Inc. All rights reserved.
  29  */
  30 
  31 #include "igb_sw.h"
  32 
  33 static char ident[] = "Intel 1Gb Ethernet";
  34 static char igb_version[] = "igb 1.1.18";
  35 
  36 /*
  37  * Local function protoypes
  38  */
  39 static int igb_register_mac(igb_t *);
  40 static int igb_identify_hardware(igb_t *);
  41 static int igb_regs_map(igb_t *);
  42 static void igb_init_properties(igb_t *);
  43 static int igb_init_driver_settings(igb_t *);
  44 static void igb_init_locks(igb_t *);
  45 static void igb_destroy_locks(igb_t *);
  46 static int igb_init_mac_address(igb_t *);
  47 static int igb_init(igb_t *);
  48 static int igb_init_adapter(igb_t *);
 
 
 107 static uint_t igb_intr_tx_other(void *, void *);
 108 static void igb_intr_rx_work(igb_rx_ring_t *);
 109 static void igb_intr_tx_work(igb_tx_ring_t *);
 110 static void igb_intr_link_work(igb_t *);
 111 static void igb_get_driver_control(struct e1000_hw *);
 112 static void igb_release_driver_control(struct e1000_hw *);
 113 
 114 static int igb_attach(dev_info_t *, ddi_attach_cmd_t);
 115 static int igb_detach(dev_info_t *, ddi_detach_cmd_t);
 116 static int igb_resume(dev_info_t *);
 117 static int igb_suspend(dev_info_t *);
 118 static int igb_quiesce(dev_info_t *);
 119 static void igb_unconfigure(dev_info_t *, igb_t *);
 120 static int igb_fm_error_cb(dev_info_t *, ddi_fm_error_t *,
 121     const void *);
 122 static void igb_fm_init(igb_t *);
 123 static void igb_fm_fini(igb_t *);
 124 static void igb_release_multicast(igb_t *);
 125 
 126 char *igb_priv_props[] = {
 127         "_eee_support",
 128         "_tx_copy_thresh",
 129         "_tx_recycle_thresh",
 130         "_tx_overload_thresh",
 131         "_tx_resched_thresh",
 132         "_rx_copy_thresh",
 133         "_rx_limit_per_intr",
 134         "_intr_throttling",
 135         "_adv_pause_cap",
 136         "_adv_asym_pause_cap",
 137         NULL
 138 };
 139 
 140 static struct cb_ops igb_cb_ops = {
 141         nulldev,                /* cb_open */
 142         nulldev,                /* cb_close */
 143         nodev,                  /* cb_strategy */
 144         nodev,                  /* cb_print */
 145         nodev,                  /* cb_dump */
 146         nodev,                  /* cb_read */
 147         nodev,                  /* cb_write */
 
 |