diff options
Diffstat (limited to 'patches/collateral-evolutions/network/16-bluetooth/net_bluetooth_hidp_core.patch')
-rw-r--r-- | patches/collateral-evolutions/network/16-bluetooth/net_bluetooth_hidp_core.patch | 169 |
1 files changed, 0 insertions, 169 deletions
diff --git a/patches/collateral-evolutions/network/16-bluetooth/net_bluetooth_hidp_core.patch b/patches/collateral-evolutions/network/16-bluetooth/net_bluetooth_hidp_core.patch deleted file mode 100644 index 068243f1..00000000 --- a/patches/collateral-evolutions/network/16-bluetooth/net_bluetooth_hidp_core.patch +++ /dev/null @@ -1,169 +0,0 @@ ---- a/net/bluetooth/hidp/core.c -+++ b/net/bluetooth/hidp/core.c -@@ -268,6 +268,7 @@ static int hidp_hidinput_event(struct in - return hidp_send_report(session, field->report); - } - -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,38)) - static int hidp_get_raw_report(struct hid_device *hid, - unsigned char report_number, - unsigned char *data, size_t count, -@@ -352,6 +353,7 @@ err: - mutex_unlock(&session->report_mutex); - return ret; - } -+#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,38)) */ - - static int hidp_set_raw_report(struct hid_device *hid, unsigned char reportnum, - unsigned char *data, size_t count, -@@ -418,6 +420,7 @@ err: - return ret; - } - -+#if defined(CPTCFG_BACKPORT_OPTION_BT_SOCK_CREATE_NEEDS_KERN) - static int hidp_output_raw_report(struct hid_device *hid, unsigned char *data, size_t count, - unsigned char report_type) - { -@@ -475,6 +478,16 @@ err: - mutex_unlock(&session->report_mutex); - return ret; - } -+#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27)) -+static int hidp_output_raw_report(struct hid_device *hid, unsigned char *data, size_t count) -+{ -+ if (hidp_send_ctrl_message(hid->driver_data, -+ HIDP_TRANS_SET_REPORT | HIDP_DATA_RTYPE_FEATURE, -+ data, count)) -+ return -ENOMEM; -+ return count; -+} -+#endif - - static int hidp_raw_request(struct hid_device *hid, unsigned char reportnum, - __u8 *buf, size_t len, unsigned char rtype, -@@ -786,6 +799,87 @@ static void hidp_close(struct hid_device - { - } - -+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,27)) -+static const struct { -+ __u16 idVendor; -+ __u16 idProduct; -+ unsigned quirks; -+} hidp_blacklist[] = { -+ /* Apple wireless Mighty Mouse */ -+ { 0x05ac, 0x030c, HID_QUIRK_MIGHTYMOUSE | HID_QUIRK_INVERT_HWHEEL }, -+ -+ { } /* Terminating entry */ -+}; -+static void hidp_setup_quirks(struct hid_device *hid) -+{ -+ unsigned int n; -+ -+ for (n = 0; hidp_blacklist[n].idVendor; n++) -+ if (hidp_blacklist[n].idVendor == le16_to_cpu(hid->vendor) && -+ hidp_blacklist[n].idProduct == le16_to_cpu(hid->product)) -+ hid->quirks = hidp_blacklist[n].quirks; -+} -+ -+static int hidp_setup_hid(struct hidp_session *session, -+ struct hidp_connadd_req *req) -+{ -+ struct hid_device *hid; -+ struct hid_report *report; -+ bdaddr_t src, dst; -+ unsigned char *buf; -+ -+ buf = kmalloc(req->rd_size, GFP_KERNEL); -+ if (!buf) -+ return -ENOMEM; -+ -+ if (copy_from_user(buf, req->rd_data, req->rd_size)) { -+ kfree(buf); -+ return -EFAULT; -+ } -+ -+ hid = hid_parse_report(buf, req->rd_size); -+ kfree(buf); -+ if (!session->hid) -+ return -EINVAL; -+ -+ session->hid = hid; -+ -+ hid->driver_data = session; -+ -+ baswap(&src, &bt_sk(session->ctrl_sock->sk)->src); -+ baswap(&dst, &bt_sk(session->ctrl_sock->sk)->dst); -+ -+ hid->bus = BUS_BLUETOOTH; -+ hid->vendor = req->vendor; -+ hid->product = req->product; -+ hid->version = req->version; -+ hid->country = req->country; -+ -+ strlcpy(hid->name, req->name, 128); -+ strlcpy(hid->phys, batostr(&src), 64); -+ strlcpy(hid->uniq, batostr(&dst), 64); -+ -+ hid->dev = hidp_get_device(session); -+ hid->hid_open = hidp_open; -+ hid->hid_close = hidp_close; -+ -+ hid->hidinput_input_event = hidp_hidinput_event; -+ -+ hidp_setup_quirks(hid); -+ -+ list_for_each_entry(report, &hid->report_enum[HID_INPUT_REPORT].report_list, list) -+ hidp_send_report(session, report); -+ -+ list_for_each_entry(report, &hid->report_enum[HID_FEATURE_REPORT].report_list, list) -+ hidp_send_report(session, report); -+ -+ if (hidinput_connect(hid) == 0) -+ hid->claimed |= HID_CLAIMED_INPUT; -+ -+ return 0; -+} -+#else -+ - static int hidp_parse(struct hid_device *hid) - { - struct hidp_session *session = hid->driver_data; -@@ -865,7 +959,9 @@ static int hidp_setup_hid(struct hidp_se - hid->dev.parent = &session->conn->hcon->dev; - hid->ll_driver = &hidp_hid_driver; - -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,38)) - hid->hid_get_raw_report = hidp_get_raw_report; -+#endif - hid->hid_output_raw_report = hidp_output_raw_report; - - /* True if device is blacklisted in drivers/hid/hid-core.c */ -@@ -883,6 +979,7 @@ fault: - - return err; - } -+#endif - - /* initialize session devices */ - static int hidp_session_dev_init(struct hidp_session *session, -@@ -945,10 +1042,17 @@ static int hidp_session_dev_add(struct h - /* remove HID/input devices from their bus systems */ - static void hidp_session_dev_del(struct hidp_session *session) - { -- if (session->hid) -+ if (session->hid) { -+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27)) - hid_destroy_device(session->hid); -- else if (session->input) -+#else -+ if (session->hid->claimed & HID_CLAIMED_INPUT) -+ hidinput_disconnect(session->hid); -+ hid_free_device(session->hid); -+#endif -+ } else if (session->input) { - input_unregister_device(session->input); -+ } - } - - /* |