Skip to content

Commit

Permalink
ath10k: Disable DBGLOG output by default, ibss-cca set-special hack.
Browse files Browse the repository at this point in the history
The big visible change is that DBGLOG output will be disabled by
default.  To re-enable, set your debug_mask so that bit 0x10000000
is not set.  0x0 would be sufficient if you don't want any other
ath10k debugging, for instance.

And, I disabled the CCA/IBSS hack in the wave-2 firmware that I had added
a week or so ago.  This driver update includes the set-special option to
re-enable it if you wish.

Signed-off-by: Ben Greear <greearb@candelatech.com>
  • Loading branch information
greearb committed Mar 16, 2018
1 parent 41c5b5a commit 30827f7
Show file tree
Hide file tree
Showing 12 changed files with 94 additions and 14 deletions.
8 changes: 7 additions & 1 deletion ath10k-4.13/core.c
Expand Up @@ -34,7 +34,9 @@
#include "testmode.h"
#include "wmi-ops.h"

unsigned int ath10k_debug_mask;
/* Disable ath10k-ct DBGLOG output by default */
unsigned int ath10k_debug_mask = ATH10K_DBG_NO_DBGLOG;

static unsigned int ath10k_cryptmode_param;
static bool uart_print;
static bool skip_otp;
Expand Down Expand Up @@ -2822,6 +2824,10 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode,
ath10k_wmi_pdev_set_special(ar, SET_SPECIAL_ID_TX_DBG,
ar->eeprom_overrides.tx_debug);

if (ar->eeprom_overrides.disable_ibss_cca)
ath10k_wmi_pdev_set_special(ar, SET_SPECIAL_ID_DISABLE_IBSS_CCA,
ar->eeprom_overrides.disable_ibss_cca);

if (ar->eeprom_overrides.su_sounding_timer_ms)
ath10k_wmi_pdev_set_param(ar, ar->wmi.pdev_param->txbf_sound_period_cmdid,
ar->eeprom_overrides.su_sounding_timer_ms);
Expand Down
2 changes: 2 additions & 0 deletions ath10k-4.13/core.h
Expand Up @@ -1186,6 +1186,7 @@ struct ath10k {
struct ath10k_spec_scan config;
} spectral;
#endif
u32 wmi_get_temp_count;

struct {
/* protected by conf_mutex */
Expand Down Expand Up @@ -1248,6 +1249,7 @@ struct ath10k {
bool coverage_already_set;
bool txbf_cv_msg;
bool rx_all_mgt;
u8 disable_ibss_cca;
u8 rc_txbf_probe;
#define CT_DISABLE_20MHZ 0x1
#define CT_DISABLE_40MHZ 0x2
Expand Down
6 changes: 6 additions & 0 deletions ath10k-4.13/debug.c
Expand Up @@ -3354,6 +3354,11 @@ static ssize_t ath10k_write_ct_special(struct file *file,
ath10k_warn(ar, "Setting tx-hang-cold-reset-ok to %d\n",
ar->eeprom_overrides.tx_hang_cold_reset_ok);
}
else if (id == SET_SPECIAL_ID_DISABLE_IBSS_CCA) {
ar->eeprom_overrides.disable_ibss_cca = val;
ath10k_warn(ar, "Setting disable-ibss-cca to %d\n",
ar->eeprom_overrides.disable_ibss_cca);
}
else if (id == SET_SPECIAL_ID_TX_DBG) {
/* Set TX debugging */
ar->eeprom_overrides.tx_debug = val;
Expand Down Expand Up @@ -3460,6 +3465,7 @@ static ssize_t ath10k_read_ct_special(struct file *file,
"id: 0xF Enable TXBF-CV-MSG.\n"
"id: 0x10 rx-all-mgt.\n"
"id: 0x11 allow tx-hang logic to try cold resets instead of just warm resets.\n"
"id: 0x12 disable special CCA setting for IBSS queues.\n"
"\nBelow here should work with most firmware, including non-CT firmware.\n"
"id: 0x1001 set sta-kickout threshold due to tx-failures (0 means disable. Default is 20 * 16.)\n"
"id: 0x1002 set su-sounding-timer-ms (0 means use defaults next FW reload. Default is 100, max is 500)\n"
Expand Down
5 changes: 4 additions & 1 deletion ath10k-4.13/mac.c
Expand Up @@ -8742,7 +8742,6 @@ static struct ieee80211_iface_combination ath10k_10x_ct_if_comb[] = {
.radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) |
BIT(NL80211_CHAN_WIDTH_20) |
BIT(NL80211_CHAN_WIDTH_40) |
BIT(NL80211_CHAN_WIDTH_160) | /* TODO: Verify --Ben */
BIT(NL80211_CHAN_WIDTH_80),
#endif
},
Expand Down Expand Up @@ -8812,6 +8811,8 @@ static const struct ieee80211_iface_combination ath10k_10_4_if_comb[] = {
.radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) |
BIT(NL80211_CHAN_WIDTH_20) |
BIT(NL80211_CHAN_WIDTH_40) |
BIT(NL80211_CHAN_WIDTH_80P80) | /* TODO: Verify --Ben */
BIT(NL80211_CHAN_WIDTH_160) | /* TODO: Verify --Ben */
BIT(NL80211_CHAN_WIDTH_80),
#endif
},
Expand Down Expand Up @@ -8846,6 +8847,8 @@ static struct ieee80211_iface_combination ath10k_10_4_ct_if_comb[] = {
.radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) |
BIT(NL80211_CHAN_WIDTH_20) |
BIT(NL80211_CHAN_WIDTH_40) |
BIT(NL80211_CHAN_WIDTH_80P80) | /* TODO: Verify --Ben */
BIT(NL80211_CHAN_WIDTH_160) | /* TODO: Verify --Ben */
BIT(NL80211_CHAN_WIDTH_80),
#endif
},
Expand Down
32 changes: 27 additions & 5 deletions ath10k-4.13/wmi.c
Expand Up @@ -2689,8 +2689,15 @@ int ath10k_wmi_event_debug_mesg(struct ath10k *ar, struct sk_buff *skb)
(skb->len - 4)/sizeof(__le32));
spin_unlock_bh(&ar->data_lock);

if (ath10k_debug_mask & ATH10K_DBG_NO_DBGLOG)
if (ath10k_debug_mask & ATH10K_DBG_NO_DBGLOG) {
static bool done_once = false;
if (!done_once) {
ath10k_info(ar, "NOTE: Firmware DBGLOG output disabled in debug_mask: 0x%x\n",
ath10k_debug_mask);
done_once = true;
}
return 0;
}

if (ev->dropped_count)
ath10k_warn(ar, "WARNING: Dropped dbglog buffers: %d\n", __le32_to_cpu(ev->dropped_count));
Expand Down Expand Up @@ -6822,8 +6829,13 @@ int ath10k_wmi_request_nop(struct ath10k *ar)
cmd = (struct wmi_request_nop_cmd *)skb->data;
cmd->nop_id = __cpu_to_le32(ar->debug.nop_id++);

ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi request nop (id %d)\n",
ar->debug.nop_id - 1);
/* This is fairly verbose in the logs when WMI debugging is enabled,
* so only print this out every 100 times. --Ben
*/
if ((ar->debug.nop_id % 100) == 0)
ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi request nop (id %d)\n",
ar->debug.nop_id - 1);

return ath10k_wmi_cmd_send(ar, skb, WMI_NOP);
}
#endif
Expand Down Expand Up @@ -7465,7 +7477,12 @@ ath10k_wmi_10_1_op_gen_pdev_get_temperature(struct ath10k *ar)
if (!skb)
return ERR_PTR(-ENOMEM);

ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi pdev get temperature\n");
/* This can be fairly verbose in the logs when WMI debugging is enabled,
* so only print this out every 100 times. --Ben
*/
if ((ar->wmi_get_temp_count++ % 100) == 0)
ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi pdev get temperature (count: %d)\n",
ar->wmi_get_temp_count);
return skb;
}

Expand All @@ -7478,7 +7495,12 @@ ath10k_wmi_10_2_op_gen_pdev_get_temperature(struct ath10k *ar)
if (!skb)
return ERR_PTR(-ENOMEM);

ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi pdev get temperature\n");
/* This can be fairly verbose in the logs when WMI debugging is enabled,
* so only print this out every 100 times. --Ben
*/
if ((ar->wmi_get_temp_count++ % 100) == 0)
ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi pdev get temperature (count: %d)\n",
ar->wmi_get_temp_count);
return skb;
}

Expand Down
1 change: 1 addition & 0 deletions ath10k-4.13/wmi.h
Expand Up @@ -6726,6 +6726,7 @@ struct wmi_pdev_set_special_cmd {
* 0x1 == enable, 0x0 == disable (default)
*/
#define SET_SPECIAL_ID_TX_HANG_COLD_RESET 0x11 /* Allow cold-reset in tx-hang recover code. */
#define SET_SPECIAL_ID_DISABLE_IBSS_CCA 0x12 /* Disable special HWSCH CCA settings for IBSS. */

/* Requires specially compiled firmware (-T option) to have any useful effect. */
#define SET_SPECIAL_ID_TX_DBG 0x99 /* 0x1 == enable, 0x2 == pkt-dbg, 0x0 == disable (default). */
Expand Down
8 changes: 7 additions & 1 deletion ath10k-4.9/core.c
Expand Up @@ -32,7 +32,9 @@
#include "testmode.h"
#include "wmi-ops.h"

unsigned int ath10k_debug_mask;
/* Disable ath10k-ct DBGLOG output by default */
unsigned int ath10k_debug_mask = ATH10K_DBG_NO_DBGLOG;

static unsigned int ath10k_cryptmode_param;
static bool uart_print;
static bool skip_otp;
Expand Down Expand Up @@ -2671,6 +2673,10 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode,
ath10k_wmi_pdev_set_special(ar, SET_SPECIAL_ID_TX_DBG,
ar->eeprom_overrides.tx_debug);

if (ar->eeprom_overrides.disable_ibss_cca)
ath10k_wmi_pdev_set_special(ar, SET_SPECIAL_ID_DISABLE_IBSS_CCA,
ar->eeprom_overrides.disable_ibss_cca);

if (ar->eeprom_overrides.su_sounding_timer_ms)
ath10k_wmi_pdev_set_param(ar, ar->wmi.pdev_param->txbf_sound_period_cmdid,
ar->eeprom_overrides.su_sounding_timer_ms);
Expand Down
2 changes: 2 additions & 0 deletions ath10k-4.9/core.h
Expand Up @@ -1141,6 +1141,7 @@ struct ath10k {
struct ath10k_spec_scan config;
} spectral;
#endif
u32 wmi_get_temp_count;

struct {
/* protected by conf_mutex */
Expand Down Expand Up @@ -1188,6 +1189,7 @@ struct ath10k {
bool rifs_enable_override;
bool txbf_cv_msg;
bool rx_all_mgt;
u8 disable_ibss_cca;
u8 rc_txbf_probe;
#define CT_DISABLE_20MHZ 0x1
#define CT_DISABLE_40MHZ 0x2
Expand Down
6 changes: 6 additions & 0 deletions ath10k-4.9/debug.c
Expand Up @@ -3272,6 +3272,11 @@ static ssize_t ath10k_write_ct_special(struct file *file,
ath10k_warn(ar, "Setting tx-hang-cold-reset-ok to %d\n",
ar->eeprom_overrides.tx_hang_cold_reset_ok);
}
else if (id == SET_SPECIAL_ID_DISABLE_IBSS_CCA) {
ar->eeprom_overrides.disable_ibss_cca = val;
ath10k_warn(ar, "Setting disable-ibss-cca to %d\n",
ar->eeprom_overrides.disable_ibss_cca);
}
else if (id == SET_SPECIAL_ID_TX_DBG) {
/* Set TX debugging */
ar->eeprom_overrides.tx_debug = val;
Expand Down Expand Up @@ -3378,6 +3383,7 @@ static ssize_t ath10k_read_ct_special(struct file *file,
"id: 0xF Enable TXBF-CV-MSG.\n"
"id: 0x10 rx-all-mgt.\n"
"id: 0x11 allow tx-hang logic to try cold resets instead of just warm resets.\n"
"id: 0x12 disable special CCA setting for IBSS queues.\n"
"\nBelow here should work with most firmware, including non-CT firmware.\n"
"id: 0x1001 set sta-kickout threshold due to tx-failures (0 means disable. Default is 20 * 16.)\n"
"id: 0x1002 set su-sounding-timer-ms (0 means use defaults next FW reload. Default is 100, max is 500)\n"
Expand Down
5 changes: 4 additions & 1 deletion ath10k-4.9/mac.c
Expand Up @@ -8641,6 +8641,8 @@ static struct ieee80211_iface_combination ath10k_10x_ct_if_comb[] = {
.radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) |
BIT(NL80211_CHAN_WIDTH_20) |
BIT(NL80211_CHAN_WIDTH_40) |
BIT(NL80211_CHAN_WIDTH_80P80) | /* TODO: Verify --Ben */
BIT(NL80211_CHAN_WIDTH_160) | /* TODO: Verify --Ben */
BIT(NL80211_CHAN_WIDTH_80),
#endif
},
Expand Down Expand Up @@ -8710,6 +8712,8 @@ static const struct ieee80211_iface_combination ath10k_10_4_if_comb[] = {
.radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) |
BIT(NL80211_CHAN_WIDTH_20) |
BIT(NL80211_CHAN_WIDTH_40) |
BIT(NL80211_CHAN_WIDTH_80P80) | /* TODO: Verify --Ben */
BIT(NL80211_CHAN_WIDTH_160) | /* TODO: Verify --Ben */
BIT(NL80211_CHAN_WIDTH_80),
#endif
},
Expand Down Expand Up @@ -8744,7 +8748,6 @@ static struct ieee80211_iface_combination ath10k_10_4_ct_if_comb[] = {
.radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) |
BIT(NL80211_CHAN_WIDTH_20) |
BIT(NL80211_CHAN_WIDTH_40) |
BIT(NL80211_CHAN_WIDTH_160) | /* TODO: Verify --Ben */
BIT(NL80211_CHAN_WIDTH_80),
#endif
},
Expand Down
32 changes: 27 additions & 5 deletions ath10k-4.9/wmi.c
Expand Up @@ -2652,8 +2652,15 @@ int ath10k_wmi_event_debug_mesg(struct ath10k *ar, struct sk_buff *skb)
(skb->len - 4)/sizeof(__le32));
spin_unlock_bh(&ar->data_lock);

if (ath10k_debug_mask & ATH10K_DBG_NO_DBGLOG)
if (ath10k_debug_mask & ATH10K_DBG_NO_DBGLOG) {
static bool done_once = false;
if (!done_once) {
ath10k_info(ar, "NOTE: Firmware DBGLOG output disabled in debug_mask: 0x%x\n",
ath10k_debug_mask);
done_once = true;
}
return 0;
}

if (ev->dropped_count)
ath10k_warn(ar, "WARNING: Dropped dbglog buffers: %d\n", __le32_to_cpu(ev->dropped_count));
Expand Down Expand Up @@ -6703,8 +6710,13 @@ int ath10k_wmi_request_nop(struct ath10k *ar)
cmd = (struct wmi_request_nop_cmd *)skb->data;
cmd->nop_id = __cpu_to_le32(ar->debug.nop_id++);

ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi request nop (id %d)\n",
ar->debug.nop_id - 1);
/* This is fairly verbose in the logs when WMI debugging is enabled,
* so only print this out every 100 times. --Ben
*/
if ((ar->debug.nop_id % 100) == 0)
ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi request nop (id %d)\n",
ar->debug.nop_id - 1);

return ath10k_wmi_cmd_send(ar, skb, WMI_NOP);
}
#endif
Expand Down Expand Up @@ -7346,7 +7358,12 @@ ath10k_wmi_10_1_op_gen_pdev_get_temperature(struct ath10k *ar)
if (!skb)
return ERR_PTR(-ENOMEM);

ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi pdev get temperature\n");
/* This can be fairly verbose in the logs when WMI debugging is enabled,
* so only print this out every 100 times. --Ben
*/
if ((ar->wmi_get_temp_count++ % 100) == 0)
ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi pdev get temperature (count: %d)\n",
ar->wmi_get_temp_count);
return skb;
}

Expand All @@ -7359,7 +7376,12 @@ ath10k_wmi_10_2_op_gen_pdev_get_temperature(struct ath10k *ar)
if (!skb)
return ERR_PTR(-ENOMEM);

ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi pdev get temperature\n");
/* This can be fairly verbose in the logs when WMI debugging is enabled,
* so only print this out every 100 times. --Ben
*/
if ((ar->wmi_get_temp_count++ % 100) == 0)
ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi pdev get temperature (count: %d)\n",
ar->wmi_get_temp_count);
return skb;
}

Expand Down
1 change: 1 addition & 0 deletions ath10k-4.9/wmi.h
Expand Up @@ -6691,6 +6691,7 @@ struct wmi_pdev_set_special_cmd {
* 0x1 == enable, 0x0 == disable (default)
*/
#define SET_SPECIAL_ID_TX_HANG_COLD_RESET 0x11 /* Allow cold-reset in tx-hang recover code. */
#define SET_SPECIAL_ID_DISABLE_IBSS_CCA 0x12 /* Disable special HWSCH CCA settings for IBSS. */

/* Requires specially compiled firmware (-T option) to have any useful effect. */
#define SET_SPECIAL_ID_TX_DBG 0x99 /* 0x1 == enable, 0x2 == pkt-dbg, 0x0 == disable (default). */
Expand Down

0 comments on commit 30827f7

Please sign in to comment.