ioResource = rm.claimIOResource(owner, iobase, iolength);
ioResource = claimPorts(rm, owner, iobase, iolength);
	public LanceCore(		LanceDriver driver,		ResourceOwner owner,		PCIDevice device,		Flags flags)		throws ResourceNotFreeException, DriverException {		this.driver = driver;		this.flags = (LanceFlags) flags;		final PCIDeviceConfig config = device.getConfig();		final int irq = config.getInterruptLine();		final PCIBaseAddress[] addrs = config.getBaseAddresses();		if (addrs.length < 1) {			throw new DriverException("Cannot find iobase: not base addresses");		}		if (!addrs[0].isIOSpace()) {			throw new DriverException("Cannot find iobase: first address is not I/O");		}		// Get the start of the IO address space		iobase = addrs[0].getIOBase();		final int iolength = addrs[0].getSize();		log.debug(			"Found Lance IOBase: 0x"				+ NumberUtils.hex(iobase)				+ ", length: "				+ iolength);		ResourceManager rm;		try {			rm = (ResourceManager) InitialNaming.lookup(ResourceManager.NAME);		} catch (NameNotFoundException ex) {			throw new DriverException("Cannot find ResourceManager");		}		this.irq = rm.claimIRQ(owner, irq, this, true);		try {			ioResource = rm.claimIOResource(owner, iobase, iolength);		} catch (ResourceNotFreeException ex) {			this.irq.release();			throw ex;		}				// Determine the type of IO access (Word or DWord)		io = getIOAccess();		log.debug("IO Access set to " + io.getType());				// Set the flags based on the version of the device found		setFlags();		// Load the hw address		this.hwAddress = loadHWAddress();		log.info(			"Found "				+ this.flags.getChipName()				+ " at 0x"				+ NumberUtils.hex(iobase, 4)				+ " with MAC Address "				+ hwAddress);		// Create rx & tx descriptor rings, initdata and databuffers		this.bufferManager =			new BufferManager(			RX_DESCRIPTOR_LENGTH,			TX_DESCRIPTOR_LENGTH,				CSR15_DRX | CSR15_DTX,				hwAddress,				0,				rm,				owner);		// Enable device to become a bus master on the PCI bus.		device.writeConfigByte(			PCIConstants.PCI_COMMAND,			device.readConfigByte(PCIConstants.PCI_COMMAND)				| PCIConstants.PCI_COMMAND_MASTER);	}