diff options
author | mav <mav@FreeBSD.org> | 2009-11-14 20:06:04 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2009-11-14 20:06:04 +0000 |
commit | 65ae6957dab32b28124a7f314768cb788541ec8c (patch) | |
tree | 148fe7d329f3e34efce66e64ea024e984e62b69d /sys/dev/ahci | |
parent | 272f28263b1eec62691d61e72818912396f7d5e5 (diff) | |
download | FreeBSD-src-65ae6957dab32b28124a7f314768cb788541ec8c.zip FreeBSD-src-65ae6957dab32b28124a7f314768cb788541ec8c.tar.gz |
MFp4:
Check SNCQ HBA capability bit when reporting NCQ support to CAM.
Diffstat (limited to 'sys/dev/ahci')
-rw-r--r-- | sys/dev/ahci/ahci.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/ahci/ahci.c b/sys/dev/ahci/ahci.c index c46d0ce..fed095b 100644 --- a/sys/dev/ahci/ahci.c +++ b/sys/dev/ahci/ahci.c @@ -734,7 +734,9 @@ ahci_ch_attach(device_t dev) /* Construct SIM entry */ ch->sim = cam_sim_alloc(ahciaction, ahcipoll, "ahcich", ch, device_get_unit(dev), &ch->mtx, - min(2, ch->numslots), ch->numslots, devq); + min(2, ch->numslots), + (ch->caps & AHCI_CAP_SNCQ) ? ch->numslots : 0, + devq); if (ch->sim == NULL) { device_printf(dev, "unable to allocate sim\n"); error = ENOMEM; @@ -2119,7 +2121,9 @@ ahciaction(struct cam_sim *sim, union ccb *ccb) struct ccb_pathinq *cpi = &ccb->cpi; cpi->version_num = 1; /* XXX??? */ - cpi->hba_inquiry = PI_SDTR_ABLE | PI_TAG_ABLE; + cpi->hba_inquiry = PI_SDTR_ABLE; + if (ch->caps & AHCI_CAP_SNCQ) + cpi->hba_inquiry |= PI_TAG_ABLE; if (ch->caps & AHCI_CAP_SPM) cpi->hba_inquiry |= PI_SATAPM; cpi->target_sprt = 0; |