if_wpivar.h revision 1.2.4.2 1 1.2.4.2 yamt /* $NetBSD: if_wpivar.h,v 1.2.4.2 2006/12/30 20:48:46 yamt Exp $ */
2 1.2.4.2 yamt
3 1.2.4.2 yamt /*-
4 1.2.4.2 yamt * Copyright (c) 2006
5 1.2.4.2 yamt * Damien Bergamini <damien.bergamini (at) free.fr>
6 1.2.4.2 yamt *
7 1.2.4.2 yamt * Permission to use, copy, modify, and distribute this software for any
8 1.2.4.2 yamt * purpose with or without fee is hereby granted, provided that the above
9 1.2.4.2 yamt * copyright notice and this permission notice appear in all copies.
10 1.2.4.2 yamt *
11 1.2.4.2 yamt * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 1.2.4.2 yamt * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 1.2.4.2 yamt * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 1.2.4.2 yamt * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 1.2.4.2 yamt * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 1.2.4.2 yamt * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 1.2.4.2 yamt * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 1.2.4.2 yamt */
19 1.2.4.2 yamt
20 1.2.4.2 yamt struct wpi_rx_radiotap_header {
21 1.2.4.2 yamt struct ieee80211_radiotap_header wr_ihdr;
22 1.2.4.2 yamt uint64_t wr_tsft;
23 1.2.4.2 yamt uint8_t wr_flags;
24 1.2.4.2 yamt uint8_t wr_rate;
25 1.2.4.2 yamt uint16_t wr_chan_freq;
26 1.2.4.2 yamt uint16_t wr_chan_flags;
27 1.2.4.2 yamt int8_t wr_dbm_antsignal;
28 1.2.4.2 yamt int8_t wr_dbm_antnoise;
29 1.2.4.2 yamt uint8_t wr_antenna;
30 1.2.4.2 yamt };
31 1.2.4.2 yamt
32 1.2.4.2 yamt #define WPI_RX_RADIOTAP_PRESENT \
33 1.2.4.2 yamt ((1 << IEEE80211_RADIOTAP_TSFT) | \
34 1.2.4.2 yamt (1 << IEEE80211_RADIOTAP_FLAGS) | \
35 1.2.4.2 yamt (1 << IEEE80211_RADIOTAP_RATE) | \
36 1.2.4.2 yamt (1 << IEEE80211_RADIOTAP_CHANNEL) | \
37 1.2.4.2 yamt (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | \
38 1.2.4.2 yamt (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE) | \
39 1.2.4.2 yamt (1 << IEEE80211_RADIOTAP_ANTENNA))
40 1.2.4.2 yamt
41 1.2.4.2 yamt struct wpi_tx_radiotap_header {
42 1.2.4.2 yamt struct ieee80211_radiotap_header wt_ihdr;
43 1.2.4.2 yamt uint8_t wt_flags;
44 1.2.4.2 yamt uint8_t wt_rate;
45 1.2.4.2 yamt uint16_t wt_chan_freq;
46 1.2.4.2 yamt uint16_t wt_chan_flags;
47 1.2.4.2 yamt uint8_t wt_hwqueue;
48 1.2.4.2 yamt };
49 1.2.4.2 yamt
50 1.2.4.2 yamt #define WPI_TX_RADIOTAP_PRESENT \
51 1.2.4.2 yamt ((1 << IEEE80211_RADIOTAP_FLAGS) | \
52 1.2.4.2 yamt (1 << IEEE80211_RADIOTAP_RATE) | \
53 1.2.4.2 yamt (1 << IEEE80211_RADIOTAP_CHANNEL))
54 1.2.4.2 yamt
55 1.2.4.2 yamt struct wpi_dma_info {
56 1.2.4.2 yamt bus_dmamap_t map;
57 1.2.4.2 yamt bus_dma_segment_t seg;
58 1.2.4.2 yamt bus_addr_t paddr;
59 1.2.4.2 yamt caddr_t vaddr;
60 1.2.4.2 yamt bus_size_t size;
61 1.2.4.2 yamt };
62 1.2.4.2 yamt
63 1.2.4.2 yamt struct wpi_tx_data {
64 1.2.4.2 yamt bus_dmamap_t map;
65 1.2.4.2 yamt struct mbuf *m;
66 1.2.4.2 yamt struct ieee80211_node *ni;
67 1.2.4.2 yamt };
68 1.2.4.2 yamt
69 1.2.4.2 yamt struct wpi_tx_ring {
70 1.2.4.2 yamt struct wpi_dma_info desc_dma;
71 1.2.4.2 yamt struct wpi_dma_info cmd_dma;
72 1.2.4.2 yamt struct wpi_tx_desc *desc;
73 1.2.4.2 yamt struct wpi_tx_cmd *cmd;
74 1.2.4.2 yamt struct wpi_tx_data *data;
75 1.2.4.2 yamt int qid;
76 1.2.4.2 yamt int count;
77 1.2.4.2 yamt int queued;
78 1.2.4.2 yamt int cur;
79 1.2.4.2 yamt };
80 1.2.4.2 yamt
81 1.2.4.2 yamt struct wpi_rx_data {
82 1.2.4.2 yamt bus_dmamap_t map;
83 1.2.4.2 yamt struct mbuf *m;
84 1.2.4.2 yamt };
85 1.2.4.2 yamt
86 1.2.4.2 yamt struct wpi_rx_ring {
87 1.2.4.2 yamt struct wpi_dma_info desc_dma;
88 1.2.4.2 yamt uint32_t *desc;
89 1.2.4.2 yamt struct wpi_rx_data data[WPI_RX_RING_COUNT];
90 1.2.4.2 yamt int cur;
91 1.2.4.2 yamt };
92 1.2.4.2 yamt
93 1.2.4.2 yamt struct wpi_node {
94 1.2.4.2 yamt struct ieee80211_node ni; /* must be the first */
95 1.2.4.2 yamt struct ieee80211_amrr_node amn;
96 1.2.4.2 yamt };
97 1.2.4.2 yamt
98 1.2.4.2 yamt struct wpi_softc {
99 1.2.4.2 yamt struct device sc_dev;
100 1.2.4.2 yamt struct ethercom sc_ec;
101 1.2.4.2 yamt struct ieee80211com sc_ic;
102 1.2.4.2 yamt int (*sc_newstate)(struct ieee80211com *,
103 1.2.4.2 yamt enum ieee80211_state, int);
104 1.2.4.2 yamt struct ieee80211_amrr amrr;
105 1.2.4.2 yamt
106 1.2.4.2 yamt uint32_t flags;
107 1.2.4.2 yamt #define WPI_FLAG_FW_INITED (1 << 0)
108 1.2.4.2 yamt
109 1.2.4.2 yamt bus_dma_tag_t sc_dmat;
110 1.2.4.2 yamt
111 1.2.4.2 yamt /* shared area */
112 1.2.4.2 yamt struct wpi_dma_info shared_dma;
113 1.2.4.2 yamt struct wpi_shared *shared;
114 1.2.4.2 yamt
115 1.2.4.2 yamt struct wpi_tx_ring txq[4];
116 1.2.4.2 yamt struct wpi_tx_ring cmdq;
117 1.2.4.2 yamt struct wpi_tx_ring svcq;
118 1.2.4.2 yamt struct wpi_rx_ring rxq;
119 1.2.4.2 yamt
120 1.2.4.2 yamt bus_space_tag_t sc_st;
121 1.2.4.2 yamt bus_space_handle_t sc_sh;
122 1.2.4.2 yamt void *sc_ih;
123 1.2.4.2 yamt pci_chipset_tag_t sc_pct;
124 1.2.4.2 yamt pcitag_t sc_pcitag;
125 1.2.4.2 yamt bus_size_t sc_sz;
126 1.2.4.2 yamt
127 1.2.4.2 yamt struct callout amrr_ch;
128 1.2.4.2 yamt
129 1.2.4.2 yamt struct wpi_config config;
130 1.2.4.2 yamt uint16_t pwr1[14];
131 1.2.4.2 yamt uint16_t pwr2[14];
132 1.2.4.2 yamt
133 1.2.4.2 yamt int sc_tx_timer;
134 1.2.4.2 yamt void *powerhook;
135 1.2.4.2 yamt
136 1.2.4.2 yamt #if NBPFILTER > 0
137 1.2.4.2 yamt caddr_t sc_drvbpf;
138 1.2.4.2 yamt
139 1.2.4.2 yamt union {
140 1.2.4.2 yamt struct wpi_rx_radiotap_header th;
141 1.2.4.2 yamt uint8_t pad[IEEE80211_RADIOTAP_HDRLEN];
142 1.2.4.2 yamt } sc_rxtapu;
143 1.2.4.2 yamt #define sc_rxtap sc_rxtapu.th
144 1.2.4.2 yamt int sc_rxtap_len;
145 1.2.4.2 yamt
146 1.2.4.2 yamt union {
147 1.2.4.2 yamt struct wpi_tx_radiotap_header th;
148 1.2.4.2 yamt uint8_t pad[IEEE80211_RADIOTAP_HDRLEN];
149 1.2.4.2 yamt } sc_txtapu;
150 1.2.4.2 yamt #define sc_txtap sc_txtapu.th
151 1.2.4.2 yamt int sc_txtap_len;
152 1.2.4.2 yamt #endif
153 1.2.4.2 yamt };
154