#include <linux/device.h>
#include <linux/hid.h>
#include <linux/module.h>
#include <linux/kfifo.h>
#include <linux/delay.h>
#include <linux/usb.h>
#include <asm/unaligned.h>
#include "hid-ids.h"
#define DJ_MAX_PAIRED_DEVICES …
#define DJ_MAX_NUMBER_NOTIFS …
#define DJ_RECEIVER_INDEX …
#define DJ_DEVICE_INDEX_MIN …
#define DJ_DEVICE_INDEX_MAX …
#define DJREPORT_SHORT_LENGTH …
#define DJREPORT_LONG_LENGTH …
#define REPORT_ID_DJ_SHORT …
#define REPORT_ID_DJ_LONG …
#define REPORT_ID_HIDPP_SHORT …
#define REPORT_ID_HIDPP_LONG …
#define REPORT_ID_HIDPP_VERY_LONG …
#define HIDPP_REPORT_SHORT_LENGTH …
#define HIDPP_REPORT_LONG_LENGTH …
#define HIDPP_RECEIVER_INDEX …
#define REPORT_TYPE_RFREPORT_FIRST …
#define REPORT_TYPE_RFREPORT_LAST …
#define REPORT_TYPE_CMD_SWITCH …
#define CMD_SWITCH_PARAM_DEVBITFIELD …
#define CMD_SWITCH_PARAM_TIMEOUT_SECONDS …
#define TIMEOUT_NO_KEEPALIVE …
#define REPORT_TYPE_CMD_GET_PAIRED_DEVICES …
#define REPORT_TYPE_NOTIF_DEVICE_PAIRED …
#define SPFUNCTION_MORE_NOTIF_EXPECTED …
#define SPFUNCTION_DEVICE_LIST_EMPTY …
#define DEVICE_PAIRED_PARAM_SPFUNCTION …
#define DEVICE_PAIRED_PARAM_EQUAD_ID_LSB …
#define DEVICE_PAIRED_PARAM_EQUAD_ID_MSB …
#define DEVICE_PAIRED_RF_REPORT_TYPE …
#define REPORT_TYPE_NOTIF_DEVICE_UNPAIRED …
#define REPORT_TYPE_NOTIF_CONNECTION_STATUS …
#define CONNECTION_STATUS_PARAM_STATUS …
#define STATUS_LINKLOSS …
#define REPORT_TYPE_NOTIF_ERROR …
#define NOTIF_ERROR_PARAM_ETYPE …
#define ETYPE_KEEPALIVE_TIMEOUT …
#define REPORT_TYPE_KEYBOARD …
#define REPORT_TYPE_MOUSE …
#define REPORT_TYPE_CONSUMER_CONTROL …
#define REPORT_TYPE_SYSTEM_CONTROL …
#define REPORT_TYPE_MEDIA_CENTER …
#define REPORT_TYPE_LEDS …
#define STD_KEYBOARD …
#define STD_MOUSE …
#define MULTIMEDIA …
#define POWER_KEYS …
#define KBD_MOUSE …
#define MEDIA_CENTER …
#define KBD_LEDS …
#define HIDPP …
#define REPORT_TYPE_NOTIF_DEVICE_CONNECTED …
#define HIDPP_PARAM_PROTO_TYPE …
#define HIDPP_PARAM_DEVICE_INFO …
#define HIDPP_PARAM_EQUAD_LSB …
#define HIDPP_PARAM_EQUAD_MSB …
#define HIDPP_PARAM_27MHZ_DEVID …
#define HIDPP_DEVICE_TYPE_MASK …
#define HIDPP_LINK_STATUS_MASK …
#define HIDPP_MANUFACTURER_MASK …
#define HIDPP_27MHZ_SECURE_MASK …
#define HIDPP_DEVICE_TYPE_KEYBOARD …
#define HIDPP_DEVICE_TYPE_MOUSE …
#define HIDPP_SET_REGISTER …
#define HIDPP_GET_LONG_REGISTER …
#define HIDPP_REG_CONNECTION_STATE …
#define HIDPP_REG_PAIRING_INFORMATION …
#define HIDPP_PAIRING_INFORMATION …
#define HIDPP_FAKE_DEVICE_ARRIVAL …
enum recvr_type { … };
struct dj_report { … };
struct hidpp_event { … } __packed;
struct dj_receiver_dev { … };
struct dj_device { … };
#define WORKITEM_TYPE_EMPTY …
#define WORKITEM_TYPE_PAIRED …
#define WORKITEM_TYPE_UNPAIRED …
#define WORKITEM_TYPE_UNKNOWN …
struct dj_workitem { … };
static const char kbd_descriptor[] = …;
static const char mse_descriptor[] = …;
static const char mse_27mhz_descriptor[] = …;
static const char mse_bluetooth_descriptor[] = …;
static const char mse5_bluetooth_descriptor[] = …;
static const char mse_high_res_descriptor[] = …;
static const char consumer_descriptor[] = …;
static const char syscontrol_descriptor[] = …;
static const char media_descriptor[] = …;
static const char hidpp_descriptor[] = …;
#define MAX_REPORT_SIZE …
#define MAX_RDESC_SIZE …
#define NUMBER_OF_HID_REPORTS …
static const u8 hid_reportid_size_map[NUMBER_OF_HID_REPORTS] = …;
#define LOGITECH_DJ_INTERFACE_NUMBER …
static const struct hid_ll_driver logi_dj_ll_driver;
static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev);
static void delayedwork_callback(struct work_struct *work);
static LIST_HEAD(dj_hdev_list);
static DEFINE_MUTEX(dj_hdev_list_lock);
static bool recvr_type_is_bluetooth(enum recvr_type type)
{ … }
static struct dj_receiver_dev *dj_find_receiver_dev(struct hid_device *hdev,
enum recvr_type type)
{ … }
static void dj_release_receiver_dev(struct kref *kref)
{ … }
static void dj_put_receiver_dev(struct hid_device *hdev)
{ … }
static struct dj_receiver_dev *dj_get_receiver_dev(struct hid_device *hdev,
enum recvr_type type,
unsigned int application,
bool is_hidpp)
{ … }
static void logi_dj_recv_destroy_djhid_device(struct dj_receiver_dev *djrcv_dev,
struct dj_workitem *workitem)
{ … }
static void logi_dj_recv_add_djhid_device(struct dj_receiver_dev *djrcv_dev,
struct dj_workitem *workitem)
{ … }
static void delayedwork_callback(struct work_struct *work)
{ … }
static void logi_dj_recv_queue_unknown_work(struct dj_receiver_dev *djrcv_dev)
{ … }
static void logi_dj_recv_queue_notification(struct dj_receiver_dev *djrcv_dev,
struct dj_report *dj_report)
{ … }
static const u16 kbd_builtin_touchpad_ids[] = …;
static void logi_hidpp_dev_conn_notif_equad(struct hid_device *hdev,
struct hidpp_event *hidpp_report,
struct dj_workitem *workitem)
{ … }
static void logi_hidpp_dev_conn_notif_27mhz(struct hid_device *hdev,
struct hidpp_event *hidpp_report,
struct dj_workitem *workitem)
{ … }
static void logi_hidpp_recv_queue_notif(struct hid_device *hdev,
struct hidpp_event *hidpp_report)
{ … }
static void logi_dj_recv_forward_null_report(struct dj_receiver_dev *djrcv_dev,
struct dj_report *dj_report)
{ … }
static void logi_dj_recv_forward_dj(struct dj_receiver_dev *djrcv_dev,
struct dj_report *dj_report)
{ … }
static void logi_dj_recv_forward_report(struct dj_device *dj_dev, u8 *data,
int size)
{ … }
static void logi_dj_recv_forward_input_report(struct hid_device *hdev,
u8 *data, int size)
{ … }
static int logi_dj_recv_send_report(struct dj_receiver_dev *djrcv_dev,
struct dj_report *dj_report)
{ … }
static int logi_dj_recv_query_hidpp_devices(struct dj_receiver_dev *djrcv_dev)
{ … }
static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev)
{ … }
static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev,
unsigned timeout)
{ … }
static int logi_dj_ll_open(struct hid_device *hid)
{ … }
static void logi_dj_ll_close(struct hid_device *hid)
{ … }
static u8 unifying_pairing_query[] = …;
static u8 unifying_pairing_answer[] = …;
static int logi_dj_ll_raw_request(struct hid_device *hid,
unsigned char reportnum, __u8 *buf,
size_t count, unsigned char report_type,
int reqtype)
{ … }
static void rdcat(char *rdesc, unsigned int *rsize, const char *data, unsigned int size)
{ … }
static int logi_dj_ll_parse(struct hid_device *hid)
{ … }
static int logi_dj_ll_start(struct hid_device *hid)
{ … }
static void logi_dj_ll_stop(struct hid_device *hid)
{ … }
static bool logi_dj_ll_may_wakeup(struct hid_device *hid)
{ … }
static const struct hid_ll_driver logi_dj_ll_driver = …;
static int logi_dj_dj_event(struct hid_device *hdev,
struct hid_report *report, u8 *data,
int size)
{ … }
static int logi_dj_hidpp_event(struct hid_device *hdev,
struct hid_report *report, u8 *data,
int size)
{ … }
static int logi_dj_raw_event(struct hid_device *hdev,
struct hid_report *report, u8 *data,
int size)
{ … }
static int logi_dj_probe(struct hid_device *hdev,
const struct hid_device_id *id)
{ … }
#ifdef CONFIG_PM
static int logi_dj_reset_resume(struct hid_device *hdev)
{ … }
#endif
static void logi_dj_remove(struct hid_device *hdev)
{ … }
static const struct hid_device_id logi_dj_receivers[] = …;
MODULE_DEVICE_TABLE(hid, logi_dj_receivers);
static struct hid_driver logi_djreceiver_driver = …;
module_hid_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;