Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ata Set disk model name as disk type. The informatio...
details: https://anonhg.NetBSD.org/src/rev/32c2f8e2d7e8
branches: trunk
changeset: 449738:32c2f8e2d7e8
user: mlelstv <mlelstv%NetBSD.org@localhost>
date: Tue Mar 19 06:51:05 2019 +0000
description:
Set disk model name as disk type. The information can be queried through
drvctl(4).
diffstat:
sys/dev/ata/wd.c | 15 ++++++++++-----
sys/dev/ata/wdvar.h | 4 +++-
2 files changed, 13 insertions(+), 6 deletions(-)
diffs (75 lines):
diff -r f27ec049f01d -r 32c2f8e2d7e8 sys/dev/ata/wd.c
--- a/sys/dev/ata/wd.c Tue Mar 19 06:47:12 2019 +0000
+++ b/sys/dev/ata/wd.c Tue Mar 19 06:51:05 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wd.c,v 1.444 2019/03/19 06:47:12 mlelstv Exp $ */
+/* $NetBSD: wd.c,v 1.445 2019/03/19 06:51:05 mlelstv Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@@ -54,7 +54,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.444 2019/03/19 06:47:12 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.445 2019/03/19 06:51:05 mlelstv Exp $");
#include "opt_ata.h"
#include "opt_wd.h"
@@ -309,7 +309,7 @@
struct dk_softc *dksc = &wd->sc_dksc;
struct ata_device *adev= aux;
int i, blank;
- char tbuf[41], pbuf[9], c, *p, *q;
+ char tbuf[41],pbuf[9], c, *p, *q;
const struct wd_quirk *wdq;
int dtype = DKTYPE_UNKNOWN;
@@ -359,7 +359,8 @@
}
*q++ = '\0';
- aprint_normal_dev(self, "<%s>\n", tbuf);
+ wd->sc_typename = kmem_asprintf("%s", tbuf);
+ aprint_normal_dev(self, "<%s>\n", wd->sc_typename);
wdq = wd_lookup_quirks(tbuf);
if (wdq != NULL)
@@ -555,6 +556,10 @@
}
wd->sc_bscount = 0;
#endif
+ if (wd->sc_typename != NULL) {
+ kmem_free(wd->sc_typename, strlen(wd->sc_typename) + 1);
+ wd->sc_typename = NULL;
+ }
pmf_device_deregister(self);
@@ -1608,7 +1613,7 @@
if ((wd->sc_flags & WDF_LBA) == 0)
dg->dg_ncylinders = wd->sc_params.atap_cylinders;
- disk_set_info(dksc->sc_dev, &dksc->sc_dkdev, NULL);
+ disk_set_info(dksc->sc_dev, &dksc->sc_dkdev, wd->sc_typename);
}
int
diff -r f27ec049f01d -r 32c2f8e2d7e8 sys/dev/ata/wdvar.h
--- a/sys/dev/ata/wdvar.h Tue Mar 19 06:47:12 2019 +0000
+++ b/sys/dev/ata/wdvar.h Tue Mar 19 06:51:05 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wdvar.h,v 1.47 2018/10/22 20:13:47 jdolecek Exp $ */
+/* $NetBSD: wdvar.h,v 1.48 2019/03/19 06:51:05 mlelstv Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer.
@@ -86,6 +86,8 @@
int drv_chaos_freq; /* frequency of simulated bio errors */
int drv_chaos_cnt; /* count of processed bio read xfers */
#endif
+ unsigned inflight;
+ char *sc_typename;
};
#endif /* _DEV_ATA_WDVAR_H_ */
Home |
Main Index |
Thread Index |
Old Index