diff options
author | julian <julian@FreeBSD.org> | 1998-06-01 19:44:54 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1998-06-01 19:44:54 +0000 |
commit | 5c6ec72d1613409295be390d76fb691885845f85 (patch) | |
tree | c9f1c27e7c341bc4864837e121bb7e3d80925f4d | |
parent | 2e14b57974b6399ec9027cb64afa2a2d1ca83799 (diff) | |
download | FreeBSD-src-5c6ec72d1613409295be390d76fb691885845f85.zip FreeBSD-src-5c6ec72d1613409295be390d76fb691885845f85.tar.gz |
Allow devfs to support the 'uk' device
Submitted by: Micha Class <michael_class@hp.com>
-rw-r--r-- | sys/scsi/uk.c | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/sys/scsi/uk.c b/sys/scsi/uk.c index 3439218..a9b8edf 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; |