2 * proc.c - procfs support for Protocol family CAN core module
4 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of Volkswagen nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
19 * Alternatively, provided that this notice is retained in full, this
20 * software may be distributed under the terms of the GNU General
21 * Public License ("GPL") version 2, in which case the provisions of the
22 * GPL apply INSTEAD OF those given above.
24 * The provided data structures and external interfaces from this code
25 * are not restricted to be used by modules with a GPL compatible license.
27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
30 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
32 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
33 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
35 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
40 * Send feedback to <socketcan-users@lists.berlios.de>
44 #include <linux/module.h>
45 #include <linux/version.h>
46 #include <linux/proc_fs.h>
47 #include <linux/list.h>
48 #include <linux/rcupdate.h>
49 #include <socketcan/can/core.h>
52 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
56 #include <socketcan/can/version.h> /* for RCSID. Removed by mkpatch script */
60 * proc filenames for the PF_CAN core
63 #define CAN_PROC_VERSION "version"
64 #define CAN_PROC_STATS "stats"
65 #define CAN_PROC_RESET_STATS "reset_stats"
66 #define CAN_PROC_RCVLIST_ALL "rcvlist_all"
67 #define CAN_PROC_RCVLIST_FIL "rcvlist_fil"
68 #define CAN_PROC_RCVLIST_INV "rcvlist_inv"
69 #define CAN_PROC_RCVLIST_SFF "rcvlist_sff"
70 #define CAN_PROC_RCVLIST_EFF "rcvlist_eff"
71 #define CAN_PROC_RCVLIST_ERR "rcvlist_err"
73 static struct proc_dir_entry *can_dir;
74 static struct proc_dir_entry *pde_version;
75 static struct proc_dir_entry *pde_stats;
76 static struct proc_dir_entry *pde_reset_stats;
77 static struct proc_dir_entry *pde_rcvlist_all;
78 static struct proc_dir_entry *pde_rcvlist_fil;
79 static struct proc_dir_entry *pde_rcvlist_inv;
80 static struct proc_dir_entry *pde_rcvlist_sff;
81 static struct proc_dir_entry *pde_rcvlist_eff;
82 static struct proc_dir_entry *pde_rcvlist_err;
84 static int user_reset;
86 static const char rx_list_name[][8] = {
95 * af_can statistics stuff
98 static void can_init_stats(void)
101 * This memset function is called from a timer context (when
102 * can_stattimer is active which is the default) OR in a process
103 * context (reading the proc_fs when can_stattimer is disabled).
105 memset(&can_stats, 0, sizeof(can_stats));
106 can_stats.jiffies_init = jiffies;
108 can_pstats.stats_reset++;
112 can_pstats.user_reset++;
116 static unsigned long calc_rate(unsigned long oldjif, unsigned long newjif,
121 if (oldjif == newjif)
124 /* see can_stat_update() - this should NEVER happen! */
125 if (count > (ULONG_MAX / HZ)) {
126 printk(KERN_ERR "can: calc_rate: count exceeded! %ld\n",
131 rate = (count * HZ) / (newjif - oldjif);
136 void can_stat_update(unsigned long data)
138 unsigned long j = jiffies; /* snapshot */
140 /* restart counting in timer context on user request */
144 /* restart counting on jiffies overflow */
145 if (j < can_stats.jiffies_init)
148 /* prevent overflow in calc_rate() */
149 if (can_stats.rx_frames > (ULONG_MAX / HZ))
152 /* prevent overflow in calc_rate() */
153 if (can_stats.tx_frames > (ULONG_MAX / HZ))
156 /* matches overflow - very improbable */
157 if (can_stats.matches > (ULONG_MAX / 100))
160 /* calc total values */
161 if (can_stats.rx_frames)
162 can_stats.total_rx_match_ratio = (can_stats.matches * 100) /
165 can_stats.total_tx_rate = calc_rate(can_stats.jiffies_init, j,
166 can_stats.tx_frames);
167 can_stats.total_rx_rate = calc_rate(can_stats.jiffies_init, j,
168 can_stats.rx_frames);
170 /* calc current values */
171 if (can_stats.rx_frames_delta)
172 can_stats.current_rx_match_ratio =
173 (can_stats.matches_delta * 100) /
174 can_stats.rx_frames_delta;
176 can_stats.current_tx_rate = calc_rate(0, HZ, can_stats.tx_frames_delta);
177 can_stats.current_rx_rate = calc_rate(0, HZ, can_stats.rx_frames_delta);
179 /* check / update maximum values */
180 if (can_stats.max_tx_rate < can_stats.current_tx_rate)
181 can_stats.max_tx_rate = can_stats.current_tx_rate;
183 if (can_stats.max_rx_rate < can_stats.current_rx_rate)
184 can_stats.max_rx_rate = can_stats.current_rx_rate;
186 if (can_stats.max_rx_match_ratio < can_stats.current_rx_match_ratio)
187 can_stats.max_rx_match_ratio = can_stats.current_rx_match_ratio;
189 /* clear values for 'current rate' calculation */
190 can_stats.tx_frames_delta = 0;
191 can_stats.rx_frames_delta = 0;
192 can_stats.matches_delta = 0;
194 /* restart timer (one second) */
195 mod_timer(&can_stattimer, round_jiffies(jiffies + HZ));
199 * proc read functions
201 * From known use-cases we expect about 10 entries in a receive list to be
202 * printed in the proc_fs. So PAGE_SIZE is definitely enough space here.
206 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
207 static void can_print_rcvlist(struct seq_file *m, struct hlist_head *rx_list,
208 struct net_device *dev)
211 struct hlist_node *n;
213 hlist_for_each_entry_rcu(r, n, rx_list, list) {
214 char *fmt = (r->can_id & CAN_EFF_FLAG)?
215 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0)
216 " %-5s %08x %08x %p %p %8ld %s\n" :
217 " %-5s %03x %08x %p %p %8ld %s\n";
219 " %-5s %08x %08x %pK %pK %8ld %s\n" :
220 " %-5s %03x %08x %pK %pK %8ld %s\n";
223 seq_printf(m, fmt, DNAME(dev), r->can_id, r->mask,
224 r->func, r->data, r->matches, r->ident);
228 static void can_print_recv_banner(struct seq_file *m)
231 * can1. 00000000 00000000 00000000
234 seq_puts(m, " device can_id can_mask function"
235 " userdata matches ident\n");
238 static int can_stats_proc_show(struct seq_file *m, void *v)
241 seq_printf(m, " %8ld transmitted frames (TXF)\n", can_stats.tx_frames);
242 seq_printf(m, " %8ld received frames (RXF)\n", can_stats.rx_frames);
243 seq_printf(m, " %8ld matched frames (RXMF)\n", can_stats.matches);
247 if (can_stattimer.function == can_stat_update) {
248 seq_printf(m, " %8ld %% total match ratio (RXMR)\n",
249 can_stats.total_rx_match_ratio);
251 seq_printf(m, " %8ld frames/s total tx rate (TXR)\n",
252 can_stats.total_tx_rate);
253 seq_printf(m, " %8ld frames/s total rx rate (RXR)\n",
254 can_stats.total_rx_rate);
258 seq_printf(m, " %8ld %% current match ratio (CRXMR)\n",
259 can_stats.current_rx_match_ratio);
261 seq_printf(m, " %8ld frames/s current tx rate (CTXR)\n",
262 can_stats.current_tx_rate);
263 seq_printf(m, " %8ld frames/s current rx rate (CRXR)\n",
264 can_stats.current_rx_rate);
268 seq_printf(m, " %8ld %% max match ratio (MRXMR)\n",
269 can_stats.max_rx_match_ratio);
271 seq_printf(m, " %8ld frames/s max tx rate (MTXR)\n",
272 can_stats.max_tx_rate);
273 seq_printf(m, " %8ld frames/s max rx rate (MRXR)\n",
274 can_stats.max_rx_rate);
279 seq_printf(m, " %8ld current receive list entries (CRCV)\n",
280 can_pstats.rcv_entries);
281 seq_printf(m, " %8ld maximum receive list entries (MRCV)\n",
282 can_pstats.rcv_entries_max);
284 if (can_pstats.stats_reset)
285 seq_printf(m, "\n %8ld statistic resets (STR)\n",
286 can_pstats.stats_reset);
288 if (can_pstats.user_reset)
289 seq_printf(m, " %8ld user statistic resets (USTR)\n",
290 can_pstats.user_reset);
296 static int can_stats_proc_open(struct inode *inode, struct file *file)
298 return single_open(file, can_stats_proc_show, NULL);
301 static const struct file_operations can_stats_proc_fops = {
302 .owner = THIS_MODULE,
303 .open = can_stats_proc_open,
306 .release = single_release,
309 static int can_reset_stats_proc_show(struct seq_file *m, void *v)
313 if (can_stattimer.function == can_stat_update) {
314 seq_printf(m, "Scheduled statistic reset #%ld.\n",
315 can_pstats.stats_reset + 1);
318 if (can_stats.jiffies_init != jiffies)
321 seq_printf(m, "Performed statistic reset #%ld.\n",
322 can_pstats.stats_reset);
327 static int can_reset_stats_proc_open(struct inode *inode, struct file *file)
329 return single_open(file, can_reset_stats_proc_show, NULL);
332 static const struct file_operations can_reset_stats_proc_fops = {
333 .owner = THIS_MODULE,
334 .open = can_reset_stats_proc_open,
337 .release = single_release,
340 static int can_version_proc_show(struct seq_file *m, void *v)
342 seq_printf(m, "%s\n", CAN_VERSION_STRING);
346 static int can_version_proc_open(struct inode *inode, struct file *file)
348 return single_open(file, can_version_proc_show, NULL);
351 static const struct file_operations can_version_proc_fops = {
352 .owner = THIS_MODULE,
353 .open = can_version_proc_open,
356 .release = single_release,
359 static int can_rcvlist_proc_show(struct seq_file *m, void *v)
361 /* double cast to prevent GCC warning */
362 int idx = (int)(long)m->private;
363 struct dev_rcv_lists *d;
364 struct hlist_node *n;
366 seq_printf(m, "\nreceive list '%s':\n", rx_list_name[idx]);
369 hlist_for_each_entry_rcu(d, n, &can_rx_dev_list, list) {
371 if (!hlist_empty(&d->rx[idx])) {
372 can_print_recv_banner(m);
373 can_print_rcvlist(m, &d->rx[idx], d->dev);
375 seq_printf(m, " (%s: no entry)\n", DNAME(d->dev));
383 static int can_rcvlist_proc_open(struct inode *inode, struct file *file)
385 return single_open(file, can_rcvlist_proc_show, PDE(inode)->data);
388 static const struct file_operations can_rcvlist_proc_fops = {
389 .owner = THIS_MODULE,
390 .open = can_rcvlist_proc_open,
393 .release = single_release,
396 static int can_rcvlist_sff_proc_show(struct seq_file *m, void *v)
398 struct dev_rcv_lists *d;
399 struct hlist_node *n;
402 seq_puts(m, "\nreceive list 'rx_sff':\n");
405 hlist_for_each_entry_rcu(d, n, &can_rx_dev_list, list) {
406 int i, all_empty = 1;
407 /* check wether at least one list is non-empty */
408 for (i = 0; i < 0x800; i++)
409 if (!hlist_empty(&d->rx_sff[i])) {
415 can_print_recv_banner(m);
416 for (i = 0; i < 0x800; i++) {
417 if (!hlist_empty(&d->rx_sff[i]))
418 can_print_rcvlist(m, &d->rx_sff[i],
422 seq_printf(m, " (%s: no entry)\n", DNAME(d->dev));
430 static int can_rcvlist_sff_proc_open(struct inode *inode, struct file *file)
432 return single_open(file, can_rcvlist_sff_proc_show, NULL);
435 static const struct file_operations can_rcvlist_sff_proc_fops = {
436 .owner = THIS_MODULE,
437 .open = can_rcvlist_sff_proc_open,
440 .release = single_release,
443 static int can_print_rcvlist(char *page, int len, struct hlist_head *rx_list,
444 struct net_device *dev)
447 struct hlist_node *n;
449 hlist_for_each_entry_rcu(r, n, rx_list, list) {
450 char *fmt = (r->can_id & CAN_EFF_FLAG)?
451 " %-5s %08X %08x %08x %08x %8ld %s\n" :
452 " %-5s %03X %08x %08lx %08lx %8ld %s\n";
454 len += snprintf(page + len, PAGE_SIZE - len, fmt,
455 DNAME(dev), r->can_id, r->mask,
456 (unsigned long)r->func, (unsigned long)r->data,
457 r->matches, r->ident);
459 /* does a typical line fit into the current buffer? */
461 /* 100 Bytes before end of buffer */
462 if (len > PAGE_SIZE - 100) {
463 /* mark output cut off */
464 len += snprintf(page + len, PAGE_SIZE - len,
473 static int can_print_recv_banner(char *page, int len)
476 * can1. 00000000 00000000 00000000
479 len += snprintf(page + len, PAGE_SIZE - len,
480 " device can_id can_mask function"
481 " userdata matches ident\n");
486 static int can_proc_read_stats(char *page, char **start, off_t off,
487 int count, int *eof, void *data)
491 len += snprintf(page + len, PAGE_SIZE - len, "\n");
492 len += snprintf(page + len, PAGE_SIZE - len,
493 " %8ld transmitted frames (TXF)\n",
494 can_stats.tx_frames);
495 len += snprintf(page + len, PAGE_SIZE - len,
496 " %8ld received frames (RXF)\n", can_stats.rx_frames);
497 len += snprintf(page + len, PAGE_SIZE - len,
498 " %8ld matched frames (RXMF)\n", can_stats.matches);
500 len += snprintf(page + len, PAGE_SIZE - len, "\n");
502 if (can_stattimer.function == can_stat_update) {
503 len += snprintf(page + len, PAGE_SIZE - len,
504 " %8ld %% total match ratio (RXMR)\n",
505 can_stats.total_rx_match_ratio);
507 len += snprintf(page + len, PAGE_SIZE - len,
508 " %8ld frames/s total tx rate (TXR)\n",
509 can_stats.total_tx_rate);
510 len += snprintf(page + len, PAGE_SIZE - len,
511 " %8ld frames/s total rx rate (RXR)\n",
512 can_stats.total_rx_rate);
514 len += snprintf(page + len, PAGE_SIZE - len, "\n");
516 len += snprintf(page + len, PAGE_SIZE - len,
517 " %8ld %% current match ratio (CRXMR)\n",
518 can_stats.current_rx_match_ratio);
520 len += snprintf(page + len, PAGE_SIZE - len,
521 " %8ld frames/s current tx rate (CTXR)\n",
522 can_stats.current_tx_rate);
523 len += snprintf(page + len, PAGE_SIZE - len,
524 " %8ld frames/s current rx rate (CRXR)\n",
525 can_stats.current_rx_rate);
527 len += snprintf(page + len, PAGE_SIZE - len, "\n");
529 len += snprintf(page + len, PAGE_SIZE - len,
530 " %8ld %% max match ratio (MRXMR)\n",
531 can_stats.max_rx_match_ratio);
533 len += snprintf(page + len, PAGE_SIZE - len,
534 " %8ld frames/s max tx rate (MTXR)\n",
535 can_stats.max_tx_rate);
536 len += snprintf(page + len, PAGE_SIZE - len,
537 " %8ld frames/s max rx rate (MRXR)\n",
538 can_stats.max_rx_rate);
540 len += snprintf(page + len, PAGE_SIZE - len, "\n");
543 len += snprintf(page + len, PAGE_SIZE - len,
544 " %8ld current receive list entries (CRCV)\n",
545 can_pstats.rcv_entries);
546 len += snprintf(page + len, PAGE_SIZE - len,
547 " %8ld maximum receive list entries (MRCV)\n",
548 can_pstats.rcv_entries_max);
550 if (can_pstats.stats_reset)
551 len += snprintf(page + len, PAGE_SIZE - len,
552 "\n %8ld statistic resets (STR)\n",
553 can_pstats.stats_reset);
555 if (can_pstats.user_reset)
556 len += snprintf(page + len, PAGE_SIZE - len,
557 " %8ld user statistic resets (USTR)\n",
558 can_pstats.user_reset);
560 len += snprintf(page + len, PAGE_SIZE - len, "\n");
566 static int can_proc_read_reset_stats(char *page, char **start, off_t off,
567 int count, int *eof, void *data)
573 if (can_stattimer.function == can_stat_update) {
574 len += snprintf(page + len, PAGE_SIZE - len,
575 "Scheduled statistic reset #%ld.\n",
576 can_pstats.stats_reset + 1);
579 if (can_stats.jiffies_init != jiffies)
582 len += snprintf(page + len, PAGE_SIZE - len,
583 "Performed statistic reset #%ld.\n",
584 can_pstats.stats_reset);
591 static int can_proc_read_version(char *page, char **start, off_t off,
592 int count, int *eof, void *data)
596 len += snprintf(page + len, PAGE_SIZE - len, "%s\n",
602 static int can_proc_read_rcvlist(char *page, char **start, off_t off,
603 int count, int *eof, void *data)
605 /* double cast to prevent GCC warning */
606 int idx = (int)(long)data;
608 struct dev_rcv_lists *d;
609 struct hlist_node *n;
611 len += snprintf(page + len, PAGE_SIZE - len,
612 "\nreceive list '%s':\n", rx_list_name[idx]);
615 hlist_for_each_entry_rcu(d, n, &can_rx_dev_list, list) {
617 if (!hlist_empty(&d->rx[idx])) {
618 len = can_print_recv_banner(page, len);
619 len = can_print_rcvlist(page, len, &d->rx[idx], d->dev);
621 len += snprintf(page + len, PAGE_SIZE - len,
622 " (%s: no entry)\n", DNAME(d->dev));
624 /* exit on end of buffer? */
625 if (len > PAGE_SIZE - 100)
630 len += snprintf(page + len, PAGE_SIZE - len, "\n");
636 static int can_proc_read_rcvlist_sff(char *page, char **start, off_t off,
637 int count, int *eof, void *data)
640 struct dev_rcv_lists *d;
641 struct hlist_node *n;
644 len += snprintf(page + len, PAGE_SIZE - len,
645 "\nreceive list 'rx_sff':\n");
648 hlist_for_each_entry_rcu(d, n, &can_rx_dev_list, list) {
649 int i, all_empty = 1;
650 /* check wether at least one list is non-empty */
651 for (i = 0; i < 0x800; i++)
652 if (!hlist_empty(&d->rx_sff[i])) {
658 len = can_print_recv_banner(page, len);
659 for (i = 0; i < 0x800; i++) {
660 if (!hlist_empty(&d->rx_sff[i]) &&
661 len < PAGE_SIZE - 100)
662 len = can_print_rcvlist(page, len,
667 len += snprintf(page + len, PAGE_SIZE - len,
668 " (%s: no entry)\n", DNAME(d->dev));
670 /* exit on end of buffer? */
671 if (len > PAGE_SIZE - 100)
676 len += snprintf(page + len, PAGE_SIZE - len, "\n");
684 * proc utility functions
687 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
688 static struct proc_dir_entry *can_create_proc_readentry(const char *name,
690 read_proc_t *read_proc,
694 return create_proc_read_entry(name, mode, can_dir, read_proc,
701 static void can_remove_proc_readentry(const char *name)
704 remove_proc_entry(name, can_dir);
708 * can_init_proc - create main CAN proc directory and procfs entries
710 void can_init_proc(void)
712 /* create /proc/net/can directory */
713 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
714 can_dir = proc_mkdir("can", init_net.proc_net);
716 can_dir = proc_mkdir("can", proc_net);
720 printk(KERN_INFO "can: failed to create /proc/net/can . "
721 "CONFIG_PROC_FS missing?\n");
725 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
726 can_dir->owner = THIS_MODULE;
729 /* own procfs entries from the AF_CAN core */
730 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
731 pde_version = proc_create(CAN_PROC_VERSION, 0644, can_dir,
732 &can_version_proc_fops);
733 pde_stats = proc_create(CAN_PROC_STATS, 0644, can_dir,
734 &can_stats_proc_fops);
735 pde_reset_stats = proc_create(CAN_PROC_RESET_STATS, 0644, can_dir,
736 &can_reset_stats_proc_fops);
737 pde_rcvlist_err = proc_create_data(CAN_PROC_RCVLIST_ERR, 0644, can_dir,
738 &can_rcvlist_proc_fops, (void *)RX_ERR);
739 pde_rcvlist_all = proc_create_data(CAN_PROC_RCVLIST_ALL, 0644, can_dir,
740 &can_rcvlist_proc_fops, (void *)RX_ALL);
741 pde_rcvlist_fil = proc_create_data(CAN_PROC_RCVLIST_FIL, 0644, can_dir,
742 &can_rcvlist_proc_fops, (void *)RX_FIL);
743 pde_rcvlist_inv = proc_create_data(CAN_PROC_RCVLIST_INV, 0644, can_dir,
744 &can_rcvlist_proc_fops, (void *)RX_INV);
745 pde_rcvlist_eff = proc_create_data(CAN_PROC_RCVLIST_EFF, 0644, can_dir,
746 &can_rcvlist_proc_fops, (void *)RX_EFF);
747 pde_rcvlist_sff = proc_create(CAN_PROC_RCVLIST_SFF, 0644, can_dir,
748 &can_rcvlist_sff_proc_fops);
750 pde_version = can_create_proc_readentry(CAN_PROC_VERSION, 0644,
751 can_proc_read_version, NULL);
752 pde_stats = can_create_proc_readentry(CAN_PROC_STATS, 0644,
753 can_proc_read_stats, NULL);
754 pde_reset_stats = can_create_proc_readentry(CAN_PROC_RESET_STATS, 0644,
755 can_proc_read_reset_stats, NULL);
756 pde_rcvlist_err = can_create_proc_readentry(CAN_PROC_RCVLIST_ERR, 0644,
757 can_proc_read_rcvlist, (void *)RX_ERR);
758 pde_rcvlist_all = can_create_proc_readentry(CAN_PROC_RCVLIST_ALL, 0644,
759 can_proc_read_rcvlist, (void *)RX_ALL);
760 pde_rcvlist_fil = can_create_proc_readentry(CAN_PROC_RCVLIST_FIL, 0644,
761 can_proc_read_rcvlist, (void *)RX_FIL);
762 pde_rcvlist_inv = can_create_proc_readentry(CAN_PROC_RCVLIST_INV, 0644,
763 can_proc_read_rcvlist, (void *)RX_INV);
764 pde_rcvlist_eff = can_create_proc_readentry(CAN_PROC_RCVLIST_EFF, 0644,
765 can_proc_read_rcvlist, (void *)RX_EFF);
766 pde_rcvlist_sff = can_create_proc_readentry(CAN_PROC_RCVLIST_SFF, 0644,
767 can_proc_read_rcvlist_sff, NULL);
772 * can_remove_proc - remove procfs entries and main CAN proc directory
774 void can_remove_proc(void)
777 can_remove_proc_readentry(CAN_PROC_VERSION);
780 can_remove_proc_readentry(CAN_PROC_STATS);
783 can_remove_proc_readentry(CAN_PROC_RESET_STATS);
786 can_remove_proc_readentry(CAN_PROC_RCVLIST_ERR);
789 can_remove_proc_readentry(CAN_PROC_RCVLIST_ALL);
792 can_remove_proc_readentry(CAN_PROC_RCVLIST_FIL);
795 can_remove_proc_readentry(CAN_PROC_RCVLIST_INV);
798 can_remove_proc_readentry(CAN_PROC_RCVLIST_EFF);
801 can_remove_proc_readentry(CAN_PROC_RCVLIST_SFF);
804 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
805 proc_net_remove(&init_net, "can");
807 proc_net_remove("can");