PERFORCE change 163695 for review
Alexander Motin
mav at FreeBSD.org
Sun Jun 7 09:51:04 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=163695
Change 163695 by mav at mav_mavbook on 2009/06/07 09:50:58
Minor parts of PM support.
Affected files ...
.. //depot/projects/scottl-camlock/src/sys/dev/ahci/ahci.c#14 edit
Differences ...
==== //depot/projects/scottl-camlock/src/sys/dev/ahci/ahci.c#14 (text+ko) ====
@@ -814,7 +814,7 @@
struct ahci_channel *ch = device_get_softc(slot->dev);
struct ahci_cmd_tab *ctp;
struct ahci_cmd_list *clp;
- int port = 0 & 0x0f;
+ int port = slot->ccb->ccb_h.target_id & 0x0f;
int fis_size;
//device_printf(slot->dev, "%s slot %d\n", __func__, slot->slot);
@@ -1350,10 +1350,11 @@
case 0x0000:
ch->devices = ATA_ATA_MASTER;
break;
-/* case 0x9669:
- ch->devices = ATA_PORTMULTIPLIER;
- ata_pm_identify(dev);
- break; */
+ case 0x9669:
+ ch->devices = ATA_PORTMULTIPLIER | 0x0003; /* Temporary hack. */
+// ch->devices = ATA_PORTMULTIPLIER;
+// ata_pm_identify(dev);
+ break;
case 0xeb14:
ch->devices = ATA_ATAPI_MASTER;
break;
@@ -1551,8 +1552,7 @@
ccb->csio.cdb_io.cdb_ptr : ccb->csio.cdb_io.cdb_bytes,
ctp->acmd, ccb->csio.cdb_len);
fis[0] = 0x27; /* host to device */
-// fis[1] = 0x80 | (atadev->unit & 0x0f);
- fis[1] = 0x80 | (0 & 0x0f);
+ fis[1] = 0x80 | (ccb->ccb_h.target_id & 0x0f);
fis[2] = ATA_PACKET_CMD;
if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE)
fis[3] = ATA_F_DMA;
@@ -1564,8 +1564,7 @@
fis[15] = ATA_A_4BIT;
} else if (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA) {
fis[0] = 0x27; /* host to device */
-// fis[1] = 0x80 | (atadev->unit & 0x0f);
- fis[1] = 0x80 | (0 & 0x0f);
+ fis[1] = 0x80 | (ccb->ccb_h.target_id & 0x0f);
fis[2] = ccb->ataio.cmd.command;
fis[3] = ccb->ataio.cmd.count;
fis[4] = ccb->ataio.cmd.lba;
@@ -1581,8 +1580,7 @@
fis[15] = ATA_A_4BIT;
} else {
fis[0] = 0x27; /* host to device */
-// fis[1] = 0x80 | (atadev->unit & 0x0f);
- fis[1] = 0x80 | (0 & 0x0f);
+ fis[1] = 0x80 | (ccb->ccb_h.target_id & 0x0f);
fis[2] = ccb->ataio.cmd.command;
fis[3] = ccb->ataio.cmd.feature;
fis[4] = ccb->ataio.cmd.lba;
@@ -1660,7 +1658,7 @@
DELAY(5000);
for (loop = 0; loop < 10; loop++) {
ATA_IDX_OUTL(ch, ATA_SCONTROL,
- ATA_SC_DET_IDLE | ((ch->pm_level > 0) ? 0 :
+ ATA_SC_DET_IDLE | ATA_SC_SPD_SPEED_GEN1 | ((ch->pm_level > 0) ? 0 :
ATA_SC_IPM_DIS_PARTIAL | ATA_SC_IPM_DIS_SLUMBER));
DELAY(100);
val = ATA_IDX_INL(ch, ATA_SCONTROL);
@@ -1783,9 +1781,9 @@
cpi->version_num = 1; /* XXX??? */
cpi->hba_inquiry = PI_SDTR_ABLE | PI_TAG_ABLE;
cpi->target_sprt = 0;
- cpi->hba_misc = 0;
+ cpi->hba_misc = PIM_SEQSCAN;
cpi->hba_eng_cnt = 0;
- cpi->max_target = 0;
+ cpi->max_target = 14;
cpi->max_lun = 0;
cpi->initiator_id = 0;
cpi->bus_id = cam_sim_bus(sim);
More information about the p4-projects
mailing list