NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/43683: puc(4) could be more useful



>Number:         43683
>Category:       kern
>Synopsis:       puc(4)-based parallel ports' addresses are not printed
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jul 29 13:00:01 +0000 2010
>Originator:     Pierre Pronchery
>Release:        NetBSD 5.1_RC2
>Organization:
>Environment:
System: NetBSD kwarx.defora.lan 5.1_RC2 NetBSD 5.1_RC2 (GENERIC) #2: Fri Jun 11 
21:15:51 CEST 2010 
khorben%kwarx.defora.lan@localhost:/usr/obj/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
puc(4) is a driver for PCI extension cards, providing extra serial and
parallel ports to the computer. Many existing programs interacting with
the parallel port, do so by means of the ioperm() or iopl() calls, and
then perform inb()/outb() requests.

However, these programs require an address to open the desired hardware
port; unfortunately, there is currently no way of knowing this address:
it is not printed at any time by the kernel.
>How-To-Repeat:
Connect a puc(4)-based PCI card to the computer. Boot and look for a way
to access it through the ioperm/iopl/inb/outb interfaces.
>Fix:
The patch below simply enables a call to printf(), already found in the
code, that does print the proper address (held in paa.a). It could
probably be modified to look more obvious to the user.

Index: sys/dev/pci/puc.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/puc.c,v
retrieving revision 1.31
diff -p -u -r1.31 puc.c
--- sys/dev/pci/puc.c   9 Jul 2008 14:46:15 -0000       1.31
+++ sys/dev/pci/puc.c   29 Jul 2010 12:50:22 -0000
@@ -288,7 +288,7 @@ puc_attach(device_t parent, device_t sel
                }
                paa.h = subregion_handle;
 
-#if 0
+#if 1
                printf("%s: port %d: %s @ (index %d) 0x%x (0x%lx, 0x%lx)\n",
                    device_xname(self), paa.port,
                    puc_port_type_name(paa.type), barindex, (int)paa.a,



Home | Main Index | Thread Index | Old Index