Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
debugfs.h File Reference
#include "wlcore.h"

Go to the source code of this file.

Macros

#define DEBUGFS_FORMAT_BUFFER_SIZE   256
 
#define DEBUGFS_READONLY_FILE(name, fmt, value...)
 
#define DEBUGFS_ADD(name, parent)
 
#define DEBUGFS_ADD_PREFIX(prefix, name, parent)
 
#define DEBUGFS_FWSTATS_FILE(sub, name, fmt, struct_type)
 
#define DEBUGFS_FWSTATS_FILE_ARRAY(sub, name, len, struct_type)
 
#define DEBUGFS_FWSTATS_ADD(sub, name)   DEBUGFS_ADD(sub## _ ##name, stats)
 

Functions

int wl1271_format_buffer (char __user *userbuf, size_t count, loff_t *ppos, char *fmt,...)
 
int wl1271_debugfs_init (struct wl1271 *wl)
 
void wl1271_debugfs_exit (struct wl1271 *wl)
 
void wl1271_debugfs_reset (struct wl1271 *wl)
 
void wl1271_debugfs_update_stats (struct wl1271 *wl)
 

Macro Definition Documentation

#define DEBUGFS_ADD (   name,
  parent 
)
Value:
do { \
entry = debugfs_create_file(#name, 0400, parent, \
wl, &name## _ops); \
if (!entry || IS_ERR(entry)) \
goto err; \
} while (0);

Definition at line 54 of file debugfs.h.

#define DEBUGFS_ADD_PREFIX (   prefix,
  name,
  parent 
)
Value:
do { \
entry = debugfs_create_file(#name, 0400, parent, \
wl, &prefix## _## name## _ops); \
if (!entry || IS_ERR(entry)) \
goto err; \
} while (0);

Definition at line 63 of file debugfs.h.

#define DEBUGFS_FORMAT_BUFFER_SIZE   256

Definition at line 37 of file debugfs.h.

#define DEBUGFS_FWSTATS_ADD (   sub,
  name 
)    DEBUGFS_ADD(sub## _ ##name, stats)

Definition at line 116 of file debugfs.h.

#define DEBUGFS_FWSTATS_FILE (   sub,
  name,
  fmt,
  struct_type 
)
Value:
static ssize_t sub## _ ##name## _read(struct file *file, \
char __user *userbuf, \
size_t count, loff_t *ppos) \
{ \
struct struct_type *stats = wl->stats.fw_stats; \
\
return wl1271_format_buffer(userbuf, count, ppos, fmt "\n", \
stats->sub.name); \
} \
\
static const struct file_operations sub## _ ##name## _ops = { \
.read = sub## _ ##name## _read, \
.open = simple_open, \
.llseek = generic_file_llseek, \
};

Definition at line 71 of file debugfs.h.

#define DEBUGFS_FWSTATS_FILE_ARRAY (   sub,
  name,
  len,
  struct_type 
)
Value:
static ssize_t sub## _ ##name## _read(struct file *file, \
char __user *userbuf, \
size_t count, loff_t *ppos) \
{ \
struct struct_type *stats = wl->stats.fw_stats; \
int res, i; \
for (i = 0; i < len; i++) \
res = snprintf(buf, sizeof(buf), "%s[%d] = %d\n", \
buf, i, stats->sub.name[i]); \
\
return wl1271_format_buffer(userbuf, count, ppos, "%s", buf); \
} \
\
static const struct file_operations sub## _ ##name## _ops = { \
.read = sub## _ ##name## _read, \
.open = simple_open, \
.llseek = generic_file_llseek, \
};

Definition at line 91 of file debugfs.h.

#define DEBUGFS_READONLY_FILE (   name,
  fmt,
  value... 
)
Value:
static ssize_t name## _read(struct file *file, char __user *userbuf, \
size_t count, loff_t *ppos) \
{ \
return wl1271_format_buffer(userbuf, count, ppos, \
fmt "\n", ##value); \
} \
\
static const struct file_operations name## _ops = { \
.read = name## _read, \
.open = simple_open, \
.llseek = generic_file_llseek, \
};

Definition at line 39 of file debugfs.h.

Function Documentation

void wl1271_debugfs_exit ( struct wl1271 wl)

Definition at line 1325 of file debugfs.c.

int wl1271_debugfs_init ( struct wl1271 wl)

Definition at line 1284 of file debugfs.c.

void wl1271_debugfs_reset ( struct wl1271 wl)

Definition at line 1274 of file debugfs.c.

void wl1271_debugfs_update_stats ( struct wl1271 wl)

Definition at line 59 of file debugfs.c.

int wl1271_format_buffer ( char __user userbuf,
size_t  count,
loff_t *  ppos,
char fmt,
  ... 
)

Definition at line 44 of file debugfs.c.