Linux驱动开发杂记(0x18) - 内核tty接口各版本的变化(二)之tty_driver.h

2024-06-09 06:18

本文主要是介绍Linux驱动开发杂记(0x18) - 内核tty接口各版本的变化(二)之tty_driver.h,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

2.6.17 - 2.6.18

删除

struct tty_driver {const char      *devfs_name;
}

2.6.19 - 2.6.20

修改

struct tty_operations {void (*set_termios)(struct tty_struct *tty, struct termios * old);
//改为	void (*set_termios)(struct tty_struct *tty, struct ktermios * old);
}
struct tty_driver {struct termios init_termios; /* Initial termios *///改为	struct ktermios init_termios; /* Initial termios */struct termios **termios;struct termios **termios_locked;//改为	struct ktermios **termios;struct ktermios **termios_locked;void (*set_termios)(struct tty_struct *tty, struct termios * old);//改为	void (*set_termios)(struct tty_struct *tty, struct ktermios * old);
}

2.6.21 - 2.6.22

添加

struct tty_operations {long (*compat_ioctl)(struct tty_struct *tty, struct file * file,unsigned int cmd, unsigned long arg);
}
struct tty_driver {long (*compat_ioctl)(struct tty_struct *tty, struct file * file,unsigned int cmd, unsigned long arg);
}

2.6.25 - 2.6.26

添加

extern struct tty_driver *tty_find_polling_driver(char *name, int *line);
struct tty_driver {const struct tty_operations *ops;
}

修改

struct tty_operations {void (*put_char)(struct tty_struct *tty, unsigned char ch);//改为int  (*put_char)(struct tty_struct *tty, unsigned char ch);
}
struct tty_driver {long (*compat_ioctl)(struct tty_struct *tty, struct file * file,unsigned int cmd, unsigned long arg);
}

删除

struct tty_operations {int (*write_proc)(struct file *file, const char __user *buffer,unsigned long count, void *data);
}
struct tty_driver {int  (*open)(struct tty_struct * tty, struct file * filp);void (*close)(struct tty_struct * tty, struct file * filp);int  (*write)(struct tty_struct * tty,const unsigned char *buf, int count);void (*put_char)(struct tty_struct *tty, unsigned char ch);void (*flush_chars)(struct tty_struct *tty);int  (*write_room)(struct tty_struct *tty);int  (*chars_in_buffer)(struct tty_struct *tty);int  (*ioctl)(struct tty_struct *tty, struct file * file,unsigned int cmd, unsigned long arg);long (*compat_ioctl)(struct tty_struct *tty, struct file * file,unsigned int cmd, unsigned long arg);void (*set_termios)(struct tty_struct *tty, struct ktermios * old);void (*throttle)(struct tty_struct * tty);void (*unthrottle)(struct tty_struct * tty);void (*stop)(struct tty_struct *tty);void (*start)(struct tty_struct *tty);void (*hangup)(struct tty_struct *tty);void (*break_ctl)(struct tty_struct *tty, int state);void (*flush_buffer)(struct tty_struct *tty);void (*set_ldisc)(struct tty_struct *tty);void (*wait_until_sent)(struct tty_struct *tty, int timeout);void (*send_xchar)(struct tty_struct *tty, char ch);int (*read_proc)(char *page, char **start, off_t off,int count, int *eof, void *data);int (*write_proc)(struct file *file, const char __user *buffer,unsigned long count, void *data);int (*tiocmget)(struct tty_struct *tty, struct file *file);int (*tiocmset)(struct tty_struct *tty, struct file *file,unsigned int set, unsigned int clear);
}

2.6.26 - 2.6.27

添加

struct tty_operations {int (*resize)(struct tty_struct *tty, struct tty_struct *real_tty, struct winsize *ws);
}

修改

struct tty_operations {	void (*break_ctl)(struct tty_struct *tty, int state);
//改为int (*break_ctl)(struct tty_struct *tty, int state);
}

2.6.29 - 2.6.30

添加

struct tty_operations {struct tty_struct * (*lookup)(struct tty_driver *driver, struct inode *inode, int idx);int  (*install)(struct tty_driver *driver, struct tty_struct *tty);void (*remove)(struct tty_driver *driver, struct tty_struct *tty);void (*shutdown)(struct tty_struct *tty);int (*set_termiox)(struct tty_struct *tty, struct termiox *tnew);
}
struct tty_driver {struct kref kref;       /* Reference management */
}
extern void tty_driver_kref_put(struct tty_driver *driver);
extern inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d);

删除

struct tty_driver {int     refcount;       /* for loadable tty drivers */
}

2.6.28 - 2.6.29

修改

struct tty_operations {int (*resize)(struct tty_struct *tty, struct tty_struct *real_tty, unsigned int rows, unsigned int cols);int (*resize)(struct tty_struct *tty, struct winsize *ws);
}

2.6.29 - 2.6.30

添加

struct tty_operations {const struct file_operations *proc_fops;
}

删除

struct tty_operations {int (*read_proc)(char *page, char **start, off_t off, int count, int *eof, void *data);}

2.6.31 - 2.6.32

添加

struct tty_operations {void (*cleanup)(struct tty_struct *tty);
}

2.6.36 - 2.6.37

添加

struct tty_operations {int (*get_icount)(struct tty_struct *tty, struct serial_icounter_struct *icount);
}

2.6.38 - 2.6.39

//修改

struct tty_operations {int  (*ioctl)(struct tty_struct *tty, struct file * file, unsigned int cmd, unsigned long arg);// 改为int  (*ioctl)(struct tty_struct *tty, unsigned int cmd, unsigned long arg);long (*compat_ioctl)(struct tty_struct *tty, struct file * file,unsigned int cmd, unsigned long arg);// 改为long (*compat_ioctl)(struct tty_struct *tty,unsigned int cmd, unsigned long arg);int (*tiocmget)(struct tty_struct *tty, struct file *file);int (*tiocmset)(struct tty_struct *tty, struct file *file,unsigned int set, unsigned int clear);// 改为int (*tiocmget)(struct tty_struct *tty);int (*tiocmset)(struct tty_struct *tty, unsigned int set, unsigned int clear);
}                        

3.2 - 3.3

删除

struct tty_driver {......struct ktermios **termios_locked;......
}

3.3 - 3.4

删除

struct tty_driver {......int     minor_num;      /* number of *possible* devices */......
}

3.6 - 3.7

添加

struct tty_driver {......struct tty_port **ports;......
}
#define tty_alloc_driver(lines, flags)

修改

struct tty_driver {......struct cdev cdev;// 改为struct cdev *cdevs;......
}

4.2 - 4.3

修改

struct tty_driver {......struct cdev *cdevs;// 改为struct cdev **cdevs;......
}

4.5 - 4.6

修改

struct tty_operations {......struct tty_struct * (*lookup)(struct tty_driver *self, int idx);// 改为struct tty_struct * (*lookup)(struct tty_driver *self, struct file *, int idx);......
}
struct tty_struct * (*lookup)(struct tty_driver *self, int idx)
struct tty_struct * (*lookup)(struct tty_driver *self, struct file *, int idx)

4.13 - 4.14

添加

struct tty_operations {......void (*show_fdinfo)(struct tty_struct *tty, struct seq_file *m);......
}

4.17 - 4.18

添加

struct tty_operations {......int (*proc_show)(struct seq_file *, void *);......
}

删除

struct tty_operations {......const struct file_operations *proc_fops;......
}

4.19 - 4.20

添加

struct tty_operations {......int  (*get_serial)(struct tty_struct *tty, struct serial_struct *p);int  (*set_serial)(struct tty_struct *tty, struct serial_struct *p);......
}

这篇关于Linux驱动开发杂记(0x18) - 内核tty接口各版本的变化(二)之tty_driver.h的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1044410

相关文章

Linux脚本(shell)的使用方式

《Linux脚本(shell)的使用方式》:本文主要介绍Linux脚本(shell)的使用方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录概述语法详解数学运算表达式Shell变量变量分类环境变量Shell内部变量自定义变量:定义、赋值自定义变量:引用、修改、删

Python实例题之pygame开发打飞机游戏实例代码

《Python实例题之pygame开发打飞机游戏实例代码》对于python的学习者,能够写出一个飞机大战的程序代码,是不是感觉到非常的开心,:本文主要介绍Python实例题之pygame开发打飞机... 目录题目pygame-aircraft-game使用 Pygame 开发的打飞机游戏脚本代码解释初始化部

使用Python开发一个现代化屏幕取色器

《使用Python开发一个现代化屏幕取色器》在UI设计、网页开发等场景中,颜色拾取是高频需求,:本文主要介绍如何使用Python开发一个现代化屏幕取色器,有需要的小伙伴可以参考一下... 目录一、项目概述二、核心功能解析2.1 实时颜色追踪2.2 智能颜色显示三、效果展示四、实现步骤详解4.1 环境配置4.

使用jenv工具管理多个JDK版本的方法步骤

《使用jenv工具管理多个JDK版本的方法步骤》jenv是一个开源的Java环境管理工具,旨在帮助开发者在同一台机器上轻松管理和切换多个Java版本,:本文主要介绍使用jenv工具管理多个JD... 目录一、jenv到底是干啥的?二、jenv的核心功能(一)管理多个Java版本(二)支持插件扩展(三)环境隔

MybatisPlus service接口功能介绍

《MybatisPlusservice接口功能介绍》:本文主要介绍MybatisPlusservice接口功能介绍,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友... 目录Service接口基本用法进阶用法总结:Lambda方法Service接口基本用法MyBATisP

Linux链表操作方式

《Linux链表操作方式》:本文主要介绍Linux链表操作方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、链表基础概念与内核链表优势二、内核链表结构与宏解析三、内核链表的优点四、用户态链表示例五、双向循环链表在内核中的实现优势六、典型应用场景七、调试技巧与

Python使用smtplib库开发一个邮件自动发送工具

《Python使用smtplib库开发一个邮件自动发送工具》在现代软件开发中,自动化邮件发送是一个非常实用的功能,无论是系统通知、营销邮件、还是日常工作报告,Python的smtplib库都能帮助我们... 目录代码实现与知识点解析1. 导入必要的库2. 配置邮件服务器参数3. 创建邮件发送类4. 实现邮件

详解Linux中常见环境变量的特点与设置

《详解Linux中常见环境变量的特点与设置》环境变量是操作系统和用户设置的一些动态键值对,为运行的程序提供配置信息,理解环境变量对于系统管理、软件开发都很重要,下面小编就为大家详细介绍一下吧... 目录前言一、环境变量的概念二、常见的环境变量三、环境变量特点及其相关指令3.1 环境变量的全局性3.2、环境变

Linux系统中的firewall-offline-cmd详解(收藏版)

《Linux系统中的firewall-offline-cmd详解(收藏版)》firewall-offline-cmd是firewalld的一个命令行工具,专门设计用于在没有运行firewalld服务的... 目录主要用途基本语法选项1. 状态管理2. 区域管理3. 服务管理4. 端口管理5. ICMP 阻断

Linux实现线程同步的多种方式汇总

《Linux实现线程同步的多种方式汇总》本文详细介绍了Linux下线程同步的多种方法,包括互斥锁、自旋锁、信号量以及它们的使用示例,通过这些同步机制,可以解决线程安全问题,防止资源竞争导致的错误,示例... 目录什么是线程同步?一、互斥锁(单人洗手间规则)适用场景:特点:二、条件变量(咖啡厅取餐系统)工作流