Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Oct 1998 23:32:05 +0100
From:      Sebastian Lederer <lederer@bonn-online.com>
To:        freebsd-hackers@FreeBSD.ORG
Subject:   Patch for src/sys/i386/isa/wd.c
Message-ID:  <3634F865.9755D2E7@bonn-online.com>

next in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Hi,

How about the following patch to src/sys/i386/isa/wd.c ? It fills in the
disk model name (and disk type) when reading the in-core disk label via
the DIOCGDINFO ioctl(), if it has not already been set. Tested and
working on a couple of machines. It's just a simple way for userland
programs to identify IDE disks by name (which is what I need for a
FreeBSD installation program).

Best regards,
Sebastian Lederer

--
Sebastian Lederer
lederer@bonn-online.com



[-- Attachment #2 --]
*** sys/i386/isa/wd.c.orig	Mon Oct 26 21:49:04 1998
--- sys/i386/isa/wd.c	Mon Oct 26 23:03:57 1998
***************
*** 1984,1989 ****
--- 1984,2003 ----
  	wdsleep(du->dk_ctrlr, "wdioct");
  	error = dsioctl("wd", dev, cmd, addr, flags, &du->dk_slices,
  			wdstrategy1, (ds_setgeom_t *)NULL);
+ 
+ 
+ 	if (!error && cmd == DIOCGDINFO) {
+ 		if (!strncmp(((struct disklabel *) addr)->d_packname,
+ 			     "fictitious",
+ 			 sizeof(((struct disklabel *) addr)->d_packname))) { 
+ 
+ 			((struct disklabel *) addr)->d_type = DTYPE_ESDI;
+ 			bcopy(du->dk_params.wdp_model,
+ 			      ((struct disklabel *) addr)->d_packname,
+ 			   sizeof(((struct disklabel *) addr)->d_packname));
+ 		}
+ 	}
+ 
  	if (error != ENOIOCTL)
  		return (error);
  	switch (cmd) {

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3634F865.9755D2E7>