Lines Matching refs:port

45  *	@port: tty port owning the flip buffer
56 void tty_buffer_lock_exclusive(struct tty_port *port)
58 struct tty_bufhead *buf = &port->buf;
65 void tty_buffer_unlock_exclusive(struct tty_port *port)
67 struct tty_bufhead *buf = &port->buf;
81 * @port: tty port owning the flip buffer
91 int tty_buffer_space_avail(struct tty_port *port)
93 int space = port->buf.mem_limit - atomic_read(&port->buf.mem_used);
110 * @port: tty port to free from
116 void tty_buffer_free_all(struct tty_port *port)
118 struct tty_bufhead *buf = &port->buf;
145 * @port: tty port
155 static struct tty_buffer *tty_buffer_alloc(struct tty_port *port, size_t size)
164 free = llist_del_first(&port->buf.free);
173 if (atomic_read(&port->buf.mem_used) > port->buf.mem_limit)
182 atomic_add(size, &port->buf.mem_used);
188 * @port: tty port owning the buffer
195 static void tty_buffer_free(struct tty_port *port, struct tty_buffer *b)
197 struct tty_bufhead *buf = &port->buf;
222 struct tty_port *port = tty->port;
223 struct tty_bufhead *buf = &port->buf;
233 tty_buffer_free(port, buf->head);
247 * @port: tty port
258 static int __tty_buffer_request_room(struct tty_port *port, size_t size,
261 struct tty_bufhead *buf = &port->buf;
274 n = tty_buffer_alloc(port, size);
295 int tty_buffer_request_room(struct tty_port *port, size_t size)
297 return __tty_buffer_request_room(port, size, 0);
303 * @port: tty port
312 int tty_insert_flip_string_fixed_flag(struct tty_port *port,
319 int space = __tty_buffer_request_room(port, goal, flags);
320 struct tty_buffer *tb = port->buf.tail;
338 * @port: tty port
348 int tty_insert_flip_string_flags(struct tty_port *port,
354 int space = tty_buffer_request_room(port, goal);
355 struct tty_buffer *tb = port->buf.tail;
373 * @port: tty port
380 int __tty_insert_flip_char(struct tty_port *port, unsigned char ch, char flag)
385 if (!__tty_buffer_request_room(port, 1, flags))
388 tb = port->buf.tail;
399 * @port: tty port
410 int tty_prepare_flip_string(struct tty_port *port, unsigned char **chars,
413 int space = __tty_buffer_request_room(port, size, TTYB_NORMAL);
415 struct tty_buffer *tb = port->buf.tail;
452 receive_buf(struct tty_port *port, struct tty_buffer *head, int count)
461 n = port->client_ops->receive_buf(port, p, f, count);
482 struct tty_port *port = container_of(work, struct tty_port, buf.work);
483 struct tty_bufhead *buf = &port->buf;
509 tty_buffer_free(port, head);
513 count = receive_buf(port, head, count);
537 * @port: tty port to push
546 void tty_flip_buffer_push(struct tty_port *port)
548 struct tty_bufhead *buf = &port->buf;
558 * @port: tty port
563 * with the exception of properly holding the @port->lock.
569 int tty_insert_flip_string_and_push_buffer(struct tty_port *port,
572 struct tty_bufhead *buf = &port->buf;
575 spin_lock_irqsave(&port->lock, flags);
576 size = tty_insert_flip_string(port, chars, size);
579 spin_unlock_irqrestore(&port->lock, flags);
588 * @port: tty port to initialise
594 void tty_buffer_init(struct tty_port *port)
596 struct tty_bufhead *buf = &port->buf;
611 * @port: tty port to change
617 int tty_buffer_set_limit(struct tty_port *port, int limit)
621 port->buf.mem_limit = limit;
627 void tty_buffer_set_lock_subclass(struct tty_port *port)
629 lockdep_set_subclass(&port->buf.lock, TTY_LOCK_SLAVE);
632 bool tty_buffer_restart_work(struct tty_port *port)
634 return queue_work(system_unbound_wq, &port->buf.work);
637 bool tty_buffer_cancel_work(struct tty_port *port)
639 return cancel_work_sync(&port->buf.work);
642 void tty_buffer_flush_work(struct tty_port *port)
644 flush_work(&port->buf.work);