svn commit: r250792 - in head/sys: cam cam/ata cam/scsi dev/ahci

Steven Hartland smh at FreeBSD.org
Sat May 18 23:36:24 UTC 2013


Author: smh
Date: Sat May 18 23:36:21 2013
New Revision: 250792
URL: http://svnweb.freebsd.org/changeset/base/250792

Log:
  Added output of device QUIRKS for CAM and AHCI devices during boot.
  
  Reviewed by:	mav
  Approved by:	pjd (mentor)
  MFC after:	2 weeks

Modified:
  head/sys/cam/ata/ata_da.c
  head/sys/cam/cam_xpt.c
  head/sys/cam/cam_xpt_periph.h
  head/sys/cam/scsi/scsi_cd.c
  head/sys/cam/scsi/scsi_ch.c
  head/sys/cam/scsi/scsi_da.c
  head/sys/cam/scsi/scsi_sa.c
  head/sys/dev/ahci/ahci.c

Modified: head/sys/cam/ata/ata_da.c
==============================================================================
--- head/sys/cam/ata/ata_da.c	Sat May 18 22:42:21 2013	(r250791)
+++ head/sys/cam/ata/ata_da.c	Sat May 18 23:36:21 2013	(r250792)
@@ -93,6 +93,10 @@ typedef enum {
 	ADA_Q_4K		= 0x01,
 } ada_quirks;
 
+#define ADA_Q_BIT_STRING	\
+	"\020"			\
+	"\0014K"
+
 typedef enum {
 	ADA_CCB_RAHEAD		= 0x01,
 	ADA_CCB_WCACHE		= 0x02,
@@ -1278,6 +1282,7 @@ adaregister(struct cam_periph *periph, v
 		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: head/sys/cam/cam_xpt.c
==============================================================================
--- head/sys/cam/cam_xpt.c	Sat May 18 22:42:21 2013	(r250791)
+++ head/sys/cam/cam_xpt.c	Sat May 18 23:36:21 2013	(r250792)
@@ -1084,6 +1084,15 @@ xpt_announce_periph(struct cam_periph *p
 		       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: head/sys/cam/cam_xpt_periph.h
==============================================================================
--- head/sys/cam/cam_xpt_periph.h	Sat May 18 22:42:21 2013	(r250791)
+++ head/sys/cam/cam_xpt_periph.h	Sat May 18 23:36:21 2013	(r250792)
@@ -46,6 +46,8 @@ void		xpt_remove_periph(struct cam_perip
 				  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: head/sys/cam/scsi/scsi_cd.c
==============================================================================
--- head/sys/cam/scsi/scsi_cd.c	Sat May 18 22:42:21 2013	(r250791)
+++ head/sys/cam/scsi/scsi_cd.c	Sat May 18 23:36:21 2013	(r250792)
@@ -92,6 +92,14 @@ typedef enum {
 	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,
@@ -1867,6 +1875,8 @@ cddone(struct cam_periph *periph, union 
 		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: head/sys/cam/scsi/scsi_ch.c
==============================================================================
--- head/sys/cam/scsi/scsi_ch.c	Sat May 18 22:42:21 2013	(r250791)
+++ head/sys/cam/scsi/scsi_ch.c	Sat May 18 23:36:21 2013	(r250792)
@@ -125,6 +125,10 @@ typedef enum {
 	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
 
@@ -706,8 +710,11 @@ chdone(struct cam_periph *periph, union 
 				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: head/sys/cam/scsi/scsi_da.c
==============================================================================
--- head/sys/cam/scsi/scsi_da.c	Sat May 18 22:42:21 2013	(r250791)
+++ head/sys/cam/scsi/scsi_da.c	Sat May 18 23:36:21 2013	(r250792)
@@ -99,6 +99,13 @@ typedef enum {
 	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,
@@ -2957,7 +2964,8 @@ dadone(struct cam_periph *periph, union 
 				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: head/sys/cam/scsi/scsi_sa.c
==============================================================================
--- head/sys/cam/scsi/scsi_sa.c	Sat May 18 22:42:21 2013	(r250791)
+++ head/sys/cam/scsi/scsi_sa.c	Sat May 18 23:36:21 2013	(r250792)
@@ -173,6 +173,17 @@ typedef enum {
 	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 @@ saregister(struct cam_periph *periph, vo
 	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);
 }

Modified: head/sys/dev/ahci/ahci.c
==============================================================================
--- head/sys/dev/ahci/ahci.c	Sat May 18 22:42:21 2013	(r250791)
+++ head/sys/dev/ahci/ahci.c	Sat May 18 23:36:21 2013	(r250792)
@@ -115,6 +115,22 @@ static struct {
 #define AHCI_Q_NOCOUNT	1024
 #define AHCI_Q_ALTSIG	2048
 #define AHCI_Q_NOMSI	4096
+
+#define AHCI_Q_BIT_STRING	\
+	"\020"			\
+	"\001NOFORCE"		\
+	"\002NOPMP"		\
+	"\003NONCQ"		\
+	"\0041CH"		\
+	"\0052CH"		\
+	"\0064CH"		\
+	"\007EDGEIS"		\
+	"\010SATA2"		\
+	"\011NOBSYRES"		\
+	"\012NOAA"		\
+	"\013NOCOUNT"		\
+	"\014ALTSIG"		\
+	"\015NOMSI"
 } ahci_ids[] = {
 	{0x43801002, 0x00, "ATI IXP600",	AHCI_Q_NOMSI},
 	{0x43901002, 0x00, "ATI IXP700",	0},
@@ -489,6 +505,10 @@ ahci_attach(device_t dev)
 		    "supported" : "not supported",
 		    (ctlr->caps & AHCI_CAP_FBSS) ?
 		    " with FBS" : "");
+	if (ctlr->quirks != 0) {
+		device_printf(dev, "quirks=0x%b\n", ctlr->quirks,
+		    AHCI_Q_BIT_STRING);
+	}
 	if (bootverbose) {
 		device_printf(dev, "Caps:%s%s%s%s%s%s%s%s %sGbps",
 		    (ctlr->caps & AHCI_CAP_64BIT) ? " 64bit":"",


More information about the svn-src-head mailing list