Bewerken

Delen via


Use of Mapping Buffers in the Storport I/O Model

In the SCSI Port I/O model, miniport drivers can require the port driver to allocate and map system virtual memory for SRB I/O buffers. Miniport drivers configure the port driver to map I/O buffers by setting the MapBuffers member of the PORT_CONFIGURATION_INFORMATION (SCSI) structure to TRUE.

If the port driver is configured with MapBuffers set to TRUE, the DataBuffer member of each SRB that the miniport driver receives will contain a system virtual address of an I/O buffer. This address is valid in the address space of all processes in the system. Also, the miniport driver will be free to directly access the I/O buffer.

On the other hand, if the miniport driver sets MapBuffers to FALSE, DataBuffer will contain a virtual address that belongs to a particular process that is not necessarily valid in the context in which the miniport driver runs. Therefore, the miniport driver will not be able to access the memory area to which DataBuffer points.

In the Storport I/O model, miniport drivers are required to support DMA-based I/O. When DMA is used, there should be no need for miniport drivers to access an SRB's I/O buffers indirectly through a system-wide virtual address. With this in view, the Storport I/O model defines a different set of values for the MapBuffers member of PORT_CONFIGURATION_INFORMATION (STORPORT).

Value Meaning

STOR_MAP_NO_BUFFERS

The Storport driver does not map data buffers for any type of SRB. Therefore, its miniport drivers must not directly access the data pointed to by the DataBuffer member in any of the SRBs it receives.

STOR_MAP_ALL_BUFFERS

This feature is not currently implemented. If the MapBuffers member is assigned this value, the Storport driver interprets it as though it were STOR_MAP_NON_READ_WRITE_BUFFERS.

STOR_MAP_NON_READ_WRITE_BUFFERS

The Storport driver maps the data buffers for the request, provided it is not a data transfer (read and write) request. Likewise, miniport drivers can access data in the SRB provided that the SRB does not belong to a read or a write request.