18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Linux WiMAX
48c2ecf20Sopenharmony_ci * Debugfs support
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * Copyright (C) 2005-2006 Intel Corporation <linux-wimax@intel.com>
78c2ecf20Sopenharmony_ci * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci#include <linux/debugfs.h>
108c2ecf20Sopenharmony_ci#include <linux/wimax.h>
118c2ecf20Sopenharmony_ci#include "wimax-internal.h"
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#define D_SUBMODULE debugfs
148c2ecf20Sopenharmony_ci#include "debug-levels.h"
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_civoid wimax_debugfs_add(struct wimax_dev *wimax_dev)
178c2ecf20Sopenharmony_ci{
188c2ecf20Sopenharmony_ci	struct net_device *net_dev = wimax_dev->net_dev;
198c2ecf20Sopenharmony_ci	struct dentry *dentry;
208c2ecf20Sopenharmony_ci	char buf[128];
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci	snprintf(buf, sizeof(buf), "wimax:%s", net_dev->name);
238c2ecf20Sopenharmony_ci	dentry = debugfs_create_dir(buf, NULL);
248c2ecf20Sopenharmony_ci	wimax_dev->debugfs_dentry = dentry;
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci	d_level_register_debugfs("wimax_dl_", debugfs, dentry);
278c2ecf20Sopenharmony_ci	d_level_register_debugfs("wimax_dl_", id_table, dentry);
288c2ecf20Sopenharmony_ci	d_level_register_debugfs("wimax_dl_", op_msg, dentry);
298c2ecf20Sopenharmony_ci	d_level_register_debugfs("wimax_dl_", op_reset, dentry);
308c2ecf20Sopenharmony_ci	d_level_register_debugfs("wimax_dl_", op_rfkill, dentry);
318c2ecf20Sopenharmony_ci	d_level_register_debugfs("wimax_dl_", op_state_get, dentry);
328c2ecf20Sopenharmony_ci	d_level_register_debugfs("wimax_dl_", stack, dentry);
338c2ecf20Sopenharmony_ci}
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_civoid wimax_debugfs_rm(struct wimax_dev *wimax_dev)
368c2ecf20Sopenharmony_ci{
378c2ecf20Sopenharmony_ci	debugfs_remove_recursive(wimax_dev->debugfs_dentry);
388c2ecf20Sopenharmony_ci}
39