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