20 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
22 #include <linux/module.h>
23 #include <linux/errno.h>
24 #include <linux/kernel.h>
25 #include <linux/string.h>
29 #include <linux/netdevice.h>
30 #include <linux/if_vlan.h>
39 static int vlan_seq_show(
struct seq_file *seq,
void *
v);
40 static void *vlan_seq_start(
struct seq_file *seq, loff_t *
pos);
41 static void *vlan_seq_next(
struct seq_file *seq,
void *
v, loff_t *
pos);
42 static void vlan_seq_stop(
struct seq_file *seq,
void *);
43 static int vlandev_seq_show(
struct seq_file *seq,
void *
v);
54 static const char name_root[] =
"vlan";
55 static const char name_conf[] =
"config";
70 .start = vlan_seq_start,
71 .next = vlan_seq_next,
72 .stop = vlan_seq_stop,
73 .show = vlan_seq_show,
84 .open = vlan_seq_open,
94 static int vlandev_seq_open(
struct inode *inode,
struct file *file)
101 .open = vlandev_seq_open,
160 pr_err(
"can't create entry in proc filesystem!\n");
205 static void *vlan_seq_start(
struct seq_file *seq, loff_t *
pos)
209 struct net *
net = seq_file_net(seq);
217 if (!is_vlan_dev(dev))
227 static void *vlan_seq_next(
struct seq_file *seq,
void *
v, loff_t *
pos)
230 struct net *net = seq_file_net(seq);
239 if (!is_vlan_dev(dev))
248 static void vlan_seq_stop(
struct seq_file *seq,
void *v)
254 static int vlan_seq_show(
struct seq_file *seq,
void *v)
256 struct net *net = seq_file_net(seq);
260 const char *nmtype =
NULL;
262 seq_puts(seq,
"VLAN Dev name | VLAN ID\n");
265 nmtype = vlan_name_type_str[vn->
name_type];
268 nmtype ? nmtype :
"UNKNOWN");
285 static const char fmt64[] =
"%30s %12llu\n";
288 if (!is_vlan_dev(vlandev))
293 "%s VID: %d REORDER_HDR: %i dev->priv_flags: %hx\n",
305 seq_printf(seq,
"\nINGRESS priority mappings: "
306 "0:%u 1:%u 2:%u 3:%u 4:%u 5:%u 6:%u 7:%u\n",
307 vlan->ingress_priority_map[0],
308 vlan->ingress_priority_map[1],
309 vlan->ingress_priority_map[2],
310 vlan->ingress_priority_map[3],
311 vlan->ingress_priority_map[4],
312 vlan->ingress_priority_map[5],
313 vlan->ingress_priority_map[6],
314 vlan->ingress_priority_map[7]);
316 seq_printf(seq,
" EGRESS priority mappings: ");
317 for (i = 0; i < 16; i++) {
319 =
vlan->egress_priority_map[
i];