Re: Rapoo V7 Keyboard Driver

2013-01-30 Thread Daniel Bolgheroni
On Mon, Jan 28, 2013 at 03:01:08PM -0800, Mike Larkin wrote:
 
 The diff above might work but when I tried something akin to that last year
 when implementing support for the Monoprice keyboard (similar mechanical
 'gaming' style keyboard), the boot protocol only allowed one key pressed at 
 a time. That meant no Shift/Ctrl/Alt which made things somewhat difficult.

As a workaround, it works OK with boot protocol, despite the fact the
mouse wheel gone.

BTW, what's the correct approach here? This keyboard is a 3-in-1, and 2
of them attach as ukbd and one as uhid. Is it work to attach the uhid
one as ukbd?

Thank you.



Rapoo V7 Keyboard Driver

2013-01-28 Thread Daniel Bolgheroni
Hi tech@,

anyone with a patch lurking around to work with a Rapoo V7 keyboard?

Linux has a workaround, but don't know if works:

https://github.com/Golevka/rapoov7-keyboard-driver

The dmesg for the kbd is:

uhidev1 at uhub5 port 1 configuration 1 interface 0 Holtek USB Gaming 
Keyboard rev 1.10/2.10 addr 3
uhidev1: iclass 3/1
ukbd0 at uhidev1: 8 variable keys, 6 key codes
wskbd1 at ukbd0 mux 1
wskbd1: connecting to wsdisplay0
uhidev2 at uhub5 port 1 configuration 1 interface 1 Holtek USB Gaming 
Keyboard rev 1.10/2.10 addr 3
uhidev2: iclass 3/0, 6 report ids
ums1 at uhidev2 reportid 1: 5 buttons, Z dir
wsmouse2 at ums1 mux 0
uhid0 at uhidev2 reportid 2: input=1, output=0, feature=0
uhid1 at uhidev2 reportid 3: input=2, output=0, feature=0
ukbd1 at uhidev2 reportid 4: 56 variable keys, 0 key codes
wskbd2 at ukbd1 mux 1
wskbd2: connecting to wsdisplay0
ukbd2 at uhidev2 reportid 5: 56 variable keys, 0 key codes
wskbd3 at ukbd2 mux 1
wskbd3: connecting to wsdisplay0
uhid2 at uhidev2 reportid 6: input=2, output=0, feature=0
uhidev3 at uhub5 port 1 configuration 1 interface 2 Holtek USB Gaming 
Keyboard rev 1.10/2.10 addr 3
uhidev3: no input interrupt endpoint

Thank you.



The complete dmesg:
OpenBSD 5.2-current (GENERIC.MP) #20: Mon Jan 21 17:23:23 MST 2013
t...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 3184132096 (3036MB)
avail mem = 3076943872 (2934MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.5 @ 0xfc480 (33 entries)
bios0: vendor American Megatrends Inc. version 200.T02 date 10/26/2010
bios0: POSITIVO POSITIVO MOBILE
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP APIC MCFG SLIC ECDT DBGP BOOT OEMB HPET GSCI ATKG SSDT
acpi0: wakeup devices USB0(S3) USB1(S3) USB2(S3) USB5(S3) EUSB(S3) USB3(S3) 
USB4(S3) USB6(S3) USBE(S3) HDAC(S3) P0P1(S4) P0P2(S3) P0P3(S3) WLAN(S3) 
P0P4(S3) P0P7(S4) GLAN(S4) P0P8(S3) SLPB(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Pentium(R) Dual-Core CPU T4500 @ 2.30GHz, 2640.47 MHz
cpu0: 
FPU,VME,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,PBE,SSE3,DTES64,MWAIT,DS-CPL,EST,TM2,SSSE3,CX16,xTPR,PDCM,XSAVE,NXE,LONG,LAHF,PERF
cpu0: 1MB 64b/line 4-way L2 cache
cpu0: apic clock running at 200MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Pentium(R) Dual-Core CPU T4500 @ 2.30GHz, 2200.08 MHz
cpu1: 
FPU,VME,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,PBE,SSE3,DTES64,MWAIT,DS-CPL,EST,TM2,SSSE3,CX16,xTPR,PDCM,XSAVE,NXE,LONG,LAHF,PERF
cpu1: 1MB 64b/line 4-way L2 cache
ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 24 pins
acpimcfg0 at acpi0 addr 0xe000, bus 0-255
acpiec0 at acpi0
acpihpet0 at acpi0: 14318179 Hz
acpi0: unable to load \\_SB_.PCI0._INI.USBT
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (P0P1)
acpiprt2 at acpi0: bus 1 (P0P2)
acpiprt3 at acpi0: bus 2 (P0P3)
acpiprt4 at acpi0: bus 3 (P0P4)
acpiprt5 at acpi0: bus 5 (P0P7)
acpicpu0 at acpi0: C2, C1, PSS
acpicpu1 at acpi0: C2, C1, PSS
acpitz0 at acpi0: critical temperature is 110 degC
acpiac0 at acpi0: AC unit in unknown state
acpibat0 at acpi0: BAT0 not present
acpiasus at acpi0 not configured
acpibtn0 at acpi0: SLPB
acpibtn1 at acpi0: LID_
cpu0: Enhanced SpeedStep 2640 MHz: speeds: 2300, 1600, 1200 MHz
pci0 at mainbus0 bus 0
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 0xd000, size 0x1000
inteldrm0 at vga1: apic 2 int 16
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
uhci1 at pci0 dev 26 function 1 Intel 82801I USB rev 0x03: apic 2 int 17
uhci2 at pci0 dev 26 function 2 Intel 82801I USB rev 0x03: apic 2 int 19
ehci0 at pci0 dev 26 function 7 Intel 82801I USB rev 0x03: apic 2 int 18
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: msi
azalia0: codecs: Realtek ALC269, Intel/0x2802, using Realtek ALC269
audio0 at azalia0
ppb0 at pci0 dev 28 function 0 Intel 82801I PCIE rev 0x03: msi
pci1 at ppb0 bus 1
ppb1 at pci0 dev 28 function 1 Intel 82801I PCIE rev 0x03: msi
pci2 at ppb1 bus 2
athn0 at pci2 dev 0 function 0 Atheros AR2427 rev 0x01: apic 2 int 17
athn0: AR9285 rev 2 (1T1R), ROM rev 13, address 48:5d:60:a2:e0:6a
ppb2 at pci0 dev 28 function 2 Intel 82801I PCIE rev 0x03: msi
pci3 at ppb2 bus 3
ppb3 at pci0 dev 28 function 5 Intel 82801I PCIE rev 0x03: msi
pci4 at ppb3 bus 5
re0 at pci4 dev 0 function 0 Realtek 8168 rev 0x03: RTL8168D/8111D (0x2800), 
apic 2 int 17, 

Re: Rapoo V7 Keyboard Driver

2013-01-28 Thread Mike Larkin
On Mon, Jan 28, 2013 at 06:50:28PM -0200, Daniel Bolgheroni wrote:
 Hi tech@,
 
 anyone with a patch lurking around to work with a Rapoo V7 keyboard?
 
 Linux has a workaround, but don't know if works:
 
 https://github.com/Golevka/rapoov7-keyboard-driver
 
 The dmesg for the kbd is:
 
 uhidev1 at uhub5 port 1 configuration 1 interface 0 Holtek USB Gaming 
 Keyboard rev 1.10/2.10 addr 3
 uhidev1: iclass 3/1
 ukbd0 at uhidev1: 8 variable keys, 6 key codes
 wskbd1 at ukbd0 mux 1
 wskbd1: connecting to wsdisplay0
 uhidev2 at uhub5 port 1 configuration 1 interface 1 Holtek USB Gaming 
 Keyboard rev 1.10/2.10 addr 3
 uhidev2: iclass 3/0, 6 report ids
 ums1 at uhidev2 reportid 1: 5 buttons, Z dir
 wsmouse2 at ums1 mux 0
 uhid0 at uhidev2 reportid 2: input=1, output=0, feature=0
 uhid1 at uhidev2 reportid 3: input=2, output=0, feature=0
 ukbd1 at uhidev2 reportid 4: 56 variable keys, 0 key codes
 wskbd2 at ukbd1 mux 1
 wskbd2: connecting to wsdisplay0
 ukbd2 at uhidev2 reportid 5: 56 variable keys, 0 key codes
 wskbd3 at ukbd2 mux 1
 wskbd3: connecting to wsdisplay0
 uhid2 at uhidev2 reportid 6: input=2, output=0, feature=0
 uhidev3 at uhub5 port 1 configuration 1 interface 2 Holtek USB Gaming 
 Keyboard rev 1.10/2.10 addr 3
 uhidev3: no input interrupt endpoint
 
 Thank you.
 

I fixed a variety of mechanical gaming keyboard last year, looks like this is
yet another example of a company doing things slightly different and causing
the usb kbd driver fits.

I'd think you probably won't find much help unless you're willing to donate
the kb to someone for testing. Or buy one for someone. Awfully hard to fix
this sort of thing without access to the hardware.

-ml

 
 
 The complete dmesg:
 OpenBSD 5.2-current (GENERIC.MP) #20: Mon Jan 21 17:23:23 MST 2013
 t...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
 real mem = 3184132096 (3036MB)
 avail mem = 3076943872 (2934MB)
 mainbus0 at root
 bios0 at mainbus0: SMBIOS rev. 2.5 @ 0xfc480 (33 entries)
 bios0: vendor American Megatrends Inc. version 200.T02 date 10/26/2010
 bios0: POSITIVO POSITIVO MOBILE
 acpi0 at bios0: rev 2
 acpi0: sleep states S0 S3 S4 S5
 acpi0: tables DSDT FACP APIC MCFG SLIC ECDT DBGP BOOT OEMB HPET GSCI ATKG SSDT
 acpi0: wakeup devices USB0(S3) USB1(S3) USB2(S3) USB5(S3) EUSB(S3) USB3(S3) 
 USB4(S3) USB6(S3) USBE(S3) HDAC(S3) P0P1(S4) P0P2(S3) P0P3(S3) WLAN(S3) 
 P0P4(S3) P0P7(S4) GLAN(S4) P0P8(S3) SLPB(S4)
 acpitimer0 at acpi0: 3579545 Hz, 24 bits
 acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
 cpu0 at mainbus0: apid 0 (boot processor)
 cpu0: Pentium(R) Dual-Core CPU T4500 @ 2.30GHz, 2640.47 MHz
 cpu0: 
 FPU,VME,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,PBE,SSE3,DTES64,MWAIT,DS-CPL,EST,TM2,SSSE3,CX16,xTPR,PDCM,XSAVE,NXE,LONG,LAHF,PERF
 cpu0: 1MB 64b/line 4-way L2 cache
 cpu0: apic clock running at 200MHz
 cpu1 at mainbus0: apid 1 (application processor)
 cpu1: Pentium(R) Dual-Core CPU T4500 @ 2.30GHz, 2200.08 MHz
 cpu1: 
 FPU,VME,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,PBE,SSE3,DTES64,MWAIT,DS-CPL,EST,TM2,SSSE3,CX16,xTPR,PDCM,XSAVE,NXE,LONG,LAHF,PERF
 cpu1: 1MB 64b/line 4-way L2 cache
 ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 24 pins
 acpimcfg0 at acpi0 addr 0xe000, bus 0-255
 acpiec0 at acpi0
 acpihpet0 at acpi0: 14318179 Hz
 acpi0: unable to load \\_SB_.PCI0._INI.USBT
 acpiprt0 at acpi0: bus 0 (PCI0)
 acpiprt1 at acpi0: bus -1 (P0P1)
 acpiprt2 at acpi0: bus 1 (P0P2)
 acpiprt3 at acpi0: bus 2 (P0P3)
 acpiprt4 at acpi0: bus 3 (P0P4)
 acpiprt5 at acpi0: bus 5 (P0P7)
 acpicpu0 at acpi0: C2, C1, PSS
 acpicpu1 at acpi0: C2, C1, PSS
 acpitz0 at acpi0: critical temperature is 110 degC
 acpiac0 at acpi0: AC unit in unknown state
 acpibat0 at acpi0: BAT0 not present
 acpiasus at acpi0 not configured
 acpibtn0 at acpi0: SLPB
 acpibtn1 at acpi0: LID_
 cpu0: Enhanced SpeedStep 2640 MHz: speeds: 2300, 1600, 1200 MHz
 pci0 at mainbus0 bus 0
 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 0xd000, size 0x1000
 inteldrm0 at vga1: apic 2 int 16
 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
 uhci1 at pci0 dev 26 function 1 Intel 82801I USB rev 0x03: apic 2 int 17
 uhci2 at pci0 dev 26 function 2 Intel 82801I USB rev 0x03: apic 2 int 19
 ehci0 at pci0 dev 26 function 7 Intel 82801I USB rev 0x03: apic 2 int 18
 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: msi
 azalia0: codecs: Realtek ALC269, Intel/0x2802, using Realtek ALC269
 audio0 at azalia0
 

Re: Rapoo V7 Keyboard Driver

2013-01-28 Thread Stuart Henderson
On 2013/01/28 14:20, Mike Larkin wrote:
 On Mon, Jan 28, 2013 at 06:50:28PM -0200, Daniel Bolgheroni wrote:
  Hi tech@,
  
  anyone with a patch lurking around to work with a Rapoo V7 keyboard?
  
  Linux has a workaround, but don't know if works:
  
  https://github.com/Golevka/rapoov7-keyboard-driver
  
  The dmesg for the kbd is:
  
  ukbd1 at uhidev2 reportid 4: 56 variable keys, 0 key codes
   ^^^
I think it's probably related to this.

The workaround seems to set the keyboard to a simpler boot protocol
which probably doesn't do the n-key rollover stuff; it might be worth
playing with this.

Index: uhidev.c
===
RCS file: /cvs/src/sys/dev/usb/uhidev.c,v
retrieving revision 1.42
diff -u -p -u -7 -r1.42 uhidev.c
--- uhidev.c3 Jul 2011 15:47:17 -   1.42
+++ uhidev.c28 Jan 2013 22:52:00 -
@@ -126,14 +126,15 @@ uhidev_attach(struct device *parent, str
const void *descptr;
usbd_status err;
 
sc-sc_udev = uaa-device;
sc-sc_iface = iface;
id = usbd_get_interface_descriptor(iface);
 
+   (void)usbd_set_protocol(iface, 0);
(void)usbd_set_idle(iface, 0, 0);
 #if 0
 
qflags = usbd_get_quirks(sc-sc_udev)-uq_flags;
if ((qflags  UQ_NO_SET_PROTO) == 0 
id-bInterfaceSubClass != UISUBCLASS_BOOT)
(void)usbd_set_protocol(iface, 1);

The other workaround I saw mentioned for these new keyboards was to
plug them into a passive USB-PS/2 adapter (if the keyboard supports
this), and then plug that into an active PS/2 - USB adapter. Again
you lose any of the more complicated features.

 I'd think you probably won't find much help unless you're willing to donate
 the kb to someone for testing. Or buy one for someone. Awfully hard to fix
 this sort of thing without access to the hardware.

yep.



Re: Rapoo V7 Keyboard Driver

2013-01-28 Thread Mike Larkin
On Mon, Jan 28, 2013 at 10:54:33PM +, Stuart Henderson wrote:
 On 2013/01/28 14:20, Mike Larkin wrote:
  On Mon, Jan 28, 2013 at 06:50:28PM -0200, Daniel Bolgheroni wrote:
   Hi tech@,
   
   anyone with a patch lurking around to work with a Rapoo V7 keyboard?
   
   Linux has a workaround, but don't know if works:
   
   https://github.com/Golevka/rapoov7-keyboard-driver
   
   The dmesg for the kbd is:
   
   ukbd1 at uhidev2 reportid 4: 56 variable keys, 0 key codes
^^^
 I think it's probably related to this.
 
 The workaround seems to set the keyboard to a simpler boot protocol
 which probably doesn't do the n-key rollover stuff; it might be worth
 playing with this.
 
 Index: uhidev.c
 ===
 RCS file: /cvs/src/sys/dev/usb/uhidev.c,v
 retrieving revision 1.42
 diff -u -p -u -7 -r1.42 uhidev.c
 --- uhidev.c  3 Jul 2011 15:47:17 -   1.42
 +++ uhidev.c  28 Jan 2013 22:52:00 -
 @@ -126,14 +126,15 @@ uhidev_attach(struct device *parent, str
   const void *descptr;
   usbd_status err;
  
   sc-sc_udev = uaa-device;
   sc-sc_iface = iface;
   id = usbd_get_interface_descriptor(iface);
  
 + (void)usbd_set_protocol(iface, 0);
   (void)usbd_set_idle(iface, 0, 0);
  #if 0
  
   qflags = usbd_get_quirks(sc-sc_udev)-uq_flags;
   if ((qflags  UQ_NO_SET_PROTO) == 0 
   id-bInterfaceSubClass != UISUBCLASS_BOOT)
   (void)usbd_set_protocol(iface, 1);
 
 The other workaround I saw mentioned for these new keyboards was to
 plug them into a passive USB-PS/2 adapter (if the keyboard supports
 this), and then plug that into an active PS/2 - USB adapter. Again
 you lose any of the more complicated features.
 
  I'd think you probably won't find much help unless you're willing to donate
  the kb to someone for testing. Or buy one for someone. Awfully hard to fix
  this sort of thing without access to the hardware.
 
 yep.
 

The diff above might work but when I tried something akin to that last year
when implementing support for the Monoprice keyboard (similar mechanical
'gaming' style keyboard), the boot protocol only allowed one key pressed at 
a time. That meant no Shift/Ctrl/Alt which made things somewhat difficult.

-ml