mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 18:05:46 +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
|
* NDIS_STATUS_FAILURE: a general failure has occured
|
||||||
* NOTES:
|
* NOTES:
|
||||||
* - Must be called at IRQL = PASSIVE_LEVEL
|
* - 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();
|
PAGED_CODE();
|
||||||
ASSERT(VirtualAddress && MiniportAdapterHandle);
|
ASSERT(VirtualAddress && MiniportAdapterHandle);
|
||||||
|
|
||||||
NDIS_DbgPrint(MAX_TRACE, ("Called\n"));
|
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) {
|
if(!*VirtualAddress) {
|
||||||
NDIS_DbgPrint(MIN_TRACE, ("MmMapIoSpace failed\n"));
|
NDIS_DbgPrint(MIN_TRACE, ("MmMapIoSpace failed\n"));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue