Package org.jnode.driver

Examples of org.jnode.driver.DriverException


    protected void stopDevice() throws DriverException {
        try {
            unlock();
        } catch (IOException ex) {
            throw new DriverException(ex);
        } finally {
            final SCSIDevice dev = (SCSIDevice) getDevice();
            dev.unregisterAPI(RemovableDeviceAPI.class);
            dev.unregisterAPI(FSBlockDeviceAPI.class);
            dev.unregisterAPI(SCSIDeviceAPI.class);
View Full Code Here


        final ResourceManager rm;

        try {
            rm = InitialNaming.lookup(ResourceManager.NAME);
        } catch (NameNotFoundException ex) {
            throw new DriverException("Cannot find ResourceManager");
        }

        this.irq = rm.claimIRQ(owner, irq_nr, this, true);

        try {
View Full Code Here

    protected PCIBaseAddress getIOBaseAddress(Device device, Flags flags)
        throws DriverException {
        final PCIHeaderType0 config = ((PCIDevice) device).getConfig().asHeaderType0();
        final PCIBaseAddress[] addrs = config.getBaseAddresses();
        if (addrs.length < 1) {
            throw new DriverException("Cannot find iobase: no base address");
        }
        if (!addrs[0].isIOSpace()) {
            throw new DriverException("Cannot find iobase: first address is not I/O");
        }
        return addrs[0];
    }
View Full Code Here

        } catch (DriverException ex) {
            throw ex;
        } catch (ResourceNotFreeException ex) {
            throw ex;
        } catch (Exception ex) {
            throw new DriverException(ex);
        }
    }
View Full Code Here

                }
            }
        } catch (DeviceAlreadyRegisteredException ex) {
            log.error("Cannot rename device", ex);
        } catch (NameNotFoundException ex) {
            throw new DriverException("Cannot find DeviceManager", ex);
        }
        device.registerAPI(DeviceInfoAPI.class, this);
        device.registerAPI(NetDeviceAPI.class, this);
        txThread = new QueueProcessorThread<Object[]>(device.getId() + "-tx", txQueue, this);
        txThread.start();
View Full Code Here

    final void resultToException(Result result) throws DriverException {
        switch (result) {
            case SUCCESS:
                return;
            case CARD_FAIL:
                throw new DriverException("Card failure");
            case NO_BUFF:
                throw new DriverException("No buffer");
            case CMD_ERR:
                throw new DriverException("Command error");
            default:
                throw new DriverException("Unknown result code 0x" +
                        NumberUtils.hex(result.getCode(), 2));
        }
    }
View Full Code Here

        // Wait for the bap to settle.
        try {
            waitUntilBapNotBusy();
        } catch (TimeoutException ex) {
            throw new DriverException("Cannot setup BAP in time", ex);
        }

        // Test for errors
        if ((getReg(OFFSET0) & OFFSET_ERR) != 0) {
            throw new DriverException("Error in offset");
        }
    }
View Full Code Here

     * @throws DriverException
     */
    public Prism2Core(Prism2Driver driver, ResourceOwner owner,
                      PCIDevice device, Flags flags) throws DriverException {
        if (!(flags instanceof Prism2Flags))
            throw new DriverException("Wrong flags to the Prism2 driver");

        this.driver = driver;
        this.device = device;
        this.flags = (Prism2Flags) flags;

        final ResourceManager rm;
        try {
            rm = InitialNaming.lookup(ResourceManager.NAME);
        } catch (NameNotFoundException ex) {
            throw new DriverException("Cannot find ResourceManager");
        }

        final PCIHeaderType0 pciCfg = device.getConfig().asHeaderType0();
        final PCIBaseAddress[] baseAddrs = pciCfg.getBaseAddresses();
        if (baseAddrs.length < 1) {
            throw new DriverException(
                "No memory mapped I/O region in PCI config");
        }
        final PCIBaseAddress regsAddr = pciCfg.getBaseAddresses()[0];
        if (!regsAddr.isMemorySpace()) {
            throw new DriverException("Memory mapped I/O is not a memory space");
        }

        // Claim the memory mapped I/O region
        final Address regsAddrPtr = Address.fromLong(regsAddr.getMemoryBase());
        final Extent regsSize = Extent.fromIntZeroExtend(regsAddr.getSize());
        try {
            final MemoryResource regs;
            regs = rm.claimMemoryResource(device, regsAddrPtr, regsSize,
                ResourceManager.MEMMODE_NORMAL);
            this.io = new Prism2IO(regs);
        } catch (ResourceNotFreeException ex) {
            throw new DriverException("Cannot claim memory mapped I/O", ex);
        }

        // Claim IRQ
        final int irqNo = pciCfg.getInterruptLine();
        try {
            this.irq = rm.claimIRQ(device, irqNo, this, true);
        } catch (ResourceNotFreeException ex) {
            // Release IO
            io.release();
            io = null;
            // re-throw exception
            throw new DriverException("Cannot claim IRQ", ex);
        }

        log.info("Found " + flags.getName() + ", regs at "
            + MagicUtils.toString(regsAddrPtr));
    }
View Full Code Here

                cmdFlags = 0;
            }
            result = io.executeCommand(ACCESS, cmdFlags, rid.getId(), 0, 0, null);
            io.resultToException(result);
        } catch (TimeoutException ex) {
            throw new DriverException("Timeout in Access command", ex);
        }
    }
View Full Code Here

        try {
            final Result result;
            result = io.executeCommand(ALLOC, 0, bufferLength, 0, 0, null);
            io.resultToException(result);
        } catch (TimeoutException ex) {
            throw new DriverException("Timeout in Alloc command", ex);
        }
    }
View Full Code Here

TOP

Related Classes of org.jnode.driver.DriverException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.