linux/drivers/net/wireless/ath/carl9170/carl9170.h

/*
 * Atheros CARL9170 driver
 *
 * Driver specific definitions
 *
 * Copyright 2008, Johannes Berg <[email protected]>
 * Copyright 2009, 2010, Christian Lamparter <[email protected]>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; see the file COPYING.  If not, see
 * http://www.gnu.org/licenses/.
 *
 * This file incorporates work covered by the following copyright and
 * permission notice:
 *    Copyright (c) 2007-2008 Atheros Communications, Inc.
 *
 *    Permission to use, copy, modify, and/or distribute this software for any
 *    purpose with or without fee is hereby granted, provided that the above
 *    copyright notice and this permission notice appear in all copies.
 *
 *    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 *    WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 *    MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 *    ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 *    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 *    ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 *    OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */
#ifndef __CARL9170_H
#define __CARL9170_H

#include <linux/kernel.h>
#include <linux/firmware.h>
#include <linux/completion.h>
#include <linux/spinlock.h>
#include <linux/hw_random.h>
#include <net/cfg80211.h>
#include <net/mac80211.h>
#include <linux/usb.h>
#ifdef CONFIG_CARL9170_LEDS
#include <linux/leds.h>
#endif /* CONFIG_CARL9170_LEDS */
#ifdef CONFIG_CARL9170_WPC
#include <linux/input.h>
#endif /* CONFIG_CARL9170_WPC */
#include "eeprom.h"
#include "wlan.h"
#include "hw.h"
#include "fwdesc.h"
#include "fwcmd.h"
#include "../regd.h"

#ifdef CONFIG_CARL9170_DEBUGFS
#include "debug.h"
#endif /* CONFIG_CARL9170_DEBUGFS */

#define CARL9170FW_NAME

#define PAYLOAD_MAX

static inline u8 ar9170_qmap(u8 idx)
{}

#define CARL9170_MAX_RX_BUFFER_SIZE

enum carl9170_device_state {};

#define WME_BA_BMP_SIZE
#define CARL9170_TX_USER_RATE_TRIES

#define TID_TO_WME_AC(_tid)

#define SEQ_DIFF(_start, _seq)
#define SEQ_PREV(_seq)
#define SEQ_NEXT(_seq)
#define BAW_WITHIN(_start, _bawsz, _seqno)

enum carl9170_tid_state {};

#define CARL9170_BAW_BITS
#define CARL9170_BAW_SIZE
#define CARL9170_BAW_LEN

struct carl9170_sta_tid {};

#define CARL9170_QUEUE_TIMEOUT
#define CARL9170_BUMP_QUEUE
#define CARL9170_TX_TIMEOUT
#define CARL9170_JANITOR_DELAY
#define CARL9170_QUEUE_STUCK_TIMEOUT
#define CARL9170_STAT_WORK

#define CARL9170_NUM_TX_AGG_MAX

/*
 * Tradeoff between stability/latency and speed.
 *
 * AR9170_TXQ_DEPTH is devised by dividing the amount of available
 * tx buffers with the size of a full ethernet frame + overhead.
 *
 * Naturally: The higher the limit, the faster the device CAN send.
 * However, even a slight over-commitment at the wrong time and the
 * hardware is doomed to send all already-queued frames at suboptimal
 * rates. This in turn leads to an enormous amount of unsuccessful
 * retries => Latency goes up, whereas the throughput goes down. CRASH!
 */
#define CARL9170_NUM_TX_LIMIT_HARD
#define CARL9170_NUM_TX_LIMIT_SOFT

struct carl9170_tx_queue_stats {};

struct carl9170_vif {};

struct carl9170_vif_info {};

#define AR9170_NUM_RX_URBS
#define AR9170_NUM_RX_URBS_MUL
#define AR9170_NUM_TX_URBS
#define AR9170_NUM_RX_URBS_POOL

enum carl9170_device_features {};

#ifdef CONFIG_CARL9170_LEDS
struct ar9170;

struct carl9170_led {};
#endif /* CONFIG_CARL9170_LEDS */

enum carl9170_restart_reasons {};

enum carl9170_erp_modes {};

struct ar9170 {};

enum carl9170_ps_off_override_reasons {};

struct carl9170_bar_list_entry {};

struct carl9170_ba_stats {};

struct carl9170_sta_info {};

struct carl9170_tx_info {};

#define CHK_DEV_STATE(a, s)
#define IS_INITIALIZED(a)
#define IS_ACCEPTING_CMD(a)
#define IS_STARTED(a)

static inline void __carl9170_set_state(struct ar9170 *ar,
	enum carl9170_device_state newstate)
{}

static inline void carl9170_set_state(struct ar9170 *ar,
	enum carl9170_device_state newstate)
{}

static inline void carl9170_set_state_when(struct ar9170 *ar,
	enum carl9170_device_state min, enum carl9170_device_state newstate)
{}

/* exported interface */
void *carl9170_alloc(size_t priv_size);
int carl9170_register(struct ar9170 *ar);
void carl9170_unregister(struct ar9170 *ar);
void carl9170_free(struct ar9170 *ar);
void carl9170_restart(struct ar9170 *ar, const enum carl9170_restart_reasons r);
void carl9170_ps_check(struct ar9170 *ar);

/* USB back-end */
int carl9170_usb_open(struct ar9170 *ar);
void carl9170_usb_stop(struct ar9170 *ar);
void carl9170_usb_tx(struct ar9170 *ar, struct sk_buff *skb);
void carl9170_usb_handle_tx_err(struct ar9170 *ar);
int carl9170_exec_cmd(struct ar9170 *ar, const enum carl9170_cmd_oids,
		      u32 plen, void *payload, u32 rlen, void *resp);
int __carl9170_exec_cmd(struct ar9170 *ar, struct carl9170_cmd *cmd,
			const bool free_buf);
int carl9170_usb_restart(struct ar9170 *ar);
void carl9170_usb_reset(struct ar9170 *ar);

/* MAC */
int carl9170_init_mac(struct ar9170 *ar);
int carl9170_set_qos(struct ar9170 *ar);
int carl9170_update_multicast(struct ar9170 *ar, const u64 mc_hast);
int carl9170_mod_virtual_mac(struct ar9170 *ar, const unsigned int id,
			     const u8 *mac);
int carl9170_set_operating_mode(struct ar9170 *ar);
int carl9170_set_beacon_timers(struct ar9170 *ar);
int carl9170_set_dyn_sifs_ack(struct ar9170 *ar);
int carl9170_set_rts_cts_rate(struct ar9170 *ar);
int carl9170_set_ampdu_settings(struct ar9170 *ar);
int carl9170_set_slot_time(struct ar9170 *ar);
int carl9170_set_mac_rates(struct ar9170 *ar);
int carl9170_set_hwretry_limit(struct ar9170 *ar, const u32 max_retry);
int carl9170_upload_key(struct ar9170 *ar, const u8 id, const u8 *mac,
	const u8 ktype, const u8 keyidx, const u8 *keydata, const int keylen);
int carl9170_disable_key(struct ar9170 *ar, const u8 id);
int carl9170_set_mac_tpc(struct ar9170 *ar, struct ieee80211_channel *channel);

/* RX */
void carl9170_rx(struct ar9170 *ar, void *buf, unsigned int len);
void carl9170_handle_command_response(struct ar9170 *ar, void *buf, u32 len);

/* TX */
void carl9170_op_tx(struct ieee80211_hw *hw,
		    struct ieee80211_tx_control *control,
		    struct sk_buff *skb);
void carl9170_tx_janitor(struct work_struct *work);
void carl9170_tx_process_status(struct ar9170 *ar,
				const struct carl9170_rsp *cmd);
void carl9170_tx_status(struct ar9170 *ar, struct sk_buff *skb,
			const bool success);
void carl9170_tx_callback(struct ar9170 *ar, struct sk_buff *skb);
void carl9170_tx_drop(struct ar9170 *ar, struct sk_buff *skb);
void carl9170_tx_scheduler(struct ar9170 *ar);
void carl9170_tx_get_skb(struct sk_buff *skb);
int carl9170_tx_put_skb(struct sk_buff *skb);
int carl9170_update_beacon(struct ar9170 *ar, const bool submit);

/* LEDs */
#ifdef CONFIG_CARL9170_LEDS
int carl9170_led_register(struct ar9170 *ar);
void carl9170_led_unregister(struct ar9170 *ar);
#endif /* CONFIG_CARL9170_LEDS */
int carl9170_led_init(struct ar9170 *ar);
int carl9170_led_set_state(struct ar9170 *ar, const u32 led_state);

/* PHY / RF */
int carl9170_set_channel(struct ar9170 *ar, struct ieee80211_channel *channel,
			 enum nl80211_channel_type bw);
int carl9170_get_noisefloor(struct ar9170 *ar);

/* FW */
int carl9170_parse_firmware(struct ar9170 *ar);

extern struct ieee80211_rate __carl9170_ratetable[];
extern int modparam_noht;

static inline struct ar9170 *carl9170_get_priv(struct carl9170_vif *carl_vif)
{}

static inline struct ieee80211_hdr *carl9170_get_hdr(struct sk_buff *skb)
{}

static inline u16 get_seq_h(struct ieee80211_hdr *hdr)
{}

static inline u16 carl9170_get_seq(struct sk_buff *skb)
{}

static inline u16 carl9170_get_tid(struct sk_buff *skb)
{}

static inline struct ieee80211_vif *
carl9170_get_vif(struct carl9170_vif_info *priv)
{}

/* Protected by ar->mutex or RCU */
static inline struct ieee80211_vif *carl9170_get_main_vif(struct ar9170 *ar)
{}

static inline bool is_main_vif(struct ar9170 *ar, struct ieee80211_vif *vif)
{}

#endif /* __CARL9170_H */