8446 uts: pci_check_bios() should check for BIOS
[unleashed.git] / include / sys / dls.h
blob6bd2bbe35a7104fdc1cdccf6695a0a82077b2472
1 /*
2 * CDDL HEADER START
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.
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.
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]
19 * CDDL HEADER END
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _SYS_DLS_H
27 #define _SYS_DLS_H
29 #include <sys/types.h>
30 #include <sys/stream.h>
31 #include <sys/mac_client.h>
32 #include <sys/dls_mgmt.h>
35 * Data-Link Services Module
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
43 * Module name.
45 #define DLS_MODULE_NAME "dls"
48 * Data-Link Services Information (text emitted by modinfo(1m))
50 #define DLS_INFO "Data-Link Services"
53 * Macros for converting ppas to instance #s, Vlan ID, or minor.
55 #define DLS_PPA2INST(ppa) ((int)((ppa) % 1000))
56 #define DLS_PPA2VID(ppa) ((uint16_t)((ppa) / 1000))
57 #define DLS_PPA2MINOR(ppa) ((minor_t)((DLS_PPA2INST(ppa)) + 1))
60 * Maps a (VID, INST) pair to ppa
62 #define DLS_VIDINST2PPA(vid, inst) ((minor_t)((vid) * 1000 + (inst)))
65 * Converts a minor to an instance#; makes sense only when minor <= 1000.
67 #define DLS_MINOR2INST(minor) ((int)((minor) - 1))
69 #ifdef _KERNEL
71 #define DLS_MAX_PPA 999
72 #define DLS_MAX_MINOR (DLS_MAX_PPA + 1)
74 typedef void (*dls_rx_t)(void *, mac_resource_handle_t, mblk_t *,
75 mac_header_info_t *);
77 typedef struct dld_str_s dld_str_t;
78 typedef struct dls_devnet_s *dls_dl_handle_t;
79 typedef struct dls_dev_t *dls_dev_handle_t;
80 typedef struct dls_link_s dls_link_t;
82 #define DLS_SAP_LLC 0
83 #define DLS_SAP_PROMISC (1 << 16)
85 #define DLS_PROMISC_SAP 0x00000001
86 #define DLS_PROMISC_MULTI 0x00000002
87 #define DLS_PROMISC_PHYS 0x00000004
89 extern int dls_open(dls_link_t *, dls_dl_handle_t, dld_str_t *);
90 extern void dls_close(dld_str_t *);
91 extern int dls_bind(dld_str_t *, uint32_t);
92 extern void dls_unbind(dld_str_t *);
94 extern int dls_promisc(dld_str_t *, uint32_t);
96 extern int dls_multicst_add(dld_str_t *, const uint8_t *);
97 extern int dls_multicst_remove(dld_str_t *, const uint8_t *);
99 extern mblk_t *dls_header(dld_str_t *, const uint8_t *,
100 uint16_t, uint_t, mblk_t **);
102 extern void dls_rx_set(dld_str_t *, dls_rx_t, void *);
103 extern dld_str_t *dls_rx_get(char *, flow_desc_t *, size_t *);
105 extern void str_notify(void *, mac_notify_type_t);
107 extern int dls_devnet_open(const char *,
108 dls_dl_handle_t *, dev_t *);
109 extern void dls_devnet_close(dls_dl_handle_t);
110 extern boolean_t dls_devnet_rebuild();
112 extern int dls_devnet_rename(datalink_id_t, datalink_id_t,
113 const char *);
114 extern int dls_devnet_create(mac_handle_t, datalink_id_t,
115 zoneid_t);
116 extern int dls_devnet_destroy(mac_handle_t, datalink_id_t *,
117 boolean_t);
118 extern int dls_devnet_recreate(mac_handle_t, datalink_id_t);
119 extern int dls_devnet_hold_tmp(datalink_id_t, dls_dl_handle_t *);
120 extern void dls_devnet_rele_tmp(dls_dl_handle_t);
121 extern int dls_devnet_hold_by_dev(dev_t, dls_dl_handle_t *);
122 extern void dls_devnet_rele(dls_dl_handle_t);
123 extern void dls_devnet_prop_task_wait(dls_dl_handle_t);
125 extern const char *dls_devnet_mac(dls_dl_handle_t);
126 extern uint16_t dls_devnet_vid(dls_dl_handle_t);
127 extern datalink_id_t dls_devnet_linkid(dls_dl_handle_t);
128 extern int dls_devnet_dev2linkid(dev_t, datalink_id_t *);
129 extern int dls_devnet_phydev(datalink_id_t, dev_t *);
130 extern int dls_devnet_setzid(dls_dl_handle_t, zoneid_t);
131 extern zoneid_t dls_devnet_getzid(dls_dl_handle_t);
132 extern zoneid_t dls_devnet_getownerzid(dls_dl_handle_t);
133 extern boolean_t dls_devnet_islinkvisible(datalink_id_t, zoneid_t);
135 extern int dls_mgmt_door_set(boolean_t);
136 extern int dls_mgmt_create(const char *, dev_t, datalink_class_t,
137 uint32_t, boolean_t, datalink_id_t *);
138 extern int dls_mgmt_destroy(datalink_id_t, boolean_t);
139 extern int dls_mgmt_update(const char *, uint32_t, boolean_t,
140 uint32_t *, datalink_id_t *);
141 extern int dls_mgmt_get_linkinfo(datalink_id_t, char *,
142 datalink_class_t *, uint32_t *, uint32_t *);
143 extern int dls_mgmt_get_linkid(const char *, datalink_id_t *);
144 extern datalink_id_t dls_mgmt_get_next(datalink_id_t, datalink_class_t,
145 datalink_media_t, uint32_t);
146 extern int dls_devnet_macname2linkid(const char *,
147 datalink_id_t *);
149 #endif /* _KERNEL */
151 #ifdef __cplusplus
153 #endif
155 #endif /* _SYS_DLS_H */