htc.h 15.7 KB
Newer Older
S
Sujith 已提交
1
/*
2
 * Copyright (c) 2010-2011 Atheros Communications Inc.
S
Sujith 已提交
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
 *
 * 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 HTC_H
#define HTC_H

#include <linux/module.h>
#include <linux/usb.h>
#include <linux/firmware.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
25
#include <linux/etherdevice.h>
S
Sujith 已提交
26
#include <linux/leds.h>
T
Tejun Heo 已提交
27
#include <linux/slab.h>
S
Sujith 已提交
28 29 30 31 32 33 34 35
#include <net/mac80211.h>

#include "common.h"
#include "htc_hst.h"
#include "hif_usb.h"
#include "wmi.h"

#define ATH_STA_SHORT_CALINTERVAL 1000    /* 1 second */
36
#define ATH_AP_SHORT_CALINTERVAL  100     /* 100 ms */
S
Sujith 已提交
37 38 39 40 41 42 43 44 45
#define ATH_ANI_POLLINTERVAL      100     /* 100 ms */
#define ATH_LONG_CALINTERVAL      30000   /* 30 seconds */
#define ATH_RESTART_CALINTERVAL   1200000 /* 20 minutes */

#define ATH_DEFAULT_BMISS_LIMIT 10
#define TSF_TO_TU(_h, _l) \
	((((u32)(_h)) << 22) | (((u32)(_l)) >> 10))

extern struct ieee80211_ops ath9k_htc_ops;
46
extern int htc_modparam_nohwcrypt;
S
Sujith 已提交
47 48

enum htc_phymode {
S
Sujith Manoharan 已提交
49 50
	HTC_MODE_11NA		= 0,
	HTC_MODE_11NG		= 1
S
Sujith 已提交
51 52 53 54 55 56 57 58 59 60 61
};

enum htc_opmode {
	HTC_M_STA	= 1,
	HTC_M_IBSS	= 0,
	HTC_M_AHDEMO	= 3,
	HTC_M_HOSTAP	= 6,
	HTC_M_MONITOR	= 8,
	HTC_M_WDS	= 2
};

62
#define ATH9K_HTC_AMPDU  1
S
Sujith 已提交
63
#define ATH9K_HTC_NORMAL 2
64 65
#define ATH9K_HTC_BEACON 3
#define ATH9K_HTC_MGMT   4
S
Sujith 已提交
66 67 68 69 70 71 72 73 74

#define ATH9K_HTC_TX_CTSONLY      0x1
#define ATH9K_HTC_TX_RTSCTS       0x2

struct tx_frame_hdr {
	u8 data_type;
	u8 node_idx;
	u8 vif_idx;
	u8 tidno;
75
	__be32 flags; /* ATH9K_HTC_TX_* */
S
Sujith 已提交
76 77
	u8 key_type;
	u8 keyix;
78 79
	u8 cookie;
	u8 pad;
S
Sujith 已提交
80 81 82 83 84 85 86 87 88
} __packed;

struct tx_mgmt_hdr {
	u8 node_idx;
	u8 vif_idx;
	u8 tidno;
	u8 flags;
	u8 key_type;
	u8 keyix;
89 90
	u8 cookie;
	u8 pad;
S
Sujith 已提交
91 92 93 94
} __packed;

struct tx_beacon_header {
	u8 vif_index;
95
	u8 len_changed;
S
Sujith 已提交
96 97 98
	u16 rev;
} __packed;

99 100 101
#define MAX_TX_AMPDU_SUBFRAMES_9271 17
#define MAX_TX_AMPDU_SUBFRAMES_7010 22

S
Sujith 已提交
102
struct ath9k_htc_cap_target {
103
	__be32 ampdu_limit;
S
Sujith 已提交
104
	u8 ampdu_subframes;
105
	u8 enable_coex;
S
Sujith 已提交
106
	u8 tx_chainmask;
107
	u8 pad;
S
Sujith 已提交
108 109 110 111
} __packed;

struct ath9k_htc_target_vif {
	u8 index;
112
	u8 opmode;
S
Sujith 已提交
113 114
	u8 myaddr[ETH_ALEN];
	u8 ath_cap;
115 116
	__be16 rtsthreshold;
	u8 pad;
S
Sujith 已提交
117 118 119 120 121 122 123 124
} __packed;

struct ath9k_htc_target_sta {
	u8 macaddr[ETH_ALEN];
	u8 bssid[ETH_ALEN];
	u8 sta_index;
	u8 vif_index;
	u8 is_vif_sta;
S
Sujith Manoharan 已提交
125
	__be16 flags;
126 127 128
	__be16 htcap;
	__be16 maxampdu;
	u8 pad;
S
Sujith 已提交
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
} __packed;

struct ath9k_htc_target_aggr {
	u8 sta_index;
	u8 tidno;
	u8 aggr_enable;
	u8 padding;
} __packed;

#define ATH_HTC_RATE_MAX 30

#define WLAN_RC_DS_FLAG  0x01
#define WLAN_RC_40_FLAG  0x02
#define WLAN_RC_SGI_FLAG 0x04
#define WLAN_RC_HT_FLAG  0x08
O
Oleksij Rempel 已提交
144
#define ATH_RC_TX_STBC_FLAG 0x20
S
Sujith 已提交
145 146 147 148 149 150 151 152 153 154 155 156 157 158

struct ath9k_htc_rateset {
	u8 rs_nrates;
	u8 rs_rates[ATH_HTC_RATE_MAX];
};

struct ath9k_htc_rate {
	struct ath9k_htc_rateset legacy_rates;
	struct ath9k_htc_rateset ht_rates;
} __packed;

struct ath9k_htc_target_rate {
	u8 sta_index;
	u8 isnew;
S
Sujith 已提交
159
	__be32 capflags;
S
Sujith 已提交
160 161 162
	struct ath9k_htc_rate rates;
};

163 164 165 166 167 168 169
struct ath9k_htc_target_rate_mask {
	u8 vif_index;
	u8 band;
	__be32 mask;
	u16 pad;
} __packed;

170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
struct ath9k_htc_target_int_stats {
	__be32 rx;
	__be32 rxorn;
	__be32 rxeol;
	__be32 txurn;
	__be32 txto;
	__be32 cst;
} __packed;

struct ath9k_htc_target_tx_stats {
	__be32 xretries;
	__be32 fifoerr;
	__be32 filtered;
	__be32 timer_exp;
	__be32 shortretries;
	__be32 longretries;
	__be32 qnull;
	__be32 encap_fail;
	__be32 nobuf;
} __packed;

struct ath9k_htc_target_rx_stats {
	__be32 nobuf;
	__be32 host_send;
	__be32 host_done;
S
Sujith 已提交
195 196
} __packed;

197
#define ATH9K_HTC_MAX_VIF 2
198
#define ATH9K_HTC_MAX_BCN_VIF 2
199

200 201 202 203 204 205 206 207
#define INC_VIF(_priv, _type) do {		\
		switch (_type) {		\
		case NL80211_IFTYPE_STATION:	\
			_priv->num_sta_vif++;	\
			break;			\
		case NL80211_IFTYPE_ADHOC:	\
			_priv->num_ibss_vif++;	\
			break;			\
208 209 210
		case NL80211_IFTYPE_AP:		\
			_priv->num_ap_vif++;	\
			break;			\
211 212 213
		case NL80211_IFTYPE_MESH_POINT:	\
			_priv->num_mbss_vif++;	\
			break;			\
214 215 216 217 218 219 220 221 222 223 224 225 226
		default:			\
			break;			\
		}				\
	} while (0)

#define DEC_VIF(_priv, _type) do {		\
		switch (_type) {		\
		case NL80211_IFTYPE_STATION:	\
			_priv->num_sta_vif--;	\
			break;			\
		case NL80211_IFTYPE_ADHOC:	\
			_priv->num_ibss_vif--;	\
			break;			\
227 228 229
		case NL80211_IFTYPE_AP:		\
			_priv->num_ap_vif--;	\
			break;			\
230 231 232
		case NL80211_IFTYPE_MESH_POINT:	\
			_priv->num_mbss_vif--;	\
			break;			\
233 234 235 236 237
		default:			\
			break;			\
		}				\
	} while (0)

S
Sujith 已提交
238 239
struct ath9k_htc_vif {
	u8 index;
240
	u16 seq_no;
241
	bool beacon_configured;
S
Sujith Manoharan 已提交
242
	int bslot;
243
	__le64 tsfadjust;
S
Sujith 已提交
244 245
};

246 247 248 249 250
struct ath9k_vif_iter_data {
	const u8 *hw_macaddr;
	u8 mask[ETH_ALEN];
};

S
Sujith 已提交
251 252 253 254 255 256 257 258 259 260 261 262 263
#define ATH9K_HTC_MAX_STA 8
#define ATH9K_HTC_MAX_TID 8

enum tid_aggr_state {
	AGGR_STOP = 0,
	AGGR_PROGRESS,
	AGGR_START,
	AGGR_OPERATIONAL
};

struct ath9k_htc_sta {
	u8 index;
	enum tid_aggr_state tid_state[ATH9K_HTC_MAX_TID];
264 265
	struct work_struct rc_update_work;
	struct ath9k_htc_priv *htc_priv;
S
Sujith 已提交
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282
};

#define ATH9K_HTC_RXBUF 256
#define HTC_RX_FRAME_HEADER_SIZE 40

struct ath9k_htc_rxbuf {
	bool in_process;
	struct sk_buff *skb;
	struct ath_htc_rx_status rxstatus;
	struct list_head list;
};

struct ath9k_htc_rx {
	struct list_head rxbuf;
	spinlock_t rxbuflock;
};

283
#define ATH9K_HTC_TX_CLEANUP_INTERVAL 50 /* ms */
S
Sujith Manoharan 已提交
284
#define ATH9K_HTC_TX_TIMEOUT_INTERVAL 3000 /* ms */
285
#define ATH9K_HTC_TX_RESERVE 10
S
Sujith Manoharan 已提交
286
#define ATH9K_HTC_TX_TIMEOUT_COUNT 40
287 288 289
#define ATH9K_HTC_TX_THRESHOLD (MAX_TX_BUF_NUM - ATH9K_HTC_TX_RESERVE)

#define ATH9K_HTC_OP_TX_QUEUES_STOP BIT(0)
290
#define ATH9K_HTC_OP_TX_DRAIN       BIT(1)
291

292 293 294
struct ath9k_htc_tx {
	u8 flags;
	int queued_cnt;
295 296 297 298 299 300
	struct sk_buff_head mgmt_ep_queue;
	struct sk_buff_head cab_ep_queue;
	struct sk_buff_head data_be_queue;
	struct sk_buff_head data_bk_queue;
	struct sk_buff_head data_vi_queue;
	struct sk_buff_head data_vo_queue;
301
	struct sk_buff_head tx_failed;
S
Sujith Manoharan 已提交
302
	DECLARE_BITMAP(tx_slot, MAX_TX_BUF_NUM);
303
	struct timer_list cleanup_timer;
304
	spinlock_t tx_lock;
305 306
};

S
Sujith 已提交
307 308
struct ath9k_htc_tx_ctl {
	u8 type; /* ATH9K_HTC_* */
309
	u8 epid;
310
	u8 txok;
311
	u8 sta_idx;
312
	unsigned long timestamp;
S
Sujith 已提交
313 314
};

315 316 317 318 319 320 321 322 323
static inline struct ath9k_htc_tx_ctl *HTC_SKB_CB(struct sk_buff *skb)
{
	struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);

	BUILD_BUG_ON(sizeof(struct ath9k_htc_tx_ctl) >
		     IEEE80211_TX_INFO_DRIVER_DATA_SIZE);
	return (struct ath9k_htc_tx_ctl *) &tx_info->driver_data;
}

S
Sujith 已提交
324 325 326
#ifdef CONFIG_ATH9K_HTC_DEBUGFS

#define TX_STAT_INC(c) (hif_dev->htc_handle->drv_priv->debug.tx_stats.c++)
327
#define TX_STAT_ADD(c, a) (hif_dev->htc_handle->drv_priv->debug.tx_stats.c += a)
328 329
#define RX_STAT_INC(c) (hif_dev->htc_handle->drv_priv->debug.skbrx_stats.c++)
#define RX_STAT_ADD(c, a) (hif_dev->htc_handle->drv_priv->debug.skbrx_stats.c += a)
330
#define CAB_STAT_INC   priv->debug.tx_stats.cab_queued++
S
Sujith 已提交
331

332 333
#define TX_QSTAT_INC(q) (priv->debug.tx_stats.queue_stats[q]++)

334
void ath9k_htc_err_stat_rx(struct ath9k_htc_priv *priv,
335
			   struct ath_rx_status *rs);
336

S
Sujith 已提交
337 338 339 340
struct ath_tx_stats {
	u32 buf_queued;
	u32 buf_completed;
	u32 skb_queued;
341
	u32 skb_success;
342
	u32 skb_success_bytes;
343
	u32 skb_failed;
344
	u32 cab_queued;
345
	u32 queue_stats[IEEE80211_NUM_ACS];
S
Sujith 已提交
346 347
};

348
struct ath_skbrx_stats {
S
Sujith 已提交
349 350
	u32 skb_allocated;
	u32 skb_completed;
351
	u32 skb_completed_bytes;
S
Sujith 已提交
352 353 354 355 356 357 358
	u32 skb_dropped;
};

struct ath9k_debug {
	struct dentry *debugfs_phy;
	struct ath_tx_stats tx_stats;
	struct ath_rx_stats rx_stats;
359
	struct ath_skbrx_stats skbrx_stats;
S
Sujith 已提交
360 361
};

362 363 364 365 366 367 368 369
void ath9k_htc_get_et_strings(struct ieee80211_hw *hw,
			      struct ieee80211_vif *vif,
			      u32 sset, u8 *data);
int ath9k_htc_get_et_sset_count(struct ieee80211_hw *hw,
				struct ieee80211_vif *vif, int sset);
void ath9k_htc_get_et_stats(struct ieee80211_hw *hw,
			    struct ieee80211_vif *vif,
			    struct ethtool_stats *stats, u64 *data);
S
Sujith 已提交
370 371 372
#else

#define TX_STAT_INC(c) do { } while (0)
373
#define TX_STAT_ADD(c, a) do { } while (0)
S
Sujith 已提交
374
#define RX_STAT_INC(c) do { } while (0)
375
#define RX_STAT_ADD(c, a) do { } while (0)
376
#define CAB_STAT_INC   do { } while (0)
S
Sujith 已提交
377

378 379
#define TX_QSTAT_INC(c) do { } while (0)

380
static inline void ath9k_htc_err_stat_rx(struct ath9k_htc_priv *priv,
381
					 struct ath_rx_status *rs)
382 383 384
{
}

S
Sujith 已提交
385 386 387
#endif /* CONFIG_ATH9K_HTC_DEBUGFS */

#define ATH_LED_PIN_DEF             1
388
#define ATH_LED_PIN_9287            10
S
Sujith 已提交
389
#define ATH_LED_PIN_9271            15
S
Sujith 已提交
390
#define ATH_LED_PIN_7010            12
S
Sujith 已提交
391

S
Sujith Manoharan 已提交
392 393
#define BSTUCK_THRESHOLD 10

394 395 396 397 398 399 400
/*
 * Adjust these when the max. no of beaconing interfaces is
 * increased.
 */
#define DEFAULT_SWBA_RESPONSE 40 /* in TUs */
#define MIN_SWBA_RESPONSE     10 /* in TUs */

401
struct htc_beacon {
402 403 404 405 406 407
	enum {
		OK,		/* no change needed */
		UPDATE,		/* update pending */
		COMMIT		/* beacon sent, commit change */
	} updateslot;		/* slot time update fsm */

S
Sujith Manoharan 已提交
408
	struct ieee80211_vif *bslot[ATH9K_HTC_MAX_BCN_VIF];
409
	u32 bmisscnt;
410
	u32 beaconq;
411 412
	int slottime;
	int slotupdate;
413 414
};

415 416 417 418 419 420 421 422 423
struct ath_btcoex {
	u32 bt_priority_cnt;
	unsigned long bt_priority_time;
	int bt_stomp_type; /* Types of BT stomping */
	u32 btcoex_no_stomp;
	u32 btcoex_period;
	u32 btscan_no_stomp;
};

424
#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
425
void ath9k_htc_init_btcoex(struct ath9k_htc_priv *priv, char *product);
426 427
void ath9k_htc_start_btcoex(struct ath9k_htc_priv *priv);
void ath9k_htc_stop_btcoex(struct ath9k_htc_priv *priv);
428 429 430 431 432 433 434 435 436 437 438
#else
static inline void ath9k_htc_init_btcoex(struct ath9k_htc_priv *priv, char *product)
{
}
static inline void ath9k_htc_start_btcoex(struct ath9k_htc_priv *priv)
{
}
static inline void ath9k_htc_stop_btcoex(struct ath9k_htc_priv *priv)
{
}
#endif /* CONFIG_ATH9K_BTCOEX_SUPPORT */
439

440 441 442
#define OP_BT_PRIORITY_DETECTED    BIT(3)
#define OP_BT_SCAN                 BIT(4)
#define OP_TSF_RESET               BIT(6)
S
Sujith 已提交
443 444 445 446 447 448 449 450

struct ath9k_htc_priv {
	struct device *dev;
	struct ieee80211_hw *hw;
	struct ath_hw *ah;
	struct htc_target *htc;
	struct wmi *wmi;

451 452 453
	u16 fw_version_major;
	u16 fw_version_minor;

S
Sujith 已提交
454 455 456 457 458 459 460 461 462 463
	enum htc_endpoint_id wmi_cmd_ep;
	enum htc_endpoint_id beacon_ep;
	enum htc_endpoint_id cab_ep;
	enum htc_endpoint_id uapsd_ep;
	enum htc_endpoint_id mgmt_ep;
	enum htc_endpoint_id data_be_ep;
	enum htc_endpoint_id data_bk_ep;
	enum htc_endpoint_id data_vi_ep;
	enum htc_endpoint_id data_vo_ep;

464 465 466 467
	u8 vif_slot;
	u8 mon_vif_idx;
	u8 sta_slot;
	u8 vif_sta_pos[ATH9K_HTC_MAX_VIF];
468
	u8 num_ibss_vif;
469
	u8 num_mbss_vif;
470
	u8 num_sta_vif;
471
	u8 num_sta_assoc_vif;
472
	u8 num_ap_vif;
473

S
Sujith 已提交
474 475 476 477
	u16 curtxpow;
	u16 txpowlimit;
	u16 nvifs;
	u16 nstations;
478 479
	bool rearm_ani;
	bool reconfig_beacon;
480
	unsigned int rxfilter;
481
	unsigned long op_flags;
S
Sujith 已提交
482

483
	struct ath9k_hw_cal_data caldata;
484
	struct ath_spec_scan_priv spec_priv;
485

S
Sujith 已提交
486
	spinlock_t beacon_lock;
487 488
	struct ath_beacon_config cur_beacon_conf;
	struct htc_beacon beacon;
S
Sujith 已提交
489

490 491
	struct ath9k_htc_rx rx;
	struct ath9k_htc_tx tx;
S
Sujith 已提交
492

493
	struct tasklet_struct swba_tasklet;
S
Sujith 已提交
494
	struct tasklet_struct rx_tasklet;
495
	struct delayed_work ani_work;
496
	struct tasklet_struct tx_failed_tasklet;
497
	struct work_struct ps_work;
498
	struct work_struct fatal_work;
499 500 501 502

	struct mutex htc_pm_lock;
	unsigned long ps_usecount;
	bool ps_enabled;
503
	bool ps_idle;
S
Sujith 已提交
504

505 506 507 508 509 510 511
#ifdef CONFIG_MAC80211_LEDS
	enum led_brightness brightness;
	bool led_registered;
	char led_name[32];
	struct led_classdev led_cdev;
	struct work_struct led_work;
#endif
S
Sujith 已提交
512 513

	int cabq;
514
	int hwq_map[IEEE80211_NUM_ACS];
S
Sujith 已提交
515

516
#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
517
	struct ath_btcoex btcoex;
518 519
#endif

520 521
	struct delayed_work coex_period_work;
	struct delayed_work duty_cycle_work;
S
Sujith 已提交
522 523 524 525 526 527 528 529 530 531 532
#ifdef CONFIG_ATH9K_HTC_DEBUGFS
	struct ath9k_debug debug;
#endif
	struct mutex mutex;
};

static inline void ath_read_cachesize(struct ath_common *common, int *csz)
{
	common->bus_ops->read_cachesize(common, csz);
}

533 534
void ath9k_htc_reset(struct ath9k_htc_priv *priv);

S
Sujith Manoharan 已提交
535 536 537 538
void ath9k_htc_assign_bslot(struct ath9k_htc_priv *priv,
			    struct ieee80211_vif *vif);
void ath9k_htc_remove_bslot(struct ath9k_htc_priv *priv,
			    struct ieee80211_vif *vif);
539 540
void ath9k_htc_set_tsfadjust(struct ath9k_htc_priv *priv,
			     struct ieee80211_vif *vif);
S
Sujith 已提交
541
void ath9k_htc_beaconq_config(struct ath9k_htc_priv *priv);
S
Sujith 已提交
542
void ath9k_htc_beacon_config(struct ath9k_htc_priv *priv,
543
			     struct ieee80211_vif *vif);
544
void ath9k_htc_beacon_reconfig(struct ath9k_htc_priv *priv);
S
Sujith Manoharan 已提交
545 546
void ath9k_htc_swba(struct ath9k_htc_priv *priv,
		    struct wmi_event_swba *swba);
S
Sujith 已提交
547 548 549 550 551

void ath9k_htc_rxep(void *priv, struct sk_buff *skb,
		    enum htc_endpoint_id ep_id);
void ath9k_htc_txep(void *priv, struct sk_buff *skb, enum htc_endpoint_id ep_id,
		    bool txok);
S
Sujith 已提交
552 553
void ath9k_htc_beaconep(void *drv_priv, struct sk_buff *skb,
			enum htc_endpoint_id ep_id, bool txok);
S
Sujith 已提交
554

555 556
int ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv,
				u8 enable_coex);
557 558 559
void ath9k_htc_ani_work(struct work_struct *work);
void ath9k_htc_start_ani(struct ath9k_htc_priv *priv);
void ath9k_htc_stop_ani(struct ath9k_htc_priv *priv);
S
Sujith 已提交
560 561

int ath9k_tx_init(struct ath9k_htc_priv *priv);
562
int ath9k_htc_tx_start(struct ath9k_htc_priv *priv,
563
		       struct ieee80211_sta *sta,
S
Sujith Manoharan 已提交
564
		       struct sk_buff *skb, u8 slot, bool is_cab);
S
Sujith 已提交
565
void ath9k_tx_cleanup(struct ath9k_htc_priv *priv);
566
bool ath9k_htc_txq_setup(struct ath9k_htc_priv *priv, int subtype);
S
Sujith 已提交
567
int ath9k_htc_cabq_setup(struct ath9k_htc_priv *priv);
S
Sujith 已提交
568
int get_hw_qnum(u16 queue, int *hwq_map);
569 570
int ath_htc_txq_update(struct ath9k_htc_priv *priv, int qnum,
		       struct ath9k_tx_queue_info *qinfo);
571 572
void ath9k_htc_check_stop_queues(struct ath9k_htc_priv *priv);
void ath9k_htc_check_wake_queues(struct ath9k_htc_priv *priv);
S
Sujith Manoharan 已提交
573 574
int ath9k_htc_tx_get_slot(struct ath9k_htc_priv *priv);
void ath9k_htc_tx_clear_slot(struct ath9k_htc_priv *priv, int slot);
575
void ath9k_htc_tx_drain(struct ath9k_htc_priv *priv);
576 577
void ath9k_htc_txstatus(struct ath9k_htc_priv *priv, void *wmi_event);
void ath9k_tx_failed_tasklet(unsigned long data);
578
void ath9k_htc_tx_cleanup_timer(unsigned long data);
S
Sujith 已提交
579 580 581 582 583

int ath9k_rx_init(struct ath9k_htc_priv *priv);
void ath9k_rx_cleanup(struct ath9k_htc_priv *priv);
void ath9k_host_rx_init(struct ath9k_htc_priv *priv);
void ath9k_rx_tasklet(unsigned long data);
584
u32 ath9k_htc_calcrxfilter(struct ath9k_htc_priv *priv);
S
Sujith 已提交
585

586 587 588
void ath9k_htc_ps_wakeup(struct ath9k_htc_priv *priv);
void ath9k_htc_ps_restore(struct ath9k_htc_priv *priv);
void ath9k_ps_work(struct work_struct *work);
S
Sujith Manoharan 已提交
589 590
bool ath9k_htc_setpower(struct ath9k_htc_priv *priv,
			enum ath9k_power_mode mode);
591

S
Sujith 已提交
592
void ath9k_start_rfkill_poll(struct ath9k_htc_priv *priv);
593
void ath9k_htc_rfkill_poll_state(struct ieee80211_hw *hw);
594

595 596
struct base_eep_header *ath9k_htc_get_eeprom_base(struct ath9k_htc_priv *priv);

597
#ifdef CONFIG_MAC80211_LEDS
598
void ath9k_configure_leds(struct ath9k_htc_priv *priv);
S
Sujith 已提交
599 600
void ath9k_init_leds(struct ath9k_htc_priv *priv);
void ath9k_deinit_leds(struct ath9k_htc_priv *priv);
601 602
void ath9k_led_work(struct work_struct *work);
#else
603 604 605 606
static inline void ath9k_configure_leds(struct ath9k_htc_priv *priv)
{
}

607 608 609 610 611 612 613 614 615 616 617 618
static inline void ath9k_init_leds(struct ath9k_htc_priv *priv)
{
}

static inline void ath9k_deinit_leds(struct ath9k_htc_priv *priv)
{
}

static inline void ath9k_led_work(struct work_struct *work)
{
}
#endif
S
Sujith 已提交
619 620

int ath9k_htc_probe_device(struct htc_target *htc_handle, struct device *dev,
621
			   u16 devid, char *product, u32 drv_info);
S
Sujith 已提交
622 623
void ath9k_htc_disconnect_device(struct htc_target *htc_handle, bool hotunplug);
#ifdef CONFIG_PM
S
Sujith Manoharan 已提交
624
void ath9k_htc_suspend(struct htc_target *htc_handle);
S
Sujith 已提交
625 626 627
int ath9k_htc_resume(struct htc_target *htc_handle);
#endif
#ifdef CONFIG_ATH9K_HTC_DEBUGFS
628
int ath9k_htc_init_debug(struct ath_hw *ah);
629
void ath9k_htc_deinit_debug(struct ath9k_htc_priv *priv);
S
Sujith 已提交
630
#else
631
static inline int ath9k_htc_init_debug(struct ath_hw *ah) { return 0; };
632
static inline void ath9k_htc_deinit_debug(struct ath9k_htc_priv *priv) { return 0; };
S
Sujith 已提交
633 634 635
#endif /* CONFIG_ATH9K_HTC_DEBUGFS */

#endif /* HTC_H */