设为首页 加入收藏

TOP

Linux tty core 源码分析(二)
2014-11-24 07:29:20 来源: 作者: 【 】 浏览:1
Tags:Linux tty core 源码 分析
s的write方法不同其他操作都是相同的所以在其


//他操作上要兼顾各种设备


//下面我们介绍下tty_driver结构和tty_struct 结构。tty_driver表示一个具体的tty设备的驱动程序,而tty_struct 表示tty设备在


//具体的分析中介绍其成员。


struct tty_driver {
int magic; /* magic number for this structure */
struct kref kref; /* Reference management */
struct cdev cdev;//可见tty设备驱动是一个字符设备设备驱动
struct module *owner;
const char *driver_name;//这里是指驱动程序的名字
const char *name;//tty设备的命名相关
int name_base; /* offset of printed name */
int major; /* major device number */
int minor_start; /* start of minor device number */
int minor_num; /* number of *possible* devices */
int num; /* number of devices allocated */
short type; /* type of tty driver */
short subtype; /* subtype of tty driver */
struct ktermios init_termios; /* Initial termios */
int flags; /* tty driver flags */
struct proc_dir_entry *proc_entry; /* /proc fs entry */
struct tty_driver *other; /* only used for the PTY driver */


/*
* Pointer to the tty data structures
*/
struct tty_struct **ttys;//驱动操作的具体tty设备
struct ktermios **termios;
struct ktermios **termios_locked;
void *driver_state;


/*
* Driver methods
*/


const struct tty_operations *ops;
struct list_head tty_drivers; //用于链接tty驱动全局链表
};


首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Linux shell的优点和缺点 下一篇Linux serial构架分析及驱动开发

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·Java 学习线路图是怎 (2025-12-25 15:19:15)
·关于 Java 学习,有 (2025-12-25 15:19:12)
·有没有Java swing教 (2025-12-25 15:19:09)
·Start, Stop, and Di (2025-12-25 14:50:57)
·C语言入门教程:零基 (2025-12-25 14:50:54)