| .. | .. |
|---|
| 18 | 18 | #include <linux/delay.h> |
|---|
| 19 | 19 | #include <linux/module.h> |
|---|
| 20 | 20 | #include <linux/serdev.h> |
|---|
| 21 | +#include "tty.h" |
|---|
| 21 | 22 | |
|---|
| 22 | 23 | static int tty_port_default_receive_buf(struct tty_port *port, |
|---|
| 23 | 24 | const unsigned char *p, |
|---|
| .. | .. |
|---|
| 280 | 281 | * Return a refcount protected tty instance or NULL if the port is not |
|---|
| 281 | 282 | * associated with a tty (eg due to close or hangup) |
|---|
| 282 | 283 | */ |
|---|
| 283 | | - |
|---|
| 284 | 284 | struct tty_struct *tty_port_tty_get(struct tty_port *port) |
|---|
| 285 | 285 | { |
|---|
| 286 | 286 | unsigned long flags; |
|---|
| .. | .. |
|---|
| 301 | 301 | * Associate the port and tty pair. Manages any internal refcounts. |
|---|
| 302 | 302 | * Pass NULL to deassociate a port |
|---|
| 303 | 303 | */ |
|---|
| 304 | | - |
|---|
| 305 | 304 | void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty) |
|---|
| 306 | 305 | { |
|---|
| 307 | 306 | unsigned long flags; |
|---|
| .. | .. |
|---|
| 344 | 343 | * |
|---|
| 345 | 344 | * Caller holds tty lock. |
|---|
| 346 | 345 | */ |
|---|
| 347 | | - |
|---|
| 348 | 346 | void tty_port_hangup(struct tty_port *port) |
|---|
| 349 | 347 | { |
|---|
| 350 | 348 | struct tty_struct *tty; |
|---|
| .. | .. |
|---|
| 400 | 398 | * to hide some internal details. This will eventually become entirely |
|---|
| 401 | 399 | * internal to the tty port. |
|---|
| 402 | 400 | */ |
|---|
| 403 | | - |
|---|
| 404 | 401 | int tty_port_carrier_raised(struct tty_port *port) |
|---|
| 405 | 402 | { |
|---|
| 406 | 403 | if (port->ops->carrier_raised == NULL) |
|---|
| .. | .. |
|---|
| 417 | 414 | * to hide some internal details. This will eventually become entirely |
|---|
| 418 | 415 | * internal to the tty port. |
|---|
| 419 | 416 | */ |
|---|
| 420 | | - |
|---|
| 421 | 417 | void tty_port_raise_dtr_rts(struct tty_port *port) |
|---|
| 422 | 418 | { |
|---|
| 423 | 419 | if (port->ops->dtr_rts) |
|---|
| .. | .. |
|---|
| 433 | 429 | * to hide some internal details. This will eventually become entirely |
|---|
| 434 | 430 | * internal to the tty port. |
|---|
| 435 | 431 | */ |
|---|
| 436 | | - |
|---|
| 437 | 432 | void tty_port_lower_dtr_rts(struct tty_port *port) |
|---|
| 438 | 433 | { |
|---|
| 439 | 434 | if (port->ops->dtr_rts) |
|---|
| .. | .. |
|---|
| 465 | 460 | * NB: May drop and reacquire tty lock when blocking, so tty and tty_port |
|---|
| 466 | 461 | * may have changed state (eg., may have been hung up). |
|---|
| 467 | 462 | */ |
|---|
| 468 | | - |
|---|
| 469 | 463 | int tty_port_block_til_ready(struct tty_port *port, |
|---|
| 470 | 464 | struct tty_struct *tty, struct file *filp) |
|---|
| 471 | 465 | { |
|---|