xref: /titanic_51/usr/src/uts/common/sys/dlpi.h (revision 9dd0f810214fdc8e1af881a9a5c4b6927629ff9e)
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 2006 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 #pragma ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.2	*/
39 
40 #include <sys/types.h>
41 #include <sys/stream.h>
42 
43 #ifdef	__cplusplus
44 extern "C" {
45 #endif
46 
47 /*
48  * Sun additions.
49  */
50 #define	DLIOC		('D' << 8)
51 #define	DLIOCRAW	(DLIOC|1)	/* M_DATA "raw" mode */
52 #define	DLIOCNATIVE	(DLIOC|2)	/* Native traffic 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 #define	DL_WIFI		0x80000004ul	/* IEEE 802.11 */
266 
267 /*
268  * DLPI provider service supported.
269  * These must be allowed to be bitwise-OR for dl_service_mode in
270  * DL_INFO_ACK.
271  */
272 #define	DL_CODLS	0x01	/* support connection-oriented service */
273 #define	DL_CLDLS	0x02	/* support connectionless data link service */
274 #define	DL_ACLDLS	0x04	/* support acknowledged connectionless serv. */
275 
276 
277 /*
278  * DLPI provider style.
279  * The DLPI provider style which determines whether a provider
280  * requires a DL_ATTACH_REQ to inform the provider which PPA
281  * user messages should be sent/received on.
282  */
283 #define	DL_STYLE1	0x0500	/* PPA is implicitly bound by open(2) */
284 #define	DL_STYLE2	0x0501	/* PPA must be expl. bound via DL_ATTACH_REQ */
285 
286 
287 /*
288  * DLPI Originator for Disconnect and Resets
289  */
290 #define	DL_PROVIDER	0x0700
291 #define	DL_USER		0x0701
292 
293 /*
294  * DLPI Disconnect Reasons
295  */
296 #define	DL_CONREJ_DEST_UNKNOWN			0x0800
297 #define	DL_CONREJ_DEST_UNREACH_PERMANENT	0x0801
298 #define	DL_CONREJ_DEST_UNREACH_TRANSIENT	0x0802
299 #define	DL_CONREJ_QOS_UNAVAIL_PERMANENT		0x0803
300 #define	DL_CONREJ_QOS_UNAVAIL_TRANSIENT		0x0804
301 #define	DL_CONREJ_PERMANENT_COND		0x0805
302 #define	DL_CONREJ_TRANSIENT_COND		0x0806
303 #define	DL_DISC_ABNORMAL_CONDITION		0x0807
304 #define	DL_DISC_NORMAL_CONDITION		0x0808
305 #define	DL_DISC_PERMANENT_CONDITION		0x0809
306 #define	DL_DISC_TRANSIENT_CONDITION		0x080a
307 #define	DL_DISC_UNSPECIFIED			0x080b
308 
309 /*
310  * DLPI Reset Reasons
311  */
312 #define	DL_RESET_FLOW_CONTROL	0x0900
313 #define	DL_RESET_LINK_ERROR	0x0901
314 #define	DL_RESET_RESYNCH	0x0902
315 
316 /*
317  * DLPI status values for acknowledged connectionless data transfer
318  */
319 #define	DL_CMD_MASK	0x0f	/* mask for command portion of status */
320 #define	DL_CMD_OK	0x00	/* Command Accepted */
321 #define	DL_CMD_RS	0x01	/* Unimplemented or inactivated service */
322 #define	DL_CMD_UE	0x05	/* Data Link User interface error */
323 #define	DL_CMD_PE	0x06	/* Protocol error */
324 #define	DL_CMD_IP	0x07	/* Permanent implementation dependent error */
325 #define	DL_CMD_UN	0x09	/* Resources temporarily unavailable */
326 #define	DL_CMD_IT	0x0f	/* Temporary implementation dependent error */
327 #define	DL_RSP_MASK	0xf0	/* mask for response portion of status */
328 #define	DL_RSP_OK	0x00	/* Response DLSDU present */
329 #define	DL_RSP_RS	0x10	/* Unimplemented or inactivated service */
330 #define	DL_RSP_NE	0x30	/* Response DLSDU never submitted */
331 #define	DL_RSP_NR	0x40	/* Response DLSDU not requested */
332 #define	DL_RSP_UE	0x50	/* Data Link User interface error */
333 #define	DL_RSP_IP	0x70	/* Permanent implementation dependent error */
334 #define	DL_RSP_UN	0x90	/* Resources temporarily unavailable */
335 #define	DL_RSP_IT	0xf0	/* Temporary implementation dependent error */
336 
337 /*
338  * Service Class values for acknowledged connectionless data transfer
339  */
340 #define	DL_RQST_RSP	0x01	/* Use acknowledge capability in MAC sublayer */
341 #define	DL_RQST_NORSP	0x02	/* No acknowledgement service requested */
342 
343 /*
344  * DLPI address type definition
345  */
346 #define	DL_FACT_PHYS_ADDR	0x01	/* factory physical address */
347 #define	DL_CURR_PHYS_ADDR	0x02	/* current physical address */
348 #define	DL_IPV6_TOKEN		0x03	/* IPv6 interface token */
349 #define	DL_IPV6_LINK_LAYER_ADDR	0x04	/* Neighbor Discovery format */
350 
351 /*
352  * DLPI flag definitions
353  */
354 #define	DL_POLL_FINAL	0x01		/* indicates poll/final bit set */
355 
356 /*
357  *	XID and TEST responses supported by the provider
358  */
359 #define	DL_AUTO_XID	0x01		/* provider will respond to XID */
360 #define	DL_AUTO_TEST	0x02		/* provider will respond to TEST */
361 
362 /*
363  * Subsequent bind type
364  */
365 #define	DL_PEER_BIND	0x01		/* subsequent bind on a peer addr */
366 #define	DL_HIERARCHICAL_BIND	0x02	/* subs_bind on a hierarchical addr */
367 
368 /*
369  * DLPI promiscuous mode definitions
370  */
371 #define	DL_PROMISC_PHYS		0x01	/* promiscuous mode at phys level */
372 #define	DL_PROMISC_SAP		0x02	/* promiscous mode at sap level */
373 #define	DL_PROMISC_MULTI	0x03	/* promiscuous mode for multicast */
374 
375 /*
376  * DLPI notification codes for DL_NOTIFY primitives.
377  * Bit-wise distinct since DL_NOTIFY_REQ and DL_NOTIFY_ACK carry multiple
378  * notification codes.
379  */
380 #define	DL_NOTE_PHYS_ADDR	0x0001	/* Physical address change */
381 #define	DL_NOTE_PROMISC_ON_PHYS	0x0002	/* DL_PROMISC_PHYS set on ppa */
382 #define	DL_NOTE_PROMISC_OFF_PHYS 0x0004	/* DL_PROMISC_PHYS cleared on ppa */
383 #define	DL_NOTE_LINK_DOWN	0x0008	/* Link down */
384 #define	DL_NOTE_LINK_UP		0x0010	/* Link up */
385 #define	DL_NOTE_AGGR_AVAIL	0x0020	/* Link aggregation is available */
386 #define	DL_NOTE_AGGR_UNAVAIL	0x0040	/* Link aggregation is not available */
387 #define	DL_NOTE_SDU_SIZE	0x0080	/* New SDU size, global or per addr */
388 #define	DL_NOTE_SPEED		0x0100	/* Approximate link speed */
389 #define	DL_NOTE_FASTPATH_FLUSH	0x0200	/* Fast Path info changes */
390 #define	DL_NOTE_CAPAB_RENEG	0x0400	/* Initiate capability renegotiation */
391 
392 /*
393  * DLPI Quality Of Service definition for use in QOS structure definitions.
394  * The QOS structures are used in connection establishment, DL_INFO_ACK,
395  * and setting connectionless QOS values.
396  */
397 
398 /*
399  * Throughput
400  *
401  * This parameter is specified for both directions.
402  */
403 typedef struct {
404 	t_scalar_t	dl_target_value;	/* bits/second desired */
405 	t_scalar_t	dl_accept_value;	/* min. ok bits/second */
406 } dl_through_t;
407 
408 /*
409  * transit delay specification
410  *
411  * This parameter is specified for both directions.
412  * expressed in milliseconds assuming a DLSDU size of 128 octets.
413  * The scaling of the value to the current DLSDU size is provider dependent.
414  */
415 typedef struct {
416 	t_scalar_t	dl_target_value;	/* desired value of service */
417 	t_scalar_t	dl_accept_value;	/* min. ok value of service */
418 } dl_transdelay_t;
419 
420 /*
421  * priority specification
422  * priority range is 0-100, with 0 being highest value.
423  */
424 typedef struct {
425 	t_scalar_t	dl_min;
426 	t_scalar_t	dl_max;
427 } dl_priority_t;
428 
429 
430 /*
431  * protection specification
432  *
433  */
434 #define	DL_NONE			0x0B01	/* no protection supplied */
435 #define	DL_MONITOR		0x0B02	/* prot. from passive monit. */
436 #define	DL_MAXIMUM		0x0B03	/* prot. from modification, replay, */
437 					/* addition, or deletion */
438 
439 typedef struct {
440 	t_scalar_t	dl_min;
441 	t_scalar_t	dl_max;
442 } dl_protect_t;
443 
444 
445 /*
446  * Resilience specification
447  * probabilities are scaled by a factor of 10,000 with a time interval
448  * of 10,000 seconds.
449  */
450 typedef struct {
451 	t_scalar_t	dl_disc_prob;	/* prob. of provider init DISC */
452 	t_scalar_t	dl_reset_prob;	/* prob. of provider init RESET */
453 } dl_resilience_t;
454 
455 
456 /*
457  * QOS type definition to be used for negotiation with the
458  * remote end of a connection, or a connectionless unitdata request.
459  * There are two type definitions to handle the negotiation
460  * process at connection establishment. The typedef dl_qos_range_t
461  * is used to present a range for parameters. This is used
462  * in the DL_CONNECT_REQ and DL_CONNECT_IND messages. The typedef
463  * dl_qos_sel_t is used to select a specific value for the QOS
464  * parameters. This is used in the DL_CONNECT_RES, DL_CONNECT_CON,
465  * and DL_INFO_ACK messages to define the selected QOS parameters
466  * for a connection.
467  *
468  * NOTE
469  *	A DataLink provider which has unknown values for any of the fields
470  *	will use a value of DL_UNKNOWN for all values in the fields.
471  *
472  * NOTE
473  *	A QOS parameter value of DL_QOS_DONT_CARE informs the DLS
474  *	provider the user requesting this value doesn't care
475  *	what the QOS parameter is set to. This value becomes the
476  *	least possible value in the range of QOS parameters.
477  *	The order of the QOS parameter range is then:
478  *
479  *		DL_QOS_DONT_CARE < 0 < MAXIMUM QOS VALUE
480  */
481 #define	DL_UNKNOWN		-1
482 #define	DL_QOS_DONT_CARE	-2
483 
484 /*
485  * Every QOS structure has the first 4 bytes containing a type
486  * field, denoting the definition of the rest of the structure.
487  * This is used in the same manner has the dl_primitive variable
488  * is in messages.
489  *
490  * The following list is the defined QOS structure type values and structures.
491  */
492 #define	DL_QOS_CO_RANGE1	0x0101	/* CO QOS range struct. */
493 #define	DL_QOS_CO_SEL1		0x0102	/* CO QOS selection structure */
494 #define	DL_QOS_CL_RANGE1	0x0103	/* CL QOS range struct. */
495 #define	DL_QOS_CL_SEL1		0x0104	/* CL QOS selection */
496 
497 typedef struct {
498 	t_uscalar_t	dl_qos_type;
499 	dl_through_t	dl_rcv_throughput;	/* desired and accep. */
500 	dl_transdelay_t	dl_rcv_trans_delay;	/* desired and accep. */
501 	dl_through_t	dl_xmt_throughput;
502 	dl_transdelay_t	dl_xmt_trans_delay;
503 	dl_priority_t	dl_priority;		/* min and max values */
504 	dl_protect_t	dl_protection;		/* min and max values */
505 	t_scalar_t	dl_residual_error;
506 	dl_resilience_t	dl_resilience;
507 }	dl_qos_co_range1_t;
508 
509 typedef struct {
510 	t_uscalar_t	dl_qos_type;
511 	t_scalar_t	dl_rcv_throughput;
512 	t_scalar_t	dl_rcv_trans_delay;
513 	t_scalar_t	dl_xmt_throughput;
514 	t_scalar_t	dl_xmt_trans_delay;
515 	t_scalar_t	dl_priority;
516 	t_scalar_t	dl_protection;
517 	t_scalar_t	dl_residual_error;
518 	dl_resilience_t	dl_resilience;
519 }	dl_qos_co_sel1_t;
520 
521 typedef struct {
522 	t_uscalar_t	dl_qos_type;
523 	dl_transdelay_t	dl_trans_delay;
524 	dl_priority_t	dl_priority;
525 	dl_protect_t	dl_protection;
526 	t_scalar_t	dl_residual_error;
527 }	dl_qos_cl_range1_t;
528 
529 typedef struct {
530 	t_uscalar_t	dl_qos_type;
531 	t_scalar_t	dl_trans_delay;
532 	t_scalar_t	dl_priority;
533 	t_scalar_t	dl_protection;
534 	t_scalar_t	dl_residual_error;
535 }	dl_qos_cl_sel1_t;
536 
537 union	DL_qos_types {
538 	t_uscalar_t		dl_qos_type;
539 	dl_qos_co_range1_t	qos_co_range1;
540 	dl_qos_co_sel1_t	qos_co_sel1;
541 	dl_qos_cl_range1_t	qos_cl_range1;
542 	dl_qos_cl_sel1_t	qos_cl_sel1;
543 };
544 
545 /*
546  *    Solaris specific structures and definitions.
547  */
548 
549 /*
550  * The following are the capability types and structures used by the
551  * the DL_CAPABILITY_REQ and DL_CAPABILITY_ACK primitives.
552  *
553  * These primitives are used both to determine the set of capabilities in
554  * the DLS provider and also to turn on and off specific capabilities.
555  * The response is a DL_CAPABILITY_ACK or DL_ERROR_ACK.
556  *
557  * DL_CAPABILITY_REQ can either be empty (i.e. dl_sub_length is zero) which
558  * is a request for the driver to return all capabilities. Otherwise, the
559  * DL_CAPABILITY_REQ contains the capabilities the DLS user wants to use and
560  * their settings.
561  *
562  * DL_CAPABILITY_ACK contains the capabilities that the DLS provider can
563  * support modified based on what was listed in the request. If a
564  * capability was included in the request then the information returned
565  * in the ack might be modified based on the information in the request.
566  */
567 
568 #define	DL_CAPAB_ID_WRAPPER	0x00	/* Module ID wrapper structure */
569 					/* dl_data is dl_capab_id_t */
570 #define	DL_CAPAB_HCKSUM		0x01	/* Checksum offload */
571 					/* dl_data is dl_capab_hcksum_t */
572 #define	DL_CAPAB_IPSEC_AH	0x02	/* IPsec AH acceleration */
573 					/* dl_data is dl_capab_ipsec_t */
574 #define	DL_CAPAB_IPSEC_ESP	0x03	/* IPsec ESP acceleration */
575 					/* dl_data is dl_capab_ipsec_t */
576 #define	DL_CAPAB_MDT		0x04	/* Multidata Transmit capability */
577 					/* dl_data is dl_capab_mdt_t */
578 #define	DL_CAPAB_ZEROCOPY	0x05	/* Zero-copy capability */
579 					/* dl_data is dl_capab_zerocopy_t */
580 #define	DL_CAPAB_POLL		0x06	/* Polling capability */
581 					/* dl_data is dl_capab_dls_t */
582 #define	DL_CAPAB_SOFT_RING   	0x07	/* Soft ring capable */
583 					/* dl_data is dl_capab_dls_t */
584 #define	DL_CAPAB_LSO		0x08	/* Large Send Offload capability */
585 					/* dl_data is dl_capab_lso_t */
586 
587 typedef struct {
588 	t_uscalar_t	dl_cap;		/* capability type */
589 	t_uscalar_t	dl_length;	/* length of data following */
590 	/* Followed by zero or more bytes of dl_data */
591 } dl_capability_sub_t;
592 
593 /*
594  * Definitions and structures needed for DL_CONTROL_REQ and DL_CONTROL_ACK
595  * primitives.
596  * Extensible message to send down control information to the DLS provider.
597  * The response is a DL_CONTROL_ACK or DL_ERROR_ACK.
598  *
599  * Different types of control operations will define different format for the
600  * key and data fields. ADD requires key and data fields; if the <type, key>
601  * matches an already existing entry a DL_ERROR_ACK will be returned. DELETE
602  * requires a key field; if the <type, key> does not exist, a DL_ERROR_ACK
603  * will be returned. FLUSH requires neither a key nor data; it
604  * unconditionally removes all entries for the specified type. GET requires a
605  * key field; the get operation returns the data for the <type, key>. If
606  * <type, key> doesn't exist a DL_ERROR_ACK is returned. UPDATE requires key
607  * and data fields; if <type, key> doesn't exist a DL_ERROR_ACK is returned.
608  */
609 
610 /*
611  * Control operations
612  */
613 #define	DL_CO_ADD	0x01	/* Add new entry matching for <type,key> */
614 #define	DL_CO_DELETE	0x02	/* Delete the entry matching <type,key> */
615 #define	DL_CO_FLUSH	0x03	/* Purge all entries of <type> */
616 #define	DL_CO_GET	0x04	/* Get the data for the <type,key> */
617 #define	DL_CO_UPDATE	0x05	/* Update the data for <type,key> */
618 #define	DL_CO_SET	0x06	/* Add or update as appropriate */
619 
620 /*
621  * Control types (dl_type field of dl_control_req_t and dl_control_ack_t)
622  */
623 #define	DL_CT_IPSEC_AH	0x01	/* AH; key=spi,dest_addr; */
624 				/* data=keying material */
625 #define	DL_CT_IPSEC_ESP	0x02	/* ESP; key=spi,des_taddr; */
626 				/* data=keying material */
627 
628 /*
629  * Module ID token to be included in new sub-capability structures.
630  * Existing sub-capabilities lacking an identification token, e.g. IPSEC
631  * hardware acceleration, need to be encapsulated within the ID sub-
632  * capability.  Access to this structure must be done through
633  * dlcapab{set,check}qid().
634  */
635 typedef struct {
636 	t_uscalar_t	mid[4];		/* private fields */
637 } dl_mid_t;
638 
639 /*
640  * Module ID wrapper (follows dl_capability_sub_t)
641  */
642 typedef struct {
643 	dl_mid_t		id_mid;		/* module ID token */
644 	dl_capability_sub_t	id_subcap;	/* sub-capability */
645 } dl_capab_id_t;
646 
647 /*
648  * Multidata Transmit sub-capability (follows dl_capability_sub_t)
649  */
650 typedef struct {
651 	t_uscalar_t	mdt_version;	/* interface version */
652 	t_uscalar_t	mdt_flags;	/* flags */
653 	t_uscalar_t	mdt_hdr_head;	/* minimum leading header space */
654 	t_uscalar_t	mdt_hdr_tail;	/* minimum trailing header space */
655 	t_uscalar_t	mdt_max_pld;	/* maximum doable payload buffers */
656 	t_uscalar_t	mdt_span_limit;	/* scatter-gather descriptor limit */
657 	dl_mid_t	mdt_mid;	/* module ID token */
658 } dl_capab_mdt_t;
659 
660 /*
661  * Multidata Transmit revision definition history
662  */
663 #define	MDT_CURRENT_VERSION	0x02
664 #define	MDT_VERSION_2		0x02
665 
666 /*
667  * mdt_flags values
668  */
669 #define	DL_CAPAB_MDT_ENABLE	0x01	/* enable Multidata Transmit */
670 
671 /*
672  * DL_CAPAB_HCKSUM
673  * Used for negotiating different flavors of checksum offload
674  * capabilities.
675  */
676 typedef struct {
677 	t_uscalar_t	hcksum_version;	/* version of data following */
678 	t_uscalar_t	hcksum_txflags;	/* capabilities on transmit */
679 	dl_mid_t	hcksum_mid;		/* module ID */
680 } dl_capab_hcksum_t;
681 
682 /*
683  * DL_CAPAB_HCKSUM  revision definition history
684  */
685 #define	HCKSUM_CURRENT_VERSION	0x01
686 #define	HCKSUM_VERSION_1	0x01
687 
688 /*
689  * Values for dl_txflags
690  */
691 #define	HCKSUM_ENABLE		0x01	/* Set to enable hardware checksum */
692 					/* capability */
693 #define	HCKSUM_INET_PARTIAL	0x02	/* Partial 1's complement checksum */
694 					/* ability */
695 #define	HCKSUM_INET_FULL_V4	0x04	/* Full 1's complement checksum */
696 					/* ability for IPv4 packets. */
697 #define	HCKSUM_INET_FULL_V6	0x08	/* Full 1's complement checksum */
698 					/* ability for IPv6 packets. */
699 #define	HCKSUM_IPHDRCKSUM	0x10	/* IPv4 Header checksum offload */
700 					/* capability */
701 #ifdef _KERNEL
702 
703 /*
704  * This structure is used by DL_CAPAB_POLL and DL_CAPAB_SOFT_RING
705  * capabilities. It provides a mechanism for IP to exchange function
706  * pointers with a gldv3-based driver to enable it to bypass streams-
707  * data-paths. DL_CAPAB_POLL mechanism provides a way to blank
708  * interrupts. Note: True polling support will be added in the future.
709  * DL_CAPAB_SOFT_RING provides a mechanism to create soft ring at the
710  * dls layer.
711  */
712 typedef struct dl_capab_dls_s {
713 	t_uscalar_t		dls_version;
714 	t_uscalar_t		dls_flags;
715 
716 	/* DLD provided information */
717 	uintptr_t		dls_tx_handle;
718 	uintptr_t		dls_tx;
719 	uintptr_t		dls_ring_change_status;
720 	uintptr_t		dls_ring_bind;
721 	uintptr_t		dls_ring_unbind;
722 
723 	/* IP provided information */
724 	uintptr_t		dls_rx_handle;
725 	uintptr_t		dls_ring_assign;
726 	uintptr_t		dls_rx;
727 	uintptr_t		dls_ring_add;
728 	t_uscalar_t		dls_ring_cnt;
729 
730 	dl_mid_t		dls_mid;		/* module ID */
731 } dl_capab_dls_t;
732 
733 #define	POLL_CURRENT_VERSION	0x01
734 #define	POLL_VERSION_1		0x01
735 
736 #define	SOFT_RING_VERSION_1		0x01
737 
738 /* Values for poll_flags */
739 #define	POLL_ENABLE		0x01	/* Set to enable polling */
740 					/* capability */
741 #define	POLL_CAPABLE		0x02	/* Polling ability exists */
742 #define	POLL_DISABLE		0x03	/* Disable Polling */
743 
744 /* Values for soft_ring_flags */
745 #define	SOFT_RING_ENABLE		0x04	/* Set to enable soft_ring */
746 						/* capability */
747 #define	SOFT_RING_CAPABLE		0x05	/* Soft_Ring ability exists */
748 #define	SOFT_RING_DISABLE		0x06	/* Disable Soft_Ring */
749 
750 /* Soft_Ring fanout types (used by soft_ring_change_status) */
751 #define	SOFT_RING_NONE			0x00
752 #define	SOFT_RING_RANDOM		0x01
753 #define	SOFT_RING_SRC_HASH		0x02
754 #define	SOFT_RING_RND_ROBIN		0x03
755 
756 #endif /* _KERNEL */
757 
758 /*
759  * Zero-copy sub-capability (follows dl_capability_sub_t)
760  */
761 typedef struct {
762 	t_uscalar_t	zerocopy_version;	/* interface version */
763 	t_uscalar_t	zerocopy_flags;		/* capability flags */
764 	t_uscalar_t	reserved[9];		/* reserved fields */
765 	dl_mid_t	zerocopy_mid;		/* module ID */
766 } dl_capab_zerocopy_t;
767 
768 /*
769  * Zero-copy revision definition history
770  */
771 #define	ZEROCOPY_CURRENT_VERSION	0x01
772 #define	ZEROCOPY_VERSION_1		0x01
773 
774 /*
775  * Currently supported values of zerocopy_flags
776  */
777 #define	DL_CAPAB_VMSAFE_MEM		0x01	/* Driver is zero-copy safe */
778 						/* wrt VM named buffers on */
779 						/* transmit */
780 
781 /*
782  * Large Send Offload sub-capability (follows dl_capability_sub_t)
783  */
784 typedef struct {
785 	t_uscalar_t	lso_version;		/* interface version */
786 	t_uscalar_t	lso_flags;		/* capability flags */
787 	t_uscalar_t	lso_max;		/* maximum payload */
788 	t_uscalar_t	reserved[1];		/* reserved fields */
789 	dl_mid_t	lso_mid;		/* module ID */
790 } dl_capab_lso_t;
791 
792 /*
793  * Large Send Offload revision definition history
794  */
795 #define	LSO_CURRENT_VERSION		0x01
796 #define	LSO_VERSION_1			0x01
797 
798 /*
799  * Currently supported values of lso_flags
800  */
801 #define	LSO_TX_ENABLE			0x01	/* to enable LSO */
802 #define	LSO_TX_BASIC_TCP_IPV4		0x02	/* TCP LSO capability */
803 
804 /*
805  * DLPI interface primitive definitions.
806  *
807  * Each primitive is sent as a stream message.  It is possible that
808  * the messages may be viewed as a sequence of bytes that have the
809  * following form without any padding. The structure definition
810  * of the following messages may have to change depending on the
811  * underlying hardware architecture and crossing of a hardware
812  * boundary with a different hardware architecture.
813  *
814  * Fields in the primitives having a name of the form
815  * dl_reserved cannot be used and have the value of
816  * binary zero, no bits turned on.
817  *
818  * Each message has the name defined followed by the
819  * stream message type (M_PROTO, M_PCPROTO, M_DATA)
820  */
821 
822 /*
823  *	LOCAL MANAGEMENT SERVICE PRIMITIVES
824  */
825 
826 /*
827  * DL_INFO_REQ, M_PCPROTO type
828  */
829 typedef struct {
830 	t_uscalar_t	dl_primitive;			/* set to DL_INFO_REQ */
831 } dl_info_req_t;
832 
833 /*
834  * DL_INFO_ACK, M_PCPROTO type
835  */
836 typedef struct {
837 	t_uscalar_t	dl_primitive;		/* set to DL_INFO_ACK */
838 	t_uscalar_t	dl_max_sdu;		/* Max bytes in a DLSDU */
839 	t_uscalar_t	dl_min_sdu;		/* Min bytes in a DLSDU */
840 	t_uscalar_t	dl_addr_length;		/* length of DLSAP address */
841 	t_uscalar_t	dl_mac_type;		/* type of medium supported */
842 	t_uscalar_t	dl_reserved;		/* value set to zero */
843 	t_uscalar_t	dl_current_state;	/* state of DLPI interface */
844 	t_scalar_t	dl_sap_length;		/* length of dlsap SAP part */
845 	t_uscalar_t	dl_service_mode;	/* CO, CL or ACL */
846 	t_uscalar_t	dl_qos_length;		/* length of qos values */
847 	t_uscalar_t	dl_qos_offset;		/* offset from start of block */
848 	t_uscalar_t	dl_qos_range_length;	/* available range of qos */
849 	t_uscalar_t	dl_qos_range_offset;	/* offset from start of block */
850 	t_uscalar_t	dl_provider_style;	/* style1 or style2 */
851 	t_uscalar_t	dl_addr_offset;		/* offset of the dlsap addr */
852 	t_uscalar_t	dl_version;		/* version number */
853 	t_uscalar_t	dl_brdcst_addr_length;	/* length of broadcast addr */
854 	t_uscalar_t	dl_brdcst_addr_offset;	/* offset from start of block */
855 	t_uscalar_t	dl_growth;		/* set to zero */
856 } dl_info_ack_t;
857 
858 /*
859  * DL_ATTACH_REQ, M_PROTO type
860  */
861 typedef struct {
862 	t_uscalar_t	dl_primitive;		/* set to DL_ATTACH_REQ */
863 	t_uscalar_t	dl_ppa;			/* id of the PPA */
864 } dl_attach_req_t;
865 
866 /*
867  * DL_DETACH_REQ, M_PROTO type
868  */
869 typedef struct {
870 	t_uscalar_t	dl_primitive;		/* set to DL_DETACH_REQ */
871 } dl_detach_req_t;
872 
873 /*
874  * DL_BIND_REQ, M_PROTO type
875  */
876 typedef struct {
877 	t_uscalar_t	dl_primitive;	/* set to DL_BIND_REQ */
878 	t_uscalar_t	dl_sap;		/* info to identify dlsap addr */
879 	t_uscalar_t	dl_max_conind;	/* max # of outstanding con_ind */
880 	uint16_t	dl_service_mode;	/* CO, CL or ACL */
881 	uint16_t	dl_conn_mgmt;	/* if non-zero, is con-mgmt stream */
882 	t_uscalar_t	dl_xidtest_flg;	/* auto init. of test and xid */
883 } dl_bind_req_t;
884 
885 /*
886  * DL_BIND_ACK, M_PCPROTO type
887  */
888 typedef struct {
889 	t_uscalar_t	dl_primitive;	/* DL_BIND_ACK */
890 	t_uscalar_t	dl_sap;		/* DLSAP addr info */
891 	t_uscalar_t	dl_addr_length;	/* length of complete DLSAP addr */
892 	t_uscalar_t	dl_addr_offset;	/* offset from start of M_PCPROTO */
893 	t_uscalar_t	dl_max_conind;	/* allowed max. # of con-ind */
894 	t_uscalar_t	dl_xidtest_flg;	/* responses supported by provider */
895 } dl_bind_ack_t;
896 
897 /*
898  * DL_SUBS_BIND_REQ, M_PROTO type
899  */
900 typedef struct {
901 	t_uscalar_t	dl_primitive;		/* DL_SUBS_BIND_REQ */
902 	t_uscalar_t	dl_subs_sap_offset;	/* offset of subs_sap */
903 	t_uscalar_t	dl_subs_sap_length;	/* length of subs_sap */
904 	t_uscalar_t	dl_subs_bind_class;	/* peer or hierarchical */
905 } dl_subs_bind_req_t;
906 
907 /*
908  * DL_SUBS_BIND_ACK, M_PCPROTO type
909  */
910 typedef struct {
911 	t_uscalar_t dl_primitive;	/* DL_SUBS_BIND_ACK */
912 	t_uscalar_t dl_subs_sap_offset;	/* offset of subs_sap */
913 	t_uscalar_t dl_subs_sap_length;	/* length of subs_sap */
914 } dl_subs_bind_ack_t;
915 
916 /*
917  * DL_UNBIND_REQ, M_PROTO type
918  */
919 typedef struct {
920 	t_uscalar_t	dl_primitive;	/* DL_UNBIND_REQ */
921 } dl_unbind_req_t;
922 
923 /*
924  * DL_SUBS_UNBIND_REQ, M_PROTO type
925  */
926 typedef struct {
927 	t_uscalar_t	dl_primitive;		/* DL_SUBS_UNBIND_REQ */
928 	t_uscalar_t	dl_subs_sap_offset;	/* offset of subs_sap */
929 	t_uscalar_t	dl_subs_sap_length;	/* length of subs_sap */
930 } dl_subs_unbind_req_t;
931 
932 /*
933  * DL_OK_ACK, M_PCPROTO type
934  */
935 typedef struct {
936 	t_uscalar_t	dl_primitive;		/* DL_OK_ACK */
937 	t_uscalar_t	dl_correct_primitive;	/* primitive acknowledged */
938 } dl_ok_ack_t;
939 
940 /*
941  * DL_ERROR_ACK, M_PCPROTO type
942  */
943 typedef struct {
944 	t_uscalar_t	dl_primitive;		/* DL_ERROR_ACK */
945 	t_uscalar_t	dl_error_primitive;	/* primitive in error */
946 	t_uscalar_t	dl_errno;		/* DLPI error code */
947 	t_uscalar_t	dl_unix_errno;		/* UNIX system error code */
948 } dl_error_ack_t;
949 
950 /*
951  * DL_ENABMULTI_REQ, M_PROTO type
952  */
953 typedef struct {
954 	t_uscalar_t	dl_primitive;	/* DL_ENABMULTI_REQ */
955 	t_uscalar_t	dl_addr_length;	/* length of multicast address */
956 	t_uscalar_t	dl_addr_offset;	/* offset from start of M_PROTO block */
957 } dl_enabmulti_req_t;
958 
959 /*
960  * DL_DISABMULTI_REQ, M_PROTO type
961  */
962 
963 typedef struct {
964 	t_uscalar_t	dl_primitive;	/* DL_DISABMULTI_REQ */
965 	t_uscalar_t	dl_addr_length;	/* length of multicast address */
966 	t_uscalar_t	dl_addr_offset;	/* offset from start of M_PROTO block */
967 } dl_disabmulti_req_t;
968 
969 /*
970  * DL_PROMISCON_REQ, M_PROTO type
971  */
972 
973 typedef struct {
974 	t_uscalar_t	dl_primitive;	/* DL_PROMISCON_REQ */
975 	t_uscalar_t	dl_level;	/* physical,SAP, or ALL multicast */
976 } dl_promiscon_req_t;
977 
978 /*
979  * DL_PROMISCOFF_REQ, M_PROTO type
980  */
981 
982 typedef struct {
983 	t_uscalar_t	dl_primitive;	/* DL_PROMISCOFF_REQ */
984 	t_uscalar_t	dl_level;	/* Physical,SAP, or ALL multicast */
985 } dl_promiscoff_req_t;
986 
987 /*
988  *	Primitives to get and set the Physical address
989  */
990 
991 /*
992  * DL_PHYS_ADDR_REQ, M_PROTO type
993  */
994 typedef	struct {
995 	t_uscalar_t	dl_primitive;	/* DL_PHYS_ADDR_REQ */
996 	t_uscalar_t	dl_addr_type;	/* factory or current physical addr */
997 } dl_phys_addr_req_t;
998 
999 /*
1000  * DL_PHYS_ADDR_ACK, M_PCPROTO type
1001  */
1002 typedef struct {
1003 	t_uscalar_t	dl_primitive;	/* DL_PHYS_ADDR_ACK */
1004 	t_uscalar_t	dl_addr_length;	/* length of the physical addr */
1005 	t_uscalar_t	dl_addr_offset;	/* offset from start of block */
1006 } dl_phys_addr_ack_t;
1007 
1008 /*
1009  * DL_SET_PHYS_ADDR_REQ, M_PROTO type
1010  */
1011 typedef struct {
1012 	t_uscalar_t	dl_primitive;	/* DL_SET_PHYS_ADDR_REQ */
1013 	t_uscalar_t	dl_addr_length;	/* length of physical addr */
1014 	t_uscalar_t	dl_addr_offset;	/* offset from start of block */
1015 } dl_set_phys_addr_req_t;
1016 
1017 /*
1018  *	Primitives to get statistics
1019  */
1020 
1021 /*
1022  * DL_GET_STATISTICS_REQ, M_PROTO type
1023  */
1024 typedef struct {
1025 	t_uscalar_t	dl_primitive;		/* DL_GET_STATISTICS_REQ */
1026 } dl_get_statistics_req_t;
1027 
1028 /*
1029  * DL_GET_STATISTICS_ACK, M_PCPROTO type
1030  */
1031 typedef struct {
1032 	t_uscalar_t	dl_primitive;	/* DL_GET_STATISTICS_ACK */
1033 	t_uscalar_t	dl_stat_length;	/* length of statistics structure */
1034 	t_uscalar_t	dl_stat_offset;	/* offset from start of block */
1035 } dl_get_statistics_ack_t;
1036 
1037 /*
1038  *	Solaris specific local management service primitives
1039  */
1040 
1041 /*
1042  * DL_NOTIFY_REQ, M_PROTO type
1043  */
1044 typedef struct {
1045 	t_uscalar_t	dl_primitive;	/* set to DL_NOTIFY_REQ */
1046 	uint32_t	dl_notifications; /* Requested set of notifications */
1047 	uint32_t	dl_timelimit;	/* In milliseconds */
1048 } dl_notify_req_t;
1049 
1050 /*
1051  * DL_NOTIFY_ACK, M_PROTO type
1052  */
1053 typedef struct {
1054 	t_uscalar_t	dl_primitive;	/* set to DL_NOTIFY_ACK */
1055 	uint32_t	dl_notifications; /* Supported set of notifications */
1056 } dl_notify_ack_t;
1057 
1058 /*
1059  * DL_NOTIFY_IND, M_PROTO type
1060  */
1061 typedef struct {
1062 	t_uscalar_t	dl_primitive;	/* set to DL_NOTIFY_IND */
1063 	uint32_t	dl_notification; /* Which notification? */
1064 	uint32_t	dl_data;	/* notification specific */
1065 	t_uscalar_t	dl_addr_length;	/* length of complete DLSAP addr */
1066 	t_uscalar_t	dl_addr_offset;	/* offset from start of M_PROTO */
1067 } dl_notify_ind_t;
1068 
1069 /*
1070  * DL_AGGR_REQ, M_PROTO type
1071  */
1072 typedef struct {
1073 	t_uscalar_t	dl_primitive;	/* set to DL_AGGR_REQ */
1074 	uint32_t	dl_key;		/* Key identifying the group */
1075 	uint32_t	dl_port;	/* Identifying the NIC */
1076 	t_uscalar_t	dl_addr_length;	/* length of PHYS addr addr */
1077 	t_uscalar_t	dl_addr_offset;	/* offset from start of M_PROTO */
1078 } dl_aggr_req_t;
1079 
1080 /*
1081  * DL_AGGR_IND, M_PROTO type
1082  */
1083 typedef struct {
1084 	t_uscalar_t	dl_primitive;	/* set to DL_AGGR_IND */
1085 	uint32_t	dl_key;		/* Key identifying the group */
1086 	uint32_t	dl_port;	/* Identifying the NIC */
1087 	t_uscalar_t	dl_addr_length;	/* length of PHYS addr */
1088 	t_uscalar_t	dl_addr_offset;	/* offset from start of M_PROTO */
1089 } dl_aggr_ind_t;
1090 
1091 /*
1092  * DL_UNAGGR_REQ, M_PROTO type
1093  */
1094 typedef struct {
1095 	t_uscalar_t	dl_primitive;	/* set to DL_UNAGGR_REQ */
1096 	uint32_t	dl_key;		/* Key identifying the group */
1097 	uint32_t	dl_port;	/* Identifying the NIC */
1098 	t_uscalar_t	dl_addr_length;	/* length of PHYS addr */
1099 	t_uscalar_t	dl_addr_offset;	/* offset from start of M_PROTO */
1100 } dl_unaggr_req_t;
1101 
1102 /*
1103  * DL_CAPABILITY_REQ, M_PROTO type
1104  */
1105 typedef struct {
1106 	t_uscalar_t	dl_primitive;	/* DL_CAPABILITY_REQ */
1107 	t_uscalar_t	dl_sub_offset;	/* options offset */
1108 	t_uscalar_t	dl_sub_length;	/* options length */
1109 	/* Followed by a list of zero or more dl_capability_sub_t */
1110 } dl_capability_req_t;
1111 
1112 /*
1113  * DL_CAPABILITY_ACK, M_PROTO type
1114  */
1115 typedef struct {
1116 	t_uscalar_t	dl_primitive;	/* DL_CAPABILITY_ACK */
1117 	t_uscalar_t	dl_sub_offset;	/* options offset */
1118 	t_uscalar_t	dl_sub_length;	/* options length */
1119 	/* Followed by a list of zero or more dl_capability_sub_t */
1120 } dl_capability_ack_t;
1121 
1122 /*
1123  * DL_CONTROL_REQ, M_PROTO type
1124  */
1125 typedef struct {
1126 	t_uscalar_t	dl_primitive;	/* DL_CONTROL_REQ */
1127 	t_uscalar_t	dl_operation;	/* add/delete/purge */
1128 	t_uscalar_t	dl_type;	/* e.g. AH/ESP/ ... */
1129 	t_uscalar_t	dl_key_offset;	/* offset of key */
1130 	t_uscalar_t	dl_key_length;	/* length of key */
1131 	t_uscalar_t	dl_data_offset;	/* offset of data */
1132 	t_uscalar_t	dl_data_length;	/* length of data */
1133 } dl_control_req_t;
1134 
1135 /*
1136  * DL_CONTROL_ACK, M_PROTO type
1137  */
1138 typedef struct {
1139 	t_uscalar_t	dl_primitive;	/* DL_CONTROL_ACK */
1140 	t_uscalar_t	dl_operation;	/* add/delete/purge */
1141 	t_uscalar_t	dl_type;	/* e.g. AH/ESP/ ... */
1142 	t_uscalar_t	dl_key_offset;	/* offset of key */
1143 	t_uscalar_t	dl_key_length;	/* length of key */
1144 	t_uscalar_t	dl_data_offset;	/* offset of data */
1145 	t_uscalar_t	dl_data_length;	/* length of data */
1146 } dl_control_ack_t;
1147 
1148 /*
1149  * DL_PASSIVE_REQ, M_PROTO type
1150  */
1151 typedef struct {
1152 	t_uscalar_t	dl_primitive;
1153 } dl_passive_req_t;
1154 
1155 /*
1156  *	CONNECTION-ORIENTED SERVICE PRIMITIVES
1157  */
1158 
1159 /*
1160  * DL_CONNECT_REQ, M_PROTO type
1161  */
1162 typedef struct {
1163 	t_uscalar_t	dl_primitive;		/* DL_CONNECT_REQ */
1164 	t_uscalar_t	dl_dest_addr_length;	/* len. of dlsap addr */
1165 	t_uscalar_t	dl_dest_addr_offset;	/* offset */
1166 	t_uscalar_t	dl_qos_length;		/* len. of QOS parm val */
1167 	t_uscalar_t	dl_qos_offset;		/* offset */
1168 	t_uscalar_t	dl_growth;		/* set to zero */
1169 } dl_connect_req_t;
1170 
1171 /*
1172  * DL_CONNECT_IND, M_PROTO type
1173  */
1174 typedef struct {
1175 	t_uscalar_t	dl_primitive;		/* DL_CONNECT_IND */
1176 	t_uscalar_t	dl_correlation;		/* provider's correl. token */
1177 	t_uscalar_t	dl_called_addr_length;  /* length of called address */
1178 	t_uscalar_t	dl_called_addr_offset;	/* offset from start of block */
1179 	t_uscalar_t	dl_calling_addr_length;	/* length of calling address */
1180 	t_uscalar_t	dl_calling_addr_offset;	/* offset from start of block */
1181 	t_uscalar_t	dl_qos_length;		/* length of qos structure */
1182 	t_uscalar_t	dl_qos_offset;		/* offset from start of block */
1183 	t_uscalar_t	dl_growth;		/* set to zero */
1184 } dl_connect_ind_t;
1185 
1186 /*
1187  * DL_CONNECT_RES, M_PROTO type
1188  */
1189 typedef struct {
1190 	t_uscalar_t	dl_primitive;	/* DL_CONNECT_RES */
1191 	t_uscalar_t	dl_correlation; /* provider's correlation token */
1192 	t_uscalar_t	dl_resp_token;	/* token of responding stream */
1193 	t_uscalar_t	dl_qos_length;  /* length of qos structure */
1194 	t_uscalar_t	dl_qos_offset;	/* offset from start of block */
1195 	t_uscalar_t	dl_growth;	/* set to zero */
1196 } dl_connect_res_t;
1197 
1198 /*
1199  * DL_CONNECT_CON, M_PROTO type
1200  */
1201 typedef struct {
1202 	t_uscalar_t	dl_primitive;		/* DL_CONNECT_CON */
1203 	t_uscalar_t	dl_resp_addr_length;	/* responder's address len */
1204 	t_uscalar_t	dl_resp_addr_offset;	/* offset from start of block */
1205 	t_uscalar_t	dl_qos_length;		/* length of qos structure */
1206 	t_uscalar_t	dl_qos_offset;		/* offset from start of block */
1207 	t_uscalar_t	dl_growth;		/* set to zero */
1208 } dl_connect_con_t;
1209 
1210 /*
1211  * DL_TOKEN_REQ, M_PCPROTO type
1212  */
1213 typedef struct {
1214 	t_uscalar_t	dl_primitive;	/* DL_TOKEN_REQ */
1215 } dl_token_req_t;
1216 
1217 /*
1218  * DL_TOKEN_ACK, M_PCPROTO type
1219  */
1220 typedef struct {
1221 	t_uscalar_t	dl_primitive;	/* DL_TOKEN_ACK */
1222 	t_uscalar_t	dl_token;	/* Connection response token */
1223 }dl_token_ack_t;
1224 
1225 /*
1226  * DL_DISCONNECT_REQ, M_PROTO type
1227  */
1228 typedef struct {
1229 	t_uscalar_t	dl_primitive;	/* DL_DISCONNECT_REQ */
1230 	t_uscalar_t	dl_reason;	/* norm., abnorm., perm. or trans. */
1231 	t_uscalar_t	dl_correlation; /* association with connect_ind */
1232 } dl_disconnect_req_t;
1233 
1234 /*
1235  * DL_DISCONNECT_IND, M_PROTO type
1236  */
1237 typedef struct {
1238 	t_uscalar_t	dl_primitive;	/* DL_DISCONNECT_IND */
1239 	t_uscalar_t	dl_originator;	/* USER or PROVIDER */
1240 	t_uscalar_t	dl_reason;	/* permanent or transient */
1241 	t_uscalar_t	dl_correlation;	/* association with connect_ind */
1242 } dl_disconnect_ind_t;
1243 
1244 /*
1245  * DL_RESET_REQ, M_PROTO type
1246  */
1247 typedef struct {
1248 	t_uscalar_t	dl_primitive;	/* DL_RESET_REQ */
1249 } dl_reset_req_t;
1250 
1251 /*
1252  * DL_RESET_IND, M_PROTO type
1253  */
1254 typedef struct {
1255 	t_uscalar_t	dl_primitive;	/* DL_RESET_IND */
1256 	t_uscalar_t	dl_originator;	/* Provider or User */
1257 	t_uscalar_t	dl_reason;	/* flow control, link error, resync */
1258 } dl_reset_ind_t;
1259 
1260 /*
1261  * DL_RESET_RES, M_PROTO type
1262  */
1263 typedef struct {
1264 	t_uscalar_t	dl_primitive;		/* DL_RESET_RES */
1265 } dl_reset_res_t;
1266 
1267 /*
1268  * DL_RESET_CON, M_PROTO type
1269  */
1270 typedef struct {
1271 	t_uscalar_t	dl_primitive;		/* DL_RESET_CON */
1272 } dl_reset_con_t;
1273 
1274 
1275 /*
1276  *	CONNECTIONLESS SERVICE PRIMITIVES
1277  */
1278 
1279 /*
1280  * DL_UNITDATA_REQ, M_PROTO type, with M_DATA block(s)
1281  */
1282 typedef struct {
1283 	t_uscalar_t	dl_primitive;		/* DL_UNITDATA_REQ */
1284 	t_uscalar_t	dl_dest_addr_length;	/* DLSAP length of dest. user */
1285 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
1286 	dl_priority_t	dl_priority;	/* priority value */
1287 } dl_unitdata_req_t;
1288 
1289 /*
1290  * DL_UNITDATA_IND, M_PROTO type, with M_DATA block(s)
1291  */
1292 typedef struct {
1293 	t_uscalar_t	dl_primitive;		/* DL_UNITDATA_IND */
1294 	t_uscalar_t	dl_dest_addr_length;	/* DLSAP length of dest. user */
1295 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
1296 	t_uscalar_t	dl_src_addr_length;	/* DLSAP addr length sender */
1297 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
1298 	t_uscalar_t	dl_group_address;	/* one if multicast/broadcast */
1299 } dl_unitdata_ind_t;
1300 
1301 /*
1302  * DL_UDERROR_IND, M_PROTO type
1303  *	(or M_PCPROTO type if LLI-based provider)
1304  */
1305 typedef struct {
1306 	t_uscalar_t	dl_primitive;		/* DL_UDERROR_IND */
1307 	t_uscalar_t	dl_dest_addr_length;	/* Destination DLSAP */
1308 	t_uscalar_t	dl_dest_addr_offset;	/* Offset from start of block */
1309 	t_uscalar_t	dl_unix_errno;		/* unix system error code */
1310 	t_uscalar_t	dl_errno;		/* DLPI error code */
1311 } dl_uderror_ind_t;
1312 
1313 /*
1314  * DL_UDQOS_REQ, M_PROTO type
1315  */
1316 typedef struct {
1317 	t_uscalar_t	dl_primitive;	/* DL_UDQOS_REQ */
1318 	t_uscalar_t	dl_qos_length;	/* requested qos byte length */
1319 	t_uscalar_t	dl_qos_offset;	/* offset from start of block */
1320 } dl_udqos_req_t;
1321 
1322 /*
1323  *	Primitives to handle XID and TEST operations
1324  */
1325 
1326 /*
1327  * DL_TEST_REQ, M_PROTO type
1328  */
1329 typedef struct {
1330 	t_uscalar_t	dl_primitive;		/* DL_TEST_REQ */
1331 	t_uscalar_t	dl_flag;		/* poll/final */
1332 	t_uscalar_t	dl_dest_addr_length;	/* DLSAP length of dest. user */
1333 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
1334 } dl_test_req_t;
1335 
1336 /*
1337  * DL_TEST_IND, M_PROTO type
1338  */
1339 typedef struct {
1340 	t_uscalar_t	dl_primitive;		/* DL_TEST_IND */
1341 	t_uscalar_t	dl_flag;		/* poll/final */
1342 	t_uscalar_t	dl_dest_addr_length;	/* dlsap length of dest. user */
1343 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
1344 	t_uscalar_t	dl_src_addr_length;	/* dlsap length of source */
1345 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
1346 } dl_test_ind_t;
1347 
1348 /*
1349  *	DL_TEST_RES, M_PROTO type
1350  */
1351 typedef struct {
1352 	t_uscalar_t	dl_primitive;		/* DL_TEST_RES */
1353 	t_uscalar_t	dl_flag;		/* poll/final */
1354 	t_uscalar_t	dl_dest_addr_length;	/* DLSAP length of dest. user */
1355 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
1356 } dl_test_res_t;
1357 
1358 /*
1359  *	DL_TEST_CON, M_PROTO type
1360  */
1361 typedef struct {
1362 	t_uscalar_t	dl_primitive;		/* DL_TEST_CON */
1363 	t_uscalar_t	dl_flag;		/* poll/final */
1364 	t_uscalar_t	dl_dest_addr_length;	/* dlsap length of dest. user */
1365 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
1366 	t_uscalar_t	dl_src_addr_length;	/* dlsap length of source */
1367 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
1368 } dl_test_con_t;
1369 
1370 /*
1371  * DL_XID_REQ, M_PROTO type
1372  */
1373 typedef struct {
1374 	t_uscalar_t	dl_primitive;		/* DL_XID_REQ */
1375 	t_uscalar_t	dl_flag;		/* poll/final */
1376 	t_uscalar_t	dl_dest_addr_length;	/* dlsap length of dest. user */
1377 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
1378 } dl_xid_req_t;
1379 
1380 /*
1381  * DL_XID_IND, M_PROTO type
1382  */
1383 typedef struct {
1384 	t_uscalar_t	dl_primitive;		/* DL_XID_IND */
1385 	t_uscalar_t	dl_flag;		/* poll/final */
1386 	t_uscalar_t	dl_dest_addr_length;	/* dlsap length of dest. user */
1387 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
1388 	t_uscalar_t	dl_src_addr_length;	/* dlsap length of source */
1389 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
1390 } dl_xid_ind_t;
1391 
1392 /*
1393  *	DL_XID_RES, M_PROTO type
1394  */
1395 typedef struct {
1396 	t_uscalar_t	dl_primitive;		/* DL_XID_RES */
1397 	t_uscalar_t	dl_flag;		/* poll/final */
1398 	t_uscalar_t	dl_dest_addr_length;	/* DLSAP length of dest. user */
1399 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
1400 } dl_xid_res_t;
1401 
1402 /*
1403  *	DL_XID_CON, M_PROTO type
1404  */
1405 typedef struct {
1406 	t_uscalar_t	dl_primitive;		/* DL_XID_CON */
1407 	t_uscalar_t	dl_flag;		/* poll/final */
1408 	t_uscalar_t	dl_dest_addr_length;	/* dlsap length of dest. user */
1409 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
1410 	t_uscalar_t	dl_src_addr_length;	/* dlsap length of source */
1411 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
1412 } dl_xid_con_t;
1413 
1414 /*
1415  *	ACKNOWLEDGED CONNECTIONLESS SERVICE PRIMITIVES
1416  */
1417 
1418 /*
1419  * DL_DATA_ACK_REQ, M_PROTO type
1420  */
1421 typedef struct {
1422 	t_uscalar_t	dl_primitive;		/* DL_DATA_ACK_REQ */
1423 	t_uscalar_t	dl_correlation;		/* User's correlation token */
1424 	t_uscalar_t	dl_dest_addr_length;	/* length of destination addr */
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;		/* priority */
1429 	t_uscalar_t	dl_service_class;	/* DL_RQST_RSP|DL_RQST_NORSP */
1430 } dl_data_ack_req_t;
1431 
1432 /*
1433  * DL_DATA_ACK_IND, M_PROTO type
1434  */
1435 typedef struct {
1436 	t_uscalar_t	dl_primitive;		/* DL_DATA_ACK_IND */
1437 	t_uscalar_t	dl_dest_addr_length;	/* length of destination addr */
1438 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
1439 	t_uscalar_t	dl_src_addr_length;	/* length of source address */
1440 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
1441 	t_uscalar_t	dl_priority;		/* pri. for data unit transm. */
1442 	t_uscalar_t	dl_service_class;	/* DL_RQST_RSP|DL_RQST_NORSP */
1443 } dl_data_ack_ind_t;
1444 
1445 /*
1446  * DL_DATA_ACK_STATUS_IND, M_PROTO type
1447  */
1448 typedef struct {
1449 	t_uscalar_t	dl_primitive;	/* DL_DATA_ACK_STATUS_IND */
1450 	t_uscalar_t	dl_correlation;	/* User's correlation token */
1451 	t_uscalar_t	dl_status;	/* success or failure of previous req */
1452 } dl_data_ack_status_ind_t;
1453 
1454 /*
1455  * DL_REPLY_REQ, M_PROTO type
1456  */
1457 typedef struct {
1458 	t_uscalar_t	dl_primitive;		/* DL_REPLY_REQ */
1459 	t_uscalar_t	dl_correlation;		/* User's correlation token */
1460 	t_uscalar_t	dl_dest_addr_length;	/* destination address length */
1461 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
1462 	t_uscalar_t	dl_src_addr_length;	/* source address length */
1463 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
1464 	t_uscalar_t	dl_priority;		/* pri for data unit trans. */
1465 	t_uscalar_t	dl_service_class;
1466 } dl_reply_req_t;
1467 
1468 /*
1469  * DL_REPLY_IND, M_PROTO type
1470  */
1471 typedef struct {
1472 	t_uscalar_t	dl_primitive;		/* DL_REPLY_IND */
1473 	t_uscalar_t	dl_dest_addr_length;	/* destination address length */
1474 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
1475 	t_uscalar_t	dl_src_addr_length;	/* length of source address */
1476 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
1477 	t_uscalar_t	dl_priority;		/* pri for data unit trans. */
1478 	t_uscalar_t	dl_service_class;	/* DL_RQST_RSP|DL_RQST_NORSP */
1479 } dl_reply_ind_t;
1480 
1481 /*
1482  * DL_REPLY_STATUS_IND, M_PROTO type
1483  */
1484 typedef struct {
1485 	t_uscalar_t	dl_primitive;	/* DL_REPLY_STATUS_IND */
1486 	t_uscalar_t	dl_correlation;	/* User's correlation token */
1487 	t_uscalar_t	dl_status;	/* success or failure of previous req */
1488 } dl_reply_status_ind_t;
1489 
1490 /*
1491  * DL_REPLY_UPDATE_REQ, M_PROTO type
1492  */
1493 typedef struct {
1494 	t_uscalar_t	dl_primitive;		/* DL_REPLY_UPDATE_REQ */
1495 	t_uscalar_t	dl_correlation;		/* user's correlation token */
1496 	t_uscalar_t	dl_src_addr_length;	/* length of source address */
1497 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
1498 } dl_reply_update_req_t;
1499 
1500 /*
1501  * DL_REPLY_UPDATE_STATUS_IND, M_PROTO type
1502  */
1503 typedef struct {
1504 	t_uscalar_t	dl_primitive;	/* DL_REPLY_UPDATE_STATUS_IND */
1505 	t_uscalar_t	dl_correlation;	/* User's correlation token */
1506 	t_uscalar_t	dl_status;	/* success or failure of previous req */
1507 } dl_reply_update_status_ind_t;
1508 
1509 union DL_primitives {
1510 	t_uscalar_t		dl_primitive;
1511 	dl_info_req_t		info_req;
1512 	dl_info_ack_t		info_ack;
1513 	dl_attach_req_t		attach_req;
1514 	dl_detach_req_t		detach_req;
1515 	dl_bind_req_t		bind_req;
1516 	dl_bind_ack_t		bind_ack;
1517 	dl_unbind_req_t		unbind_req;
1518 	dl_subs_bind_req_t	subs_bind_req;
1519 	dl_subs_bind_ack_t	subs_bind_ack;
1520 	dl_subs_unbind_req_t	subs_unbind_req;
1521 	dl_ok_ack_t		ok_ack;
1522 	dl_error_ack_t		error_ack;
1523 	dl_connect_req_t	connect_req;
1524 	dl_connect_ind_t	connect_ind;
1525 	dl_connect_res_t	connect_res;
1526 	dl_connect_con_t	connect_con;
1527 	dl_token_req_t		token_req;
1528 	dl_token_ack_t		token_ack;
1529 	dl_disconnect_req_t	disconnect_req;
1530 	dl_disconnect_ind_t	disconnect_ind;
1531 	dl_reset_req_t		reset_req;
1532 	dl_reset_ind_t		reset_ind;
1533 	dl_reset_res_t		reset_res;
1534 	dl_reset_con_t		reset_con;
1535 	dl_unitdata_req_t	unitdata_req;
1536 	dl_unitdata_ind_t	unitdata_ind;
1537 	dl_uderror_ind_t	uderror_ind;
1538 	dl_udqos_req_t		udqos_req;
1539 	dl_enabmulti_req_t	enabmulti_req;
1540 	dl_disabmulti_req_t	disabmulti_req;
1541 	dl_promiscon_req_t	promiscon_req;
1542 	dl_promiscoff_req_t	promiscoff_req;
1543 	dl_phys_addr_req_t	physaddr_req;
1544 	dl_phys_addr_ack_t	physaddr_ack;
1545 	dl_set_phys_addr_req_t	set_physaddr_req;
1546 	dl_get_statistics_req_t	get_statistics_req;
1547 	dl_get_statistics_ack_t	get_statistics_ack;
1548 	dl_notify_req_t		notify_req;
1549 	dl_notify_ack_t		notify_ack;
1550 	dl_notify_ind_t		notify_ind;
1551 	dl_aggr_req_t		aggr_req;
1552 	dl_aggr_ind_t		aggr_ind;
1553 	dl_unaggr_req_t		unaggr_req;
1554 	dl_test_req_t		test_req;
1555 	dl_test_ind_t		test_ind;
1556 	dl_test_res_t		test_res;
1557 	dl_test_con_t		test_con;
1558 	dl_xid_req_t		xid_req;
1559 	dl_xid_ind_t		xid_ind;
1560 	dl_xid_res_t		xid_res;
1561 	dl_xid_con_t		xid_con;
1562 	dl_data_ack_req_t	data_ack_req;
1563 	dl_data_ack_ind_t	data_ack_ind;
1564 	dl_data_ack_status_ind_t	data_ack_status_ind;
1565 	dl_reply_req_t		reply_req;
1566 	dl_reply_ind_t		reply_ind;
1567 	dl_reply_status_ind_t	reply_status_ind;
1568 	dl_reply_update_req_t	reply_update_req;
1569 	dl_reply_update_status_ind_t	reply_update_status_ind;
1570 	dl_capability_req_t	capability_req;
1571 	dl_capability_ack_t	capability_ack;
1572 	dl_control_req_t	control_req;
1573 	dl_control_ack_t	control_ack;
1574 	dl_passive_req_t	passive_req;
1575 };
1576 
1577 #define	DL_INFO_REQ_SIZE	sizeof (dl_info_req_t)
1578 #define	DL_INFO_ACK_SIZE	sizeof (dl_info_ack_t)
1579 #define	DL_ATTACH_REQ_SIZE	sizeof (dl_attach_req_t)
1580 #define	DL_DETACH_REQ_SIZE	sizeof (dl_detach_req_t)
1581 #define	DL_BIND_REQ_SIZE	sizeof (dl_bind_req_t)
1582 #define	DL_BIND_ACK_SIZE	sizeof (dl_bind_ack_t)
1583 #define	DL_UNBIND_REQ_SIZE	sizeof (dl_unbind_req_t)
1584 #define	DL_SUBS_BIND_REQ_SIZE	sizeof (dl_subs_bind_req_t)
1585 #define	DL_SUBS_BIND_ACK_SIZE	sizeof (dl_subs_bind_ack_t)
1586 #define	DL_SUBS_UNBIND_REQ_SIZE	sizeof (dl_subs_unbind_req_t)
1587 #define	DL_OK_ACK_SIZE		sizeof (dl_ok_ack_t)
1588 #define	DL_ERROR_ACK_SIZE	sizeof (dl_error_ack_t)
1589 #define	DL_CONNECT_REQ_SIZE	sizeof (dl_connect_req_t)
1590 #define	DL_CONNECT_IND_SIZE	sizeof (dl_connect_ind_t)
1591 #define	DL_CONNECT_RES_SIZE	sizeof (dl_connect_res_t)
1592 #define	DL_CONNECT_CON_SIZE	sizeof (dl_connect_con_t)
1593 #define	DL_TOKEN_REQ_SIZE	sizeof (dl_token_req_t)
1594 #define	DL_TOKEN_ACK_SIZE	sizeof (dl_token_ack_t)
1595 #define	DL_DISCONNECT_REQ_SIZE	sizeof (dl_disconnect_req_t)
1596 #define	DL_DISCONNECT_IND_SIZE	sizeof (dl_disconnect_ind_t)
1597 #define	DL_RESET_REQ_SIZE	sizeof (dl_reset_req_t)
1598 #define	DL_RESET_IND_SIZE	sizeof (dl_reset_ind_t)
1599 #define	DL_RESET_RES_SIZE	sizeof (dl_reset_res_t)
1600 #define	DL_RESET_CON_SIZE	sizeof (dl_reset_con_t)
1601 #define	DL_UNITDATA_REQ_SIZE	sizeof (dl_unitdata_req_t)
1602 #define	DL_UNITDATA_IND_SIZE	sizeof (dl_unitdata_ind_t)
1603 #define	DL_UDERROR_IND_SIZE	sizeof (dl_uderror_ind_t)
1604 #define	DL_UDQOS_REQ_SIZE	sizeof (dl_udqos_req_t)
1605 #define	DL_ENABMULTI_REQ_SIZE	sizeof (dl_enabmulti_req_t)
1606 #define	DL_DISABMULTI_REQ_SIZE	sizeof (dl_disabmulti_req_t)
1607 #define	DL_PROMISCON_REQ_SIZE	sizeof (dl_promiscon_req_t)
1608 #define	DL_PROMISCOFF_REQ_SIZE	sizeof (dl_promiscoff_req_t)
1609 #define	DL_PHYS_ADDR_REQ_SIZE	sizeof (dl_phys_addr_req_t)
1610 #define	DL_PHYS_ADDR_ACK_SIZE	sizeof (dl_phys_addr_ack_t)
1611 #define	DL_SET_PHYS_ADDR_REQ_SIZE	sizeof (dl_set_phys_addr_req_t)
1612 #define	DL_GET_STATISTICS_REQ_SIZE	sizeof (dl_get_statistics_req_t)
1613 #define	DL_GET_STATISTICS_ACK_SIZE	sizeof (dl_get_statistics_ack_t)
1614 #define	DL_NOTIFY_REQ_SIZE	sizeof (dl_notify_req_t)
1615 #define	DL_NOTIFY_ACK_SIZE	sizeof (dl_notify_ack_t)
1616 #define	DL_NOTIFY_IND_SIZE	sizeof (dl_notify_ind_t)
1617 #define	DL_AGGR_REQ_SIZE	sizeof (dl_aggr_req_t)
1618 #define	DL_AGGR_IND_SIZE	sizeof (dl_aggr_ind_t)
1619 #define	DL_UNAGGR_REQ_SIZE	sizeof (dl_unaggr_req_t)
1620 #define	DL_XID_REQ_SIZE		sizeof (dl_xid_req_t)
1621 #define	DL_XID_IND_SIZE		sizeof (dl_xid_ind_t)
1622 #define	DL_XID_RES_SIZE		sizeof (dl_xid_res_t)
1623 #define	DL_XID_CON_SIZE		sizeof (dl_xid_con_t)
1624 #define	DL_TEST_REQ_SIZE	sizeof (dl_test_req_t)
1625 #define	DL_TEST_IND_SIZE	sizeof (dl_test_ind_t)
1626 #define	DL_TEST_RES_SIZE	sizeof (dl_test_res_t)
1627 #define	DL_TEST_CON_SIZE	sizeof (dl_test_con_t)
1628 #define	DL_DATA_ACK_REQ_SIZE	sizeof (dl_data_ack_req_t)
1629 #define	DL_DATA_ACK_IND_SIZE	sizeof (dl_data_ack_ind_t)
1630 #define	DL_DATA_ACK_STATUS_IND_SIZE	sizeof (dl_data_ack_status_ind_t)
1631 #define	DL_REPLY_REQ_SIZE	sizeof (dl_reply_req_t)
1632 #define	DL_REPLY_IND_SIZE	sizeof (dl_reply_ind_t)
1633 #define	DL_REPLY_STATUS_IND_SIZE	sizeof (dl_reply_status_ind_t)
1634 #define	DL_REPLY_UPDATE_REQ_SIZE	sizeof (dl_reply_update_req_t)
1635 #define	DL_REPLY_UPDATE_STATUS_IND_SIZE	sizeof (dl_reply_update_status_ind_t)
1636 #define	DL_CAPABILITY_REQ_SIZE	sizeof (dl_capability_req_t)
1637 #define	DL_CAPABILITY_ACK_SIZE	sizeof (dl_capability_ack_t)
1638 #define	DL_CONTROL_REQ_SIZE	sizeof (dl_control_req_t)
1639 #define	DL_CONTROL_ACK_SIZE	sizeof (dl_control_ack_t)
1640 #define	DL_PASSIVE_REQ_SIZE	sizeof (dl_passive_req_t)
1641 
1642 #ifdef	_KERNEL
1643 /*
1644  * The following are unstable, internal DLPI utility routines.
1645  */
1646 extern void	dlbindack(queue_t *, mblk_t *, t_scalar_t, void *, t_uscalar_t,
1647 		    t_uscalar_t, t_uscalar_t);
1648 extern void	dlokack(queue_t *, mblk_t *, t_uscalar_t);
1649 extern void	dlerrorack(queue_t *, mblk_t *, t_uscalar_t, t_uscalar_t,
1650 		    t_uscalar_t);
1651 extern void	dluderrorind(queue_t *, mblk_t *, void *, t_uscalar_t,
1652 		    t_uscalar_t, t_uscalar_t);
1653 extern void	dlphysaddrack(queue_t *, mblk_t *, void *, t_uscalar_t);
1654 extern void	dlcapabsetqid(dl_mid_t *, const queue_t *);
1655 extern boolean_t dlcapabcheckqid(const dl_mid_t *, const queue_t *);
1656 extern void	dlnotifyack(queue_t *, mblk_t *, uint32_t);
1657 #endif	/* _KERNEL */
1658 
1659 #ifdef	__cplusplus
1660 }
1661 #endif
1662 
1663 #endif /* _SYS_DLPI_H */
1664