From e9a109c40c34e61239d8286265e9ed8c1877bd84 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sat, 10 May 2025 01:29:13 -0400 Subject: kernel: ahci: Keep track of total ports Signed-off-by: Ian Moffett --- sys/dev/ic/ahci.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sys/dev/ic/ahci.c') diff --git a/sys/dev/ic/ahci.c b/sys/dev/ic/ahci.c index 9482c77..fc87b71 100644 --- a/sys/dev/ic/ahci.c +++ b/sys/dev/ic/ahci.c @@ -46,6 +46,7 @@ #define pr_trace(fmt, ...) kprintf("ahci: " fmt, ##__VA_ARGS__) #define pr_error(...) pr_trace(__VA_ARGS__) +static uint32_t devs_max = 0; static struct hba_device *devs; static struct pci_device *ahci_dev; static struct timer tmr; @@ -567,6 +568,7 @@ ahci_hba_scan(struct ahci_hba *hba) size_t len; len = hba->nports * sizeof(struct hba_device); + devs_max = hba->nports; if ((devs = dynalloc(len)) == NULL) { pr_trace("failed to allocate dev descriptors\n"); return -ENOMEM; -- cgit v1.2.3