Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/tws/tws.c
Show First 20 Lines • Show All 239 Lines • ▼ Show 20 Lines | |||||
#ifndef TWS_PULL_MODE_ENABLE | #ifndef TWS_PULL_MODE_ENABLE | ||||
sc->mfa_base = (u_int64_t)pci_read_config(dev, TWS_PCI_BAR2, 4); | sc->mfa_base = (u_int64_t)pci_read_config(dev, TWS_PCI_BAR2, 4); | ||||
sc->mfa_base = sc->mfa_base & ~TWS_BIT2; | sc->mfa_base = sc->mfa_base & ~TWS_BIT2; | ||||
TWS_TRACE_DEBUG(sc, "bar2 ", sc->mfa_base, 0); | TWS_TRACE_DEBUG(sc, "bar2 ", sc->mfa_base, 0); | ||||
#endif | #endif | ||||
/* allocate MMIO register space */ | /* allocate MMIO register space */ | ||||
sc->reg_res_id = TWS_PCI_BAR1; /* BAR1 offset */ | sc->reg_res_id = TWS_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) { | ||||
tws_log(sc, ALLOC_MEMORY_RES); | tws_log(sc, ALLOC_MEMORY_RES); | ||||
goto attach_fail_1; | goto attach_fail_1; | ||||
} | } | ||||
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); | ||||
#ifndef TWS_PULL_MODE_ENABLE | #ifndef TWS_PULL_MODE_ENABLE | ||||
▲ Show 20 Lines • Show All 665 Lines • Show Last 20 Lines |