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: length parameter of IOUSBPipe->write()



At 4:51 PM -0500 1/9/05, Daniel Sumorok wrote:

	As far as I could tell, the number of bytes being transfered on
the bus was not correct.

I think you may be right. The important parameter is the buffer end field of the OHCI transfer descriptor (pOHCIGeneralTransferDescriptor->pShared->bufferEnd), on the last transfer descriptor if should be the address of the last byte of the buffer, but it seems to be the last byte of the page on which the end of the buffer resides, or possibly the last byte of the next page.


(An OHCI controller transfers data until its current buffer pointer (pOHCIGeneralTransferDescriptor->pShared->currentBufferPtr) is equal to the buffer end pointer.)

I don't think it allocates more transfer descriptors than are needed.

This code is basically unchanged since the dawn of time and this is the first time anyone's pointed this out, and it should be glaringly obvious to anyone who has this problem, so I can only presume that most developers do not uses buffers which are a subset of their memory descriptor. I'd be hesitant about "fixing" this bug, there may be code out there which does not pass the buffer size parameter correctly and will break if we fix it. Documenting the behaviour is probably the safest option.

This behaviour may also be in the EHCI controller, I based that memory allocation code on the OHCI code. It might be more critical in the EHCI as it could possibly run on 4 pages before getting to the end of a transfer descriptor. (EHCI transfer descriptors can describe 5 pages, whereas OHCI can only describe 2.)
--
Barry Twycross
email@hidden
---
USB, it's not a Dyslexic BUS. (Thanks to TC.)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/usb/email@hidden


This email sent to email@hidden
References: 
 >USB (From: "nishino tetsuya" <email@hidden>)
 >length parameter of IOUSBPipe->write() (From: Daniel Sumorok <email@hidden>)
 >Re: length parameter of IOUSBPipe->write() (From: David Ferguson <email@hidden>)
 >Re: length parameter of IOUSBPipe->write() (From: Daniel Sumorok <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.