qcacmn: Add debugfs support
Create a root directory for debugfs at /sys/kernel/debug/KBUILD_MODNAME_qdf/. The module name, KBUILD_MODNAME, is used in the path to avoid conflict in case of multiple instances of the same driver. Any sub module in QDF can use this as the root directory to add further files of directories. While unloading the driver the exit routine does a recursive cleanup of any remaining files or sub directories. Even though debugfs is a Linux specific feature, a logic which is related to file system for debugging can be added here. This feature is protected with a compilation flag WLAN_DEBUGFS. Change-Id: I21cae38b69f45c22121dfe70fe84f02423a26020 CRs-Fixed: 1083771
This commit is contained in:

committed by
qcabuildsw

orang tua
5fe84fede1
melakukan
e79aee03e8
60
qdf/inc/qdf_debugfs.h
Normal file
60
qdf/inc/qdf_debugfs.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (c) 2017 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 copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: qdf_debugfs.h
|
||||
* This file provides OS abstraction for debug filesystem APIs.
|
||||
*/
|
||||
|
||||
#ifndef _QDF_DEBUGFS_H
|
||||
#define _QDF_DEBUGFS_H
|
||||
|
||||
#include <qdf_status.h>
|
||||
#include <i_qdf_debugfs.h>
|
||||
|
||||
#ifdef WLAN_DEBUGFS
|
||||
/**
|
||||
* qdf_debugfs_init() - initialize debugfs
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS qdf_debugfs_init(void);
|
||||
|
||||
/**
|
||||
* qdf_debugfs_exit() - cleanup debugfs
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS qdf_debugfs_exit(void);
|
||||
|
||||
#else
|
||||
|
||||
static inline QDF_STATUS qdf_debugfs_init(void)
|
||||
{
|
||||
return QDF_STATUS_E_NOSUPPORT;
|
||||
}
|
||||
|
||||
static inline QDF_STATUS qdf_debugfs_exit(void)
|
||||
{
|
||||
return QDF_STATUS_E_NOSUPPORT;
|
||||
}
|
||||
|
||||
#endif /* WLAN_DEBUGFS */
|
||||
#endif /* _QDF_DEBUGFS_H */
|
||||
|
||||
|
Reference in New Issue
Block a user