From owner-svn-src-head@FreeBSD.ORG Sat May 18 23:36:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0BDCE4DF; Sat, 18 May 2013 23:36:24 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F0E3F991; Sat, 18 May 2013 23:36:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4INaNIU082574; Sat, 18 May 2013 23:36:23 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4INaMVc082562; Sat, 18 May 2013 23:36:22 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201305182336.r4INaMVc082562@svn.freebsd.org> From: Steven Hartland Date: Sat, 18 May 2013 23:36:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250792 - in head/sys: cam cam/ata cam/scsi dev/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 May 2013 23:36:24 -0000 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":"",