mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-19 15:43:56 +00:00
part_blk: propagate back end information
Propagate supported device operations and read/write errors from back end to client.
This commit is contained in:
committed by
Christian Helmuth
parent
88034ef836
commit
8eb2286f60
@ -146,7 +146,7 @@ class Block::Session_component : public Block::Session_rpc_object,
|
|||||||
request.block_count() * Driver::driver().blk_size();
|
request.block_count() * Driver::driver().blk_size();
|
||||||
Genode::memcpy(tx_sink()->packet_content(request), src, sz);
|
Genode::memcpy(tx_sink()->packet_content(request), src, sz);
|
||||||
}
|
}
|
||||||
request.succeeded(true);
|
request.succeeded(reply.succeeded());
|
||||||
_ack_packet(request);
|
_ack_packet(request);
|
||||||
|
|
||||||
if (_ack_queue_full)
|
if (_ack_queue_full)
|
||||||
@ -179,8 +179,7 @@ class Block::Session_component : public Block::Session_rpc_object,
|
|||||||
{
|
{
|
||||||
*blk_count = _partition->sectors;
|
*blk_count = _partition->sectors;
|
||||||
*blk_size = Driver::driver().blk_size();
|
*blk_size = Driver::driver().blk_size();
|
||||||
ops->set_operation(Packet_descriptor::READ);
|
*ops = Driver::driver().ops();
|
||||||
ops->set_operation(Packet_descriptor::WRITE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void sync() { Driver::driver().session().sync(); }
|
void sync() { Driver::driver().session().sync(); }
|
||||||
|
@ -83,6 +83,7 @@ class Block::Driver
|
|||||||
Genode::size_t _blk_size;
|
Genode::size_t _blk_size;
|
||||||
Genode::Signal_dispatcher<Driver> _source_ack;
|
Genode::Signal_dispatcher<Driver> _source_ack;
|
||||||
Genode::Signal_dispatcher<Driver> _source_submit;
|
Genode::Signal_dispatcher<Driver> _source_submit;
|
||||||
|
Block::Session::Operations _ops;
|
||||||
|
|
||||||
void _ready_to_submit(unsigned);
|
void _ready_to_submit(unsigned);
|
||||||
|
|
||||||
@ -113,12 +114,12 @@ class Block::Driver
|
|||||||
_source_ack(receiver, *this, &Driver::_ack_avail),
|
_source_ack(receiver, *this, &Driver::_ack_avail),
|
||||||
_source_submit(receiver, *this, &Driver::_ready_to_submit)
|
_source_submit(receiver, *this, &Driver::_ready_to_submit)
|
||||||
{
|
{
|
||||||
Block::Session::Operations ops;
|
_session.info(&_blk_cnt, &_blk_size, &_ops);
|
||||||
_session.info(&_blk_cnt, &_blk_size, &ops);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Genode::size_t blk_size() { return _blk_size; }
|
Genode::size_t blk_size() { return _blk_size; }
|
||||||
Genode::size_t blk_cnt() { return _blk_cnt; }
|
Genode::size_t blk_cnt() { return _blk_cnt; }
|
||||||
|
Session::Operations ops() { return _ops; }
|
||||||
Session_client& session() { return _session; }
|
Session_client& session() { return _session; }
|
||||||
|
|
||||||
void work_asynchronously()
|
void work_asynchronously()
|
||||||
|
Reference in New Issue
Block a user