block: extend interface of generic driver class
To support read-only devices like CDROMs, or rom_blk the supported block operations have to be stated by specific the device driver. Ref #966
This commit is contained in:
committed by
Norman Feske
parent
5a4cb7fcfb
commit
0c8a4f9f3a
@@ -136,8 +136,7 @@ class Block::Session_component : public Block::Session_rpc_object
|
||||
{
|
||||
*blk_count = _driver.block_count();
|
||||
*blk_size = _driver.block_size();
|
||||
ops->set_operation(Packet_descriptor::READ);
|
||||
ops->set_operation(Packet_descriptor::WRITE);
|
||||
*ops = _driver.ops();
|
||||
}
|
||||
|
||||
void sync() { _driver.sync(); }
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <base/stdint.h>
|
||||
|
||||
#include <ram_session/ram_session.h>
|
||||
|
||||
#include <block_session/block_session.h>
|
||||
|
||||
namespace Block {
|
||||
|
||||
@@ -43,6 +43,11 @@ namespace Block {
|
||||
*/
|
||||
virtual Genode::size_t block_count() = 0;
|
||||
|
||||
/**
|
||||
* Request operations supported by the device
|
||||
*/
|
||||
virtual Session::Operations ops() = 0;
|
||||
|
||||
/**
|
||||
* Read from medium
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user