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