htc.h 15.2 KB
Newer Older
S
Sujith 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
/*
 * Copyright (c) 2010 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 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>
#include <linux/leds.h>
T
Tejun Heo 已提交
26
#include <linux/slab.h>
S
Sujith 已提交
27 28 29 30 31 32 33 34
#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 */
35
#define ATH_AP_SHORT_CALINTERVAL  100     /* 100 ms */
S
Sujith 已提交
36 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 IEEE80211_MS_TO_TU(x)   (((x) * 1000) / 1024)
#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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69

enum htc_phymode {
	HTC_MODE_AUTO		= 0,
	HTC_MODE_11A		= 1,
	HTC_MODE_11B		= 2,
	HTC_MODE_11G		= 3,
	HTC_MODE_FH		= 4,
	HTC_MODE_TURBO_A	= 5,
	HTC_MODE_TURBO_G	= 6,
	HTC_MODE_11NA		= 7,
	HTC_MODE_11NG		= 8
};

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
};

#define ATH9K_HTC_HDRSPACE sizeof(struct htc_frame_hdr)
70 71

#define ATH9K_HTC_AMPDU  1
S
Sujith 已提交
72
#define ATH9K_HTC_NORMAL 2
73 74
#define ATH9K_HTC_BEACON 3
#define ATH9K_HTC_MGMT   4
S
Sujith 已提交
75 76 77 78 79 80 81 82 83 84

#define ATH9K_HTC_TX_CTSONLY      0x1
#define ATH9K_HTC_TX_RTSCTS       0x2
#define ATH9K_HTC_TX_USE_MIN_RATE 0x100

struct tx_frame_hdr {
	u8 data_type;
	u8 node_idx;
	u8 vif_idx;
	u8 tidno;
85
	__be32 flags; /* ATH9K_HTC_TX_* */
S
Sujith 已提交
86 87
	u8 key_type;
	u8 keyix;
88 89
	u8 cookie;
	u8 pad;
S
Sujith 已提交
90 91 92 93 94 95 96 97 98
} __packed;

struct tx_mgmt_hdr {
	u8 node_idx;
	u8 vif_idx;
	u8 tidno;
	u8 flags;
	u8 key_type;
	u8 keyix;
99 100
	u8 cookie;
	u8 pad;
S
Sujith 已提交
101 102 103 104
} __packed;

struct tx_beacon_header {
	u8 vif_index;
105
	u8 len_changed;
S
Sujith 已提交
106 107 108 109 110 111 112 113 114 115 116 117
	u16 rev;
} __packed;

struct ath9k_htc_cap_target {
	u32 flags;
	u32 flags_ext;
	u32 ampdu_limit;
	u8 ampdu_subframes;
	u8 tx_chainmask;
	u8 tx_chainmask_legacy;
	u8 rtscts_ratecode;
	u8 protmode;
118
	u8 pad;
S
Sujith 已提交
119 120 121 122
} __packed;

struct ath9k_htc_target_vif {
	u8 index;
123
	u8 opmode;
S
Sujith 已提交
124 125
	u8 myaddr[ETH_ALEN];
	u8 ath_cap;
126 127
	__be16 rtsthreshold;
	u8 pad;
S
Sujith 已提交
128 129 130 131 132 133 134 135 136 137 138 139 140
} __packed;

#define ATH_HTC_STA_AUTH  0x0001
#define ATH_HTC_STA_QOS   0x0002
#define ATH_HTC_STA_ERP   0x0004
#define ATH_HTC_STA_HT    0x0008

struct ath9k_htc_target_sta {
	u8 macaddr[ETH_ALEN];
	u8 bssid[ETH_ALEN];
	u8 sta_index;
	u8 vif_index;
	u8 is_vif_sta;
141 142 143 144
	__be16 flags; /* ATH_HTC_STA_* */
	__be16 htcap;
	__be16 maxampdu;
	u8 pad;
S
Sujith 已提交
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
} __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

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 已提交
174
	__be32 capflags;
S
Sujith 已提交
175 176 177 178
	struct ath9k_htc_rate rates;
};

struct ath9k_htc_target_stats {
S
Sujith 已提交
179 180 181 182 183
	__be32 tx_shortretry;
	__be32 tx_longretry;
	__be32 tx_xretries;
	__be32 ht_txunaggr_xretry;
	__be32 ht_tx_xretries;
S
Sujith 已提交
184 185
} __packed;

186
#define ATH9K_HTC_MAX_VIF 2
187
#define ATH9K_HTC_MAX_BCN_VIF 2
188

189 190 191 192 193 194 195 196
#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;			\
197 198 199
		case NL80211_IFTYPE_AP:		\
			_priv->num_ap_vif++;	\
			break;			\
200 201 202 203 204 205 206 207 208 209 210 211 212
		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;			\
213 214 215
		case NL80211_IFTYPE_AP:		\
			_priv->num_ap_vif--;	\
			break;			\
216 217 218 219 220
		default:			\
			break;			\
		}				\
	} while (0)

S
Sujith 已提交
221 222
struct ath9k_htc_vif {
	u8 index;
223
	u16 seq_no;
224
	bool beacon_configured;
S
Sujith Manoharan 已提交
225
	int bslot;
226
	__le64 tsfadjust;
S
Sujith 已提交
227 228
};

229 230 231 232 233
struct ath9k_vif_iter_data {
	const u8 *hw_macaddr;
	u8 mask[ETH_ALEN];
};

S
Sujith 已提交
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264
#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];
};

#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 {
	int last_rssi; /* FIXME: per-STA */
	struct list_head rxbuf;
	spinlock_t rxbuflock;
};

265 266 267 268
#define ATH9K_HTC_TX_CLEANUP_INTERVAL 50 /* ms */
#define ATH9K_HTC_TX_TIMEOUT_INTERVAL 2500 /* ms */
#define ATH9K_HTC_TX_RESERVE 10
#define ATH9K_HTC_TX_TIMEOUT_COUNT 20
269 270 271
#define ATH9K_HTC_TX_THRESHOLD (MAX_TX_BUF_NUM - ATH9K_HTC_TX_RESERVE)

#define ATH9K_HTC_OP_TX_QUEUES_STOP BIT(0)
272
#define ATH9K_HTC_OP_TX_DRAIN       BIT(1)
273

274 275 276
struct ath9k_htc_tx {
	u8 flags;
	int queued_cnt;
277 278 279 280 281 282
	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;
283
	struct sk_buff_head tx_failed;
S
Sujith Manoharan 已提交
284
	DECLARE_BITMAP(tx_slot, MAX_TX_BUF_NUM);
285
	struct timer_list cleanup_timer;
286
	spinlock_t tx_lock;
287 288
};

S
Sujith 已提交
289 290
struct ath9k_htc_tx_ctl {
	u8 type; /* ATH9K_HTC_* */
291
	u8 epid;
292
	u8 txok;
293
	u8 sta_idx;
294
	unsigned long timestamp;
S
Sujith 已提交
295 296
};

297 298 299 300 301 302 303 304 305
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 已提交
306 307 308 309
#ifdef CONFIG_ATH9K_HTC_DEBUGFS

#define TX_STAT_INC(c) (hif_dev->htc_handle->drv_priv->debug.tx_stats.c++)
#define RX_STAT_INC(c) (hif_dev->htc_handle->drv_priv->debug.rx_stats.c++)
310
#define CAB_STAT_INC   priv->debug.tx_stats.cab_queued++
S
Sujith 已提交
311

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

314 315 316
void ath9k_htc_err_stat_rx(struct ath9k_htc_priv *priv,
			   struct ath_htc_rx_status *rxs);

S
Sujith 已提交
317 318 319 320
struct ath_tx_stats {
	u32 buf_queued;
	u32 buf_completed;
	u32 skb_queued;
321 322
	u32 skb_success;
	u32 skb_failed;
323
	u32 cab_queued;
324
	u32 queue_stats[WME_NUM_AC];
S
Sujith 已提交
325 326 327 328 329 330
};

struct ath_rx_stats {
	u32 skb_allocated;
	u32 skb_completed;
	u32 skb_dropped;
331 332 333 334 335 336 337 338
	u32 err_crc;
	u32 err_decrypt_crc;
	u32 err_mic;
	u32 err_pre_delim;
	u32 err_post_delim;
	u32 err_decrypt_busy;
	u32 err_phy;
	u32 err_phy_stats[ATH9K_PHYERR_MAX];
S
Sujith 已提交
339 340 341 342 343 344 345
};

struct ath9k_debug {
	struct dentry *debugfs_phy;
	struct dentry *debugfs_tgt_stats;
	struct dentry *debugfs_xmit;
	struct dentry *debugfs_recv;
346
	struct dentry *debugfs_slot;
347
	struct dentry *debugfs_queue;
S
Sujith 已提交
348 349 350 351 352 353 354 355 356
	struct ath_tx_stats tx_stats;
	struct ath_rx_stats rx_stats;
	u32 txrate;
};

#else

#define TX_STAT_INC(c) do { } while (0)
#define RX_STAT_INC(c) do { } while (0)
357
#define CAB_STAT_INC   do { } while (0)
S
Sujith 已提交
358

359 360
#define TX_QSTAT_INC(c) do { } while (0)

361 362 363 364 365
static inline void ath9k_htc_err_stat_rx(struct ath9k_htc_priv *priv,
					 struct ath_htc_rx_status *rxs)
{
}

S
Sujith 已提交
366 367 368
#endif /* CONFIG_ATH9K_HTC_DEBUGFS */

#define ATH_LED_PIN_DEF             1
369
#define ATH_LED_PIN_9287            10
S
Sujith 已提交
370
#define ATH_LED_PIN_9271            15
S
Sujith 已提交
371
#define ATH_LED_PIN_7010            12
S
Sujith 已提交
372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391
#define ATH_LED_ON_DURATION_IDLE    350	/* in msecs */
#define ATH_LED_OFF_DURATION_IDLE   250	/* in msecs */

enum ath_led_type {
	ATH_LED_RADIO,
	ATH_LED_ASSOC,
	ATH_LED_TX,
	ATH_LED_RX
};

struct ath_led {
	struct ath9k_htc_priv *priv;
	struct led_classdev led_cdev;
	enum ath_led_type led_type;
	struct delayed_work brightness_work;
	char name[32];
	bool registered;
	int brightness;
};

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_config {
S
Sujith Manoharan 已提交
402
	struct ieee80211_vif *bslot[ATH9K_HTC_MAX_BCN_VIF];
403 404 405
	u16 beacon_interval;
	u16 dtim_period;
	u16 bmiss_timeout;
S
Sujith Manoharan 已提交
406
	u32 bmiss_cnt;
407 408
};

409 410 411 412 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;
};

void ath_htc_init_btcoex_work(struct ath9k_htc_priv *priv);
void ath_htc_resume_btcoex_work(struct ath9k_htc_priv *priv);
void ath_htc_cancel_btcoex_work(struct ath9k_htc_priv *priv);

#define OP_INVALID		   BIT(0)
#define OP_SCANNING		   BIT(1)
424 425
#define OP_LED_ASSOCIATED	   BIT(2)
#define OP_LED_ON		   BIT(3)
426 427 428 429
#define OP_ENABLE_BEACON	   BIT(4)
#define OP_LED_DEINIT		   BIT(5)
#define OP_BT_PRIORITY_DETECTED    BIT(6)
#define OP_BT_SCAN                 BIT(7)
430
#define OP_ANI_RUNNING             BIT(8)
431
#define OP_TSF_RESET               BIT(9)
S
Sujith 已提交
432 433 434 435 436 437 438 439

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

440 441 442
	u16 fw_version_major;
	u16 fw_version_minor;

S
Sujith 已提交
443 444 445 446 447 448 449 450 451 452
	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;

453 454 455 456
	u8 vif_slot;
	u8 mon_vif_idx;
	u8 sta_slot;
	u8 vif_sta_pos[ATH9K_HTC_MAX_VIF];
457 458
	u8 num_ibss_vif;
	u8 num_sta_vif;
459
	u8 num_ap_vif;
460

S
Sujith 已提交
461 462 463 464 465
	u16 op_flags;
	u16 curtxpow;
	u16 txpowlimit;
	u16 nvifs;
	u16 nstations;
466 467
	bool rearm_ani;
	bool reconfig_beacon;
468
	unsigned int rxfilter;
S
Sujith 已提交
469

470
	struct ath9k_hw_cal_data caldata;
471
	struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS];
472

S
Sujith 已提交
473
	spinlock_t beacon_lock;
474
	struct htc_beacon_config cur_beacon_conf;
S
Sujith 已提交
475

476 477
	struct ath9k_htc_rx rx;
	struct ath9k_htc_tx tx;
S
Sujith 已提交
478

479
	struct tasklet_struct swba_tasklet;
S
Sujith 已提交
480
	struct tasklet_struct rx_tasklet;
481
	struct delayed_work ani_work;
482
	struct tasklet_struct tx_failed_tasklet;
483
	struct work_struct ps_work;
484
	struct work_struct fatal_work;
485 486 487 488

	struct mutex htc_pm_lock;
	unsigned long ps_usecount;
	bool ps_enabled;
489
	bool ps_idle;
S
Sujith 已提交
490 491 492 493 494 495 496 497 498 499

	struct ath_led radio_led;
	struct ath_led assoc_led;
	struct ath_led tx_led;
	struct ath_led rx_led;
	struct delayed_work ath9k_led_blink_work;
	int led_on_duration;
	int led_off_duration;
	int led_on_cnt;
	int led_off_cnt;
S
Sujith 已提交
500 501 502

	int beaconq;
	int cabq;
503
	int hwq_map[WME_NUM_AC];
S
Sujith 已提交
504

505 506 507
	struct ath_btcoex btcoex;
	struct delayed_work coex_period_work;
	struct delayed_work duty_cycle_work;
S
Sujith 已提交
508 509 510 511 512 513 514 515 516 517 518
#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);
}

519 520
void ath9k_htc_reset(struct ath9k_htc_priv *priv);

S
Sujith Manoharan 已提交
521 522 523 524
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);
525 526
void ath9k_htc_set_tsfadjust(struct ath9k_htc_priv *priv,
			     struct ieee80211_vif *vif);
S
Sujith 已提交
527
void ath9k_htc_beaconq_config(struct ath9k_htc_priv *priv);
S
Sujith 已提交
528
void ath9k_htc_beacon_config(struct ath9k_htc_priv *priv,
529
			     struct ieee80211_vif *vif);
530
void ath9k_htc_beacon_reconfig(struct ath9k_htc_priv *priv);
S
Sujith Manoharan 已提交
531 532
void ath9k_htc_swba(struct ath9k_htc_priv *priv,
		    struct wmi_event_swba *swba);
S
Sujith 已提交
533 534 535 536 537

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 已提交
538 539
void ath9k_htc_beaconep(void *drv_priv, struct sk_buff *skb,
			enum htc_endpoint_id ep_id, bool txok);
S
Sujith 已提交
540

541
int ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv);
S
Sujith 已提交
542 543
void ath9k_htc_station_work(struct work_struct *work);
void ath9k_htc_aggr_work(struct work_struct *work);
544 545 546
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 已提交
547 548

int ath9k_tx_init(struct ath9k_htc_priv *priv);
549
int ath9k_htc_tx_start(struct ath9k_htc_priv *priv,
S
Sujith Manoharan 已提交
550
		       struct sk_buff *skb, u8 slot, bool is_cab);
S
Sujith 已提交
551
void ath9k_tx_cleanup(struct ath9k_htc_priv *priv);
552
bool ath9k_htc_txq_setup(struct ath9k_htc_priv *priv, int subtype);
S
Sujith 已提交
553
int ath9k_htc_cabq_setup(struct ath9k_htc_priv *priv);
S
Sujith 已提交
554
int get_hw_qnum(u16 queue, int *hwq_map);
555 556
int ath_htc_txq_update(struct ath9k_htc_priv *priv, int qnum,
		       struct ath9k_tx_queue_info *qinfo);
557 558
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 已提交
559 560
int ath9k_htc_tx_get_slot(struct ath9k_htc_priv *priv);
void ath9k_htc_tx_clear_slot(struct ath9k_htc_priv *priv, int slot);
561
void ath9k_htc_tx_drain(struct ath9k_htc_priv *priv);
562 563 564
void ath9k_htc_txstatus(struct ath9k_htc_priv *priv, void *wmi_event);
void ath9k_htc_tx_failed(struct ath9k_htc_priv *priv);
void ath9k_tx_failed_tasklet(unsigned long data);
565
void ath9k_htc_tx_cleanup_timer(unsigned long data);
S
Sujith 已提交
566 567 568 569 570

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);
571
u32 ath9k_htc_calcrxfilter(struct ath9k_htc_priv *priv);
S
Sujith 已提交
572

573 574 575
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 已提交
576 577
bool ath9k_htc_setpower(struct ath9k_htc_priv *priv,
			enum ath9k_power_mode mode);
578

S
Sujith 已提交
579
void ath9k_start_rfkill_poll(struct ath9k_htc_priv *priv);
580 581 582 583
void ath9k_htc_rfkill_poll_state(struct ieee80211_hw *hw);
void ath9k_htc_radio_enable(struct ieee80211_hw *hw);
void ath9k_htc_radio_disable(struct ieee80211_hw *hw);
void ath9k_led_stop_brightness(struct ath9k_htc_priv *priv);
S
Sujith 已提交
584 585 586 587
void ath9k_init_leds(struct ath9k_htc_priv *priv);
void ath9k_deinit_leds(struct ath9k_htc_priv *priv);

int ath9k_htc_probe_device(struct htc_target *htc_handle, struct device *dev,
588
			   u16 devid, char *product, u32 drv_info);
S
Sujith 已提交
589 590
void ath9k_htc_disconnect_device(struct htc_target *htc_handle, bool hotunplug);
#ifdef CONFIG_PM
S
Sujith Manoharan 已提交
591
void ath9k_htc_suspend(struct htc_target *htc_handle);
S
Sujith 已提交
592 593 594
int ath9k_htc_resume(struct htc_target *htc_handle);
#endif
#ifdef CONFIG_ATH9K_HTC_DEBUGFS
595 596 597 598
int ath9k_htc_debug_create_root(void);
void ath9k_htc_debug_remove_root(void);
int ath9k_htc_init_debug(struct ath_hw *ah);
void ath9k_htc_exit_debug(struct ath_hw *ah);
S
Sujith 已提交
599
#else
600 601 602 603
static inline int ath9k_htc_debug_create_root(void) { return 0; };
static inline void ath9k_htc_debug_remove_root(void) {};
static inline int ath9k_htc_init_debug(struct ath_hw *ah) { return 0; };
static inline void ath9k_htc_exit_debug(struct ath_hw *ah) {};
S
Sujith 已提交
604 605 606
#endif /* CONFIG_ATH9K_HTC_DEBUGFS */

#endif /* HTC_H */