hi all, i'm new here :)
i have a I/O card in the usb port, can read but can't write uhid0
uname -a:
OpenBSD myhost.my.domain 4.6 GENERIC.MP#81 amd64
dmesg:
uhidev0 at uhub5 port 2 configuration 1 interface 0 "Anchor Chips
product 0x7453" rev 2.00/0.00 addr 2
uhidev0: iclass 3/0
uhid0 at uhidev0: input=31, output=21, feature=0
ls -l /dev/uhid0:
crw-rw---- 1 root wheel 62, 0 Feb 12 02:00 /dev/uhid0
user groups:
users wheel
usbhidctl -vv -f uhid0:
report ID=0
usbhidctl: USB_GET_REPORT (probably not supported by device):
Input/output error
usbhidctl -r -f uhid0:
Report descriptor:
Collection page=0xffa0 usage=0x00a5
Input size=8 count=1 page=0xffa0 usage=0x00a6, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Input size=8 count=1 page=0xffa0 usage=0x00a7, logical range -128..127
Output size=8 count=1 page=0xffa0 usage=0x00a9, logical range -128..127
Output size=8 count=1 page=0xffa0 usage=0x00a9, logical range -128..127
Output size=8 count=1 page=0xffa0 usage=0x00a9, logical range -128..127
Output size=8 count=1 page=0xffa0 usage=0x00a9, logical range -128..127
Output size=8 count=1 page=0xffa0 usage=0x00a9, logical range -128..127
Output size=8 count=1 page=0xffa0 usage=0x00a9, logical range -128..127
Output size=8 count=1 page=0xffa0 usage=0x00a9, logical range -128..127
Output size=8 count=1 page=0xffa0 usage=0x00a9, logical range -128..127
Output size=8 count=1 page=0xffa0 usage=0x00a9, logical range -128..127
Output size=8 count=1 page=0xffa0 usage=0x00a9, logical range -128..127
Output size=8 count=1 page=0xffa0 usage=0x00a9, logical range -128..127
Output size=8 count=1 page=0xffa0 usage=0x00a9, logical range -128..127
Output size=8 count=1 page=0xffa0 usage=0x00a9, logical range -128..127
Output size=8 count=1 page=0xffa0 usage=0x00a9, logical range -128..127
Output size=8 count=1 page=0xffa0 usage=0x00a9, logical range -128..127
Output size=8 count=1 page=0xffa0 usage=0x00a9, logical range -128..127
Output size=8 count=1 page=0xffa0 usage=0x00a9, logical range -128..127
Output size=8 count=1 page=0xffa0 usage=0x00a9, logical range -128..127
Output size=8 count=1 page=0xffa0 usage=0x00a9, logical range -128..127
Output size=8 count=1 page=0xffa0 usage=0x00a9, logical range -128..127
Output size=8 count=1 page=0xffa0 usage=0x00a9, logical range -128..127
End collection
Total input size 31 bytes
Total output size 21 bytes
Total feature size 0 bytes
uhid(4):
Use read(2) to get data from the device. Data should be read in chunks
of the size prescribed by the report descriptor.
Use write(2) send data to the device. Data should be written in chunks
of the size prescribed by the report descriptor.
read uhid0 is OK
read.c:
#include <unistd.h>
#include <fcntl.h>
#include <err.h>
#define USB_DEV "/dev/uhid0"
int
main(void)
{
char buff[31];
int fd, ret;
fd = open(USB_DEV, O_RDONLY);
if (fd == -1)
err(1, NULL);
ret = read(fd, buff, sizeof(buff));
if (ret == -1)
err(1, NULL);
return 0;
}
ret == 31 and data from buff is ok
the problem is write uhid0 ...
write.c:
#include <unistd.h>
#include <fcntl.h>
#include <err.h>
#define USB_DEV "/dev/uhid0"
int
main(void)
{
char buff[21];
int fd, ret;
fd = open(USB_DEV, O_WRONLY);
if (fd == -1)
err(1, NULL);
ret = write(fd, buff, sizeof(buff));
if (ret == -1)
err(1, NULL);
return 0;
}
ret == -1
errno = 5 ( EIO )
test: Input/output error
Re install system to SNAPSHOT
uname -a:
OpenBSD myhost.my.domain 4.7 GENERIC.MP#412 i386
but write uhid0 is the same error EIO.
Any doc or suggestion?
write.c is ok?
thanks for its time and sorry my english
usbdevs -v:
Controller /dev/usb0:
addr 1: high speed, self powered, config 1, EHCI root hub(0x0000),
Intel(0x8086), rev 1.00
port 1 powered
port 2 powered
port 3 powered
port 4 powered
port 5 powered
port 6 powered
Controller /dev/usb1:
addr 1: high speed, self powered, config 1, EHCI root hub(0x0000),
Intel(0x8086), rev 1.00
port 1 powered
port 2 powered
port 3 addr 2: high speed, power 500 mA, config 1, Lenovo
EasyCamera(0x0145), Bison Electronics Inc.(0x5986), rev 14.10
port 4 powered
port 5 powered
port 6 powered
Controller /dev/usb2:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000),
Intel(0x8086), rev 1.00
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
port 1 powered
port 2 powered
Controller /dev/usb4:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000),
Intel(0x8086), rev 1.00
port 1 powered
port 2 powered
Controller /dev/usb5:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000),
Intel(0x8086), rev 1.00
port 1 powered
port 2 addr 2: full speed, self powered, config 1, product
0x7453(0x7453), Anchor Chips(0x0547), rev 0.00
full dmesg:
OpenBSD 4.7-beta (GENERIC.MP) #412: Tue Feb 16 00:15:31 MST 2010
[email protected]:/usr/src/sys/arch/i386/compile/GENERIC.MP
cpu0: Pentium(R) Dual-Core CPU T4300 @ 2.10GHz ("GenuineIntel"
686-class) 2.10 GHz
cpu0:
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,EST,TM2,CX16,xTPR
real mem = 2104799232 (2007MB)
avail mem = 2030678016 (1936MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 08/21/09, BIOS32 rev. 0 @
0xfdc01, SMBIOS rev. 2.5 @ 0xdc010 (25 entries)
bios0: vendor LENOVO version "18CN33WW(V2.06)" date 08/21/2009
bios0: LENOVO 2958
acpi0 at bios0: rev 2
acpi0: tables DSDT FACP HPET MCFG SLIC DBGP APIC BOOT SSDT SSDT SSDT
acpi0: wakeup devices LID0(S3) P0P2(S4) P0P1(S4) USB0(S3) USB2(S3)
EHC1(S3) EHC2(S3) HDEF(S0) RP02(S4) RP04(S3) PXSX(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpihpet0 at acpi0: 14318179 Hz
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: apic clock running at 199MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Pentium(R) Dual-Core CPU T4300 @ 2.10GHz ("GenuineIntel"
686-class) 2.10 GHz
cpu1:
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,EST,TM2,CX16,xTPR
ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 20, 24 pins
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (P0P2)
acpiprt2 at acpi0: bus 2 (RP01)
acpiprt3 at acpi0: bus 3 (RP02)
acpiprt4 at acpi0: bus 4 (RP03)
acpiprt5 at acpi0: bus 5 (RP04)
acpiprt6 at acpi0: bus -1 (RP05)
acpiprt7 at acpi0: bus 7 (RP06)
acpiec0 at acpi0
acpicpu0 at acpi0: C2, C1, PSS
acpicpu1 at acpi0: C2, C1, PSS
acpitz0 at acpi0: critical temperature 119 degC
acpibtn0 at acpi0: LID0
acpibtn1 at acpi0: PWRB
acpibtn2 at acpi0: SLPB
acpibat0 at acpi0: BAT1 model "PABAS024" serial 3658Q type LION oem "SANYO "
acpiac0 at acpi0: AC unit online
acpivideo0 at acpi0: VGA_
acpivout0 at acpivideo0: CRT_
acpivout1 at acpivideo0: LCD_
acpivout2 at acpivideo0: TV__
acpivout3 at acpivideo0: DVI_
acpivideo1 at acpi0: GFX0
bios0: ROM list: 0xc0000/0xfc00! 0xd0000/0x1e00 0xdc000/0x4000! 0xe0000/0x1800!
cpu0: Enhanced SpeedStep 2095 MHz: speeds: 2100, 1600, 1200 MHz
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 "Intel GM45 Host" rev 0x09
vga1 at pci0 dev 2 function 0 "Intel GM45 Video" rev 0x09
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 0xd0000000, size 0x10000000
inteldrm0 at vga1: apic 2 int 16 (irq 5)
drm0 at inteldrm0
"Intel GM45 Video" rev 0x09 at pci0 dev 2 function 1 not configured
uhci0 at pci0 dev 26 function 0 "Intel 82801I USB" rev 0x03: apic 2
int 16 (irq 5)
uhci1 at pci0 dev 26 function 1 "Intel 82801I USB" rev 0x03: apic 2
int 21 (irq 11)
uhci2 at pci0 dev 26 function 2 "Intel 82801I USB" rev 0x03: apic 2
int 20 (irq 7)
ehci0 at pci0 dev 26 function 7 "Intel 82801I USB" rev 0x03: apic 2
int 20 (irq 7)
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
azalia0 at pci0 dev 27 function 0 "Intel 82801I HD Audio" rev 0x03:
apic 2 int 22 (irq 10)
azalia0: codecs: Conexant CX20561
audio0 at azalia0
ppb0 at pci0 dev 28 function 0 "Intel 82801I PCIE" rev 0x03: apic 2
int 17 (irq 11)
pci1 at ppb0 bus 2
ppb1 at pci0 dev 28 function 1 "Intel 82801I PCIE" rev 0x03: apic 2
int 16 (irq 5)
pci2 at ppb1 bus 3
ppb2 at pci0 dev 28 function 2 "Intel 82801I PCIE" rev 0x03: apic 2
int 18 (irq 3)
pci3 at ppb2 bus 4
"Broadcom BCM4315" rev 0x01 at pci3 dev 0 function 0 not configured
ppb3 at pci0 dev 28 function 3 "Intel 82801I PCIE" rev 0x03: apic 2
int 19 (irq 10)
pci4 at ppb3 bus 5
ppb4 at pci0 dev 28 function 5 "Intel 82801I PCIE" rev 0x03: apic 2
int 16 (irq 5)
pci5 at ppb4 bus 7
bge0 at pci5 dev 0 function 0 "Broadcom BCM5906M" rev 0x02, BCM5906 A2
(0xc002): apic 2 int 17 (irq 11), address 00:26:22:ca:3c:d1
brgphy0 at bge0 phy 1: BCM5906 10/100baseTX PHY, rev. 0
uhci3 at pci0 dev 29 function 0 "Intel 82801I USB" rev 0x03: apic 2
int 23 (irq 4)
uhci4 at pci0 dev 29 function 1 "Intel 82801I USB" rev 0x03: apic 2
int 19 (irq 10)
uhci5 at pci0 dev 29 function 2 "Intel 82801I USB" rev 0x03: apic 2
int 18 (irq 3)
ehci1 at pci0 dev 29 function 7 "Intel 82801I USB" rev 0x03: apic 2
int 23 (irq 4)
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb5 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0x93
pci6 at ppb5 bus 8
pcib0 at pci0 dev 31 function 0 "Intel 82801IBM LPC" rev 0x03
pciide0 at pci0 dev 31 function 2 "Intel 82801I SATA" rev 0x03: DMA,
channel 0 configured to native-PCI, channel 1 configured to native-PCI
pciide0: using apic 2 int 19 (irq 10) for native-PCI interrupt
wd0 at pciide0 channel 0 drive 0: <Hitachi HTS543225L9A300>
wd0: 16-sector PIO, LBA48, 238475MB, 488397168 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 6
atapiscsi0 at pciide0 channel 1 drive 0
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: <Optiarc, DVD RW AD-7580S, F820> ATAPI
5/cdrom removable
cd0(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 5
ichiic0 at pci0 dev 31 function 3 "Intel 82801I SMBus" rev 0x03: apic
2 int 19 (irq 10)
iic0 at ichiic0
spdmem0 at iic0 addr 0x50: 2GB DDR3 SDRAM PC3-8500 SO-DIMM
pciide1 at pci0 dev 31 function 5 "Intel 82801I SATA" rev 0x03: DMA,
channel 0 wired to native-PCI, channel 1 wired to native-PCI
pciide1: using apic 2 int 19 (irq 10) for native-PCI interrupt
"Intel 82801I Thermal" rev 0x03 at pci0 dev 31 function 6 not configured
usb2 at uhci0: USB revision 1.0
uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb3 at uhci1: USB revision 1.0
uhub3 at usb3 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb4 at uhci2: USB revision 1.0
uhub4 at usb4 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb5 at uhci3: USB revision 1.0
uhub5 at usb5 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb6 at uhci4: USB revision 1.0
uhub6 at usb6 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb7 at uhci5: USB revision 1.0
uhub7 at usb7 "Intel UHCI root hub" rev 1.00/1.00 addr 1
isa0 at pcib0
isadma0 at isa0
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
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <PC speaker>
spkr0 at pcppi0
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
mtrr: Pentium Pro MTRR support
uvideo0 at uhub1 port 3 configuration 1 interface 0 "Bison Electronics
Inc. Lenovo EasyCamera" rev 2.00/14.10 addr 2
video0 at uvideo0
uhidev0 at uhub5 port 2 configuration 1 interface 0 "Anchor Chips
product 0x7453" rev 2.00/0.00 addr 2
uhidev0: iclass 3/0
uhid0 at uhidev0: input=31, output=21, feature=0
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
root on wd0a swap on wd0b dump on wd0b
### AML PARSE ERROR (0x45b4): Undefined name: PBST
error evaluating: \\_SB_.PCI0.LPCB.BAT1._BST