24 #include <linux/stddef.h>
25 #include <linux/errno.h>
26 #include <linux/kernel.h>
27 #include <linux/module.h>
28 #include <linux/wanrouter.h>
35 #define PROC_STATS_FORMAT "%30s: %12lu\n"
39 #define PROT_DECODE(prot) ((prot == WANCONFIG_FR) ? " FR" :\
40 (prot == WANCONFIG_X25) ? " X25" : \
41 (prot == WANCONFIG_PPP) ? " PPP" : \
42 (prot == WANCONFIG_CHDLC) ? " CHDLC": \
43 (prot == WANCONFIG_MPPP) ? " MPPP" : \
92 wandev = wandev->
next)
97 static void *r_next(
struct seq_file *m,
void *
v, loff_t *pos)
104 static void r_stop(
struct seq_file *m,
void *v)
109 static int config_show(
struct seq_file *m,
void *v)
113 seq_puts(m,
"Device name | port |IRQ|DMA| mem.addr |"
114 "mem.size|option1|option2|option3|option4\n");
119 seq_printf(m,
"%-15s|0x%-4X|%3u|%3u| 0x%-8lX |0x%-6X|%7u|%7u|%7u|%7u\n",
125 static int status_show(
struct seq_file *m,
void *v)
129 seq_puts(m,
"Device name |protocol|station|interface|"
130 "clocking|baud rate| MTU |ndev|link state\n");
135 seq_printf(m,
"%-15s|%-8s| %-7s| %-9s|%-8s|%9u|%5u|%3u |",
139 (p->
station ?
"Node" :
"CPE") :
144 p->
clocking ?
"internal" :
"external",
209 static int wandev_show(
struct seq_file *m,
void *v)
216 if (!wandev->
state) {
217 seq_puts(m,
"device is not configured!\n");
229 seq_puts(m,
"Device is not configured!\n");
235 "total packets received", wandev->
stats.rx_packets);
237 "total packets transmitted", wandev->
stats.tx_packets);
239 "total bytes received", wandev->
stats.rx_bytes);
241 "total bytes transmitted", wandev->
stats.tx_bytes);
243 "bad packets received", wandev->
stats.rx_errors);
245 "packet transmit problems", wandev->
stats.tx_errors);
247 "received frames dropped", wandev->
stats.rx_dropped);
249 "transmit frames dropped", wandev->
stats.tx_dropped);
251 "multicast packets received", wandev->
stats.multicast);
253 "transmit collisions", wandev->
stats.collisions);
255 "receive length errors", wandev->
stats.rx_length_errors);
257 "receiver overrun errors", wandev->
stats.rx_over_errors);
259 "CRC errors", wandev->
stats.rx_crc_errors);
261 "frame format errors (aborts)", wandev->
stats.rx_frame_errors);
263 "receiver fifo overrun", wandev->
stats.rx_fifo_errors);
265 "receiver missed packet", wandev->
stats.rx_missed_errors);
267 "aborted frames transmitted", wandev->
stats.tx_aborted_errors);
296 p = proc_create(
"config",
S_IRUGO, proc_router, &config_fops);
299 p = proc_create(
"status",
S_IRUGO, proc_router, &status_fops);
332 proc_router, &wandev_fops);
335 wandev->
dent->data = wandev;