本文整理汇总了C++中DEVMETHOD函数的典型用法代码示例。如果您正苦于以下问题:C++ DEVMETHOD函数的具体用法?C++ DEVMETHOD怎么用?C++ DEVMETHOD使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DEVMETHOD函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: device_printf
device_printf(dev, "bus_setup_intr() failed! (%d)\n", error);
goto bad;
}
return (0);
bad:
if (eisa_io)
bus_release_resource(dev, SYS_RES_IOPORT, 0, eisa_io);
ep_free(dev);
return (error);
}
static device_method_t ep_eisa_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, ep_eisa_probe),
DEVMETHOD(device_attach, ep_eisa_attach),
DEVMETHOD(device_detach, ep_detach),
DEVMETHOD_END
};
static driver_t ep_eisa_driver = {
"ep",
ep_eisa_methods,
sizeof(struct ep_softc),
};
extern devclass_t ep_devclass;
DRIVER_MODULE(ep, eisa, ep_eisa_driver, ep_devclass, 0, 0);
示例2: usb_bus_mem_free_all
usb_bus_mem_free_all(&sc->sc_dci.sc_bus, NULL);
/* disable clocks */
at91_pmc_clock_disable(sc->sc_iclk);
at91_pmc_clock_disable(sc->sc_fclk);
at91_pmc_clock_disable(sc->sc_mclk);
at91_pmc_clock_deref(sc->sc_fclk);
at91_pmc_clock_deref(sc->sc_iclk);
at91_pmc_clock_deref(sc->sc_mclk);
return (0);
}
static device_method_t at91_udp_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, at91_udp_probe),
DEVMETHOD(device_attach, at91_udp_attach),
DEVMETHOD(device_detach, at91_udp_detach),
DEVMETHOD(device_suspend, bus_generic_suspend),
DEVMETHOD(device_resume, bus_generic_resume),
DEVMETHOD(device_shutdown, bus_generic_shutdown),
DEVMETHOD_END
};
static driver_t at91_udp_driver = {
.name = "at91_udp",
.methods = at91_udp_methods,
.size = sizeof(struct at91_udp_softc),
};
示例3: km_identify
struct km_softc {
struct device *sc_dev;
struct ksensor sc_sensor;
struct ksensordev sc_sensordev;
};
static void km_identify(driver_t *, struct device *);
static int km_probe(struct device *);
static int km_attach(struct device *);
static int km_detach(struct device *);
static void km_refresh(void *);
static device_method_t km_methods[] = {
DEVMETHOD(device_identify, km_identify),
DEVMETHOD(device_probe, km_probe),
DEVMETHOD(device_attach, km_attach),
DEVMETHOD(device_detach, km_detach),
{ NULL, NULL }
};
static driver_t km_driver = {
"km",
km_methods,
sizeof(struct km_softc)
};
static devclass_t km_devclass;
DRIVER_MODULE(km, hostb, km_driver, km_devclass, NULL, NULL);
示例4: ti_mmchs_detach
ti_mmchs_detach(device_t dev)
{
struct ti_mmchs_softc *sc = device_get_softc(dev);
ti_mmchs_hw_fini(dev);
ti_mmchs_deactivate(dev);
ti_sdma_deactivate_channel(sc->sc_dmach_wr);
ti_sdma_deactivate_channel(sc->sc_dmach_rd);
return (0);
}
static device_method_t ti_mmchs_methods[] = {
/* device_if */
DEVMETHOD(device_probe, ti_mmchs_probe),
DEVMETHOD(device_attach, ti_mmchs_attach),
DEVMETHOD(device_detach, ti_mmchs_detach),
/* Bus interface */
DEVMETHOD(bus_read_ivar, ti_mmchs_read_ivar),
DEVMETHOD(bus_write_ivar, ti_mmchs_write_ivar),
/* mmcbr_if - MMC state machine callbacks */
DEVMETHOD(mmcbr_update_ios, ti_mmchs_update_ios),
DEVMETHOD(mmcbr_request, ti_mmchs_request),
DEVMETHOD(mmcbr_get_ro, ti_mmchs_get_ro),
DEVMETHOD(mmcbr_acquire_host, ti_mmchs_acquire_host),
DEVMETHOD(mmcbr_release_host, ti_mmchs_release_host),
{0, 0},
示例5: at91_pmc_clock_deref
clk->pll_min_in = SAM9260_PLL_B_MIN_IN_FREQ; /* 1 MHz */
clk->pll_max_in = SAM9260_PLL_B_MAX_IN_FREQ; /* 5 MHz */
clk->pll_max_in = 2999999; /* ~3 MHz */
clk->pll_min_out = SAM9260_PLL_B_MIN_OUT_FREQ; /* 70 MHz */
clk->pll_max_out = SAM9260_PLL_B_MAX_OUT_FREQ; /* 130 MHz */
clk->pll_mul_shift = SAM9260_PLL_B_MUL_SHIFT;
clk->pll_mul_mask = SAM9260_PLL_B_MUL_MASK;
clk->pll_div_shift = SAM9260_PLL_B_DIV_SHIFT;
clk->pll_div_mask = SAM9260_PLL_B_DIV_MASK;
clk->set_outb = at91_pll_outb;
at91_pmc_clock_deref(clk);
return (0);
}
static device_method_t at91sam9260_methods[] = {
DEVMETHOD(device_probe, at91_probe),
DEVMETHOD(device_attach, at91_attach),
DEVMETHOD(device_identify, at91_identify),
{0, 0},
};
static driver_t at91sam9260_driver = {
"at91sam9260",
at91sam9260_methods,
sizeof(struct at91sam9_softc),
};
static devclass_t at91sam9260_devclass;
DRIVER_MODULE(at91sam9260, atmelarm, at91sam9260_driver, at91sam9260_devclass, 0, 0);
示例6: uart_octeon_probe
#include <mips/cavium/octeon_pcmap_regs.h>
#include <contrib/octeon-sdk/cvmx.h>
#include "uart_if.h"
extern struct uart_class uart_oct16550_class;
static int uart_octeon_probe(device_t dev);
extern struct uart_class octeon_uart_class;
static device_method_t uart_octeon_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, uart_octeon_probe),
DEVMETHOD(device_attach, uart_bus_attach),
DEVMETHOD(device_detach, uart_bus_detach),
{0, 0}
};
static driver_t uart_octeon_driver = {
uart_driver_name,
uart_octeon_methods,
sizeof(struct uart_softc),
};
extern
SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs;
static int
示例7: nexus_set_resource
void *);
static struct resource_list *nexus_get_reslist(device_t dev, device_t child);
static int nexus_set_resource(device_t, device_t, int, int, u_long, u_long);
static int nexus_get_resource(device_t, device_t, int, int, u_long *, u_long *);
static void nexus_delete_resource(device_t, device_t, int, int);
#ifdef DEV_APIC
static int nexus_alloc_msi(device_t pcib, device_t dev, int count, int maxcount, int *irqs);
static int nexus_release_msi(device_t pcib, device_t dev, int count, int *irqs);
static int nexus_alloc_msix(device_t pcib, device_t dev, int *irq);
static int nexus_release_msix(device_t pcib, device_t dev, int irq);
static int nexus_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr, uint32_t *data);
#endif
static device_method_t nexus_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, nexus_probe),
DEVMETHOD(device_attach, nexus_attach),
DEVMETHOD(device_detach, bus_generic_detach),
DEVMETHOD(device_shutdown, bus_generic_shutdown),
DEVMETHOD(device_suspend, bus_generic_suspend),
DEVMETHOD(device_resume, bus_generic_resume),
/* Bus interface */
DEVMETHOD(bus_print_child, nexus_print_child),
DEVMETHOD(bus_add_child, nexus_add_child),
DEVMETHOD(bus_alloc_resource, nexus_alloc_resource),
DEVMETHOD(bus_adjust_resource, nexus_adjust_resource),
DEVMETHOD(bus_release_resource, nexus_release_resource),
DEVMETHOD(bus_activate_resource, nexus_activate_resource),
DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource),
DEVMETHOD(bus_setup_intr, nexus_setup_intr),
示例8: g_modem_timeout
static device_probe_t g_modem_probe;
static device_attach_t g_modem_attach;
static device_detach_t g_modem_detach;
static usb_handle_request_t g_modem_handle_request;
static usb_callback_t g_modem_intr_callback;
static usb_callback_t g_modem_bulk_read_callback;
static usb_callback_t g_modem_bulk_write_callback;
static void g_modem_timeout(void *arg);
static devclass_t g_modem_devclass;
static device_method_t g_modem_methods[] = {
/* USB interface */
DEVMETHOD(usb_handle_request, g_modem_handle_request),
/* Device interface */
DEVMETHOD(device_probe, g_modem_probe),
DEVMETHOD(device_attach, g_modem_attach),
DEVMETHOD(device_detach, g_modem_detach),
DEVMETHOD_END
};
static driver_t g_modem_driver = {
.name = "g_modem",
.methods = g_modem_methods,
.size = sizeof(struct g_modem_softc),
};
示例9: ACPI_SERIAL_DECL
ACPI_HANDLE acpi_lid_handle;
ACPI_SERIAL_DECL(lid, "ACPI lid");
static int acpi_lid_probe(device_t dev);
static int acpi_lid_attach(device_t dev);
static int acpi_lid_suspend(device_t dev);
static int acpi_lid_resume(device_t dev);
static void acpi_lid_notify_status_changed(void *arg);
static void acpi_lid_notify_handler(ACPI_HANDLE h, UINT32 notify,
void *context);
static device_method_t acpi_lid_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, acpi_lid_probe),
DEVMETHOD(device_attach, acpi_lid_attach),
DEVMETHOD(device_suspend, acpi_lid_suspend),
DEVMETHOD(device_resume, acpi_lid_resume),
DEVMETHOD_END
};
static driver_t acpi_lid_driver = {
"acpi_lid",
acpi_lid_methods,
sizeof(struct acpi_lid_softc),
};
static devclass_t acpi_lid_devclass;
DRIVER_MODULE(acpi_lid, acpi, acpi_lid_driver, acpi_lid_devclass, 0, 0);
示例10: i2c_get_node
bus_space_tag_t bst;
};
static phandle_t i2c_get_node(device_t, device_t);
static int i2c_probe(device_t);
static int i2c_attach(device_t);
static int i2c_repeated_start(device_t, u_char, int);
static int i2c_start(device_t, u_char, int);
static int i2c_stop(device_t);
static int i2c_reset(device_t, u_char, u_char, u_char *);
static int i2c_read(device_t, char *, int, int *, int, int);
static int i2c_write(device_t, const char *, int, int *, int);
static device_method_t i2c_methods[] = {
DEVMETHOD(device_probe, i2c_probe),
DEVMETHOD(device_attach, i2c_attach),
/* OFW methods */
DEVMETHOD(ofw_bus_get_node, i2c_get_node),
DEVMETHOD(iicbus_callback, iicbus_null_callback),
DEVMETHOD(iicbus_repeated_start, i2c_repeated_start),
DEVMETHOD(iicbus_start, i2c_start),
DEVMETHOD(iicbus_stop, i2c_stop),
DEVMETHOD(iicbus_reset, i2c_reset),
DEVMETHOD(iicbus_read, i2c_read),
DEVMETHOD(iicbus_write, i2c_write),
DEVMETHOD(iicbus_transfer, iicbus_transfer_gen),
{ 0, 0 }
示例11: bus_setup_intr
bus_setup_intr(dev, irq, INTR_TYPE_CAM|INTR_ENTROPY, NULL, adv_intr,
adv, &ih);
/* Attach sub-devices - always succeeds */
adv_attach(adv);
if (adv_b != NULL)
adv_attach(adv_b);
return 0;
bad:
bus_release_resource(dev, SYS_RES_IOPORT, 0, io);
bus_release_resource(dev, SYS_RES_IRQ, 0, irq);
return -1;
}
static device_method_t adv_eisa_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, adv_eisa_probe),
DEVMETHOD(device_attach, adv_eisa_attach),
{ 0, 0 }
};
static driver_t adv_eisa_driver = {
"adv", adv_eisa_methods, sizeof(struct adv_softc)
};
static devclass_t adv_eisa_devclass;
DRIVER_MODULE(adv, eisa, adv_eisa_driver, adv_eisa_devclass, 0, 0);
MODULE_DEPEND(adv, eisa, 1, 1, 1);
示例12: clkdom_dump
}
#ifdef CLK_DEBUG
clkdom_dump(sc->clkdom);
#endif
free(__DECONST(char *, def.clkdef.name), M_OFWPROP);
free(def.clkdef.parent_names, M_OFWPROP);
return (bus_generic_attach(dev));
fail:
free(__DECONST(char *, def.clkdef.name), M_OFWPROP);
free(def.clkdef.parent_names, M_OFWPROP);
return (rv);
}
static device_method_t clk_fixed_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, clk_fixed_probe),
DEVMETHOD(device_attach, clk_fixed_attach),
DEVMETHOD_END
};
DEFINE_CLASS_0(clk_fixed, clk_fixed_driver, clk_fixed_methods,
sizeof(struct clk_fixed_softc));
static devclass_t clk_fixed_devclass;
EARLY_DRIVER_MODULE(clk_fixed, simplebus, clk_fixed_driver,
clk_fixed_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE);
MODULE_VERSION(clk_fixed, 1);
#endif
示例13: rman_get_bushandle
(bus_space_write_1(rman_get_bustag((reg)), \
rman_get_bushandle((reg)), 0, (val)))
static void ichss_identify(driver_t *driver, device_t parent);
static int ichss_probe(device_t dev);
static int ichss_attach(device_t dev);
static int ichss_detach(device_t dev);
static int ichss_settings(device_t dev, struct cf_setting *sets,
int *count);
static int ichss_set(device_t dev, const struct cf_setting *set);
static int ichss_get(device_t dev, struct cf_setting *set);
static int ichss_type(device_t dev, int *type);
static device_method_t ichss_methods[] = {
/* Device interface */
DEVMETHOD(device_identify, ichss_identify),
DEVMETHOD(device_probe, ichss_probe),
DEVMETHOD(device_attach, ichss_attach),
DEVMETHOD(device_detach, ichss_detach),
/* cpufreq interface */
DEVMETHOD(cpufreq_drv_set, ichss_set),
DEVMETHOD(cpufreq_drv_get, ichss_get),
DEVMETHOD(cpufreq_drv_type, ichss_type),
DEVMETHOD(cpufreq_drv_settings, ichss_settings),
DEVMETHOD_END
};
static driver_t ichss_driver = {
"ichss", ichss_methods, sizeof(struct ichss_softc)
};
static devclass_t ichss_devclass;
示例14: uart_rc32434_probe
#include <dev/uart/uart.h>
#include <dev/uart/uart_bus.h>
#include <dev/uart/uart_cpu.h>
#include <dev/ic/ns16550.h>
#include "uart_if.h"
static int uart_rc32434_probe(device_t dev);
extern struct uart_class uart_rc32434_uart_class;
static device_method_t uart_rc32434_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, uart_rc32434_probe),
DEVMETHOD(device_attach, uart_bus_attach),
DEVMETHOD(device_detach, uart_bus_detach),
{ 0, 0 }
};
static driver_t uart_rc32434_driver = {
uart_driver_name,
uart_rc32434_methods,
sizeof(struct uart_softc),
};
extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs;
static int
uart_rc32434_probe(device_t dev)
示例15: bus_space_read_4
for (i = 0; i < 10; i++) {
reg = bus_space_read_4(sc->bst, sc->bsh, MCT_WRITE_STAT);
if (reg & mask) {
bus_space_write_4(sc->bst, sc->bsh,
MCT_WRITE_STAT, mask);
return (0);
}
cpufunc_nullop();
}
/* NOTREACHED */
panic("Can't enable timer\n");
}
static device_method_t arm_tmr_methods[] = {
DEVMETHOD(device_probe, arm_tmr_probe),
DEVMETHOD(device_attach, arm_tmr_attach),
{ 0, 0 }
};
static driver_t arm_tmr_driver = {
"arch_timer",
arm_tmr_methods,
sizeof(struct arm_tmr_softc),
};
static devclass_t arm_tmr_devclass;
DRIVER_MODULE(arch_timer, simplebus, arm_tmr_driver, arm_tmr_devclass, 0, 0);