aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ahci/ahci.c
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2010-07-25 15:43:52 +0000
committerAlexander Motin <mav@FreeBSD.org>2010-07-25 15:43:52 +0000
commit8edcf69406cc816bb7c64b51ec38f23d25ad4b67 (patch)
tree17a1e011d37cb64ccedab6ec54cdbac15a501c84 /sys/dev/ahci/ahci.c
parentf4e7a6c3f1891945141035dfe0144611ba609d25 (diff)
downloadsrc-8edcf69406cc816bb7c64b51ec38f23d25ad4b67.tar.gz
src-8edcf69406cc816bb7c64b51ec38f23d25ad4b67.zip
Export PCI IDs of ATA/SATA controllers through CAM and ata(4) layers to
GEOM. This information needed for proper soft-RAID's on-disk metadata reading and writing.
Notes
Notes: svn path=/head/; revision=210471
Diffstat (limited to 'sys/dev/ahci/ahci.c')
-rw-r--r--sys/dev/ahci/ahci.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/ahci/ahci.c b/sys/dev/ahci/ahci.c
index 9de77403a5ec..2f53f822a9d0 100644
--- a/sys/dev/ahci/ahci.c
+++ b/sys/dev/ahci/ahci.c
@@ -2459,7 +2459,7 @@ ahci_check_ids(device_t dev, union ccb *ccb)
static void
ahciaction(struct cam_sim *sim, union ccb *ccb)
{
- device_t dev;
+ device_t dev, parent;
struct ahci_channel *ch;
CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("ahciaction func_code=%x\n",
@@ -2599,6 +2599,7 @@ ahciaction(struct cam_sim *sim, union ccb *ccb)
{
struct ccb_pathinq *cpi = &ccb->cpi;
+ parent = device_get_parent(dev);
cpi->version_num = 1; /* XXX??? */
cpi->hba_inquiry = PI_SDTR_ABLE;
if (ch->caps & AHCI_CAP_SNCQ)
@@ -2626,8 +2627,12 @@ ahciaction(struct cam_sim *sim, union ccb *ccb)
cpi->protocol_version = PROTO_VERSION_UNSPECIFIED;
cpi->maxio = MAXPHYS;
/* ATI SB600 can't handle 256 sectors with FPDMA (NCQ). */
- if (pci_get_devid(device_get_parent(dev)) == 0x43801002)
+ if (pci_get_devid(parent) == 0x43801002)
cpi->maxio = min(cpi->maxio, 128 * 512);
+ cpi->hba_vendor = pci_get_vendor(parent);
+ cpi->hba_device = pci_get_device(parent);
+ cpi->hba_subvendor = pci_get_subvendor(parent);
+ cpi->hba_subdevice = pci_get_subdevice(parent);
cpi->ccb_h.status = CAM_REQ_CMP;
break;
}