Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ctau/if_ct.c
Context not available. | |||||
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; | ||||
Context not available. | |||||
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; | ||||
Context not available. | |||||
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")) | ||||
Context not available. | |||||
} | } | ||||
if (!ct_probe_board (iobase, -1, -1)) { | if (!ct_probe_board (iobase, -1, -1)) { | ||||
printf ("ct%d: probing for Tau-ISA at %lx faild\n", unit, iobase); | printf ("ct%d: probing for Tau-ISA at %jx faild\n", unit, iobase); | ||||
return ENXIO; | return ENXIO; | ||||
} | } | ||||
Context not available. | |||||
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; | ||||
Context not available. | |||||
ct_ln[2] = '0' + unit; | ct_ln[2] = '0' + unit; | ||||
mtx_init (&bd->ct_mtx, ct_ln, MTX_NETWORK_LOCK, MTX_DEF|MTX_RECURSE); | mtx_init (&bd->ct_mtx, ct_ln, MTX_NETWORK_LOCK, MTX_DEF|MTX_RECURSE); | ||||
if (! probe_irq (b, irq)) { | if (! probe_irq (b, irq)) { | ||||
printf ("ct%d: irq %ld not functional\n", unit, irq); | printf ("ct%d: irq %jd not functional\n", unit, irq); | ||||
bd->board = 0; | bd->board = 0; | ||||
adapter [unit] = 0; | adapter [unit] = 0; | ||||
free (b, M_DEVBUF); | free (b, M_DEVBUF); | ||||
Context not available. | |||||
if (bus_setup_intr (dev, bd->irq_res, | if (bus_setup_intr (dev, bd->irq_res, | ||||
INTR_TYPE_NET|INTR_MPSAFE, | INTR_TYPE_NET|INTR_MPSAFE, | ||||
NULL, ct_intr, bd, &bd->intrhand)) { | NULL, ct_intr, bd, &bd->intrhand)) { | ||||
printf ("ct%d: Can't setup irq %ld\n", unit, irq); | printf ("ct%d: Can't setup irq %jd\n", unit, irq); | ||||
bd->board = 0; | bd->board = 0; | ||||
adapter [unit] = 0; | adapter [unit] = 0; | ||||
free (b, M_DEVBUF); | free (b, M_DEVBUF); | ||||
Context not available. |