#ifndef RT2X00_H
#define RT2X00_H
#include <linux/bitops.h>
#include <linux/interrupt.h>
#include <linux/skbuff.h>
#include <linux/workqueue.h>
#include <linux/firmware.h>
#include <linux/leds.h>
#include <linux/mutex.h>
#include <linux/etherdevice.h>
#include <linux/kfifo.h>
#include <linux/hrtimer.h>
#include <linux/average.h>
#include <linux/usb.h>
#include <linux/clk.h>
#include <net/mac80211.h>
#include "rt2x00debug.h"
#include "rt2x00dump.h"
#include "rt2x00leds.h"
#include "rt2x00reg.h"
#include "rt2x00queue.h"
#define DRV_VERSION …
#define DRV_PROJECT …
#ifdef CONFIG_RT2X00_DEBUG
#define DEBUG
#endif
#define rt2x00_probe_err(fmt, ...) …
#define rt2x00_err(dev, fmt, ...) …
#define rt2x00_warn(dev, fmt, ...) …
#define rt2x00_info(dev, fmt, ...) …
#define rt2x00_dbg(dev, fmt, ...) …
#define rt2x00_eeprom_dbg(dev, fmt, ...) …
#define GET_DURATION(__size, __rate) …
#define GET_DURATION_RES(__size, __rate) …
#define L2PAD_SIZE(__hdrlen) …
#define ALIGN_SIZE(__skb, __header) …
#define RT2X00_ALIGN_SIZE …
#define RT2X00_L2PAD_SIZE …
#define ACK_SIZE …
#define IEEE80211_HEADER …
#define PLCP …
#define BEACON …
#define PREAMBLE …
#define SHORT_PREAMBLE …
#define SLOT_TIME …
#define SHORT_SLOT_TIME …
#define SIFS …
#define PIFS …
#define SHORT_PIFS …
#define DIFS …
#define SHORT_DIFS …
#define EIFS …
#define SHORT_EIFS …
enum rt2x00_chip_intf { … };
struct rt2x00_chip { … };
struct rf_channel { … };
struct rt2x00_chan_survey { … };
struct channel_info { … };
struct antenna_setup { … };
struct link_qual { … };
DECLARE_EWMA(rssi, 10, 8)
struct link_ant { … };
struct link { … };
enum rt2x00_delayed_flags { … };
struct rt2x00_intf { … };
static inline struct rt2x00_intf* vif_to_intf(struct ieee80211_vif *vif)
{ … }
struct hw_mode_spec { … };
struct rt2x00lib_conf { … };
struct rt2x00lib_erp { … };
struct rt2x00lib_crypto { … };
struct rt2x00intf_conf { … };
struct rt2x00_sta { … };
static inline struct rt2x00_sta* sta_to_rt2x00_sta(struct ieee80211_sta *sta)
{ … }
struct rt2x00lib_ops { … };
struct rt2x00_ops { … };
enum rt2x00_state_flags { … };
enum rt2x00_capability_flags { … };
enum { … };
struct rt2x00_dev { … };
struct rt2x00_bar_list_entry { … };
#define REGISTER_BUSY_COUNT …
#define REGISTER_USB_BUSY_COUNT …
#define REGISTER_BUSY_DELAY …
static inline u32 rt2x00_rf_read(struct rt2x00_dev *rt2x00dev,
const unsigned int word)
{ … }
static inline void rt2x00_rf_write(struct rt2x00_dev *rt2x00dev,
const unsigned int word, u32 data)
{ … }
static inline void *rt2x00_eeprom_addr(struct rt2x00_dev *rt2x00dev,
const unsigned int word)
{ … }
static inline u16 rt2x00_eeprom_read(struct rt2x00_dev *rt2x00dev,
const unsigned int word)
{ … }
static inline void rt2x00_eeprom_write(struct rt2x00_dev *rt2x00dev,
const unsigned int word, u16 data)
{ … }
static inline u8 rt2x00_eeprom_byte(struct rt2x00_dev *rt2x00dev,
const unsigned int byte)
{ … }
static inline void rt2x00_set_chip(struct rt2x00_dev *rt2x00dev,
const u16 rt, const u16 rf, const u16 rev)
{ … }
static inline void rt2x00_set_rt(struct rt2x00_dev *rt2x00dev,
const u16 rt, const u16 rev)
{ … }
static inline void rt2x00_set_rf(struct rt2x00_dev *rt2x00dev, const u16 rf)
{ … }
static inline bool rt2x00_rt(struct rt2x00_dev *rt2x00dev, const u16 rt)
{ … }
static inline bool rt2x00_rf(struct rt2x00_dev *rt2x00dev, const u16 rf)
{ … }
static inline u16 rt2x00_rev(struct rt2x00_dev *rt2x00dev)
{ … }
static inline bool rt2x00_rt_rev(struct rt2x00_dev *rt2x00dev,
const u16 rt, const u16 rev)
{ … }
static inline bool rt2x00_rt_rev_lt(struct rt2x00_dev *rt2x00dev,
const u16 rt, const u16 rev)
{ … }
static inline bool rt2x00_rt_rev_gte(struct rt2x00_dev *rt2x00dev,
const u16 rt, const u16 rev)
{ … }
static inline void rt2x00_set_chip_intf(struct rt2x00_dev *rt2x00dev,
enum rt2x00_chip_intf intf)
{ … }
static inline bool rt2x00_intf(struct rt2x00_dev *rt2x00dev,
enum rt2x00_chip_intf intf)
{ … }
static inline bool rt2x00_is_pci(struct rt2x00_dev *rt2x00dev)
{ … }
static inline bool rt2x00_is_pcie(struct rt2x00_dev *rt2x00dev)
{ … }
static inline bool rt2x00_is_usb(struct rt2x00_dev *rt2x00dev)
{ … }
static inline bool rt2x00_is_soc(struct rt2x00_dev *rt2x00dev)
{ … }
static inline bool
rt2x00_has_cap_flag(struct rt2x00_dev *rt2x00dev,
enum rt2x00_capability_flags cap_flag)
{ … }
static inline bool
rt2x00_has_cap_hw_crypto(struct rt2x00_dev *rt2x00dev)
{ … }
static inline bool
rt2x00_has_cap_power_limit(struct rt2x00_dev *rt2x00dev)
{ … }
static inline bool
rt2x00_has_cap_control_filters(struct rt2x00_dev *rt2x00dev)
{ … }
static inline bool
rt2x00_has_cap_control_filter_pspoll(struct rt2x00_dev *rt2x00dev)
{ … }
static inline bool
rt2x00_has_cap_pre_tbtt_interrupt(struct rt2x00_dev *rt2x00dev)
{ … }
static inline bool
rt2x00_has_cap_link_tuning(struct rt2x00_dev *rt2x00dev)
{ … }
static inline bool
rt2x00_has_cap_frame_type(struct rt2x00_dev *rt2x00dev)
{ … }
static inline bool
rt2x00_has_cap_rf_sequence(struct rt2x00_dev *rt2x00dev)
{ … }
static inline bool
rt2x00_has_cap_external_lna_a(struct rt2x00_dev *rt2x00dev)
{ … }
static inline bool
rt2x00_has_cap_external_lna_bg(struct rt2x00_dev *rt2x00dev)
{ … }
static inline bool
rt2x00_has_cap_external_pa(struct rt2x00_dev *rt2x00dev)
{ … }
static inline bool
rt2x00_has_cap_double_antenna(struct rt2x00_dev *rt2x00dev)
{ … }
static inline bool
rt2x00_has_cap_bt_coexist(struct rt2x00_dev *rt2x00dev)
{ … }
static inline bool
rt2x00_has_cap_vco_recalibration(struct rt2x00_dev *rt2x00dev)
{ … }
static inline bool
rt2x00_has_cap_restart_hw(struct rt2x00_dev *rt2x00dev)
{ … }
int rt2x00queue_map_txskb(struct queue_entry *entry);
void rt2x00queue_unmap_skb(struct queue_entry *entry);
static inline struct data_queue *
rt2x00queue_get_tx_queue(struct rt2x00_dev *rt2x00dev,
enum data_queue_qid queue)
{ … }
struct queue_entry *rt2x00queue_get_entry(struct data_queue *queue,
enum queue_index index);
void rt2x00queue_pause_queue(struct data_queue *queue);
void rt2x00queue_unpause_queue(struct data_queue *queue);
void rt2x00queue_start_queue(struct data_queue *queue);
void rt2x00queue_stop_queue(struct data_queue *queue);
void rt2x00queue_flush_queue(struct data_queue *queue, bool drop);
void rt2x00queue_start_queues(struct rt2x00_dev *rt2x00dev);
void rt2x00queue_stop_queues(struct rt2x00_dev *rt2x00dev);
void rt2x00queue_flush_queues(struct rt2x00_dev *rt2x00dev, bool drop);
#ifdef CONFIG_RT2X00_LIB_DEBUGFS
void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev,
enum rt2x00_dump_type type, struct queue_entry *entry);
#else
static inline void rt2x00debug_dump_frame(struct rt2x00_dev *rt2x00dev,
enum rt2x00_dump_type type,
struct queue_entry *entry)
{
}
#endif
u32 rt2x00lib_get_bssidx(struct rt2x00_dev *rt2x00dev,
struct ieee80211_vif *vif);
void rt2x00lib_set_mac_address(struct rt2x00_dev *rt2x00dev, u8 *eeprom_mac_addr);
void rt2x00lib_beacondone(struct rt2x00_dev *rt2x00dev);
void rt2x00lib_pretbtt(struct rt2x00_dev *rt2x00dev);
void rt2x00lib_dmastart(struct queue_entry *entry);
void rt2x00lib_dmadone(struct queue_entry *entry);
void rt2x00lib_txdone(struct queue_entry *entry,
struct txdone_entry_desc *txdesc);
void rt2x00lib_txdone_nomatch(struct queue_entry *entry,
struct txdone_entry_desc *txdesc);
void rt2x00lib_txdone_noinfo(struct queue_entry *entry, u32 status);
void rt2x00lib_rxdone(struct queue_entry *entry, gfp_t gfp);
void rt2x00mac_tx(struct ieee80211_hw *hw,
struct ieee80211_tx_control *control,
struct sk_buff *skb);
int rt2x00mac_start(struct ieee80211_hw *hw);
void rt2x00mac_stop(struct ieee80211_hw *hw, bool suspend);
void rt2x00mac_reconfig_complete(struct ieee80211_hw *hw,
enum ieee80211_reconfig_type reconfig_type);
int rt2x00mac_add_interface(struct ieee80211_hw *hw,
struct ieee80211_vif *vif);
void rt2x00mac_remove_interface(struct ieee80211_hw *hw,
struct ieee80211_vif *vif);
int rt2x00mac_config(struct ieee80211_hw *hw, u32 changed);
void rt2x00mac_configure_filter(struct ieee80211_hw *hw,
unsigned int changed_flags,
unsigned int *total_flags,
u64 multicast);
int rt2x00mac_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
bool set);
#ifdef CONFIG_RT2X00_LIB_CRYPTO
int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
struct ieee80211_vif *vif, struct ieee80211_sta *sta,
struct ieee80211_key_conf *key);
#else
#define rt2x00mac_set_key …
#endif
void rt2x00mac_sw_scan_start(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
const u8 *mac_addr);
void rt2x00mac_sw_scan_complete(struct ieee80211_hw *hw,
struct ieee80211_vif *vif);
int rt2x00mac_get_stats(struct ieee80211_hw *hw,
struct ieee80211_low_level_stats *stats);
void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_bss_conf *bss_conf,
u64 changes);
int rt2x00mac_conf_tx(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
unsigned int link_id, u16 queue,
const struct ieee80211_tx_queue_params *params);
void rt2x00mac_rfkill_poll(struct ieee80211_hw *hw);
void rt2x00mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u32 queues, bool drop);
int rt2x00mac_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant);
int rt2x00mac_get_antenna(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant);
void rt2x00mac_get_ringparam(struct ieee80211_hw *hw,
u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max);
bool rt2x00mac_tx_frames_pending(struct ieee80211_hw *hw);
int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev);
void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev);
int rt2x00lib_suspend(struct rt2x00_dev *rt2x00dev);
int rt2x00lib_resume(struct rt2x00_dev *rt2x00dev);
#endif