xref: /titanic_51/usr/src/uts/common/sys/dlpi.h (revision 7380b00ccf9fc5638da98d756925bc6d6c002a42)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
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  */
21 /*
22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
27 /*	  All Rights Reserved	*/
28 
29 
30 /*
31  * Data Link Provider Interface, Version 2.0
32  * Refer to document: "STREAMS DLPI Spec", 800-6915-01.
33  */
34 
35 #ifndef	_SYS_DLPI_H
36 #define	_SYS_DLPI_H
37 
38 #include <sys/types.h>
39 #include <sys/stream.h>
40 #ifdef	__cplusplus
41 extern "C" {
42 #endif
43 
44 /*
45  * Sun additions.
46  */
47 #define	DLIOC		('D' << 8)
48 #define	DLIOCRAW	(DLIOC|1)	/* M_DATA "raw" mode */
49 #define	DLIOCNATIVE	(DLIOC|2)	/* Native traffic mode */
50 #define	DLIOCMARGININFO	(DLIOC|3)	/* margin size info */
51 #define	DLIOCIPNETINFO	(DLIOC|4)	/* ipnet header */
52 #define	DLIOCLOWLINK	(DLIOC|5)	/* low-level link up/down */
53 #define	DLIOCHDRINFO	(DLIOC|10)	/* IP fast-path */
54 #define	DL_IOC_HDR_INFO	DLIOCHDRINFO
55 
56 #define	DL_IPNETINFO_VERSION	0x1
57 
58 typedef struct dl_ipnetinfo {
59 	uint8_t		dli_version;	/* DL_IPNETINFO_* version */
60 	uint8_t		dli_ipver;	/* packet IP header version */
61 	uint16_t	dli_len;	/* length of dl_ipnetinfo_t */
62 	uint32_t	dli_pad;	/* alignment pad */
63 	uint64_t	dli_srczone; 	/* packet source zone ID (if any) */
64 	uint64_t	dli_dstzone;	/* packet dest zone ID (if any) */
65 } dl_ipnetinfo_t;
66 
67 /*
68  * DLPI revision definition history
69  */
70 #define	DL_CURRENT_VERSION	0x02	/* current version of dlpi */
71 #define	DL_VERSION_2		0x02	/* version of dlpi March 12, 1991 */
72 
73 /*
74  * Primitives for Local Management Services
75  */
76 #define	DL_INFO_REQ		0x00	/* Information Req */
77 #define	DL_INFO_ACK		0x03	/* Information Ack */
78 #define	DL_ATTACH_REQ		0x0b	/* Attach a PPA */
79 #define	DL_DETACH_REQ		0x0c	/* Detach a PPA */
80 #define	DL_BIND_REQ		0x01	/* Bind DLSAP address */
81 #define	DL_BIND_ACK		0x04	/* DLSAP address bound */
82 #define	DL_UNBIND_REQ		0x02	/* Unbind DLSAP address */
83 #define	DL_OK_ACK		0x06	/* Success acknowledgment */
84 #define	DL_ERROR_ACK		0x05	/* Error acknowledgment */
85 #define	DL_SUBS_BIND_REQ	0x1b	/* Bind Subsequent DLSAP address */
86 #define	DL_SUBS_BIND_ACK	0x1c	/* Subsequent DLSAP address bound */
87 #define	DL_SUBS_UNBIND_REQ	0x15	/* Subsequent unbind */
88 #define	DL_ENABMULTI_REQ	0x1d	/* Enable multicast addresses */
89 #define	DL_DISABMULTI_REQ	0x1e	/* Disable multicast addresses */
90 #define	DL_PROMISCON_REQ	0x1f	/* Turn on promiscuous mode */
91 #define	DL_PROMISCOFF_REQ	0x20	/* Turn off promiscuous mode */
92 
93 /*
94  * Solaris specific local management
95  */
96 #define	DL_NOTIFY_REQ		0x100	/* Enable notifications */
97 #define	DL_NOTIFY_ACK		0x101	/* Supported notifications */
98 #define	DL_NOTIFY_IND		0x102	/* Notification from provider */
99 #define	DL_AGGR_REQ		0x103	/* Enable link aggregation */
100 #define	DL_AGGR_IND		0x104	/* Result from link aggregation */
101 #define	DL_UNAGGR_REQ		0x105	/* Disable link aggregation */
102 #define	DL_CAPABILITY_REQ	0x110	/* Capability request */
103 #define	DL_CAPABILITY_ACK	0x111	/* Capability ack */
104 #define	DL_CONTROL_REQ		0x112	/* Device specific control request */
105 #define	DL_CONTROL_ACK		0x113	/* Device specific control ack */
106 #define	DL_PASSIVE_REQ		0x114	/* Allow access to aggregated link */
107 #define	DL_INTR_MODE_REQ	0x115	/* Request Rx processing in INTR mode */
108 #define	DL_NOTIFY_CONF		0x116	/* Notification from upstream */
109 
110 /*
111  * Primitives used for Connectionless Service
112  */
113 #define	DL_UNITDATA_REQ		0x07	/* datagram send request */
114 #define	DL_UNITDATA_IND		0x08	/* datagram receive indication */
115 #define	DL_UDERROR_IND		0x09	/* datagram error indication */
116 #define	DL_UDQOS_REQ		0x0a	/* set QOS for subsequent datagrams */
117 
118 /*
119  * Primitives used for Connection-Oriented Service
120  */
121 #define	DL_CONNECT_REQ		0x0d	/* Connect request */
122 #define	DL_CONNECT_IND		0x0e	/* Incoming connect indication */
123 #define	DL_CONNECT_RES		0x0f	/* Accept previous connect indication */
124 #define	DL_CONNECT_CON		0x10	/* Connection established */
125 
126 #define	DL_TOKEN_REQ		0x11	/* Passoff token request */
127 #define	DL_TOKEN_ACK		0x12	/* Passoff token ack */
128 
129 #define	DL_DISCONNECT_REQ	0x13	/* Disconnect request */
130 #define	DL_DISCONNECT_IND	0x14	/* Disconnect indication */
131 
132 #define	DL_RESET_REQ		0x17	/* Reset service request */
133 #define	DL_RESET_IND		0x18	/* Incoming reset indication */
134 #define	DL_RESET_RES		0x19	/* Complete reset processing */
135 #define	DL_RESET_CON		0x1a	/* Reset processing complete */
136 
137 /*
138  *  Primitives used for Acknowledged Connectionless Service
139  */
140 
141 #define	DL_DATA_ACK_REQ		0x21	/* data unit transmission request */
142 #define	DL_DATA_ACK_IND		0x22	/* Arrival of a command PDU */
143 #define	DL_DATA_ACK_STATUS_IND	0x23	/* Status indication of DATA_ACK_REQ */
144 #define	DL_REPLY_REQ		0x24	/* Request a DLSDU from the remote */
145 #define	DL_REPLY_IND		0x25	/* Arrival of a command PDU */
146 #define	DL_REPLY_STATUS_IND	0x26	/* Status indication of REPLY_REQ */
147 #define	DL_REPLY_UPDATE_REQ	0x27	/* Hold a DLSDU for transmission */
148 #define	DL_REPLY_UPDATE_STATUS_IND	0x28 /* Status of REPLY_UPDATE req */
149 
150 /*
151  * Primitives used for XID and TEST operations
152  */
153 
154 #define	DL_XID_REQ	0x29		/* Request to send an XID PDU */
155 #define	DL_XID_IND	0x2a		/* Arrival of an XID PDU */
156 #define	DL_XID_RES	0x2b		/* request to send a response XID PDU */
157 #define	DL_XID_CON	0x2c		/* Arrival of a response XID PDU */
158 #define	DL_TEST_REQ	0x2d		/* TEST command request */
159 #define	DL_TEST_IND	0x2e		/* TEST response indication */
160 #define	DL_TEST_RES	0x2f		/* TEST response */
161 #define	DL_TEST_CON	0x30		/* TEST Confirmation */
162 
163 /*
164  * Primitives to get and set the physical address, and to get
165  * Statistics
166  */
167 
168 #define	DL_PHYS_ADDR_REQ	0x31	/* Request to get physical addr */
169 #define	DL_PHYS_ADDR_ACK	0x32	/* Return physical addr */
170 #define	DL_SET_PHYS_ADDR_REQ	0x33	/* set physical addr */
171 #define	DL_GET_STATISTICS_REQ	0x34	/* Request to get statistics */
172 #define	DL_GET_STATISTICS_ACK	0x35	/* Return statistics */
173 
174 /*
175  * Invalid primitive
176  */
177 
178 #define	DL_PRIM_INVAL		0xffff	/* Invalid DL primitive value */
179 
180 /*
181  * DLPI interface states
182  */
183 #define	DL_UNATTACHED		0x04	/* PPA not attached */
184 #define	DL_ATTACH_PENDING	0x05	/* Waiting ack of DL_ATTACH_REQ */
185 #define	DL_DETACH_PENDING	0x06	/* Waiting ack of DL_DETACH_REQ */
186 #define	DL_UNBOUND		0x00	/* PPA attached */
187 #define	DL_BIND_PENDING		0x01	/* Waiting ack of DL_BIND_REQ */
188 #define	DL_UNBIND_PENDING	0x02	/* Waiting ack of DL_UNBIND_REQ */
189 #define	DL_IDLE			0x03	/* DLSAP bound, awaiting use */
190 #define	DL_UDQOS_PENDING	0x07	/* Waiting ack of DL_UDQOS_REQ */
191 #define	DL_OUTCON_PENDING	0x08	/* awaiting DL_CONN_CON */
192 #define	DL_INCON_PENDING	0x09	/* awaiting DL_CONN_RES */
193 #define	DL_CONN_RES_PENDING	0x0a	/* Waiting ack of DL_CONNECT_RES */
194 #define	DL_DATAXFER		0x0b	/* connection-oriented data transfer */
195 #define	DL_USER_RESET_PENDING	0x0c	/* awaiting DL_RESET_CON */
196 #define	DL_PROV_RESET_PENDING	0x0d	/* awaiting DL_RESET_RES */
197 #define	DL_RESET_RES_PENDING	0x0e	/* Waiting ack of DL_RESET_RES */
198 #define	DL_DISCON8_PENDING	0x0f	/* Waiting ack of DL_DISC_REQ */
199 #define	DL_DISCON9_PENDING	0x10	/* Waiting ack of DL_DISC_REQ */
200 #define	DL_DISCON11_PENDING	0x11	/* Waiting ack of DL_DISC_REQ */
201 #define	DL_DISCON12_PENDING	0x12	/* Waiting ack of DL_DISC_REQ */
202 #define	DL_DISCON13_PENDING	0x13	/* Waiting ack of DL_DISC_REQ */
203 #define	DL_SUBS_BIND_PND	0x14	/* Waiting ack of DL_SUBS_BIND_REQ */
204 #define	DL_SUBS_UNBIND_PND	0x15	/* Waiting ack of DL_SUBS_UNBIND_REQ */
205 
206 
207 /*
208  * DL_ERROR_ACK error return values
209  */
210 #define	DL_ACCESS	0x02	/* Improper permissions for request */
211 #define	DL_BADADDR	0x01	/* DLSAP addr in improper format or invalid */
212 #define	DL_BADCORR	0x05	/* Seq number not from outstand DL_CONN_IND */
213 #define	DL_BADDATA	0x06	/* User data exceeded provider limit */
214 #define	DL_BADPPA	0x08	/* Specified PPA was invalid */
215 #define	DL_BADPRIM	0x09	/* Primitive received not known by provider */
216 #define	DL_BADQOSPARAM	0x0a	/* QOS parameters contained invalid values */
217 #define	DL_BADQOSTYPE	0x0b	/* QOS structure type is unknown/unsupported */
218 #define	DL_BADSAP	0x00	/* Bad LSAP selector */
219 #define	DL_BADTOKEN	0x0c	/* Token used not an active stream */
220 #define	DL_BOUND	0x0d	/* Attempted second bind with dl_max_conind */
221 #define	DL_INITFAILED	0x0e	/* Physical Link initialization failed */
222 #define	DL_NOADDR	0x0f	/* Provider couldn't allocate alt. address */
223 #define	DL_NOTINIT	0x10	/* Physical Link not initialized */
224 #define	DL_OUTSTATE	0x03	/* Primitive issued in improper state */
225 #define	DL_SYSERR	0x04	/* UNIX system error occurred */
226 #define	DL_UNSUPPORTED	0x07	/* Requested serv. not supplied by provider */
227 #define	DL_UNDELIVERABLE 0x11	/* Previous data unit could not be delivered */
228 #define	DL_NOTSUPPORTED  0x12	/* Primitive is known but not supported */
229 #define	DL_TOOMANY	0x13	/* limit exceeded	*/
230 #define	DL_NOTENAB	0x14	/* Promiscuous mode not enabled */
231 #define	DL_BUSY		0x15	/* Other streams for PPA in post-attached */
232 
233 #define	DL_NOAUTO	0x16	/* Automatic handling XID&TEST not supported */
234 #define	DL_NOXIDAUTO	0x17    /* Automatic handling of XID not supported */
235 #define	DL_NOTESTAUTO	0x18	/* Automatic handling of TEST not supported */
236 #define	DL_XIDAUTO	0x19	/* Automatic handling of XID response */
237 #define	DL_TESTAUTO	0x1a	/* Automatic handling of TEST response */
238 #define	DL_PENDING	0x1b	/* pending outstanding connect indications */
239 
240 /*
241  * DLPI media types supported
242  */
243 #define	DL_CSMACD	0x0	/* IEEE 802.3 CSMA/CD network */
244 #define	DL_TPB		0x1	/* IEEE 802.4 Token Passing Bus */
245 #define	DL_TPR		0x2	/* IEEE 802.5 Token Passing Ring */
246 #define	DL_METRO	0x3	/* IEEE 802.6 Metro Net */
247 #define	DL_ETHER	0x4	/* Ethernet Bus */
248 #define	DL_HDLC		0x05	/* ISO HDLC protocol support */
249 #define	DL_CHAR		0x06	/* Character Synchronous protocol support */
250 #define	DL_CTCA		0x07	/* IBM Channel-to-Channel Adapter */
251 #define	DL_FDDI		0x08	/* Fiber Distributed data interface */
252 #define	DL_FC		0x10	/* Fibre Channel interface */
253 #define	DL_ATM		0x11	/* ATM */
254 #define	DL_IPATM	0x12	/* ATM Classical IP interface */
255 #define	DL_X25		0x13	/* X.25 LAPB interface */
256 #define	DL_ISDN		0x14	/* ISDN interface */
257 #define	DL_HIPPI	0x15	/* HIPPI interface */
258 #define	DL_100VG	0x16	/* 100 Based VG Ethernet */
259 #define	DL_100VGTPR	0x17	/* 100 Based VG Token Ring */
260 #define	DL_ETH_CSMA	0x18	/* ISO 8802/3 and Ethernet */
261 #define	DL_100BT	0x19	/* 100 Base T */
262 #define	DL_IB		0x1a	/* Infiniband */
263 #define	DL_FRAME	0x0a	/* Frame Relay LAPF */
264 #define	DL_MPFRAME	0x0b	/* Multi-protocol over Frame Relay */
265 #define	DL_ASYNC	0x0c	/* Character Asynchronous Protocol */
266 #define	DL_IPX25	0x0d	/* X.25 Classical IP interface */
267 #define	DL_LOOP		0x0e	/* software loopback */
268 #define	DL_OTHER	0x09	/* Any other medium not listed above */
269 /*
270  * Private media types.  These must be above the value 0x80000000 as
271  * stated in the DLPI specification.  NOTE: The SUNW_ prefix is used
272  * to denote synthetic DLPI types that are internal to the stack.
273  */
274 #define	DL_IPV4		0x80000001ul	/* IPv4 Tunnel Link */
275 #define	DL_IPV6		0x80000002ul	/* IPv6 Tunnel Link */
276 #define	SUNW_DL_VNI	0x80000003ul	/* Virtual network interface */
277 #define	DL_WIFI		0x80000004ul	/* IEEE 802.11 */
278 #define	DL_IPNET	0x80000005ul	/* ipnet(7D) link */
279 #define	SUNW_DL_IPMP	0x80000006ul	/* IPMP stub interface */
280 #define	DL_6TO4		0x80000007ul	/* 6to4 Tunnel Link */
281 
282 /*
283  * DLPI provider service supported.
284  * These must be allowed to be bitwise-OR for dl_service_mode in
285  * DL_INFO_ACK.
286  */
287 #define	DL_CODLS	0x01	/* support connection-oriented service */
288 #define	DL_CLDLS	0x02	/* support connectionless data link service */
289 #define	DL_ACLDLS	0x04	/* support acknowledged connectionless serv. */
290 
291 
292 /*
293  * DLPI provider style.
294  * The DLPI provider style which determines whether a provider
295  * requires a DL_ATTACH_REQ to inform the provider which PPA
296  * user messages should be sent/received on.
297  */
298 #define	DL_STYLE1	0x0500	/* PPA is implicitly bound by open(2) */
299 #define	DL_STYLE2	0x0501	/* PPA must be expl. bound via DL_ATTACH_REQ */
300 
301 
302 /*
303  * DLPI Originator for Disconnect and Resets
304  */
305 #define	DL_PROVIDER	0x0700
306 #define	DL_USER		0x0701
307 
308 /*
309  * DLPI Disconnect Reasons
310  */
311 #define	DL_CONREJ_DEST_UNKNOWN			0x0800
312 #define	DL_CONREJ_DEST_UNREACH_PERMANENT	0x0801
313 #define	DL_CONREJ_DEST_UNREACH_TRANSIENT	0x0802
314 #define	DL_CONREJ_QOS_UNAVAIL_PERMANENT		0x0803
315 #define	DL_CONREJ_QOS_UNAVAIL_TRANSIENT		0x0804
316 #define	DL_CONREJ_PERMANENT_COND		0x0805
317 #define	DL_CONREJ_TRANSIENT_COND		0x0806
318 #define	DL_DISC_ABNORMAL_CONDITION		0x0807
319 #define	DL_DISC_NORMAL_CONDITION		0x0808
320 #define	DL_DISC_PERMANENT_CONDITION		0x0809
321 #define	DL_DISC_TRANSIENT_CONDITION		0x080a
322 #define	DL_DISC_UNSPECIFIED			0x080b
323 
324 /*
325  * DLPI Reset Reasons
326  */
327 #define	DL_RESET_FLOW_CONTROL	0x0900
328 #define	DL_RESET_LINK_ERROR	0x0901
329 #define	DL_RESET_RESYNCH	0x0902
330 
331 /*
332  * DLPI status values for acknowledged connectionless data transfer
333  */
334 #define	DL_CMD_MASK	0x0f	/* mask for command portion of status */
335 #define	DL_CMD_OK	0x00	/* Command Accepted */
336 #define	DL_CMD_RS	0x01	/* Unimplemented or inactivated service */
337 #define	DL_CMD_UE	0x05	/* Data Link User interface error */
338 #define	DL_CMD_PE	0x06	/* Protocol error */
339 #define	DL_CMD_IP	0x07	/* Permanent implementation dependent error */
340 #define	DL_CMD_UN	0x09	/* Resources temporarily unavailable */
341 #define	DL_CMD_IT	0x0f	/* Temporary implementation dependent error */
342 #define	DL_RSP_MASK	0xf0	/* mask for response portion of status */
343 #define	DL_RSP_OK	0x00	/* Response DLSDU present */
344 #define	DL_RSP_RS	0x10	/* Unimplemented or inactivated service */
345 #define	DL_RSP_NE	0x30	/* Response DLSDU never submitted */
346 #define	DL_RSP_NR	0x40	/* Response DLSDU not requested */
347 #define	DL_RSP_UE	0x50	/* Data Link User interface error */
348 #define	DL_RSP_IP	0x70	/* Permanent implementation dependent error */
349 #define	DL_RSP_UN	0x90	/* Resources temporarily unavailable */
350 #define	DL_RSP_IT	0xf0	/* Temporary implementation dependent error */
351 
352 /*
353  * Service Class values for acknowledged connectionless data transfer
354  */
355 #define	DL_RQST_RSP	0x01	/* Use acknowledge capability in MAC sublayer */
356 #define	DL_RQST_NORSP	0x02	/* No acknowledgement service requested */
357 
358 /*
359  * DLPI address type definition
360  */
361 #define	DL_FACT_PHYS_ADDR	0x01	/* factory physical address */
362 #define	DL_CURR_PHYS_ADDR	0x02	/* current physical address */
363 #define	DL_IPV6_TOKEN		0x03	/* IPv6 interface token */
364 #define	DL_IPV6_LINK_LAYER_ADDR	0x04	/* Neighbor Discovery format */
365 #define	DL_CURR_DEST_ADDR	0x05	/* current destination address */
366 
367 /*
368  * DLPI flag definitions
369  */
370 #define	DL_POLL_FINAL	0x01		/* indicates poll/final bit set */
371 
372 /*
373  *	XID and TEST responses supported by the provider
374  */
375 #define	DL_AUTO_XID	0x01		/* provider will respond to XID */
376 #define	DL_AUTO_TEST	0x02		/* provider will respond to TEST */
377 
378 /*
379  * Subsequent bind type
380  */
381 #define	DL_PEER_BIND	0x01		/* subsequent bind on a peer addr */
382 #define	DL_HIERARCHICAL_BIND	0x02	/* subs_bind on a hierarchical addr */
383 
384 /*
385  * DLPI promiscuous mode definitions
386  */
387 #define	DL_PROMISC_PHYS		0x01	/* promiscuous mode at phys level */
388 #define	DL_PROMISC_SAP		0x02	/* promiscuous mode at sap level */
389 #define	DL_PROMISC_MULTI	0x03	/* promiscuous mode for multicast */
390 
391 /*
392  * DLPI notification codes for DL_NOTIFY_REQ primitives.
393  * Bit-wise distinct since DL_NOTIFY_REQ and DL_NOTIFY_ACK carry multiple
394  * notification codes.
395  */
396 #define	DL_NOTE_PHYS_ADDR	0x0001	/* Physical address change */
397 #define	DL_NOTE_PROMISC_ON_PHYS	0x0002	/* DL_PROMISC_PHYS set on ppa */
398 #define	DL_NOTE_PROMISC_OFF_PHYS 0x0004	/* DL_PROMISC_PHYS cleared on ppa */
399 #define	DL_NOTE_LINK_DOWN	0x0008	/* Link down */
400 #define	DL_NOTE_LINK_UP		0x0010	/* Link up */
401 #define	DL_NOTE_AGGR_AVAIL	0x0020	/* Link aggregation is available */
402 #define	DL_NOTE_AGGR_UNAVAIL	0x0040	/* Link aggregation is not available */
403 #define	DL_NOTE_SDU_SIZE	0x0080	/* New SDU size, global or per addr */
404 #define	DL_NOTE_SPEED		0x0100	/* Approximate link speed */
405 #define	DL_NOTE_FASTPATH_FLUSH	0x0200	/* Fast Path info changes */
406 #define	DL_NOTE_CAPAB_RENEG	0x0400	/* Initiate capability renegotiation */
407 #define	DL_NOTE_REPLUMB		0x0800	/* Inform the link to replumb */
408 
409 /*
410  * DLPI notification codes for DL_NOTIFY_CONF primitives.
411  */
412 #define	DL_NOTE_REPLUMB_DONE	0x0001	/* Indicate replumb has done */
413 
414 /*
415  * DLPI Quality Of Service definition for use in QOS structure definitions.
416  * The QOS structures are used in connection establishment, DL_INFO_ACK,
417  * and setting connectionless QOS values.
418  */
419 
420 /*
421  * Throughput
422  *
423  * This parameter is specified for both directions.
424  */
425 typedef struct {
426 	t_scalar_t	dl_target_value;	/* bits/second desired */
427 	t_scalar_t	dl_accept_value;	/* min. ok bits/second */
428 } dl_through_t;
429 
430 /*
431  * transit delay specification
432  *
433  * This parameter is specified for both directions.
434  * expressed in milliseconds assuming a DLSDU size of 128 octets.
435  * The scaling of the value to the current DLSDU size is provider dependent.
436  */
437 typedef struct {
438 	t_scalar_t	dl_target_value;	/* desired value of service */
439 	t_scalar_t	dl_accept_value;	/* min. ok value of service */
440 } dl_transdelay_t;
441 
442 /*
443  * priority specification
444  * priority range is 0-100, with 0 being highest value.
445  */
446 typedef struct {
447 	t_scalar_t	dl_min;
448 	t_scalar_t	dl_max;
449 } dl_priority_t;
450 
451 
452 /*
453  * protection specification
454  *
455  */
456 #define	DL_NONE			0x0B01	/* no protection supplied */
457 #define	DL_MONITOR		0x0B02	/* prot. from passive monit. */
458 #define	DL_MAXIMUM		0x0B03	/* prot. from modification, replay, */
459 					/* addition, or deletion */
460 
461 typedef struct {
462 	t_scalar_t	dl_min;
463 	t_scalar_t	dl_max;
464 } dl_protect_t;
465 
466 
467 /*
468  * Resilience specification
469  * probabilities are scaled by a factor of 10,000 with a time interval
470  * of 10,000 seconds.
471  */
472 typedef struct {
473 	t_scalar_t	dl_disc_prob;	/* prob. of provider init DISC */
474 	t_scalar_t	dl_reset_prob;	/* prob. of provider init RESET */
475 } dl_resilience_t;
476 
477 
478 /*
479  * QOS type definition to be used for negotiation with the
480  * remote end of a connection, or a connectionless unitdata request.
481  * There are two type definitions to handle the negotiation
482  * process at connection establishment. The typedef dl_qos_range_t
483  * is used to present a range for parameters. This is used
484  * in the DL_CONNECT_REQ and DL_CONNECT_IND messages. The typedef
485  * dl_qos_sel_t is used to select a specific value for the QOS
486  * parameters. This is used in the DL_CONNECT_RES, DL_CONNECT_CON,
487  * and DL_INFO_ACK messages to define the selected QOS parameters
488  * for a connection.
489  *
490  * NOTE
491  *	A DataLink provider which has unknown values for any of the fields
492  *	will use a value of DL_UNKNOWN for all values in the fields.
493  *
494  * NOTE
495  *	A QOS parameter value of DL_QOS_DONT_CARE informs the DLS
496  *	provider the user requesting this value doesn't care
497  *	what the QOS parameter is set to. This value becomes the
498  *	least possible value in the range of QOS parameters.
499  *	The order of the QOS parameter range is then:
500  *
501  *		DL_QOS_DONT_CARE < 0 < MAXIMUM QOS VALUE
502  */
503 #define	DL_UNKNOWN		-1
504 #define	DL_QOS_DONT_CARE	-2
505 
506 /*
507  * Every QOS structure has the first 4 bytes containing a type
508  * field, denoting the definition of the rest of the structure.
509  * This is used in the same manner has the dl_primitive variable
510  * is in messages.
511  *
512  * The following list is the defined QOS structure type values and structures.
513  */
514 #define	DL_QOS_CO_RANGE1	0x0101	/* CO QOS range struct. */
515 #define	DL_QOS_CO_SEL1		0x0102	/* CO QOS selection structure */
516 #define	DL_QOS_CL_RANGE1	0x0103	/* CL QOS range struct. */
517 #define	DL_QOS_CL_SEL1		0x0104	/* CL QOS selection */
518 
519 typedef struct {
520 	t_uscalar_t	dl_qos_type;
521 	dl_through_t	dl_rcv_throughput;	/* desired and accep. */
522 	dl_transdelay_t	dl_rcv_trans_delay;	/* desired and accep. */
523 	dl_through_t	dl_xmt_throughput;
524 	dl_transdelay_t	dl_xmt_trans_delay;
525 	dl_priority_t	dl_priority;		/* min and max values */
526 	dl_protect_t	dl_protection;		/* min and max values */
527 	t_scalar_t	dl_residual_error;
528 	dl_resilience_t	dl_resilience;
529 }	dl_qos_co_range1_t;
530 
531 typedef struct {
532 	t_uscalar_t	dl_qos_type;
533 	t_scalar_t	dl_rcv_throughput;
534 	t_scalar_t	dl_rcv_trans_delay;
535 	t_scalar_t	dl_xmt_throughput;
536 	t_scalar_t	dl_xmt_trans_delay;
537 	t_scalar_t	dl_priority;
538 	t_scalar_t	dl_protection;
539 	t_scalar_t	dl_residual_error;
540 	dl_resilience_t	dl_resilience;
541 }	dl_qos_co_sel1_t;
542 
543 typedef struct {
544 	t_uscalar_t	dl_qos_type;
545 	dl_transdelay_t	dl_trans_delay;
546 	dl_priority_t	dl_priority;
547 	dl_protect_t	dl_protection;
548 	t_scalar_t	dl_residual_error;
549 }	dl_qos_cl_range1_t;
550 
551 typedef struct {
552 	t_uscalar_t	dl_qos_type;
553 	t_scalar_t	dl_trans_delay;
554 	t_scalar_t	dl_priority;
555 	t_scalar_t	dl_protection;
556 	t_scalar_t	dl_residual_error;
557 }	dl_qos_cl_sel1_t;
558 
559 union	DL_qos_types {
560 	t_uscalar_t		dl_qos_type;
561 	dl_qos_co_range1_t	qos_co_range1;
562 	dl_qos_co_sel1_t	qos_co_sel1;
563 	dl_qos_cl_range1_t	qos_cl_range1;
564 	dl_qos_cl_sel1_t	qos_cl_sel1;
565 };
566 
567 /*
568  *    Solaris specific structures and definitions.
569  */
570 
571 /*
572  * The following are the capability types and structures used by the
573  * the DL_CAPABILITY_REQ and DL_CAPABILITY_ACK primitives.
574  *
575  * These primitives are used both to determine the set of capabilities in
576  * the DLS provider and also to turn on and off specific capabilities.
577  * The response is a DL_CAPABILITY_ACK or DL_ERROR_ACK.
578  *
579  * DL_CAPABILITY_REQ can either be empty (i.e. dl_sub_length is zero) which
580  * is a request for the driver to return all capabilities. Otherwise, the
581  * DL_CAPABILITY_REQ contains the capabilities the DLS user wants to use and
582  * their settings.
583  *
584  * DL_CAPABILITY_ACK contains the capabilities that the DLS provider can
585  * support modified based on what was listed in the request. If a
586  * capability was included in the request then the information returned
587  * in the ack might be modified based on the information in the request.
588  */
589 
590 #define	DL_CAPAB_ID_WRAPPER	0x00	/* Module ID wrapper structure */
591 					/* dl_data is dl_capab_id_t */
592 #define	DL_CAPAB_HCKSUM		0x01	/* Checksum offload */
593 					/* dl_data is dl_capab_hcksum_t */
594 #define	DL_CAPAB_IPSEC_AH	0x02	/* IPsec AH acceleration */
595 					/* dl_data is dl_capab_ipsec_t */
596 #define	DL_CAPAB_IPSEC_ESP	0x03	/* IPsec ESP acceleration */
597 					/* dl_data is dl_capab_ipsec_t */
598 #define	DL_CAPAB_MDT		0x04	/* Multidata Transmit capability */
599 					/* dl_data is dl_capab_mdt_t */
600 #define	DL_CAPAB_ZEROCOPY	0x05	/* Zero-copy capability */
601 					/* dl_data is dl_capab_zerocopy_t */
602 #define	DL_CAPAB_DLD		0x06	/* dld capability */
603 					/* dl_data is dl_capab_dld_t */
604 
605 typedef struct {
606 	t_uscalar_t	dl_cap;		/* capability type */
607 	t_uscalar_t	dl_length;	/* length of data following */
608 	/* Followed by zero or more bytes of dl_data */
609 } dl_capability_sub_t;
610 
611 /*
612  * Definitions and structures needed for DL_CONTROL_REQ and DL_CONTROL_ACK
613  * primitives.
614  * Extensible message to send down control information to the DLS provider.
615  * The response is a DL_CONTROL_ACK or DL_ERROR_ACK.
616  *
617  * Different types of control operations will define different format for the
618  * key and data fields. ADD requires key and data fields; if the <type, key>
619  * matches an already existing entry a DL_ERROR_ACK will be returned. DELETE
620  * requires a key field; if the <type, key> does not exist, a DL_ERROR_ACK
621  * will be returned. FLUSH requires neither a key nor data; it
622  * unconditionally removes all entries for the specified type. GET requires a
623  * key field; the get operation returns the data for the <type, key>. If
624  * <type, key> doesn't exist a DL_ERROR_ACK is returned. UPDATE requires key
625  * and data fields; if <type, key> doesn't exist a DL_ERROR_ACK is returned.
626  */
627 
628 /*
629  * Control operations
630  */
631 #define	DL_CO_ADD	0x01	/* Add new entry matching for <type,key> */
632 #define	DL_CO_DELETE	0x02	/* Delete the entry matching <type,key> */
633 #define	DL_CO_FLUSH	0x03	/* Purge all entries of <type> */
634 #define	DL_CO_GET	0x04	/* Get the data for the <type,key> */
635 #define	DL_CO_UPDATE	0x05	/* Update the data for <type,key> */
636 #define	DL_CO_SET	0x06	/* Add or update as appropriate */
637 
638 /*
639  * Control types (dl_type field of dl_control_req_t and dl_control_ack_t)
640  */
641 #define	DL_CT_IPSEC_AH	0x01	/* AH; key=spi,dest_addr; */
642 				/* data=keying material */
643 #define	DL_CT_IPSEC_ESP	0x02	/* ESP; key=spi,des_taddr; */
644 				/* data=keying material */
645 
646 /*
647  * Module ID token to be included in new sub-capability structures.
648  * Existing sub-capabilities lacking an identification token, e.g. IPSEC
649  * hardware acceleration, need to be encapsulated within the ID sub-
650  * capability.  Access to this structure must be done through
651  * dlcapab{set,check}qid().
652  */
653 typedef struct {
654 	t_uscalar_t	mid[4];		/* private fields */
655 } dl_mid_t;
656 
657 /*
658  * Module ID wrapper (follows dl_capability_sub_t)
659  */
660 typedef struct {
661 	dl_mid_t		id_mid;		/* module ID token */
662 	dl_capability_sub_t	id_subcap;	/* sub-capability */
663 } dl_capab_id_t;
664 
665 /*
666  * Multidata Transmit sub-capability (follows dl_capability_sub_t)
667  */
668 typedef struct {
669 	t_uscalar_t	mdt_version;	/* interface version */
670 	t_uscalar_t	mdt_flags;	/* flags */
671 	t_uscalar_t	mdt_hdr_head;	/* minimum leading header space */
672 	t_uscalar_t	mdt_hdr_tail;	/* minimum trailing header space */
673 	t_uscalar_t	mdt_max_pld;	/* maximum doable payload buffers */
674 	t_uscalar_t	mdt_span_limit;	/* scatter-gather descriptor limit */
675 	dl_mid_t	mdt_mid;	/* module ID token */
676 } dl_capab_mdt_t;
677 
678 /*
679  * Multidata Transmit revision definition history
680  */
681 #define	MDT_CURRENT_VERSION	0x02
682 #define	MDT_VERSION_2		0x02
683 
684 /*
685  * mdt_flags values
686  */
687 #define	DL_CAPAB_MDT_ENABLE	0x01	/* enable Multidata Transmit */
688 
689 /*
690  * DL_CAPAB_HCKSUM
691  * Used for negotiating different flavors of checksum offload
692  * capabilities.
693  */
694 typedef struct {
695 	t_uscalar_t	hcksum_version;	/* version of data following */
696 	t_uscalar_t	hcksum_txflags;	/* capabilities on transmit */
697 	dl_mid_t	hcksum_mid;		/* module ID */
698 } dl_capab_hcksum_t;
699 
700 /*
701  * DL_CAPAB_HCKSUM  revision definition history
702  */
703 #define	HCKSUM_CURRENT_VERSION	0x01
704 #define	HCKSUM_VERSION_1	0x01
705 
706 /*
707  * Values for dl_txflags
708  */
709 #define	HCKSUM_ENABLE		0x01	/* Set to enable hardware checksum */
710 					/* capability */
711 #define	HCKSUM_INET_PARTIAL	0x02	/* Partial 1's complement checksum */
712 					/* ability */
713 #define	HCKSUM_INET_FULL_V4	0x04	/* Full 1's complement checksum */
714 					/* ability for IPv4 packets. */
715 #define	HCKSUM_INET_FULL_V6	0x08	/* Full 1's complement checksum */
716 					/* ability for IPv6 packets. */
717 #define	HCKSUM_IPHDRCKSUM	0x10	/* IPv4 Header checksum offload */
718 					/* capability */
719 #ifdef _KERNEL
720 
721 /*
722  * The DL_CAPAB_DLD capability enables the capabilities of gldv3-based drivers
723  * to be negotiated using a function call (dld_capab) instead of using streams.
724  */
725 typedef struct dl_capab_dld_s {
726 	t_uscalar_t		dld_version;
727 	t_uscalar_t		dld_flags;
728 
729 	/* DLD provided information */
730 	uintptr_t		dld_capab;
731 	uintptr_t		dld_capab_handle;
732 	dl_mid_t		dld_mid;	/* module ID */
733 } dl_capab_dld_t;
734 
735 #define	DL_CAPAB_DLD_ENABLE	0x00000001
736 #define	DLD_VERSION_1		1
737 #define	DLD_CURRENT_VERSION	DLD_VERSION_1
738 
739 #endif /* _KERNEL */
740 
741 /*
742  * Zero-copy sub-capability (follows dl_capability_sub_t)
743  */
744 typedef struct {
745 	t_uscalar_t	zerocopy_version;	/* interface version */
746 	t_uscalar_t	zerocopy_flags;		/* capability flags */
747 	t_uscalar_t	reserved[9];		/* reserved fields */
748 	dl_mid_t	zerocopy_mid;		/* module ID */
749 } dl_capab_zerocopy_t;
750 
751 /*
752  * Zero-copy revision definition history
753  */
754 #define	ZEROCOPY_CURRENT_VERSION	0x01
755 #define	ZEROCOPY_VERSION_1		0x01
756 
757 /*
758  * Currently supported values of zerocopy_flags
759  */
760 #define	DL_CAPAB_VMSAFE_MEM		0x01	/* Driver is zero-copy safe */
761 						/* wrt VM named buffers on */
762 						/* transmit */
763 
764 /*
765  * DLPI interface primitive definitions.
766  *
767  * Each primitive is sent as a stream message.  It is possible that
768  * the messages may be viewed as a sequence of bytes that have the
769  * following form without any padding. The structure definition
770  * of the following messages may have to change depending on the
771  * underlying hardware architecture and crossing of a hardware
772  * boundary with a different hardware architecture.
773  *
774  * Fields in the primitives having a name of the form
775  * dl_reserved cannot be used and have the value of
776  * binary zero, no bits turned on.
777  *
778  * Each message has the name defined followed by the
779  * stream message type (M_PROTO, M_PCPROTO, M_DATA)
780  */
781 
782 /*
783  *	LOCAL MANAGEMENT SERVICE PRIMITIVES
784  */
785 
786 /*
787  * DL_INFO_REQ, M_PCPROTO type
788  */
789 typedef struct {
790 	t_uscalar_t	dl_primitive;			/* set to DL_INFO_REQ */
791 } dl_info_req_t;
792 
793 /*
794  * DL_INFO_ACK, M_PCPROTO type
795  */
796 typedef struct {
797 	t_uscalar_t	dl_primitive;		/* set to DL_INFO_ACK */
798 	t_uscalar_t	dl_max_sdu;		/* Max bytes in a DLSDU */
799 	t_uscalar_t	dl_min_sdu;		/* Min bytes in a DLSDU */
800 	t_uscalar_t	dl_addr_length;		/* length of DLSAP address */
801 	t_uscalar_t	dl_mac_type;		/* type of medium supported */
802 	t_uscalar_t	dl_reserved;		/* value set to zero */
803 	t_uscalar_t	dl_current_state;	/* state of DLPI interface */
804 	t_scalar_t	dl_sap_length;		/* length of DLSAP SAP part */
805 	t_uscalar_t	dl_service_mode;	/* CO, CL or ACL */
806 	t_uscalar_t	dl_qos_length;		/* length of qos values */
807 	t_uscalar_t	dl_qos_offset;		/* offset from start of block */
808 	t_uscalar_t	dl_qos_range_length;	/* available range of qos */
809 	t_uscalar_t	dl_qos_range_offset;	/* offset from start of block */
810 	t_uscalar_t	dl_provider_style;	/* style1 or style2 */
811 	t_uscalar_t	dl_addr_offset;		/* offset of the DLSAP addr */
812 	t_uscalar_t	dl_version;		/* version number */
813 	t_uscalar_t	dl_brdcst_addr_length;	/* length of broadcast addr */
814 	t_uscalar_t	dl_brdcst_addr_offset;	/* offset from start of block */
815 	t_uscalar_t	dl_growth;		/* set to zero */
816 } dl_info_ack_t;
817 
818 /*
819  * DL_ATTACH_REQ, M_PROTO type
820  */
821 typedef struct {
822 	t_uscalar_t	dl_primitive;		/* set to DL_ATTACH_REQ */
823 	t_uscalar_t	dl_ppa;			/* id of the PPA */
824 } dl_attach_req_t;
825 
826 /*
827  * DL_DETACH_REQ, M_PROTO type
828  */
829 typedef struct {
830 	t_uscalar_t	dl_primitive;		/* set to DL_DETACH_REQ */
831 } dl_detach_req_t;
832 
833 /*
834  * DL_BIND_REQ, M_PROTO type
835  */
836 typedef struct {
837 	t_uscalar_t	dl_primitive;	/* set to DL_BIND_REQ */
838 	t_uscalar_t	dl_sap;		/* info to identify DLSAP addr */
839 	t_uscalar_t	dl_max_conind;	/* max # of outstanding con_ind */
840 	uint16_t	dl_service_mode;	/* CO, CL or ACL */
841 	uint16_t	dl_conn_mgmt;	/* if non-zero, is con-mgmt stream */
842 	t_uscalar_t	dl_xidtest_flg;	/* auto init. of test and xid */
843 } dl_bind_req_t;
844 
845 /*
846  * DL_BIND_ACK, M_PCPROTO type
847  */
848 typedef struct {
849 	t_uscalar_t	dl_primitive;	/* DL_BIND_ACK */
850 	t_uscalar_t	dl_sap;		/* DLSAP addr info */
851 	t_uscalar_t	dl_addr_length;	/* length of complete DLSAP addr */
852 	t_uscalar_t	dl_addr_offset;	/* offset from start of M_PCPROTO */
853 	t_uscalar_t	dl_max_conind;	/* allowed max. # of con-ind */
854 	t_uscalar_t	dl_xidtest_flg;	/* responses supported by provider */
855 } dl_bind_ack_t;
856 
857 /*
858  * DL_SUBS_BIND_REQ, M_PROTO type
859  */
860 typedef struct {
861 	t_uscalar_t	dl_primitive;		/* DL_SUBS_BIND_REQ */
862 	t_uscalar_t	dl_subs_sap_offset;	/* offset of subs_sap */
863 	t_uscalar_t	dl_subs_sap_length;	/* length of subs_sap */
864 	t_uscalar_t	dl_subs_bind_class;	/* peer or hierarchical */
865 } dl_subs_bind_req_t;
866 
867 /*
868  * DL_SUBS_BIND_ACK, M_PCPROTO type
869  */
870 typedef struct {
871 	t_uscalar_t dl_primitive;	/* DL_SUBS_BIND_ACK */
872 	t_uscalar_t dl_subs_sap_offset;	/* offset of subs_sap */
873 	t_uscalar_t dl_subs_sap_length;	/* length of subs_sap */
874 } dl_subs_bind_ack_t;
875 
876 /*
877  * DL_UNBIND_REQ, M_PROTO type
878  */
879 typedef struct {
880 	t_uscalar_t	dl_primitive;	/* DL_UNBIND_REQ */
881 } dl_unbind_req_t;
882 
883 /*
884  * DL_SUBS_UNBIND_REQ, M_PROTO type
885  */
886 typedef struct {
887 	t_uscalar_t	dl_primitive;		/* DL_SUBS_UNBIND_REQ */
888 	t_uscalar_t	dl_subs_sap_offset;	/* offset of subs_sap */
889 	t_uscalar_t	dl_subs_sap_length;	/* length of subs_sap */
890 } dl_subs_unbind_req_t;
891 
892 /*
893  * DL_OK_ACK, M_PCPROTO type
894  */
895 typedef struct {
896 	t_uscalar_t	dl_primitive;		/* DL_OK_ACK */
897 	t_uscalar_t	dl_correct_primitive;	/* primitive acknowledged */
898 } dl_ok_ack_t;
899 
900 /*
901  * DL_ERROR_ACK, M_PCPROTO type
902  */
903 typedef struct {
904 	t_uscalar_t	dl_primitive;		/* DL_ERROR_ACK */
905 	t_uscalar_t	dl_error_primitive;	/* primitive in error */
906 	t_uscalar_t	dl_errno;		/* DLPI error code */
907 	t_uscalar_t	dl_unix_errno;		/* UNIX system error code */
908 } dl_error_ack_t;
909 
910 /*
911  * DL_ENABMULTI_REQ, M_PROTO type
912  */
913 typedef struct {
914 	t_uscalar_t	dl_primitive;	/* DL_ENABMULTI_REQ */
915 	t_uscalar_t	dl_addr_length;	/* length of multicast address */
916 	t_uscalar_t	dl_addr_offset;	/* offset from start of M_PROTO block */
917 } dl_enabmulti_req_t;
918 
919 /*
920  * DL_DISABMULTI_REQ, M_PROTO type
921  */
922 
923 typedef struct {
924 	t_uscalar_t	dl_primitive;	/* DL_DISABMULTI_REQ */
925 	t_uscalar_t	dl_addr_length;	/* length of multicast address */
926 	t_uscalar_t	dl_addr_offset;	/* offset from start of M_PROTO block */
927 } dl_disabmulti_req_t;
928 
929 /*
930  * DL_PROMISCON_REQ, M_PROTO type
931  */
932 
933 typedef struct {
934 	t_uscalar_t	dl_primitive;	/* DL_PROMISCON_REQ */
935 	t_uscalar_t	dl_level;	/* physical,SAP, or ALL multicast */
936 } dl_promiscon_req_t;
937 
938 /*
939  * DL_PROMISCOFF_REQ, M_PROTO type
940  */
941 
942 typedef struct {
943 	t_uscalar_t	dl_primitive;	/* DL_PROMISCOFF_REQ */
944 	t_uscalar_t	dl_level;	/* Physical,SAP, or ALL multicast */
945 } dl_promiscoff_req_t;
946 
947 /*
948  *	Primitives to get and set the Physical address
949  */
950 
951 /*
952  * DL_PHYS_ADDR_REQ, M_PROTO type
953  */
954 typedef	struct {
955 	t_uscalar_t	dl_primitive;	/* DL_PHYS_ADDR_REQ */
956 	t_uscalar_t	dl_addr_type;	/* factory or current physical addr */
957 } dl_phys_addr_req_t;
958 
959 /*
960  * DL_PHYS_ADDR_ACK, M_PCPROTO type
961  */
962 typedef struct {
963 	t_uscalar_t	dl_primitive;	/* DL_PHYS_ADDR_ACK */
964 	t_uscalar_t	dl_addr_length;	/* length of the physical addr */
965 	t_uscalar_t	dl_addr_offset;	/* offset from start of block */
966 } dl_phys_addr_ack_t;
967 
968 /*
969  * DL_SET_PHYS_ADDR_REQ, M_PROTO type
970  */
971 typedef struct {
972 	t_uscalar_t	dl_primitive;	/* DL_SET_PHYS_ADDR_REQ */
973 	t_uscalar_t	dl_addr_length;	/* length of physical addr */
974 	t_uscalar_t	dl_addr_offset;	/* offset from start of block */
975 } dl_set_phys_addr_req_t;
976 
977 /*
978  *	Primitives to get statistics
979  */
980 
981 /*
982  * DL_GET_STATISTICS_REQ, M_PROTO type
983  */
984 typedef struct {
985 	t_uscalar_t	dl_primitive;		/* DL_GET_STATISTICS_REQ */
986 } dl_get_statistics_req_t;
987 
988 /*
989  * DL_GET_STATISTICS_ACK, M_PCPROTO type
990  */
991 typedef struct {
992 	t_uscalar_t	dl_primitive;	/* DL_GET_STATISTICS_ACK */
993 	t_uscalar_t	dl_stat_length;	/* length of statistics structure */
994 	t_uscalar_t	dl_stat_offset;	/* offset from start of block */
995 } dl_get_statistics_ack_t;
996 
997 /*
998  *	Solaris specific local management service primitives
999  */
1000 
1001 /*
1002  * DL_NOTIFY_REQ, M_PROTO type
1003  */
1004 typedef struct {
1005 	t_uscalar_t	dl_primitive;	/* set to DL_NOTIFY_REQ */
1006 	uint32_t	dl_notifications; /* Requested set of notifications */
1007 	uint32_t	dl_timelimit;	/* In milliseconds */
1008 } dl_notify_req_t;
1009 
1010 /*
1011  * DL_NOTIFY_ACK, M_PROTO type
1012  */
1013 typedef struct {
1014 	t_uscalar_t	dl_primitive;	/* set to DL_NOTIFY_ACK */
1015 	uint32_t	dl_notifications; /* Supported set of notifications */
1016 } dl_notify_ack_t;
1017 
1018 /*
1019  * DL_NOTIFY_IND, M_PROTO type
1020  */
1021 typedef struct {
1022 	t_uscalar_t	dl_primitive;	/* set to DL_NOTIFY_IND */
1023 	uint32_t	dl_notification; /* Which notification? */
1024 	uint32_t	dl_data;	/* notification specific */
1025 	t_uscalar_t	dl_addr_length;	/* length of complete DLSAP addr */
1026 	t_uscalar_t	dl_addr_offset;	/* offset from start of M_PROTO */
1027 } dl_notify_ind_t;
1028 
1029 /*
1030  * DL_NOTIFY_CONF, M_PROTO type
1031  */
1032 typedef struct {
1033 	t_uscalar_t	dl_primitive;	/* set to DL_NOTIFY_CONF */
1034 	uint32_t	dl_notification; /* Which notification? */
1035 } dl_notify_conf_t;
1036 
1037 /*
1038  * DL_AGGR_REQ, M_PROTO type
1039  */
1040 typedef struct {
1041 	t_uscalar_t	dl_primitive;	/* set to DL_AGGR_REQ */
1042 	uint32_t	dl_key;		/* Key identifying the group */
1043 	uint32_t	dl_port;	/* Identifying the NIC */
1044 	t_uscalar_t	dl_addr_length;	/* length of PHYS addr addr */
1045 	t_uscalar_t	dl_addr_offset;	/* offset from start of M_PROTO */
1046 } dl_aggr_req_t;
1047 
1048 /*
1049  * DL_AGGR_IND, M_PROTO type
1050  */
1051 typedef struct {
1052 	t_uscalar_t	dl_primitive;	/* set to DL_AGGR_IND */
1053 	uint32_t	dl_key;		/* Key identifying the group */
1054 	uint32_t	dl_port;	/* Identifying the NIC */
1055 	t_uscalar_t	dl_addr_length;	/* length of PHYS addr */
1056 	t_uscalar_t	dl_addr_offset;	/* offset from start of M_PROTO */
1057 } dl_aggr_ind_t;
1058 
1059 /*
1060  * DL_UNAGGR_REQ, M_PROTO type
1061  */
1062 typedef struct {
1063 	t_uscalar_t	dl_primitive;	/* set to DL_UNAGGR_REQ */
1064 	uint32_t	dl_key;		/* Key identifying the group */
1065 	uint32_t	dl_port;	/* Identifying the NIC */
1066 	t_uscalar_t	dl_addr_length;	/* length of PHYS addr */
1067 	t_uscalar_t	dl_addr_offset;	/* offset from start of M_PROTO */
1068 } dl_unaggr_req_t;
1069 
1070 /*
1071  * DL_CAPABILITY_REQ, M_PROTO type
1072  */
1073 typedef struct {
1074 	t_uscalar_t	dl_primitive;	/* DL_CAPABILITY_REQ */
1075 	t_uscalar_t	dl_sub_offset;	/* options offset */
1076 	t_uscalar_t	dl_sub_length;	/* options length */
1077 	/* Followed by a list of zero or more dl_capability_sub_t */
1078 } dl_capability_req_t;
1079 
1080 /*
1081  * DL_CAPABILITY_ACK, M_PROTO type
1082  */
1083 typedef struct {
1084 	t_uscalar_t	dl_primitive;	/* DL_CAPABILITY_ACK */
1085 	t_uscalar_t	dl_sub_offset;	/* options offset */
1086 	t_uscalar_t	dl_sub_length;	/* options length */
1087 	/* Followed by a list of zero or more dl_capability_sub_t */
1088 } dl_capability_ack_t;
1089 
1090 /*
1091  * DL_CONTROL_REQ, M_PROTO type
1092  */
1093 typedef struct {
1094 	t_uscalar_t	dl_primitive;	/* DL_CONTROL_REQ */
1095 	t_uscalar_t	dl_operation;	/* add/delete/purge */
1096 	t_uscalar_t	dl_type;	/* e.g. AH/ESP/ ... */
1097 	t_uscalar_t	dl_key_offset;	/* offset of key */
1098 	t_uscalar_t	dl_key_length;	/* length of key */
1099 	t_uscalar_t	dl_data_offset;	/* offset of data */
1100 	t_uscalar_t	dl_data_length;	/* length of data */
1101 } dl_control_req_t;
1102 
1103 /*
1104  * DL_CONTROL_ACK, M_PROTO type
1105  */
1106 typedef struct {
1107 	t_uscalar_t	dl_primitive;	/* DL_CONTROL_ACK */
1108 	t_uscalar_t	dl_operation;	/* add/delete/purge */
1109 	t_uscalar_t	dl_type;	/* e.g. AH/ESP/ ... */
1110 	t_uscalar_t	dl_key_offset;	/* offset of key */
1111 	t_uscalar_t	dl_key_length;	/* length of key */
1112 	t_uscalar_t	dl_data_offset;	/* offset of data */
1113 	t_uscalar_t	dl_data_length;	/* length of data */
1114 } dl_control_ack_t;
1115 
1116 /*
1117  * DL_PASSIVE_REQ, M_PROTO type
1118  */
1119 typedef struct {
1120 	t_uscalar_t	dl_primitive;
1121 } dl_passive_req_t;
1122 
1123 /*
1124  *	DL_INTR_MODE_REQ, M_PROTO type
1125  */
1126 typedef struct {
1127 	t_uscalar_t	dl_primitive;
1128 	t_uscalar_t	dl_sap;
1129 	t_uscalar_t	dl_imode;	/* intr mode: 0 off  1 on */
1130 } dl_intr_mode_req_t;
1131 
1132 /*
1133  *	CONNECTION-ORIENTED SERVICE PRIMITIVES
1134  */
1135 
1136 /*
1137  * DL_CONNECT_REQ, M_PROTO type
1138  */
1139 typedef struct {
1140 	t_uscalar_t	dl_primitive;		/* DL_CONNECT_REQ */
1141 	t_uscalar_t	dl_dest_addr_length;	/* len. of DLSAP addr */
1142 	t_uscalar_t	dl_dest_addr_offset;	/* offset */
1143 	t_uscalar_t	dl_qos_length;		/* len. of QOS parm val */
1144 	t_uscalar_t	dl_qos_offset;		/* offset */
1145 	t_uscalar_t	dl_growth;		/* set to zero */
1146 } dl_connect_req_t;
1147 
1148 /*
1149  * DL_CONNECT_IND, M_PROTO type
1150  */
1151 typedef struct {
1152 	t_uscalar_t	dl_primitive;		/* DL_CONNECT_IND */
1153 	t_uscalar_t	dl_correlation;		/* provider's correl. token */
1154 	t_uscalar_t	dl_called_addr_length;  /* length of called address */
1155 	t_uscalar_t	dl_called_addr_offset;	/* offset from start of block */
1156 	t_uscalar_t	dl_calling_addr_length;	/* length of calling address */
1157 	t_uscalar_t	dl_calling_addr_offset;	/* offset from start of block */
1158 	t_uscalar_t	dl_qos_length;		/* length of qos structure */
1159 	t_uscalar_t	dl_qos_offset;		/* offset from start of block */
1160 	t_uscalar_t	dl_growth;		/* set to zero */
1161 } dl_connect_ind_t;
1162 
1163 /*
1164  * DL_CONNECT_RES, M_PROTO type
1165  */
1166 typedef struct {
1167 	t_uscalar_t	dl_primitive;	/* DL_CONNECT_RES */
1168 	t_uscalar_t	dl_correlation; /* provider's correlation token */
1169 	t_uscalar_t	dl_resp_token;	/* token of responding stream */
1170 	t_uscalar_t	dl_qos_length;  /* length of qos structure */
1171 	t_uscalar_t	dl_qos_offset;	/* offset from start of block */
1172 	t_uscalar_t	dl_growth;	/* set to zero */
1173 } dl_connect_res_t;
1174 
1175 /*
1176  * DL_CONNECT_CON, M_PROTO type
1177  */
1178 typedef struct {
1179 	t_uscalar_t	dl_primitive;		/* DL_CONNECT_CON */
1180 	t_uscalar_t	dl_resp_addr_length;	/* responder's address len */
1181 	t_uscalar_t	dl_resp_addr_offset;	/* offset from start of block */
1182 	t_uscalar_t	dl_qos_length;		/* length of qos structure */
1183 	t_uscalar_t	dl_qos_offset;		/* offset from start of block */
1184 	t_uscalar_t	dl_growth;		/* set to zero */
1185 } dl_connect_con_t;
1186 
1187 /*
1188  * DL_TOKEN_REQ, M_PCPROTO type
1189  */
1190 typedef struct {
1191 	t_uscalar_t	dl_primitive;	/* DL_TOKEN_REQ */
1192 } dl_token_req_t;
1193 
1194 /*
1195  * DL_TOKEN_ACK, M_PCPROTO type
1196  */
1197 typedef struct {
1198 	t_uscalar_t	dl_primitive;	/* DL_TOKEN_ACK */
1199 	t_uscalar_t	dl_token;	/* Connection response token */
1200 }dl_token_ack_t;
1201 
1202 /*
1203  * DL_DISCONNECT_REQ, M_PROTO type
1204  */
1205 typedef struct {
1206 	t_uscalar_t	dl_primitive;	/* DL_DISCONNECT_REQ */
1207 	t_uscalar_t	dl_reason;	/* norm., abnorm., perm. or trans. */
1208 	t_uscalar_t	dl_correlation; /* association with connect_ind */
1209 } dl_disconnect_req_t;
1210 
1211 /*
1212  * DL_DISCONNECT_IND, M_PROTO type
1213  */
1214 typedef struct {
1215 	t_uscalar_t	dl_primitive;	/* DL_DISCONNECT_IND */
1216 	t_uscalar_t	dl_originator;	/* USER or PROVIDER */
1217 	t_uscalar_t	dl_reason;	/* permanent or transient */
1218 	t_uscalar_t	dl_correlation;	/* association with connect_ind */
1219 } dl_disconnect_ind_t;
1220 
1221 /*
1222  * DL_RESET_REQ, M_PROTO type
1223  */
1224 typedef struct {
1225 	t_uscalar_t	dl_primitive;	/* DL_RESET_REQ */
1226 } dl_reset_req_t;
1227 
1228 /*
1229  * DL_RESET_IND, M_PROTO type
1230  */
1231 typedef struct {
1232 	t_uscalar_t	dl_primitive;	/* DL_RESET_IND */
1233 	t_uscalar_t	dl_originator;	/* Provider or User */
1234 	t_uscalar_t	dl_reason;	/* flow control, link error, resync */
1235 } dl_reset_ind_t;
1236 
1237 /*
1238  * DL_RESET_RES, M_PROTO type
1239  */
1240 typedef struct {
1241 	t_uscalar_t	dl_primitive;		/* DL_RESET_RES */
1242 } dl_reset_res_t;
1243 
1244 /*
1245  * DL_RESET_CON, M_PROTO type
1246  */
1247 typedef struct {
1248 	t_uscalar_t	dl_primitive;		/* DL_RESET_CON */
1249 } dl_reset_con_t;
1250 
1251 
1252 /*
1253  *	CONNECTIONLESS SERVICE PRIMITIVES
1254  */
1255 
1256 /*
1257  * DL_UNITDATA_REQ, M_PROTO type, with M_DATA block(s)
1258  */
1259 typedef struct {
1260 	t_uscalar_t	dl_primitive;		/* DL_UNITDATA_REQ */
1261 	t_uscalar_t	dl_dest_addr_length;	/* DLSAP length of dest. user */
1262 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
1263 	dl_priority_t	dl_priority;	/* priority value */
1264 } dl_unitdata_req_t;
1265 
1266 /*
1267  * DL_UNITDATA_IND, M_PROTO type, with M_DATA block(s)
1268  */
1269 typedef struct {
1270 	t_uscalar_t	dl_primitive;		/* DL_UNITDATA_IND */
1271 	t_uscalar_t	dl_dest_addr_length;	/* DLSAP length of dest. user */
1272 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
1273 	t_uscalar_t	dl_src_addr_length;	/* DLSAP addr length sender */
1274 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
1275 	t_uscalar_t	dl_group_address;	/* one if multicast/broadcast */
1276 } dl_unitdata_ind_t;
1277 
1278 /*
1279  * DL_UDERROR_IND, M_PROTO type
1280  *	(or M_PCPROTO type if LLI-based provider)
1281  */
1282 typedef struct {
1283 	t_uscalar_t	dl_primitive;		/* DL_UDERROR_IND */
1284 	t_uscalar_t	dl_dest_addr_length;	/* Destination DLSAP */
1285 	t_uscalar_t	dl_dest_addr_offset;	/* Offset from start of block */
1286 	t_uscalar_t	dl_unix_errno;		/* unix system error code */
1287 	t_uscalar_t	dl_errno;		/* DLPI error code */
1288 } dl_uderror_ind_t;
1289 
1290 /*
1291  * DL_UDQOS_REQ, M_PROTO type
1292  */
1293 typedef struct {
1294 	t_uscalar_t	dl_primitive;	/* DL_UDQOS_REQ */
1295 	t_uscalar_t	dl_qos_length;	/* requested qos byte length */
1296 	t_uscalar_t	dl_qos_offset;	/* offset from start of block */
1297 } dl_udqos_req_t;
1298 
1299 /*
1300  *	Primitives to handle XID and TEST operations
1301  */
1302 
1303 /*
1304  * DL_TEST_REQ, M_PROTO type
1305  */
1306 typedef struct {
1307 	t_uscalar_t	dl_primitive;		/* DL_TEST_REQ */
1308 	t_uscalar_t	dl_flag;		/* poll/final */
1309 	t_uscalar_t	dl_dest_addr_length;	/* DLSAP length of dest. user */
1310 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
1311 } dl_test_req_t;
1312 
1313 /*
1314  * DL_TEST_IND, M_PROTO type
1315  */
1316 typedef struct {
1317 	t_uscalar_t	dl_primitive;		/* DL_TEST_IND */
1318 	t_uscalar_t	dl_flag;		/* poll/final */
1319 	t_uscalar_t	dl_dest_addr_length;	/* DLSAP length of dest. user */
1320 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
1321 	t_uscalar_t	dl_src_addr_length;	/* DLSAP length of source */
1322 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
1323 } dl_test_ind_t;
1324 
1325 /*
1326  *	DL_TEST_RES, M_PROTO type
1327  */
1328 typedef struct {
1329 	t_uscalar_t	dl_primitive;		/* DL_TEST_RES */
1330 	t_uscalar_t	dl_flag;		/* poll/final */
1331 	t_uscalar_t	dl_dest_addr_length;	/* DLSAP length of dest. user */
1332 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
1333 } dl_test_res_t;
1334 
1335 /*
1336  *	DL_TEST_CON, M_PROTO type
1337  */
1338 typedef struct {
1339 	t_uscalar_t	dl_primitive;		/* DL_TEST_CON */
1340 	t_uscalar_t	dl_flag;		/* poll/final */
1341 	t_uscalar_t	dl_dest_addr_length;	/* DLSAP length of dest. user */
1342 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
1343 	t_uscalar_t	dl_src_addr_length;	/* DLSAP length of source */
1344 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
1345 } dl_test_con_t;
1346 
1347 /*
1348  * DL_XID_REQ, M_PROTO type
1349  */
1350 typedef struct {
1351 	t_uscalar_t	dl_primitive;		/* DL_XID_REQ */
1352 	t_uscalar_t	dl_flag;		/* poll/final */
1353 	t_uscalar_t	dl_dest_addr_length;	/* DLSAP length of dest. user */
1354 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
1355 } dl_xid_req_t;
1356 
1357 /*
1358  * DL_XID_IND, M_PROTO type
1359  */
1360 typedef struct {
1361 	t_uscalar_t	dl_primitive;		/* DL_XID_IND */
1362 	t_uscalar_t	dl_flag;		/* poll/final */
1363 	t_uscalar_t	dl_dest_addr_length;	/* DLSAP length of dest. user */
1364 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
1365 	t_uscalar_t	dl_src_addr_length;	/* DLSAP length of source */
1366 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
1367 } dl_xid_ind_t;
1368 
1369 /*
1370  *	DL_XID_RES, M_PROTO type
1371  */
1372 typedef struct {
1373 	t_uscalar_t	dl_primitive;		/* DL_XID_RES */
1374 	t_uscalar_t	dl_flag;		/* poll/final */
1375 	t_uscalar_t	dl_dest_addr_length;	/* DLSAP length of dest. user */
1376 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
1377 } dl_xid_res_t;
1378 
1379 /*
1380  *	DL_XID_CON, M_PROTO type
1381  */
1382 typedef struct {
1383 	t_uscalar_t	dl_primitive;		/* DL_XID_CON */
1384 	t_uscalar_t	dl_flag;		/* poll/final */
1385 	t_uscalar_t	dl_dest_addr_length;	/* DLSAP length of dest. user */
1386 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
1387 	t_uscalar_t	dl_src_addr_length;	/* DLSAP length of source */
1388 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
1389 } dl_xid_con_t;
1390 
1391 /*
1392  *	ACKNOWLEDGED CONNECTIONLESS SERVICE PRIMITIVES
1393  */
1394 
1395 /*
1396  * DL_DATA_ACK_REQ, M_PROTO type
1397  */
1398 typedef struct {
1399 	t_uscalar_t	dl_primitive;		/* DL_DATA_ACK_REQ */
1400 	t_uscalar_t	dl_correlation;		/* User's correlation token */
1401 	t_uscalar_t	dl_dest_addr_length;	/* length of destination addr */
1402 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
1403 	t_uscalar_t	dl_src_addr_length;	/* length of source address */
1404 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
1405 	t_uscalar_t	dl_priority;		/* priority */
1406 	t_uscalar_t	dl_service_class;	/* DL_RQST_RSP|DL_RQST_NORSP */
1407 } dl_data_ack_req_t;
1408 
1409 /*
1410  * DL_DATA_ACK_IND, M_PROTO type
1411  */
1412 typedef struct {
1413 	t_uscalar_t	dl_primitive;		/* DL_DATA_ACK_IND */
1414 	t_uscalar_t	dl_dest_addr_length;	/* length of destination addr */
1415 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
1416 	t_uscalar_t	dl_src_addr_length;	/* length of source address */
1417 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
1418 	t_uscalar_t	dl_priority;		/* pri. for data unit transm. */
1419 	t_uscalar_t	dl_service_class;	/* DL_RQST_RSP|DL_RQST_NORSP */
1420 } dl_data_ack_ind_t;
1421 
1422 /*
1423  * DL_DATA_ACK_STATUS_IND, M_PROTO type
1424  */
1425 typedef struct {
1426 	t_uscalar_t	dl_primitive;	/* DL_DATA_ACK_STATUS_IND */
1427 	t_uscalar_t	dl_correlation;	/* User's correlation token */
1428 	t_uscalar_t	dl_status;	/* success or failure of previous req */
1429 } dl_data_ack_status_ind_t;
1430 
1431 /*
1432  * DL_REPLY_REQ, M_PROTO type
1433  */
1434 typedef struct {
1435 	t_uscalar_t	dl_primitive;		/* DL_REPLY_REQ */
1436 	t_uscalar_t	dl_correlation;		/* User's correlation token */
1437 	t_uscalar_t	dl_dest_addr_length;	/* destination address length */
1438 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
1439 	t_uscalar_t	dl_src_addr_length;	/* source address length */
1440 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
1441 	t_uscalar_t	dl_priority;		/* pri for data unit trans. */
1442 	t_uscalar_t	dl_service_class;
1443 } dl_reply_req_t;
1444 
1445 /*
1446  * DL_REPLY_IND, M_PROTO type
1447  */
1448 typedef struct {
1449 	t_uscalar_t	dl_primitive;		/* DL_REPLY_IND */
1450 	t_uscalar_t	dl_dest_addr_length;	/* destination address length */
1451 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
1452 	t_uscalar_t	dl_src_addr_length;	/* length of source address */
1453 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
1454 	t_uscalar_t	dl_priority;		/* pri for data unit trans. */
1455 	t_uscalar_t	dl_service_class;	/* DL_RQST_RSP|DL_RQST_NORSP */
1456 } dl_reply_ind_t;
1457 
1458 /*
1459  * DL_REPLY_STATUS_IND, M_PROTO type
1460  */
1461 typedef struct {
1462 	t_uscalar_t	dl_primitive;	/* DL_REPLY_STATUS_IND */
1463 	t_uscalar_t	dl_correlation;	/* User's correlation token */
1464 	t_uscalar_t	dl_status;	/* success or failure of previous req */
1465 } dl_reply_status_ind_t;
1466 
1467 /*
1468  * DL_REPLY_UPDATE_REQ, M_PROTO type
1469  */
1470 typedef struct {
1471 	t_uscalar_t	dl_primitive;		/* DL_REPLY_UPDATE_REQ */
1472 	t_uscalar_t	dl_correlation;		/* user's correlation token */
1473 	t_uscalar_t	dl_src_addr_length;	/* length of source address */
1474 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
1475 } dl_reply_update_req_t;
1476 
1477 /*
1478  * DL_REPLY_UPDATE_STATUS_IND, M_PROTO type
1479  */
1480 typedef struct {
1481 	t_uscalar_t	dl_primitive;	/* DL_REPLY_UPDATE_STATUS_IND */
1482 	t_uscalar_t	dl_correlation;	/* User's correlation token */
1483 	t_uscalar_t	dl_status;	/* success or failure of previous req */
1484 } dl_reply_update_status_ind_t;
1485 
1486 union DL_primitives {
1487 	t_uscalar_t		dl_primitive;
1488 	dl_info_req_t		info_req;
1489 	dl_info_ack_t		info_ack;
1490 	dl_attach_req_t		attach_req;
1491 	dl_detach_req_t		detach_req;
1492 	dl_bind_req_t		bind_req;
1493 	dl_bind_ack_t		bind_ack;
1494 	dl_unbind_req_t		unbind_req;
1495 	dl_subs_bind_req_t	subs_bind_req;
1496 	dl_subs_bind_ack_t	subs_bind_ack;
1497 	dl_subs_unbind_req_t	subs_unbind_req;
1498 	dl_ok_ack_t		ok_ack;
1499 	dl_error_ack_t		error_ack;
1500 	dl_connect_req_t	connect_req;
1501 	dl_connect_ind_t	connect_ind;
1502 	dl_connect_res_t	connect_res;
1503 	dl_connect_con_t	connect_con;
1504 	dl_token_req_t		token_req;
1505 	dl_token_ack_t		token_ack;
1506 	dl_disconnect_req_t	disconnect_req;
1507 	dl_disconnect_ind_t	disconnect_ind;
1508 	dl_reset_req_t		reset_req;
1509 	dl_reset_ind_t		reset_ind;
1510 	dl_reset_res_t		reset_res;
1511 	dl_reset_con_t		reset_con;
1512 	dl_unitdata_req_t	unitdata_req;
1513 	dl_unitdata_ind_t	unitdata_ind;
1514 	dl_uderror_ind_t	uderror_ind;
1515 	dl_udqos_req_t		udqos_req;
1516 	dl_enabmulti_req_t	enabmulti_req;
1517 	dl_disabmulti_req_t	disabmulti_req;
1518 	dl_promiscon_req_t	promiscon_req;
1519 	dl_promiscoff_req_t	promiscoff_req;
1520 	dl_phys_addr_req_t	physaddr_req;
1521 	dl_phys_addr_ack_t	physaddr_ack;
1522 	dl_set_phys_addr_req_t	set_physaddr_req;
1523 	dl_get_statistics_req_t	get_statistics_req;
1524 	dl_get_statistics_ack_t	get_statistics_ack;
1525 	dl_notify_req_t		notify_req;
1526 	dl_notify_ack_t		notify_ack;
1527 	dl_notify_ind_t		notify_ind;
1528 	dl_notify_conf_t	notify_conf;
1529 	dl_aggr_req_t		aggr_req;
1530 	dl_aggr_ind_t		aggr_ind;
1531 	dl_unaggr_req_t		unaggr_req;
1532 	dl_test_req_t		test_req;
1533 	dl_test_ind_t		test_ind;
1534 	dl_test_res_t		test_res;
1535 	dl_test_con_t		test_con;
1536 	dl_xid_req_t		xid_req;
1537 	dl_xid_ind_t		xid_ind;
1538 	dl_xid_res_t		xid_res;
1539 	dl_xid_con_t		xid_con;
1540 	dl_data_ack_req_t	data_ack_req;
1541 	dl_data_ack_ind_t	data_ack_ind;
1542 	dl_data_ack_status_ind_t	data_ack_status_ind;
1543 	dl_reply_req_t		reply_req;
1544 	dl_reply_ind_t		reply_ind;
1545 	dl_reply_status_ind_t	reply_status_ind;
1546 	dl_reply_update_req_t	reply_update_req;
1547 	dl_reply_update_status_ind_t	reply_update_status_ind;
1548 	dl_capability_req_t	capability_req;
1549 	dl_capability_ack_t	capability_ack;
1550 	dl_control_req_t	control_req;
1551 	dl_control_ack_t	control_ack;
1552 	dl_passive_req_t	passive_req;
1553 	dl_intr_mode_req_t	intr_mode_req;
1554 };
1555 
1556 #define	DL_INFO_REQ_SIZE	sizeof (dl_info_req_t)
1557 #define	DL_INFO_ACK_SIZE	sizeof (dl_info_ack_t)
1558 #define	DL_ATTACH_REQ_SIZE	sizeof (dl_attach_req_t)
1559 #define	DL_DETACH_REQ_SIZE	sizeof (dl_detach_req_t)
1560 #define	DL_BIND_REQ_SIZE	sizeof (dl_bind_req_t)
1561 #define	DL_BIND_ACK_SIZE	sizeof (dl_bind_ack_t)
1562 #define	DL_UNBIND_REQ_SIZE	sizeof (dl_unbind_req_t)
1563 #define	DL_SUBS_BIND_REQ_SIZE	sizeof (dl_subs_bind_req_t)
1564 #define	DL_SUBS_BIND_ACK_SIZE	sizeof (dl_subs_bind_ack_t)
1565 #define	DL_SUBS_UNBIND_REQ_SIZE	sizeof (dl_subs_unbind_req_t)
1566 #define	DL_OK_ACK_SIZE		sizeof (dl_ok_ack_t)
1567 #define	DL_ERROR_ACK_SIZE	sizeof (dl_error_ack_t)
1568 #define	DL_CONNECT_REQ_SIZE	sizeof (dl_connect_req_t)
1569 #define	DL_CONNECT_IND_SIZE	sizeof (dl_connect_ind_t)
1570 #define	DL_CONNECT_RES_SIZE	sizeof (dl_connect_res_t)
1571 #define	DL_CONNECT_CON_SIZE	sizeof (dl_connect_con_t)
1572 #define	DL_TOKEN_REQ_SIZE	sizeof (dl_token_req_t)
1573 #define	DL_TOKEN_ACK_SIZE	sizeof (dl_token_ack_t)
1574 #define	DL_DISCONNECT_REQ_SIZE	sizeof (dl_disconnect_req_t)
1575 #define	DL_DISCONNECT_IND_SIZE	sizeof (dl_disconnect_ind_t)
1576 #define	DL_RESET_REQ_SIZE	sizeof (dl_reset_req_t)
1577 #define	DL_RESET_IND_SIZE	sizeof (dl_reset_ind_t)
1578 #define	DL_RESET_RES_SIZE	sizeof (dl_reset_res_t)
1579 #define	DL_RESET_CON_SIZE	sizeof (dl_reset_con_t)
1580 #define	DL_UNITDATA_REQ_SIZE	sizeof (dl_unitdata_req_t)
1581 #define	DL_UNITDATA_IND_SIZE	sizeof (dl_unitdata_ind_t)
1582 #define	DL_UDERROR_IND_SIZE	sizeof (dl_uderror_ind_t)
1583 #define	DL_UDQOS_REQ_SIZE	sizeof (dl_udqos_req_t)
1584 #define	DL_ENABMULTI_REQ_SIZE	sizeof (dl_enabmulti_req_t)
1585 #define	DL_DISABMULTI_REQ_SIZE	sizeof (dl_disabmulti_req_t)
1586 #define	DL_PROMISCON_REQ_SIZE	sizeof (dl_promiscon_req_t)
1587 #define	DL_PROMISCOFF_REQ_SIZE	sizeof (dl_promiscoff_req_t)
1588 #define	DL_PHYS_ADDR_REQ_SIZE	sizeof (dl_phys_addr_req_t)
1589 #define	DL_PHYS_ADDR_ACK_SIZE	sizeof (dl_phys_addr_ack_t)
1590 #define	DL_SET_PHYS_ADDR_REQ_SIZE	sizeof (dl_set_phys_addr_req_t)
1591 #define	DL_GET_STATISTICS_REQ_SIZE	sizeof (dl_get_statistics_req_t)
1592 #define	DL_GET_STATISTICS_ACK_SIZE	sizeof (dl_get_statistics_ack_t)
1593 #define	DL_NOTIFY_REQ_SIZE	sizeof (dl_notify_req_t)
1594 #define	DL_NOTIFY_ACK_SIZE	sizeof (dl_notify_ack_t)
1595 #define	DL_NOTIFY_IND_SIZE	sizeof (dl_notify_ind_t)
1596 #define	DL_NOTIFY_CONF_SIZE	sizeof (dl_notify_conf_t)
1597 #define	DL_AGGR_REQ_SIZE	sizeof (dl_aggr_req_t)
1598 #define	DL_AGGR_IND_SIZE	sizeof (dl_aggr_ind_t)
1599 #define	DL_UNAGGR_REQ_SIZE	sizeof (dl_unaggr_req_t)
1600 #define	DL_XID_REQ_SIZE		sizeof (dl_xid_req_t)
1601 #define	DL_XID_IND_SIZE		sizeof (dl_xid_ind_t)
1602 #define	DL_XID_RES_SIZE		sizeof (dl_xid_res_t)
1603 #define	DL_XID_CON_SIZE		sizeof (dl_xid_con_t)
1604 #define	DL_TEST_REQ_SIZE	sizeof (dl_test_req_t)
1605 #define	DL_TEST_IND_SIZE	sizeof (dl_test_ind_t)
1606 #define	DL_TEST_RES_SIZE	sizeof (dl_test_res_t)
1607 #define	DL_TEST_CON_SIZE	sizeof (dl_test_con_t)
1608 #define	DL_DATA_ACK_REQ_SIZE	sizeof (dl_data_ack_req_t)
1609 #define	DL_DATA_ACK_IND_SIZE	sizeof (dl_data_ack_ind_t)
1610 #define	DL_DATA_ACK_STATUS_IND_SIZE	sizeof (dl_data_ack_status_ind_t)
1611 #define	DL_REPLY_REQ_SIZE	sizeof (dl_reply_req_t)
1612 #define	DL_REPLY_IND_SIZE	sizeof (dl_reply_ind_t)
1613 #define	DL_REPLY_STATUS_IND_SIZE	sizeof (dl_reply_status_ind_t)
1614 #define	DL_REPLY_UPDATE_REQ_SIZE	sizeof (dl_reply_update_req_t)
1615 #define	DL_REPLY_UPDATE_STATUS_IND_SIZE	sizeof (dl_reply_update_status_ind_t)
1616 #define	DL_CAPABILITY_REQ_SIZE	sizeof (dl_capability_req_t)
1617 #define	DL_CAPABILITY_ACK_SIZE	sizeof (dl_capability_ack_t)
1618 #define	DL_CONTROL_REQ_SIZE	sizeof (dl_control_req_t)
1619 #define	DL_CONTROL_ACK_SIZE	sizeof (dl_control_ack_t)
1620 #define	DL_PASSIVE_REQ_SIZE	sizeof (dl_passive_req_t)
1621 #define	DL_INTR_MODE_REQ_SIZE	sizeof (dl_intr_mode_req_t)
1622 
1623 #ifdef	_KERNEL
1624 /*
1625  * DDI DLPI routines; see the appropriate manpage for details.
1626  */
1627 extern void	dlbindack(queue_t *, mblk_t *, t_scalar_t, const void *,
1628     t_uscalar_t, t_uscalar_t, t_uscalar_t);
1629 extern void	dlokack(queue_t *, mblk_t *, t_uscalar_t);
1630 extern void	dlerrorack(queue_t *, mblk_t *, t_uscalar_t, t_uscalar_t,
1631     t_uscalar_t);
1632 extern void	dluderrorind(queue_t *, mblk_t *, const void *, t_uscalar_t,
1633     t_uscalar_t, t_uscalar_t);
1634 extern void	dlphysaddrack(queue_t *, mblk_t *, const void *, t_uscalar_t);
1635 
1636 /*
1637  * All routines that follow are unstable and subject to change.
1638  */
1639 extern void	dlcapabsetqid(dl_mid_t *, const queue_t *);
1640 extern boolean_t dlcapabcheckqid(const dl_mid_t *, const queue_t *);
1641 extern void	dlnotifyack(queue_t *, mblk_t *, uint32_t);
1642 /*
1643  * The ldi_handle_t typedef is in <sys/sunldi.h>, which in turn requires
1644  * <sys/sunddi.h>, which pulls in <sys/cmn_err.h>, which declares kernel
1645  * versions of the printf() functions that conflict with the libc ones.
1646  * This causes conflicts when building MDB modules like ARP that #define
1647  * _KERNEL.  So we use `struct __ldi_handle *' instead.
1648  */
1649 struct __ldi_handle;
1650 extern int dl_attach(struct __ldi_handle *, int, dl_error_ack_t *);
1651 extern int dl_bind(struct __ldi_handle *, uint_t, dl_error_ack_t *);
1652 extern int dl_phys_addr(struct __ldi_handle *, uchar_t *, size_t *,
1653     dl_error_ack_t *);
1654 extern int dl_info(struct __ldi_handle *, dl_info_ack_t *, uchar_t *, size_t *,
1655     dl_error_ack_t *);
1656 extern int dl_notify(struct __ldi_handle *, uint32_t *, dl_error_ack_t *);
1657 extern const char *dl_errstr(t_uscalar_t);
1658 extern const char *dl_primstr(t_uscalar_t);
1659 extern const char *dl_mactypestr(t_uscalar_t);
1660 
1661 #endif	/* _KERNEL */
1662 
1663 #ifdef	__cplusplus
1664 }
1665 #endif
1666 
1667 #endif /* _SYS_DLPI_H */
1668