• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ ISA_PNP_PROBE函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ISA_PNP_PROBE函数的典型用法代码示例。如果您正苦于以下问题:C++ ISA_PNP_PROBE函数的具体用法?C++ ISA_PNP_PROBE怎么用?C++ ISA_PNP_PROBE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ISA_PNP_PROBE函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ata_isa_probe

static int
ata_isa_probe(device_t dev)
{
    struct ata_channel *ch = device_get_softc(dev);
    struct resource *io;
    u_long tmp;
    int rid;

    /* check isapnp ids */
    if (ISA_PNP_PROBE(device_get_parent(dev), dev, ata_ids) == ENXIO)
	return ENXIO;
    
    /* allocate the io port range to get the start address */
    rid = ATA_IOADDR_RID;
    io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0,
			    ATA_IOSIZE, RF_ACTIVE);
    if (!io)
	return ENOMEM;

    /* set the altport range */
    if (bus_get_resource(dev, SYS_RES_IOPORT, ATA_ALTADDR_RID, &tmp, &tmp)) {
	bus_set_resource(dev, SYS_RES_IOPORT, ATA_ALTADDR_RID,
			 rman_get_start(io) + ATA_ALTOFFSET, ATA_ALTIOSIZE);
    }

    bus_release_resource(dev, SYS_RES_IOPORT, rid, io);
    ch->unit = 0;
    ch->flags |= ATA_USE_16BIT;
    return ata_probe(dev);
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:30,代码来源:ata-isa.c


示例2: sbni_probe_isa

static int
sbni_probe_isa(device_t dev)
{
    struct sbni_softc *sc;
    int error;

    error = ISA_PNP_PROBE(device_get_parent(dev), dev, sbni_ids);
    if (error && error != ENOENT)
        return (error);

    sc = device_get_softc(dev);

    sc->io_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->io_rid,
                                    0ul, ~0ul, SBNI_PORTS, RF_ACTIVE);
    if (!sc->io_res) {
        printf("sbni: cannot allocate io ports!\n");
        return (ENOENT);
    }

    if (sbni_probe(sc) != 0) {
        sbni_release_resources(sc);
        return (ENXIO);
    }

    device_set_desc(dev, "Granch SBNI12/ISA adapter");
    return (0);
}
开发者ID:DangerDexter,项目名称:FreeBSD-8.0-dyntick,代码行数:27,代码来源:if_sbni_isa.c


示例3: sbni_probe_isa

static int
sbni_probe_isa(device_t dev)
{
	struct sbni_softc *sc;
	int error;

	error = ISA_PNP_PROBE(device_get_parent(dev), dev, sbni_ids);
	if (error && error != ENOENT)
		return (error);

	sc = device_get_softc(dev);
	bzero(sc, sizeof(struct sbni_softc));

 	sc->io_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->io_rid,
					0ul, ~0ul, SBNI_PORTS, RF_ACTIVE);
	if (!sc->io_res) {
		printf("sbni: cannot allocate io ports!\n");
		return (ENOENT);
	}

	sc->base_addr = rman_get_start(sc->io_res);
	if (sbni_probe(sc) != 0) {
		bus_release_resource(dev, SYS_RES_IOPORT,
				     sc->io_rid, sc->io_res);
		return (ENXIO);
	}

	device_quiet(dev);
	return (0);
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:30,代码来源:if_sbni_isa.c


示例4: cs_isa_probe

/*
 * Determine if the device is present
 */
static int
cs_isa_probe(device_t dev)
{
	int error = 0;

	/* Check isapnp ids */
	error = ISA_PNP_PROBE(device_get_parent(dev), dev, cs_ids);

	/* If the card had a PnP ID that didn't match any we know about */
	if (error == ENXIO)
                goto end;

        /* If we had some other problem. */
        if (!(error == 0 || error == ENOENT))
                goto end;

	error = cs_cs89x0_probe(dev);
end:
	/* Make sure IRQ is assigned for probe message and available */
	if (error == 0)
                error = cs_alloc_irq(dev, 0, 0);

        cs_release_resources(dev);
        return (error);
}
开发者ID:UnitedMarsupials,项目名称:kame,代码行数:28,代码来源:if_cs_isa.c


示例5: sbc_probe

static int
sbc_probe(device_t dev)
{
	char *s = NULL;
	u_int32_t lid, vid;

	lid = isa_get_logicalid(dev);
	vid = isa_get_vendorid(dev);
	if (lid) {
		if (lid == 0x01000000 && vid != 0x01009305) /* ALS0001 */
			return ENXIO;
		/* Check pnp ids */
		return ISA_PNP_PROBE(device_get_parent(dev), dev, sbc_ids);
	} else {
		int rid = 0, ver;
	    	struct resource *io;

#ifdef PC98
		io = isa_alloc_resourcev(dev, SYS_RES_IOPORT, &rid,
					 pcm_iat, 16, RF_ACTIVE);
#else
		io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid,
		  		    	0, ~0, 16, RF_ACTIVE);
#endif
		if (!io) goto bad;
#ifdef PC98
		isa_load_resourcev(io, pcm_iat, 16);
#endif
    		if (sb_reset_dsp(io)) goto bad2;
		ver = sb_identify_board(io);
		if (ver == 0) goto bad2;
		switch ((ver & 0x00000f00) >> 8) {
		case 1:
			device_set_desc(dev, "SoundBlaster 1.0 (not supported)");
			s = NULL;
			break;

		case 2:
			s = "SoundBlaster 2.0";
			break;

		case 3:
			s = (ver & 0x0000f000)? "ESS 488" : "SoundBlaster Pro";
			break;

		case 4:
			s = "SoundBlaster 16";
			break;

		case 5:
			s = (ver & 0x00000008)? "ESS 688" : "ESS 1688";
			break;
	     	}
		if (s) device_set_desc(dev, s);
bad2:		bus_release_resource(dev, SYS_RES_IOPORT, rid, io);
bad:		return s? 0 : ENXIO;
	}
}
开发者ID:edgar-pek,项目名称:PerspicuOS,代码行数:58,代码来源:sbc.c


示例6: rtc_isa_probe

static int
rtc_isa_probe(device_t dev)
{

	if (ISA_PNP_PROBE(device_get_parent(dev), dev, rtc_isa_ids) == 0)
		return (0);

	return (ENXIO);
}
开发者ID:dcui,项目名称:FreeBSD-9.3_kernel,代码行数:9,代码来源:rtc.c


示例7: gusc_probe

static int
gusc_probe(device_t dev)
{
	device_t child;
	u_int32_t logical_id;
	char *s;
	struct sndcard_func *func;
	int ret;

	logical_id = isa_get_logicalid(dev);
	s = NULL;

	/* Check isapnp ids */
	if (logical_id != 0 && (ret = ISA_PNP_PROBE(device_get_parent(dev), dev, gusc_ids)) != 0)
		return (ret);
	else {
		if (logical_id == 0)
			return gusisa_probe(dev);
	}

	switch (logical_id) {
	case LOGICALID_PCM:
		s = "Gravis UltraSound Plug & Play PCM";
		func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO);
		if (func == NULL)
			return (ENOMEM);
		func->func = SCF_PCM;
		child = device_add_child(dev, "pcm", -1);
		device_set_ivars(child, func);
		break;
	case LOGICALID_OPL:
		s = "Gravis UltraSound Plug & Play OPL";
		func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO);
		if (func == NULL)
			return (ENOMEM);
		func->func = SCF_SYNTH;
		child = device_add_child(dev, "midi", -1);
		device_set_ivars(child, func);
		break;
	case LOGICALID_MIDI:
		s = "Gravis UltraSound Plug & Play MIDI";
		func = malloc(sizeof(struct sndcard_func), M_DEVBUF, M_NOWAIT | M_ZERO);
		if (func == NULL)
			return (ENOMEM);
		func->func = SCF_MIDI;
		child = device_add_child(dev, "midi", -1);
		device_set_ivars(child, func);
		break;
	}

	if (s != NULL) {
		device_set_desc(dev, s);
		return (0);
	}

	return (ENXIO);
}
开发者ID:ele7enxxh,项目名称:dtrace-pf,代码行数:57,代码来源:gusc.c


示例8: sysresource_probe

static int
sysresource_probe(device_t dev)
{
	int	result;
	
	if ((result = ISA_PNP_PROBE(device_get_parent(dev), dev, sysresource_ids)) <= 0) {
		device_quiet(dev);
	}
	return(result);
}
开发者ID:MarginC,项目名称:kame,代码行数:10,代码来源:nexus.c


示例9: pmtimer_probe

static int
pmtimer_probe(device_t dev)
{

	if (ISA_PNP_PROBE(device_get_parent(dev), dev, pmtimer_ids) == ENXIO)
		return (ENXIO);

	/* only one instance always */
	return (device_get_unit(dev));
}
开发者ID:JabirTech,项目名称:Source,代码行数:10,代码来源:pmtimer.c


示例10: atrtc_probe

static int
atrtc_probe(device_t dev)
{
	int result;
	
	device_set_desc(dev, "AT Real Time Clock");
	result = ISA_PNP_PROBE(device_get_parent(dev), dev, atrtc_ids);
	/* ENXIO if wrong PnP-ID, ENOENT ifno PnP-ID, zero if good PnP-iD */
	if (result != ENOENT)
		return(result);
	/* All PC's have an RTC, and we're hosed without it, so... */
	return (BUS_PROBE_LOW_PRIORITY);
}
开发者ID:DangerDexter,项目名称:FreeBSD-8.0-dyntick,代码行数:13,代码来源:atrtc.c


示例11: aic_isa_probe

static int
aic_isa_probe(device_t dev)
{
	struct aic_isa_softc *sc = device_get_softc(dev);
	struct aic_softc *aic = &sc->sc_aic;
	int numports, i;
	u_int port, *ports;
	u_int8_t porta;

	if (ISA_PNP_PROBE(device_get_parent(dev), dev, aic_ids) == ENXIO)
		return (ENXIO);

	port = isa_get_port(dev);
	if (port != -1) {
		ports = &port;
		numports = 1;
	} else {
		ports = aic_isa_ports;
		numports = AIC_ISA_NUMPORTS;
	}

	for (i = 0; i < numports; i++) {
		if (bus_set_resource(dev, SYS_RES_IOPORT, 0, ports[i],
				     AIC_ISA_PORTSIZE, -1))
			continue;
		if (aic_isa_alloc_resources(dev))
			continue;
		if (!aic_probe(aic)) {
			aic_isa_release_resources(dev);
			break;
		}
		aic_isa_release_resources(dev);
	}

	if (i == numports)
		return (ENXIO);

	porta = aic_inb(aic, PORTA);
	if (isa_get_irq(dev) == -1) {
		int irq = PORTA_IRQ(porta);

		bus_set_resource(dev, SYS_RES_IRQ, 0, irq, 1,
		    machintr_intr_cpuid(irq));
	}
	if ((aic->flags & AIC_DMA_ENABLE) && isa_get_drq(dev) == -1)
		bus_set_resource(dev, SYS_RES_DRQ, 0, PORTA_DRQ(porta), 1, -1);
	device_set_desc(dev, "Adaptec 6260/6360 SCSI controller");
	return (0);
}
开发者ID:juanfra684,项目名称:DragonFlyBSD,代码行数:49,代码来源:aic_isa.c


示例12: ata_isa_probe

static int
ata_isa_probe(device_t dev)
{
    struct ata_channel *ch = device_get_softc(dev);
    struct resource *io = NULL, *ctlio = NULL;
    u_long tmp;
    int i, rid;

    /* check isapnp ids */
    if (ISA_PNP_PROBE(device_get_parent(dev), dev, ata_ids) == ENXIO)
	return ENXIO;
    
    /* allocate the io port range */
    rid = ATA_IOADDR_RID;
    if (!(io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0,
				  ATA_IOSIZE, RF_ACTIVE)))
	return ENXIO;

    /* set the altport range */
    if (bus_get_resource(dev, SYS_RES_IOPORT, ATA_CTLADDR_RID, &tmp, &tmp)) {
	bus_set_resource(dev, SYS_RES_IOPORT, ATA_CTLADDR_RID,
			 rman_get_start(io) + ATA_CTLOFFSET, ATA_CTLIOSIZE, -1);
    }

    /* allocate the altport range */
    rid = ATA_CTLADDR_RID; 
    if (!(ctlio = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0,
				     ATA_CTLIOSIZE, RF_ACTIVE))) {
	bus_release_resource(dev, SYS_RES_IOPORT, ATA_IOADDR_RID, io);
	return ENXIO;
    }

    /* setup the resource vectors */
    for (i = ATA_DATA; i <= ATA_COMMAND; i++) {
	ch->r_io[i].res = io;
	ch->r_io[i].offset = i;
    }
    ch->r_io[ATA_CONTROL].res = ctlio;
    ch->r_io[ATA_CONTROL].offset = 0;
    ch->r_io[ATA_IDX_ADDR].res = io;
    ata_default_registers(dev);
 
    /* initialize softc for this channel */
    ch->unit = 0;
    ch->flags |= ATA_USE_16BIT;
    ata_generic_hw(dev);
    return ata_probe(dev);
}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:48,代码来源:ata-isa.c


示例13: ppc_isa_probe

static int
ppc_isa_probe(device_t dev)
{
	device_t parent;
	int error;

	parent = device_get_parent(dev);

	error = ISA_PNP_PROBE(parent, dev, lpc_ids);
	if (error == ENXIO)
		return (ENXIO);
	else if (error != 0)	/* XXX shall be set after detection */
		device_set_desc(dev, "Parallel port");

	return(ppc_probe(dev));
}
开发者ID:MarginC,项目名称:kame,代码行数:16,代码来源:ppc.c


示例14: uart_acpi_probe

static int
uart_acpi_probe(device_t dev)
{
	struct uart_softc *sc;
	device_t parent;

	parent = device_get_parent(dev);
	sc = device_get_softc(dev);

	if (!ISA_PNP_PROBE(parent, dev, acpi_ns8250_ids)) {
		sc->sc_class = &uart_ns8250_class;
		return (uart_bus_probe(dev, 0, 0, 0, 0));
	}

	/* Add checks for non-ns8250 IDs here. */
	return (ENXIO);
}
开发者ID:edgar-pek,项目名称:PerspicuOS,代码行数:17,代码来源:uart_bus_acpi.c


示例15: cs_isa_probe

/*
 * Determine if the device is present
 */
static int
cs_isa_probe(device_t dev)
{
	int error = 0;

	/* Check isapnp ids */
	error = ISA_PNP_PROBE(device_get_parent(dev), dev, cs_ids);

	/* If the card had a PnP ID that didn't match any we know about */
        if (!(error == 0 || error == ENOENT))
		return error;

	error = cs_cs89x0_probe(dev);
	if (error == 0)
                error = cs_alloc_irq(dev, 0, 0);

        cs_release_resources(dev);
        return (error);
}
开发者ID:AhmadTux,项目名称:DragonFlyBSD,代码行数:22,代码来源:if_cs_isa.c


示例16: atkbdc_isa_add_child

static device_t
atkbdc_isa_add_child(device_t bus, int order, char *name, int unit)
{
	atkbdc_device_t	*ivar;
	device_t	child;
	int		t;

	ivar = malloc(sizeof(struct atkbdc_device), M_ATKBDDEV,
		M_NOWAIT | M_ZERO);
	if (!ivar)
		return NULL;

	child = device_add_child_ordered(bus, order, name, unit);
	if (child == NULL) {
		free(ivar, M_ATKBDDEV);
		return child;
	}

	resource_list_init(&ivar->resources);
	ivar->rid = order;

	/*
	 * If the device is not created by the PnP BIOS or ACPI,
	 * refer to device hints for IRQ.
	 */
	if (ISA_PNP_PROBE(device_get_parent(bus), bus, atkbdc_ids) != 0) {
		if (resource_int_value(name, unit, "irq", &t) != 0)
			t = -1;
	} else {
		t = bus_get_resource_start(bus, SYS_RES_IRQ, ivar->rid);
	}
	if (t > 0)
		resource_list_add(&ivar->resources, SYS_RES_IRQ, ivar->rid,
				  t, t, 1);

	if (resource_disabled(name, unit))
		device_disable(child);

	device_set_ivars(child, ivar);

	return child;
}
开发者ID:syedzubairahmed,项目名称:FreeBSD-7.3-dyntick,代码行数:42,代码来源:atkbdc_isa.c


示例17: cbb_isa_probe

static int
cbb_isa_probe(device_t dev)
{
	int error;
	struct cbb_softc *sc = device_get_softc(dev);

	/* Check isapnp ids */
	error = ISA_PNP_PROBE(device_get_parent(dev), dev, pcic_ids);
	if (error != 0 && error != ENOENT)
		return (error);

	error = cbb_isa_activate(dev);
	if (error != 0)
		return (error);

	/* Check to make sure that we have actual hardware */
	error = exca_probe_slots(dev, &sc->exca[0], sc->bst, sc->bsh);
	cbb_isa_deactivate(dev);
	return (error);
}
开发者ID:ChristosKa,项目名称:freebsd,代码行数:20,代码来源:pccbb_isa.c


示例18: an_probe_isa

static int
an_probe_isa(device_t dev)
{
	int			error = 0;

	error = ISA_PNP_PROBE(device_get_parent(dev), dev, an_ids);
	if (error == ENXIO)
		return(error);

	error = an_probe(dev);
	an_release_resources(dev);
	if (error == 0)
		return (ENXIO);

	error = an_alloc_irq(dev, 0, 0);
	an_release_resources(dev);
	if (!error)
		device_set_desc(dev, "Aironet ISA4500/ISA4800");
	return (error);
}
开发者ID:dcui,项目名称:FreeBSD-9.3_kernel,代码行数:20,代码来源:if_an_isa.c


示例19: le_isa_probe

static int
le_isa_probe(device_t dev)
{
	int i;

	switch (ISA_PNP_PROBE(device_get_parent(dev), dev, le_isa_ids)) {
	case 0:
		return (-20);
	case ENOENT:
		for (i = 0; i < NELEM(le_isa_params); i++) {
			if (le_isa_probe_legacy(dev, &le_isa_params[i]) == 0) {
				device_set_desc(dev, le_isa_params[i].name);
				return (-20);
			}
		}
		/* FALLTHROUGH */
	case ENXIO:
	default:
		return (ENXIO);
	}
}
开发者ID:vishesh,项目名称:DragonFlyBSD,代码行数:21,代码来源:if_lnc_isa.c


示例20: fdc_isa_probe

static int
fdc_isa_probe(device_t dev)
{
	int	error;
	struct	fdc_data *fdc;

	fdc = device_get_softc(dev);
	fdc->fdc_dev = dev;

	/* Check pnp ids */
	error = ISA_PNP_PROBE(device_get_parent(dev), dev, fdc_ids);
	if (error == ENXIO)
		return (ENXIO);

	/* Attempt to allocate our resources for the duration of the probe */
	error = fdc_isa_alloc_resources(dev, fdc);
	if (error == 0)
		error = fdc_initial_reset(dev, fdc);

	fdc_release_resources(fdc);
	return (error);
}
开发者ID:AhmadTux,项目名称:freebsd,代码行数:22,代码来源:fdc_isa.c



注:本文中的ISA_PNP_PROBE函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ISCAPI_SOCKET_VALID函数代码示例发布时间:2022-05-30
下一篇:
C++ ISAPNP_VENDOR函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap