9da57d7b0ddd8d73b676ce12c040362132cdd538bt/*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * CDDL HEADER START
9da57d7b0ddd8d73b676ce12c040362132cdd538bt *
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * The contents of this file are subject to the terms of the
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Common Development and Distribution License (the "License").
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * You may not use this file except in compliance with the License.
9da57d7b0ddd8d73b676ce12c040362132cdd538bt *
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * or http://www.opensolaris.org/os/licensing.
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * See the License for the specific language governing permissions
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * and limitations under the License.
9da57d7b0ddd8d73b676ce12c040362132cdd538bt *
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * When distributing Covered Code, include this CDDL HEADER in each
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * If applicable, add the following below this CDDL HEADER, with the
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * fields enclosed by brackets "[]" replaced with your own identifying
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * information: Portions Copyright [yyyy] [name of copyright owner]
9da57d7b0ddd8d73b676ce12c040362132cdd538bt *
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * CDDL HEADER END
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt/*
5b6dd21f5401160f9a62ac2e76a858c2bc105370chenlu chen - Sun Microsystems - Beijing China * Copyright(c) 2007-2010 Intel Corporation. All rights reserved.
5b6dd21f5401160f9a62ac2e76a858c2bc105370chenlu chen - Sun Microsystems - Beijing China */
5b6dd21f5401160f9a62ac2e76a858c2bc105370chenlu chen - Sun Microsystems - Beijing China
5b6dd21f5401160f9a62ac2e76a858c2bc105370chenlu chen - Sun Microsystems - Beijing China/*
5b6dd21f5401160f9a62ac2e76a858c2bc105370chenlu chen - Sun Microsystems - Beijing China * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
43fab1a9f38ff02e665a874ea0a8eb3818e61ff3Saso Kiselkov * Copyright (c) 2013 Saso Kiselkov. All rights reserved.
dc0cb1cda72a989d92d813e487cdff59f629aa3fDale Ghent * Copyright 2016 OmniTI Computer Consulting, Inc. All rights reserved.
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#ifndef _IXGBE_SW_H
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define _IXGBE_SW_H
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#ifdef __cplusplus
9da57d7b0ddd8d73b676ce12c040362132cdd538btextern "C" {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#endif
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/types.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/conf.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/debug.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/stropts.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/stream.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/strsun.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/strlog.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/kmem.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/stat.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/kstat.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/modctl.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/errno.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/dlpi.h>
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng#include <sys/mac_provider.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/mac_ether.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/vlan.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/ddi.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/sunddi.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/pci.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/pcie.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/sdt.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/ethernet.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/pattr.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/strsubr.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/netlb.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/random.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <inet/common.h>
c971fb7ec0a19c6cd00c5614a94c97f953b6e8b1gg#include <inet/tcp.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <inet/ip.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <inet/mi.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <inet/nd.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/bitmap.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/ddifm.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/fm/protocol.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/fm/util.h>
62e6e1adfc8d795f477410703cc7a88dc5b82622Paul Guo#include <sys/disp.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include <sys/fm/io/ddi.h>
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#include "ixgbe_api.h"
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define MODULE_NAME "ixgbe" /* module name */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define IXGBE_FAILURE DDI_FAILURE
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define IXGBE_UNKNOWN 0x00
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define IXGBE_INITIALIZED 0x01
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define IXGBE_STARTED 0x02
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define IXGBE_SUSPENDED 0x04
62e6e1adfc8d795f477410703cc7a88dc5b82622Paul Guo#define IXGBE_STALL 0x08
5b6dd21f5401160f9a62ac2e76a858c2bc105370chenlu chen - Sun Microsystems - Beijing China#define IXGBE_OVERTEMP 0x20
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer#define IXGBE_INTR_ADJUST 0x40
62e6e1adfc8d795f477410703cc7a88dc5b82622Paul Guo#define IXGBE_ERROR 0x80
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer#define MAX_NUM_UNICAST_ADDRESSES 0x80
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define MAX_NUM_MULTICAST_ADDRESSES 0x1000
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define IXGBE_INTR_NONE 0
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define IXGBE_INTR_MSIX 1
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define IXGBE_INTR_MSI 2
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define IXGBE_INTR_LEGACY 3
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng#define IXGBE_POLL_NULL -1
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng
c971fb7ec0a19c6cd00c5614a94c97f953b6e8b1gg#define MAX_COOKIE 18
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define MIN_NUM_TX_DESC 2
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
edf70dc9b8e373c558a49c15c2d86be817d497fePaul Guo#define IXGBE_TX_DESC_LIMIT 32 /* tx desc limitation */
edf70dc9b8e373c558a49c15c2d86be817d497fePaul Guo
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China#define IXGBE_ADAPTER_REGSET 1 /* map adapter registers */
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China#define IXGBE_RX_STOPPED 0x1
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China
ffd8e8832e01f996f32459073f4dd308fe5265baWinson Wang - Sun Microsystems - Beijing China#define IXGBE_PKG_BUF_16k 16384
ffd8e8832e01f996f32459073f4dd308fe5265baWinson Wang - Sun Microsystems - Beijing China
9da57d7b0ddd8d73b676ce12c040362132cdd538bt/*
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China * MAX_xx_QUEUE_NUM and MAX_INTR_VECTOR values need to be the maximum of all
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo * supported silicon types.
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China#define MAX_TX_QUEUE_NUM 128
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China#define MAX_RX_QUEUE_NUM 128
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China#define MAX_INTR_VECTOR 64
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt/*
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo * Maximum values for user configurable parameters
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define MAX_TX_RING_SIZE 4096
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define MAX_RX_RING_SIZE 4096
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define MAX_RX_LIMIT_PER_INTR 4096
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define MAX_RX_COPY_THRESHOLD 9216
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define MAX_TX_COPY_THRESHOLD 9216
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define MAX_TX_RECYCLE_THRESHOLD DEFAULT_TX_RING_SIZE
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define MAX_TX_OVERLOAD_THRESHOLD DEFAULT_TX_RING_SIZE
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define MAX_TX_RESCHED_THRESHOLD DEFAULT_TX_RING_SIZE
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt/*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Minimum values for user configurable parameters
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define MIN_TX_RING_SIZE 64
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define MIN_RX_RING_SIZE 64
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define MIN_MTU ETHERMIN
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define MIN_RX_LIMIT_PER_INTR 16
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define MIN_TX_COPY_THRESHOLD 0
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define MIN_RX_COPY_THRESHOLD 0
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define MIN_TX_RECYCLE_THRESHOLD MIN_NUM_TX_DESC
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define MIN_TX_OVERLOAD_THRESHOLD MIN_NUM_TX_DESC
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define MIN_TX_RESCHED_THRESHOLD MIN_NUM_TX_DESC
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt/*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Default values for user configurable parameters
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng#define DEFAULT_TX_RING_SIZE 1024
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng#define DEFAULT_RX_RING_SIZE 1024
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define DEFAULT_MTU ETHERMTU
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define DEFAULT_RX_LIMIT_PER_INTR 256
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define DEFAULT_RX_COPY_THRESHOLD 128
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define DEFAULT_TX_COPY_THRESHOLD 512
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng#define DEFAULT_TX_RECYCLE_THRESHOLD (MAX_COOKIE + 1)
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define DEFAULT_TX_OVERLOAD_THRESHOLD MIN_NUM_TX_DESC
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define DEFAULT_TX_RESCHED_THRESHOLD 128
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define DEFAULT_FCRTH 0x20000
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define DEFAULT_FCRTL 0x10000
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define DEFAULT_FCPAUSE 0xFFFF
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng#define DEFAULT_TX_HCKSUM_ENABLE B_TRUE
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng#define DEFAULT_RX_HCKSUM_ENABLE B_TRUE
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng#define DEFAULT_LSO_ENABLE B_TRUE
ffd8e8832e01f996f32459073f4dd308fe5265baWinson Wang - Sun Microsystems - Beijing China#define DEFAULT_LRO_ENABLE B_FALSE
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng#define DEFAULT_MR_ENABLE B_TRUE
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng#define DEFAULT_TX_HEAD_WB_ENABLE B_TRUE
5b6dd21f5401160f9a62ac2e76a858c2bc105370chenlu chen - Sun Microsystems - Beijing China#define DEFAULT_RELAX_ORDER_ENABLE B_TRUE
43fab1a9f38ff02e665a874ea0a8eb3818e61ff3Saso Kiselkov#define DEFAULT_ALLOW_UNSUPPORTED_SFP B_FALSE
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng#define IXGBE_LSO_MAXLEN 65535
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define TX_DRAIN_TIME 200
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define RX_DRAIN_TIME 200
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define STALL_WATCHDOG_TIMEOUT 8 /* 8 seconds */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define MAX_LINK_DOWN_TIMEOUT 8 /* 8 seconds */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
62e6e1adfc8d795f477410703cc7a88dc5b82622Paul Guo#define IXGBE_CYCLIC_PERIOD (1000000000) /* 1s */
62e6e1adfc8d795f477410703cc7a88dc5b82622Paul Guo
9da57d7b0ddd8d73b676ce12c040362132cdd538bt/*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Extra register bit masks for 82598
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define IXGBE_PCS1GANA_FDC 0x20
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define IXGBE_PCS1GANLP_LPFD 0x20
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define IXGBE_PCS1GANLP_LPHD 0x40
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt/*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Defined for IP header alignment.
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define IPHDR_ALIGN_ROOM 2
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt/*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Bit flags for attach_progress
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define ATTACH_PROGRESS_PCI_CONFIG 0x0001 /* PCI config setup */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define ATTACH_PROGRESS_REGS_MAP 0x0002 /* Registers mapped */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define ATTACH_PROGRESS_PROPS 0x0004 /* Properties initialized */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define ATTACH_PROGRESS_ALLOC_INTR 0x0008 /* Interrupts allocated */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define ATTACH_PROGRESS_ALLOC_RINGS 0x0010 /* Rings allocated */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define ATTACH_PROGRESS_ADD_INTR 0x0020 /* Intr handlers added */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define ATTACH_PROGRESS_LOCKS 0x0040 /* Locks initialized */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define ATTACH_PROGRESS_INIT 0x0080 /* Device initialized */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define ATTACH_PROGRESS_STATS 0x0200 /* Kstats created */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define ATTACH_PROGRESS_MAC 0x0800 /* MAC registered */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define ATTACH_PROGRESS_ENABLE_INTR 0x1000 /* DDI interrupts enabled */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define ATTACH_PROGRESS_FM_INIT 0x2000 /* FMA initialized */
62e6e1adfc8d795f477410703cc7a88dc5b82622Paul Guo#define ATTACH_PROGRESS_SFP_TASKQ 0x4000 /* SFP taskq created */
62e6e1adfc8d795f477410703cc7a88dc5b82622Paul Guo#define ATTACH_PROGRESS_LINK_TIMER 0x8000 /* link check timer */
5b6dd21f5401160f9a62ac2e76a858c2bc105370chenlu chen - Sun Microsystems - Beijing China#define ATTACH_PROGRESS_OVERTEMP_TASKQ 0x10000 /* Over-temp taskq created */
dc0cb1cda72a989d92d813e487cdff59f629aa3fDale Ghent#define ATTACH_PROGRESS_PHY_TASKQ 0x20000 /* Ext. PHY taskq created */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define PROP_DEFAULT_MTU "default_mtu"
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define PROP_FLOW_CONTROL "flow_control"
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define PROP_TX_QUEUE_NUM "tx_queue_number"
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define PROP_TX_RING_SIZE "tx_ring_size"
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define PROP_RX_QUEUE_NUM "rx_queue_number"
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define PROP_RX_RING_SIZE "rx_ring_size"
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng#define PROP_RX_GROUP_NUM "rx_group_number"
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define PROP_INTR_FORCE "intr_force"
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define PROP_TX_HCKSUM_ENABLE "tx_hcksum_enable"
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define PROP_RX_HCKSUM_ENABLE "rx_hcksum_enable"
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define PROP_LSO_ENABLE "lso_enable"
ffd8e8832e01f996f32459073f4dd308fe5265baWinson Wang - Sun Microsystems - Beijing China#define PROP_LRO_ENABLE "lro_enable"
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng#define PROP_MR_ENABLE "mr_enable"
5b6dd21f5401160f9a62ac2e76a858c2bc105370chenlu chen - Sun Microsystems - Beijing China#define PROP_RELAX_ORDER_ENABLE "relax_order_enable"
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define PROP_TX_HEAD_WB_ENABLE "tx_head_wb_enable"
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define PROP_TX_COPY_THRESHOLD "tx_copy_threshold"
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define PROP_TX_RECYCLE_THRESHOLD "tx_recycle_threshold"
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define PROP_TX_OVERLOAD_THRESHOLD "tx_overload_threshold"
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define PROP_TX_RESCHED_THRESHOLD "tx_resched_threshold"
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define PROP_RX_COPY_THRESHOLD "rx_copy_threshold"
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define PROP_RX_LIMIT_PER_INTR "rx_limit_per_intr"
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define PROP_INTR_THROTTLING "intr_throttling"
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define PROP_FM_CAPABLE "fm_capable"
43fab1a9f38ff02e665a874ea0a8eb3818e61ff3Saso Kiselkov#define PROP_ALLOW_UNSUPPORTED_SFP "allow_unsupported_sfp"
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define IXGBE_LB_NONE 0
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define IXGBE_LB_EXTERNAL 1
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define IXGBE_LB_INTERNAL_MAC 2
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define IXGBE_LB_INTERNAL_PHY 3
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define IXGBE_LB_INTERNAL_SERDES 4
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo/*
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo * capability/feature flags
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo * Flags named _CAPABLE are set when the NIC hardware is capable of the feature.
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo * Separately, the flag named _ENABLED is set when the feature is enabled.
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo */
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo#define IXGBE_FLAG_DCA_ENABLED (u32)(1)
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo#define IXGBE_FLAG_DCA_CAPABLE (u32)(1 << 1)
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo#define IXGBE_FLAG_DCB_ENABLED (u32)(1 << 2)
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo#define IXGBE_FLAG_DCB_CAPABLE (u32)(1 << 4)
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo#define IXGBE_FLAG_RSS_ENABLED (u32)(1 << 4)
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo#define IXGBE_FLAG_RSS_CAPABLE (u32)(1 << 5)
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo#define IXGBE_FLAG_VMDQ_CAPABLE (u32)(1 << 6)
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo#define IXGBE_FLAG_VMDQ_ENABLED (u32)(1 << 7)
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo#define IXGBE_FLAG_FAN_FAIL_CAPABLE (u32)(1 << 8)
ffd8e8832e01f996f32459073f4dd308fe5265baWinson Wang - Sun Microsystems - Beijing China#define IXGBE_FLAG_RSC_CAPABLE (u32)(1 << 9)
5b6dd21f5401160f9a62ac2e76a858c2bc105370chenlu chen - Sun Microsystems - Beijing China#define IXGBE_FLAG_SFP_PLUG_CAPABLE (u32)(1 << 10)
5b6dd21f5401160f9a62ac2e76a858c2bc105370chenlu chen - Sun Microsystems - Beijing China#define IXGBE_FLAG_TEMP_SENSOR_CAPABLE (u32)(1 << 11)
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer/*
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer * Classification mode
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer */
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer#define IXGBE_CLASSIFY_NONE 0
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer#define IXGBE_CLASSIFY_RSS 1
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer#define IXGBE_CLASSIFY_VMDQ 2
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer#define IXGBE_CLASSIFY_VMDQ_RSS 3
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo/* adapter-specific info for each supported device type */
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guotypedef struct adapter_info {
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer uint32_t max_rx_que_num; /* maximum number of rx queues */
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer uint32_t min_rx_que_num; /* minimum number of rx queues */
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer uint32_t def_rx_que_num; /* default number of rx queues */
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer uint32_t max_rx_grp_num; /* maximum number of rx groups */
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer uint32_t min_rx_grp_num; /* minimum number of rx groups */
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer uint32_t def_rx_grp_num; /* default number of rx groups */
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo uint32_t max_tx_que_num; /* maximum number of tx queues */
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo uint32_t min_tx_que_num; /* minimum number of tx queues */
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo uint32_t def_tx_que_num; /* default number of tx queues */
1fedc51fe8f78efa2ee550387171e6adb2223b8dWinson Wang - Sun Microsystems - Beijing China uint32_t max_mtu; /* maximum MTU size */
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China /*
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China * Interrupt throttling is in unit of 256 nsec
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China */
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China uint32_t max_intr_throttle; /* maximum interrupt throttle */
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China uint32_t min_intr_throttle; /* minimum interrupt throttle */
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China uint32_t def_intr_throttle; /* default interrupt throttle */
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo uint32_t max_msix_vect; /* maximum total msix vectors */
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo uint32_t max_ring_vect; /* maximum number of ring vectors */
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo uint32_t max_other_vect; /* maximum number of other vectors */
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo uint32_t other_intr; /* "other" interrupt types handled */
5b6dd21f5401160f9a62ac2e76a858c2bc105370chenlu chen - Sun Microsystems - Beijing China uint32_t other_gpie; /* "other" interrupt types enabling */
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo uint32_t flags; /* capability flags */
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo} adapter_info_t;
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo/* bits representing all interrupt types other than tx & rx */
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo#define IXGBE_OTHER_INTR 0x3ff00000
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China#define IXGBE_82599_OTHER_INTR 0x86100000
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo
9da57d7b0ddd8d73b676ce12c040362132cdd538btenum ioc_reply {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt IOC_INVAL = -1, /* bad, NAK with EINVAL */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt IOC_DONE, /* OK, reply sent */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt IOC_ACK, /* OK, just send ACK */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt IOC_REPLY /* OK, just send reply */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt};
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define DMA_SYNC(area, flag) ((void) ddi_dma_sync((area)->dma_handle, \
9da57d7b0ddd8d73b676ce12c040362132cdd538bt 0, 0, (flag)))
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt/*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Defined for ring index operations
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * ASSERT(index < limit)
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * ASSERT(step < limit)
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * ASSERT(index1 < limit)
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * ASSERT(index2 < limit)
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define NEXT_INDEX(index, step, limit) (((index) + (step)) < (limit) ? \
9da57d7b0ddd8d73b676ce12c040362132cdd538bt (index) + (step) : (index) + (step) - (limit))
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define PREV_INDEX(index, step, limit) ((index) >= (step) ? \
9da57d7b0ddd8d73b676ce12c040362132cdd538bt (index) - (step) : (index) + (limit) - (step))
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define OFFSET(index1, index2, limit) ((index1) <= (index2) ? \
9da57d7b0ddd8d73b676ce12c040362132cdd538bt (index2) - (index1) : (index2) + (limit) - (index1))
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define LINK_LIST_INIT(_LH) \
9da57d7b0ddd8d73b676ce12c040362132cdd538bt (_LH)->head = (_LH)->tail = NULL
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define LIST_GET_HEAD(_LH) ((single_link_t *)((_LH)->head))
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define LIST_POP_HEAD(_LH) \
9da57d7b0ddd8d73b676ce12c040362132cdd538bt (single_link_t *)(_LH)->head; \
9da57d7b0ddd8d73b676ce12c040362132cdd538bt { \
9da57d7b0ddd8d73b676ce12c040362132cdd538bt if ((_LH)->head != NULL) { \
9da57d7b0ddd8d73b676ce12c040362132cdd538bt (_LH)->head = (_LH)->head->link; \
9da57d7b0ddd8d73b676ce12c040362132cdd538bt if ((_LH)->head == NULL) \
9da57d7b0ddd8d73b676ce12c040362132cdd538bt (_LH)->tail = NULL; \
9da57d7b0ddd8d73b676ce12c040362132cdd538bt } \
9da57d7b0ddd8d73b676ce12c040362132cdd538bt }
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define LIST_GET_TAIL(_LH) ((single_link_t *)((_LH)->tail))
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define LIST_PUSH_TAIL(_LH, _E) \
9da57d7b0ddd8d73b676ce12c040362132cdd538bt if ((_LH)->tail != NULL) { \
9da57d7b0ddd8d73b676ce12c040362132cdd538bt (_LH)->tail->link = (single_link_t *)(_E); \
9da57d7b0ddd8d73b676ce12c040362132cdd538bt (_LH)->tail = (single_link_t *)(_E); \
9da57d7b0ddd8d73b676ce12c040362132cdd538bt } else { \
9da57d7b0ddd8d73b676ce12c040362132cdd538bt (_LH)->head = (_LH)->tail = (single_link_t *)(_E); \
9da57d7b0ddd8d73b676ce12c040362132cdd538bt } \
9da57d7b0ddd8d73b676ce12c040362132cdd538bt (_E)->link = NULL;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define LIST_GET_NEXT(_LH, _E) \
9da57d7b0ddd8d73b676ce12c040362132cdd538bt (((_LH)->tail == (single_link_t *)(_E)) ? \
9da57d7b0ddd8d73b676ce12c040362132cdd538bt NULL : ((single_link_t *)(_E))->link)
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bttypedef struct single_link {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt struct single_link *link;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt} single_link_t;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bttypedef struct link_list {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt single_link_t *head;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt single_link_t *tail;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt} link_list_t;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt/*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Property lookups
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define IXGBE_PROP_EXISTS(d, n) ddi_prop_exists(DDI_DEV_T_ANY, (d), \
9da57d7b0ddd8d73b676ce12c040362132cdd538bt DDI_PROP_DONTPASS, (n))
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#define IXGBE_PROP_GET_INT(d, n) ddi_prop_get_int(DDI_DEV_T_ANY, (d), \
9da57d7b0ddd8d73b676ce12c040362132cdd538bt DDI_PROP_DONTPASS, (n), -1)
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bttypedef union ixgbe_ether_addr {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt struct {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t high;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t low;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt } reg;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt struct {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint8_t set;
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer uint8_t group_index;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint8_t addr[ETHERADDRL];
9da57d7b0ddd8d73b676ce12c040362132cdd538bt } mac;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt} ixgbe_ether_addr_t;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bttypedef enum {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt USE_NONE,
9da57d7b0ddd8d73b676ce12c040362132cdd538bt USE_COPY,
9da57d7b0ddd8d73b676ce12c040362132cdd538bt USE_DMA
9da57d7b0ddd8d73b676ce12c040362132cdd538bt} tx_type_t;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
c971fb7ec0a19c6cd00c5614a94c97f953b6e8b1ggtypedef struct ixgbe_tx_context {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t hcksum_flags;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t ip_hdr_len;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t mac_hdr_len;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t l4_proto;
c971fb7ec0a19c6cd00c5614a94c97f953b6e8b1gg uint32_t mss;
c971fb7ec0a19c6cd00c5614a94c97f953b6e8b1gg uint32_t l4_hdr_len;
c971fb7ec0a19c6cd00c5614a94c97f953b6e8b1gg boolean_t lso_flag;
c971fb7ec0a19c6cd00c5614a94c97f953b6e8b1gg} ixgbe_tx_context_t;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt/*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Hold address/length of each DMA segment
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bttypedef struct sw_desc {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint64_t address;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt size_t length;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt} sw_desc_t;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt/*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Handles and addresses of DMA buffer
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bttypedef struct dma_buffer {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt caddr_t address; /* Virtual address */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint64_t dma_address; /* DMA (Hardware) address */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt ddi_acc_handle_t acc_handle; /* Data access handle */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt ddi_dma_handle_t dma_handle; /* DMA handle */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt size_t size; /* Buffer size */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt size_t len; /* Data length in the buffer */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt} dma_buffer_t;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt/*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Tx Control Block
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bttypedef struct tx_control_block {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt single_link_t link;
edf70dc9b8e373c558a49c15c2d86be817d497fePaul Guo uint32_t last_index; /* last descriptor of the pkt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t frag_num;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t desc_num;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt mblk_t *mp;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt tx_type_t tx_type;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt ddi_dma_handle_t tx_dma_handle;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt dma_buffer_t tx_buf;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt sw_desc_t desc[MAX_COOKIE];
9da57d7b0ddd8d73b676ce12c040362132cdd538bt} tx_control_block_t;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt/*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * RX Control Block
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bttypedef struct rx_control_block {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt mblk_t *mp;
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China uint32_t ref_cnt;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt dma_buffer_t rx_buf;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt frtn_t free_rtn;
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China struct ixgbe_rx_data *rx_data;
ffd8e8832e01f996f32459073f4dd308fe5265baWinson Wang - Sun Microsystems - Beijing China int lro_next; /* Index of next rcb */
ffd8e8832e01f996f32459073f4dd308fe5265baWinson Wang - Sun Microsystems - Beijing China int lro_prev; /* Index of previous rcb */
ffd8e8832e01f996f32459073f4dd308fe5265baWinson Wang - Sun Microsystems - Beijing China boolean_t lro_pkt; /* Flag for LRO rcb */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt} rx_control_block_t;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt/*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Software Data Structure for Tx Ring
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bttypedef struct ixgbe_tx_ring {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t index; /* Ring index */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t intr_vector; /* Interrupt vector index */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t vect_bit; /* vector's bit in register */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Mutexes
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kmutex_t tx_lock;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kmutex_t recycle_lock;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kmutex_t tcb_head_lock;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kmutex_t tcb_tail_lock;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Tx descriptor ring definitions
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt dma_buffer_t tbd_area;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt union ixgbe_adv_tx_desc *tbd_ring;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t tbd_head; /* Index of next tbd to recycle */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t tbd_tail; /* Index of next tbd to transmit */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t tbd_free; /* Number of free tbd */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Tx control block list definitions
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt tx_control_block_t *tcb_area;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt tx_control_block_t **work_list;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt tx_control_block_t **free_list;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t tcb_head; /* Head index of free list */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t tcb_tail; /* Tail index of free list */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t tcb_free; /* Number of free tcb in free list */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t *tbd_head_wb; /* Head write-back */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t (*tx_recycle)(struct ixgbe_tx_ring *);
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /*
c971fb7ec0a19c6cd00c5614a94c97f953b6e8b1gg * s/w context structure for TCP/UDP checksum offload
c971fb7ec0a19c6cd00c5614a94c97f953b6e8b1gg * and LSO.
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
c971fb7ec0a19c6cd00c5614a94c97f953b6e8b1gg ixgbe_tx_context_t tx_context;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Tx ring settings and status
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t ring_size; /* Tx descriptor ring size */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t free_list_size; /* Tx free list size */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt boolean_t reschedule;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t recycle_fail;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t stall_watchdog;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#ifdef IXGBE_DEBUG
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Debug statistics
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t stat_overload;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t stat_fail_no_tbd;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t stat_fail_no_tcb;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t stat_fail_dma_bind;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t stat_reschedule;
edf70dc9b8e373c558a49c15c2d86be817d497fePaul Guo uint32_t stat_break_tbd_limit;
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng uint32_t stat_lso_header_fail;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#endif
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer uint64_t stat_obytes;
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer uint64_t stat_opackets;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng mac_ring_handle_t ring_handle;
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Pointer to the ixgbe struct
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt struct ixgbe *ixgbe;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt} ixgbe_tx_ring_t;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt/*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Software Receive Ring
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing Chinatypedef struct ixgbe_rx_data {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kmutex_t recycle_lock; /* Recycle lock, for rcb_tail */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Rx descriptor ring definitions
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt dma_buffer_t rbd_area; /* DMA buffer of rx desc ring */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt union ixgbe_adv_rx_desc *rbd_ring; /* Rx desc ring */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t rbd_next; /* Index of next rx desc */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Rx control block list definitions
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt rx_control_block_t *rcb_area;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt rx_control_block_t **work_list; /* Work list of rcbs */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt rx_control_block_t **free_list; /* Free list of rcbs */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t rcb_head; /* Index of next free rcb */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t rcb_tail; /* Index to put recycled rcb */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t rcb_free; /* Number of free rcbs */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /*
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China * Rx sw ring settings and status
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t ring_size; /* Rx descriptor ring size */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t free_list_size; /* Rx free list size */
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China uint32_t rcb_pending;
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China uint32_t flag;
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China
ffd8e8832e01f996f32459073f4dd308fe5265baWinson Wang - Sun Microsystems - Beijing China uint32_t lro_num; /* Number of rcbs of one LRO */
ffd8e8832e01f996f32459073f4dd308fe5265baWinson Wang - Sun Microsystems - Beijing China uint32_t lro_first; /* Index of first LRO rcb */
ffd8e8832e01f996f32459073f4dd308fe5265baWinson Wang - Sun Microsystems - Beijing China
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China struct ixgbe_rx_ring *rx_ring; /* Pointer to rx ring */
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China} ixgbe_rx_data_t;
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China/*
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China * Software Data Structure for Rx Ring
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China */
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing Chinatypedef struct ixgbe_rx_ring {
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China uint32_t index; /* Ring index */
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer uint32_t group_index; /* Group index */
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer uint32_t hw_index; /* h/w ring index */
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China uint32_t intr_vector; /* Interrupt vector index */
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China uint32_t vect_bit; /* vector's bit in register */
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China ixgbe_rx_data_t *rx_data; /* Rx software ring */
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China kmutex_t rx_lock; /* Rx access lock */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#ifdef IXGBE_DEBUG
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Debug statistics
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t stat_frame_error;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t stat_cksum_error;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t stat_exceed_pkt;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#endif
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer uint64_t stat_rbytes;
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer uint64_t stat_ipackets;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng mac_ring_handle_t ring_handle;
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng uint64_t ring_gen_num;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng struct ixgbe *ixgbe; /* Pointer to ixgbe struct */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt} ixgbe_rx_ring_t;
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng/*
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * Software Receive Ring Group
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng */
da14cebe459d3275048785f25bd869cb09b5307fEric Chengtypedef struct ixgbe_rx_group {
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng uint32_t index; /* Group index */
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng mac_group_handle_t group_handle; /* call back group handle */
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng struct ixgbe *ixgbe; /* Pointer to ixgbe struct */
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng} ixgbe_rx_group_t;
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng
9da57d7b0ddd8d73b676ce12c040362132cdd538bt/*
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China * structure to map interrupt cleanup to msi-x vector
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing Chinatypedef struct ixgbe_intr_vector {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt struct ixgbe *ixgbe; /* point to my adapter */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt ulong_t rx_map[BT_BITOUL(MAX_RX_QUEUE_NUM)]; /* bitmap of rx rings */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt int rxr_cnt; /* count rx rings */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt ulong_t tx_map[BT_BITOUL(MAX_TX_QUEUE_NUM)]; /* bitmap of tx rings */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt int txr_cnt; /* count tx rings */
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China ulong_t other_map[BT_BITOUL(2)]; /* bitmap of other */
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China int other_cnt; /* count other interrupt */
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China} ixgbe_intr_vector_t;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt/*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Software adapter state
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bttypedef struct ixgbe {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt int instance;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt mac_handle_t mac_hdl;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt dev_info_t *dip;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt struct ixgbe_hw hw;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt struct ixgbe_osdep osdep;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo adapter_info_t *capab; /* adapter hardware capabilities */
62e6e1adfc8d795f477410703cc7a88dc5b82622Paul Guo ddi_taskq_t *sfp_taskq; /* sfp-change taskq */
5b6dd21f5401160f9a62ac2e76a858c2bc105370chenlu chen - Sun Microsystems - Beijing China ddi_taskq_t *overtemp_taskq; /* overtemp taskq */
dc0cb1cda72a989d92d813e487cdff59f629aa3fDale Ghent ddi_taskq_t *phy_taskq; /* external PHY taskq */
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo uint32_t eims; /* interrupt mask setting */
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China uint32_t eimc; /* interrupt mask clear */
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China uint32_t eicr; /* interrupt cause reg */
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t ixgbe_state;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt link_state_t link_state;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t link_speed;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t link_duplex;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t reset_count;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t attach_progress;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t loopback_mode;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t default_mtu;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t max_frame_size;
dc0cb1cda72a989d92d813e487cdff59f629aa3fDale Ghent ixgbe_link_speed speeds_supported;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China uint32_t rcb_pending;
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /*
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China * Each msi-x vector: map vector to interrupt cleanup
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China ixgbe_intr_vector_t vect_map[MAX_INTR_VECTOR];
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Receive Rings
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt ixgbe_rx_ring_t *rx_rings; /* Array of rx rings */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t num_rx_rings; /* Number of rx rings in use */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t rx_ring_size; /* Rx descriptor ring size */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t rx_buf_size; /* Rx buffer size */
ffd8e8832e01f996f32459073f4dd308fe5265baWinson Wang - Sun Microsystems - Beijing China boolean_t lro_enable; /* Large Receive Offload */
ffd8e8832e01f996f32459073f4dd308fe5265baWinson Wang - Sun Microsystems - Beijing China uint64_t lro_pkt_count; /* LRO packet count */
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng /*
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng * Receive Groups
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng */
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng ixgbe_rx_group_t *rx_groups; /* Array of rx groups */
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng uint32_t num_rx_groups; /* Number of rx groups in use */
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Transmit Rings
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt ixgbe_tx_ring_t *tx_rings; /* Array of tx rings */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t num_tx_rings; /* Number of tx rings in use */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t tx_ring_size; /* Tx descriptor ring size */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t tx_buf_size; /* Tx buffer size */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China boolean_t tx_ring_init;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt boolean_t tx_head_wb_enable; /* Tx head wrtie-back */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt boolean_t tx_hcksum_enable; /* Tx h/w cksum offload */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt boolean_t lso_enable; /* Large Segment Offload */
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng boolean_t mr_enable; /* Multiple Tx and Rx Ring */
5b6dd21f5401160f9a62ac2e76a858c2bc105370chenlu chen - Sun Microsystems - Beijing China boolean_t relax_order_enable; /* Relax Order */
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer uint32_t classify_mode; /* Classification mode */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t tx_copy_thresh; /* Tx copy threshold */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t tx_recycle_thresh; /* Tx recycle threshold */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t tx_overload_thresh; /* Tx overload threshold */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t tx_resched_thresh; /* Tx reschedule threshold */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt boolean_t rx_hcksum_enable; /* Rx h/w cksum offload */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t rx_copy_thresh; /* Rx copy threshold */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t rx_limit_per_intr; /* Rx pkts per interrupt */
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China uint32_t intr_throttling[MAX_INTR_VECTOR];
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t intr_force;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt int fm_capabilities; /* FMA capabilities */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt int intr_type;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt int intr_cnt;
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer uint32_t intr_cnt_max;
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer uint32_t intr_cnt_min;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt int intr_cap;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt size_t intr_size;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint_t intr_pri;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt ddi_intr_handle_t *htable;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t eims_mask;
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer ddi_cb_handle_t cb_hdl; /* Interrupt callback handle */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kmutex_t gen_lock; /* General lock for device access */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kmutex_t watchdog_lock;
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China kmutex_t rx_pending_lock;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt boolean_t watchdog_enable;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt boolean_t watchdog_start;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt timeout_id_t watchdog_tid;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt boolean_t unicst_init;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t unicst_avail;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t unicst_total;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt ixgbe_ether_addr_t unicst_addr[MAX_NUM_UNICAST_ADDRESSES];
9da57d7b0ddd8d73b676ce12c040362132cdd538bt uint32_t mcast_count;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt struct ether_addr mcast_table[MAX_NUM_MULTICAST_ADDRESSES];
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng ulong_t sys_page_size;
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng
62e6e1adfc8d795f477410703cc7a88dc5b82622Paul Guo boolean_t link_check_complete;
62e6e1adfc8d795f477410703cc7a88dc5b82622Paul Guo hrtime_t link_check_hrtime;
62e6e1adfc8d795f477410703cc7a88dc5b82622Paul Guo ddi_periodic_t periodic_id; /* for link check timer func */
62e6e1adfc8d795f477410703cc7a88dc5b82622Paul Guo
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Kstat definitions
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_t *ixgbe_ks;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China uint32_t param_en_10000fdx_cap:1,
dc0cb1cda72a989d92d813e487cdff59f629aa3fDale Ghent param_en_5000fdx_cap:1,
dc0cb1cda72a989d92d813e487cdff59f629aa3fDale Ghent param_en_2500fdx_cap:1,
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China param_en_1000fdx_cap:1,
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China param_en_100fdx_cap:1,
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China param_adv_10000fdx_cap:1,
dc0cb1cda72a989d92d813e487cdff59f629aa3fDale Ghent param_adv_5000fdx_cap:1,
dc0cb1cda72a989d92d813e487cdff59f629aa3fDale Ghent param_adv_2500fdx_cap:1,
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China param_adv_1000fdx_cap:1,
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China param_adv_100fdx_cap:1,
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China param_pause_cap:1,
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China param_asym_pause_cap:1,
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China param_rem_fault:1,
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China param_adv_autoneg_cap:1,
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China param_adv_pause_cap:1,
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China param_adv_asym_pause_cap:1,
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China param_adv_rem_fault:1,
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China param_lp_10000fdx_cap:1,
dc0cb1cda72a989d92d813e487cdff59f629aa3fDale Ghent param_lp_5000fdx_cap:1,
dc0cb1cda72a989d92d813e487cdff59f629aa3fDale Ghent param_lp_2500fdx_cap:1,
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China param_lp_1000fdx_cap:1,
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China param_lp_100fdx_cap:1,
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China param_lp_autoneg_cap:1,
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China param_lp_pause_cap:1,
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing China param_lp_asym_pause_cap:1,
1fedc51fe8f78efa2ee550387171e6adb2223b8dWinson Wang - Sun Microsystems - Beijing China param_lp_rem_fault:1,
dc0cb1cda72a989d92d813e487cdff59f629aa3fDale Ghent param_pad_to_32:6;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt} ixgbe_t;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bttypedef struct ixgbe_stat {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t link_speed; /* Link Speed */
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t reset_count; /* Reset Count */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t rx_frame_error; /* Rx Error in Packet */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t rx_cksum_error; /* Rx Checksum Error */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t rx_exceed_pkt; /* Rx Exceed Max Pkt Count */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t tx_overload; /* Tx Desc Ring Overload */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t tx_fail_no_tcb; /* Tx Fail Freelist Empty */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t tx_fail_no_tbd; /* Tx Fail Desc Ring Empty */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t tx_fail_dma_bind; /* Tx Fail DMA bind */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t tx_reschedule; /* Tx Reschedule */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t gprc; /* Good Packets Received Count */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t gptc; /* Good Packets Xmitted Count */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t gor; /* Good Octets Received Count */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t got; /* Good Octets Xmitd Count */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t prc64; /* Packets Received - 64b */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t prc127; /* Packets Received - 65-127b */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t prc255; /* Packets Received - 127-255b */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t prc511; /* Packets Received - 256-511b */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t prc1023; /* Packets Received - 511-1023b */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t prc1522; /* Packets Received - 1024-1522b */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t ptc64; /* Packets Xmitted (64b) */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t ptc127; /* Packets Xmitted (64-127b) */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t ptc255; /* Packets Xmitted (128-255b) */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t ptc511; /* Packets Xmitted (255-511b) */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t ptc1023; /* Packets Xmitted (512-1023b) */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t ptc1522; /* Packets Xmitted (1024-1522b */
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng kstat_named_t qprc[16]; /* Queue Packets Received Count */
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng kstat_named_t qptc[16]; /* Queue Packets Transmitted Count */
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng kstat_named_t qbrc[16]; /* Queue Bytes Received Count */
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng kstat_named_t qbtc[16]; /* Queue Bytes Transmitted Count */
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t crcerrs; /* CRC Error Count */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t illerrc; /* Illegal Byte Error Count */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t errbc; /* Error Byte Count */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t mspdc; /* MAC Short Packet Discard Count */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t mpc; /* Missed Packets Count */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t mlfc; /* MAC Local Fault Count */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t mrfc; /* MAC Remote Fault Count */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t rlec; /* Receive Length Error Count */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t lxontxc; /* Link XON Transmitted Count */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t lxonrxc; /* Link XON Received Count */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t lxofftxc; /* Link XOFF Transmitted Count */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t lxoffrxc; /* Link XOFF Received Count */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t bprc; /* Broadcasts Pkts Received Count */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t mprc; /* Multicast Pkts Received Count */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t rnbc; /* Receive No Buffers Count */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t ruc; /* Receive Undersize Count */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t rfc; /* Receive Frag Count */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t roc; /* Receive Oversize Count */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t rjc; /* Receive Jabber Count */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t tor; /* Total Octets Recvd Count */
f27d3025d908422c3f6e682964b4f1e2b4834e4agg kstat_named_t tot; /* Total Octets Xmitted Count */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t tpr; /* Total Packets Received */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t tpt; /* Total Packets Xmitted */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t mptc; /* Multicast Packets Xmited Count */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt kstat_named_t bptc; /* Broadcast Packets Xmited Count */
ffd8e8832e01f996f32459073f4dd308fe5265baWinson Wang - Sun Microsystems - Beijing China kstat_named_t lroc; /* LRO Packets Received Count */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt} ixgbe_stat_t;
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt/*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Function prototypes in ixgbe_buf.c
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538btint ixgbe_alloc_dma(ixgbe_t *);
9da57d7b0ddd8d73b676ce12c040362132cdd538btvoid ixgbe_free_dma(ixgbe_t *);
837c1ac4e72b7d86278cca88b1075af557f7d161Stephen Hansonvoid ixgbe_set_fma_flags(int);
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing Chinavoid ixgbe_free_dma_buffer(dma_buffer_t *);
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing Chinaint ixgbe_alloc_rx_ring_data(ixgbe_rx_ring_t *rx_ring);
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing Chinavoid ixgbe_free_rx_ring_data(ixgbe_rx_data_t *rx_data);
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt/*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Function prototypes in ixgbe_main.c
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing Chinaint ixgbe_start(ixgbe_t *, boolean_t);
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing Chinavoid ixgbe_stop(ixgbe_t *, boolean_t);
9da57d7b0ddd8d73b676ce12c040362132cdd538btint ixgbe_driver_setup_link(ixgbe_t *, boolean_t);
9da57d7b0ddd8d73b676ce12c040362132cdd538btint ixgbe_multicst_add(ixgbe_t *, const uint8_t *);
9da57d7b0ddd8d73b676ce12c040362132cdd538btint ixgbe_multicst_remove(ixgbe_t *, const uint8_t *);
9da57d7b0ddd8d73b676ce12c040362132cdd538btenum ioc_reply ixgbe_loopback_ioctl(ixgbe_t *, struct iocblk *, mblk_t *);
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538btvoid ixgbe_enable_watchdog_timer(ixgbe_t *);
9da57d7b0ddd8d73b676ce12c040362132cdd538btvoid ixgbe_disable_watchdog_timer(ixgbe_t *);
9da57d7b0ddd8d73b676ce12c040362132cdd538btint ixgbe_atomic_reserve(uint32_t *, uint32_t);
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538btint ixgbe_check_acc_handle(ddi_acc_handle_t handle);
9da57d7b0ddd8d73b676ce12c040362132cdd538btint ixgbe_check_dma_handle(ddi_dma_handle_t handle);
9da57d7b0ddd8d73b676ce12c040362132cdd538btvoid ixgbe_fm_ereport(ixgbe_t *, char *);
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
da14cebe459d3275048785f25bd869cb09b5307fEric Chengvoid ixgbe_fill_ring(void *, mac_ring_type_t, const int, const int,
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng mac_ring_info_t *, mac_ring_handle_t);
da14cebe459d3275048785f25bd869cb09b5307fEric Chengvoid ixgbe_fill_group(void *arg, mac_ring_type_t, const int,
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng mac_group_info_t *, mac_group_handle_t);
da14cebe459d3275048785f25bd869cb09b5307fEric Chengint ixgbe_rx_ring_intr_enable(mac_intr_handle_t);
da14cebe459d3275048785f25bd869cb09b5307fEric Chengint ixgbe_rx_ring_intr_disable(mac_intr_handle_t);
da14cebe459d3275048785f25bd869cb09b5307fEric Cheng
9da57d7b0ddd8d73b676ce12c040362132cdd538bt/*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Function prototypes in ixgbe_gld.c
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538btint ixgbe_m_start(void *);
9da57d7b0ddd8d73b676ce12c040362132cdd538btvoid ixgbe_m_stop(void *);
9da57d7b0ddd8d73b676ce12c040362132cdd538btint ixgbe_m_promisc(void *, boolean_t);
9da57d7b0ddd8d73b676ce12c040362132cdd538btint ixgbe_m_multicst(void *, boolean_t, const uint8_t *);
9da57d7b0ddd8d73b676ce12c040362132cdd538btvoid ixgbe_m_resources(void *);
9da57d7b0ddd8d73b676ce12c040362132cdd538btvoid ixgbe_m_ioctl(void *, queue_t *, mblk_t *);
9da57d7b0ddd8d73b676ce12c040362132cdd538btboolean_t ixgbe_m_getcapab(void *, mac_capab_t, void *);
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing Chinaint ixgbe_m_setprop(void *, const char *, mac_prop_id_t, uint_t, const void *);
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyerint ixgbe_m_getprop(void *, const char *, mac_prop_id_t, uint_t, void *);
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyervoid ixgbe_m_propinfo(void *, const char *, mac_prop_id_t,
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer mac_prop_info_handle_t);
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing Chinaint ixgbe_set_priv_prop(ixgbe_t *, const char *, uint_t, const void *);
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyerint ixgbe_get_priv_prop(ixgbe_t *, const char *, uint_t, void *);
ea65739ebec0cbd625d8c89e19592be58fa186a6chenlu chen - Sun Microsystems - Beijing Chinaboolean_t ixgbe_param_locked(mac_prop_id_t);
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt/*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Function prototypes in ixgbe_rx.c
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
da14cebe459d3275048785f25bd869cb09b5307fEric Chengmblk_t *ixgbe_ring_rx(ixgbe_rx_ring_t *, int);
9da57d7b0ddd8d73b676ce12c040362132cdd538btvoid ixgbe_rx_recycle(caddr_t arg);
da14cebe459d3275048785f25bd869cb09b5307fEric Chengmblk_t *ixgbe_ring_rx_poll(void *, int);
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt/*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Function prototypes in ixgbe_tx.c
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
da14cebe459d3275048785f25bd869cb09b5307fEric Chengmblk_t *ixgbe_ring_tx(void *, mblk_t *);
9da57d7b0ddd8d73b676ce12c040362132cdd538btvoid ixgbe_free_tcb(tx_control_block_t *);
9da57d7b0ddd8d73b676ce12c040362132cdd538btvoid ixgbe_put_free_list(ixgbe_tx_ring_t *, link_list_t *);
9da57d7b0ddd8d73b676ce12c040362132cdd538btuint32_t ixgbe_tx_recycle_legacy(ixgbe_tx_ring_t *);
9da57d7b0ddd8d73b676ce12c040362132cdd538btuint32_t ixgbe_tx_recycle_head_wb(ixgbe_tx_ring_t *);
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt/*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Function prototypes in ixgbe_log.c
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538btvoid ixgbe_notice(void *, const char *, ...);
9da57d7b0ddd8d73b676ce12c040362132cdd538btvoid ixgbe_log(void *, const char *, ...);
9da57d7b0ddd8d73b676ce12c040362132cdd538btvoid ixgbe_error(void *, const char *, ...);
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt/*
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Function prototypes in ixgbe_stat.c
9da57d7b0ddd8d73b676ce12c040362132cdd538bt */
9da57d7b0ddd8d73b676ce12c040362132cdd538btint ixgbe_init_stats(ixgbe_t *);
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyerint ixgbe_m_stat(void *, uint_t, uint64_t *);
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyerint ixgbe_rx_ring_stat(mac_ring_driver_t, uint_t, uint64_t *);
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyerint ixgbe_tx_ring_stat(mac_ring_driver_t, uint_t, uint64_t *);
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#ifdef __cplusplus
9da57d7b0ddd8d73b676ce12c040362132cdd538bt}
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#endif
9da57d7b0ddd8d73b676ce12c040362132cdd538bt
9da57d7b0ddd8d73b676ce12c040362132cdd538bt#endif /* _IXGBE_SW_H */