#define DEBUGFS_READONLY_FILE(name, buflen, fmt, value...) \
static ssize_t name## _read(struct file *file, char __user *userbuf, \
size_t count, loff_t *ppos) \
struct wiphy *wiphy = file->private_data; \
res = scnprintf(buf, buflen, fmt "\n", ##value); \
return simple_read_from_buffer(userbuf, count, ppos, buf, res); \
static const struct file_operations name## _ops = { \
.llseek = generic_file_llseek, \
DEBUGFS_READONLY_FILE(rts_threshold, 20, "%d",
DEBUGFS_READONLY_FILE(fragmentation_threshold, 20, "%d",
DEBUGFS_READONLY_FILE(short_retry_limit, 20, "%d",
DEBUGFS_READONLY_FILE(long_retry_limit, 20, "%d",
static int ht_print_chan(struct ieee80211_channel *chan,
char *buf, int buf_size, int offset)
if (WARN_ON(offset > buf_size))
if (chan->flags & IEEE80211_CHAN_DISABLED)
return scnprintf(buf + offset,
return scnprintf(buf + offset,
(chan->flags & IEEE80211_CHAN_NO_HT40MINUS) ?
(chan->flags & IEEE80211_CHAN_NO_HT40PLUS) ?