diff options
-rw-r--r-- | sys/dev/ic/ahci.c | 4 | ||||
-rw-r--r-- | sys/include/dev/ic/ahcivar.h | 2 |
2 files changed, 6 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; diff --git a/sys/include/dev/ic/ahcivar.h b/sys/include/dev/ic/ahcivar.h index a23a654..67f2efe 100644 --- a/sys/include/dev/ic/ahcivar.h +++ b/sys/include/dev/ic/ahcivar.h @@ -96,6 +96,7 @@ struct ahci_hba { * @io: Memory mapped port registers * @hba: HBA descriptor * @cmdlist: Command list [p] + * @nlba: Max number of addressable blocks * @fra: FIS receive area [p] * @dev: Device minor number. */ @@ -104,6 +105,7 @@ struct hba_device { struct ahci_hba *hba; struct ahci_cmd_hdr *cmdlist; struct dcdr *dcdr; + uint32_t nlba; void *fra; dev_t dev; }; |