Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 May 2009 16:26:48 GMT
From:      Alexander Motin <mav@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 162654 for review
Message-ID:  <200905241626.n4OGQmdS062172@repoman.freebsd.org>

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

Change 162654 by mav@mav_mavbook on 2009/05/24 16:26:08

	Add proper ATA devices listing.

Affected files ...

.. //depot/projects/scottl-camlock/src/sbin/camcontrol/camcontrol.c#6 edit

Differences ...

==== //depot/projects/scottl-camlock/src/sbin/camcontrol/camcontrol.c#6 (text+ko) ====

@@ -396,19 +396,34 @@
 				} else
 					skip_device = 0;
 
-				cam_strvis(vendor, dev_result->inq_data.vendor,
+				if (dev_result->protocol == PROTO_SCSI) {
+				    cam_strvis(vendor, dev_result->inq_data.vendor,
 					   sizeof(dev_result->inq_data.vendor),
 					   sizeof(vendor));
-				cam_strvis(product,
+				    cam_strvis(product,
 					   dev_result->inq_data.product,
 					   sizeof(dev_result->inq_data.product),
 					   sizeof(product));
-				cam_strvis(revision,
+				    cam_strvis(revision,
 					   dev_result->inq_data.revision,
 					  sizeof(dev_result->inq_data.revision),
 					   sizeof(revision));
-				sprintf(tmpstr, "<%s %s %s>", vendor, product,
+				    sprintf(tmpstr, "<%s %s %s>", vendor, product,
+					revision);
+				} else if (dev_result->protocol == PROTO_ATA) {
+				    cam_strvis(product,
+					   dev_result->ident_data.model,
+					   sizeof(dev_result->ident_data.model),
+					   sizeof(product));
+				    cam_strvis(revision,
+					   dev_result->ident_data.revision,
+					  sizeof(dev_result->ident_data.revision),
+					   sizeof(revision));
+				    sprintf(tmpstr, "<%s %s>", product,
 					revision);
+				} else {
+				    sprintf(tmpstr, "<>");
+				}
 				if (need_close) {
 					fprintf(stdout, ")\n");
 					need_close = 0;



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