Subject: port-i386/2157: The "uk" device still can't be configured
To: None <gnats-bugs@NetBSD.ORG>
From: Andreas Gustafsson <gson@araneus.fi>
List: netbsd-bugs
Date: 03/02/1996 12:31:01
>Number:         2157
>Category:       port-i386
>Synopsis:       The "uk" device still can't be configured
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Mar  2 05:35:03 1996
>Last-Modified:
>Originator:     Andreas Gustafsson
>Organization:
Araneus Information Systems Oy
>Release:        NetBSD 1.1
>Environment:

System: NetBSD guava.araneus.fi 1.1 NetBSD 1.1 (GUAVA) #3: Wed Feb 28 12:27:14 EET 1996 gson@guava.araneus.fi:/usr/src/sys/arch/i386/compile/GUAVA i386

>Description:

There is no way to configure a "uk" (generic SCSI) device in
NetBSD/i386, despite the fact that the driver itself already
exists and is fully functional.

I submitted a set of patches correcting the situation as PR #988
as early as April, 1995.  Regrettably, these changes have not been
integrated into NetBSD 1.1.  Since then, there have been extensive
changes to the configuration mechanisms, necessitating a revised set
of patches (enclosed).

I have now been using the "uk" driver successfully for almost a year,
driving a Sharp JX-300 GPIB flatbed scanner through a National
Instruments SCSI/GPIB interface unit.

>How-To-Repeat:

Attempt to configure a "uk" device on a NetBSD/i386 system.

>Fix:

Apply the following patches.

*** usr/src/sys/arch/i386/i386/conf.c.no-uk	Tue Jan 23 08:31:29 1996
--- usr/src/sys/arch/i386/i386/conf.c	Mon Jan 29 06:50:05 1996
***************
*** 143,148 ****
--- 143,150 ----
  cdev_decl(lpt);
  #include "ch.h"
  cdev_decl(ch);
+ #include "uk.h"
+ cdev_decl(uk);
  dev_decl(fd,open);
  #include "bpfilter.h"
  cdev_decl(bpf);
***************
*** 194,200 ****
  	cdev_lpt_init(NLPT,lpt),	/* 16: parallel printer */
  	cdev_ch_init(NCH,ch),		/* 17: SCSI autochanger */
  	cdev_disk_init(NCCD,ccd),	/* 18: concatenated disk driver */
! 	cdev_notdef(),			/* 19 */
  	cdev_notdef(),			/* 20 */
  	cdev_notdef(),			/* 21 */
  	cdev_fd_init(1,fd),		/* 22: file descriptor pseudo-device */
--- 196,202 ----
  	cdev_lpt_init(NLPT,lpt),	/* 16: parallel printer */
  	cdev_ch_init(NCH,ch),		/* 17: SCSI autochanger */
  	cdev_disk_init(NCCD,ccd),	/* 18: concatenated disk driver */
! 	cdev_uk_init(NUK,uk),		/* 19: SCSI generic */
  	cdev_notdef(),			/* 20 */
  	cdev_notdef(),			/* 21 */
  	cdev_fd_init(1,fd),		/* 22: file descriptor pseudo-device */
*** usr/src/sys/arch/i386/conf/GENERIC.no-uk	Wed Oct 18 04:33:45 1995
--- usr/src/sys/arch/i386/conf/GENERIC	Tue Jan 23 08:31:46 1996
***************
*** 133,138 ****
--- 133,139 ----
  st*	at scsibus? target ? lun ?	# SCSI tape drives
  cd*	at scsibus? target ? lun ?	# SCSI CD-ROM drives
  ch*	at scsibus? target ? lun ?	# SCSI autochangers
+ uk*	at scsibus? target ? lun ?      # SCSI unknown
  
  fdc0	at isa? port 0x3f0 irq 6 drq 2	# standard PC floppy controllers
  #fdc1	at isa? port 0x370 irq ? drq ?
*** dev/MAKEDEV.no-uk	Mon Aug  1 15:38:31 1994
--- dev/MAKEDEV	Thu Feb 29 03:31:34 1996
***************
*** 80,86 ****
  
  all)
  	sh MAKEDEV std fd wt0 fd0 fd1 wd0 wd1 sd0 sd1 sd2 tty0 tty1 pty0 pty1
! 	sh MAKEDEV st0 st1 ch0 cd0 cd1 mcd0 vnd0 vnd1 lpa0 lpa1
  	sh MAKEDEV lpt0 lpt1 lpt2 ttyv0 bpf0 bpf1 bpf2 bpf3 speaker lkm
  	sh MAKEDEV mms0 lms0 pms0 audio local
  # MISSING:
--- 80,86 ----
  
  all)
  	sh MAKEDEV std fd wt0 fd0 fd1 wd0 wd1 sd0 sd1 sd2 tty0 tty1 pty0 pty1
! 	sh MAKEDEV st0 st1 ch0 uk0 cd0 cd1 mcd0 vnd0 vnd1 lpa0 lpa1
  	sh MAKEDEV lpt0 lpt1 lpt2 ttyv0 bpf0 bpf1 bpf2 bpf3 speaker lkm
  	sh MAKEDEV mms0 lms0 pms0 audio local
  # MISSING:
***************
*** 258,263 ****
--- 258,274 ----
  		;;
  	esac
  	umask 77
+ 	;;
+ 
+ uk*)
+ 	unit=`expr $i : '..\(.*\)'`
+ 	case $i in
+ 	uk*) name=uk;  chr=19;;
+ 	esac
+ 	rm -f $name$unit
+ 	mknod ${name}${unit}	c $chr $unit
+ 	chgrp operator ${name}${unit}
+ 	chmod 600 ${name}${unit}
  	;;
  
  cd*|mcd*)
*** usr/src/sys/sys/conf.h.no-uk	Mon Jan 29 06:56:08 1996
--- usr/src/sys/sys/conf.h	Mon Jan 29 06:56:15 1996
***************
*** 278,283 ****
--- 278,290 ----
  	(dev_type_stop((*))) enodev, 0, (dev_type_select((*))) enodev, \
  	(dev_type_mmap((*))) enodev }
  
+ /* open, close, ioctl */
+ #define	cdev_uk_init(c,n) { \
+ 	dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \
+ 	(dev_type_write((*))) enodev, dev_init(c,n,ioctl), \
+ 	(dev_type_stop((*))) enodev, 0, (dev_type_select((*))) enodev, \
+ 	(dev_type_mmap((*))) enodev }
+ 
  /* open, close, ioctl, mmap */
  #define	cdev_fb_init(c,n) { \
  	dev_init(c,n,open), dev_init(c,n,close), (dev_type_read((*))) enodev, \

-- 
Andreas Gustafsson, gson@araneus.fi
>Audit-Trail:
>Unformatted: