Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/scsipi Set disk product name as disk type. The infor...
details: https://anonhg.NetBSD.org/src/rev/0d302b4a8800
branches: trunk
changeset: 840057:0d302b4a8800
user: mlelstv <mlelstv%NetBSD.org@localhost>
date: Tue Mar 19 06:59:40 2019 +0000
description:
Set disk product name as disk type. The information can be queried through
drvctl(4).
diffstat:
sys/dev/scsipi/sd.c | 8 +++++---
sys/dev/scsipi/sdvar.h | 3 ++-
2 files changed, 7 insertions(+), 4 deletions(-)
diffs (51 lines):
diff -r b07820ff6aba -r 0d302b4a8800 sys/dev/scsipi/sd.c
--- a/sys/dev/scsipi/sd.c Tue Mar 19 06:51:05 2019 +0000
+++ b/sys/dev/scsipi/sd.c Tue Mar 19 06:59:40 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sd.c,v 1.326 2018/10/07 18:14:32 christos Exp $ */
+/* $NetBSD: sd.c,v 1.327 2019/03/19 06:59:40 mlelstv Exp $ */
/*-
* Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc.
@@ -47,7 +47,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.326 2018/10/07 18:14:32 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.327 2019/03/19 06:59:40 mlelstv Exp $");
#ifdef _KERNEL_OPT
#include "opt_scsi.h"
@@ -256,6 +256,8 @@
sd->type = (sa->sa_inqbuf.type & SID_TYPE);
strncpy(sd->name, sa->sa_inqbuf.product, sizeof(sd->name));
+ strncpy(sd->typename, sa->sa_inqbuf.product, sizeof(sd->typename));
+
if (sd->type == T_SIMPLE_DIRECT)
periph->periph_quirks |= PQUIRK_ONLYBIG | PQUIRK_NOBIGMODESENSE;
@@ -1936,5 +1938,5 @@
dg->dg_ntracks = sd->params.heads;
dg->dg_ncylinders = sd->params.cyls;
- disk_set_info(dksc->sc_dev, &dksc->sc_dkdev, NULL);
+ disk_set_info(dksc->sc_dev, &dksc->sc_dkdev, sd->typename);
}
diff -r b07820ff6aba -r 0d302b4a8800 sys/dev/scsipi/sdvar.h
--- a/sys/dev/scsipi/sdvar.h Tue Mar 19 06:51:05 2019 +0000
+++ b/sys/dev/scsipi/sdvar.h Tue Mar 19 06:59:40 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sdvar.h,v 1.38 2016/12/10 10:26:38 mlelstv Exp $ */
+/* $NetBSD: sdvar.h,v 1.39 2019/03/19 06:59:40 mlelstv Exp $ */
/*-
* Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
@@ -88,6 +88,7 @@
callout_t sc_callout;
u_int8_t type;
char name[16]; /* product name, for default disklabel */
+ char typename[128+4+1]; /* stored in disk info */
};
#define SDGP_RESULT_OK 0 /* parameters obtained */
Home |
Main Index |
Thread Index |
Old Index