summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorsmh <smh@FreeBSD.org>2013-05-18 23:36:21 +0000
committersmh <smh@FreeBSD.org>2013-05-18 23:36:21 +0000
commit99516daae550194c4659ff0f4c31cb515b63ee88 (patch)
tree5e94763c709f06d7bbb8507ed710a1dc505213a0 /sys
parent8987b328e8f40bef2aaf5a2de0ea4d5a0aab8c62 (diff)
downloadFreeBSD-src-99516daae550194c4659ff0f4c31cb515b63ee88.zip
FreeBSD-src-99516daae550194c4659ff0f4c31cb515b63ee88.tar.gz
Added output of device QUIRKS for CAM and AHCI devices during boot.
Reviewed by: mav Approved by: pjd (mentor) MFC after: 2 weeks
Diffstat (limited to 'sys')
-rw-r--r--sys/cam/ata/ata_da.c5
-rw-r--r--sys/cam/cam_xpt.c9
-rw-r--r--sys/cam/cam_xpt_periph.h2
-rw-r--r--sys/cam/scsi/scsi_cd.c10
-rw-r--r--sys/cam/scsi/scsi_ch.c9
-rw-r--r--sys/cam/scsi/scsi_da.c10
-rw-r--r--sys/cam/scsi/scsi_sa.c12
-rw-r--r--sys/dev/ahci/ahci.c20
8 files changed, 75 insertions, 2 deletions
diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c
index 0162fce..18cb6ad 100644
--- a/sys/cam/ata/ata_da.c
+++ b/sys/cam/ata/ata_da.c
@@ -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, void *arg)
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);
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index f92c33c..5f1300f 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -1084,6 +1084,15 @@ xpt_announce_periph(struct cam_periph *periph, char *announce_string)
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)
{
diff --git a/sys/cam/cam_xpt_periph.h b/sys/cam/cam_xpt_periph.h
index d353283..1dbbdd9 100644
--- a/sys/cam/cam_xpt_periph.h
+++ b/sys/cam/cam_xpt_periph.h
@@ -46,6 +46,8 @@ void xpt_remove_periph(struct cam_periph *periph,
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 */
diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c
index ba903a1..4bfbc41 100644
--- a/sys/cam/scsi/scsi_cd.c
+++ b/sys/cam/scsi/scsi_cd.c
@@ -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 ccb *done_ccb)
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);
/*
diff --git a/sys/cam/scsi/scsi_ch.c b/sys/cam/scsi/scsi_ch.c
index a1d0db5..02bbd60 100644
--- a/sys/cam/scsi/scsi_ch.c
+++ b/sys/cam/scsi/scsi_ch.c
@@ -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 ccb *done_ccb)
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);
/*
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 93156a6..de11028 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -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 ccb *done_ccb)
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");
diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c
index 6f2d0f7..3f97432 100644
--- a/sys/cam/scsi/scsi_sa.c
+++ b/sys/cam/scsi/scsi_sa.c
@@ -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, void *arg)
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);
}
diff --git a/sys/dev/ahci/ahci.c b/sys/dev/ahci/ahci.c
index 88069eb..56fa668 100644
--- a/sys/dev/ahci/ahci.c
+++ b/sys/dev/ahci/ahci.c
@@ -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":"",
OpenPOWER on IntegriCloud