18c2ecf20Sopenharmony_ci/* 28c2ecf20Sopenharmony_ci * Copyright (c) 2010-2011 Atheros Communications Inc. 38c2ecf20Sopenharmony_ci * 48c2ecf20Sopenharmony_ci * Permission to use, copy, modify, and/or distribute this software for any 58c2ecf20Sopenharmony_ci * purpose with or without fee is hereby granted, provided that the above 68c2ecf20Sopenharmony_ci * copyright notice and this permission notice appear in all copies. 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 98c2ecf20Sopenharmony_ci * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 108c2ecf20Sopenharmony_ci * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 118c2ecf20Sopenharmony_ci * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 128c2ecf20Sopenharmony_ci * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 138c2ecf20Sopenharmony_ci * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 148c2ecf20Sopenharmony_ci * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 158c2ecf20Sopenharmony_ci */ 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci#ifndef HTC_H 188c2ecf20Sopenharmony_ci#define HTC_H 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci#include <linux/module.h> 218c2ecf20Sopenharmony_ci#include <linux/usb.h> 228c2ecf20Sopenharmony_ci#include <linux/firmware.h> 238c2ecf20Sopenharmony_ci#include <linux/skbuff.h> 248c2ecf20Sopenharmony_ci#include <linux/netdevice.h> 258c2ecf20Sopenharmony_ci#include <linux/etherdevice.h> 268c2ecf20Sopenharmony_ci#include <linux/leds.h> 278c2ecf20Sopenharmony_ci#include <linux/slab.h> 288c2ecf20Sopenharmony_ci#include <net/mac80211.h> 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci#include "common.h" 318c2ecf20Sopenharmony_ci#include "htc_hst.h" 328c2ecf20Sopenharmony_ci#include "hif_usb.h" 338c2ecf20Sopenharmony_ci#include "wmi.h" 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ci#define ATH_STA_SHORT_CALINTERVAL 1000 /* 1 second */ 368c2ecf20Sopenharmony_ci#define ATH_AP_SHORT_CALINTERVAL 100 /* 100 ms */ 378c2ecf20Sopenharmony_ci#define ATH_ANI_POLLINTERVAL 100 /* 100 ms */ 388c2ecf20Sopenharmony_ci#define ATH_LONG_CALINTERVAL 30000 /* 30 seconds */ 398c2ecf20Sopenharmony_ci#define ATH_RESTART_CALINTERVAL 1200000 /* 20 minutes */ 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ci#define ATH_DEFAULT_BMISS_LIMIT 10 428c2ecf20Sopenharmony_ci#define TSF_TO_TU(_h, _l) \ 438c2ecf20Sopenharmony_ci ((((u32)(_h)) << 22) | (((u32)(_l)) >> 10)) 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_ciextern struct ieee80211_ops ath9k_htc_ops; 468c2ecf20Sopenharmony_ciextern int htc_modparam_nohwcrypt; 478c2ecf20Sopenharmony_ci#ifdef CONFIG_MAC80211_LEDS 488c2ecf20Sopenharmony_ciextern int ath9k_htc_led_blink; 498c2ecf20Sopenharmony_ci#endif 508c2ecf20Sopenharmony_ci 518c2ecf20Sopenharmony_cienum htc_phymode { 528c2ecf20Sopenharmony_ci HTC_MODE_11NA = 0, 538c2ecf20Sopenharmony_ci HTC_MODE_11NG = 1 548c2ecf20Sopenharmony_ci}; 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_cienum htc_opmode { 578c2ecf20Sopenharmony_ci HTC_M_STA = 1, 588c2ecf20Sopenharmony_ci HTC_M_IBSS = 0, 598c2ecf20Sopenharmony_ci HTC_M_AHDEMO = 3, 608c2ecf20Sopenharmony_ci HTC_M_HOSTAP = 6, 618c2ecf20Sopenharmony_ci HTC_M_MONITOR = 8, 628c2ecf20Sopenharmony_ci HTC_M_WDS = 2 638c2ecf20Sopenharmony_ci}; 648c2ecf20Sopenharmony_ci 658c2ecf20Sopenharmony_ci#define ATH9K_HTC_AMPDU 1 668c2ecf20Sopenharmony_ci#define ATH9K_HTC_NORMAL 2 678c2ecf20Sopenharmony_ci#define ATH9K_HTC_BEACON 3 688c2ecf20Sopenharmony_ci#define ATH9K_HTC_MGMT 4 698c2ecf20Sopenharmony_ci 708c2ecf20Sopenharmony_ci#define ATH9K_HTC_TX_CTSONLY 0x1 718c2ecf20Sopenharmony_ci#define ATH9K_HTC_TX_RTSCTS 0x2 728c2ecf20Sopenharmony_ci 738c2ecf20Sopenharmony_cistruct tx_frame_hdr { 748c2ecf20Sopenharmony_ci u8 data_type; 758c2ecf20Sopenharmony_ci u8 node_idx; 768c2ecf20Sopenharmony_ci u8 vif_idx; 778c2ecf20Sopenharmony_ci u8 tidno; 788c2ecf20Sopenharmony_ci __be32 flags; /* ATH9K_HTC_TX_* */ 798c2ecf20Sopenharmony_ci u8 key_type; 808c2ecf20Sopenharmony_ci u8 keyix; 818c2ecf20Sopenharmony_ci u8 cookie; 828c2ecf20Sopenharmony_ci u8 pad; 838c2ecf20Sopenharmony_ci} __packed; 848c2ecf20Sopenharmony_ci 858c2ecf20Sopenharmony_cistruct tx_mgmt_hdr { 868c2ecf20Sopenharmony_ci u8 node_idx; 878c2ecf20Sopenharmony_ci u8 vif_idx; 888c2ecf20Sopenharmony_ci u8 tidno; 898c2ecf20Sopenharmony_ci u8 flags; 908c2ecf20Sopenharmony_ci u8 key_type; 918c2ecf20Sopenharmony_ci u8 keyix; 928c2ecf20Sopenharmony_ci u8 cookie; 938c2ecf20Sopenharmony_ci u8 pad; 948c2ecf20Sopenharmony_ci} __packed; 958c2ecf20Sopenharmony_ci 968c2ecf20Sopenharmony_cistruct tx_beacon_header { 978c2ecf20Sopenharmony_ci u8 vif_index; 988c2ecf20Sopenharmony_ci u8 len_changed; 998c2ecf20Sopenharmony_ci u16 rev; 1008c2ecf20Sopenharmony_ci} __packed; 1018c2ecf20Sopenharmony_ci 1028c2ecf20Sopenharmony_ci#define MAX_TX_AMPDU_SUBFRAMES_9271 17 1038c2ecf20Sopenharmony_ci#define MAX_TX_AMPDU_SUBFRAMES_7010 22 1048c2ecf20Sopenharmony_ci 1058c2ecf20Sopenharmony_cistruct ath9k_htc_cap_target { 1068c2ecf20Sopenharmony_ci __be32 ampdu_limit; 1078c2ecf20Sopenharmony_ci u8 ampdu_subframes; 1088c2ecf20Sopenharmony_ci u8 enable_coex; 1098c2ecf20Sopenharmony_ci u8 tx_chainmask; 1108c2ecf20Sopenharmony_ci u8 pad; 1118c2ecf20Sopenharmony_ci} __packed; 1128c2ecf20Sopenharmony_ci 1138c2ecf20Sopenharmony_cistruct ath9k_htc_target_vif { 1148c2ecf20Sopenharmony_ci u8 index; 1158c2ecf20Sopenharmony_ci u8 opmode; 1168c2ecf20Sopenharmony_ci u8 myaddr[ETH_ALEN]; 1178c2ecf20Sopenharmony_ci u8 ath_cap; 1188c2ecf20Sopenharmony_ci __be16 rtsthreshold; 1198c2ecf20Sopenharmony_ci u8 pad; 1208c2ecf20Sopenharmony_ci} __packed; 1218c2ecf20Sopenharmony_ci 1228c2ecf20Sopenharmony_cistruct ath9k_htc_target_sta { 1238c2ecf20Sopenharmony_ci u8 macaddr[ETH_ALEN]; 1248c2ecf20Sopenharmony_ci u8 bssid[ETH_ALEN]; 1258c2ecf20Sopenharmony_ci u8 sta_index; 1268c2ecf20Sopenharmony_ci u8 vif_index; 1278c2ecf20Sopenharmony_ci u8 is_vif_sta; 1288c2ecf20Sopenharmony_ci __be16 flags; 1298c2ecf20Sopenharmony_ci __be16 htcap; 1308c2ecf20Sopenharmony_ci __be16 maxampdu; 1318c2ecf20Sopenharmony_ci u8 pad; 1328c2ecf20Sopenharmony_ci} __packed; 1338c2ecf20Sopenharmony_ci 1348c2ecf20Sopenharmony_cistruct ath9k_htc_target_aggr { 1358c2ecf20Sopenharmony_ci u8 sta_index; 1368c2ecf20Sopenharmony_ci u8 tidno; 1378c2ecf20Sopenharmony_ci u8 aggr_enable; 1388c2ecf20Sopenharmony_ci u8 padding; 1398c2ecf20Sopenharmony_ci} __packed; 1408c2ecf20Sopenharmony_ci 1418c2ecf20Sopenharmony_ci#define ATH_HTC_RATE_MAX 30 1428c2ecf20Sopenharmony_ci 1438c2ecf20Sopenharmony_ci#define WLAN_RC_DS_FLAG 0x01 1448c2ecf20Sopenharmony_ci#define WLAN_RC_40_FLAG 0x02 1458c2ecf20Sopenharmony_ci#define WLAN_RC_SGI_FLAG 0x04 1468c2ecf20Sopenharmony_ci#define WLAN_RC_HT_FLAG 0x08 1478c2ecf20Sopenharmony_ci#define ATH_RC_TX_STBC_FLAG 0x20 1488c2ecf20Sopenharmony_ci 1498c2ecf20Sopenharmony_cistruct ath9k_htc_rateset { 1508c2ecf20Sopenharmony_ci u8 rs_nrates; 1518c2ecf20Sopenharmony_ci u8 rs_rates[ATH_HTC_RATE_MAX]; 1528c2ecf20Sopenharmony_ci}; 1538c2ecf20Sopenharmony_ci 1548c2ecf20Sopenharmony_cistruct ath9k_htc_rate { 1558c2ecf20Sopenharmony_ci struct ath9k_htc_rateset legacy_rates; 1568c2ecf20Sopenharmony_ci struct ath9k_htc_rateset ht_rates; 1578c2ecf20Sopenharmony_ci} __packed; 1588c2ecf20Sopenharmony_ci 1598c2ecf20Sopenharmony_cistruct ath9k_htc_target_rate { 1608c2ecf20Sopenharmony_ci u8 sta_index; 1618c2ecf20Sopenharmony_ci u8 isnew; 1628c2ecf20Sopenharmony_ci __be32 capflags; 1638c2ecf20Sopenharmony_ci struct ath9k_htc_rate rates; 1648c2ecf20Sopenharmony_ci}; 1658c2ecf20Sopenharmony_ci 1668c2ecf20Sopenharmony_cistruct ath9k_htc_target_rate_mask { 1678c2ecf20Sopenharmony_ci u8 vif_index; 1688c2ecf20Sopenharmony_ci u8 band; 1698c2ecf20Sopenharmony_ci __be32 mask; 1708c2ecf20Sopenharmony_ci u16 pad; 1718c2ecf20Sopenharmony_ci} __packed; 1728c2ecf20Sopenharmony_ci 1738c2ecf20Sopenharmony_cistruct ath9k_htc_target_int_stats { 1748c2ecf20Sopenharmony_ci __be32 rx; 1758c2ecf20Sopenharmony_ci __be32 rxorn; 1768c2ecf20Sopenharmony_ci __be32 rxeol; 1778c2ecf20Sopenharmony_ci __be32 txurn; 1788c2ecf20Sopenharmony_ci __be32 txto; 1798c2ecf20Sopenharmony_ci __be32 cst; 1808c2ecf20Sopenharmony_ci} __packed; 1818c2ecf20Sopenharmony_ci 1828c2ecf20Sopenharmony_cistruct ath9k_htc_target_tx_stats { 1838c2ecf20Sopenharmony_ci __be32 xretries; 1848c2ecf20Sopenharmony_ci __be32 fifoerr; 1858c2ecf20Sopenharmony_ci __be32 filtered; 1868c2ecf20Sopenharmony_ci __be32 timer_exp; 1878c2ecf20Sopenharmony_ci __be32 shortretries; 1888c2ecf20Sopenharmony_ci __be32 longretries; 1898c2ecf20Sopenharmony_ci __be32 qnull; 1908c2ecf20Sopenharmony_ci __be32 encap_fail; 1918c2ecf20Sopenharmony_ci __be32 nobuf; 1928c2ecf20Sopenharmony_ci} __packed; 1938c2ecf20Sopenharmony_ci 1948c2ecf20Sopenharmony_cistruct ath9k_htc_target_rx_stats { 1958c2ecf20Sopenharmony_ci __be32 nobuf; 1968c2ecf20Sopenharmony_ci __be32 host_send; 1978c2ecf20Sopenharmony_ci __be32 host_done; 1988c2ecf20Sopenharmony_ci} __packed; 1998c2ecf20Sopenharmony_ci 2008c2ecf20Sopenharmony_ci#define ATH9K_HTC_MAX_VIF 2 2018c2ecf20Sopenharmony_ci#define ATH9K_HTC_MAX_BCN_VIF 2 2028c2ecf20Sopenharmony_ci 2038c2ecf20Sopenharmony_ci#define INC_VIF(_priv, _type) do { \ 2048c2ecf20Sopenharmony_ci switch (_type) { \ 2058c2ecf20Sopenharmony_ci case NL80211_IFTYPE_STATION: \ 2068c2ecf20Sopenharmony_ci _priv->num_sta_vif++; \ 2078c2ecf20Sopenharmony_ci break; \ 2088c2ecf20Sopenharmony_ci case NL80211_IFTYPE_ADHOC: \ 2098c2ecf20Sopenharmony_ci _priv->num_ibss_vif++; \ 2108c2ecf20Sopenharmony_ci break; \ 2118c2ecf20Sopenharmony_ci case NL80211_IFTYPE_AP: \ 2128c2ecf20Sopenharmony_ci _priv->num_ap_vif++; \ 2138c2ecf20Sopenharmony_ci break; \ 2148c2ecf20Sopenharmony_ci case NL80211_IFTYPE_MESH_POINT: \ 2158c2ecf20Sopenharmony_ci _priv->num_mbss_vif++; \ 2168c2ecf20Sopenharmony_ci break; \ 2178c2ecf20Sopenharmony_ci default: \ 2188c2ecf20Sopenharmony_ci break; \ 2198c2ecf20Sopenharmony_ci } \ 2208c2ecf20Sopenharmony_ci } while (0) 2218c2ecf20Sopenharmony_ci 2228c2ecf20Sopenharmony_ci#define DEC_VIF(_priv, _type) do { \ 2238c2ecf20Sopenharmony_ci switch (_type) { \ 2248c2ecf20Sopenharmony_ci case NL80211_IFTYPE_STATION: \ 2258c2ecf20Sopenharmony_ci _priv->num_sta_vif--; \ 2268c2ecf20Sopenharmony_ci break; \ 2278c2ecf20Sopenharmony_ci case NL80211_IFTYPE_ADHOC: \ 2288c2ecf20Sopenharmony_ci _priv->num_ibss_vif--; \ 2298c2ecf20Sopenharmony_ci break; \ 2308c2ecf20Sopenharmony_ci case NL80211_IFTYPE_AP: \ 2318c2ecf20Sopenharmony_ci _priv->num_ap_vif--; \ 2328c2ecf20Sopenharmony_ci break; \ 2338c2ecf20Sopenharmony_ci case NL80211_IFTYPE_MESH_POINT: \ 2348c2ecf20Sopenharmony_ci _priv->num_mbss_vif--; \ 2358c2ecf20Sopenharmony_ci break; \ 2368c2ecf20Sopenharmony_ci default: \ 2378c2ecf20Sopenharmony_ci break; \ 2388c2ecf20Sopenharmony_ci } \ 2398c2ecf20Sopenharmony_ci } while (0) 2408c2ecf20Sopenharmony_ci 2418c2ecf20Sopenharmony_cistruct ath9k_htc_vif { 2428c2ecf20Sopenharmony_ci u8 index; 2438c2ecf20Sopenharmony_ci u16 seq_no; 2448c2ecf20Sopenharmony_ci bool beacon_configured; 2458c2ecf20Sopenharmony_ci int bslot; 2468c2ecf20Sopenharmony_ci __le64 tsfadjust; 2478c2ecf20Sopenharmony_ci}; 2488c2ecf20Sopenharmony_ci 2498c2ecf20Sopenharmony_cistruct ath9k_vif_iter_data { 2508c2ecf20Sopenharmony_ci const u8 *hw_macaddr; 2518c2ecf20Sopenharmony_ci u8 mask[ETH_ALEN]; 2528c2ecf20Sopenharmony_ci}; 2538c2ecf20Sopenharmony_ci 2548c2ecf20Sopenharmony_ci#define ATH9K_HTC_MAX_STA 8 2558c2ecf20Sopenharmony_ci#define ATH9K_HTC_MAX_TID 8 2568c2ecf20Sopenharmony_ci 2578c2ecf20Sopenharmony_cienum tid_aggr_state { 2588c2ecf20Sopenharmony_ci AGGR_STOP = 0, 2598c2ecf20Sopenharmony_ci AGGR_PROGRESS, 2608c2ecf20Sopenharmony_ci AGGR_START, 2618c2ecf20Sopenharmony_ci AGGR_OPERATIONAL 2628c2ecf20Sopenharmony_ci}; 2638c2ecf20Sopenharmony_ci 2648c2ecf20Sopenharmony_cistruct ath9k_htc_sta { 2658c2ecf20Sopenharmony_ci u8 index; 2668c2ecf20Sopenharmony_ci enum tid_aggr_state tid_state[ATH9K_HTC_MAX_TID]; 2678c2ecf20Sopenharmony_ci struct work_struct rc_update_work; 2688c2ecf20Sopenharmony_ci struct ath9k_htc_priv *htc_priv; 2698c2ecf20Sopenharmony_ci}; 2708c2ecf20Sopenharmony_ci 2718c2ecf20Sopenharmony_ci#define ATH9K_HTC_RXBUF 256 2728c2ecf20Sopenharmony_ci#define HTC_RX_FRAME_HEADER_SIZE 40 2738c2ecf20Sopenharmony_ci 2748c2ecf20Sopenharmony_cistruct ath9k_htc_rxbuf { 2758c2ecf20Sopenharmony_ci bool in_process; 2768c2ecf20Sopenharmony_ci struct sk_buff *skb; 2778c2ecf20Sopenharmony_ci struct ath_htc_rx_status rxstatus; 2788c2ecf20Sopenharmony_ci struct list_head list; 2798c2ecf20Sopenharmony_ci}; 2808c2ecf20Sopenharmony_ci 2818c2ecf20Sopenharmony_cistruct ath9k_htc_rx { 2828c2ecf20Sopenharmony_ci struct list_head rxbuf; 2838c2ecf20Sopenharmony_ci spinlock_t rxbuflock; 2848c2ecf20Sopenharmony_ci bool initialized; 2858c2ecf20Sopenharmony_ci}; 2868c2ecf20Sopenharmony_ci 2878c2ecf20Sopenharmony_ci#define ATH9K_HTC_TX_CLEANUP_INTERVAL 50 /* ms */ 2888c2ecf20Sopenharmony_ci#define ATH9K_HTC_TX_TIMEOUT_INTERVAL 3000 /* ms */ 2898c2ecf20Sopenharmony_ci#define ATH9K_HTC_TX_RESERVE 10 2908c2ecf20Sopenharmony_ci#define ATH9K_HTC_TX_TIMEOUT_COUNT 40 2918c2ecf20Sopenharmony_ci#define ATH9K_HTC_TX_THRESHOLD (MAX_TX_BUF_NUM - ATH9K_HTC_TX_RESERVE) 2928c2ecf20Sopenharmony_ci 2938c2ecf20Sopenharmony_ci#define ATH9K_HTC_OP_TX_QUEUES_STOP BIT(0) 2948c2ecf20Sopenharmony_ci#define ATH9K_HTC_OP_TX_DRAIN BIT(1) 2958c2ecf20Sopenharmony_ci 2968c2ecf20Sopenharmony_cistruct ath9k_htc_tx { 2978c2ecf20Sopenharmony_ci u8 flags; 2988c2ecf20Sopenharmony_ci int queued_cnt; 2998c2ecf20Sopenharmony_ci struct sk_buff_head mgmt_ep_queue; 3008c2ecf20Sopenharmony_ci struct sk_buff_head cab_ep_queue; 3018c2ecf20Sopenharmony_ci struct sk_buff_head data_be_queue; 3028c2ecf20Sopenharmony_ci struct sk_buff_head data_bk_queue; 3038c2ecf20Sopenharmony_ci struct sk_buff_head data_vi_queue; 3048c2ecf20Sopenharmony_ci struct sk_buff_head data_vo_queue; 3058c2ecf20Sopenharmony_ci struct sk_buff_head tx_failed; 3068c2ecf20Sopenharmony_ci DECLARE_BITMAP(tx_slot, MAX_TX_BUF_NUM); 3078c2ecf20Sopenharmony_ci struct timer_list cleanup_timer; 3088c2ecf20Sopenharmony_ci spinlock_t tx_lock; 3098c2ecf20Sopenharmony_ci bool initialized; 3108c2ecf20Sopenharmony_ci}; 3118c2ecf20Sopenharmony_ci 3128c2ecf20Sopenharmony_cistruct ath9k_htc_tx_ctl { 3138c2ecf20Sopenharmony_ci u8 type; /* ATH9K_HTC_* */ 3148c2ecf20Sopenharmony_ci u8 epid; 3158c2ecf20Sopenharmony_ci u8 txok; 3168c2ecf20Sopenharmony_ci u8 sta_idx; 3178c2ecf20Sopenharmony_ci unsigned long timestamp; 3188c2ecf20Sopenharmony_ci}; 3198c2ecf20Sopenharmony_ci 3208c2ecf20Sopenharmony_cistatic inline struct ath9k_htc_tx_ctl *HTC_SKB_CB(struct sk_buff *skb) 3218c2ecf20Sopenharmony_ci{ 3228c2ecf20Sopenharmony_ci struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); 3238c2ecf20Sopenharmony_ci 3248c2ecf20Sopenharmony_ci BUILD_BUG_ON(sizeof(struct ath9k_htc_tx_ctl) > 3258c2ecf20Sopenharmony_ci IEEE80211_TX_INFO_DRIVER_DATA_SIZE); 3268c2ecf20Sopenharmony_ci return (struct ath9k_htc_tx_ctl *) &tx_info->driver_data; 3278c2ecf20Sopenharmony_ci} 3288c2ecf20Sopenharmony_ci 3298c2ecf20Sopenharmony_ci#ifdef CONFIG_ATH9K_HTC_DEBUGFS 3308c2ecf20Sopenharmony_ci#define __STAT_SAFE(hif_dev, expr) do { ((hif_dev)->htc_handle->drv_priv ? (expr) : 0); } while (0) 3318c2ecf20Sopenharmony_ci#define CAB_STAT_INC(priv) do { ((priv)->debug.tx_stats.cab_queued++); } while (0) 3328c2ecf20Sopenharmony_ci#define TX_QSTAT_INC(priv, q) do { ((priv)->debug.tx_stats.queue_stats[q]++); } while (0) 3338c2ecf20Sopenharmony_ci 3348c2ecf20Sopenharmony_ci#define TX_STAT_INC(hif_dev, c) \ 3358c2ecf20Sopenharmony_ci __STAT_SAFE((hif_dev), (hif_dev)->htc_handle->drv_priv->debug.tx_stats.c++) 3368c2ecf20Sopenharmony_ci#define TX_STAT_ADD(hif_dev, c, a) \ 3378c2ecf20Sopenharmony_ci __STAT_SAFE((hif_dev), (hif_dev)->htc_handle->drv_priv->debug.tx_stats.c += a) 3388c2ecf20Sopenharmony_ci#define RX_STAT_INC(hif_dev, c) \ 3398c2ecf20Sopenharmony_ci __STAT_SAFE((hif_dev), (hif_dev)->htc_handle->drv_priv->debug.skbrx_stats.c++) 3408c2ecf20Sopenharmony_ci#define RX_STAT_ADD(hif_dev, c, a) \ 3418c2ecf20Sopenharmony_ci __STAT_SAFE((hif_dev), (hif_dev)->htc_handle->drv_priv->debug.skbrx_stats.c += a) 3428c2ecf20Sopenharmony_ci 3438c2ecf20Sopenharmony_civoid ath9k_htc_err_stat_rx(struct ath9k_htc_priv *priv, 3448c2ecf20Sopenharmony_ci struct ath_rx_status *rs); 3458c2ecf20Sopenharmony_ci 3468c2ecf20Sopenharmony_cistruct ath_tx_stats { 3478c2ecf20Sopenharmony_ci u32 buf_queued; 3488c2ecf20Sopenharmony_ci u32 buf_completed; 3498c2ecf20Sopenharmony_ci u32 skb_queued; 3508c2ecf20Sopenharmony_ci u32 skb_success; 3518c2ecf20Sopenharmony_ci u32 skb_success_bytes; 3528c2ecf20Sopenharmony_ci u32 skb_failed; 3538c2ecf20Sopenharmony_ci u32 cab_queued; 3548c2ecf20Sopenharmony_ci u32 queue_stats[IEEE80211_NUM_ACS]; 3558c2ecf20Sopenharmony_ci}; 3568c2ecf20Sopenharmony_ci 3578c2ecf20Sopenharmony_cistruct ath_skbrx_stats { 3588c2ecf20Sopenharmony_ci u32 skb_allocated; 3598c2ecf20Sopenharmony_ci u32 skb_completed; 3608c2ecf20Sopenharmony_ci u32 skb_completed_bytes; 3618c2ecf20Sopenharmony_ci u32 skb_dropped; 3628c2ecf20Sopenharmony_ci}; 3638c2ecf20Sopenharmony_ci 3648c2ecf20Sopenharmony_cistruct ath9k_debug { 3658c2ecf20Sopenharmony_ci struct dentry *debugfs_phy; 3668c2ecf20Sopenharmony_ci struct ath_tx_stats tx_stats; 3678c2ecf20Sopenharmony_ci struct ath_rx_stats rx_stats; 3688c2ecf20Sopenharmony_ci struct ath_skbrx_stats skbrx_stats; 3698c2ecf20Sopenharmony_ci}; 3708c2ecf20Sopenharmony_ci 3718c2ecf20Sopenharmony_civoid ath9k_htc_get_et_strings(struct ieee80211_hw *hw, 3728c2ecf20Sopenharmony_ci struct ieee80211_vif *vif, 3738c2ecf20Sopenharmony_ci u32 sset, u8 *data); 3748c2ecf20Sopenharmony_ciint ath9k_htc_get_et_sset_count(struct ieee80211_hw *hw, 3758c2ecf20Sopenharmony_ci struct ieee80211_vif *vif, int sset); 3768c2ecf20Sopenharmony_civoid ath9k_htc_get_et_stats(struct ieee80211_hw *hw, 3778c2ecf20Sopenharmony_ci struct ieee80211_vif *vif, 3788c2ecf20Sopenharmony_ci struct ethtool_stats *stats, u64 *data); 3798c2ecf20Sopenharmony_ci#else 3808c2ecf20Sopenharmony_ci 3818c2ecf20Sopenharmony_ci#define TX_STAT_INC(hif_dev, c) do { } while (0) 3828c2ecf20Sopenharmony_ci#define TX_STAT_ADD(hif_dev, c, a) do { } while (0) 3838c2ecf20Sopenharmony_ci#define RX_STAT_INC(hif_dev, c) do { } while (0) 3848c2ecf20Sopenharmony_ci#define RX_STAT_ADD(hif_dev, c, a) do { } while (0) 3858c2ecf20Sopenharmony_ci 3868c2ecf20Sopenharmony_ci#define CAB_STAT_INC(priv) 3878c2ecf20Sopenharmony_ci#define TX_QSTAT_INC(priv, c) 3888c2ecf20Sopenharmony_ci 3898c2ecf20Sopenharmony_cistatic inline void ath9k_htc_err_stat_rx(struct ath9k_htc_priv *priv, 3908c2ecf20Sopenharmony_ci struct ath_rx_status *rs) 3918c2ecf20Sopenharmony_ci{ 3928c2ecf20Sopenharmony_ci} 3938c2ecf20Sopenharmony_ci 3948c2ecf20Sopenharmony_ci#endif /* CONFIG_ATH9K_HTC_DEBUGFS */ 3958c2ecf20Sopenharmony_ci 3968c2ecf20Sopenharmony_ci#define ATH_LED_PIN_DEF 1 3978c2ecf20Sopenharmony_ci#define ATH_LED_PIN_9287 10 3988c2ecf20Sopenharmony_ci#define ATH_LED_PIN_9271 15 3998c2ecf20Sopenharmony_ci#define ATH_LED_PIN_7010 12 4008c2ecf20Sopenharmony_ci 4018c2ecf20Sopenharmony_ci#define BSTUCK_THRESHOLD 10 4028c2ecf20Sopenharmony_ci 4038c2ecf20Sopenharmony_ci/* 4048c2ecf20Sopenharmony_ci * Adjust these when the max. no of beaconing interfaces is 4058c2ecf20Sopenharmony_ci * increased. 4068c2ecf20Sopenharmony_ci */ 4078c2ecf20Sopenharmony_ci#define DEFAULT_SWBA_RESPONSE 40 /* in TUs */ 4088c2ecf20Sopenharmony_ci#define MIN_SWBA_RESPONSE 10 /* in TUs */ 4098c2ecf20Sopenharmony_ci 4108c2ecf20Sopenharmony_cistruct htc_beacon { 4118c2ecf20Sopenharmony_ci enum { 4128c2ecf20Sopenharmony_ci OK, /* no change needed */ 4138c2ecf20Sopenharmony_ci UPDATE, /* update pending */ 4148c2ecf20Sopenharmony_ci COMMIT /* beacon sent, commit change */ 4158c2ecf20Sopenharmony_ci } updateslot; /* slot time update fsm */ 4168c2ecf20Sopenharmony_ci 4178c2ecf20Sopenharmony_ci struct ieee80211_vif *bslot[ATH9K_HTC_MAX_BCN_VIF]; 4188c2ecf20Sopenharmony_ci u32 bmisscnt; 4198c2ecf20Sopenharmony_ci u32 beaconq; 4208c2ecf20Sopenharmony_ci int slottime; 4218c2ecf20Sopenharmony_ci int slotupdate; 4228c2ecf20Sopenharmony_ci}; 4238c2ecf20Sopenharmony_ci 4248c2ecf20Sopenharmony_cistruct ath_btcoex { 4258c2ecf20Sopenharmony_ci u32 bt_priority_cnt; 4268c2ecf20Sopenharmony_ci unsigned long bt_priority_time; 4278c2ecf20Sopenharmony_ci int bt_stomp_type; /* Types of BT stomping */ 4288c2ecf20Sopenharmony_ci u32 btcoex_no_stomp; 4298c2ecf20Sopenharmony_ci u32 btcoex_period; 4308c2ecf20Sopenharmony_ci u32 btscan_no_stomp; 4318c2ecf20Sopenharmony_ci}; 4328c2ecf20Sopenharmony_ci 4338c2ecf20Sopenharmony_ci#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT 4348c2ecf20Sopenharmony_civoid ath9k_htc_init_btcoex(struct ath9k_htc_priv *priv, char *product); 4358c2ecf20Sopenharmony_civoid ath9k_htc_start_btcoex(struct ath9k_htc_priv *priv); 4368c2ecf20Sopenharmony_civoid ath9k_htc_stop_btcoex(struct ath9k_htc_priv *priv); 4378c2ecf20Sopenharmony_ci#else 4388c2ecf20Sopenharmony_cistatic inline void ath9k_htc_init_btcoex(struct ath9k_htc_priv *priv, char *product) 4398c2ecf20Sopenharmony_ci{ 4408c2ecf20Sopenharmony_ci} 4418c2ecf20Sopenharmony_cistatic inline void ath9k_htc_start_btcoex(struct ath9k_htc_priv *priv) 4428c2ecf20Sopenharmony_ci{ 4438c2ecf20Sopenharmony_ci} 4448c2ecf20Sopenharmony_cistatic inline void ath9k_htc_stop_btcoex(struct ath9k_htc_priv *priv) 4458c2ecf20Sopenharmony_ci{ 4468c2ecf20Sopenharmony_ci} 4478c2ecf20Sopenharmony_ci#endif /* CONFIG_ATH9K_BTCOEX_SUPPORT */ 4488c2ecf20Sopenharmony_ci 4498c2ecf20Sopenharmony_ci#define OP_BT_PRIORITY_DETECTED 3 4508c2ecf20Sopenharmony_ci#define OP_BT_SCAN 4 4518c2ecf20Sopenharmony_ci#define OP_TSF_RESET 6 4528c2ecf20Sopenharmony_ci 4538c2ecf20Sopenharmony_cienum htc_op_flags { 4548c2ecf20Sopenharmony_ci HTC_FWFLAG_NO_RMW, 4558c2ecf20Sopenharmony_ci}; 4568c2ecf20Sopenharmony_ci 4578c2ecf20Sopenharmony_cistruct ath9k_htc_priv { 4588c2ecf20Sopenharmony_ci struct device *dev; 4598c2ecf20Sopenharmony_ci struct ieee80211_hw *hw; 4608c2ecf20Sopenharmony_ci struct ath_hw *ah; 4618c2ecf20Sopenharmony_ci struct htc_target *htc; 4628c2ecf20Sopenharmony_ci struct wmi *wmi; 4638c2ecf20Sopenharmony_ci 4648c2ecf20Sopenharmony_ci u16 fw_version_major; 4658c2ecf20Sopenharmony_ci u16 fw_version_minor; 4668c2ecf20Sopenharmony_ci 4678c2ecf20Sopenharmony_ci enum htc_endpoint_id wmi_cmd_ep; 4688c2ecf20Sopenharmony_ci enum htc_endpoint_id beacon_ep; 4698c2ecf20Sopenharmony_ci enum htc_endpoint_id cab_ep; 4708c2ecf20Sopenharmony_ci enum htc_endpoint_id uapsd_ep; 4718c2ecf20Sopenharmony_ci enum htc_endpoint_id mgmt_ep; 4728c2ecf20Sopenharmony_ci enum htc_endpoint_id data_be_ep; 4738c2ecf20Sopenharmony_ci enum htc_endpoint_id data_bk_ep; 4748c2ecf20Sopenharmony_ci enum htc_endpoint_id data_vi_ep; 4758c2ecf20Sopenharmony_ci enum htc_endpoint_id data_vo_ep; 4768c2ecf20Sopenharmony_ci 4778c2ecf20Sopenharmony_ci u8 vif_slot; 4788c2ecf20Sopenharmony_ci u8 mon_vif_idx; 4798c2ecf20Sopenharmony_ci u8 sta_slot; 4808c2ecf20Sopenharmony_ci u8 vif_sta_pos[ATH9K_HTC_MAX_VIF]; 4818c2ecf20Sopenharmony_ci u8 num_ibss_vif; 4828c2ecf20Sopenharmony_ci u8 num_mbss_vif; 4838c2ecf20Sopenharmony_ci u8 num_sta_vif; 4848c2ecf20Sopenharmony_ci u8 num_sta_assoc_vif; 4858c2ecf20Sopenharmony_ci u8 num_ap_vif; 4868c2ecf20Sopenharmony_ci 4878c2ecf20Sopenharmony_ci u16 curtxpow; 4888c2ecf20Sopenharmony_ci u16 txpowlimit; 4898c2ecf20Sopenharmony_ci u16 nvifs; 4908c2ecf20Sopenharmony_ci u16 nstations; 4918c2ecf20Sopenharmony_ci bool rearm_ani; 4928c2ecf20Sopenharmony_ci bool reconfig_beacon; 4938c2ecf20Sopenharmony_ci unsigned int rxfilter; 4948c2ecf20Sopenharmony_ci unsigned long op_flags; 4958c2ecf20Sopenharmony_ci unsigned long fw_flags; 4968c2ecf20Sopenharmony_ci 4978c2ecf20Sopenharmony_ci struct ath9k_hw_cal_data caldata; 4988c2ecf20Sopenharmony_ci struct ath_spec_scan_priv spec_priv; 4998c2ecf20Sopenharmony_ci 5008c2ecf20Sopenharmony_ci spinlock_t beacon_lock; 5018c2ecf20Sopenharmony_ci struct ath_beacon_config cur_beacon_conf; 5028c2ecf20Sopenharmony_ci struct htc_beacon beacon; 5038c2ecf20Sopenharmony_ci 5048c2ecf20Sopenharmony_ci struct ath9k_htc_rx rx; 5058c2ecf20Sopenharmony_ci struct ath9k_htc_tx tx; 5068c2ecf20Sopenharmony_ci 5078c2ecf20Sopenharmony_ci struct tasklet_struct swba_tasklet; 5088c2ecf20Sopenharmony_ci struct tasklet_struct rx_tasklet; 5098c2ecf20Sopenharmony_ci struct delayed_work ani_work; 5108c2ecf20Sopenharmony_ci struct tasklet_struct tx_failed_tasklet; 5118c2ecf20Sopenharmony_ci struct work_struct ps_work; 5128c2ecf20Sopenharmony_ci struct work_struct fatal_work; 5138c2ecf20Sopenharmony_ci 5148c2ecf20Sopenharmony_ci struct mutex htc_pm_lock; 5158c2ecf20Sopenharmony_ci unsigned long ps_usecount; 5168c2ecf20Sopenharmony_ci bool ps_enabled; 5178c2ecf20Sopenharmony_ci bool ps_idle; 5188c2ecf20Sopenharmony_ci 5198c2ecf20Sopenharmony_ci#ifdef CONFIG_MAC80211_LEDS 5208c2ecf20Sopenharmony_ci enum led_brightness brightness; 5218c2ecf20Sopenharmony_ci bool led_registered; 5228c2ecf20Sopenharmony_ci char led_name[32]; 5238c2ecf20Sopenharmony_ci struct led_classdev led_cdev; 5248c2ecf20Sopenharmony_ci struct work_struct led_work; 5258c2ecf20Sopenharmony_ci#endif 5268c2ecf20Sopenharmony_ci 5278c2ecf20Sopenharmony_ci int cabq; 5288c2ecf20Sopenharmony_ci int hwq_map[IEEE80211_NUM_ACS]; 5298c2ecf20Sopenharmony_ci 5308c2ecf20Sopenharmony_ci#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT 5318c2ecf20Sopenharmony_ci struct ath_btcoex btcoex; 5328c2ecf20Sopenharmony_ci#endif 5338c2ecf20Sopenharmony_ci 5348c2ecf20Sopenharmony_ci struct delayed_work coex_period_work; 5358c2ecf20Sopenharmony_ci struct delayed_work duty_cycle_work; 5368c2ecf20Sopenharmony_ci#ifdef CONFIG_ATH9K_HTC_DEBUGFS 5378c2ecf20Sopenharmony_ci struct ath9k_debug debug; 5388c2ecf20Sopenharmony_ci#endif 5398c2ecf20Sopenharmony_ci struct mutex mutex; 5408c2ecf20Sopenharmony_ci struct ieee80211_vif *csa_vif; 5418c2ecf20Sopenharmony_ci}; 5428c2ecf20Sopenharmony_ci 5438c2ecf20Sopenharmony_cistatic inline void ath_read_cachesize(struct ath_common *common, int *csz) 5448c2ecf20Sopenharmony_ci{ 5458c2ecf20Sopenharmony_ci common->bus_ops->read_cachesize(common, csz); 5468c2ecf20Sopenharmony_ci} 5478c2ecf20Sopenharmony_ci 5488c2ecf20Sopenharmony_civoid ath9k_htc_reset(struct ath9k_htc_priv *priv); 5498c2ecf20Sopenharmony_ci 5508c2ecf20Sopenharmony_civoid ath9k_htc_assign_bslot(struct ath9k_htc_priv *priv, 5518c2ecf20Sopenharmony_ci struct ieee80211_vif *vif); 5528c2ecf20Sopenharmony_civoid ath9k_htc_remove_bslot(struct ath9k_htc_priv *priv, 5538c2ecf20Sopenharmony_ci struct ieee80211_vif *vif); 5548c2ecf20Sopenharmony_civoid ath9k_htc_set_tsfadjust(struct ath9k_htc_priv *priv, 5558c2ecf20Sopenharmony_ci struct ieee80211_vif *vif); 5568c2ecf20Sopenharmony_civoid ath9k_htc_beaconq_config(struct ath9k_htc_priv *priv); 5578c2ecf20Sopenharmony_civoid ath9k_htc_beacon_config(struct ath9k_htc_priv *priv, 5588c2ecf20Sopenharmony_ci struct ieee80211_vif *vif); 5598c2ecf20Sopenharmony_civoid ath9k_htc_beacon_reconfig(struct ath9k_htc_priv *priv); 5608c2ecf20Sopenharmony_civoid ath9k_htc_swba(struct ath9k_htc_priv *priv, 5618c2ecf20Sopenharmony_ci struct wmi_event_swba *swba); 5628c2ecf20Sopenharmony_ci 5638c2ecf20Sopenharmony_civoid ath9k_htc_rxep(void *priv, struct sk_buff *skb, 5648c2ecf20Sopenharmony_ci enum htc_endpoint_id ep_id); 5658c2ecf20Sopenharmony_civoid ath9k_htc_txep(void *priv, struct sk_buff *skb, enum htc_endpoint_id ep_id, 5668c2ecf20Sopenharmony_ci bool txok); 5678c2ecf20Sopenharmony_civoid ath9k_htc_beaconep(void *drv_priv, struct sk_buff *skb, 5688c2ecf20Sopenharmony_ci enum htc_endpoint_id ep_id, bool txok); 5698c2ecf20Sopenharmony_ci 5708c2ecf20Sopenharmony_ciint ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv, 5718c2ecf20Sopenharmony_ci u8 enable_coex); 5728c2ecf20Sopenharmony_civoid ath9k_htc_ani_work(struct work_struct *work); 5738c2ecf20Sopenharmony_civoid ath9k_htc_start_ani(struct ath9k_htc_priv *priv); 5748c2ecf20Sopenharmony_civoid ath9k_htc_stop_ani(struct ath9k_htc_priv *priv); 5758c2ecf20Sopenharmony_ci 5768c2ecf20Sopenharmony_ciint ath9k_tx_init(struct ath9k_htc_priv *priv); 5778c2ecf20Sopenharmony_ciint ath9k_htc_tx_start(struct ath9k_htc_priv *priv, 5788c2ecf20Sopenharmony_ci struct ieee80211_sta *sta, 5798c2ecf20Sopenharmony_ci struct sk_buff *skb, u8 slot, bool is_cab); 5808c2ecf20Sopenharmony_civoid ath9k_tx_cleanup(struct ath9k_htc_priv *priv); 5818c2ecf20Sopenharmony_cibool ath9k_htc_txq_setup(struct ath9k_htc_priv *priv, int subtype); 5828c2ecf20Sopenharmony_ciint ath9k_htc_cabq_setup(struct ath9k_htc_priv *priv); 5838c2ecf20Sopenharmony_ciint get_hw_qnum(u16 queue, int *hwq_map); 5848c2ecf20Sopenharmony_ciint ath_htc_txq_update(struct ath9k_htc_priv *priv, int qnum, 5858c2ecf20Sopenharmony_ci struct ath9k_tx_queue_info *qinfo); 5868c2ecf20Sopenharmony_civoid ath9k_htc_check_stop_queues(struct ath9k_htc_priv *priv); 5878c2ecf20Sopenharmony_civoid ath9k_htc_check_wake_queues(struct ath9k_htc_priv *priv); 5888c2ecf20Sopenharmony_ciint ath9k_htc_tx_get_slot(struct ath9k_htc_priv *priv); 5898c2ecf20Sopenharmony_civoid ath9k_htc_tx_clear_slot(struct ath9k_htc_priv *priv, int slot); 5908c2ecf20Sopenharmony_civoid ath9k_htc_tx_drain(struct ath9k_htc_priv *priv); 5918c2ecf20Sopenharmony_civoid ath9k_htc_txstatus(struct ath9k_htc_priv *priv, void *wmi_event); 5928c2ecf20Sopenharmony_civoid ath9k_tx_failed_tasklet(struct tasklet_struct *t); 5938c2ecf20Sopenharmony_civoid ath9k_htc_tx_cleanup_timer(struct timer_list *t); 5948c2ecf20Sopenharmony_cibool ath9k_htc_csa_is_finished(struct ath9k_htc_priv *priv); 5958c2ecf20Sopenharmony_ci 5968c2ecf20Sopenharmony_ciint ath9k_rx_init(struct ath9k_htc_priv *priv); 5978c2ecf20Sopenharmony_civoid ath9k_rx_cleanup(struct ath9k_htc_priv *priv); 5988c2ecf20Sopenharmony_civoid ath9k_host_rx_init(struct ath9k_htc_priv *priv); 5998c2ecf20Sopenharmony_civoid ath9k_rx_tasklet(struct tasklet_struct *t); 6008c2ecf20Sopenharmony_ciu32 ath9k_htc_calcrxfilter(struct ath9k_htc_priv *priv); 6018c2ecf20Sopenharmony_ci 6028c2ecf20Sopenharmony_civoid ath9k_htc_ps_wakeup(struct ath9k_htc_priv *priv); 6038c2ecf20Sopenharmony_civoid ath9k_htc_ps_restore(struct ath9k_htc_priv *priv); 6048c2ecf20Sopenharmony_civoid ath9k_ps_work(struct work_struct *work); 6058c2ecf20Sopenharmony_cibool ath9k_htc_setpower(struct ath9k_htc_priv *priv, 6068c2ecf20Sopenharmony_ci enum ath9k_power_mode mode); 6078c2ecf20Sopenharmony_ci 6088c2ecf20Sopenharmony_civoid ath9k_start_rfkill_poll(struct ath9k_htc_priv *priv); 6098c2ecf20Sopenharmony_civoid ath9k_htc_rfkill_poll_state(struct ieee80211_hw *hw); 6108c2ecf20Sopenharmony_ci 6118c2ecf20Sopenharmony_cistruct base_eep_header *ath9k_htc_get_eeprom_base(struct ath9k_htc_priv *priv); 6128c2ecf20Sopenharmony_ci 6138c2ecf20Sopenharmony_ci#ifdef CONFIG_MAC80211_LEDS 6148c2ecf20Sopenharmony_civoid ath9k_configure_leds(struct ath9k_htc_priv *priv); 6158c2ecf20Sopenharmony_civoid ath9k_init_leds(struct ath9k_htc_priv *priv); 6168c2ecf20Sopenharmony_civoid ath9k_deinit_leds(struct ath9k_htc_priv *priv); 6178c2ecf20Sopenharmony_civoid ath9k_led_work(struct work_struct *work); 6188c2ecf20Sopenharmony_ci#else 6198c2ecf20Sopenharmony_cistatic inline void ath9k_configure_leds(struct ath9k_htc_priv *priv) 6208c2ecf20Sopenharmony_ci{ 6218c2ecf20Sopenharmony_ci} 6228c2ecf20Sopenharmony_ci 6238c2ecf20Sopenharmony_cistatic inline void ath9k_init_leds(struct ath9k_htc_priv *priv) 6248c2ecf20Sopenharmony_ci{ 6258c2ecf20Sopenharmony_ci} 6268c2ecf20Sopenharmony_ci 6278c2ecf20Sopenharmony_cistatic inline void ath9k_deinit_leds(struct ath9k_htc_priv *priv) 6288c2ecf20Sopenharmony_ci{ 6298c2ecf20Sopenharmony_ci} 6308c2ecf20Sopenharmony_ci 6318c2ecf20Sopenharmony_cistatic inline void ath9k_led_work(struct work_struct *work) 6328c2ecf20Sopenharmony_ci{ 6338c2ecf20Sopenharmony_ci} 6348c2ecf20Sopenharmony_ci#endif 6358c2ecf20Sopenharmony_ci 6368c2ecf20Sopenharmony_ciint ath9k_htc_probe_device(struct htc_target *htc_handle, struct device *dev, 6378c2ecf20Sopenharmony_ci u16 devid, char *product, u32 drv_info); 6388c2ecf20Sopenharmony_civoid ath9k_htc_disconnect_device(struct htc_target *htc_handle, bool hotunplug); 6398c2ecf20Sopenharmony_ci#ifdef CONFIG_PM 6408c2ecf20Sopenharmony_civoid ath9k_htc_suspend(struct htc_target *htc_handle); 6418c2ecf20Sopenharmony_ciint ath9k_htc_resume(struct htc_target *htc_handle); 6428c2ecf20Sopenharmony_ci#endif 6438c2ecf20Sopenharmony_ci#ifdef CONFIG_ATH9K_HTC_DEBUGFS 6448c2ecf20Sopenharmony_ciint ath9k_htc_init_debug(struct ath_hw *ah); 6458c2ecf20Sopenharmony_civoid ath9k_htc_deinit_debug(struct ath9k_htc_priv *priv); 6468c2ecf20Sopenharmony_ci#else 6478c2ecf20Sopenharmony_cistatic inline int ath9k_htc_init_debug(struct ath_hw *ah) { return 0; }; 6488c2ecf20Sopenharmony_cistatic inline void ath9k_htc_deinit_debug(struct ath9k_htc_priv *priv) 6498c2ecf20Sopenharmony_ci{ 6508c2ecf20Sopenharmony_ci} 6518c2ecf20Sopenharmony_ci#endif /* CONFIG_ATH9K_HTC_DEBUGFS */ 6528c2ecf20Sopenharmony_ci 6538c2ecf20Sopenharmony_ci#endif /* HTC_H */ 654