[Midnightbsd-cvs] src [9486] trunk/sys/cam: Added output of device QUIRKS for CAM and AHCI devices during boot.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Mar 5 15:05:30 EST 2017


Revision: 9486
          http://svnweb.midnightbsd.org/src/?rev=9486
Author:   laffer1
Date:     2017-03-05 15:05:30 -0500 (Sun, 05 Mar 2017)
Log Message:
-----------
Added output of device QUIRKS for CAM and AHCI devices during boot.

Modified Paths:
--------------
    trunk/sys/cam/ata/ata_da.c
    trunk/sys/cam/cam_xpt.c
    trunk/sys/cam/cam_xpt_periph.h
    trunk/sys/cam/scsi/scsi_cd.c
    trunk/sys/cam/scsi/scsi_ch.c
    trunk/sys/cam/scsi/scsi_da.c
    trunk/sys/cam/scsi/scsi_sa.c

Modified: trunk/sys/cam/ata/ata_da.c
===================================================================
--- trunk/sys/cam/ata/ata_da.c	2017-03-05 20:04:43 UTC (rev 9485)
+++ trunk/sys/cam/ata/ata_da.c	2017-03-05 20:05:30 UTC (rev 9486)
@@ -95,6 +95,10 @@
 	ADA_Q_4K		= 0x01,
 } ada_quirks;
 
+#define ADA_Q_BIT_STRING	\
+	"\020"			\
+	"\0014K"
+
 typedef enum {
 	ADA_CCB_RAHEAD		= 0x01,
 	ADA_CCB_WCACHE		= 0x02,
@@ -1413,6 +1417,7 @@
 		dp->secsize, dp->heads,
 		dp->secs_per_track, dp->cylinders);
 	xpt_announce_periph(periph, announce_buf);
+	xpt_announce_quirks(periph, softc->quirks, ADA_Q_BIT_STRING);
 	if (legacy_id >= 0)
 		printf("%s%d: Previously was known as ad%d\n",
 		       periph->periph_name, periph->unit_number, legacy_id);

Modified: trunk/sys/cam/cam_xpt.c
===================================================================
--- trunk/sys/cam/cam_xpt.c	2017-03-05 20:04:43 UTC (rev 9485)
+++ trunk/sys/cam/cam_xpt.c	2017-03-05 20:05:30 UTC (rev 9486)
@@ -1114,6 +1114,15 @@
 		       periph->unit_number, announce_string);
 }
 
+void
+xpt_announce_quirks(struct cam_periph *periph, int quirks, char *bit_string)
+{
+	if (quirks != 0) {
+		printf("%s%d: quirks=0x%b\n", periph->periph_name,
+		    periph->unit_number, quirks, bit_string);
+	}
+}
+
 int
 xpt_getattr(char *buf, size_t len, const char *attr, struct cam_path *path)
 {

Modified: trunk/sys/cam/cam_xpt_periph.h
===================================================================
--- trunk/sys/cam/cam_xpt_periph.h	2017-03-05 20:04:43 UTC (rev 9485)
+++ trunk/sys/cam/cam_xpt_periph.h	2017-03-05 20:05:30 UTC (rev 9486)
@@ -46,6 +46,8 @@
 				  int topology_lock_held);
 void		xpt_announce_periph(struct cam_periph *periph,
 				    char *announce_string);
+void		xpt_announce_quirks(struct cam_periph *periph,
+				    int quirks, char *bit_string);
 #endif
 
 #endif /* _CAM_CAM_XPT_PERIPH_H */

Modified: trunk/sys/cam/scsi/scsi_cd.c
===================================================================
--- trunk/sys/cam/scsi/scsi_cd.c	2017-03-05 20:04:43 UTC (rev 9485)
+++ trunk/sys/cam/scsi/scsi_cd.c	2017-03-05 20:05:30 UTC (rev 9486)
@@ -92,6 +92,14 @@
 	CD_Q_10_BYTE_ONLY	= 0x10
 } cd_quirks;
 
+#define CD_Q_BIT_STRING		\
+	"\020"			\
+	"\001NO_TOUCH"		\
+	"\002BCD_TRACKS"	\
+	"\003NO_CHANGER"	\
+	"\004CHANGER"		\
+	"\00510_BYTE_ONLY"
+
 typedef enum {
 	CD_FLAG_INVALID		= 0x0001,
 	CD_FLAG_NEW_DISC	= 0x0002,
@@ -1866,6 +1874,8 @@
 		free(rdcap, M_SCSICD);
 		if (announce_buf[0] != '\0') {
 			xpt_announce_periph(periph, announce_buf);
+			xpt_announce_quirks(periph, softc->quirks,
+			    CD_Q_BIT_STRING);
 			if (softc->flags & CD_FLAG_CHANGER)
 				cdchangerschedule(softc);
 			/*

Modified: trunk/sys/cam/scsi/scsi_ch.c
===================================================================
--- trunk/sys/cam/scsi/scsi_ch.c	2017-03-05 20:04:43 UTC (rev 9485)
+++ trunk/sys/cam/scsi/scsi_ch.c	2017-03-05 20:05:30 UTC (rev 9486)
@@ -125,6 +125,10 @@
 	CH_Q_NO_DBD	= 0x01
 } ch_quirks;
 
+#define CH_Q_BIT_STRING	\
+	"\020"		\
+	"\001NO_DBD"
+
 #define ccb_state	ppriv_field0
 #define ccb_bp		ppriv_ptr1
 
@@ -703,8 +707,11 @@
 				announce_buf[0] = '\0';
 			}
 		}
-		if (announce_buf[0] != '\0')
+		if (announce_buf[0] != '\0') {
 			xpt_announce_periph(periph, announce_buf);
+			xpt_announce_quirks(periph, softc->quirks,
+			    CH_Q_BIT_STRING);
+		}
 		softc->state = CH_STATE_NORMAL;
 		free(mode_header, M_SCSICH);
 		/*

Modified: trunk/sys/cam/scsi/scsi_da.c
===================================================================
--- trunk/sys/cam/scsi/scsi_da.c	2017-03-05 20:04:43 UTC (rev 9485)
+++ trunk/sys/cam/scsi/scsi_da.c	2017-03-05 20:05:30 UTC (rev 9486)
@@ -100,6 +100,13 @@
 	DA_Q_4K			= 0x08
 } da_quirks;
 
+#define DA_Q_BIT_STRING		\
+	"\020"			\
+	"\001NO_SYNC_CACHE"	\
+	"\002NO_6_BYTE"		\
+	"\003NO_PREVENT"	\
+	"\0044K"
+
 typedef enum {
 	DA_CCB_PROBE_RC		= 0x01,
 	DA_CCB_PROBE_RC16	= 0x02,
@@ -2903,7 +2910,8 @@
 				taskqueue_enqueue(taskqueue_thread,
 						  &softc->sysctl_task);
 				xpt_announce_periph(periph, announce_buf);
-
+				xpt_announce_quirks(periph, softc->quirks,
+				    DA_Q_BIT_STRING);
 			} else {
 				xpt_print(periph->path, "fatal error, "
 				    "could not acquire reference count\n");

Modified: trunk/sys/cam/scsi/scsi_sa.c
===================================================================
--- trunk/sys/cam/scsi/scsi_sa.c	2017-03-05 20:04:43 UTC (rev 9485)
+++ trunk/sys/cam/scsi/scsi_sa.c	2017-03-05 20:05:30 UTC (rev 9486)
@@ -173,6 +173,17 @@
 	SA_QUIRK_NO_CPAGE	= 0x80	/* Don't use DEVICE COMPRESSION page */
 } sa_quirks;
 
+#define SA_QUIRK_BIT_STRING	\
+	"\020"			\
+	"\001NOCOMP"		\
+	"\002FIXED"		\
+	"\003VARIABLE"		\
+	"\0042FM"		\
+	"\0051FM"		\
+	"\006NODREAD"		\
+	"\007NO_MODESEL"	\
+	"\010NO_CPAGE"
+
 #define	SAMODE(z)	(dev2unit(z) & 0x3)
 #define	SADENSITY(z)	((dev2unit(z) >> 2) & 0x3)
 #define	SA_IS_CTRL(z)	(dev2unit(z) & (1 << 4))
@@ -1546,6 +1557,7 @@
 	xpt_register_async(AC_LOST_DEVICE, saasync, periph, periph->path);
 
 	xpt_announce_periph(periph, NULL);
+	xpt_announce_quirks(periph, softc->quirks, SA_QUIRK_BIT_STRING);
 
 	return (CAM_REQ_CMP);
 }



More information about the Midnightbsd-cvs mailing list