HcdMdd_CreateMemoryObject

This function creates the host controller interface shared memory area.

LPVOID HcdMdd_CreateMemoryObject(
  DWORD cbSize,
  DWORD cbHighPrioritySize,
  PUCHAR pVirtAddr,
  PUCHAR pPhysAddr 
);

Parameters

  • cbSize
    [in] Total size of the host controller device shared memory area.
  • cbHighPrioritySize
    [in] Specifies the bytes reserved for high-priority isochronous or interrupt transfers and the host controller interface (HCI) communication area.
  • pVirtAddr
    [in] Pointer to the virtual address, which may be NULL, of a memory area.
  • pPhysAddr
    [in] Pointer to the physical address, which may be NULL, of a memory area.

Return Values

A pointer to a host controller (HC) driver memory object indicates success. NULL indicates failure.

Remarks

This HC driver platform-dependent driver (PDD) calls this function to initialize the shared memory area used by the HCI driver. This memory contains data structures shared between the driver and the host controller hardware and is used to allocate DMA buffers for USB driver data transfers. Two options are available. If a platform has an area of memory set aside that can be used by HCI, as specified in the Config.bib file, it can pass the virtual and physical address pointers in to this function. This is the recommended method. Alternatively, the PDD may pass NULL in for the physical and virtual address pointers, in which case the HcdMdd_CreateMemoryObject function attempts to allocate a suitable memory buffer from system RAM.

The host controller interface shared memory area is broken into two separate areas: a high-priority pool of buffers for the host controller communications area and for isochronous client buffers, and a lower-priority pool of buffers for other client transfers.

The size of the shared memory area is dependent on the perceived usage of USB within the platform.

A recommended value for general-purpose USB operation is 64 KB, with 20 KB reserved for high-priority isochronous transfers. If you anticipate less demand on the USB subsystem you can safely reduce this or change the split between normal and high-priority reserve. Reducing the size of the high-priority buffer may cause isochronous transfers to fail if memory cannot be allocated, whereas reducing the size of the non-high-priority buffer reduces performance on bulk interrupt and control transfers. However, reducing the non-high-priority buffer does not cause failures, because bulk transfers can block to wait for memory to become available.

If possible, you should consider placing the HC driver shared memory area in high-speed memory, particularly to support streaming, isochronous, data transfers.

Requirements

OS Versions: Windows CE 1.0 and later.
Header: Ohcdddsi.h or Uhcdddsi.h.

See Also

HcdMdd_DestroyMemoryObject | USB Drivers

 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.