Speed enhancement for bulk devices.
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=KVoBjY5qzh9xBW1l8UinoldkyBFzLDO0LYasuJ7Rxx3NyvVbcVbPmuxVlQcNzRolCpf3onbNDp0PeoGcvZXMuxPqXIe9fluhR0VLWDQwcpr8R0GXMQ8bt0aOfSKuPqSF2y4zY7qK8JbsP7oWrlVQpC2pZPeD6J4/h8/7SCEmHOY= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=lkg9cqQEHch0b1K/lsmVyTe4v5455E/XaYcQJVvbBNiG4njxxQ2kSbRujBCoY+UYJt3/UUNwmc+TNELQyB2JnagfTDHDf4qFFF3OwCOBeh0vW1M7DexbEWOr31QRCO58MSaHrB8+PMX8/eyfCTWXzsHO8MryjF2ZQ824IALX+do= 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 (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
rohit dhamija