qcacld-3.0: Consistently use CDS logging APIs

The CDS module currently has a mixture of directly using QDF_TRACE
(with an assortment of module IDs) along with using its own CDS
logging APIs. Update the module to consistently use just the CDS
logging APIs.

Change-Id: I5581c960d2b3c973246b44bda3b5bbb740ac3bf3
CRs-Fixed: 2251991
This commit is contained in:
Jeff Johnson 2018-05-30 22:57:39 -07:00 • committed by nshrivas
commit d0a6b2c979
6 changed files with 182 additions and 355 deletions

View file

@ -134,16 +134,14 @@ uint8_t cds_get_datapath_handles(void **soc, struct cdp_pdev **pdev,
(*soc) = cds_get_context(QDF_MODULE_ID_SOC);
if (!(*soc)) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"soc handle is invalid");
cds_err("soc handle is invalid");
return -EINVAL;
}
(*pdev) = cds_get_context(QDF_MODULE_ID_TXRX);
if (!(*pdev)) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"pdev handle is invalid");
cds_err("pdev handle is invalid");
return -EINVAL;
}
@ -151,8 +149,7 @@ uint8_t cds_get_datapath_handles(void **soc, struct cdp_pdev **pdev,
sessionId);
if (!(*vdev)) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"vdev handle is invalid");
cds_err("vdev handle is invalid");
return -EINVAL;
}
return 0;
@ -426,8 +423,7 @@ cds_set_ac_specs_params(struct cds_config_info *cds_cfg)
cds_ctx = cds_get_context(QDF_MODULE_ID_QDF);
if (!cds_ctx) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"Invalid CDS Context");
cds_err("Invalid CDS Context");
return;
}
@ -463,13 +459,11 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc)
struct hdd_context *hdd_ctx;
struct cds_context *cds_ctx;
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO_HIGH,
"%s: Opening CDS", __func__);
cds_debug("Opening CDS");
cds_ctx = cds_get_context(QDF_MODULE_ID_QDF);
if (!cds_ctx) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
"%s: Trying to open CDS without a PreOpen", __func__);
cds_alert("Trying to open CDS without a PreOpen");
QDF_ASSERT(0);
return QDF_STATUS_E_FAILURE;
}
@ -482,8 +476,7 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc)
status = qdf_event_create(&gp_cds_context->wma_complete_event);
if (QDF_IS_STATUS_ERROR(status)) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
"%s: Unable to init wma_complete_event", __func__);
cds_alert("Unable to init wma_complete_event");
QDF_ASSERT(0);
return status;
}
@ -517,8 +510,7 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc)
scn = cds_get_context(QDF_MODULE_ID_HIF);
if (!scn) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
"%s: scn is null!", __func__);
cds_alert("scn is null!");
status = QDF_STATUS_E_FAILURE;
goto err_sched_close;
@ -539,8 +531,7 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc)
ol_ctx = cds_get_context(QDF_MODULE_ID_BMI);
status = bmi_download_firmware(ol_ctx);
if (QDF_IS_STATUS_ERROR(status)) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
"BMI FIALED status:%d", status);
cds_alert("BMI FIALED status:%d", status);
goto err_bmi_close;
}
@ -558,8 +549,7 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc)
gp_cds_context->htc_ctx =
htc_create(scn, &htcInfo, qdf_ctx, cds_get_conparam());
if (!gp_cds_context->htc_ctx) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
"%s: Failed to Create HTC", __func__);
cds_alert("Failed to Create HTC");
status = QDF_STATUS_E_FAILURE;
goto err_bmi_close;
@ -568,8 +558,7 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc)
status = bmi_done(ol_ctx);
if (QDF_IS_STATUS_ERROR(status)) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
"%s: Failed to complete BMI phase", __func__);
cds_alert("Failed to complete BMI phase");
goto err_htc_close;
}
@ -578,8 +567,7 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc)
hdd_ctx->target_type);
if (QDF_IS_STATUS_ERROR(status)) {
/* Critical Error ... Cannot proceed further */
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
"%s: Failed to open WMA module", __func__);
cds_alert("Failed to open WMA module");
QDF_ASSERT(0);
goto err_htc_close;
}
@ -598,8 +586,7 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc)
HTCHandle = cds_get_context(QDF_MODULE_ID_HTC);
if (!HTCHandle) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
"%s: HTCHandle is null!", __func__);
cds_alert("HTCHandle is null!");
status = QDF_STATUS_E_FAILURE;
goto err_wma_close;
@ -615,10 +602,8 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc)
goto err_wma_close;
}
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_DEBUG,
"%s: target_type %d 8074:%d 6290:%d",
__func__, hdd_ctx->target_type,
TARGET_TYPE_QCA8074, TARGET_TYPE_QCA6290);
cds_debug("target_type %d 8074:%d 6290:%d", hdd_ctx->target_type,
TARGET_TYPE_QCA8074, TARGET_TYPE_QCA6290);
if (TARGET_TYPE_QCA6290 == hdd_ctx->target_type)
gp_cds_context->dp_soc = cdp_soc_attach(LITHIUM_DP,
@ -653,8 +638,7 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc)
if (eSIR_SUCCESS != sirStatus) {
/* Critical Error ... Cannot proceed further */
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
"%s: Failed to open MAC", __func__);
cds_alert("Failed to open MAC");
QDF_ASSERT(0);
status = QDF_STATUS_E_FAILURE;
@ -665,8 +649,7 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc)
status = sme_open(gp_cds_context->mac_context);
if (QDF_IS_STATUS_ERROR(status)) {
/* Critical Error ... Cannot proceed further */
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
"%s: Failed to open SME", __func__);
cds_alert("Failed to open SME");
QDF_ASSERT(0);
goto err_mac_close;
}
@ -717,8 +700,7 @@ QDF_STATUS cds_dp_open(struct wlan_objmgr_psoc *psoc)
{
if (cdp_txrx_intr_attach(gp_cds_context->dp_soc)
!= QDF_STATUS_SUCCESS) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
"%s: Failed to attach interrupts", __func__);
cds_alert("Failed to attach interrupts");
goto close;
}
@ -729,8 +711,7 @@ QDF_STATUS cds_dp_open(struct wlan_objmgr_psoc *psoc)
gp_cds_context->qdf_ctx, 0));
if (!gp_cds_context->pdev_txrx_ctx) {
/* Critical Error ... Cannot proceed further */
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
"%s: Failed to open TXRX", __func__);
cds_alert("Failed to open TXRX");
QDF_ASSERT(0);
goto intr_close;
}
@ -738,8 +719,7 @@ QDF_STATUS cds_dp_open(struct wlan_objmgr_psoc *psoc)
pmo_ucfg_psoc_set_txrx_handle(psoc, gp_cds_context->pdev_txrx_ctx);
ucfg_ocb_set_txrx_handle(psoc, gp_cds_context->pdev_txrx_ctx);
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO_HIGH,
"%s: CDS successfully Opened", __func__);
cds_debug("CDS successfully Opened");
return 0;
@ -856,19 +836,16 @@ QDF_STATUS cds_enable(struct wlan_objmgr_psoc *psoc)
/* We support only one instance for now ... */
if (!gp_cds_context) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Invalid CDS context", __func__);
cds_err("Invalid CDS context");
return QDF_STATUS_E_FAILURE;
}
if ((!gp_cds_context->wma_context) ||
(gp_cds_context->mac_context == NULL)) {
if (!gp_cds_context->wma_context)
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: WMA NULL context", __func__);
cds_err("WMA NULL context");
else
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: MAC NULL context", __func__);
cds_err("MAC NULL context");
return QDF_STATUS_E_FAILURE;
}
@ -876,12 +853,10 @@ QDF_STATUS cds_enable(struct wlan_objmgr_psoc *psoc)
/* Start the wma */
qdf_status = wma_start();
if (qdf_status != QDF_STATUS_SUCCESS) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Failed to start wma", __func__);
cds_err("Failed to start wma");
return QDF_STATUS_E_FAILURE;
}
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO,
"%s: wma correctly started", __func__);
cds_info("wma correctly started");
/* Start the MAC */
qdf_mem_zero(&halStartParams,
@ -892,46 +867,38 @@ QDF_STATUS cds_enable(struct wlan_objmgr_psoc *psoc)
mac_start(gp_cds_context->mac_context, &halStartParams);
if (eSIR_SUCCESS != sirStatus) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
"%s: Failed to start MAC", __func__);
cds_alert("Failed to start MAC");
goto err_wma_stop;
}
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO,
"%s: MAC correctly started", __func__);
cds_info("MAC correctly started");
/* START SME */
qdf_status = sme_start(gp_cds_context->mac_context);
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
"%s: Failed to start SME", __func__);
cds_alert("Failed to start SME");
goto err_mac_stop;
}
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO,
"%s: SME correctly started", __func__);
cds_info("SME correctly started");
if (cdp_soc_attach_target(cds_get_context(QDF_MODULE_ID_SOC))) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
"%s: Failed to attach soc target", __func__);
cds_alert("Failed to attach soc target");
goto err_sme_stop;
}
if (cdp_pdev_attach_target(cds_get_context(QDF_MODULE_ID_SOC),
(struct cdp_pdev *)cds_get_context(QDF_MODULE_ID_TXRX))) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
"%s: Failed to attach pdev target", __func__);
cds_alert("Failed to attach pdev target");
goto err_soc_target_detach;
}
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO,
"%s: CDS Start is successful!!", __func__);
cds_info("CDS Start is successful!!");
qdf_status = dispatcher_psoc_enable(psoc);
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
"%s: dispatcher_psoc_enable failed", __func__);
cds_alert("dispatcher_psoc_enable failed");
goto err_soc_target_detach;
}
@ -953,8 +920,7 @@ err_wma_stop:
qdf_event_reset(&gp_cds_context->wma_complete_event);
qdf_status = wma_stop(HAL_STOP_TYPE_RF_KILL);
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Failed to stop wma", __func__);
cds_err("Failed to stop wma");
QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status));
wma_setneedshutdown();
} else {
@ -964,15 +930,9 @@ err_wma_stop:
CDS_WMA_TIMEOUT);
if (qdf_status != QDF_STATUS_SUCCESS) {
if (qdf_status == QDF_STATUS_E_TIMEOUT) {
QDF_TRACE(QDF_MODULE_ID_QDF,
QDF_TRACE_LEVEL_FATAL,
"%s: Timeout occurred before WMA_stop complete",
__func__);
cds_alert("Timeout occurred before WMA_stop complete");
} else {
QDF_TRACE(QDF_MODULE_ID_QDF,
QDF_TRACE_LEVEL_FATAL,
"%s: WMA_stop reporting other error",
__func__);
cds_alert("WMA_stop reporting other error");
}
QDF_ASSERT(0);
wma_setneedshutdown();
@ -1126,8 +1086,7 @@ QDF_STATUS cds_close(struct wlan_objmgr_psoc *psoc)
qdf_status = wma_wmi_work_close();
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Failed to close wma_wmi_work", __func__);
cds_err("Failed to close wma_wmi_work");
QDF_ASSERT(0);
}
@ -1139,15 +1098,13 @@ QDF_STATUS cds_close(struct wlan_objmgr_psoc *psoc)
qdf_status = sme_close(gp_cds_context->mac_context);
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Failed to close SME", __func__);
cds_err("Failed to close SME");
QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status));
}
qdf_status = mac_close(gp_cds_context->mac_context);
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Failed to close MAC", __func__);
cds_err("Failed to close MAC");
QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status));
}
@ -1160,28 +1117,24 @@ QDF_STATUS cds_close(struct wlan_objmgr_psoc *psoc)
cds_shutdown_notifier_purge();
if (true == wma_needshutdown()) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Failed to shutdown wma", __func__);
cds_err("Failed to shutdown wma");
} else {
qdf_status = wma_close();
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Failed to close wma", __func__);
cds_err("Failed to close wma");
QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status));
}
}
qdf_status = wma_wmi_service_close();
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Failed to close wma_wmi_service", __func__);
cds_err("Failed to close wma_wmi_service");
QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status));
}
qdf_status = qdf_event_destroy(&gp_cds_context->wma_complete_event);
if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: failed to destroy wma_complete_event", __func__);
cds_err("failed to destroy wma_complete_event");
QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status));
}
@ -1226,8 +1179,7 @@ void *cds_get_context(QDF_MODULE_ID module_id)
void *context = NULL;
if (gp_cds_context == NULL) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: cds context pointer is null", __func__);
cds_err("cds context pointer is null");
return NULL;
}
@ -1304,18 +1256,15 @@ void *cds_get_context(QDF_MODULE_ID module_id)
default:
{
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Module ID %i does not have its context maintained by CDS",
__func__, module_id);
cds_err("Module ID %i does not have its context maintained by CDS",
module_id);
QDF_ASSERT(0);
return NULL;
}
}
if (!context)
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Module ID %i context is Null", __func__,
module_id);
cds_err("Module ID %i context is Null", module_id);
return context;
} /* cds_get_context() */
@ -1352,8 +1301,7 @@ void *cds_get_global_context(void)
enum cds_driver_state cds_get_driver_state(void)
{
if (gp_cds_context == NULL) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: global cds context is NULL", __func__);
cds_err("global cds context is NULL");
return CDS_DRIVER_STATE_UNINITIALIZED;
}
@ -1374,9 +1322,7 @@ enum cds_driver_state cds_get_driver_state(void)
void cds_set_driver_state(enum cds_driver_state state)
{
if (gp_cds_context == NULL) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: global cds context is NULL: %x", __func__,
state);
cds_err("global cds context is NULL: %x", state);
return;
}
@ -1396,9 +1342,7 @@ void cds_set_driver_state(enum cds_driver_state state)
void cds_clear_driver_state(enum cds_driver_state state)
{
if (gp_cds_context == NULL) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: global cds context is NULL: %x", __func__,
state);
cds_err("global cds context is NULL: %x", state);
return;
}
@ -1409,8 +1353,7 @@ void cds_clear_driver_state(enum cds_driver_state state)
enum cds_fw_state cds_get_fw_state(void)
{
if (gp_cds_context == NULL) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: global cds context is NULL", __func__);
cds_err("global cds context is NULL");
return CDS_FW_STATE_UNINITIALIZED;
}
@ -1421,9 +1364,7 @@ enum cds_fw_state cds_get_fw_state(void)
void cds_set_fw_state(enum cds_fw_state state)
{
if (gp_cds_context == NULL) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: global cds context is NULL: %d", __func__,
state);
cds_err("global cds context is NULL: %d", state);
return;
}
@ -1434,9 +1375,7 @@ void cds_set_fw_state(enum cds_fw_state state)
void cds_clear_fw_state(enum cds_fw_state state)
{
if (gp_cds_context == NULL) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: global cds context is NULL: %d", __func__,
state);
cds_err("global cds context is NULL: %d", state);
return;
}
@ -1463,15 +1402,12 @@ QDF_STATUS cds_alloc_context(QDF_MODULE_ID module_id,
void **cds_mod_context = NULL;
if (!gp_cds_context) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: cds context is null", __func__);
cds_err("cds context is null");
return QDF_STATUS_E_FAILURE;
}
if (!module_context) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: null param passed",
__func__);
cds_err("null param passed");
return QDF_STATUS_E_FAILURE;
}
@ -1489,9 +1425,8 @@ QDF_STATUS cds_alloc_context(QDF_MODULE_ID module_id,
break;
default:
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Module ID %i does not have its context allocated by CDS",
__func__, module_id);
cds_err("Module ID %i does not have its context allocated by CDS",
module_id);
QDF_ASSERT(0);
return QDF_STATUS_E_INVAL;
}
@ -1500,9 +1435,8 @@ QDF_STATUS cds_alloc_context(QDF_MODULE_ID module_id,
/* Context has already been allocated!
* Prevent double allocation
*/
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Module ID %i context has already been allocated",
__func__, module_id);
cds_err("Module ID %i context has already been allocated",
module_id);
return QDF_STATUS_E_EXISTS;
}
@ -1511,9 +1445,8 @@ QDF_STATUS cds_alloc_context(QDF_MODULE_ID module_id,
*module_context = qdf_mem_malloc(size);
if (!*module_context) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Failed to allocate Context for module ID %i",
__func__, module_id);
cds_err("Failed to allocate Context for module ID %i",
module_id);
QDF_ASSERT(0);
return QDF_STATUS_E_NOMEM;
}
@ -1537,8 +1470,7 @@ QDF_STATUS cds_set_context(QDF_MODULE_ID module_id, void *context)
struct cds_context *p_cds_context = cds_get_global_context();
if (!p_cds_context) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"cds context is Invalid");
cds_err("cds context is Invalid");
return QDF_STATUS_NOT_INITIALIZED;
}
@ -1553,9 +1485,8 @@ QDF_STATUS cds_set_context(QDF_MODULE_ID module_id, void *context)
p_cds_context->hif_context = context;
break;
default:
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Module ID %i does not have its context managed by CDS",
__func__, module_id);
cds_err("Module ID %i does not have its context managed by CDS",
module_id);
QDF_ASSERT(0);
return QDF_STATUS_E_INVAL;
}
@ -1579,14 +1510,12 @@ QDF_STATUS cds_free_context(QDF_MODULE_ID module_id, void *module_context)
void **cds_mod_context = NULL;
if (!gp_cds_context) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: cds context is null", __func__);
cds_err("cds context is null");
return QDF_STATUS_E_FAILURE;
}
if (!module_context) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Null param", __func__);
cds_err("Null param");
return QDF_STATUS_E_FAILURE;
}
@ -1608,25 +1537,21 @@ QDF_STATUS cds_free_context(QDF_MODULE_ID module_id, void *module_context)
break;
default:
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Module ID %i "
"does not have its context allocated by CDS",
__func__, module_id);
cds_err("Module ID %i does not have its context allocated by CDS",
module_id);
QDF_ASSERT(0);
return QDF_STATUS_E_INVAL;
}
if (!*cds_mod_context) {
/* Context has not been allocated or freed already! */
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Module ID %i context has not been allocated or freed already",
__func__, module_id);
cds_err("Module ID %i context has not been allocated or freed already",
module_id);
return QDF_STATUS_E_FAILURE;
}
if (*cds_mod_context != module_context) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: cds_mod_context != module_context", __func__);
cds_err("cds_mod_context != module_context");
return QDF_STATUS_E_FAILURE;
}
@ -1645,15 +1570,13 @@ QDF_STATUS cds_free_context(QDF_MODULE_ID module_id, void *module_context)
void cds_wma_complete_cback(void)
{
if (!gp_cds_context) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: invalid gp_cds_context", __func__);
cds_err("invalid gp_cds_context");
return;
}
if (qdf_event_set(&gp_cds_context->wma_complete_event) !=
QDF_STATUS_SUCCESS) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: qdf_event_set failed", __func__);
cds_err("qdf_event_set failed");
return;
}
} /* cds_wma_complete_cback() */
@ -1705,8 +1628,7 @@ QDF_STATUS cds_get_vdev_types(enum QDF_OPMODE mode, uint32_t *type,
*type = WMI_VDEV_TYPE_NDI;
break;
default:
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"Invalid device mode %d", mode);
cds_err("Invalid device mode %d", mode);
status = QDF_STATUS_E_INVAL;
break;
}
@ -1746,8 +1668,7 @@ bool cds_is_packet_log_enabled(void)
hdd_ctx = gp_cds_context->hdd_context;
if ((NULL == hdd_ctx) || (NULL == hdd_ctx->config)) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
"%s: Hdd Context is Null", __func__);
cds_alert("Hdd Context is Null");
return false;
}
return hdd_ctx->config->enablePacketLog;
@ -1975,8 +1896,7 @@ void cds_set_wakelock_logging(bool value)
p_cds_context = cds_get_global_context();
if (!p_cds_context) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"cds context is Invald");
cds_err("cds context is Invald");
return;
}
p_cds_context->is_wakelock_log_enabled = value;
@ -1996,8 +1916,7 @@ bool cds_is_wakelock_enabled(void)
p_cds_context = cds_get_global_context();
if (!p_cds_context) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"cds context is Invald");
cds_err("cds context is Invald");
return false;
}
return p_cds_context->is_wakelock_log_enabled;
@ -2020,8 +1939,7 @@ void cds_set_ring_log_level(uint32_t ring_id, uint32_t log_level)
p_cds_context = cds_get_global_context();
if (!p_cds_context) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: cds context is Invald", __func__);
cds_err("cds context is Invald");
return;
}
@ -2073,8 +1991,7 @@ enum wifi_driver_log_level cds_get_ring_log_level(uint32_t ring_id)
p_cds_context = cds_get_global_context();
if (!p_cds_context) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: cds context is Invald", __func__);
cds_err("cds context is Invald");
return WLAN_LOG_LEVEL_OFF;
}
@ -2135,8 +2052,7 @@ void cds_init_log_completion(void)
p_cds_context = cds_get_global_context();
if (!p_cds_context) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: cds context is Invalid", __func__);
cds_err("cds context is Invalid");
return;
}
@ -2167,8 +2083,7 @@ QDF_STATUS cds_set_log_completion(uint32_t is_fatal,
p_cds_context = cds_get_global_context();
if (!p_cds_context) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: cds context is Invalid", __func__);
cds_err("cds context is Invalid");
return QDF_STATUS_E_FAILURE;
}
@ -2179,9 +2094,8 @@ QDF_STATUS cds_set_log_completion(uint32_t is_fatal,
p_cds_context->log_complete.recovery_needed = recovery_needed;
p_cds_context->log_complete.is_report_in_progress = true;
qdf_spinlock_release(&p_cds_context->bug_report_lock);
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_DEBUG,
"%s: is_fatal %d ind %d reasn_code %d recovery needed %d",
__func__, is_fatal, indicator, reason_code, recovery_needed);
cds_debug("is_fatal %d indicator %d reason_code %d recovery needed %d",
is_fatal, indicator, reason_code, recovery_needed);
return QDF_STATUS_SUCCESS;
}
@ -2206,8 +2120,7 @@ void cds_get_and_reset_log_completion(uint32_t *is_fatal,
p_cds_context = cds_get_global_context();
if (!p_cds_context) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: cds context is Invalid", __func__);
cds_err("cds context is Invalid");
return;
}
@ -2239,8 +2152,7 @@ bool cds_is_log_report_in_progress(void)
p_cds_context = cds_get_global_context();
if (!p_cds_context) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: cds context is Invalid", __func__);
cds_err("cds context is Invalid");
return true;
}
return p_cds_context->log_complete.is_report_in_progress;
@ -2257,8 +2169,7 @@ bool cds_is_fatal_event_enabled(void)
p_cds_context = cds_get_global_context();
if (!p_cds_context) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: cds context is Invalid", __func__);
cds_err("cds context is Invalid");
return false;
}
@ -2274,15 +2185,13 @@ bool cds_is_ptp_rx_opt_enabled(void)
p_cds_context = cds_get_global_context();
if (!p_cds_context) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: cds context is Invalid", __func__);
cds_err("cds context is Invalid");
return false;
}
hdd_ctx = (struct hdd_context *)(p_cds_context->hdd_context);
if ((NULL == hdd_ctx) || (NULL == hdd_ctx->config)) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Hdd Context is Null", __func__);
cds_err("Hdd Context is Null");
return false;
}
@ -2296,15 +2205,13 @@ bool cds_is_ptp_tx_opt_enabled(void)
p_cds_context = cds_get_global_context();
if (!p_cds_context) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: cds context is Invalid", __func__);
cds_err("cds context is Invalid");
return false;
}
hdd_ctx = (struct hdd_context *)(p_cds_context->hdd_context);
if ((NULL == hdd_ctx) || (NULL == hdd_ctx->config)) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Hdd Context is Null", __func__);
cds_err("Hdd Context is Null");
return false;
}
@ -2326,8 +2233,7 @@ uint32_t cds_get_log_indicator(void)
p_cds_context = cds_get_global_context();
if (!p_cds_context) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: cds context is Invalid", __func__);
cds_err("cds context is Invalid");
return WLAN_LOG_INDICATOR_UNUSED;
}
@ -2383,40 +2289,34 @@ QDF_STATUS cds_flush_logs(uint32_t is_fatal,
p_cds_context = cds_get_global_context();
if (!p_cds_context) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: cds context is Invalid", __func__);
cds_err("cds context is Invalid");
return QDF_STATUS_E_FAILURE;
}
if (!p_cds_context->enable_fatal_event) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Fatal event not enabled", __func__);
cds_err("Fatal event not enabled");
return QDF_STATUS_E_FAILURE;
}
if (cds_is_load_or_unload_in_progress() ||
cds_is_driver_recovering() || cds_is_driver_in_bad_state()) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: un/Load/SSR in progress", __func__);
cds_err("un/Load/SSR in progress");
return QDF_STATUS_E_FAILURE;
}
if (cds_is_log_report_in_progress() == true) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Bug report already in progress - dropping! type:%d, indicator=%d reason_code=%d",
__func__, is_fatal, indicator, reason_code);
if (cds_is_log_report_in_progress()) {
cds_err("Bug report already in progress - dropping! type:%d, indicator=%d reason_code=%d",
is_fatal, indicator, reason_code);
return QDF_STATUS_E_FAILURE;
}
status = cds_set_log_completion(is_fatal, indicator,
reason_code, recovery_needed);
if (QDF_STATUS_SUCCESS != status) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Failed to set log trigger params", __func__);
cds_err("Failed to set log trigger params");
return QDF_STATUS_E_FAILURE;
}
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO,
"%s: Triggering bug report: type:%d, indicator=%d reason_code=%d",
__func__, is_fatal, indicator, reason_code);
cds_info("Triggering bug report: type:%d, indicator=%d reason_code=%d",
is_fatal, indicator, reason_code);
if (dump_mac_trace)
qdf_trace_dump_all(p_cds_context->mac_context, 0, 0, 500, 0);
@ -2428,8 +2328,7 @@ QDF_STATUS cds_flush_logs(uint32_t is_fatal,
ret = sme_send_flush_logs_cmd_to_fw(p_cds_context->mac_context);
if (0 != ret) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Failed to send flush FW log", __func__);
cds_err("Failed to send flush FW log");
cds_init_log_completion();
return QDF_STATUS_E_FAILURE;
}
@ -2463,8 +2362,7 @@ void cds_set_fatal_event(bool value)
p_cds_context = cds_get_global_context();
if (!p_cds_context) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: cds context is Invalid", __func__);
cds_err("cds context is Invalid");
return;
}
p_cds_context->enable_fatal_event = value;
@ -2728,9 +2626,8 @@ uint32_t cds_get_connectivity_stats_pkt_bitmap(void *context)
adapter = (struct hdd_adapter *)context;
if (unlikely(adapter->magic != WLAN_HDD_ADAPTER_MAGIC)) {
QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_ERROR,
"Magic cookie(%x) for adapter sanity verification is invalid",
adapter->magic);
cds_err("Magic cookie(%x) for adapter sanity verification is invalid",
adapter->magic);
return QDF_STATUS_E_FAILURE;
}
return adapter->pkt_type_bitmap;
@ -2751,9 +2648,8 @@ uint32_t cds_get_arp_stats_gw_ip(void *context)
adapter = (struct hdd_adapter *)context;
if (unlikely(adapter->magic != WLAN_HDD_ADAPTER_MAGIC)) {
QDF_TRACE(QDF_MODULE_ID_HDD_DATA, QDF_TRACE_LEVEL_ERROR,
"Magic cookie(%x) for adapter sanity verification is invalid",
adapter->magic);
cds_err("Magic cookie(%x) for adapter sanity verification is invalid",
adapter->magic);
return 0;
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2016 The Linux Foundation. All rights reserved.
* Copyright (c) 2014-2016, 2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@ -36,6 +36,7 @@
#include <wlan_hdd_main.h>
#include "qdf_nbuf.h"
#include "qdf_mem.h"
#include "cds_utils.h"
#define TX_PKT_MIN_HEADROOM (64)
@ -90,8 +91,7 @@ cds_pkt_get_packet_length(cds_pkt_t *pPacket, uint16_t *pPacketSize)
/* Validate the parameter pointers */
if (unlikely((pPacket == NULL) || (pPacketSize == NULL)) ||
(pPacket->pkt_buf == NULL)) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
"VPKT [%d]: NULL pointer", __LINE__);
cds_alert("NULL pointer");
return QDF_STATUS_E_INVAL;
}
/* return the requested information */

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2014-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@ -28,6 +28,7 @@
#include "cds_reg_service.h"
#include "cds_ieee80211_common_i.h"
#include "cds_config.h"
#include "cds_utils.h"
uint32_t cds_get_vendor_reg_flags(struct wlan_objmgr_pdev *pdev,
uint32_t chan, uint16_t bandwidth,
@ -134,8 +135,7 @@ uint32_t cds_get_vendor_reg_flags(struct wlan_objmgr_pdev *pdev,
flags |= IEEE80211_CHAN_QUARTER;
break;
default:
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO,
"invalid channel width value %d", bandwidth);
cds_info("invalid channel width value %d", bandwidth);
}
return flags;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011,2013-2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2011,2013-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@ -468,8 +468,7 @@ static bool is_reg_dmn_valid(uint16_t reg_dmn)
return true;
}
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"invalid regulatory domain/country code 0x%x", reg_dmn);
cds_err("invalid regulatory domain/country code 0x%x", reg_dmn);
return false;
}
@ -637,8 +636,7 @@ int32_t cds_fill_some_regulatory_info(struct regulatory *reg)
if (country_code != CTRY_DEFAULT) {
country = find_country(country_code);
if (!country) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"not a valid country code");
cds_err("not a valid country code");
return -EINVAL;
}
@ -647,8 +645,7 @@ int32_t cds_fill_some_regulatory_info(struct regulatory *reg)
reg->regpair = get_reg_dmn_pair(reg_dmn);
if (!reg->regpair) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"no regpair is found, can not proceeed");
cds_err("no regpair is found, can not proceeed");
return -EINVAL;
}
@ -683,28 +680,24 @@ void cds_fill_and_send_ctl_to_fw(struct regulatory *reg)
tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA);
if (!wma) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"unable to get WMA handle");
cds_err("unable to get WMA handle");
return;
}
if (!reg->regpair) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
FL("no regpair is found, can not proceed"));
cds_err(FL("no regpair is found, can not proceed"));
return;
}
regpair = reg->regpair;
reg_dmn_2g = get_reg_dmn(regpair->reg_dmn_2ghz);
if (!reg_dmn_2g) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"failed to get regdmn 2G");
cds_err("failed to get regdmn 2G");
return;
}
reg_dmn_5g = get_reg_dmn(regpair->reg_dmn_5ghz);
if (!reg_dmn_5g) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"failed to get regdmn 5G");
cds_err("failed to get regdmn 5G");
return;
}

View file

@ -124,23 +124,19 @@ static int cds_sched_find_attach_cpu(p_cds_sched_context pSchedContext,
int i;
#endif
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_DEBUG,
"%s: num possible cpu %d",
__func__, num_possible_cpus());
cds_debug("num possible cpu %d", num_possible_cpus());
online_perf_cpu = qdf_mem_malloc(
num_possible_cpus() * sizeof(unsigned long));
if (!online_perf_cpu) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: perf cpu cache alloc fail", __func__);
cds_err("perf cpu cache alloc fail");
return 1;
}
online_litl_cpu = qdf_mem_malloc(
num_possible_cpus() * sizeof(unsigned long));
if (!online_litl_cpu) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: lttl cpu cache alloc fail", __func__);
cds_err("lttl cpu cache alloc fail");
qdf_mem_free(online_perf_cpu);
return 1;
}
@ -150,9 +146,8 @@ static int cds_sched_find_attach_cpu(p_cds_sched_context pSchedContext,
(LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0))
for_each_online_cpu(cpus) {
if (topology_physical_package_id(cpus) > CDS_MAX_CPU_CLUSTERS) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: can handle max %d clusters, returning...",
__func__, CDS_MAX_CPU_CLUSTERS);
cds_err("can handle max %d clusters, returning...",
CDS_MAX_CPU_CLUSTERS);
goto err;
}
@ -170,14 +165,12 @@ static int cds_sched_find_attach_cpu(p_cds_sched_context pSchedContext,
/* Single cluster system, not need to handle this */
if (CDS_CPU_CLUSTER_TYPE_LITTLE == cds_max_cluster_id) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO_LOW,
"%s: single cluster system. returning", __func__);
cds_debug("single cluster system. returning");
goto success;
}
if ((!litl_core_count) && (!perf_core_count)) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Both Cluster off, do nothing", __func__);
cds_err("Both Cluster off, do nothing");
goto success;
}
#if defined(WLAN_OPEN_SOURCE) && \
@ -206,9 +199,8 @@ static int cds_sched_find_attach_cpu(p_cds_sched_context pSchedContext,
CDS_CPU_CLUSTER_TYPE_LITTLE;
}
#endif
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO,
"%s: NUM PERF CORE %d, HIGH TPUT REQ %d, RX THRE CLUS %d",
__func__, perf_core_count,
cds_info("NUM PERF CORE %d, HIGH TPUT REQ %d, RX THRE CLUS %d",
perf_core_count,
(int)pSchedContext->high_throughput_required,
(int)pSchedContext->rx_thread_cpu_cluster);
@ -237,8 +229,7 @@ int cds_sched_handle_cpu_hot_plug(void)
p_cds_sched_context pSchedContext = get_cds_sched_ctxt();
if (!pSchedContext) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: invalid context", __func__);
cds_err("invalid context");
return 1;
}
@ -248,8 +239,7 @@ int cds_sched_handle_cpu_hot_plug(void)
mutex_lock(&pSchedContext->affinity_lock);
if (cds_sched_find_attach_cpu(pSchedContext,
pSchedContext->high_throughput_required)) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: handle hot plug fail", __func__);
cds_err("handle hot plug fail");
mutex_unlock(&pSchedContext->affinity_lock);
return 1;
}
@ -272,22 +262,19 @@ int cds_sched_handle_throughput_req(bool high_tput_required)
p_cds_sched_context pSchedContext = get_cds_sched_ctxt();
if (!pSchedContext) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: invalid context", __func__);
cds_err("invalid context");
return 1;
}
if (cds_is_load_or_unload_in_progress()) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: load or unload in progress", __func__);
cds_err("load or unload in progress");
return 0;
}
mutex_lock(&pSchedContext->affinity_lock);
pSchedContext->high_throughput_required = high_tput_required;
if (cds_sched_find_attach_cpu(pSchedContext, high_tput_required)) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: handle throughput req fail", __func__);
cds_err("handle throughput req fail");
mutex_unlock(&pSchedContext->affinity_lock);
return 1;
}
@ -429,18 +416,14 @@ QDF_STATUS cds_sched_open(void *p_cds_context,
p_cds_sched_context pSchedContext,
uint32_t SchedCtxSize)
{
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO_HIGH,
"%s: Opening the CDS Scheduler", __func__);
cds_debug("Opening the CDS Scheduler");
/* Sanity checks */
if ((p_cds_context == NULL) || (pSchedContext == NULL)) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Null params being passed", __func__);
cds_err("Null params being passed");
return QDF_STATUS_E_FAILURE;
}
if (sizeof(cds_sched_context) != SchedCtxSize) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO_HIGH,
"%s: Incorrect CDS Sched Context size passed",
__func__);
cds_debug("Incorrect CDS Sched Context size passed");
return QDF_STATUS_E_INVAL;
}
qdf_mem_zero(pSchedContext, sizeof(cds_sched_context));
@ -475,22 +458,17 @@ QDF_STATUS cds_sched_open(void *p_cds_context,
"cds_ol_rx_thread");
if (IS_ERR(pSchedContext->ol_rx_thread)) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL,
"%s: Could not Create CDS OL RX Thread",
__func__);
cds_alert("Could not Create CDS OL RX Thread");
goto OL_RX_THREAD_START_FAILURE;
}
wake_up_process(pSchedContext->ol_rx_thread);
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO_HIGH,
("CDS OL RX thread Created"));
cds_debug("CDS OL RX thread Created");
wait_for_completion_interruptible(&pSchedContext->ol_rx_start_event);
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO_HIGH,
"%s: CDS OL Rx Thread has started", __func__);
cds_debug("CDS OL Rx Thread has started");
#endif
/* We're good now: Let's get the ball rolling!!! */
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO_HIGH,
"%s: CDS Scheduler successfully Opened", __func__);
cds_debug("CDS Scheduler successfully Opened");
return QDF_STATUS_SUCCESS;
#ifdef QCA_CONFIG_SMP
@ -551,9 +529,7 @@ static QDF_STATUS cds_alloc_ol_rx_pkt_freeq(p_cds_sched_context pSchedContext)
for (i = 0; i < CDS_MAX_OL_RX_PKT; i++) {
pkt = qdf_mem_malloc(sizeof(*pkt));
if (!pkt) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s Vos packet allocation for ol rx thread failed",
__func__);
cds_err("Vos packet allocation for ol rx thread failed");
goto free;
}
spin_lock_bh(&pSchedContext->cds_ol_rx_pkt_freeq_lock);
@ -745,8 +721,7 @@ static int cds_ol_rx_thread(void *arg)
affine_cpu = pref_cpu;
if (!arg) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Bad Args passed", __func__);
cds_err("Bad Args passed");
return 0;
}
@ -775,10 +750,7 @@ static int cds_ol_rx_thread(void *arg)
complete
(&pSchedContext->ol_suspend_rx_event);
}
QDF_TRACE(QDF_MODULE_ID_QDF,
QDF_TRACE_LEVEL_INFO,
"%s: Shutting down OL RX Thread",
__func__);
cds_info("Shutting down OL RX Thread");
shutdown = true;
break;
}
@ -800,8 +772,7 @@ static int cds_ol_rx_thread(void *arg)
}
}
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_DEBUG,
"%s: Exiting CDS OL rx thread", __func__);
cds_debug("Exiting CDS OL rx thread");
complete_and_exit(&pSchedContext->ol_rx_shutdown, 0);
return 0;
@ -821,12 +792,10 @@ static int cds_ol_rx_thread(void *arg)
*/
QDF_STATUS cds_sched_close(void)
{
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO_HIGH,
"%s: invoked", __func__);
cds_debug("invoked");
if (gp_cds_sched_context == NULL) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: gp_cds_sched_context == NULL", __func__);
cds_err("gp_cds_sched_context == NULL");
return QDF_STATUS_E_FAILURE;
}
@ -857,8 +826,7 @@ p_cds_sched_context get_cds_sched_ctxt(void)
{
/* Make sure that Vos Scheduler context has been initialized */
if (gp_cds_sched_context == NULL)
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: gp_cds_sched_context == NULL", __func__);
cds_err("gp_cds_sched_context == NULL");
return gp_cds_sched_context;
}
@ -900,10 +868,9 @@ void cds_print_external_threads(void)
while (i < MAX_SSR_PROTECT_LOG) {
if (!ssr_protect_log[i].free) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"PID %d is executing %s",
ssr_protect_log[i].pid,
ssr_protect_log[i].func);
cds_err("PID %d is executing %s",
ssr_protect_log[i].pid,
ssr_protect_log[i].func);
}
i++;
}
@ -950,15 +917,13 @@ void cds_ssr_protect(const char *caller_func)
* logs while telling us which calls are taking a long time to finish.
*/
if (count >= MAX_SSR_PROTECT_LOG && count % MAX_SSR_PROTECT_LOG == 0) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"Protect Log overflow; Dumping contents:");
cds_err("Protect Log overflow; Dumping contents:");
cds_print_external_threads();
}
if (!status)
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s can not be protected; PID:%d, entry_count:%d",
caller_func, current->pid, count);
cds_err("%s can not be protected; PID:%d, entry_count:%d",
caller_func, current->pid, count);
}
/**
@ -995,9 +960,8 @@ void cds_ssr_unprotect(const char *caller_func)
spin_unlock_irqrestore(&ssr_protect_lock, irq_flags);
if (!status)
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s was not protected; PID:%d, entry_count:%d",
caller_func, current->pid, count);
cds_err("%s was not protected; PID:%d, entry_count:%d",
caller_func, current->pid, count);
}
/**
@ -1128,15 +1092,11 @@ bool cds_wait_for_external_threads_completion(const char *caller_func)
break;
if (--count) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Waiting for %d active entry points to exit",
__func__, r);
cds_err("Waiting for %d active entry points to exit",
r);
msleep(SSR_WAIT_SLEEP_TIME);
if (count & 0x1) {
QDF_TRACE(QDF_MODULE_ID_QDF,
QDF_TRACE_LEVEL_ERROR,
"%s: in middle of waiting for active entry points:",
__func__);
cds_err("in middle of waiting for active entry points:");
cds_print_external_threads();
}
}
@ -1144,14 +1104,12 @@ bool cds_wait_for_external_threads_completion(const char *caller_func)
/* at least one external thread is executing */
if (!count) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"Timed-out waiting for active entry points:");
cds_err("Timed-out waiting for active entry points:");
cds_print_external_threads();
return false;
}
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO,
"Allowing SSR/Driver unload for %s", caller_func);
cds_info("Allowing SSR/Driver unload for %s", caller_func);
return true;
}

View file

@ -348,8 +348,7 @@ cds_attach_mmie(uint8_t *igtk, uint8_t *ipn, uint16_t key_id,
/* Check if frame is invalid length */
if (((efrm - frm) != frmLen) || (frmLen < sizeof(*wh))) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Invalid frame length", __func__);
cds_err("Invalid frame length");
return false;
}
mmie = (struct ieee80211_mmie *)(efrm - sizeof(*mmie));
@ -378,16 +377,13 @@ cds_attach_mmie(uint8_t *igtk, uint8_t *ipn, uint16_t key_id,
if (IS_ERR(tfm)) {
ret = PTR_ERR(tfm);
tfm = NULL;
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: crypto_alloc_cipher failed (%d)", __func__, ret);
cds_err("crypto_alloc_cipher failed (%d)", ret);
goto err_tfm;
}
ret = crypto_cipher_setkey(tfm, igtk, AES_KEYSIZE_128);
if (ret) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: crypto_cipher_setkey failed (%d)", __func__,
ret);
cds_err("crypto_cipher_setkey failed (%d)", ret);
goto err_tfm;
}
@ -408,8 +404,7 @@ cds_attach_mmie(uint8_t *igtk, uint8_t *ipn, uint16_t key_id,
nBytes = AAD_LEN + (frmLen - sizeof(struct ieee80211_frame));
input = (uint8_t *) qdf_mem_malloc(nBytes);
if (NULL == input) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"%s: Memory allocation failed", __func__);
cds_err("Memory allocation failed");
ret = QDF_STATUS_E_NOMEM;
goto err_tfm;
}
@ -428,8 +423,7 @@ cds_attach_mmie(uint8_t *igtk, uint8_t *ipn, uint16_t key_id,
cds_cmac_calc_mic(tfm, input, nBytes, mic);
qdf_mem_free(input);
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO_HIGH,
"CMAC(T)= %02X %02X %02X %02X %02X %02X %02X %02X",
cds_debug("CMAC(T)= %02X %02X %02X %02X %02X %02X %02X %02X",
mic[0], mic[1], mic[2], mic[3],
mic[4], mic[5], mic[6], mic[7]);
qdf_mem_copy(mmie->mic, mic, IEEE80211_MMIE_MICLEN);
@ -456,8 +450,7 @@ cds_is_mmie_valid(uint8_t *igtk, uint8_t *ipn, uint8_t *frm, uint8_t *efrm)
/* Check if frame is invalid length */
if ((efrm < frm) || ((efrm - frm) < sizeof(*wh))) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"Invalid frame length");
cds_err("Invalid frame length");
return false;
}
@ -466,8 +459,7 @@ cds_is_mmie_valid(uint8_t *igtk, uint8_t *ipn, uint8_t *frm, uint8_t *efrm)
/* Check Element ID */
if ((mmie->element_id != IEEE80211_ELEMID_MMIE) ||
(mmie->length != (sizeof(*mmie) - 2))) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"IE is not Mgmt MIC IE or Invalid length");
cds_err("IE is not Mgmt MIC IE or Invalid length");
/* IE is not Mgmt MIC IE or invalid length */
return false;
}
@ -476,8 +468,7 @@ cds_is_mmie_valid(uint8_t *igtk, uint8_t *ipn, uint8_t *frm, uint8_t *efrm)
rx_ipn = mmie->sequence_number;
if (OS_MEMCMP(rx_ipn, ipn, CMAC_IPN_LEN) <= 0) {
/* Replay error */
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"Replay error mmie ipn %02X %02X %02X %02X %02X %02X"
cds_err("Replay error mmie ipn %02X %02X %02X %02X %02X %02X"
" drvr ipn %02X %02X %02X %02X %02X %02X",
rx_ipn[0], rx_ipn[1], rx_ipn[2], rx_ipn[3], rx_ipn[4],
rx_ipn[5], ipn[0], ipn[1], ipn[2], ipn[3], ipn[4],
@ -488,15 +479,13 @@ cds_is_mmie_valid(uint8_t *igtk, uint8_t *ipn, uint8_t *frm, uint8_t *efrm)
if (IS_ERR(tfm)) {
ret = PTR_ERR(tfm);
tfm = NULL;
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"crypto_alloc_cipher failed (%d)", ret);
cds_err("crypto_alloc_cipher failed (%d)", ret);
goto err_tfm;
}
ret = crypto_cipher_setkey(tfm, igtk, AES_KEYSIZE_128);
if (ret) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"crypto_cipher_setkey failed (%d)", ret);
cds_err("crypto_cipher_setkey failed (%d)", ret);
goto err_tfm;
}
@ -517,8 +506,7 @@ cds_is_mmie_valid(uint8_t *igtk, uint8_t *ipn, uint8_t *frm, uint8_t *efrm)
nBytes = AAD_LEN + (efrm - (uint8_t *) (wh + 1));
input = (uint8_t *) qdf_mem_malloc(nBytes);
if (NULL == input) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"Memory allocation failed");
cds_err("Memory allocation failed");
ret = QDF_STATUS_E_NOMEM;
goto err_tfm;
}
@ -531,15 +519,13 @@ cds_is_mmie_valid(uint8_t *igtk, uint8_t *ipn, uint8_t *frm, uint8_t *efrm)
cds_cmac_calc_mic(tfm, input, nBytes, mic);
qdf_mem_free(input);
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"CMAC(T)= %02X %02X %02X %02X %02X %02X %02X %02X",
mic[0], mic[1], mic[2], mic[3],
mic[4], mic[5], mic[6], mic[7]);
cds_err("CMAC(T)= %02X %02X %02X %02X %02X %02X %02X %02X",
mic[0], mic[1], mic[2], mic[3],
mic[4], mic[5], mic[6], mic[7]);
if (OS_MEMCMP(mic, mmie->mic, CMAC_TLEN) != 0) {
/* MMIE MIC mismatch */
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"BC/MC MGMT frame MMIE MIC check Failed"
cds_err("BC/MC MGMT frame MMIE MIC check Failed"
" rmic %02X %02X %02X %02X %02X %02X %02X %02X"
" cmic %02X %02X %02X %02X %02X %02X %02X %02X",
mmie->mic[0], mmie->mic[1], mmie->mic[2],
@ -602,8 +588,7 @@ bool cds_is_gmac_mmie_valid(uint8_t *igtk, uint8_t *ipn, uint8_t *frm,
/* Check if frame is invalid length */
if ((efrm < frm) || ((efrm - frm) < sizeof(*wh))) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"Invalid frame length");
cds_err("Invalid frame length");
return false;
}
@ -612,8 +597,7 @@ bool cds_is_gmac_mmie_valid(uint8_t *igtk, uint8_t *ipn, uint8_t *frm,
/* Check Element ID */
if ((mmie->element_id != IEEE80211_ELEMID_MMIE) ||
(mmie->length != (sizeof(*mmie) - 2))) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"IE is not Mgmt MIC IE or Invalid length");
cds_err("IE is not Mgmt MIC IE or Invalid length");
/* IE is not Mgmt MIC IE or invalid length */
return false;
}
@ -622,8 +606,7 @@ bool cds_is_gmac_mmie_valid(uint8_t *igtk, uint8_t *ipn, uint8_t *frm,
ipn_swap(rx_ipn, mmie->sequence_number);
if (qdf_mem_cmp(rx_ipn, ipn, IEEE80211_MMIE_IPNLEN) <= 0) {
/* Replay error */
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_DEBUG,
"Replay error mmie ipn %02X %02X %02X %02X %02X %02X"
cds_debug("Replay error mmie ipn %02X %02X %02X %02X %02X %02X"
" drvr ipn %02X %02X %02X %02X %02X %02X",
rx_ipn[0], rx_ipn[1], rx_ipn[2], rx_ipn[3], rx_ipn[4],
rx_ipn[5], ipn[0], ipn[1], ipn[2], ipn[3], ipn[4],
@ -655,15 +638,13 @@ bool cds_is_gmac_mmie_valid(uint8_t *igtk, uint8_t *ipn, uint8_t *frm,
ret = qdf_crypto_aes_gmac(igtk, key_length, iv, aad,
(uint8_t *) (wh + 1), data_len, mic);
if (ret) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"qdf_crypto_aes_gmac failed %d", ret);
cds_err("qdf_crypto_aes_gmac failed %d", ret);
return false;
}
if (qdf_mem_cmp(mic, mmie->mic, IEEE80211_MMIE_GMAC_MICLEN) != 0) {
/* MMIE MIC mismatch */
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_DEBUG,
"BC/MC MGMT frame MMIE MIC check Failed"
cds_debug("BC/MC MGMT frame MMIE MIC check Failed"
" rmic %02X %02X %02X %02X %02X %02X %02X %02X"
" %02X %02X %02X %02X %02X %02X %02X %02X",
mmie->mic[0], mmie->mic[1], mmie->mic[2],
@ -749,8 +730,7 @@ void cds_copy_hlp_info(struct qdf_mac_addr *input_dst_mac,
uint8_t *output_hlp_data)
{
if (!input_hlp_data_len) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
"Input HLP data len zero\n");
cds_err("Input HLP data len zero\n");
return;
}