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