Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright (c) 2010-2011 Atheros Communications Inc.
0003  *
0004  * Permission to use, copy, modify, and/or distribute this software for any
0005  * purpose with or without fee is hereby granted, provided that the above
0006  * copyright notice and this permission notice appear in all copies.
0007  *
0008  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
0009  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
0010  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
0011  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
0012  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
0013  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
0014  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
0015  */
0016 
0017 #ifndef HTC_H
0018 #define HTC_H
0019 
0020 #include <linux/module.h>
0021 #include <linux/usb.h>
0022 #include <linux/firmware.h>
0023 #include <linux/skbuff.h>
0024 #include <linux/netdevice.h>
0025 #include <linux/etherdevice.h>
0026 #include <linux/leds.h>
0027 #include <linux/slab.h>
0028 #include <net/mac80211.h>
0029 
0030 #include "common.h"
0031 #include "htc_hst.h"
0032 #include "hif_usb.h"
0033 #include "wmi.h"
0034 
0035 #define ATH_STA_SHORT_CALINTERVAL 1000    /* 1 second */
0036 #define ATH_AP_SHORT_CALINTERVAL  100     /* 100 ms */
0037 #define ATH_ANI_POLLINTERVAL      100     /* 100 ms */
0038 #define ATH_LONG_CALINTERVAL      30000   /* 30 seconds */
0039 #define ATH_RESTART_CALINTERVAL   1200000 /* 20 minutes */
0040 
0041 #define ATH_DEFAULT_BMISS_LIMIT 10
0042 #define TSF_TO_TU(_h, _l) \
0043     ((((u32)(_h)) << 22) | (((u32)(_l)) >> 10))
0044 
0045 extern struct ieee80211_ops ath9k_htc_ops;
0046 extern int htc_modparam_nohwcrypt;
0047 #ifdef CONFIG_MAC80211_LEDS
0048 extern int ath9k_htc_led_blink;
0049 #endif
0050 
0051 enum htc_phymode {
0052     HTC_MODE_11NA       = 0,
0053     HTC_MODE_11NG       = 1
0054 };
0055 
0056 enum htc_opmode {
0057     HTC_M_STA   = 1,
0058     HTC_M_IBSS  = 0,
0059     HTC_M_AHDEMO    = 3,
0060     HTC_M_HOSTAP    = 6,
0061     HTC_M_MONITOR   = 8,
0062     HTC_M_WDS   = 2
0063 };
0064 
0065 #define ATH9K_HTC_AMPDU  1
0066 #define ATH9K_HTC_NORMAL 2
0067 #define ATH9K_HTC_BEACON 3
0068 #define ATH9K_HTC_MGMT   4
0069 
0070 #define ATH9K_HTC_TX_CTSONLY      0x1
0071 #define ATH9K_HTC_TX_RTSCTS       0x2
0072 
0073 struct tx_frame_hdr {
0074     u8 data_type;
0075     u8 node_idx;
0076     u8 vif_idx;
0077     u8 tidno;
0078     __be32 flags; /* ATH9K_HTC_TX_* */
0079     u8 key_type;
0080     u8 keyix;
0081     u8 cookie;
0082     u8 pad;
0083 } __packed;
0084 
0085 struct tx_mgmt_hdr {
0086     u8 node_idx;
0087     u8 vif_idx;
0088     u8 tidno;
0089     u8 flags;
0090     u8 key_type;
0091     u8 keyix;
0092     u8 cookie;
0093     u8 pad;
0094 } __packed;
0095 
0096 struct tx_beacon_header {
0097     u8 vif_index;
0098     u8 len_changed;
0099     u16 rev;
0100 } __packed;
0101 
0102 #define MAX_TX_AMPDU_SUBFRAMES_9271 17
0103 #define MAX_TX_AMPDU_SUBFRAMES_7010 22
0104 
0105 struct ath9k_htc_cap_target {
0106     __be32 ampdu_limit;
0107     u8 ampdu_subframes;
0108     u8 enable_coex;
0109     u8 tx_chainmask;
0110     u8 pad;
0111 } __packed;
0112 
0113 struct ath9k_htc_target_vif {
0114     u8 index;
0115     u8 opmode;
0116     u8 myaddr[ETH_ALEN];
0117     u8 ath_cap;
0118     __be16 rtsthreshold;
0119     u8 pad;
0120 } __packed;
0121 
0122 struct ath9k_htc_target_sta {
0123     u8 macaddr[ETH_ALEN];
0124     u8 bssid[ETH_ALEN];
0125     u8 sta_index;
0126     u8 vif_index;
0127     u8 is_vif_sta;
0128     __be16 flags;
0129     __be16 htcap;
0130     __be16 maxampdu;
0131     u8 pad;
0132 } __packed;
0133 
0134 struct ath9k_htc_target_aggr {
0135     u8 sta_index;
0136     u8 tidno;
0137     u8 aggr_enable;
0138     u8 padding;
0139 } __packed;
0140 
0141 #define ATH_HTC_RATE_MAX 30
0142 
0143 #define WLAN_RC_DS_FLAG  0x01
0144 #define WLAN_RC_40_FLAG  0x02
0145 #define WLAN_RC_SGI_FLAG 0x04
0146 #define WLAN_RC_HT_FLAG  0x08
0147 #define ATH_RC_TX_STBC_FLAG 0x20
0148 
0149 struct ath9k_htc_rateset {
0150     u8 rs_nrates;
0151     u8 rs_rates[ATH_HTC_RATE_MAX];
0152 };
0153 
0154 struct ath9k_htc_rate {
0155     struct ath9k_htc_rateset legacy_rates;
0156     struct ath9k_htc_rateset ht_rates;
0157 } __packed;
0158 
0159 struct ath9k_htc_target_rate {
0160     u8 sta_index;
0161     u8 isnew;
0162     __be32 capflags;
0163     struct ath9k_htc_rate rates;
0164 };
0165 
0166 struct ath9k_htc_target_rate_mask {
0167     u8 vif_index;
0168     u8 band;
0169     __be32 mask;
0170     u16 pad;
0171 } __packed;
0172 
0173 struct ath9k_htc_target_int_stats {
0174     __be32 rx;
0175     __be32 rxorn;
0176     __be32 rxeol;
0177     __be32 txurn;
0178     __be32 txto;
0179     __be32 cst;
0180 } __packed;
0181 
0182 struct ath9k_htc_target_tx_stats {
0183     __be32 xretries;
0184     __be32 fifoerr;
0185     __be32 filtered;
0186     __be32 timer_exp;
0187     __be32 shortretries;
0188     __be32 longretries;
0189     __be32 qnull;
0190     __be32 encap_fail;
0191     __be32 nobuf;
0192 } __packed;
0193 
0194 struct ath9k_htc_target_rx_stats {
0195     __be32 nobuf;
0196     __be32 host_send;
0197     __be32 host_done;
0198 } __packed;
0199 
0200 #define ATH9K_HTC_MAX_VIF 2
0201 #define ATH9K_HTC_MAX_BCN_VIF 2
0202 
0203 #define INC_VIF(_priv, _type) do {      \
0204         switch (_type) {        \
0205         case NL80211_IFTYPE_STATION:    \
0206             _priv->num_sta_vif++;   \
0207             break;          \
0208         case NL80211_IFTYPE_ADHOC:  \
0209             _priv->num_ibss_vif++;  \
0210             break;          \
0211         case NL80211_IFTYPE_AP:     \
0212             _priv->num_ap_vif++;    \
0213             break;          \
0214         case NL80211_IFTYPE_MESH_POINT: \
0215             _priv->num_mbss_vif++;  \
0216             break;          \
0217         default:            \
0218             break;          \
0219         }               \
0220     } while (0)
0221 
0222 #define DEC_VIF(_priv, _type) do {      \
0223         switch (_type) {        \
0224         case NL80211_IFTYPE_STATION:    \
0225             _priv->num_sta_vif--;   \
0226             break;          \
0227         case NL80211_IFTYPE_ADHOC:  \
0228             _priv->num_ibss_vif--;  \
0229             break;          \
0230         case NL80211_IFTYPE_AP:     \
0231             _priv->num_ap_vif--;    \
0232             break;          \
0233         case NL80211_IFTYPE_MESH_POINT: \
0234             _priv->num_mbss_vif--;  \
0235             break;          \
0236         default:            \
0237             break;          \
0238         }               \
0239     } while (0)
0240 
0241 struct ath9k_htc_vif {
0242     u8 index;
0243     u16 seq_no;
0244     bool beacon_configured;
0245     int bslot;
0246     __le64 tsfadjust;
0247 };
0248 
0249 struct ath9k_vif_iter_data {
0250     const u8 *hw_macaddr;
0251     u8 mask[ETH_ALEN];
0252 };
0253 
0254 #define ATH9K_HTC_MAX_STA 8
0255 #define ATH9K_HTC_MAX_TID 8
0256 
0257 enum tid_aggr_state {
0258     AGGR_STOP = 0,
0259     AGGR_PROGRESS,
0260     AGGR_START,
0261     AGGR_OPERATIONAL
0262 };
0263 
0264 struct ath9k_htc_sta {
0265     u8 index;
0266     enum tid_aggr_state tid_state[ATH9K_HTC_MAX_TID];
0267     struct work_struct rc_update_work;
0268     struct ath9k_htc_priv *htc_priv;
0269 };
0270 
0271 #define ATH9K_HTC_RXBUF 256
0272 #define HTC_RX_FRAME_HEADER_SIZE 40
0273 
0274 struct ath9k_htc_rxbuf {
0275     bool in_process;
0276     struct sk_buff *skb;
0277     struct ath_htc_rx_status rxstatus;
0278     struct list_head list;
0279 };
0280 
0281 struct ath9k_htc_rx {
0282     struct list_head rxbuf;
0283     spinlock_t rxbuflock;
0284     bool initialized;
0285 };
0286 
0287 #define ATH9K_HTC_TX_CLEANUP_INTERVAL 50 /* ms */
0288 #define ATH9K_HTC_TX_TIMEOUT_INTERVAL 3000 /* ms */
0289 #define ATH9K_HTC_TX_RESERVE 10
0290 #define ATH9K_HTC_TX_TIMEOUT_COUNT 40
0291 #define ATH9K_HTC_TX_THRESHOLD (MAX_TX_BUF_NUM - ATH9K_HTC_TX_RESERVE)
0292 
0293 #define ATH9K_HTC_OP_TX_QUEUES_STOP BIT(0)
0294 #define ATH9K_HTC_OP_TX_DRAIN       BIT(1)
0295 
0296 struct ath9k_htc_tx {
0297     u8 flags;
0298     int queued_cnt;
0299     struct sk_buff_head mgmt_ep_queue;
0300     struct sk_buff_head cab_ep_queue;
0301     struct sk_buff_head data_be_queue;
0302     struct sk_buff_head data_bk_queue;
0303     struct sk_buff_head data_vi_queue;
0304     struct sk_buff_head data_vo_queue;
0305     struct sk_buff_head tx_failed;
0306     DECLARE_BITMAP(tx_slot, MAX_TX_BUF_NUM);
0307     struct timer_list cleanup_timer;
0308     spinlock_t tx_lock;
0309     bool initialized;
0310 };
0311 
0312 struct ath9k_htc_tx_ctl {
0313     u8 type; /* ATH9K_HTC_* */
0314     u8 epid;
0315     u8 txok;
0316     u8 sta_idx;
0317     unsigned long timestamp;
0318 };
0319 
0320 static inline struct ath9k_htc_tx_ctl *HTC_SKB_CB(struct sk_buff *skb)
0321 {
0322     struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
0323 
0324     BUILD_BUG_ON(sizeof(struct ath9k_htc_tx_ctl) >
0325              IEEE80211_TX_INFO_DRIVER_DATA_SIZE);
0326     return (struct ath9k_htc_tx_ctl *) &tx_info->driver_data;
0327 }
0328 
0329 #ifdef CONFIG_ATH9K_HTC_DEBUGFS
0330 #define __STAT_SAFE(hif_dev, expr)  ((hif_dev)->htc_handle->drv_priv ? (expr) : 0)
0331 #define CAB_STAT_INC(priv)      ((priv)->debug.tx_stats.cab_queued++)
0332 #define TX_QSTAT_INC(priv, q)       ((priv)->debug.tx_stats.queue_stats[q]++)
0333 
0334 #define TX_STAT_INC(hif_dev, c) \
0335         __STAT_SAFE((hif_dev), (hif_dev)->htc_handle->drv_priv->debug.tx_stats.c++)
0336 #define TX_STAT_ADD(hif_dev, c, a) \
0337         __STAT_SAFE((hif_dev), (hif_dev)->htc_handle->drv_priv->debug.tx_stats.c += a)
0338 #define RX_STAT_INC(hif_dev, c) \
0339         __STAT_SAFE((hif_dev), (hif_dev)->htc_handle->drv_priv->debug.skbrx_stats.c++)
0340 #define RX_STAT_ADD(hif_dev, c, a) \
0341         __STAT_SAFE((hif_dev), (hif_dev)->htc_handle->drv_priv->debug.skbrx_stats.c += a)
0342 
0343 void ath9k_htc_err_stat_rx(struct ath9k_htc_priv *priv,
0344                struct ath_rx_status *rs);
0345 
0346 struct ath_tx_stats {
0347     u32 buf_queued;
0348     u32 buf_completed;
0349     u32 skb_queued;
0350     u32 skb_success;
0351     u32 skb_success_bytes;
0352     u32 skb_failed;
0353     u32 cab_queued;
0354     u32 queue_stats[IEEE80211_NUM_ACS];
0355 };
0356 
0357 struct ath_skbrx_stats {
0358     u32 skb_allocated;
0359     u32 skb_completed;
0360     u32 skb_completed_bytes;
0361     u32 skb_dropped;
0362 };
0363 
0364 struct ath9k_debug {
0365     struct dentry *debugfs_phy;
0366     struct ath_tx_stats tx_stats;
0367     struct ath_rx_stats rx_stats;
0368     struct ath_skbrx_stats skbrx_stats;
0369 };
0370 
0371 void ath9k_htc_get_et_strings(struct ieee80211_hw *hw,
0372                   struct ieee80211_vif *vif,
0373                   u32 sset, u8 *data);
0374 int ath9k_htc_get_et_sset_count(struct ieee80211_hw *hw,
0375                 struct ieee80211_vif *vif, int sset);
0376 void ath9k_htc_get_et_stats(struct ieee80211_hw *hw,
0377                 struct ieee80211_vif *vif,
0378                 struct ethtool_stats *stats, u64 *data);
0379 #else
0380 
0381 #define TX_STAT_INC(hif_dev, c)
0382 #define TX_STAT_ADD(hif_dev, c, a)
0383 #define RX_STAT_INC(hif_dev, c)
0384 #define RX_STAT_ADD(hif_dev, c, a)
0385 
0386 #define CAB_STAT_INC(priv)
0387 #define TX_QSTAT_INC(priv, c)
0388 
0389 static inline void ath9k_htc_err_stat_rx(struct ath9k_htc_priv *priv,
0390                      struct ath_rx_status *rs)
0391 {
0392 }
0393 
0394 #endif /* CONFIG_ATH9K_HTC_DEBUGFS */
0395 
0396 #define ATH_LED_PIN_DEF             1
0397 #define ATH_LED_PIN_9287            10
0398 #define ATH_LED_PIN_9271            15
0399 #define ATH_LED_PIN_7010            12
0400 
0401 #define BSTUCK_THRESHOLD 10
0402 
0403 /*
0404  * Adjust these when the max. no of beaconing interfaces is
0405  * increased.
0406  */
0407 #define DEFAULT_SWBA_RESPONSE 40 /* in TUs */
0408 #define MIN_SWBA_RESPONSE     10 /* in TUs */
0409 
0410 struct htc_beacon {
0411     enum {
0412         OK,     /* no change needed */
0413         UPDATE,     /* update pending */
0414         COMMIT      /* beacon sent, commit change */
0415     } updateslot;       /* slot time update fsm */
0416 
0417     struct ieee80211_vif *bslot[ATH9K_HTC_MAX_BCN_VIF];
0418     u32 bmisscnt;
0419     u32 beaconq;
0420     int slottime;
0421     int slotupdate;
0422 };
0423 
0424 struct ath_btcoex {
0425     u32 bt_priority_cnt;
0426     unsigned long bt_priority_time;
0427     int bt_stomp_type; /* Types of BT stomping */
0428     u32 btcoex_no_stomp;
0429     u32 btcoex_period;
0430     u32 btscan_no_stomp;
0431 };
0432 
0433 #ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
0434 void ath9k_htc_init_btcoex(struct ath9k_htc_priv *priv, char *product);
0435 void ath9k_htc_start_btcoex(struct ath9k_htc_priv *priv);
0436 void ath9k_htc_stop_btcoex(struct ath9k_htc_priv *priv);
0437 #else
0438 static inline void ath9k_htc_init_btcoex(struct ath9k_htc_priv *priv, char *product)
0439 {
0440 }
0441 static inline void ath9k_htc_start_btcoex(struct ath9k_htc_priv *priv)
0442 {
0443 }
0444 static inline void ath9k_htc_stop_btcoex(struct ath9k_htc_priv *priv)
0445 {
0446 }
0447 #endif /* CONFIG_ATH9K_BTCOEX_SUPPORT */
0448 
0449 #define OP_BT_PRIORITY_DETECTED    3
0450 #define OP_BT_SCAN                 4
0451 #define OP_TSF_RESET               6
0452 
0453 enum htc_op_flags {
0454     HTC_FWFLAG_NO_RMW,
0455 };
0456 
0457 struct ath9k_htc_priv {
0458     struct device *dev;
0459     struct ieee80211_hw *hw;
0460     struct ath_hw *ah;
0461     struct htc_target *htc;
0462     struct wmi *wmi;
0463 
0464     u16 fw_version_major;
0465     u16 fw_version_minor;
0466 
0467     enum htc_endpoint_id wmi_cmd_ep;
0468     enum htc_endpoint_id beacon_ep;
0469     enum htc_endpoint_id cab_ep;
0470     enum htc_endpoint_id uapsd_ep;
0471     enum htc_endpoint_id mgmt_ep;
0472     enum htc_endpoint_id data_be_ep;
0473     enum htc_endpoint_id data_bk_ep;
0474     enum htc_endpoint_id data_vi_ep;
0475     enum htc_endpoint_id data_vo_ep;
0476 
0477     u8 vif_slot;
0478     u8 mon_vif_idx;
0479     u8 sta_slot;
0480     u8 vif_sta_pos[ATH9K_HTC_MAX_VIF];
0481     u8 num_ibss_vif;
0482     u8 num_mbss_vif;
0483     u8 num_sta_vif;
0484     u8 num_sta_assoc_vif;
0485     u8 num_ap_vif;
0486 
0487     u16 curtxpow;
0488     u16 txpowlimit;
0489     u16 nvifs;
0490     u16 nstations;
0491     bool rearm_ani;
0492     bool reconfig_beacon;
0493     unsigned int rxfilter;
0494     unsigned long op_flags;
0495     unsigned long fw_flags;
0496 
0497     struct ath9k_hw_cal_data caldata;
0498     struct ath_spec_scan_priv spec_priv;
0499 
0500     spinlock_t beacon_lock;
0501     struct ath_beacon_config cur_beacon_conf;
0502     struct htc_beacon beacon;
0503 
0504     struct ath9k_htc_rx rx;
0505     struct ath9k_htc_tx tx;
0506 
0507     struct tasklet_struct swba_tasklet;
0508     struct tasklet_struct rx_tasklet;
0509     struct delayed_work ani_work;
0510     struct tasklet_struct tx_failed_tasklet;
0511     struct work_struct ps_work;
0512     struct work_struct fatal_work;
0513 
0514     struct mutex htc_pm_lock;
0515     unsigned long ps_usecount;
0516     bool ps_enabled;
0517     bool ps_idle;
0518 
0519 #ifdef CONFIG_MAC80211_LEDS
0520     enum led_brightness brightness;
0521     bool led_registered;
0522     char led_name[32];
0523     struct led_classdev led_cdev;
0524     struct work_struct led_work;
0525 #endif
0526 
0527     int cabq;
0528     int hwq_map[IEEE80211_NUM_ACS];
0529 
0530 #ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
0531     struct ath_btcoex btcoex;
0532 #endif
0533 
0534     struct delayed_work coex_period_work;
0535     struct delayed_work duty_cycle_work;
0536 #ifdef CONFIG_ATH9K_HTC_DEBUGFS
0537     struct ath9k_debug debug;
0538 #endif
0539     struct mutex mutex;
0540     struct ieee80211_vif *csa_vif;
0541 };
0542 
0543 static inline void ath_read_cachesize(struct ath_common *common, int *csz)
0544 {
0545     common->bus_ops->read_cachesize(common, csz);
0546 }
0547 
0548 void ath9k_htc_reset(struct ath9k_htc_priv *priv);
0549 
0550 void ath9k_htc_assign_bslot(struct ath9k_htc_priv *priv,
0551                 struct ieee80211_vif *vif);
0552 void ath9k_htc_remove_bslot(struct ath9k_htc_priv *priv,
0553                 struct ieee80211_vif *vif);
0554 void ath9k_htc_set_tsfadjust(struct ath9k_htc_priv *priv,
0555                  struct ieee80211_vif *vif);
0556 void ath9k_htc_beaconq_config(struct ath9k_htc_priv *priv);
0557 void ath9k_htc_beacon_config(struct ath9k_htc_priv *priv,
0558                  struct ieee80211_vif *vif);
0559 void ath9k_htc_beacon_reconfig(struct ath9k_htc_priv *priv);
0560 void ath9k_htc_swba(struct ath9k_htc_priv *priv,
0561             struct wmi_event_swba *swba);
0562 
0563 void ath9k_htc_rxep(void *priv, struct sk_buff *skb,
0564             enum htc_endpoint_id ep_id);
0565 void ath9k_htc_txep(void *priv, struct sk_buff *skb, enum htc_endpoint_id ep_id,
0566             bool txok);
0567 void ath9k_htc_beaconep(void *drv_priv, struct sk_buff *skb,
0568             enum htc_endpoint_id ep_id, bool txok);
0569 
0570 int ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv,
0571                 u8 enable_coex);
0572 void ath9k_htc_ani_work(struct work_struct *work);
0573 void ath9k_htc_start_ani(struct ath9k_htc_priv *priv);
0574 void ath9k_htc_stop_ani(struct ath9k_htc_priv *priv);
0575 
0576 int ath9k_tx_init(struct ath9k_htc_priv *priv);
0577 int ath9k_htc_tx_start(struct ath9k_htc_priv *priv,
0578                struct ieee80211_sta *sta,
0579                struct sk_buff *skb, u8 slot, bool is_cab);
0580 void ath9k_tx_cleanup(struct ath9k_htc_priv *priv);
0581 bool ath9k_htc_txq_setup(struct ath9k_htc_priv *priv, int subtype);
0582 int ath9k_htc_cabq_setup(struct ath9k_htc_priv *priv);
0583 int get_hw_qnum(u16 queue, int *hwq_map);
0584 int ath_htc_txq_update(struct ath9k_htc_priv *priv, int qnum,
0585                struct ath9k_tx_queue_info *qinfo);
0586 void ath9k_htc_check_stop_queues(struct ath9k_htc_priv *priv);
0587 void ath9k_htc_check_wake_queues(struct ath9k_htc_priv *priv);
0588 int ath9k_htc_tx_get_slot(struct ath9k_htc_priv *priv);
0589 void ath9k_htc_tx_clear_slot(struct ath9k_htc_priv *priv, int slot);
0590 void ath9k_htc_tx_drain(struct ath9k_htc_priv *priv);
0591 void ath9k_htc_txstatus(struct ath9k_htc_priv *priv, void *wmi_event);
0592 void ath9k_tx_failed_tasklet(struct tasklet_struct *t);
0593 void ath9k_htc_tx_cleanup_timer(struct timer_list *t);
0594 bool ath9k_htc_csa_is_finished(struct ath9k_htc_priv *priv);
0595 
0596 int ath9k_rx_init(struct ath9k_htc_priv *priv);
0597 void ath9k_rx_cleanup(struct ath9k_htc_priv *priv);
0598 void ath9k_host_rx_init(struct ath9k_htc_priv *priv);
0599 void ath9k_rx_tasklet(struct tasklet_struct *t);
0600 u32 ath9k_htc_calcrxfilter(struct ath9k_htc_priv *priv);
0601 
0602 void ath9k_htc_ps_wakeup(struct ath9k_htc_priv *priv);
0603 void ath9k_htc_ps_restore(struct ath9k_htc_priv *priv);
0604 void ath9k_ps_work(struct work_struct *work);
0605 bool ath9k_htc_setpower(struct ath9k_htc_priv *priv,
0606             enum ath9k_power_mode mode);
0607 
0608 void ath9k_start_rfkill_poll(struct ath9k_htc_priv *priv);
0609 void ath9k_htc_rfkill_poll_state(struct ieee80211_hw *hw);
0610 
0611 struct base_eep_header *ath9k_htc_get_eeprom_base(struct ath9k_htc_priv *priv);
0612 
0613 #ifdef CONFIG_MAC80211_LEDS
0614 void ath9k_configure_leds(struct ath9k_htc_priv *priv);
0615 void ath9k_init_leds(struct ath9k_htc_priv *priv);
0616 void ath9k_deinit_leds(struct ath9k_htc_priv *priv);
0617 void ath9k_led_work(struct work_struct *work);
0618 #else
0619 static inline void ath9k_configure_leds(struct ath9k_htc_priv *priv)
0620 {
0621 }
0622 
0623 static inline void ath9k_init_leds(struct ath9k_htc_priv *priv)
0624 {
0625 }
0626 
0627 static inline void ath9k_deinit_leds(struct ath9k_htc_priv *priv)
0628 {
0629 }
0630 
0631 static inline void ath9k_led_work(struct work_struct *work)
0632 {
0633 }
0634 #endif
0635 
0636 int ath9k_htc_probe_device(struct htc_target *htc_handle, struct device *dev,
0637                u16 devid, char *product, u32 drv_info);
0638 void ath9k_htc_disconnect_device(struct htc_target *htc_handle, bool hotunplug);
0639 #ifdef CONFIG_PM
0640 void ath9k_htc_suspend(struct htc_target *htc_handle);
0641 int ath9k_htc_resume(struct htc_target *htc_handle);
0642 #endif
0643 #ifdef CONFIG_ATH9K_HTC_DEBUGFS
0644 int ath9k_htc_init_debug(struct ath_hw *ah);
0645 void ath9k_htc_deinit_debug(struct ath9k_htc_priv *priv);
0646 #else
0647 static inline int ath9k_htc_init_debug(struct ath_hw *ah) { return 0; };
0648 static inline void ath9k_htc_deinit_debug(struct ath9k_htc_priv *priv)
0649 {
0650 }
0651 #endif /* CONFIG_ATH9K_HTC_DEBUGFS */
0652 
0653 #endif /* HTC_H */