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