From 7300eb479cbd3df29aca7903663f7eccd73758dd Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Sat, 21 Oct 2023 21:52:55 -0700 Subject: [PATCH] ZuluSCSI_initiator: Print disk parameters in log --- src/ZuluSCSI_initiator.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/ZuluSCSI_initiator.cpp b/src/ZuluSCSI_initiator.cpp index 5bf071cb..0ca296de 100644 --- a/src/ZuluSCSI_initiator.cpp +++ b/src/ZuluSCSI_initiator.cpp @@ -172,6 +172,8 @@ void scsiInitiatorMainLoop() delay_with_poll(1000); uint8_t inquiry_data[36]; + char vendor[9], product[17], revision[5]; + int type; LED_ON(); bool startstopok = @@ -185,6 +187,15 @@ void scsiInitiatorMainLoop() bool inquiryok = startstopok && scsiInquiry(g_initiator_state.target_id, inquiry_data); + + memcpy(vendor, &inquiry_data[8], 8); + vendor[8]=0; + memcpy(product, &inquiry_data[16], 16); + product[16]=0; + memcpy(revision, &inquiry_data[32], 4); + revision[4]=0; + type=inquiry_data[0]&0x1f; + LED_OFF(); uint64_t total_bytes = 0; @@ -194,6 +205,12 @@ void scsiInitiatorMainLoop() " capacity ", (int)g_initiator_state.sectorcount, " sectors x ", (int)g_initiator_state.sectorsize, " bytes"); + logmsg("[SCSI", g_initiator_state.target_id,"]"); + logmsg(" Vendor = \"", vendor,"\""); + logmsg(" Product = \"", product,"\""); + logmsg(" Version = \"", revision,"\""); + logmsg(" Type = ", type); + g_initiator_state.sectorcount_all = g_initiator_state.sectorcount; total_bytes = (uint64_t)g_initiator_state.sectorcount * g_initiator_state.sectorsize;