author | Venugopal Iyer <Venu.Iyer@Sun.COM> |
Tue, 17 Feb 2009 01:31:30 -0800 | |
changeset 8833 | 8adf20bc60e3 |
parent 8275 | 7c223a798022 |
child 8874 | c95653a13ea6 |
permissions | -rw-r--r-- |
0 | 1 |
/* |
2 |
* CDDL HEADER START |
|
3 |
* |
|
4 |
* The contents of this file are subject to the terms of the |
|
2311 | 5 |
* Common Development and Distribution License (the "License"). |
6 |
* You may not use this file except in compliance with the License. |
|
0 | 7 |
* |
8 |
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
9 |
* or http://www.opensolaris.org/os/licensing. |
|
10 |
* See the License for the specific language governing permissions |
|
11 |
* and limitations under the License. |
|
12 |
* |
|
13 |
* When distributing Covered Code, include this CDDL HEADER in each |
|
14 |
* file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
15 |
* If applicable, add the following below this CDDL HEADER, with the |
|
16 |
* fields enclosed by brackets "[]" replaced with your own identifying |
|
17 |
* information: Portions Copyright [yyyy] [name of copyright owner] |
|
18 |
* |
|
19 |
* CDDL HEADER END |
|
20 |
*/ |
|
8275
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
21 |
|
0 | 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 | 24 |
* Use is subject to license terms. |
25 |
*/ |
|
26 |
||
27 |
#ifndef _SYS_MAC_H |
|
28 |
#define _SYS_MAC_H |
|
29 |
||
2760 | 30 |
#include <sys/types.h> |
0 | 31 |
#include <sys/ddi.h> |
32 |
#include <sys/sunddi.h> |
|
33 |
#include <sys/stream.h> |
|
8275
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
34 |
#include <sys/mac_flow.h> |
0 | 35 |
|
36 |
/* |
|
37 |
* MAC Services Module |
|
38 |
*/ |
|
39 |
||
40 |
#ifdef __cplusplus |
|
41 |
extern "C" { |
|
42 |
#endif |
|
43 |
||
44 |
/* |
|
45 |
* MAC Information (text emitted by modinfo(1m)) |
|
46 |
*/ |
|
8275
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
47 |
#define MAC_INFO "MAC Services v1.20" |
2311 | 48 |
|
49 |
/* |
|
50 |
* MAC-Type version identifier. This is used by mactype_alloc() and |
|
51 |
* mactype_register() to verify that incompatible MAC-Type plugins don't |
|
52 |
* register. |
|
53 |
*/ |
|
54 |
#define MACTYPE_VERSION 0x1 |
|
55 |
||
56 |
/* |
|
8275
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
57 |
* Opaque handle types |
0 | 58 |
*/ |
8275
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
59 |
typedef struct __mac_handle *mac_handle_t; |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
60 |
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
|
61 |
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
|
62 |
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
|
63 |
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
|
64 |
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
|
65 |
typedef struct __mac_group_handle *mac_group_handle_t; |
0 | 66 |
|
8275
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
67 |
#define DATALINK_INVALID_LINKID 0 |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
68 |
#define DATALINK_ALL_LINKID 0 |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
69 |
#define DATALINK_MAX_LINKID 0xffffffff |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
70 |
|
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
71 |
#define MAC_MAX_MINOR 1000 |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
72 |
|
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
73 |
typedef uint32_t datalink_id_t; |
0 | 74 |
|
75 |
typedef enum { |
|
76 |
LINK_STATE_UNKNOWN = -1, |
|
77 |
LINK_STATE_DOWN, |
|
78 |
LINK_STATE_UP |
|
79 |
} link_state_t; |
|
80 |
||
81 |
typedef enum { |
|
82 |
LINK_DUPLEX_UNKNOWN = 0, |
|
83 |
LINK_DUPLEX_HALF, |
|
84 |
LINK_DUPLEX_FULL |
|
85 |
} link_duplex_t; |
|
86 |
||
5903
df6aed881b11
PSARC 2007/429 Brussels - enhanced network driver configuration via dladm
sowmini
parents:
5895
diff
changeset
|
87 |
typedef enum { |
df6aed881b11
PSARC 2007/429 Brussels - enhanced network driver configuration via dladm
sowmini
parents:
5895
diff
changeset
|
88 |
LINK_FLOWCTRL_NONE = 0, |
df6aed881b11
PSARC 2007/429 Brussels - enhanced network driver configuration via dladm
sowmini
parents:
5895
diff
changeset
|
89 |
LINK_FLOWCTRL_RX, |
df6aed881b11
PSARC 2007/429 Brussels - enhanced network driver configuration via dladm
sowmini
parents:
5895
diff
changeset
|
90 |
LINK_FLOWCTRL_TX, |
df6aed881b11
PSARC 2007/429 Brussels - enhanced network driver configuration via dladm
sowmini
parents:
5895
diff
changeset
|
91 |
LINK_FLOWCTRL_BI |
df6aed881b11
PSARC 2007/429 Brussels - enhanced network driver configuration via dladm
sowmini
parents:
5895
diff
changeset
|
92 |
} link_flowctrl_t; |
df6aed881b11
PSARC 2007/429 Brussels - enhanced network driver configuration via dladm
sowmini
parents:
5895
diff
changeset
|
93 |
|
8275
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
94 |
/* |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
95 |
* Maximum MAC address length |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
96 |
*/ |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
97 |
#define MAXMACADDRLEN 20 |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
98 |
|
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
99 |
typedef enum { |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
100 |
MAC_LOGTYPE_LINK = 1, |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
101 |
MAC_LOGTYPE_FLOW |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
102 |
} mac_logtype_t; |
6789
4c5ca96fbed3
6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents:
6512
diff
changeset
|
103 |
|
4c5ca96fbed3
6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents:
6512
diff
changeset
|
104 |
/* |
4c5ca96fbed3
6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents:
6512
diff
changeset
|
105 |
* Encodings for public properties. |
4c5ca96fbed3
6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents:
6512
diff
changeset
|
106 |
* 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
|
107 |
* 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
|
108 |
* if desired. |
4c5ca96fbed3
6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents:
6512
diff
changeset
|
109 |
* |
4c5ca96fbed3
6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents:
6512
diff
changeset
|
110 |
* 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
|
111 |
* 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
|
112 |
* 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
|
113 |
*/ |
4c5ca96fbed3
6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents:
6512
diff
changeset
|
114 |
#define MAXLINKPROPNAME 256 |
4c5ca96fbed3
6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents:
6512
diff
changeset
|
115 |
#define MAC_PROP_DEFAULT 0x0001 |
4c5ca96fbed3
6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents:
6512
diff
changeset
|
116 |
typedef enum { |
4c5ca96fbed3
6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents:
6512
diff
changeset
|
117 |
MAC_PROP_DUPLEX = 0x00000001, |
4c5ca96fbed3
6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents:
6512
diff
changeset
|
118 |
MAC_PROP_SPEED, |
4c5ca96fbed3
6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents:
6512
diff
changeset
|
119 |
MAC_PROP_STATUS, |
4c5ca96fbed3
6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents:
6512
diff
changeset
|
120 |
MAC_PROP_AUTONEG, |
4c5ca96fbed3
6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents:
6512
diff
changeset
|
121 |
MAC_PROP_EN_AUTONEG, |
4c5ca96fbed3
6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents:
6512
diff
changeset
|
122 |
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
|
123 |
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
|
124 |
MAC_PROP_AUTOPUSH, |
6789
4c5ca96fbed3
6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents:
6512
diff
changeset
|
125 |
MAC_PROP_FLOWCTRL, |
4c5ca96fbed3
6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents:
6512
diff
changeset
|
126 |
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
|
127 |
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
|
128 |
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
|
129 |
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
|
130 |
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
|
131 |
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
|
132 |
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
|
133 |
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
|
134 |
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
|
135 |
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
|
136 |
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
|
137 |
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
|
138 |
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
|
139 |
MAC_PROP_EN_100T4_CAP, |
7663
bbef84085f42
6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents:
7342
diff
changeset
|
140 |
MAC_PROP_WL_ESSID, |
bbef84085f42
6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents:
7342
diff
changeset
|
141 |
MAC_PROP_WL_BSSID, |
bbef84085f42
6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents:
7342
diff
changeset
|
142 |
MAC_PROP_WL_BSSTYPE, |
bbef84085f42
6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents:
7342
diff
changeset
|
143 |
MAC_PROP_WL_LINKSTATUS, |
bbef84085f42
6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents:
7342
diff
changeset
|
144 |
MAC_PROP_WL_DESIRED_RATES, |
bbef84085f42
6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents:
7342
diff
changeset
|
145 |
MAC_PROP_WL_SUPPORTED_RATES, |
bbef84085f42
6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents:
7342
diff
changeset
|
146 |
MAC_PROP_WL_AUTH_MODE, |
bbef84085f42
6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents:
7342
diff
changeset
|
147 |
MAC_PROP_WL_ENCRYPTION, |
bbef84085f42
6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents:
7342
diff
changeset
|
148 |
MAC_PROP_WL_RSSI, |
bbef84085f42
6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents:
7342
diff
changeset
|
149 |
MAC_PROP_WL_PHY_CONFIG, |
bbef84085f42
6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents:
7342
diff
changeset
|
150 |
MAC_PROP_WL_CAPABILITY, |
bbef84085f42
6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents:
7342
diff
changeset
|
151 |
MAC_PROP_WL_WPA, |
bbef84085f42
6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents:
7342
diff
changeset
|
152 |
MAC_PROP_WL_SCANRESULTS, |
bbef84085f42
6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents:
7342
diff
changeset
|
153 |
MAC_PROP_WL_POWER_MODE, |
bbef84085f42
6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents:
7342
diff
changeset
|
154 |
MAC_PROP_WL_RADIO, |
bbef84085f42
6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents:
7342
diff
changeset
|
155 |
MAC_PROP_WL_ESS_LIST, |
bbef84085f42
6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents:
7342
diff
changeset
|
156 |
MAC_PROP_WL_KEY_TAB, |
bbef84085f42
6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents:
7342
diff
changeset
|
157 |
MAC_PROP_WL_CREATE_IBSS, |
bbef84085f42
6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents:
7342
diff
changeset
|
158 |
MAC_PROP_WL_SETOPTIE, |
bbef84085f42
6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents:
7342
diff
changeset
|
159 |
MAC_PROP_WL_DELKEY, |
bbef84085f42
6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents:
7342
diff
changeset
|
160 |
MAC_PROP_WL_KEY, |
bbef84085f42
6721363 concise 'show-linkprop' default output
Sowmini Varadhan <Sowmini.Varadhan@Sun.COM>
parents:
7342
diff
changeset
|
161 |
MAC_PROP_WL_MLME, |
8275
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
162 |
MAC_PROP_MAXBW, |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
163 |
MAC_PROP_PRIO, |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
164 |
MAC_PROP_BIND_CPU, |
6789
4c5ca96fbed3
6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents:
6512
diff
changeset
|
165 |
MAC_PROP_PRIVATE = -1 |
4c5ca96fbed3
6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents:
6512
diff
changeset
|
166 |
} mac_prop_id_t; |
4c5ca96fbed3
6674402 sort out property management related constants and data-structures in {dld,mac}.h
am223141
parents:
6512
diff
changeset
|
167 |
|
5084 | 168 |
/* |
8118
88925232392f
PSARC 2008/608 brussels property permissions
Vasumathi Sundaram - Sun Microsystems <Vasumathi.Sundaram@Sun.COM>
parents:
7663
diff
changeset
|
169 |
* 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
|
170 |
*/ |
88925232392f
PSARC 2008/608 brussels property permissions
Vasumathi Sundaram - Sun Microsystems <Vasumathi.Sundaram@Sun.COM>
parents:
7663
diff
changeset
|
171 |
#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
|
172 |
#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
|
173 |
#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
|
174 |
#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
|
175 |
#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
|
176 |
|
0 | 177 |
#ifdef _KERNEL |
178 |
||
2311 | 179 |
/* |
180 |
* There are three ranges of statistics values. 0 to 1 - MAC_STAT_MIN are |
|
181 |
* interface statistics maintained by the mac module. MAC_STAT_MIN to 1 - |
|
182 |
* MACTYPE_STAT_MIN are common MAC statistics defined by the mac module and |
|
183 |
* maintained by each driver. MACTYPE_STAT_MIN and above are statistics |
|
184 |
* defined by MAC-Type plugins and maintained by each driver. |
|
185 |
*/ |
|
186 |
#define MAC_STAT_MIN 1000 |
|
187 |
#define MACTYPE_STAT_MIN 2000 |
|
188 |
||
189 |
#define IS_MAC_STAT(stat) \ |
|
190 |
(stat >= MAC_STAT_MIN && stat < MACTYPE_STAT_MIN) |
|
191 |
#define IS_MACTYPE_STAT(stat) (stat >= MACTYPE_STAT_MIN) |
|
192 |
||
4089 | 193 |
/* |
5895
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
194 |
* 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
|
195 |
* statistics. |
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
196 |
*/ |
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
197 |
enum mac_mod_stat { |
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
198 |
MAC_STAT_LINK_STATE, |
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
199 |
MAC_STAT_LINK_UP, |
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
200 |
MAC_STAT_PROMISC |
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
201 |
}; |
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
202 |
|
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
203 |
/* |
4089 | 204 |
* Do not reorder, and add only to the end of this list. |
205 |
*/ |
|
2311 | 206 |
enum mac_driver_stat { |
207 |
/* MIB-II stats (RFC 1213 and RFC 1573) */ |
|
208 |
MAC_STAT_IFSPEED = MAC_STAT_MIN, |
|
0 | 209 |
MAC_STAT_MULTIRCV, |
210 |
MAC_STAT_BRDCSTRCV, |
|
211 |
MAC_STAT_MULTIXMT, |
|
212 |
MAC_STAT_BRDCSTXMT, |
|
213 |
MAC_STAT_NORCVBUF, |
|
214 |
MAC_STAT_IERRORS, |
|
215 |
MAC_STAT_UNKNOWNS, |
|
216 |
MAC_STAT_NOXMTBUF, |
|
217 |
MAC_STAT_OERRORS, |
|
218 |
MAC_STAT_COLLISIONS, |
|
219 |
MAC_STAT_RBYTES, |
|
220 |
MAC_STAT_IPACKETS, |
|
221 |
MAC_STAT_OBYTES, |
|
4089 | 222 |
MAC_STAT_OPACKETS, |
223 |
MAC_STAT_UNDERFLOWS, |
|
224 |
MAC_STAT_OVERFLOWS |
|
2311 | 225 |
}; |
0 | 226 |
|
4089 | 227 |
#define MAC_NSTAT (MAC_STAT_OVERFLOWS - MAC_STAT_IFSPEED + 1) |
0 | 228 |
|
2311 | 229 |
#define MAC_STAT_ISACOUNTER(_stat) ( \ |
230 |
(_stat) == MAC_STAT_MULTIRCV || \ |
|
231 |
(_stat) == MAC_STAT_BRDCSTRCV || \ |
|
232 |
(_stat) == MAC_STAT_MULTIXMT || \ |
|
233 |
(_stat) == MAC_STAT_BRDCSTXMT || \ |
|
234 |
(_stat) == MAC_STAT_NORCVBUF || \ |
|
235 |
(_stat) == MAC_STAT_IERRORS || \ |
|
236 |
(_stat) == MAC_STAT_UNKNOWNS || \ |
|
237 |
(_stat) == MAC_STAT_NOXMTBUF || \ |
|
238 |
(_stat) == MAC_STAT_OERRORS || \ |
|
239 |
(_stat) == MAC_STAT_COLLISIONS || \ |
|
240 |
(_stat) == MAC_STAT_RBYTES || \ |
|
241 |
(_stat) == MAC_STAT_IPACKETS || \ |
|
242 |
(_stat) == MAC_STAT_OBYTES || \ |
|
4089 | 243 |
(_stat) == MAC_STAT_OPACKETS || \ |
244 |
(_stat) == MAC_STAT_UNDERFLOWS || \ |
|
245 |
(_stat) == MAC_STAT_OVERFLOWS) |
|
0 | 246 |
|
247 |
/* |
|
248 |
* Immutable information. (This may not be modified after registration). |
|
249 |
*/ |
|
250 |
typedef struct mac_info_s { |
|
251 |
uint_t mi_media; |
|
3147 | 252 |
uint_t mi_nativemedia; |
0 | 253 |
uint_t mi_addr_length; |
2311 | 254 |
uint8_t *mi_unicst_addr; |
255 |
uint8_t *mi_brdcst_addr; |
|
0 | 256 |
} mac_info_t; |
257 |
||
258 |
/* |
|
5895
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
259 |
* Information for legacy devices. |
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
260 |
*/ |
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
261 |
typedef struct mac_capab_legacy_s { |
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
262 |
/* |
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
263 |
* Notifications that the legacy device does not support. |
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
264 |
*/ |
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
265 |
uint32_t ml_unsup_note; |
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
266 |
/* |
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
267 |
* dev_t of the legacy device; can be held to force attach. |
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
268 |
*/ |
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
269 |
dev_t ml_dev; |
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
270 |
} mac_capab_legacy_t; |
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
271 |
|
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
272 |
/* |
8275
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
273 |
* 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
|
274 |
* 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
|
275 |
* 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
|
276 |
* 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
|
277 |
* 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
|
278 |
* 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
|
279 |
* 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
|
280 |
* dealing with a VNIC. |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
281 |
* |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
282 |
* 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
|
283 |
* access, and implement the required shortcuts. |
0 | 284 |
*/ |
6495 | 285 |
|
8275
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
286 |
typedef void *(*mac_client_handle_fn_t)(void *); |
6495 | 287 |
|
8275
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
288 |
typedef struct mac_capab_vnic_s { |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
289 |
void *mcv_arg; |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
290 |
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
|
291 |
} mac_capab_vnic_t; |
6495 | 292 |
|
8275
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
293 |
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
|
294 |
typedef struct mac_capab_aggr_s { |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
295 |
mac_rename_fn_t mca_rename_fn; |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
296 |
int (*mca_unicst)(void *, const uint8_t *); |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
297 |
} mac_capab_aggr_t; |
6495 | 298 |
|
0 | 299 |
typedef enum { |
300 |
MAC_NOTE_LINK, |
|
301 |
MAC_NOTE_PROMISC, |
|
302 |
MAC_NOTE_UNICST, |
|
303 |
MAC_NOTE_TX, |
|
304 |
MAC_NOTE_RESOURCE, |
|
305 |
MAC_NOTE_DEVPROMISC, |
|
2311 | 306 |
MAC_NOTE_FASTPATH_FLUSH, |
5903
df6aed881b11
PSARC 2007/429 Brussels - enhanced network driver configuration via dladm
sowmini
parents:
5895
diff
changeset
|
307 |
MAC_NOTE_SDU_SIZE, |
5895
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
308 |
MAC_NOTE_MARGIN, |
8275
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
309 |
MAC_NOTE_CAPAB_CHG, |
0 | 310 |
MAC_NNOTE /* must be the last entry */ |
311 |
} mac_notify_type_t; |
|
312 |
||
313 |
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
|
314 |
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
|
315 |
boolean_t); |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
316 |
typedef mblk_t *(*mac_receive_t)(void *, int); |
0 | 317 |
|
318 |
/* |
|
319 |
* MAC promiscuous types |
|
320 |
*/ |
|
321 |
typedef enum { |
|
322 |
MAC_PROMISC = 0x01, /* MAC instance is promiscuous */ |
|
323 |
MAC_DEVPROMISC = 0x02 /* Device is promiscuous */ |
|
324 |
} mac_promisc_type_t; |
|
325 |
||
326 |
/* |
|
327 |
* MAC resource types |
|
328 |
*/ |
|
329 |
typedef enum { |
|
330 |
MAC_RX_FIFO = 1 |
|
331 |
} mac_resource_type_t; |
|
332 |
||
8275
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
333 |
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
|
334 |
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
|
335 |
|
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
336 |
typedef struct mac_intr_s { |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
337 |
mac_intr_handle_t mi_handle; |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
338 |
mac_intr_enable_t mi_enable; |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
339 |
mac_intr_disable_t mi_disable; |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
340 |
} mac_intr_t; |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
341 |
|
0 | 342 |
typedef struct mac_rx_fifo_s { |
343 |
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
|
344 |
mac_intr_t mrf_intr; |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
345 |
mac_receive_t mrf_receive; |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
346 |
void *mrf_rx_arg; |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
347 |
uint32_t mrf_flow_priority; |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
348 |
/* |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
349 |
* 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
|
350 |
* 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
|
351 |
* and get a squeue assigned on that CPU. |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
352 |
*/ |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
353 |
uint_t mrf_cpu_id; |
0 | 354 |
} mac_rx_fifo_t; |
355 |
||
8275
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
356 |
#define mrf_intr_handle mrf_intr.mi_handle |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
357 |
#define mrf_intr_enable mrf_intr.mi_enable |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
358 |
#define mrf_intr_disable mrf_intr.mi_disable |
56 | 359 |
|
0 | 360 |
typedef union mac_resource_u { |
361 |
mac_resource_type_t mr_type; |
|
362 |
mac_rx_fifo_t mr_fifo; |
|
363 |
} mac_resource_t; |
|
364 |
||
2311 | 365 |
typedef enum { |
366 |
MAC_ADDRTYPE_UNICAST, |
|
367 |
MAC_ADDRTYPE_MULTICAST, |
|
368 |
MAC_ADDRTYPE_BROADCAST |
|
369 |
} mac_addrtype_t; |
|
370 |
||
371 |
typedef struct mac_header_info_s { |
|
372 |
size_t mhi_hdrsize; |
|
373 |
size_t mhi_pktsize; |
|
374 |
const uint8_t *mhi_daddr; |
|
375 |
const uint8_t *mhi_saddr; |
|
376 |
uint32_t mhi_origsap; |
|
377 |
uint32_t mhi_bindsap; |
|
378 |
mac_addrtype_t mhi_dsttype; |
|
2760 | 379 |
uint16_t mhi_tci; |
8275
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
380 |
boolean_t mhi_istagged; |
2311 | 381 |
} mac_header_info_t; |
382 |
||
383 |
/* |
|
8275
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
384 |
* 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
|
385 |
* 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
|
386 |
* client directly. |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
387 |
*/ |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
388 |
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
|
389 |
mblk_t *, mac_header_info_t *); |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
390 |
|
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
391 |
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
|
392 |
typedef int (*mac_resource_bind_t)(void *, |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
393 |
mac_resource_handle_t, processorid_t); |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
394 |
typedef void (*mac_resource_remove_t)(void *, void *); |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
395 |
typedef void (*mac_resource_quiesce_t)(void *, void *); |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
396 |
typedef void (*mac_resource_restart_t)(void *, void *); |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
397 |
typedef int (*mac_resource_modify_t)(void *, void *, |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
398 |
mac_resource_t *); |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
399 |
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
|
400 |
void *); |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
401 |
|
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
402 |
/* |
2311 | 403 |
* MAC-Type plugin interfaces |
404 |
*/ |
|
405 |
||
406 |
typedef int (*mtops_addr_verify_t)(const void *, void *); |
|
407 |
typedef boolean_t (*mtops_sap_verify_t)(uint32_t, uint32_t *, void *); |
|
408 |
typedef mblk_t *(*mtops_header_t)(const void *, const void *, |
|
409 |
uint32_t, void *, mblk_t *, size_t); |
|
410 |
typedef int (*mtops_header_info_t)(mblk_t *, void *, |
|
411 |
mac_header_info_t *); |
|
412 |
typedef boolean_t (*mtops_pdata_verify_t)(void *, size_t); |
|
413 |
typedef mblk_t *(*mtops_header_modify_t)(mblk_t *, void *); |
|
4403 | 414 |
typedef void (*mtops_link_details_t)(char *, size_t, mac_handle_t, |
415 |
void *); |
|
2311 | 416 |
|
417 |
typedef struct mactype_ops_s { |
|
418 |
uint_t mtops_ops; |
|
419 |
/* |
|
420 |
* mtops_unicst_verify() returns 0 if the given address is a valid |
|
421 |
* unicast address, or a non-zero errno otherwise. |
|
422 |
*/ |
|
423 |
mtops_addr_verify_t mtops_unicst_verify; |
|
424 |
/* |
|
425 |
* mtops_multicst_verify() returns 0 if the given address is a |
|
426 |
* valid multicast address, or a non-zero errno otherwise. If the |
|
427 |
* media doesn't support multicast, ENOTSUP should be returned (for |
|
428 |
* example). |
|
429 |
*/ |
|
430 |
mtops_addr_verify_t mtops_multicst_verify; |
|
431 |
/* |
|
432 |
* mtops_sap_verify() returns B_TRUE if the given SAP is a valid |
|
433 |
* SAP value, or B_FALSE otherwise. |
|
434 |
*/ |
|
435 |
mtops_sap_verify_t mtops_sap_verify; |
|
436 |
/* |
|
437 |
* mtops_header() is used to allocate and construct a MAC header. |
|
438 |
*/ |
|
439 |
mtops_header_t mtops_header; |
|
440 |
/* |
|
441 |
* mtops_header_info() is used to gather information on a given MAC |
|
442 |
* header. |
|
443 |
*/ |
|
444 |
mtops_header_info_t mtops_header_info; |
|
445 |
/* |
|
446 |
* mtops_pdata_verify() is used to verify the validity of MAC |
|
447 |
* plugin data. It is called by mac_register() if the driver has |
|
448 |
* supplied MAC plugin data, and also by mac_pdata_update() when |
|
449 |
* drivers update the data. |
|
450 |
*/ |
|
451 |
mtops_pdata_verify_t mtops_pdata_verify; |
|
452 |
/* |
|
453 |
* mtops_header_cook() is an optional callback that converts (or |
|
454 |
* "cooks") the given raw header (as sent by a raw DLPI consumer) |
|
455 |
* into one that is appropriate to send down to the MAC driver. |
|
456 |
* Following the example above, an Ethernet header sent down by a |
|
457 |
* DLPI consumer would be converted to whatever header the MAC |
|
458 |
* driver expects. |
|
459 |
*/ |
|
460 |
mtops_header_modify_t mtops_header_cook; |
|
461 |
/* |
|
462 |
* mtops_header_uncook() is an optional callback that does the |
|
463 |
* opposite of mtops_header_cook(). It "uncooks" a given MAC |
|
464 |
* header (as received from the driver) for consumption by raw DLPI |
|
465 |
* consumers. For example, for a non-Ethernet plugin that wants |
|
466 |
* raw DLPI consumers to be fooled into thinking that the device |
|
467 |
* provides Ethernet access, this callback would modify the given |
|
468 |
* mblk_t such that the MAC header is converted to an Ethernet |
|
469 |
* header. |
|
470 |
*/ |
|
471 |
mtops_header_modify_t mtops_header_uncook; |
|
4403 | 472 |
/* |
473 |
* mtops_link_details() is an optional callback that provides |
|
474 |
* extended information about the link state. Its primary purpose |
|
475 |
* is to provide type-specific support for syslog contents on |
|
476 |
* link up events. If no implementation is provided, then a default |
|
477 |
* implementation will be used. |
|
478 |
*/ |
|
479 |
mtops_link_details_t mtops_link_details; |
|
2311 | 480 |
} mactype_ops_t; |
481 |
||
482 |
/* |
|
483 |
* mtops_ops exists for the plugin to enumerate the optional callback |
|
484 |
* entrypoints it has defined. This allows the mac module to define |
|
485 |
* additional plugin entrypoints in mactype_ops_t without breaking backward |
|
486 |
* compatibility with old plugins. |
|
487 |
*/ |
|
488 |
#define MTOPS_PDATA_VERIFY 0x001 |
|
489 |
#define MTOPS_HEADER_COOK 0x002 |
|
490 |
#define MTOPS_HEADER_UNCOOK 0x004 |
|
4403 | 491 |
#define MTOPS_LINK_DETAILS 0x008 |
2311 | 492 |
|
6512 | 493 |
/* |
494 |
* Provide mapping for legacy ndd ioctls relevant to that mactype. |
|
495 |
* Note that the ndd ioctls are obsolete, and may be removed in a future |
|
496 |
* release of Solaris. The ndd ioctls are not typically used in legacy |
|
497 |
* ethernet drivers. New datalink drivers of all link-types should use |
|
498 |
* dladm(1m) interfaces for administering tunables and not have to provide |
|
499 |
* a mapping. |
|
500 |
*/ |
|
501 |
typedef struct mac_ndd_mapping_s { |
|
502 |
char *mp_name; |
|
503 |
union { |
|
504 |
mac_prop_id_t u_id; |
|
505 |
uint_t u_kstat; |
|
506 |
} u_mp_id; |
|
507 |
long mp_minval; |
|
508 |
long mp_maxval; |
|
509 |
size_t mp_valsize; |
|
510 |
int mp_flags; |
|
511 |
} mac_ndd_mapping_t; |
|
512 |
||
513 |
#define mp_prop_id u_mp_id.u_id |
|
514 |
#define mp_kstat u_mp_id.u_kstat |
|
515 |
||
8275
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
516 |
typedef struct mac_stat_info_s { |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
517 |
uint_t msi_stat; |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
518 |
char *msi_name; |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
519 |
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
|
520 |
uint64_t msi_default; |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
521 |
} mac_stat_info_t; |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
522 |
|
2311 | 523 |
typedef struct mactype_register_s { |
524 |
uint_t mtr_version; /* set by mactype_alloc() */ |
|
525 |
const char *mtr_ident; |
|
526 |
mactype_ops_t *mtr_ops; |
|
527 |
uint_t mtr_mactype; |
|
3147 | 528 |
uint_t mtr_nativetype; |
2311 | 529 |
uint_t mtr_addrlen; |
530 |
uint8_t *mtr_brdcst_addr; |
|
531 |
mac_stat_info_t *mtr_stats; |
|
532 |
size_t mtr_statcount; |
|
6512 | 533 |
mac_ndd_mapping_t *mtr_mapping; |
534 |
size_t mtr_mappingcount; |
|
2311 | 535 |
} mactype_register_t; |
536 |
||
5903
df6aed881b11
PSARC 2007/429 Brussels - enhanced network driver configuration via dladm
sowmini
parents:
5895
diff
changeset
|
537 |
typedef struct mac_prop_s { |
df6aed881b11
PSARC 2007/429 Brussels - enhanced network driver configuration via dladm
sowmini
parents:
5895
diff
changeset
|
538 |
mac_prop_id_t mp_id; |
df6aed881b11
PSARC 2007/429 Brussels - enhanced network driver configuration via dladm
sowmini
parents:
5895
diff
changeset
|
539 |
char *mp_name; |
6512 | 540 |
uint_t mp_flags; |
5903
df6aed881b11
PSARC 2007/429 Brussels - enhanced network driver configuration via dladm
sowmini
parents:
5895
diff
changeset
|
541 |
} mac_prop_t; |
df6aed881b11
PSARC 2007/429 Brussels - enhanced network driver configuration via dladm
sowmini
parents:
5895
diff
changeset
|
542 |
|
0 | 543 |
/* |
8275
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
544 |
* Driver interface functions. |
0 | 545 |
*/ |
5895
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
546 |
extern int mac_open_by_linkid(datalink_id_t, |
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
547 |
mac_handle_t *); |
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
548 |
extern int mac_open_by_linkname(const char *, |
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
549 |
mac_handle_t *); |
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
550 |
extern const char *mac_name(mac_handle_t); |
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
551 |
extern minor_t mac_minor(mac_handle_t); |
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
552 |
extern minor_t mac_minor_hold(boolean_t); |
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
553 |
extern void mac_minor_rele(minor_t); |
8275
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
554 |
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
|
555 |
extern int mac_maxsdu_update(mac_handle_t, uint_t); |
0 | 556 |
|
2311 | 557 |
extern void mac_unicst_update(mac_handle_t, |
5895
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
558 |
const uint8_t *); |
2311 | 559 |
extern void mac_resource_update(mac_handle_t); |
8275
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
560 |
extern void mac_capab_update(mac_handle_t); |
2311 | 561 |
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
|
562 |
size_t); |
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
563 |
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
|
564 |
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
|
565 |
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
|
566 |
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
|
567 |
boolean_t); |
f251acdd9bdc
PSARC/2006/499 Clearview Nemo unification and vanity naming
yz147064
parents:
5733
diff
changeset
|
568 |
|
2311 | 569 |
extern mactype_register_t *mactype_alloc(uint_t); |
570 |
extern void mactype_free(mactype_register_t *); |
|
571 |
extern int mactype_register(mactype_register_t *); |
|
572 |
extern int mactype_unregister(const char *); |
|
8275
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
573 |
|
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
574 |
extern void mac_start_logusage(mac_logtype_t, uint_t); |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
575 |
extern void mac_stop_logusage(mac_logtype_t); |
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
576 |
|
7c223a798022
PSARC/2006/357 Crossbow - Network Virtualization and Resource Management
Eric Cheng
parents:
8118
diff
changeset
|
577 |
extern mac_handle_t mac_get_lower_mac_handle(mac_handle_t); |
0 | 578 |
|
8833
8adf20bc60e3
PSARC/2009/099 dladm show-usage modifications
Venugopal Iyer <Venu.Iyer@Sun.COM>
parents:
8275
diff
changeset
|
579 |
/* |
8adf20bc60e3
PSARC/2009/099 dladm show-usage modifications
Venugopal Iyer <Venu.Iyer@Sun.COM>
parents:
8275
diff
changeset
|
580 |
* 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
|
581 |
*/ |
8adf20bc60e3
PSARC/2009/099 dladm show-usage modifications
Venugopal Iyer <Venu.Iyer@Sun.COM>
parents:
8275
diff
changeset
|
582 |
|
8adf20bc60e3
PSARC/2009/099 dladm show-usage modifications
Venugopal Iyer <Venu.Iyer@Sun.COM>
parents:
8275
diff
changeset
|
583 |
#define MAC_PKT_HASH_L2 0x01 |
8adf20bc60e3
PSARC/2009/099 dladm show-usage modifications
Venugopal Iyer <Venu.Iyer@Sun.COM>
parents:
8275
diff
changeset
|
584 |
#define MAC_PKT_HASH_L3 0x02 |
8adf20bc60e3
PSARC/2009/099 dladm show-usage modifications
Venugopal Iyer <Venu.Iyer@Sun.COM>
parents:
8275
diff
changeset
|
585 |
#define MAC_PKT_HASH_L4 0x04 |
8adf20bc60e3
PSARC/2009/099 dladm show-usage modifications
Venugopal Iyer <Venu.Iyer@Sun.COM>
parents:
8275
diff
changeset
|
586 |
|
8adf20bc60e3
PSARC/2009/099 dladm show-usage modifications
Venugopal Iyer <Venu.Iyer@Sun.COM>
parents:
8275
diff
changeset
|
587 |
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
|
588 |
boolean_t); |
8adf20bc60e3
PSARC/2009/099 dladm show-usage modifications
Venugopal Iyer <Venu.Iyer@Sun.COM>
parents:
8275
diff
changeset
|
589 |
|
0 | 590 |
#endif /* _KERNEL */ |
591 |
||
592 |
#ifdef __cplusplus |
|
593 |
} |
|
594 |
#endif |
|
595 |
||
596 |
#endif /* _SYS_MAC_H */ |