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
This is a multi-part message in MIME format. --------------8F9E5C4B973502E5736EE3E7 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 --------------8F9E5C4B973502E5736EE3E7 Content-Type: text/plain; charset=us-ascii; name="wd.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="wd.c.diff" *** 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) { --------------8F9E5C4B973502E5736EE3E7-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3634F865.9755D2E7>