Skip to content

Commit

Permalink
lidetool: Add version check for unit struct dump
Browse files Browse the repository at this point in the history
  • Loading branch information
LIV2 committed Aug 30, 2024
1 parent 63d8adc commit 8f42501
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lidetool/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include "main.h"
#include "config.h"
#include "../device.h"

#define CMD_XFER 0x1001

Expand Down Expand Up @@ -324,8 +325,17 @@ int main(int argc, char *argv[])
}

if (config->DumpInfo) {
doScsiInquiry(req);
DumpUnit(req);
UWORD driverVersion = req->io_Device->dd_Library.lib_Version;
UWORD driverRevision = req->io_Device->dd_Library.lib_Revision;

if (driverVersion != DEVICE_VERSION ||
driverRevision != DEVICE_REVISION) {
printf("Driver version mismatch.\n");
printf("lidetool version: %d.%d lide.device %d.%d\n", DEVICE_VERSION, DEVICE_REVISION, driverVersion, driverRevision);
} else {
doScsiInquiry(req);
DumpUnit(req);
}
}

if (config->Multiple >= 0) {
Expand Down

0 comments on commit 8f42501

Please sign in to comment.