Hello,
I have a problem with opening non-control bulk endpoint of Echelon USB
Network Interface which was detected as ugen0.
There is no problem with opening control endpoint with open(2) like following:
open("/dev/ugen0.00",O_RDWR,0)
After that the control endpoint (endpoint 0) accepts every ioctl(2)
calls listed in ugen(2) manual ( USB_SET_CONFIG, USB_GET_CONFIG_DESC
etc..)
However when I try to open any endpoint from 1 to 15 open(2) fails and
error "Device not configured" is returned.
This device does working well under Windows, and I saw *.inf driver
file - Windows recognize this device as FTDI. OS 4.5 recognize this
device only as ugen0.
Below I also add output from some ioctl(2) calls which I made for
information about the device, maybe it could be helpful.
Thanks in advance,
Milosz Jakubowski
==================
output from some ioctl calls:
==================
ioctl USB_GET_DEVICEINFO:
bus: 0
addr: 2
product: Echelon USB Network Interface
vendor: Echelon
release: 4.00
productNo: 29952
vendorNo: 2336
releaseNo: 1024
class: 0
subclass: 0
protocol: 0
config: 1
lowspeed: 2
power: 50
nports: 0
devnames[0]: ugen0
devnames[1]:
devnames[2]:
devnames[3]:
udi_ports: 0
udi_ports: 0
udi_ports: 0
udi_ports: 0
udi_ports: 0
udi_ports: 0
udi_ports: 0
udi_ports: 0
udi_ports: 0
udi_ports: 0
udi_ports: 0
udi_ports: 0
udi_ports: 0
udi_ports: 0
udi_ports: 0
udi_ports: 0
ioctl USB_GET_INTERFACE_DESC:
config_index: -1
interface_index: 0
alt_index: -1
desc.bLength: 9
desc.bDescriptorType: 4
desc.bInterfaceNumber: 0
desc.bAlternateSetting: 0
desc.bNumEndpoints: 2
desc.bInterfaceClass: 255
desc.bInterfaceSubClass: 255
desc.bInterfaceProtocol: 255
desc.iInterface: 2
ioctl USB_GET_ENDPOINT_DESC:
i=0: usb_endpoint_desc
config_index: -1
interface_index: 0
alt_index: -1
endpoint_index: 0
desc.bLength: 7
desc.bDescriptorType: 5
desc.bEndpointAddress: 129
desc.bmAttributes: 2
desc.wMaxPacketSize: 64
desc.bInterval: 0
i=1: usb_endpoint_desc
config_index: -1
interface_index: 0
alt_index: -1
endpoint_index: 1
desc.bLength: 7
desc.bDescriptorType: 5
desc.bEndpointAddress: 2
desc.bmAttributes: 2
desc.wMaxPacketSize: 64
desc.bInterval: 0
==================
fragment of code
==================
int desc;
char buff[20] = {"/dev/ugen0.\0"};
int config=1;
if ((desc=open("/dev/ugen0.00",O_RDWR,0)) == -1)
{
fprintf(stderr,"open: %s",strerror(errno));
return -1;
}
if( ioctl(desc, USB_SET_CONFIG, &config) ==-1){
fprintf(stderr,"USB_SET_CONFIG: %s",strerror(errno));
}
for(int i=1;i<16;i++){
sprintf(buff+11,"%02d",i);
printf("opening %s\n",buff);
if((bulk_desc = open(buff,O_RDWR,0)) == -1 ){
fprintf(stderr,"open endpoint %s: %s\n",buff,strerror(errno));
}
==================
usbdevs:
==================
Controller /dev/usb0:
addr 1: high speed, self powered, config 1, EHCI root hub(0x0000),
Intel(0x8086), rev 1.00
uhub0
port 1 powered
port 2 powered
port 3 powered
port 4 powered
port 5 powered
port 6 powered
Controller /dev/usb1:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000),
Intel(0x8086), rev 1.00
uhub1
port 1 powered
port 2 addr 2: full speed, power 50 mA, config 1, Echelon USB Network
Interface(0x7500), Echelon(0x0920), rev 4.00, iSerialNumber D03B5F02
ugen0
Controller /dev/usb2:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000),
Intel(0x8086), rev 1.00
uhub2
port 1 powered
port 2 powered
Controller /dev/usb3:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000),
Intel(0x8086), rev 1.00
uhub3
port 1 powered
port 2 powered
==============================
dmesg:
==============================
OpenBSD 4.5 (GENERIC) #1749: Sat Feb 28 14:51:18 MST 2009
[email protected]:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: Intel(R) Celeron(R) M processor 1.00GHz ("GenuineIntel"
686-class, 0KB L2 cache) 1 GHz
cpu0:
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,TM,SBF
real mem = 502820864 (479MB)
avail mem = 477847552 (455MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 12/07/05, BIOS32 rev. 0 @
0xfada0, SMBIOS rev. 2.2 @ 0xf0800 (34 entries)
bios0: vendor Phoenix Technologies, LTD version "6.00 PG" date 12/07/2005
apm0 at bios0: Power Management spec V1.2 (slowidle)
apm0: AC on, battery charge unknown
acpi at bios0 function 0x0 not configured
pcibios0 at bios0: rev 2.1 @ 0xf0000/0xdf84
pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xfde70/256 (14 entries)
pcibios0: PCI Exclusive IRQs: 5 9 10 11 12
pcibios0: PCI Interrupt Router at 000:31:0 ("Intel 82801DBM LPC" rev 0x00)
pcibios0: PCI bus #1 is the last bus
bios0: ROM list: 0xc0000/0xc800!
cpu0 at mainbus0: (uniprocessor)
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 "Intel 82855GM Host" rev 0x02
"Intel 82855GM Memory" rev 0x02 at pci0 dev 0 function 1 not configured
"Intel 82855GM Config" rev 0x02 at pci0 dev 0 function 3 not configured
vga1 at pci0 dev 2 function 0 "Intel 82855GM Video" rev 0x02
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
intagp0 at vga1
agp0 at intagp0: aperture at 0xd8000000, size 0x8000000
inteldrm0 at vga1: irq 12
drm0 at inteldrm0
"Intel 82855GM Video" rev 0x02 at pci0 dev 2 function 1 not configured
uhci0 at pci0 dev 29 function 0 "Intel 82801DB USB" rev 0x02: irq 12
uhci1 at pci0 dev 29 function 1 "Intel 82801DB USB" rev 0x02: irq 11
uhci2 at pci0 dev 29 function 2 "Intel 82801DB USB" rev 0x02: irq 9
ehci0 at pci0 dev 29 function 7 "Intel 82801DB USB" rev 0x02: irq 5
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb0 at pci0 dev 30 function 0 "Intel 82801BA Hub-to-PCI" rev 0x82
pci1 at ppb0 bus 1
fxp0 at pci1 dev 4 function 0 "Intel 8255x" rev 0x10, i82551: irq 11,
address 00:01:29:13:67:aa
inphy0 at fxp0 phy 1: i82555 10/100 PHY, rev. 4
fxp1 at pci1 dev 8 function 0 "Intel PRO/100 VM" rev 0x82, i82562: irq
10, address 00:01:29:13:67:ab
inphy1 at fxp1 phy 1: i82562ET 10/100 PHY, rev. 0
ichpcib0 at pci0 dev 31 function 0 "Intel 82801DB LPC" rev 0x02:
24-bit timer at 3579545Hz
pciide0 at pci0 dev 31 function 1 "Intel 82801DB IDE" rev 0x02: DMA,
channel 0 configured to compatibility, channel 1 configured to
compatibility
wd0 at pciide0 channel 0 drive 0: <ST380215A>
wd0: 16-sector PIO, LBA48, 76319MB, 156301488 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 5
pciide0: channel 1 disabled (no drives)
ichiic0 at pci0 dev 31 function 3 "Intel 82801DB SMBus" rev 0x02: irq 11
iic0 at ichiic0
spdmem0 at iic0 addr 0x50: 512MB DDR SDRAM non-parity PC3200CL3.0
auich0 at pci0 dev 31 function 5 "Intel 82801DB AC97" rev 0x02: irq
11, ICH4 AC97
ac97: codec id 0x414c4740 (Avance Logic ALC202)
ac97: codec features headphone, 20 bit DAC, 18 bit ADC, Realtek 3D
audio0 at auich0
usb1 at uhci0: USB revision 1.0
uhub1 at usb1 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb2 at uhci1: USB revision 1.0
uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb3 at uhci2: USB revision 1.0
uhub3 at usb3 "Intel UHCI root hub" rev 1.00/1.00 addr 1
isa0 at ichpcib0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
com0: probed fifo depth: 15 bytes
com1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
com1: probed fifo depth: 15 bytes
com2: irq 5 already in use
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <PC speaker>
spkr0 at pcppi0
lpt0 at isa0 port 0x378/4 irq 7
wbsio0 at isa0 port 0x2e/2: W83627HF rev 0x41
lm1 at wbsio0 port 0x290/8: W83627HF
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
biomask fb65 netmask ff65 ttymask ffff
mtrr: Pentium Pro MTRR support
softraid0 at root
root on wd0a swap on wd0b dump on wd0b
ugen0 at uhub1 port 2 "Echelon Echelon USB Network Interface" rev
2.00/4.00 addr 2
ugen0 detached
ugen0 at uhub1 port 2 "Echelon Echelon USB Network Interface" rev
2.00/4.00 addr 2
ugen0 detached
ugen0 at uhub1 port 2 "Echelon Echelon USB Network Interface" rev
2.00/4.00 addr 2