Lines Matching refs:lba
289 uint32_t lba; in SCSI_CMD_STRUCT() local
298 uint32_t lba; in SCSI_CMD_STRUCT() local
688 validate_transfer_length(struct scsi_ctx *ctx, uint32_t lba, uint16_t length) in validate_transfer_length() argument
690 uint32_t last_lba = lba + length - 1; in validate_transfer_length()
692 if (lba >= ctx->sector_count) { in validate_transfer_length()
693 LOG_WRN("LBA %d is out of range", lba); in validate_transfer_length()
702 if ((last_lba >= ctx->sector_count) || (last_lba < lba)) { in validate_transfer_length()
703 LOG_WRN("%d blocks starting at %d go out of bounds", length, lba); in validate_transfer_length()
716 if (disk_access_read(ctx->disk, buf, ctx->lba, sectors) != 0) { in fill_read_10()
720 ctx->lba += sectors; in fill_read_10()
726 uint32_t lba = sys_be32_to_cpu(cmd->lba); in SCSI_CMD_HANDLER() local
735 if (validate_transfer_length(ctx, lba, transfer_length)) { in SCSI_CMD_HANDLER()
740 ctx->lba = lba; in SCSI_CMD_HANDLER()
754 if (disk_access_write(ctx->disk, buf, ctx->lba, sectors) != 0) { in store_write_10()
769 ctx->lba += sectors; in store_write_10()
780 uint32_t lba = sys_be32_to_cpu(cmd->lba); in SCSI_CMD_HANDLER() local
789 if (validate_transfer_length(ctx, lba, transfer_length)) { in SCSI_CMD_HANDLER()
794 ctx->lba = lba; in SCSI_CMD_HANDLER()