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