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