diff options
author | Ian Moffett <ian@osmora.org> | 2025-05-26 01:49:45 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-05-26 01:50:28 -0400 |
commit | 08d925bce8a18361655a56bf5b38d6f9e9134b8a (patch) | |
tree | 0d5f58926f6b935e5f75d3eee5c6da3c05498e52 /sys/dev/ic | |
parent | d2ae9910bd6d5d4d2bd79cd2c835d6ca1a64364c (diff) |
kernel: ahci: Detect max SATA sector count
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/ahci.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/dev/ic/ahci.c b/sys/dev/ic/ahci.c index d88274a..669b936 100644 --- a/sys/dev/ic/ahci.c +++ b/sys/dev/ic/ahci.c @@ -435,6 +435,7 @@ ahci_identify(struct ahci_hba *hba, struct hba_device *dp) struct ahci_cmd_hdr *cmdhdr; struct ahci_cmdtab *cmdtbl; struct ahci_fis_h2d *fis; + uint16_t *p; int cmdslot, status; buf = vm_alloc_frame(1); @@ -475,6 +476,9 @@ ahci_identify(struct ahci_hba *hba, struct hba_device *dp) } ahci_dump_identity(PHYS_TO_VIRT(buf)); + p = (uint16_t *)PHYS_TO_VIRT(buf); + dp->nlba = (p[61] << 16) | p[60]; + pr_trace("max block size: %d\n", dp->nlba); done: vm_free_frame(buf, 1); return status; |