mirror of
https://github.com/reactos/reactos.git
synced 2025-04-25 16:10:29 +00:00
- Translate the raw address before attempting to map it
svn path=/trunk/; revision=40776
This commit is contained in:
parent
5852b28a2b
commit
1d7714cac8
1 changed files with 12 additions and 5 deletions
|
@ -613,18 +613,25 @@ NdisMMapIoSpace(
|
|||
* NDIS_STATUS_FAILURE: a general failure has occured
|
||||
* NOTES:
|
||||
* - Must be called at IRQL = PASSIVE_LEVEL
|
||||
* BUGS:
|
||||
* - Only supports things that MmMapIoSpace internally supports - what
|
||||
* about considering bus type, etc?
|
||||
* - doesn't track resources allocated...
|
||||
*/
|
||||
{
|
||||
PLOGICAL_ADAPTER Adapter = MiniportAdapterHandle;
|
||||
ULONG AddressSpace = 0; /* Memory Space */
|
||||
NDIS_PHYSICAL_ADDRESS TranslatedAddress;
|
||||
|
||||
PAGED_CODE();
|
||||
ASSERT(VirtualAddress && MiniportAdapterHandle);
|
||||
|
||||
NDIS_DbgPrint(MAX_TRACE, ("Called\n"));
|
||||
|
||||
*VirtualAddress = MmMapIoSpace(PhysicalAddress, Length, MmNonCached);
|
||||
if(!HalTranslateBusAddress(Adapter->NdisMiniportBlock.BusType, Adapter->NdisMiniportBlock.BusNumber,
|
||||
PhysicalAddress, &AddressSpace, &TranslatedAddress))
|
||||
{
|
||||
NDIS_DbgPrint(MIN_TRACE, ("Unable to translate address\n"));
|
||||
return NDIS_STATUS_RESOURCES;
|
||||
}
|
||||
|
||||
*VirtualAddress = MmMapIoSpace(TranslatedAddress, Length, MmNonCached);
|
||||
|
||||
if(!*VirtualAddress) {
|
||||
NDIS_DbgPrint(MIN_TRACE, ("MmMapIoSpace failed\n"));
|
||||
|
|
Loading…
Reference in a new issue