xhcid: reduce logging
This commit is contained in:
@@ -77,7 +77,7 @@ impl<const N: usize> DeviceEnumerator<N> {
|
||||
}
|
||||
|
||||
//THIS LOCKS THE PORTS. DO NOT LOCK PORTS BEFORE THIS POINT
|
||||
info!("Received a device connect on port {}, but it's not enabled. Resetting the port.", port_id);
|
||||
debug!("Received a device connect on port {}, but it's not enabled. Resetting the port.", port_id);
|
||||
let _ = self.hci.reset_port(port_id);
|
||||
|
||||
let mut ports = self.hci.ports.lock().unwrap();
|
||||
@@ -128,8 +128,10 @@ impl<const N: usize> DeviceEnumerator<N> {
|
||||
);
|
||||
let result = futures::executor::block_on(self.hci.detach_device(port_id));
|
||||
match result {
|
||||
Ok(_) => {
|
||||
info!("Device on port {} was detached", port_id);
|
||||
Ok(was_connected) => {
|
||||
if was_connected {
|
||||
info!("Device on port {} was detached", port_id);
|
||||
}
|
||||
}
|
||||
Err(err) => {
|
||||
warn!("processing of device attach request failed! Error: {}", err);
|
||||
|
||||
@@ -417,7 +417,7 @@ impl<const N: usize> Xhci<N> {
|
||||
let max_slots = cap.max_slots();
|
||||
let max_ports = cap.max_ports();
|
||||
|
||||
info!("xHC max slots: {}, max ports: {}", max_slots, max_ports);
|
||||
debug!("xHC max slots: {}, max ports: {}", max_slots, max_ports);
|
||||
(max_slots, max_ports)
|
||||
};
|
||||
|
||||
@@ -589,7 +589,7 @@ impl<const N: usize> Xhci<N> {
|
||||
debug!("Ringing command doorbell.");
|
||||
self.dbs.lock().unwrap()[0].write(0);
|
||||
|
||||
info!("XHCI initialized.");
|
||||
debug!("XHCI initialized.");
|
||||
|
||||
self.op.get_mut().unwrap().set_cie(self.cap.cic());
|
||||
|
||||
@@ -633,6 +633,7 @@ impl<const N: usize> Xhci<N> {
|
||||
//Do nothing
|
||||
}
|
||||
_ => {
|
||||
eprintln!("{}: CCS {}, CSC {}", port_id, ccs, csc);
|
||||
//Either something is connected, or nothing is connected and a port status change was asserted.
|
||||
self.device_enumerator_sender
|
||||
.send(DeviceEnumerationRequest { port_id })
|
||||
@@ -668,7 +669,7 @@ impl<const N: usize> Xhci<N> {
|
||||
warn!("No detected supported protocol for port {}", port_id);
|
||||
}
|
||||
Some(protocol) => {
|
||||
info!(
|
||||
debug!(
|
||||
"Port {} is a USB {}.{} port with slot type {} and in current state {}: {:?}",
|
||||
port_id,
|
||||
protocol.rev_major(),
|
||||
@@ -803,7 +804,7 @@ impl<const N: usize> Xhci<N> {
|
||||
(port.read(), port.state(), port.speed(), port.flags())
|
||||
};
|
||||
|
||||
info!(
|
||||
debug!(
|
||||
"XHCI Port {}: {:X}, State {}, Speed {}, Flags {:?}",
|
||||
port_id, data, state, speed, flags
|
||||
);
|
||||
@@ -836,7 +837,7 @@ impl<const N: usize> Xhci<N> {
|
||||
|
||||
let mut input = unsafe { self.alloc_dma_zeroed::<InputContext<N>>()? };
|
||||
|
||||
info!("Attempting to address the device");
|
||||
debug!("Attempting to address the device");
|
||||
let mut ring = match self
|
||||
.address_device(&mut input, port_id, slot_ty, slot, protocol_speed, speed)
|
||||
.await
|
||||
@@ -914,7 +915,7 @@ impl<const N: usize> Xhci<N> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn detach_device(&self, port_id: PortId) -> Result<()> {
|
||||
pub async fn detach_device(&self, port_id: PortId) -> Result<bool> {
|
||||
if let Some(children) = self.drivers.remove(&port_id) {
|
||||
for mut child in children {
|
||||
info!("killing driver process {} for port {}", child.id(), port_id);
|
||||
@@ -964,19 +965,18 @@ impl<const N: usize> Xhci<N> {
|
||||
|
||||
if let Some(state) = self.port_states.remove(&port_id) {
|
||||
debug!("disabling port slot {} for port {}", state.slot, port_id);
|
||||
let result = self.disable_port_slot(state.slot).await;
|
||||
let result = self.disable_port_slot(state.slot).await.and(Ok(true));
|
||||
debug!(
|
||||
"disabled port slot {} for port {} with result: {:?}",
|
||||
state.slot, port_id, result
|
||||
);
|
||||
|
||||
result
|
||||
} else {
|
||||
debug!(
|
||||
"Attempted to detach from port {}, which wasn't previously attached.",
|
||||
port_id
|
||||
);
|
||||
Ok(())
|
||||
Ok(false)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1185,7 +1185,7 @@ impl<const N: usize> Xhci<N> {
|
||||
.c
|
||||
.write(u32::from(avg_trb_len) | (u32::from(max_esit_payload_lo) << 16));
|
||||
|
||||
log::info!("initialized endpoint {}", endp_num);
|
||||
log::debug!("initialized endpoint {}", endp_num);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -1214,7 +1214,7 @@ impl<const N: usize> Xhci<N> {
|
||||
let mut req: ConfigureEndpointsReq =
|
||||
serde_json::from_slice(json_buf).or(Err(Error::new(EBADMSG)))?;
|
||||
|
||||
info!(
|
||||
debug!(
|
||||
"Running configure endpoints command, at port {}, request: {:?}",
|
||||
port, req
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user