Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/uart/uart_cpu.h
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | struct uart_ops { | ||||
int (*rxready)(struct uart_bas *); | int (*rxready)(struct uart_bas *); | ||||
int (*getc)(struct uart_bas *, struct mtx *); | int (*getc)(struct uart_bas *, struct mtx *); | ||||
}; | }; | ||||
extern bus_space_tag_t uart_bus_space_io; | extern bus_space_tag_t uart_bus_space_io; | ||||
extern bus_space_tag_t uart_bus_space_mem; | extern bus_space_tag_t uart_bus_space_mem; | ||||
/* | /* | ||||
* PCI bus address from the ACPI SPCR table. | |||||
*/ | |||||
struct uart_pci_info { | |||||
uint16_t vendor; | |||||
uint16_t device; | |||||
uint8_t bus; | |||||
uint8_t slot; | |||||
}; | |||||
/* | |||||
* Console and debug port device info. | * Console and debug port device info. | ||||
*/ | */ | ||||
struct uart_devinfo { | struct uart_devinfo { | ||||
SLIST_ENTRY(uart_devinfo) next; | SLIST_ENTRY(uart_devinfo) next; | ||||
struct uart_ops *ops; | struct uart_ops *ops; | ||||
struct uart_bas bas; | struct uart_bas bas; | ||||
int baudrate; | int baudrate; | ||||
int databits; | int databits; | ||||
int stopbits; | int stopbits; | ||||
int parity; | int parity; | ||||
int type; | int type; | ||||
#define UART_DEV_CONSOLE 0 | #define UART_DEV_CONSOLE 0 | ||||
#define UART_DEV_DBGPORT 1 | #define UART_DEV_DBGPORT 1 | ||||
#define UART_DEV_KEYBOARD 2 | #define UART_DEV_KEYBOARD 2 | ||||
int (*attach)(struct uart_softc*); | int (*attach)(struct uart_softc*); | ||||
int (*detach)(struct uart_softc*); | int (*detach)(struct uart_softc*); | ||||
void *cookie; /* Type dependent use. */ | void *cookie; /* Type dependent use. */ | ||||
struct mtx *hwmtx; | struct mtx *hwmtx; | ||||
struct uart_softc *sc; /* valid only from start of attach */ | struct uart_softc *sc; /* valid only from start of attach */ | ||||
struct uart_pci_info pci_info; | |||||
}; | }; | ||||
int uart_cpu_eqres(struct uart_bas *, struct uart_bas *); | int uart_cpu_eqres(struct uart_bas *, struct uart_bas *); | ||||
int uart_cpu_getdev(int, struct uart_devinfo *); | int uart_cpu_getdev(int, struct uart_devinfo *); | ||||
int uart_getenv(int, struct uart_devinfo *, struct uart_class *); | int uart_getenv(int, struct uart_devinfo *, struct uart_class *); | ||||
const char *uart_getname(struct uart_class *); | const char *uart_getname(struct uart_class *); | ||||
struct uart_ops *uart_getops(struct uart_class *); | struct uart_ops *uart_getops(struct uart_class *); | ||||
▲ Show 20 Lines • Show All 97 Lines • Show Last 20 Lines |