dlpi.h revision 12554c89453ad4722e4a8e4af492e416d696138e
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Data Link Provider Interface, Version 2.0
* Refer to document: "STREAMS DLPI Spec", 800-6915-01.
*/
#ifndef _SYS_DLPI_H
#define _SYS_DLPI_H
#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.2 */
#ifdef __cplusplus
extern "C" {
#endif
/*
* Sun additions.
*/
#define DL_IOC_HDR_INFO DLIOCHDRINFO
/*
* DLPI revision definition history
*/
/*
* Primitives for Local Management Services
*/
/*
* Solaris specific local management
*/
/*
* Primitives used for Connectionless Service
*/
/*
* Primitives used for Connection-Oriented Service
*/
/*
* Primitives used for Acknowledged Connectionless Service
*/
/*
* Primitives used for XID and TEST operations
*/
/*
* Primitives to get and set the physical address, and to get
* Statistics
*/
/*
* Invalid primitive
*/
/*
* DLPI interface states
*/
/*
* DL_ERROR_ACK error return values
*/
/*
* DLPI media types supported
*/
/*
* Private media types. These must be above the value 0x80000000 as
* stated in the DLPI specification.
*/
/*
* DLPI provider service supported.
* These must be allowed to be bitwise-OR for dl_service_mode in
* DL_INFO_ACK.
*/
/*
* DLPI provider style.
* The DLPI provider style which determines whether a provider
* requires a DL_ATTACH_REQ to inform the provider which PPA
*/
/*
* DLPI Originator for Disconnect and Resets
*/
#define DL_PROVIDER 0x0700
#define DL_USER 0x0701
/*
* DLPI Disconnect Reasons
*/
#define DL_CONREJ_DEST_UNKNOWN 0x0800
#define DL_CONREJ_DEST_UNREACH_PERMANENT 0x0801
#define DL_CONREJ_DEST_UNREACH_TRANSIENT 0x0802
#define DL_CONREJ_QOS_UNAVAIL_PERMANENT 0x0803
#define DL_CONREJ_QOS_UNAVAIL_TRANSIENT 0x0804
#define DL_CONREJ_PERMANENT_COND 0x0805
#define DL_CONREJ_TRANSIENT_COND 0x0806
#define DL_DISC_ABNORMAL_CONDITION 0x0807
#define DL_DISC_NORMAL_CONDITION 0x0808
#define DL_DISC_PERMANENT_CONDITION 0x0809
#define DL_DISC_TRANSIENT_CONDITION 0x080a
#define DL_DISC_UNSPECIFIED 0x080b
/*
* DLPI Reset Reasons
*/
#define DL_RESET_FLOW_CONTROL 0x0900
#define DL_RESET_LINK_ERROR 0x0901
#define DL_RESET_RESYNCH 0x0902
/*
* DLPI status values for acknowledged connectionless data transfer
*/
/*
* Service Class values for acknowledged connectionless data transfer
*/
/*
* DLPI address type definition
*/
/*
* DLPI flag definitions
*/
/*
* XID and TEST responses supported by the provider
*/
/*
* Subsequent bind type
*/
/*
* DLPI promiscuous mode definitions
*/
/*
* DLPI notification codes for DL_NOTIFY primitives.
* Bit-wise distinct since DL_NOTIFY_REQ and DL_NOTIFY_ACK carry multiple
* notification codes.
*/
/*
* DLPI Quality Of Service definition for use in QOS structure definitions.
* The QOS structures are used in connection establishment, DL_INFO_ACK,
* and setting connectionless QOS values.
*/
/*
* Throughput
*
* This parameter is specified for both directions.
*/
typedef struct {
} dl_through_t;
/*
* transit delay specification
*
* This parameter is specified for both directions.
* expressed in milliseconds assuming a DLSDU size of 128 octets.
* The scaling of the value to the current DLSDU size is provider dependent.
*/
typedef struct {
/*
* priority specification
* priority range is 0-100, with 0 being highest value.
*/
typedef struct {
/*
* protection specification
*
*/
/* addition, or deletion */
typedef struct {
} dl_protect_t;
/*
* Resilience specification
* probabilities are scaled by a factor of 10,000 with a time interval
* of 10,000 seconds.
*/
typedef struct {
/*
* QOS type definition to be used for negotiation with the
* remote end of a connection, or a connectionless unitdata request.
* There are two type definitions to handle the negotiation
* process at connection establishment. The typedef dl_qos_range_t
* is used to present a range for parameters. This is used
* in the DL_CONNECT_REQ and DL_CONNECT_IND messages. The typedef
* dl_qos_sel_t is used to select a specific value for the QOS
* parameters. This is used in the DL_CONNECT_RES, DL_CONNECT_CON,
* and DL_INFO_ACK messages to define the selected QOS parameters
* for a connection.
*
* NOTE
* A DataLink provider which has unknown values for any of the fields
* will use a value of DL_UNKNOWN for all values in the fields.
*
* NOTE
* A QOS parameter value of DL_QOS_DONT_CARE informs the DLS
* provider the user requesting this value doesn't care
* what the QOS parameter is set to. This value becomes the
* least possible value in the range of QOS parameters.
* The order of the QOS parameter range is then:
*
* DL_QOS_DONT_CARE < 0 < MAXIMUM QOS VALUE
*/
#define DL_UNKNOWN -1
#define DL_QOS_DONT_CARE -2
/*
* Every QOS structure has the first 4 bytes containing a type
* field, denoting the definition of the rest of the structure.
* This is used in the same manner has the dl_primitive variable
* is in messages.
*
* The following list is the defined QOS structure type values and structures.
*/
typedef struct {
typedef struct {
typedef struct {
typedef struct {
union DL_qos_types {
};
/*
* Solaris specific structures and definitions.
*/
/*
* The following are the capability types and structures used by the
* the DL_CAPABILITY_REQ and DL_CAPABILITY_ACK primitives.
*
* These primitives are used both to determine the set of capabilities in
* the DLS provider and also to turn on and off specific capabilities.
* The response is a DL_CAPABILITY_ACK or DL_ERROR_ACK.
*
* DL_CAPABILITY_REQ can either be empty (i.e. dl_sub_length is zero) which
* is a request for the driver to return all capabilities. Otherwise, the
* DL_CAPABILITY_REQ contains the capabilities the DLS user wants to use and
* their settings.
*
* DL_CAPABILITY_ACK contains the capabilities that the DLS provider can
* support modified based on what was listed in the request. If a
* capability was included in the request then the information returned
* in the ack might be modified based on the information in the request.
*/
/* dl_data is dl_capab_id_t */
/* dl_data is dl_capab_hcksum_t */
/* dl_data is dl_capab_ipsec_t */
/* dl_data is dl_capab_ipsec_t */
/* dl_data is dl_capab_mdt_t */
/* dl_data is dl_capab_zerocopy_t */
/* dl_data is dl_capab_dls_t */
/* dl_data is dl_capab_dls_t */
/* dl_data is dl_capab_lso_t */
typedef struct {
/* Followed by zero or more bytes of dl_data */
/*
* Definitions and structures needed for DL_CONTROL_REQ and DL_CONTROL_ACK
* primitives.
* Extensible message to send down control information to the DLS provider.
* The response is a DL_CONTROL_ACK or DL_ERROR_ACK.
*
* Different types of control operations will define different format for the
* key and data fields. ADD requires key and data fields; if the <type, key>
* matches an already existing entry a DL_ERROR_ACK will be returned. DELETE
* requires a key field; if the <type, key> does not exist, a DL_ERROR_ACK
* will be returned. FLUSH requires neither a key nor data; it
* unconditionally removes all entries for the specified type. GET requires a
* key field; the get operation returns the data for the <type, key>. If
* <type, key> doesn't exist a DL_ERROR_ACK is returned. UPDATE requires key
* and data fields; if <type, key> doesn't exist a DL_ERROR_ACK is returned.
*/
/*
* Control operations
*/
/*
* Control types (dl_type field of dl_control_req_t and dl_control_ack_t)
*/
/* data=keying material */
/* data=keying material */
/*
* Module ID token to be included in new sub-capability structures.
* Existing sub-capabilities lacking an identification token, e.g. IPSEC
* hardware acceleration, need to be encapsulated within the ID sub-
* capability. Access to this structure must be done through
* dlcapab{set,check}qid().
*/
typedef struct {
} dl_mid_t;
/*
* Module ID wrapper (follows dl_capability_sub_t)
*/
typedef struct {
/*
* Multidata Transmit sub-capability (follows dl_capability_sub_t)
*/
typedef struct {
/*
* Multidata Transmit revision definition history
*/
#define MDT_CURRENT_VERSION 0x02
#define MDT_VERSION_2 0x02
/*
* mdt_flags values
*/
/*
* DL_CAPAB_HCKSUM
* Used for negotiating different flavors of checksum offload
* capabilities.
*/
typedef struct {
/*
* DL_CAPAB_HCKSUM revision definition history
*/
#define HCKSUM_CURRENT_VERSION 0x01
#define HCKSUM_VERSION_1 0x01
/*
* Values for dl_txflags
*/
/* capability */
/* ability */
/* ability for IPv4 packets. */
/* ability for IPv6 packets. */
/* capability */
#ifdef _KERNEL
/*
* This structure is used by DL_CAPAB_POLL and DL_CAPAB_SOFT_RING
* capabilities. It provides a mechanism for IP to exchange function
* pointers with a gldv3-based driver to enable it to bypass streams-
* data-paths. DL_CAPAB_POLL mechanism provides a way to blank
* interrupts. Note: True polling support will be added in the future.
* DL_CAPAB_SOFT_RING provides a mechanism to create soft ring at the
* dls layer.
*/
typedef struct dl_capab_dls_s {
/* DLD provided information */
/* IP provided information */
#define POLL_CURRENT_VERSION 0x01
#define POLL_VERSION_1 0x01
#define SOFT_RING_VERSION_1 0x01
/* Values for poll_flags */
/* capability */
/* Values for soft_ring_flags */
/* capability */
/* Soft_Ring fanout types (used by soft_ring_change_status) */
#define SOFT_RING_NONE 0x00
#define SOFT_RING_FANOUT 0x01
#endif /* _KERNEL */
/*
* Zero-copy sub-capability (follows dl_capability_sub_t)
*/
typedef struct {
/*
* Zero-copy revision definition history
*/
#define ZEROCOPY_CURRENT_VERSION 0x01
#define ZEROCOPY_VERSION_1 0x01
/*
* Currently supported values of zerocopy_flags
*/
/* wrt VM named buffers on */
/* transmit */
/*
* Large Send Offload sub-capability (follows dl_capability_sub_t)
*/
typedef struct {
/*
* Large Send Offload revision definition history
*/
#define LSO_CURRENT_VERSION 0x01
#define LSO_VERSION_1 0x01
/*
* Currently supported values of lso_flags
*/
/*
* DLPI interface primitive definitions.
*
* Each primitive is sent as a stream message. It is possible that
* the messages may be viewed as a sequence of bytes that have the
* following form without any padding. The structure definition
* of the following messages may have to change depending on the
* underlying hardware architecture and crossing of a hardware
* boundary with a different hardware architecture.
*
* Fields in the primitives having a name of the form
* dl_reserved cannot be used and have the value of
* binary zero, no bits turned on.
*
* Each message has the name defined followed by the
* stream message type (M_PROTO, M_PCPROTO, M_DATA)
*/
/*
* LOCAL MANAGEMENT SERVICE PRIMITIVES
*/
/*
* DL_INFO_REQ, M_PCPROTO type
*/
typedef struct {
/*
* DL_INFO_ACK, M_PCPROTO type
*/
typedef struct {
/*
* DL_ATTACH_REQ, M_PROTO type
*/
typedef struct {
/*
* DL_DETACH_REQ, M_PROTO type
*/
typedef struct {
/*
* DL_BIND_REQ, M_PROTO type
*/
typedef struct {
/*
* DL_BIND_ACK, M_PCPROTO type
*/
typedef struct {
/*
* DL_SUBS_BIND_REQ, M_PROTO type
*/
typedef struct {
/*
* DL_SUBS_BIND_ACK, M_PCPROTO type
*/
typedef struct {
/*
* DL_UNBIND_REQ, M_PROTO type
*/
typedef struct {
/*
* DL_SUBS_UNBIND_REQ, M_PROTO type
*/
typedef struct {
/*
* DL_OK_ACK, M_PCPROTO type
*/
typedef struct {
} dl_ok_ack_t;
/*
* DL_ERROR_ACK, M_PCPROTO type
*/
typedef struct {
/*
* DL_ENABMULTI_REQ, M_PROTO type
*/
typedef struct {
/*
* DL_DISABMULTI_REQ, M_PROTO type
*/
typedef struct {
/*
* DL_PROMISCON_REQ, M_PROTO type
*/
typedef struct {
/*
* DL_PROMISCOFF_REQ, M_PROTO type
*/
typedef struct {
/*
* Primitives to get and set the Physical address
*/
/*
* DL_PHYS_ADDR_REQ, M_PROTO type
*/
typedef struct {
/*
* DL_PHYS_ADDR_ACK, M_PCPROTO type
*/
typedef struct {
/*
* DL_SET_PHYS_ADDR_REQ, M_PROTO type
*/
typedef struct {
/*
* Primitives to get statistics
*/
/*
* DL_GET_STATISTICS_REQ, M_PROTO type
*/
typedef struct {
/*
* DL_GET_STATISTICS_ACK, M_PCPROTO type
*/
typedef struct {
/*
* Solaris specific local management service primitives
*/
/*
* DL_NOTIFY_REQ, M_PROTO type
*/
typedef struct {
/*
* DL_NOTIFY_ACK, M_PROTO type
*/
typedef struct {
/*
* DL_NOTIFY_IND, M_PROTO type
*/
typedef struct {
/*
* DL_AGGR_REQ, M_PROTO type
*/
typedef struct {
/*
* DL_AGGR_IND, M_PROTO type
*/
typedef struct {
/*
* DL_UNAGGR_REQ, M_PROTO type
*/
typedef struct {
/*
* DL_CAPABILITY_REQ, M_PROTO type
*/
typedef struct {
/* Followed by a list of zero or more dl_capability_sub_t */
/*
* DL_CAPABILITY_ACK, M_PROTO type
*/
typedef struct {
/* Followed by a list of zero or more dl_capability_sub_t */
/*
* DL_CONTROL_REQ, M_PROTO type
*/
typedef struct {
/*
* DL_CONTROL_ACK, M_PROTO type
*/
typedef struct {
/*
* DL_PASSIVE_REQ, M_PROTO type
*/
typedef struct {
/*
* CONNECTION-ORIENTED SERVICE PRIMITIVES
*/
/*
* DL_CONNECT_REQ, M_PROTO type
*/
typedef struct {
/*
* DL_CONNECT_IND, M_PROTO type
*/
typedef struct {
/*
* DL_CONNECT_RES, M_PROTO type
*/
typedef struct {
/*
* DL_CONNECT_CON, M_PROTO type
*/
typedef struct {
/*
* DL_TOKEN_REQ, M_PCPROTO type
*/
typedef struct {
/*
* DL_TOKEN_ACK, M_PCPROTO type
*/
typedef struct {
/*
* DL_DISCONNECT_REQ, M_PROTO type
*/
typedef struct {
/*
* DL_DISCONNECT_IND, M_PROTO type
*/
typedef struct {
/*
* DL_RESET_REQ, M_PROTO type
*/
typedef struct {
/*
* DL_RESET_IND, M_PROTO type
*/
typedef struct {
/*
* DL_RESET_RES, M_PROTO type
*/
typedef struct {
/*
* DL_RESET_CON, M_PROTO type
*/
typedef struct {
/*
* CONNECTIONLESS SERVICE PRIMITIVES
*/
/*
* DL_UNITDATA_REQ, M_PROTO type, with M_DATA block(s)
*/
typedef struct {
/*
* DL_UNITDATA_IND, M_PROTO type, with M_DATA block(s)
*/
typedef struct {
/*
* DL_UDERROR_IND, M_PROTO type
* (or M_PCPROTO type if LLI-based provider)
*/
typedef struct {
/*
* DL_UDQOS_REQ, M_PROTO type
*/
typedef struct {
/*
* Primitives to handle XID and TEST operations
*/
/*
* DL_TEST_REQ, M_PROTO type
*/
typedef struct {
/*
* DL_TEST_IND, M_PROTO type
*/
typedef struct {
/*
* DL_TEST_RES, M_PROTO type
*/
typedef struct {
/*
* DL_TEST_CON, M_PROTO type
*/
typedef struct {
/*
* DL_XID_REQ, M_PROTO type
*/
typedef struct {
} dl_xid_req_t;
/*
* DL_XID_IND, M_PROTO type
*/
typedef struct {
} dl_xid_ind_t;
/*
* DL_XID_RES, M_PROTO type
*/
typedef struct {
} dl_xid_res_t;
/*
* DL_XID_CON, M_PROTO type
*/
typedef struct {
} dl_xid_con_t;
/*
* ACKNOWLEDGED CONNECTIONLESS SERVICE PRIMITIVES
*/
/*
* DL_DATA_ACK_REQ, M_PROTO type
*/
typedef struct {
/*
* DL_DATA_ACK_IND, M_PROTO type
*/
typedef struct {
/*
* DL_DATA_ACK_STATUS_IND, M_PROTO type
*/
typedef struct {
/*
* DL_REPLY_REQ, M_PROTO type
*/
typedef struct {
/*
* DL_REPLY_IND, M_PROTO type
*/
typedef struct {
/*
* DL_REPLY_STATUS_IND, M_PROTO type
*/
typedef struct {
/*
* DL_REPLY_UPDATE_REQ, M_PROTO type
*/
typedef struct {
/*
* DL_REPLY_UPDATE_STATUS_IND, M_PROTO type
*/
typedef struct {
union DL_primitives {
};
#define DL_INFO_REQ_SIZE sizeof (dl_info_req_t)
#define DL_INFO_ACK_SIZE sizeof (dl_info_ack_t)
#define DL_ATTACH_REQ_SIZE sizeof (dl_attach_req_t)
#define DL_DETACH_REQ_SIZE sizeof (dl_detach_req_t)
#define DL_BIND_REQ_SIZE sizeof (dl_bind_req_t)
#define DL_BIND_ACK_SIZE sizeof (dl_bind_ack_t)
#define DL_UNBIND_REQ_SIZE sizeof (dl_unbind_req_t)
#define DL_SUBS_BIND_REQ_SIZE sizeof (dl_subs_bind_req_t)
#define DL_SUBS_BIND_ACK_SIZE sizeof (dl_subs_bind_ack_t)
#define DL_SUBS_UNBIND_REQ_SIZE sizeof (dl_subs_unbind_req_t)
#define DL_OK_ACK_SIZE sizeof (dl_ok_ack_t)
#define DL_ERROR_ACK_SIZE sizeof (dl_error_ack_t)
#define DL_CONNECT_REQ_SIZE sizeof (dl_connect_req_t)
#define DL_CONNECT_IND_SIZE sizeof (dl_connect_ind_t)
#define DL_CONNECT_RES_SIZE sizeof (dl_connect_res_t)
#define DL_CONNECT_CON_SIZE sizeof (dl_connect_con_t)
#define DL_TOKEN_REQ_SIZE sizeof (dl_token_req_t)
#define DL_TOKEN_ACK_SIZE sizeof (dl_token_ack_t)
#define DL_DISCONNECT_REQ_SIZE sizeof (dl_disconnect_req_t)
#define DL_DISCONNECT_IND_SIZE sizeof (dl_disconnect_ind_t)
#define DL_RESET_REQ_SIZE sizeof (dl_reset_req_t)
#define DL_RESET_IND_SIZE sizeof (dl_reset_ind_t)
#define DL_RESET_RES_SIZE sizeof (dl_reset_res_t)
#define DL_RESET_CON_SIZE sizeof (dl_reset_con_t)
#define DL_UNITDATA_REQ_SIZE sizeof (dl_unitdata_req_t)
#define DL_UNITDATA_IND_SIZE sizeof (dl_unitdata_ind_t)
#define DL_UDERROR_IND_SIZE sizeof (dl_uderror_ind_t)
#define DL_UDQOS_REQ_SIZE sizeof (dl_udqos_req_t)
#define DL_ENABMULTI_REQ_SIZE sizeof (dl_enabmulti_req_t)
#define DL_DISABMULTI_REQ_SIZE sizeof (dl_disabmulti_req_t)
#define DL_PROMISCON_REQ_SIZE sizeof (dl_promiscon_req_t)
#define DL_PROMISCOFF_REQ_SIZE sizeof (dl_promiscoff_req_t)
#define DL_PHYS_ADDR_REQ_SIZE sizeof (dl_phys_addr_req_t)
#define DL_PHYS_ADDR_ACK_SIZE sizeof (dl_phys_addr_ack_t)
#define DL_SET_PHYS_ADDR_REQ_SIZE sizeof (dl_set_phys_addr_req_t)
#define DL_GET_STATISTICS_REQ_SIZE sizeof (dl_get_statistics_req_t)
#define DL_GET_STATISTICS_ACK_SIZE sizeof (dl_get_statistics_ack_t)
#define DL_NOTIFY_REQ_SIZE sizeof (dl_notify_req_t)
#define DL_NOTIFY_ACK_SIZE sizeof (dl_notify_ack_t)
#define DL_NOTIFY_IND_SIZE sizeof (dl_notify_ind_t)
#define DL_AGGR_REQ_SIZE sizeof (dl_aggr_req_t)
#define DL_AGGR_IND_SIZE sizeof (dl_aggr_ind_t)
#define DL_UNAGGR_REQ_SIZE sizeof (dl_unaggr_req_t)
#define DL_XID_REQ_SIZE sizeof (dl_xid_req_t)
#define DL_XID_IND_SIZE sizeof (dl_xid_ind_t)
#define DL_XID_RES_SIZE sizeof (dl_xid_res_t)
#define DL_XID_CON_SIZE sizeof (dl_xid_con_t)
#define DL_TEST_REQ_SIZE sizeof (dl_test_req_t)
#define DL_TEST_IND_SIZE sizeof (dl_test_ind_t)
#define DL_TEST_RES_SIZE sizeof (dl_test_res_t)
#define DL_TEST_CON_SIZE sizeof (dl_test_con_t)
#define DL_DATA_ACK_REQ_SIZE sizeof (dl_data_ack_req_t)
#define DL_DATA_ACK_IND_SIZE sizeof (dl_data_ack_ind_t)
#define DL_DATA_ACK_STATUS_IND_SIZE sizeof (dl_data_ack_status_ind_t)
#define DL_REPLY_REQ_SIZE sizeof (dl_reply_req_t)
#define DL_REPLY_IND_SIZE sizeof (dl_reply_ind_t)
#define DL_REPLY_STATUS_IND_SIZE sizeof (dl_reply_status_ind_t)
#define DL_REPLY_UPDATE_REQ_SIZE sizeof (dl_reply_update_req_t)
#define DL_REPLY_UPDATE_STATUS_IND_SIZE sizeof (dl_reply_update_status_ind_t)
#define DL_CAPABILITY_REQ_SIZE sizeof (dl_capability_req_t)
#define DL_CAPABILITY_ACK_SIZE sizeof (dl_capability_ack_t)
#define DL_CONTROL_REQ_SIZE sizeof (dl_control_req_t)
#define DL_CONTROL_ACK_SIZE sizeof (dl_control_ack_t)
#define DL_PASSIVE_REQ_SIZE sizeof (dl_passive_req_t)
#ifdef _KERNEL
/*
* The following are unstable, internal DLPI utility routines.
*/
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_DLPI_H */