Package org.jscsi.scsi.protocol.cdb

Examples of org.jscsi.scsi.protocol.cdb.CDB


   //

   @Test
   public void TestReadWriteCompare6()
   {
      CDB cdb1 = new Write6(false, true, 10, NUM_BLOCKS_TRANSFER);
      Command cmd1 =
            new Command(this.transport.createNexus(this.cmdRef), cdb1, TaskAttribute.ORDERED,
                  this.cmdRef, 0);
      this.transport.createReadData(NUM_BLOCKS_TRANSFER * STORE_BLOCK_SIZE, this.cmdRef);
      lu.enqueue(this.transport, cmd1);
      this.cmdRef++;

      CDB cdb2 = new Read6(false, true, 10, NUM_BLOCKS_TRANSFER);
      Command cmd2 =
            new Command(this.transport.createNexus(this.cmdRef), cdb2, TaskAttribute.ORDERED,
                  this.cmdRef, 0);
      lu.enqueue(this.transport, cmd2);

View Full Code Here


   }

   @Test
   public void TestReadWriteCompare10()
   {
      CDB cdb1 = new Write10(0, false, false, false, false, false, 10, NUM_BLOCKS_TRANSFER);
      Command cmd1 =
            new Command(this.transport.createNexus(this.cmdRef), cdb1, TaskAttribute.ORDERED,
                  this.cmdRef, 0);
      this.transport.createReadData(NUM_BLOCKS_TRANSFER * STORE_BLOCK_SIZE, this.cmdRef);
      lu.enqueue(this.transport, cmd1);
      this.cmdRef++;

      CDB cdb2 = new Read10(0, false, false, false, false, false, 10, NUM_BLOCKS_TRANSFER);
      Command cmd2 =
            new Command(this.transport.createNexus(this.cmdRef), cdb2, TaskAttribute.ORDERED,
                  this.cmdRef, 0);
      lu.enqueue(this.transport, cmd2);

View Full Code Here

   }

   @Test
   public void TestReadWriteCompare12()
   {
      CDB cdb1 = new Write12(0, false, false, false, false, false, 10, NUM_BLOCKS_TRANSFER);
      Command cmd1 =
            new Command(this.transport.createNexus(this.cmdRef), cdb1, TaskAttribute.ORDERED,
                  this.cmdRef, 0);
      this.transport.createReadData(NUM_BLOCKS_TRANSFER * STORE_BLOCK_SIZE, this.cmdRef);
      lu.enqueue(this.transport, cmd1);
      this.cmdRef++;

      CDB cdb2 = new Read12(0, false, false, false, false, false, 10, NUM_BLOCKS_TRANSFER);
      Command cmd2 =
            new Command(this.transport.createNexus(this.cmdRef), cdb2, TaskAttribute.ORDERED,
                  this.cmdRef, 0);
      lu.enqueue(this.transport, cmd2);

View Full Code Here

   }

   @Test
   public void TestReadWriteCompare16()
   {
      CDB cdb1 = new Write16(0, false, false, false, false, false, 10, NUM_BLOCKS_TRANSFER);
      Command cmd1 =
            new Command(this.transport.createNexus(this.cmdRef), cdb1, TaskAttribute.ORDERED,
                  this.cmdRef, 0);
      this.transport.createReadData(NUM_BLOCKS_TRANSFER * STORE_BLOCK_SIZE, this.cmdRef);
      lu.enqueue(this.transport, cmd1);
      this.cmdRef++;

      CDB cdb2 = new Read16(0, false, false, false, false, false, 10, NUM_BLOCKS_TRANSFER);
      Command cmd2 =
            new Command(this.transport.createNexus(this.cmdRef), cdb2, TaskAttribute.ORDERED,
                  this.cmdRef, 0);
      lu.enqueue(this.transport, cmd2);

View Full Code Here

   {
      if (Thread.interrupted())
         throw new InterruptedException();

      // check how much data may be returned
      CDB cdb = this.command.getCommandDescriptorBlock();
      long transferLength = 0;
      if (cdb instanceof TransferCDB)
      {
         transferLength = ((TransferCDB) cdb).getTransferLength();
      }
View Full Code Here

   }

   @Override
   protected void execute() throws InterruptedException, SenseException
   {
      CDB cdb = getCommand().getCommandDescriptorBlock();
      assert cdb instanceof Inquiry;

      Inquiry inquiryCDB = (Inquiry) cdb;

      if (inquiryCDB.isEVPD())
View Full Code Here

   private Collection<ModePage> execute6(ModePageRegistry registry, byte pageCode, int subPageCode)
         throws ModeSenseException
   {
      // We allocate 200 bytes for return data
      CDB cdb = new ModeSense6(true, 0, pageCode, subPageCode, 200);

      TestTargetTransportPort port = new TestTargetTransportPort(null, false);
      Command command =
            new Command(new Nexus("initiator", "target", 0, 0), cdb, TaskAttribute.SIMPLE, 0, 0);
      InquiryDataRegistry inqreg = new StaticInquiryDataRegistry();
View Full Code Here

   }

   private void performWrite6(int lba, int numBlocks, ByteBuffer data)
   {
      _logger.debug("********** WRITE6 MEMORY **********");
      CDB cdb = new Write6(false, true, lba, numBlocks);
      this.addReadData(numBlocks * STORE_BLOCK_SIZE, cmdRef, data);
      this.submitMemoryTask(cdb, cmdRef);
      this.purgeReadData(cmdRef);
      cmdRef++;
   }
View Full Code Here

   }

   private void performWrite10(int lba, int numBlocks, ByteBuffer data)
   {
      _logger.debug("********** WRITE10 MEMORY **********");
      CDB cdb = new Write10(0, false, false, false, false, false, lba, numBlocks);
      this.addReadData(numBlocks * STORE_BLOCK_SIZE, cmdRef, data);
      this.submitMemoryTask(cdb, cmdRef);
      this.purgeReadData(cmdRef);
      cmdRef++;
   }
View Full Code Here

   }

   private void performWrite12(int lba, int numBlocks, ByteBuffer data)
   {
      _logger.debug("********** WRITE12 MEMORY **********");
      CDB cdb = new Write12(0, false, false, false, false, false, lba, numBlocks);
      this.addReadData(numBlocks * STORE_BLOCK_SIZE, cmdRef, data);
      this.submitMemoryTask(cdb, cmdRef);
      this.purgeReadData(cmdRef);
      cmdRef++;
   }
View Full Code Here

TOP

Related Classes of org.jscsi.scsi.protocol.cdb.CDB

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.