PERFORCE change 163080 for review
Alexander Motin
mav at FreeBSD.org
Sat May 30 12:58:50 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=163080
Change 163080 by mav at mav_mavbook on 2009/05/30 12:57:50
Print some more information about device.
Affected files ...
.. //depot/projects/scottl-camlock/src/sys/cam/ata/ata_all.c#5 edit
Differences ...
==== //depot/projects/scottl-camlock/src/sys/cam/ata/ata_all.c#5 (text+ko) ====
@@ -45,6 +45,19 @@
#include <cam/ata/ata_all.h>
#include <sys/sbuf.h>
+static int
+ata_version(int ver)
+{
+ int bit;
+
+ if (ver == 0xffff)
+ return 0;
+ for (bit = 15; bit >= 0; bit--)
+ if (ver & (1<<bit))
+ return bit;
+ return 0;
+}
+
void
ata_print_ident(struct ata_params *ident_data)
{
@@ -54,9 +67,17 @@
sizeof(product));
cam_strvis(revision, ident_data->revision, sizeof(ident_data->revision),
sizeof(revision));
-
- printf("<%s %s> ATA device\n",
- product, revision);
+ printf("<%s %s> ATA/ATAPI-%d",
+ product, revision, ata_version(ident_data->version_major));
+ if (ident_data->satacapabilities && ident_data->satacapabilities != 0xffff) {
+ if (ident_data->satacapabilities & ATA_SATA_GEN2)
+ printf(" SATA 2.x");
+ else if (ident_data->satacapabilities & ATA_SATA_GEN1)
+ printf(" SATA 1.x");
+ else
+ printf(" SATA");
+ }
+ printf(" device\n");
}
#endif /* _KERNEL */
More information about the p4-projects
mailing list