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 * $FreeBSD: src/sys/dev/ipw/if_ipwvar.h,v 1.3 2005/06/10 16:49:11 brooks Exp $
29 * $DragonFly: src/sys/dev/netif/ipw/Attic/if_ipwvar.h,v 1.6 2006/05/18 13:51:45 sephe Exp $
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
52 SLIST_ENTRY(ipw_soft_hdr) next;
57 struct ieee80211_node *ni;
59 SLIST_ENTRY(ipw_soft_buf) next;
62 #define IPW_MAX_NSEG 6
63 struct ipw_dma_mapping {
64 bus_dma_segment_t segs[IPW_MAX_NSEG];
69 struct ipw_rx_radiotap_header {
70 struct ieee80211_radiotap_header wr_ihdr;
72 u_int16_t wr_chan_freq;
73 u_int16_t wr_chan_flags;
74 u_int8_t wr_antsignal;
77 #define IPW_RX_RADIOTAP_PRESENT \
78 ((1 << IEEE80211_RADIOTAP_FLAGS) | \
79 (1 << IEEE80211_RADIOTAP_CHANNEL) | \
80 (1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL))
82 struct ipw_tx_radiotap_header {
83 struct ieee80211_radiotap_header wt_ihdr;
85 u_int16_t wt_chan_freq;
86 u_int16_t wt_chan_flags;
89 #define IPW_TX_RADIOTAP_PRESENT \
90 ((1 << IEEE80211_RADIOTAP_FLAGS) | \
91 (1 << IEEE80211_RADIOTAP_CHANNEL))
94 struct ieee80211com sc_ic;
95 int (*sc_newstate)(struct ieee80211com *,
96 enum ieee80211_state, int);
97 struct ipw_firmware fw;
99 #define IPW_FLAG_FW_CACHED (1 << 0)
100 #define IPW_FLAG_FW_INITED (1 << 1)
101 #define IPW_FLAG_HAS_RADIO_SWITCH (1 << 2)
102 #define IPW_FLAG_FW_WARNED (1 << 3)
106 struct resource *irq;
107 struct resource *mem;
108 bus_space_tag_t sc_st;
109 bus_space_handle_t sc_sh;
114 bus_dma_tag_t tbd_dmat;
115 bus_dma_tag_t rbd_dmat;
116 bus_dma_tag_t status_dmat;
117 bus_dma_tag_t cmd_dmat;
118 bus_dma_tag_t hdr_dmat;
119 bus_dma_tag_t txbuf_dmat;
120 bus_dma_tag_t rxbuf_dmat;
122 bus_dmamap_t tbd_map;
123 bus_dmamap_t rbd_map;
124 bus_dmamap_t status_map;
125 bus_dmamap_t cmd_map;
129 bus_addr_t status_phys;
131 struct ipw_bd *tbd_list;
132 struct ipw_bd *rbd_list;
133 struct ipw_status *status_list;
136 struct ipw_soft_bd stbd_list[IPW_NTBD];
137 struct ipw_soft_buf tx_sbuf_list[IPW_NDATA];
138 struct ipw_soft_hdr shdr_list[IPW_NDATA];
139 struct ipw_soft_bd srbd_list[IPW_NRBD];
140 struct ipw_soft_buf rx_sbuf_list[IPW_NRBD];
142 SLIST_HEAD(, ipw_soft_hdr) free_shdr;
143 SLIST_HEAD(, ipw_soft_buf) free_sbuf;
145 u_int32_t table1_base;
146 u_int32_t table2_base;
155 struct bpf_if *sc_drvbpf;
158 struct ipw_rx_radiotap_header th;
161 #define sc_rxtap sc_rxtapu.th
165 struct ipw_tx_radiotap_header th;
168 #define sc_txtap sc_txtapu.th
170 struct sysctl_ctx_list sysctl_ctx;
173 #define SIOCSLOADFW _IOW('i', 137, struct ifreq)
174 #define SIOCSKILLFW _IOW('i', 138, struct ifreq)