Role of device drivers

Device drivers enable publishers to communicate with attached devices by supporting POSIX system calls such as open(), read(), and write(). Publishers issue these system calls to drivers to obtain information about the devices that the drivers manage; they then publish the information to PPS objects that applications monitor. Using this information, applications may, in turn, perform a variety of actions, such as using a control PPS object to set the power of a USB hub or to eject a CD.

Here is a summary of how the device publishers typically interact with their corresponding drivers:

  usblauncher_otg mmcsdpub cdpub
Driver startup USB launcher starts and stops drivers when devices added or removed. Driver launched at system startup; runs continuously. Driver launched at system startup; runs continuously.
Driver communication

Drivers create entries in /dev for attached USB devices and manage communication with USB-based devices: mass storage, DVD, SD Card, etc.

usblauncher_otg monitors /dev entries and, when it notices a state change, asks the driver to retrieve device and mount information; it then writes the information to PPS objects.a

usblauncher_otg also gets event notifications (for instance, device insertions and removals) from the USB stack; it then writes these to PPS.

Driver creates entries in /dev for attached devices and manages communication with SD cards.

mmcsdpub monitors /dev entries and, when it notices a state change, asks the driver to retrieve device and mount information; it then writes the information to PPS objects.

Driver creates entries in /dev for CD devices and manages communication with DVDs, audio CDs, CD-ROMs, etc.

cdpub monitors /dev entries and, when it notices a state change, asks driver to retrieve device and mount information; it then writes the information to PPS objects.

Note: In previous releases, device publishers could use the media content detector, mcd, to automatically mount filesystems on connected USB devices. Functionality formerly provided by mcd is now incorporated into the USB launcher service. To perform filesystem mounting on an SD Card or CD device, you can use the auto-mount capabilities of the appropriate block driver.
a The usblauncher_otg service doesn't perform device-specific actions, such as ejecting the disc in a USB optical drive. Such actions are managed by the other publishers (in this case, cdpub).