diff options
| author | SenthilKumar Jegadeesan <sjegadee@qti.qualcomm.com> | 2015-01-29 04:06:52 -0500 |
|---|---|---|
| committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2015-02-04 02:20:08 -0500 |
| commit | 467210a67b8e4e63dc7fb0bc9aca21e412f32da5 (patch) | |
| tree | e261397bd1da8749e838b4b67ae7c31df0d18cdf /drivers/net/wireless/ath/ath10k | |
| parent | 75930d1a80e81052376ffc5298aadfe8a075d9d2 (diff) | |
ath10k: add log level configuration for fw_dbglog
Introduce an optional log level configuration for the existing debugfs fw_dbglog file. It
allows users to configure the desired log level for firmware dbglog messages.
To configure log level as WARN:
echo 0xffffffff 2 > /sys/kernel/debug/ieee80211/phy0/ath10k/fw_dbglog
The values are:
VERBOSE 0
INFO 1
WARN 2
ERR 3
Signed-off-by: SenthilKumar Jegadeesan <sjegadee@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath10k')
| -rw-r--r-- | drivers/net/wireless/ath/ath10k/core.h | 1 | ||||
| -rw-r--r-- | drivers/net/wireless/ath/ath10k/debug.c | 32 | ||||
| -rw-r--r-- | drivers/net/wireless/ath/ath10k/wmi-ops.h | 7 | ||||
| -rw-r--r-- | drivers/net/wireless/ath/ath10k/wmi-tlv.c | 4 | ||||
| -rw-r--r-- | drivers/net/wireless/ath/ath10k/wmi.c | 5 |
5 files changed, 33 insertions, 16 deletions
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index c8ba6bd4b968..d60e46fe6d19 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h | |||
| @@ -350,6 +350,7 @@ struct ath10k_debug { | |||
| 350 | 350 | ||
| 351 | /* protected by conf_mutex */ | 351 | /* protected by conf_mutex */ |
| 352 | u32 fw_dbglog_mask; | 352 | u32 fw_dbglog_mask; |
| 353 | u32 fw_dbglog_level; | ||
| 353 | u32 pktlog_filter; | 354 | u32 pktlog_filter; |
| 354 | u32 reg_addr; | 355 | u32 reg_addr; |
| 355 | u32 nf_cal_period; | 356 | u32 nf_cal_period; |
diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c index 42b2e49b2836..d2281e5c2ffe 100644 --- a/drivers/net/wireless/ath/ath10k/debug.c +++ b/drivers/net/wireless/ath/ath10k/debug.c | |||
| @@ -1318,10 +1318,10 @@ static ssize_t ath10k_read_fw_dbglog(struct file *file, | |||
| 1318 | { | 1318 | { |
| 1319 | struct ath10k *ar = file->private_data; | 1319 | struct ath10k *ar = file->private_data; |
| 1320 | unsigned int len; | 1320 | unsigned int len; |
| 1321 | char buf[32]; | 1321 | char buf[64]; |
| 1322 | 1322 | ||
| 1323 | len = scnprintf(buf, sizeof(buf), "0x%08x\n", | 1323 | len = scnprintf(buf, sizeof(buf), "0x%08x %u\n", |
| 1324 | ar->debug.fw_dbglog_mask); | 1324 | ar->debug.fw_dbglog_mask, ar->debug.fw_dbglog_level); |
| 1325 | 1325 | ||
| 1326 | return simple_read_from_buffer(user_buf, count, ppos, buf, len); | 1326 | return simple_read_from_buffer(user_buf, count, ppos, buf, len); |
| 1327 | } | 1327 | } |
| @@ -1331,19 +1331,32 @@ static ssize_t ath10k_write_fw_dbglog(struct file *file, | |||
| 1331 | size_t count, loff_t *ppos) | 1331 | size_t count, loff_t *ppos) |
| 1332 | { | 1332 | { |
| 1333 | struct ath10k *ar = file->private_data; | 1333 | struct ath10k *ar = file->private_data; |
| 1334 | unsigned long mask; | ||
| 1335 | int ret; | 1334 | int ret; |
| 1335 | char buf[64]; | ||
| 1336 | unsigned int log_level, mask; | ||
| 1336 | 1337 | ||
| 1337 | ret = kstrtoul_from_user(user_buf, count, 0, &mask); | 1338 | simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count); |
| 1338 | if (ret) | 1339 | |
| 1339 | return ret; | 1340 | /* make sure that buf is null terminated */ |
| 1341 | buf[sizeof(buf) - 1] = 0; | ||
| 1342 | |||
| 1343 | ret = sscanf(buf, "%x %u", &mask, &log_level); | ||
| 1344 | |||
| 1345 | if (!ret) | ||
| 1346 | return -EINVAL; | ||
| 1347 | |||
| 1348 | if (ret == 1) | ||
| 1349 | /* default if user did not specify */ | ||
| 1350 | log_level = ATH10K_DBGLOG_LEVEL_WARN; | ||
| 1340 | 1351 | ||
| 1341 | mutex_lock(&ar->conf_mutex); | 1352 | mutex_lock(&ar->conf_mutex); |
| 1342 | 1353 | ||
| 1343 | ar->debug.fw_dbglog_mask = mask; | 1354 | ar->debug.fw_dbglog_mask = mask; |
| 1355 | ar->debug.fw_dbglog_level = log_level; | ||
| 1344 | 1356 | ||
| 1345 | if (ar->state == ATH10K_STATE_ON) { | 1357 | if (ar->state == ATH10K_STATE_ON) { |
| 1346 | ret = ath10k_wmi_dbglog_cfg(ar, ar->debug.fw_dbglog_mask); | 1358 | ret = ath10k_wmi_dbglog_cfg(ar, ar->debug.fw_dbglog_mask, |
| 1359 | ar->debug.fw_dbglog_level); | ||
| 1347 | if (ret) { | 1360 | if (ret) { |
| 1348 | ath10k_warn(ar, "dbglog cfg failed from debugfs: %d\n", | 1361 | ath10k_warn(ar, "dbglog cfg failed from debugfs: %d\n", |
| 1349 | ret); | 1362 | ret); |
| @@ -1685,7 +1698,8 @@ int ath10k_debug_start(struct ath10k *ar) | |||
| 1685 | ret); | 1698 | ret); |
| 1686 | 1699 | ||
| 1687 | if (ar->debug.fw_dbglog_mask) { | 1700 | if (ar->debug.fw_dbglog_mask) { |
| 1688 | ret = ath10k_wmi_dbglog_cfg(ar, ar->debug.fw_dbglog_mask); | 1701 | ret = ath10k_wmi_dbglog_cfg(ar, ar->debug.fw_dbglog_mask, |
| 1702 | ATH10K_DBGLOG_LEVEL_WARN); | ||
| 1689 | if (ret) | 1703 | if (ret) |
| 1690 | /* not serious */ | 1704 | /* not serious */ |
| 1691 | ath10k_warn(ar, "failed to enable dbglog during start: %d", | 1705 | ath10k_warn(ar, "failed to enable dbglog during start: %d", |
diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h b/drivers/net/wireless/ath/ath10k/wmi-ops.h index de436162a805..04dc4b9db04e 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-ops.h +++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h | |||
| @@ -116,7 +116,8 @@ struct wmi_ops { | |||
| 116 | enum wmi_force_fw_hang_type type, | 116 | enum wmi_force_fw_hang_type type, |
| 117 | u32 delay_ms); | 117 | u32 delay_ms); |
| 118 | struct sk_buff *(*gen_mgmt_tx)(struct ath10k *ar, struct sk_buff *skb); | 118 | struct sk_buff *(*gen_mgmt_tx)(struct ath10k *ar, struct sk_buff *skb); |
| 119 | struct sk_buff *(*gen_dbglog_cfg)(struct ath10k *ar, u32 module_enable); | 119 | struct sk_buff *(*gen_dbglog_cfg)(struct ath10k *ar, u32 module_enable, |
| 120 | u32 log_level); | ||
| 120 | struct sk_buff *(*gen_pktlog_enable)(struct ath10k *ar, u32 filter); | 121 | struct sk_buff *(*gen_pktlog_enable)(struct ath10k *ar, u32 filter); |
| 121 | struct sk_buff *(*gen_pktlog_disable)(struct ath10k *ar); | 122 | struct sk_buff *(*gen_pktlog_disable)(struct ath10k *ar); |
| 122 | struct sk_buff *(*gen_pdev_set_quiet_mode)(struct ath10k *ar, | 123 | struct sk_buff *(*gen_pdev_set_quiet_mode)(struct ath10k *ar, |
| @@ -846,14 +847,14 @@ ath10k_wmi_force_fw_hang(struct ath10k *ar, | |||
| 846 | } | 847 | } |
| 847 | 848 | ||
| 848 | static inline int | 849 | static inline int |
| 849 | ath10k_wmi_dbglog_cfg(struct ath10k *ar, u32 module_enable) | 850 | ath10k_wmi_dbglog_cfg(struct ath10k *ar, u32 module_enable, u32 log_level) |
| 850 | { | 851 | { |
| 851 | struct sk_buff *skb; | 852 | struct sk_buff *skb; |
| 852 | 853 | ||
| 853 | if (!ar->wmi.ops->gen_dbglog_cfg) | 854 | if (!ar->wmi.ops->gen_dbglog_cfg) |
| 854 | return -EOPNOTSUPP; | 855 | return -EOPNOTSUPP; |
| 855 | 856 | ||
| 856 | skb = ar->wmi.ops->gen_dbglog_cfg(ar, module_enable); | 857 | skb = ar->wmi.ops->gen_dbglog_cfg(ar, module_enable, log_level); |
| 857 | if (IS_ERR(skb)) | 858 | if (IS_ERR(skb)) |
| 858 | return PTR_ERR(skb); | 859 | return PTR_ERR(skb); |
| 859 | 860 | ||
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c index ba78c187976c..71614ba1b145 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c | |||
| @@ -2126,8 +2126,8 @@ ath10k_wmi_tlv_op_gen_force_fw_hang(struct ath10k *ar, | |||
| 2126 | } | 2126 | } |
| 2127 | 2127 | ||
| 2128 | static struct sk_buff * | 2128 | static struct sk_buff * |
| 2129 | ath10k_wmi_tlv_op_gen_dbglog_cfg(struct ath10k *ar, u32 module_enable) | 2129 | ath10k_wmi_tlv_op_gen_dbglog_cfg(struct ath10k *ar, u32 module_enable, |
| 2130 | { | 2130 | u32 log_level) { |
| 2131 | struct wmi_tlv_dbglog_cmd *cmd; | 2131 | struct wmi_tlv_dbglog_cmd *cmd; |
| 2132 | struct wmi_tlv *tlv; | 2132 | struct wmi_tlv *tlv; |
| 2133 | struct sk_buff *skb; | 2133 | struct sk_buff *skb; |
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index d6c5b423b836..fd213d9e4214 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c | |||
| @@ -4991,7 +4991,8 @@ ath10k_wmi_op_gen_force_fw_hang(struct ath10k *ar, | |||
| 4991 | } | 4991 | } |
| 4992 | 4992 | ||
| 4993 | static struct sk_buff * | 4993 | static struct sk_buff * |
| 4994 | ath10k_wmi_op_gen_dbglog_cfg(struct ath10k *ar, u32 module_enable) | 4994 | ath10k_wmi_op_gen_dbglog_cfg(struct ath10k *ar, u32 module_enable, |
| 4995 | u32 log_level) | ||
| 4995 | { | 4996 | { |
| 4996 | struct wmi_dbglog_cfg_cmd *cmd; | 4997 | struct wmi_dbglog_cfg_cmd *cmd; |
| 4997 | struct sk_buff *skb; | 4998 | struct sk_buff *skb; |
| @@ -5004,7 +5005,7 @@ ath10k_wmi_op_gen_dbglog_cfg(struct ath10k *ar, u32 module_enable) | |||
| 5004 | cmd = (struct wmi_dbglog_cfg_cmd *)skb->data; | 5005 | cmd = (struct wmi_dbglog_cfg_cmd *)skb->data; |
| 5005 | 5006 | ||
| 5006 | if (module_enable) { | 5007 | if (module_enable) { |
| 5007 | cfg = SM(ATH10K_DBGLOG_LEVEL_VERBOSE, | 5008 | cfg = SM(log_level, |
| 5008 | ATH10K_DBGLOG_CFG_LOG_LVL); | 5009 | ATH10K_DBGLOG_CFG_LOG_LVL); |
| 5009 | } else { | 5010 | } else { |
| 5010 | /* set back defaults, all modules with WARN level */ | 5011 | /* set back defaults, all modules with WARN level */ |
