17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5ba2e4443Sseb * Common Development and Distribution License (the "License"). 6ba2e4443Sseb * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 217c478bd9Sstevel@tonic-gate /* 22da000602SGirish Moodalbail * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate * Use is subject to license terms. 247c478bd9Sstevel@tonic-gate */ 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate #ifndef _SYS_DLD_H 277c478bd9Sstevel@tonic-gate #define _SYS_DLD_H 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gate /* 307c478bd9Sstevel@tonic-gate * Data-Link Driver (public header). 31eae72b5bSSebastien Roy * 32eae72b5bSSebastien Roy * Note that the datastructures defined here define an ioctl interface 33eae72b5bSSebastien Roy * that is shared betwen user and kernel space. The dld driver thus 34eae72b5bSSebastien Roy * assumes that the structures have identical layout and size when 35eae72b5bSSebastien Roy * compiled in either IPL32 or LP64. 367c478bd9Sstevel@tonic-gate */ 377c478bd9Sstevel@tonic-gate 387c478bd9Sstevel@tonic-gate #include <sys/types.h> 397c478bd9Sstevel@tonic-gate #include <sys/stream.h> 40da14cebeSEric Cheng #include <sys/mac_flow.h> 41d62bc4baSyz147064 #include <sys/conf.h> 42d62bc4baSyz147064 #include <sys/sad.h> 433fd94f8cSam223141 #include <sys/mac.h> 447c478bd9Sstevel@tonic-gate 457c478bd9Sstevel@tonic-gate #ifdef __cplusplus 467c478bd9Sstevel@tonic-gate extern "C" { 477c478bd9Sstevel@tonic-gate #endif 487c478bd9Sstevel@tonic-gate 497c478bd9Sstevel@tonic-gate /* 507c478bd9Sstevel@tonic-gate * Data-Link Driver Information (text emitted by modinfo(1m)) 517c478bd9Sstevel@tonic-gate */ 524045d941Ssowmini #define DLD_INFO "Data-Link Driver" 537c478bd9Sstevel@tonic-gate 547c478bd9Sstevel@tonic-gate /* 557c478bd9Sstevel@tonic-gate * Options: To enable an option set the property name to a non-zero value 567c478bd9Sstevel@tonic-gate * in kernel/drv/dld.conf. 577c478bd9Sstevel@tonic-gate */ 587c478bd9Sstevel@tonic-gate 597c478bd9Sstevel@tonic-gate /* 607c478bd9Sstevel@tonic-gate * Prevent use of the IP fast-path (direct M_DATA transmit). 617c478bd9Sstevel@tonic-gate */ 627c478bd9Sstevel@tonic-gate #define DLD_PROP_NO_FASTPATH "no-fastpath" 637c478bd9Sstevel@tonic-gate 647c478bd9Sstevel@tonic-gate /* 657c478bd9Sstevel@tonic-gate * Prevent advertising of the DL_CAPAB_POLL capability. 667c478bd9Sstevel@tonic-gate */ 677c478bd9Sstevel@tonic-gate #define DLD_PROP_NO_POLL "no-poll" 687c478bd9Sstevel@tonic-gate 697c478bd9Sstevel@tonic-gate /* 707c478bd9Sstevel@tonic-gate * Prevent advertising of the DL_CAPAB_ZEROCOPY capability. 717c478bd9Sstevel@tonic-gate */ 727c478bd9Sstevel@tonic-gate #define DLD_PROP_NO_ZEROCOPY "no-zerocopy" 737c478bd9Sstevel@tonic-gate 747c478bd9Sstevel@tonic-gate /* 759c175129Sja97890 * Prevent advertising of the DL_CAPAB_SOFTRING capability. 769c175129Sja97890 */ 779c175129Sja97890 #define DLD_PROP_NO_SOFTRING "no-softring" 789c175129Sja97890 799c175129Sja97890 /* 807c478bd9Sstevel@tonic-gate * The name of the driver. 817c478bd9Sstevel@tonic-gate */ 827c478bd9Sstevel@tonic-gate #define DLD_DRIVER_NAME "dld" 837c478bd9Sstevel@tonic-gate 84da14cebeSEric Cheng #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4 85da14cebeSEric Cheng #pragma pack(4) 86da14cebeSEric Cheng #endif 87da14cebeSEric Cheng 887c478bd9Sstevel@tonic-gate /* 897c478bd9Sstevel@tonic-gate * IOCTL codes and data structures. 907c478bd9Sstevel@tonic-gate */ 91eae72b5bSSebastien Roy #define DLDIOC_ATTR DLDIOC(0x03) 927c478bd9Sstevel@tonic-gate 937c478bd9Sstevel@tonic-gate typedef struct dld_ioc_attr { 94d62bc4baSyz147064 datalink_id_t dia_linkid; 95210db224Sericheng uint_t dia_max_sdu; 967c478bd9Sstevel@tonic-gate } dld_ioc_attr_t; 977c478bd9Sstevel@tonic-gate 98eae72b5bSSebastien Roy #define DLDIOC_VLAN_ATTR DLDIOC(0x04) 99d62bc4baSyz147064 typedef struct dld_ioc_vlan_attr { 100d62bc4baSyz147064 datalink_id_t div_vlanid; 101d62bc4baSyz147064 uint16_t div_vid; 102d62bc4baSyz147064 datalink_id_t div_linkid; 103d62bc4baSyz147064 boolean_t div_force; 104d62bc4baSyz147064 } dld_ioc_vlan_attr_t; 105210db224Sericheng 106eae72b5bSSebastien Roy #define DLDIOC_PHYS_ATTR DLDIOC(0x05) 107e7801d59Ssowmini #define DLPI_LINKNAME_MAX 32 108e7801d59Ssowmini 109d62bc4baSyz147064 typedef struct dld_ioc_phys_attr { 110d62bc4baSyz147064 datalink_id_t dip_linkid; 111d62bc4baSyz147064 /* 112d62bc4baSyz147064 * Whether this physical link supports vanity naming. Note that 113d62bc4baSyz147064 * physical links whose media type is not supported by GLDv3 114d62bc4baSyz147064 * can not support vanity naming. 115d62bc4baSyz147064 */ 116d62bc4baSyz147064 boolean_t dip_novanity; 117d62bc4baSyz147064 char dip_dev[MAXLINKNAMELEN]; 118d62bc4baSyz147064 } dld_ioc_phys_attr_t; 119f4b3ec61Sdh155122 1200ba2cbe9Sxc151355 /* 1210ba2cbe9Sxc151355 * Secure objects ioctls 1220ba2cbe9Sxc151355 */ 1230ba2cbe9Sxc151355 typedef enum { 124a399b765Szf162725 DLD_SECOBJ_CLASS_WEP = 1, 125a399b765Szf162725 DLD_SECOBJ_CLASS_WPA 1260ba2cbe9Sxc151355 } dld_secobj_class_t; 1270ba2cbe9Sxc151355 1280ba2cbe9Sxc151355 #define DLD_SECOBJ_OPT_CREATE 0x00000001 1290ba2cbe9Sxc151355 #define DLD_SECOBJ_NAME_MAX 32 1300ba2cbe9Sxc151355 #define DLD_SECOBJ_VAL_MAX 256 1310ba2cbe9Sxc151355 typedef struct dld_secobj { 1320ba2cbe9Sxc151355 char so_name[DLD_SECOBJ_NAME_MAX]; 1330ba2cbe9Sxc151355 dld_secobj_class_t so_class; 1340ba2cbe9Sxc151355 uint8_t so_val[DLD_SECOBJ_VAL_MAX]; 1350ba2cbe9Sxc151355 uint_t so_len; 1360ba2cbe9Sxc151355 } dld_secobj_t; 1370ba2cbe9Sxc151355 138eae72b5bSSebastien Roy #define DLDIOC_SECOBJ_SET DLDIOC(0x06) 1390ba2cbe9Sxc151355 typedef struct dld_ioc_secobj_set { 1400ba2cbe9Sxc151355 dld_secobj_t ss_obj; 1410ba2cbe9Sxc151355 uint_t ss_flags; 1420ba2cbe9Sxc151355 } dld_ioc_secobj_set_t; 1430ba2cbe9Sxc151355 144eae72b5bSSebastien Roy #define DLDIOC_SECOBJ_GET DLDIOC(0x07) 1450ba2cbe9Sxc151355 typedef struct dld_ioc_secobj_get { 1460ba2cbe9Sxc151355 dld_secobj_t sg_obj; 1470ba2cbe9Sxc151355 uint_t sg_count; 148eae72b5bSSebastien Roy uint_t sg_size; 1490ba2cbe9Sxc151355 } dld_ioc_secobj_get_t; 1500ba2cbe9Sxc151355 151d62bc4baSyz147064 /* 152d62bc4baSyz147064 * The following two slots were used outside of ON, so don't reuse them. 153d62bc4baSyz147064 * 154eae72b5bSSebastien Roy * #define DLDIOCHOLDVLAN DLDIOC(0x08) 155eae72b5bSSebastien Roy * #define DLDIOCRELEVLAN DLDIOC(0x09) 156d62bc4baSyz147064 */ 157d62bc4baSyz147064 158eae72b5bSSebastien Roy #define DLDIOC_SECOBJ_UNSET DLDIOC(0x0a) 1590ba2cbe9Sxc151355 typedef struct dld_ioc_secobj_unset { 1600ba2cbe9Sxc151355 char su_name[DLD_SECOBJ_NAME_MAX]; 1610ba2cbe9Sxc151355 } dld_ioc_secobj_unset_t; 1620ba2cbe9Sxc151355 163eae72b5bSSebastien Roy #define DLDIOC_CREATE_VLAN DLDIOC(0x0b) 164d62bc4baSyz147064 typedef struct dld_ioc_create_vlan { 165d62bc4baSyz147064 datalink_id_t dic_vlanid; 166d62bc4baSyz147064 datalink_id_t dic_linkid; 167d62bc4baSyz147064 uint16_t dic_vid; 168d62bc4baSyz147064 boolean_t dic_force; 169d62bc4baSyz147064 } dld_ioc_create_vlan_t; 170d62bc4baSyz147064 171eae72b5bSSebastien Roy #define DLDIOC_DELETE_VLAN DLDIOC(0x0c) 172d62bc4baSyz147064 typedef struct dld_ioc_delete_vlan { 173d62bc4baSyz147064 datalink_id_t did_linkid; 174d62bc4baSyz147064 } dld_ioc_delete_vlan_t; 175d62bc4baSyz147064 1763bc21d0aSAruna Ramakrishna - Sun Microsystems /* 1773bc21d0aSAruna Ramakrishna - Sun Microsystems * The following constants have been removed, and the slots are open: 1783bc21d0aSAruna Ramakrishna - Sun Microsystems * 179eae72b5bSSebastien Roy * #define DLDIOC_SETAUTOPUSH DLDIOC(0x0d) 180eae72b5bSSebastien Roy * #define DLDIOC_GETAUTOPUSH DLDIOC(0x0e) 181eae72b5bSSebastien Roy * #define DLDIOC_CLRAUTOPUSH DLDIOC(0x0f) 1823bc21d0aSAruna Ramakrishna - Sun Microsystems */ 183d62bc4baSyz147064 184eae72b5bSSebastien Roy #define DLDIOC_DOORSERVER DLDIOC(0x10) 185d62bc4baSyz147064 typedef struct dld_ioc_door { 186d62bc4baSyz147064 boolean_t did_start_door; 187d62bc4baSyz147064 } dld_ioc_door_t; 188d62bc4baSyz147064 189eae72b5bSSebastien Roy #define DLDIOC_RENAME DLDIOC(0x11) 190d62bc4baSyz147064 typedef struct dld_ioc_rename { 191d62bc4baSyz147064 datalink_id_t dir_linkid1; 192d62bc4baSyz147064 datalink_id_t dir_linkid2; 193d62bc4baSyz147064 char dir_link[MAXLINKNAMELEN]; 194d62bc4baSyz147064 } dld_ioc_rename_t; 195d62bc4baSyz147064 196f4b3ec61Sdh155122 /* 1973bc21d0aSAruna Ramakrishna - Sun Microsystems * The following constants have been removed, and the slots are open: 1983bc21d0aSAruna Ramakrishna - Sun Microsystems * 199eae72b5bSSebastien Roy * #define DLDIOC_SETZID DLDIOC(0x12) 200eae72b5bSSebastien Roy * #define DLDIOC_GETZID DLDIOC(0x13) 201f4b3ec61Sdh155122 */ 202f4b3ec61Sdh155122 2033bc21d0aSAruna Ramakrishna - Sun Microsystems typedef struct dld_ioc_zid { 2043bc21d0aSAruna Ramakrishna - Sun Microsystems zoneid_t diz_zid; 2052b24ab6bSSebastien Roy datalink_id_t diz_linkid; 2063bc21d0aSAruna Ramakrishna - Sun Microsystems } dld_ioc_zid_t; 207f4b3ec61Sdh155122 208d62bc4baSyz147064 /* 209d62bc4baSyz147064 * data-link autopush configuration. 210d62bc4baSyz147064 */ 211d62bc4baSyz147064 struct dlautopush { 212d62bc4baSyz147064 uint_t dap_anchor; 213d62bc4baSyz147064 uint_t dap_npush; 214d62bc4baSyz147064 char dap_aplist[MAXAPUSH][FMNAMESZ+1]; 215d62bc4baSyz147064 }; 216f4b3ec61Sdh155122 217da14cebeSEric Cheng #define DLDIOC_MACADDRGET DLDIOC(0x15) 218da14cebeSEric Cheng typedef struct dld_ioc_macaddrget { 219da14cebeSEric Cheng datalink_id_t dig_linkid; 220da14cebeSEric Cheng uint_t dig_count; 221da14cebeSEric Cheng uint_t dig_size; 222da14cebeSEric Cheng } dld_ioc_macaddrget_t; 223da14cebeSEric Cheng 224da14cebeSEric Cheng /* possible flags for dmi_flags below */ 225da14cebeSEric Cheng #define DLDIOCMACADDR_USED 0x1 /* address slot used */ 226da14cebeSEric Cheng 227da14cebeSEric Cheng typedef struct dld_macaddrinfo { 228da14cebeSEric Cheng uint_t dmi_slot; 229da14cebeSEric Cheng uint_t dmi_flags; 230da14cebeSEric Cheng uint_t dmi_addrlen; 231da14cebeSEric Cheng uchar_t dmi_addr[MAXMACADDRLEN]; 232da14cebeSEric Cheng char dmi_client_name[MAXNAMELEN]; 233da14cebeSEric Cheng datalink_id_t dma_client_linkid; 234da14cebeSEric Cheng } dld_macaddrinfo_t; 235da14cebeSEric Cheng 236da14cebeSEric Cheng /* 237da14cebeSEric Cheng * IOCTL codes and data structures for flowadm. 238da14cebeSEric Cheng */ 239da14cebeSEric Cheng #define DLDIOC_ADDFLOW DLDIOC(0x16) 240da14cebeSEric Cheng typedef struct dld_ioc_addflow { 241da14cebeSEric Cheng datalink_id_t af_linkid; 242da14cebeSEric Cheng flow_desc_t af_flow_desc; 243da14cebeSEric Cheng mac_resource_props_t af_resource_props; 244da000602SGirish Moodalbail char af_name[MAXFLOWNAMELEN]; 245da14cebeSEric Cheng } dld_ioc_addflow_t; 246da14cebeSEric Cheng 247da14cebeSEric Cheng #define DLDIOC_REMOVEFLOW DLDIOC(0x17) 248da14cebeSEric Cheng typedef struct dld_ioc_removeflow { 249da000602SGirish Moodalbail char rf_name[MAXFLOWNAMELEN]; 250da14cebeSEric Cheng } dld_ioc_removeflow_t; 251da14cebeSEric Cheng 252da14cebeSEric Cheng #define DLDIOC_MODIFYFLOW DLDIOC(0x18) 253da14cebeSEric Cheng typedef struct dld_ioc_modifyflow { 254da000602SGirish Moodalbail char mf_name[MAXFLOWNAMELEN]; 255da14cebeSEric Cheng mac_resource_props_t mf_resource_props; 256da14cebeSEric Cheng } dld_ioc_modifyflow_t; 257da14cebeSEric Cheng 258da14cebeSEric Cheng #define DLDIOC_WALKFLOW DLDIOC(0x19) 259da14cebeSEric Cheng typedef struct dld_ioc_walkflow { 260da14cebeSEric Cheng datalink_id_t wf_linkid; 261da000602SGirish Moodalbail char wf_name[MAXFLOWNAMELEN]; 262da14cebeSEric Cheng uint32_t wf_nflows; 263da14cebeSEric Cheng uint_t wf_len; 264da14cebeSEric Cheng } dld_ioc_walkflow_t; 265da14cebeSEric Cheng 266da14cebeSEric Cheng typedef struct dld_flowinfo { 267da14cebeSEric Cheng datalink_id_t fi_linkid; 268da14cebeSEric Cheng flow_desc_t fi_flow_desc; 269da14cebeSEric Cheng mac_resource_props_t fi_resource_props; 270da000602SGirish Moodalbail char fi_flowname[MAXFLOWNAMELEN]; 271da14cebeSEric Cheng uint32_t fi_pad; 272da14cebeSEric Cheng } dld_flowinfo_t; 273da14cebeSEric Cheng 274da14cebeSEric Cheng #define DLDIOC_USAGELOG DLDIOC(0x1a) 275da14cebeSEric Cheng typedef struct dld_ioc_usagelog { 276da14cebeSEric Cheng mac_logtype_t ul_type; 277da14cebeSEric Cheng boolean_t ul_onoff; 278da14cebeSEric Cheng uint_t ul_interval; 279da14cebeSEric Cheng } dld_ioc_usagelog_t; 280da14cebeSEric Cheng 281da14cebeSEric Cheng #define DLDIOC_SETMACPROP DLDIOC(0x1b) 282da14cebeSEric Cheng #define DLDIOC_GETMACPROP DLDIOC(0x1c) 2833fd94f8cSam223141 #define MAC_PROP_VERSION 1 284e7801d59Ssowmini 2853fd94f8cSam223141 typedef struct dld_ioc_macprop_s { 286e7801d59Ssowmini int pr_version; 2874045d941Ssowmini uint_t pr_flags; 2886b9e797cSsowmini datalink_id_t pr_linkid; 2893fd94f8cSam223141 mac_prop_id_t pr_num; 290afdda45fSVasumathi Sundaram - Sun Microsystems uint_t pr_perm_flags; 2914045d941Ssowmini char pr_name[MAXLINKPROPNAME]; 292e7801d59Ssowmini uint_t pr_valsize; /* sizeof pr_val */ 293e7801d59Ssowmini char pr_val[1]; 2943fd94f8cSam223141 } dld_ioc_macprop_t; 295e7801d59Ssowmini 296da14cebeSEric Cheng #define DLDIOC_GETHWGRP DLDIOC(0x1d) 297da14cebeSEric Cheng 298da14cebeSEric Cheng typedef struct dld_ioc_hwgrpget { 299da14cebeSEric Cheng datalink_id_t dih_linkid; 300da14cebeSEric Cheng uint_t dih_n_groups; /* number of groups included in ioc */ 301da14cebeSEric Cheng uint_t dih_size; 302da14cebeSEric Cheng } dld_ioc_hwgrpget_t; 303da14cebeSEric Cheng 304da14cebeSEric Cheng #define MAXCLIENTNAMELEN 1024 305da14cebeSEric Cheng typedef struct dld_hwgrpinfo { 306da14cebeSEric Cheng char dhi_link_name[MAXLINKNAMELEN]; 307da14cebeSEric Cheng uint_t dhi_grp_num; 308da14cebeSEric Cheng uint_t dhi_grp_type; 309da14cebeSEric Cheng uint_t dhi_n_rings; 310da14cebeSEric Cheng uint_t dhi_n_clnts; 311da14cebeSEric Cheng /* XXXX later we should use dhi_n_clnts * MAXNAMELEN for dhi_clnts */ 312da14cebeSEric Cheng char dhi_clnts[MAXCLIENTNAMELEN]; 313da14cebeSEric Cheng } dld_hwgrpinfo_t; 314da14cebeSEric Cheng 315da14cebeSEric Cheng #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4 316da14cebeSEric Cheng #pragma pack() 317da14cebeSEric Cheng #endif 318da14cebeSEric Cheng 319210db224Sericheng #ifdef _KERNEL 320da14cebeSEric Cheng 321da14cebeSEric Cheng #define DLD_CAPAB_DIRECT 0x00000001 322da14cebeSEric Cheng #define DLD_CAPAB_POLL 0x00000002 323da14cebeSEric Cheng #define DLD_CAPAB_PERIM 0x00000003 324da14cebeSEric Cheng #define DLD_CAPAB_LSO 0x00000004 325da14cebeSEric Cheng 326da14cebeSEric Cheng #define DLD_ENABLE 0x00000001 327da14cebeSEric Cheng #define DLD_DISABLE 0x00000002 328da14cebeSEric Cheng #define DLD_QUERY 0x00000003 329da14cebeSEric Cheng 330da14cebeSEric Cheng /* 331da14cebeSEric Cheng * GLDv3 entry point for negotiating capabilities. 332da14cebeSEric Cheng * This is exposed to IP after negotiation of DL_CAPAB_DLD. 333da14cebeSEric Cheng * 334da14cebeSEric Cheng * This function takes the following arguments: 335da14cebeSEric Cheng * handle: used for identifying the interface to operate on (provided by dld). 336da14cebeSEric Cheng * type: capability type. 337da14cebeSEric Cheng * arg: points to a capability-specific structure. 338da14cebeSEric Cheng * flags: used for indicating whether to enable or disable a capability. 339da14cebeSEric Cheng * 340da14cebeSEric Cheng * With this function, capability negotiation is reduced from a multi-step 341da14cebeSEric Cheng * process to just one single function call. 342da14cebeSEric Cheng * e.g. the following code would pass 'x' from IP to dld and obtain 343da14cebeSEric Cheng * arg.output_arg from dld: 344da14cebeSEric Cheng * 345da14cebeSEric Cheng * arg.input_arg = x; 346da14cebeSEric Cheng * rc = (*dld_capab)(handle, DLD_CAPAB_XXX, &arg, DLD_ENABLE); 347da14cebeSEric Cheng * ill->info1 = arg.output_arg; 348da14cebeSEric Cheng */ 349da14cebeSEric Cheng typedef int (*dld_capab_func_t)(void *, uint_t, void *, uint_t); 350da14cebeSEric Cheng 351da14cebeSEric Cheng /* 352da14cebeSEric Cheng * Direct Tx/Rx capability. 353da14cebeSEric Cheng */ 354da14cebeSEric Cheng typedef struct dld_capab_direct_s { 355da14cebeSEric Cheng /* 356da14cebeSEric Cheng * Rx entry point and handle, owned by IP. 357da14cebeSEric Cheng */ 358da14cebeSEric Cheng uintptr_t di_rx_cf; 359da14cebeSEric Cheng void *di_rx_ch; 360da14cebeSEric Cheng 361da14cebeSEric Cheng /* 362da14cebeSEric Cheng * Tx entry points and handle, owned by DLD. 363da14cebeSEric Cheng */ 364da14cebeSEric Cheng /* Entry point for transmitting packets */ 365da14cebeSEric Cheng uintptr_t di_tx_df; 366da14cebeSEric Cheng void *di_tx_dh; 367da14cebeSEric Cheng 368da14cebeSEric Cheng /* flow control notification callback */ 369da14cebeSEric Cheng uintptr_t di_tx_cb_df; /* callback registration/de-registration */ 370da14cebeSEric Cheng void *di_tx_cb_dh; 371ae6aa22aSVenugopal Iyer 372ae6aa22aSVenugopal Iyer /* flow control "can I put on a ring" callback */ 373ae6aa22aSVenugopal Iyer uintptr_t di_tx_fctl_df; /* canput-like callback */ 374ae6aa22aSVenugopal Iyer void *di_tx_fctl_dh; 375da14cebeSEric Cheng } dld_capab_direct_t; 376da14cebeSEric Cheng 377da14cebeSEric Cheng /* 378da14cebeSEric Cheng * Polling/softring capability. 379da14cebeSEric Cheng */ 380da14cebeSEric Cheng #define POLL_SOFTRING 0x00000001 381da14cebeSEric Cheng typedef struct dld_capab_poll_s { 382da14cebeSEric Cheng uintptr_t poll_ring_add_cf; 383da14cebeSEric Cheng uintptr_t poll_ring_remove_cf; 384da14cebeSEric Cheng uintptr_t poll_ring_quiesce_cf; 385da14cebeSEric Cheng uintptr_t poll_ring_restart_cf; 386da14cebeSEric Cheng uintptr_t poll_ring_bind_cf; 387da14cebeSEric Cheng void *poll_ring_ch; 388da14cebeSEric Cheng uintptr_t poll_mac_accept_df; 389da14cebeSEric Cheng void *poll_mac_dh; 390da14cebeSEric Cheng } dld_capab_poll_t; 391da14cebeSEric Cheng 392da14cebeSEric Cheng /* 393da14cebeSEric Cheng * LSO capability 394da14cebeSEric Cheng */ 395da14cebeSEric Cheng /* 396da14cebeSEric Cheng * Currently supported flags for LSO. 397da14cebeSEric Cheng */ 398*bd670b35SErik Nordmark #define DLD_LSO_BASIC_TCP_IPV4 0x01 /* TCP LSO over IPv4 capability */ 399*bd670b35SErik Nordmark #define DLD_LSO_BASIC_TCP_IPV6 0x02 /* TCP LSO over IPv6 capability */ 400da14cebeSEric Cheng 401da14cebeSEric Cheng typedef struct dld_capab_lso_s { 402da14cebeSEric Cheng uint_t lso_flags; /* capability flags */ 403da14cebeSEric Cheng uint_t lso_max; /* maximum payload */ 404da14cebeSEric Cheng } dld_capab_lso_t; 405da14cebeSEric Cheng 406210db224Sericheng int dld_getinfo(dev_info_t *, ddi_info_cmd_t, void *, void **); 40761af1958SGarrett D'Amore int dld_devt_to_instance(dev_t); 408210db224Sericheng int dld_open(queue_t *, dev_t *, int, int, cred_t *); 409210db224Sericheng int dld_close(queue_t *); 410210db224Sericheng void dld_wput(queue_t *, mblk_t *); 411210db224Sericheng void dld_wsrv(queue_t *); 4125d460eafSCathy Zhou int dld_str_open(queue_t *, dev_t *, void *); 4135d460eafSCathy Zhou int dld_str_close(queue_t *); 4145d460eafSCathy Zhou void *dld_str_private(queue_t *); 415210db224Sericheng void dld_init_ops(struct dev_ops *, const char *); 416210db224Sericheng void dld_fini_ops(struct dev_ops *); 417d62bc4baSyz147064 int dld_autopush(dev_t *, struct dlautopush *); 418da14cebeSEric Cheng 419da14cebeSEric Cheng int dld_add_flow(datalink_id_t, char *, flow_desc_t *, 420da14cebeSEric Cheng mac_resource_props_t *); 421da14cebeSEric Cheng int dld_remove_flow(char *); 422da14cebeSEric Cheng int dld_modify_flow(char *, mac_resource_props_t *); 4232b24ab6bSSebastien Roy int dld_walk_flow(dld_ioc_walkflow_t *, intptr_t, cred_t *); 424da14cebeSEric Cheng 425210db224Sericheng #endif 426210db224Sericheng 4277c478bd9Sstevel@tonic-gate #ifdef __cplusplus 4287c478bd9Sstevel@tonic-gate } 4297c478bd9Sstevel@tonic-gate #endif 4307c478bd9Sstevel@tonic-gate 4317c478bd9Sstevel@tonic-gate #endif /* _SYS_DLD_H */ 432