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在线解压jar包的实现方式

《Linux在线解压jar包的实现方式》:本文主要介绍Linux在线解压jar包的实现方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录linux在线解压jar包解压 jar包的步骤总结Linux在线解压jar包在 Centos 中解压 jar 包可以使用 u

linux解压缩 xxx.jar文件进行内部操作过程

《linux解压缩xxx.jar文件进行内部操作过程》:本文主要介绍linux解压缩xxx.jar文件进行内部操作,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、解压文件二、压缩文件总结一、解压文件1、把 xxx.jar 文件放在服务器上,并进入当前目录#

Linux系统性能检测命令详解

《Linux系统性能检测命令详解》本文介绍了Linux系统常用的监控命令(如top、vmstat、iostat、htop等)及其参数功能,涵盖进程状态、内存使用、磁盘I/O、系统负载等多维度资源监控,... 目录toppsuptimevmstatIOStatiotopslabtophtopdstatnmon

Java通过驱动包(jar包)连接MySQL数据库的步骤总结及验证方式

《Java通过驱动包(jar包)连接MySQL数据库的步骤总结及验证方式》本文详细介绍如何使用Java通过JDBC连接MySQL数据库,包括下载驱动、配置Eclipse环境、检测数据库连接等关键步骤,... 目录一、下载驱动包二、放jar包三、检测数据库连接JavaJava 如何使用 JDBC 连接 mys

在Linux中改变echo输出颜色的实现方法

《在Linux中改变echo输出颜色的实现方法》在Linux系统的命令行环境下,为了使输出信息更加清晰、突出,便于用户快速识别和区分不同类型的信息,常常需要改变echo命令的输出颜色,所以本文给大家介... 目python录在linux中改变echo输出颜色的方法技术背景实现步骤使用ANSI转义码使用tpu

linux hostname设置全过程

《linuxhostname设置全过程》:本文主要介绍linuxhostname设置全过程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录查询hostname设置步骤其它相关点hostid/etc/hostsEDChina编程A工具license破解注意事项总结以RHE

Linux中压缩、网络传输与系统监控工具的使用完整指南

《Linux中压缩、网络传输与系统监控工具的使用完整指南》在Linux系统管理中,压缩与传输工具是数据备份和远程协作的桥梁,而系统监控工具则是保障服务器稳定运行的眼睛,下面小编就来和大家详细介绍一下它... 目录引言一、压缩与解压:数据存储与传输的优化核心1. zip/unzip:通用压缩格式的便捷操作2.

Linux中SSH服务配置的全面指南

《Linux中SSH服务配置的全面指南》作为网络安全工程师,SSH(SecureShell)服务的安全配置是我们日常工作中不可忽视的重要环节,本文将从基础配置到高级安全加固,全面解析SSH服务的各项参... 目录概述基础配置详解端口与监听设置主机密钥配置认证机制强化禁用密码认证禁止root直接登录实现双因素

在Linux终端中统计非二进制文件行数的实现方法

《在Linux终端中统计非二进制文件行数的实现方法》在Linux系统中,有时需要统计非二进制文件(如CSV、TXT文件)的行数,而不希望手动打开文件进行查看,例如,在处理大型日志文件、数据文件时,了解... 目录在linux终端中统计非二进制文件的行数技术背景实现步骤1. 使用wc命令2. 使用grep命令

SpringBoot开发中十大常见陷阱深度解析与避坑指南

《SpringBoot开发中十大常见陷阱深度解析与避坑指南》在SpringBoot的开发过程中,即使是经验丰富的开发者也难免会遇到各种棘手的问题,本文将针对SpringBoot开发中十大常见的“坑... 目录引言一、配置总出错?是不是同时用了.properties和.yml?二、换个位置配置就失效?搞清楚加