#define pr_fmt(fmt) …
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/dma-mapping.h>
#include <linux/hardirq.h>
#include <linux/if.h>
#include <linux/io.h>
#include <linux/netdevice.h>
#include <linux/cache.h>
#include <linux/ethtool.h>
#include <linux/uaccess.h>
#include <linux/slab.h>
#include <linux/etherdevice.h>
#include <linux/nl80211.h>
#include <net/cfg80211.h>
#include <net/ieee80211_radiotap.h>
#include <asm/unaligned.h>
#include <net/mac80211.h>
#include "base.h"
#include "reg.h"
#include "debug.h"
#include "ani.h"
#include "ath5k.h"
#include "../regd.h"
#define CREATE_TRACE_POINTS
#include "trace.h"
bool ath5k_modparam_nohwcrypt;
module_param_named(nohwcrypt, ath5k_modparam_nohwcrypt, bool, 0444);
MODULE_PARM_DESC(…) …;
static bool modparam_fastchanswitch;
module_param_named(fastchanswitch, modparam_fastchanswitch, bool, 0444);
MODULE_PARM_DESC(…) …;
static bool ath5k_modparam_no_hw_rfkill_switch;
module_param_named(no_hw_rfkill_switch, ath5k_modparam_no_hw_rfkill_switch,
bool, 0444);
MODULE_PARM_DESC(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
static int ath5k_init(struct ieee80211_hw *hw);
static int ath5k_reset(struct ath5k_hw *ah, struct ieee80211_channel *chan,
bool skip_pcu);
static const struct ath5k_srev_name srev_names[] = …;
static const struct ieee80211_rate ath5k_rates[] = …;
static inline u64 ath5k_extend_tsf(struct ath5k_hw *ah, u32 rstamp)
{ … }
const char *
ath5k_chip_name(enum ath5k_srev_type type, u_int16_t val)
{ … }
static unsigned int ath5k_ioread32(void *hw_priv, u32 reg_offset)
{ … }
static void ath5k_iowrite32(void *hw_priv, u32 val, u32 reg_offset)
{ … }
static const struct ath_ops ath5k_common_ops = …;
static void ath5k_reg_notifier(struct wiphy *wiphy,
struct regulatory_request *request)
{ … }
#ifdef CONFIG_ATH5K_TEST_CHANNELS
static bool ath5k_is_standard_channel(short chan, enum nl80211_band band)
{ … }
#else
static bool ath5k_is_standard_channel(short chan, enum nl80211_band band)
{
if (band == NL80211_BAND_2GHZ && chan <= 14)
return true;
return
(((chan & 3) == 0 && chan >= 36 && chan <= 64) ||
((chan & 3) == 0 && chan >= 100 && chan <= 140) ||
((chan & 3) == 1 && chan >= 149 && chan <= 165) ||
(chan == 8 || chan == 12 || chan == 16) ||
(chan == 184 || chan == 188 || chan == 192 || chan == 196));
}
#endif
static unsigned int
ath5k_setup_channels(struct ath5k_hw *ah, struct ieee80211_channel *channels,
unsigned int mode, unsigned int max)
{ … }
static void
ath5k_setup_rate_idx(struct ath5k_hw *ah, struct ieee80211_supported_band *b)
{ … }
static int
ath5k_setup_bands(struct ieee80211_hw *hw)
{ … }
int
ath5k_chan_set(struct ath5k_hw *ah, struct cfg80211_chan_def *chandef)
{ … }
void ath5k_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
{ … }
void
ath5k_update_bssid_mask_and_opmode(struct ath5k_hw *ah,
struct ieee80211_vif *vif)
{ … }
static inline int
ath5k_hw_to_driver_rix(struct ath5k_hw *ah, int hw_rix)
{ … }
static
struct sk_buff *ath5k_rx_skb_alloc(struct ath5k_hw *ah, dma_addr_t *skb_addr)
{ … }
static int
ath5k_rxbuf_setup(struct ath5k_hw *ah, struct ath5k_buf *bf)
{ … }
static enum ath5k_pkt_type get_hw_packet_type(struct sk_buff *skb)
{ … }
static struct ieee80211_rate *
ath5k_get_rate(const struct ieee80211_hw *hw,
const struct ieee80211_tx_info *info,
struct ath5k_buf *bf, int idx)
{ … }
static u16
ath5k_get_rate_hw_value(const struct ieee80211_hw *hw,
const struct ieee80211_tx_info *info,
struct ath5k_buf *bf, int idx)
{ … }
static bool ath5k_merge_ratetbl(struct ieee80211_sta *sta,
struct ath5k_buf *bf,
struct ieee80211_tx_info *tx_info)
{ … }
static int
ath5k_txbuf_setup(struct ath5k_hw *ah, struct ath5k_buf *bf,
struct ath5k_txq *txq, int padsize,
struct ieee80211_tx_control *control)
{ … }
static int
ath5k_desc_alloc(struct ath5k_hw *ah)
{ … }
void
ath5k_txbuf_free_skb(struct ath5k_hw *ah, struct ath5k_buf *bf)
{ … }
void
ath5k_rxbuf_free_skb(struct ath5k_hw *ah, struct ath5k_buf *bf)
{ … }
static void
ath5k_desc_free(struct ath5k_hw *ah)
{ … }
static struct ath5k_txq *
ath5k_txq_setup(struct ath5k_hw *ah,
int qtype, int subtype)
{ … }
static int
ath5k_beaconq_setup(struct ath5k_hw *ah)
{ … }
static int
ath5k_beaconq_config(struct ath5k_hw *ah)
{ … }
static void
ath5k_drain_tx_buffs(struct ath5k_hw *ah)
{ … }
static void
ath5k_txq_release(struct ath5k_hw *ah)
{ … }
static int
ath5k_rx_start(struct ath5k_hw *ah)
{ … }
static void
ath5k_rx_stop(struct ath5k_hw *ah)
{ … }
static unsigned int
ath5k_rx_decrypted(struct ath5k_hw *ah, struct sk_buff *skb,
struct ath5k_rx_status *rs)
{ … }
static void
ath5k_check_ibss_tsf(struct ath5k_hw *ah, struct sk_buff *skb,
struct ieee80211_rx_status *rxs)
{ … }
static int ath5k_common_padpos(struct sk_buff *skb)
{ … }
static int ath5k_add_padding(struct sk_buff *skb)
{ … }
static int ath5k_remove_padding(struct sk_buff *skb)
{ … }
static void
ath5k_receive_frame(struct ath5k_hw *ah, struct sk_buff *skb,
struct ath5k_rx_status *rs)
{ … }
static bool
ath5k_receive_frame_ok(struct ath5k_hw *ah, struct ath5k_rx_status *rs)
{ … }
static void
ath5k_set_current_imask(struct ath5k_hw *ah)
{ … }
static void
ath5k_tasklet_rx(struct tasklet_struct *t)
{ … }
void
ath5k_tx_queue(struct ieee80211_hw *hw, struct sk_buff *skb,
struct ath5k_txq *txq, struct ieee80211_tx_control *control)
{ … }
static void
ath5k_tx_frame_completed(struct ath5k_hw *ah, struct sk_buff *skb,
struct ath5k_txq *txq, struct ath5k_tx_status *ts,
struct ath5k_buf *bf)
{ … }
static void
ath5k_tx_processq(struct ath5k_hw *ah, struct ath5k_txq *txq)
{ … }
static void
ath5k_tasklet_tx(struct tasklet_struct *t)
{ … }
static int
ath5k_beacon_setup(struct ath5k_hw *ah, struct ath5k_buf *bf)
{ … }
int
ath5k_beacon_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
{ … }
static void
ath5k_beacon_send(struct ath5k_hw *ah)
{ … }
void
ath5k_beacon_update_timers(struct ath5k_hw *ah, u64 bc_tsf)
{ … }
void
ath5k_beacon_config(struct ath5k_hw *ah)
{ … }
static void ath5k_tasklet_beacon(struct tasklet_struct *t)
{ … }
static void
ath5k_intr_calibration_poll(struct ath5k_hw *ah)
{ … }
static void
ath5k_schedule_rx(struct ath5k_hw *ah)
{ … }
static void
ath5k_schedule_tx(struct ath5k_hw *ah)
{ … }
static irqreturn_t
ath5k_intr(int irq, void *dev_id)
{ … }
static void
ath5k_calibrate_work(struct work_struct *work)
{ … }
static void
ath5k_tasklet_ani(struct tasklet_struct *t)
{ … }
static void
ath5k_tx_complete_poll_work(struct work_struct *work)
{ … }
static const struct ieee80211_iface_limit if_limits[] = …;
static const struct ieee80211_iface_combination if_comb = …;
int
ath5k_init_ah(struct ath5k_hw *ah, const struct ath_bus_ops *bus_ops)
{ … }
static int
ath5k_stop_locked(struct ath5k_hw *ah)
{ … }
int ath5k_start(struct ieee80211_hw *hw)
{ … }
static void ath5k_stop_tasklets(struct ath5k_hw *ah)
{ … }
void ath5k_stop(struct ieee80211_hw *hw, bool suspend)
{ … }
static int
ath5k_reset(struct ath5k_hw *ah, struct ieee80211_channel *chan,
bool skip_pcu)
{ … }
static void ath5k_reset_work(struct work_struct *work)
{ … }
static int
ath5k_init(struct ieee80211_hw *hw)
{ … }
void
ath5k_deinit_ah(struct ath5k_hw *ah)
{ … }
bool
ath5k_any_vif_assoc(struct ath5k_hw *ah)
{ … }
void
ath5k_set_beacon_filter(struct ieee80211_hw *hw, bool enable)
{ … }
void _ath5k_printk(const struct ath5k_hw *ah, const char *level,
const char *fmt, ...)
{ … }