usr/src/uts/common/sys/mac.h
author Sebastien Roy <Sebastien.Roy@Sun.COM>
Tue, 22 Sep 2009 22:04:45 -0400
changeset 10616 3be00c4a6835
parent 10491 8893b747ecdf
child 10639 368f1335a058
permissions -rw-r--r--
PSARC 2009/373 Clearview IP Tunneling PSARC 2009/410 Datalink Administration from Non-Global Zones 6858533 Clearview IP Tunneling 4861777 *snoop* cannot snoop on tunnel interfaces 5010680 M_IOCTL interface between ip and tun is horribly wrong 5029727 tun prints bogus debug messages when receiving multicast packets on 6to4 tunnels 6835873 dlpi_walk() silently fails in an exclusive zone 4152864 must not allow two tunnels to have the same tsrc/tdst pair 6855902 link and flow kstats are too promiscuous 6218826 need to be able to tunnel into a zone 4505468 network interface names can confuse, lie, and deceive 4524756 tun_wproc() takes up too much stack 6417373 tun_wproc_mdata assertion failures 4627970 scalability problems with IP in IP tunnels 4674797 ifparse_ifspec() will not correctly parse ipv6 tunnels 6509231 dladm should show links in exclusive stack zone 4793233 tun driver should include addr in DL_PHYS_ADDR_ACK for non-zero lengths 6795831 ZONE_*_DATALINK syscalls should take datalink_id_t as argument 6791472 mac module doesn't allow MAC addresses < 6 bytes 6618091 Race condition trips ASSERT() in tun.c's SIOCSLIFNAME path 6837580 bogus mi_active check in mac_set_mtu() 6868083 libinetutil: ofmt_open()'s template argument should be const 6870313 libdladm: needless dladm_init_linkprop() in i_dladm_aggr_up() 6872221 panic in dls_devnet_close() if "mtu" property is being set 4289774 Change to the interface-id does not change IPv6 link-local address 6873561 unable to create links with 31 character link names 6874666 changing a link property can accidentally destroy it 6874682 removing a link attribute corrupts the attribute list 6875167 IPCL_ISV6 conn flag is set but never used 6881764 itp reference leak in ipsec_construct_inverse_acquire() 6881951 dladm delete-vlan can no longer delete persistent-only VLANs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     1
/*
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     2
 * CDDL HEADER START
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     3
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     4
 * The contents of this file are subject to the terms of the
2311
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
     5
 * Common Development and Distribution License (the "License").
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
     6
 * You may not use this file except in compliance with the License.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     7
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     8
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     9
 * or http://www.opensolaris.org/os/licensing.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    10
 * See the License for the specific language governing permissions
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    11
 * and limitations under the License.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    12
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    13
 * When distributing Covered Code, include this CDDL HEADER in each
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    14
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    15
 * If applicable, add the following below this CDDL HEADER, with the
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    16
 * fields enclosed by brackets "[]" replaced with your own identifying
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    17
 * information: Portions Copyright [yyyy] [name of copyright owner]
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    18
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    19
 * CDDL HEADER END
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    20
 */
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
    21
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    22
/*
8833
8adf20bc60e3 PSARC/2009/099 dladm show-usage modifications
Venugopal Iyer <Venu.Iyer@Sun.COM>
parents: 8275
diff changeset
    23
 * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    24
 * Use is subject to license terms.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    25
 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    26
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    27
#ifndef	_SYS_MAC_H
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    28
#define	_SYS_MAC_H
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    29
2760
38f12e308f6d PSARC/2006/358 VLAN Observability Enhancement
dg199075
parents: 2406
diff changeset
    30
#include <sys/types.h>
9107
a47dcdb19715 6795822 dld.h and mac.h pollute user space code with kernel symbols
James Carlson <james.d.carlson@sun.com>
parents: 9073
diff changeset
    31
#ifdef	_KERNEL
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    32
#include <sys/sunddi.h>
9107
a47dcdb19715 6795822 dld.h and mac.h pollute user space code with kernel symbols
James Carlson <james.d.carlson@sun.com>
parents: 9073
diff changeset
    33
#endif
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    34
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    35
/*
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    36
 * MAC Services Module
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    37
 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    38
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    39
#ifdef	__cplusplus
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    40
extern "C" {
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    41
#endif
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    42
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    43
/*
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    44
 * MAC Information (text emitted by modinfo(1m))
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    45
 */
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
    46
#define	MAC_INFO	"MAC Services v1.20"
2311
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
    47
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
    48
/*
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
    49
 * MAC-Type version identifier.  This is used by mactype_alloc() and
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
    50
 * mactype_register() to verify that incompatible MAC-Type plugins don't
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
    51
 * register.
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
    52
 */
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
    53
#define	MACTYPE_VERSION	0x1
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
    54
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
    55
/*
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
    56
 * Opaque handle types
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    57
 */
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
    58
typedef struct __mac_handle		*mac_handle_t;
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
    59
typedef struct __mac_resource_handle	*mac_resource_handle_t;
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
    60
typedef struct __mac_notify_handle	*mac_notify_handle_t;
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
    61
typedef struct __mac_tx_notify_handle	*mac_tx_notify_handle_t;
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
    62
typedef	struct __mac_intr_handle	*mac_intr_handle_t;
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
    63
typedef	struct __mac_ring_handle	*mac_ring_handle_t;
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
    64
typedef	struct __mac_group_handle	*mac_group_handle_t;
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    65
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
    66
#define	DATALINK_INVALID_LINKID	0
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
    67
#define	DATALINK_ALL_LINKID	0
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
    68
#define	DATALINK_MAX_LINKID	0xffffffff
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
    69
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
    70
#define	MAC_MAX_MINOR	1000
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
    71
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    72
typedef enum {
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    73
	LINK_STATE_UNKNOWN = -1,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    74
	LINK_STATE_DOWN,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    75
	LINK_STATE_UP
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    76
} link_state_t;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    77
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    78
typedef enum {
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    79
	LINK_DUPLEX_UNKNOWN = 0,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    80
	LINK_DUPLEX_HALF,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    81
	LINK_DUPLEX_FULL
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    82
} link_duplex_t;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    83
5903
df6aed881b11 PSARC 2007/429 Brussels - enhanced network driver configuration via dladm
sowmini
parents: 5895
diff changeset
    84
typedef enum {
df6aed881b11 PSARC 2007/429 Brussels - enhanced network driver configuration via dladm
sowmini
parents: 5895
diff changeset
    85
	LINK_FLOWCTRL_NONE = 0,
df6aed881b11 PSARC 2007/429 Brussels - enhanced network driver configuration via dladm
sowmini
parents: 5895
diff changeset
    86
	LINK_FLOWCTRL_RX,
df6aed881b11 PSARC 2007/429 Brussels - enhanced network driver configuration via dladm
sowmini
parents: 5895
diff changeset
    87
	LINK_FLOWCTRL_TX,
df6aed881b11 PSARC 2007/429 Brussels - enhanced network driver configuration via dladm
sowmini
parents: 5895
diff changeset
    88
	LINK_FLOWCTRL_BI
df6aed881b11 PSARC 2007/429 Brussels - enhanced network driver configuration via dladm
sowmini
parents: 5895
diff changeset
    89
} link_flowctrl_t;
df6aed881b11 PSARC 2007/429 Brussels - enhanced network driver configuration via dladm
sowmini
parents: 5895
diff changeset
    90
8874
c95653a13ea6 PSARC 2009/069 802.1Q tag mode link property
Sebastien Roy <Sebastien.Roy@Sun.COM>
parents: 8833
diff changeset
    91
typedef enum {
c95653a13ea6 PSARC 2009/069 802.1Q tag mode link property
Sebastien Roy <Sebastien.Roy@Sun.COM>
parents: 8833
diff changeset
    92
	LINK_TAGMODE_VLANONLY = 0,
c95653a13ea6 PSARC 2009/069 802.1Q tag mode link property
Sebastien Roy <Sebastien.Roy@Sun.COM>
parents: 8833
diff changeset
    93
	LINK_TAGMODE_NORMAL
c95653a13ea6 PSARC 2009/069 802.1Q tag mode link property
Sebastien Roy <Sebastien.Roy@Sun.COM>
parents: 8833
diff changeset
    94
} link_tagmode_t;
c95653a13ea6 PSARC 2009/069 802.1Q tag mode link property
Sebastien Roy <Sebastien.Roy@Sun.COM>
parents: 8833
diff changeset
    95
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
    96
/*
9514
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
    97
 * Defines range of uint32 values
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
    98
 */
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
    99
typedef struct mac_propval_uint32_range_s {
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   100
	uint32_t mpur_min;
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   101
	uint32_t mpur_max;
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   102
} mac_propval_uint32_range_t;
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   103
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   104
/*
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   105
 * Data type of the value
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   106
 */
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   107
typedef enum {
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   108
	MAC_PROPVAL_UINT32 = 0x1
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   109
} mac_propval_type_t;
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   110
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   111
/*
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   112
 * Captures possible values for a given property. A property can have
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   113
 * range of values (int32, int64, uint32, uint64, et al) or collection/
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   114
 * enumeration of values (strings).
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   115
 * Can be used as a value-result parameter.
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   116
 *
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   117
 * See PSARC 2009/235 for more information.
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   118
 */
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   119
typedef struct mac_propval_range_s {
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   120
	uint_t mpr_count;			/* count of ranges */
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   121
	mac_propval_type_t mpr_type;		/* type of value */
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   122
	union {
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   123
		mac_propval_uint32_range_t mpr_uint32[1];
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   124
	} u;
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   125
} mac_propval_range_t;
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   126
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   127
#define	range_uint32	u.mpr_uint32
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   128
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   129
/*
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   130
 * Maximum MAC address length
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   131
 */
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   132
#define	MAXMACADDRLEN		20
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   133
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   134
typedef enum {
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   135
	MAC_LOGTYPE_LINK = 1,
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   136
	MAC_LOGTYPE_FLOW
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   137
} mac_logtype_t;
6789
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   138
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   139
/*
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   140
 * Encodings for public properties.
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   141
 * A most significant bit value of 1 indicates private property, intended
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   142
 * to allow private property implementations to use internal encodings
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   143
 * if desired.
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   144
 *
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   145
 * Note that there are 2 sets of parameters: the *_EN_*
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   146
 * values are those that the Administrator configures for autonegotiation.
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   147
 * The _ADV_* values are those that are currently exposed over the wire.
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   148
 */
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   149
#define	MAXLINKPROPNAME		256
9514
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   150
#define	MAC_PROP_DEFAULT	0x0001		/* default property value */
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   151
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   152
/*
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   153
 * Indicates the linkprop framework is interested in knowing the list of
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   154
 * possible property values. When used to obtain possible values for a
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   155
 * property, one may have to change all the drivers. See PSARC 2009/235.
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   156
 */
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   157
#define	MAC_PROP_POSSIBLE	0x0002		/* possible property values */
7732f19e67a6 PSARC/2009/235 dladm Possible Values List
Girish Moodalbail <Girish.Moodalbail@Sun.COM>
parents: 9449
diff changeset
   158
6789
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   159
typedef enum {
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   160
	MAC_PROP_DUPLEX = 0x00000001,
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   161
	MAC_PROP_SPEED,
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   162
	MAC_PROP_STATUS,
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   163
	MAC_PROP_AUTONEG,
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   164
	MAC_PROP_EN_AUTONEG,
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   165
	MAC_PROP_MTU,
7342
ba01248bb368 6714745 zone/autopush should be implemented using DLDIOC_*MACPROP ioctls.
Aruna Ramakrishna - Sun Microsystems <Aruna.Ramakrishna@Sun.COM>
parents: 6916
diff changeset
   166
	MAC_PROP_ZONE,
ba01248bb368 6714745 zone/autopush should be implemented using DLDIOC_*MACPROP ioctls.
Aruna Ramakrishna - Sun Microsystems <Aruna.Ramakrishna@Sun.COM>
parents: 6916
diff changeset
   167
	MAC_PROP_AUTOPUSH,
6789
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   168
	MAC_PROP_FLOWCTRL,
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   169
	MAC_PROP_ADV_1000FDX_CAP,
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   170
	MAC_PROP_EN_1000FDX_CAP,
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   171
	MAC_PROP_ADV_1000HDX_CAP,
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   172
	MAC_PROP_EN_1000HDX_CAP,
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   173
	MAC_PROP_ADV_100FDX_CAP,
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   174
	MAC_PROP_EN_100FDX_CAP,
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   175
	MAC_PROP_ADV_100HDX_CAP,
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   176
	MAC_PROP_EN_100HDX_CAP,
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   177
	MAC_PROP_ADV_10FDX_CAP,
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   178
	MAC_PROP_EN_10FDX_CAP,
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   179
	MAC_PROP_ADV_10HDX_CAP,
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   180
	MAC_PROP_EN_10HDX_CAP,
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   181
	MAC_PROP_ADV_100T4_CAP,
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   182
	MAC_PROP_EN_100T4_CAP,
10616
3be00c4a6835 PSARC 2009/373 Clearview IP Tunneling
Sebastien Roy <Sebastien.Roy@Sun.COM>
parents: 10491
diff changeset
   183
	MAC_PROP_IPTUN_HOPLIMIT,
3be00c4a6835 PSARC 2009/373 Clearview IP Tunneling
Sebastien Roy <Sebastien.Roy@Sun.COM>
parents: 10491
diff changeset
   184
	MAC_PROP_IPTUN_ENCAPLIMIT,
7663
bbef84085f42 6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents: 7342
diff changeset
   185
	MAC_PROP_WL_ESSID,
bbef84085f42 6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents: 7342
diff changeset
   186
	MAC_PROP_WL_BSSID,
bbef84085f42 6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents: 7342
diff changeset
   187
	MAC_PROP_WL_BSSTYPE,
bbef84085f42 6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents: 7342
diff changeset
   188
	MAC_PROP_WL_LINKSTATUS,
bbef84085f42 6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents: 7342
diff changeset
   189
	MAC_PROP_WL_DESIRED_RATES,
bbef84085f42 6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents: 7342
diff changeset
   190
	MAC_PROP_WL_SUPPORTED_RATES,
bbef84085f42 6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents: 7342
diff changeset
   191
	MAC_PROP_WL_AUTH_MODE,
bbef84085f42 6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents: 7342
diff changeset
   192
	MAC_PROP_WL_ENCRYPTION,
bbef84085f42 6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents: 7342
diff changeset
   193
	MAC_PROP_WL_RSSI,
bbef84085f42 6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents: 7342
diff changeset
   194
	MAC_PROP_WL_PHY_CONFIG,
bbef84085f42 6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents: 7342
diff changeset
   195
	MAC_PROP_WL_CAPABILITY,
bbef84085f42 6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents: 7342
diff changeset
   196
	MAC_PROP_WL_WPA,
bbef84085f42 6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents: 7342
diff changeset
   197
	MAC_PROP_WL_SCANRESULTS,
bbef84085f42 6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents: 7342
diff changeset
   198
	MAC_PROP_WL_POWER_MODE,
bbef84085f42 6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents: 7342
diff changeset
   199
	MAC_PROP_WL_RADIO,
bbef84085f42 6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents: 7342
diff changeset
   200
	MAC_PROP_WL_ESS_LIST,
bbef84085f42 6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents: 7342
diff changeset
   201
	MAC_PROP_WL_KEY_TAB,
bbef84085f42 6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents: 7342
diff changeset
   202
	MAC_PROP_WL_CREATE_IBSS,
bbef84085f42 6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents: 7342
diff changeset
   203
	MAC_PROP_WL_SETOPTIE,
bbef84085f42 6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents: 7342
diff changeset
   204
	MAC_PROP_WL_DELKEY,
bbef84085f42 6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents: 7342
diff changeset
   205
	MAC_PROP_WL_KEY,
bbef84085f42 6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents: 7342
diff changeset
   206
	MAC_PROP_WL_MLME,
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   207
	MAC_PROP_MAXBW,
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   208
	MAC_PROP_PRIO,
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   209
	MAC_PROP_BIND_CPU,
8874
c95653a13ea6 PSARC 2009/069 802.1Q tag mode link property
Sebastien Roy <Sebastien.Roy@Sun.COM>
parents: 8833
diff changeset
   210
	MAC_PROP_TAGMODE,
9449
53d84bc6a35a PSARC 2009/206 10G link properties
lucy wang - Sun Microsystems - Beijing China <xiuyan.wang@Sun.COM>
parents: 9107
diff changeset
   211
	MAC_PROP_ADV_10GFDX_CAP,
53d84bc6a35a PSARC 2009/206 10G link properties
lucy wang - Sun Microsystems - Beijing China <xiuyan.wang@Sun.COM>
parents: 9107
diff changeset
   212
	MAC_PROP_EN_10GFDX_CAP,
10491
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   213
	MAC_PROP_PVID,
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   214
	MAC_PROP_LLIMIT,
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   215
	MAC_PROP_LDECAY,
6789
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   216
	MAC_PROP_PRIVATE = -1
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   217
} mac_prop_id_t;
4c5ca96fbed3 6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents: 6512
diff changeset
   218
5084
7d838c5c0eed PSARC 2006/260 Solaris on Xen
johnlev
parents: 4913
diff changeset
   219
/*
8118
88925232392f PSARC 2008/608 brussels property permissions
Vasumathi Sundaram - Sun Microsystems <Vasumathi.Sundaram@Sun.COM>
parents: 7663
diff changeset
   220
 * Flags to figure out r/w status of legacy ndd props.
88925232392f PSARC 2008/608 brussels property permissions
Vasumathi Sundaram - Sun Microsystems <Vasumathi.Sundaram@Sun.COM>
parents: 7663
diff changeset
   221
 */
88925232392f PSARC 2008/608 brussels property permissions
Vasumathi Sundaram - Sun Microsystems <Vasumathi.Sundaram@Sun.COM>
parents: 7663
diff changeset
   222
#define	MAC_PROP_PERM_READ		0x0001
88925232392f PSARC 2008/608 brussels property permissions
Vasumathi Sundaram - Sun Microsystems <Vasumathi.Sundaram@Sun.COM>
parents: 7663
diff changeset
   223
#define	MAC_PROP_PERM_WRITE		0x0010
88925232392f PSARC 2008/608 brussels property permissions
Vasumathi Sundaram - Sun Microsystems <Vasumathi.Sundaram@Sun.COM>
parents: 7663
diff changeset
   224
#define	MAC_PROP_MAP_KSTAT		0x0100
88925232392f PSARC 2008/608 brussels property permissions
Vasumathi Sundaram - Sun Microsystems <Vasumathi.Sundaram@Sun.COM>
parents: 7663
diff changeset
   225
#define	MAC_PROP_PERM_RW		(MAC_PROP_PERM_READ|MAC_PROP_PERM_WRITE)
88925232392f PSARC 2008/608 brussels property permissions
Vasumathi Sundaram - Sun Microsystems <Vasumathi.Sundaram@Sun.COM>
parents: 7663
diff changeset
   226
#define	MAC_PROP_FLAGS_RK		(MAC_PROP_PERM_READ|MAC_PROP_MAP_KSTAT)
88925232392f PSARC 2008/608 brussels property permissions
Vasumathi Sundaram - Sun Microsystems <Vasumathi.Sundaram@Sun.COM>
parents: 7663
diff changeset
   227
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   228
#ifdef	_KERNEL
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   229
2311
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   230
/*
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   231
 * There are three ranges of statistics values.  0 to 1 - MAC_STAT_MIN are
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   232
 * interface statistics maintained by the mac module.  MAC_STAT_MIN to 1 -
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   233
 * MACTYPE_STAT_MIN are common MAC statistics defined by the mac module and
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   234
 * maintained by each driver.  MACTYPE_STAT_MIN and above are statistics
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   235
 * defined by MAC-Type plugins and maintained by each driver.
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   236
 */
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   237
#define	MAC_STAT_MIN		1000
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   238
#define	MACTYPE_STAT_MIN	2000
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   239
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   240
#define	IS_MAC_STAT(stat)	\
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   241
	(stat >= MAC_STAT_MIN && stat < MACTYPE_STAT_MIN)
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   242
#define	IS_MACTYPE_STAT(stat)	(stat >= MACTYPE_STAT_MIN)
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   243
4089
32330c723688 PSARC 2007/220 Update Nemo Statistics
gd78059
parents: 3448
diff changeset
   244
/*
5895
f251acdd9bdc PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents: 5733
diff changeset
   245
 * Statistics maintained by the mac module, and possibly populated as link
f251acdd9bdc PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents: 5733
diff changeset
   246
 * statistics.
f251acdd9bdc PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents: 5733
diff changeset
   247
 */
f251acdd9bdc PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents: 5733
diff changeset
   248
enum mac_mod_stat {
f251acdd9bdc PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents: 5733
diff changeset
   249
	MAC_STAT_LINK_STATE,
f251acdd9bdc PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents: 5733
diff changeset
   250
	MAC_STAT_LINK_UP,
10491
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   251
	MAC_STAT_PROMISC,
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   252
	MAC_STAT_LOWLINK_STATE
5895
f251acdd9bdc PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents: 5733
diff changeset
   253
};
f251acdd9bdc PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents: 5733
diff changeset
   254
f251acdd9bdc PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents: 5733
diff changeset
   255
/*
4089
32330c723688 PSARC 2007/220 Update Nemo Statistics
gd78059
parents: 3448
diff changeset
   256
 * Do not reorder, and add only to the end of this list.
32330c723688 PSARC 2007/220 Update Nemo Statistics
gd78059
parents: 3448
diff changeset
   257
 */
2311
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   258
enum mac_driver_stat {
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   259
	/* MIB-II stats (RFC 1213 and RFC 1573) */
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   260
	MAC_STAT_IFSPEED = MAC_STAT_MIN,
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   261
	MAC_STAT_MULTIRCV,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   262
	MAC_STAT_BRDCSTRCV,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   263
	MAC_STAT_MULTIXMT,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   264
	MAC_STAT_BRDCSTXMT,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   265
	MAC_STAT_NORCVBUF,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   266
	MAC_STAT_IERRORS,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   267
	MAC_STAT_UNKNOWNS,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   268
	MAC_STAT_NOXMTBUF,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   269
	MAC_STAT_OERRORS,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   270
	MAC_STAT_COLLISIONS,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   271
	MAC_STAT_RBYTES,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   272
	MAC_STAT_IPACKETS,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   273
	MAC_STAT_OBYTES,
4089
32330c723688 PSARC 2007/220 Update Nemo Statistics
gd78059
parents: 3448
diff changeset
   274
	MAC_STAT_OPACKETS,
32330c723688 PSARC 2007/220 Update Nemo Statistics
gd78059
parents: 3448
diff changeset
   275
	MAC_STAT_UNDERFLOWS,
32330c723688 PSARC 2007/220 Update Nemo Statistics
gd78059
parents: 3448
diff changeset
   276
	MAC_STAT_OVERFLOWS
2311
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   277
};
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   278
4089
32330c723688 PSARC 2007/220 Update Nemo Statistics
gd78059
parents: 3448
diff changeset
   279
#define	MAC_NSTAT	(MAC_STAT_OVERFLOWS - MAC_STAT_IFSPEED + 1)
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   280
2311
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   281
#define	MAC_STAT_ISACOUNTER(_stat) (		\
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   282
	    (_stat) == MAC_STAT_MULTIRCV ||	\
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   283
	    (_stat) == MAC_STAT_BRDCSTRCV ||	\
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   284
	    (_stat) == MAC_STAT_MULTIXMT ||	\
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   285
	    (_stat) == MAC_STAT_BRDCSTXMT ||	\
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   286
	    (_stat) == MAC_STAT_NORCVBUF ||	\
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   287
	    (_stat) == MAC_STAT_IERRORS ||	\
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   288
	    (_stat) == MAC_STAT_UNKNOWNS ||	\
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   289
	    (_stat) == MAC_STAT_NOXMTBUF ||	\
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   290
	    (_stat) == MAC_STAT_OERRORS ||	\
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   291
	    (_stat) == MAC_STAT_COLLISIONS ||	\
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   292
	    (_stat) == MAC_STAT_RBYTES ||	\
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   293
	    (_stat) == MAC_STAT_IPACKETS ||	\
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   294
	    (_stat) == MAC_STAT_OBYTES ||	\
4089
32330c723688 PSARC 2007/220 Update Nemo Statistics
gd78059
parents: 3448
diff changeset
   295
	    (_stat) == MAC_STAT_OPACKETS ||	\
32330c723688 PSARC 2007/220 Update Nemo Statistics
gd78059
parents: 3448
diff changeset
   296
	    (_stat) == MAC_STAT_UNDERFLOWS ||	\
32330c723688 PSARC 2007/220 Update Nemo Statistics
gd78059
parents: 3448
diff changeset
   297
	    (_stat) == MAC_STAT_OVERFLOWS)
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   298
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   299
/*
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   300
 * Immutable information. (This may not be modified after registration).
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   301
 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   302
typedef struct mac_info_s {
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   303
	uint_t		mi_media;
3147
2789cc0027be PSARC/2006/406 WiFi for GLDv3
xc151355
parents: 3115
diff changeset
   304
	uint_t		mi_nativemedia;
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   305
	uint_t		mi_addr_length;
2311
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   306
	uint8_t		*mi_unicst_addr;
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   307
	uint8_t		*mi_brdcst_addr;
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   308
} mac_info_t;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   309
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   310
/*
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   311
 * When VNICs are created on top of the NIC, there are two levels
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   312
 * of MAC layer, a lower MAC, which is the MAC layer at the level of the
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   313
 * physical NIC, and an upper MAC, which is the MAC layer at the level
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   314
 * of the VNIC. Each VNIC maps to a MAC client at the lower MAC, and
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   315
 * the SRS and classification is done at the lower MAC level. The upper
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   316
 * MAC is therefore for the most part pass-through, and therefore
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   317
 * special processing needs to be done at the upper MAC layer when
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   318
 * dealing with a VNIC.
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   319
 *
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   320
 * This capability allows the MAC layer to detect when a VNIC is being
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   321
 * access, and implement the required shortcuts.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   322
 */
6495
1a95fa8c7c94 FWARC 2008/246 Virtual IO Dynamic Device Service
speer
parents: 5903
diff changeset
   323
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   324
typedef void *(*mac_client_handle_fn_t)(void *);
6495
1a95fa8c7c94 FWARC 2008/246 Virtual IO Dynamic Device Service
speer
parents: 5903
diff changeset
   325
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   326
typedef struct mac_capab_vnic_s {
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   327
	void			*mcv_arg;
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   328
	mac_client_handle_fn_t	mcv_mac_client_handle;
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   329
} mac_capab_vnic_t;
6495
1a95fa8c7c94 FWARC 2008/246 Virtual IO Dynamic Device Service
speer
parents: 5903
diff changeset
   330
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   331
typedef void (*mac_rename_fn_t)(const char *, void *);
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   332
typedef struct mac_capab_aggr_s {
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   333
	mac_rename_fn_t mca_rename_fn;
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   334
	int (*mca_unicst)(void *, const uint8_t *);
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   335
} mac_capab_aggr_t;
6495
1a95fa8c7c94 FWARC 2008/246 Virtual IO Dynamic Device Service
speer
parents: 5903
diff changeset
   336
10491
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   337
/* Bridge transmit and receive function signatures */
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   338
typedef mblk_t *(*mac_bridge_tx_t)(mac_handle_t, mac_ring_handle_t, mblk_t *);
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   339
typedef void (*mac_bridge_rx_t)(mac_handle_t, mac_resource_handle_t, mblk_t *);
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   340
typedef void (*mac_bridge_ref_t)(mac_handle_t, boolean_t);
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   341
typedef link_state_t (*mac_bridge_ls_t)(mac_handle_t, link_state_t);
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   342
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   343
/* must change mac_notify_cb_list[] in mac_provider.c if this is changed */
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   344
typedef enum {
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   345
	MAC_NOTE_LINK,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   346
	MAC_NOTE_UNICST,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   347
	MAC_NOTE_TX,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   348
	MAC_NOTE_DEVPROMISC,
2311
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   349
	MAC_NOTE_FASTPATH_FLUSH,
5903
df6aed881b11 PSARC 2007/429 Brussels - enhanced network driver configuration via dladm
sowmini
parents: 5895
diff changeset
   350
	MAC_NOTE_SDU_SIZE,
10616
3be00c4a6835 PSARC 2009/373 Clearview IP Tunneling
Sebastien Roy <Sebastien.Roy@Sun.COM>
parents: 10491
diff changeset
   351
	MAC_NOTE_DEST,
5895
f251acdd9bdc PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents: 5733
diff changeset
   352
	MAC_NOTE_MARGIN,
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   353
	MAC_NOTE_CAPAB_CHG,
10491
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   354
	MAC_NOTE_LOWLINK,
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   355
	MAC_NNOTE	/* must be the last entry */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   356
} mac_notify_type_t;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   357
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   358
typedef void		(*mac_notify_t)(void *, mac_notify_type_t);
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   359
typedef void		(*mac_rx_t)(void *, mac_resource_handle_t, mblk_t *,
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   360
			    boolean_t);
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   361
typedef	mblk_t		*(*mac_receive_t)(void *, int);
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   362
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   363
/*
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   364
 * MAC resource types
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   365
 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   366
typedef enum {
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   367
	MAC_RX_FIFO = 1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   368
} mac_resource_type_t;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   369
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   370
typedef	int	(*mac_intr_enable_t)(mac_intr_handle_t);
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   371
typedef	int	(*mac_intr_disable_t)(mac_intr_handle_t);
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   372
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   373
typedef	struct mac_intr_s {
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   374
	mac_intr_handle_t	mi_handle;
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   375
	mac_intr_enable_t	mi_enable;
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   376
	mac_intr_disable_t	mi_disable;
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   377
} mac_intr_t;
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   378
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   379
typedef struct mac_rx_fifo_s {
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   380
	mac_resource_type_t	mrf_type;	/* MAC_RX_FIFO */
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   381
	mac_intr_t		mrf_intr;
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   382
	mac_receive_t		mrf_receive;
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   383
	void			*mrf_rx_arg;
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   384
	uint32_t		mrf_flow_priority;
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   385
	/*
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   386
	 * The CPU this flow is to be processed on. With intrd and future
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   387
	 * things, we should know which CPU the flow needs to be processed
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   388
	 * and get a squeue assigned on that CPU.
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   389
	 */
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   390
	uint_t			mrf_cpu_id;
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   391
} mac_rx_fifo_t;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   392
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   393
#define	mrf_intr_handle		mrf_intr.mi_handle
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   394
#define	mrf_intr_enable		mrf_intr.mi_enable
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   395
#define	mrf_intr_disable	mrf_intr.mi_disable
56
8b051e816bd8 PSARC/2005/358 Nemo Transmit Pointers
meem
parents: 0
diff changeset
   396
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   397
typedef union mac_resource_u {
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   398
	mac_resource_type_t	mr_type;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   399
	mac_rx_fifo_t		mr_fifo;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   400
} mac_resource_t;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   401
2311
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   402
typedef enum {
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   403
	MAC_ADDRTYPE_UNICAST,
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   404
	MAC_ADDRTYPE_MULTICAST,
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   405
	MAC_ADDRTYPE_BROADCAST
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   406
} mac_addrtype_t;
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   407
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   408
typedef struct mac_header_info_s {
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   409
	size_t		mhi_hdrsize;
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   410
	size_t		mhi_pktsize;
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   411
	const uint8_t	*mhi_daddr;
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   412
	const uint8_t	*mhi_saddr;
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   413
	uint32_t	mhi_origsap;
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   414
	uint32_t	mhi_bindsap;
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   415
	mac_addrtype_t	mhi_dsttype;
2760
38f12e308f6d PSARC/2006/358 VLAN Observability Enhancement
dg199075
parents: 2406
diff changeset
   416
	uint16_t	mhi_tci;
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   417
	boolean_t	mhi_istagged;
10491
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   418
	boolean_t	mhi_ispvid;
2311
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   419
} mac_header_info_t;
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   420
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   421
/*
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   422
 * Function pointer to match dls client signature. Should be same as
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   423
 * dls_rx_t to allow a soft ring to bypass DLS layer and call a DLS
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   424
 * client directly.
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   425
 */
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   426
typedef	void		(*mac_direct_rx_t)(void *, mac_resource_handle_t,
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   427
				mblk_t *, mac_header_info_t *);
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   428
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   429
typedef mac_resource_handle_t	(*mac_resource_add_t)(void *, mac_resource_t *);
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   430
typedef int			(*mac_resource_bind_t)(void *,
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   431
    mac_resource_handle_t, processorid_t);
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   432
typedef void			(*mac_resource_remove_t)(void *, void *);
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   433
typedef void			(*mac_resource_quiesce_t)(void *, void *);
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   434
typedef void			(*mac_resource_restart_t)(void *, void *);
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   435
typedef int			(*mac_resource_modify_t)(void *, void *,
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   436
				    mac_resource_t *);
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   437
typedef	void			(*mac_change_upcall_t)(void *, mac_direct_rx_t,
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   438
    void *);
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   439
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   440
/*
2311
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   441
 * MAC-Type plugin interfaces
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   442
 */
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   443
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   444
typedef int		(*mtops_addr_verify_t)(const void *, void *);
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   445
typedef boolean_t	(*mtops_sap_verify_t)(uint32_t, uint32_t *, void *);
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   446
typedef mblk_t		*(*mtops_header_t)(const void *, const void *,
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   447
    uint32_t, void *, mblk_t *, size_t);
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   448
typedef int		(*mtops_header_info_t)(mblk_t *, void *,
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   449
    mac_header_info_t *);
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   450
typedef boolean_t	(*mtops_pdata_verify_t)(void *, size_t);
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   451
typedef	mblk_t		*(*mtops_header_modify_t)(mblk_t *, void *);
4403
77da60925cac PSARC 2007/296 nemo ethernet stats update, part 2
gd78059
parents: 4089
diff changeset
   452
typedef void		(*mtops_link_details_t)(char *, size_t, mac_handle_t,
77da60925cac PSARC 2007/296 nemo ethernet stats update, part 2
gd78059
parents: 4089
diff changeset
   453
    void *);
2311
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   454
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   455
typedef struct mactype_ops_s {
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   456
	uint_t			mtops_ops;
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   457
	/*
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   458
	 * mtops_unicst_verify() returns 0 if the given address is a valid
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   459
	 * unicast address, or a non-zero errno otherwise.
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   460
	 */
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   461
	mtops_addr_verify_t	mtops_unicst_verify;
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   462
	/*
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   463
	 * mtops_multicst_verify() returns 0 if the given address is a
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   464
	 * valid multicast address, or a non-zero errno otherwise.  If the
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   465
	 * media doesn't support multicast, ENOTSUP should be returned (for
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   466
	 * example).
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   467
	 */
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   468
	mtops_addr_verify_t	mtops_multicst_verify;
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   469
	/*
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   470
	 * mtops_sap_verify() returns B_TRUE if the given SAP is a valid
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   471
	 * SAP value, or B_FALSE otherwise.
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   472
	 */
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   473
	mtops_sap_verify_t	mtops_sap_verify;
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   474
	/*
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   475
	 * mtops_header() is used to allocate and construct a MAC header.
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   476
	 */
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   477
	mtops_header_t		mtops_header;
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   478
	/*
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   479
	 * mtops_header_info() is used to gather information on a given MAC
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   480
	 * header.
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   481
	 */
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   482
	mtops_header_info_t	mtops_header_info;
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   483
	/*
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   484
	 * mtops_pdata_verify() is used to verify the validity of MAC
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   485
	 * plugin data.  It is called by mac_register() if the driver has
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   486
	 * supplied MAC plugin data, and also by mac_pdata_update() when
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   487
	 * drivers update the data.
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   488
	 */
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   489
	mtops_pdata_verify_t	mtops_pdata_verify;
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   490
	/*
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   491
	 * mtops_header_cook() is an optional callback that converts (or
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   492
	 * "cooks") the given raw header (as sent by a raw DLPI consumer)
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   493
	 * into one that is appropriate to send down to the MAC driver.
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   494
	 * Following the example above, an Ethernet header sent down by a
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   495
	 * DLPI consumer would be converted to whatever header the MAC
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   496
	 * driver expects.
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   497
	 */
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   498
	mtops_header_modify_t	mtops_header_cook;
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   499
	/*
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   500
	 * mtops_header_uncook() is an optional callback that does the
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   501
	 * opposite of mtops_header_cook().  It "uncooks" a given MAC
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   502
	 * header (as received from the driver) for consumption by raw DLPI
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   503
	 * consumers.  For example, for a non-Ethernet plugin that wants
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   504
	 * raw DLPI consumers to be fooled into thinking that the device
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   505
	 * provides Ethernet access, this callback would modify the given
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   506
	 * mblk_t such that the MAC header is converted to an Ethernet
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   507
	 * header.
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   508
	 */
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   509
	mtops_header_modify_t	mtops_header_uncook;
4403
77da60925cac PSARC 2007/296 nemo ethernet stats update, part 2
gd78059
parents: 4089
diff changeset
   510
	/*
77da60925cac PSARC 2007/296 nemo ethernet stats update, part 2
gd78059
parents: 4089
diff changeset
   511
	 * mtops_link_details() is an optional callback that provides
77da60925cac PSARC 2007/296 nemo ethernet stats update, part 2
gd78059
parents: 4089
diff changeset
   512
	 * extended information about the link state.  Its primary purpose
77da60925cac PSARC 2007/296 nemo ethernet stats update, part 2
gd78059
parents: 4089
diff changeset
   513
	 * is to provide type-specific support for syslog contents on
77da60925cac PSARC 2007/296 nemo ethernet stats update, part 2
gd78059
parents: 4089
diff changeset
   514
	 * link up events.  If no implementation is provided, then a default
77da60925cac PSARC 2007/296 nemo ethernet stats update, part 2
gd78059
parents: 4089
diff changeset
   515
	 * implementation will be used.
77da60925cac PSARC 2007/296 nemo ethernet stats update, part 2
gd78059
parents: 4089
diff changeset
   516
	 */
77da60925cac PSARC 2007/296 nemo ethernet stats update, part 2
gd78059
parents: 4089
diff changeset
   517
	mtops_link_details_t	mtops_link_details;
2311
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   518
} mactype_ops_t;
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   519
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   520
/*
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   521
 * mtops_ops exists for the plugin to enumerate the optional callback
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   522
 * entrypoints it has defined.  This allows the mac module to define
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   523
 * additional plugin entrypoints in mactype_ops_t without breaking backward
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   524
 * compatibility with old plugins.
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   525
 */
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   526
#define	MTOPS_PDATA_VERIFY	0x001
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   527
#define	MTOPS_HEADER_COOK	0x002
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   528
#define	MTOPS_HEADER_UNCOOK	0x004
4403
77da60925cac PSARC 2007/296 nemo ethernet stats update, part 2
gd78059
parents: 4089
diff changeset
   529
#define	MTOPS_LINK_DETAILS	0x008
2311
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   530
6512
707ffe0297ab PSARC/2008/171 Brussels: NDD compatiblity support
sowmini
parents: 6495
diff changeset
   531
/*
707ffe0297ab PSARC/2008/171 Brussels: NDD compatiblity support
sowmini
parents: 6495
diff changeset
   532
 * Provide mapping for legacy ndd ioctls relevant to that mactype.
707ffe0297ab PSARC/2008/171 Brussels: NDD compatiblity support
sowmini
parents: 6495
diff changeset
   533
 * Note that the ndd ioctls are obsolete, and may be removed in a future
707ffe0297ab PSARC/2008/171 Brussels: NDD compatiblity support
sowmini
parents: 6495
diff changeset
   534
 * release of Solaris. The ndd ioctls are not typically used in legacy
707ffe0297ab PSARC/2008/171 Brussels: NDD compatiblity support
sowmini
parents: 6495
diff changeset
   535
 * ethernet drivers. New datalink drivers of all link-types should use
707ffe0297ab PSARC/2008/171 Brussels: NDD compatiblity support
sowmini
parents: 6495
diff changeset
   536
 * dladm(1m) interfaces for administering tunables and not have to provide
707ffe0297ab PSARC/2008/171 Brussels: NDD compatiblity support
sowmini
parents: 6495
diff changeset
   537
 * a mapping.
707ffe0297ab PSARC/2008/171 Brussels: NDD compatiblity support
sowmini
parents: 6495
diff changeset
   538
 */
707ffe0297ab PSARC/2008/171 Brussels: NDD compatiblity support
sowmini
parents: 6495
diff changeset
   539
typedef struct mac_ndd_mapping_s {
707ffe0297ab PSARC/2008/171 Brussels: NDD compatiblity support
sowmini
parents: 6495
diff changeset
   540
	char		*mp_name;
707ffe0297ab PSARC/2008/171 Brussels: NDD compatiblity support
sowmini
parents: 6495
diff changeset
   541
	union {
707ffe0297ab PSARC/2008/171 Brussels: NDD compatiblity support
sowmini
parents: 6495
diff changeset
   542
		mac_prop_id_t   u_id;
707ffe0297ab PSARC/2008/171 Brussels: NDD compatiblity support
sowmini
parents: 6495
diff changeset
   543
		uint_t		u_kstat;
707ffe0297ab PSARC/2008/171 Brussels: NDD compatiblity support
sowmini
parents: 6495
diff changeset
   544
	} u_mp_id;
707ffe0297ab PSARC/2008/171 Brussels: NDD compatiblity support
sowmini
parents: 6495
diff changeset
   545
	long		mp_minval;
707ffe0297ab PSARC/2008/171 Brussels: NDD compatiblity support
sowmini
parents: 6495
diff changeset
   546
	long		mp_maxval;
707ffe0297ab PSARC/2008/171 Brussels: NDD compatiblity support
sowmini
parents: 6495
diff changeset
   547
	size_t		mp_valsize;
707ffe0297ab PSARC/2008/171 Brussels: NDD compatiblity support
sowmini
parents: 6495
diff changeset
   548
	int		mp_flags;
707ffe0297ab PSARC/2008/171 Brussels: NDD compatiblity support
sowmini
parents: 6495
diff changeset
   549
} mac_ndd_mapping_t;
707ffe0297ab PSARC/2008/171 Brussels: NDD compatiblity support
sowmini
parents: 6495
diff changeset
   550
707ffe0297ab PSARC/2008/171 Brussels: NDD compatiblity support
sowmini
parents: 6495
diff changeset
   551
#define	mp_prop_id	u_mp_id.u_id
707ffe0297ab PSARC/2008/171 Brussels: NDD compatiblity support
sowmini
parents: 6495
diff changeset
   552
#define	mp_kstat	u_mp_id.u_kstat
707ffe0297ab PSARC/2008/171 Brussels: NDD compatiblity support
sowmini
parents: 6495
diff changeset
   553
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   554
typedef struct mac_stat_info_s {
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   555
	uint_t		msi_stat;
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   556
	char		*msi_name;
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   557
	uint_t		msi_type;	/* as defined in kstat_named_init(9F) */
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   558
	uint64_t	msi_default;
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   559
} mac_stat_info_t;
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   560
2311
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   561
typedef struct mactype_register_s {
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   562
	uint_t		mtr_version;	/* set by mactype_alloc() */
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   563
	const char	*mtr_ident;
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   564
	mactype_ops_t	*mtr_ops;
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   565
	uint_t		mtr_mactype;
3147
2789cc0027be PSARC/2006/406 WiFi for GLDv3
xc151355
parents: 3115
diff changeset
   566
	uint_t		mtr_nativetype;
2311
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   567
	uint_t		mtr_addrlen;
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   568
	uint8_t		*mtr_brdcst_addr;
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   569
	mac_stat_info_t	*mtr_stats;
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   570
	size_t		mtr_statcount;
6512
707ffe0297ab PSARC/2008/171 Brussels: NDD compatiblity support
sowmini
parents: 6495
diff changeset
   571
	mac_ndd_mapping_t *mtr_mapping;
707ffe0297ab PSARC/2008/171 Brussels: NDD compatiblity support
sowmini
parents: 6495
diff changeset
   572
	size_t		mtr_mappingcount;
2311
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   573
} mactype_register_t;
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   574
5903
df6aed881b11 PSARC 2007/429 Brussels - enhanced network driver configuration via dladm
sowmini
parents: 5895
diff changeset
   575
typedef struct mac_prop_s {
df6aed881b11 PSARC 2007/429 Brussels - enhanced network driver configuration via dladm
sowmini
parents: 5895
diff changeset
   576
	mac_prop_id_t	mp_id;
df6aed881b11 PSARC 2007/429 Brussels - enhanced network driver configuration via dladm
sowmini
parents: 5895
diff changeset
   577
	char		*mp_name;
6512
707ffe0297ab PSARC/2008/171 Brussels: NDD compatiblity support
sowmini
parents: 6495
diff changeset
   578
	uint_t		mp_flags;
5903
df6aed881b11 PSARC 2007/429 Brussels - enhanced network driver configuration via dladm
sowmini
parents: 5895
diff changeset
   579
} mac_prop_t;
df6aed881b11 PSARC 2007/429 Brussels - enhanced network driver configuration via dladm
sowmini
parents: 5895
diff changeset
   580
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   581
/*
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   582
 * Driver interface functions.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   583
 */
5895
f251acdd9bdc PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents: 5733
diff changeset
   584
extern int			mac_open_by_linkid(datalink_id_t,
f251acdd9bdc PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents: 5733
diff changeset
   585
				    mac_handle_t *);
f251acdd9bdc PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents: 5733
diff changeset
   586
extern int			mac_open_by_linkname(const char *,
f251acdd9bdc PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents: 5733
diff changeset
   587
				    mac_handle_t *);
f251acdd9bdc PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents: 5733
diff changeset
   588
extern const char		*mac_name(mac_handle_t);
f251acdd9bdc PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents: 5733
diff changeset
   589
extern minor_t			mac_minor(mac_handle_t);
f251acdd9bdc PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents: 5733
diff changeset
   590
extern minor_t			mac_minor_hold(boolean_t);
f251acdd9bdc PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents: 5733
diff changeset
   591
extern void			mac_minor_rele(minor_t);
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   592
extern void			mac_sdu_get(mac_handle_t, uint_t *, uint_t *);
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   593
extern int			mac_maxsdu_update(mac_handle_t, uint_t);
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   594
2311
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   595
extern void 			mac_unicst_update(mac_handle_t,
5895
f251acdd9bdc PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents: 5733
diff changeset
   596
				    const uint8_t *);
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   597
extern void			mac_capab_update(mac_handle_t);
2311
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   598
extern int			mac_pdata_update(mac_handle_t, void *,
5895
f251acdd9bdc PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents: 5733
diff changeset
   599
				    size_t);
f251acdd9bdc PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents: 5733
diff changeset
   600
extern boolean_t		mac_margin_update(mac_handle_t, uint32_t);
f251acdd9bdc PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents: 5733
diff changeset
   601
extern void			mac_margin_get(mac_handle_t, uint32_t *);
f251acdd9bdc PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents: 5733
diff changeset
   602
extern int			mac_margin_remove(mac_handle_t, uint32_t);
f251acdd9bdc PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents: 5733
diff changeset
   603
extern int			mac_margin_add(mac_handle_t, uint32_t *,
f251acdd9bdc PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents: 5733
diff changeset
   604
				    boolean_t);
9073
a5a4bb23741e PSARC/2008/242 Data Fast-Path for Softmac
Cathy Zhou <Cathy.Zhou@Sun.COM>
parents: 9060
diff changeset
   605
extern int			mac_fastpath_disable(mac_handle_t);
a5a4bb23741e PSARC/2008/242 Data Fast-Path for Softmac
Cathy Zhou <Cathy.Zhou@Sun.COM>
parents: 9060
diff changeset
   606
extern void			mac_fastpath_enable(mac_handle_t);
10491
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   607
extern void			mac_no_active(mac_handle_t);
5895
f251acdd9bdc PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents: 5733
diff changeset
   608
2311
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   609
extern mactype_register_t	*mactype_alloc(uint_t);
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   610
extern void			mactype_free(mactype_register_t *);
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   611
extern int			mactype_register(mactype_register_t *);
2d86e52dcdf0 PSARC/2006/248 Nemo MAC-Type Plugin Architecture
seb
parents: 269
diff changeset
   612
extern int			mactype_unregister(const char *);
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   613
9073
a5a4bb23741e PSARC/2008/242 Data Fast-Path for Softmac
Cathy Zhou <Cathy.Zhou@Sun.COM>
parents: 9060
diff changeset
   614
extern int			mac_start_logusage(mac_logtype_t, uint_t);
8275
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   615
extern void			mac_stop_logusage(mac_logtype_t);
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   616
7c223a798022 PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents: 8118
diff changeset
   617
extern mac_handle_t		mac_get_lower_mac_handle(mac_handle_t);
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   618
8833
8adf20bc60e3 PSARC/2009/099 dladm show-usage modifications
Venugopal Iyer <Venu.Iyer@Sun.COM>
parents: 8275
diff changeset
   619
/*
8adf20bc60e3 PSARC/2009/099 dladm show-usage modifications
Venugopal Iyer <Venu.Iyer@Sun.COM>
parents: 8275
diff changeset
   620
 * Packet hashing for distribution to multiple ports and rings.
8adf20bc60e3 PSARC/2009/099 dladm show-usage modifications
Venugopal Iyer <Venu.Iyer@Sun.COM>
parents: 8275
diff changeset
   621
 */
8adf20bc60e3 PSARC/2009/099 dladm show-usage modifications
Venugopal Iyer <Venu.Iyer@Sun.COM>
parents: 8275
diff changeset
   622
8adf20bc60e3 PSARC/2009/099 dladm show-usage modifications
Venugopal Iyer <Venu.Iyer@Sun.COM>
parents: 8275
diff changeset
   623
#define	MAC_PKT_HASH_L2		0x01
8adf20bc60e3 PSARC/2009/099 dladm show-usage modifications
Venugopal Iyer <Venu.Iyer@Sun.COM>
parents: 8275
diff changeset
   624
#define	MAC_PKT_HASH_L3		0x02
8adf20bc60e3 PSARC/2009/099 dladm show-usage modifications
Venugopal Iyer <Venu.Iyer@Sun.COM>
parents: 8275
diff changeset
   625
#define	MAC_PKT_HASH_L4		0x04
8adf20bc60e3 PSARC/2009/099 dladm show-usage modifications
Venugopal Iyer <Venu.Iyer@Sun.COM>
parents: 8275
diff changeset
   626
8adf20bc60e3 PSARC/2009/099 dladm show-usage modifications
Venugopal Iyer <Venu.Iyer@Sun.COM>
parents: 8275
diff changeset
   627
extern uint64_t			mac_pkt_hash(uint_t, mblk_t *, uint8_t,
8adf20bc60e3 PSARC/2009/099 dladm show-usage modifications
Venugopal Iyer <Venu.Iyer@Sun.COM>
parents: 8275
diff changeset
   628
				    boolean_t);
8adf20bc60e3 PSARC/2009/099 dladm show-usage modifications
Venugopal Iyer <Venu.Iyer@Sun.COM>
parents: 8275
diff changeset
   629
10491
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   630
/*
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   631
 * Bridging linkage
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   632
 */
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   633
extern void			mac_rx_common(mac_handle_t,
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   634
				    mac_resource_handle_t, mblk_t *);
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   635
extern int			mac_bridge_set(mac_handle_t, mac_handle_t);
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   636
extern void			mac_bridge_clear(mac_handle_t, mac_handle_t);
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   637
extern void			mac_bridge_vectors(mac_bridge_tx_t,
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   638
				    mac_bridge_rx_t, mac_bridge_ref_t,
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   639
				    mac_bridge_ls_t);
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   640
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   641
/* special case function for TRILL observability */
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   642
extern void			mac_trill_snoop(mac_handle_t, mblk_t *);
8893b747ecdf PSARC 2007/596 RBridges: Routing Bridges
Rishi Srivatsavai <Rishi.Srivatsavai@Sun.COM>
parents: 9641
diff changeset
   643
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   644
#endif	/* _KERNEL */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   645
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   646
#ifdef	__cplusplus
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   647
}
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   648
#endif
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   649
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   650
#endif /* _SYS_MAC_H */