The libio-char.a library defines these functions and data types:
The io-char library calls the tto() function, and the driver implements it. The TTYCTRL and TTYDEV structures provide the interface between io-char and the driver. The tto() function writes tx data, line status, device settings, and line-control information to the hardware.
The driver calls the ttc(), tti() and tti2() functions. The ttc() function initializes the device and the resource manager. The tti() and tti2() functions pass receive data and control information to the io-char library.
The tte() function is generated by an event that causes io-char's event handler to be called.
The relationship between the io-char library and the driver is seen here:
The TTYDEV structure contains two buffers: an obuf (output buffer) and an ibuf (input buffer).
The tto() function call provides the interface between the Tx FIFO register and the obuf. It's called to send the contents of the output buffer to the Tx FIFO register.
The tti() and tti2() functions call provide the interface between the Rx FIFO register and the ibuf. They're called to place the data from the Rx FIFO register into the input buffer.
The relationship between the output and input buffers and the tto() and tti() and tti2() function calls can be seen here:
The following table indicates the relationship between the driver and these APIs:
The driver implements: |
---|
tto() — to transmit data, and perform line status, line control, and device settings, e.g. baud, parity, etc.) |
The driver calls: |
iochar_regdrv_power() — to register as a power-managed device driver |
iochar_send_event() — to send a pulse event into io-char's event handler. |
kick() — to kick the output driver into life |
timer_queue() — to add a timer entry to io-char timer queue. |
timer_remove() — to remove a timer entry from io-char timer queue. |
ttc() — to initialize the device and resource manager |
tti() — to pass rx data and control info to io-char |
tti2() — to pass rx data buffer and control information to io-char |
tto_getchar() — to get the first character from the output buf to process. |
tto_checkclients() — to check client lists for notify conditions. |
tx_inject() — to inject a character at the front of the output buffer |
wait_add() — to add a new wait entry to the client message buffer. |
wait_remove_rcvid() — to remove the rcvid matching wait entry. |
The driver generates an event: |
tte() — the io-char event handler. |