Information Technology Reference
In-Depth Information
class-specific request for the mass-storage class.
2. Clear Feature(ENDPOINT_HALT) request for the bulk IN end-
point. The device resets the endpoint's data toggle to DATA0. The end-
point resumes normal communications if possible. This request is a
standard USB request.
3. Clear Feature(ENDPOINT_HALT) request for the bulk OUT end-
point. The device resets the endpoint's data toggle to DATA0. The end-
point resumes normal communications if possible. This request is a
standard USB request.
As an alternative to a reset recovery, a host might issue a Set Port Feature
(PORT_RESET) request to the device's hub port. The host must then
re-enumerate the device. This option isn't ideal for composite devices, which
have multiple active interfaces, because the port reset will affect all of the
device's interfaces. But a port reset can be necessary when communicating
with a device that crashes when the host attempts a reset recovery. (Such
devices exist.) The Windows mass-storage driver favors the port reset over
the reset recovery.
The PrepareCSWData function sets the CSWTag and CSWSignature fields
in the CSW. The other fields in the CSW are set in other functions later in
this chapter.
volatile far USB_MSD_CSW msd_csw;
void PrepareCSWData()
{
// Set dCSWTag to match dCBWTag in the command's CBW.
msd_csw.dCSWTag = gblCBW.dCBWTag;
msd_csw.dCSWSignature = 0x53425355;
}
Managing Communications on the Bulk Endpoints
One way to manage communications on the bulk endpoints is to set a vari-
able that specifies whether the device is waiting for a CBW, ready to send
data or a CSW to the host, or ready to receive data from the host.
Search WWH ::




Custom Search