From owner-freebsd-hackers Mon Oct 26 14:32:30 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA01334 for freebsd-hackers-outgoing; Mon, 26 Oct 1998 14:32:30 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from circe.bonn-online.com (circe.bonn-online.com [195.52.214.66]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA01328 for ; Mon, 26 Oct 1998 14:32:28 -0800 (PST) (envelope-from lederer@bonn-online.com) Received: from bonn-online.com (ppp142.dialin.bonn-online.com [194.162.223.142]) by circe.bonn-online.com (8.8.5/8.8.5) with ESMTP id XAA19751 for ; Mon, 26 Oct 1998 23:31:38 +0100 Message-ID: <3634F865.9755D2E7@bonn-online.com> Date: Mon, 26 Oct 1998 23:32:05 +0100 From: Sebastian Lederer X-Mailer: Mozilla 4.04 [en] (X11; I; FreeBSD 3.0-CURRENT i386) MIME-Version: 1.0 To: freebsd-hackers@FreeBSD.ORG Subject: Patch for src/sys/i386/isa/wd.c Content-Type: multipart/mixed; boundary="------------8F9E5C4B973502E5736EE3E7" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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