wivar.h revision 1.20 1 1.20 onoe /* $NetBSD: wivar.h,v 1.20 2002/09/30 06:29:30 onoe Exp $ */
2 1.1 ichiro
3 1.1 ichiro /*
4 1.1 ichiro * Copyright (c) 1997, 1998, 1999
5 1.1 ichiro * Bill Paul <wpaul (at) ctr.columbia.edu>. All rights reserved.
6 1.1 ichiro *
7 1.1 ichiro * Redistribution and use in source and binary forms, with or without
8 1.1 ichiro * modification, are permitted provided that the following conditions
9 1.1 ichiro * are met:
10 1.1 ichiro * 1. Redistributions of source code must retain the above copyright
11 1.1 ichiro * notice, this list of conditions and the following disclaimer.
12 1.1 ichiro * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 ichiro * notice, this list of conditions and the following disclaimer in the
14 1.1 ichiro * documentation and/or other materials provided with the distribution.
15 1.1 ichiro * 3. All advertising materials mentioning features or use of this software
16 1.1 ichiro * must display the following acknowledgement:
17 1.1 ichiro * This product includes software developed by Bill Paul.
18 1.1 ichiro * 4. Neither the name of the author nor the names of any co-contributors
19 1.1 ichiro * may be used to endorse or promote products derived from this software
20 1.1 ichiro * without specific prior written permission.
21 1.1 ichiro *
22 1.1 ichiro * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
23 1.1 ichiro * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 1.1 ichiro * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 1.1 ichiro * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
26 1.1 ichiro * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27 1.1 ichiro * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28 1.1 ichiro * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29 1.1 ichiro * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30 1.1 ichiro * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 1.1 ichiro * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
32 1.1 ichiro * THE POSSIBILITY OF SUCH DAMAGE.
33 1.1 ichiro */
34 1.1 ichiro
35 1.1 ichiro /*
36 1.1 ichiro * FreeBSD driver ported to NetBSD by Bill Sommerfeld in the back of the
37 1.1 ichiro * Oslo IETF plenary meeting.
38 1.1 ichiro */
39 1.1 ichiro
40 1.17 thorpej #include <dev/ic/wi_hostap.h>
41 1.17 thorpej
42 1.1 ichiro struct wi_softc {
43 1.1 ichiro struct device sc_dev;
44 1.1 ichiro struct ethercom sc_ethercom;
45 1.1 ichiro void *sc_ih; /* interrupt handler */
46 1.1 ichiro int (*sc_enable) __P((struct wi_softc *));
47 1.1 ichiro void (*sc_disable) __P((struct wi_softc *));
48 1.1 ichiro
49 1.1 ichiro int sc_attached;
50 1.1 ichiro int sc_enabled;
51 1.10 onoe int sc_firmware_type;
52 1.14 ichiro #define WI_NOTYPE 0
53 1.14 ichiro #define WI_LUCENT 1
54 1.14 ichiro #define WI_INTERSIL 2
55 1.14 ichiro #define WI_SYMBOL 3
56 1.11 ichiro int sc_pri_firmware_ver; /* Primary firmware version */
57 1.11 ichiro int sc_sta_firmware_ver; /* Station firmware version */
58 1.8 ichiro int sc_pci; /* attach to PCI-Bus */
59 1.1 ichiro
60 1.1 ichiro bus_space_tag_t sc_iot; /* bus cookie */
61 1.1 ichiro bus_space_handle_t sc_ioh; /* bus i/o handle */
62 1.1 ichiro
63 1.7 explorer struct callout wi_inquire_ch;
64 1.8 ichiro struct callout wi_scan_sh;
65 1.1 ichiro
66 1.1 ichiro u_int8_t sc_macaddr[ETHER_ADDR_LEN];
67 1.1 ichiro
68 1.19 thorpej u_int16_t wi_txbuf[(sizeof(struct wi_frame) + 2312) / 2];
69 1.19 thorpej
70 1.1 ichiro struct ifmedia sc_media;
71 1.16 thorpej int wi_flags;
72 1.1 ichiro int wi_tx_data_id;
73 1.1 ichiro int wi_tx_mgmt_id;
74 1.2 ichiro int wi_if_flags;
75 1.1 ichiro u_int16_t wi_ptype;
76 1.1 ichiro u_int16_t wi_portnum;
77 1.1 ichiro u_int16_t wi_max_data_len;
78 1.1 ichiro u_int16_t wi_rts_thresh;
79 1.1 ichiro u_int16_t wi_ap_density;
80 1.1 ichiro u_int16_t wi_tx_rate;
81 1.1 ichiro u_int16_t wi_create_ibss;
82 1.19 thorpej u_int16_t wi_channels;
83 1.1 ichiro u_int16_t wi_pm_enabled;
84 1.1 ichiro u_int16_t wi_mor_enabled;
85 1.1 ichiro u_int16_t wi_max_sleep;
86 1.3 ichiro u_int16_t wi_authtype;
87 1.3 ichiro u_int16_t wi_roaming;
88 1.15 thorpej u_int16_t wi_supprates;
89 1.1 ichiro
90 1.1 ichiro struct ieee80211_nwid wi_nodeid;
91 1.1 ichiro struct ieee80211_nwid wi_netid;
92 1.1 ichiro struct ieee80211_nwid wi_ibssid;
93 1.1 ichiro
94 1.1 ichiro int wi_use_wep;
95 1.19 thorpej int wi_do_host_encrypt;
96 1.1 ichiro int wi_tx_key;
97 1.1 ichiro struct wi_ltv_keys wi_keys;
98 1.1 ichiro struct wi_counters wi_stats;
99 1.16 thorpej u_int16_t wi_ibss_port;
100 1.8 ichiro
101 1.19 thorpej u_int8_t wi_current_bssid[IEEE80211_ADDR_LEN];
102 1.19 thorpej u_int16_t wi_current_channel; /* current BSS channel */
103 1.19 thorpej
104 1.19 thorpej u_int8_t wi_join_bssid[IEEE80211_ADDR_LEN];
105 1.19 thorpej u_int16_t wi_join_channel; /* channel of BSS to join */
106 1.19 thorpej
107 1.19 thorpej u_int16_t wi_create_channel;/* channel of BSS to create */
108 1.19 thorpej
109 1.8 ichiro struct wi_apinfo wi_aps[MAXAPINFO];
110 1.8 ichiro int wi_naps;
111 1.8 ichiro int wi_scanning; /* scan mode */
112 1.17 thorpej
113 1.17 thorpej struct wihap_info wi_hostap_info;
114 1.17 thorpej u_int32_t wi_icv;
115 1.17 thorpej int wi_icv_flag;
116 1.19 thorpej
117 1.19 thorpej caddr_t sc_bpf80211;
118 1.19 thorpej caddr_t sc_bpf80211plus;
119 1.12 ichiro };
120 1.20 onoe
121 1.20 onoe #define sc_if sc_ethercom.ec_if
122 1.16 thorpej
123 1.16 thorpej /* Values for wi_flags. */
124 1.16 thorpej #define WI_FLAGS_ATTACHED 0x0001
125 1.16 thorpej #define WI_FLAGS_INITIALIZED 0x0002
126 1.16 thorpej #define WI_FLAGS_HAS_WEP 0x0004
127 1.16 thorpej #define WI_FLAGS_HAS_IBSS 0x0008
128 1.16 thorpej #define WI_FLAGS_HAS_CREATE_IBSS 0x0010
129 1.16 thorpej #define WI_FLAGS_HAS_MOR 0x0020
130 1.16 thorpej #define WI_FLAGS_HAS_ROAMING 0x0040
131 1.16 thorpej #define WI_FLAGS_HAS_DIVERSITY 0x0080
132 1.16 thorpej #define WI_FLAGS_HAS_HOSTAP 0x0100
133 1.19 thorpej #define WI_FLAGS_CONNECTED 0x0200
134 1.19 thorpej #define WI_FLAGS_AP_IN_RANGE 0x0400
135 1.19 thorpej #define WI_FLAGS_JOINING 0x0800
136 1.12 ichiro
137 1.12 ichiro struct wi_card_ident {
138 1.12 ichiro u_int16_t card_id;
139 1.12 ichiro char *card_name;
140 1.12 ichiro u_int8_t firm_type;
141 1.1 ichiro };
142 1.1 ichiro
143 1.1 ichiro int wi_attach __P((struct wi_softc *));
144 1.1 ichiro int wi_detach __P((struct wi_softc *));
145 1.1 ichiro int wi_activate __P((struct device *, enum devact));
146 1.1 ichiro int wi_intr __P((void *arg));
147 1.1 ichiro void wi_power __P((struct wi_softc *, int));
148 1.1 ichiro void wi_shutdown __P((struct wi_softc *));
149 1.17 thorpej
150 1.17 thorpej int wi_mgmt_xmit(struct wi_softc *, caddr_t, int);
151