Re: Write/Read Bulk communication process in KEXT. How?
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com On May 24, 2006, at 9:02 PM, Chinki wrote: Step4. Communicating with the KEY [ MAIN PART OF OUR DISCUSSION] // assign for IN pipe IOMemoryDescriptor *memDescIN = NULL; I assume you mean kIODirectionOut? // check for validation of memDescOut // Fill myOutStructure You are missing the ->prepare() and ->complete() calls. // Similarly for IN structure I assume you mean kIODirectionIn? // check for validation of memDescIn // Fill myOutStructure You are missing the ->prepare() and ->complete() calls. = Mike _______________________________________________ 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... a) I get the structure (got from user level) and Allocate the memory using IOMemoryDescriptor in my communication module (kext) i.e, // assign for OUT pipe IOMemoryDescriptor *memDescOut = NULL; // Now create and initialize an IOMemoryDescriptor for memory FOR WRITE memDescOut = IOMemoryDescriptor::withAddress( (void*) &myOutStructure, sizeof(MY_OUTSTRUCTURE), kDirectionOUT) // Do write operation with the allocated outpipe status = (pdx->fOUTPipe)->Write( memDescOut, (UInt32)1000, (UInt32) 2000, size, NULL); // Now create and initialize an IOMemoryDescriptor for memory FOR READ memDescIN = IOMemoryDescriptor::withAddress( (void*)&myINStructure, sizeof(MY_OUTSTRUCTURE), kDirectionOUT) // Do write operation with the allocated outpipe status = (pdx->fINPipe)->Read( memDescIN , (UInt32)1000, (UInt32) 2000, size, NULL, &gotsize); I also note that you're not checking the result of the IOMemoryDescriptor::withAddress() calls. It's imperative that you do this, and handle the case where they return NULL in a sensible fashion. This email sent to site_archiver@lists.apple.com
participants (1)
-
Michael Smith