Jaa


Isochronous Listen Options for IEEE 1394 Devices

This section describes the various isochronous listen options.

Receiving or stripping packet headers

Host controllers may or may not automatically strip the headers off an isochronous packet. The bus driver sets the HOST_INFO_SUPPORTS_RETURNING_ISO_HDR flag of HostCapabilities member of the GET_LOCAL_HOST_INFO2 structure if the host controller does not automatically strip the headers off isochronous packets.

Also, host controllers may support configurable stripping of headers. The bus driver sets the HOST_INFO_SUPPORTS_ISOCH_STRIPPING flag of HostCapabilities if the host controller can be configured to strip headers. To actually configure the host controller to strip headers, the driver submits the REQUEST_ISOCH_ALLOCATE_RESOURCES request with the RESOURCE_STRIP_ADDITIONAL_QUADLETS flag set. The nQuadletsToStrip member specifies the number of quadlets to strip off the beginning of each packet. For example, nQuadletsToStrip = 1 would strip off the isochronous packet header.

Stream versus packet-based DMA

The stream-based and packet-based DMA strategies require support from the underlying host controller. All host controllers support at least one of the DMA strategies, and OHCI-compliant host controllers support both.

Packet-based DMA and stream-based DMA have similar characteristics when all packets are of the same size. But the two sorts of DMA have very different characteristics when the packet size varies.

In stream-based DMA, the host controller ignores packet boundaries as it fills the I/O buffers, leaving no gaps in the data that it writes. In order to determine the location of a particular packet, you must know the lengths of all the previous packets.

In packet-based DMA, the host controller writes just one isochronous packet per buffer. Thus in packet mode, the host controller spaces the data it writes, so that each packet begins at a distance from the beginning of the I/O buffer that is an integral multiple of the maximum packet size. If a particular packet is smaller than the maximum, the data located between the end of that packet and the start of the next packet is undefined. So when packets are smaller than the maximum size, some buffer space is wasted. For example, a buffer large enough to hold 10 packets always holds exactly 10 packets, even if some packets are smaller than the maximum size allowed.

Regardless of which DMA mode you choose, some design tradeoffs apply. For example, the choice of buffer size affects the performance of your device, no matter which DMA mode you use. Large buffers provide efficiency because you avoid some of the overhead associated with initializing a large number of buffers. Also, fewer buffers mean that fewer DMA descriptors are required. On the other hand, larger buffers increase the latency between the beginning of an I/O operation and the moment in which the bus driver informs the function driver that the buffer is full.

If the host controller supports both types of DMA, the bus driver sets the host controller to default to stream-based DMA. To reset the host controller to packet-based DMA, the driver should set the RESOURCE_USE_PACKET_BASED flag when it allocates the resource handle.

Drivers use the REQUEST_GET_LOCAL_HOST_INFO bus request (with the u.GetLocalHostInformation.nLevel member of the IRB = GET_HOST_CAPABILITIES) to determine the characteristics of the host controller. The bus driver returns a GET_LOCAL_HOST_INFO2 structure, and sets flags within the HostCapabilities member to indicate what the host controller supports:

DMA type HostCapabilities flag

stream-based

HOST_INFO_STREAM_BASED

packet-based

HOST_INFO_PACKET_BASED