Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/snc/if_snc_cbus.c
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
{ 0, NULL } | { 0, NULL } | ||||
}; | }; | ||||
static void | static void | ||||
snc_isapnp_reconfig(device_t dev) | snc_isapnp_reconfig(device_t dev) | ||||
{ | { | ||||
struct isa_device *idev = DEVTOISA(dev); | struct isa_device *idev = DEVTOISA(dev); | ||||
struct isa_config config; | struct isa_config config; | ||||
u_long start, count; | rman_res_t start, count; | ||||
int rid; | int rid; | ||||
bzero(&config, sizeof(config)); | bzero(&config, sizeof(config)); | ||||
for (rid = 0; rid < ISA_NMEM; rid++) { | for (rid = 0; rid < ISA_NMEM; rid++) { | ||||
if (bus_get_resource(dev, SYS_RES_MEMORY, rid, &start, &count)) | if (bus_get_resource(dev, SYS_RES_MEMORY, rid, &start, &count)) | ||||
break; | break; | ||||
config.ic_mem[rid].ir_start = start; | config.ic_mem[rid].ir_start = start; | ||||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | |||||
int port; | int port; | ||||
int rid = 0; | int rid = 0; | ||||
struct resource *res = NULL; | struct resource *res = NULL; | ||||
for (port = 0x0888; port <= 0x3888; port += 0x1000) { | for (port = 0x0888; port <= 0x3888; port += 0x1000) { | ||||
bus_set_resource(dev, SYS_RES_IOPORT, rid, | bus_set_resource(dev, SYS_RES_IOPORT, rid, | ||||
port, SNEC_NREGS); | port, SNEC_NREGS); | ||||
res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, | res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, | ||||
0ul, ~0ul, SNEC_NREGS, | 0, ~0, SNEC_NREGS, | ||||
0 /* !RF_ACTIVE */); | 0 /* !RF_ACTIVE */); | ||||
if (res) break; | if (res) break; | ||||
} | } | ||||
printf("snc_isa_probe: broken PnP resource, "); | printf("snc_isa_probe: broken PnP resource, "); | ||||
if (res) { | if (res) { | ||||
printf("use port 0x%x\n", port); | printf("use port 0x%x\n", port); | ||||
bus_release_resource(dev, SYS_RES_IOPORT, rid, res); | bus_release_resource(dev, SYS_RES_IOPORT, rid, res); | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |