From owner-p4-projects@FreeBSD.ORG Sun Jun 7 09:51:04 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2148A1065673; Sun, 7 Jun 2009 09:51:04 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D76531065670 for ; Sun, 7 Jun 2009 09:51:03 +0000 (UTC) (envelope-from mav@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id AB6118FC08 for ; Sun, 7 Jun 2009 09:51:03 +0000 (UTC) (envelope-from mav@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n579p3u5076872 for ; Sun, 7 Jun 2009 09:51:03 GMT (envelope-from mav@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n579p3rP076870 for perforce@freebsd.org; Sun, 7 Jun 2009 09:51:03 GMT (envelope-from mav@freebsd.org) Date: Sun, 7 Jun 2009 09:51:03 GMT Message-Id: <200906070951.n579p3rP076870@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to mav@freebsd.org using -f From: Alexander Motin To: Perforce Change Reviews Cc: Subject: PERFORCE change 163695 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2009 09:51:04 -0000 http://perforce.freebsd.org/chv.cgi?CH=163695 Change 163695 by mav@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);