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 /* Give up message buffer memory */
30 if (objects_p[MINOR_NR]->fifo->buf_tx_entry)
31 del_mem_from_list(objects_p[MINOR_NR]->fifo->buf_tx_entry);
33 CANMSG("objects_p[MINOR_NR]->fifo->buf_tx_entry is NULL\n");
34 if (objects_p[MINOR_NR]->fifo->buf_rx_entry)
35 del_mem_from_list(objects_p[MINOR_NR]->fifo->buf_rx_entry);
37 CANMSG("objects_p[MINOR_NR]->fifo->buf_rx_entry is NULL\n");
39 /* FIXME: what about clearing chip HW status, stopping sending messages etc? */
41 objects_p[MINOR_NR]->flags &= ~OPENED;