aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2024-03-01 22:18:43 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2024-03-01 22:18:43 +0000
commit7485926e09a08fbfe83a9bc908e7d43aaca4c172 (patch)
tree16da8abdcddd5557d87a06e65bc70b5d0fc37c5b /sys
parent638b5ae1c7858373344bc7b9dcb5a1e7fab80bd9 (diff)
downloadsrc-7485926e09a08fbfe83a9bc908e7d43aaca4c172.tar.gz
src-7485926e09a08fbfe83a9bc908e7d43aaca4c172.zip
nvme: Firmware revisions in the firmware slot info logpage are ASCII strings
In particular, don't try to byteswap the values as 64-bit integers and always print a non-empty version as a string. Reviewed by: chuck, imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D44121
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/nvme/nvme.h14
-rw-r--r--sys/dev/nvme/nvme_ctrlr.c4
2 files changed, 2 insertions, 16 deletions
diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h
index 004fa1e9d1ca..137aff792868 100644
--- a/sys/dev/nvme/nvme.h
+++ b/sys/dev/nvme/nvme.h
@@ -1465,7 +1465,8 @@ _Static_assert(sizeof(struct nvme_health_information_page) == 512, "bad size for
struct nvme_firmware_page {
uint8_t afi;
uint8_t reserved[7];
- uint64_t revision[7]; /* revisions for 7 slots */
+ /* revisions for 7 slots */
+ uint8_t revision[7][NVME_FIRMWARE_REVISION_LENGTH];
uint8_t reserved2[448];
} __packed __aligned(4);
@@ -2007,17 +2008,6 @@ void nvme_health_information_page_swapbytes(
}
static inline
-void nvme_firmware_page_swapbytes(struct nvme_firmware_page *s __unused)
-{
-#if _BYTE_ORDER != _LITTLE_ENDIAN
- int i;
-
- for (i = 0; i < 7; i++)
- s->revision[i] = le64toh(s->revision[i]);
-#endif
-}
-
-static inline
void nvme_ns_list_swapbytes(struct nvme_ns_list *s __unused)
{
#if _BYTE_ORDER != _LITTLE_ENDIAN
diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c
index 3b3b9bbe6998..b29512455fda 100644
--- a/sys/dev/nvme/nvme_ctrlr.c
+++ b/sys/dev/nvme/nvme_ctrlr.c
@@ -682,10 +682,6 @@ nvme_ctrlr_async_event_log_page_cb(void *arg, const struct nvme_completion *cpl)
nvme_health_information_page_swapbytes(
(struct nvme_health_information_page *)aer->log_page_buffer);
break;
- case NVME_LOG_FIRMWARE_SLOT:
- nvme_firmware_page_swapbytes(
- (struct nvme_firmware_page *)aer->log_page_buffer);
- break;
case NVME_LOG_CHANGED_NAMESPACE:
nvme_ns_list_swapbytes(
(struct nvme_ns_list *)aer->log_page_buffer);