Communication API
Posted: Fri Feb 27, 2004 11:31 pm
This idea has been on the backburner for quite awhile, but I'd like to get started working on it soon. Basically I'd like a device-independent driver interface that allows high-level drivers, such as a TCP/IP stack, or a bootloader, to enumerate and communicate over low-level device transports. I'd like to be able to load a module, whether it's ps2smap, usbpegasus, or usbcable (e.g. PL230x USB cable) and have the transport type indentified automatically to a higher layer. The high-level driver need not care really what type of transport it is if it doesn't need to, as a bootloader wouldn't really care if it's using a point-to-point link such as a usb cable. This crude diagram shows the scheme of things:
+--------+ +------------+
| TCP/IP | | bootloader |
+--------+ +------------+
| |
\ /
\_ +--------------------+
| Communications API |
+--------------------+
/ | \
+-----+ +----------+ \ +-----+
|SMAP | | IEEE1394 | | USB |
+-----+ +----------+ +-----+
\
+---------+
| Pegasus |
+---------+
I would imagine that the core driver for a device, like IEEE1394 or USB, would be responsible for device enumeration and exclusive access to the device below it. Because there's only one type of SMAP device, it would also be responsible for enumeration.
High-level drivers should be able to enumerate devices, "lock" a device for exclusive access (meaning it can be enumerated by other drivers but not accessed by them), send data to a device, and register callbacks for data received on the device. It should also be notified of other events, such as device removal, and disconnection (this would be link status for SMAP) if that info is available for that type of device.
Does anyone have more ideas or suggestions about how this should work?
+--------+ +------------+
| TCP/IP | | bootloader |
+--------+ +------------+
| |
\ /
\_ +--------------------+
| Communications API |
+--------------------+
/ | \
+-----+ +----------+ \ +-----+
|SMAP | | IEEE1394 | | USB |
+-----+ +----------+ +-----+
\
+---------+
| Pegasus |
+---------+
I would imagine that the core driver for a device, like IEEE1394 or USB, would be responsible for device enumeration and exclusive access to the device below it. Because there's only one type of SMAP device, it would also be responsible for enumeration.
High-level drivers should be able to enumerate devices, "lock" a device for exclusive access (meaning it can be enumerated by other drivers but not accessed by them), send data to a device, and register callbacks for data received on the device. It should also be notified of other events, such as device removal, and disconnection (this would be link status for SMAP) if that info is available for that type of device.
Does anyone have more ideas or suggestions about how this should work?