1 /* $NetBSD: if_iwivar.h,v 1.14 2007/10/22 15:28:48 joerg Exp $ */
4 * Copyright (c) 2004, 2005
5 * Damien Bergamini <damien.bergamini@free.fr>. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice unmodified, this list of conditions, and the following
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 struct iwi_rx_radiotap_header
{
40 struct ieee80211_radiotap_header wr_ihdr
;
43 uint16_t wr_chan_freq
;
44 uint16_t wr_chan_flags
;
49 #define IWI_RX_RADIOTAP_PRESENT \
50 ((1 << IEEE80211_RADIOTAP_FLAGS) | \
51 (1 << IEEE80211_RADIOTAP_RATE) | \
52 (1 << IEEE80211_RADIOTAP_CHANNEL) | \
53 (1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL) | \
54 (1 << IEEE80211_RADIOTAP_ANTENNA))
56 struct iwi_tx_radiotap_header
{
57 struct ieee80211_radiotap_header wt_ihdr
;
59 uint16_t wt_chan_freq
;
60 uint16_t wt_chan_flags
;
63 #define IWI_TX_RADIOTAP_PRESENT \
64 ((1 << IEEE80211_RADIOTAP_FLAGS) | \
65 (1 << IEEE80211_RADIOTAP_CHANNEL))
68 bus_dmamap_t desc_map
;
69 bus_dma_segment_t desc_seg
;
70 struct iwi_cmd_desc
*desc
;
80 struct ieee80211_node
*ni
;
84 bus_dmamap_t desc_map
;
85 bus_dma_segment_t desc_seg
;
88 struct iwi_tx_desc
*desc
;
89 struct iwi_tx_data
*data
;
102 struct iwi_rx_data
*data
;
108 struct ieee80211_node in_node
;
110 #define IWI_MAX_IBSSNODE 32
115 struct ethercom sc_ec
;
116 struct ieee80211com sc_ic
;
117 int (*sc_newstate
)(struct ieee80211com
*,
118 enum ieee80211_state
, int);
119 void (*sc_node_free
)(struct ieee80211_node
*);
123 struct iwi_firmware fw
;
124 const char *sc_fwname
;
128 #define IWI_FLAG_FW_CACHED (1 << 0)
129 #define IWI_FLAG_FW_INITED (1 << 1)
130 #define IWI_FLAG_SCANNING (1 << 3)
132 bus_dma_tag_t sc_dmat
;
134 struct iwi_cmd_ring cmdq
;
135 struct iwi_tx_ring txq
[WME_NUM_AC
];
136 struct iwi_rx_ring rxq
;
138 struct resource
*irq
;
139 struct resource
*mem
;
140 bus_space_tag_t sc_st
;
141 bus_space_handle_t sc_sh
;
143 pci_chipset_tag_t sc_pct
;
147 struct sysctllog
*sc_sysctllog
;
157 struct bpf_if
*sc_drvbpf
;
160 struct iwi_rx_radiotap_header th
;
163 #define sc_rxtap sc_rxtapu.th
167 struct iwi_tx_radiotap_header th
;
170 #define sc_txtap sc_txtapu.th
175 #define sc_if sc_ec.ec_if
177 #define SIOCGRADIO _IOWR('i', 139, struct ifreq)
178 #define SIOCGTABLE0 _IOWR('i', 140, struct ifreq)