linux/drivers/net/wireless/marvell/mwl8k.c

/*
 * drivers/net/wireless/mwl8k.c
 * Driver for Marvell TOPDOG 802.11 Wireless cards
 *
 * Copyright (C) 2008, 2009, 2010 Marvell Semiconductor Inc.
 *
 * This file is licensed under the terms of the GNU General Public
 * License version 2.  This program is licensed "as is" without any
 * warranty of any kind, whether express or implied.
 */

#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/spinlock.h>
#include <linux/list.h>
#include <linux/pci.h>
#include <linux/delay.h>
#include <linux/completion.h>
#include <linux/etherdevice.h>
#include <linux/slab.h>
#include <net/mac80211.h>
#include <linux/moduleparam.h>
#include <linux/firmware.h>
#include <linux/workqueue.h>

#define MWL8K_DESC
#define MWL8K_NAME
#define MWL8K_VERSION

/* Module parameters */
static bool ap_mode_default;
module_param(ap_mode_default, bool, 0);
MODULE_PARM_DESC();

/* Register definitions */
#define MWL8K_HIU_GEN_PTR
#define MWL8K_MODE_STA
#define MWL8K_MODE_AP
#define MWL8K_HIU_INT_CODE
#define MWL8K_FWSTA_READY
#define MWL8K_FWAP_READY
#define MWL8K_INT_CODE_CMD_FINISHED
#define MWL8K_HIU_SCRATCH

/* Host->device communications */
#define MWL8K_HIU_H2A_INTERRUPT_EVENTS
#define MWL8K_HIU_H2A_INTERRUPT_STATUS
#define MWL8K_HIU_H2A_INTERRUPT_MASK
#define MWL8K_HIU_H2A_INTERRUPT_CLEAR_SEL
#define MWL8K_HIU_H2A_INTERRUPT_STATUS_MASK
#define MWL8K_H2A_INT_DUMMY
#define MWL8K_H2A_INT_RESET
#define MWL8K_H2A_INT_DOORBELL
#define MWL8K_H2A_INT_PPA_READY

/* Device->host communications */
#define MWL8K_HIU_A2H_INTERRUPT_EVENTS
#define MWL8K_HIU_A2H_INTERRUPT_STATUS
#define MWL8K_HIU_A2H_INTERRUPT_MASK
#define MWL8K_HIU_A2H_INTERRUPT_CLEAR_SEL
#define MWL8K_HIU_A2H_INTERRUPT_STATUS_MASK
#define MWL8K_A2H_INT_DUMMY
#define MWL8K_A2H_INT_BA_WATCHDOG
#define MWL8K_A2H_INT_CHNL_SWITCHED
#define MWL8K_A2H_INT_QUEUE_EMPTY
#define MWL8K_A2H_INT_RADAR_DETECT
#define MWL8K_A2H_INT_RADIO_ON
#define MWL8K_A2H_INT_RADIO_OFF
#define MWL8K_A2H_INT_MAC_EVENT
#define MWL8K_A2H_INT_OPC_DONE
#define MWL8K_A2H_INT_RX_READY
#define MWL8K_A2H_INT_TX_DONE

/* HW micro second timer register
 * located at offset 0xA600. This
 * will be used to timestamp tx
 * packets.
 */

#define MWL8K_HW_TIMER_REGISTER
#define BBU_RXRDY_CNT_REG
#define NOK_CCA_CNT_REG
#define BBU_AVG_NOISE_VAL

#define MWL8K_A2H_EVENTS

#define MWL8K_RX_QUEUES
#define MWL8K_TX_WMM_QUEUES
#define MWL8K_MAX_AMPDU_QUEUES
#define MWL8K_MAX_TX_QUEUES
#define mwl8k_tx_queues(priv)

/* txpriorities are mapped with hw queues.
 * Each hw queue has a txpriority.
 */
#define TOTAL_HW_TX_QUEUES

/* Each HW queue can have one AMPDU stream.
 * But, because one of the hw queue is reserved,
 * maximum AMPDU queues that can be created are
 * one short of total tx queues.
 */
#define MWL8K_NUM_AMPDU_STREAMS

#define MWL8K_NUM_CHANS

struct rxd_ops {};

struct mwl8k_device_info {};

struct mwl8k_rx_queue {};

struct mwl8k_tx_queue {};

enum {};

struct mwl8k_ampdu_stream {};

struct mwl8k_priv {};

#define MAX_WEP_KEY_LEN
#define NUM_WEP_KEYS

/* Per interface specific private data */
struct mwl8k_vif {};
#define MWL8K_VIF(_vif)
#define IEEE80211_KEY_CONF(_u8)

struct tx_traffic_info {};

#define MWL8K_MAX_TID
struct mwl8k_sta {};
#define MWL8K_STA(_sta)

static const struct ieee80211_channel mwl8k_channels_24[] =;

static const struct ieee80211_rate mwl8k_rates_24[] =;

static const struct ieee80211_channel mwl8k_channels_50[] =;

static const struct ieee80211_rate mwl8k_rates_50[] =;

/* Set or get info from Firmware */
#define MWL8K_CMD_GET
#define MWL8K_CMD_SET
#define MWL8K_CMD_SET_LIST

/* Firmware command codes */
#define MWL8K_CMD_CODE_DNLD
#define MWL8K_CMD_GET_HW_SPEC
#define MWL8K_CMD_SET_HW_SPEC
#define MWL8K_CMD_MAC_MULTICAST_ADR
#define MWL8K_CMD_GET_STAT
#define MWL8K_CMD_BBP_REG_ACCESS
#define MWL8K_CMD_RADIO_CONTROL
#define MWL8K_CMD_RF_TX_POWER
#define MWL8K_CMD_TX_POWER
#define MWL8K_CMD_RF_ANTENNA
#define MWL8K_CMD_SET_BEACON
#define MWL8K_CMD_SET_PRE_SCAN
#define MWL8K_CMD_SET_POST_SCAN
#define MWL8K_CMD_SET_RF_CHANNEL
#define MWL8K_CMD_SET_AID
#define MWL8K_CMD_SET_RATE
#define MWL8K_CMD_SET_FINALIZE_JOIN
#define MWL8K_CMD_RTS_THRESHOLD
#define MWL8K_CMD_SET_SLOT
#define MWL8K_CMD_SET_EDCA_PARAMS
#define MWL8K_CMD_SET_WMM_MODE
#define MWL8K_CMD_MIMO_CONFIG
#define MWL8K_CMD_USE_FIXED_RATE
#define MWL8K_CMD_ENABLE_SNIFFER
#define MWL8K_CMD_SET_MAC_ADDR
#define MWL8K_CMD_SET_RATEADAPT_MODE
#define MWL8K_CMD_GET_WATCHDOG_BITMAP
#define MWL8K_CMD_DEL_MAC_ADDR
#define MWL8K_CMD_BSS_START
#define MWL8K_CMD_SET_NEW_STN
#define MWL8K_CMD_UPDATE_ENCRYPTION
#define MWL8K_CMD_UPDATE_STADB
#define MWL8K_CMD_BASTREAM

#define MWL8K_LEGACY_5G_RATE_OFFSET

static const char *mwl8k_cmd_name(__le16 cmd, char *buf, int bufsize)
{}

/* Hardware and firmware reset */
static void mwl8k_hw_reset(struct mwl8k_priv *priv)
{}

/* Release fw image */
static void mwl8k_release_fw(const struct firmware **fw)
{}

static void mwl8k_release_firmware(struct mwl8k_priv *priv)
{}

/* states for asynchronous f/w loading */
static void mwl8k_fw_state_machine(const struct firmware *fw, void *context);
enum {};

/* Request fw image */
static int mwl8k_request_fw(struct mwl8k_priv *priv,
			    const char *fname, const struct firmware **fw,
			    bool nowait)
{}

static int mwl8k_request_firmware(struct mwl8k_priv *priv, char *fw_image,
				  bool nowait)
{}

struct mwl8k_cmd_pkt {} __packed;

/*
 * Firmware loading.
 */
static int
mwl8k_send_fw_load_cmd(struct mwl8k_priv *priv, void *data, int length)
{}

static int mwl8k_load_fw_image(struct mwl8k_priv *priv,
				const u8 *data, size_t length)
{}

static int mwl8k_feed_fw_image(struct mwl8k_priv *priv,
				const u8 *data, size_t length)
{}

static int mwl8k_load_firmware(struct ieee80211_hw *hw)
{}


/* DMA header used by firmware and hardware.  */
struct mwl8k_dma_data {} __packed __aligned();

/* Routines to add/remove DMA header from skb.  */
static inline void mwl8k_remove_dma_header(struct sk_buff *skb, __le16 qos)
{}

#define REDUCED_TX_HEADROOM

static void
mwl8k_add_dma_header(struct mwl8k_priv *priv, struct sk_buff *skb,
						int head_pad, int tail_pad)
{}

static void mwl8k_encapsulate_tx_frame(struct mwl8k_priv *priv,
		struct sk_buff *skb)
{}

/*
 * Packet reception for 88w8366/88w8764 AP firmware.
 */
struct mwl8k_rxd_ap {} __packed;

#define MWL8K_AP_RATE_INFO_MCS_FORMAT
#define MWL8K_AP_RATE_INFO_40MHZ
#define MWL8K_AP_RATE_INFO_RATEID(x)

#define MWL8K_AP_RX_CTRL_OWNED_BY_HOST

/* 8366/8764 AP rx_status bits */
#define MWL8K_AP_RXSTAT_DECRYPT_ERR_MASK
#define MWL8K_AP_RXSTAT_GENERAL_DECRYPT_ERR
#define MWL8K_AP_RXSTAT_TKIP_DECRYPT_MIC_ERR
#define MWL8K_AP_RXSTAT_WEP_DECRYPT_ICV_ERR
#define MWL8K_AP_RXSTAT_TKIP_DECRYPT_ICV_ERR

static void mwl8k_rxd_ap_init(void *_rxd, dma_addr_t next_dma_addr)
{}

static void mwl8k_rxd_ap_refill(void *_rxd, dma_addr_t addr, int len)
{}

static int
mwl8k_rxd_ap_process(void *_rxd, struct ieee80211_rx_status *status,
		     __le16 *qos, s8 *noise)
{}

static struct rxd_ops rxd_ap_ops =;

/*
 * Packet reception for STA firmware.
 */
struct mwl8k_rxd_sta {} __packed;

#define MWL8K_STA_RATE_INFO_SHORTPRE
#define MWL8K_STA_RATE_INFO_ANTSELECT(x)
#define MWL8K_STA_RATE_INFO_RATEID(x)
#define MWL8K_STA_RATE_INFO_40MHZ
#define MWL8K_STA_RATE_INFO_SHORTGI
#define MWL8K_STA_RATE_INFO_MCS_FORMAT

#define MWL8K_STA_RX_CTRL_OWNED_BY_HOST
#define MWL8K_STA_RX_CTRL_DECRYPT_ERROR
/* ICV=0 or MIC=1 */
#define MWL8K_STA_RX_CTRL_DEC_ERR_TYPE
/* Key is uploaded only in failure case */
#define MWL8K_STA_RX_CTRL_KEY_INDEX

static void mwl8k_rxd_sta_init(void *_rxd, dma_addr_t next_dma_addr)
{}

static void mwl8k_rxd_sta_refill(void *_rxd, dma_addr_t addr, int len)
{}

static int
mwl8k_rxd_sta_process(void *_rxd, struct ieee80211_rx_status *status,
		       __le16 *qos, s8 *noise)
{}

static struct rxd_ops rxd_sta_ops =;


#define MWL8K_RX_DESCS
#define MWL8K_RX_MAXSZ

static int mwl8k_rxq_init(struct ieee80211_hw *hw, int index)
{}

static int rxq_refill(struct ieee80211_hw *hw, int index, int limit)
{}

/* Must be called only when the card's reception is completely halted */
static void mwl8k_rxq_deinit(struct ieee80211_hw *hw, int index)
{}


/*
 * Scan a list of BSSIDs to process for finalize join.
 * Allows for extension to process multiple BSSIDs.
 */
static inline int
mwl8k_capture_bssid(struct mwl8k_priv *priv, struct ieee80211_hdr *wh)
{}

static inline void mwl8k_save_beacon(struct ieee80211_hw *hw,
				     struct sk_buff *skb)
{}

static inline struct mwl8k_vif *mwl8k_find_vif_bss(struct list_head *vif_list,
						   u8 *bssid)
{}

static int rxq_process(struct ieee80211_hw *hw, int index, int limit)
{}


/*
 * Packet transmission.
 */

#define MWL8K_TXD_STATUS_OK
#define MWL8K_TXD_STATUS_OK_RETRY
#define MWL8K_TXD_STATUS_OK_MORE_RETRY
#define MWL8K_TXD_STATUS_MULTICAST_TX
#define MWL8K_TXD_STATUS_FW_OWNED

#define MWL8K_QOS_QLEN_UNSPEC
#define MWL8K_QOS_ACK_POLICY_MASK
#define MWL8K_QOS_ACK_POLICY_NORMAL
#define MWL8K_QOS_ACK_POLICY_BLOCKACK
#define MWL8K_QOS_EOSP

struct mwl8k_tx_desc {} __packed;

#define MWL8K_TX_DESCS

static int mwl8k_txq_init(struct ieee80211_hw *hw, int index)
{}

static inline void mwl8k_tx_start(struct mwl8k_priv *priv)
{}

static void mwl8k_dump_tx_rings(struct ieee80211_hw *hw)
{}

/*
 * Must be called with priv->fw_mutex held and tx queues stopped.
 */
#define MWL8K_TX_WAIT_TIMEOUT_MS

static int mwl8k_tx_wait_empty(struct ieee80211_hw *hw)
{}

#define MWL8K_TXD_SUCCESS(status)

static int mwl8k_tid_queue_mapping(u8 tid)
{}

/* The firmware will fill in the rate information
 * for each packet that gets queued in the hardware
 * and these macros will interpret that info.
 */

#define RI_FORMAT(a)
#define RI_RATE_ID_MCS(a)

static int
mwl8k_txq_reclaim(struct ieee80211_hw *hw, int index, int limit, int force)
{}

/* must be called only when the card's transmit is completely halted */
static void mwl8k_txq_deinit(struct ieee80211_hw *hw, int index)
{}

/* caller must hold priv->stream_lock when calling the stream functions */
static struct mwl8k_ampdu_stream *
mwl8k_add_stream(struct ieee80211_hw *hw, struct ieee80211_sta *sta, u8 tid)
{}

static int
mwl8k_start_stream(struct ieee80211_hw *hw, struct mwl8k_ampdu_stream *stream)
{}

static void
mwl8k_remove_stream(struct ieee80211_hw *hw, struct mwl8k_ampdu_stream *stream)
{}

static struct mwl8k_ampdu_stream *
mwl8k_lookup_stream(struct ieee80211_hw *hw, u8 *addr, u8 tid)
{}

#define MWL8K_AMPDU_PACKET_THRESHOLD
static inline bool mwl8k_ampdu_allowed(struct ieee80211_sta *sta, u8 tid)
{}

static inline void mwl8k_tx_count_packet(struct ieee80211_sta *sta, u8 tid)
{}

/* The hardware ampdu queues start from 5.
 * txpriorities for ampdu queues are
 * 5 6 7 0 1 2 3 4 ie., queue 5 is highest
 * and queue 3 is lowest (queue 4 is reserved)
 */
#define BA_QUEUE

static void
mwl8k_txq_xmit(struct ieee80211_hw *hw,
	       int index,
	       struct ieee80211_sta *sta,
	       struct sk_buff *skb)
{}


/*
 * Firmware access.
 *
 * We have the following requirements for issuing firmware commands:
 * - Some commands require that the packet transmit path is idle when
 *   the command is issued.  (For simplicity, we'll just quiesce the
 *   transmit path for every command.)
 * - There are certain sequences of commands that need to be issued to
 *   the hardware sequentially, with no other intervening commands.
 *
 * This leads to an implementation of a "firmware lock" as a mutex that
 * can be taken recursively, and which is taken by both the low-level
 * command submission function (mwl8k_post_cmd) as well as any users of
 * that function that require issuing of an atomic sequence of commands,
 * and quiesces the transmit path whenever it's taken.
 */
static int mwl8k_fw_lock(struct ieee80211_hw *hw)
{}

static void mwl8k_fw_unlock(struct ieee80211_hw *hw)
{}

static void mwl8k_enable_bsses(struct ieee80211_hw *hw, bool enable,
			       u32 bitmap);

/*
 * Command processing.
 */

/* Timeout firmware commands after 10s */
#define MWL8K_CMD_TIMEOUT_MS

static int mwl8k_post_cmd(struct ieee80211_hw *hw, struct mwl8k_cmd_pkt_hdr *cmd)
{}

static int mwl8k_post_pervif_cmd(struct ieee80211_hw *hw,
				 struct ieee80211_vif *vif,
				 struct mwl8k_cmd_pkt_hdr *cmd)
{}

/*
 * Setup code shared between STA and AP firmware images.
 */
static void mwl8k_setup_2ghz_band(struct ieee80211_hw *hw)
{}

static void mwl8k_setup_5ghz_band(struct ieee80211_hw *hw)
{}

/*
 * CMD_GET_HW_SPEC (STA version).
 */
struct mwl8k_cmd_get_hw_spec_sta {} __packed;

#define MWL8K_CAP_MAX_AMSDU
#define MWL8K_CAP_GREENFIELD
#define MWL8K_CAP_AMPDU
#define MWL8K_CAP_RX_STBC
#define MWL8K_CAP_TX_STBC
#define MWL8K_CAP_SHORTGI_40MHZ
#define MWL8K_CAP_SHORTGI_20MHZ
#define MWL8K_CAP_RX_ANTENNA_MASK
#define MWL8K_CAP_TX_ANTENNA_MASK
#define MWL8K_CAP_DELAY_BA
#define MWL8K_CAP_MIMO
#define MWL8K_CAP_40MHZ
#define MWL8K_CAP_BAND_MASK
#define MWL8K_CAP_5GHZ
#define MWL8K_CAP_2GHZ4

static void
mwl8k_set_ht_caps(struct ieee80211_hw *hw,
		  struct ieee80211_supported_band *band, u32 cap)
{}

static void
mwl8k_set_caps(struct ieee80211_hw *hw, u32 caps)
{}

static int mwl8k_cmd_get_hw_spec_sta(struct ieee80211_hw *hw)
{}

/*
 * CMD_GET_HW_SPEC (AP version).
 */
struct mwl8k_cmd_get_hw_spec_ap {} __packed;

static int mwl8k_cmd_get_hw_spec_ap(struct ieee80211_hw *hw)
{}

/*
 * CMD_SET_HW_SPEC.
 */
struct mwl8k_cmd_set_hw_spec {} __packed;

/* If enabled, MWL8K_SET_HW_SPEC_FLAG_ENABLE_LIFE_TIME_EXPIRY will cause
 * packets to expire 500 ms after the timestamp in the tx descriptor.  That is,
 * the packets that are queued for more than 500ms, will be dropped in the
 * hardware. This helps minimizing the issues caused due to head-of-line
 * blocking where a slow client can hog the bandwidth and affect traffic to a
 * faster client.
 */
#define MWL8K_SET_HW_SPEC_FLAG_ENABLE_LIFE_TIME_EXPIRY
#define MWL8K_SET_HW_SPEC_FLAG_GENERATE_CCMP_HDR
#define MWL8K_SET_HW_SPEC_FLAG_HOST_DECR_MGMT
#define MWL8K_SET_HW_SPEC_FLAG_HOSTFORM_PROBERESP
#define MWL8K_SET_HW_SPEC_FLAG_HOSTFORM_BEACON

static int mwl8k_cmd_set_hw_spec(struct ieee80211_hw *hw)
{}

/*
 * CMD_MAC_MULTICAST_ADR.
 */
struct mwl8k_cmd_mac_multicast_adr {};

#define MWL8K_ENABLE_RX_DIRECTED
#define MWL8K_ENABLE_RX_MULTICAST
#define MWL8K_ENABLE_RX_ALL_MULTICAST
#define MWL8K_ENABLE_RX_BROADCAST

static struct mwl8k_cmd_pkt_hdr *
__mwl8k_cmd_mac_multicast_adr(struct ieee80211_hw *hw, int allmulti,
			      struct netdev_hw_addr_list *mc_list)
{}

/*
 * CMD_GET_STAT.
 */
struct mwl8k_cmd_get_stat {} __packed;

#define MWL8K_STAT_ACK_FAILURE
#define MWL8K_STAT_RTS_FAILURE
#define MWL8K_STAT_FCS_ERROR
#define MWL8K_STAT_RTS_SUCCESS

static int mwl8k_cmd_get_stat(struct ieee80211_hw *hw,
			      struct ieee80211_low_level_stats *stats)
{}

/*
 * CMD_RADIO_CONTROL.
 */
struct mwl8k_cmd_radio_control {} __packed;

static int
mwl8k_cmd_radio_control(struct ieee80211_hw *hw, bool enable, bool force)
{}

static int mwl8k_cmd_radio_disable(struct ieee80211_hw *hw)
{}

static int mwl8k_cmd_radio_enable(struct ieee80211_hw *hw)
{}

static int
mwl8k_set_radio_preamble(struct ieee80211_hw *hw, bool short_preamble)
{}

/*
 * CMD_RF_TX_POWER.
 */
#define MWL8K_RF_TX_POWER_LEVEL_TOTAL

struct mwl8k_cmd_rf_tx_power {} __packed;

static int mwl8k_cmd_rf_tx_power(struct ieee80211_hw *hw, int dBm)
{}

/*
 * CMD_TX_POWER.
 */
#define MWL8K_TX_POWER_LEVEL_TOTAL

struct mwl8k_cmd_tx_power {} __packed;

static int mwl8k_cmd_tx_power(struct ieee80211_hw *hw,
				     struct ieee80211_conf *conf,
				     unsigned short pwr)
{}

/*
 * CMD_RF_ANTENNA.
 */
struct mwl8k_cmd_rf_antenna {} __packed;

#define MWL8K_RF_ANTENNA_RX
#define MWL8K_RF_ANTENNA_TX

static int
mwl8k_cmd_rf_antenna(struct ieee80211_hw *hw, int antenna, int mask)
{}

/*
 * CMD_SET_BEACON.
 */
struct mwl8k_cmd_set_beacon {};

static int mwl8k_cmd_set_beacon(struct ieee80211_hw *hw,
				struct ieee80211_vif *vif, u8 *beacon, int len)
{}

/*
 * CMD_SET_PRE_SCAN.
 */
struct mwl8k_cmd_set_pre_scan {} __packed;

static int mwl8k_cmd_set_pre_scan(struct ieee80211_hw *hw)
{}

/*
 * CMD_BBP_REG_ACCESS.
 */
struct mwl8k_cmd_bbp_reg_access {} __packed;

static int
mwl8k_cmd_bbp_reg_access(struct ieee80211_hw *hw,
			 u16 action,
			 u16 offset,
			 u8 *value)
{}

/*
 * CMD_SET_POST_SCAN.
 */
struct mwl8k_cmd_set_post_scan {} __packed;

static int
mwl8k_cmd_set_post_scan(struct ieee80211_hw *hw, const __u8 *mac)
{}

static int freq_to_idx(struct mwl8k_priv *priv, int freq)
{}

static void mwl8k_update_survey(struct mwl8k_priv *priv,
				struct ieee80211_channel *channel)
{}

/*
 * CMD_SET_RF_CHANNEL.
 */
struct mwl8k_cmd_set_rf_channel {} __packed;

static int mwl8k_cmd_set_rf_channel(struct ieee80211_hw *hw,
				    struct ieee80211_conf *conf)
{}

/*
 * CMD_SET_AID.
 */
#define MWL8K_FRAME_PROT_DISABLED
#define MWL8K_FRAME_PROT_11G
#define MWL8K_FRAME_PROT_11N_HT_40MHZ_ONLY
#define MWL8K_FRAME_PROT_11N_HT_ALL

struct mwl8k_cmd_update_set_aid {} __packed;

static void legacy_rate_mask_to_array(u8 *rates, u32 mask)
{}

static int
mwl8k_cmd_set_aid(struct ieee80211_hw *hw,
		  struct ieee80211_vif *vif, u32 legacy_rate_mask)
{}

/*
 * CMD_SET_RATE.
 */
struct mwl8k_cmd_set_rate {} __packed;

static int
mwl8k_cmd_set_rate(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
		   u32 legacy_rate_mask, u8 *mcs_rates)
{}

/*
 * CMD_FINALIZE_JOIN.
 */
#define MWL8K_FJ_BEACON_MAXLEN

struct mwl8k_cmd_finalize_join {} __packed;

static int mwl8k_cmd_finalize_join(struct ieee80211_hw *hw, void *frame,
				   int framelen, int dtim)
{}

/*
 * CMD_SET_RTS_THRESHOLD.
 */
struct mwl8k_cmd_set_rts_threshold {} __packed;

static int
mwl8k_cmd_set_rts_threshold(struct ieee80211_hw *hw, int rts_thresh)
{}

/*
 * CMD_SET_SLOT.
 */
struct mwl8k_cmd_set_slot {} __packed;

static int mwl8k_cmd_set_slot(struct ieee80211_hw *hw, bool short_slot_time)
{}

/*
 * CMD_SET_EDCA_PARAMS.
 */
struct mwl8k_cmd_set_edca_params {} __packed;

#define MWL8K_SET_EDCA_CW
#define MWL8K_SET_EDCA_TXOP
#define MWL8K_SET_EDCA_AIFS

#define MWL8K_SET_EDCA_ALL

static int
mwl8k_cmd_set_edca_params(struct ieee80211_hw *hw, __u8 qnum,
			  __u16 cw_min, __u16 cw_max,
			  __u8 aifs, __u16 txop)
{}

/*
 * CMD_SET_WMM_MODE.
 */
struct mwl8k_cmd_set_wmm_mode {} __packed;

static int mwl8k_cmd_set_wmm_mode(struct ieee80211_hw *hw, bool enable)
{}

/*
 * CMD_MIMO_CONFIG.
 */
struct mwl8k_cmd_mimo_config {} __packed;

static int mwl8k_cmd_mimo_config(struct ieee80211_hw *hw, __u8 rx, __u8 tx)
{}

/*
 * CMD_USE_FIXED_RATE (STA version).
 */
struct mwl8k_cmd_use_fixed_rate_sta {} __packed;

#define MWL8K_USE_AUTO_RATE
#define MWL8K_UCAST_RATE

static int mwl8k_cmd_use_fixed_rate_sta(struct ieee80211_hw *hw)
{}

/*
 * CMD_USE_FIXED_RATE (AP version).
 */
struct mwl8k_cmd_use_fixed_rate_ap {} __packed;

static int
mwl8k_cmd_use_fixed_rate_ap(struct ieee80211_hw *hw, int mcast, int mgmt)
{}

/*
 * CMD_ENABLE_SNIFFER.
 */
struct mwl8k_cmd_enable_sniffer {} __packed;

static int mwl8k_cmd_enable_sniffer(struct ieee80211_hw *hw, bool enable)
{}

struct mwl8k_cmd_update_mac_addr {} __packed;

#define MWL8K_MAC_TYPE_PRIMARY_CLIENT
#define MWL8K_MAC_TYPE_SECONDARY_CLIENT
#define MWL8K_MAC_TYPE_PRIMARY_AP
#define MWL8K_MAC_TYPE_SECONDARY_AP

static int mwl8k_cmd_update_mac_addr(struct ieee80211_hw *hw,
				  struct ieee80211_vif *vif, u8 *mac, bool set)
{}

/*
 * MWL8K_CMD_SET_MAC_ADDR.
 */
static inline int mwl8k_cmd_set_mac_addr(struct ieee80211_hw *hw,
				  struct ieee80211_vif *vif, u8 *mac)
{}

/*
 * MWL8K_CMD_DEL_MAC_ADDR.
 */
static inline int mwl8k_cmd_del_mac_addr(struct ieee80211_hw *hw,
				  struct ieee80211_vif *vif, u8 *mac)
{}

/*
 * CMD_SET_RATEADAPT_MODE.
 */
struct mwl8k_cmd_set_rate_adapt_mode {} __packed;

static int mwl8k_cmd_set_rateadapt_mode(struct ieee80211_hw *hw, __u16 mode)
{}

/*
 * CMD_GET_WATCHDOG_BITMAP.
 */
struct mwl8k_cmd_get_watchdog_bitmap {} __packed;

static int mwl8k_cmd_get_watchdog_bitmap(struct ieee80211_hw *hw, u8 *bitmap)
{}

#define MWL8K_WMM_QUEUE_NUMBER

static void mwl8k_destroy_ba(struct ieee80211_hw *hw,
			     u8 idx);

static void mwl8k_watchdog_ba_events(struct work_struct *work)
{}


/*
 * CMD_BSS_START.
 */
struct mwl8k_cmd_bss_start {} __packed;

static int mwl8k_cmd_bss_start(struct ieee80211_hw *hw,
			       struct ieee80211_vif *vif, int enable)
{}

static void mwl8k_enable_bsses(struct ieee80211_hw *hw, bool enable, u32 bitmap)
{}
/*
 * CMD_BASTREAM.
 */

/*
 * UPSTREAM is tx direction
 */
#define BASTREAM_FLAG_DIRECTION_UPSTREAM
#define BASTREAM_FLAG_IMMEDIATE_TYPE

enum ba_stream_action_type {};


struct mwl8k_create_ba_stream {} __packed;

struct mwl8k_destroy_ba_stream {} __packed;

struct mwl8k_cmd_bastream {} __packed;

static int
mwl8k_check_ba(struct ieee80211_hw *hw, struct mwl8k_ampdu_stream *stream,
	       struct ieee80211_vif *vif)
{}

static int
mwl8k_create_ba(struct ieee80211_hw *hw, struct mwl8k_ampdu_stream *stream,
		u8 buf_size, struct ieee80211_vif *vif)
{}

static void mwl8k_destroy_ba(struct ieee80211_hw *hw,
			     u8 idx)
{}

/*
 * CMD_SET_NEW_STN.
 */
struct mwl8k_cmd_set_new_stn {} __packed;

#define MWL8K_STA_ACTION_ADD
#define MWL8K_STA_ACTION_REMOVE

static int mwl8k_cmd_set_new_stn_add(struct ieee80211_hw *hw,
				     struct ieee80211_vif *vif,
				     struct ieee80211_sta *sta)
{}

static int mwl8k_cmd_set_new_stn_add_self(struct ieee80211_hw *hw,
					  struct ieee80211_vif *vif)
{}

static int mwl8k_cmd_set_new_stn_del(struct ieee80211_hw *hw,
				     struct ieee80211_vif *vif, u8 *addr)
{}

/*
 * CMD_UPDATE_ENCRYPTION.
 */

#define MAX_ENCR_KEY_LENGTH
#define MIC_KEY_LENGTH

struct mwl8k_cmd_update_encryption {} __packed;

struct mwl8k_cmd_set_key {} __packed;

enum {};

#define MWL8K_UPDATE_ENCRYPTION_TYPE_WEP
#define MWL8K_UPDATE_ENCRYPTION_TYPE_DISABLE
#define MWL8K_UPDATE_ENCRYPTION_TYPE_TKIP
#define MWL8K_UPDATE_ENCRYPTION_TYPE_MIXED
#define MWL8K_UPDATE_ENCRYPTION_TYPE_AES

enum {};

#define MWL8K_KEY_FLAG_TXGROUPKEY
#define MWL8K_KEY_FLAG_PAIRWISE
#define MWL8K_KEY_FLAG_TSC_VALID
#define MWL8K_KEY_FLAG_WEP_TXKEY
#define MWL8K_KEY_FLAG_MICKEY_VALID

static int mwl8k_cmd_update_encryption_enable(struct ieee80211_hw *hw,
					      struct ieee80211_vif *vif,
					      u8 *addr,
					      u8 encr_type)
{}

static int mwl8k_encryption_set_cmd_info(struct mwl8k_cmd_set_key *cmd,
						u8 *addr,
						struct ieee80211_key_conf *key)
{}

static int mwl8k_cmd_encryption_set_key(struct ieee80211_hw *hw,
						struct ieee80211_vif *vif,
						u8 *addr,
						struct ieee80211_key_conf *key)
{}

static int mwl8k_cmd_encryption_remove_key(struct ieee80211_hw *hw,
						struct ieee80211_vif *vif,
						u8 *addr,
						struct ieee80211_key_conf *key)
{}

static int mwl8k_set_key(struct ieee80211_hw *hw,
			 enum set_key_cmd cmd_param,
			 struct ieee80211_vif *vif,
			 struct ieee80211_sta *sta,
			 struct ieee80211_key_conf *key)
{}

/*
 * CMD_UPDATE_STADB.
 */
struct ewc_ht_info {} __packed;

struct peer_capability_info {} __packed;

struct mwl8k_cmd_update_stadb {} __packed;

#define MWL8K_STA_DB_MODIFY_ENTRY
#define MWL8K_STA_DB_DEL_ENTRY

/* Peer Entry flags - used to define the type of the peer node */
#define MWL8K_PEER_TYPE_ACCESSPOINT

static int mwl8k_cmd_update_stadb_add(struct ieee80211_hw *hw,
				      struct ieee80211_vif *vif,
				      struct ieee80211_sta *sta)
{}

static int mwl8k_cmd_update_stadb_del(struct ieee80211_hw *hw,
				      struct ieee80211_vif *vif, u8 *addr)
{}


/*
 * Interrupt handling.
 */
static irqreturn_t mwl8k_interrupt(int irq, void *dev_id)
{}

static void mwl8k_tx_poll(struct tasklet_struct *t)
{}

static void mwl8k_rx_poll(struct tasklet_struct *t)
{}


/*
 * Core driver operations.
 */
static void mwl8k_tx(struct ieee80211_hw *hw,
		     struct ieee80211_tx_control *control,
		     struct sk_buff *skb)
{}

static int mwl8k_start(struct ieee80211_hw *hw)
{}

static void mwl8k_stop(struct ieee80211_hw *hw, bool suspend)
{}

static int mwl8k_reload_firmware(struct ieee80211_hw *hw, char *fw_image);

static int mwl8k_add_interface(struct ieee80211_hw *hw,
			       struct ieee80211_vif *vif)
{}

static void mwl8k_remove_vif(struct mwl8k_priv *priv, struct mwl8k_vif *vif)
{}

static void mwl8k_remove_interface(struct ieee80211_hw *hw,
				   struct ieee80211_vif *vif)
{}

static void mwl8k_hw_restart_work(struct work_struct *work)
{}

static int mwl8k_config(struct ieee80211_hw *hw, u32 changed)
{}

static void
mwl8k_bss_info_changed_sta(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
			   struct ieee80211_bss_conf *info, u32 changed)
{}

static void
mwl8k_bss_info_changed_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
			  struct ieee80211_bss_conf *info, u32 changed)
{}

static void
mwl8k_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
		       struct ieee80211_bss_conf *info, u64 changed)
{}

static u64 mwl8k_prepare_multicast(struct ieee80211_hw *hw,
				   struct netdev_hw_addr_list *mc_list)
{}

static int
mwl8k_configure_filter_sniffer(struct ieee80211_hw *hw,
			       unsigned int changed_flags,
			       unsigned int *total_flags)
{}

static struct mwl8k_vif *mwl8k_first_vif(struct mwl8k_priv *priv)
{}

static void mwl8k_configure_filter(struct ieee80211_hw *hw,
				   unsigned int changed_flags,
				   unsigned int *total_flags,
				   u64 multicast)
{}

static int mwl8k_set_rts_threshold(struct ieee80211_hw *hw, u32 value)
{}

static int mwl8k_sta_remove(struct ieee80211_hw *hw,
			    struct ieee80211_vif *vif,
			    struct ieee80211_sta *sta)
{}

static int mwl8k_sta_add(struct ieee80211_hw *hw,
			 struct ieee80211_vif *vif,
			 struct ieee80211_sta *sta)
{}

static int mwl8k_conf_tx(struct ieee80211_hw *hw,
			 struct ieee80211_vif *vif,
			 unsigned int link_id, u16 queue,
			 const struct ieee80211_tx_queue_params *params)
{}

static int mwl8k_get_stats(struct ieee80211_hw *hw,
			   struct ieee80211_low_level_stats *stats)
{}

static int mwl8k_get_survey(struct ieee80211_hw *hw, int idx,
				struct survey_info *survey)
{}

#define MAX_AMPDU_ATTEMPTS

static int
mwl8k_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
		   struct ieee80211_ampdu_params *params)
{}

static void mwl8k_sw_scan_start(struct ieee80211_hw *hw,
				struct ieee80211_vif *vif,
				const u8 *mac_addr)
{}

static void mwl8k_sw_scan_complete(struct ieee80211_hw *hw,
				   struct ieee80211_vif *vif)
{}

static const struct ieee80211_ops mwl8k_ops =;

static void mwl8k_finalize_join_worker(struct work_struct *work)
{}

enum {};

#define MWL8K_8366_AP_FW_API
#define _MWL8K_8366_AP_FW(api)
#define MWL8K_8366_AP_FW(api)

#define MWL8K_8764_AP_FW_API
#define _MWL8K_8764_AP_FW(api)
#define MWL8K_8764_AP_FW(api)

static struct mwl8k_device_info mwl8k_info_tbl[] =;

MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();

static const struct pci_device_id mwl8k_pci_id_table[] =;
MODULE_DEVICE_TABLE(pci, mwl8k_pci_id_table);

static int mwl8k_request_alt_fw(struct mwl8k_priv *priv)
{}

static int mwl8k_firmware_load_success(struct mwl8k_priv *priv);
static void mwl8k_fw_state_machine(const struct firmware *fw, void *context)
{}

#define MAX_RESTART_ATTEMPTS
static int mwl8k_init_firmware(struct ieee80211_hw *hw, char *fw_image,
			       bool nowait)
{}

static int mwl8k_init_txqs(struct ieee80211_hw *hw)
{}

/* initialize hw after successfully loading a firmware image */
static int mwl8k_probe_hw(struct ieee80211_hw *hw)
{}

/*
 * invoke mwl8k_reload_firmware to change the firmware image after the device
 * has already been registered
 */
static int mwl8k_reload_firmware(struct ieee80211_hw *hw, char *fw_image)
{}

static const struct ieee80211_iface_limit ap_if_limits[] =;

static const struct ieee80211_iface_combination ap_if_comb =;


static int mwl8k_firmware_load_success(struct mwl8k_priv *priv)
{}
static int mwl8k_probe(struct pci_dev *pdev,
				 const struct pci_device_id *id)
{}

static void mwl8k_remove(struct pci_dev *pdev)
{}

static struct pci_driver mwl8k_driver =;

module_pci_driver();

MODULE_DESCRIPTION();
MODULE_VERSION();
MODULE_AUTHOR();
MODULE_LICENSE();