本文整理汇总了C++中device_set_desc_copy函数的典型用法代码示例。如果您正苦于以下问题:C++ device_set_desc_copy函数的具体用法?C++ device_set_desc_copy怎么用?C++ device_set_desc_copy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了device_set_desc_copy函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ata_avila_probe
static int
ata_avila_probe(device_t dev)
{
struct ixp425_softc *sa = device_get_softc(device_get_parent(dev));
/* XXX any way to check? */
if (EXP_BUS_READ_4(sa, EXP_TIMING_CS2_OFFSET) != 0)
device_set_desc_copy(dev, "Gateworks Avila IDE/CF Controller");
else
device_set_desc_copy(dev,
"ADI Pronghorn Metro IDE/CF Controller");
return 0;
}
开发者ID:oza,项目名称:FreeBSD-7.3-dyntick,代码行数:13,代码来源:avila_ata.c
示例2: vtpci_probe
static int
vtpci_probe(device_t dev)
{
char desc[36];
const char *name;
if (pci_get_vendor(dev) != VIRTIO_PCI_VENDORID)
return (ENXIO);
if (pci_get_device(dev) < VIRTIO_PCI_DEVICEID_MIN ||
pci_get_device(dev) > VIRTIO_PCI_DEVICEID_MAX)
return (ENXIO);
if (pci_get_revid(dev) != VIRTIO_PCI_ABI_VERSION)
return (ENXIO);
name = virtio_device_name(pci_get_subdevice(dev));
if (name == NULL)
name = "Unknown";
snprintf(desc, sizeof(desc), "VirtIO PCI %s adapter", name);
device_set_desc_copy(dev, desc);
return (BUS_PROBE_DEFAULT);
}
开发者ID:2asoft,项目名称:freebsd,代码行数:25,代码来源:virtio_pci.c
示例3: ahci_em_probe
static int
ahci_em_probe(device_t dev)
{
device_set_desc_copy(dev, "AHCI enclosure management bridge");
return (0);
}
开发者ID:ele7enxxh,项目名称:dtrace-pf,代码行数:7,代码来源:ahciem.c
示例4: ata_jmicron_probe
/*
* JMicron chipset support functions
*/
static int
ata_jmicron_probe(device_t dev)
{
struct ata_pci_controller *ctlr = device_get_softc(dev);
const struct ata_chip_id *idx;
static const struct ata_chip_id ids[] =
{{ ATA_JMB360, 0, 1, 0, ATA_SA300, "JMB360" },
{ ATA_JMB361, 0, 1, 1, ATA_UDMA6, "JMB361" },
{ ATA_JMB362, 0, 2, 0, ATA_SA300, "JMB362" },
{ ATA_JMB363, 0, 2, 1, ATA_UDMA6, "JMB363" },
{ ATA_JMB365, 0, 1, 2, ATA_UDMA6, "JMB365" },
{ ATA_JMB366, 0, 2, 2, ATA_UDMA6, "JMB366" },
{ ATA_JMB368, 0, 0, 1, ATA_UDMA6, "JMB368" },
{ ATA_JMB368_2, 0, 0, 1, ATA_UDMA6, "JMB368" },
{ 0, 0, 0, 0, 0, 0}};
char buffer[64];
if (pci_get_vendor(dev) != ATA_JMICRON_ID)
return ENXIO;
if (!(idx = ata_match_chip(dev, ids)))
return ENXIO;
sprintf(buffer, "JMicron %s %s controller",
idx->text, ata_mode2str(idx->max_dma));
device_set_desc_copy(dev, buffer);
ctlr->chip = idx;
ctlr->chipinit = ata_jmicron_chipinit;
return (BUS_PROBE_LOW_PRIORITY);
}
开发者ID:coyizumi,项目名称:cs111,代码行数:33,代码来源:ata-jmicron.c
示例5: mvs_probe
static int
mvs_probe(device_t dev)
{
char buf[64];
int i;
uint32_t devid, revid;
if (!ofw_bus_status_okay(dev))
return (ENXIO);
if (!ofw_bus_is_compatible(dev, "mrvl,sata"))
return (ENXIO);
soc_id(&devid, &revid);
for (i = 0; mvs_ids[i].id != 0; i++) {
if (mvs_ids[i].id == devid &&
mvs_ids[i].rev <= revid) {
snprintf(buf, sizeof(buf), "%s SATA controller",
mvs_ids[i].name);
device_set_desc_copy(dev, buf);
return (BUS_PROBE_VENDOR);
}
}
return (ENXIO);
}
开发者ID:ChristosKa,项目名称:freebsd,代码行数:25,代码来源:mvs_soc.c
示例6: ichwd_identify
/*
* Look for an ICH LPC interface bridge. If one is found, register an
* ichwd device. There can be only one.
*/
static void
ichwd_identify(driver_t *driver, device_t parent)
{
struct ichwd_device *id_p;
device_t ich = NULL;
device_t dev;
uint32_t rcba;
int rc;
ich = ichwd_find_ich_lpc_bridge(&id_p);
if (ich == NULL)
return;
/* good, add child to bus */
if ((dev = device_find_child(parent, driver->name, 0)) == NULL)
dev = BUS_ADD_CHILD(parent, 0, driver->name, 0);
if (dev == NULL)
return;
device_set_desc_copy(dev, id_p->desc);
if (id_p->version >= 6) {
/* get RCBA (root complex base address) */
rcba = pci_read_config(ich, ICH_RCBA, 4);
rc = bus_set_resource(ich, SYS_RES_MEMORY, 0,
(rcba & 0xffffc000) + ICH_GCS_OFFSET, ICH_GCS_SIZE);
if (rc)
ichwd_verbose_printf(dev,
"Can not set memory resource for RCBA\n");
}
}
开发者ID:JabirTech,项目名称:Source,代码行数:36,代码来源:ichwd.c
示例7: ata_cbuschannel_probe
static int
ata_cbuschannel_probe(device_t dev)
{
char buffer[32];
sprintf(buffer, "ATA channel %d", (int)(intptr_t)device_get_ivars(dev));
device_set_desc_copy(dev, buffer);
return ata_probe(dev);
}
开发者ID:hmatyschok,项目名称:MeshBSD,代码行数:10,代码来源:ata-cbus.c
示例8: ata_set_desc
void
ata_set_desc(device_t dev)
{
struct ata_pci_controller *ctlr = device_get_softc(dev);
char buffer[128];
sprintf(buffer, "%s %s %s controller",
ata_pcivendor2str(dev), ctlr->chip->text,
ata_mode2str(ctlr->chip->max_dma));
device_set_desc_copy(dev, buffer);
}
开发者ID:coyizumi,项目名称:cs111,代码行数:11,代码来源:ata-pci.c
示例9: lebuffer_probe
static int
lebuffer_probe(device_t dev)
{
const char *name;
name = ofw_bus_get_name(dev);
if (strcmp(name, "lebuffer") == 0) {
device_set_desc_copy(dev, name);
return (0);
}
return (ENXIO);
}
开发者ID:SayCV,项目名称:rtems-libbsdport,代码行数:12,代码来源:lebuffer_sbus.c
示例10: tegra_ahci_probe
static int
tegra_ahci_probe(device_t dev)
{
if (!ofw_bus_status_okay(dev))
return (ENXIO);
if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data)
return (ENXIO);
device_set_desc_copy(dev, "AHCI SATA controller");
return (BUS_PROBE_DEFAULT);
}
开发者ID:jaredmcneill,项目名称:freebsd,代码行数:13,代码来源:tegra_ahci.c
示例11: dma_probe
static int
dma_probe(device_t dev)
{
const char *name;
name = ofw_bus_get_name(dev);
if (strcmp(name, "espdma") == 0 || strcmp(name, "dma") == 0 ||
strcmp(name, "ledma") == 0) {
device_set_desc_copy(dev, name);
return (0);
}
return (ENXIO);
}
开发者ID:DangerDexter,项目名称:FreeBSD-8.0-dyntick,代码行数:13,代码来源:dma_sbus.c
示例12: acpi_fujitsu_probe
static int
acpi_fujitsu_probe(device_t dev)
{
char *name;
char buffer[64];
name = ACPI_ID_PROBE(device_get_parent(dev), dev, fujitsu_ids);
if (acpi_disabled("fujitsu") || name == NULL ||
device_get_unit(dev) > 1)
return (ENXIO);
sprintf(buffer, "Fujitsu Function Hotkeys %s", name);
device_set_desc_copy(dev, buffer);
return (0);
}
开发者ID:2asoft,项目名称:freebsd,代码行数:16,代码来源:acpi_fujitsu.c
示例13: sfxge_vpd_init
static int
sfxge_vpd_init(struct sfxge_softc *sc)
{
struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->dev);
struct sysctl_oid *vpd_node;
struct sysctl_oid_list *vpd_list;
char keyword[3];
efx_vpd_value_t value;
int rc;
if ((rc = efx_vpd_size(sc->enp, &sc->vpd_size)) != 0)
goto fail;
sc->vpd_data = malloc(sc->vpd_size, M_SFXGE, M_WAITOK);
if ((rc = efx_vpd_read(sc->enp, sc->vpd_data, sc->vpd_size)) != 0)
goto fail2;
/* Copy ID (product name) into device description, and log it. */
value.evv_tag = EFX_VPD_ID;
if (efx_vpd_get(sc->enp, sc->vpd_data, sc->vpd_size, &value) == 0) {
value.evv_value[value.evv_length] = 0;
device_set_desc_copy(sc->dev, value.evv_value);
device_printf(sc->dev, "%s\n", value.evv_value);
}
vpd_node = SYSCTL_ADD_NODE(
ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)),
OID_AUTO, "vpd", CTLFLAG_RD, NULL, "Vital Product Data");
vpd_list = SYSCTL_CHILDREN(vpd_node);
/* Add sysctls for all expected and any vendor-defined keywords. */
sfxge_vpd_try_add(sc, vpd_list, EFX_VPD_RO, "PN");
sfxge_vpd_try_add(sc, vpd_list, EFX_VPD_RO, "EC");
sfxge_vpd_try_add(sc, vpd_list, EFX_VPD_RO, "SN");
keyword[0] = 'V';
keyword[2] = 0;
for (keyword[1] = '0'; keyword[1] <= '9'; keyword[1]++)
sfxge_vpd_try_add(sc, vpd_list, EFX_VPD_RO, keyword);
for (keyword[1] = 'A'; keyword[1] <= 'Z'; keyword[1]++)
sfxge_vpd_try_add(sc, vpd_list, EFX_VPD_RO, keyword);
return 0;
fail2:
free(sc->vpd_data, M_SFXGE);
fail:
return rc;
}
开发者ID:AhmadTux,项目名称:freebsd,代码行数:47,代码来源:sfxge.c
示例14: ahci_fdt_probe
static int
ahci_fdt_probe(device_t dev)
{
struct ahci_controller *ctlr = device_get_softc(dev);
phandle_t node;
if (!ofw_bus_status_okay(dev))
return (ENXIO);
if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data)
return (ENXIO);
device_set_desc_copy(dev, "AHCI SATA controller");
node = ofw_bus_get_node(dev);
ctlr->dma_coherent = OF_hasprop(node, "dma-coherent");
return (BUS_PROBE_DEFAULT);
}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:17,代码来源:ahci_generic.c
示例15: thunder_pem_probe
static int
thunder_pem_probe(device_t dev)
{
uint16_t pci_vendor_id;
uint16_t pci_device_id;
pci_vendor_id = pci_get_vendor(dev);
pci_device_id = pci_get_device(dev);
if ((pci_vendor_id == THUNDER_PEM_VENDOR_ID) &&
(pci_device_id == THUNDER_PEM_DEVICE_ID)) {
device_set_desc_copy(dev, THUNDER_PEM_DESC);
return (0);
}
return (ENXIO);
}
开发者ID:tomtor,项目名称:freebsd,代码行数:17,代码来源:thunder_pcie_pem.c
示例16: ahci_acpi_probe
static int
ahci_acpi_probe(device_t dev)
{
ACPI_HANDLE h;
if ((h = acpi_get_handle(dev)) == NULL)
return (ENXIO);
if (pci_get_class(dev) == PCIC_STORAGE &&
pci_get_subclass(dev) == PCIS_STORAGE_SATA &&
pci_get_progif(dev) == PCIP_STORAGE_SATA_AHCI_1_0) {
device_set_desc_copy(dev, "AHCI SATA controller");
return (BUS_PROBE_DEFAULT);
}
return (ENXIO);
}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:17,代码来源:ahci_generic.c
示例17: ata_pci_probe
/*
* generic PCI ATA device probe
*/
int
ata_pci_probe(device_t dev)
{
struct ata_pci_controller *ctlr = device_get_softc(dev);
char buffer[64];
/* is this a storage class device ? */
if (pci_get_class(dev) != PCIC_STORAGE)
return (ENXIO);
/* is this an IDE/ATA type device ? */
if (pci_get_subclass(dev) != PCIS_STORAGE_IDE)
return (ENXIO);
sprintf(buffer, "%s ATA controller", ata_pcivendor2str(dev));
device_set_desc_copy(dev, buffer);
ctlr->chipinit = ata_generic_chipinit;
/* we are a low priority handler */
return (BUS_PROBE_GENERIC);
}
开发者ID:coyizumi,项目名称:cs111,代码行数:24,代码来源:ata-pci.c
示例18: acpi_timer_attach
static int
acpi_timer_attach(device_t dev)
{
char desc[40];
int i, j;
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
/*
* If all tests of the counter succeed, use the ACPI-fast method. If
* at least one failed, default to using the safe routine, which reads
* the timer multiple times to get a consistent value before returning.
*/
j = 0;
for (i = 0; i < 10; i++)
j += acpi_timer_test();
if (j == 10) {
if (acpi_timer_resolution == 32) {
acpi_cputimer.name = "ACPI-fast";
acpi_cputimer.count = acpi_timer_get_timecount;
} else {
acpi_cputimer.name = "ACPI-fast24";
acpi_cputimer.count = acpi_timer_get_timecount24;
}
} else {
if (acpi_timer_resolution == 32)
acpi_cputimer.name = "ACPI-safe";
else
acpi_cputimer.name = "ACPI-safe24";
acpi_cputimer.count = acpi_timer_get_timecount_safe;
}
ksprintf(desc, "%u-bit timer at 3.579545MHz", acpi_timer_resolution);
device_set_desc_copy(dev, desc);
cputimer_register(&acpi_cputimer);
cputimer_select(&acpi_cputimer, 0);
return (0);
}
开发者ID:wan721,项目名称:DragonFlyBSD,代码行数:40,代码来源:acpi_timer.c
示例19: ixl_probe
static int
ixl_probe(device_t dev)
{
ixl_vendor_info_t *ent;
u16 pci_vendor_id, pci_device_id;
u16 pci_subvendor_id, pci_subdevice_id;
char device_name[256];
#if 0
INIT_DEBUGOUT("ixl_probe: begin");
#endif
pci_vendor_id = pci_get_vendor(dev);
if (pci_vendor_id != I40E_INTEL_VENDOR_ID)
return (ENXIO);
pci_device_id = pci_get_device(dev);
pci_subvendor_id = pci_get_subvendor(dev);
pci_subdevice_id = pci_get_subdevice(dev);
ent = ixl_vendor_info_array;
while (ent->vendor_id != 0) {
if ((pci_vendor_id == ent->vendor_id) &&
(pci_device_id == ent->device_id) &&
((pci_subvendor_id == ent->subvendor_id) ||
(ent->subvendor_id == 0)) &&
((pci_subdevice_id == ent->subdevice_id) ||
(ent->subdevice_id == 0))) {
sprintf(device_name, "%s, Version - %s",
ixl_strings[ent->index],
ixl_driver_version);
device_set_desc_copy(dev, device_name);
return (BUS_PROBE_DEFAULT);
}
ent++;
}
return (ENXIO);
}
开发者ID:derekmarcotte,项目名称:freebsd,代码行数:40,代码来源:if_ixl.c
示例20: bhnd_pmu_chipc_probe
static int
bhnd_pmu_chipc_probe(device_t dev)
{
struct bhnd_pmu_softc *sc;
struct chipc_caps *ccaps;
struct chipc_softc *chipc_sc;
device_t chipc;
char desc[34];
int error;
uint32_t pcaps;
uint8_t rev;
sc = device_get_softc(dev);
/* Look for chipc parent */
chipc = device_get_parent(dev);
if (device_get_devclass(chipc) != devclass_find("bhnd_chipc"))
return (ENXIO);
/* Check the chipc PMU capability flag. */
ccaps = BHND_CHIPC_GET_CAPS(chipc);
if (!ccaps->pmu)
return (ENXIO);
/* Delegate to common driver implementation */
if ((error = bhnd_pmu_probe(dev)) > 0)
return (error);
/* Fetch PMU capability flags */
chipc_sc = device_get_softc(chipc);
pcaps = bhnd_bus_read_4(chipc_sc->core, BHND_PMU_CAP);
/* Set description */
rev = BHND_PMU_GET_BITS(pcaps, BHND_PMU_CAP_REV);
snprintf(desc, sizeof(desc), "Broadcom ChipCommon PMU, rev %hhu", rev);
device_set_desc_copy(dev, desc);
return (BUS_PROBE_NOWILDCARD);
}
开发者ID:2trill2spill,项目名称:freebsd,代码行数:39,代码来源:bhnd_pmu_chipc.c
注:本文中的device_set_desc_copy函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论