Subject: access to ugen0.00 crashes current kernel
To: None <current-users@NetBSD.org>
From: thilo <jeremias@optushome.com.au>
List: current-users
Date: 03/17/2006 20:26:20
Hello there,

I found that current (yesterday till at least 4 month back) crashes
if I insert an E-gate usb token and try to start the openct-tools.

What happens essentially is, that the device returns no endpoints, but
ugen poll is started and tries  to access edesc->bnAtt..... this results 
in a vm-fault......
  see dev/usb/ugen.c:1362 (switch....)

I'm not sure why the descriptor is not set, but the code in ugen.c:290
will only allocate the edesc if  the number of endpoints is >0.

Is this correct? ( asside that the kernel should not crash)

Isn't enpoint number 0 always available? So shouldn't the structure
be initialized?

Any help is apreciated.
I assume every ugen device with only enpoint 0 should crash the kernel.

below is the usb device descriptor.
thilo


Dumping all descriptors
DEVICE descriptor:
bLength=18 bDescriptorType=1 bcdUSB=1.10 bDeviceClass=255 bDeviceSubClass=0
bDeviceProtocol=0 bMaxPacketSize=8
idVendor=0x0973 idProduct=0x0001 bcdDevice=100
iManufacturer=1 iProduct=2 iSerialNumber=0 bNumConfigurations=1

Current configuration is number 1

CONFIGURATION descriptor index 0:
bLength=9 bDescriptorType=2 wTotalLength=18 bNumInterface=1
bConfigurationValue=1 iConfiguration=0 bmAttributes=80 bMaxPower=30 mA

  INTERFACE descriptor index 0, alt index 0:
  bLength=9 bDescriptorType=4 bInterfaceNumber=0 bAlternateSetting=0
  bNumEndpoints=0 bInterfaceClass=0 bInterfaceSubClass=0
  bInterfaceProtocol=0 iInterface=0

Product: SchlumbergerSema Cyberflex e-gate
Vendor:  SchlumbergerSema
address 2

~