xhci: route driver chatter through log_message(), silence at default log level
xhci.c and repl.c's USB attach/detach path printed every xHCI command submission, completion, and BOT transfer step unconditionally via console_println()/console_puts() -- floods the serial log on every boot, regardless of whether anyone is debugging the USB stack. Converted every "xhci:"-prefixed line to log_message() with a level chosen by what it reports, not blanket debug: - LOG_ERROR: allocation/mapping failures, timeouts, command failures, CSW signature/tag mismatches, CSW FAILED/PHASE ERROR, "not implemented" refusals, every "deferred ... setup failed" path - LOG_WARN: dropped/skipped conditions (command ring busy, tracked-port range exceeded), unrecognized media (bad version/CRC), TUR retry - LOG_DEBUG: routine progress (command submitted, succeeded, transfer completed, port connected) and expected outcomes (recognized/blank media) Default log level is LOG_INFO, so the LOG_DEBUG chatter that was the actual complaint is now silent by default and re-enabled with --log-level=debug; LOG_ERROR/LOG_WARN stay visible so real faults aren't buried. xhci_log_hex32() now routes through log_message(LOG_DEBUG, ...) instead of console_puts()/console_println() directly -- kept its own zero-padded 8-digit hex formatting rather than switching to log_message()'s %x (which has no width control), since register values lining up in the log is the reason this helper exists. console.h dropped from xhci.c, no longer used directly. Verified functionally unchanged, not just "still boots": all three architectures reach zuse)ok>, log_message()-instrumented lines are gone from the default-level log (grep -c xhci == 0 on all three, versus dozens before), and the USB thumbdrive path still works end to end -- "Zuse: identity confirmed from attached thumbdrive" appears on all three boots exactly as before. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019YcT3H2PQeyujrzjqS3Var
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
1bd041e84d
commit
dbaead0af2
@@ -30,6 +30,7 @@
|
||||
|
||||
#include "starkernel/repl.h"
|
||||
#include "console.h"
|
||||
#include "log.h"
|
||||
#include "vm.h"
|
||||
#include "version.h"
|
||||
#include "starkernel/timer.h"
|
||||
@@ -224,22 +225,22 @@ static void sk_repl_idle(VM *active_vm)
|
||||
homeblocks_sig_check(&usb_blk_dev, HOMEBLOCKS_SIG_START_FBLOCK, &sig);
|
||||
switch (sig_rc) {
|
||||
case HOMEBLOCKS_SIG_OK:
|
||||
console_println("xhci: USB drive recognized as a home-blocks drive");
|
||||
log_message(LOG_DEBUG, "xhci: USB drive recognized as a home-blocks drive");
|
||||
g_homeblocks_dev = &usb_blk_dev;
|
||||
g_homeblocks_sig = sig;
|
||||
g_homeblocks_sig_valid = 1;
|
||||
break;
|
||||
case HOMEBLOCKS_SIG_BLANK:
|
||||
console_println("xhci: USB drive not recognized (blank or foreign media) -- read-only general use only");
|
||||
log_message(LOG_DEBUG, "xhci: USB drive not recognized (blank or foreign media) -- read-only general use only");
|
||||
break;
|
||||
case HOMEBLOCKS_SIG_BAD_VERSION:
|
||||
console_println("xhci: USB drive has a home-blocks header of an unrecognized version -- read-only general use only");
|
||||
log_message(LOG_WARN, "xhci: USB drive has a home-blocks header of an unrecognized version -- read-only general use only");
|
||||
break;
|
||||
case HOMEBLOCKS_SIG_BAD_CRC:
|
||||
console_println("xhci: USB drive has a home-blocks header that fails its checksum (corrupt or tampered) -- read-only general use only");
|
||||
log_message(LOG_WARN, "xhci: USB drive has a home-blocks header that fails its checksum (corrupt or tampered) -- read-only general use only");
|
||||
break;
|
||||
case HOMEBLOCKS_SIG_READ_ERROR:
|
||||
console_println("xhci: USB drive signature check failed to read the device -- read-only general use only");
|
||||
log_message(LOG_ERROR, "xhci: USB drive signature check failed to read the device -- read-only general use only");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -269,7 +270,7 @@ static void sk_repl_idle(VM *active_vm)
|
||||
xdev->bot_msc_attached = 1;
|
||||
g_attached_blk_dev = &usb_blk_dev;
|
||||
} else {
|
||||
console_println("xhci: USB MSC block-subsystem attach failed");
|
||||
log_message(LOG_ERROR, "xhci: USB MSC block-subsystem attach failed");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user