Correctly index the dev ctx arr for slot states.
This commit is contained in:
@@ -337,7 +337,7 @@ impl Xhci {
|
||||
|
||||
println!(" - Enable slot");
|
||||
|
||||
self.run.ints[0].erdp.write(self.cmd.erdp()); // TODO: ?
|
||||
self.run.ints[0].erdp.write(self.cmd.erdp());
|
||||
|
||||
let slot = Self::enable_port_slot(&mut self.cmd, &mut self.dbs);
|
||||
|
||||
|
||||
@@ -792,7 +792,8 @@ impl SchemeMut for Xhci {
|
||||
Ok(buf.len())
|
||||
}
|
||||
EndpointHandleTy::Status(ref mut offset) => {
|
||||
let status = self.dev_ctx.contexts.get(port_num).ok_or(Error::new(EBADF))?.endpoints.get(endp_num as usize).ok_or(Error::new(EBADF))?.a.read() & ENDPOINT_CONTEXT_STATUS_MASK;
|
||||
let ps = self.port_states.get(&port_num).ok_or(Error::new(EBADF))?;
|
||||
let status = self.dev_ctx.contexts.get(ps.slot as usize).ok_or(Error::new(EBADF))?.endpoints.get(endp_num as usize).ok_or(Error::new(EBADF))?.a.read() & ENDPOINT_CONTEXT_STATUS_MASK;
|
||||
|
||||
let string = match status {
|
||||
// TODO: Give this its own enum.
|
||||
|
||||
Reference in New Issue
Block a user