From de349f7b5a2130cc40c289a7a59081cc76998516 Mon Sep 17 00:00:00 2001 From: Mitchell Waite Date: Sun, 2 Aug 2026 16:10:15 -0400 Subject: [PATCH] Add ATA revision to the ATA device struct and properly populate it for DVD and HDD --- libxenon/drivers/diskio/ata.c | 23 ++++++++++++++--------- libxenon/drivers/diskio/ata.h | 1 + 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/libxenon/drivers/diskio/ata.c b/libxenon/drivers/diskio/ata.c index 6dbcbbee..18988b33 100644 --- a/libxenon/drivers/diskio/ata.c +++ b/libxenon/drivers/diskio/ata.c @@ -236,12 +236,13 @@ xenon_ata_dumpinfo(struct xenon_ata_device *dev, char *info) { strncpy(text, data + 20, 20); text[20] = 0; printf(" * Serial: %s\n", text); - strncpy(text, data + 46, 8); - text[8] = 0; - printf(" * Firmware: %s\n", text); - strncpy(text, data + 54, 40); - text[40] = 0; - strncpy(dev->model, text, sizeof(dev->model)); + + strncpy(dev->rev, data + 46, 8); + dev->rev[8] = 0; + printf(" * Firmware: %s\n", dev->rev); + + strncpy(dev->model, data + 54, 40); + dev->model[40] = 0; printf(" * Model: %s\n", dev->model); if (!dev->atapi) { @@ -456,9 +457,13 @@ xenon_atapi_inquiry_model(struct xenon_ata_device *dev) { return -1; }; - buf[8 + 24] = '\0'; - strncpy(dev->model, &buf[8], sizeof(dev->model)); - printf("ATAPI inquiry model: %s %d\n", dev->model); + memcpy(dev->model, &buf[8], 24); + dev->model[24] = '\0'; + + memcpy(dev->rev, &buf[32], 4); + dev->rev[4] = '\0'; + + printf("ATAPI inquiry model: %s %s\n", dev->model, dev->rev); return 0; } diff --git a/libxenon/drivers/diskio/ata.h b/libxenon/drivers/diskio/ata.h index 14c10f77..801ff5e2 100644 --- a/libxenon/drivers/diskio/ata.h +++ b/libxenon/drivers/diskio/ata.h @@ -82,6 +82,7 @@ extern "C" { struct xenon_ata_dma_prd * prds; char model[0x30]; + char rev[9]; }; struct xenon_atapi_read {