Multi-Function Drivers

USB and PCI devices may be composite devices that include multiple independent devices in which each device's separate driver can handle each function. Other devices may consist of one logical device handled by multiple drivers. Let's consider a modern graphics card with an HDMI output port as an example. HDMI is able to carry both audio and video, so it would be nice to provide an audio driver that allowed the device to be used with Core Audio. The device is a graphics card, so the hardware doesn't have the typical DMA engine of most audio hardware. Instead, audio data is sent along with video frames at regular vertical blanking intervals. This design means that the audio and video parts are intimately linked and need a shared state between them in order to operate. Since there is no clear separation, the driver can be structured as shown in Figure 17-1.

images

Figure 17-1. Multi-function driver

The design in Figure 17-1 uses a central driver, which coordinates the hardware and manages the provider. The central driver is used for matching against the hardware provider. The central driver then creates an audio driver based on the IOAudioFamily and a video/graphics driver based on the IOGraphicsFamily. There are two ways of managing the relationship of the subordinate drivers to the central driver:

  • The central, audio, and video drivers can be in separate KEXTs. The central driver matches against the hardware resource, whereas the audio and video drivers will match against the central driver and use it as the provider.
  • All drivers can be located in the same KEXT. The central driver would then need to manage the lifecycle of the subordinated drivers manually.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.177.151