1 /* $NetBSD: if_wpivar.h,v 1.12 2008/07/02 03:42:55 cube Exp $ */
5 * Damien Bergamini <damien.bergamini@free.fr>
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 struct wpi_rx_radiotap_header
{
21 struct ieee80211_radiotap_header wr_ihdr
;
25 uint16_t wr_chan_freq
;
26 uint16_t wr_chan_flags
;
27 int8_t wr_dbm_antsignal
;
28 int8_t wr_dbm_antnoise
;
32 #define WPI_RX_RADIOTAP_PRESENT \
33 ((1 << IEEE80211_RADIOTAP_TSFT) | \
34 (1 << IEEE80211_RADIOTAP_FLAGS) | \
35 (1 << IEEE80211_RADIOTAP_RATE) | \
36 (1 << IEEE80211_RADIOTAP_CHANNEL) | \
37 (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | \
38 (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE) | \
39 (1 << IEEE80211_RADIOTAP_ANTENNA))
41 struct wpi_tx_radiotap_header
{
42 struct ieee80211_radiotap_header wt_ihdr
;
45 uint16_t wt_chan_freq
;
46 uint16_t wt_chan_flags
;
50 #define WPI_TX_RADIOTAP_PRESENT \
51 ((1 << IEEE80211_RADIOTAP_FLAGS) | \
52 (1 << IEEE80211_RADIOTAP_RATE) | \
53 (1 << IEEE80211_RADIOTAP_CHANNEL))
58 bus_dma_segment_t seg
;
67 struct ieee80211_node
*ni
;
71 struct wpi_dma_info desc_dma
;
72 struct wpi_dma_info cmd_dma
;
73 struct wpi_tx_desc
*desc
;
74 struct wpi_tx_cmd
*cmd
;
75 struct wpi_tx_data
*data
;
82 #define WPI_RBUF_COUNT (WPI_RX_RING_COUNT + 16)
83 #define WPI_RBUF_LOW_LIMIT 8
91 SLIST_ENTRY(wpi_rbuf
) next
;
99 struct wpi_dma_info desc_dma
;
100 struct wpi_dma_info buf_dma
;
102 struct wpi_rx_data data
[WPI_RX_RING_COUNT
];
103 struct wpi_rbuf rbuf
[WPI_RBUF_COUNT
];
104 SLIST_HEAD(, wpi_rbuf
) freelist
;
105 kmutex_t freelist_mtx
;
111 struct ieee80211_node ni
; /* must be the first */
112 struct ieee80211_amrr_node amn
;
115 struct wpi_power_sample
{
120 struct wpi_power_group
{
121 #define WPI_SAMPLES_COUNT 5
122 struct wpi_power_sample samples
[WPI_SAMPLES_COUNT
];
130 struct ethercom sc_ec
;
131 struct ieee80211com sc_ic
;
132 int (*sc_newstate
)(struct ieee80211com
*,
133 enum ieee80211_state
, int);
135 struct ieee80211_amrr amrr
;
137 bus_dma_tag_t sc_dmat
;
140 struct wpi_dma_info shared_dma
;
141 struct wpi_shared
*shared
;
143 /* firmware DMA transfer */
144 struct wpi_dma_info fw_dma
;
147 struct wpi_tx_ring txq
[4];
148 struct wpi_tx_ring cmdq
;
149 struct wpi_rx_ring rxq
;
151 bus_space_tag_t sc_st
;
152 bus_space_handle_t sc_sh
;
154 pci_chipset_tag_t sc_pct
;
158 struct callout calib_to
;
161 struct wpi_config config
;
167 struct wpi_power_group groups
[WPI_POWER_GROUPS_COUNT
];
168 int8_t maxpwr
[IEEE80211_CHAN_MAX
];
176 struct wpi_rx_radiotap_header th
;
177 uint8_t pad
[IEEE80211_RADIOTAP_HDRLEN
];
179 #define sc_rxtap sc_rxtapu.th
183 struct wpi_tx_radiotap_header th
;
184 uint8_t pad
[IEEE80211_RADIOTAP_HDRLEN
];
186 #define sc_txtap sc_txtapu.th
192 struct sysctllog
*sc_sysctllog
;