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