part_blk: propagate back end information

Propagate supported device operations and read/write errors from back end to
client.
This commit is contained in:
Sebastian Sumpf 2015-05-11 14:59:30 +02:00 committed by Christian Helmuth
parent 88034ef836
commit 8eb2286f60
2 changed files with 5 additions and 5 deletions

View File

@ -146,7 +146,7 @@ class Block::Session_component : public Block::Session_rpc_object,
request.block_count() * Driver::driver().blk_size();
Genode::memcpy(tx_sink()->packet_content(request), src, sz);
}
request.succeeded(true);
request.succeeded(reply.succeeded());
_ack_packet(request);
if (_ack_queue_full)
@ -179,8 +179,7 @@ class Block::Session_component : public Block::Session_rpc_object,
{
*blk_count = _partition->sectors;
*blk_size = Driver::driver().blk_size();
ops->set_operation(Packet_descriptor::READ);
ops->set_operation(Packet_descriptor::WRITE);
*ops = Driver::driver().ops();
}
void sync() { Driver::driver().session().sync(); }

View File

@ -83,6 +83,7 @@ class Block::Driver
Genode::size_t _blk_size;
Genode::Signal_dispatcher<Driver> _source_ack;
Genode::Signal_dispatcher<Driver> _source_submit;
Block::Session::Operations _ops;
void _ready_to_submit(unsigned);
@ -113,12 +114,12 @@ class Block::Driver
_source_ack(receiver, *this, &Driver::_ack_avail),
_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_cnt() { return _blk_cnt; }
Session::Operations ops() { return _ops; }
Session_client& session() { return _session; }
void work_asynchronously()