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.5 2006/05/18 13:51:45 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 ifnet *sc_ifp;
127 struct ieee80211com sc_ic;
128 int (*sc_newstate)(struct ieee80211com *,
129 enum ieee80211_state, int);
130 void (*sc_node_free)(struct ieee80211_node *);
133 struct iwi_firmware fw;
135 #define IWI_FLAG_FW_CACHED (1 << 0)
136 #define IWI_FLAG_FW_INITED (1 << 1)
137 #define IWI_FLAG_FW_WARNED (1 << 2)
138 #define IWI_FLAG_SCANNING (1 << 3)
140 struct iwi_cmd_ring cmdq;
141 struct iwi_tx_ring txq[WME_NUM_AC];
142 struct iwi_rx_ring rxq;
144 struct resource *irq;
145 struct resource *mem;
146 bus_space_tag_t sc_st;
147 bus_space_handle_t sc_sh;
158 struct bpf_if *sc_drvbpf;
161 struct iwi_rx_radiotap_header th;
164 #define sc_rxtap sc_rxtapu.th
168 struct iwi_tx_radiotap_header th;
171 #define sc_txtap sc_txtapu.th
174 uint8_t sc_ibss_node[IWI_MAX_IBSSNODE_NBYTE];
176 struct sysctl_ctx_list sysctl_ctx;
177 struct sysctl_oid *sysctl_tree;
180 #define SIOCSLOADFW _IOW('i', 137, struct ifreq)
181 #define SIOCSKILLFW _IOW('i', 138, struct ifreq)
183 #define IWI_FW_INITIALIZED(sc) (sc + 1)
184 #define IWI_FW_CMD_ACKED(sc) (sc + 2)