We have developed a kernel mode driver to control the boards that have also developed by our company. The board is an audio switch matrix that uses the ISA bus. It is also able to use DMA transfers by using the hardware of a computer. The DMA transfers are used to generate and save audio in real time by using the driver that we designed following the CommonBuffer Slave DMA model.
We use the following parameters to call HalGetAdapter:
DmaDescription.Version = DEVICE_DESCRIPTION_VERSION1;
DmaDescription.Master = FALSE;
DmaDescription.ScatterGather = FALSE;
DmaDescription.DemandMode = TRUE;
DmaDescription.AutoInitialize = TRUE;
DmaDescription.IgnoreCount = FALSE;
DmaDescription.Dma32BitAddresses = FALSE;
DmaDescription.InterfaceType = Isa;
DmaDescription.BusNumber = 0;
DmaDescription.DmaChannel = 0, 1, 6 or 7;
DmaDescription.MaximumLength = CommonBufferSize;
DmaDescription.DmaWidth = Width8Bits or Width16Bits;
DmaDescription.DmaSpeed = MaximumDmaSpeed;
AdapterObject = HalGetAdapter(&DmaDescription, &MaxMapRegisterCount);
Where CommonBuffersize is one of 32, 64 or 128KB.
In order to obtain the necessary memory buffers for the continuous transfer and after obtaining the Adapter Object, we use the HalAllocateCommonBuffer as follows:
DMACommonBuffer = HalAllocateCommonBuffer(AdapterObject, CommonBufferSize, &DMAPA, TRUE or FALSE);
It is there where we find the problems. Although all functions are executed when the driver initialites (in DriverEntry), HalAllocateCommonBuffer always fails for 64KB or 128KB buffers. It also fails for 32 KB buffers in several cases.
This is a big problem for us since our system is supposed to support 2 boards by using DMA simultaneously in different channels. We are now