Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/ctau/if_ct.c
Show First 20 Lines • Show All 311 Lines • ▼ Show 20 Lines | |||||
static short porttab [] = { | static short porttab [] = { | ||||
0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0, | 0x200, 0x220, 0x240, 0x260, 0x280, 0x2a0, 0x2c0, 0x2e0, | ||||
0x300, 0x320, 0x340, 0x360, 0x380, 0x3a0, 0x3c0, 0x3e0, 0 | 0x300, 0x320, 0x340, 0x360, 0x380, 0x3a0, 0x3c0, 0x3e0, 0 | ||||
}; | }; | ||||
static char dmatab [] = { 7, 6, 5, 0 }; | static char dmatab [] = { 7, 6, 5, 0 }; | ||||
static char irqtab [] = { 5, 10, 11, 7, 3, 15, 12, 0 }; | static char irqtab [] = { 5, 10, 11, 7, 3, 15, 12, 0 }; | ||||
static int ct_is_free_res (device_t dev, int rid, int type, u_long start, | static int ct_is_free_res (device_t dev, int rid, int type, rman_res_t start, | ||||
u_long end, u_long count) | rman_res_t end, rman_res_t count) | ||||
{ | { | ||||
struct resource *res; | struct resource *res; | ||||
if (!(res = bus_alloc_resource (dev, type, &rid, start, end, count, 0))) | if (!(res = bus_alloc_resource (dev, type, &rid, start, end, count, 0))) | ||||
return 0; | return 0; | ||||
bus_release_resource (dev, type, rid, res); | bus_release_resource (dev, type, rid, res); | ||||
return 1; | return 1; | ||||
} | } | ||||
static void ct_identify (driver_t *driver, device_t dev) | static void ct_identify (driver_t *driver, device_t dev) | ||||
{ | { | ||||
u_long iobase, rescount; | rman_res_t iobase, rescount; | ||||
int devcount; | int devcount; | ||||
device_t *devices; | device_t *devices; | ||||
device_t child; | device_t child; | ||||
devclass_t my_devclass; | devclass_t my_devclass; | ||||
int i, k; | int i, k; | ||||
if ((my_devclass = devclass_find ("ct")) == NULL) | if ((my_devclass = devclass_find ("ct")) == NULL) | ||||
return; | return; | ||||
▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | static void ct_identify (driver_t *driver, device_t dev) | ||||
} | } | ||||
return; | return; | ||||
} | } | ||||
static int ct_probe (device_t dev) | static int ct_probe (device_t dev) | ||||
{ | { | ||||
int unit = device_get_unit (dev); | int unit = device_get_unit (dev); | ||||
u_long iobase, rescount; | rman_res_t iobase, rescount; | ||||
if (!device_get_desc (dev) || | if (!device_get_desc (dev) || | ||||
strcmp (device_get_desc (dev), "Cronyx Tau-ISA")) | strcmp (device_get_desc (dev), "Cronyx Tau-ISA")) | ||||
return ENXIO; | return ENXIO; | ||||
/* KASSERT ((bd != NULL), ("ct%d: NULL device softc\n", unit));*/ | /* KASSERT ((bd != NULL), ("ct%d: NULL device softc\n", unit));*/ | ||||
if (bus_get_resource (dev, SYS_RES_IOPORT, 0, &iobase, &rescount) != 0) { | if (bus_get_resource (dev, SYS_RES_IOPORT, 0, &iobase, &rescount) != 0) { | ||||
printf ("ct%d: Couldn't get IOPORT\n", unit); | printf ("ct%d: Couldn't get IOPORT\n", unit); | ||||
▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
/* | /* | ||||
* The adapter is present, initialize the driver structures. | * The adapter is present, initialize the driver structures. | ||||
*/ | */ | ||||
static int ct_attach (device_t dev) | static int ct_attach (device_t dev) | ||||
{ | { | ||||
bdrv_t *bd = device_get_softc (dev); | bdrv_t *bd = device_get_softc (dev); | ||||
u_long iobase, drq, irq, rescount; | rman_res_t iobase, drq, irq, rescount; | ||||
int unit = device_get_unit (dev); | int unit = device_get_unit (dev); | ||||
char *ct_ln = CT_LOCK_NAME; | char *ct_ln = CT_LOCK_NAME; | ||||
ct_board_t *b; | ct_board_t *b; | ||||
ct_chan_t *c; | ct_chan_t *c; | ||||
drv_t *d; | drv_t *d; | ||||
int i; | int i; | ||||
int s; | int s; | ||||
▲ Show 20 Lines • Show All 1,666 Lines • Show Last 20 Lines |