mirror of
https://github.com/dingusdev/dingusppc.git
synced 2024-06-01 14:41:34 +00:00
scsicdrom, scsihd: Check lun.
READ_CAPACITY_10, READ_6, and READ_10 now checks LUN that is included in CDB and returns a CHECK_CONDITION if it doesn't match.
This commit is contained in:
parent
6bb5227ee1
commit
c999c51d77
|
@ -178,6 +178,9 @@ bool ScsiCdrom::get_more_data() {
|
||||||
|
|
||||||
void ScsiCdrom::read(uint32_t lba, uint16_t nblocks, uint8_t cmd_len)
|
void ScsiCdrom::read(uint32_t lba, uint16_t nblocks, uint8_t cmd_len)
|
||||||
{
|
{
|
||||||
|
if (!check_lun())
|
||||||
|
return;
|
||||||
|
|
||||||
if (cmd_len == 6 && nblocks == 0)
|
if (cmd_len == 6 && nblocks == 0)
|
||||||
nblocks = 256;
|
nblocks = 256;
|
||||||
|
|
||||||
|
@ -381,6 +384,9 @@ void ScsiCdrom::read_capacity_10()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!check_lun())
|
||||||
|
return;
|
||||||
|
|
||||||
int last_lba = (int)this->size_blocks - 1;
|
int last_lba = (int)this->size_blocks - 1;
|
||||||
|
|
||||||
WRITE_DWORD_BE_A(&this->data_buf[0], last_lba);
|
WRITE_DWORD_BE_A(&this->data_buf[0], last_lba);
|
||||||
|
|
|
@ -323,6 +323,9 @@ void ScsiHardDisk::read_capacity_10() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!check_lun())
|
||||||
|
return;
|
||||||
|
|
||||||
uint32_t last_lba = this->total_blocks - 1;
|
uint32_t last_lba = this->total_blocks - 1;
|
||||||
uint32_t blk_len = this->sector_size;
|
uint32_t blk_len = this->sector_size;
|
||||||
|
|
||||||
|
@ -346,6 +349,9 @@ void ScsiHardDisk::format() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScsiHardDisk::read(uint32_t lba, uint16_t transfer_len, uint8_t cmd_len) {
|
void ScsiHardDisk::read(uint32_t lba, uint16_t transfer_len, uint8_t cmd_len) {
|
||||||
|
if (!check_lun())
|
||||||
|
return;
|
||||||
|
|
||||||
uint32_t transfer_size = transfer_len;
|
uint32_t transfer_size = transfer_len;
|
||||||
|
|
||||||
std::memset(this->data_buf, 0, sizeof(this->data_buf));
|
std::memset(this->data_buf, 0, sizeof(this->data_buf));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user