release/src/linux/linux/arch/parisc/kernel/lba_pci.c
/*
** Determine if a device is already configured.
** If so, reserve it resources.
**
** Read PCI cfg command register and see if I/O or MMIO is enabled.
** PAT has to enable the devices it's using.
**
** Note: resources are fixed up before we try to claim them.
*/
Determine if a device is already configured.
If so, reserve it resources.

Read PCI cfg command register and see if I/O or MMIO is enabled.
PAT has to enable the devices it's using.

resources are fixed up before we try to claim them.
Determine if a device is already configured . If so reserve it resources . Read PCI cfg command register and see if I / O or MMIO is enabled . PAT has to enable the devices it ' s using . resources are fixed up before we try to claim them .
static void
lba_claim_dev_resources(struct pci_dev *dev)
{
	u16 cmd;
	int i, srch_flags;
	(void) lba_cfg_read16(dev, PCI_COMMAND, &cmd);
	srch_flags  = (cmd & PCI_COMMAND_IO) ? IORESOURCE_IO : 0;
	if (cmd & PCI_COMMAND_MEMORY)
		srch_flags |= IORESOURCE_MEM;
	if (!srch_flags)
		return;
	for (i = 0; i <= PCI_ROM_RESOURCE; i++) {
		if (dev->resource[i].flags & srch_flags) {
			pci_claim_resource(dev, i);
			DBG("   claimed %s %d [%lx,%lx]/%x\n",
				dev->slot_name, i,
				dev->resource[i].start,
				dev->resource[i].end,
				(int) dev->resource[i].flags
				);
		}
	}
}
static void lba_claim_dev_resources ( struct pci_dev * dev ) { u16 cmd ; int i , srch_flags ; ( void ) lba_cfg_read16 ( dev , PCI_COMMAND , & cmd ) ; srch_flags = ( cmd & PCI_COMMAND_IO ) ? IORESOURCE_IO : 0 ; if ( cmd & PCI_COMMAND_MEMORY ) srch_flags |= IORESOURCE_MEM ; if ( ! srch_flags ) return ; for ( i = 0 ; i <= PCI_ROM_RESOURCE ; i ++ ) { if ( dev -> resource [ i ] . flags & srch_flags ) { pci_claim_resource ( dev , i ) ; DBG ( " \n " , dev -> slot_name , i , dev -> resource [ i ] . start , dev -> resource [ i ] . end , ( int ) dev -> resource [ i ] . flags ) ; } } }
Determine if a device is already configured.
Determine if a device is already configured .