Lines Matching +full:com +full:- +full:seq
1 // SPDX-License-Identifier: GPL-2.0-or-later
5 * This module is completely hardware-independent and provides
8 * Author: Ben Greear, <greearb@candelatech.com> coppied from wanproc.c
9 * by: Gene Kozin <genek@compuserve.com>
36 static int vlan_seq_show(struct seq_file *seq, void *v);
37 static void *vlan_seq_start(struct seq_file *seq, loff_t *pos);
38 static void *vlan_seq_next(struct seq_file *seq, void *v, loff_t *pos);
39 static void vlan_seq_stop(struct seq_file *seq, void *);
40 static int vlandev_seq_show(struct seq_file *seq, void *v);
96 if (vn->proc_vlan_conf) in vlan_proc_cleanup()
97 remove_proc_entry(name_conf, vn->proc_vlan_dir); in vlan_proc_cleanup()
99 if (vn->proc_vlan_dir) in vlan_proc_cleanup()
100 remove_proc_entry(name_root, net->proc_net); in vlan_proc_cleanup()
115 vn->proc_vlan_dir = proc_net_mkdir(net, name_root, net->proc_net); in vlan_proc_init()
116 if (!vn->proc_vlan_dir) in vlan_proc_init()
119 vn->proc_vlan_conf = proc_create_net(name_conf, S_IFREG | 0600, in vlan_proc_init()
120 vn->proc_vlan_dir, &vlan_seq_ops, in vlan_proc_init()
122 if (!vn->proc_vlan_conf) in vlan_proc_init()
129 return -ENOBUFS; in vlan_proc_init()
141 if (!strcmp(vlandev->name, name_conf)) in vlan_proc_add_dev()
142 return -EINVAL; in vlan_proc_add_dev()
143 vlan->dent = proc_create_single_data(vlandev->name, S_IFREG | 0600, in vlan_proc_add_dev()
144 vn->proc_vlan_dir, vlandev_seq_show, vlandev); in vlan_proc_add_dev()
145 if (!vlan->dent) in vlan_proc_add_dev()
146 return -ENOBUFS; in vlan_proc_add_dev()
156 proc_remove(vlan_dev_priv(vlandev)->dent); in vlan_proc_rem_dev()
157 vlan_dev_priv(vlandev)->dent = NULL; in vlan_proc_rem_dev()
166 static void *vlan_seq_from_index(struct seq_file *seq, loff_t *pos) in vlan_seq_from_index() argument
171 for_each_netdev_dump(seq_file_net(seq), dev, ifindex) { in vlan_seq_from_index()
174 *pos = dev->ifindex; in vlan_seq_from_index()
180 static void *vlan_seq_start(struct seq_file *seq, loff_t *pos) in vlan_seq_start() argument
187 return vlan_seq_from_index(seq, pos); in vlan_seq_start()
190 static void *vlan_seq_next(struct seq_file *seq, void *v, loff_t *pos) in vlan_seq_next() argument
193 return vlan_seq_from_index(seq, pos); in vlan_seq_next()
196 static void vlan_seq_stop(struct seq_file *seq, void *v) in vlan_seq_stop() argument
202 static int vlan_seq_show(struct seq_file *seq, void *v) in vlan_seq_show() argument
204 struct net *net = seq_file_net(seq); in vlan_seq_show()
210 seq_puts(seq, "VLAN Dev name | VLAN ID\n"); in vlan_seq_show()
212 if (vn->name_type < ARRAY_SIZE(vlan_name_type_str)) in vlan_seq_show()
213 nmtype = vlan_name_type_str[vn->name_type]; in vlan_seq_show()
215 seq_printf(seq, "Name-Type: %s\n", in vlan_seq_show()
221 seq_printf(seq, "%-15s| %d | %s\n", vlandev->name, in vlan_seq_show()
222 vlan->vlan_id, vlan->real_dev->name); in vlan_seq_show()
227 static int vlandev_seq_show(struct seq_file *seq, void *offset) in vlandev_seq_show() argument
229 struct net_device *vlandev = (struct net_device *) seq->private; in vlandev_seq_show()
240 seq_printf(seq, in vlandev_seq_show()
241 "%s VID: %d REORDER_HDR: %i dev->priv_flags: %x\n", in vlandev_seq_show()
242 vlandev->name, vlan->vlan_id, in vlandev_seq_show()
243 (int)(vlan->flags & 1), (u32)vlandev->priv_flags); in vlandev_seq_show()
245 seq_printf(seq, fmt64, "total frames received", stats->rx_packets); in vlandev_seq_show()
246 seq_printf(seq, fmt64, "total bytes received", stats->rx_bytes); in vlandev_seq_show()
247 seq_printf(seq, fmt64, "Broadcast/Multicast Rcvd", stats->multicast); in vlandev_seq_show()
248 seq_puts(seq, "\n"); in vlandev_seq_show()
249 seq_printf(seq, fmt64, "total frames transmitted", stats->tx_packets); in vlandev_seq_show()
250 seq_printf(seq, fmt64, "total bytes transmitted", stats->tx_bytes); in vlandev_seq_show()
251 seq_printf(seq, "Device: %s", vlan->real_dev->name); in vlandev_seq_show()
253 seq_printf(seq, "\nINGRESS priority mappings: " in vlandev_seq_show()
255 vlan->ingress_priority_map[0], in vlandev_seq_show()
256 vlan->ingress_priority_map[1], in vlandev_seq_show()
257 vlan->ingress_priority_map[2], in vlandev_seq_show()
258 vlan->ingress_priority_map[3], in vlandev_seq_show()
259 vlan->ingress_priority_map[4], in vlandev_seq_show()
260 vlan->ingress_priority_map[5], in vlandev_seq_show()
261 vlan->ingress_priority_map[6], in vlandev_seq_show()
262 vlan->ingress_priority_map[7]); in vlandev_seq_show()
264 seq_printf(seq, " EGRESS priority mappings: "); in vlandev_seq_show()
267 = vlan->egress_priority_map[i]; in vlandev_seq_show()
269 seq_printf(seq, "%u:%d ", in vlandev_seq_show()
270 mp->priority, ((mp->vlan_qos >> 13) & 0x7)); in vlandev_seq_show()
271 mp = mp->next; in vlandev_seq_show()
274 seq_puts(seq, "\n"); in vlandev_seq_show()