DMA Problem

OK. A bunch of single-page allocations are no problem for scatter/gather
DMA hardware. But how do I coalesce the virtual addresses for all these
allocations into a single linear block the driver can access with
READ/WRITE_xxxx_BUFFER_ULONG? I can see how I might be able to do this with
MmAllocateMappingAddress and MmMapLockedPagesWithReservedMapping. Is that
the recommended approach? What about on Windows 2000 platforms?

-Dan

----- Original Message -----

Subject: RE: DMA Problem
From: “Roddy, Mark”
> Date: Mon, 25 Oct 2004 12:52:36 -0400
> X-Message-Number: 11
>
>
> I think that perhaps if you are a boot start unloadable driver the single
> allocation is a good idea while if you are dynamically loadable and in
> particular not a boot start driver then the 33-one page allocations might
> have a better chance of success.
>
>
>
> =====================
> Mark Roddy
>
>
>
>
> _____
>
> From: Andreas Hansson [mailto:xxxxx@briljant.se]
> Sent: Monday, October 25, 2004 12:29 PM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] DMA Problem
>
>
> The Windows 2000 DDK said:
>
> If a driver needs several pages of common buffer space, but the pages need
> not be contiguous, the driver should make several one-page requests to
> AllocateCommonBuffer instead of one large request. This approach conserves
> contiguous memory.
>
> Sounds like the reverse of what you’re saying?
>
> Andreas
>
>
> ----- Original Message -----
> From: Maxim S. mailto:xxxxx Shatskih
> To: Windows System Software Devs Interest mailto:xxxxx
> List
>
> Sent: Wednesday, October 20, 2004 9:59 PM
> Subject: Re: [ntdev] DMA Problem
>
>
> Please allocate 1 common buffer of 33 pages in size. Allocating lots of
> common buffers is a very bad idea.
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com mailto:xxxxx
> http://www.storagecraft.com http:</http:></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx>

You wouldn’t - you’d break your READ/WRITE* into buffer sized chunks and
transfer each one individually.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Daniel
E. Germann
Sent: Tuesday, October 26, 2004 5:37 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] DMA Problem

OK. A bunch of single-page allocations are no problem for
scatter/gather DMA hardware. But how do I coalesce the
virtual addresses for all these allocations into a single
linear block the driver can access with
READ/WRITE_xxxx_BUFFER_ULONG? I can see how I might be able
to do this with MmAllocateMappingAddress and
MmMapLockedPagesWithReservedMapping. Is that the recommended
approach? What about on Windows 2000 platforms?

-Dan

----- Original Message -----
> Subject: RE: DMA Problem
> From: “Roddy, Mark”
> > Date: Mon, 25 Oct 2004 12:52:36 -0400
> > X-Message-Number: 11
> >
> >
> > I think that perhaps if you are a boot start unloadable
> driver the single
> > allocation is a good idea while if you are dynamically
> loadable and in
> > particular not a boot start driver then the 33-one page
> allocations might
> > have a better chance of success.
> >
> >
> >
> > =====================
> > Mark Roddy
> >
> >
> >
> >
> > _____
> >
> > From: Andreas Hansson [mailto:xxxxx@briljant.se]
> > Sent: Monday, October 25, 2004 12:29 PM
> > To: Windows System Software Devs Interest List
> > Subject: Re: [ntdev] DMA Problem
> >
> >
> > The Windows 2000 DDK said:
> >
> > If a driver needs several pages of common buffer space, but
> the pages need
> > not be contiguous, the driver should make several one-page
> requests to
> > AllocateCommonBuffer instead of one large request. This
> approach conserves
> > contiguous memory.
> >
> > Sounds like the reverse of what you’re saying?
> >
> > Andreas
> >
> >
> > ----- Original Message -----
> > From: Maxim S. mailto:xxxxx Shatskih
> > To: Windows System Software Devs Interest
> mailto:xxxxx
> > List
> >
> > Sent: Wednesday, October 20, 2004 9:59 PM
> > Subject: Re: [ntdev] DMA Problem
> >
> >
> > Please allocate 1 common buffer of 33 pages in size.
> Allocating lots of
> > common buffers is a very bad idea.
> >
> > Maxim Shatskih, Windows DDK MVP
> > StorageCraft Corporation
> > xxxxx@storagecraft.com mailto:xxxxx
> > http://www.storagecraft.com http:
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as:
> xxxxx@windows.microsoft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
></http:></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx>