^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Linux WiMAX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Debugfs support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Copyright (C) 2005-2006 Intel Corporation <linux-wimax@intel.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include <linux/debugfs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <linux/wimax.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include "wimax-internal.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #define D_SUBMODULE debugfs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include "debug-levels.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) void wimax_debugfs_add(struct wimax_dev *wimax_dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) struct net_device *net_dev = wimax_dev->net_dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) struct dentry *dentry;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) char buf[128];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) snprintf(buf, sizeof(buf), "wimax:%s", net_dev->name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) dentry = debugfs_create_dir(buf, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) wimax_dev->debugfs_dentry = dentry;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) d_level_register_debugfs("wimax_dl_", debugfs, dentry);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) d_level_register_debugfs("wimax_dl_", id_table, dentry);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) d_level_register_debugfs("wimax_dl_", op_msg, dentry);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) d_level_register_debugfs("wimax_dl_", op_reset, dentry);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) d_level_register_debugfs("wimax_dl_", op_rfkill, dentry);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) d_level_register_debugfs("wimax_dl_", op_state_get, dentry);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) d_level_register_debugfs("wimax_dl_", stack, dentry);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) void wimax_debugfs_rm(struct wimax_dev *wimax_dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) debugfs_remove_recursive(wimax_dev->debugfs_dentry);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) }