12 #include <linux/rtnetlink.h>
18 #define DEBUGFS_FORMAT_BUFFER_SIZE 100
21 loff_t *ppos,
char *
fmt, ...)
34 #define DEBUGFS_READONLY_FILE_FN(name, fmt, value...) \
35 static ssize_t name## _read(struct file *file, char __user *userbuf, \
36 size_t count, loff_t *ppos) \
38 struct ieee80211_local *local = file->private_data; \
40 return mac80211_format_buffer(userbuf, count, ppos, \
44 #define DEBUGFS_READONLY_FILE_OPS(name) \
45 static const struct file_operations name## _ops = { \
46 .read = name## _read, \
47 .open = simple_open, \
48 .llseek = generic_file_llseek, \
51 #define DEBUGFS_READONLY_FILE(name, fmt, value...) \
52 DEBUGFS_READONLY_FILE_FN(name, fmt, value) \
53 DEBUGFS_READONLY_FILE_OPS(name)
55 #define DEBUGFS_ADD(name) \
56 debugfs_create_file(#name, 0400, phyd, local, &name## _ops);
58 #define DEBUGFS_ADD_MODE(name, mode) \
59 debugfs_create_file(#name, mode, phyd, local, &name## _ops);
63 local->user_power_level);
65 local->hw.conf.power_level);
67 local->total_ps_buffered);
69 local->wep_iv & 0xffffff);
71 local->rate_ctrl ? local->rate_ctrl->ops->name :
"hw/driver");
74 static ssize_t reset_write(
struct file *
file,
const char __user *user_buf,
75 size_t count, loff_t *ppos)
81 __ieee80211_resume(&local->
hw);
95 size_t count, loff_t *ppos)
106 sf +=
snprintf(buf, mxln - sf,
"0x%x\n", local->
hw.flags);
108 sf +=
snprintf(buf + sf, mxln - sf,
"HAS_RATE_CONTROL\n");
110 sf +=
snprintf(buf + sf, mxln - sf,
"RX_INCLUDES_FCS\n");
113 "HOST_BCAST_PS_BUFFERING\n");
116 "2GHZ_SHORT_SLOT_INCAPABLE\n");
119 "2GHZ_SHORT_PREAMBLE_INCAPABLE\n");
121 sf +=
snprintf(buf + sf, mxln - sf,
"SIGNAL_UNSPEC\n");
123 sf +=
snprintf(buf + sf, mxln - sf,
"SIGNAL_DBM\n");
125 sf +=
snprintf(buf + sf, mxln - sf,
"NEED_DTIM_PERIOD\n");
127 sf +=
snprintf(buf + sf, mxln - sf,
"SPECTRUM_MGMT\n");
129 sf +=
snprintf(buf + sf, mxln - sf,
"AMPDU_AGGREGATION\n");
131 sf +=
snprintf(buf + sf, mxln - sf,
"SUPPORTS_PS\n");
133 sf +=
snprintf(buf + sf, mxln - sf,
"PS_NULLFUNC_STACK\n");
135 sf +=
snprintf(buf + sf, mxln - sf,
"SUPPORTS_DYNAMIC_PS\n");
137 sf +=
snprintf(buf + sf, mxln - sf,
"MFP_CAPABLE\n");
139 sf +=
snprintf(buf + sf, mxln - sf,
"SUPPORTS_STATIC_SMPS\n");
141 sf +=
snprintf(buf + sf, mxln - sf,
"SUPPORTS_DYNAMIC_SMPS\n");
143 sf +=
snprintf(buf + sf, mxln - sf,
"SUPPORTS_UAPSD\n");
145 sf +=
snprintf(buf + sf, mxln - sf,
"REPORTS_TX_ACK_STATUS\n");
147 sf +=
snprintf(buf + sf, mxln - sf,
"CONNECTION_MONITOR\n");
149 sf +=
snprintf(buf + sf, mxln - sf,
"SUPPORTS_PER_STA_GTK\n");
151 sf +=
snprintf(buf + sf, mxln - sf,
"AP_LINK_PS\n");
153 sf +=
snprintf(buf + sf, mxln - sf,
"TX_AMPDU_SETUP_IN_HW\n");
155 sf +=
snprintf(buf + sf, mxln - sf,
"SCAN_WHILE_IDLE\n");
162 static ssize_t queues_read(
struct file *file,
char __user *user_buf,
163 size_t count, loff_t *ppos)
171 for (q = 0; q < local->
hw.queues; q++)
172 res +=
sprintf(buf + res,
"%02d: %#.8lx/%d\n", q,
174 skb_queue_len(&local->
pending[q]));
186 char __user *userbuf,
187 size_t count, loff_t *ppos,
196 res = drv_get_stats(local, &stats);
200 res = printvalue(&stats, buf,
sizeof(buf));
204 #define DEBUGFS_DEVSTATS_FILE(name) \
205 static int print_devstats_##name(struct ieee80211_low_level_stats *stats,\
206 char *buf, int buflen) \
208 return scnprintf(buf, buflen, "%u\n", stats->name); \
210 static ssize_t stats_ ##name## _read(struct file *file, \
211 char __user *userbuf, \
212 size_t count, loff_t *ppos) \
214 return format_devstat_counter(file->private_data, \
218 print_devstats_##name); \
221 static const struct file_operations stats_ ##name## _ops = { \
222 .read = stats_ ##name## _read, \
223 .open = simple_open, \
224 .llseek = generic_file_llseek, \
227 #define DEBUGFS_STATS_ADD(name, field) \
228 debugfs_create_u32(#name, 0400, statsd, (u32 *) &field);
229 #define DEBUGFS_DEVSTATS_ADD(name) \
230 debugfs_create_file(#name, 0400, statsd, local, &stats_ ##name## _ops);
239 struct dentry *phyd = local->
hw.wiphy->debugfsdir;
279 #ifdef CONFIG_MAC80211_DEBUG_COUNTERS
283 local->tx_handlers_drop_unencrypted);
285 local->tx_handlers_drop_fragment);
287 local->tx_handlers_drop_wep);
289 local->tx_handlers_drop_not_assoc);
291 local->tx_handlers_drop_unauth_port);
295 local->rx_handlers_drop_nullfunc);
297 local->rx_handlers_drop_defrag);
299 local->rx_handlers_drop_short);
301 local->tx_expand_skb_head);
303 local->tx_expand_skb_head_cloned);
305 local->rx_expand_skb_head);
307 local->rx_expand_skb_head2);
309 local->rx_handlers_fragments);
311 local->tx_status_drop);