Lines Matching refs:tty

11     driver::tty::{
54 fn ioctl_helper(&self, tty: Arc<TtyCore>, cmd: u32, arg: usize) -> Result<usize, SystemError> { in ioctl_helper()
63 return TtyCore::tty_mode_ioctl(tty.clone(), cmd, arg); in ioctl_helper()
125 tty: Weak<TtyCore>, field
154 tty: Weak::default(), in new()
173 tty: Arc<TtyCore>, in receive_buf_common()
180 let termios = tty.core().termios(); in receive_buf_common()
213 self.receive_buf(tty.clone(), &buf[offset..], Some(&flags[offset..]), n); in receive_buf_common()
215 self.receive_buf(tty.clone(), &buf[offset..], flags, n); in receive_buf_common()
225 if tty.core().flags().contains(TtyFlag::LDISC_CHANGING) { in receive_buf_common()
237 tty: Arc<TtyCore>, in receive_buf()
242 let termios = tty.core().termios(); in receive_buf()
252 } else if tty.core().is_closing() && !termios.local_mode.contains(LocalMode::EXTPROC) { in receive_buf()
256 self.receive_buf_standard(tty.clone(), buf, flags, look_ahead, true); in receive_buf()
260 self.receive_buf_standard(tty.clone(), buf, flags, count - look_ahead, false); in receive_buf()
264 self.flush_echoes(tty.clone()); in receive_buf()
266 tty.flush_chars(tty.core()); in receive_buf()
278 tty.core() in receive_buf()
324 pub fn flush_echoes(&mut self, tty: Arc<TtyCore>) { in flush_echoes()
325 let termios = tty.core().termios(); in flush_echoes()
335 let _ = self.echoes(tty); in flush_echoes()
340 tty: Arc<TtyCore>, in receive_buf_standard()
346 let termios = tty.core().termios(); in receive_buf_standard()
370 self.receive_char(c, tty.clone()) in receive_buf_standard()
393 self.receive_special_char(c, tty.clone(), lookahead_done); in receive_buf_standard()
395 self.receive_char(c, tty.clone()); in receive_buf_standard()
403 pub fn receive_special_char(&mut self, mut c: u8, tty: Arc<TtyCore>, lookahead_done: bool) { in receive_special_char()
404 let is_flow_ctrl = self.is_flow_ctrl_char(tty.clone(), c, lookahead_done); in receive_special_char()
405 let termios = tty.core().termios(); in receive_special_char()
414 self.recv_sig_char(tty.clone(), &termios, Signal::SIGINT, c); in receive_special_char()
419 self.recv_sig_char(tty.clone(), &termios, Signal::SIGQUIT, c); in receive_special_char()
424 self.recv_sig_char(tty.clone(), &termios, Signal::SIGTSTP, c); in receive_special_char()
429 let flow = tty.core().flow_irqsave(); in receive_special_char()
435 tty.tty_start(); in receive_special_char()
436 self.process_echoes(tty.clone()); in receive_special_char()
461 self.commit_echoes(tty.clone()); in receive_special_char()
473 self.commit_echoes(tty.clone()); in receive_special_char()
490 self.commit_echoes(tty.clone()); in receive_special_char()
499 self.commit_echoes(tty.clone()); in receive_special_char()
506 tty.core().read_wq().wakeup_any( in receive_special_char()
519 tty.core().read_wq().wakeup_any( in receive_special_char()
535 self.commit_echoes(tty.clone()); in receive_special_char()
547 tty.core().read_wq().wakeup_any( in receive_special_char()
566 self.commit_echoes(tty.clone()); in receive_special_char()
736 pub fn is_flow_ctrl_char(&mut self, tty: Arc<TtyCore>, c: u8, lookahead_done: bool) -> bool { in is_flow_ctrl_char()
737 let termios = tty.core().termios(); in is_flow_ctrl_char()
750 tty.tty_start(); in is_flow_ctrl_char()
751 self.process_echoes(tty.clone()); in is_flow_ctrl_char()
754 tty.tty_stop(); in is_flow_ctrl_char()
762 tty: Arc<TtyCore>, in recv_sig_char()
767 self.input_signal(tty.clone(), termios, signal); in recv_sig_char()
769 tty.tty_start(); in recv_sig_char()
774 self.commit_echoes(tty); in recv_sig_char()
776 self.process_echoes(tty); in recv_sig_char()
783 tty: Arc<TtyCore>, in input_signal()
788 let mut ctrl_info = tty.core().contorl_info_irqsave(); in input_signal()
803 let _ = tty.flush_buffer(tty.core()); in input_signal()
815 if tty.core().link().is_some() { in input_signal()
816 self.packet_mode_flush(tty.core()); in input_signal()
821 pub fn receive_char(&mut self, c: u8, tty: Arc<TtyCore>) { in receive_char()
822 let termios = tty.core().termios(); in receive_char()
836 self.commit_echoes(tty.clone()); in receive_char()
839 if c == 0o377 && tty.core().termios().input_mode.contains(InputMode::PARMRK) { in receive_char()
870 pub fn commit_echoes(&mut self, tty: Arc<TtyCore>) { in commit_echoes()
883 let echoed = self.echoes(tty.clone()); in commit_echoes()
886 tty.flush_chars(tty.core()); in commit_echoes()
1170 let tty = self.tty.upgrade().unwrap(); in process_output_block() localVariable
1171 let space = tty.write_room(tty.core()); in process_output_block()
1236 return tty.write(core, buf, cnt); in process_output_block()
1240 pub fn process_echoes(&mut self, tty: Arc<TtyCore>) { in process_echoes()
1245 let echoed = self.echoes(tty.clone()); in process_echoes()
1248 tty.flush_chars(tty.core()); in process_echoes()
1253 pub fn echoes(&mut self, tty: Arc<TtyCore>) -> Result<usize, SystemError> { in echoes()
1254 let mut space = tty.write_room(tty.core()); in echoes()
1256 let termios = tty.core().termios(); in echoes()
1257 let core = tty.core(); in echoes()
1278 if tty in echoes()
1279 .put_char(tty.core(), EchoOperation::Start.to_u8()) in echoes()
1282 tty.write(core, &[EchoOperation::Start.to_u8()], 1)?; in echoes()
1328 if tty.put_char(tty.core(), 8).is_err() { in echoes()
1329 tty.write(core, &[8], 1)?; in echoes()
1343 if tty.put_char(tty.core(), 8).is_err() { in echoes()
1344 tty.write(core, &[8], 1)?; in echoes()
1346 if tty.put_char(tty.core(), b' ').is_err() { in echoes()
1347 tty.write(core, b" ", 1)?; in echoes()
1359 if tty.put_char(tty.core(), b'^').is_err() { in echoes()
1360 tty.write(core, b"^", 1)?; in echoes()
1363 if tty.put_char(tty.core(), ch ^ 0o100).is_err() { in echoes()
1364 tty.write(core, &[ch ^ 0o100], 1)?; in echoes()
1376 let ret = self.do_output_char(tty.clone(), c, space); in echoes()
1387 if tty.put_char(tty.core(), c).is_err() { in echoes()
1388 tty.write(core, &[c], 1)?; in echoes()
1414 pub fn process_output(&mut self, tty: Arc<TtyCore>, c: u8) -> bool { in process_output()
1415 let space = tty.write_room(tty.core()); in process_output()
1417 if self.do_output_char(tty, c, space).is_err() { in process_output()
1427 tty: Arc<TtyCore>, in do_output_char()
1435 let termios = tty.core().termios(); in do_output_char()
1436 let core = tty.core(); in do_output_char()
1443 if tty.put_char(tty.core(), c).is_err() { in do_output_char()
1444 tty.write(core, &[c], 1)?; in do_output_char()
1463 tty.write(core, "\r\n".as_bytes(), 2)?; in do_output_char()
1501 tty.write(core, " ".as_bytes(), spaces)?; in do_output_char()
1523 if tty.put_char(tty.core(), c).is_err() { in do_output_char()
1524 tty.write(core, &[c], 1)?; in do_output_char()
1529 fn packet_mode_flush(&self, tty: &TtyCoreData) { in packet_mode_flush()
1530 let link = tty.link().unwrap(); in packet_mode_flush()
1532 tty.contorl_info_irqsave() in packet_mode_flush()
1542 fn open(&self, tty: Arc<TtyCore>) -> Result<(), system_error::SystemError> { in open()
1544 self.disc_data().tty = Arc::downgrade(&tty); in open()
1546 return self.set_termios(tty, None); in open()
1554 fn flush_buffer(&self, tty: Arc<TtyCore>) -> Result<(), system_error::SystemError> { in flush_buffer()
1555 let core = tty.core(); in flush_buffer()
1580 tty: Arc<TtyCore>, in read()
1597 let core = tty.core(); in read()
1627 TtyJobCtrlManager::tty_check_change(tty.clone(), Signal::SIGTTIN)?; in read()
1631 let core = tty.core(); in read()
1666 let core = tty.core(); in read()
1749 tty: Arc<TtyCore>, in write()
1757 let binding = tty.clone(); in write()
1761 TtyJobCtrlManager::tty_check_change(tty.clone(), Signal::SIGTTOU)?; in write()
1764 ldata.process_echoes(tty.clone()); in write()
1798 if !ldata.process_output(tty.clone(), c) { in write()
1805 tty.flush_chars(core); in write()
1808 let write = tty.write(core, &buf[offset..], nr)?; in write()
1838 tty: Arc<TtyCore>, in ioctl()
1850 let count = tty.chars_in_buffer(); in ioctl()
1856 let termios = tty.core().termios(); in ioctl()
1894 return self.ioctl_helper(tty, cmd, arg); in ioctl()
1902 tty: Arc<TtyCore>, in set_termios()
1903 old: Option<crate::driver::tty::termios::Termios>, in set_termios()
1905 let core = tty.core(); in set_termios()
2058 fn poll(&self, tty: Arc<TtyCore>) -> Result<usize, system_error::SystemError> { in poll()
2059 let core = tty.core(); in poll()
2104 tty: Arc<TtyCore>, in receive_buf()
2110 ldata.receive_buf_common(tty, buf, flags, count, false) in receive_buf()
2115 tty: Arc<TtyCore>, in receive_buf2()
2121 ldata.receive_buf_common(tty, buf, flags, count, true) in receive_buf2()