Skip to content

Commit

Permalink
scsi: include firmware version in vendor section of inquiry
Browse files Browse the repository at this point in the history
  • Loading branch information
erichelgeson committed Feb 25, 2024
1 parent 23a4212 commit 551dcfc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/BlueSCSI_platform_RP2040/BlueSCSI_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ extern "C" {

/* These are used in debug output and default SCSI strings */
extern const char *g_platform_name;
#define PLATFORM_NAME "BlueSCSI Pico"
#define PLATFORM_NAME "BlueSCSI"
#define PLATFORM_REVISION "2.0"
#define PLATFORM_INQUIRY PLATFORM_NAME " v" BLUESCSI_FW_VERSION
#define PLATFORM_MAX_SCSI_SPEED S2S_CFG_SPEED_SYNC_10
#define PLATFORM_OPTIMAL_MIN_SD_WRITE_SIZE 32768
#define PLATFORM_OPTIMAL_MAX_SD_WRITE_SIZE 65536
Expand Down
11 changes: 10 additions & 1 deletion lib/SCSI2SD/src/firmware/inquiry.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include "scsi.h"
#include "config.h"
#include "BlueSCSI_config.h"
#include "inquiry.h"

#include <string.h>
Expand Down Expand Up @@ -223,6 +224,7 @@ uint32_t s2s_getStandardInquiry(
const S2S_TargetCfg* cfg, uint8_t* out, uint32_t maxlen
)
{
uint32_t size = 0;
uint32_t buflen = sizeof(StandardResponse);
if (buflen > maxlen) buflen = maxlen;

Expand All @@ -241,10 +243,17 @@ uint32_t s2s_getStandardInquiry(
memcpy(&out[8], cfg->vendor, sizeof(cfg->vendor));
memcpy(&out[16], cfg->prodId, sizeof(cfg->prodId));
memcpy(&out[32], cfg->revision, sizeof(cfg->revision));
return sizeof(StandardResponse) +
size = sizeof(StandardResponse) +
sizeof(cfg->vendor) +
sizeof(cfg->prodId) +
sizeof(cfg->revision);

// Mac Daynaport Driver does not like this added.
if(cfg->deviceType != S2S_CFG_NETWORK) {
memcpy(&out[36], PLATFORM_INQUIRY, sizeof(PLATFORM_INQUIRY));
size += sizeof(PLATFORM_INQUIRY);
}
return size;
}

uint8_t getDeviceTypeQualifier()
Expand Down

0 comments on commit 551dcfc

Please sign in to comment.