#include <linux/kref.h>
#include <linux/module.h>
#include <linux/file.h>
#include <linux/kthread.h>
#include <linux/hidraw.h>
#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>
#include <net/bluetooth/l2cap.h>
#include "hidp.h"
#define VERSION …
static DECLARE_RWSEM(hidp_session_sem);
static DECLARE_WAIT_QUEUE_HEAD(hidp_session_wq);
static LIST_HEAD(hidp_session_list);
static unsigned char hidp_keycode[256] = …;
static unsigned char hidp_mkeyspat[] = …;
static int hidp_session_probe(struct l2cap_conn *conn,
struct l2cap_user *user);
static void hidp_session_remove(struct l2cap_conn *conn,
struct l2cap_user *user);
static int hidp_session_thread(void *arg);
static void hidp_session_terminate(struct hidp_session *s);
static void hidp_copy_session(struct hidp_session *session, struct hidp_conninfo *ci)
{ … }
static int hidp_send_message(struct hidp_session *session, struct socket *sock,
struct sk_buff_head *transmit, unsigned char hdr,
const unsigned char *data, int size)
{ … }
static int hidp_send_ctrl_message(struct hidp_session *session,
unsigned char hdr, const unsigned char *data,
int size)
{ … }
static int hidp_send_intr_message(struct hidp_session *session,
unsigned char hdr, const unsigned char *data,
int size)
{ … }
static int hidp_input_event(struct input_dev *dev, unsigned int type,
unsigned int code, int value)
{ … }
static void hidp_input_report(struct hidp_session *session, struct sk_buff *skb)
{ … }
static int hidp_get_raw_report(struct hid_device *hid,
unsigned char report_number,
unsigned char *data, size_t count,
unsigned char report_type)
{ … }
static int hidp_set_raw_report(struct hid_device *hid, unsigned char reportnum,
unsigned char *data, size_t count,
unsigned char report_type)
{ … }
static int hidp_output_report(struct hid_device *hid, __u8 *data, size_t count)
{ … }
static int hidp_raw_request(struct hid_device *hid, unsigned char reportnum,
__u8 *buf, size_t len, unsigned char rtype,
int reqtype)
{ … }
static void hidp_idle_timeout(struct timer_list *t)
{ … }
static void hidp_set_timer(struct hidp_session *session)
{ … }
static void hidp_del_timer(struct hidp_session *session)
{ … }
static void hidp_process_report(struct hidp_session *session, int type,
const u8 *data, unsigned int len, int intr)
{ … }
static void hidp_process_handshake(struct hidp_session *session,
unsigned char param)
{ … }
static void hidp_process_hid_control(struct hidp_session *session,
unsigned char param)
{ … }
static int hidp_process_data(struct hidp_session *session, struct sk_buff *skb,
unsigned char param)
{ … }
static void hidp_recv_ctrl_frame(struct hidp_session *session,
struct sk_buff *skb)
{ … }
static void hidp_recv_intr_frame(struct hidp_session *session,
struct sk_buff *skb)
{ … }
static int hidp_send_frame(struct socket *sock, unsigned char *data, int len)
{ … }
static void hidp_process_transmit(struct hidp_session *session,
struct sk_buff_head *transmit,
struct socket *sock)
{ … }
static int hidp_setup_input(struct hidp_session *session,
const struct hidp_connadd_req *req)
{ … }
static int hidp_open(struct hid_device *hid)
{ … }
static void hidp_close(struct hid_device *hid)
{ … }
static int hidp_parse(struct hid_device *hid)
{ … }
static int hidp_start(struct hid_device *hid)
{ … }
static void hidp_stop(struct hid_device *hid)
{ … }
static const struct hid_ll_driver hidp_hid_driver = …;
static int hidp_setup_hid(struct hidp_session *session,
const struct hidp_connadd_req *req)
{ … }
static int hidp_session_dev_init(struct hidp_session *session,
const struct hidp_connadd_req *req)
{ … }
static void hidp_session_dev_destroy(struct hidp_session *session)
{ … }
static int hidp_session_dev_add(struct hidp_session *session)
{ … }
static void hidp_session_dev_del(struct hidp_session *session)
{ … }
static void hidp_session_dev_work(struct work_struct *work)
{ … }
static int hidp_session_new(struct hidp_session **out, const bdaddr_t *bdaddr,
struct socket *ctrl_sock,
struct socket *intr_sock,
const struct hidp_connadd_req *req,
struct l2cap_conn *conn)
{ … }
static void hidp_session_get(struct hidp_session *session)
{ … }
static void session_free(struct kref *ref)
{ … }
static void hidp_session_put(struct hidp_session *session)
{ … }
static struct hidp_session *__hidp_session_find(const bdaddr_t *bdaddr)
{ … }
static struct hidp_session *hidp_session_find(const bdaddr_t *bdaddr)
{ … }
static int hidp_session_start_sync(struct hidp_session *session)
{ … }
static void hidp_session_terminate(struct hidp_session *session)
{ … }
static int hidp_session_probe(struct l2cap_conn *conn,
struct l2cap_user *user)
{ … }
static void hidp_session_remove(struct l2cap_conn *conn,
struct l2cap_user *user)
{ … }
static void hidp_session_run(struct hidp_session *session)
{ … }
static int hidp_session_wake_function(wait_queue_entry_t *wait,
unsigned int mode,
int sync, void *key)
{ … }
static int hidp_session_thread(void *arg)
{ … }
static int hidp_verify_sockets(struct socket *ctrl_sock,
struct socket *intr_sock)
{ … }
int hidp_connection_add(const struct hidp_connadd_req *req,
struct socket *ctrl_sock,
struct socket *intr_sock)
{ … }
int hidp_connection_del(struct hidp_conndel_req *req)
{ … }
int hidp_get_connlist(struct hidp_connlist_req *req)
{ … }
int hidp_get_conninfo(struct hidp_conninfo *ci)
{ … }
static int __init hidp_init(void)
{ … }
static void __exit hidp_exit(void)
{ … }
module_init(…) …;
module_exit(hidp_exit);
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_VERSION(…);
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;