Availability:
     Level 2    , 'o'

  Quick Help:
     Corrupt LBA, o[Lba],[NumBlocks],[BurstSpan],[BurstOffset],[NumberOfRandomCorrupt],[Flags]

  Description:
    This command corrupts blocks in User Area starting at the specified LBA (Logical
    Block Address) for the specified number of blocks. Each block will be corrupted by
    the specified number of bytes or symbols to corrupt. The location within the blocks where
    the corruption should occur is determined by the user specified parameters and option
    flags. This Diagnostic command basically does Read Long operation, corrupt the Diag Read
    buffer then does Write Long operation with the corrupted Diag Read buffer.

  Input Parameters:

    
    0 - LBA (Logical Block Address) number.
    
        This parameter specifies the address of the first User Area LBA to corrupt.
    
          Type:    Unsigned 32-bit value
    
          Range:   0 to maximum User Area LBA
    
          Default: None
    
    1 - Number of blocks to corrupt
    
        This parameter specifies the number of consecutive blocks to corrupt.
    
          Type:    Unsigned 32-bit value
    
          Range:   0 to 0xFFFFFFFF
    
          Default: 1
    
    2 - Number of bytes or symbols to corrupt
    
        If parameter 4 is not specified or specified with zero value then this parameter
        specifies the consecutive number of bytes or symbols to corrupt from the starting
        offset specified by the parameter 3. If parameter 4 is specified with a non-zero
        value then this parameter specifies the number of bytes or symbols to corrupt at
        random byte or symbol offsets within the region secified by the starting offset
        specified by the parameter 3 and the span specified by the parameter 4.
    
          Type:    Unsigned 16-bit value
    
          Range:   0 to 0xffff
    
          Default: None
    
    3 - Starting byte or symbol offset of the burst that will be corrupted
    
        This parameter specifies the starting byte or symbol offset value of the region that
        will be corrupted in the target block(s).
    
          Type:    Unsigned 16-bit value
    
          Range:   0 to 0xffff
    
          Default: 0
    
    4 - Span of the region for corruption at random offsets
    
        If this parameter is specified with a non-zero value then it specifies the span of
        the region within which values at random byte or symbols offsets will be corrupted
        by the number of byte or symbols to corrupt specified by the parameter 2.
    
          Type:    Unsigned 16-bit value
    
          Range:   0 to 0xffff
    
          Default: 0
    
    5 - Options
    
        This parameter is a bit-significant value that specifies the following options
    
          Bits 15-5:  not used.
    
          Bit 2:      Enable interactive mode for entering corruption parameters.
    
                      If this bit is set, then the parameter 2, 3 and 4 will be ignored and
                      the user will be prompted to enter the parameters in interactive mode.
                      This is useful for entering corruption parameters for multiple bursts.
    
          Bit 1:      Enable using byte unit.
    
                      If this bit is set, then the parameter 2, 3 and 4 will be in bytes,
                      otherwise they will be in symbols.
    
          Bit 0:      Enable ECC correction for the Read Long operation part of the
                      Corrupt LBA diagnostic command.
    
                      If this bit is set, then the ECC correction will be enabled for the
                      Read Long operation, otherwise ECC correction will be disabled.
    
          Type:    Unsigned 16-bit value
    
          Range:   0 to 0xFFFF
    
          Default: 0 (ECC Correction disabled, parameters 2,3 and 4 are in symbols)
    
  Output Data:

        If bit 2 of the input parameter 5 was set then following message will be displayed to
        prompt the user to enter the parameters as the user would do for parameter 2, 3 and 4,
        to corrupt multiple bursts within each block(s).
        
              "Enter the parameters delimited by commas as you would do for parameter 2, 3 and 4 of this command."
              "Hit Enter key at the beginning of the line when you are done with entering."
              "Burst Index aaa:"        <- This line is repeated until user finishes entering the parameters 
           
           where
           
              aaa      is the index number of the current burst being entered.


    If an error occurred, the following information will be displayed.
    
          "DiagError aaaaaaaa R/W Status c R/W Error dddddddd"
    
       and
    
          "Next User LBA eeeeeeee LLL CHS ffffff.g.hhhh PLP CHS iiiiii.j.kkkk"
          "Remaining Transfer Length llllllll"
    
       or
    
          "Next System LBA eeeeeeee LLL CHS ffffff.g.hhhh PLP CHS iiiiii.j.kkkk"
          "Remaining Transfer Length llllllll"
    
       where
    
          aaaaaaaa is the Diagnostic Error Code
    
          c is the status returned by the R/W subsystem
    
                0 = R/W request completed successfully with error recovery
                1 = R/W request completed successfully (no error recovery performed)
                2 = R/W request failed
    
          dddddddd is the error code returned by the R/W subsystem
    
          eeeeeeee is the Disk Logical Block Address of the sector in error
    
          ffffff is the Logical Cylinder Address of the sector in error
    
          g is the Logical Head Address of the sector in error
    
          hhhh is the Logical Sector Address of the sector in error
    
          iiiiii is the Physical Cylinder Address of the sector in error
    
          j is the Logical Head Address of the sector in error
    
          kkkk is the Physical Sector Address of the sector in error
    
          llllllll is the number of sectors remaining to be read or written
    
    If the Verbose Formatted ASCII Data Output Mode is selected, the Verbose Mode option
    bits will enable the following data to be output when set.
    
       Bit 0:      Enables the R/W Status and R/W Error to be displayed
       Bit 1:      Enable the Next Address to be displayed
       Bit 2:      Enables the Track Position and Track Follow Offset to be displayed
       Bit 3:      Enables the Target Address to be displayed
       Bit 4:      Enables the Recovery Status to be displayed
       Bit 5:      Enables the Fault Status to be displayed
       Bit 6:      Enables the Elapsed Time to be displayed
       Bits 31-7:  NA
    
    If Bit 0 is set, the R/W Status and R/W Error will be displayed even if no error
    occurred.  The data displayed will be formatted as shown above.
    
    If Bit 1 is set, the Next Address will be displayed even if no error occurred.  The
    data displayed will be formatted as shown above.
    
    If Bit 2 is set, the Track Position and Track Follow Offset will be displayed as
    follows.
    
          "Read Position, Persistent Offset m.m% Total Offset n.n%"          or
          "Write Position, Persistent Offset m.m% Total Offset n.n%"         or
          "Write Header Position, Persistent Offset m.m% Total Offset n.n%"
    
       where
    
          m.m is the Persistent Track Follow Offset in units of percentage of track width
    
          n.n is the Total Track Follow Offset in units of percentage of track width
    
    If Bit 3 is set, the Target Address will be displayed as follows.
    
          "Target User LBA pppppppp LLL CHS qqqqqq.r.ssss PLP CHS tttttt.u.vvvv"
          "Starting Transfer Length wwwwwwww"
    
       or
    
          "Target System LBA pppppppp LLL CHS qqqqqq.r.ssss PLP CHS tttttt.u.vvvv"
          "Starting Transfer Length wwwwwwww"
    
       where
    
          pppppppp is the starting Disk Logical Block Address
    
          qqqqqq is the starting Logical Cylinder Address
    
          r is the starting Logical Head Address
    
          ssss is the starting Logical Sector Address
    
          tttttt is the starting Physical Cylinder Address
    
          u is the starting Logical Head Address
    
          vvvv is the starting Physical Sector Address
    
          wwwwwwww is the starting Transfer Length
    
    If Bit 4 is set, the Recovery Status will be displayed as follows.
    
          "Recovered User LBA AAAAAAAA LLL CHS BBBBBB.C.DDDD PLP CHS EEEEEE.F.GGGG"
          "Recovery Flags HHHH Count II"
    
       or
    
          "Recovered System LBA AAAAAAAA LLL CHS BBBBBB.C.DDDD PLP CHS EEEEEE.F.GGGG"
          "Recovery Flags HHHH Count II"
    
       where
    
          AAAAAAAA is the Disk Logical Block Address of the last recovered sector
    
          BBBBBB is the Logical Cylinder Address of the last recovered sector
    
          C is the Logical Head Address of the last recovered sector
    
          DDDD is the Logical Sector Address of the last recovered sector
    
          EEEEEE is the Physical Cylinder Address of the last recovered sector
    
          F is the Logical Head Address of the last recovered sector
    
          GGGG is the Physical Sector Address of the last recovered sector
    
          HHHH are the Recovery Flags reported by the Read/Write code
    
          II is the Recovery Count reported by the Read/Write code
    
    If Bit 5 is set, the Fault Status will be displayed as follows.
    
          "Drive Fault Status JJJJ Preamp Fault Status KKKK"
          "Read Channel Faults:
           SRC Fault Reg 190 = aaaa
           SRC Fault Reg 191 = bbbb
           SID Reg 20B = cccc
           SID Reg 26C = dddd
           SID Reg 26F = eeee
           SID Reg 251 = fffff
    
       where
    
          JJJJ is the Drive Fault Status reported by the Read/Write code
    
          KKKK is the Preamp Fault Status reported by the Read/Write code
    
          aaaa  is the SRC channel fault Register 190h value
    
          bbbb is the SRC channel fault register 191h value
    
          cccc is the SID channel fault register 20bh   value
    
          dddd is the SID channel fault reg 26ch   value
    
          eeee is the SID Channel fault reg 251h value
    
    If Bit 6 is set, the Elapsed Time for the read/write operation will be displayed.

    
       "Elapsed Time a mins b secs"  or
       "Elapsed Time b.c secs"       or
       "Elapsed Time c.d msecs"
    
    where
    
       a is minutes
       b is seconds
       c is milliseconds
       d is microseconds
  
  Examples:

    Example #1:
    To corrupt a single LBA at byte offsets from 0 to 0xF (in this case LBA 0x51237).

      F3 2>o51237,,10,,,2
      or
      F3 2>o51237,1,10,0,0,2

    Example #2:
    To corrupt multiple LBAs at byte offsets from 0x100 to 0x11F for each block
    (in this case LBAs from 0x51237 to 0x51247).

       F3 2>o51237,11,20,100,,2
       or
       F3 2>o51237,11,20,100,0,2

    Example #3:
    To corrupt a single LBA at 16(0x10) random byte offsets within 0x100 and 0x17F
    (in this case LBA at 0x51237).

       F3 2>o51237,,10,100,80,2
       or
       F3 2>o51237,1,10,100,80,2

    Example #4:
    To corrupt a single LBA at byte offsets from 0x30 to 00x37 with ECC correction enabled
    (in this case LBA 0x51237)

       F3 2>o51237,,8,30,,3
       or
       F3 2>o51237,1,8,30,0,3

    Example #5:
    To corrupt a single LBA at 32(0x20) random byte offsets within 0x80 and 0xBF with ECC
    correction enabled (in this case LBA 0x51237).

       F3 2>o51237,,20,80,40,3
       or
       F3 2>o51237,1,20,80,40,3

    Example #6:
    To corrupt a single LBA at symbol offsets from 0 to 0xF (in this case LBA 0x51237).

      F3 2>o51237,,10
      or
      F3 2>o51237,1,10,0,0,0

    Example #7:
    To corrupt multiple LBAs at symbol offsets from 0x100 to 0x11F for each block
    (in this case LBAs from 0x51237 to 0x51247).

       F3 2>o51237,11,20,100
       or
       F3 2>o51237,11,20,100,0,0

    Example #8:
    To corrupt a single LBA at 16(0x10) random symbol offsets within 0x100 and 0x17F
    (in this case LBA at 0x51237).

       F3 2>o51237,,10,100,80
       or
       F3 2>o51237,1,10,100,80,0

    Example #9:
    To corrupt a single LBA at symbol offsets from 0x30 to 00x37 with ECC correction enabled
    (in this case LBA 0x51237)

       F3 2>o51237,,8,30,,1
       or
       F3 2>o51237,1,8,30,0,1

    Example #10:
    To corrupt a single LBA at 32(0x20) random symbol offsets within 0x80 and 0xBF with ECC
    correction enabled (in this case LBA 0x51237).

       F3 2>o51237,,20,80,40,1
       or
       F3 2>o51237,1,20,80,40,1

  Revision History:

    0001.0000   Initial revision.
    0002.0000   Revised flag parameter to support symbol based corruption.
                Revised flag parameter to support entering parameters for corrupting multiple
                bursts.
                Also added one additional parameter to allow the users to select the region for
                random corruption any way they want.