hbirr@svn.reactos.com wrote:
- Copy the map registers to the buffer only, if they are used (in IoFlushAdapterBuffers).
- Do not use the byte offset into the page from a given buffer if the map registers are used,
because the caller didn't request for one additional register in the call to IoAllocateAdapterChannel and it will not work for a 64k buffer.
Sorry, but these changes are wrong. I won't argue that there isn't bug, but you're just workarounding it.
- At first, the UseMapRegisters variable you added to MAP_REGISTER_ENTRY structure isn't needed. IoFlushAdapterBuffers can determine the information itself and the case was clearly marked as UNIMPLEMENTED and FIXME. - The byte offset is added for a reason. I know the stuff that it is supposed to solve is broken atm, but the rationale is that there can be more IoMapTransfer calls and together with MAP_REGISTER_ENTRY->Counter you can setup more transfers... It's explained in http://download.microsoft.com/download/e/b/a/eba1050f-a31d-436b-9281-92cdfea....
I certainly welcome any help and review of the DMA code and I'll try to add comments where appropriate, but I would like to discuss these changes first on the Mailing List / IRC / mail since this piece of code is pretty complex and any changes are prone to break some feature...
- Filip