usb: quiet the investigation diagnostics now that hubs work on real HW
The compound-hub investigation is resolved (Keychron keyboard + ROG mouse enumerate through the Genesys USB2 companion hub and type on real hardware). Turn the debugging spam back down for main: the full 22-port PORTSC dump runs only when a scan finds NOTHING (a 'why is this empty' aid), not every boot; a downstream hub port logs only when a device actually appears or leaves, not for every empty seed-sweep port. The readable device names, class names, and port-change events stay.
This commit is contained in:
@@ -200,10 +200,6 @@ fn scanPorts(manager: runtime.ipc.Handle) void {
|
||||
};
|
||||
std.log.info("{d} root-hub ports", .{engine.max_ports});
|
||||
|
||||
// Diagnostic: the USB2/USB3 root-port map (xECP) + every port's raw PORTSC,
|
||||
// to find a USB2 companion hub that isn't presenting a connection.
|
||||
engine.dumpPortTopology();
|
||||
|
||||
var port: u32 = 1;
|
||||
var connected: u32 = 0;
|
||||
while (port <= engine.max_ports) : (port += 1) {
|
||||
@@ -212,7 +208,10 @@ fn scanPorts(manager: runtime.ipc.Handle) void {
|
||||
connected += 1;
|
||||
bringUpPort(manager, engine, port);
|
||||
}
|
||||
if (connected == 0) _ = runtime.system.write("/system/drivers/usb-xhci-bus: no devices connected\n");
|
||||
if (connected == 0) {
|
||||
_ = runtime.system.write("/system/drivers/usb-xhci-bus: no devices connected\n");
|
||||
engine.dumpPortTopology(); // help diagnose an empty scan: the xECP map + raw PORTSC
|
||||
}
|
||||
}
|
||||
|
||||
/// Bring up whatever is on `port`: setup + enumerate + register/report one child
|
||||
@@ -272,8 +271,9 @@ fn hubPortKey(hub_slot: u8, port: u16) u32 {
|
||||
fn bringUpBehindHub(manager: runtime.ipc.Handle, engine: *library.Controller, hub: *library.Device, port: u16) void {
|
||||
const status = engine.hubPortStatusAck(hub, port) orelse return;
|
||||
const connected = library.Controller.hubPortConnected(status);
|
||||
std.log.info("hub slot {d} port {d} status 0x{x:0>8} ({s})", .{ hub.slot_id, port, status, if (connected) "connected" else "empty" });
|
||||
const existing = engine.deviceOnHubPort(hub, port);
|
||||
if (connected != (existing != null)) // only when a device appears or leaves — not empty seed-sweep ports
|
||||
std.log.info("hub slot {d} port {d}: {s} (status 0x{x:0>4})", .{ hub.slot_id, port, if (connected) "device connected" else "device removed", status & 0xFFFF });
|
||||
|
||||
if (!connected) {
|
||||
if (existing) |dev| tearDownHubDevice(manager, engine, dev);
|
||||
|
||||
Reference in New Issue
Block a user