国产gaysexchina男同gay,japanrcep老熟妇乱子伦视频,吃奶呻吟打开双腿做受动态图,成人色网站,国产av一区二区三区最新精品

18.7. tty_operaions 結構的細節(jié)

2018-02-24 15:50 更新

18.7.?tty_operaions 結構的細節(jié)

tty_operations 結構包含所有的函數(shù)回調, 可以被一個 tty 驅動設置和被 tty 核心調用. 當前, 所有包含在這個結構中的的函數(shù)指針也在 tty_driver 結構中, 但是會很快被只有一個這個結構的實例來替代.

int (open)(struct tty_struct tty, struct file * filp);
open 函數(shù).

void (close)(struct tty_struct tty, struct file * filp);
close 函數(shù).

int (write)(struct tty_struct tty, const unsigned char *buf, int count);
write 函數(shù).

void (put_char)(struct tty_struct tty, unsigned char ch);
單字節(jié)寫函數(shù). 這個函數(shù)被 tty 核心調用當單個字節(jié)被寫入設備. 如果一個 tty 驅動沒有定義這個函數(shù), write 函數(shù)被調用來替代, 當 tty 核心想發(fā)送一個單個字節(jié).

void (flush_chars)(struct tty_struct tty);void (wait_until_sent)(struct tty_struct tty, int timeout);
刷新數(shù)據(jù)到硬件的函數(shù).

int (write_room)(struct tty_struct tty);
指示多少緩沖空閑的函數(shù).

int (chars_in_buffer)(struct tty_struct tty);
指示多少緩沖滿數(shù)據(jù)的函數(shù).

int (ioctl)(struct tty_struct tty, struct file * file, unsigned int cmd, unsigned long arg);
ioctl 函數(shù). 這個函數(shù)被 tty 核心調用, 當 ioctl(2)在設備節(jié)點上被調用時.

void (set_termios)(struct tty_struct tty, struct termios * old);
set_termios 函數(shù). 這個函數(shù)被 tty 核心調用, 當設備的 termios 設置已被改變時.

void (throttle)(struct tty_struct tty);void (unthrottle)(struct tty_struct tty);void (stop)(struct tty_struct tty);void (start)(struct tty_struct tty);
數(shù)據(jù)抑制函數(shù). 這些函數(shù)用來幫助控制 tty 核心的輸入緩存. 這個抑制函數(shù)被調用當 tty 核心的輸入緩沖滿. tty 驅動應當試圖通知設備不應當發(fā)送字符給它. unthrottle 函數(shù)被調用當 tty 核心的輸入緩沖已被清空, 并且它現(xiàn)在可以接收更多數(shù)據(jù). tty 驅動應當接著通知設備可以接收數(shù)據(jù). stop 和 start 函數(shù)非常象 throttle 和 unthrottle 函數(shù), 但是它們表示 tty 驅動應當停止發(fā)送數(shù)據(jù)給設備以及以后恢復發(fā)送數(shù)據(jù).

void (hangup)(struct tty_struct tty);
掛起函數(shù). 這個函數(shù)被調用當 tty 驅動應當掛起 tty 設備. 任何需要做的特殊的硬件操作應當在此時發(fā)生.

void (break_ctl)(struct tty_struct tty, int state);
線路中斷控制函數(shù). 這個函數(shù)被調用當這個 tty 驅動要打開或關閉線路的 BREAK 狀態(tài)在 RS-232 端口上. 如果狀態(tài)設為 -1, BREAK 狀態(tài)應當打開. 如果狀態(tài)設為 0, BREAK 狀態(tài)應當關閉. 如果這個函數(shù)由 tty 驅動實現(xiàn), tty 核心將處理 TCSBRK, TCSBRKP, TIOCSBRK, 和 TIOCCBRK ioctl. 否則, 這些 ioctls 被發(fā)送給驅動 ioctl 函數(shù).

void (flush_buffer)(struct tty_struct tty);
刷新緩沖和丟失任何剩下的數(shù)據(jù).

void (set_ldisc)(struct tty_struct tty);
設置線路規(guī)程的函數(shù). 這個函數(shù)被調用當 tty 核心已改變這個 tty 驅動的線路規(guī)程. 這個函數(shù)通常不用并且不應當被一個驅動定義.

void (send_xchar)(struct tty_struct tty, char ch);
發(fā)送 X-類型 字符 的函數(shù). 這個函數(shù)用來發(fā)送一個高優(yōu)先級 XON 或者 XOFF 字符給 tty 設備. 要被發(fā)送的字符在 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 buffer, unsigned long count, void *data);
/proc 讀和寫函數(shù).

int (tiocmget)(struct tty_struct tty, struct file *file);
獲得當前的特定 tty 設備的線路設置. 如果從 tty 設備成功獲取到, 應當返回這個值給調用者.

int (tiocmset)(struct tty_struct tty, struct file *file, unsigned int set, unsigned int clear);
設置當前的特定 tty 設備的線路設置. set 和 clear 包含了去設置或者清除的不同的線路設置.

以上內容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號