For receive descriptors we need to provide 4k memory for our adapter.
I am given to understand that earlier mac implementation had 2k
limitation.
Do we still have any such limitation in MAC OS. I am working on
10.3.9.
Is a "receive descriptor" scratch space for the device or are you
asking here about the actual packet buffers? I haven't worked with
large packets, so if you mean 4KB mbufs then I can't help.
If you mean just general memory for the device then you can certainly
allocate 4KB, get its physical address and pass that to your adaptor
for its bus-master DMA. I've done this and it's fine.
If you are only allocating 4KB then you won't need
kIOMemoryPhysicallyContiguous as I did below since a 1-page
allocation will be contiguous by definition. If you allocate more
than 1 page then it can be an issue. And in that case bear in mind
that the alignment only applies to the virtual address. There is no
support for large-grain alignment of physical memory whether
contiguous or not. (Those are 2 days of debugging I'll never get
back...)
if (QmemMap)
QmemMap->release(), QmemMap = 0;
if (QmemDescriptor)
QmemDescriptor->complete(), QmemDescriptor->release(),
QmemDescriptor = 0;
Now, if you are asking about using the system's DMA engine and not a
bus-master device then I'm less sure. I'd be surprised if it couldn't
handle 4KB (since that's the VM page size) but I have no experience
working with that.