iPXE
common.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009-2011 Atheros Communications Inc.
3  *
4  * Modified for iPXE by Scott K Logan <logans@cottsay.net> July 2011
5  * Original from Linux kernel 3.0.1
6  *
7  * Permission to use, copy, modify, and/or 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.
10  *
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.
18  */
19 
20 FILE_LICENCE ( BSD2 );
21 FILE_SECBOOT ( FORBIDDEN );
22 
23 #include "../ath.h"
24 
25 #include "hw.h"
26 #include "hw-ops.h"
27 
28 /* Common header for Atheros 802.11n base driver cores */
29 
30 #define WME_NUM_TID 16
31 #define WME_BA_BMP_SIZE 64
32 #define WME_MAX_BA WME_BA_BMP_SIZE
33 #define ATH_TID_MAX_BUFS (2 * WME_MAX_BA)
34 
35 #define WME_AC_BE 2
36 #define WME_NUM_AC 1
37 
38 #define ATH_RSSI_DUMMY_MARKER 0x127
39 #define ATH_RSSI_LPF_LEN 10
40 #define RSSI_LPF_THRESHOLD -20
41 #define ATH_RSSI_EP_MULTIPLIER (1<<7)
42 #define ATH_EP_MUL(x, mul) ((x) * (mul))
43 #define ATH_RSSI_IN(x) (ATH_EP_MUL((x), ATH_RSSI_EP_MULTIPLIER))
44 #define ATH_LPF_RSSI(x, y, len) \
45  ((x != ATH_RSSI_DUMMY_MARKER) ? (((x) * ((len) - 1) + (y)) / (len)) : (y))
46 #define ATH_RSSI_LPF(x, y) do { \
47  if ((y) >= RSSI_LPF_THRESHOLD) \
48  x = ATH_LPF_RSSI((x), ATH_RSSI_IN((y)), ATH_RSSI_LPF_LEN); \
49 } while (0)
50 #define ATH_EP_RND(x, mul) \
51  ((((x)%(mul)) >= ((mul)/2)) ? ((x) + ((mul) - 1)) / (mul) : (x)/(mul))
52 
53 
54 void ath9k_cmn_update_ichannel(struct ath9k_channel *ichan,
55  struct net80211_channel *chan);
57  struct ath_hw *ah);
58 void ath9k_cmn_update_txpow(struct ath_hw *ah, u16 cur_txpow,
59  u16 new_txpow, u16 *txpower);
uint16_t u16
Definition: stdint.h:22
Definition: hw.h:657
FILE_LICENCE(BSD2)
FILE_SECBOOT(FORBIDDEN)
Structure encapsulating the complete state of an 802.11 device.
Definition: net80211.h:786
An 802.11 RF channel.
Definition: net80211.h:385
uint8_t ah
Definition: registers.h:85
struct ath9k_channel * ath9k_cmn_get_curchannel(struct net80211_device *dev, struct ath_hw *ah)
Definition: ath9k_common.c:49
void ath9k_cmn_update_ichannel(struct ath9k_channel *ichan, struct net80211_channel *chan)
Definition: ath9k_common.c:31
void ath9k_cmn_update_txpow(struct ath_hw *ah, u16 cur_txpow, u16 new_txpow, u16 *txpower)
Definition: ath9k_common.c:63