mirror of
https://github.com/opnsense/src.git
synced 2026-06-14 19:20:18 -04:00
nvd: For AHCI attached devices, report ahci bridge
When an NVME device is attached via a AHCI controller, we have no access
to its config space. So instead of information about the nvme drive
itself, return info about the AHCI controller as the next best
thing. Since the Intel Hardware RAID support looks at these values, this
likely is best.
Sponsored by: Netflix
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D33286
(cherry picked from commit b8194f3766)
This commit is contained in:
parent
f7735c3952
commit
67873a4fca
1 changed files with 7 additions and 0 deletions
|
|
@ -484,6 +484,13 @@ nvd_new_disk(struct nvme_namespace *ns, void *ctrlr_arg)
|
|||
NVME_MODEL_NUMBER_LENGTH);
|
||||
strlcpy(disk->d_descr, descr, sizeof(descr));
|
||||
|
||||
/*
|
||||
* For devices that are reported as children of the AHCI controller,
|
||||
* which has no access to the config space for this controller, report
|
||||
* the AHCI controller's data.
|
||||
*/
|
||||
if (ctrlr->ctrlr->quirks & QUIRK_AHCI)
|
||||
dev = device_get_parent(dev);
|
||||
disk->d_hba_vendor = pci_get_vendor(dev);
|
||||
disk->d_hba_device = pci_get_device(dev);
|
||||
disk->d_hba_subvendor = pci_get_subvendor(dev);
|
||||
|
|
|
|||
Loading…
Reference in a new issue