Lines Matching refs:port
55 void tty_buffer_lock_exclusive(struct tty_port *port) in tty_buffer_lock_exclusive() argument
57 struct tty_bufhead *buf = &port->buf; in tty_buffer_lock_exclusive()
64 void tty_buffer_unlock_exclusive(struct tty_port *port) in tty_buffer_unlock_exclusive() argument
66 struct tty_bufhead *buf = &port->buf; in tty_buffer_unlock_exclusive()
90 int tty_buffer_space_avail(struct tty_port *port) in tty_buffer_space_avail() argument
92 int space = port->buf.mem_limit - atomic_read(&port->buf.mem_used); in tty_buffer_space_avail()
115 void tty_buffer_free_all(struct tty_port *port) in tty_buffer_free_all() argument
117 struct tty_bufhead *buf = &port->buf; in tty_buffer_free_all()
149 static struct tty_buffer *tty_buffer_alloc(struct tty_port *port, size_t size) in tty_buffer_alloc() argument
158 free = llist_del_first(&port->buf.free); in tty_buffer_alloc()
167 if (atomic_read(&port->buf.mem_used) > port->buf.mem_limit) in tty_buffer_alloc()
175 atomic_add(size, &port->buf.mem_used); in tty_buffer_alloc()
188 static void tty_buffer_free(struct tty_port *port, struct tty_buffer *b) in tty_buffer_free() argument
190 struct tty_bufhead *buf = &port->buf; in tty_buffer_free()
215 struct tty_port *port = tty->port; in tty_buffer_flush() local
216 struct tty_bufhead *buf = &port->buf; in tty_buffer_flush()
226 tty_buffer_free(port, buf->head); in tty_buffer_flush()
251 static int __tty_buffer_request_room(struct tty_port *port, size_t size, in __tty_buffer_request_room() argument
254 struct tty_bufhead *buf = &port->buf; in __tty_buffer_request_room()
267 n = tty_buffer_alloc(port, size); in __tty_buffer_request_room()
288 int tty_buffer_request_room(struct tty_port *port, size_t size) in tty_buffer_request_room() argument
290 return __tty_buffer_request_room(port, size, 0); in tty_buffer_request_room()
305 int tty_insert_flip_string_fixed_flag(struct tty_port *port, in tty_insert_flip_string_fixed_flag() argument
312 int space = __tty_buffer_request_room(port, goal, flags); in tty_insert_flip_string_fixed_flag()
313 struct tty_buffer *tb = port->buf.tail; in tty_insert_flip_string_fixed_flag()
341 int tty_insert_flip_string_flags(struct tty_port *port, in tty_insert_flip_string_flags() argument
347 int space = tty_buffer_request_room(port, goal); in tty_insert_flip_string_flags()
348 struct tty_buffer *tb = port->buf.tail; in tty_insert_flip_string_flags()
373 void tty_schedule_flip(struct tty_port *port) in tty_schedule_flip() argument
375 struct tty_bufhead *buf = &port->buf; in tty_schedule_flip()
398 int tty_prepare_flip_string(struct tty_port *port, unsigned char **chars, in tty_prepare_flip_string() argument
401 int space = __tty_buffer_request_room(port, size, TTYB_NORMAL); in tty_prepare_flip_string()
403 struct tty_buffer *tb = port->buf.tail; in tty_prepare_flip_string()
449 struct tty_port *port = container_of(work, struct tty_port, buf.work); in flush_to_ldisc() local
450 struct tty_bufhead *buf = &port->buf; in flush_to_ldisc()
454 tty = READ_ONCE(port->itty); in flush_to_ldisc()
486 tty_buffer_free(port, head); in flush_to_ldisc()
512 void tty_flip_buffer_push(struct tty_port *port) in tty_flip_buffer_push() argument
514 tty_schedule_flip(port); in tty_flip_buffer_push()
526 void tty_buffer_init(struct tty_port *port) in tty_buffer_init() argument
528 struct tty_bufhead *buf = &port->buf; in tty_buffer_init()
549 int tty_buffer_set_limit(struct tty_port *port, int limit) in tty_buffer_set_limit() argument
553 port->buf.mem_limit = limit; in tty_buffer_set_limit()
559 void tty_buffer_set_lock_subclass(struct tty_port *port) in tty_buffer_set_lock_subclass() argument
561 lockdep_set_subclass(&port->buf.lock, TTY_LOCK_SLAVE); in tty_buffer_set_lock_subclass()
564 bool tty_buffer_restart_work(struct tty_port *port) in tty_buffer_restart_work() argument
566 return queue_work(system_unbound_wq, &port->buf.work); in tty_buffer_restart_work()
569 bool tty_buffer_cancel_work(struct tty_port *port) in tty_buffer_cancel_work() argument
571 return cancel_work_sync(&port->buf.work); in tty_buffer_cancel_work()
574 void tty_buffer_flush_work(struct tty_port *port) in tty_buffer_flush_work() argument
576 flush_work(&port->buf.work); in tty_buffer_flush_work()