.owner = THIS_MODULE, \ .open = (_open), \ .read = (_read), \ .write = (_write), \ .poll = (_poll), \ } struct wilc_debugfs_info_t { const char *name; int perm; unsigned int data; const struct file_operations fops; }; static struct wilc_debugfs_info_t debugfs_info[] = { { "wilc_debug_level", 0666, (DEBUG | ERR), FOPS(NULL, wilc_debug_level_read, wilc_debug_level_write, NULL), }, }; static int __init wilc_debugfs_init(void) { int i; struct dentry *debugfs_files; struct wilc_debugfs_info_t *info; wilc_dir = debugfs_create_dir("wilc_wifi", NULL); if (wilc_dir == ERR_PTR(-ENODEV)) { /* it's not error. the debugfs is just not being enabled. */ printk("ERR, kernel has built without debugfs support\n"); return 0; }
.owner = THIS_MODULE, \ .open = (fopen), \ .read = seq_read, \ .llseek = seq_lseek, \ } #define FOPS_RW(fopen, fwrite) { \ .owner = THIS_MODULE, \ .open = (fopen), \ .read = seq_read, \ .llseek = seq_lseek, \ .write = (fwrite), \ } static const struct rsi_dbg_files dev_debugfs_files[] = { {"version", 0644, FOPS(rsi_version_open),}, {"stats", 0644, FOPS(rsi_stats_open),}, {"debug_zone", 0666, FOPS_RW(rsi_debug_read, rsi_debug_zone_write),}, {"sdio_stats", 0644, FOPS(rsi_sdio_stats_open),}, }; /** * rsi_init_dbgfs() - This function initializes the dbgfs entry. * @adapter: Pointer to the adapter structure. * * Return: 0 on success, -1 on failure. */ int rsi_init_dbgfs(struct rsi_hw *adapter) { struct rsi_common *common = adapter->priv; struct rsi_debugfs *dev_dbgfs;
#define FOPS(fread, fwrite) { \ .owner = THIS_MODULE, \ .open = open_file_generic, \ .read = (fread), \ .write = (fwrite), \ .llseek = generic_file_llseek, \ } struct lbs_debugfs_files { const char *name; int perm; struct file_operations fops; }; static const struct lbs_debugfs_files debugfs_files[] = { { "info", 0444, FOPS(lbs_dev_info, write_file_dummy), }, { "sleepparams", 0644, FOPS(lbs_sleepparams_read, lbs_sleepparams_write), }, { "hostsleep", 0644, FOPS(lbs_host_sleep_read, lbs_host_sleep_write), }, }; static const struct lbs_debugfs_files debugfs_events_files[] = { {"low_rssi", 0644, FOPS(lbs_lowrssi_read, lbs_lowrssi_write), }, {"low_snr", 0644, FOPS(lbs_lowsnr_read, lbs_lowsnr_write), }, {"failure_count", 0644, FOPS(lbs_failcount_read, lbs_failcount_write), }, {"beacon_missed", 0644, FOPS(lbs_bcnmiss_read, lbs_bcnmiss_write), },
#define FOPS(fread, fwrite) { \ .owner = THIS_MODULE, \ .open = open_file_generic, \ .read = (fread), \ .write = (fwrite), \ } struct rda5890_debugfs_files { char *name; int perm; struct file_operations fops; }; static struct rda5890_debugfs_files debugfs_files[] = { { "debug", 0444, FOPS(rda5890_debug_read, rda5890_debug_write), }, { "debugarea", 0444, FOPS(rda5890_debugarea_read, rda5890_debugarea_write), }, { "debuglevel", 0444, FOPS(rda5890_debuglevel_read, rda5890_debuglevel_write), }, { "sdioread", 0444, FOPS(NULL, rda5890_sdio_read), }, { "sdiowrite", 0444, FOPS(NULL, rda5890_sdio_write), }, { "sdiotput", 0444, FOPS(NULL, rda5890_sdio_tput), }, }; void rda5890_debugfs_init(void) { RDA5890_DBGLAP(RDA5890_DA_SDIO, RDA5890_DL_DEBUG, "%s\n", __func__); if (!rda5890_dir) rda5890_dir = debugfs_create_dir("rda5890", NULL);
.owner = THIS_MODULE, \ .open = (_open), \ .read = (_read), \ .write = (_write), \ .poll = (_poll), \ } struct atwilc_debugfs_info_t { const char *name; int perm; unsigned int data; struct file_operations fops; }; static struct atwilc_debugfs_info_t debugfs_info[] = { { "atwilc_debug_level", 0666, (DEBUG | ERR), FOPS(atwilc_debug_level_open, atwilc_debug_level_read, atwilc_debug_level_write,NULL), }, { "atwilc_debug_region", 0666, (INIT_DBG | GENERIC_DBG | CFG80211_DBG), FOPS(atwilc_debug_region_open, atwilc_debug_region_read, atwilc_debug_region_write, NULL), }, { "atwilc_debug_dump", 0666, 0, FOPS(atwilc_debug_dump_open, kmsgdump_read, NULL, kmsgdump_poll), }, }; int atwilc_debugfs_init(void) { int i; struct dentry *debugfs_files; struct atwilc_debugfs_info_t *info; atwilc_dir = debugfs_create_dir("atwilc_wifi", NULL); if(atwilc_dir == ERR_PTR(-ENODEV)) { /* it's not error. the debugfs is just not being enabled. */ printk("ERR, kernel has built without debugfs support\n");
.poll = (_poll), \ } struct wilc_debugfs_info_t { const char *name; int perm; unsigned int data; const struct file_operations fops; }; static struct wilc_debugfs_info_t debugfs_info[] = { { "wilc_debug_level", 0666, (DEBUG | ERR), FOPS(NULL, wilc_debug_level_read, wilc_debug_level_write, NULL), }, }; static int __init wilc_debugfs_init(void) { int i; struct wilc_debugfs_info_t *info; wilc_dir = debugfs_create_dir("wilc_wifi", NULL); for (i = 0; i < ARRAY_SIZE(debugfs_info); i++) { info = &debugfs_info[i]; debugfs_create_file(info->name, info->perm, wilc_dir, &info->data,