Added output of device QUIRKS for CAM and AHCI devices during boot.

Reviewed by:	mav
Approved by:	pjd (mentor)
MFC after:	2 weeks
This commit is contained in:
Steven Hartland 2013-05-18 23:36:21 +00:00
parent 11ee687c67
commit 6fb5c84ea2
8 changed files with 75 additions and 2 deletions

View File

@ -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);

View File

@ -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)
{

View File

@ -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 */

View File

@ -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);
/*

View File

@ -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);
/*

View File

@ -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");

View File

@ -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);
}

View File

@ -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":"",