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

@ -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 */