Speed enhancement for bulk devices.
Speed enhancement for bulk devices.
- Subject: Speed enhancement for bulk devices.
- From: "rohit dhamija" <email@hidden>
- Date: Thu, 19 Jul 2007 09:14:49 +0530
Dear All,
Sorry for the repost, but i didnot get any replies from USB list forum.
My USB device is of bulk type having two endpoints.
I need to send buffer continously to my USB bulk device , each buffer
having size around 1.5 MB. As per the protocol decided with the
device, I send 40KB of data and then read a single byte data from the
device.
I have developed the kernel extension module for my device
successfully, but finding major concern in bandwidth i.e. number of
bytes transferred per second.
I am a NO expert in this field , so please all suggestions are most welcome!!
Below are my queries:
a) I am achieving around 8 MB/s of data transfer speed (checked it
with USB Analyzer), whereas the same device when run on Windows /
Linux machines gives bandwidth of more than 20 MB/s. The device is a
High speed one. What can be the reason for such huge difference? Is
macintosh USB host controller slow? Please comment.
b) I am getting different bandwidth speeds on different Macintosh
systems. For example on intel mac-mini the bandwidth achieved is
6MB/s, where as on IntelXeon Mac pro it is 10MB/s. I know that lots
depend on CPU speed. But can we apply some ways to achieve almost same
bandwidth for different machine configurations? For example can we
have DMA engine access directly to pass the memory descriptor ???
Please suggest.
c) I am mapping my 1.5 MB of data in a shared memory. Then perform
logical operations and finally pass the data to following code for
writing to my device. Is there any way to make this code more
efficient ? OR if we can add something to improve on the speed?
d) How can we check if something is going fishy under the client driver?
UInt16 myBulkDevice::WritingIntoPipe(unsigned char *memory, unsigned int pktlen)
{
IOReturn status = kIOReturnNoDevice;
IOMemoryDescriptor *memDescOut = NULL;
if( (pDevice)->isInactive())
return kIOReturnNoDevice;
if(!(pDevice)->isOpen())
return kIOReturnNoDevice;
if(!intf)
return kIOReturnNoDevice;
if( (intf)->isInactive())
return kIOReturnNoDevice;
if(!(intf)->isOpen())
return kIOReturnNoDevice;
memDescOut = IOMemoryDescriptor::withAddress( (void *)memory,
pktlen, kIODirectionOut);
if ( memDescOut == NULL )
return kIOReturnNoResources;
if(!(fOutPipe))
{
status = kIOReturnNoResources;
if(memDescOut)
{
memDescOut->release();
memDescOut = NULL;
}
return (status);
}
status = memDescOut->prepare(memDescOut->getDirection());
if(status != kIOReturnSuccess){
if(memDescOut)
{
memDescOut->release();
memDescOut = NULL;
}
return (status);
}
if((intf)->isInactive()){
status = kIOReturnError;
}
else{
status = (fOutPipe)->Write(
memDescOut,(UInt32)1,(UInt32)1,pktlen,(IOUSBCompletion*)NULL
);
}
memDescOut->complete(memDescOut->getDirection());
if(memDescOut)
{
memDescOut->release();
memDescOut = NULL;
}
return (status);
}
Please let me know incase of any clarification in this regard.
Thanks and Regards,
rohit
--
Rohit Dhamija(M) 9818446545
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden