本文整理汇总了C++中rman_get_rid函数的典型用法代码示例。如果您正苦于以下问题:C++ rman_get_rid函数的具体用法?C++ rman_get_rid怎么用?C++ rman_get_rid使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rman_get_rid函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rtwn_pci_detach
static int
rtwn_pci_detach(device_t dev)
{
struct rtwn_pci_softc *pc = device_get_softc(dev);
struct rtwn_softc *sc = &pc->pc_sc;
int i;
/* Generic detach. */
rtwn_detach(sc);
/* Uninstall interrupt handler. */
if (pc->irq != NULL) {
bus_teardown_intr(dev, pc->irq, pc->pc_ih);
bus_release_resource(dev, SYS_RES_IRQ, rman_get_rid(pc->irq),
pc->irq);
pci_release_msi(dev);
}
/* Free Tx/Rx buffers. */
for (i = 0; i < RTWN_PCI_NTXQUEUES; i++)
rtwn_pci_free_tx_list(sc, i);
rtwn_pci_free_rx_list(sc);
if (pc->mem != NULL)
bus_release_resource(dev, SYS_RES_MEMORY,
rman_get_rid(pc->mem), pc->mem);
rtwn_detach_private(sc);
mtx_destroy(&sc->sc_mtx);
return (0);
}
示例2: zy7_devcfg_detach
static int
zy7_devcfg_detach(device_t dev)
{
struct zy7_devcfg_softc *sc = device_get_softc(dev);
if (device_is_attached(dev))
bus_generic_detach(dev);
/* Get rid of /dev/devcfg0. */
if (sc->sc_ctl_dev != NULL)
destroy_dev(sc->sc_ctl_dev);
/* Teardown and release interrupt. */
if (sc->irq_res != NULL) {
if (sc->intrhandle)
bus_teardown_intr(dev, sc->irq_res, sc->intrhandle);
bus_release_resource(dev, SYS_RES_IRQ,
rman_get_rid(sc->irq_res), sc->irq_res);
}
/* Release memory resource. */
if (sc->mem_res != NULL)
bus_release_resource(dev, SYS_RES_MEMORY,
rman_get_rid(sc->mem_res), sc->mem_res);
zy7_devcfg_softc_p = NULL;
DEVCFG_SC_LOCK_DESTROY(sc);
return (0);
}
示例3: at91_spi_deactivate
static void
at91_spi_deactivate(device_t dev)
{
struct at91_spi_softc *sc;
int i;
sc = device_get_softc(dev);
bus_generic_detach(dev);
for (i = 0; i < 4; i++)
if (sc->map[i])
bus_dmamap_destroy(sc->dmatag, sc->map[i]);
if (sc->dmatag)
bus_dma_tag_destroy(sc->dmatag);
if (sc->intrhand)
bus_teardown_intr(dev, sc->irq_res, sc->intrhand);
sc->intrhand = NULL;
if (sc->irq_res)
bus_release_resource(dev, SYS_RES_IRQ,
rman_get_rid(sc->irq_res), sc->irq_res);
sc->irq_res = NULL;
if (sc->mem_res)
bus_release_resource(dev, SYS_RES_MEMORY,
rman_get_rid(sc->mem_res), sc->mem_res);
sc->mem_res = NULL;
}
示例4: sata_detach
static int
sata_detach(device_t dev)
{
struct sata_softc *sc;
sc = device_get_softc(dev);
if (device_is_attached(dev))
bus_generic_detach(dev);
if (sc->sc_mem_res != NULL) {
bus_release_resource(dev, SYS_RES_MEMORY,
rman_get_rid(sc->sc_mem_res), sc->sc_mem_res);
sc->sc_mem_res = NULL;
}
if (sc->sc_irq_res != NULL) {
bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_irq_cookiep);
bus_release_resource(dev, SYS_RES_IRQ,
rman_get_rid(sc->sc_irq_res), sc->sc_irq_res);
sc->sc_irq_res = NULL;
}
return (0);
}
示例5: mpt_free_bus_resources
/*
* Free bus resources
*/
static void
mpt_free_bus_resources(struct mpt_softc *mpt)
{
if (mpt->ih) {
bus_teardown_intr(mpt->dev, mpt->pci_irq, mpt->ih);
mpt->ih = NULL;
}
if (mpt->pci_irq) {
bus_release_resource(mpt->dev, SYS_RES_IRQ,
rman_get_rid(mpt->pci_irq), mpt->pci_irq);
mpt->pci_irq = NULL;
}
if (mpt->pci_msi_count) {
pci_release_msi(mpt->dev);
mpt->pci_msi_count = 0;
}
if (mpt->pci_pio_reg) {
bus_release_resource(mpt->dev, SYS_RES_IOPORT,
rman_get_rid(mpt->pci_pio_reg), mpt->pci_pio_reg);
mpt->pci_pio_reg = NULL;
}
if (mpt->pci_reg) {
bus_release_resource(mpt->dev, SYS_RES_MEMORY,
rman_get_rid(mpt->pci_reg), mpt->pci_reg);
mpt->pci_reg = NULL;
}
MPT_LOCK_DESTROY(mpt);
}
示例6: zy7_ehci_detach
static int
zy7_ehci_detach(device_t dev)
{
ehci_softc_t *sc = device_get_softc(dev);
/* during module unload there are lots of children leftover */
device_delete_children(dev);
sc->sc_flags &= ~EHCI_SCFLG_DONEINIT;
if (sc->sc_irq_res && sc->sc_intr_hdl)
/* call ehci_detach() after ehci_init() called after
* successful bus_setup_intr().
*/
ehci_detach(sc);
if (sc->sc_irq_res) {
if (sc->sc_intr_hdl != NULL)
bus_teardown_intr(dev, sc->sc_irq_res,
sc->sc_intr_hdl);
bus_release_resource(dev, SYS_RES_IRQ,
rman_get_rid(sc->sc_irq_res), sc->sc_irq_res);
}
if (sc->sc_io_res)
bus_release_resource(dev, SYS_RES_MEMORY,
rman_get_rid(sc->sc_io_res), sc->sc_io_res);
usb_bus_mem_free_all(&sc->sc_bus, &ehci_iterate_hw_softc);
return (0);
}
示例7: le_isa_detach
static int
le_isa_detach(device_t dev)
{
struct le_isa_softc *lesc;
struct lance_softc *sc;
lesc = device_get_softc(dev);
sc = &lesc->sc_am7990.lsc;
bus_teardown_intr(dev, lesc->sc_ires, lesc->sc_ih);
am7990_detach(&lesc->sc_am7990);
bus_dmamap_unload(lesc->sc_dmat, lesc->sc_dmam);
bus_dmamem_free(lesc->sc_dmat, sc->sc_mem, lesc->sc_dmam);
bus_dma_tag_destroy(lesc->sc_dmat);
bus_dma_tag_destroy(lesc->sc_pdmat);
bus_release_resource(dev, SYS_RES_IRQ,
rman_get_rid(lesc->sc_ires), lesc->sc_ires);
bus_release_resource(dev, SYS_RES_DRQ,
rman_get_rid(lesc->sc_dres), lesc->sc_dres);
bus_release_resource(dev, SYS_RES_IOPORT,
rman_get_rid(lesc->sc_rres), lesc->sc_rres);
LE_LOCK_DESTROY(sc);
return (0);
}
示例8: xhci_detach
static int
xhci_detach(device_t dev)
{
struct xhci_softc *sc = device_get_softc(dev);
int err;
/* during module unload there are lots of children leftover */
device_delete_children(dev);
if (sc->sc_irq_res != NULL && sc->sc_intr_hdl != NULL) {
err = bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_intr_hdl);
if (err != 0)
device_printf(dev, "Could not tear down irq, %d\n",
err);
sc->sc_intr_hdl = NULL;
}
if (sc->sc_irq_res != NULL) {
bus_release_resource(dev, SYS_RES_IRQ,
rman_get_rid(sc->sc_irq_res), sc->sc_irq_res);
sc->sc_irq_res = NULL;
}
if (sc->sc_io_res != NULL) {
bus_release_resource(dev, SYS_RES_MEMORY,
rman_get_rid(sc->sc_io_res), sc->sc_io_res);
sc->sc_io_res = NULL;
}
xhci_uninit(sc);
return (0);
}
示例9: ti_mmchs_deactivate
/**
* ti_mmchs_deactivate - deactivates the driver
* @dev: mmc device handle
*
* Unmaps the register set and releases the IRQ resource.
*
* LOCKING:
* None required
*
* RETURNS:
* nothing
*/
static void
ti_mmchs_deactivate(device_t dev)
{
struct ti_mmchs_softc *sc= device_get_softc(dev);
/* Remove the IRQ handler */
if (sc->sc_irq_h != NULL) {
bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_irq_h);
sc->sc_irq_h = NULL;
}
/* Do the generic detach */
bus_generic_detach(sc->sc_dev);
/* Deactivate the DMA channels */
ti_sdma_deactivate_channel(sc->sc_dmach_rd);
ti_sdma_deactivate_channel(sc->sc_dmach_wr);
/* Unmap the MMC controller registers */
if (sc->sc_mem_res != 0) {
bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(sc->sc_irq_res),
sc->sc_mem_res);
sc->sc_mem_res = NULL;
}
/* Release the IRQ resource */
if (sc->sc_irq_res != NULL) {
bus_release_resource(dev, SYS_RES_IRQ, rman_get_rid(sc->sc_irq_res),
sc->sc_irq_res);
sc->sc_irq_res = NULL;
}
return;
}
示例10: le_dma_detach
static int
le_dma_detach(device_t dev)
{
struct le_dma_softc *lesc;
struct lance_softc *sc;
int error;
lesc = device_get_softc(dev);
sc = &lesc->sc_am7990.lsc;
bus_teardown_intr(dev, lesc->sc_ires, lesc->sc_ih);
am7990_detach(&lesc->sc_am7990);
bus_dmamap_unload(lesc->sc_dmat, lesc->sc_dmam);
bus_dmamem_free(lesc->sc_dmat, sc->sc_mem, lesc->sc_dmam);
bus_dma_tag_destroy(lesc->sc_dmat);
error = lsi64854_detach(lesc->sc_dma);
if (error != 0)
return (error);
bus_release_resource(dev, SYS_RES_IRQ, rman_get_rid(lesc->sc_ires),
lesc->sc_ires);
bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(lesc->sc_rres),
lesc->sc_rres);
LE_LOCK_DESTROY(sc);
return (0);
}
示例11: at91_rtc_deactivate
static void
at91_rtc_deactivate(device_t dev)
{
struct at91_rtc_softc *sc;
sc = device_get_softc(dev);
#ifdef AT91_RTC_USE_INTERRUPTS
WR4(sc, RTC_IDR, 0xffffffff);
if (sc->intrhand)
bus_teardown_intr(dev, sc->irq_res, sc->intrhand);
sc->intrhand = 0;
#endif
bus_generic_detach(sc->dev);
if (sc->mem_res)
bus_release_resource(dev, SYS_RES_MEMORY,
rman_get_rid(sc->mem_res), sc->mem_res);
sc->mem_res = 0;
#ifdef AT91_RTC_USE_INTERRUPTS
if (sc->irq_res)
bus_release_resource(dev, SYS_RES_IRQ,
rman_get_rid(sc->irq_res), sc->irq_res);
sc->irq_res = 0;
#endif
return;
}
示例12: simplebus_setup_intr
static int
simplebus_setup_intr(device_t bus, device_t child, struct resource *res,
int flags, driver_filter_t *filter, driver_intr_t *ihand, void *arg,
void **cookiep)
{
struct simplebus_devinfo *di;
enum intr_trigger trig;
enum intr_polarity pol;
int error, rid;
di = device_get_ivars(child);
if (di == NULL)
return (ENXIO);
if (res == NULL)
return (EINVAL);
rid = rman_get_rid(res);
if (rid >= DI_MAX_INTR_NUM)
return (ENOENT);
trig = di->di_intr_sl[rid].trig;
pol = di->di_intr_sl[rid].pol;
if (trig != INTR_TRIGGER_CONFORM || pol != INTR_POLARITY_CONFORM) {
error = bus_generic_config_intr(bus, rman_get_start(res),
trig, pol);
if (error)
return (error);
}
error = bus_generic_setup_intr(bus, child, res, flags, filter, ihand,
arg, cookiep);
return (error);
}
示例13: nicvf_detach
static int
nicvf_detach(device_t dev)
{
struct nicvf *nic;
nic = device_get_softc(dev);
NICVF_CORE_LOCK(nic);
/* Shut down the port and release ring resources */
nicvf_stop_locked(nic);
/* Release stats lock */
mtx_destroy(&nic->stats_mtx);
/* Release interrupts */
nicvf_release_all_interrupts(nic);
/* Release memory resource */
if (nic->reg_base != NULL) {
bus_release_resource(dev, SYS_RES_MEMORY,
rman_get_rid(nic->reg_base), nic->reg_base);
}
/* Remove all ifmedia configurations */
ifmedia_removeall(&nic->if_media);
/* Free this ifnet */
if_free(nic->ifp);
NICVF_CORE_UNLOCK(nic);
/* Finally destroy the lock */
NICVF_CORE_LOCK_DESTROY(nic);
return (0);
}
示例14: le_isa_probe_legacy
static int
le_isa_probe_legacy(device_t dev, const struct le_isa_param *leip)
{
struct le_isa_softc *lesc;
struct lance_softc *sc;
int error, i;
lesc = device_get_softc(dev);
sc = &lesc->sc_am7990.lsc;
i = 0;
lesc->sc_rres = bus_alloc_resource(dev, SYS_RES_IOPORT, &i, 0, ~0,
leip->iosize, RF_ACTIVE);
if (lesc->sc_rres == NULL)
return (ENXIO);
lesc->sc_rap = leip->rap;
lesc->sc_rdp = leip->rdp;
/* Stop the chip and put it in a known state. */
le_isa_wrcsr(sc, LE_CSR0, LE_C0_STOP);
DELAY(100);
if (le_isa_rdcsr(sc, LE_CSR0) != LE_C0_STOP) {
error = ENXIO;
goto fail;
}
le_isa_wrcsr(sc, LE_CSR3, 0);
error = 0;
fail:
bus_release_resource(dev, SYS_RES_IOPORT,
rman_get_rid(lesc->sc_rres), lesc->sc_rres);
return (error);
}
示例15: hme_pci_detach
static int
hme_pci_detach(device_t dev)
{
struct hme_pci_softc *hsc;
struct hme_softc *sc;
hsc = device_get_softc(dev);
sc = &hsc->hsc_hme;
bus_teardown_intr(dev, hsc->hsc_ires, hsc->hsc_ih);
hme_detach(sc);
bus_release_resource(dev, SYS_RES_IRQ,
rman_get_rid(hsc->hsc_ires), hsc->hsc_ires);
bus_release_resource(dev, SYS_RES_MEMORY,
rman_get_rid(hsc->hsc_sres), hsc->hsc_sres);
mtx_destroy(&sc->sc_lock);
return (0);
}