2009-11-06 00:44:39 +08:00
|
|
|
/*
|
2011-05-17 16:06:18 +08:00
|
|
|
* Copyright (c) 2009-2011 Atheros Communications Inc.
|
2009-11-06 00:44:39 +08:00
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
|
|
* copyright notice and this permission notice appear in all copies.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <net/mac80211.h>
|
|
|
|
|
|
|
|
#include "../ath.h"
|
|
|
|
|
|
|
|
#include "hw.h"
|
2010-04-16 05:38:06 +08:00
|
|
|
#include "hw-ops.h"
|
2009-11-06 00:44:39 +08:00
|
|
|
|
|
|
|
/* Common header for Atheros 802.11n base driver cores */
|
|
|
|
|
|
|
|
#define WME_NUM_TID 16
|
|
|
|
#define WME_BA_BMP_SIZE 64
|
|
|
|
#define WME_MAX_BA WME_BA_BMP_SIZE
|
|
|
|
#define ATH_TID_MAX_BUFS (2 * WME_MAX_BA)
|
|
|
|
|
2010-11-07 21:59:39 +08:00
|
|
|
/* These must match mac80211 skb queue mapping numbers */
|
|
|
|
#define WME_AC_VO 0
|
|
|
|
#define WME_AC_VI 1
|
|
|
|
#define WME_AC_BE 2
|
|
|
|
#define WME_AC_BK 3
|
2009-11-06 00:44:39 +08:00
|
|
|
#define WME_NUM_AC 4
|
|
|
|
|
|
|
|
#define ATH_RSSI_DUMMY_MARKER 0x127
|
|
|
|
#define ATH_RSSI_LPF_LEN 10
|
|
|
|
#define RSSI_LPF_THRESHOLD -20
|
|
|
|
#define ATH_RSSI_EP_MULTIPLIER (1<<7)
|
|
|
|
#define ATH_EP_MUL(x, mul) ((x) * (mul))
|
|
|
|
#define ATH_RSSI_IN(x) (ATH_EP_MUL((x), ATH_RSSI_EP_MULTIPLIER))
|
|
|
|
#define ATH_LPF_RSSI(x, y, len) \
|
|
|
|
((x != ATH_RSSI_DUMMY_MARKER) ? (((x) * ((len) - 1) + (y)) / (len)) : (y))
|
|
|
|
#define ATH_RSSI_LPF(x, y) do { \
|
|
|
|
if ((y) >= RSSI_LPF_THRESHOLD) \
|
|
|
|
x = ATH_LPF_RSSI((x), ATH_RSSI_IN((y)), ATH_RSSI_LPF_LEN); \
|
|
|
|
} while (0)
|
|
|
|
#define ATH_EP_RND(x, mul) \
|
|
|
|
((((x)%(mul)) >= ((mul)/2)) ? ((x) + ((mul) - 1)) / (mul) : (x)/(mul))
|
|
|
|
|
2009-11-24 22:49:18 +08:00
|
|
|
int ath9k_cmn_padpos(__le16 frame_control);
|
2010-03-17 16:55:25 +08:00
|
|
|
int ath9k_cmn_get_hw_crypto_keytype(struct sk_buff *skb);
|
2010-10-20 08:09:46 +08:00
|
|
|
void ath9k_cmn_update_ichannel(struct ath9k_channel *ichan,
|
|
|
|
struct ieee80211_channel *chan,
|
|
|
|
enum nl80211_channel_type channel_type);
|
2010-03-17 16:55:25 +08:00
|
|
|
struct ath9k_channel *ath9k_cmn_get_curchannel(struct ieee80211_hw *hw,
|
|
|
|
struct ath_hw *ah);
|
2010-06-02 18:23:37 +08:00
|
|
|
int ath9k_cmn_count_streams(unsigned int chainmask, int max);
|
2010-08-18 22:27:48 +08:00
|
|
|
void ath9k_cmn_btcoex_bt_stomp(struct ath_common *common,
|
|
|
|
enum ath_stomp_type stomp_type);
|
2011-02-01 02:17:44 +08:00
|
|
|
void ath9k_cmn_update_txpow(struct ath_hw *ah, u16 cur_txpow,
|
|
|
|
u16 new_txpow, u16 *txpower);
|