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>
index | next in thread | raw e-mail
[-- Attachment #1 --]
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)
-------------------------------------------------------------------------
[-- Attachment #2 --]
*** 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)
{
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3571407E.D3D078E1>
