if_iwivar.h revision 1.1 1 1.1 skrll /* $Id: if_iwivar.h,v 1.1 2005/01/11 18:24:24 skrll Exp $ */
2 1.1 skrll
3 1.1 skrll /*-
4 1.1 skrll * Copyright (c) 2004, 2005
5 1.1 skrll * Damien Bergamini <damien.bergamini (at) free.fr>. All rights reserved.
6 1.1 skrll *
7 1.1 skrll * Redistribution and use in source and binary forms, with or without
8 1.1 skrll * modification, are permitted provided that the following conditions
9 1.1 skrll * are met:
10 1.1 skrll * 1. Redistributions of source code must retain the above copyright
11 1.1 skrll * notice unmodified, this list of conditions, and the following
12 1.1 skrll * disclaimer.
13 1.1 skrll * 2. Redistributions in binary form must reproduce the above copyright
14 1.1 skrll * notice, this list of conditions and the following disclaimer in the
15 1.1 skrll * documentation and/or other materials provided with the distribution.
16 1.1 skrll *
17 1.1 skrll * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18 1.1 skrll * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 1.1 skrll * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 1.1 skrll * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21 1.1 skrll * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 1.1 skrll * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 1.1 skrll * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 1.1 skrll * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 1.1 skrll * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 1.1 skrll * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 1.1 skrll * SUCH DAMAGE.
28 1.1 skrll */
29 1.1 skrll
30 1.1 skrll struct iwi_firmware {
31 1.1 skrll void *boot;
32 1.1 skrll int boot_size;
33 1.1 skrll void *ucode;
34 1.1 skrll int ucode_size;
35 1.1 skrll void *main;
36 1.1 skrll int main_size;
37 1.1 skrll };
38 1.1 skrll
39 1.1 skrll struct iwi_rx_radiotap_header {
40 1.1 skrll struct ieee80211_radiotap_header wr_ihdr;
41 1.1 skrll u_int8_t wr_flags;
42 1.1 skrll u_int8_t wr_rate;
43 1.1 skrll u_int16_t wr_chan_freq;
44 1.1 skrll u_int16_t wr_chan_flags;
45 1.1 skrll u_int8_t wr_antsignal;
46 1.1 skrll u_int8_t wr_antnoise;
47 1.1 skrll u_int8_t wr_antenna;
48 1.1 skrll };
49 1.1 skrll
50 1.1 skrll #define IWI_RX_RADIOTAP_PRESENT \
51 1.1 skrll ((1 << IEEE80211_RADIOTAP_FLAGS) | \
52 1.1 skrll (1 << IEEE80211_RADIOTAP_RATE) | \
53 1.1 skrll (1 << IEEE80211_RADIOTAP_CHANNEL) | \
54 1.1 skrll (1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL) | \
55 1.1 skrll (1 << IEEE80211_RADIOTAP_DB_ANTNOISE) | \
56 1.1 skrll (1 << IEEE80211_RADIOTAP_ANTENNA))
57 1.1 skrll
58 1.1 skrll struct iwi_tx_radiotap_header {
59 1.1 skrll struct ieee80211_radiotap_header wt_ihdr;
60 1.1 skrll u_int8_t wt_flags;
61 1.1 skrll u_int16_t wt_chan_freq;
62 1.1 skrll u_int16_t wt_chan_flags;
63 1.1 skrll };
64 1.1 skrll
65 1.1 skrll #define IWI_TX_RADIOTAP_PRESENT \
66 1.1 skrll ((1 << IEEE80211_RADIOTAP_FLAGS) | \
67 1.1 skrll (1 << IEEE80211_RADIOTAP_CHANNEL))
68 1.1 skrll
69 1.1 skrll struct iwi_softc {
70 1.1 skrll struct device sc_dev;
71 1.1 skrll
72 1.1 skrll struct ieee80211com sc_ic;
73 1.1 skrll int (*sc_newstate)(struct ieee80211com *,
74 1.1 skrll enum ieee80211_state, int);
75 1.1 skrll
76 1.1 skrll struct iwi_firmware fw;
77 1.1 skrll u_int32_t flags;
78 1.1 skrll #define IWI_FLAG_FW_CACHED (1 << 0)
79 1.1 skrll #define IWI_FLAG_FW_INITED (1 << 1)
80 1.1 skrll
81 1.1 skrll bus_dma_tag_t sc_dmat;
82 1.1 skrll
83 1.1 skrll struct iwi_tx_desc *tx_desc;
84 1.1 skrll bus_dmamap_t tx_ring_map;
85 1.1 skrll bus_dma_segment_t tx_ring_seg;
86 1.1 skrll
87 1.1 skrll struct iwi_tx_buf {
88 1.1 skrll bus_dmamap_t map;
89 1.1 skrll struct mbuf *m;
90 1.1 skrll struct ieee80211_node *ni;
91 1.1 skrll } tx_buf[IWI_TX_RING_SIZE];
92 1.1 skrll
93 1.1 skrll int tx_cur;
94 1.1 skrll int tx_old;
95 1.1 skrll int tx_queued;
96 1.1 skrll
97 1.1 skrll struct iwi_cmd_desc *cmd_desc;
98 1.1 skrll bus_dmamap_t cmd_ring_map;
99 1.1 skrll bus_dma_segment_t cmd_ring_seg;
100 1.1 skrll int cmd_cur;
101 1.1 skrll
102 1.1 skrll struct iwi_rx_buf {
103 1.1 skrll bus_dmamap_t map;
104 1.1 skrll struct mbuf *m;
105 1.1 skrll } rx_buf[IWI_RX_RING_SIZE];
106 1.1 skrll
107 1.1 skrll int rx_cur;
108 1.1 skrll
109 1.1 skrll struct resource *irq;
110 1.1 skrll struct resource *mem;
111 1.1 skrll bus_space_tag_t sc_st;
112 1.1 skrll bus_space_handle_t sc_sh;
113 1.1 skrll void *sc_ih;
114 1.1 skrll pci_chipset_tag_t sc_pct;
115 1.1 skrll pcitag_t sc_pcitag;
116 1.1 skrll bus_size_t sc_sz;
117 1.1 skrll
118 1.1 skrll int authmode;
119 1.1 skrll
120 1.1 skrll int sc_tx_timer;
121 1.1 skrll
122 1.1 skrll #if NBPFILTER > 0
123 1.1 skrll struct bpf_if *sc_drvbpf;
124 1.1 skrll
125 1.1 skrll union {
126 1.1 skrll struct iwi_rx_radiotap_header th;
127 1.1 skrll u_int8_t pad[64];
128 1.1 skrll } sc_rxtapu;
129 1.1 skrll #define sc_rxtap sc_rxtapu.th
130 1.1 skrll int sc_rxtap_len;
131 1.1 skrll
132 1.1 skrll union {
133 1.1 skrll struct iwi_tx_radiotap_header th;
134 1.1 skrll u_int8_t pad[64];
135 1.1 skrll } sc_txtapu;
136 1.1 skrll #define sc_txtap sc_txtapu.th
137 1.1 skrll int sc_txtap_len;
138 1.1 skrll #endif
139 1.1 skrll };
140 1.1 skrll
141 1.1 skrll #define SIOCSLOADFW _IOW('i', 137, struct ifreq)
142 1.1 skrll #define SIOCSKILLFW _IOW('i', 138, struct ifreq)
143 1.1 skrll #define SIOCGRADIO _IOWR('i', 139, struct ifreq)
144 1.1 skrll #define SIOCGTABLE0 _IOWR('i', 140, struct ifreq)
145