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

C++ pci_scan_bus函数代码示例

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

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



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

示例1: ixp2000_pci_init

void __init ixp2000_pci_init(void *sysdata)
{
	external_fault = ixp2000_pci_abort_handler;
	
	DBG("PCI: set upper mem io bits\n");
	*IXP2000_PCI_ADDR_EXT = 0x0;  

	if (npu_is_master()) {/* master NPU */
		pci_scan_bus(0, &ixp2000_ops, sysdata);
	} else { /* NPU is slave */

		/*
		 * NOTE TO HW DESIGNERS:
		 *
		 * Do NOT make boards like this which have slave devices that scan
		 * the bus and own devices. It is completely against the PCI spec
		 * as it is _NOT_ a peer to peer bus.
		 */
		if(machine_is_ixdp2400())
			pci_scan_bus(0, &ixp2000_ops, sysdata);
	}

	/* enable PCI INTB */
 	*(IXP2000_IRQ_ENABLE_SET) = (1<<15);
	*IXP2000_PCI_XSCALE_INT_ENABLE |= (1<<27) | (1<<26);

	DBG("ixp200_pci_init Done\n");
}
开发者ID:iPodLinux,项目名称:linux-2.4.24-ipod,代码行数:28,代码来源:ixp2000-pci.c


示例2: via82c505_init

void __init via82c505_init(void *sysdata)
{
	struct pci_bus *bus;

	printk(KERN_DEBUG "PCI: VIA 82c505\n");
	if (!request_region(0xA8,2,"via config")) {
		printk(KERN_WARNING"VIA 82c505: Unable to request region 0xA8\n");
		return;
	}
	if (!request_region(0xCF8,8,"pci config")) {
		printk(KERN_WARNING"VIA 82c505: Unable to request region 0xCF8\n");
		release_region(0xA8, 2);
		return;
	}

	/* Enable compatible Mode */
	outb(0x96,0xA8);
	outb(0x18,0xA9);
	outb(0x93,0xA8);
	outb(0xd0,0xA9);

	pci_scan_bus(0, &via82c505_ops, sysdata);

#ifdef CONFIG_ARCH_SHARK
	/* 
	 * Initialize a fake pci-bus number 1 for the CyberPro
         * on the vlbus
	 */
	bus = pci_scan_bus(1, &dummy_ops, sysdata);
#endif
}
开发者ID:GunioRobot,项目名称:MI424WR_GEN2_Rev_E-F,代码行数:31,代码来源:via82c505.c


示例3: detect_pci22

/* --- implementations --- */
int detect_pci22(void){
  
  unsigned int c;
  char counter=0;

  
  pacc = pci_alloc();           /* Get the pci_access structure */
  
  pci_init(pacc);               /* Initialize the PCI library */
  pci_scan_bus(pacc);           /* We want to get the list of devices */


  /* Iterate over all PCI devices */
  for(pci22_dev=pacc->devices; pci22_dev; pci22_dev=pci22_dev->next){
    
    pci_fill_info(pci22_dev, PCI_FILL_IDENT | PCI_FILL_BASES); 
    
    // Detect the specified device
    if( (pci22_dev->vendor_id == PCI22_PCI_VENDOR_ID) && 
	(pci22_dev->device_id == PCI22_PCI_DEVICE_ID) 
	){
      break;
    }

  }
  if (pci22_dev==NULL){
    printf("\n\nERROR: PCI22 card not detected\n\n\n");
    exit(0);
  }


  printf("\n\nPCI22 card detected on %02x:%02x.%d\nVendorID=%04x DeviceID=%04x irq=%d\n",
	 pci22_dev->bus,pci22_dev->dev,
	 pci22_dev->func,pci22_dev->vendor_id,
	 pci22_dev->device_id,
	 pci22_dev->irq);


  printf("\n\n--- Baseaddresses ---\n");
  printf("BAR1 %x\n",pci22_dev->base_addr[0]);
  printf("BAR2 %x\n",pci22_dev->base_addr[1]);
  printf("BAR3 %x\n",pci22_dev->base_addr[2]);
  printf("BAR4 %x\n",pci22_dev->base_addr[3]);
  printf("BAR5 %x\n",pci22_dev->base_addr[4]);
  printf("BAR6 %x\n",pci22_dev->base_addr[6]);
  printf("\n");


  //printPCIDevice(pci22_dev);

/* The baseaddress of the COM20022 is at BAR2 */

//g_pci22dipswitch = pci22_dev->base_addr[1]; //Nonworking
g_pci22base = pci22_dev->base_addr[2];

  /* Close everything */
  pci_cleanup(pacc);

  return 0;
}
开发者ID:PA10ros,项目名称:PA10ros,代码行数:61,代码来源:drv_pci22.c


示例4: pcibios_init

static int __init pcibios_init(void)
{
	struct pci_controller *pci_ctrl;
	struct pci_bus *bus;
	int next_busno = 0, i;

	printk("PCI: Probing PCI hardware\n");

	/* Scan all of the recorded PCI controllers.  */
	for (pci_ctrl = pci_ctrl_head; pci_ctrl; pci_ctrl = pci_ctrl->next) {
		pci_ctrl->last_busno = 0xff;
		bus = pci_scan_bus(pci_ctrl->first_busno, pci_ctrl->ops,
				   pci_ctrl);
		if (pci_ctrl->io_resource.flags) {
			unsigned long offs;

			offs = (unsigned long)pci_ctrl->io_space.base;
			pci_ctrl->io_resource.start += offs;
			pci_ctrl->io_resource.end += offs;
			bus->resource[0] = &pci_ctrl->io_resource;
		}
		for (i = 0; i < 3; ++i)
			if (pci_ctrl->mem_resources[i].flags)
				bus->resource[i+1] =&pci_ctrl->mem_resources[i];
		pci_ctrl->bus = bus;
		pci_ctrl->last_busno = bus->subordinate;
		if (next_busno <= pci_ctrl->last_busno)
			next_busno = pci_ctrl->last_busno+1;
	}
	pci_bus_count = next_busno;

	return platform_pcibios_fixup();
}
开发者ID:08opt,项目名称:linux,代码行数:33,代码来源:pci.c


示例5: l4vpci_x86_init

static int __init l4vpci_x86_init(void)
{
	struct pci_dev *dev = NULL;
	struct pci_bus *bus;
	struct pci_sysdata *sd = kzalloc(sizeof(*sd), GFP_KERNEL);
	if (!sd)
		return -ENOMEM;

	bus = pci_scan_bus(0, &l4vpci_ops, sd);
	if (!bus) {
		pr_err("Failed to scan PCI bus\n");
		return -ENODEV;
	}

	pci_bus_add_devices(bus);

	pr_info("l4vPCI: Using L4-IO for IRQ routing\n");

	for_each_pci_dev(dev)
		l4vpci_irq_enable(dev);

	pcibios_resource_survey();

	return 0;
}
开发者ID:michas2,项目名称:l4re-snapshot,代码行数:25,代码来源:l4vpci.c


示例6: via82c505_scan_bus

struct pci_bus * __init via82c505_scan_bus(int nr, struct pci_sys_data *sysdata)
{
	if (nr == 0)
		return pci_scan_bus(0, &via82c505_ops, sysdata);

	return NULL;
}
开发者ID:420GrayFox,项目名称:dsl-n55u-bender,代码行数:7,代码来源:via82c505.c


示例7: pcibios_init

void __init pcibios_init(void)
{
	struct pci_channel *p;
	struct pci_bus *bus;
	int busno;

	/* assign resources */
	busno=0;
	for (p= mips_pci_channels; p->pci_ops != NULL; p++) {
		busno = pciauto_assign_resources(busno, p) + 1;
	}

	/* scan the buses */
	busno = 0;
	for (p= mips_pci_channels; p->pci_ops != NULL; p++) {
		bus = pci_scan_bus(busno, p->pci_ops, p);
		busno = bus->subordinate+1;
	}

	/* fixup irqs (board specific routines) */
	pcibios_fixup_irqs();

	/* 
	 * should we do a fixup of ioport_resource and iomem_resource
	 * based on mips_pci_channels?  
	 * Let us wait and see if this is a common need and whether there
	 * are exceptions.  Until then, each board should adjust them
	 * perhaps in their setup() function.
	 */
}
开发者ID:TitaniumBoy,项目名称:lin,代码行数:30,代码来源:pci.c


示例8: pcibios_init

static int __init pcibios_init(void)
{
	struct pci_channel *p;
	struct pci_bus *bus;
	int busno;

#if 1
	/* assign resources */
	busno = 0;
	for (p = board_pci_channels; p->pci_ops != NULL; p++) {
		busno = pciauto_assign_resources(busno, p) + 1;
	}
#endif

	/* scan the buses */
	busno = 0;
	for (p= board_pci_channels; p->pci_ops != NULL; p++) {
		bus = pci_scan_bus(busno, p->pci_ops, p);
		busno = bus->subordinate+1;
	}

	/* board-specific fixups */
	pcibios_fixup_irqs();

	return 0;
}
开发者ID:ZHAW-INES,项目名称:rioxo-linux-2.6,代码行数:26,代码来源:pci.c


示例9: pcibios_init

/*
 * Initialization. Try all known PCI access methods. Note that we support
 * using both PCI BIOS and direct access: in such cases, we use I/O ports
 * to access config space, but we still keep BIOS order of cards to be
 * compatible with 2.0.X. This should go away some day.
 */
static int __init pcibios_init(void)
{
	ioport_resource.start	= 0xA0000000;
	ioport_resource.end	= 0xDFFFFFFF;
	iomem_resource.start	= 0xA0000000;
	iomem_resource.end	= 0xDFFFFFFF;

	if (insert_resource(&iomem_resource, &pci_iomem_resource) < 0)
		panic("Unable to insert PCI IOMEM resource\n");
	if (insert_resource(&ioport_resource, &pci_ioport_resource) < 0)
		panic("Unable to insert PCI IOPORT resource\n");

	if (!pci_probe)
		return 0;

	if (pci_check_direct() < 0) {
		printk(KERN_WARNING "PCI: No PCI bus detected\n");
		return 0;
	}

	printk(KERN_INFO "PCI: Probing PCI hardware [mempage %08x]\n",
	       MEM_PAGING_REG);

	pci_root_bus = pci_scan_bus(0, &pci_direct_ampci, NULL);

	pcibios_irq_init();
	pcibios_fixup_irqs();
	pcibios_resource_survey();
	return 0;
}
开发者ID:AdrianHuang,项目名称:uclinux-robutest,代码行数:36,代码来源:pci.c


示例10: pirq_peer_trick

static void __init pirq_peer_trick(void)
{
	struct irq_routing_table *rt = pirq_table;
	u8 busmap[256];
	int i;
	struct irq_info *e;

	memset(busmap, 0, sizeof(busmap));
	for(i=0; i < (rt->size - sizeof(struct irq_routing_table)) / sizeof(struct irq_info); i++) {
		e = &rt->slots[i];
#ifdef DEBUG
		{
			int j;
			DBG(KERN_DEBUG "%02x:%02x slot=%02x", e->bus, e->devfn/8, e->slot);
			for(j=0; j<4; j++)
				DBG(" %d:%02x/%04x", j, e->irq[j].link, e->irq[j].bitmap);
			DBG("\n");
		}
#endif
		busmap[e->bus] = 1;
	}
	for(i = 1; i < 256; i++) {
		if (!busmap[i] || pci_find_bus(0, i))
			continue;
		if (pci_scan_bus(i, &pci_root_ops, NULL))
			printk(KERN_INFO "PCI: Discovered primary peer bus %02x [IRQ]\n", i);
	}
	pcibios_last_bus = -1;
}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:29,代码来源:irq.c


示例11: pirq_peer_trick

static void __init pirq_peer_trick(void)
{
	struct irq_routing_table *rt = pirq_table;
	u8 busmap[256];
	int i;
	struct irq_info *e;

	memset(busmap, 0, sizeof(busmap));
	for(i=0; i < (rt->size - sizeof(struct irq_routing_table)) / sizeof(struct irq_info); i++) {
		e = &rt->slots[i];
#ifdef DEBUG
		{
			int j;
			DBG("%02x:%02x slot=%02x", e->bus, e->devfn/8, e->slot);
			for(j=0; j<4; j++)
				DBG(" %d:%02x/%04x", j, e->irq[j].link, e->irq[j].bitmap);
			DBG("\n");
		}
#endif
		busmap[e->bus] = 1;
	}
	for(i=1; i<256; i++)
		/*
		 *  It might be a secondary bus, but in this case its parent is already
		 *  known (ascending bus order) and therefore pci_scan_bus returns immediately.
		 */
		if (busmap[i] && pci_scan_bus(i, pci_root_bus->ops, NULL))
			printk(KERN_INFO "PCI: Discovered primary peer bus %02x [IRQ]\n", i);
	pcibios_last_bus = -1;
}
开发者ID:dduval,项目名称:kernel-rhel3,代码行数:30,代码来源:pci-irq.c


示例12: pci_scan

void pci_scan(pci_func_t f, int type) {
	pci_scan_bus(f, type, 0);

	if (!pci_read_field(0, PCI_HEADER_TYPE, 1)) {
		return;
	}

	for (int func = 1; func < 8; ++func) {
		uint32_t dev = pci_box_device(0, 0, func);
		if (pci_read_field(dev, PCI_VENDOR_ID, 2) != PCI_NONE) {
			pci_scan_bus(f, type, func);
		} else {
			break;
		}
	}
}
开发者ID:dardevelin,项目名称:ponyos,代码行数:16,代码来源:pci.c


示例13: pci_scan_func

void pci_scan_func(pci_func_t f, int type, int bus, int slot, int func) {
	uint32_t dev = pci_box_device(bus, slot, func);
	if (type == -1 || type == pci_find_type(dev)) {
		pci_scan_hit(f, dev);
	}
	if (pci_find_type(dev) == PCI_TYPE_BRIDGE) {
		pci_scan_bus(f, type, pci_read_field(dev, PCI_SECONDARY_BUS, 1));
	}
}
开发者ID:dardevelin,项目名称:ponyos,代码行数:9,代码来源:pci.c


示例14: KERNEL_VERSION

static struct pci_bus *soc_pci_scan_bus(int nr, struct pci_sys_data *sys)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0)
        return pci_scan_bus(sys->busnr, &soc_pcie_ops, sys);
#else
		return pci_scan_root_bus(NULL, sys->busnr, &soc_pcie_ops, sys,
					&sys->resources);
#endif
}
开发者ID:bjayesh,项目名称:chandra,代码行数:9,代码来源:pcie_iproc.c


示例15: pcibios_init

static int __init pcibios_init(void)
{
	/* The VISWS supports configuration access type 1 only */
	pci_probe = (pci_probe | PCI_PROBE_CONF1) &
		    ~(PCI_PROBE_BIOS | PCI_PROBE_CONF2);

	pci_bus0 = li_pcib_read16(LI_PCI_BUSNUM) & 0xff;
	pci_bus1 = li_pcia_read16(LI_PCI_BUSNUM) & 0xff;

	printk(KERN_INFO "PCI: Lithium bridge A bus: %u, "
		"bridge B (PIIX4) bus: %u\n", pci_bus1, pci_bus0);

	raw_pci_ops = &pci_direct_conf1;
	pci_scan_bus(pci_bus0, &pci_root_ops, NULL);
	pci_scan_bus(pci_bus1, &pci_root_ops, NULL);
	pci_fixup_irqs(visws_swizzle, visws_map_irq);
	pcibios_resource_survey();
	return 0;
}
开发者ID:1x23,项目名称:unifi-gpl,代码行数:19,代码来源:visws.c


示例16: pci_init

/* Exported interface */
int
pci_init(void)
{
	static struct pci_bus root_bus;
	memset(&root_bus, 0, sizeof(root_bus));

	if (platform_pci_init() < 0)
		panic("pci: unable to initial PCI\n");

	return pci_scan_bus(&root_bus);
}
开发者ID:m943040028,项目名称:prex,代码行数:12,代码来源:pci.c


示例17: pci_init

void
pci_init (void)
{
  list_init (&devices);
  list_init (&int_devices);

  num_pci_pages = 0;

  pci_scan_bus (0);
  pci_print_stats ();
}
开发者ID:SeanHogan,项目名称:Hollow_Moose,代码行数:11,代码来源:pci.c


示例18: pcibios_init

void __init pcibios_init(void)
{
	/* 
	 * XXX These values below need to change
	 */
	ioport_resource.start = 0xe0000000;
	ioport_resource.end   = 0xe0000000 + 0x20000000 - 1;
	iomem_resource.start  = 0xc0000000;
	iomem_resource.end    = 0xc0000000 + 0x20000000 - 1;

	pci_scan_bus(0, &titan_pci_ops, NULL);
}
开发者ID:iPodLinux,项目名称:linux-2.6.7-ipod,代码行数:12,代码来源:ops-titan.c


示例19: pcibios_init

void __init pcibios_init(void)
{
	printk("PCI: Probing PCI hardware on host bus 0.\n");

	switch (mips_revision_corid) {
	case MIPS_REVISION_CORID_QED_RM5261:
	case MIPS_REVISION_CORID_CORE_LV:
	case MIPS_REVISION_CORID_CORE_FPGA:
		/*
		 * Due to a bug in the Galileo system controller, we need
		 * to setup the PCI BAR for the Galileo internal registers.
		 * This should be done in the bios/bootprom and will be
		 * fixed in a later revision of YAMON (the MIPS boards
		 * boot prom).
		 */
		GT_WRITE(GT_PCI0_CFGADDR_OFS,
			 (0 << GT_PCI0_CFGADDR_BUSNUM_SHF) | /* Local bus */
			 (0 << GT_PCI0_CFGADDR_DEVNUM_SHF) | /* GT64120 dev */
			 (0 << GT_PCI0_CFGADDR_FUNCTNUM_SHF) | /* Function 0*/
			 ((0x20/4) << GT_PCI0_CFGADDR_REGNUM_SHF) | /* BAR 4*/
			 GT_PCI0_CFGADDR_CONFIGEN_BIT );

		/* Perform the write */
		GT_WRITE( GT_PCI0_CFGDATA_OFS, PHYSADDR(GT64120_BASE));

		pci_scan_bus(0, &gt64120_pci_ops, NULL);
		break;

	case MIPS_REVISION_CORID_BONITO64:
	case MIPS_REVISION_CORID_CORE_20K:
		pci_scan_bus(0, &bonito64_pci_ops, NULL);
		break;

	case MIPS_REVISION_CORID_CORE_MSC:
		pci_scan_bus(0, &msc_pci_ops, NULL);
		break;
	}

	malta_fixup();
}
开发者ID:Picture-Elements,项目名称:linux-2.4-peijse,代码行数:40,代码来源:pci.c


示例20: pcibios_init

void __init pcibios_init(void)
{
	struct pci_ops *ops = &bridge_pci_ops;
	int	i;

	ioport_resource.end = ~0UL;
	iomem_resource.end = ~0UL;

	for (i=0; i<num_bridges; i++) {
		printk("PCI: Probing PCI hardware on host bus %2d.\n", i);
		pci_scan_bus(i, ops, NULL);
	}
}
开发者ID:nhanh0,项目名称:hah,代码行数:13,代码来源:ip27-pci.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ pci_set_consistent_dma_mask函数代码示例发布时间:2022-05-30
下一篇:
C++ pci_save_state函数代码示例发布时间: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