Examples of DriverException


Examples of org.jnode.driver.DriverException

                }
            }
        } 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

Examples of org.jnode.driver.DriverException

    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

Examples of org.jnode.driver.DriverException

        // 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

Examples of org.jnode.driver.DriverException

     * @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

Examples of org.jnode.driver.DriverException

                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

Examples of org.jnode.driver.DriverException

        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

Examples of org.jnode.driver.DriverException

            final int cmdFlags = ((macPort & 7) << 8);
            final Result result;
            result = io.executeCommand(ENABLE, cmdFlags, 0, 0, 0, null);
            io.resultToException(result);
        } catch (TimeoutException ex) {
            throw new DriverException("Timeout in Enable command", ex);
        }
    }
View Full Code Here

Examples of org.jnode.driver.DriverException

            final int cmdFlags = ((macPort & 7) << 8);
            final Result result;
            result = io.executeCommand(DISABLE, cmdFlags, 0, 0, 0, null);
            io.resultToException(result);
        } catch (TimeoutException ex) {
            throw new DriverException("Timeout in Disable command", ex);
        }
    }
View Full Code Here

Examples of org.jnode.driver.DriverException

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

Examples of org.jnode.driver.DriverException

        final byte[] hdr = new byte[Prism2Record.HDR_LENGTH];
        io.copyFromBAP(rid.getId(), 0, hdr, 0, hdr.length);

        // Validate the record length
        if ((Prism2Record.getRecordLength(hdr, 0) - 1) * 2 != len) {
            throw new DriverException("Mismatch in record length. " + len + '/'
                + Prism2Record.getRecordLength(hdr, 0));
        }

        // Copy out record data
        io.copyFromBAP(rid.getId(), hdr.length, dst, dstOffset, len);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.