本文整理汇总了C++中device_set_desc_copy函数的典型用法代码示例。如果您正苦于以下问题:C++ device_set_desc_copy函数的具体用法?C++ device_set_desc_copy怎么用?C++ device_set_desc_copy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了device_set_desc_copy函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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);
}
示例3: ahci_em_probe
static int
ahci_em_probe(device_t dev)
{
device_set_desc_copy(dev, "AHCI enclosure management bridge");
return (0);
}
示例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);
}
示例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);
}
示例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");
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}