#include <linux/completion.h>
#include <linux/device.h>
#include <linux/hid.h>
#include <linux/input.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/spinlock.h>
#include "hid-ids.h"
#include "hid-wiimote.h"
static int wiimote_hid_send(struct hid_device *hdev, __u8 *buffer,
size_t count)
{ … }
static void wiimote_queue_worker(struct work_struct *work)
{ … }
static void wiimote_queue(struct wiimote_data *wdata, const __u8 *buffer,
size_t count)
{ … }
static inline void wiiproto_keep_rumble(struct wiimote_data *wdata, __u8 *cmd1)
{ … }
void wiiproto_req_rumble(struct wiimote_data *wdata, __u8 rumble)
{ … }
void wiiproto_req_leds(struct wiimote_data *wdata, int leds)
{ … }
static __u8 select_drm(struct wiimote_data *wdata)
{ … }
void wiiproto_req_drm(struct wiimote_data *wdata, __u8 drm)
{ … }
void wiiproto_req_status(struct wiimote_data *wdata)
{ … }
void wiiproto_req_accel(struct wiimote_data *wdata, __u8 accel)
{ … }
void wiiproto_req_ir1(struct wiimote_data *wdata, __u8 flags)
{ … }
void wiiproto_req_ir2(struct wiimote_data *wdata, __u8 flags)
{ … }
#define wiiproto_req_wreg(wdata, os, buf, sz) …
#define wiiproto_req_weeprom(wdata, os, buf, sz) …
static void wiiproto_req_wmem(struct wiimote_data *wdata, bool eeprom,
__u32 offset, const __u8 *buf, __u8 size)
{ … }
void wiiproto_req_rmem(struct wiimote_data *wdata, bool eeprom, __u32 offset,
__u16 size)
{ … }
int wiimote_cmd_write(struct wiimote_data *wdata, __u32 offset,
const __u8 *wmem, __u8 size)
{ … }
ssize_t wiimote_cmd_read(struct wiimote_data *wdata, __u32 offset, __u8 *rmem,
__u8 size)
{ … }
static int wiimote_cmd_init_ext(struct wiimote_data *wdata)
{ … }
static __u8 wiimote_cmd_read_ext(struct wiimote_data *wdata, __u8 *rmem)
{ … }
static int wiimote_cmd_init_mp(struct wiimote_data *wdata)
{ … }
static bool wiimote_cmd_map_mp(struct wiimote_data *wdata, __u8 exttype)
{ … }
static bool wiimote_cmd_read_mp(struct wiimote_data *wdata, __u8 *rmem)
{ … }
static __u8 wiimote_cmd_read_mp_mapped(struct wiimote_data *wdata)
{ … }
static const __u8 * const wiimote_devtype_mods[WIIMOTE_DEV_NUM] = …;
static void wiimote_modules_load(struct wiimote_data *wdata,
unsigned int devtype)
{ … }
static void wiimote_modules_unload(struct wiimote_data *wdata)
{ … }
static void wiimote_ext_load(struct wiimote_data *wdata, unsigned int ext)
{ … }
static void wiimote_ext_unload(struct wiimote_data *wdata)
{ … }
static void wiimote_mp_load(struct wiimote_data *wdata)
{ … }
static void wiimote_mp_unload(struct wiimote_data *wdata)
{ … }
static const char *wiimote_devtype_names[WIIMOTE_DEV_NUM] = …;
static void wiimote_init_set_type(struct wiimote_data *wdata,
__u8 exttype)
{ … }
static void wiimote_init_detect(struct wiimote_data *wdata)
{ … }
static void wiimote_init_poll_mp(struct wiimote_data *wdata)
{ … }
static bool wiimote_init_check(struct wiimote_data *wdata)
{ … }
static const char *wiimote_exttype_names[WIIMOTE_EXT_NUM] = …;
static void wiimote_init_hotplug(struct wiimote_data *wdata)
{ … }
static void wiimote_init_worker(struct work_struct *work)
{ … }
void __wiimote_schedule(struct wiimote_data *wdata)
{ … }
static void wiimote_schedule(struct wiimote_data *wdata)
{ … }
static void wiimote_init_timeout(struct timer_list *t)
{ … }
static void handler_keys(struct wiimote_data *wdata, const __u8 *payload)
{ … }
static void handler_accel(struct wiimote_data *wdata, const __u8 *payload)
{ … }
static bool valid_ext_handler(const struct wiimod_ops *ops, size_t len)
{ … }
static void handler_ext(struct wiimote_data *wdata, const __u8 *payload,
size_t len)
{ … }
#define ir_to_input0(wdata, ir, packed) …
#define ir_to_input1(wdata, ir, packed) …
#define ir_to_input2(wdata, ir, packed) …
#define ir_to_input3(wdata, ir, packed) …
static void handler_ir(struct wiimote_data *wdata, const __u8 *payload,
bool packed, unsigned int id)
{ … }
static void handler_status_K(struct wiimote_data *wdata,
const __u8 *payload)
{ … }
static void handler_status(struct wiimote_data *wdata, const __u8 *payload)
{ … }
static void handler_generic_K(struct wiimote_data *wdata, const __u8 *payload)
{ … }
static void handler_data(struct wiimote_data *wdata, const __u8 *payload)
{ … }
static void handler_return(struct wiimote_data *wdata, const __u8 *payload)
{ … }
static void handler_drm_KA(struct wiimote_data *wdata, const __u8 *payload)
{ … }
static void handler_drm_KE(struct wiimote_data *wdata, const __u8 *payload)
{ … }
static void handler_drm_KAI(struct wiimote_data *wdata, const __u8 *payload)
{ … }
static void handler_drm_KEE(struct wiimote_data *wdata, const __u8 *payload)
{ … }
static void handler_drm_KIE(struct wiimote_data *wdata, const __u8 *payload)
{ … }
static void handler_drm_KAE(struct wiimote_data *wdata, const __u8 *payload)
{ … }
static void handler_drm_KAIE(struct wiimote_data *wdata, const __u8 *payload)
{ … }
static void handler_drm_E(struct wiimote_data *wdata, const __u8 *payload)
{ … }
static void handler_drm_SKAI1(struct wiimote_data *wdata, const __u8 *payload)
{ … }
static void handler_drm_SKAI2(struct wiimote_data *wdata, const __u8 *payload)
{ … }
struct wiiproto_handler { … };
static const struct wiiproto_handler handlers[] = …;
static int wiimote_hid_event(struct hid_device *hdev, struct hid_report *report,
u8 *raw_data, int size)
{ … }
static ssize_t wiimote_ext_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t wiimote_ext_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(extension, S_IRUGO | S_IWUSR | S_IWGRP, wiimote_ext_show,
wiimote_ext_store);
static ssize_t wiimote_dev_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(devtype, S_IRUGO, wiimote_dev_show, NULL);
static struct wiimote_data *wiimote_create(struct hid_device *hdev)
{ … }
static void wiimote_destroy(struct wiimote_data *wdata)
{ … }
static int wiimote_hid_probe(struct hid_device *hdev,
const struct hid_device_id *id)
{ … }
static void wiimote_hid_remove(struct hid_device *hdev)
{ … }
static const struct hid_device_id wiimote_hid_devices[] = …;
bool wiimote_dpad_as_analog = …;
module_param_named(dpad_as_analog, wiimote_dpad_as_analog, bool, 0644);
MODULE_PARM_DESC(…) …;
MODULE_DEVICE_TABLE(hid, wiimote_hid_devices);
static struct hid_driver wiimote_hid_driver = …;
module_hid_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;