NetBSD Problem Report #22393

Received: (qmail 20682 invoked by uid 605); 7 Aug 2003 16:57:28 -0000
Message-Id: <200308071657.h77GvKEp004718@fearless-vampire-killer.waterside.net>
Date: Thu, 7 Aug 2003 12:57:20 -0400 (EDT)
From: rafal@netbsd.org
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: rafal@netbsd.org
To: gnats-bugs@gnats.netbsd.org
Subject: [rkb] usscanner(4) config line in i386 GENERIC not detailed enough
X-Send-Pr-Version: 3.95

>Number:         22393
>Category:       port-i386
>Synopsis:       usscanner(4) config line in i386 GENERIC not detailed enough
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-i386-maintainer
>State:          closed
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 07 16:58:00 +0000 2003
>Closed-Date:    Sun Nov 26 20:20:17 +0000 2006
>Last-Modified:  Sun Nov 26 20:20:17 +0000 2006
>Originator:     Rafal Boni
>Release:        NetBSD 1.6W
>Organization:
Lacking
>Environment:
System: NetBSD fearless-vampire-killer.waterside.net 1.6W NetBSD 1.6W (FEARLESS_VAMPIRE_KILLER) #6: Thu Aug 7 12:24:53 EDT 2003 rafal@fearless-vampire-killer.waterside.net:/extra/sparc64/obj/sys/arch/sparc64/compile/FEARLESS_VAMPIRE_KILLER sparc64
Architecture: sparc64
Machine: sparc64
>Description:
	Add just 'usscanner* at uhub?' to your kernel config without the
	'scsibus* at usscanner?' and 'ss* at scsibus?' because you did
	not read usscanner(4) and copied the USB config stuff wholesale
	from i386 GENERIC config to your own config file.

	config(8) the kernel, and note that while it builds, the final 
	link dies with the following messages:

scanner.o: In function `usscanner_attach':
usscanner.o(.text+0x368): undefined reference to `scsi_bustype'
usscanner.o(.text+0x374): undefined reference to `scsi_bustype'
usscanner.o(.text+0x3c4): undefined reference to `scsiprint'
usscanner.o(.text+0x3cc): undefined reference to `scsiprint'

	While this is likely user-brain-damage, note that it would have
	been prevented if there had been (commented out or otherwise),
	the config lines mentioned in usscanner(4) in the i386 GENERIC
	config.... That config works because of the catchall 'scsibus*
	at scsi?' and 'ss* at scsibus? ...' elsewhere in the config
	file.

>How-To-Repeat:
	In a kernel config with no 'scsibus' declarations, but some USB
	devices for it to attach to, add just:
		usscanner* at uhub?

	config(8) and build the kernel, watch it not link.
>Fix:
	(1) Add the follwing to i386 GENERIC:

Index: GENERIC
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/conf/GENERIC,v
retrieving revision 1.566
diff -u -r1.566 GENERIC
--- GENERIC	2003/08/06 12:32:07	1.566
+++ GENERIC	2003/08/07 16:53:26
@@ -901,6 +901,8 @@

 # USB scanners that use SCSI emulation, e.g., HP5300
 usscanner* at uhub? port ?
+# scsibus* at usscanner?
+# ss* at scsibus? target ? lun ?

 # Y@P firmware loader
 uyap* at uhub? port ?

	(2) Have config either catch the error, or force inclusion of the
	    SCSI bus code when it catches a `usscanner' entry.  Note sure
	    the second thing is the right thing to do (things still won't
	    work unless you have a `ss* at scsibus?' line), but the first
	    would be nice :-)

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: fair 
State-Changed-When: Tue May 25 01:24:37 UTC 2004 
State-Changed-Why:  

I think this has been fixed by the changes which eliminated the need 
to have: 

scsibus* at <hba>? 

in kernel config files. If you agree, we can close this PR ... 


From: Rafal Boni <rafal@pobox.com>
To: gnats-bugs@gnats.netbsd.org
Cc: fair@NetBSD.org, port-i386-maintainer@NetBSD.org
Subject: Re: port-i386/22393 
Date: Mon, 24 May 2004 21:35:19 -0400

 In message <20040525012537.24839.qmail@mail.netbsd.org>, you write: 

 -> I think this has been fixed by the changes which eliminated the need
 -> to have:
 -> 
 -> scsibus* at <hba>?
 -> 
 -> in kernel config files. If you agree, we can close this PR ...

 No, actually I think that created the problem, because now when you 
 move usscanner to a non-SCSI config, you have to spend time figuring
 out that it needs a SCSI bus (whereas before it was obvious, since
 it needed a separate declaration of the scsibus* at ussscanner? in
 *any* config file.

 --rafal

 ----
 Rafal Boni                                                     rafal@pobox.com
   We are all worms.  But I do believe I am a glowworm.  -- Winston Churchill
State-Changed-From-To: feedback->open 
State-Changed-By: fair 
State-Changed-When: Tue May 25 02:13:28 UTC 2004 
State-Changed-Why:  

Feedback provided. 

From: Martin Husemann <martin@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/22393 CVS commit: src/sys/dev/usb
Date: Sun, 26 Nov 2006 20:14:41 +0000 (UTC)

 Module Name:	src
 Committed By:	martin
 Date:		Sun Nov 26 20:14:41 UTC 2006

 Modified Files:
 	src/sys/dev/usb: usscanner.c

 Log Message:
 If no scsibus is configured, do not silently fail the attach but print
 a message pointing at the usscanner(4) manual page.
 Addresses PR port-i386/22393.


 To generate a diff of this commit:
 cvs rdiff -r1.20 -r1.21 src/sys/dev/usb/usscanner.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: martin@netbsd.org
State-Changed-When: Sun, 26 Nov 2006 20:20:17 +0000
State-Changed-Why:
The link error has been fixed long ago, and the device now prints a 
helpfull message at attach time if no scsibus is configured. This is
close to what the real solution would do in this case (print a "not configured"
message) - I don't see a point in adding unneeded commented entries
to random kernel configs.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.