Lines Matching refs:bd
260 bdrv_t *bd = (bdrv_t *) b->sys; in cp_led_off() local
267 CP_LOCK (bd); in cp_led_off()
269 CP_UNLOCK (bd); in cp_led_off()
275 bdrv_t *bd = arg; in cp_intr() local
276 cp_board_t *b = bd->board; in cp_intr()
285 CP_LOCK (bd); in cp_intr()
290 CP_UNLOCK (bd); in cp_intr()
300 CP_UNLOCK (bd); in cp_intr()
382 bdrv_t *bd = device_get_softc (dev); in cp_attach() local
401 bd->board = b; in cp_attach()
403 bd->cp_res = bus_alloc_resource (dev, SYS_RES_MEMORY, &rid, in cp_attach()
405 if (! bd->cp_res) { in cp_attach()
411 vbase = (vm_offset_t) rman_get_virtual (bd->cp_res); in cp_attach()
414 mtx_init (&bd->cp_mtx, cp_ln, MTX_NETWORK_LOCK, MTX_DEF|MTX_RECURSE); in cp_attach()
418 bus_release_resource (dev, SYS_RES_MEMORY, PCIR_BAR(0), bd->cp_res); in cp_attach()
424 bd->dmamem.size = sizeof(cp_qbuf_t); in cp_attach()
425 if (! cp_bus_dma_mem_alloc (unit, -1, &bd->dmamem)) { in cp_attach()
430 CP_LOCK (bd); in cp_attach()
431 cp_reset (b, bd->dmamem.virt, bd->dmamem.phys); in cp_attach()
432 CP_UNLOCK (bd); in cp_attach()
435 bd->cp_irq = bus_alloc_resource (dev, SYS_RES_IRQ, &rid, 0, ~0, 1, in cp_attach()
437 if (! bd->cp_irq) { in cp_attach()
441 PCIR_BAR(0), bd->cp_res); in cp_attach()
442 mtx_destroy (&bd->cp_mtx); in cp_attach()
448 error = bus_setup_intr (dev, bd->cp_irq, in cp_attach()
450 NULL, cp_intr, bd, &bd->cp_intrhand); in cp_attach()
454 bus_release_resource (dev, SYS_RES_IRQ, 0, bd->cp_irq); in cp_attach()
456 PCIR_BAR(0), bd->cp_res); in cp_attach()
457 mtx_destroy (&bd->cp_mtx); in cp_attach()
467 d = &bd->channel[c->num]; in cp_attach()
528 CP_LOCK (bd); in cp_attach()
529 b->sys = bd; in cp_attach()
531 CP_UNLOCK (bd); in cp_attach()
538 bdrv_t *bd = device_get_softc (dev); in cp_detach() local
539 cp_board_t *b = bd->board; in cp_detach()
543 KASSERT (mtx_initialized (&bd->cp_mtx), ("cp mutex not initialized")); in cp_detach()
545 CP_LOCK (bd); in cp_detach()
553 CP_UNLOCK (bd); in cp_detach()
581 bus_teardown_intr (dev, bd->cp_irq, bd->cp_intrhand); in cp_detach()
614 CP_UNLOCK (bd); in cp_detach()
616 bus_release_resource (dev, SYS_RES_IRQ, 0, bd->cp_irq); in cp_detach()
617 bus_release_resource (dev, SYS_RES_MEMORY, PCIR_BAR(0), bd->cp_res); in cp_detach()
619 CP_LOCK (bd); in cp_detach()
621 CP_UNLOCK (bd); in cp_detach()
636 cp_bus_dma_mem_free (&bd->dmamem); in cp_detach()
638 mtx_destroy (&bd->cp_mtx); in cp_detach()
646 bdrv_t *bd = d->board->sys; in cp_ifstart() local
648 CP_LOCK (bd); in cp_ifstart()
650 CP_UNLOCK (bd); in cp_ifstart()
680 bdrv_t *bd = d->board->sys; in cp_sioctl() local
704 CP_LOCK (bd); in cp_sioctl()
716 CP_UNLOCK (bd); in cp_sioctl()
851 bdrv_t *bd = d->board->sys; in cp_watchdog_timer() local
853 CP_LOCK (bd); in cp_watchdog_timer()
859 CP_UNLOCK (bd); in cp_watchdog_timer()
982 bdrv_t *bd = d->board->sys; in cp_modem_status() local
987 CP_LOCK (bd); in cp_modem_status()
993 CP_UNLOCK (bd); in cp_modem_status()
1001 bdrv_t *bd = d->board->sys; in cp_ioctl() local
1069 CP_LOCK (bd); in cp_ioctl()
1074 CP_UNLOCK (bd); in cp_ioctl()
1108 CP_LOCK (bd); in cp_ioctl()
1110 CP_UNLOCK (bd); in cp_ioctl()
1232 CP_LOCK (bd); in cp_ioctl()
1234 CP_UNLOCK (bd); in cp_ioctl()
1250 CP_LOCK (bd); in cp_ioctl()
1252 CP_UNLOCK (bd); in cp_ioctl()
1272 CP_LOCK (bd); in cp_ioctl()
1274 CP_UNLOCK (bd); in cp_ioctl()
1294 CP_LOCK (bd); in cp_ioctl()
1296 CP_UNLOCK (bd); in cp_ioctl()
1341 CP_LOCK (bd); in cp_ioctl()
1343 CP_UNLOCK (bd); in cp_ioctl()
1363 CP_LOCK (bd); in cp_ioctl()
1365 CP_UNLOCK (bd); in cp_ioctl()
1385 CP_LOCK (bd); in cp_ioctl()
1387 CP_UNLOCK (bd); in cp_ioctl()
1407 CP_LOCK (bd); in cp_ioctl()
1409 CP_UNLOCK (bd); in cp_ioctl()
1432 CP_LOCK (bd); in cp_ioctl()
1434 CP_UNLOCK (bd); in cp_ioctl()
1454 CP_LOCK (bd); in cp_ioctl()
1456 CP_UNLOCK (bd); in cp_ioctl()
1476 CP_LOCK (bd); in cp_ioctl()
1478 CP_UNLOCK (bd); in cp_ioctl()
1513 CP_LOCK (bd); in cp_ioctl()
1522 CP_UNLOCK (bd); in cp_ioctl()
1542 CP_LOCK (bd); in cp_ioctl()
1544 CP_UNLOCK (bd); in cp_ioctl()
1568 CP_LOCK (bd); in cp_ioctl()
1571 CP_UNLOCK (bd); in cp_ioctl()
1591 CP_LOCK (bd); in cp_ioctl()
1593 CP_UNLOCK (bd); in cp_ioctl()
1613 CP_LOCK (bd); in cp_ioctl()
1615 CP_UNLOCK (bd); in cp_ioctl()
1624 CP_LOCK (bd); in cp_ioctl()
1626 CP_UNLOCK (bd); in cp_ioctl()
1638 CP_LOCK (bd); in cp_ioctl()
1640 CP_UNLOCK (bd); in cp_ioctl()
1651 CP_LOCK (bd); in cp_ioctl()
1653 CP_UNLOCK (bd); in cp_ioctl()
1663 CP_LOCK (bd); in cp_ioctl()
1665 CP_UNLOCK (bd); in cp_ioctl()
1683 CP_LOCK (bd); in cp_ioctl()
1685 CP_UNLOCK (bd); in cp_ioctl()
1708 CP_LOCK (bd); in cp_ioctl()
1710 CP_UNLOCK (bd); in cp_ioctl()
1730 CP_LOCK (bd); in cp_ioctl()
1732 CP_UNLOCK (bd); in cp_ioctl()
1738 CP_LOCK (bd); in cp_ioctl()
1740 CP_UNLOCK (bd); in cp_ioctl()
1746 CP_LOCK (bd); in cp_ioctl()
1748 CP_UNLOCK (bd); in cp_ioctl()
1754 CP_LOCK (bd); in cp_ioctl()
1757 CP_UNLOCK (bd); in cp_ioctl()
1763 CP_LOCK (bd); in cp_ioctl()
1766 CP_UNLOCK (bd); in cp_ioctl()
1772 CP_LOCK (bd); in cp_ioctl()
1775 CP_UNLOCK (bd); in cp_ioctl()
1798 bdrv_t *bd = d->board->sys; in ng_cp_newhook() local
1815 CP_LOCK (bd); in ng_cp_newhook()
1817 CP_UNLOCK (bd); in ng_cp_newhook()
2007 bdrv_t *bd = d->board->sys; in print_chan() local
2050 CP_LOCK (bd); in print_chan()
2052 CP_UNLOCK (bd); in print_chan()
2119 bdrv_t *bd = d->board->sys; in ng_cp_rcvdata() local
2139 CP_LOCK (bd); in ng_cp_rcvdata()
2143 CP_UNLOCK (bd); in ng_cp_rcvdata()
2151 CP_UNLOCK (bd); in ng_cp_rcvdata()
2162 bdrv_t *bd = d->board->sys; in ng_cp_rmnode() local
2164 CP_LOCK (bd); in ng_cp_rmnode()
2166 CP_UNLOCK (bd); in ng_cp_rmnode()
2199 bdrv_t *bd = d->board->sys; in ng_cp_disconnect() local
2201 CP_LOCK (bd); in ng_cp_disconnect()
2203 CP_UNLOCK (bd); in ng_cp_disconnect()