Skip to content

Commit abd5f00

Browse files
author
Kalle Valo
committed
Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
ath.git patches for 4.17. Major changes: wil6210 * support multiple virtual interfaces
2 parents 996bfed + 6767b30 commit abd5f00

43 files changed

Lines changed: 3446 additions & 1015 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎drivers/net/wireless/ath/ath10k/core.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
22
* Copyright (c) 2005-2011 Atheros Communications Inc.
33
* Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
4+
* Copyright (c) 2018, The Linux Foundation. All rights reserved.
45
*
56
* Permission to use, copy, modify, and/or distribute this software for any
67
* purpose with or without fee is hereby granted, provided that the above
@@ -2439,7 +2440,7 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
24392440

24402441
ret = ath10k_hif_power_up(ar);
24412442
if (ret) {
2442-
ath10k_err(ar, "could not start pci hif (%d)\n", ret);
2443+
ath10k_err(ar, "could not power on hif bus (%d)\n", ret);
24432444
return ret;
24442445
}
24452446

‎drivers/net/wireless/ath/ath10k/core.h‎

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
22
* Copyright (c) 2005-2011 Atheros Communications Inc.
33
* Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
4+
* Copyright (c) 2018, The Linux Foundation. All rights reserved.
45
*
56
* Permission to use, copy, modify, and/or distribute this software for any
67
* purpose with or without fee is hereby granted, provided that the above
@@ -324,6 +325,27 @@ struct ath10k_tpc_stats {
324325
struct ath10k_tpc_table tpc_table[WMI_TPC_FLAG];
325326
};
326327

328+
struct ath10k_tpc_table_final {
329+
u32 pream_idx[WMI_TPC_FINAL_RATE_MAX];
330+
u8 rate_code[WMI_TPC_FINAL_RATE_MAX];
331+
char tpc_value[WMI_TPC_FINAL_RATE_MAX][WMI_TPC_TX_N_CHAIN * WMI_TPC_BUF_SIZE];
332+
};
333+
334+
struct ath10k_tpc_stats_final {
335+
u32 reg_domain;
336+
u32 chan_freq;
337+
u32 phy_mode;
338+
u32 twice_antenna_reduction;
339+
u32 twice_max_rd_power;
340+
s32 twice_antenna_gain;
341+
u32 power_limit;
342+
u32 num_tx_chain;
343+
u32 ctl;
344+
u32 rate_max;
345+
u8 flag[WMI_TPC_FLAG];
346+
struct ath10k_tpc_table_final tpc_table_final[WMI_TPC_FLAG];
347+
};
348+
327349
struct ath10k_dfs_stats {
328350
u32 phy_errors;
329351
u32 pulses_total;
@@ -354,6 +376,45 @@ struct ath10k_txq {
354376
unsigned long num_push_allowed;
355377
};
356378

379+
enum ath10k_pkt_rx_err {
380+
ATH10K_PKT_RX_ERR_FCS,
381+
ATH10K_PKT_RX_ERR_TKIP,
382+
ATH10K_PKT_RX_ERR_CRYPT,
383+
ATH10K_PKT_RX_ERR_PEER_IDX_INVAL,
384+
ATH10K_PKT_RX_ERR_MAX,
385+
};
386+
387+
enum ath10k_ampdu_subfrm_num {
388+
ATH10K_AMPDU_SUBFRM_NUM_10,
389+
ATH10K_AMPDU_SUBFRM_NUM_20,
390+
ATH10K_AMPDU_SUBFRM_NUM_30,
391+
ATH10K_AMPDU_SUBFRM_NUM_40,
392+
ATH10K_AMPDU_SUBFRM_NUM_50,
393+
ATH10K_AMPDU_SUBFRM_NUM_60,
394+
ATH10K_AMPDU_SUBFRM_NUM_MORE,
395+
ATH10K_AMPDU_SUBFRM_NUM_MAX,
396+
};
397+
398+
enum ath10k_amsdu_subfrm_num {
399+
ATH10K_AMSDU_SUBFRM_NUM_1,
400+
ATH10K_AMSDU_SUBFRM_NUM_2,
401+
ATH10K_AMSDU_SUBFRM_NUM_3,
402+
ATH10K_AMSDU_SUBFRM_NUM_4,
403+
ATH10K_AMSDU_SUBFRM_NUM_MORE,
404+
ATH10K_AMSDU_SUBFRM_NUM_MAX,
405+
};
406+
407+
struct ath10k_sta_tid_stats {
408+
unsigned long int rx_pkt_from_fw;
409+
unsigned long int rx_pkt_unchained;
410+
unsigned long int rx_pkt_drop_chained;
411+
unsigned long int rx_pkt_drop_filter;
412+
unsigned long int rx_pkt_err[ATH10K_PKT_RX_ERR_MAX];
413+
unsigned long int rx_pkt_queued_for_mac;
414+
unsigned long int rx_pkt_ampdu[ATH10K_AMPDU_SUBFRM_NUM_MAX];
415+
unsigned long int rx_pkt_amsdu[ATH10K_AMSDU_SUBFRM_NUM_MAX];
416+
};
417+
357418
struct ath10k_sta {
358419
struct ath10k_vif *arvif;
359420

@@ -371,6 +432,9 @@ struct ath10k_sta {
371432
#ifdef CONFIG_MAC80211_DEBUGFS
372433
/* protected by conf_mutex */
373434
bool aggr_mode;
435+
436+
/* Protected with ar->data_lock */
437+
struct ath10k_sta_tid_stats tid_stats[IEEE80211_NUM_TIDS + 1];
374438
#endif
375439
};
376440

@@ -487,6 +551,7 @@ struct ath10k_debug {
487551

488552
/* used for tpc-dump storage, protected by data-lock */
489553
struct ath10k_tpc_stats *tpc_stats;
554+
struct ath10k_tpc_stats_final *tpc_stats_final;
490555

491556
struct completion tpc_complete;
492557

@@ -1019,6 +1084,8 @@ struct ath10k {
10191084

10201085
void *ce_priv;
10211086

1087+
u32 sta_tid_stats_mask;
1088+
10221089
/* must be last */
10231090
u8 drv_priv[0] __aligned(sizeof(void *));
10241091
};

‎drivers/net/wireless/ath/ath10k/debug.c‎

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1480,6 +1480,19 @@ void ath10k_debug_tpc_stats_process(struct ath10k *ar,
14801480
spin_unlock_bh(&ar->data_lock);
14811481
}
14821482

1483+
void
1484+
ath10k_debug_tpc_stats_final_process(struct ath10k *ar,
1485+
struct ath10k_tpc_stats_final *tpc_stats)
1486+
{
1487+
spin_lock_bh(&ar->data_lock);
1488+
1489+
kfree(ar->debug.tpc_stats_final);
1490+
ar->debug.tpc_stats_final = tpc_stats;
1491+
complete(&ar->debug.tpc_complete);
1492+
1493+
spin_unlock_bh(&ar->data_lock);
1494+
}
1495+
14831496
static void ath10k_tpc_stats_print(struct ath10k_tpc_stats *tpc_stats,
14841497
unsigned int j, char *buf, size_t *len)
14851498
{
@@ -2143,6 +2156,137 @@ static const struct file_operations fops_fw_checksums = {
21432156
.llseek = default_llseek,
21442157
};
21452158

2159+
static ssize_t ath10k_sta_tid_stats_mask_read(struct file *file,
2160+
char __user *user_buf,
2161+
size_t count, loff_t *ppos)
2162+
{
2163+
struct ath10k *ar = file->private_data;
2164+
char buf[32];
2165+
size_t len;
2166+
2167+
len = scnprintf(buf, sizeof(buf), "0x%08x\n", ar->sta_tid_stats_mask);
2168+
return simple_read_from_buffer(user_buf, count, ppos, buf, len);
2169+
}
2170+
2171+
static ssize_t ath10k_sta_tid_stats_mask_write(struct file *file,
2172+
const char __user *user_buf,
2173+
size_t count, loff_t *ppos)
2174+
{
2175+
struct ath10k *ar = file->private_data;
2176+
char buf[32];
2177+
ssize_t len;
2178+
u32 mask;
2179+
2180+
len = min(count, sizeof(buf) - 1);
2181+
if (copy_from_user(buf, user_buf, len))
2182+
return -EFAULT;
2183+
2184+
buf[len] = '\0';
2185+
if (kstrtoint(buf, 0, &mask))
2186+
return -EINVAL;
2187+
2188+
ar->sta_tid_stats_mask = mask;
2189+
2190+
return len;
2191+
}
2192+
2193+
static const struct file_operations fops_sta_tid_stats_mask = {
2194+
.read = ath10k_sta_tid_stats_mask_read,
2195+
.write = ath10k_sta_tid_stats_mask_write,
2196+
.open = simple_open,
2197+
.owner = THIS_MODULE,
2198+
.llseek = default_llseek,
2199+
};
2200+
2201+
static int ath10k_debug_tpc_stats_final_request(struct ath10k *ar)
2202+
{
2203+
int ret;
2204+
unsigned long time_left;
2205+
2206+
lockdep_assert_held(&ar->conf_mutex);
2207+
2208+
reinit_completion(&ar->debug.tpc_complete);
2209+
2210+
ret = ath10k_wmi_pdev_get_tpc_table_cmdid(ar, WMI_TPC_CONFIG_PARAM);
2211+
if (ret) {
2212+
ath10k_warn(ar, "failed to request tpc table cmdid: %d\n", ret);
2213+
return ret;
2214+
}
2215+
2216+
time_left = wait_for_completion_timeout(&ar->debug.tpc_complete,
2217+
1 * HZ);
2218+
if (time_left == 0)
2219+
return -ETIMEDOUT;
2220+
2221+
return 0;
2222+
}
2223+
2224+
static int ath10k_tpc_stats_final_open(struct inode *inode, struct file *file)
2225+
{
2226+
struct ath10k *ar = inode->i_private;
2227+
void *buf;
2228+
int ret;
2229+
2230+
mutex_lock(&ar->conf_mutex);
2231+
2232+
if (ar->state != ATH10K_STATE_ON) {
2233+
ret = -ENETDOWN;
2234+
goto err_unlock;
2235+
}
2236+
2237+
buf = vmalloc(ATH10K_TPC_CONFIG_BUF_SIZE);
2238+
if (!buf) {
2239+
ret = -ENOMEM;
2240+
goto err_unlock;
2241+
}
2242+
2243+
ret = ath10k_debug_tpc_stats_final_request(ar);
2244+
if (ret) {
2245+
ath10k_warn(ar, "failed to request tpc stats final: %d\n",
2246+
ret);
2247+
goto err_free;
2248+
}
2249+
2250+
ath10k_tpc_stats_fill(ar, ar->debug.tpc_stats, buf);
2251+
file->private_data = buf;
2252+
2253+
mutex_unlock(&ar->conf_mutex);
2254+
return 0;
2255+
2256+
err_free:
2257+
vfree(buf);
2258+
2259+
err_unlock:
2260+
mutex_unlock(&ar->conf_mutex);
2261+
return ret;
2262+
}
2263+
2264+
static int ath10k_tpc_stats_final_release(struct inode *inode,
2265+
struct file *file)
2266+
{
2267+
vfree(file->private_data);
2268+
2269+
return 0;
2270+
}
2271+
2272+
static ssize_t ath10k_tpc_stats_final_read(struct file *file,
2273+
char __user *user_buf,
2274+
size_t count, loff_t *ppos)
2275+
{
2276+
const char *buf = file->private_data;
2277+
unsigned int len = strlen(buf);
2278+
2279+
return simple_read_from_buffer(user_buf, count, ppos, buf, len);
2280+
}
2281+
2282+
static const struct file_operations fops_tpc_stats_final = {
2283+
.open = ath10k_tpc_stats_final_open,
2284+
.release = ath10k_tpc_stats_final_release,
2285+
.read = ath10k_tpc_stats_final_read,
2286+
.owner = THIS_MODULE,
2287+
.llseek = default_llseek,
2288+
};
2289+
21462290
int ath10k_debug_create(struct ath10k *ar)
21472291
{
21482292
ar->debug.cal_data = vzalloc(ATH10K_DEBUG_CAL_DATA_LEN);
@@ -2258,6 +2402,16 @@ int ath10k_debug_register(struct ath10k *ar)
22582402
debugfs_create_file("fw_checksums", 0400, ar->debug.debugfs_phy, ar,
22592403
&fops_fw_checksums);
22602404

2405+
if (IS_ENABLED(CONFIG_MAC80211_DEBUGFS))
2406+
debugfs_create_file("sta_tid_stats_mask", 0600,
2407+
ar->debug.debugfs_phy,
2408+
ar, &fops_sta_tid_stats_mask);
2409+
2410+
if (test_bit(WMI_SERVICE_TPC_STATS_FINAL, ar->wmi.svc_map))
2411+
debugfs_create_file("tpc_stats_final", 0400,
2412+
ar->debug.debugfs_phy, ar,
2413+
&fops_tpc_stats_final);
2414+
22612415
return 0;
22622416
}
22632417

‎drivers/net/wireless/ath/ath10k/debug.h‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
22
* Copyright (c) 2005-2011 Atheros Communications Inc.
33
* Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
4+
* Copyright (c) 2018, The Linux Foundation. All rights reserved.
45
*
56
* Permission to use, copy, modify, and/or distribute this software for any
67
* purpose with or without fee is hereby granted, provided that the above
@@ -101,6 +102,9 @@ void ath10k_debug_unregister(struct ath10k *ar);
101102
void ath10k_debug_fw_stats_process(struct ath10k *ar, struct sk_buff *skb);
102103
void ath10k_debug_tpc_stats_process(struct ath10k *ar,
103104
struct ath10k_tpc_stats *tpc_stats);
105+
void
106+
ath10k_debug_tpc_stats_final_process(struct ath10k *ar,
107+
struct ath10k_tpc_stats_final *tpc_stats);
104108
void ath10k_debug_dbglog_add(struct ath10k *ar, u8 *buffer, int len);
105109

106110
#define ATH10K_DFS_STAT_INC(ar, c) (ar->debug.dfs_stats.c++)
@@ -164,6 +168,13 @@ static inline void ath10k_debug_tpc_stats_process(struct ath10k *ar,
164168
kfree(tpc_stats);
165169
}
166170

171+
static inline void
172+
ath10k_debug_tpc_stats_final_process(struct ath10k *ar,
173+
struct ath10k_tpc_stats_final *tpc_stats)
174+
{
175+
kfree(tpc_stats);
176+
}
177+
167178
static inline void ath10k_debug_dbglog_add(struct ath10k *ar, u8 *buffer,
168179
int len)
169180
{
@@ -191,12 +202,42 @@ void ath10k_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
191202
struct ieee80211_sta *sta, struct dentry *dir);
192203
void ath10k_sta_update_rx_duration(struct ath10k *ar,
193204
struct ath10k_fw_stats *stats);
205+
void ath10k_sta_update_rx_tid_stats(struct ath10k *ar, u8 *first_hdr,
206+
unsigned long int num_msdus,
207+
enum ath10k_pkt_rx_err err,
208+
unsigned long int unchain_cnt,
209+
unsigned long int drop_cnt,
210+
unsigned long int drop_cnt_filter,
211+
unsigned long int queued_msdus);
212+
void ath10k_sta_update_rx_tid_stats_ampdu(struct ath10k *ar,
213+
u16 peer_id, u8 tid,
214+
struct htt_rx_indication_mpdu_range *ranges,
215+
int num_ranges);
194216
#else
195217
static inline
196218
void ath10k_sta_update_rx_duration(struct ath10k *ar,
197219
struct ath10k_fw_stats *stats)
198220
{
199221
}
222+
223+
static inline
224+
void ath10k_sta_update_rx_tid_stats(struct ath10k *ar, u8 *first_hdr,
225+
unsigned long int num_msdus,
226+
enum ath10k_pkt_rx_err err,
227+
unsigned long int unchain_cnt,
228+
unsigned long int drop_cnt,
229+
unsigned long int drop_cnt_filter,
230+
unsigned long int queued_msdus)
231+
{
232+
}
233+
234+
static inline
235+
void ath10k_sta_update_rx_tid_stats_ampdu(struct ath10k *ar,
236+
u16 peer_id, u8 tid,
237+
struct htt_rx_indication_mpdu_range *ranges,
238+
int num_ranges)
239+
{
240+
}
200241
#endif /* CONFIG_MAC80211_DEBUGFS */
201242

202243
#ifdef CONFIG_ATH10K_DEBUG

0 commit comments

Comments
 (0)