1 /* $NetBSD: if_ipwvar.h,v 1.13 2008/05/27 21:42:08 dyoung Exp $ */
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
37 #define IPW_MAX_NSEG 1
42 #define IPW_SBD_TYPE_NOASSOC 0
43 #define IPW_SBD_TYPE_COMMAND 1
44 #define IPW_SBD_TYPE_HEADER 2
45 #define IPW_SBD_TYPE_DATA 3
53 TAILQ_ENTRY(ipw_soft_hdr
) next
;
58 struct ieee80211_node
*ni
;
60 TAILQ_ENTRY(ipw_soft_buf
) next
;
63 struct ipw_rx_radiotap_header
{
64 struct ieee80211_radiotap_header wr_ihdr
;
65 uint16_t wr_chan_freq
;
66 uint16_t wr_chan_flags
;
70 #define IPW_RX_RADIOTAP_PRESENT \
71 ((1 << IEEE80211_RADIOTAP_CHANNEL) | \
72 (1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL))
74 struct ipw_tx_radiotap_header
{
75 struct ieee80211_radiotap_header wt_ihdr
;
76 uint16_t wt_chan_freq
;
77 uint16_t wt_chan_flags
;
80 #define IPW_TX_RADIOTAP_PRESENT \
81 ((1 << IEEE80211_RADIOTAP_CHANNEL))
86 struct ethercom sc_ec
;
87 struct ieee80211com sc_ic
;
88 int (*sc_newstate
)(struct ieee80211com
*,
89 enum ieee80211_state
, int);
91 struct ipw_firmware fw
;
92 const char *sc_fwname
;
94 #define IPW_FLAG_FW_CACHED (1 << 0)
95 #define IPW_FLAG_FW_INITED (1 << 1)
96 #define IPW_FLAG_HAS_RADIO_SWITCH (1 << 2)
97 #define IPW_FLAG_FW_WARNED (1 << 3)
100 struct resource
*mem
;
101 bus_space_tag_t sc_st
;
102 bus_space_handle_t sc_sh
;
104 pci_chipset_tag_t sc_pct
;
110 bus_dma_tag_t sc_dmat
;
112 bus_dmamap_t tbd_map
;
113 bus_dmamap_t rbd_map
;
114 bus_dmamap_t status_map
;
115 bus_dmamap_t cmd_map
;
116 bus_dmamap_t hdr_map
;
118 bus_dma_segment_t tbd_seg
;
119 bus_dma_segment_t rbd_seg
;
120 bus_dma_segment_t status_seg
;
121 bus_dma_segment_t cmd_seg
;
122 bus_dma_segment_t hdr_seg
;
124 struct ipw_bd
*tbd_list
;
125 struct ipw_bd
*rbd_list
;
126 struct ipw_status
*status_list
;
127 struct ipw_hdr
*hdr_list
;
130 struct ipw_soft_bd stbd_list
[IPW_NTBD
];
131 struct ipw_soft_buf tx_sbuf_list
[IPW_NDATA
];
132 struct ipw_soft_bd srbd_list
[IPW_NRBD
];
133 struct ipw_soft_buf rx_sbuf_list
[IPW_NRBD
];
134 struct ipw_soft_hdr shdr_list
[IPW_NDATA
];
136 TAILQ_HEAD(, ipw_soft_hdr
) sc_free_shdr
;
137 TAILQ_HEAD(, ipw_soft_buf
) sc_free_sbuf
;
139 uint32_t table1_base
;
140 uint32_t table2_base
;
150 struct bpf_if
*sc_drvbpf
;
153 struct ipw_rx_radiotap_header th
;
156 #define sc_rxtap sc_rxtapu.th
160 struct ipw_tx_radiotap_header th
;
163 #define sc_txtap sc_txtapu.th
168 #define sc_if sc_ec.ec_if
170 #define SIOCGRADIO _IOWR('i', 139, struct ifreq)
171 #define SIOCGTABLE1 _IOWR('i', 140, struct ifreq)