菜鸟请教ARMLinux串口驱动问题。
各位大侠,由于刚接触驱动,被老板逼着写一个串口驱动,希望牛人指点一下。问题是这样的,我在AT91RM9200外扩了一个16C255的串口片子,要为这个片子写个驱动加到ARMLinux里面,我根据原来的串口驱动程序,里面有一个函数指针表struct uart_ops {
u_int (*tx_empty)(struct uart_port *);
void (*set_mctrl)(struct uart_port *, u_int mctrl);
u_int (*get_mctrl)(struct uart_port *);
void (*stop_tx)(struct uart_port *, u_int from_tty);
void (*start_tx)(struct uart_port *, u_int nonempty, u_int from_tty);
void (*stop_rx)(struct uart_port *);
void (*enable_ms)(struct uart_port *);
void (*break_ctl)(struct uart_port *, int ctl);
int (*startup)(struct uart_port *, struct uart_info *);
void (*shutdown)(struct uart_port *, struct uart_info *);
void (*change_speed)(struct uart_port *, u_int cflag, u_int iflag, u_int quot);
void (*pm)(struct uart_port *, u_int state, u_int oldstate);
int (*set_wake)(struct uart_port *, u_int state);
const char *(*type)(struct uart_port *);
void (*release_port)(struct uart_port *);
/*
* Request IO and memory resources used by the port.
* This includes iomapping the port if necessary.
*/
int (*request_port)(struct uart_port *);
void (*config_port)(struct uart_port *, int);
int (*verify_port)(struct uart_port *, struct serial_struct *);
int (*ioctl)(struct uart_port *, u_int, u_long);
};
当系统调用时就在这个表里找对应的操作,我现在一打开串口设备文件,内核就挂了,我不知道在系统调用时,到底是如何来调用这些函数的,是按什么流程来申请资源,注册中断的,我对这个体系结构不太了解,希望大家指点。谢谢!