PERFORCE change 162654 for review

Alexander Motin mav at FreeBSD.org
Sun May 24 16:26:50 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=162654

Change 162654 by mav at 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;


More information about the p4-projects mailing list