2 * Copyright (c) 2004, 2005
3 * Damien Bergamini <damien.bergamini@free.fr>.
4 * Copyright (c) 2004, 2005
5 * Andrew Atrens <atrens@nortelnetworks.com>.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice unmodified, this list of conditions, and the following
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * $FreeBSD: src/sys/dev/iwi/if_iwivar.h,v 1.4.2.1 2005/09/26 17:31:36 damien Exp $
32 * $DragonFly: src/sys/dev/netif/iwi/if_iwivar.h,v 1.6 2006/08/12 13:43:21 sephe Exp $
44 struct iwi_rx_radiotap_header {
45 struct ieee80211_radiotap_header wr_ihdr;
48 uint16_t wr_chan_freq;
49 uint16_t wr_chan_flags;
54 #define IWI_RX_RADIOTAP_PRESENT \
55 ((1 << IEEE80211_RADIOTAP_FLAGS) | \
56 (1 << IEEE80211_RADIOTAP_RATE) | \
57 (1 << IEEE80211_RADIOTAP_CHANNEL) | \
58 (1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL) | \
59 (1 << IEEE80211_RADIOTAP_ANTENNA))
61 struct iwi_tx_radiotap_header {
62 struct ieee80211_radiotap_header wt_ihdr;
64 uint16_t wt_chan_freq;
65 uint16_t wt_chan_flags;
68 #define IWI_TX_RADIOTAP_PRESENT \
69 ((1 << IEEE80211_RADIOTAP_FLAGS) | \
70 (1 << IEEE80211_RADIOTAP_CHANNEL))
73 bus_dma_tag_t desc_dmat;
74 bus_dmamap_t desc_map;
76 struct iwi_cmd_desc *desc;
86 struct ieee80211_node *ni;
90 bus_dma_tag_t desc_dmat;
91 bus_dma_tag_t data_dmat;
92 bus_dmamap_t desc_map;
96 struct iwi_tx_desc *desc;
97 struct iwi_tx_data *data;
112 bus_dma_tag_t data_dmat;
113 struct iwi_rx_data *data;
119 struct ieee80211_node in_node;
121 #define IWI_MAX_IBSSNODE_NBYTE 4
122 #define IWI_MAX_IBSSNODE (IWI_MAX_IBSSNODE_NBYTE * NBBY)
126 struct ieee80211com sc_ic;
127 int (*sc_newstate)(struct ieee80211com *,
128 enum ieee80211_state, int);
129 void (*sc_node_free)(struct ieee80211_node *);
132 struct iwi_firmware fw;
134 #define IWI_FLAG_FW_CACHED 0x01
135 #define IWI_FLAG_FW_INITED 0x02
136 #define IWI_FLAG_FW_WARNED 0x04
137 #define IWI_FLAG_SCANNING 0x08
138 #define IWI_FLAG_EXIT 0x10 /* detaching */
139 #define IWI_FLAG_RESET 0x20 /* need to reset firmware */
140 #define IWI_FLAG_MONITOR 0x40 /* monitor thread was created */
142 struct iwi_cmd_ring cmdq;
143 struct iwi_tx_ring txq[WME_NUM_AC];
144 struct iwi_rx_ring rxq;
146 struct resource *irq;
147 struct resource *mem;
148 bus_space_tag_t sc_st;
149 bus_space_handle_t sc_sh;
160 struct bpf_if *sc_drvbpf;
163 struct iwi_rx_radiotap_header th;
166 #define sc_rxtap sc_rxtapu.th
170 struct iwi_tx_radiotap_header th;
173 #define sc_txtap sc_txtapu.th
176 uint8_t sc_ibss_node[IWI_MAX_IBSSNODE_NBYTE];
178 struct sysctl_ctx_list sysctl_ctx;
179 struct sysctl_oid *sysctl_tree;
180 struct thread *sc_fw_monitor;
183 #define SIOCSLOADFW _IOW('i', 137, struct ifreq)
184 #define SIOCSKILLFW _IOW('i', 138, struct ifreq)
186 #define IWI_FW_INITIALIZED(sc) (sc + 1)
187 #define IWI_FW_CMD_ACKED(sc) (sc + 2)
188 #define IWI_FW_WAKE_MONITOR(sc) (sc + 3)
189 #define IWI_FW_EXIT_MONITOR(sc) (sc + 4)