iwlagn: transport handler can register debugfs entries
Add a handler in iwl_trans_ops to allow it to add entries under debugfs dir
given by the upper level.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h
index 4a0c786..a9b3157 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/iwlwifi/iwl-trans.h
@@ -63,6 +63,8 @@
#ifndef __iwl_trans_h__
#define __iwl_trans_h__
+#include <linux/debugfs.h>
+
/*This file includes the declaration that are exported from the transport
* layer */
@@ -98,6 +100,8 @@
* layer shall not pass any Rx.
* @free: release all the ressource for the transport layer itself such as
* irq, tasklet etc...
+ * @dbgfs_register: add the dbgfs files under this directory. Files will be
+ * automatically deleted.
*/
struct iwl_trans_ops {
@@ -128,6 +132,8 @@
void (*sync_irq)(struct iwl_priv *priv);
void (*free)(struct iwl_priv *priv);
+
+ int (*dbgfs_register)(struct iwl_trans *trans, struct dentry* dir);
};
/**
@@ -232,6 +238,12 @@
trans->ops->free(priv(trans));
}
+static inline int iwl_trans_dbgfs_register(struct iwl_trans *trans,
+ struct dentry *dir)
+{
+ return trans->ops->dbgfs_register(trans, dir);
+}
+
/*****************************************************
* Transport layers implementations
******************************************************/