32 #define CHAN2G(_freq, _idx) { \ 33 .band = NET80211_BAND_2GHZ, \ 34 .center_freq = (_freq), \ 39 #define CHAN5G(_freq, _idx) { \ 40 .band = NET80211_BAND_5GHZ, \ 41 .center_freq = (_freq), \ 103 #define SHPCHECK(__hw_rate, __flags) \ 104 ((__flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) ? (__hw_rate | 0x04 ) : 0) 106 #define RATE(_bitrate, _hw_rate, _flags) { \ 107 .bitrate = (_bitrate), \ 109 .hw_value = (_hw_rate), \ 110 .hw_value_short = (SHPCHECK(_hw_rate, _flags)) \ 182 int nbuf,
int ndesc,
int is_tx)
184 #define DS2PHYS(_dd, _ds) \ 185 ((_dd)->dd_desc_paddr + ((char *)(_ds) - (char *)(_dd)->dd_desc)) 186 #define ATH_DESC_4KB_BOUND_CHECK(_daddr) ((((_daddr) & 0xFFF) > 0xF9F) ? 1 : 0) 189 int i, bsize,
error, desc_len;
191 DBG2(
"ath9k: %s DMA: %d buffers %d desc/buf\n",
202 if ((desc_len % 4) != 0) {
203 DBG(
"ath9k: ath_desc not DWORD aligned\n");
218 u32 ndesc_skipped = 1;
221 dma_len = ndesc_skipped * desc_len;
233 DBG2(
"ath9k: %s DMA map: %p (%d) -> %llx (%d)\n",
238 bsize =
sizeof(
struct ath_buf) * nbuf;
246 for (i = 0; i < nbuf; i++, bf++,
ds += (desc_len * ndesc)) {
258 ds += (desc_len * ndesc);
269 memset(dd, 0,
sizeof(*dd));
271 #undef ATH_DESC_4KB_BOUND_CHECK 287 for (i = 0; i <
common->keymax; i++)
369 ah->hw_version.devid = devid;
370 ah->hw_version.subsysid = subsysid;
378 DBG(
"ath9k: cannot allocate 802.11 hardware info structure\n");
399 common->cachelsz = csz << 2;
446 if(chan->
band != band)
464 ah->curchan = curchan;
595 memset(dd, 0,
sizeof(*dd));
int ath_hw_keyreset(struct ath_common *common, u16 entry)
#define AR_PCU_MIC_NEW_LOC_ENA
int modes
A bitwise OR of the 802.11x modes supported by this device.
struct net80211_channel channels[NET80211_MAX_CHANNELS]
List of RF channels supported by the card.
static unsigned int unsigned int reg
void ath9k_init_crypto(struct ath_softc *sc)
struct option_descriptor set[0]
void ath_tx_cleanupq(struct ath_softc *sc, struct ath_txq *txq)
#define CHAN5G(_freq, _idx)
void ath9k_tasklet(struct ath_softc *sc)
u32 ath9k_hw_getdefantenna(struct ath_hw *ah)
struct arbelprm_completion_with_error error
void net80211_unregister(struct net80211_device *dev)
Unregister 802.11 device from network stack.
uint32_t readl(volatile uint32_t *io_addr)
Read 32-bit dword from memory-mapped device.
uint8_t eth_broadcast[ETH_ALEN]
Ethernet broadcast MAC address.
void ath9k_set_hw_capab(struct ath_softc *sc, struct net80211_device *dev __unused)
void ath_tx_cleanup(struct ath_softc *sc)
static void *__malloc malloc_phys(size_t size, size_t phys_align)
Allocate memory with specified physical alignment.
#define ATH_TXQ_SETUP(sc, i)
#define DS2PHYS(_dd, _ds)
struct ath_txq txq[ATH9K_NUM_TX_QUEUES]
static const struct net80211_channel ath9k_2ghz_chantable[]
unsigned signal_max
Maximum signal in arbitrary cases.
static unsigned int ath9k_reg_rmw(void *hw_priv, u32 reg_offset, u32 set, u32 clr)
static int ath9k_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid, const struct ath_bus_ops *bus_ops)
enum net80211_hw_info::@630 signal_type
Signal strength information that can be provided by the device.
void ath_descdma_cleanup(struct ath_softc *sc __unused, struct ath_descdma *dd, struct list_head *head)
static void ath9k_init_misc(struct ath_softc *sc)
static const struct net80211_channel ath9k_5ghz_chantable[]
A doubly-linked list entry (or list head)
#define NET80211_BAND_BIT_5GHZ
Bitmask for the 5GHz band.
Dynamic memory allocation.
#define NET80211_BAND_2GHZ
The 2.4 GHz ISM band, unlicensed in most countries.
struct net80211_device * dev
u16 rates[NET80211_NR_BANDS][NET80211_MAX_RATES]
List of transmission rates supported by the card, indexed by band.
#define ATH_DESC_4KB_BOUND_CHECK(_daddr)
#define ENOMEM
Not enough space.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
static void ath_read_cachesize(struct ath_common *common, int *csz)
#define __unused
Declare a variable or data structure as unused.
u16 hw_value
Hardware channel value.
static __always_inline unsigned long virt_to_bus(volatile const void *addr)
Convert virtual address to a bus address.
u8 hwaddr[ETH_ALEN]
Default hardware MAC address.
u8 maxpower
Maximum allowable transmit power, in dBm.
#define CHAN2G(_freq, _idx)
#define list_add_tail(new, head)
Add a new entry to the tail of a list.
int nr_rates[NET80211_NR_BANDS]
Number of supported rates, indexed by band.
void writel(uint32_t data, volatile uint32_t *io_addr)
Write 32-bit dword to memory-mapped device.
static struct ath_regulatory * ath9k_hw_regulatory(struct ath_hw *ah)
struct net80211_device_operations ath9k_ops
void(* hw_pll_work)(struct ath_softc *sc)
const struct ath_bus_ops * bus_ops
#define ATH_RSSI_DUMMY_MARKER
#define NET80211_BAND_5GHZ
The band from 4.9 GHz to 5.7 GHz, which tends to be more restricted.
static void ath9k_iowrite32(void *hw_priv, u32 val, u32 reg_offset)
static void(* free)(struct refcnt *refcnt))
void ath9k_hw_deinit(struct ath_hw *ah)
void * zalloc(size_t size)
Allocate cleared memory.
u8 band
The band with which this channel is associated.
Structure encapsulating the complete state of an 802.11 device.
#define ATH9K_NUM_TX_QUEUES
static void ath9k_hw_set_diversity(struct ath_hw *ah, int value)
static struct ath_common * ath9k_hw_common(struct ath_hw *ah)
struct net80211_hw_info * hwinfo
#define NET80211_MODE_B
802.11b: 1-11 Mbps operation using DSSS/CCK signaling on the 2.4GHz band
struct ib_cm_common common
void ath_rx_cleanup(struct ath_softc *sc)
static int ath9k_init_channels_rates(struct ath_softc *sc)
static struct ath9k_legacy_rate ath9k_legacy_rates[]
void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit, int test)
#define INIT_LIST_HEAD(list)
Initialise a list head.
struct ath9k_hw_capabilities caps
int ath9k_hw_init(struct ath_hw *ah)
#define NET80211_BAND_BIT_2GHZ
Bitmask for the 2GHz band.
int nr_channels
Number of supported channels.
#define RATE(_bitrate, _hw_rate, _flags)
enum net80211_hw_info::@629 flags
A set of flags indicating peculiarities of this device.
int ath_tx_init(struct ath_softc *sc, int nbufs)
void ath_hw_pll_work(struct ath_softc *sc)
int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid, const struct ath_bus_ops *bus_ops)
static void free_phys(void *ptr, size_t size)
Free memory allocated with malloc_phys()
void(* intr_tq)(struct ath_softc *sc)
int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd, struct list_head *head, const char *name, int nbuf, int ndesc, int is_tx)
void ath9k_deinit_device(struct ath_softc *sc)
static unsigned int ath9k_ioread32(void *hw_priv, u32 reg_offset)
static int ath9k_init_queues(struct ath_softc *sc)
struct ath9k_legacy_rate rates[NET80211_MAX_RATES]
int bands
A bitwise OR of the bands on which this device can communicate.
static void ath9k_deinit_softc(struct ath_softc *sc)
static void ath9k_init_band_txpower(struct ath_softc *sc, int band)
#define DBG(...)
Print a debugging message.
struct ath_txq * txq_map[WME_NUM_AC]
int ath_rx_init(struct ath_softc *sc, int nbufs)
#define NULL
NULL pointer (VOID *)
struct ath_txq * ath_txq_setup(struct ath_softc *sc, int qtype, int subtype)
unsigned channel_change_time
Estimate of the time required to change channels, in microseconds.
#define NET80211_MODE_G
802.11g: 54 Mbps operation using ERP/OFDM signaling on the 2.4GHz band
struct ath_buf * dd_bufptr
int net80211_register(struct net80211_device *dev, struct net80211_device_operations *ops, struct net80211_hw_info *hw)
Register 802.11 device with network stack.
#define NET80211_MODE_A
802.11a: 54 Mbps operation using OFDM signaling on the 5GHz band
static void ath9k_init_txpower_limits(struct ath_softc *sc)
void * memset(void *dest, int character, size_t len) __nonnull