mirror of
https://github.com/reactos/reactos.git
synced 2025-04-27 09:00:27 +00:00
- DmaSize is NDIS_DMA_SIZE not BOOLEAN
- DmaWidth and DmaSpeed aren't used for bus-master DMA svn path=/trunk/; revision=40110
This commit is contained in:
parent
ac73f877b3
commit
b2490d5d64
1 changed files with 10 additions and 30 deletions
|
@ -240,7 +240,7 @@ EXPORT
|
||||||
NdisMAllocateMapRegisters(
|
NdisMAllocateMapRegisters(
|
||||||
IN NDIS_HANDLE MiniportAdapterHandle,
|
IN NDIS_HANDLE MiniportAdapterHandle,
|
||||||
IN UINT DmaChannel,
|
IN UINT DmaChannel,
|
||||||
IN BOOLEAN DmaSize,
|
IN NDIS_DMA_SIZE DmaSize,
|
||||||
IN ULONG BaseMapRegistersNeeded,
|
IN ULONG BaseMapRegistersNeeded,
|
||||||
IN ULONG MaximumBufferSize)
|
IN ULONG MaximumBufferSize)
|
||||||
/*
|
/*
|
||||||
|
@ -293,9 +293,8 @@ NdisMAllocateMapRegisters(
|
||||||
ASSERT(Adapter);
|
ASSERT(Adapter);
|
||||||
|
|
||||||
/* only bus masters may call this routine */
|
/* only bus masters may call this routine */
|
||||||
ASSERT(Adapter->NdisMiniportBlock.Flags & NDIS_ATTRIBUTE_BUS_MASTER);
|
|
||||||
if(!(Adapter->NdisMiniportBlock.Flags & NDIS_ATTRIBUTE_BUS_MASTER))
|
if(!(Adapter->NdisMiniportBlock.Flags & NDIS_ATTRIBUTE_BUS_MASTER))
|
||||||
return NDIS_STATUS_SUCCESS;
|
return NDIS_STATUS_NOT_SUPPORTED;
|
||||||
|
|
||||||
DeviceObject = Adapter->NdisMiniportBlock.DeviceObject;
|
DeviceObject = Adapter->NdisMiniportBlock.DeviceObject;
|
||||||
|
|
||||||
|
@ -319,34 +318,15 @@ NdisMAllocateMapRegisters(
|
||||||
Description.Version = DEVICE_DESCRIPTION_VERSION;
|
Description.Version = DEVICE_DESCRIPTION_VERSION;
|
||||||
Description.Master = TRUE; /* implied by calling this function */
|
Description.Master = TRUE; /* implied by calling this function */
|
||||||
Description.ScatterGather = TRUE; /* XXX UNTRUE: All BM DMA are S/G (ms seems to do this) */
|
Description.ScatterGather = TRUE; /* XXX UNTRUE: All BM DMA are S/G (ms seems to do this) */
|
||||||
Description.Dma32BitAddresses = DmaSize;
|
|
||||||
Description.BusNumber = Adapter->NdisMiniportBlock.BusNumber;
|
Description.BusNumber = Adapter->NdisMiniportBlock.BusNumber;
|
||||||
Description.InterfaceType = Adapter->NdisMiniportBlock.BusType;
|
Description.InterfaceType = Adapter->NdisMiniportBlock.BusType;
|
||||||
Description.DmaChannel = DmaChannel;
|
Description.DmaChannel = DmaChannel;
|
||||||
Description.MaximumLength = MaximumBufferSize;
|
Description.MaximumLength = MaximumBufferSize;
|
||||||
|
|
||||||
if(Adapter->NdisMiniportBlock.AdapterType == Isa)
|
|
||||||
{
|
|
||||||
/* system dma */
|
|
||||||
if(DmaChannel < 4)
|
|
||||||
Description.DmaWidth = Width8Bits;
|
|
||||||
else
|
|
||||||
Description.DmaWidth = Width16Bits;
|
|
||||||
|
|
||||||
Description.DmaSpeed = Compatible;
|
|
||||||
}
|
|
||||||
else if(Adapter->NdisMiniportBlock.AdapterType == PCIBus)
|
|
||||||
{
|
|
||||||
if(DmaSize == NDIS_DMA_64BITS)
|
if(DmaSize == NDIS_DMA_64BITS)
|
||||||
Description.Dma64BitAddresses = TRUE;
|
Description.Dma64BitAddresses = TRUE;
|
||||||
else
|
else
|
||||||
Description.Dma32BitAddresses = TRUE;
|
Description.Dma32BitAddresses = TRUE;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
NDIS_DbgPrint(MIN_TRACE, ("Unsupported bus type\n"));
|
|
||||||
ASSERT(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
AdapterObject = IoGetDmaAdapter(
|
AdapterObject = IoGetDmaAdapter(
|
||||||
Adapter->NdisMiniportBlock.PhysicalDeviceObject, &Description, &AvailableMapRegisters);
|
Adapter->NdisMiniportBlock.PhysicalDeviceObject, &Description, &AvailableMapRegisters);
|
||||||
|
|
Loading…
Reference in a new issue