FreeBSD/sys/dev/pms/RefTisa/tisa/sassata/sata/host/sat.c
/*****************************************************************************/
/*
  CBD16 has bit64 LBA
  But it has to be less than (2^28 - 1)
  Therefore, use last four bytes to compute LBA is OK
*/
CBD16 has bit64 LBA
But it has to be less than (2^28 - 1)
Therefore, use last four bytes to compute LBA is OK
CBD16 has bit64 LBA But it has to be less than ( 2^28 - 1 ) Therefore use last four bytes to compute LBA is OK
bit32 satComputeCDB16LBA(satIOContext_t            *satIOContext)
{
  tiIniScsiCmnd_t           *scsiCmnd;
  tiScsiInitiatorRequest_t *tiScsiRequest;
  bit32                     lba = 0;
  TI_DBG5(("satComputeCDB10LBA: start\n"));
  tiScsiRequest = satIOContext->tiScsiXchg;
  scsiCmnd      = &(tiScsiRequest->scsiCmnd);
  lba = (scsiCmnd->cdb[6] << (8*3)) + (scsiCmnd->cdb[7] << (8*2))
    + (scsiCmnd->cdb[8] << 8) + scsiCmnd->cdb[9];
  return lba;
}
bit32 satComputeCDB16LBA ( satIOContext_t * satIOContext ) { tiIniScsiCmnd_t * scsiCmnd ; tiScsiInitiatorRequest_t * tiScsiRequest ; bit32 lba = 0 ; TI_DBG5 ( ( " \n " ) ) ; tiScsiRequest = satIOContext -> tiScsiXchg ; scsiCmnd = & ( tiScsiRequest -> scsiCmnd ) ; lba = ( scsiCmnd -> cdb [ 6 ] << ( 8 * 3 ) ) + ( scsiCmnd -> cdb [ 7 ] << ( 8 * 2 ) ) + ( scsiCmnd -> cdb [ 8 ] << 8 ) + scsiCmnd -> cdb [ 9 ] ; return lba ; }
CBD16 has bit64 LBA
But it has to be less than (2^28 - 1)
Therefore, use last four bytes to compute LBA is OK
CBD16 has bit64 LBA But it has to be less than ( 2^28 - 1 ) Therefore use last four bytes to compute LBA is OK