From 77a23e8f71c7ca7f65185b02d0511610d22e9d61 Mon Sep 17 00:00:00 2001 From: Debasis Das Date: Fri, 31 Jul 2020 17:06:07 +0530 Subject: [PATCH] qcacmn: Use abstraction APIs for kernel APIs Use non-inline OS-abstraction APIs to avoid direct usage of kernel API's. Use non-inline OS-abstraction APIs instead of OS APIs. Change-Id: Ie4acfedc63a0e0e8ecbe358db711148db92bd8b6 --- iot_sim/core/iot_sim_common.c | 16 ++++++++-------- iot_sim/core/iot_sim_defs_i.h | 7 ++++++- utils/fwlog/dbglog_host.c | 13 +++++++------ 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/iot_sim/core/iot_sim_common.c b/iot_sim/core/iot_sim_common.c index 2a7183f3f3..e6b83ce7d0 100644 --- a/iot_sim/core/iot_sim_common.c +++ b/iot_sim/core/iot_sim_common.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2020-2021, 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 above @@ -1711,7 +1711,7 @@ struct iot_sim_dbgfs_file iot_sim_dbgfs_files[IOT_SIM_DEBUGFS_FILE_NUM] = { static QDF_STATUS iot_sim_debugfs_deinit(struct iot_sim_context *isc) { - debugfs_remove_recursive(isc->iot_sim_dbgfs_ctx.iot_sim_dir_de); + qdf_debugfs_remove_dir_recursive(isc->iot_sim_dbgfs_ctx.iot_sim_dir_de); return QDF_STATUS_SUCCESS; } @@ -1791,7 +1791,7 @@ iot_sim_debugfs_init(struct iot_sim_context *isc) qdf_mem_zero(buf, sizeof(buf)); snprintf(buf, sizeof(buf), "iot_sim_pdev%u", pdev_id); - dbgfs_dir = debugfs_create_dir(buf, NULL); + dbgfs_dir = qdf_debugfs_create_dir(buf, NULL); isc->iot_sim_dbgfs_ctx.iot_sim_dir_de = dbgfs_dir; if (!isc->iot_sim_dbgfs_ctx.iot_sim_dir_de) { @@ -1800,10 +1800,10 @@ iot_sim_debugfs_init(struct iot_sim_context *isc) } for (i = 0; i < IOT_SIM_DEBUGFS_FILE_NUM; ++i) { - de = debugfs_create_file(iot_sim_dbgfs_files[i].name, - 0644, - dbgfs_dir, isc, - iot_sim_dbgfs_files[i].ops); + de = qdf_debugfs_create_entry(iot_sim_dbgfs_files[i].name, + IOT_SIM_DBG_FILE_PERM, + dbgfs_dir, isc, + iot_sim_dbgfs_files[i].ops); if (!de) { iot_sim_err("dbgfs file creation failed for pdev%u", @@ -1816,7 +1816,7 @@ iot_sim_debugfs_init(struct iot_sim_context *isc) return QDF_STATUS_SUCCESS; out: - debugfs_remove_recursive(dbgfs_dir); + qdf_debugfs_remove_dir_recursive(dbgfs_dir); qdf_mem_set(isc->iot_sim_dbgfs_ctx.iot_sim_file_de, sizeof(isc->iot_sim_dbgfs_ctx.iot_sim_file_de), 0); diff --git a/iot_sim/core/iot_sim_defs_i.h b/iot_sim/core/iot_sim_defs_i.h index dae251c3fa..ccbe8f4b12 100644 --- a/iot_sim/core/iot_sim_defs_i.h +++ b/iot_sim/core/iot_sim_defs_i.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2020-2021, 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 above @@ -82,6 +82,11 @@ #define FRAME_TYPE_IS_BEACON(type, subtype) ((type) == 0 && (subtype) == 8) #define FRAME_TYPE_IS_ACTION(type, subtype) ((type) == 0 && (subtype) == 13) +#define IOT_SIM_DBG_FILE_PERM (QDF_FILE_USR_READ | \ + QDF_FILE_USR_WRITE | \ + QDF_FILE_GRP_READ | \ + QDF_FILE_OTH_READ) + enum iot_sim_action_cat_type { CAT_SPECTRUM, CAT_QOS, diff --git a/utils/fwlog/dbglog_host.c b/utils/fwlog/dbglog_host.c index 221066dd5a..3feebd4d05 100644 --- a/utils/fwlog/dbglog_host.c +++ b/utils/fwlog/dbglog_host.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2021 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 @@ -49,6 +49,7 @@ #define CLD_DEBUGFS_DIR "cld" #endif #define DEBUGFS_BLOCK_NAME "dbglog_block" +#define DEBUGFS_BLOCK_PERM QDF_FILE_USR_READ #define ATH_MODULE_NAME fwlog #include @@ -4135,22 +4136,22 @@ static const struct file_operations fops_dbglog_block = { static void dbglog_debugfs_init(wmi_unified_t wmi_handle) { - wmi_handle->debugfs_phy = debugfs_create_dir(CLD_DEBUGFS_DIR, NULL); + wmi_handle->debugfs_phy = qdf_debugfs_create_dir(CLD_DEBUGFS_DIR, NULL); if (!wmi_handle->debugfs_phy) { qdf_print("Failed to create WMI debug fs"); return; } - debugfs_create_file(DEBUGFS_BLOCK_NAME, 0400, - wmi_handle->debugfs_phy, &wmi_handle->dbglog, - &fops_dbglog_block); + qdf_debugfs_create_entry(DEBUGFS_BLOCK_NAME, DEBUGFS_BLOCK_PERM, + wmi_handle->debugfs_phy, &wmi_handle->dbglog, + &fops_dbglog_block); return; } static void dbglog_debugfs_remove(wmi_unified_t wmi_handle) { - debugfs_remove_recursive(wmi_handle->debugfs_phy); + qdf_debugfs_remove_dir_recursive(wmi_handle->debugfs_phy); } #else