Date: Sun, 31 May 1998 13:35:26 +0200 From: Micha Class <michael_class@hp.com> To: current@FreeBSD.ORG Subject: scsi-uk and DEVFS Message-ID: <3571407E.D3D078E1@hp.com>
next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------3EC78750E2ECE13AA8EFF14B Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello, I just found that the uk-driver which I am using for my scanner (together with sane), does not include devicenodes when DEVFS is used. The following patch fixes that for me (mostly stolen from pt.c) If someone with commit-privileges could check and possibly commit this, this would be nice. Michael -- ------------------------------------------------------------------------- michael class, viktor-renner str. 39, 72074 tuebingen, frg E-Mail: michael_class@hp.com Phone: +49 7031 14-3707 (work) +49 7071 81950 (private) ------------------------------------------------------------------------- --------------3EC78750E2ECE13AA8EFF14B Content-Type: text/plain; charset=us-ascii; name="uk.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="uk.diff" *** src/sys/scsi/uk.c Sat Aug 2 16:33:16 1997 --- src/sys/scsi/uk.c.NEW Sun May 31 13:27:15 1998 *************** *** 8,13 **** --- 8,15 ---- * 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,23 **** --- 20,31 ---- #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,49 **** 0, {0, 0}, SDEV_ONCE_ONLY|SDEV_UK, /* Only one open allowed */ ! 0, "Unknown", ukopen, ! 0, T_UNKNOWN, 0, 0, --- 48,57 ---- 0, {0, 0}, SDEV_ONCE_ONLY|SDEV_UK, /* Only one open allowed */ ! ukattach, "Unknown", ukopen, ! sizeof(struct scsi_data), T_UNKNOWN, 0, 0, *************** *** 55,60 **** --- 63,84 ---- 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) { --------------3EC78750E2ECE13AA8EFF14B-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3571407E.D3D078E1>