2 * Copyright (c) 2004, 2005
3 * Damien Bergamini <damien.bergamini@free.fr>. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice unmodified, this list of conditions, and the following
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * $Id: if_ipwvar.h,v 1.2.2.1 2005/01/13 20:01:04 damien Exp $
28 * $DragonFly: src/sys/dev/netif/ipw/Attic/if_ipwvar.h,v 1.5 2005/11/29 17:15:56 dillon Exp $
41 #define IPW_SBD_TYPE_NOASSOC 0
42 #define IPW_SBD_TYPE_COMMAND 1
43 #define IPW_SBD_TYPE_HEADER 2
44 #define IPW_SBD_TYPE_DATA 3
51 SLIST_ENTRY(ipw_soft_hdr) next;
56 struct ieee80211_node *ni;
58 SLIST_ENTRY(ipw_soft_buf) next;
61 #define IPW_MAX_NSEG 6
62 struct ipw_dma_mapping {
63 bus_dma_segment_t segs[IPW_MAX_NSEG];
68 struct ipw_rx_radiotap_header {
69 struct ieee80211_radiotap_header wr_ihdr;
71 u_int16_t wr_chan_freq;
72 u_int16_t wr_chan_flags;
73 u_int8_t wr_antsignal;
76 #define IPW_RX_RADIOTAP_PRESENT \
77 ((1 << IEEE80211_RADIOTAP_FLAGS) | \
78 (1 << IEEE80211_RADIOTAP_CHANNEL) | \
79 (1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL))
81 struct ipw_tx_radiotap_header {
82 struct ieee80211_radiotap_header wt_ihdr;
84 u_int16_t wt_chan_freq;
85 u_int16_t wt_chan_flags;
88 #define IPW_TX_RADIOTAP_PRESENT \
89 ((1 << IEEE80211_RADIOTAP_FLAGS) | \
90 (1 << IEEE80211_RADIOTAP_CHANNEL))
93 struct ieee80211com sc_ic;
94 int (*sc_newstate)(struct ieee80211com *,
95 enum ieee80211_state, int);
96 struct ipw_firmware fw;
98 #define IPW_FLAG_FW_CACHED (1 << 0)
99 #define IPW_FLAG_FW_INITED (1 << 1)
100 #define IPW_FLAG_HAS_RADIO_SWITCH (1 << 2)
102 struct resource *irq;
103 struct resource *mem;
104 bus_space_tag_t sc_st;
105 bus_space_handle_t sc_sh;
111 bus_dma_tag_t tbd_dmat;
112 bus_dma_tag_t rbd_dmat;
113 bus_dma_tag_t status_dmat;
114 bus_dma_tag_t cmd_dmat;
115 bus_dma_tag_t hdr_dmat;
116 bus_dma_tag_t txbuf_dmat;
117 bus_dma_tag_t rxbuf_dmat;
119 bus_dmamap_t tbd_map;
120 bus_dmamap_t rbd_map;
121 bus_dmamap_t status_map;
122 bus_dmamap_t cmd_map;
126 bus_addr_t status_phys;
128 struct ipw_bd *tbd_list;
129 struct ipw_bd *rbd_list;
130 struct ipw_status *status_list;
133 struct ipw_soft_bd stbd_list[IPW_NTBD];
134 struct ipw_soft_buf tx_sbuf_list[IPW_NDATA];
135 struct ipw_soft_hdr shdr_list[IPW_NDATA];
136 struct ipw_soft_bd srbd_list[IPW_NRBD];
137 struct ipw_soft_buf rx_sbuf_list[IPW_NRBD];
139 SLIST_HEAD(, ipw_soft_hdr) free_shdr;
140 SLIST_HEAD(, ipw_soft_buf) free_sbuf;
142 u_int32_t table1_base;
143 u_int32_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
165 struct sysctl_ctx_list sysctl_ctx;
168 #define SIOCSLOADFW _IOW('i', 137, struct ifreq)
169 #define SIOCSKILLFW _IOW('i', 138, struct ifreq)