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()
223 tty_buffer_free(port, buf->head); in tty_buffer_flush()
248 static int __tty_buffer_request_room(struct tty_port *port, size_t size, in __tty_buffer_request_room() argument
251 struct tty_bufhead *buf = &port->buf; in __tty_buffer_request_room()
264 if ((n = tty_buffer_alloc(port, size)) != NULL) { in __tty_buffer_request_room()
282 int tty_buffer_request_room(struct tty_port *port, size_t size) in tty_buffer_request_room() argument
284 return __tty_buffer_request_room(port, size, 0); in tty_buffer_request_room()
299 int tty_insert_flip_string_fixed_flag(struct tty_port *port, in tty_insert_flip_string_fixed_flag() argument
306 int space = __tty_buffer_request_room(port, goal, flags); in tty_insert_flip_string_fixed_flag()
307 struct tty_buffer *tb = port->buf.tail; in tty_insert_flip_string_fixed_flag()
335 int tty_insert_flip_string_flags(struct tty_port *port, in tty_insert_flip_string_flags() argument
341 int space = tty_buffer_request_room(port, goal); in tty_insert_flip_string_flags()
342 struct tty_buffer *tb = port->buf.tail; in tty_insert_flip_string_flags()
367 void tty_schedule_flip(struct tty_port *port) in tty_schedule_flip() argument
369 struct tty_bufhead *buf = &port->buf; in tty_schedule_flip()
389 int tty_prepare_flip_string(struct tty_port *port, unsigned char **chars, in tty_prepare_flip_string() argument
392 int space = __tty_buffer_request_room(port, size, TTYB_NORMAL); in tty_prepare_flip_string()
394 struct tty_buffer *tb = port->buf.tail; in tty_prepare_flip_string()
441 struct tty_port *port = container_of(work, struct tty_port, buf.work); in flush_to_ldisc() local
442 struct tty_bufhead *buf = &port->buf; in flush_to_ldisc()
446 tty = port->itty; in flush_to_ldisc()
476 tty_buffer_free(port, head); in flush_to_ldisc()
501 void tty_flip_buffer_push(struct tty_port *port) in tty_flip_buffer_push() argument
503 tty_schedule_flip(port); in tty_flip_buffer_push()
515 void tty_buffer_init(struct tty_port *port) in tty_buffer_init() argument
517 struct tty_bufhead *buf = &port->buf; in tty_buffer_init()
538 int tty_buffer_set_limit(struct tty_port *port, int limit) in tty_buffer_set_limit() argument
542 port->buf.mem_limit = limit; in tty_buffer_set_limit()
548 void tty_buffer_set_lock_subclass(struct tty_port *port) in tty_buffer_set_lock_subclass() argument
550 lockdep_set_subclass(&port->buf.lock, TTY_LOCK_SLAVE); in tty_buffer_set_lock_subclass()
553 void tty_buffer_flush_work(struct tty_port *port) in tty_buffer_flush_work() argument
555 flush_work(&port->buf.work); in tty_buffer_flush_work()