aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Elischer <julian@FreeBSD.org>1998-06-01 19:44:54 +0000
committerJulian Elischer <julian@FreeBSD.org>1998-06-01 19:44:54 +0000
commitaae96b2e7537f1480dde0bf95dd37910b9b834ca (patch)
treef88a45ed9f5d9ffb298f88371ff3d3df41cbcd52
parent686544f020a95e1b955788915cd7be53e0e90dc3 (diff)
downloadsrc-aae96b2e7537f1480dde0bf95dd37910b9b834ca.tar.gz
src-aae96b2e7537f1480dde0bf95dd37910b9b834ca.zip
Allow devfs to support the 'uk' device
Submitted by: Micha Class <michael_class@hp.com>
Notes
Notes: svn path=/head/; revision=36576
-rw-r--r--sys/scsi/uk.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/sys/scsi/uk.c b/sys/scsi/uk.c
index 34392182d742..a9b8edf4277b 100644
--- a/sys/scsi/uk.c
+++ b/sys/scsi/uk.c
@@ -2,12 +2,14 @@
* Driver for a device we can't identify.
* by Julian Elischer (julian@tfs.com)
*
- * $Id: uk.c,v 1.17 1997/03/23 06:33:54 bde Exp $
+ * $Id: uk.c,v 1.18 1997/08/02 14:33:16 bde Exp $
*
* If you find that you are adding any code to this file look closely
* at putting it in "scsi_driver.c" instead.
*/
+#include <opt_devfs.h>
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
@@ -18,6 +20,12 @@
#include <scsi/scsiconf.h>
#include <scsi/scsi_driver.h>
+struct scsi_data {
+#ifdef DEVFS
+ void *devfs_data_tok;
+#endif
+};
+
static d_open_t ukopen;
static d_close_t ukclose;
static d_ioctl_t ukioctl;
@@ -40,10 +48,10 @@ struct scsi_device uk_switch =
0,
{0, 0},
SDEV_ONCE_ONLY|SDEV_UK, /* Only one open allowed */
- 0,
+ ukattach,
"Unknown",
ukopen,
- 0,
+ sizeof(struct scsi_data),
T_UNKNOWN,
0,
0,
@@ -56,6 +64,22 @@ struct scsi_device uk_switch =
static uk_devsw_installed = 0;
+static errval
+ukattach(struct scsi_link *sc_link)
+{
+#ifdef DEVFS
+ struct scsi_data *uk = sc_link->sd;
+
+ uk->devfs_data_tok = devfs_add_devswf(&uk_cdevsw,
+ sc_link->dev_unit,
+ DV_CHR,
+ UID_ROOT, GID_WHEEL, 0600,
+ "uk%d", sc_link->dev_unit);
+#endif
+ return 0;
+}
+
+
static void uk_drvinit(void *unused)
{
dev_t dev;