freebsd_network: Enable memory mapped io and ioport access.

Cofirmed to fix #15016, #15052.
Potentially fixes #14576, #14546, #14298, #14265, #13840.

Change-Id: I27b0bb6692c23aedbdddc70aff9349c713703dd4
Reviewed-on: https://review.haiku-os.org/c/1497
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Bruno Albuquerque
2019-05-31 17:02:48 +00:00
committed by waddlesplash
parent 7c2135591b
commit 8c76ab00c4
+8
View File
@@ -137,6 +137,10 @@ bus_alloc_mem_resource(device_t dev, struct resource *res, int regid)
// TODO: check flags & PCI_address_prefetchable ?
// enable this I/O resource
if (pci_enable_io(dev, SYS_RES_MEMORY) != 0)
return -1;
void *virtualAddr;
res->r_mapped_area = map_mem(&virtualAddr, addr, size, 0,
@@ -153,6 +157,10 @@ bus_alloc_mem_resource(device_t dev, struct resource *res, int regid)
static int
bus_alloc_ioport_resource(device_t dev, struct resource *res, int regid)
{
// enable this I/O resource
if (pci_enable_io(dev, SYS_RES_IOPORT) != 0)
return -1;
res->r_bustag = X86_BUS_SPACE_IO;
res->r_bushandle = pci_read_config(dev, regid, 4) & PCI_address_io_mask;
return 0;