Merge remote-tracking branch 'origin/master'
[unleashed/lotheac.git] / usr / src / uts / common / io / simnet / simnet_impl.h
blob74dcba511385cb6ba24d7cf80c770f699b5e7451
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_SIMNET_IMPL_H
27 #define _SYS_SIMNET_IMPL_H
29 #include <sys/types.h>
30 #include <sys/list.h>
31 #include <sys/mutex.h>
32 #include <sys/mac.h>
33 #include <sys/net80211.h>
34 #include <inet/wifi_ioctl.h>
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
40 #define MAX_SIMNET_ESSCONF 25 /* Max num of WiFi scan results */
41 #define MAX_ESSLIST_ARGS 10 /* Max num of ESS list arguments */
42 #define MAX_ESSLIST_ARGLEN 50 /* Max ESS list argument len */
44 struct simnet_dev;
46 typedef struct simnet_wifidev {
47 struct simnet_dev *swd_sdev;
48 wl_essid_t swd_essid;
49 wl_bssid_t swd_bssid;
50 wl_rssi_t swd_rssi; /* signal strength */
51 wl_linkstatus_t swd_linkstatus;
52 int swd_esslist_num;
53 wl_ess_conf_t *swd_esslist[MAX_SIMNET_ESSCONF];
54 } simnet_wifidev_t;
56 typedef struct simnet_stats {
57 uint64_t rbytes;
58 uint64_t obytes;
59 uint64_t xmit_errors;
60 uint64_t xmit_count;
61 uint64_t recv_count;
62 uint64_t recv_errors;
63 } simnet_stats_t;
65 typedef struct simnet_dev {
66 list_node_t sd_listnode;
67 uint_t sd_type; /* WiFi, Ethernet etc. */
68 datalink_id_t sd_link_id;
69 zoneid_t sd_zoneid; /* zone where created */
70 struct simnet_dev *sd_peer_dev; /* Attached peer, if any */
71 uint_t sd_flags; /* Device flags SDF_* */
72 uint_t sd_refcount;
73 /* Num of active threads using the device */
74 uint_t sd_threadcount;
75 kcondvar_t sd_threadwait;
76 mac_handle_t sd_mh;
77 simnet_wifidev_t *sd_wifidev;
78 boolean_t sd_promisc;
79 kmutex_t sd_instlock;
80 /* Num of multicast addresses stored in sd_mcastaddrs */
81 uint_t sd_mcastaddr_count;
82 /* Multicast address list stored in single buffer */
83 uint8_t *sd_mcastaddrs;
84 uint_t sd_mac_len;
85 uchar_t sd_mac_addr[MAXMACADDRLEN];
86 simnet_stats_t sd_stats;
87 } simnet_dev_t;
89 /* Simnet device flags */
90 #define SDF_SHUTDOWN 0x00000001 /* Device shutdown, no new ops */
91 #define SDF_STARTED 0x00000002 /* Device started, allow ops */
93 #define SIMNET_MAX_MTU 9000 /* Max MTU supported by simnet driver */
95 #ifdef __cplusplus
97 #endif
99 #endif /* _SYS_SIMNET_IMPL_H */