diff options
| -rw-r--r-- | core/hdd/inc/wlan_hdd_tdls.h | 5 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_tdls.c | 28 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_trace.c | 6 |
3 files changed, 31 insertions, 8 deletions
diff --git a/core/hdd/inc/wlan_hdd_tdls.h b/core/hdd/inc/wlan_hdd_tdls.h index 01ca3e54533e..fd498fd96bf3 100644 --- a/core/hdd/inc/wlan_hdd_tdls.h +++ b/core/hdd/inc/wlan_hdd_tdls.h @@ -88,6 +88,9 @@ typedef enum { #define TDLS_CT_MAC_MAX_TABLE_SIZE 8 +/* Define the interval for 5 minutes */ +#define TDLS_ENABLE_CDS_FLUSH_INTERVAL 300000000 + /** * enum tdls_disable_source - TDLS disable sources * @HDD_SET_TDLS_MODE_SOURCE_USER: disable from user @@ -368,6 +371,7 @@ struct tdls_set_state_info { * @ap_rssi: ap rssi * @curr_candidate: current candidate * @magic: magic + * @last_flush_ts: last timestamp when flush logs was displayed. * */ typedef struct { @@ -381,6 +385,7 @@ typedef struct { int8_t ap_rssi; struct _hddTdlsPeer_t *curr_candidate; uint32_t magic; + uint64_t last_flush_ts; } tdlsCtx_t; /** diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c index f3e4d03e30cd..adaf0a013ab3 100644 --- a/core/hdd/src/wlan_hdd_tdls.c +++ b/core/hdd/src/wlan_hdd_tdls.c @@ -773,6 +773,7 @@ int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter) pHddTdlsCtx->curr_candidate = NULL; pHddTdlsCtx->magic = 0; pHddCtx->valid_mac_entries = 0; + pHddTdlsCtx->last_flush_ts = 0; /* remember configuration even if it is not used right now. it could be used later */ pHddTdlsCtx->threshold_config.tx_period_t = @@ -3966,6 +3967,7 @@ static int __wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); hdd_context_t *pHddCtx = wiphy_priv(wiphy); hdd_station_ctx_t *hdd_sta_ctx; + tdlsCtx_t *hdd_tdls_ctx; u8 peerMac[QDF_MAC_ADDR_SIZE]; QDF_STATUS status; int max_sta_failed = 0; @@ -4206,11 +4208,27 @@ static int __wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, cds_get_driver_state()); return -EAGAIN; } - if (rc <= 0) - cds_flush_logs(WLAN_LOG_TYPE_FATAL, - WLAN_LOG_INDICATOR_HOST_DRIVER, - WLAN_LOG_REASON_HDD_TIME_OUT, - true, false); + + mutex_lock(&pHddCtx->tdls_lock); + hdd_tdls_ctx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter); + if (hdd_tdls_ctx) { + if (rc <= 0 && + (((qdf_get_monotonic_boottime() - + hdd_tdls_ctx->last_flush_ts) > + TDLS_ENABLE_CDS_FLUSH_INTERVAL) + || !(hdd_tdls_ctx->last_flush_ts))) { + hdd_tdls_ctx->last_flush_ts = + qdf_get_monotonic_boottime(); + mutex_unlock(&pHddCtx->tdls_lock); + cds_flush_logs(WLAN_LOG_TYPE_FATAL, + WLAN_LOG_INDICATOR_HOST_DRIVER, + WLAN_LOG_REASON_HDD_TIME_OUT, + true, false); + } else + mutex_unlock(&pHddCtx->tdls_lock); + } else + mutex_unlock(&pHddCtx->tdls_lock); + pAdapter->mgmtTxCompletionStatus = false; return -EINVAL; } diff --git a/core/hdd/src/wlan_hdd_trace.c b/core/hdd/src/wlan_hdd_trace.c index 4490b71fe666..5955307a9b48 100644 --- a/core/hdd/src/wlan_hdd_trace.c +++ b/core/hdd/src/wlan_hdd_trace.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -51,12 +51,12 @@ static void hdd_trace_dump(void *mac, tp_qdf_trace_record record, uint16_t index) { if (TRACE_CODE_HDD_RX_SME_MSG == record->code) - hdd_err("%04d %012llu %s S%d %-14s %-30s(0x%x)", + hdd_info("%04d %012llu %s S%d %-14s %-30s(0x%x)", index, record->qtime, record->time, record->session, "RX SME MSG:", get_e_roam_cmd_status_str(record->data), record->data); else - hdd_err("%04d %012llu %s S%d %-14s %-30s(0x%x)", + hdd_info("%04d %012llu %s S%d %-14s %-30s(0x%x)", index, record->qtime, record->time, record->session, "HDD Event:", hdd_trace_event_string(record->code), record->data); |
