0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041 #ifndef _DEV_ATH5K_BASE_H
0042 #define _DEV_ATH5K_BASE_H
0043
0044 struct ieee80211_vif;
0045 struct ieee80211_hw;
0046 struct ath5k_hw;
0047 struct ath5k_txq;
0048 struct ieee80211_channel;
0049 struct ath_bus_ops;
0050 struct ieee80211_tx_control;
0051 enum nl80211_iftype;
0052
0053 enum ath5k_srev_type {
0054 AR5K_VERSION_MAC,
0055 AR5K_VERSION_RAD,
0056 };
0057
0058 struct ath5k_srev_name {
0059 const char *sr_name;
0060 enum ath5k_srev_type sr_type;
0061 u_int sr_val;
0062 };
0063
0064 struct ath5k_buf {
0065 struct list_head list;
0066 struct ath5k_desc *desc;
0067 dma_addr_t daddr;
0068 struct sk_buff *skb;
0069 dma_addr_t skbaddr;
0070 struct ieee80211_tx_rate rates[4];
0071 };
0072
0073 struct ath5k_vif {
0074 bool assoc;
0075 enum nl80211_iftype opmode;
0076 int bslot;
0077 struct ath5k_buf *bbuf;
0078 };
0079
0080 struct ath5k_vif_iter_data {
0081 const u8 *hw_macaddr;
0082 u8 mask[ETH_ALEN];
0083 u8 active_mac[ETH_ALEN];
0084 bool need_set_hw_addr;
0085 bool found_active;
0086 bool any_assoc;
0087 enum nl80211_iftype opmode;
0088 int n_stas;
0089 };
0090
0091 void ath5k_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif);
0092 bool ath5k_any_vif_assoc(struct ath5k_hw *ah);
0093
0094 int ath5k_start(struct ieee80211_hw *hw);
0095 void ath5k_stop(struct ieee80211_hw *hw);
0096
0097 void ath5k_beacon_update_timers(struct ath5k_hw *ah, u64 bc_tsf);
0098 int ath5k_beacon_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
0099 void ath5k_beacon_config(struct ath5k_hw *ah);
0100 void ath5k_set_beacon_filter(struct ieee80211_hw *hw, bool enable);
0101
0102 void ath5k_update_bssid_mask_and_opmode(struct ath5k_hw *ah,
0103 struct ieee80211_vif *vif);
0104 int ath5k_chan_set(struct ath5k_hw *ah, struct cfg80211_chan_def *chandef);
0105 void ath5k_txbuf_free_skb(struct ath5k_hw *ah, struct ath5k_buf *bf);
0106 void ath5k_rxbuf_free_skb(struct ath5k_hw *ah, struct ath5k_buf *bf);
0107 void ath5k_tx_queue(struct ieee80211_hw *hw, struct sk_buff *skb,
0108 struct ath5k_txq *txq, struct ieee80211_tx_control *control);
0109
0110 const char *ath5k_chip_name(enum ath5k_srev_type type, u_int16_t val);
0111
0112 int ath5k_init_ah(struct ath5k_hw *ah, const struct ath_bus_ops *bus_ops);
0113 void ath5k_deinit_ah(struct ath5k_hw *ah);
0114
0115
0116 #define ath5k_hw_hasbssidmask(_ah) (ah->ah_version == AR5K_AR5212)
0117
0118
0119 #define ath5k_hw_hasveol(_ah) (ah->ah_version != AR5K_AR5210)
0120
0121 #endif