Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Jun 2009 19:52:36 GMT
From:      Alexander Motin <mav@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 163297 for review
Message-ID:  <200906011952.n51Jqa96046137@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=163297

Change 163297 by mav@mav_mavbook on 2009/06/01 19:51:40

	ATA controller itself is not present on the bus as device.
	Do not reserve ID for it.

Affected files ...

.. //depot/projects/scottl-camlock/src/sys/cam/ata/ata_xpt.c#10 edit
.. //depot/projects/scottl-camlock/src/sys/dev/ahci/ahci.c#8 edit

Differences ...

==== //depot/projects/scottl-camlock/src/sys/cam/ata/ata_xpt.c#10 (text+ko) ====

@@ -805,7 +805,6 @@
 		struct	cam_path *path;
 		u_int	i;
 		u_int	max_target;
-		u_int	initiator_id;
 
 		/* Find out the characteristics of the bus */
 		work_ccb = xpt_alloc_ccb_nowait();
@@ -849,7 +848,6 @@
 
 		/* Cache on our stack so we can work asynchronously */
 		max_target = scan_info->cpi->max_target;
-		initiator_id = scan_info->cpi->initiator_id;
 
 		/*
 		 * We can scan all targets in parallel, or do it sequentially.
@@ -859,15 +857,10 @@
 			scan_info->counter = 0;
 		} else {
 			scan_info->counter = scan_info->cpi->max_target + 1;
-			if (scan_info->cpi->initiator_id < scan_info->counter) {
-				scan_info->counter--;
-			}
 		}
 
 		for (i = 0; i <= max_target; i++) {
 			cam_status status;
-			if (i == initiator_id)
-				continue;
 
 			status = xpt_create_path(&path, xpt_periph,
 						 request_ccb->ccb_h.path_id,
@@ -922,10 +915,6 @@
 		done = 0;
 		if (scan_info->cpi->hba_misc & PIM_SEQSCAN) {
 			scan_info->counter++;
-			if (scan_info->counter ==
-			    scan_info->cpi->initiator_id) {
-				scan_info->counter++;
-			}
 			if (scan_info->counter >=
 			    scan_info->cpi->max_target+1) {
 				done = 1;

==== //depot/projects/scottl-camlock/src/sys/dev/ahci/ahci.c#8 (text+ko) ====

@@ -1722,16 +1722,16 @@
 
 		if (ccb->ccb_h.target_id == CAM_TARGET_WILDCARD ||
 		    (((ATA_ATA_MASTER | ATA_ATAPI_MASTER) <<
-			(ccb->ccb_h.target_id - 1)) & ch->devices)) {
+			ccb->ccb_h.target_id) & ch->devices)) {
 
 		cpi->version_num = 1; /* XXX??? */
-		cpi->hba_inquiry = PI_SDTR_ABLE;
+		cpi->hba_inquiry = PI_SDTR_ABLE | PI_TAG_ABLE;
 		cpi->target_sprt = 0;
 		cpi->hba_misc = 0;
 		cpi->hba_eng_cnt = 0;
-		cpi->max_target = 1;
+		cpi->max_target = 0;
 		cpi->max_lun = 0;
-		cpi->initiator_id = 0;//aha->scsi_id;
+		cpi->initiator_id = 0;
 		cpi->bus_id = cam_sim_bus(sim);
 		cpi->base_transfer_speed = 150000;
 		strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
@@ -1740,7 +1740,7 @@
 		cpi->unit_number = cam_sim_unit(sim);
 		cpi->transport = XPORT_ATA;
 		cpi->transport_version = 2;
-		if ((ATA_ATA_MASTER << (ccb->ccb_h.target_id - 1)) & ch->devices)
+		if ((ATA_ATA_MASTER << ccb->ccb_h.target_id) & ch->devices)
 			cpi->protocol = PROTO_ATA;
 		else
 			cpi->protocol = PROTO_SCSI;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906011952.n51Jqa96046137>