Package org.jnode.driver.bus.ide

Examples of org.jnode.driver.bus.ide.IDEBus


         */
        public final int executeCommand(CDB cdb, byte[] data,
                                        int dataOffset, long timeout) throws SCSIException,
            TimeoutException, InterruptedException {
            final IDEDevice dev = (IDEDevice) getDevice();
            final IDEBus bus = (IDEBus) dev.getBus();

            final IDEPacketCommand cmd = new IDEPacketCommand(
                dev.isPrimary(), dev.isMaster(), cdb.toByteArray(), data,
                dataOffset);
            bus.executeAndWait(cmd, timeout);

            if (!cmd.isFinished()) {
                throw new TimeoutException("Timeout in SCSI command");
            } else if (cmd.hasError()) {
                throw new SCSIException("Command error 0x" + NumberUtils.hex(cmd.getError(), 2));
View Full Code Here


                ") must be a multiple of SECTOR_SIZE(" + IDEConstants.SECTOR_SIZE + ")");
        }

        boolean master = true;
        boolean primary = true;
        IDEBus ideBus;
        try {
            ideBus = IDEDriverUtils.getIDEDeviceFactory().createIDEBus(parentDev, primary);
        } catch (NamingException ex) {
            throw new DriverException(ex);
        }
View Full Code Here

        if (lbaStart + sectors > this.maxSector) {
            throw new IOException(errorSource + " beyond device sectors");
        }

        final IDEDevice dev = (IDEDevice) getDevice();
        final IDEBus bus = (IDEBus) dev.getBus();
        final int maxSectorCount = is48bit ? MAX_SECTOR_COUNT_48 : MAX_SECTOR_COUNT_28;
        final boolean primary = dev.isPrimary();
        final boolean master = dev.isMaster();

        while (length > 0) {
            final long partLbaStart = devOffset / SECTOR_SIZE;
            final int partSectorCount = Math.min(length / SECTOR_SIZE, maxSectorCount);
            final int partLength = partSectorCount * SECTOR_SIZE;

            final IDERWSectorsCommand cmd = isWrite ?
                new IDEWriteSectorsCommand(primary, master, is48bit, partLbaStart, partSectorCount, buf) :
                new IDEReadSectorsCommand(primary, master, is48bit, partLbaStart, partSectorCount, buf);
            try {
                log.debug("bus.exAndWt" + (isWrite ? "W" : "R") + " dev=" + dev.getId() + " start=" + partLbaStart +
                    " sectors=" + partSectorCount + " len=" + partLength);
                bus.executeAndWait(cmd, IDE_DATA_XFER_TIMEOUT);
            } catch (InterruptedException ex) {
                throw new IOException("IDE " + errorSource + " interrupted", ex);
            } catch (TimeoutException ex) {
                throw new InterruptedIOException("IDE timeout: " + ex.getMessage());
            }
View Full Code Here

TOP

Related Classes of org.jnode.driver.bus.ide.IDEBus

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.