mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-21 22:47:50 +00:00
parent
3d480ec947
commit
106a5f1d4d
@ -223,7 +223,7 @@ struct Usb::Block_driver : Usb::Completion,
|
||||
Capacity_response_10 r((addr_t)data);
|
||||
if (verbose_scsi) r.dump();
|
||||
|
||||
block_count = r.block_count();
|
||||
block_count = r.last_block() + 1;
|
||||
block_size = r.block_size();
|
||||
break;
|
||||
}
|
||||
@ -232,7 +232,7 @@ struct Usb::Block_driver : Usb::Completion,
|
||||
Capacity_response_16 r((addr_t)data);
|
||||
if (verbose_scsi) r.dump();
|
||||
|
||||
block_count = r.block_count();
|
||||
block_count = r.last_block() + 1;
|
||||
block_size = r.block_size();
|
||||
break;
|
||||
}
|
||||
|
@ -176,18 +176,18 @@ struct Scsi::Capacity_response_10 : Genode::Mmio
|
||||
{
|
||||
enum { LENGTH = 8 };
|
||||
|
||||
struct Bc : Register<0x0, 32> { };
|
||||
struct Bs : Register<0x4, 32> { };
|
||||
struct Lba : Register<0x0, 32> { };
|
||||
struct Bs : Register<0x4, 32> { };
|
||||
|
||||
Capacity_response_10(addr_t addr) : Mmio(addr) { }
|
||||
|
||||
uint32_t block_count() const { return be32(read<Bc>()); }
|
||||
uint32_t block_size() const { return be32(read<Bs>()); }
|
||||
uint32_t last_block() const { return be32(read<Lba>()); }
|
||||
uint32_t block_size() const { return be32(read<Bs>()); }
|
||||
|
||||
void dump()
|
||||
{
|
||||
Genode::log("--- Dump READ_CAPACITY_10 data ---");
|
||||
Genode::log("Bc: ", Genode::Hex(block_count()));
|
||||
Genode::log("Lba: ", Genode::Hex(last_block()));
|
||||
Genode::log("Bs: ", Genode::Hex(block_size()));
|
||||
}
|
||||
};
|
||||
@ -197,18 +197,18 @@ struct Scsi::Capacity_response_16 : Genode::Mmio
|
||||
{
|
||||
enum { LENGTH = 32 };
|
||||
|
||||
struct Bc : Register<0x0, 64> { };
|
||||
struct Bs : Register<0x8, 32> { };
|
||||
struct Lba : Register<0x0, 64> { };
|
||||
struct Bs : Register<0x8, 32> { };
|
||||
|
||||
Capacity_response_16(addr_t addr) : Mmio(addr) { }
|
||||
|
||||
uint64_t block_count() const { return be64(read<Bc>()); }
|
||||
uint32_t block_size() const { return be32(read<Bs>()); }
|
||||
uint64_t last_block() const { return be64(read<Lba>()); }
|
||||
uint32_t block_size() const { return be32(read<Bs>()); }
|
||||
|
||||
void dump()
|
||||
{
|
||||
Genode::log("--- Dump READ_CAPACITY_16 data ---");
|
||||
Genode::log("Bc: ", Genode::Hex(block_count()));
|
||||
Genode::log("Lba: ", Genode::Hex(last_block()));
|
||||
Genode::log("Bs: ", Genode::Hex(block_size()));
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user