Before you go too far down this path, a couple questions:
- Does your hardware only support 32-bit DMA?
- Is your driver responsible for allocating its DMA buffers?
(likely if you are a custom PCI device; maybe unlikely if you're a
"standard" device like an audio card, SATA controller,
etc.)
If both answers are "yes", then it turns out that it's
actually better NOT to use IODMACommand, and you can get away with
using all your old IOMemoryCursor code... you just have to change your
DMA buffer allocation to use
IOBufferMemoryDescriptor::inTaskWithPhysicalAddress() on the Intel
side.
if ( (IOMemoryDescriptor*)NULL !=
Entry->MemDescP )
Entry->MemDescP->release ( );
return ( kIOReturnCannotWire
);
}
I Unmap the
data buffer from memory as follows:
if (
(IOMemoryDescriptor*)NULL != Entry->MemDescP )
{
result = Entry->MemDescP->complete (
);
Entry->MemDescP->release (
);
}
My problem
is newSegment does not get called so that I can create my
ScatterGather list. The Apple sample code uses one of the 9 predefined
functions but does NOT demonstrate use of a custom segmenting
function, such as I need. Any ideas how I get my segment function
called?
I note from
the header file IODMACommand.h that the segment function is a C
function. Is a static C++ function allowed as it was for
IOMemoryCursor?
I would
expect an ScatterGather list of, worst case, 1 entry per 4k page
giving approx 230 entries per 1000Kb.
When I used
an IOMemoryCursor I get this behaviour, albeit very
slow.
With the
IODMACommand method I consistently get kIOReturnOverrun errors at 255
entries.
What am I
missing or doing wrong?
I also had
linker/loader related errors as I had missing OSDependencies which
this list helped me resolve, but these dependencies were not listed
anywhere.
Thanks,
Peter
Young
" Build a man a fire - he's warm for a day. Set a man
on fire - he's warm for the rest of his
life!"
Peter Young
Senior Software Engineer Remove .nospam from address email@hidden
HighWater Designs Ltd
1-6 St. George's Business Park,
Alstone Lane, Cheltenham,
Gloucestershire, GL51 8HF UK
Registered in England and Wales No 2111605. VAT No GB
448 485117
No virus found in this
outgoing message.
Checked by AVG.
Version: 7.5.467 / Virus Database: 269.7.6/814 - Release Date:
21/05/2007 14:01
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-drivers mailing list
(email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-drivers/email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-drivers mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-drivers/email@hidden
This email sent to email@hidden