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