Improving uscanner

From: David D. Smith <davidsmith_at_acm.org>
Date: Sun, 17 Jul 2005 19:04:34 +0900
Hello! I'm new to FreeBSD but eager to work and read!

I want to get my Epson PX-A550 (CX-4600 outside of Japan) device
working as both a printer and a scanner at the same time, so I started
working on uscanner.c taking the advice from a few threads on -current
talking about the existing problem. Those threads are:

http://thread.gmane.org/gmane.os.freebsd.current/69777
http://thread.gmane.org/gmane.os.freebsd.current/52610
http://thread.gmane.org/gmane.os.freebsd.current/33890

I modified uscanner's USB_ATTACH and USB_MATCH to be more like
ulpt's. My patch for these is the first attachment to this mail. This
seems to work well as I can now plug-in the device and see both
devices created successfully, but if I attempt to write to the ulpt
device, I inevitably get a panic.

I've been trying to debug the panic; backtrace along with log of my
kgdb session is the second attachment. AFAICS the crash is because of
the sc_iface being incomplete, particularly sc_iface->device being set
to NULL, but I can't tell how this situation is coming about and I
don't have a second machine to step through the running kernel and
retrieve better information. I also have quite a bit of debugging
output from the USB layer captured but nothing seems anymore helpful
than the backtrace, yet I will happily provide that info if anyone is
interested.

M. Warner Losh claimed to be working on this problem on
2005/05/31. Could you tell me how you were going about this problem? I
have been trying to dig through the heart of the USB code to find the
reason the simple patch to uscanner does not suffice but without a
debugger it is taking me a very long time to do alone.

Thanks,
-- 
  David D. Smith
A man without doubt is a monster.

cd /tmp/
diff -Naur /tmp/uscanner.c.orig /tmp/uscanner.c
--- /tmp/uscanner.c.orig	Sun Jul 17 18:27:28 2005
+++ /tmp/uscanner.c	Sun Jul 17 18:31:11 2005
_at__at_ -78,6 +78,8 _at__at_
 
 #include "usbdevs.h"
 
+#define USCANNER_CLASS_SCANJET 0x10
+
 #ifdef USB_DEBUG
 #define DPRINTF(x)	if (uscannerdebug) logprintf x
 #define DPRINTFN(n,x)	if (uscannerdebug>(n)) logprintf x
_at__at_ -205,6 +207,7 _at__at_
  {{ USB_VENDOR_EPSON, USB_PRODUCT_EPSON_3200 }, USC_KEEP_OPEN },
  {{ USB_VENDOR_EPSON, USB_PRODUCT_EPSON_GT9700F }, USC_KEEP_OPEN },
  {{ USB_VENDOR_EPSON, USB_PRODUCT_EPSON_GT9300UF }, 0 },
+ {{ USB_VENDOR_EPSON, USB_PRODUCT_EPSON_CX4600 }, 0 },
 
   /* UMAX */
  {{ USB_VENDOR_UMAX, USB_PRODUCT_UMAX_ASTRA1220U }, 0 },
_at__at_ -298,12 +301,20 _at__at_
 USB_MATCH(uscanner)
 {
 	USB_MATCH_START(uscanner, uaa);
-
-	if (uaa->iface != NULL)
+	usb_interface_descripor_t *id;
+	
+	if (uaa->iface == NULL)
 		return UMATCH_NONE;
 
-	return (uscanner_lookup(uaa->vendor, uaa->product) != NULL ?
-		UMATCH_VENDOR_PRODUCT : UMATCH_NONE);
+	id = usbd_get_interface_descriptor(uaa->iface);
+	if (id != NULL &&
+	    (id->bInterfaceClass == UICLASS_VENDOR ||
+	     id->bInterfaceClass == UICLASS_UNSPEC ||
+	     id->bInterfaceClass == UICLASS_CDC_DATA ||
+	     id->bInterfaceClass == USCANNER_CLASS_SCANJET))
+	  return (uscanner_lookup(uaa->vendor, uaa->product) != NULL ?
+		  UMATCH_VENDOR_PRODUCT : UMATCH_NONE);
+	return UMATCH_NONE;
 }
 
 USB_ATTACH(uscanner)

Diff finished at Sun Jul 17 18:31:14

Current directory is /usr/src/sys/i386/compile/EXPONENT/
[GDB will not be able to debug user-mode threads: /usr/lib/libthread_db.so: Undefined symbol "ps_pglobal_lookup"]
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd".
#0  doadump () at pcpu.h:159
(kgdb) bt
#0  doadump () at pcpu.h:159
#1  0xc067b7ee in boot (howto=260) at ../../../kern/kern_shutdown.c:410
#2  0xc067baf5 in panic (fmt=0xc08e84c0 "%s") at ../../../kern/kern_shutdown.c:566
#3  0xc089929d in trap_fatal (frame=0xd068f940, eva=0)
    at ../../../i386/i386/trap.c:817
#4  0xc0898fc0 in trap_pfault (frame=0xd068f940, usermode=0, eva=4)
    at ../../../i386/i386/trap.c:735
#5  0xc0898b8c in trap (frame=
      {tf_fs = 24, tf_es = 16, tf_ds = 16, tf_edi = 4, tf_esi = -1048176128, tf_ebp = -798426708, tf_isp = -798426772, tf_ebx = 0, tf_edx = -1046252836, tf_ecx = 0, tf_eax = 0, tf_trapno = 12, tf_err = 0, tf_eip = -1067432071, tf_cs = 8, tf_eflags = 66178, tf_esp = 0, tf_ss = 5000}) at ../../../i386/i386/trap.c:425
#6  0xc088a17a in calltrap () at ../../../i386/i386/exception.s:140
#7  0x00000018 in ?? ()
#8  0x00000010 in ?? ()
#9  0x00000010 in ?? ()
#10 0x00000004 in ?? ()
#11 0xc1861a00 in ?? ()
#12 0xd068f9ac in ?? ()
#13 0xd068f96c in ?? ()
#14 0x00000000 in ?? ()
#15 0xc1a372dc in ?? ()
#16 0x00000000 in ?? ()
#17 0x00000000 in ?? ()
#18 0x0000000c in ?? ()
#19 0x00000000 in ?? ()
#20 0xc0604779 in usbd_open_pipe_ival (iface=0xc1a372dc, address=4 '\004', 
    flags=0 '\0', pipe=0x0, ival=0) at ../../../dev/usb/usbdi.c:199
#21 0xc0604758 in usbd_open_pipe (iface=0x0, address=4 '\004', flags=0 '\0', 
    pipe=0x0) at ../../../dev/usb/usbdi.c:183
#22 0xc05fbbca in ulptopen (dev=0x0, flag=2051, mode=8192, p=0xc181d600)
    at ../../../dev/usb/ulpt.c:568
#23 0xc0634db2 in spec_open (ap=0xd068fa6c) at ../../../fs/specfs/spec_vnops.c:207
#24 0xc0634a8c in spec_vnoperate (ap=0x0) at ../../../fs/specfs/spec_vnops.c:118
#25 0xc06ea1a9 in vn_open_cred (ndp=0xd068fbd8, flagp=0xd068fcd8, cmode=0, 
    cred=0xc1861400, fdidx=0) at vnode_if.h:228
#26 0xc06e9d5b in vn_open (ndp=0x0, flagp=0x0, cmode=0, fdidx=0)
    at ../../../kern/vfs_vnops.c:91
#27 0xc06e2c4b in kern_open (td=0xc181d600, path=0x0, pathseg=UIO_USERSPACE, 
    flags=2051, mode=0) at ../../../kern/vfs_syscalls.c:957
#28 0xc06e2b3a in open (td=0x0, uap=0x0) at ../../../kern/vfs_syscalls.c:926
#29 0xc0899649 in syscall (frame=
      {tf_fs = 47, tf_es = 47, tf_ds = 47, tf_edi = 134518742, tf_esi = -1077940767, tf_ebp = -1077952088, tf_isp = -798425740, tf_ebx = 134523168, tf_edx = -1077943808, tf_ecx = 0, tf_eax = 5, tf_trapno = 12, tf_err = 2, tf_eip = 672102075, tf_cs = 31, tf_eflags = 642, tf_esp = -1077952132, tf_ss = 47})
    at ../../../i386/i386/trap.c:1009
#30 0xc088a1cf in Xint0x80_syscall () at ../../../i386/i386/exception.s:201
#31 0x0000002f in ?? ()
#32 0x0000002f in ?? ()
#33 0x0000002f in ?? ()
#34 0x080497d6 in ?? ()
#35 0xbfbfede1 in ?? ()
#36 0xbfbfc1a8 in ?? ()
#37 0xd068fd74 in ?? ()
#38 0x0804a920 in ?? ()
#39 0xbfbfe200 in ?? ()
#40 0x00000000 in ?? ()
#41 0x00000005 in ?? ()
#42 0x0000000c in ?? ()
#43 0x00000002 in ?? ()
#44 0x280f76bb in ?? ()
#45 0x0000001f in ?? ()
#46 0x00000282 in ?? ()
#47 0xbfbfc17c in ?? ()
#48 0x0000002f in ?? ()
#49 0x00000000 in ?? ()
#50 0x00000000 in ?? ()
#51 0x00000000 in ?? ()
#52 0x00000000 in ?? ()
#53 0x04d72000 in ?? ()
#54 0xc181c388 in ?? ()
#55 0xc181d600 in ?? ()
#56 0xd068f53c in ?? ()
#57 0xd068f524 in ?? ()
#58 0xc12c2d80 in ?? ()
#59 0xc068e326 in sched_switch (td=0xbfbfede1, newtd=0x804a920, flags=Cannot access memory at address 0xbfbfc1b8
)
    at ../../../kern/sched_4bsd.c:881
Previous frame inner to this frame (corrupt stack?)
#1  0xc067b7ee in boot (howto=260) at ../../../kern/kern_shutdown.c:410
#2  0xc067baf5 in panic (fmt=0xc08e84c0 "%s") at ../../../kern/kern_shutdown.c:566
#3  0xc089929d in trap_fatal (frame=0xd068f940, eva=0)
    at ../../../i386/i386/trap.c:817
#2  0xc067baf5 in panic (fmt=0xc08e84c0 "%s") at ../../../kern/kern_shutdown.c:566
#3  0xc089929d in trap_fatal (frame=0xd068f940, eva=0)
    at ../../../i386/i386/trap.c:817
#4  0xc0898fc0 in trap_pfault (frame=0xd068f940, usermode=0, eva=4)
    at ../../../i386/i386/trap.c:735
#5  0xc0898b8c in trap (frame=
      {tf_fs = 24, tf_es = 16, tf_ds = 16, tf_edi = 4, tf_esi = -1048176128, tf_ebp = -798426708, tf_isp = -798426772, tf_ebx = 0, tf_edx = -1046252836, tf_ecx = 0, tf_eax = 0, tf_trapno = 12, tf_err = 0, tf_eip = -1067432071, tf_cs = 8, tf_eflags = 66178, tf_esp = 0, tf_ss = 5000}) at ../../../i386/i386/trap.c:425
#6  0xc088a17a in calltrap () at ../../../i386/i386/exception.s:140
Current language:  auto; currently asm
#7  0x00000018 in ?? ()
#8  0x00000010 in ?? ()
(kgdb) bt
#0  doadump () at pcpu.h:159
#1  0xc067b7ee in boot (howto=260) at ../../../kern/kern_shutdown.c:410
#2  0xc067baf5 in panic (fmt=0xc08e84c0 "%s") at ../../../kern/kern_shutdown.c:566
#3  0xc089929d in trap_fatal (frame=0xd068f940, eva=0)
    at ../../../i386/i386/trap.c:817
#4  0xc0898fc0 in trap_pfault (frame=0xd068f940, usermode=0, eva=4)
    at ../../../i386/i386/trap.c:735
#5  0xc0898b8c in trap (frame=
      {tf_fs = 24, tf_es = 16, tf_ds = 16, tf_edi = 4, tf_esi = -1048176128, tf_ebp = -798426708, tf_isp = -798426772, tf_ebx = 0, tf_edx = -1046252836, tf_ecx = 0, tf_eax = 0, tf_trapno = 12, tf_err = 0, tf_eip = -1067432071, tf_cs = 8, tf_eflags = 66178, tf_esp = 0, tf_ss = 5000}) at ../../../i386/i386/trap.c:425
#6  0xc088a17a in calltrap () at ../../../i386/i386/exception.s:140
#7  0x00000018 in ?? ()
#8  0x00000010 in ?? ()
#9  0x00000010 in ?? ()
#10 0x00000004 in ?? ()
#11 0xc1861a00 in ?? ()
#12 0xd068f9ac in ?? ()
#13 0xd068f96c in ?? ()
#14 0x00000000 in ?? ()
#15 0xc1a372dc in ?? ()
#16 0x00000000 in ?? ()
#17 0x00000000 in ?? ()
#18 0x0000000c in ?? ()
#19 0x00000000 in ?? ()
#20 0xc0604779 in usbd_open_pipe_ival (iface=0xc1a372dc, address=4 '\004', 
    flags=0 '\0', pipe=0x0, ival=0) at ../../../dev/usb/usbdi.c:199
#21 0xc0604758 in usbd_open_pipe (iface=0x0, address=4 '\004', flags=0 '\0', 
    pipe=0x0) at ../../../dev/usb/usbdi.c:183
#22 0xc05fbbca in ulptopen (dev=0x0, flag=2051, mode=8192, p=0xc181d600)
    at ../../../dev/usb/ulpt.c:568
#23 0xc0634db2 in spec_open (ap=0xd068fa6c) at ../../../fs/specfs/spec_vnops.c:207
#24 0xc0634a8c in spec_vnoperate (ap=0x0) at ../../../fs/specfs/spec_vnops.c:118
#25 0xc06ea1a9 in vn_open_cred (ndp=0xd068fbd8, flagp=0xd068fcd8, cmode=0, 
    cred=0xc1861400, fdidx=0) at vnode_if.h:228
#26 0xc06e9d5b in vn_open (ndp=0x0, flagp=0x0, cmode=0, fdidx=0)
    at ../../../kern/vfs_vnops.c:91
#27 0xc06e2c4b in kern_open (td=0xc181d600, path=0x0, pathseg=UIO_USERSPACE, 
    flags=2051, mode=0) at ../../../kern/vfs_syscalls.c:957
#28 0xc06e2b3a in open (td=0x0, uap=0x0) at ../../../kern/vfs_syscalls.c:926
#29 0xc0899649 in syscall (frame=
      {tf_fs = 47, tf_es = 47, tf_ds = 47, tf_edi = 134518742, tf_esi = -1077940767, tf_ebp = -1077952088, tf_isp = -798425740, tf_ebx = 134523168, tf_edx = -1077943808, tf_ecx = 0, tf_eax = 5, tf_trapno = 12, tf_err = 2, tf_eip = 672102075, tf_cs = 31, tf_eflags = 642, tf_esp = -1077952132, tf_ss = 47})
    at ../../../i386/i386/trap.c:1009
#30 0xc088a1cf in Xint0x80_syscall () at ../../../i386/i386/exception.s:201
#31 0x0000002f in ?? ()
#32 0x0000002f in ?? ()
#33 0x0000002f in ?? ()
#34 0x080497d6 in ?? ()
#35 0xbfbfede1 in ?? ()
#36 0xbfbfc1a8 in ?? ()
#37 0xd068fd74 in ?? ()
#38 0x0804a920 in ?? ()
#39 0xbfbfe200 in ?? ()
#40 0x00000000 in ?? ()
#41 0x00000005 in ?? ()
#42 0x0000000c in ?? ()
#43 0x00000002 in ?? ()
#44 0x280f76bb in ?? ()
#45 0x0000001f in ?? ()
#46 0x00000282 in ?? ()
#47 0xbfbfc17c in ?? ()
#48 0x0000002f in ?? ()
#49 0x00000000 in ?? ()
#50 0x00000000 in ?? ()
#51 0x00000000 in ?? ()
#52 0x00000000 in ?? ()
#53 0x04d72000 in ?? ()
#54 0xc181c388 in ?? ()
#55 0xc181d600 in ?? ()
#56 0xd068f53c in ?? ()
#57 0xd068f524 in ?? ()
#58 0xc12c2d80 in ?? ()
#59 0xc068e326 in sched_switch (td=0xbfbfede1, newtd=0x804a920, flags=Cannot access memory at address 0xbfbfc1b8
)
    at ../../../kern/sched_4bsd.c:881
(kgdb) up
#9  0x00000010 in ?? ()
(kgdb) up
#10 0x00000004 in ?? ()
(kgdb) up
#11 0xc1861a00 in ?? ()
(kgdb) up
#12 0xd068f9ac in ?? ()
(kgdb) up
#13 0xd068f96c in ?? ()
(kgdb) up
#14 0x00000000 in ?? ()
(kgdb) up
#15 0xc1a372dc in ?? ()
(kgdb) up
#16 0x00000000 in ?? ()
(kgdb) up
#17 0x00000000 in ?? ()
(kgdb) up
#18 0x0000000c in ?? ()
(kgdb) up
#19 0x00000000 in ?? ()
(kgdb) up
#20 0xc0604779 in usbd_open_pipe_ival (iface=0xc1a372dc, address=4 '\004', 
    flags=0 '\0', pipe=0x0, ival=0) at ../../../dev/usb/usbdi.c:199
Current language:  auto; currently c
(kgdb) up
#21 0xc0604758 in usbd_open_pipe (iface=0x0, address=4 '\004', flags=0 '\0', 
    pipe=0x0) at ../../../dev/usb/usbdi.c:183
(kgdb) up
#22 0xc05fbbca in ulptopen (dev=0x0, flag=2051, mode=8192, p=0xc181d600)
    at ../../../dev/usb/ulpt.c:568
(kgdb) up
#23 0xc0634db2 in spec_open (ap=0xd068fa6c) at ../../../fs/specfs/spec_vnops.c:207
(kgdb) up
#24 0xc0634a8c in spec_vnoperate (ap=0x0) at ../../../fs/specfs/spec_vnops.c:118
(kgdb) up
#25 0xc06ea1a9 in vn_open_cred (ndp=0xd068fbd8, flagp=0xd068fcd8, cmode=0, 
    cred=0xc1861400, fdidx=0) at vnode_if.h:228
(kgdb) up
#26 0xc06e9d5b in vn_open (ndp=0x0, flagp=0x0, cmode=0, fdidx=0)
    at ../../../kern/vfs_vnops.c:91
(kgdb) up
#27 0xc06e2c4b in kern_open (td=0xc181d600, path=0x0, pathseg=UIO_USERSPACE, 
    flags=2051, mode=0) at ../../../kern/vfs_syscalls.c:957
#26 0xc06e9d5b in vn_open (ndp=0x0, flagp=0x0, cmode=0, fdidx=0)
    at ../../../kern/vfs_vnops.c:91
#25 0xc06ea1a9 in vn_open_cred (ndp=0xd068fbd8, flagp=0xd068fcd8, cmode=0, 
    cred=0xc1861400, fdidx=0) at vnode_if.h:228
#24 0xc0634a8c in spec_vnoperate (ap=0x0) at ../../../fs/specfs/spec_vnops.c:118
#23 0xc0634db2 in spec_open (ap=0xd068fa6c) at ../../../fs/specfs/spec_vnops.c:207
#22 0xc05fbbca in ulptopen (dev=0x0, flag=2051, mode=8192, p=0xc181d600)
    at ../../../dev/usb/ulpt.c:568
#21 0xc0604758 in usbd_open_pipe (iface=0x0, address=4 '\004', flags=0 '\0', 
    pipe=0x0) at ../../../dev/usb/usbdi.c:183
#20 0xc0604779 in usbd_open_pipe_ival (iface=0xc1a372dc, address=4 '\004', 
    flags=0 '\0', pipe=0x0, ival=0) at ../../../dev/usb/usbdi.c:199
#21 0xc0604758 in usbd_open_pipe (iface=0x0, address=4 '\004', flags=0 '\0', 
    pipe=0x0) at ../../../dev/usb/usbdi.c:183
#22 0xc05fbbca in ulptopen (dev=0x0, flag=2051, mode=8192, p=0xc181d600)
    at ../../../dev/usb/ulpt.c:568
#23 0xc0634db2 in spec_open (ap=0xd068fa6c) at ../../../fs/specfs/spec_vnops.c:207
#24 0xc0634a8c in spec_vnoperate (ap=0x0) at ../../../fs/specfs/spec_vnops.c:118
#25 0xc06ea1a9 in vn_open_cred (ndp=0xd068fbd8, flagp=0xd068fcd8, cmode=0, 
    cred=0xc1861400, fdidx=0) at vnode_if.h:228
#24 0xc0634a8c in spec_vnoperate (ap=0x0) at ../../../fs/specfs/spec_vnops.c:118
#23 0xc0634db2 in spec_open (ap=0xd068fa6c) at ../../../fs/specfs/spec_vnops.c:207
#22 0xc05fbbca in ulptopen (dev=0x0, flag=2051, mode=8192, p=0xc181d600)
    at ../../../dev/usb/ulpt.c:568
A syntax error in expression, near `'.
Attempt to use a type name as an expression
No symbol "ulpt_softc" in current context.
$1 = 0xc1a372dc
$2 = 0xc1a372dc
(kgdb) print sc_iface
No symbol "sc_iface" in current context.
(kgdb) print sc->sc_out
$3 = 4
(kgdb) p sc->sc_dying
$4 = 0 '\0'
(kgdb) p sc->sc_state
$5 = 4 '\004'
(kgdb) p ulpt_status(sc)
You can't do that without a process to debug.
(kgdb) p flags 
$6 = 0 '\0'
(kgdb) p sc->sc_refcnt
$7 = 1
(kgdb) p sc->sc_flags
$8 = 0 '\0'
(kgdb) p sc->sc_state
$9 = 4 '\004'
(kgdb) p sc->sc_iface
$10 = 0xc1a372dc
(kgdb) p sc->sc_out
$11 = 4
(kgdb) p sc->sc_out_pipe
$12 = 0x0
(kgdb) p sc->sc_iface->index
$13 = 0
(kgdb) p sc->sc_iface->altindex
$14 = 0
(kgdb) p sc->sc_iface->pipes
$15 = {lh_first = 0x0}
(kgdb) p sc->sc_iface->device
$16 = (struct usbd_device *) 0x0
(kgdb) p dev
$17 = (struct cdev *) 0x0
(kgdb) p flag
$18 = 2051
(kgdb) p dev
$19 = (struct cdev *) 0x0
(kgdb) p (dev == NULL)
No symbol "NULL" in current context.
(kgdb) p (dev == 0)
$20 = 1
(kgdb) p sc
$21 = (struct ulpt_softc *) 0xc1861a00
(kgdb) p minor(dv)
No symbol "dv" in current context.
(kgdb) p minor(dev)
You can't do that without a process to debug.
(kgdb) p unit
No symbol "unit" in current context.
(kgdb) p cd_ndevs
No symbol "cd_ndevs" in current context.
(kgdb) p ulpt_cd.cd_ndevs
No symbol "ulpt_cd" in current context.
(kgdb) p ulpt_cd
No symbol "ulpt_cd" in current context.
(kgdb) p sc
$22 = (struct ulpt_softc *) 0xc1861a00
(kgdb) p sc->sc_iface
$23 = 0xc1a372dc
(kgdb) p sc->sc_iface->device
$24 = (struct usbd_device *) 0x0
(kgdb) p sc->sc_iface->endpoints
$25 = (struct usbd_endpoint *) 0xc145bb70
(kgdb) p sc->sc_iface->device->cdesc
Cannot access memory at address 0x4c
(kgdb) p &sc->sc_iface->device
$26 = (struct usbd_device **) 0xc1a372dc
(kgdb) p *sc->sc_iface->device
Cannot access memory at address 0x0
(kgdb) p sc->sc_iface->device->ifaces
Cannot access memory at address 0x34
(kgdb) p sc->sc_iface->device->cdesc
Cannot access memory at address 0x4c
(kgdb) p sc->sc_iface->idesc
$27 = (usb_interface_descriptor_t *) 0x0
(kgdb) p sc->sc_iface->ifaceidx
There is no member named ifaceidx.
(kgdb) p sc->sc_iface->index
$28 = 0
(kgdb) p sc->sc_iface->endpoints
$29 = (struct usbd_endpoint *) 0xc145bb70
(kgdb) p *sc->sc_iface->endpoints
$30 = {edesc = 0x61007768, refcnt = 6910051}
(kgdb) p sc->sc_iface->endpoints->edesc
$31 = (usb_endpoint_descriptor_t *) 0x61007768
(kgdb) p *sc->sc_iface->endpoints->edesc
Cannot access memory at address 0x61007768
(kgdb) p sc->sc_iface->device->speed
Cannot access memory at address 0xb
(kgdb) p sc->sc_iface->idesc
$32 = (usb_interface_descriptor_t *) 0x0
(kgdb) p *sc->sc_iface->idesc
Cannot access memory at address 0x0
(kgdb) p *sc->sc_in
Cannot access memory at address 0x83
(kgdb) p sc->sc_in
$33 = 131
(kgdb) p sc->sc_out
$34 = 4
(kgdb) p sc->sc_ifaceno
$35 = 1
(kgdb) p sc->sc_udev
$36 = 0xc185ed00
(kgdb) p *sc->sc_udev
$37 = {bus = 0xc13ea000, default_pipe = 0xc1860380, address = 2 '\002', 
  config = 1 '\001', depth = 1 '\001', speed = 2 '\002', self_powered = 1 '\001', 
  power = 2, langid = 1033, cookie = {cookie = 6}, powersrc = 0xc1403044, 
  myhub = 0xc13d9a80, myhsport = 0x0, def_ep = {edesc = 0xc185ed2c, refcnt = 1}, 
  def_ep_desc = {bLength = 7 '\a', bDescriptorType = 5 '\005', 
    bEndpointAddress = 0 '\0', bmAttributes = 0 '\0', wMaxPacketSize = "\b", 
    bInterval = 0 '\0'}, ifaces = 0xc1a36b00, ddesc = {bLength = 18 '\022', 
    bDescriptorType = 1 '\001', bcdUSB = "\020\001", bDeviceClass = 0 '\0', 
    bDeviceSubClass = 0 '\0', bDeviceProtocol = 0 '\0', bMaxPacketSize = 8 '\b', 
    idVendor = "ΒΈ\004", idProduct = "\016\b", bcdDevice = "\000\001", 
    iManufacturer = 1 '\001', iProduct = 2 '\002', iSerialNumber = 3 '\003', 
    bNumConfigurations = 1 '\001'}, cdesc = 0xc1a36b80, quirks = 0xc08be8f8, 
  hub = 0x0, subdevs = 0xc145b0d0, ifacenums = 0xc14d7270 ""}
(kgdb) p *sc->sc_udev->subdevs
$38 = 0xc1860400
(kgdb) p sc->sc_udev->subdevs
$39 = (device_t *) 0xc145b0d0
(kgdb) p *sc->sc_udev->subdevs
$40 = 0xc1860400
#21 0xc0604758 in usbd_open_pipe (iface=0x0, address=4 '\004', flags=0 '\0', 
    pipe=0x0) at ../../../dev/usb/usbdi.c:183
#20 0xc0604779 in usbd_open_pipe_ival (iface=0xc1a372dc, address=4 '\004', 
    flags=0 '\0', pipe=0x0, ival=0) at ../../../dev/usb/usbdi.c:199
(kgdb) p iface
$41 = 0xc1a372dc
(kgdb) p iface->idesc
$42 = (usb_interface_descriptor_t *) 0x0
#19 0x00000000 in ?? ()
#20 0xc0604779 in usbd_open_pipe_ival (iface=0xc1a372dc, address=4 '\004', 
    flags=0 '\0', pipe=0x0, ival=0) at ../../../dev/usb/usbdi.c:199
#21 0xc0604758 in usbd_open_pipe (iface=0x0, address=4 '\004', flags=0 '\0', 
    pipe=0x0) at ../../../dev/usb/usbdi.c:183
(kgdb) p iface
$43 = 0x0
#22 0xc05fbbca in ulptopen (dev=0x0, flag=2051, mode=8192, p=0xc181d600)
    at ../../../dev/usb/ulpt.c:568
(kgdb) p sc->sc_iface
$44 = 0xc1a372dc
(kgdb) p *sc->sc_iface
$45 = {device = 0x0, idesc = 0x0, index = 0, altindex = 0, endpoints = 0xc145bb70, 
  priv = 0x0, pipes = {lh_first = 0x0}}
#21 0xc0604758 in usbd_open_pipe (iface=0x0, address=4 '\004', flags=0 '\0', 
    pipe=0x0) at ../../../dev/usb/usbdi.c:183
#20 0xc0604779 in usbd_open_pipe_ival (iface=0xc1a372dc, address=4 '\004', 
    flags=0 '\0', pipe=0x0, ival=0) at ../../../dev/usb/usbdi.c:199
#21 0xc0604758 in usbd_open_pipe (iface=0x0, address=4 '\004', flags=0 '\0', 
    pipe=0x0) at ../../../dev/usb/usbdi.c:183
#22 0xc05fbbca in ulptopen (dev=0x0, flag=2051, mode=8192, p=0xc181d600)
    at ../../../dev/usb/ulpt.c:568
(kgdb) p up
No symbol "up" in current context.
(kgdb) up
#23 0xc0634db2 in spec_open (ap=0xd068fa6c) at ../../../fs/specfs/spec_vnops.c:207
(kgdb) down
#22 0xc05fbbca in ulptopen (dev=0x0, flag=2051, mode=8192, p=0xc181d600)
    at ../../../dev/usb/ulpt.c:568
(kgdb) down
#21 0xc0604758 in usbd_open_pipe (iface=0x0, address=4 '\004', flags=0 '\0', 
    pipe=0x0) at ../../../dev/usb/usbdi.c:183
(kgdb) up
#22 0xc05fbbca in ulptopen (dev=0x0, flag=2051, mode=8192, p=0xc181d600)
    at ../../../dev/usb/ulpt.c:568
(kgdb) up
#23 0xc0634db2 in spec_open (ap=0xd068fa6c) at ../../../fs/specfs/spec_vnops.c:207
(kgdb) down
#22 0xc05fbbca in ulptopen (dev=0x0, flag=2051, mode=8192, p=0xc181d600)
    at ../../../dev/usb/ulpt.c:568
(kgdb) up
#23 0xc0634db2 in spec_open (ap=0xd068fa6c) at ../../../fs/specfs/spec_vnops.c:207
(kgdb) down
#22 0xc05fbbca in ulptopen (dev=0x0, flag=2051, mode=8192, p=0xc181d600)
    at ../../../dev/usb/ulpt.c:568
(kgdb) p sc->sc_iface
$46 = 0xc1a372dc
(kgdb) p sc->sc_iface->device
$47 = (struct usbd_device *) 0x0
(kgdb) p sc->sc_iface->pipes
$48 = {lh_first = 0x0}
(kgdb) quit

Debugger finished

Received on Sun Jul 17 2005 - 08:30:22 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:39 UTC