Date: Fri, 7 Jun 2013 12:33:40 +0000 (UTC) From: Steven Hartland <smh@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251492 - in stable/8/sys: cam cam/ata cam/scsi dev/ahci Message-ID: <201306071233.r57CXeeg097034@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: smh Date: Fri Jun 7 12:33:40 2013 New Revision: 251492 URL: http://svnweb.freebsd.org/changeset/base/251492 Log: MFC r250792: Added output of device QUIRKS for CAM and AHCI devices during boot. Modified: stable/8/sys/cam/ata/ata_da.c stable/8/sys/cam/cam_xpt.c stable/8/sys/cam/cam_xpt_periph.h stable/8/sys/cam/scsi/scsi_cd.c stable/8/sys/cam/scsi/scsi_ch.c stable/8/sys/cam/scsi/scsi_da.c stable/8/sys/cam/scsi/scsi_sa.c stable/8/sys/dev/ahci/ahci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/ahci/ (props changed) Modified: stable/8/sys/cam/ata/ata_da.c ============================================================================== --- stable/8/sys/cam/ata/ata_da.c Fri Jun 7 12:24:15 2013 (r251491) +++ stable/8/sys/cam/ata/ata_da.c Fri Jun 7 12:33:40 2013 (r251492) @@ -94,6 +94,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, @@ -1191,6 +1195,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: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Fri Jun 7 12:24:15 2013 (r251491) +++ stable/8/sys/cam/cam_xpt.c Fri Jun 7 12:33:40 2013 (r251492) @@ -1099,6 +1099,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); + } +} + static dev_match_ret xptbusmatch(struct dev_match_pattern *patterns, u_int num_patterns, struct cam_eb *bus) Modified: stable/8/sys/cam/cam_xpt_periph.h ============================================================================== --- stable/8/sys/cam/cam_xpt_periph.h Fri Jun 7 12:24:15 2013 (r251491) +++ stable/8/sys/cam/cam_xpt_periph.h Fri Jun 7 12:33:40 2013 (r251492) @@ -45,6 +45,8 @@ int32_t xpt_add_periph(struct cam_perip void xpt_remove_periph(struct cam_periph *periph); 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: stable/8/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_cd.c Fri Jun 7 12:24:15 2013 (r251491) +++ stable/8/sys/cam/scsi/scsi_cd.c Fri Jun 7 12:33:40 2013 (r251492) @@ -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, @@ -1782,6 +1790,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: stable/8/sys/cam/scsi/scsi_ch.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_ch.c Fri Jun 7 12:24:15 2013 (r251491) +++ stable/8/sys/cam/scsi/scsi_ch.c Fri Jun 7 12:33:40 2013 (r251492) @@ -126,6 +126,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 @@ -639,8 +643,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: stable/8/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_da.c Fri Jun 7 12:24:15 2013 (r251491) +++ stable/8/sys/cam/scsi/scsi_da.c Fri Jun 7 12:33:40 2013 (r251492) @@ -97,6 +97,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, @@ -2778,6 +2785,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: stable/8/sys/cam/scsi/scsi_sa.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_sa.c Fri Jun 7 12:24:15 2013 (r251491) +++ stable/8/sys/cam/scsi/scsi_sa.c Fri Jun 7 12:33:40 2013 (r251492) @@ -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: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Fri Jun 7 12:24:15 2013 (r251491) +++ stable/8/sys/dev/ahci/ahci.c Fri Jun 7 12:33:40 2013 (r251492) @@ -121,6 +121,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}, @@ -482,6 +498,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":"",
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306071233.r57CXeeg097034>