2 * Linux CAN-bus device driver.
3 * Written by Arnaud Westenberg email:arnaud@wanadoo.nl
4 * This software is released under the GPL-License.
5 * Version 0.7 6 Aug 2001
9 #include <linux/module.h>
11 #include <linux/autoconf.h>
12 #if defined (CONFIG_MODVERSIONS) && !defined (MODVERSIONS)
16 #if defined (MODVERSIONS)
17 #include <linux/modversions.h>
22 #include "../include/main.h"
23 #include "../include/close.h"
24 #include "../include/i82527.h"
25 #include "../include/setup.h"
27 int can_close(struct inode *inode, struct file *file)
29 objects_p[MINOR_NR]->flags &= ~BUFFERS_ALLOCATED;
30 /* Give up message buffer memory */
31 if (objects_p[MINOR_NR]->fifo->buf_tx_entry)
32 del_mem_from_list(objects_p[MINOR_NR]->fifo->buf_tx_entry);
34 CANMSG("objects_p[MINOR_NR]->fifo->buf_tx_entry is NULL\n");
35 if (objects_p[MINOR_NR]->fifo->buf_rx_entry)
36 del_mem_from_list(objects_p[MINOR_NR]->fifo->buf_rx_entry);
38 CANMSG("objects_p[MINOR_NR]->fifo->buf_rx_entry is NULL\n");
40 /* FIXME: what about clearing chip HW status, stopping sending messages etc? */
42 objects_p[MINOR_NR]->flags &= ~OPENED;
43 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,50))