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