mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-18 18:56:29 +00:00
ahci: disable atapi support by default
If needed it has to be enabled explicitly as documented in the README. Related to issue #1906
This commit is contained in:
parent
16adc852a5
commit
46a7b2ea66
@ -17,7 +17,7 @@ which client can access a certain device:
|
|||||||
! <route>
|
! <route>
|
||||||
! <any-service> <parent /> <any-child /> </any-service>
|
! <any-service> <parent /> <any-child /> </any-service>
|
||||||
! </route>
|
! </route>
|
||||||
! <config>
|
! <config atapi="no">
|
||||||
! <!-- use model and serial number -->
|
! <!-- use model and serial number -->
|
||||||
! <policy label="test-ahci" model="QEMU HARDDISK" serial="QM00005" />
|
! <policy label="test-ahci" model="QEMU HARDDISK" serial="QM00005" />
|
||||||
! <!-- use controller port number -->
|
! <!-- use controller port number -->
|
||||||
@ -27,4 +27,5 @@ which client can access a certain device:
|
|||||||
|
|
||||||
In the example above, a session request labeled with "test-ahci" gains access to
|
In the example above, a session request labeled with "test-ahci" gains access to
|
||||||
a device with certain model and serial numbers, while "bench" gains access to
|
a device with certain model and serial numbers, while "bench" gains access to
|
||||||
device at port 1.
|
device at port 1. ATAPI support is by default disabled and can be enabled by
|
||||||
|
setting the config attribute "atapi" to "yes".
|
||||||
|
@ -49,10 +49,12 @@ struct Ahci
|
|||||||
Signal_rpc_member<Ahci> irq;
|
Signal_rpc_member<Ahci> irq;
|
||||||
Signal_rpc_member<Ahci> device_ready;
|
Signal_rpc_member<Ahci> device_ready;
|
||||||
unsigned ready_count = 0;
|
unsigned ready_count = 0;
|
||||||
|
bool enable_atapi;
|
||||||
|
|
||||||
Ahci(Ahci_root &root)
|
Ahci(Ahci_root &root, bool support_atapi)
|
||||||
: root(root), irq(root.entrypoint(), *this, &Ahci::handle_irq),
|
: root(root), irq(root.entrypoint(), *this, &Ahci::handle_irq),
|
||||||
device_ready(root.entrypoint(), *this, &Ahci::ready)
|
device_ready(root.entrypoint(), *this, &Ahci::ready),
|
||||||
|
enable_atapi(support_atapi)
|
||||||
{
|
{
|
||||||
info();
|
info();
|
||||||
|
|
||||||
@ -68,7 +70,7 @@ struct Ahci
|
|||||||
|
|
||||||
bool atapi(unsigned sig)
|
bool atapi(unsigned sig)
|
||||||
{
|
{
|
||||||
return sig == ATAPI_SIG_QEMU || sig == ATAPI_SIG;
|
return enable_atapi && (sig == ATAPI_SIG_QEMU || sig == ATAPI_SIG);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ata(unsigned sig)
|
bool ata(unsigned sig)
|
||||||
@ -208,9 +210,9 @@ static Ahci *sata_ahci(Ahci *ahci = 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Ahci_driver::init(Ahci_root &root)
|
void Ahci_driver::init(Ahci_root &root, bool support_atapi)
|
||||||
{
|
{
|
||||||
static Ahci ahci(root);
|
static Ahci ahci(root, support_atapi);
|
||||||
sata_ahci(&ahci);
|
sata_ahci(&ahci);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ struct Ahci_root
|
|||||||
|
|
||||||
namespace Ahci_driver {
|
namespace Ahci_driver {
|
||||||
|
|
||||||
void init(Ahci_root &ep);
|
void init(Ahci_root &ep, bool support_atapi);
|
||||||
|
|
||||||
bool avail(long device_num);
|
bool avail(long device_num);
|
||||||
long device_number(char const *model_num, char const *serial_num);
|
long device_number(char const *model_num, char const *serial_num);
|
||||||
|
@ -155,7 +155,8 @@ struct Main
|
|||||||
: root(ep, Genode::env()->heap())
|
: root(ep, Genode::env()->heap())
|
||||||
{
|
{
|
||||||
PINF("--- Starting AHCI driver -> done right .-) --\n");
|
PINF("--- Starting AHCI driver -> done right .-) --\n");
|
||||||
Ahci_driver::init(root);
|
bool support_atapi = Genode::config()->xml_node().attribute_value("atapi", false);
|
||||||
|
Ahci_driver::init(root, support_atapi);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user