📄 at91_uart_core.c
字号:
/* * can_core - can4linux CAN driver moduleset tagprg="global -t $1" * * * can4linux -- LINUX CAN device driver source * * Copyright (c) 2001 port GmbH Halle/Saale * (c) 2001 Heinz-J黵gen Oertel (oe@port.de) * Claus Schroeter (clausi@chemie.fu-berlin.de) * derived from the the LDDK can4linux version * (c) 1996,1997 Claus Schroeter (clausi@chemie.fu-berlin.de) *------------------------------------------------------------------ * $Header: /z2/cvsroot/products/0530/software/can4linux/src/can_core.c,v 1.19 2005/08/29 08:55:43 oe Exp $ * *-------------------------------------------------------------------------- * * * modification history * -------------------- * $Log: can_core.c,v $ * Revision 1.19 2005/08/29 08:55:43 oe * - adopted to be compiled for K2.6 and 2.4 * * Revision 1.18 2005/07/22 12:01:46 oe * applied patch by Steven Scholz * - new ioctl( , CONF_LISTEN_ONLY_MODE, ) * - replaced verify_area() by !access_ok() * * Revision 1.17 2005/04/01 16:04:37 oe * - documentation changes * - move regbase to the hardware files * * Revision 1.16 2005/02/09 16:16:08 oe * - changed doc a bit * * Revision 1.15 2005/02/07 11:40:33 oe * - added comment * * Revision 1.14 2004/12/14 09:36:35 oe * - Release for kernel 2.6 with support for 82527 included * * Revision 1.13 2004/05/14 10:02:54 oe * - started supporting CPC-Card * - version number in can4linux.h available * - only one structure type for Config_par_t Command_par_t * - new ioctl command CMD_CLEARBUFFERS * * Revision 1.12 2004/02/13 14:19:50 oe * *** empty log message *** * * Revision 1.11 2003/12/29 15:18:22 oe * - register driver in dev-filesystems * - support for indexed-i/o * * Revision 1.10 2003/08/27 13:06:26 oe * - Version 3.0 * * Revision 1.9 2003/07/05 14:28:55 oe * - all changes for the new 3.0: try to eliminate hw depedencies at run-time. * configure for HW at compile time * * Revision 1.8 2002/10/25 10:39:25 oe * - vendor specific handling for Advantech board added by "R.R.Robotica" <rrrobot@tin.it> * * Revision 1.7 2002/10/11 16:58:06 oe * - IOModel, Outc, VendOpt are now set at compile time * - deleted one misleading printk() * * Revision 1.6 2002/08/08 17:59:38 oe * *** empty log message *** * * Revision 1.5 2001/11/20 16:43:29 oe * *** empty log message *** * * Revision 1.4 2001/09/14 14:58:09 oe * first free release * * Revision 1.3 2001/09/04 15:51:44 oe * changed struct file_operations can_fops * * Revision 1.2 2001/06/15 15:32:10 oe * - added PCI support EMS CPC-PCI * * Revision 1.1.1.1 2001/06/11 18:30:54 oe * minimal version can4linux embedded, compile time Konfigurierbar * * * * *-------------------------------------------------------------------------- */#include <linux/init.h>#include <linux/fs.h> /* register_chrdev() */#include "at91_uart_defs.h"#include <linux/device.h>MODULE_AUTHOR("H.-J.Oertel <oe@port.de>");MODULE_DESCRIPTION("CAN fieldbus driver");MODULE_LICENSE("GPL");int Can_major = CAN_MAJOR; static struct file_operations at91_uart_fops = { .owner = THIS_MODULE, .open = at91_uart_open, .release = at91_uart_close, .read = at91_uart_read, .write = at91_uart_write, .ioctl = at91_uart_ioctl,};static int __init at91_uart_init(void){ int i; if( (i = register_chrdev(Can_major, "t6963c", &at91_uart_fops)) ) { printk("-> can't get Major %d = %d\n", Can_major, i); return(-EIO); }#ifdef CONFIG_DEVFS_FS /* If we have devfs, create /dev/canX to put files in there */ devfs_mk_dir("t6963c"); for (i=0; i < MAX_CHANNELS; i++) { devfs_mk_cdev(MKDEV(Can_major, i), S_IFCHR | S_IRUGO | S_IWUGO, "t6963c/%d", i); }#endif printk(" H.J. Oertel (oe@port.de)\n"); printk(" C.Schroeter (clausi@chemie.fu-berlin.de), H.D. Stich\n"); return 0;}static void at91_uart_exit(void){#ifdef CONFIG_DEVFS_FSint i;#endif #ifdef CONFIG_DEVFS_FS for (i=0; i < MAX_CHANNELS; i++) { devfs_remove("t6963c/%d", i);} devfs_remove("t6963c");#endif unregister_chrdev(Can_major, "t6963c");}module_init(at91_uart_init);module_exit(at91_uart_exit);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -