Fix scheme name for xhcid and launch drivers
This commit is contained in:
+3
-2
@@ -231,8 +231,9 @@ fn main() {
|
||||
format!(" + XHCI {} on: {} IRQ: {}\n", name, bar, irq)
|
||||
);
|
||||
|
||||
let scheme_name = format!("usb/{}", name);
|
||||
let socket_fd = syscall::open(
|
||||
format!(":usb/{}", name),
|
||||
format!(":{}", scheme_name),
|
||||
syscall::O_RDWR | syscall::O_CREAT,
|
||||
)
|
||||
.expect("xhcid: failed to create usb scheme");
|
||||
@@ -240,7 +241,7 @@ fn main() {
|
||||
File::from_raw_fd(socket_fd as RawFd)
|
||||
}));
|
||||
|
||||
let hci = Arc::new(Xhci::new(name, address, interrupt_method, pcid_handle).expect("xhcid: failed to allocate device"));
|
||||
let hci = Arc::new(Xhci::new(scheme_name, address, interrupt_method, pcid_handle).expect("xhcid: failed to allocate device"));
|
||||
xhci::start_irq_reactor(&hci, irq_file);
|
||||
futures::executor::block_on(hci.probe()).expect("xhcid: failed to probe");
|
||||
|
||||
|
||||
@@ -524,11 +524,10 @@ impl Xhci {
|
||||
self.update_default_control_pipe(&mut *input, slot, dev_desc).await?;
|
||||
}
|
||||
|
||||
/*match self.spawn_drivers(i, &mut port_state) {
|
||||
match self.spawn_drivers(i) {
|
||||
Ok(()) => (),
|
||||
Err(err) => error!("Failed to spawn driver for port {}: `{}`", i, err),
|
||||
}*/
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -712,15 +711,17 @@ impl Xhci {
|
||||
}
|
||||
|
||||
}
|
||||
fn spawn_drivers(&self, port: usize, ps: &mut PortState) -> Result<()> {
|
||||
fn spawn_drivers(&self, port: usize) -> Result<()> {
|
||||
// TODO: There should probably be a way to select alternate interfaces, and not just the
|
||||
// first one.
|
||||
// TODO: Now that there are some good error crates, I don't think errno.h error codes are
|
||||
// suitable here.
|
||||
|
||||
let ps = self.port_states.get(&port).unwrap();
|
||||
|
||||
let ifdesc = &ps
|
||||
.dev_desc
|
||||
.as_ref().unwrap()
|
||||
.as_ref().ok_or(Error::new(EBADF))?
|
||||
.config_descs
|
||||
.first()
|
||||
.ok_or(Error::new(EBADF))?
|
||||
@@ -737,7 +738,7 @@ impl Xhci {
|
||||
.map(|subclass| subclass == ifdesc.sub_class)
|
||||
.unwrap_or(true)
|
||||
}) {
|
||||
info!("Loading subdriver\"{}\"", driver.name);
|
||||
info!("Loading subdriver \"{}\"", driver.name);
|
||||
let (command, args) = driver.command.split_first().ok_or(Error::new(EBADMSG))?;
|
||||
|
||||
let if_proto = ifdesc.protocol;
|
||||
|
||||
Reference in New Issue
Block a user