Share via


SDIO Client Driver Soft-Block Support (Windows Embedded CE 6.0)

1/6/2010

Soft-Block operation requires true multi-block support in the client driver. The implementation of multi-block support may require a significant change to an existing client driver. The following list shows possible changes to a client driver to enable Soft-Block support.

  • When the card is initialized, if the check for the SMB bit returns zero, the driver should call SDSetCardFeature with the SD_IS_SOFT_BLOCK_AVAILABLE CardFeature value. If this function call is successful, the driver must set a Boolean value that indicates that Soft-Block is enabled and select a valid maximum block size.
  • Any call to read the block size should be conditionally called only if Soft-Block is disabled. When Soft-Block is enabled, a valid single block size must be returned.
  • All calls to write the block size should be conditionally called only if Soft-Block is disabled.
  • During Soft-Block operation, all multi-block calls require requests to specify the block size selected during card initialization for Soft-Block.

During card initialization, the client driver can use the following code example to determine if the bus driver supports Soft-Block.

BOOL bSoftBlockSupported;

//Determine if the bus driver supports Soft-Block
bSoftBlockSupported = SD_API_SUCCESS
(
     SDSetCardFeature(pClientInfo -> hDevice, SD_IS_SOFT_BLOCK_AVAILABLE, NULL, 0)
);

The request by the client driver determines if the SDIO card supports real block mode by checking the SMB value on the card. If the card does not support real block mode, then the client driver can still issue multi-block requests to the bus driver if the bus driver supports Soft-Block.

The request by the client driver also specifies the size of the blocks that the bus driver uses when breaking up a request into multiple byte mode operations. The MMC and SD specifications limit the block size to 512 bytes, and 512 bytes are used for all requests with a block size of 512 bytes or larger. Block sizes less than 512 bytes may be used, but are less efficient as a bus request is issued for each block to the host controller driver.

The client driver may select the block size during initialization by placing the block size in a variable. This allows the client driver to use the multi-block code for the Soft-Block case. The client driver then references this variable when making multi-block calls to the bus driver.

See Also

Reference

SDSetCardFeature

Concepts

SDIO Bus Driver Soft-Block Support
SDIO Host Controller Driver Soft-Block Support

Other Resources

SDIO Soft-Block Support