From owner-p4-projects@FreeBSD.ORG Wed Nov 25 13:48:27 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C46AD106568D; Wed, 25 Nov 2009 13:48:27 +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 890DD106566B for ; Wed, 25 Nov 2009 13:48:27 +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 763F28FC19 for ; Wed, 25 Nov 2009 13:48:27 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id nAPDmRKI080409 for ; Wed, 25 Nov 2009 13:48:27 GMT (envelope-from mav@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id nAPDmRhE080407 for perforce@freebsd.org; Wed, 25 Nov 2009 13:48:27 GMT (envelope-from mav@freebsd.org) Date: Wed, 25 Nov 2009 13:48:27 GMT Message-Id: <200911251348.nAPDmRhE080407@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 Precedence: bulk Cc: Subject: PERFORCE change 171011 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 13:48:28 -0000 http://p4web.freebsd.org/chv.cgi?CH=171011 Change 171011 by mav@mav_mavbook on 2009/11/25 13:47:41 Report SATA controllers as such to CAM and report current SATA speed. Affected files ... .. //depot/projects/scottl-camlock/src/sys/dev/ata/ata-all.c#39 edit Differences ... ==== //depot/projects/scottl-camlock/src/sys/dev/ata/ata-all.c#39 (text+ko) ==== @@ -1474,18 +1474,31 @@ d = &ch->curr[ccb->ccb_h.target_id]; else d = &ch->user[ccb->ccb_h.target_id]; -// if (cts->xport_specific.sata.valid & CTS_SATA_VALID_REVISION) -// d->revision = cts->xport_specific.sata.revision; - if (cts->xport_specific.ata.valid & CTS_ATA_VALID_MODE) { - if (cts->type == CTS_TYPE_CURRENT_SETTINGS) { - d->mode = ATA_SETMODE(ch->dev, - ccb->ccb_h.target_id, - cts->xport_specific.ata.mode); - } else - d->mode = cts->xport_specific.ata.mode; + if ((ch->flags & ATA_SATA) && (ch->flags & ATA_NO_SLAVE)) { + if (cts->xport_specific.sata.valid & CTS_SATA_VALID_REVISION) + d->revision = cts->xport_specific.sata.revision; + if (cts->xport_specific.ata.valid & CTS_SATA_VALID_MODE) { + if (cts->type == CTS_TYPE_CURRENT_SETTINGS) { + d->mode = ATA_SETMODE(ch->dev, + ccb->ccb_h.target_id, + cts->xport_specific.sata.mode); + } else + d->mode = cts->xport_specific.sata.mode; + } + if (cts->xport_specific.ata.valid & CTS_SATA_VALID_BYTECOUNT) + d->bytecount = min(8192, cts->xport_specific.sata.bytecount); + } else { + if (cts->xport_specific.ata.valid & CTS_ATA_VALID_MODE) { + if (cts->type == CTS_TYPE_CURRENT_SETTINGS) { + d->mode = ATA_SETMODE(ch->dev, + ccb->ccb_h.target_id, + cts->xport_specific.ata.mode); + } else + d->mode = cts->xport_specific.ata.mode; + } + if (cts->xport_specific.ata.valid & CTS_ATA_VALID_BYTECOUNT) + d->bytecount = min(8192, cts->xport_specific.ata.bytecount); } - if (cts->xport_specific.ata.valid & CTS_ATA_VALID_BYTECOUNT) - d->bytecount = min(8192, cts->xport_specific.ata.bytecount); ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); break; @@ -1501,12 +1514,27 @@ d = &ch->user[ccb->ccb_h.target_id]; cts->protocol = PROTO_ATA; cts->protocol_version = PROTO_VERSION_UNSPECIFIED; - cts->transport = XPORT_ATA; - cts->transport_version = XPORT_VERSION_UNSPECIFIED; - cts->xport_specific.ata.mode = d->mode; - cts->xport_specific.ata.valid |= CTS_ATA_VALID_MODE; - cts->xport_specific.ata.bytecount = d->bytecount; - cts->xport_specific.ata.valid |= CTS_ATA_VALID_BYTECOUNT; + if ((ch->flags & ATA_SATA) && (ch->flags & ATA_NO_SLAVE)) { + cts->transport = XPORT_SATA; + cts->transport_version = XPORT_VERSION_UNSPECIFIED; + cts->xport_specific.sata.mode = d->mode; + cts->xport_specific.sata.valid |= CTS_SATA_VALID_MODE; + cts->xport_specific.sata.bytecount = d->bytecount; + cts->xport_specific.sata.valid |= CTS_SATA_VALID_BYTECOUNT; + if (cts->type == CTS_TYPE_CURRENT_SETTINGS) { + cts->xport_specific.sata.revision = + ATA_GETREV(dev, ccb->ccb_h.target_id); + } else + cts->xport_specific.sata.revision = d->revision; + cts->xport_specific.sata.valid |= CTS_SATA_VALID_REVISION; + } else { + cts->transport = XPORT_ATA; + cts->transport_version = XPORT_VERSION_UNSPECIFIED; + cts->xport_specific.ata.mode = d->mode; + cts->xport_specific.ata.valid |= CTS_ATA_VALID_MODE; + cts->xport_specific.ata.bytecount = d->bytecount; + cts->xport_specific.ata.valid |= CTS_ATA_VALID_BYTECOUNT; + } ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); break; @@ -1560,7 +1588,10 @@ cpi->target_sprt = 0; cpi->hba_misc = PIM_SEQSCAN; cpi->hba_eng_cnt = 0; - cpi->max_target = 1; + if (ch->flags & ATA_NO_SLAVE) + cpi->max_target = 0; + else + cpi->max_target = 1; cpi->max_lun = 0; cpi->initiator_id = 0; cpi->bus_id = cam_sim_bus(sim); @@ -1569,7 +1600,10 @@ strncpy(cpi->hba_vid, "ATA", HBA_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); cpi->unit_number = cam_sim_unit(sim); - cpi->transport = XPORT_ATA; + if ((ch->flags & ATA_SATA) && (ch->flags & ATA_NO_SLAVE)) + cpi->transport = XPORT_SATA; + else + cpi->transport = XPORT_ATA; cpi->transport_version = XPORT_VERSION_UNSPECIFIED; cpi->protocol = PROTO_ATA; cpi->protocol_version = PROTO_VERSION_UNSPECIFIED;