diff options
author | Ian Moffett <ian@osmora.org> | 2025-05-10 01:29:13 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-05-10 01:29:13 -0400 |
commit | e9a109c40c34e61239d8286265e9ed8c1877bd84 (patch) | |
tree | 64fd3e87ff98097feff5665323c8dd092370f72a | |
parent | bfb5de48838157bc3cac08ccccc0962c3ccf5609 (diff) |
kernel: ahci: Keep track of total ports
Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r-- | sys/dev/ic/ahci.c | 2 |
1 files changed, 2 insertions, 0 deletions
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; |