From: v_mirgorodsky on
Hello all,

I have a Windows 2003 Server with 4GB of RAM installed. I have a PCI
board capable of 32 bit transfers only. Whenever I try to allocate the
DMA adapter object using the following statement sequence - it fails.

DEVICE_DESCRIPTION dd = { 0 };
dd.Version = DEVICE_DESCRIPTION_VERSION;
dd.InterfaceType = BusType;
dd.MaximumLength = 16 * 1024 * 1024;
dd.Dma32BitAddresses = TRUE;
dd.Master = TRUE;
dd.ScatterGather = TRUE;
pdc->DmaAdapter = IoGetDmaAdapter(pdc->PhysicalDeviceObject, &dd, &pdc-
>DmaMapRegisters);

IoGetDmaAdapter() returns NULL as a result. Is there any reason for
such a weird behavior?

With best regards,
Vladimir Mirgorodsky
From: Alexander Grigoriev on
With 4GB of RAM, part of it is remapped above 4GB, to provide a window for
the PCI devices.

You request that the maximum transfer size is 16MB, while the HAL has to use
bounce buffers to make sure they are below 4GB. Such large bounce buffers
cannot be provided.

"v_mirgorodsky" <v.mirgorodsky(a)gmail.com> wrote in message
news:eccd0646-828c-4067-a01d-a3df4071b23b(a)m20g2000vbp.googlegroups.com...
> Hello all,
>
> I have a Windows 2003 Server with 4GB of RAM installed. I have a PCI
> board capable of 32 bit transfers only. Whenever I try to allocate the
> DMA adapter object using the following statement sequence - it fails.
>
> DEVICE_DESCRIPTION dd = { 0 };
> dd.Version = DEVICE_DESCRIPTION_VERSION;
> dd.InterfaceType = BusType;
> dd.MaximumLength = 16 * 1024 * 1024;
> dd.Dma32BitAddresses = TRUE;
> dd.Master = TRUE;
> dd.ScatterGather = TRUE;
> pdc->DmaAdapter = IoGetDmaAdapter(pdc->PhysicalDeviceObject, &dd, &pdc-
>>DmaMapRegisters);
>
> IoGetDmaAdapter() returns NULL as a result. Is there any reason for
> such a weird behavior?
>
> With best regards,
> Vladimir Mirgorodsky


From: Tim Roberts on
v_mirgorodsky <v.mirgorodsky(a)gmail.com> wrote:
>
>I have a Windows 2003 Server with 4GB of RAM installed. I have a PCI
>board capable of 32 bit transfers only. Whenever I try to allocate the
>DMA adapter object using the following statement sequence - it fails.
>
>DEVICE_DESCRIPTION dd = { 0 };
>dd.Version = DEVICE_DESCRIPTION_VERSION;
>dd.InterfaceType = BusType;
>dd.MaximumLength = 16 * 1024 * 1024;
>dd.Dma32BitAddresses = TRUE;
>dd.Master = TRUE;
>dd.ScatterGather = TRUE;
>pdc->DmaAdapter = IoGetDmaAdapter(pdc->PhysicalDeviceObject, &dd, &pdc-
>>DmaMapRegisters);
>
>IoGetDmaAdapter() returns NULL as a result. Is there any reason for
>such a weird behavior?

What did you pass in pdc->DmaMapRegisters?
--
Tim Roberts, timr(a)probo.com
Providenza & Boekelheide, Inc.
From: v_mirgorodsky on
Hello Tim,

According to MSDN DmaMapRegisters is purelly output parameter, so I
don't initialize it to any praticular value before call. Since I
initialize all my driver control structa\ure with zeros - it happen to
be zero during call entrance.

> v_mirgorodsky <v.mirgorodsky(a)gmail.com> wrote:
> >
> >I have a Windows 2003 Server with 4GB of RAM installed. I have a PCI
> >board capable of 32 bit transfers only. Whenever I try to allocate the
> >DMA adapter object using the following statement sequence - it fails.
> >
> >DEVICE_DESCRIPTION dd = { 0 };
> >dd.Version = DEVICE_DESCRIPTION_VERSION;
> >dd.InterfaceType = BusType;
> >dd.MaximumLength = 16 * 1024 * 1024;
> >dd.Dma32BitAddresses = TRUE;
> >dd.Master = TRUE;
> >dd.ScatterGather = TRUE;
> >pdc->DmaAdapter = IoGetDmaAdapter(pdc->PhysicalDeviceObject, &dd, &pdc-
> >>DmaMapRegisters);
> >
> >IoGetDmaAdapter() returns NULL as a result. Is there any reason for
> >such a weird behavior?
>
> What did you pass in pdc->DmaMapRegisters?
> --
> Tim Roberts, timr(a)probo.com
> Providenza & Boekelheide, Inc.
From: v_mirgorodsky on
Hello Alexander,

It happens to be the most probable scenario. I'll try to reduce split
the transfer into several smaller ones.

Alexander Grigoriev:
> With 4GB of RAM, part of it is remapped above 4GB, to provide a window for
> the PCI devices.
>
> You request that the maximum transfer size is 16MB, while the HAL has to use
> bounce buffers to make sure they are below 4GB. Such large bounce buffers
> cannot be provided.
>
> "v_mirgorodsky" <v.mirgorodsky(a)gmail.com> wrote in message
> news:eccd0646-828c-4067-a01d-a3df4071b23b(a)m20g2000vbp.googlegroups.com...
> > Hello all,
> >
> > I have a Windows 2003 Server with 4GB of RAM installed. I have a PCI
> > board capable of 32 bit transfers only. Whenever I try to allocate the
> > DMA adapter object using the following statement sequence - it fails.
> >
> > DEVICE_DESCRIPTION dd = { 0 };
> > dd.Version = DEVICE_DESCRIPTION_VERSION;
> > dd.InterfaceType = BusType;
> > dd.MaximumLength = 16 * 1024 * 1024;
> > dd.Dma32BitAddresses = TRUE;
> > dd.Master = TRUE;
> > dd.ScatterGather = TRUE;
> > pdc->DmaAdapter = IoGetDmaAdapter(pdc->PhysicalDeviceObject, &dd, &pdc-
> >>DmaMapRegisters);
> >
> > IoGetDmaAdapter() returns NULL as a result. Is there any reason for
> > such a weird behavior?
> >
> > With best regards,
> > Vladimir Mirgorodsky