Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [OS X] Is ResetPipe() asyncronous...?



At 11:13 AM -0800 1/23/03, Barry Twycross wrote:
At 11:49 AM +0100 1/23/03, MacInsight wrote:

Before any bulk endpoints are used, the userland-driver does USBDeviceOpen(), GetNumberOfConfigurations(), GetConfigurationDescriptorPtr(), SetConfiguration(), CreateInterfaceInterface(), USBInterfaceOpen() and ResetPipes() with a subsequent DeviceRequest() (with bRequest = kUSBRqClearFeature and wValue = kUSBFeatureEndpointStall) to synchronize the data-toggle.

Do you need to do the ResetPipe?

I've heard on some OSs you need to do this for reasons which are not clear to me, as far as I know its not necessary on Mac OS.

On MacOS you need to do it for protocols like PTP (USB Still Imaging) that use stalls for signalling.


I don't know if ClearPipeStallBothEnds() is smart about this or not, but USBClearPipeStallByReference() won't set the toggle to zero on the host end if it hasn't seen a stall on that pipe yet resulting in data loss if you don't call USBResetPipeByReference().

PTP signals the host by stalling both the bulk in and out pipes -- the host sees one of the stalls first and tries to clear both -- because there hasn't been transaction on the other pipe yet, USBClearPipeStallByReference() doesn't reset the toggle on the host end causing a 50% chance of losing the next packet on that pipe.

It might be worth verifying that ClearPipeStallBothEnds() resets the data toggle on the host side even if it doesn't thing the endpoint is stalled or you may hit this case.

(Sorry, I implemented a PTP stack on 9, but not X)

Cheers,

-Steve
--
_________________________________________________________________________
Steve Sisak, CTO                                 email@hidden
IOXperts, Inc.                                            +1 617 876-2572
_______________________________________________
usb mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/usb
Do not post admin requests to the list. They will be ignored.

References: 
 >[OS X] Is ResetPipe() asyncronous...? (From: MacInsight <email@hidden>)
 >Re: [OS X] Is ResetPipe() asyncronous...? (From: Barry Twycross <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.