Deleted Added
full compact
if_iwnvar.h (252727) if_iwnvar.h (254204)
1/* $FreeBSD: head/sys/dev/iwn/if_iwnvar.h 252727 2013-07-04 21:16:49Z adrian $ */
1/* $FreeBSD: head/sys/dev/iwn/if_iwnvar.h 254204 2013-08-11 01:57:54Z adrian $ */
2/* $OpenBSD: if_iwnvar.h,v 1.18 2010/04/30 16:06:46 damien Exp $ */
3
4/*-
2/* $OpenBSD: if_iwnvar.h,v 1.18 2010/04/30 16:06:46 damien Exp $ */
3
4/*-
5 * Copyright (c) 2013 Cedric GROSS <cg@cgross.info>
6 * Copyright (c) 2011 Intel Corporation
5 * Copyright (c) 2007, 2008
6 * Damien Bergamini <damien.bergamini@free.fr>
7 * Copyright (c) 2008 Sam Leffler, Errno Consulting
8 *
9 * Permission to use, copy, modify, and distribute this software for any
10 * purpose with or without fee is hereby granted, provided that the above
11 * copyright notice and this permission notice appear in all copies.
12 *
13 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
16 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 */
7 * Copyright (c) 2007, 2008
8 * Damien Bergamini <damien.bergamini@free.fr>
9 * Copyright (c) 2008 Sam Leffler, Errno Consulting
10 *
11 * Permission to use, copy, modify, and distribute this software for any
12 * purpose with or without fee is hereby granted, provided that the above
13 * copyright notice and this permission notice appear in all copies.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
16 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
17 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
18 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
20 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
21 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 */
23enum iwn_rxon_ctx_id {
24 IWN_RXON_BSS_CTX,
25 IWN_RXON_PAN_CTX,
26 IWN_NUM_RXON_CTX
27};
21
28
29struct iwn_pan_slot {
30 uint16_t time;
31 uint8_t type;
32 uint8_t reserved;
33} __packed;
34
35struct iwn_pan_params_cmd {
36 uint16_t flags;
37#define IWN_PAN_PARAMS_FLG_SLOTTED_MODE (1 << 3)
38
39 uint8_t reserved;
40 uint8_t num_slots;
41 struct iwn_pan_slot slots[10];
42} __packed;
43
44struct iwn_led_mode
45{
46 uint8_t led_cur_mode;
47 uint64_t led_cur_bt;
48 uint64_t led_last_bt;
49 uint64_t led_cur_tpt;
50 uint64_t led_last_tpt;
51 uint64_t led_bt_diff;
52 int led_cur_time;
53 int led_last_time;
54};
55
22struct iwn_rx_radiotap_header {
23 struct ieee80211_radiotap_header wr_ihdr;
24 uint64_t wr_tsft;
25 uint8_t wr_flags;
26 uint8_t wr_rate;
27 uint16_t wr_chan_freq;
28 uint16_t wr_chan_flags;
29 int8_t wr_dbm_antsignal;

--- 156 unchanged lines hidden (view full) ---

186};
187
188struct iwn_vap {
189 struct ieee80211vap iv_vap;
190 uint8_t iv_ridx;
191
192 int (*iv_newstate)(struct ieee80211vap *,
193 enum ieee80211_state, int);
56struct iwn_rx_radiotap_header {
57 struct ieee80211_radiotap_header wr_ihdr;
58 uint64_t wr_tsft;
59 uint8_t wr_flags;
60 uint8_t wr_rate;
61 uint16_t wr_chan_freq;
62 uint16_t wr_chan_flags;
63 int8_t wr_dbm_antsignal;

--- 156 unchanged lines hidden (view full) ---

220};
221
222struct iwn_vap {
223 struct ieee80211vap iv_vap;
224 uint8_t iv_ridx;
225
226 int (*iv_newstate)(struct ieee80211vap *,
227 enum ieee80211_state, int);
228 int ctx;
229 int beacon_int;
230 uint8_t macaddr[IEEE80211_ADDR_LEN];
231
194};
195#define IWN_VAP(_vap) ((struct iwn_vap *)(_vap))
196
197struct iwn_softc {
198 device_t sc_dev;
199
200 struct ifnet *sc_ifp;
201 int sc_debug;
202
203 struct mtx sc_mtx;
204
205 u_int sc_flags;
206#define IWN_FLAG_HAS_OTPROM (1 << 1)
207#define IWN_FLAG_CALIB_DONE (1 << 2)
208#define IWN_FLAG_USE_ICT (1 << 3)
209#define IWN_FLAG_INTERNAL_PA (1 << 4)
210#define IWN_FLAG_HAS_11N (1 << 6)
211#define IWN_FLAG_ENH_SENS (1 << 7)
212#define IWN_FLAG_ADV_BTCOEX (1 << 8)
232};
233#define IWN_VAP(_vap) ((struct iwn_vap *)(_vap))
234
235struct iwn_softc {
236 device_t sc_dev;
237
238 struct ifnet *sc_ifp;
239 int sc_debug;
240
241 struct mtx sc_mtx;
242
243 u_int sc_flags;
244#define IWN_FLAG_HAS_OTPROM (1 << 1)
245#define IWN_FLAG_CALIB_DONE (1 << 2)
246#define IWN_FLAG_USE_ICT (1 << 3)
247#define IWN_FLAG_INTERNAL_PA (1 << 4)
248#define IWN_FLAG_HAS_11N (1 << 6)
249#define IWN_FLAG_ENH_SENS (1 << 7)
250#define IWN_FLAG_ADV_BTCOEX (1 << 8)
251#define IWN_FLAG_PAN_SUPPORT (1 << 9)
213
214 uint8_t hw_type;
252
253 uint8_t hw_type;
254 /* subdevice_id used to adjust configuration */
255 uint16_t subdevice_id;
215
216 struct iwn_ops ops;
217 const char *fwname;
218 const struct iwn_sensitivity_limits
219 *limits;
220 int ntxqs;
221 int firstaggqueue;
222 int ndmachnls;

--- 44 unchanged lines hidden (view full) ---

267 struct task sc_reinit_task;
268 struct task sc_radioon_task;
269 struct task sc_radiooff_task;
270
271 struct callout calib_to;
272 int calib_cnt;
273 struct iwn_calib_state calib;
274 struct callout watchdog_to;
256
257 struct iwn_ops ops;
258 const char *fwname;
259 const struct iwn_sensitivity_limits
260 *limits;
261 int ntxqs;
262 int firstaggqueue;
263 int ndmachnls;

--- 44 unchanged lines hidden (view full) ---

308 struct task sc_reinit_task;
309 struct task sc_radioon_task;
310 struct task sc_radiooff_task;
311
312 struct callout calib_to;
313 int calib_cnt;
314 struct iwn_calib_state calib;
315 struct callout watchdog_to;
275
316 struct callout ct_kill_exit_to;
276 struct iwn_fw_info fw;
277 struct iwn_calib_info calibcmd[5];
278 uint32_t errptr;
279
280 struct iwn_rx_stat last_rx_stat;
281 int last_rx_valid;
282 struct iwn_ucode_info ucode_info;
317 struct iwn_fw_info fw;
318 struct iwn_calib_info calibcmd[5];
319 uint32_t errptr;
320
321 struct iwn_rx_stat last_rx_stat;
322 int last_rx_valid;
323 struct iwn_ucode_info ucode_info;
283 struct iwn_rxon rxon;
324 struct iwn_rxon rx_on[IWN_NUM_RXON_CTX];
325 struct iwn_rxon *rxon;
326 int ctx;
327 struct ieee80211vap *ivap[IWN_NUM_RXON_CTX];
328
329 uint8_t uc_scan_progress;
284 uint32_t rawtemp;
285 int temp;
286 int noise;
287 uint32_t qfullmsk;
288
289 uint32_t prom_base;
290 struct iwn4965_eeprom_band
291 bands[IWN_NBANDS];
292 struct iwn_eeprom_chan eeprom_channels[IWN_NBANDS][IWN_MAX_CHAN_PER_BAND];
293 uint16_t rfcfg;
294 uint8_t calib_ver;
295 char eeprom_domain[4];
296 uint32_t eeprom_crystal;
297 int16_t eeprom_temp;
330 uint32_t rawtemp;
331 int temp;
332 int noise;
333 uint32_t qfullmsk;
334
335 uint32_t prom_base;
336 struct iwn4965_eeprom_band
337 bands[IWN_NBANDS];
338 struct iwn_eeprom_chan eeprom_channels[IWN_NBANDS][IWN_MAX_CHAN_PER_BAND];
339 uint16_t rfcfg;
340 uint8_t calib_ver;
341 char eeprom_domain[4];
342 uint32_t eeprom_crystal;
343 int16_t eeprom_temp;
344 int16_t eeprom_temp_high;
298 int16_t eeprom_voltage;
299 int8_t maxpwr2GHz;
300 int8_t maxpwr5GHz;
301 int8_t maxpwr[IEEE80211_CHAN_MAX];
302
345 int16_t eeprom_voltage;
346 int8_t maxpwr2GHz;
347 int8_t maxpwr5GHz;
348 int8_t maxpwr[IEEE80211_CHAN_MAX];
349
350 uint32_t tlv_feature_flags;
351
303 int32_t temp_off;
304 uint32_t int_mask;
305 uint8_t ntxchains;
306 uint8_t nrxchains;
307 uint8_t txchainmask;
308 uint8_t rxchainmask;
309 uint8_t chainmask;
310
311 int sc_tx_timer;
352 int32_t temp_off;
353 uint32_t int_mask;
354 uint8_t ntxchains;
355 uint8_t nrxchains;
356 uint8_t txchainmask;
357 uint8_t rxchainmask;
358 uint8_t chainmask;
359
360 int sc_tx_timer;
361 int sc_scan_timer;
312
313 struct ieee80211_tx_ampdu *qid2tap[IWN5000_NTXQUEUES];
314
315 int (*sc_ampdu_rx_start)(struct ieee80211_node *,
316 struct ieee80211_rx_ampdu *, int, int, int);
317 void (*sc_ampdu_rx_stop)(struct ieee80211_node *,
318 struct ieee80211_rx_ampdu *);
319 int (*sc_addba_request)(struct ieee80211_node *,
320 struct ieee80211_tx_ampdu *, int, int, int);
321 int (*sc_addba_response)(struct ieee80211_node *,
322 struct ieee80211_tx_ampdu *, int, int, int);
323 void (*sc_addba_stop)(struct ieee80211_node *,
324 struct ieee80211_tx_ampdu *);
325
362
363 struct ieee80211_tx_ampdu *qid2tap[IWN5000_NTXQUEUES];
364
365 int (*sc_ampdu_rx_start)(struct ieee80211_node *,
366 struct ieee80211_rx_ampdu *, int, int, int);
367 void (*sc_ampdu_rx_stop)(struct ieee80211_node *,
368 struct ieee80211_rx_ampdu *);
369 int (*sc_addba_request)(struct ieee80211_node *,
370 struct ieee80211_tx_ampdu *, int, int, int);
371 int (*sc_addba_response)(struct ieee80211_node *,
372 struct ieee80211_tx_ampdu *, int, int, int);
373 void (*sc_addba_stop)(struct ieee80211_node *,
374 struct ieee80211_tx_ampdu *);
375
376 struct iwn_led_mode sc_led;
326
327 struct iwn_rx_radiotap_header sc_rxtap;
328 struct iwn_tx_radiotap_header sc_txtap;
377
378 struct iwn_rx_radiotap_header sc_rxtap;
379 struct iwn_tx_radiotap_header sc_txtap;
380
381 /* The power save level originally configured by user */
382 int desired_pwrsave_level;
383
384 /*
385 * The current power save level, this may differ from the
386 * configured value due to thermal throttling etc.
387 */
388 int current_pwrsave_level;
389
390 /* For specifique params */
391 struct iwn_base_params *base_params;
329};
330
331#define IWN_LOCK_INIT(_sc) \
332 mtx_init(&(_sc)->sc_mtx, device_get_nameunit((_sc)->sc_dev), \
333 MTX_NETWORK_LOCK, MTX_DEF)
334#define IWN_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx)
335#define IWN_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED)
336#define IWN_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx)
337#define IWN_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_mtx)
392};
393
394#define IWN_LOCK_INIT(_sc) \
395 mtx_init(&(_sc)->sc_mtx, device_get_nameunit((_sc)->sc_dev), \
396 MTX_NETWORK_LOCK, MTX_DEF)
397#define IWN_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx)
398#define IWN_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED)
399#define IWN_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx)
400#define IWN_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_mtx)