xref: /onnv-gate/usr/src/uts/common/sys/dlpi.h (revision 13123:9efd3d43accd)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
53115Syl150051  * Common Development and Distribution License (the "License").
63115Syl150051  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
2212748SSowmini.Varadhan@oracle.COM  * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
230Sstevel@tonic-gate  */
240Sstevel@tonic-gate 
250Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
260Sstevel@tonic-gate /*	  All Rights Reserved	*/
270Sstevel@tonic-gate 
280Sstevel@tonic-gate 
290Sstevel@tonic-gate /*
300Sstevel@tonic-gate  * Data Link Provider Interface, Version 2.0
310Sstevel@tonic-gate  * Refer to document: "STREAMS DLPI Spec", 800-6915-01.
320Sstevel@tonic-gate  */
330Sstevel@tonic-gate 
340Sstevel@tonic-gate #ifndef	_SYS_DLPI_H
350Sstevel@tonic-gate #define	_SYS_DLPI_H
360Sstevel@tonic-gate 
370Sstevel@tonic-gate #include <sys/types.h>
380Sstevel@tonic-gate #include <sys/stream.h>
390Sstevel@tonic-gate #ifdef	__cplusplus
400Sstevel@tonic-gate extern "C" {
410Sstevel@tonic-gate #endif
420Sstevel@tonic-gate 
430Sstevel@tonic-gate /*
440Sstevel@tonic-gate  * Sun additions.
450Sstevel@tonic-gate  */
460Sstevel@tonic-gate #define	DLIOC		('D' << 8)
470Sstevel@tonic-gate #define	DLIOCRAW	(DLIOC|1)	/* M_DATA "raw" mode */
483147Sxc151355 #define	DLIOCNATIVE	(DLIOC|2)	/* Native traffic mode */
495895Syz147064 #define	DLIOCMARGININFO	(DLIOC|3)	/* margin size info */
508023SPhil.Kirk@Sun.COM #define	DLIOCIPNETINFO	(DLIOC|4)	/* ipnet header */
5110491SRishi.Srivatsavai@Sun.COM #define	DLIOCLOWLINK	(DLIOC|5)	/* low-level link up/down */
520Sstevel@tonic-gate #define	DLIOCHDRINFO	(DLIOC|10)	/* IP fast-path */
538023SPhil.Kirk@Sun.COM #define	DL_IOC_HDR_INFO	DLIOCHDRINFO
548023SPhil.Kirk@Sun.COM 
558023SPhil.Kirk@Sun.COM #define	DL_IPNETINFO_VERSION	0x1
560Sstevel@tonic-gate 
578023SPhil.Kirk@Sun.COM typedef struct dl_ipnetinfo {
588023SPhil.Kirk@Sun.COM 	uint8_t		dli_version;	/* DL_IPNETINFO_* version */
5910639SDarren.Reed@Sun.COM 	uint8_t		dli_family;	/* packet IP header version */
6010639SDarren.Reed@Sun.COM 	uint16_t	dli_htype;
6110639SDarren.Reed@Sun.COM 	uint32_t	dli_pktlen;	/* length of dl_ipnetinfo_t */
6210639SDarren.Reed@Sun.COM 	uint32_t	dli_ifindex;
6310639SDarren.Reed@Sun.COM 	uint32_t	dli_grifindex;
6410639SDarren.Reed@Sun.COM 	uint32_t	dli_zsrc; 	/* packet source zone ID (if any) */
6510639SDarren.Reed@Sun.COM 	uint32_t	dli_zdst;	/* packet dest zone ID (if any) */
668023SPhil.Kirk@Sun.COM } dl_ipnetinfo_t;
670Sstevel@tonic-gate 
680Sstevel@tonic-gate /*
690Sstevel@tonic-gate  * DLPI revision definition history
700Sstevel@tonic-gate  */
710Sstevel@tonic-gate #define	DL_CURRENT_VERSION	0x02	/* current version of dlpi */
720Sstevel@tonic-gate #define	DL_VERSION_2		0x02	/* version of dlpi March 12, 1991 */
730Sstevel@tonic-gate 
740Sstevel@tonic-gate /*
750Sstevel@tonic-gate  * Primitives for Local Management Services
760Sstevel@tonic-gate  */
770Sstevel@tonic-gate #define	DL_INFO_REQ		0x00	/* Information Req */
780Sstevel@tonic-gate #define	DL_INFO_ACK		0x03	/* Information Ack */
790Sstevel@tonic-gate #define	DL_ATTACH_REQ		0x0b	/* Attach a PPA */
800Sstevel@tonic-gate #define	DL_DETACH_REQ		0x0c	/* Detach a PPA */
818518SPeter.Memishian@Sun.COM #define	DL_BIND_REQ		0x01	/* Bind DLSAP address */
828518SPeter.Memishian@Sun.COM #define	DL_BIND_ACK		0x04	/* DLSAP address bound */
838518SPeter.Memishian@Sun.COM #define	DL_UNBIND_REQ		0x02	/* Unbind DLSAP address */
840Sstevel@tonic-gate #define	DL_OK_ACK		0x06	/* Success acknowledgment */
850Sstevel@tonic-gate #define	DL_ERROR_ACK		0x05	/* Error acknowledgment */
860Sstevel@tonic-gate #define	DL_SUBS_BIND_REQ	0x1b	/* Bind Subsequent DLSAP address */
870Sstevel@tonic-gate #define	DL_SUBS_BIND_ACK	0x1c	/* Subsequent DLSAP address bound */
880Sstevel@tonic-gate #define	DL_SUBS_UNBIND_REQ	0x15	/* Subsequent unbind */
890Sstevel@tonic-gate #define	DL_ENABMULTI_REQ	0x1d	/* Enable multicast addresses */
900Sstevel@tonic-gate #define	DL_DISABMULTI_REQ	0x1e	/* Disable multicast addresses */
910Sstevel@tonic-gate #define	DL_PROMISCON_REQ	0x1f	/* Turn on promiscuous mode */
920Sstevel@tonic-gate #define	DL_PROMISCOFF_REQ	0x20	/* Turn off promiscuous mode */
930Sstevel@tonic-gate 
940Sstevel@tonic-gate /*
950Sstevel@tonic-gate  * Solaris specific local management
960Sstevel@tonic-gate  */
970Sstevel@tonic-gate #define	DL_NOTIFY_REQ		0x100	/* Enable notifications */
980Sstevel@tonic-gate #define	DL_NOTIFY_ACK		0x101	/* Supported notifications */
990Sstevel@tonic-gate #define	DL_NOTIFY_IND		0x102	/* Notification from provider */
1000Sstevel@tonic-gate #define	DL_AGGR_REQ		0x103	/* Enable link aggregation */
1010Sstevel@tonic-gate #define	DL_AGGR_IND		0x104	/* Result from link aggregation */
1020Sstevel@tonic-gate #define	DL_UNAGGR_REQ		0x105	/* Disable link aggregation */
1030Sstevel@tonic-gate #define	DL_CAPABILITY_REQ	0x110	/* Capability request */
1040Sstevel@tonic-gate #define	DL_CAPABILITY_ACK	0x111	/* Capability ack */
1050Sstevel@tonic-gate #define	DL_CONTROL_REQ		0x112	/* Device specific control request */
1060Sstevel@tonic-gate #define	DL_CONTROL_ACK		0x113	/* Device specific control ack */
1070Sstevel@tonic-gate #define	DL_PASSIVE_REQ		0x114	/* Allow access to aggregated link */
1084617Sjoycey #define	DL_INTR_MODE_REQ	0x115	/* Request Rx processing in INTR mode */
1099073SCathy.Zhou@Sun.COM #define	DL_NOTIFY_CONF		0x116	/* Notification from upstream */
1100Sstevel@tonic-gate 
1110Sstevel@tonic-gate /*
1120Sstevel@tonic-gate  * Primitives used for Connectionless Service
1130Sstevel@tonic-gate  */
1140Sstevel@tonic-gate #define	DL_UNITDATA_REQ		0x07	/* datagram send request */
1150Sstevel@tonic-gate #define	DL_UNITDATA_IND		0x08	/* datagram receive indication */
1160Sstevel@tonic-gate #define	DL_UDERROR_IND		0x09	/* datagram error indication */
1170Sstevel@tonic-gate #define	DL_UDQOS_REQ		0x0a	/* set QOS for subsequent datagrams */
1180Sstevel@tonic-gate 
1190Sstevel@tonic-gate /*
1200Sstevel@tonic-gate  * Primitives used for Connection-Oriented Service
1210Sstevel@tonic-gate  */
1220Sstevel@tonic-gate #define	DL_CONNECT_REQ		0x0d	/* Connect request */
1230Sstevel@tonic-gate #define	DL_CONNECT_IND		0x0e	/* Incoming connect indication */
1240Sstevel@tonic-gate #define	DL_CONNECT_RES		0x0f	/* Accept previous connect indication */
1250Sstevel@tonic-gate #define	DL_CONNECT_CON		0x10	/* Connection established */
1260Sstevel@tonic-gate 
1270Sstevel@tonic-gate #define	DL_TOKEN_REQ		0x11	/* Passoff token request */
1280Sstevel@tonic-gate #define	DL_TOKEN_ACK		0x12	/* Passoff token ack */
1290Sstevel@tonic-gate 
1300Sstevel@tonic-gate #define	DL_DISCONNECT_REQ	0x13	/* Disconnect request */
1310Sstevel@tonic-gate #define	DL_DISCONNECT_IND	0x14	/* Disconnect indication */
1320Sstevel@tonic-gate 
1330Sstevel@tonic-gate #define	DL_RESET_REQ		0x17	/* Reset service request */
1340Sstevel@tonic-gate #define	DL_RESET_IND		0x18	/* Incoming reset indication */
1350Sstevel@tonic-gate #define	DL_RESET_RES		0x19	/* Complete reset processing */
1360Sstevel@tonic-gate #define	DL_RESET_CON		0x1a	/* Reset processing complete */
1370Sstevel@tonic-gate 
1380Sstevel@tonic-gate /*
1390Sstevel@tonic-gate  *  Primitives used for Acknowledged Connectionless Service
1400Sstevel@tonic-gate  */
1410Sstevel@tonic-gate 
1420Sstevel@tonic-gate #define	DL_DATA_ACK_REQ		0x21	/* data unit transmission request */
1430Sstevel@tonic-gate #define	DL_DATA_ACK_IND		0x22	/* Arrival of a command PDU */
1440Sstevel@tonic-gate #define	DL_DATA_ACK_STATUS_IND	0x23	/* Status indication of DATA_ACK_REQ */
1450Sstevel@tonic-gate #define	DL_REPLY_REQ		0x24	/* Request a DLSDU from the remote */
1460Sstevel@tonic-gate #define	DL_REPLY_IND		0x25	/* Arrival of a command PDU */
1470Sstevel@tonic-gate #define	DL_REPLY_STATUS_IND	0x26	/* Status indication of REPLY_REQ */
1480Sstevel@tonic-gate #define	DL_REPLY_UPDATE_REQ	0x27	/* Hold a DLSDU for transmission */
1490Sstevel@tonic-gate #define	DL_REPLY_UPDATE_STATUS_IND	0x28 /* Status of REPLY_UPDATE req */
1500Sstevel@tonic-gate 
1510Sstevel@tonic-gate /*
1520Sstevel@tonic-gate  * Primitives used for XID and TEST operations
1530Sstevel@tonic-gate  */
1540Sstevel@tonic-gate 
1550Sstevel@tonic-gate #define	DL_XID_REQ	0x29		/* Request to send an XID PDU */
1560Sstevel@tonic-gate #define	DL_XID_IND	0x2a		/* Arrival of an XID PDU */
1570Sstevel@tonic-gate #define	DL_XID_RES	0x2b		/* request to send a response XID PDU */
1580Sstevel@tonic-gate #define	DL_XID_CON	0x2c		/* Arrival of a response XID PDU */
1590Sstevel@tonic-gate #define	DL_TEST_REQ	0x2d		/* TEST command request */
1600Sstevel@tonic-gate #define	DL_TEST_IND	0x2e		/* TEST response indication */
1610Sstevel@tonic-gate #define	DL_TEST_RES	0x2f		/* TEST response */
1620Sstevel@tonic-gate #define	DL_TEST_CON	0x30		/* TEST Confirmation */
1630Sstevel@tonic-gate 
1640Sstevel@tonic-gate /*
1650Sstevel@tonic-gate  * Primitives to get and set the physical address, and to get
1660Sstevel@tonic-gate  * Statistics
1670Sstevel@tonic-gate  */
1680Sstevel@tonic-gate 
1690Sstevel@tonic-gate #define	DL_PHYS_ADDR_REQ	0x31	/* Request to get physical addr */
1700Sstevel@tonic-gate #define	DL_PHYS_ADDR_ACK	0x32	/* Return physical addr */
1710Sstevel@tonic-gate #define	DL_SET_PHYS_ADDR_REQ	0x33	/* set physical addr */
1720Sstevel@tonic-gate #define	DL_GET_STATISTICS_REQ	0x34	/* Request to get statistics */
1730Sstevel@tonic-gate #define	DL_GET_STATISTICS_ACK	0x35	/* Return statistics */
1740Sstevel@tonic-gate 
1750Sstevel@tonic-gate /*
1760Sstevel@tonic-gate  * Invalid primitive
1770Sstevel@tonic-gate  */
1780Sstevel@tonic-gate 
1790Sstevel@tonic-gate #define	DL_PRIM_INVAL		0xffff	/* Invalid DL primitive value */
1800Sstevel@tonic-gate 
1810Sstevel@tonic-gate /*
1820Sstevel@tonic-gate  * DLPI interface states
1830Sstevel@tonic-gate  */
1840Sstevel@tonic-gate #define	DL_UNATTACHED		0x04	/* PPA not attached */
1850Sstevel@tonic-gate #define	DL_ATTACH_PENDING	0x05	/* Waiting ack of DL_ATTACH_REQ */
1860Sstevel@tonic-gate #define	DL_DETACH_PENDING	0x06	/* Waiting ack of DL_DETACH_REQ */
1870Sstevel@tonic-gate #define	DL_UNBOUND		0x00	/* PPA attached */
1880Sstevel@tonic-gate #define	DL_BIND_PENDING		0x01	/* Waiting ack of DL_BIND_REQ */
1890Sstevel@tonic-gate #define	DL_UNBIND_PENDING	0x02	/* Waiting ack of DL_UNBIND_REQ */
1908518SPeter.Memishian@Sun.COM #define	DL_IDLE			0x03	/* DLSAP bound, awaiting use */
1910Sstevel@tonic-gate #define	DL_UDQOS_PENDING	0x07	/* Waiting ack of DL_UDQOS_REQ */
1920Sstevel@tonic-gate #define	DL_OUTCON_PENDING	0x08	/* awaiting DL_CONN_CON */
1930Sstevel@tonic-gate #define	DL_INCON_PENDING	0x09	/* awaiting DL_CONN_RES */
1940Sstevel@tonic-gate #define	DL_CONN_RES_PENDING	0x0a	/* Waiting ack of DL_CONNECT_RES */
1950Sstevel@tonic-gate #define	DL_DATAXFER		0x0b	/* connection-oriented data transfer */
1960Sstevel@tonic-gate #define	DL_USER_RESET_PENDING	0x0c	/* awaiting DL_RESET_CON */
1970Sstevel@tonic-gate #define	DL_PROV_RESET_PENDING	0x0d	/* awaiting DL_RESET_RES */
1980Sstevel@tonic-gate #define	DL_RESET_RES_PENDING	0x0e	/* Waiting ack of DL_RESET_RES */
1990Sstevel@tonic-gate #define	DL_DISCON8_PENDING	0x0f	/* Waiting ack of DL_DISC_REQ */
2000Sstevel@tonic-gate #define	DL_DISCON9_PENDING	0x10	/* Waiting ack of DL_DISC_REQ */
2010Sstevel@tonic-gate #define	DL_DISCON11_PENDING	0x11	/* Waiting ack of DL_DISC_REQ */
2020Sstevel@tonic-gate #define	DL_DISCON12_PENDING	0x12	/* Waiting ack of DL_DISC_REQ */
2030Sstevel@tonic-gate #define	DL_DISCON13_PENDING	0x13	/* Waiting ack of DL_DISC_REQ */
2040Sstevel@tonic-gate #define	DL_SUBS_BIND_PND	0x14	/* Waiting ack of DL_SUBS_BIND_REQ */
2050Sstevel@tonic-gate #define	DL_SUBS_UNBIND_PND	0x15	/* Waiting ack of DL_SUBS_UNBIND_REQ */
2060Sstevel@tonic-gate 
2070Sstevel@tonic-gate 
2080Sstevel@tonic-gate /*
2090Sstevel@tonic-gate  * DL_ERROR_ACK error return values
2100Sstevel@tonic-gate  */
2110Sstevel@tonic-gate #define	DL_ACCESS	0x02	/* Improper permissions for request */
2120Sstevel@tonic-gate #define	DL_BADADDR	0x01	/* DLSAP addr in improper format or invalid */
2130Sstevel@tonic-gate #define	DL_BADCORR	0x05	/* Seq number not from outstand DL_CONN_IND */
2140Sstevel@tonic-gate #define	DL_BADDATA	0x06	/* User data exceeded provider limit */
2150Sstevel@tonic-gate #define	DL_BADPPA	0x08	/* Specified PPA was invalid */
2160Sstevel@tonic-gate #define	DL_BADPRIM	0x09	/* Primitive received not known by provider */
2170Sstevel@tonic-gate #define	DL_BADQOSPARAM	0x0a	/* QOS parameters contained invalid values */
2180Sstevel@tonic-gate #define	DL_BADQOSTYPE	0x0b	/* QOS structure type is unknown/unsupported */
2190Sstevel@tonic-gate #define	DL_BADSAP	0x00	/* Bad LSAP selector */
2200Sstevel@tonic-gate #define	DL_BADTOKEN	0x0c	/* Token used not an active stream */
2210Sstevel@tonic-gate #define	DL_BOUND	0x0d	/* Attempted second bind with dl_max_conind */
2220Sstevel@tonic-gate #define	DL_INITFAILED	0x0e	/* Physical Link initialization failed */
2230Sstevel@tonic-gate #define	DL_NOADDR	0x0f	/* Provider couldn't allocate alt. address */
2240Sstevel@tonic-gate #define	DL_NOTINIT	0x10	/* Physical Link not initialized */
2250Sstevel@tonic-gate #define	DL_OUTSTATE	0x03	/* Primitive issued in improper state */
2260Sstevel@tonic-gate #define	DL_SYSERR	0x04	/* UNIX system error occurred */
2270Sstevel@tonic-gate #define	DL_UNSUPPORTED	0x07	/* Requested serv. not supplied by provider */
2280Sstevel@tonic-gate #define	DL_UNDELIVERABLE 0x11	/* Previous data unit could not be delivered */
2290Sstevel@tonic-gate #define	DL_NOTSUPPORTED  0x12	/* Primitive is known but not supported */
2300Sstevel@tonic-gate #define	DL_TOOMANY	0x13	/* limit exceeded	*/
2310Sstevel@tonic-gate #define	DL_NOTENAB	0x14	/* Promiscuous mode not enabled */
2320Sstevel@tonic-gate #define	DL_BUSY		0x15	/* Other streams for PPA in post-attached */
2330Sstevel@tonic-gate 
2340Sstevel@tonic-gate #define	DL_NOAUTO	0x16	/* Automatic handling XID&TEST not supported */
2350Sstevel@tonic-gate #define	DL_NOXIDAUTO	0x17    /* Automatic handling of XID not supported */
2360Sstevel@tonic-gate #define	DL_NOTESTAUTO	0x18	/* Automatic handling of TEST not supported */
2370Sstevel@tonic-gate #define	DL_XIDAUTO	0x19	/* Automatic handling of XID response */
2388518SPeter.Memishian@Sun.COM #define	DL_TESTAUTO	0x1a	/* Automatic handling of TEST response */
2390Sstevel@tonic-gate #define	DL_PENDING	0x1b	/* pending outstanding connect indications */
2400Sstevel@tonic-gate 
2410Sstevel@tonic-gate /*
2420Sstevel@tonic-gate  * DLPI media types supported
2430Sstevel@tonic-gate  */
2440Sstevel@tonic-gate #define	DL_CSMACD	0x0	/* IEEE 802.3 CSMA/CD network */
2450Sstevel@tonic-gate #define	DL_TPB		0x1	/* IEEE 802.4 Token Passing Bus */
2460Sstevel@tonic-gate #define	DL_TPR		0x2	/* IEEE 802.5 Token Passing Ring */
2470Sstevel@tonic-gate #define	DL_METRO	0x3	/* IEEE 802.6 Metro Net */
2480Sstevel@tonic-gate #define	DL_ETHER	0x4	/* Ethernet Bus */
2490Sstevel@tonic-gate #define	DL_HDLC		0x05	/* ISO HDLC protocol support */
2500Sstevel@tonic-gate #define	DL_CHAR		0x06	/* Character Synchronous protocol support */
2510Sstevel@tonic-gate #define	DL_CTCA		0x07	/* IBM Channel-to-Channel Adapter */
2520Sstevel@tonic-gate #define	DL_FDDI		0x08	/* Fiber Distributed data interface */
2530Sstevel@tonic-gate #define	DL_FC		0x10	/* Fibre Channel interface */
2540Sstevel@tonic-gate #define	DL_ATM		0x11	/* ATM */
2550Sstevel@tonic-gate #define	DL_IPATM	0x12	/* ATM Classical IP interface */
2560Sstevel@tonic-gate #define	DL_X25		0x13	/* X.25 LAPB interface */
2570Sstevel@tonic-gate #define	DL_ISDN		0x14	/* ISDN interface */
2580Sstevel@tonic-gate #define	DL_HIPPI	0x15	/* HIPPI interface */
2590Sstevel@tonic-gate #define	DL_100VG	0x16	/* 100 Based VG Ethernet */
2600Sstevel@tonic-gate #define	DL_100VGTPR	0x17	/* 100 Based VG Token Ring */
2610Sstevel@tonic-gate #define	DL_ETH_CSMA	0x18	/* ISO 8802/3 and Ethernet */
2620Sstevel@tonic-gate #define	DL_100BT	0x19	/* 100 Base T */
2630Sstevel@tonic-gate #define	DL_IB		0x1a	/* Infiniband */
2640Sstevel@tonic-gate #define	DL_FRAME	0x0a	/* Frame Relay LAPF */
2650Sstevel@tonic-gate #define	DL_MPFRAME	0x0b	/* Multi-protocol over Frame Relay */
2660Sstevel@tonic-gate #define	DL_ASYNC	0x0c	/* Character Asynchronous Protocol */
2670Sstevel@tonic-gate #define	DL_IPX25	0x0d	/* X.25 Classical IP interface */
2680Sstevel@tonic-gate #define	DL_LOOP		0x0e	/* software loopback */
2690Sstevel@tonic-gate #define	DL_OTHER	0x09	/* Any other medium not listed above */
2700Sstevel@tonic-gate /*
2710Sstevel@tonic-gate  * Private media types.  These must be above the value 0x80000000 as
2728485SPeter.Memishian@Sun.COM  * stated in the DLPI specification.  NOTE: The SUNW_ prefix is used
2738485SPeter.Memishian@Sun.COM  * to denote synthetic DLPI types that are internal to the stack.
2740Sstevel@tonic-gate  */
2750Sstevel@tonic-gate #define	DL_IPV4		0x80000001ul	/* IPv4 Tunnel Link */
2760Sstevel@tonic-gate #define	DL_IPV6		0x80000002ul	/* IPv6 Tunnel Link */
2770Sstevel@tonic-gate #define	SUNW_DL_VNI	0x80000003ul	/* Virtual network interface */
2783147Sxc151355 #define	DL_WIFI		0x80000004ul	/* IEEE 802.11 */
2798023SPhil.Kirk@Sun.COM #define	DL_IPNET	0x80000005ul	/* ipnet(7D) link */
2808485SPeter.Memishian@Sun.COM #define	SUNW_DL_IPMP	0x80000006ul	/* IPMP stub interface */
28110616SSebastien.Roy@Sun.COM #define	DL_6TO4		0x80000007ul	/* 6to4 Tunnel Link */
2828485SPeter.Memishian@Sun.COM 
2830Sstevel@tonic-gate /*
2840Sstevel@tonic-gate  * DLPI provider service supported.
2850Sstevel@tonic-gate  * These must be allowed to be bitwise-OR for dl_service_mode in
2860Sstevel@tonic-gate  * DL_INFO_ACK.
2870Sstevel@tonic-gate  */
2880Sstevel@tonic-gate #define	DL_CODLS	0x01	/* support connection-oriented service */
2890Sstevel@tonic-gate #define	DL_CLDLS	0x02	/* support connectionless data link service */
2900Sstevel@tonic-gate #define	DL_ACLDLS	0x04	/* support acknowledged connectionless serv. */
2910Sstevel@tonic-gate 
2920Sstevel@tonic-gate 
2930Sstevel@tonic-gate /*
2940Sstevel@tonic-gate  * DLPI provider style.
2950Sstevel@tonic-gate  * The DLPI provider style which determines whether a provider
2960Sstevel@tonic-gate  * requires a DL_ATTACH_REQ to inform the provider which PPA
2970Sstevel@tonic-gate  * user messages should be sent/received on.
2980Sstevel@tonic-gate  */
2990Sstevel@tonic-gate #define	DL_STYLE1	0x0500	/* PPA is implicitly bound by open(2) */
3000Sstevel@tonic-gate #define	DL_STYLE2	0x0501	/* PPA must be expl. bound via DL_ATTACH_REQ */
3010Sstevel@tonic-gate 
3020Sstevel@tonic-gate 
3030Sstevel@tonic-gate /*
3040Sstevel@tonic-gate  * DLPI Originator for Disconnect and Resets
3050Sstevel@tonic-gate  */
3060Sstevel@tonic-gate #define	DL_PROVIDER	0x0700
3070Sstevel@tonic-gate #define	DL_USER		0x0701
3080Sstevel@tonic-gate 
3090Sstevel@tonic-gate /*
3100Sstevel@tonic-gate  * DLPI Disconnect Reasons
3110Sstevel@tonic-gate  */
3120Sstevel@tonic-gate #define	DL_CONREJ_DEST_UNKNOWN			0x0800
3130Sstevel@tonic-gate #define	DL_CONREJ_DEST_UNREACH_PERMANENT	0x0801
3140Sstevel@tonic-gate #define	DL_CONREJ_DEST_UNREACH_TRANSIENT	0x0802
3150Sstevel@tonic-gate #define	DL_CONREJ_QOS_UNAVAIL_PERMANENT		0x0803
3160Sstevel@tonic-gate #define	DL_CONREJ_QOS_UNAVAIL_TRANSIENT		0x0804
3170Sstevel@tonic-gate #define	DL_CONREJ_PERMANENT_COND		0x0805
3180Sstevel@tonic-gate #define	DL_CONREJ_TRANSIENT_COND		0x0806
3190Sstevel@tonic-gate #define	DL_DISC_ABNORMAL_CONDITION		0x0807
3200Sstevel@tonic-gate #define	DL_DISC_NORMAL_CONDITION		0x0808
3210Sstevel@tonic-gate #define	DL_DISC_PERMANENT_CONDITION		0x0809
3220Sstevel@tonic-gate #define	DL_DISC_TRANSIENT_CONDITION		0x080a
3230Sstevel@tonic-gate #define	DL_DISC_UNSPECIFIED			0x080b
3240Sstevel@tonic-gate 
3250Sstevel@tonic-gate /*
3260Sstevel@tonic-gate  * DLPI Reset Reasons
3270Sstevel@tonic-gate  */
3280Sstevel@tonic-gate #define	DL_RESET_FLOW_CONTROL	0x0900
3290Sstevel@tonic-gate #define	DL_RESET_LINK_ERROR	0x0901
3300Sstevel@tonic-gate #define	DL_RESET_RESYNCH	0x0902
3310Sstevel@tonic-gate 
3320Sstevel@tonic-gate /*
3330Sstevel@tonic-gate  * DLPI status values for acknowledged connectionless data transfer
3340Sstevel@tonic-gate  */
3350Sstevel@tonic-gate #define	DL_CMD_MASK	0x0f	/* mask for command portion of status */
3360Sstevel@tonic-gate #define	DL_CMD_OK	0x00	/* Command Accepted */
3370Sstevel@tonic-gate #define	DL_CMD_RS	0x01	/* Unimplemented or inactivated service */
3380Sstevel@tonic-gate #define	DL_CMD_UE	0x05	/* Data Link User interface error */
3390Sstevel@tonic-gate #define	DL_CMD_PE	0x06	/* Protocol error */
3400Sstevel@tonic-gate #define	DL_CMD_IP	0x07	/* Permanent implementation dependent error */
3410Sstevel@tonic-gate #define	DL_CMD_UN	0x09	/* Resources temporarily unavailable */
3420Sstevel@tonic-gate #define	DL_CMD_IT	0x0f	/* Temporary implementation dependent error */
3430Sstevel@tonic-gate #define	DL_RSP_MASK	0xf0	/* mask for response portion of status */
3440Sstevel@tonic-gate #define	DL_RSP_OK	0x00	/* Response DLSDU present */
3450Sstevel@tonic-gate #define	DL_RSP_RS	0x10	/* Unimplemented or inactivated service */
3460Sstevel@tonic-gate #define	DL_RSP_NE	0x30	/* Response DLSDU never submitted */
3470Sstevel@tonic-gate #define	DL_RSP_NR	0x40	/* Response DLSDU not requested */
3480Sstevel@tonic-gate #define	DL_RSP_UE	0x50	/* Data Link User interface error */
3490Sstevel@tonic-gate #define	DL_RSP_IP	0x70	/* Permanent implementation dependent error */
3500Sstevel@tonic-gate #define	DL_RSP_UN	0x90	/* Resources temporarily unavailable */
3510Sstevel@tonic-gate #define	DL_RSP_IT	0xf0	/* Temporary implementation dependent error */
3520Sstevel@tonic-gate 
3530Sstevel@tonic-gate /*
3540Sstevel@tonic-gate  * Service Class values for acknowledged connectionless data transfer
3550Sstevel@tonic-gate  */
3560Sstevel@tonic-gate #define	DL_RQST_RSP	0x01	/* Use acknowledge capability in MAC sublayer */
3570Sstevel@tonic-gate #define	DL_RQST_NORSP	0x02	/* No acknowledgement service requested */
3580Sstevel@tonic-gate 
3590Sstevel@tonic-gate /*
3600Sstevel@tonic-gate  * DLPI address type definition
3610Sstevel@tonic-gate  */
3620Sstevel@tonic-gate #define	DL_FACT_PHYS_ADDR	0x01	/* factory physical address */
3630Sstevel@tonic-gate #define	DL_CURR_PHYS_ADDR	0x02	/* current physical address */
3640Sstevel@tonic-gate #define	DL_IPV6_TOKEN		0x03	/* IPv6 interface token */
3650Sstevel@tonic-gate #define	DL_IPV6_LINK_LAYER_ADDR	0x04	/* Neighbor Discovery format */
36610616SSebastien.Roy@Sun.COM #define	DL_CURR_DEST_ADDR	0x05	/* current destination address */
3670Sstevel@tonic-gate 
3680Sstevel@tonic-gate /*
3690Sstevel@tonic-gate  * DLPI flag definitions
3700Sstevel@tonic-gate  */
3710Sstevel@tonic-gate #define	DL_POLL_FINAL	0x01		/* indicates poll/final bit set */
3720Sstevel@tonic-gate 
3730Sstevel@tonic-gate /*
3740Sstevel@tonic-gate  *	XID and TEST responses supported by the provider
3750Sstevel@tonic-gate  */
3760Sstevel@tonic-gate #define	DL_AUTO_XID	0x01		/* provider will respond to XID */
3770Sstevel@tonic-gate #define	DL_AUTO_TEST	0x02		/* provider will respond to TEST */
3780Sstevel@tonic-gate 
3790Sstevel@tonic-gate /*
3800Sstevel@tonic-gate  * Subsequent bind type
3810Sstevel@tonic-gate  */
3820Sstevel@tonic-gate #define	DL_PEER_BIND	0x01		/* subsequent bind on a peer addr */
3830Sstevel@tonic-gate #define	DL_HIERARCHICAL_BIND	0x02	/* subs_bind on a hierarchical addr */
3840Sstevel@tonic-gate 
3850Sstevel@tonic-gate /*
3860Sstevel@tonic-gate  * DLPI promiscuous mode definitions
3870Sstevel@tonic-gate  */
3880Sstevel@tonic-gate #define	DL_PROMISC_PHYS		0x01	/* promiscuous mode at phys level */
3898518SPeter.Memishian@Sun.COM #define	DL_PROMISC_SAP		0x02	/* promiscuous mode at sap level */
3900Sstevel@tonic-gate #define	DL_PROMISC_MULTI	0x03	/* promiscuous mode for multicast */
3910Sstevel@tonic-gate 
3920Sstevel@tonic-gate /*
3939073SCathy.Zhou@Sun.COM  * DLPI notification codes for DL_NOTIFY_REQ primitives.
3940Sstevel@tonic-gate  * Bit-wise distinct since DL_NOTIFY_REQ and DL_NOTIFY_ACK carry multiple
3950Sstevel@tonic-gate  * notification codes.
3960Sstevel@tonic-gate  */
3970Sstevel@tonic-gate #define	DL_NOTE_PHYS_ADDR	0x0001	/* Physical address change */
3980Sstevel@tonic-gate #define	DL_NOTE_PROMISC_ON_PHYS	0x0002	/* DL_PROMISC_PHYS set on ppa */
3990Sstevel@tonic-gate #define	DL_NOTE_PROMISC_OFF_PHYS 0x0004	/* DL_PROMISC_PHYS cleared on ppa */
4000Sstevel@tonic-gate #define	DL_NOTE_LINK_DOWN	0x0008	/* Link down */
4010Sstevel@tonic-gate #define	DL_NOTE_LINK_UP		0x0010	/* Link up */
4020Sstevel@tonic-gate #define	DL_NOTE_AGGR_AVAIL	0x0020	/* Link aggregation is available */
4030Sstevel@tonic-gate #define	DL_NOTE_AGGR_UNAVAIL	0x0040	/* Link aggregation is not available */
4040Sstevel@tonic-gate #define	DL_NOTE_SDU_SIZE	0x0080	/* New SDU size, global or per addr */
4050Sstevel@tonic-gate #define	DL_NOTE_SPEED		0x0100	/* Approximate link speed */
4060Sstevel@tonic-gate #define	DL_NOTE_FASTPATH_FLUSH	0x0200	/* Fast Path info changes */
4070Sstevel@tonic-gate #define	DL_NOTE_CAPAB_RENEG	0x0400	/* Initiate capability renegotiation */
4089073SCathy.Zhou@Sun.COM #define	DL_NOTE_REPLUMB		0x0800	/* Inform the link to replumb */
40912748SSowmini.Varadhan@oracle.COM #define	DL_NOTE_ALLOWED_IPS	0x1000	/* "allowed-ips"  notification */
410*13123SErik.Nordmark@Sun.COM #define	DL_NOTE_SDU_SIZE2	0x2000	/* New unicast and multicast size */
4119073SCathy.Zhou@Sun.COM 
4129073SCathy.Zhou@Sun.COM /*
4139073SCathy.Zhou@Sun.COM  * DLPI notification codes for DL_NOTIFY_CONF primitives.
4149073SCathy.Zhou@Sun.COM  */
4159073SCathy.Zhou@Sun.COM #define	DL_NOTE_REPLUMB_DONE	0x0001	/* Indicate replumb has done */
4160Sstevel@tonic-gate 
4170Sstevel@tonic-gate /*
4180Sstevel@tonic-gate  * DLPI Quality Of Service definition for use in QOS structure definitions.
4190Sstevel@tonic-gate  * The QOS structures are used in connection establishment, DL_INFO_ACK,
4200Sstevel@tonic-gate  * and setting connectionless QOS values.
4210Sstevel@tonic-gate  */
4220Sstevel@tonic-gate 
4230Sstevel@tonic-gate /*
4240Sstevel@tonic-gate  * Throughput
4250Sstevel@tonic-gate  *
4260Sstevel@tonic-gate  * This parameter is specified for both directions.
4270Sstevel@tonic-gate  */
4280Sstevel@tonic-gate typedef struct {
4290Sstevel@tonic-gate 	t_scalar_t	dl_target_value;	/* bits/second desired */
4300Sstevel@tonic-gate 	t_scalar_t	dl_accept_value;	/* min. ok bits/second */
4310Sstevel@tonic-gate } dl_through_t;
4320Sstevel@tonic-gate 
4330Sstevel@tonic-gate /*
4340Sstevel@tonic-gate  * transit delay specification
4350Sstevel@tonic-gate  *
4360Sstevel@tonic-gate  * This parameter is specified for both directions.
4370Sstevel@tonic-gate  * expressed in milliseconds assuming a DLSDU size of 128 octets.
4380Sstevel@tonic-gate  * The scaling of the value to the current DLSDU size is provider dependent.
4390Sstevel@tonic-gate  */
4400Sstevel@tonic-gate typedef struct {
4410Sstevel@tonic-gate 	t_scalar_t	dl_target_value;	/* desired value of service */
4420Sstevel@tonic-gate 	t_scalar_t	dl_accept_value;	/* min. ok value of service */
4430Sstevel@tonic-gate } dl_transdelay_t;
4440Sstevel@tonic-gate 
4450Sstevel@tonic-gate /*
4460Sstevel@tonic-gate  * priority specification
4470Sstevel@tonic-gate  * priority range is 0-100, with 0 being highest value.
4480Sstevel@tonic-gate  */
4490Sstevel@tonic-gate typedef struct {
4500Sstevel@tonic-gate 	t_scalar_t	dl_min;
4510Sstevel@tonic-gate 	t_scalar_t	dl_max;
4520Sstevel@tonic-gate } dl_priority_t;
4530Sstevel@tonic-gate 
4540Sstevel@tonic-gate 
4550Sstevel@tonic-gate /*
4560Sstevel@tonic-gate  * protection specification
4570Sstevel@tonic-gate  *
4580Sstevel@tonic-gate  */
4590Sstevel@tonic-gate #define	DL_NONE			0x0B01	/* no protection supplied */
4600Sstevel@tonic-gate #define	DL_MONITOR		0x0B02	/* prot. from passive monit. */
4610Sstevel@tonic-gate #define	DL_MAXIMUM		0x0B03	/* prot. from modification, replay, */
4620Sstevel@tonic-gate 					/* addition, or deletion */
4630Sstevel@tonic-gate 
4640Sstevel@tonic-gate typedef struct {
4650Sstevel@tonic-gate 	t_scalar_t	dl_min;
4660Sstevel@tonic-gate 	t_scalar_t	dl_max;
4670Sstevel@tonic-gate } dl_protect_t;
4680Sstevel@tonic-gate 
4690Sstevel@tonic-gate 
4700Sstevel@tonic-gate /*
4710Sstevel@tonic-gate  * Resilience specification
4720Sstevel@tonic-gate  * probabilities are scaled by a factor of 10,000 with a time interval
4730Sstevel@tonic-gate  * of 10,000 seconds.
4740Sstevel@tonic-gate  */
4750Sstevel@tonic-gate typedef struct {
4760Sstevel@tonic-gate 	t_scalar_t	dl_disc_prob;	/* prob. of provider init DISC */
4770Sstevel@tonic-gate 	t_scalar_t	dl_reset_prob;	/* prob. of provider init RESET */
4780Sstevel@tonic-gate } dl_resilience_t;
4790Sstevel@tonic-gate 
4800Sstevel@tonic-gate 
4810Sstevel@tonic-gate /*
4820Sstevel@tonic-gate  * QOS type definition to be used for negotiation with the
4830Sstevel@tonic-gate  * remote end of a connection, or a connectionless unitdata request.
4840Sstevel@tonic-gate  * There are two type definitions to handle the negotiation
4850Sstevel@tonic-gate  * process at connection establishment. The typedef dl_qos_range_t
4860Sstevel@tonic-gate  * is used to present a range for parameters. This is used
4870Sstevel@tonic-gate  * in the DL_CONNECT_REQ and DL_CONNECT_IND messages. The typedef
4880Sstevel@tonic-gate  * dl_qos_sel_t is used to select a specific value for the QOS
4890Sstevel@tonic-gate  * parameters. This is used in the DL_CONNECT_RES, DL_CONNECT_CON,
4900Sstevel@tonic-gate  * and DL_INFO_ACK messages to define the selected QOS parameters
4910Sstevel@tonic-gate  * for a connection.
4920Sstevel@tonic-gate  *
4930Sstevel@tonic-gate  * NOTE
4940Sstevel@tonic-gate  *	A DataLink provider which has unknown values for any of the fields
4950Sstevel@tonic-gate  *	will use a value of DL_UNKNOWN for all values in the fields.
4960Sstevel@tonic-gate  *
4970Sstevel@tonic-gate  * NOTE
4980Sstevel@tonic-gate  *	A QOS parameter value of DL_QOS_DONT_CARE informs the DLS
4990Sstevel@tonic-gate  *	provider the user requesting this value doesn't care
5000Sstevel@tonic-gate  *	what the QOS parameter is set to. This value becomes the
5010Sstevel@tonic-gate  *	least possible value in the range of QOS parameters.
5020Sstevel@tonic-gate  *	The order of the QOS parameter range is then:
5030Sstevel@tonic-gate  *
5040Sstevel@tonic-gate  *		DL_QOS_DONT_CARE < 0 < MAXIMUM QOS VALUE
5050Sstevel@tonic-gate  */
5060Sstevel@tonic-gate #define	DL_UNKNOWN		-1
5070Sstevel@tonic-gate #define	DL_QOS_DONT_CARE	-2
5080Sstevel@tonic-gate 
5090Sstevel@tonic-gate /*
5100Sstevel@tonic-gate  * Every QOS structure has the first 4 bytes containing a type
5110Sstevel@tonic-gate  * field, denoting the definition of the rest of the structure.
5120Sstevel@tonic-gate  * This is used in the same manner has the dl_primitive variable
5130Sstevel@tonic-gate  * is in messages.
5140Sstevel@tonic-gate  *
5150Sstevel@tonic-gate  * The following list is the defined QOS structure type values and structures.
5160Sstevel@tonic-gate  */
5170Sstevel@tonic-gate #define	DL_QOS_CO_RANGE1	0x0101	/* CO QOS range struct. */
5180Sstevel@tonic-gate #define	DL_QOS_CO_SEL1		0x0102	/* CO QOS selection structure */
5190Sstevel@tonic-gate #define	DL_QOS_CL_RANGE1	0x0103	/* CL QOS range struct. */
5200Sstevel@tonic-gate #define	DL_QOS_CL_SEL1		0x0104	/* CL QOS selection */
5210Sstevel@tonic-gate 
5220Sstevel@tonic-gate typedef struct {
5230Sstevel@tonic-gate 	t_uscalar_t	dl_qos_type;
5240Sstevel@tonic-gate 	dl_through_t	dl_rcv_throughput;	/* desired and accep. */
5250Sstevel@tonic-gate 	dl_transdelay_t	dl_rcv_trans_delay;	/* desired and accep. */
5260Sstevel@tonic-gate 	dl_through_t	dl_xmt_throughput;
5270Sstevel@tonic-gate 	dl_transdelay_t	dl_xmt_trans_delay;
5280Sstevel@tonic-gate 	dl_priority_t	dl_priority;		/* min and max values */
5290Sstevel@tonic-gate 	dl_protect_t	dl_protection;		/* min and max values */
5300Sstevel@tonic-gate 	t_scalar_t	dl_residual_error;
5310Sstevel@tonic-gate 	dl_resilience_t	dl_resilience;
5320Sstevel@tonic-gate }	dl_qos_co_range1_t;
5330Sstevel@tonic-gate 
5340Sstevel@tonic-gate typedef struct {
5350Sstevel@tonic-gate 	t_uscalar_t	dl_qos_type;
5360Sstevel@tonic-gate 	t_scalar_t	dl_rcv_throughput;
5370Sstevel@tonic-gate 	t_scalar_t	dl_rcv_trans_delay;
5380Sstevel@tonic-gate 	t_scalar_t	dl_xmt_throughput;
5390Sstevel@tonic-gate 	t_scalar_t	dl_xmt_trans_delay;
5400Sstevel@tonic-gate 	t_scalar_t	dl_priority;
5410Sstevel@tonic-gate 	t_scalar_t	dl_protection;
5420Sstevel@tonic-gate 	t_scalar_t	dl_residual_error;
5430Sstevel@tonic-gate 	dl_resilience_t	dl_resilience;
5440Sstevel@tonic-gate }	dl_qos_co_sel1_t;
5450Sstevel@tonic-gate 
5460Sstevel@tonic-gate typedef struct {
5470Sstevel@tonic-gate 	t_uscalar_t	dl_qos_type;
5480Sstevel@tonic-gate 	dl_transdelay_t	dl_trans_delay;
5490Sstevel@tonic-gate 	dl_priority_t	dl_priority;
5500Sstevel@tonic-gate 	dl_protect_t	dl_protection;
5510Sstevel@tonic-gate 	t_scalar_t	dl_residual_error;
5520Sstevel@tonic-gate }	dl_qos_cl_range1_t;
5530Sstevel@tonic-gate 
5540Sstevel@tonic-gate typedef struct {
5550Sstevel@tonic-gate 	t_uscalar_t	dl_qos_type;
5560Sstevel@tonic-gate 	t_scalar_t	dl_trans_delay;
5570Sstevel@tonic-gate 	t_scalar_t	dl_priority;
5580Sstevel@tonic-gate 	t_scalar_t	dl_protection;
5590Sstevel@tonic-gate 	t_scalar_t	dl_residual_error;
5600Sstevel@tonic-gate }	dl_qos_cl_sel1_t;
5610Sstevel@tonic-gate 
5620Sstevel@tonic-gate union	DL_qos_types {
5630Sstevel@tonic-gate 	t_uscalar_t		dl_qos_type;
5640Sstevel@tonic-gate 	dl_qos_co_range1_t	qos_co_range1;
5650Sstevel@tonic-gate 	dl_qos_co_sel1_t	qos_co_sel1;
5660Sstevel@tonic-gate 	dl_qos_cl_range1_t	qos_cl_range1;
5670Sstevel@tonic-gate 	dl_qos_cl_sel1_t	qos_cl_sel1;
5680Sstevel@tonic-gate };
5690Sstevel@tonic-gate 
5700Sstevel@tonic-gate /*
5710Sstevel@tonic-gate  *    Solaris specific structures and definitions.
5720Sstevel@tonic-gate  */
5730Sstevel@tonic-gate 
5740Sstevel@tonic-gate /*
5750Sstevel@tonic-gate  * The following are the capability types and structures used by the
5760Sstevel@tonic-gate  * the DL_CAPABILITY_REQ and DL_CAPABILITY_ACK primitives.
5770Sstevel@tonic-gate  *
5780Sstevel@tonic-gate  * These primitives are used both to determine the set of capabilities in
5790Sstevel@tonic-gate  * the DLS provider and also to turn on and off specific capabilities.
5800Sstevel@tonic-gate  * The response is a DL_CAPABILITY_ACK or DL_ERROR_ACK.
5810Sstevel@tonic-gate  *
5820Sstevel@tonic-gate  * DL_CAPABILITY_REQ can either be empty (i.e. dl_sub_length is zero) which
5830Sstevel@tonic-gate  * is a request for the driver to return all capabilities. Otherwise, the
5840Sstevel@tonic-gate  * DL_CAPABILITY_REQ contains the capabilities the DLS user wants to use and
5850Sstevel@tonic-gate  * their settings.
5860Sstevel@tonic-gate  *
5870Sstevel@tonic-gate  * DL_CAPABILITY_ACK contains the capabilities that the DLS provider can
5880Sstevel@tonic-gate  * support modified based on what was listed in the request. If a
5890Sstevel@tonic-gate  * capability was included in the request then the information returned
5900Sstevel@tonic-gate  * in the ack might be modified based on the information in the request.
5910Sstevel@tonic-gate  */
5920Sstevel@tonic-gate 
5930Sstevel@tonic-gate #define	DL_CAPAB_ID_WRAPPER	0x00	/* Module ID wrapper structure */
5940Sstevel@tonic-gate 					/* dl_data is dl_capab_id_t */
5950Sstevel@tonic-gate #define	DL_CAPAB_HCKSUM		0x01	/* Checksum offload */
5960Sstevel@tonic-gate 					/* dl_data is dl_capab_hcksum_t */
5970Sstevel@tonic-gate #define	DL_CAPAB_MDT		0x04	/* Multidata Transmit capability */
5980Sstevel@tonic-gate 					/* dl_data is dl_capab_mdt_t */
5990Sstevel@tonic-gate #define	DL_CAPAB_ZEROCOPY	0x05	/* Zero-copy capability */
6000Sstevel@tonic-gate 					/* dl_data is dl_capab_zerocopy_t */
6018275SEric Cheng #define	DL_CAPAB_DLD		0x06	/* dld capability */
6028275SEric Cheng 					/* dl_data is dl_capab_dld_t */
60311076SCathy.Zhou@Sun.COM #define	DL_CAPAB_VRRP		0x07	/* vrrp capability */
60411076SCathy.Zhou@Sun.COM 					/* dl_data is dl_capab_vrrp_t */
6050Sstevel@tonic-gate 
6060Sstevel@tonic-gate typedef struct {
6070Sstevel@tonic-gate 	t_uscalar_t	dl_cap;		/* capability type */
6080Sstevel@tonic-gate 	t_uscalar_t	dl_length;	/* length of data following */
6090Sstevel@tonic-gate 	/* Followed by zero or more bytes of dl_data */
6100Sstevel@tonic-gate } dl_capability_sub_t;
6110Sstevel@tonic-gate 
6120Sstevel@tonic-gate /*
6130Sstevel@tonic-gate  * Module ID token to be included in new sub-capability structures.
61411042SErik.Nordmark@Sun.COM  * Access to this structure must be done through
6150Sstevel@tonic-gate  * dlcapab{set,check}qid().
6160Sstevel@tonic-gate  */
6170Sstevel@tonic-gate typedef struct {
6180Sstevel@tonic-gate 	t_uscalar_t	mid[4];		/* private fields */
6190Sstevel@tonic-gate } dl_mid_t;
6200Sstevel@tonic-gate 
6210Sstevel@tonic-gate /*
6220Sstevel@tonic-gate  * Module ID wrapper (follows dl_capability_sub_t)
6230Sstevel@tonic-gate  */
6240Sstevel@tonic-gate typedef struct {
6250Sstevel@tonic-gate 	dl_mid_t		id_mid;		/* module ID token */
6260Sstevel@tonic-gate 	dl_capability_sub_t	id_subcap;	/* sub-capability */
6270Sstevel@tonic-gate } dl_capab_id_t;
6280Sstevel@tonic-gate 
6290Sstevel@tonic-gate /*
6300Sstevel@tonic-gate  * Multidata Transmit sub-capability (follows dl_capability_sub_t)
6310Sstevel@tonic-gate  */
6320Sstevel@tonic-gate typedef struct {
6330Sstevel@tonic-gate 	t_uscalar_t	mdt_version;	/* interface version */
6340Sstevel@tonic-gate 	t_uscalar_t	mdt_flags;	/* flags */
6350Sstevel@tonic-gate 	t_uscalar_t	mdt_hdr_head;	/* minimum leading header space */
6360Sstevel@tonic-gate 	t_uscalar_t	mdt_hdr_tail;	/* minimum trailing header space */
6370Sstevel@tonic-gate 	t_uscalar_t	mdt_max_pld;	/* maximum doable payload buffers */
6380Sstevel@tonic-gate 	t_uscalar_t	mdt_span_limit;	/* scatter-gather descriptor limit */
6390Sstevel@tonic-gate 	dl_mid_t	mdt_mid;	/* module ID token */
6400Sstevel@tonic-gate } dl_capab_mdt_t;
6410Sstevel@tonic-gate 
6420Sstevel@tonic-gate /*
6430Sstevel@tonic-gate  * Multidata Transmit revision definition history
6440Sstevel@tonic-gate  */
6450Sstevel@tonic-gate #define	MDT_CURRENT_VERSION	0x02
6460Sstevel@tonic-gate #define	MDT_VERSION_2		0x02
6470Sstevel@tonic-gate 
6480Sstevel@tonic-gate /*
6490Sstevel@tonic-gate  * mdt_flags values
6500Sstevel@tonic-gate  */
6510Sstevel@tonic-gate #define	DL_CAPAB_MDT_ENABLE	0x01	/* enable Multidata Transmit */
6520Sstevel@tonic-gate 
6530Sstevel@tonic-gate /*
6540Sstevel@tonic-gate  * DL_CAPAB_HCKSUM
6550Sstevel@tonic-gate  * Used for negotiating different flavors of checksum offload
6560Sstevel@tonic-gate  * capabilities.
6570Sstevel@tonic-gate  */
6580Sstevel@tonic-gate typedef struct {
6590Sstevel@tonic-gate 	t_uscalar_t	hcksum_version;	/* version of data following */
6600Sstevel@tonic-gate 	t_uscalar_t	hcksum_txflags;	/* capabilities on transmit */
6610Sstevel@tonic-gate 	dl_mid_t	hcksum_mid;		/* module ID */
6620Sstevel@tonic-gate } dl_capab_hcksum_t;
6630Sstevel@tonic-gate 
6640Sstevel@tonic-gate /*
6650Sstevel@tonic-gate  * DL_CAPAB_HCKSUM  revision definition history
6660Sstevel@tonic-gate  */
6670Sstevel@tonic-gate #define	HCKSUM_CURRENT_VERSION	0x01
6680Sstevel@tonic-gate #define	HCKSUM_VERSION_1	0x01
6690Sstevel@tonic-gate 
6700Sstevel@tonic-gate /*
6710Sstevel@tonic-gate  * Values for dl_txflags
6720Sstevel@tonic-gate  */
6730Sstevel@tonic-gate #define	HCKSUM_ENABLE		0x01	/* Set to enable hardware checksum */
6740Sstevel@tonic-gate 					/* capability */
6750Sstevel@tonic-gate #define	HCKSUM_INET_PARTIAL	0x02	/* Partial 1's complement checksum */
6760Sstevel@tonic-gate 					/* ability */
6770Sstevel@tonic-gate #define	HCKSUM_INET_FULL_V4	0x04	/* Full 1's complement checksum */
6780Sstevel@tonic-gate 					/* ability for IPv4 packets. */
679741Smasputra #define	HCKSUM_INET_FULL_V6	0x08	/* Full 1's complement checksum */
680741Smasputra 					/* ability for IPv6 packets. */
6810Sstevel@tonic-gate #define	HCKSUM_IPHDRCKSUM	0x10	/* IPv4 Header checksum offload */
6820Sstevel@tonic-gate 					/* capability */
6830Sstevel@tonic-gate #ifdef _KERNEL
6840Sstevel@tonic-gate 
685449Sericheng /*
68611076SCathy.Zhou@Sun.COM  * VRRP sub-capability (follows dl_capability_sub_t)
68711076SCathy.Zhou@Sun.COM  */
68811076SCathy.Zhou@Sun.COM typedef struct {
68911076SCathy.Zhou@Sun.COM 	int	vrrp_af;	/* IPv4 or IPv6 */
69011076SCathy.Zhou@Sun.COM } dl_capab_vrrp_t;
69111076SCathy.Zhou@Sun.COM 
69211076SCathy.Zhou@Sun.COM /*
6938275SEric Cheng  * The DL_CAPAB_DLD capability enables the capabilities of gldv3-based drivers
6948275SEric Cheng  * to be negotiated using a function call (dld_capab) instead of using streams.
695449Sericheng  */
6968275SEric Cheng typedef struct dl_capab_dld_s {
6978275SEric Cheng 	t_uscalar_t		dld_version;
6988275SEric Cheng 	t_uscalar_t		dld_flags;
6990Sstevel@tonic-gate 
700449Sericheng 	/* DLD provided information */
7018275SEric Cheng 	uintptr_t		dld_capab;
7028275SEric Cheng 	uintptr_t		dld_capab_handle;
7038275SEric Cheng 	dl_mid_t		dld_mid;	/* module ID */
7048275SEric Cheng } dl_capab_dld_t;
7050Sstevel@tonic-gate 
7068275SEric Cheng #define	DL_CAPAB_DLD_ENABLE	0x00000001
7078275SEric Cheng #define	DLD_VERSION_1		1
7088275SEric Cheng #define	DLD_CURRENT_VERSION	DLD_VERSION_1
7090Sstevel@tonic-gate 
7100Sstevel@tonic-gate #endif /* _KERNEL */
7110Sstevel@tonic-gate 
7120Sstevel@tonic-gate /*
7130Sstevel@tonic-gate  * Zero-copy sub-capability (follows dl_capability_sub_t)
7140Sstevel@tonic-gate  */
7150Sstevel@tonic-gate typedef struct {
7160Sstevel@tonic-gate 	t_uscalar_t	zerocopy_version;	/* interface version */
7170Sstevel@tonic-gate 	t_uscalar_t	zerocopy_flags;		/* capability flags */
7180Sstevel@tonic-gate 	t_uscalar_t	reserved[9];		/* reserved fields */
7190Sstevel@tonic-gate 	dl_mid_t	zerocopy_mid;		/* module ID */
7200Sstevel@tonic-gate } dl_capab_zerocopy_t;
7210Sstevel@tonic-gate 
7220Sstevel@tonic-gate /*
7230Sstevel@tonic-gate  * Zero-copy revision definition history
7240Sstevel@tonic-gate  */
7250Sstevel@tonic-gate #define	ZEROCOPY_CURRENT_VERSION	0x01
7260Sstevel@tonic-gate #define	ZEROCOPY_VERSION_1		0x01
7270Sstevel@tonic-gate 
7280Sstevel@tonic-gate /*
7290Sstevel@tonic-gate  * Currently supported values of zerocopy_flags
7300Sstevel@tonic-gate  */
7310Sstevel@tonic-gate #define	DL_CAPAB_VMSAFE_MEM		0x01	/* Driver is zero-copy safe */
7320Sstevel@tonic-gate 						/* wrt VM named buffers on */
7330Sstevel@tonic-gate 						/* transmit */
7343115Syl150051 
7353115Syl150051 /*
7360Sstevel@tonic-gate  * DLPI interface primitive definitions.
7370Sstevel@tonic-gate  *
7380Sstevel@tonic-gate  * Each primitive is sent as a stream message.  It is possible that
7390Sstevel@tonic-gate  * the messages may be viewed as a sequence of bytes that have the
7400Sstevel@tonic-gate  * following form without any padding. The structure definition
7410Sstevel@tonic-gate  * of the following messages may have to change depending on the
7420Sstevel@tonic-gate  * underlying hardware architecture and crossing of a hardware
7430Sstevel@tonic-gate  * boundary with a different hardware architecture.
7440Sstevel@tonic-gate  *
7450Sstevel@tonic-gate  * Fields in the primitives having a name of the form
7460Sstevel@tonic-gate  * dl_reserved cannot be used and have the value of
7470Sstevel@tonic-gate  * binary zero, no bits turned on.
7480Sstevel@tonic-gate  *
7490Sstevel@tonic-gate  * Each message has the name defined followed by the
7500Sstevel@tonic-gate  * stream message type (M_PROTO, M_PCPROTO, M_DATA)
7510Sstevel@tonic-gate  */
7520Sstevel@tonic-gate 
7530Sstevel@tonic-gate /*
7540Sstevel@tonic-gate  *	LOCAL MANAGEMENT SERVICE PRIMITIVES
7550Sstevel@tonic-gate  */
7560Sstevel@tonic-gate 
7570Sstevel@tonic-gate /*
7580Sstevel@tonic-gate  * DL_INFO_REQ, M_PCPROTO type
7590Sstevel@tonic-gate  */
7600Sstevel@tonic-gate typedef struct {
7610Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;			/* set to DL_INFO_REQ */
7620Sstevel@tonic-gate } dl_info_req_t;
7630Sstevel@tonic-gate 
7640Sstevel@tonic-gate /*
7650Sstevel@tonic-gate  * DL_INFO_ACK, M_PCPROTO type
7660Sstevel@tonic-gate  */
7670Sstevel@tonic-gate typedef struct {
7680Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* set to DL_INFO_ACK */
7690Sstevel@tonic-gate 	t_uscalar_t	dl_max_sdu;		/* Max bytes in a DLSDU */
7700Sstevel@tonic-gate 	t_uscalar_t	dl_min_sdu;		/* Min bytes in a DLSDU */
7710Sstevel@tonic-gate 	t_uscalar_t	dl_addr_length;		/* length of DLSAP address */
7720Sstevel@tonic-gate 	t_uscalar_t	dl_mac_type;		/* type of medium supported */
7730Sstevel@tonic-gate 	t_uscalar_t	dl_reserved;		/* value set to zero */
7740Sstevel@tonic-gate 	t_uscalar_t	dl_current_state;	/* state of DLPI interface */
7758518SPeter.Memishian@Sun.COM 	t_scalar_t	dl_sap_length;		/* length of DLSAP SAP part */
7760Sstevel@tonic-gate 	t_uscalar_t	dl_service_mode;	/* CO, CL or ACL */
7770Sstevel@tonic-gate 	t_uscalar_t	dl_qos_length;		/* length of qos values */
7780Sstevel@tonic-gate 	t_uscalar_t	dl_qos_offset;		/* offset from start of block */
7790Sstevel@tonic-gate 	t_uscalar_t	dl_qos_range_length;	/* available range of qos */
7800Sstevel@tonic-gate 	t_uscalar_t	dl_qos_range_offset;	/* offset from start of block */
7810Sstevel@tonic-gate 	t_uscalar_t	dl_provider_style;	/* style1 or style2 */
7828518SPeter.Memishian@Sun.COM 	t_uscalar_t	dl_addr_offset;		/* offset of the DLSAP addr */
7830Sstevel@tonic-gate 	t_uscalar_t	dl_version;		/* version number */
7840Sstevel@tonic-gate 	t_uscalar_t	dl_brdcst_addr_length;	/* length of broadcast addr */
7850Sstevel@tonic-gate 	t_uscalar_t	dl_brdcst_addr_offset;	/* offset from start of block */
7860Sstevel@tonic-gate 	t_uscalar_t	dl_growth;		/* set to zero */
7870Sstevel@tonic-gate } dl_info_ack_t;
7880Sstevel@tonic-gate 
7890Sstevel@tonic-gate /*
7900Sstevel@tonic-gate  * DL_ATTACH_REQ, M_PROTO type
7910Sstevel@tonic-gate  */
7920Sstevel@tonic-gate typedef struct {
7930Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* set to DL_ATTACH_REQ */
7940Sstevel@tonic-gate 	t_uscalar_t	dl_ppa;			/* id of the PPA */
7950Sstevel@tonic-gate } dl_attach_req_t;
7960Sstevel@tonic-gate 
7970Sstevel@tonic-gate /*
7980Sstevel@tonic-gate  * DL_DETACH_REQ, M_PROTO type
7990Sstevel@tonic-gate  */
8000Sstevel@tonic-gate typedef struct {
8010Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* set to DL_DETACH_REQ */
8020Sstevel@tonic-gate } dl_detach_req_t;
8030Sstevel@tonic-gate 
8040Sstevel@tonic-gate /*
8050Sstevel@tonic-gate  * DL_BIND_REQ, M_PROTO type
8060Sstevel@tonic-gate  */
8070Sstevel@tonic-gate typedef struct {
8080Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* set to DL_BIND_REQ */
8098518SPeter.Memishian@Sun.COM 	t_uscalar_t	dl_sap;		/* info to identify DLSAP addr */
8100Sstevel@tonic-gate 	t_uscalar_t	dl_max_conind;	/* max # of outstanding con_ind */
8110Sstevel@tonic-gate 	uint16_t	dl_service_mode;	/* CO, CL or ACL */
8120Sstevel@tonic-gate 	uint16_t	dl_conn_mgmt;	/* if non-zero, is con-mgmt stream */
8130Sstevel@tonic-gate 	t_uscalar_t	dl_xidtest_flg;	/* auto init. of test and xid */
8140Sstevel@tonic-gate } dl_bind_req_t;
8150Sstevel@tonic-gate 
8160Sstevel@tonic-gate /*
8170Sstevel@tonic-gate  * DL_BIND_ACK, M_PCPROTO type
8180Sstevel@tonic-gate  */
8190Sstevel@tonic-gate typedef struct {
8200Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* DL_BIND_ACK */
8210Sstevel@tonic-gate 	t_uscalar_t	dl_sap;		/* DLSAP addr info */
8220Sstevel@tonic-gate 	t_uscalar_t	dl_addr_length;	/* length of complete DLSAP addr */
8230Sstevel@tonic-gate 	t_uscalar_t	dl_addr_offset;	/* offset from start of M_PCPROTO */
8240Sstevel@tonic-gate 	t_uscalar_t	dl_max_conind;	/* allowed max. # of con-ind */
8250Sstevel@tonic-gate 	t_uscalar_t	dl_xidtest_flg;	/* responses supported by provider */
8260Sstevel@tonic-gate } dl_bind_ack_t;
8270Sstevel@tonic-gate 
8280Sstevel@tonic-gate /*
8290Sstevel@tonic-gate  * DL_SUBS_BIND_REQ, M_PROTO type
8300Sstevel@tonic-gate  */
8310Sstevel@tonic-gate typedef struct {
8320Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* DL_SUBS_BIND_REQ */
8330Sstevel@tonic-gate 	t_uscalar_t	dl_subs_sap_offset;	/* offset of subs_sap */
8340Sstevel@tonic-gate 	t_uscalar_t	dl_subs_sap_length;	/* length of subs_sap */
8350Sstevel@tonic-gate 	t_uscalar_t	dl_subs_bind_class;	/* peer or hierarchical */
8360Sstevel@tonic-gate } dl_subs_bind_req_t;
8370Sstevel@tonic-gate 
8380Sstevel@tonic-gate /*
8390Sstevel@tonic-gate  * DL_SUBS_BIND_ACK, M_PCPROTO type
8400Sstevel@tonic-gate  */
8410Sstevel@tonic-gate typedef struct {
8420Sstevel@tonic-gate 	t_uscalar_t dl_primitive;	/* DL_SUBS_BIND_ACK */
8430Sstevel@tonic-gate 	t_uscalar_t dl_subs_sap_offset;	/* offset of subs_sap */
8440Sstevel@tonic-gate 	t_uscalar_t dl_subs_sap_length;	/* length of subs_sap */
8450Sstevel@tonic-gate } dl_subs_bind_ack_t;
8460Sstevel@tonic-gate 
8470Sstevel@tonic-gate /*
8480Sstevel@tonic-gate  * DL_UNBIND_REQ, M_PROTO type
8490Sstevel@tonic-gate  */
8500Sstevel@tonic-gate typedef struct {
8510Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* DL_UNBIND_REQ */
8520Sstevel@tonic-gate } dl_unbind_req_t;
8530Sstevel@tonic-gate 
8540Sstevel@tonic-gate /*
8550Sstevel@tonic-gate  * DL_SUBS_UNBIND_REQ, M_PROTO type
8560Sstevel@tonic-gate  */
8570Sstevel@tonic-gate typedef struct {
8580Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* DL_SUBS_UNBIND_REQ */
8590Sstevel@tonic-gate 	t_uscalar_t	dl_subs_sap_offset;	/* offset of subs_sap */
8600Sstevel@tonic-gate 	t_uscalar_t	dl_subs_sap_length;	/* length of subs_sap */
8610Sstevel@tonic-gate } dl_subs_unbind_req_t;
8620Sstevel@tonic-gate 
8630Sstevel@tonic-gate /*
8640Sstevel@tonic-gate  * DL_OK_ACK, M_PCPROTO type
8650Sstevel@tonic-gate  */
8660Sstevel@tonic-gate typedef struct {
8670Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* DL_OK_ACK */
8680Sstevel@tonic-gate 	t_uscalar_t	dl_correct_primitive;	/* primitive acknowledged */
8690Sstevel@tonic-gate } dl_ok_ack_t;
8700Sstevel@tonic-gate 
8710Sstevel@tonic-gate /*
8720Sstevel@tonic-gate  * DL_ERROR_ACK, M_PCPROTO type
8730Sstevel@tonic-gate  */
8740Sstevel@tonic-gate typedef struct {
8750Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* DL_ERROR_ACK */
8760Sstevel@tonic-gate 	t_uscalar_t	dl_error_primitive;	/* primitive in error */
8770Sstevel@tonic-gate 	t_uscalar_t	dl_errno;		/* DLPI error code */
8780Sstevel@tonic-gate 	t_uscalar_t	dl_unix_errno;		/* UNIX system error code */
8790Sstevel@tonic-gate } dl_error_ack_t;
8800Sstevel@tonic-gate 
8810Sstevel@tonic-gate /*
8820Sstevel@tonic-gate  * DL_ENABMULTI_REQ, M_PROTO type
8830Sstevel@tonic-gate  */
8840Sstevel@tonic-gate typedef struct {
8850Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* DL_ENABMULTI_REQ */
8860Sstevel@tonic-gate 	t_uscalar_t	dl_addr_length;	/* length of multicast address */
8870Sstevel@tonic-gate 	t_uscalar_t	dl_addr_offset;	/* offset from start of M_PROTO block */
8880Sstevel@tonic-gate } dl_enabmulti_req_t;
8890Sstevel@tonic-gate 
8900Sstevel@tonic-gate /*
8910Sstevel@tonic-gate  * DL_DISABMULTI_REQ, M_PROTO type
8920Sstevel@tonic-gate  */
8930Sstevel@tonic-gate 
8940Sstevel@tonic-gate typedef struct {
8950Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* DL_DISABMULTI_REQ */
8960Sstevel@tonic-gate 	t_uscalar_t	dl_addr_length;	/* length of multicast address */
8970Sstevel@tonic-gate 	t_uscalar_t	dl_addr_offset;	/* offset from start of M_PROTO block */
8980Sstevel@tonic-gate } dl_disabmulti_req_t;
8990Sstevel@tonic-gate 
9000Sstevel@tonic-gate /*
9010Sstevel@tonic-gate  * DL_PROMISCON_REQ, M_PROTO type
9020Sstevel@tonic-gate  */
9030Sstevel@tonic-gate 
9040Sstevel@tonic-gate typedef struct {
9050Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* DL_PROMISCON_REQ */
9060Sstevel@tonic-gate 	t_uscalar_t	dl_level;	/* physical,SAP, or ALL multicast */
9070Sstevel@tonic-gate } dl_promiscon_req_t;
9080Sstevel@tonic-gate 
9090Sstevel@tonic-gate /*
9100Sstevel@tonic-gate  * DL_PROMISCOFF_REQ, M_PROTO type
9110Sstevel@tonic-gate  */
9120Sstevel@tonic-gate 
9130Sstevel@tonic-gate typedef struct {
9140Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* DL_PROMISCOFF_REQ */
9150Sstevel@tonic-gate 	t_uscalar_t	dl_level;	/* Physical,SAP, or ALL multicast */
9160Sstevel@tonic-gate } dl_promiscoff_req_t;
9170Sstevel@tonic-gate 
9180Sstevel@tonic-gate /*
9190Sstevel@tonic-gate  *	Primitives to get and set the Physical address
9200Sstevel@tonic-gate  */
9210Sstevel@tonic-gate 
9220Sstevel@tonic-gate /*
9230Sstevel@tonic-gate  * DL_PHYS_ADDR_REQ, M_PROTO type
9240Sstevel@tonic-gate  */
9250Sstevel@tonic-gate typedef	struct {
9260Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* DL_PHYS_ADDR_REQ */
9270Sstevel@tonic-gate 	t_uscalar_t	dl_addr_type;	/* factory or current physical addr */
9280Sstevel@tonic-gate } dl_phys_addr_req_t;
9290Sstevel@tonic-gate 
9300Sstevel@tonic-gate /*
9310Sstevel@tonic-gate  * DL_PHYS_ADDR_ACK, M_PCPROTO type
9320Sstevel@tonic-gate  */
9330Sstevel@tonic-gate typedef struct {
9340Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* DL_PHYS_ADDR_ACK */
9350Sstevel@tonic-gate 	t_uscalar_t	dl_addr_length;	/* length of the physical addr */
9360Sstevel@tonic-gate 	t_uscalar_t	dl_addr_offset;	/* offset from start of block */
9370Sstevel@tonic-gate } dl_phys_addr_ack_t;
9380Sstevel@tonic-gate 
9390Sstevel@tonic-gate /*
9400Sstevel@tonic-gate  * DL_SET_PHYS_ADDR_REQ, M_PROTO type
9410Sstevel@tonic-gate  */
9420Sstevel@tonic-gate typedef struct {
9430Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* DL_SET_PHYS_ADDR_REQ */
9440Sstevel@tonic-gate 	t_uscalar_t	dl_addr_length;	/* length of physical addr */
9450Sstevel@tonic-gate 	t_uscalar_t	dl_addr_offset;	/* offset from start of block */
9460Sstevel@tonic-gate } dl_set_phys_addr_req_t;
9470Sstevel@tonic-gate 
9480Sstevel@tonic-gate /*
9490Sstevel@tonic-gate  *	Primitives to get statistics
9500Sstevel@tonic-gate  */
9510Sstevel@tonic-gate 
9520Sstevel@tonic-gate /*
9530Sstevel@tonic-gate  * DL_GET_STATISTICS_REQ, M_PROTO type
9540Sstevel@tonic-gate  */
9550Sstevel@tonic-gate typedef struct {
9560Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* DL_GET_STATISTICS_REQ */
9570Sstevel@tonic-gate } dl_get_statistics_req_t;
9580Sstevel@tonic-gate 
9590Sstevel@tonic-gate /*
9600Sstevel@tonic-gate  * DL_GET_STATISTICS_ACK, M_PCPROTO type
9610Sstevel@tonic-gate  */
9620Sstevel@tonic-gate typedef struct {
9630Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* DL_GET_STATISTICS_ACK */
9640Sstevel@tonic-gate 	t_uscalar_t	dl_stat_length;	/* length of statistics structure */
9650Sstevel@tonic-gate 	t_uscalar_t	dl_stat_offset;	/* offset from start of block */
9660Sstevel@tonic-gate } dl_get_statistics_ack_t;
9670Sstevel@tonic-gate 
9680Sstevel@tonic-gate /*
9690Sstevel@tonic-gate  *	Solaris specific local management service primitives
9700Sstevel@tonic-gate  */
9710Sstevel@tonic-gate 
9720Sstevel@tonic-gate /*
9730Sstevel@tonic-gate  * DL_NOTIFY_REQ, M_PROTO type
9740Sstevel@tonic-gate  */
9750Sstevel@tonic-gate typedef struct {
9760Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* set to DL_NOTIFY_REQ */
9770Sstevel@tonic-gate 	uint32_t	dl_notifications; /* Requested set of notifications */
9780Sstevel@tonic-gate 	uint32_t	dl_timelimit;	/* In milliseconds */
9790Sstevel@tonic-gate } dl_notify_req_t;
9800Sstevel@tonic-gate 
9810Sstevel@tonic-gate /*
9820Sstevel@tonic-gate  * DL_NOTIFY_ACK, M_PROTO type
9830Sstevel@tonic-gate  */
9840Sstevel@tonic-gate typedef struct {
9850Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* set to DL_NOTIFY_ACK */
9860Sstevel@tonic-gate 	uint32_t	dl_notifications; /* Supported set of notifications */
9870Sstevel@tonic-gate } dl_notify_ack_t;
9880Sstevel@tonic-gate 
9890Sstevel@tonic-gate /*
9900Sstevel@tonic-gate  * DL_NOTIFY_IND, M_PROTO type
9910Sstevel@tonic-gate  */
9920Sstevel@tonic-gate typedef struct {
9930Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* set to DL_NOTIFY_IND */
9940Sstevel@tonic-gate 	uint32_t	dl_notification; /* Which notification? */
995*13123SErik.Nordmark@Sun.COM 	union {
996*13123SErik.Nordmark@Sun.COM 		uint32_t	dlu_data32;	/* notification specific */
997*13123SErik.Nordmark@Sun.COM 		uint16_t	dlu_data16[2];	/* For DL_NOTE_SDU_SIZE2 */
998*13123SErik.Nordmark@Sun.COM 	} dl_dlu;
999*13123SErik.Nordmark@Sun.COM #define	dl_data		dl_dlu.dlu_data32
1000*13123SErik.Nordmark@Sun.COM #define	dl_data1	dl_dlu.dlu_data16[0]	/* Unicast MTU */
1001*13123SErik.Nordmark@Sun.COM #define	dl_data2	dl_dlu.dlu_data16[1]	/* Multicast MTU */
10020Sstevel@tonic-gate 	t_uscalar_t	dl_addr_length;	/* length of complete DLSAP addr */
10030Sstevel@tonic-gate 	t_uscalar_t	dl_addr_offset;	/* offset from start of M_PROTO */
10040Sstevel@tonic-gate } dl_notify_ind_t;
10050Sstevel@tonic-gate 
10060Sstevel@tonic-gate /*
10079073SCathy.Zhou@Sun.COM  * DL_NOTIFY_CONF, M_PROTO type
10089073SCathy.Zhou@Sun.COM  */
10099073SCathy.Zhou@Sun.COM typedef struct {
10109073SCathy.Zhou@Sun.COM 	t_uscalar_t	dl_primitive;	/* set to DL_NOTIFY_CONF */
10119073SCathy.Zhou@Sun.COM 	uint32_t	dl_notification; /* Which notification? */
10129073SCathy.Zhou@Sun.COM } dl_notify_conf_t;
10139073SCathy.Zhou@Sun.COM 
10149073SCathy.Zhou@Sun.COM /*
10150Sstevel@tonic-gate  * DL_AGGR_REQ, M_PROTO type
10160Sstevel@tonic-gate  */
10170Sstevel@tonic-gate typedef struct {
10180Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* set to DL_AGGR_REQ */
10190Sstevel@tonic-gate 	uint32_t	dl_key;		/* Key identifying the group */
10200Sstevel@tonic-gate 	uint32_t	dl_port;	/* Identifying the NIC */
10210Sstevel@tonic-gate 	t_uscalar_t	dl_addr_length;	/* length of PHYS addr addr */
10220Sstevel@tonic-gate 	t_uscalar_t	dl_addr_offset;	/* offset from start of M_PROTO */
10230Sstevel@tonic-gate } dl_aggr_req_t;
10240Sstevel@tonic-gate 
10250Sstevel@tonic-gate /*
10260Sstevel@tonic-gate  * DL_AGGR_IND, M_PROTO type
10270Sstevel@tonic-gate  */
10280Sstevel@tonic-gate typedef struct {
10290Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* set to DL_AGGR_IND */
10300Sstevel@tonic-gate 	uint32_t	dl_key;		/* Key identifying the group */
10310Sstevel@tonic-gate 	uint32_t	dl_port;	/* Identifying the NIC */
10320Sstevel@tonic-gate 	t_uscalar_t	dl_addr_length;	/* length of PHYS addr */
10330Sstevel@tonic-gate 	t_uscalar_t	dl_addr_offset;	/* offset from start of M_PROTO */
10340Sstevel@tonic-gate } dl_aggr_ind_t;
10350Sstevel@tonic-gate 
10360Sstevel@tonic-gate /*
10370Sstevel@tonic-gate  * DL_UNAGGR_REQ, M_PROTO type
10380Sstevel@tonic-gate  */
10390Sstevel@tonic-gate typedef struct {
10400Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* set to DL_UNAGGR_REQ */
10410Sstevel@tonic-gate 	uint32_t	dl_key;		/* Key identifying the group */
10420Sstevel@tonic-gate 	uint32_t	dl_port;	/* Identifying the NIC */
10430Sstevel@tonic-gate 	t_uscalar_t	dl_addr_length;	/* length of PHYS addr */
10440Sstevel@tonic-gate 	t_uscalar_t	dl_addr_offset;	/* offset from start of M_PROTO */
10450Sstevel@tonic-gate } dl_unaggr_req_t;
10460Sstevel@tonic-gate 
10470Sstevel@tonic-gate /*
10480Sstevel@tonic-gate  * DL_CAPABILITY_REQ, M_PROTO type
10490Sstevel@tonic-gate  */
10500Sstevel@tonic-gate typedef struct {
10510Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* DL_CAPABILITY_REQ */
10520Sstevel@tonic-gate 	t_uscalar_t	dl_sub_offset;	/* options offset */
10530Sstevel@tonic-gate 	t_uscalar_t	dl_sub_length;	/* options length */
10540Sstevel@tonic-gate 	/* Followed by a list of zero or more dl_capability_sub_t */
10550Sstevel@tonic-gate } dl_capability_req_t;
10560Sstevel@tonic-gate 
10570Sstevel@tonic-gate /*
10580Sstevel@tonic-gate  * DL_CAPABILITY_ACK, M_PROTO type
10590Sstevel@tonic-gate  */
10600Sstevel@tonic-gate typedef struct {
10610Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* DL_CAPABILITY_ACK */
10620Sstevel@tonic-gate 	t_uscalar_t	dl_sub_offset;	/* options offset */
10630Sstevel@tonic-gate 	t_uscalar_t	dl_sub_length;	/* options length */
10640Sstevel@tonic-gate 	/* Followed by a list of zero or more dl_capability_sub_t */
10650Sstevel@tonic-gate } dl_capability_ack_t;
10660Sstevel@tonic-gate 
10670Sstevel@tonic-gate /*
10680Sstevel@tonic-gate  * DL_CONTROL_REQ, M_PROTO type
10690Sstevel@tonic-gate  */
10700Sstevel@tonic-gate typedef struct {
10710Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* DL_CONTROL_REQ */
10720Sstevel@tonic-gate 	t_uscalar_t	dl_operation;	/* add/delete/purge */
10730Sstevel@tonic-gate 	t_uscalar_t	dl_type;	/* e.g. AH/ESP/ ... */
10740Sstevel@tonic-gate 	t_uscalar_t	dl_key_offset;	/* offset of key */
10750Sstevel@tonic-gate 	t_uscalar_t	dl_key_length;	/* length of key */
10760Sstevel@tonic-gate 	t_uscalar_t	dl_data_offset;	/* offset of data */
10770Sstevel@tonic-gate 	t_uscalar_t	dl_data_length;	/* length of data */
10780Sstevel@tonic-gate } dl_control_req_t;
10790Sstevel@tonic-gate 
10800Sstevel@tonic-gate /*
10810Sstevel@tonic-gate  * DL_CONTROL_ACK, M_PROTO type
10820Sstevel@tonic-gate  */
10830Sstevel@tonic-gate typedef struct {
10840Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* DL_CONTROL_ACK */
10850Sstevel@tonic-gate 	t_uscalar_t	dl_operation;	/* add/delete/purge */
10860Sstevel@tonic-gate 	t_uscalar_t	dl_type;	/* e.g. AH/ESP/ ... */
10870Sstevel@tonic-gate 	t_uscalar_t	dl_key_offset;	/* offset of key */
10880Sstevel@tonic-gate 	t_uscalar_t	dl_key_length;	/* length of key */
10890Sstevel@tonic-gate 	t_uscalar_t	dl_data_offset;	/* offset of data */
10900Sstevel@tonic-gate 	t_uscalar_t	dl_data_length;	/* length of data */
10910Sstevel@tonic-gate } dl_control_ack_t;
10920Sstevel@tonic-gate 
10930Sstevel@tonic-gate /*
10940Sstevel@tonic-gate  * DL_PASSIVE_REQ, M_PROTO type
10950Sstevel@tonic-gate  */
10960Sstevel@tonic-gate typedef struct {
10970Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;
10980Sstevel@tonic-gate } dl_passive_req_t;
10990Sstevel@tonic-gate 
11000Sstevel@tonic-gate /*
11014615Sjoycey  *	DL_INTR_MODE_REQ, M_PROTO type
11024615Sjoycey  */
11034615Sjoycey typedef struct {
11044615Sjoycey 	t_uscalar_t	dl_primitive;
11054615Sjoycey 	t_uscalar_t	dl_sap;
11064615Sjoycey 	t_uscalar_t	dl_imode;	/* intr mode: 0 off  1 on */
11074615Sjoycey } dl_intr_mode_req_t;
11084615Sjoycey 
11094615Sjoycey /*
11100Sstevel@tonic-gate  *	CONNECTION-ORIENTED SERVICE PRIMITIVES
11110Sstevel@tonic-gate  */
11120Sstevel@tonic-gate 
11130Sstevel@tonic-gate /*
11140Sstevel@tonic-gate  * DL_CONNECT_REQ, M_PROTO type
11150Sstevel@tonic-gate  */
11160Sstevel@tonic-gate typedef struct {
11170Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* DL_CONNECT_REQ */
11188518SPeter.Memishian@Sun.COM 	t_uscalar_t	dl_dest_addr_length;	/* len. of DLSAP addr */
11190Sstevel@tonic-gate 	t_uscalar_t	dl_dest_addr_offset;	/* offset */
11200Sstevel@tonic-gate 	t_uscalar_t	dl_qos_length;		/* len. of QOS parm val */
11210Sstevel@tonic-gate 	t_uscalar_t	dl_qos_offset;		/* offset */
11220Sstevel@tonic-gate 	t_uscalar_t	dl_growth;		/* set to zero */
11230Sstevel@tonic-gate } dl_connect_req_t;
11240Sstevel@tonic-gate 
11250Sstevel@tonic-gate /*
11260Sstevel@tonic-gate  * DL_CONNECT_IND, M_PROTO type
11270Sstevel@tonic-gate  */
11280Sstevel@tonic-gate typedef struct {
11290Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* DL_CONNECT_IND */
11300Sstevel@tonic-gate 	t_uscalar_t	dl_correlation;		/* provider's correl. token */
11310Sstevel@tonic-gate 	t_uscalar_t	dl_called_addr_length;  /* length of called address */
11320Sstevel@tonic-gate 	t_uscalar_t	dl_called_addr_offset;	/* offset from start of block */
11330Sstevel@tonic-gate 	t_uscalar_t	dl_calling_addr_length;	/* length of calling address */
11340Sstevel@tonic-gate 	t_uscalar_t	dl_calling_addr_offset;	/* offset from start of block */
11350Sstevel@tonic-gate 	t_uscalar_t	dl_qos_length;		/* length of qos structure */
11360Sstevel@tonic-gate 	t_uscalar_t	dl_qos_offset;		/* offset from start of block */
11370Sstevel@tonic-gate 	t_uscalar_t	dl_growth;		/* set to zero */
11380Sstevel@tonic-gate } dl_connect_ind_t;
11390Sstevel@tonic-gate 
11400Sstevel@tonic-gate /*
11410Sstevel@tonic-gate  * DL_CONNECT_RES, M_PROTO type
11420Sstevel@tonic-gate  */
11430Sstevel@tonic-gate typedef struct {
11440Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* DL_CONNECT_RES */
11450Sstevel@tonic-gate 	t_uscalar_t	dl_correlation; /* provider's correlation token */
11460Sstevel@tonic-gate 	t_uscalar_t	dl_resp_token;	/* token of responding stream */
11470Sstevel@tonic-gate 	t_uscalar_t	dl_qos_length;  /* length of qos structure */
11480Sstevel@tonic-gate 	t_uscalar_t	dl_qos_offset;	/* offset from start of block */
11490Sstevel@tonic-gate 	t_uscalar_t	dl_growth;	/* set to zero */
11500Sstevel@tonic-gate } dl_connect_res_t;
11510Sstevel@tonic-gate 
11520Sstevel@tonic-gate /*
11530Sstevel@tonic-gate  * DL_CONNECT_CON, M_PROTO type
11540Sstevel@tonic-gate  */
11550Sstevel@tonic-gate typedef struct {
11560Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* DL_CONNECT_CON */
11570Sstevel@tonic-gate 	t_uscalar_t	dl_resp_addr_length;	/* responder's address len */
11580Sstevel@tonic-gate 	t_uscalar_t	dl_resp_addr_offset;	/* offset from start of block */
11590Sstevel@tonic-gate 	t_uscalar_t	dl_qos_length;		/* length of qos structure */
11600Sstevel@tonic-gate 	t_uscalar_t	dl_qos_offset;		/* offset from start of block */
11610Sstevel@tonic-gate 	t_uscalar_t	dl_growth;		/* set to zero */
11620Sstevel@tonic-gate } dl_connect_con_t;
11630Sstevel@tonic-gate 
11640Sstevel@tonic-gate /*
11650Sstevel@tonic-gate  * DL_TOKEN_REQ, M_PCPROTO type
11660Sstevel@tonic-gate  */
11670Sstevel@tonic-gate typedef struct {
11680Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* DL_TOKEN_REQ */
11690Sstevel@tonic-gate } dl_token_req_t;
11700Sstevel@tonic-gate 
11710Sstevel@tonic-gate /*
11720Sstevel@tonic-gate  * DL_TOKEN_ACK, M_PCPROTO type
11730Sstevel@tonic-gate  */
11740Sstevel@tonic-gate typedef struct {
11750Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* DL_TOKEN_ACK */
11760Sstevel@tonic-gate 	t_uscalar_t	dl_token;	/* Connection response token */
11770Sstevel@tonic-gate }dl_token_ack_t;
11780Sstevel@tonic-gate 
11790Sstevel@tonic-gate /*
11800Sstevel@tonic-gate  * DL_DISCONNECT_REQ, M_PROTO type
11810Sstevel@tonic-gate  */
11820Sstevel@tonic-gate typedef struct {
11830Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* DL_DISCONNECT_REQ */
11840Sstevel@tonic-gate 	t_uscalar_t	dl_reason;	/* norm., abnorm., perm. or trans. */
11850Sstevel@tonic-gate 	t_uscalar_t	dl_correlation; /* association with connect_ind */
11860Sstevel@tonic-gate } dl_disconnect_req_t;
11870Sstevel@tonic-gate 
11880Sstevel@tonic-gate /*
11890Sstevel@tonic-gate  * DL_DISCONNECT_IND, M_PROTO type
11900Sstevel@tonic-gate  */
11910Sstevel@tonic-gate typedef struct {
11920Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* DL_DISCONNECT_IND */
11930Sstevel@tonic-gate 	t_uscalar_t	dl_originator;	/* USER or PROVIDER */
11940Sstevel@tonic-gate 	t_uscalar_t	dl_reason;	/* permanent or transient */
11950Sstevel@tonic-gate 	t_uscalar_t	dl_correlation;	/* association with connect_ind */
11960Sstevel@tonic-gate } dl_disconnect_ind_t;
11970Sstevel@tonic-gate 
11980Sstevel@tonic-gate /*
11990Sstevel@tonic-gate  * DL_RESET_REQ, M_PROTO type
12000Sstevel@tonic-gate  */
12010Sstevel@tonic-gate typedef struct {
12020Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* DL_RESET_REQ */
12030Sstevel@tonic-gate } dl_reset_req_t;
12040Sstevel@tonic-gate 
12050Sstevel@tonic-gate /*
12060Sstevel@tonic-gate  * DL_RESET_IND, M_PROTO type
12070Sstevel@tonic-gate  */
12080Sstevel@tonic-gate typedef struct {
12090Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* DL_RESET_IND */
12100Sstevel@tonic-gate 	t_uscalar_t	dl_originator;	/* Provider or User */
12110Sstevel@tonic-gate 	t_uscalar_t	dl_reason;	/* flow control, link error, resync */
12120Sstevel@tonic-gate } dl_reset_ind_t;
12130Sstevel@tonic-gate 
12140Sstevel@tonic-gate /*
12150Sstevel@tonic-gate  * DL_RESET_RES, M_PROTO type
12160Sstevel@tonic-gate  */
12170Sstevel@tonic-gate typedef struct {
12180Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* DL_RESET_RES */
12190Sstevel@tonic-gate } dl_reset_res_t;
12200Sstevel@tonic-gate 
12210Sstevel@tonic-gate /*
12220Sstevel@tonic-gate  * DL_RESET_CON, M_PROTO type
12230Sstevel@tonic-gate  */
12240Sstevel@tonic-gate typedef struct {
12250Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* DL_RESET_CON */
12260Sstevel@tonic-gate } dl_reset_con_t;
12270Sstevel@tonic-gate 
12280Sstevel@tonic-gate 
12290Sstevel@tonic-gate /*
12300Sstevel@tonic-gate  *	CONNECTIONLESS SERVICE PRIMITIVES
12310Sstevel@tonic-gate  */
12320Sstevel@tonic-gate 
12330Sstevel@tonic-gate /*
12340Sstevel@tonic-gate  * DL_UNITDATA_REQ, M_PROTO type, with M_DATA block(s)
12350Sstevel@tonic-gate  */
12360Sstevel@tonic-gate typedef struct {
12370Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* DL_UNITDATA_REQ */
12380Sstevel@tonic-gate 	t_uscalar_t	dl_dest_addr_length;	/* DLSAP length of dest. user */
12390Sstevel@tonic-gate 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
12400Sstevel@tonic-gate 	dl_priority_t	dl_priority;	/* priority value */
12410Sstevel@tonic-gate } dl_unitdata_req_t;
12420Sstevel@tonic-gate 
12430Sstevel@tonic-gate /*
12440Sstevel@tonic-gate  * DL_UNITDATA_IND, M_PROTO type, with M_DATA block(s)
12450Sstevel@tonic-gate  */
12460Sstevel@tonic-gate typedef struct {
12470Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* DL_UNITDATA_IND */
12480Sstevel@tonic-gate 	t_uscalar_t	dl_dest_addr_length;	/* DLSAP length of dest. user */
12490Sstevel@tonic-gate 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
12500Sstevel@tonic-gate 	t_uscalar_t	dl_src_addr_length;	/* DLSAP addr length sender */
12510Sstevel@tonic-gate 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
12520Sstevel@tonic-gate 	t_uscalar_t	dl_group_address;	/* one if multicast/broadcast */
12530Sstevel@tonic-gate } dl_unitdata_ind_t;
12540Sstevel@tonic-gate 
12550Sstevel@tonic-gate /*
12560Sstevel@tonic-gate  * DL_UDERROR_IND, M_PROTO type
12570Sstevel@tonic-gate  *	(or M_PCPROTO type if LLI-based provider)
12580Sstevel@tonic-gate  */
12590Sstevel@tonic-gate typedef struct {
12600Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* DL_UDERROR_IND */
12610Sstevel@tonic-gate 	t_uscalar_t	dl_dest_addr_length;	/* Destination DLSAP */
12620Sstevel@tonic-gate 	t_uscalar_t	dl_dest_addr_offset;	/* Offset from start of block */
12630Sstevel@tonic-gate 	t_uscalar_t	dl_unix_errno;		/* unix system error code */
12640Sstevel@tonic-gate 	t_uscalar_t	dl_errno;		/* DLPI error code */
12650Sstevel@tonic-gate } dl_uderror_ind_t;
12660Sstevel@tonic-gate 
12670Sstevel@tonic-gate /*
12680Sstevel@tonic-gate  * DL_UDQOS_REQ, M_PROTO type
12690Sstevel@tonic-gate  */
12700Sstevel@tonic-gate typedef struct {
12710Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* DL_UDQOS_REQ */
12720Sstevel@tonic-gate 	t_uscalar_t	dl_qos_length;	/* requested qos byte length */
12730Sstevel@tonic-gate 	t_uscalar_t	dl_qos_offset;	/* offset from start of block */
12740Sstevel@tonic-gate } dl_udqos_req_t;
12750Sstevel@tonic-gate 
12760Sstevel@tonic-gate /*
12770Sstevel@tonic-gate  *	Primitives to handle XID and TEST operations
12780Sstevel@tonic-gate  */
12790Sstevel@tonic-gate 
12800Sstevel@tonic-gate /*
12810Sstevel@tonic-gate  * DL_TEST_REQ, M_PROTO type
12820Sstevel@tonic-gate  */
12830Sstevel@tonic-gate typedef struct {
12840Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* DL_TEST_REQ */
12850Sstevel@tonic-gate 	t_uscalar_t	dl_flag;		/* poll/final */
12860Sstevel@tonic-gate 	t_uscalar_t	dl_dest_addr_length;	/* DLSAP length of dest. user */
12870Sstevel@tonic-gate 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
12880Sstevel@tonic-gate } dl_test_req_t;
12890Sstevel@tonic-gate 
12900Sstevel@tonic-gate /*
12910Sstevel@tonic-gate  * DL_TEST_IND, M_PROTO type
12920Sstevel@tonic-gate  */
12930Sstevel@tonic-gate typedef struct {
12940Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* DL_TEST_IND */
12950Sstevel@tonic-gate 	t_uscalar_t	dl_flag;		/* poll/final */
12968518SPeter.Memishian@Sun.COM 	t_uscalar_t	dl_dest_addr_length;	/* DLSAP length of dest. user */
12970Sstevel@tonic-gate 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
12988518SPeter.Memishian@Sun.COM 	t_uscalar_t	dl_src_addr_length;	/* DLSAP length of source */
12990Sstevel@tonic-gate 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
13000Sstevel@tonic-gate } dl_test_ind_t;
13010Sstevel@tonic-gate 
13020Sstevel@tonic-gate /*
13030Sstevel@tonic-gate  *	DL_TEST_RES, M_PROTO type
13040Sstevel@tonic-gate  */
13050Sstevel@tonic-gate typedef struct {
13060Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* DL_TEST_RES */
13070Sstevel@tonic-gate 	t_uscalar_t	dl_flag;		/* poll/final */
13080Sstevel@tonic-gate 	t_uscalar_t	dl_dest_addr_length;	/* DLSAP length of dest. user */
13090Sstevel@tonic-gate 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
13100Sstevel@tonic-gate } dl_test_res_t;
13110Sstevel@tonic-gate 
13120Sstevel@tonic-gate /*
13130Sstevel@tonic-gate  *	DL_TEST_CON, M_PROTO type
13140Sstevel@tonic-gate  */
13150Sstevel@tonic-gate typedef struct {
13160Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* DL_TEST_CON */
13170Sstevel@tonic-gate 	t_uscalar_t	dl_flag;		/* poll/final */
13188518SPeter.Memishian@Sun.COM 	t_uscalar_t	dl_dest_addr_length;	/* DLSAP length of dest. user */
13190Sstevel@tonic-gate 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
13208518SPeter.Memishian@Sun.COM 	t_uscalar_t	dl_src_addr_length;	/* DLSAP length of source */
13210Sstevel@tonic-gate 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
13220Sstevel@tonic-gate } dl_test_con_t;
13230Sstevel@tonic-gate 
13240Sstevel@tonic-gate /*
13250Sstevel@tonic-gate  * DL_XID_REQ, M_PROTO type
13260Sstevel@tonic-gate  */
13270Sstevel@tonic-gate typedef struct {
13280Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* DL_XID_REQ */
13290Sstevel@tonic-gate 	t_uscalar_t	dl_flag;		/* poll/final */
13308518SPeter.Memishian@Sun.COM 	t_uscalar_t	dl_dest_addr_length;	/* DLSAP length of dest. user */
13310Sstevel@tonic-gate 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
13320Sstevel@tonic-gate } dl_xid_req_t;
13330Sstevel@tonic-gate 
13340Sstevel@tonic-gate /*
13350Sstevel@tonic-gate  * DL_XID_IND, M_PROTO type
13360Sstevel@tonic-gate  */
13370Sstevel@tonic-gate typedef struct {
13380Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* DL_XID_IND */
13390Sstevel@tonic-gate 	t_uscalar_t	dl_flag;		/* poll/final */
13408518SPeter.Memishian@Sun.COM 	t_uscalar_t	dl_dest_addr_length;	/* DLSAP length of dest. user */
13410Sstevel@tonic-gate 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
13428518SPeter.Memishian@Sun.COM 	t_uscalar_t	dl_src_addr_length;	/* DLSAP length of source */
13430Sstevel@tonic-gate 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
13440Sstevel@tonic-gate } dl_xid_ind_t;
13450Sstevel@tonic-gate 
13460Sstevel@tonic-gate /*
13470Sstevel@tonic-gate  *	DL_XID_RES, M_PROTO type
13480Sstevel@tonic-gate  */
13490Sstevel@tonic-gate typedef struct {
13500Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* DL_XID_RES */
13510Sstevel@tonic-gate 	t_uscalar_t	dl_flag;		/* poll/final */
13520Sstevel@tonic-gate 	t_uscalar_t	dl_dest_addr_length;	/* DLSAP length of dest. user */
13530Sstevel@tonic-gate 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
13540Sstevel@tonic-gate } dl_xid_res_t;
13550Sstevel@tonic-gate 
13560Sstevel@tonic-gate /*
13570Sstevel@tonic-gate  *	DL_XID_CON, M_PROTO type
13580Sstevel@tonic-gate  */
13590Sstevel@tonic-gate typedef struct {
13600Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* DL_XID_CON */
13610Sstevel@tonic-gate 	t_uscalar_t	dl_flag;		/* poll/final */
13628518SPeter.Memishian@Sun.COM 	t_uscalar_t	dl_dest_addr_length;	/* DLSAP length of dest. user */
13630Sstevel@tonic-gate 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
13648518SPeter.Memishian@Sun.COM 	t_uscalar_t	dl_src_addr_length;	/* DLSAP length of source */
13650Sstevel@tonic-gate 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
13660Sstevel@tonic-gate } dl_xid_con_t;
13670Sstevel@tonic-gate 
13680Sstevel@tonic-gate /*
13690Sstevel@tonic-gate  *	ACKNOWLEDGED CONNECTIONLESS SERVICE PRIMITIVES
13700Sstevel@tonic-gate  */
13710Sstevel@tonic-gate 
13720Sstevel@tonic-gate /*
13730Sstevel@tonic-gate  * DL_DATA_ACK_REQ, M_PROTO type
13740Sstevel@tonic-gate  */
13750Sstevel@tonic-gate typedef struct {
13760Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* DL_DATA_ACK_REQ */
13770Sstevel@tonic-gate 	t_uscalar_t	dl_correlation;		/* User's correlation token */
13780Sstevel@tonic-gate 	t_uscalar_t	dl_dest_addr_length;	/* length of destination addr */
13790Sstevel@tonic-gate 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
13800Sstevel@tonic-gate 	t_uscalar_t	dl_src_addr_length;	/* length of source address */
13810Sstevel@tonic-gate 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
13820Sstevel@tonic-gate 	t_uscalar_t	dl_priority;		/* priority */
13830Sstevel@tonic-gate 	t_uscalar_t	dl_service_class;	/* DL_RQST_RSP|DL_RQST_NORSP */
13840Sstevel@tonic-gate } dl_data_ack_req_t;
13850Sstevel@tonic-gate 
13860Sstevel@tonic-gate /*
13870Sstevel@tonic-gate  * DL_DATA_ACK_IND, M_PROTO type
13880Sstevel@tonic-gate  */
13890Sstevel@tonic-gate typedef struct {
13900Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* DL_DATA_ACK_IND */
13910Sstevel@tonic-gate 	t_uscalar_t	dl_dest_addr_length;	/* length of destination addr */
13920Sstevel@tonic-gate 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
13930Sstevel@tonic-gate 	t_uscalar_t	dl_src_addr_length;	/* length of source address */
13940Sstevel@tonic-gate 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
13950Sstevel@tonic-gate 	t_uscalar_t	dl_priority;		/* pri. for data unit transm. */
13960Sstevel@tonic-gate 	t_uscalar_t	dl_service_class;	/* DL_RQST_RSP|DL_RQST_NORSP */
13970Sstevel@tonic-gate } dl_data_ack_ind_t;
13980Sstevel@tonic-gate 
13990Sstevel@tonic-gate /*
14000Sstevel@tonic-gate  * DL_DATA_ACK_STATUS_IND, M_PROTO type
14010Sstevel@tonic-gate  */
14020Sstevel@tonic-gate typedef struct {
14030Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* DL_DATA_ACK_STATUS_IND */
14040Sstevel@tonic-gate 	t_uscalar_t	dl_correlation;	/* User's correlation token */
14050Sstevel@tonic-gate 	t_uscalar_t	dl_status;	/* success or failure of previous req */
14060Sstevel@tonic-gate } dl_data_ack_status_ind_t;
14070Sstevel@tonic-gate 
14080Sstevel@tonic-gate /*
14090Sstevel@tonic-gate  * DL_REPLY_REQ, M_PROTO type
14100Sstevel@tonic-gate  */
14110Sstevel@tonic-gate typedef struct {
14120Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* DL_REPLY_REQ */
14130Sstevel@tonic-gate 	t_uscalar_t	dl_correlation;		/* User's correlation token */
14140Sstevel@tonic-gate 	t_uscalar_t	dl_dest_addr_length;	/* destination address length */
14150Sstevel@tonic-gate 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
14160Sstevel@tonic-gate 	t_uscalar_t	dl_src_addr_length;	/* source address length */
14170Sstevel@tonic-gate 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
14180Sstevel@tonic-gate 	t_uscalar_t	dl_priority;		/* pri for data unit trans. */
14190Sstevel@tonic-gate 	t_uscalar_t	dl_service_class;
14200Sstevel@tonic-gate } dl_reply_req_t;
14210Sstevel@tonic-gate 
14220Sstevel@tonic-gate /*
14230Sstevel@tonic-gate  * DL_REPLY_IND, M_PROTO type
14240Sstevel@tonic-gate  */
14250Sstevel@tonic-gate typedef struct {
14260Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* DL_REPLY_IND */
14270Sstevel@tonic-gate 	t_uscalar_t	dl_dest_addr_length;	/* destination address length */
14280Sstevel@tonic-gate 	t_uscalar_t	dl_dest_addr_offset;	/* offset from start of block */
14290Sstevel@tonic-gate 	t_uscalar_t	dl_src_addr_length;	/* length of source address */
14300Sstevel@tonic-gate 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
14310Sstevel@tonic-gate 	t_uscalar_t	dl_priority;		/* pri for data unit trans. */
14320Sstevel@tonic-gate 	t_uscalar_t	dl_service_class;	/* DL_RQST_RSP|DL_RQST_NORSP */
14330Sstevel@tonic-gate } dl_reply_ind_t;
14340Sstevel@tonic-gate 
14350Sstevel@tonic-gate /*
14360Sstevel@tonic-gate  * DL_REPLY_STATUS_IND, M_PROTO type
14370Sstevel@tonic-gate  */
14380Sstevel@tonic-gate typedef struct {
14390Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* DL_REPLY_STATUS_IND */
14400Sstevel@tonic-gate 	t_uscalar_t	dl_correlation;	/* User's correlation token */
14410Sstevel@tonic-gate 	t_uscalar_t	dl_status;	/* success or failure of previous req */
14420Sstevel@tonic-gate } dl_reply_status_ind_t;
14430Sstevel@tonic-gate 
14440Sstevel@tonic-gate /*
14450Sstevel@tonic-gate  * DL_REPLY_UPDATE_REQ, M_PROTO type
14460Sstevel@tonic-gate  */
14470Sstevel@tonic-gate typedef struct {
14480Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;		/* DL_REPLY_UPDATE_REQ */
14490Sstevel@tonic-gate 	t_uscalar_t	dl_correlation;		/* user's correlation token */
14500Sstevel@tonic-gate 	t_uscalar_t	dl_src_addr_length;	/* length of source address */
14510Sstevel@tonic-gate 	t_uscalar_t	dl_src_addr_offset;	/* offset from start of block */
14520Sstevel@tonic-gate } dl_reply_update_req_t;
14530Sstevel@tonic-gate 
14540Sstevel@tonic-gate /*
14550Sstevel@tonic-gate  * DL_REPLY_UPDATE_STATUS_IND, M_PROTO type
14560Sstevel@tonic-gate  */
14570Sstevel@tonic-gate typedef struct {
14580Sstevel@tonic-gate 	t_uscalar_t	dl_primitive;	/* DL_REPLY_UPDATE_STATUS_IND */
14590Sstevel@tonic-gate 	t_uscalar_t	dl_correlation;	/* User's correlation token */
14600Sstevel@tonic-gate 	t_uscalar_t	dl_status;	/* success or failure of previous req */
14610Sstevel@tonic-gate } dl_reply_update_status_ind_t;
14620Sstevel@tonic-gate 
14630Sstevel@tonic-gate union DL_primitives {
14640Sstevel@tonic-gate 	t_uscalar_t		dl_primitive;
14650Sstevel@tonic-gate 	dl_info_req_t		info_req;
14660Sstevel@tonic-gate 	dl_info_ack_t		info_ack;
14670Sstevel@tonic-gate 	dl_attach_req_t		attach_req;
14680Sstevel@tonic-gate 	dl_detach_req_t		detach_req;
14690Sstevel@tonic-gate 	dl_bind_req_t		bind_req;
14700Sstevel@tonic-gate 	dl_bind_ack_t		bind_ack;
14710Sstevel@tonic-gate 	dl_unbind_req_t		unbind_req;
14720Sstevel@tonic-gate 	dl_subs_bind_req_t	subs_bind_req;
14730Sstevel@tonic-gate 	dl_subs_bind_ack_t	subs_bind_ack;
14740Sstevel@tonic-gate 	dl_subs_unbind_req_t	subs_unbind_req;
14750Sstevel@tonic-gate 	dl_ok_ack_t		ok_ack;
14760Sstevel@tonic-gate 	dl_error_ack_t		error_ack;
14770Sstevel@tonic-gate 	dl_connect_req_t	connect_req;
14780Sstevel@tonic-gate 	dl_connect_ind_t	connect_ind;
14790Sstevel@tonic-gate 	dl_connect_res_t	connect_res;
14800Sstevel@tonic-gate 	dl_connect_con_t	connect_con;
14810Sstevel@tonic-gate 	dl_token_req_t		token_req;
14820Sstevel@tonic-gate 	dl_token_ack_t		token_ack;
14830Sstevel@tonic-gate 	dl_disconnect_req_t	disconnect_req;
14840Sstevel@tonic-gate 	dl_disconnect_ind_t	disconnect_ind;
14850Sstevel@tonic-gate 	dl_reset_req_t		reset_req;
14860Sstevel@tonic-gate 	dl_reset_ind_t		reset_ind;
14870Sstevel@tonic-gate 	dl_reset_res_t		reset_res;
14880Sstevel@tonic-gate 	dl_reset_con_t		reset_con;
14890Sstevel@tonic-gate 	dl_unitdata_req_t	unitdata_req;
14900Sstevel@tonic-gate 	dl_unitdata_ind_t	unitdata_ind;
14910Sstevel@tonic-gate 	dl_uderror_ind_t	uderror_ind;
14920Sstevel@tonic-gate 	dl_udqos_req_t		udqos_req;
14930Sstevel@tonic-gate 	dl_enabmulti_req_t	enabmulti_req;
14940Sstevel@tonic-gate 	dl_disabmulti_req_t	disabmulti_req;
14950Sstevel@tonic-gate 	dl_promiscon_req_t	promiscon_req;
14960Sstevel@tonic-gate 	dl_promiscoff_req_t	promiscoff_req;
14970Sstevel@tonic-gate 	dl_phys_addr_req_t	physaddr_req;
14980Sstevel@tonic-gate 	dl_phys_addr_ack_t	physaddr_ack;
14990Sstevel@tonic-gate 	dl_set_phys_addr_req_t	set_physaddr_req;
15000Sstevel@tonic-gate 	dl_get_statistics_req_t	get_statistics_req;
15010Sstevel@tonic-gate 	dl_get_statistics_ack_t	get_statistics_ack;
15020Sstevel@tonic-gate 	dl_notify_req_t		notify_req;
15030Sstevel@tonic-gate 	dl_notify_ack_t		notify_ack;
15040Sstevel@tonic-gate 	dl_notify_ind_t		notify_ind;
15059073SCathy.Zhou@Sun.COM 	dl_notify_conf_t	notify_conf;
15060Sstevel@tonic-gate 	dl_aggr_req_t		aggr_req;
15070Sstevel@tonic-gate 	dl_aggr_ind_t		aggr_ind;
15080Sstevel@tonic-gate 	dl_unaggr_req_t		unaggr_req;
15090Sstevel@tonic-gate 	dl_test_req_t		test_req;
15100Sstevel@tonic-gate 	dl_test_ind_t		test_ind;
15110Sstevel@tonic-gate 	dl_test_res_t		test_res;
15120Sstevel@tonic-gate 	dl_test_con_t		test_con;
15130Sstevel@tonic-gate 	dl_xid_req_t		xid_req;
15140Sstevel@tonic-gate 	dl_xid_ind_t		xid_ind;
15150Sstevel@tonic-gate 	dl_xid_res_t		xid_res;
15160Sstevel@tonic-gate 	dl_xid_con_t		xid_con;
15170Sstevel@tonic-gate 	dl_data_ack_req_t	data_ack_req;
15180Sstevel@tonic-gate 	dl_data_ack_ind_t	data_ack_ind;
15190Sstevel@tonic-gate 	dl_data_ack_status_ind_t	data_ack_status_ind;
15200Sstevel@tonic-gate 	dl_reply_req_t		reply_req;
15210Sstevel@tonic-gate 	dl_reply_ind_t		reply_ind;
15220Sstevel@tonic-gate 	dl_reply_status_ind_t	reply_status_ind;
15230Sstevel@tonic-gate 	dl_reply_update_req_t	reply_update_req;
15240Sstevel@tonic-gate 	dl_reply_update_status_ind_t	reply_update_status_ind;
15250Sstevel@tonic-gate 	dl_capability_req_t	capability_req;
15260Sstevel@tonic-gate 	dl_capability_ack_t	capability_ack;
15270Sstevel@tonic-gate 	dl_control_req_t	control_req;
15280Sstevel@tonic-gate 	dl_control_ack_t	control_ack;
15290Sstevel@tonic-gate 	dl_passive_req_t	passive_req;
15304615Sjoycey 	dl_intr_mode_req_t	intr_mode_req;
15310Sstevel@tonic-gate };
15320Sstevel@tonic-gate 
15330Sstevel@tonic-gate #define	DL_INFO_REQ_SIZE	sizeof (dl_info_req_t)
15340Sstevel@tonic-gate #define	DL_INFO_ACK_SIZE	sizeof (dl_info_ack_t)
15350Sstevel@tonic-gate #define	DL_ATTACH_REQ_SIZE	sizeof (dl_attach_req_t)
15360Sstevel@tonic-gate #define	DL_DETACH_REQ_SIZE	sizeof (dl_detach_req_t)
15370Sstevel@tonic-gate #define	DL_BIND_REQ_SIZE	sizeof (dl_bind_req_t)
15380Sstevel@tonic-gate #define	DL_BIND_ACK_SIZE	sizeof (dl_bind_ack_t)
15390Sstevel@tonic-gate #define	DL_UNBIND_REQ_SIZE	sizeof (dl_unbind_req_t)
15400Sstevel@tonic-gate #define	DL_SUBS_BIND_REQ_SIZE	sizeof (dl_subs_bind_req_t)
15410Sstevel@tonic-gate #define	DL_SUBS_BIND_ACK_SIZE	sizeof (dl_subs_bind_ack_t)
15420Sstevel@tonic-gate #define	DL_SUBS_UNBIND_REQ_SIZE	sizeof (dl_subs_unbind_req_t)
15430Sstevel@tonic-gate #define	DL_OK_ACK_SIZE		sizeof (dl_ok_ack_t)
15440Sstevel@tonic-gate #define	DL_ERROR_ACK_SIZE	sizeof (dl_error_ack_t)
15450Sstevel@tonic-gate #define	DL_CONNECT_REQ_SIZE	sizeof (dl_connect_req_t)
15460Sstevel@tonic-gate #define	DL_CONNECT_IND_SIZE	sizeof (dl_connect_ind_t)
15470Sstevel@tonic-gate #define	DL_CONNECT_RES_SIZE	sizeof (dl_connect_res_t)
15480Sstevel@tonic-gate #define	DL_CONNECT_CON_SIZE	sizeof (dl_connect_con_t)
15490Sstevel@tonic-gate #define	DL_TOKEN_REQ_SIZE	sizeof (dl_token_req_t)
15500Sstevel@tonic-gate #define	DL_TOKEN_ACK_SIZE	sizeof (dl_token_ack_t)
15510Sstevel@tonic-gate #define	DL_DISCONNECT_REQ_SIZE	sizeof (dl_disconnect_req_t)
15520Sstevel@tonic-gate #define	DL_DISCONNECT_IND_SIZE	sizeof (dl_disconnect_ind_t)
15530Sstevel@tonic-gate #define	DL_RESET_REQ_SIZE	sizeof (dl_reset_req_t)
15540Sstevel@tonic-gate #define	DL_RESET_IND_SIZE	sizeof (dl_reset_ind_t)
15550Sstevel@tonic-gate #define	DL_RESET_RES_SIZE	sizeof (dl_reset_res_t)
15560Sstevel@tonic-gate #define	DL_RESET_CON_SIZE	sizeof (dl_reset_con_t)
15570Sstevel@tonic-gate #define	DL_UNITDATA_REQ_SIZE	sizeof (dl_unitdata_req_t)
15580Sstevel@tonic-gate #define	DL_UNITDATA_IND_SIZE	sizeof (dl_unitdata_ind_t)
15590Sstevel@tonic-gate #define	DL_UDERROR_IND_SIZE	sizeof (dl_uderror_ind_t)
15600Sstevel@tonic-gate #define	DL_UDQOS_REQ_SIZE	sizeof (dl_udqos_req_t)
15610Sstevel@tonic-gate #define	DL_ENABMULTI_REQ_SIZE	sizeof (dl_enabmulti_req_t)
15620Sstevel@tonic-gate #define	DL_DISABMULTI_REQ_SIZE	sizeof (dl_disabmulti_req_t)
15630Sstevel@tonic-gate #define	DL_PROMISCON_REQ_SIZE	sizeof (dl_promiscon_req_t)
15640Sstevel@tonic-gate #define	DL_PROMISCOFF_REQ_SIZE	sizeof (dl_promiscoff_req_t)
15650Sstevel@tonic-gate #define	DL_PHYS_ADDR_REQ_SIZE	sizeof (dl_phys_addr_req_t)
15660Sstevel@tonic-gate #define	DL_PHYS_ADDR_ACK_SIZE	sizeof (dl_phys_addr_ack_t)
15670Sstevel@tonic-gate #define	DL_SET_PHYS_ADDR_REQ_SIZE	sizeof (dl_set_phys_addr_req_t)
15680Sstevel@tonic-gate #define	DL_GET_STATISTICS_REQ_SIZE	sizeof (dl_get_statistics_req_t)
15690Sstevel@tonic-gate #define	DL_GET_STATISTICS_ACK_SIZE	sizeof (dl_get_statistics_ack_t)
15700Sstevel@tonic-gate #define	DL_NOTIFY_REQ_SIZE	sizeof (dl_notify_req_t)
15710Sstevel@tonic-gate #define	DL_NOTIFY_ACK_SIZE	sizeof (dl_notify_ack_t)
15720Sstevel@tonic-gate #define	DL_NOTIFY_IND_SIZE	sizeof (dl_notify_ind_t)
15739073SCathy.Zhou@Sun.COM #define	DL_NOTIFY_CONF_SIZE	sizeof (dl_notify_conf_t)
15740Sstevel@tonic-gate #define	DL_AGGR_REQ_SIZE	sizeof (dl_aggr_req_t)
15750Sstevel@tonic-gate #define	DL_AGGR_IND_SIZE	sizeof (dl_aggr_ind_t)
15760Sstevel@tonic-gate #define	DL_UNAGGR_REQ_SIZE	sizeof (dl_unaggr_req_t)
15770Sstevel@tonic-gate #define	DL_XID_REQ_SIZE		sizeof (dl_xid_req_t)
15780Sstevel@tonic-gate #define	DL_XID_IND_SIZE		sizeof (dl_xid_ind_t)
15790Sstevel@tonic-gate #define	DL_XID_RES_SIZE		sizeof (dl_xid_res_t)
15800Sstevel@tonic-gate #define	DL_XID_CON_SIZE		sizeof (dl_xid_con_t)
15810Sstevel@tonic-gate #define	DL_TEST_REQ_SIZE	sizeof (dl_test_req_t)
15820Sstevel@tonic-gate #define	DL_TEST_IND_SIZE	sizeof (dl_test_ind_t)
15830Sstevel@tonic-gate #define	DL_TEST_RES_SIZE	sizeof (dl_test_res_t)
15840Sstevel@tonic-gate #define	DL_TEST_CON_SIZE	sizeof (dl_test_con_t)
15850Sstevel@tonic-gate #define	DL_DATA_ACK_REQ_SIZE	sizeof (dl_data_ack_req_t)
15860Sstevel@tonic-gate #define	DL_DATA_ACK_IND_SIZE	sizeof (dl_data_ack_ind_t)
15870Sstevel@tonic-gate #define	DL_DATA_ACK_STATUS_IND_SIZE	sizeof (dl_data_ack_status_ind_t)
15880Sstevel@tonic-gate #define	DL_REPLY_REQ_SIZE	sizeof (dl_reply_req_t)
15890Sstevel@tonic-gate #define	DL_REPLY_IND_SIZE	sizeof (dl_reply_ind_t)
15900Sstevel@tonic-gate #define	DL_REPLY_STATUS_IND_SIZE	sizeof (dl_reply_status_ind_t)
15910Sstevel@tonic-gate #define	DL_REPLY_UPDATE_REQ_SIZE	sizeof (dl_reply_update_req_t)
15920Sstevel@tonic-gate #define	DL_REPLY_UPDATE_STATUS_IND_SIZE	sizeof (dl_reply_update_status_ind_t)
15930Sstevel@tonic-gate #define	DL_CAPABILITY_REQ_SIZE	sizeof (dl_capability_req_t)
15940Sstevel@tonic-gate #define	DL_CAPABILITY_ACK_SIZE	sizeof (dl_capability_ack_t)
15950Sstevel@tonic-gate #define	DL_CONTROL_REQ_SIZE	sizeof (dl_control_req_t)
15960Sstevel@tonic-gate #define	DL_CONTROL_ACK_SIZE	sizeof (dl_control_ack_t)
15970Sstevel@tonic-gate #define	DL_PASSIVE_REQ_SIZE	sizeof (dl_passive_req_t)
15984617Sjoycey #define	DL_INTR_MODE_REQ_SIZE	sizeof (dl_intr_mode_req_t)
15990Sstevel@tonic-gate 
16000Sstevel@tonic-gate #ifdef	_KERNEL
16010Sstevel@tonic-gate /*
16028518SPeter.Memishian@Sun.COM  * DDI DLPI routines; see the appropriate manpage for details.
16030Sstevel@tonic-gate  */
16048518SPeter.Memishian@Sun.COM extern void	dlbindack(queue_t *, mblk_t *, t_scalar_t, const void *,
16058518SPeter.Memishian@Sun.COM     t_uscalar_t, t_uscalar_t, t_uscalar_t);
16060Sstevel@tonic-gate extern void	dlokack(queue_t *, mblk_t *, t_uscalar_t);
16070Sstevel@tonic-gate extern void	dlerrorack(queue_t *, mblk_t *, t_uscalar_t, t_uscalar_t,
16088518SPeter.Memishian@Sun.COM     t_uscalar_t);
16098518SPeter.Memishian@Sun.COM extern void	dluderrorind(queue_t *, mblk_t *, const void *, t_uscalar_t,
16108518SPeter.Memishian@Sun.COM     t_uscalar_t, t_uscalar_t);
16118518SPeter.Memishian@Sun.COM extern void	dlphysaddrack(queue_t *, mblk_t *, const void *, t_uscalar_t);
16128518SPeter.Memishian@Sun.COM 
16138518SPeter.Memishian@Sun.COM /*
16148518SPeter.Memishian@Sun.COM  * All routines that follow are unstable and subject to change.
16158518SPeter.Memishian@Sun.COM  */
16160Sstevel@tonic-gate extern void	dlcapabsetqid(dl_mid_t *, const queue_t *);
16170Sstevel@tonic-gate extern boolean_t dlcapabcheckqid(const dl_mid_t *, const queue_t *);
16180Sstevel@tonic-gate extern void	dlnotifyack(queue_t *, mblk_t *, uint32_t);
16195895Syz147064 /*
16205895Syz147064  * The ldi_handle_t typedef is in <sys/sunldi.h>, which in turn requires
16215895Syz147064  * <sys/sunddi.h>, which pulls in <sys/cmn_err.h>, which declares kernel
16225895Syz147064  * versions of the printf() functions that conflict with the libc ones.
16235895Syz147064  * This causes conflicts when building MDB modules like ARP that #define
16245895Syz147064  * _KERNEL.  So we use `struct __ldi_handle *' instead.
16255895Syz147064  */
16265895Syz147064 struct __ldi_handle;
16275895Syz147064 extern int dl_attach(struct __ldi_handle *, int, dl_error_ack_t *);
16285895Syz147064 extern int dl_bind(struct __ldi_handle *, uint_t, dl_error_ack_t *);
16295895Syz147064 extern int dl_phys_addr(struct __ldi_handle *, uchar_t *, size_t *,
16305895Syz147064     dl_error_ack_t *);
16315895Syz147064 extern int dl_info(struct __ldi_handle *, dl_info_ack_t *, uchar_t *, size_t *,
16325895Syz147064     dl_error_ack_t *);
16335895Syz147064 extern int dl_notify(struct __ldi_handle *, uint32_t *, dl_error_ack_t *);
16345895Syz147064 extern const char *dl_errstr(t_uscalar_t);
16355895Syz147064 extern const char *dl_primstr(t_uscalar_t);
16365895Syz147064 extern const char *dl_mactypestr(t_uscalar_t);
16375895Syz147064 
16380Sstevel@tonic-gate #endif	/* _KERNEL */
16390Sstevel@tonic-gate 
16400Sstevel@tonic-gate #ifdef	__cplusplus
16410Sstevel@tonic-gate }
16420Sstevel@tonic-gate #endif
16430Sstevel@tonic-gate 
16440Sstevel@tonic-gate #endif /* _SYS_DLPI_H */
1645