usb: fix support for HID keyboard

This fixes issues with several HID keyboards by implementing
get_unaligned_le16(), which obviously may also fix other not-yet-known
issues. Hint: I had to look out for suspicious lines like follows in the
verbose log.

  [init -> usb_drv] get_unaligned_le16 called, not implemented

Also, quirks for cherry keyboards are now applied.
This commit is contained in:
Christian Helmuth 2013-03-25 17:56:00 +01:00 committed by Norman Feske
parent 9a1d13c32d
commit da2076e52a
6 changed files with 25 additions and 12 deletions

View File

@ -50,7 +50,7 @@ CONTENT += $(addprefix include/scsi/,scsi.h scsi_host.h)
# USB hid driver
CONTENT += drivers/hid/hid-input.c drivers/hid/hid-core.c drivers/hid/hid-ids.h
CONTENT += drivers/hid/usbhid
CONTENT += drivers/hid/hid-cherry.c drivers/hid/usbhid
# needed by USB hid
CONTENT_INPUT := input.c evdev.c input-compat.h

View File

@ -40,8 +40,9 @@ SRC_C += usb/usb-common.c
SRC_C += $(addprefix usb/host/, ehci-hcd.c)
# USB hid
SRC_C += $(addprefix hid/usbhid/,hid-core.c hid-quirks.c)
SRC_C += hid/hid-input.c hid/hid-core.c input/evdev.c input/input.c
SRC_C += $(addprefix hid/usbhid/, hid-core.c hid-quirks.c)
SRC_C += $(addprefix hid/, hid-core.c hid-input.c hid-cherry.c)
SRC_C += $(addprefix input/, evdev.c input.c)
# USB storage
SRC_C += $(addprefix usb/storage/,scsiglue.c protocol.c transport.c usb.c \
@ -99,3 +100,5 @@ vpath %.cc $(LIB_DIR)/input
vpath %.cc $(LIB_DIR)/storage
vpath %.c $(LIB_DIR)/storage
vpath %.cc $(LIB_DIR)/nic
# vi: set ft=make :

View File

@ -42,14 +42,6 @@
int atomic_inc_return(atomic_t *v) { TRACE; return 0; }
/*******************************
** linux/byteorder/generic.h **
*******************************/
u16 get_unaligned_le16(const void *p) { TRACE; return 0; }
u32 get_unaligned_le32(const void *p) { TRACE; return 0; }
/*******************************
** linux/errno.h and friends **
*******************************/

View File

@ -309,6 +309,7 @@ typedef enum irqreturn irqreturn_t;
#define be32_to_cpup __be32_to_cpup
struct __una_u16 { u16 x; } __attribute__((packed));
struct __una_u32 { u32 x; } __attribute__((packed));
struct __una_u64 { u64 x; } __attribute__((packed));

View File

@ -801,6 +801,20 @@ long find_next_zero_bit_le(const void *addr,
** linux/byteorder/generic.h **
*******************************/
u16 get_unaligned_le16(const void *p)
{
const struct __una_u16 *ptr = (const struct __una_u16 *)p;
return ptr->x;
}
u32 get_unaligned_le32(const void *p)
{
const struct __una_u32 *ptr = (const struct __una_u32 *)p;
return ptr->x;
}
void put_unaligned_le32(u32 val, void *p)
{
struct __una_u32 *ptr = (struct __una_u32 *)p;
@ -810,7 +824,7 @@ void put_unaligned_le32(u32 val, void *p)
u64 get_unaligned_le64(const void *p)
{
struct __una_u64 *ptr = (struct __una_u64 *)p;
const struct __una_u64 *ptr = (const struct __una_u64 *)p;
return ptr->x;
}

View File

@ -39,6 +39,7 @@ extern "C" void module_evdev_init();
extern "C" void module_hid_init();
extern "C" void module_hid_init_core();
extern "C" void module_usb_stor_init();
extern "C" void module_ch_init();
extern "C" void start_input_service(void *ep);
@ -63,7 +64,9 @@ static void init(Services *services)
module_evdev_init();
/* HID */
module_hid_init_core();
module_hid_init();
module_ch_init();
}
/* host controller */