Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mrsas/mrsas.c
Show First 20 Lines • Show All 827 Lines • ▼ Show 20 Lines | mrsas_attach(device_t dev) | ||||
} | } | ||||
/* Force the busmaster enable bit on. */ | /* Force the busmaster enable bit on. */ | ||||
cmd |= PCIM_CMD_BUSMASTEREN; | cmd |= PCIM_CMD_BUSMASTEREN; | ||||
pci_write_config(dev, PCIR_COMMAND, cmd, 2); | pci_write_config(dev, PCIR_COMMAND, cmd, 2); | ||||
bar = pci_read_config(dev, MRSAS_PCI_BAR1, 4); | bar = pci_read_config(dev, MRSAS_PCI_BAR1, 4); | ||||
sc->reg_res_id = MRSAS_PCI_BAR1;/* BAR1 offset */ | sc->reg_res_id = MRSAS_PCI_BAR1;/* BAR1 offset */ | ||||
if ((sc->reg_res = bus_alloc_resource(dev, SYS_RES_MEMORY, | if ((sc->reg_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, | ||||
&(sc->reg_res_id), 0, ~0, 1, RF_ACTIVE)) | &(sc->reg_res_id), RF_ACTIVE)) | ||||
== NULL) { | == NULL) { | ||||
device_printf(dev, "Cannot allocate PCI registers\n"); | device_printf(dev, "Cannot allocate PCI registers\n"); | ||||
goto attach_fail; | goto attach_fail; | ||||
} | } | ||||
sc->bus_tag = rman_get_bustag(sc->reg_res); | sc->bus_tag = rman_get_bustag(sc->reg_res); | ||||
sc->bus_handle = rman_get_bushandle(sc->reg_res); | sc->bus_handle = rman_get_bushandle(sc->reg_res); | ||||
/* Intialize mutexes */ | /* Intialize mutexes */ | ||||
▲ Show 20 Lines • Show All 3,306 Lines • Show Last 20 Lines |