mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-08 11:55:24 +00:00
usb: Storage support for ARM
This commit is contained in:
parent
3cb6de2e69
commit
fbbd2018bb
@ -114,7 +114,7 @@ help:
|
||||
$(ECHO) "cleanall - remove contib sources and downloaded archives"
|
||||
$(ECHO)
|
||||
|
||||
prepare: $(CONTRIB_DIR)/.prepared
|
||||
prepare: clean $(CONTRIB_DIR)/.prepared
|
||||
|
||||
$(CONTRIB_DIR)/.prepared: Makefile
|
||||
$(CONTRIB_DIR)/.prepared: $(DOWNLOAD_DIR)/$(LINUX_TBZ2)
|
||||
|
@ -88,7 +88,7 @@ install_config $config
|
||||
|
||||
# generic modules
|
||||
set boot_modules {
|
||||
core init timer usb_drv pci_drv test-block
|
||||
core init timer usb_drv test-block
|
||||
}
|
||||
|
||||
lappend_if [have_spec acpi] boot_modules acpi_drv
|
||||
|
@ -796,12 +796,6 @@ int scsi_get_resid(struct scsi_cmnd *cmd) { TRACE; return 0; }
|
||||
void scsi_report_bus_reset(struct Scsi_Host *shost, int channel) { TRACE; }
|
||||
void scsi_report_device_reset(struct Scsi_Host *shost, int channel, int target) { TRACE; }
|
||||
|
||||
void scsi_eh_prep_cmnd(struct scsi_cmnd *scmd,
|
||||
struct scsi_eh_save *ses, unsigned char *cmnd,
|
||||
int cmnd_size, unsigned sense_bytes) { TRACE; }
|
||||
|
||||
void scsi_eh_restore_cmnd(struct scsi_cmnd* scmd,
|
||||
struct scsi_eh_save *ses) { TRACE; }
|
||||
|
||||
|
||||
int scsi_normalize_sense(const u8 *sense_buffer, int sb_len,
|
||||
|
@ -2660,7 +2660,10 @@ unsigned int queue_max_hw_sectors(struct request_queue *q);
|
||||
** scsi/scsi_eh.h **
|
||||
*******************/
|
||||
|
||||
struct scsi_eh_save { };
|
||||
struct scsi_eh_save
|
||||
{
|
||||
unsigned char cmd_len;
|
||||
};
|
||||
|
||||
struct scsi_sense_hdr
|
||||
{
|
||||
|
@ -268,7 +268,7 @@ namespace Nic {
|
||||
/**
|
||||
* Root component, handling new session requests
|
||||
*/
|
||||
class Root : public Packet_root<Root_component, Session_component>
|
||||
class Root : public Packet_root<Root_component, Session_component, true>
|
||||
{
|
||||
public:
|
||||
|
||||
|
@ -63,19 +63,22 @@ struct Services
|
||||
}
|
||||
|
||||
try {
|
||||
config()->xml_node().attribute("uhci").has_value("yes");
|
||||
if (!config()->xml_node().attribute("uhci").has_value("yes"))
|
||||
throw -1;
|
||||
uhci = true;
|
||||
PINF("Enabled UHCI (USB 1.0/1.1) support");
|
||||
} catch (...) { }
|
||||
|
||||
try {
|
||||
config()->xml_node().attribute("ehci").has_value("yes");
|
||||
if (!config()->xml_node().attribute("ehci").has_value("yes"))
|
||||
throw -1;
|
||||
ehci = true;
|
||||
PINF("Enabled EHCI (USB 2.0) support");
|
||||
} catch (...) { }
|
||||
|
||||
try {
|
||||
config()->xml_node().attribute("xhci").has_value("yes");
|
||||
if (!config()->xml_node().attribute("xhci").has_value("yes"))
|
||||
throw -1;
|
||||
xhci = true;
|
||||
PINF("Enabled XHCI (USB 3.0) support");
|
||||
} catch (...) { }
|
||||
|
@ -79,7 +79,7 @@ class Packet_session_component : public RPC
|
||||
/**
|
||||
* Root component, handling new session requests
|
||||
*/
|
||||
template <typename ROOT_COMPONENT, typename SESSION_COMPONENT>
|
||||
template <typename ROOT_COMPONENT, typename SESSION_COMPONENT, bool CACHED>
|
||||
class Packet_root : public ROOT_COMPONENT
|
||||
{
|
||||
private:
|
||||
@ -122,8 +122,8 @@ class Packet_session_component : public RPC
|
||||
}
|
||||
|
||||
return new (ROOT_COMPONENT::md_alloc())
|
||||
SESSION_COMPONENT(env()->ram_session()->alloc(tx_buf_size),
|
||||
env()->ram_session()->alloc(rx_buf_size),
|
||||
SESSION_COMPONENT(env()->ram_session()->alloc(tx_buf_size, CACHED),
|
||||
env()->ram_session()->alloc(rx_buf_size, CACHED),
|
||||
_ep, _sig_rec, _device);
|
||||
}
|
||||
|
||||
|
@ -107,7 +107,7 @@ namespace Block {
|
||||
/**
|
||||
* Root component, handling new session requests
|
||||
*/
|
||||
class Root : public Packet_root<Root_component, Session_component>
|
||||
class Root : public Packet_root<Root_component, Session_component, false>
|
||||
{
|
||||
public:
|
||||
|
||||
|
@ -65,17 +65,6 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *t, int priv_size)
|
||||
host->max_id = 8;
|
||||
host->hostt = t;
|
||||
|
||||
// rval = scsi_setup_command_freelist(shost);
|
||||
// if (rval)
|
||||
// goto fail_kfree;
|
||||
|
||||
// shost->ehandler = kthread_run(scsi_error_handler, shost,
|
||||
// "scsi_eh_%d", shost->host_no);
|
||||
// if (IS_ERR(shost->ehandler)) {
|
||||
// rval = PTR_ERR(shost->ehandler);
|
||||
// goto fail_destroy_freelist;
|
||||
// }
|
||||
|
||||
return host;
|
||||
}
|
||||
|
||||
@ -136,6 +125,7 @@ struct scsi_cmnd *_scsi_alloc_command()
|
||||
cmnd->sdb.table.sgl = (struct scatterlist *)kmalloc(sizeof(struct scatterlist), GFP_KERNEL);
|
||||
cmnd->cmnd = kzalloc(MAX_COMMAND_SIZE, 0);
|
||||
cmnd->sdb.table.sgl->page_link = (unsigned long) kzalloc(sizeof(struct page), 0);
|
||||
cmnd->sense_buffer = kmalloc(SCSI_SENSE_BUFFERSIZE, GFP_KERNEL);
|
||||
return cmnd;
|
||||
}
|
||||
|
||||
@ -144,6 +134,7 @@ void _scsi_free_command(struct scsi_cmnd *cmnd)
|
||||
{
|
||||
kfree((void *)cmnd->sdb.table.sgl->page_link);
|
||||
kfree(cmnd->sdb.table.sgl);
|
||||
kfree(cmnd->sense_buffer);
|
||||
kfree(cmnd->cmnd);
|
||||
kfree(cmnd);
|
||||
}
|
||||
@ -223,3 +214,22 @@ void scsi_scan_host(struct Scsi_Host *host)
|
||||
unsigned scsi_bufflen(struct scsi_cmnd *cmnd) { return cmnd->sdb.length; }
|
||||
struct scatterlist *scsi_sglist(struct scsi_cmnd *cmnd) { return cmnd->sdb.table.sgl; }
|
||||
unsigned scsi_sg_count(struct scsi_cmnd *cmnd) { return cmnd->sdb.table.nents; }
|
||||
|
||||
|
||||
/********************
|
||||
** scsi/scsi_eh.h **
|
||||
*******************/
|
||||
|
||||
void scsi_eh_prep_cmnd(struct scsi_cmnd *scmd,
|
||||
struct scsi_eh_save *ses, unsigned char *cmnd,
|
||||
int cmnd_size, unsigned sense_bytes)
|
||||
{
|
||||
ses->cmd_len = scmd->cmd_len;
|
||||
}
|
||||
|
||||
|
||||
void scsi_eh_restore_cmnd(struct scsi_cmnd* scmd,
|
||||
struct scsi_eh_save *ses)
|
||||
{
|
||||
scmd->cmd_len = ses->cmd_len;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user