linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Bluez-devel] HIDP backport for 2.4
@ 2004-07-17  8:58 Marcel Holtmann
  2004-07-25 12:52 ` Marcel Holtmann
  0 siblings, 1 reply; 22+ messages in thread
From: Marcel Holtmann @ 2004-07-17  8:58 UTC (permalink / raw)
  To: BlueZ Mailing List

[-- Attachment #1: Type: text/plain, Size: 275 bytes --]

Hi Folks,

attached is a backport patch of the HIDP support from 2.6.8-rc1 for the
2.4 kernel series. I didn't tested this patch with any of my systems. I
only know that it compiles clean. So test this with the hidd daemon from
the bluez-utils-2.8 package.

Regards

Marcel


[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 30330 bytes --]

===== CREDITS 1.94 vs edited =====
--- 1.94/CREDITS	2004-04-01 09:03:37 +02:00
+++ edited/CREDITS	2004-07-15 20:59:55 +02:00
@@ -1348,6 +1348,7 @@
 D: Maintainer of the Linux Bluetooth Subsystem
 D: Author and maintainer of the various Bluetooth HCI drivers
 D: Author and maintainer of the CAPI message transport protocol driver
+D: Author and maintainer of the Bluetooth HID protocol driver
 D: Various other Bluetooth related patches, cleanups and fixes
 S: Germany
 
===== MAINTAINERS 1.139 vs edited =====
--- 1.139/MAINTAINERS	2004-06-20 23:04:08 +02:00
+++ edited/MAINTAINERS	2004-07-15 20:59:40 +02:00
@@ -357,6 +357,11 @@
 M:	marcel@holtmann.org
 S:	Maintained
 
+BLUETOOTH HIDP LAYER
+P:	Marcel Holtmann
+M:	marcel@holtmann.org
+S:	Maintained
+
 BLUETOOTH HCI UART DRIVER
 P:	Marcel Holtmann
 M:	marcel@holtmann.org
===== Documentation/Configure.help 1.258 vs edited =====
--- 1.258/Documentation/Configure.help	2004-07-13 06:59:48 +02:00
+++ edited/Documentation/Configure.help	2004-07-15 20:58:54 +02:00
@@ -23158,6 +23158,7 @@
                RFCOMM Module (RFCOMM Protocol)
                BNEP Module (Bluetooth Network Encapsulation Protocol)
                CMTP Module (CAPI Message Transport Protocol)
+               HIDP Module (Human Interface Device Protocol)
 
   Say Y here to compile Bluetooth support into the kernel or say M to
   compile it as module (bluez.o).
@@ -23222,6 +23223,15 @@
 
   Say Y here to compile CMTP support into the kernel or say M to
   compile it as module (cmtp.o).
+
+HIDP protocol support
+CONFIG_BLUEZ_HIDP
+  HIDP (Human Interface Device Protocol) is a transport layer
+  for HID reports.  HIDP is required for the Bluetooth Human
+  Interface Device Profile.
+
+  Say Y here to compile HIDP support into the kernel or say M to
+  compile it as module (hidp.o).
 
 HCI UART driver
 CONFIG_BLUEZ_HCIUART
===== arch/sparc64/kernel/ioctl32.c 1.48 vs edited =====
--- 1.48/arch/sparc64/kernel/ioctl32.c	2004-04-27 20:45:56 +02:00
+++ edited/arch/sparc64/kernel/ioctl32.c	2004-07-16 11:54:50 +02:00
@@ -4322,6 +4322,11 @@
 #define CMTPGETCONNLIST	_IOR('C', 210, int)
 #define CMTPGETCONNINFO	_IOR('C', 211, int)
 
+#define HIDPCONNADD	_IOW('H', 200, int)
+#define HIDPCONNDEL	_IOW('H', 201, int)
+#define HIDPGETCONNLIST	_IOR('H', 210, int)
+#define HIDPGETCONNINFO	_IOR('H', 211, int)
+
 struct ioctl_trans {
 	unsigned int cmd;
 	unsigned int handler;
@@ -5050,6 +5055,10 @@
 COMPATIBLE_IOCTL(CMTPCONNDEL)
 COMPATIBLE_IOCTL(CMTPGETCONNLIST)
 COMPATIBLE_IOCTL(CMTPGETCONNINFO)
+COMPATIBLE_IOCTL(HIDPCONNADD)
+COMPATIBLE_IOCTL(HIDPCONNDEL)
+COMPATIBLE_IOCTL(HIDPGETCONNLIST)
+COMPATIBLE_IOCTL(HIDPGETCONNINFO)
 /* Scanner */
 COMPATIBLE_IOCTL(SCANNER_IOCTL_VENDOR)
 COMPATIBLE_IOCTL(SCANNER_IOCTL_PRODUCT)
===== net/bluetooth/Config.in 1.6 vs edited =====
--- 1.6/net/bluetooth/Config.in	2003-06-14 00:20:26 +02:00
+++ edited/net/bluetooth/Config.in	2004-07-15 21:03:17 +02:00
@@ -14,6 +14,7 @@
       source net/bluetooth/rfcomm/Config.in
       source net/bluetooth/bnep/Config.in
       source net/bluetooth/cmtp/Config.in
+      source net/bluetooth/hidp/Config.in
       source drivers/bluetooth/Config.in
    fi
 
===== net/bluetooth/Makefile 1.7 vs edited =====
--- 1.7/net/bluetooth/Makefile	2003-07-17 05:59:48 +02:00
+++ edited/net/bluetooth/Makefile	2004-07-15 21:04:23 +02:00
@@ -16,6 +16,7 @@
 subdir-$(CONFIG_BLUEZ_RFCOMM) += rfcomm
 subdir-$(CONFIG_BLUEZ_BNEP) += bnep
 subdir-$(CONFIG_BLUEZ_CMTP) += cmtp
+subdir-$(CONFIG_BLUEZ_HIDP) += hidp
 
 ifeq ($(CONFIG_BLUEZ_RFCOMM),y)
 obj-y += rfcomm/rfcomm.o
@@ -23,6 +24,14 @@
 
 ifeq ($(CONFIG_BLUEZ_BNEP),y)
 obj-y += bnep/bnep.o
+endif
+
+ifeq ($(CONFIG_BLUEZ_CMTP),y)
+obj-y += cmtp/cmtp.o
+endif
+
+ifeq ($(CONFIG_BLUEZ_HIDP),y)
+obj-y += hidp/hidp.o
 endif
 
 include $(TOPDIR)/Rules.make
===== net/bluetooth/hidp/Config.in 1.1 vs edited =====
--- 1.1/net/bluetooth/hidp/Config.in	2004-07-15 21:01:05 +02:00
+++ edited/net/bluetooth/hidp/Config.in	2004-07-15 21:01:46 +02:00
@@ -0,0 +1,5 @@
+#
+# Bluetooth HIDP layer configuration
+#
+
+dep_tristate 'HIDP protocol support' CONFIG_BLUEZ_HIDP $CONFIG_INPUT $CONFIG_BLUEZ_L2CAP
===== net/bluetooth/hidp/Makefile 1.1 vs edited =====
--- 1.1/net/bluetooth/hidp/Makefile	2004-07-15 21:01:09 +02:00
+++ edited/net/bluetooth/hidp/Makefile	2004-07-15 21:02:37 +02:00
@@ -0,0 +1,10 @@
+#
+# Makefile for the Linux Bluetooth HIDP layer
+#
+
+O_TARGET := hidp.o
+
+obj-y	:= core.o sock.o
+obj-m	+= $(O_TARGET)
+
+include $(TOPDIR)/Rules.make
===== net/bluetooth/hidp/core.c 1.1 vs edited =====
--- 1.1/net/bluetooth/hidp/core.c	2004-07-15 21:00:37 +02:00
+++ edited/net/bluetooth/hidp/core.c	2004-07-16 11:47:17 +02:00
@@ -0,0 +1,653 @@
+/* 
+   HIDP implementation for Linux Bluetooth stack (BlueZ).
+   Copyright (C) 2003-2004 Marcel Holtmann <marcel@holtmann.org>
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License version 2 as
+   published by the Free Software Foundation;
+
+   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
+   IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
+   CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 
+   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 
+   ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 
+   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+   ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 
+   COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 
+   SOFTWARE IS DISCLAIMED.
+*/
+
+#include <linux/config.h>
+#include <linux/module.h>
+
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/kernel.h>
+#include <linux/major.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <linux/poll.h>
+#include <linux/fcntl.h>
+#include <linux/skbuff.h>
+#include <linux/socket.h>
+#include <linux/ioctl.h>
+#include <linux/file.h>
+#include <linux/init.h>
+#include <net/sock.h>
+
+#include <linux/input.h>
+
+#include <net/bluetooth/bluetooth.h>
+#include <net/bluetooth/l2cap.h>
+
+#include "hidp.h"
+
+#ifndef CONFIG_BT_HIDP_DEBUG
+#undef  BT_DBG
+#define BT_DBG(D...)
+#endif
+
+#define VERSION "1.0"
+
+static DECLARE_RWSEM(hidp_session_sem);
+static LIST_HEAD(hidp_session_list);
+
+static unsigned char hidp_keycode[256] = {
+	  0,  0,  0,  0, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38,
+	 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 21, 44,  2,  3,
+	  4,  5,  6,  7,  8,  9, 10, 11, 28,  1, 14, 15, 57, 12, 13, 26,
+	 27, 43, 43, 39, 40, 41, 51, 52, 53, 58, 59, 60, 61, 62, 63, 64,
+	 65, 66, 67, 68, 87, 88, 99, 70,119,110,102,104,111,107,109,106,
+	105,108,103, 69, 98, 55, 74, 78, 96, 79, 80, 81, 75, 76, 77, 71,
+	 72, 73, 82, 83, 86,127,116,117,183,184,185,186,187,188,189,190,
+	191,192,193,194,134,138,130,132,128,129,131,137,133,135,136,113,
+	115,114,  0,  0,  0,121,  0, 89, 93,124, 92, 94, 95,  0,  0,  0,
+	122,123, 90, 91, 85,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+	  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+	  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+	  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+	  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+	 29, 42, 56,125, 97, 54,100,126,164,166,165,163,161,115,114,113,
+	150,158,159,128,136,177,178,176,142,152,173,140
+};
+
+static struct hidp_session *__hidp_get_session(bdaddr_t *bdaddr)
+{
+	struct hidp_session *session;
+	struct list_head *p;
+
+	BT_DBG("");
+
+	list_for_each(p, &hidp_session_list) {
+		session = list_entry(p, struct hidp_session, list);
+		if (!bacmp(bdaddr, &session->bdaddr))
+			return session;
+	}
+	return NULL;
+}
+
+static void __hidp_link_session(struct hidp_session *session)
+{
+	MOD_INC_USE_COUNT;
+	list_add(&session->list, &hidp_session_list);
+}
+
+static void __hidp_unlink_session(struct hidp_session *session)
+{
+	list_del(&session->list);
+	MOD_DEC_USE_COUNT;
+}
+
+static void __hidp_copy_session(struct hidp_session *session, struct hidp_conninfo *ci)
+{
+	bacpy(&ci->bdaddr, &session->bdaddr);
+
+	ci->flags = session->flags;
+	ci->state = session->state;
+
+	ci->vendor  = 0x0000;
+	ci->product = 0x0000;
+	ci->version = 0x0000;
+	memset(ci->name, 0, 128);
+
+	if (session->input) {
+		ci->vendor  = session->input->idvendor;
+		ci->product = session->input->idproduct;
+		ci->version = session->input->idversion;
+		if (session->input->name)
+			strncpy(ci->name, session->input->name, 128);
+		else
+			strncpy(ci->name, "HID Boot Device", 128);
+	}
+}
+
+static int hidp_input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
+{
+	struct hidp_session *session = dev->private;
+	struct sk_buff *skb;
+	unsigned char newleds;
+
+	BT_DBG("session %p hid %p data %p size %d", session, device, data, size);
+
+	if (type != EV_LED)
+		return -1;
+
+	newleds = (!!test_bit(LED_KANA,    dev->led) << 3) |
+		  (!!test_bit(LED_COMPOSE, dev->led) << 3) |
+		  (!!test_bit(LED_SCROLLL, dev->led) << 2) |
+		  (!!test_bit(LED_CAPSL,   dev->led) << 1) |
+		  (!!test_bit(LED_NUML,    dev->led));
+
+	if (session->leds == newleds)
+		return 0;
+
+	session->leds = newleds;
+
+	if (!(skb = alloc_skb(3, GFP_ATOMIC))) {
+		BT_ERR("Can't allocate memory for new frame");
+		return -ENOMEM;
+	}
+
+	*skb_put(skb, 1) = 0xa2;
+	*skb_put(skb, 1) = 0x01;
+	*skb_put(skb, 1) = newleds;
+
+	skb_queue_tail(&session->intr_transmit, skb);
+
+	hidp_schedule(session);
+
+	return 0;
+}
+
+static void hidp_input_report(struct hidp_session *session, struct sk_buff *skb)
+{
+	struct input_dev *dev = session->input;
+	unsigned char *keys = session->keys;
+	unsigned char *udata = skb->data + 1;
+	signed char *sdata = skb->data + 1;
+	int i, size = skb->len - 1;
+
+	switch (skb->data[0]) {
+	case 0x01:	/* Keyboard report */
+		for (i = 0; i < 8; i++)
+			input_report_key(dev, hidp_keycode[i + 224], (udata[0] >> i) & 1);
+
+		for (i = 2; i < 8; i++) {
+			if (keys[i] > 3 && memscan(udata + 2, keys[i], 6) == udata + 8) {
+				if (hidp_keycode[keys[i]])
+					input_report_key(dev, hidp_keycode[keys[i]], 0);
+				else
+					BT_ERR("Unknown key (scancode %#x) released.", keys[i]);
+			}
+
+			if (udata[i] > 3 && memscan(keys + 2, udata[i], 6) == keys + 8) {
+				if (hidp_keycode[udata[i]])
+					input_report_key(dev, hidp_keycode[udata[i]], 1);
+				else
+					BT_ERR("Unknown key (scancode %#x) pressed.", udata[i]);
+			}
+		}
+
+		memcpy(keys, udata, 8);
+		break;
+
+	case 0x02:	/* Mouse report */
+		input_report_key(dev, BTN_LEFT,   sdata[0] & 0x01);
+		input_report_key(dev, BTN_RIGHT,  sdata[0] & 0x02);
+		input_report_key(dev, BTN_MIDDLE, sdata[0] & 0x04);
+		input_report_key(dev, BTN_SIDE,   sdata[0] & 0x08);
+		input_report_key(dev, BTN_EXTRA,  sdata[0] & 0x10);
+
+		input_report_rel(dev, REL_X, sdata[1]);
+		input_report_rel(dev, REL_Y, sdata[2]);
+
+		if (size > 3)
+			input_report_rel(dev, REL_WHEEL, sdata[3]);
+		break;
+	}
+}
+
+static void hidp_idle_timeout(unsigned long arg)
+{
+	struct hidp_session *session = (struct hidp_session *) arg;
+
+	atomic_inc(&session->terminate);
+	hidp_schedule(session);
+}
+
+static inline void hidp_set_timer(struct hidp_session *session)
+{
+	if (session->idle_to > 0)
+		mod_timer(&session->timer, jiffies + HZ * session->idle_to);
+}
+
+static inline void hidp_del_timer(struct hidp_session *session)
+{
+	if (session->idle_to > 0)
+		del_timer(&session->timer);
+}
+
+static inline void hidp_send_message(struct hidp_session *session, unsigned char hdr)
+{
+	struct sk_buff *skb;
+
+	BT_DBG("session %p", session);
+
+	if (!(skb = alloc_skb(1, GFP_ATOMIC))) {
+		BT_ERR("Can't allocate memory for message");
+		return;
+	}
+
+	*skb_put(skb, 1) = hdr;
+
+	skb_queue_tail(&session->ctrl_transmit, skb);
+
+	hidp_schedule(session);
+}
+
+static inline int hidp_recv_frame(struct hidp_session *session, struct sk_buff *skb)
+{
+	__u8 hdr;
+
+	BT_DBG("session %p skb %p len %d", session, skb, skb->len);
+
+	hdr = skb->data[0];
+	skb_pull(skb, 1);
+
+	if (hdr == 0xa1) {
+		hidp_set_timer(session);
+
+		if (session->input)
+			hidp_input_report(session, skb);
+	} else {
+		BT_DBG("Unsupported protocol header 0x%02x", hdr);
+	}
+
+	kfree_skb(skb);
+	return 0;
+}
+
+static int hidp_send_frame(struct socket *sock, unsigned char *data, int len)
+{
+	struct iovec iv = { data, len };
+	struct msghdr msg;
+
+	BT_DBG("sock %p data %p len %d", sock, data, len);
+
+	if (!len)
+		return 0;
+
+	memset(&msg, 0, sizeof(msg));
+	msg.msg_iovlen = 1;
+	msg.msg_iov = &iv;
+
+	return sock_sendmsg(sock, &msg, len);
+}
+
+static int hidp_process_transmit(struct hidp_session *session)
+{
+	struct sk_buff *skb;
+
+	BT_DBG("session %p", session);
+
+	while ((skb = skb_dequeue(&session->ctrl_transmit))) {
+		if (hidp_send_frame(session->ctrl_sock, skb->data, skb->len) < 0) {
+			skb_queue_head(&session->ctrl_transmit, skb);
+			break;
+		}
+
+		hidp_set_timer(session);
+		kfree_skb(skb);
+	}
+
+	while ((skb = skb_dequeue(&session->intr_transmit))) {
+		if (hidp_send_frame(session->intr_sock, skb->data, skb->len) < 0) {
+			skb_queue_head(&session->intr_transmit, skb);
+			break;
+		}
+
+		hidp_set_timer(session);
+		kfree_skb(skb);
+	}
+
+	return skb_queue_len(&session->ctrl_transmit) +
+				skb_queue_len(&session->intr_transmit);
+}
+
+static int hidp_session(void *arg)
+{
+	struct hidp_session *session = arg;
+	struct sock *ctrl_sk = session->ctrl_sock->sk;
+	struct sock *intr_sk = session->intr_sock->sk;
+	struct sk_buff *skb;
+	int vendor = 0x0000, product = 0x0000;
+	wait_queue_t ctrl_wait, intr_wait;
+	unsigned long timeo = HZ;
+
+	BT_DBG("session %p", session);
+
+	if (session->input) {
+		vendor  = session->input->idvendor;
+		product = session->input->idproduct;
+	}
+
+	daemonize(); reparent_to_init();
+
+	sprintf(current->comm, "khidpd_%04x%04x", vendor, product);
+
+	sigfillset(&current->blocked);
+	flush_signals(current);
+
+	current->nice = -15;
+
+	set_fs(KERNEL_DS);
+
+	init_waitqueue_entry(&ctrl_wait, current);
+	init_waitqueue_entry(&intr_wait, current);
+	add_wait_queue(ctrl_sk->sleep, &ctrl_wait);
+	add_wait_queue(intr_sk->sleep, &intr_wait);
+	while (!atomic_read(&session->terminate)) {
+		set_current_state(TASK_INTERRUPTIBLE);
+
+		if (ctrl_sk->state != BT_CONNECTED || intr_sk->state != BT_CONNECTED)
+			break;
+
+		while ((skb = skb_dequeue(&ctrl_sk->receive_queue))) {
+			skb_orphan(skb);
+			hidp_recv_frame(session, skb);
+		}
+
+		while ((skb = skb_dequeue(&intr_sk->receive_queue))) {
+			skb_orphan(skb);
+			hidp_recv_frame(session, skb);
+		}
+
+		hidp_process_transmit(session);
+
+		schedule();
+	}
+	set_current_state(TASK_RUNNING);
+	remove_wait_queue(intr_sk->sleep, &intr_wait);
+	remove_wait_queue(ctrl_sk->sleep, &ctrl_wait);
+
+	down_write(&hidp_session_sem);
+
+	hidp_del_timer(session);
+
+	if (intr_sk->state != BT_CONNECTED) {
+		init_waitqueue_entry(&ctrl_wait, current);
+		add_wait_queue(ctrl_sk->sleep, &ctrl_wait);
+		while (timeo && ctrl_sk->state != BT_CLOSED) {
+			set_current_state(TASK_INTERRUPTIBLE);
+			timeo = schedule_timeout(timeo);
+		}
+		set_current_state(TASK_RUNNING);
+		remove_wait_queue(ctrl_sk->sleep, &ctrl_wait);
+		timeo = HZ;
+	}
+
+	fput(session->ctrl_sock->file);
+
+	init_waitqueue_entry(&intr_wait, current);
+	add_wait_queue(intr_sk->sleep, &intr_wait);
+	while (timeo && intr_sk->state != BT_CLOSED) {
+		set_current_state(TASK_INTERRUPTIBLE);
+		timeo = schedule_timeout(timeo);
+	}
+	set_current_state(TASK_RUNNING);
+	remove_wait_queue(intr_sk->sleep, &intr_wait);
+
+	fput(session->intr_sock->file);
+
+	__hidp_unlink_session(session);
+
+	if (session->input) {
+		input_unregister_device(session->input);
+		kfree(session->input);
+	}
+
+	up_write(&hidp_session_sem);
+
+	kfree(session);
+	return 0;
+}
+
+static inline void hidp_setup_input(struct hidp_session *session, struct hidp_connadd_req *req)
+{
+	struct input_dev *input = session->input;
+	int i;
+
+	input->private = session;
+
+	input->idbus     = BUS_BLUETOOTH;
+	input->idvendor  = req->vendor;
+	input->idproduct = req->product;
+	input->idversion = req->version;
+
+	if (req->subclass & 0x40) {
+		set_bit(EV_KEY, input->evbit);
+		set_bit(EV_LED, input->evbit);
+		set_bit(EV_REP, input->evbit);
+
+		set_bit(LED_NUML,    input->ledbit);
+		set_bit(LED_CAPSL,   input->ledbit);
+		set_bit(LED_SCROLLL, input->ledbit);
+		set_bit(LED_COMPOSE, input->ledbit);
+		set_bit(LED_KANA,    input->ledbit);
+
+		for (i = 0; i < sizeof(hidp_keycode); i++)
+			set_bit(hidp_keycode[i], input->keybit);
+		clear_bit(0, input->keybit);
+	}
+
+	if (req->subclass & 0x80) {
+		input->evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
+		input->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE);
+		input->relbit[0] = BIT(REL_X) | BIT(REL_Y);
+		input->keybit[LONG(BTN_MOUSE)] |= BIT(BTN_SIDE) | BIT(BTN_EXTRA);
+		input->relbit[0] |= BIT(REL_WHEEL);
+	}
+
+	input->event = hidp_input_event;
+
+	input_register_device(input);
+}
+
+int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock, struct socket *intr_sock)
+{
+	struct hidp_session *session, *s;
+	int err;
+
+	BT_DBG("");
+
+	if (bacmp(&bluez_pi(ctrl_sock->sk)->src, &bluez_pi(intr_sock->sk)->src) ||
+			bacmp(&bluez_pi(ctrl_sock->sk)->dst, &bluez_pi(intr_sock->sk)->dst))
+		return -ENOTUNIQ;
+
+	session = kmalloc(sizeof(struct hidp_session), GFP_KERNEL);
+	if (!session) 
+		return -ENOMEM;
+	memset(session, 0, sizeof(struct hidp_session));
+
+	session->input = kmalloc(sizeof(struct input_dev), GFP_KERNEL);
+	if (!session->input) {
+		kfree(session);
+		return -ENOMEM;
+	}
+	memset(session->input, 0, sizeof(struct input_dev));
+
+	down_write(&hidp_session_sem);
+
+	s = __hidp_get_session(&bluez_pi(ctrl_sock->sk)->dst);
+	if (s && s->state == BT_CONNECTED) {
+		err = -EEXIST;
+		goto failed;
+	}
+
+	bacpy(&session->bdaddr, &bluez_pi(ctrl_sock->sk)->dst);
+
+	session->ctrl_mtu = min_t(uint, l2cap_pi(ctrl_sock->sk)->omtu, l2cap_pi(ctrl_sock->sk)->imtu);
+	session->intr_mtu = min_t(uint, l2cap_pi(intr_sock->sk)->omtu, l2cap_pi(intr_sock->sk)->imtu);
+
+	BT_DBG("ctrl mtu %d intr mtu %d", session->ctrl_mtu, session->intr_mtu);
+
+	session->ctrl_sock = ctrl_sock;
+	session->intr_sock = intr_sock;
+	session->state     = BT_CONNECTED;
+
+	init_timer(&session->timer);
+
+	session->timer.function = hidp_idle_timeout;
+	session->timer.data     = (unsigned long) session;
+
+	skb_queue_head_init(&session->ctrl_transmit);
+	skb_queue_head_init(&session->intr_transmit);
+
+	session->flags   = req->flags & (1 << HIDP_BLUETOOTH_VENDOR_ID);
+	session->idle_to = req->idle_to;
+
+	if (session->input)
+		hidp_setup_input(session, req);
+
+	__hidp_link_session(session);
+
+	hidp_set_timer(session);
+
+	err = kernel_thread(hidp_session, session, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+	if (err < 0)
+		goto unlink;
+
+	if (session->input) {
+		hidp_send_message(session, 0x70);
+		session->flags |= (1 << HIDP_BOOT_PROTOCOL_MODE);
+
+		session->leds = 0xff;
+		hidp_input_event(session->input, EV_LED, 0, 0);
+	}
+
+	up_write(&hidp_session_sem);
+	return 0;
+
+unlink:
+	hidp_del_timer(session);
+
+	__hidp_unlink_session(session);
+
+	if (session->input)
+		input_unregister_device(session->input);
+
+failed:
+	up_write(&hidp_session_sem);
+
+	if (session->input)
+		kfree(session->input);
+
+	kfree(session);
+	return err;
+}
+
+int hidp_del_connection(struct hidp_conndel_req *req)
+{
+	struct hidp_session *session;
+	int err = 0;
+
+	BT_DBG("");
+
+	down_read(&hidp_session_sem);
+
+	session = __hidp_get_session(&req->bdaddr);
+	if (session) {
+		if (req->flags & (1 << HIDP_VIRTUAL_CABLE_UNPLUG)) {
+			hidp_send_message(session, 0x15);
+		} else {
+			/* Flush the transmit queues */
+			skb_queue_purge(&session->ctrl_transmit);
+			skb_queue_purge(&session->intr_transmit);
+
+			/* Kill session thread */
+			atomic_inc(&session->terminate);
+			hidp_schedule(session);
+		}
+	} else
+		err = -ENOENT;
+
+	up_read(&hidp_session_sem);
+	return err;
+}
+
+int hidp_get_connlist(struct hidp_connlist_req *req)
+{
+	struct list_head *p;
+	int err = 0, n = 0;
+
+	BT_DBG("");
+
+	down_read(&hidp_session_sem);
+
+	list_for_each(p, &hidp_session_list) {
+		struct hidp_session *session;
+		struct hidp_conninfo ci;
+
+		session = list_entry(p, struct hidp_session, list);
+
+		__hidp_copy_session(session, &ci);
+
+		if (copy_to_user(req->ci, &ci, sizeof(ci))) {
+			err = -EFAULT;
+			break;
+		}
+
+		if (++n >= req->cnum)
+			break;
+
+		req->ci++;
+	}
+	req->cnum = n;
+
+	up_read(&hidp_session_sem);
+	return err;
+}
+
+int hidp_get_conninfo(struct hidp_conninfo *ci)
+{
+	struct hidp_session *session;
+	int err = 0;
+
+	down_read(&hidp_session_sem);
+
+	session = __hidp_get_session(&ci->bdaddr);
+	if (session)
+		__hidp_copy_session(session, ci);
+	else
+		err = -ENOENT;
+
+	up_read(&hidp_session_sem);
+	return err;
+}
+
+static int __init hidp_init(void)
+{
+	l2cap_load();
+
+	hidp_init_sockets();
+
+	BT_INFO("BlueZ HIDP ver %s", VERSION);
+	BT_INFO("Copyright (C) 2003-2004 Marcel Holtmann <marcel@holtmann.org>");
+
+	return 0;
+}
+
+static void __exit hidp_exit(void)
+{
+	hidp_cleanup_sockets();
+}
+
+module_init(hidp_init);
+module_exit(hidp_exit);
+
+MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
+MODULE_DESCRIPTION("Bluetooth HIDP ver " VERSION);
+MODULE_LICENSE("GPL");
===== net/bluetooth/hidp/hidp.h 1.1 vs edited =====
--- 1.1/net/bluetooth/hidp/hidp.h	2004-07-16 11:24:21 +02:00
+++ edited/net/bluetooth/hidp/hidp.h	2004-07-16 11:29:15 +02:00
@@ -0,0 +1,122 @@
+/* 
+   HIDP implementation for Linux Bluetooth stack (BlueZ).
+   Copyright (C) 2003-2004 Marcel Holtmann <marcel@holtmann.org>
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License version 2 as
+   published by the Free Software Foundation;
+
+   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
+   IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
+   CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 
+   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 
+   ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 
+   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+   ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 
+   COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 
+   SOFTWARE IS DISCLAIMED.
+*/
+
+#ifndef __HIDP_H
+#define __HIDP_H
+
+#include <linux/types.h>
+#include <net/bluetooth/bluetooth.h>
+
+/* HIDP ioctl defines */
+#define HIDPCONNADD	_IOW('H', 200, int)
+#define HIDPCONNDEL	_IOW('H', 201, int)
+#define HIDPGETCONNLIST	_IOR('H', 210, int)
+#define HIDPGETCONNINFO	_IOR('H', 211, int)
+
+#define HIDP_VIRTUAL_CABLE_UNPLUG	0
+#define HIDP_BOOT_PROTOCOL_MODE		1
+#define HIDP_BLUETOOTH_VENDOR_ID	9
+
+struct hidp_connadd_req {
+	int   ctrl_sock;	// Connected control socket
+	int   intr_sock;	// Connteted interrupt socket
+	__u16 parser;
+	__u16 rd_size;
+	__u8 *rd_data;
+	__u8  country;
+	__u8  subclass;
+	__u16 vendor;
+	__u16 product;
+	__u16 version;
+	__u32 flags;
+	__u32 idle_to;
+	char  name[128];
+};
+
+struct hidp_conndel_req {
+	bdaddr_t bdaddr;
+	__u32    flags;
+};
+
+struct hidp_conninfo {
+	bdaddr_t bdaddr;
+	__u32    flags;
+	__u16    state;
+	__u16    vendor;
+	__u16    product;
+	__u16    version;
+	char     name[128];
+};
+
+struct hidp_connlist_req {
+	__u32  cnum;
+	struct hidp_conninfo __user *ci;
+};
+
+int hidp_add_connection(struct hidp_connadd_req *req, struct socket *ctrl_sock, struct socket *intr_sock);
+int hidp_del_connection(struct hidp_conndel_req *req);
+int hidp_get_connlist(struct hidp_connlist_req *req);
+int hidp_get_conninfo(struct hidp_conninfo *ci);
+
+/* HIDP session defines */
+struct hidp_session {
+	struct list_head list;
+
+	struct socket *ctrl_sock;
+	struct socket *intr_sock;
+
+	bdaddr_t bdaddr;
+
+	unsigned long state;
+	unsigned long flags;
+	unsigned long idle_to;
+
+	uint ctrl_mtu;
+	uint intr_mtu;
+
+	atomic_t terminate;
+
+	unsigned char keys[8];
+	unsigned char leds;
+
+	struct input_dev *input;
+
+	struct timer_list timer;
+
+	struct sk_buff_head ctrl_transmit;
+	struct sk_buff_head intr_transmit;
+};
+
+static inline void hidp_schedule(struct hidp_session *session)
+{
+	struct sock *ctrl_sk = session->ctrl_sock->sk;
+	struct sock *intr_sk = session->intr_sock->sk;
+
+	wake_up_interruptible(ctrl_sk->sleep);
+	wake_up_interruptible(intr_sk->sleep);
+}
+
+/* HIDP init defines */
+extern int __init hidp_init_sockets(void);
+extern void __exit hidp_cleanup_sockets(void);
+
+#endif /* __HIDP_H */
===== net/bluetooth/hidp/sock.c 1.1 vs edited =====
--- 1.1/net/bluetooth/hidp/sock.c	2004-07-15 21:00:42 +02:00
+++ edited/net/bluetooth/hidp/sock.c	2004-07-16 12:12:48 +02:00
@@ -0,0 +1,212 @@
+/* 
+   HIDP implementation for Linux Bluetooth stack (BlueZ).
+   Copyright (C) 2003-2004 Marcel Holtmann <marcel@holtmann.org>
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License version 2 as
+   published by the Free Software Foundation;
+
+   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
+   IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
+   CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 
+   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 
+   ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 
+   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+   ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 
+   COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 
+   SOFTWARE IS DISCLAIMED.
+*/
+
+#include <linux/config.h>
+#include <linux/module.h>
+
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/kernel.h>
+#include <linux/major.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <linux/poll.h>
+#include <linux/fcntl.h>
+#include <linux/skbuff.h>
+#include <linux/socket.h>
+#include <linux/ioctl.h>
+#include <linux/file.h>
+#include <linux/init.h>
+#include <net/sock.h>
+
+#include "hidp.h"
+
+#ifndef CONFIG_BT_HIDP_DEBUG
+#undef  BT_DBG
+#define BT_DBG(D...)
+#endif
+
+static int hidp_sock_release(struct socket *sock)
+{
+	struct sock *sk = sock->sk;
+
+	BT_DBG("sock %p sk %p", sock, sk);
+
+	if (!sk)
+		return 0;
+
+	sock_orphan(sk);
+	sock_put(sk);
+
+	MOD_DEC_USE_COUNT;
+	return 0;
+}
+
+static int hidp_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
+{
+	struct hidp_connadd_req ca;
+	struct hidp_conndel_req cd;
+	struct hidp_connlist_req cl;
+	struct hidp_conninfo ci;
+	struct socket *csock;
+	struct socket *isock;
+	int err;
+
+	BT_DBG("cmd %x arg %lx", cmd, arg);
+
+	switch (cmd) {
+	case HIDPCONNADD:
+		if (!capable(CAP_NET_ADMIN))
+			return -EACCES;
+
+		if (copy_from_user(&ca, (void *) arg, sizeof(ca)))
+			return -EFAULT;
+
+		csock = sockfd_lookup(ca.ctrl_sock, &err);
+		if (!csock)
+			return err;
+
+		isock = sockfd_lookup(ca.intr_sock, &err);
+		if (!isock) {
+			fput(csock->file);
+			return err;
+		}
+
+		if (csock->sk->state != BT_CONNECTED || isock->sk->state != BT_CONNECTED) {
+			fput(csock->file);
+			fput(isock->file);
+			return -EBADFD;
+		}
+
+		err = hidp_add_connection(&ca, csock, isock);
+		if (!err) {
+			if (copy_to_user((void *) arg, &ca, sizeof(ca)))
+				err = -EFAULT;
+		} else {
+			fput(csock->file);
+			fput(isock->file);
+		}
+
+		return err;
+
+	case HIDPCONNDEL:
+		if (!capable(CAP_NET_ADMIN))
+			return -EACCES;
+
+		if (copy_from_user(&cd, (void *) arg, sizeof(cd)))
+			return -EFAULT;
+
+		return hidp_del_connection(&cd);
+
+	case HIDPGETCONNLIST:
+		if (copy_from_user(&cl, (void *) arg, sizeof(cl)))
+			return -EFAULT;
+
+		if (cl.cnum <= 0)
+			return -EINVAL;
+
+		err = hidp_get_connlist(&cl);
+		if (!err && copy_to_user((void *) arg, &cl, sizeof(cl)))
+			return -EFAULT;
+
+		return err;
+
+	case HIDPGETCONNINFO:
+		if (copy_from_user(&ci, (void *) arg, sizeof(ci)))
+			return -EFAULT;
+
+		err = hidp_get_conninfo(&ci);
+		if (!err && copy_to_user((void *) arg, &ci, sizeof(ci)))
+			return -EFAULT;
+
+		return err;
+	}
+
+	return -EINVAL;
+}
+
+static struct proto_ops hidp_sock_ops = {
+	family:		PF_BLUETOOTH,
+	release:	hidp_sock_release,
+	ioctl:		hidp_sock_ioctl,
+	bind:		sock_no_bind,
+	getname:	sock_no_getname,
+	sendmsg:	sock_no_sendmsg,
+	recvmsg:	sock_no_recvmsg,
+	poll:		sock_no_poll,
+	listen:		sock_no_listen,
+	shutdown:	sock_no_shutdown,
+	setsockopt:	sock_no_setsockopt,
+	getsockopt:	sock_no_getsockopt,
+	connect:	sock_no_connect,
+	socketpair:	sock_no_socketpair,
+	accept:		sock_no_accept,
+	mmap:		sock_no_mmap
+};
+
+static int hidp_sock_create(struct socket *sock, int protocol)
+{
+	struct sock *sk;
+
+	BT_DBG("sock %p", sock);
+
+	if (sock->type != SOCK_RAW)
+		return -ESOCKTNOSUPPORT;
+
+	sock->ops = &hidp_sock_ops;
+
+	if (!(sk = sk_alloc(PF_BLUETOOTH, GFP_KERNEL, 1)))
+		return -ENOMEM;
+
+	MOD_INC_USE_COUNT;
+
+	sock->state = SS_UNCONNECTED;
+	sock_init_data(sock, sk);
+
+	sk->destruct = NULL;
+	sk->protocol = protocol;
+
+	return 0;
+}
+
+static struct net_proto_family hidp_sock_family_ops = {
+	family:		PF_BLUETOOTH,
+	create:		hidp_sock_create
+};
+
+int __init hidp_init_sockets(void)
+{
+	int err;
+
+	if ((err = bluez_sock_register(BTPROTO_HIDP, &hidp_sock_family_ops)))
+		BT_ERR("Can't register HIDP socket layer (%d)", err);
+
+	return err;
+}
+
+void __exit hidp_cleanup_sockets(void)
+{
+	int err;
+
+	if ((err = bluez_sock_unregister(BTPROTO_HIDP)))
+		BT_ERR("Can't unregister HIDP socket layer (%d)", err);
+}

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Bluez-devel] HIDP backport for 2.4
  2004-07-17  8:58 [Bluez-devel] HIDP backport for 2.4 Marcel Holtmann
@ 2004-07-25 12:52 ` Marcel Holtmann
  2004-07-25 16:57   ` Michael Frey
  2004-07-26 17:24   ` Michael Frey
  0 siblings, 2 replies; 22+ messages in thread
From: Marcel Holtmann @ 2004-07-25 12:52 UTC (permalink / raw)
  To: BlueZ Mailing List

Hi again,

> attached is a backport patch of the HIDP support from 2.6.8-rc1 for the
> 2.4 kernel series. I didn't tested this patch with any of my systems. I
> only know that it compiles clean. So test this with the hidd daemon from
> the bluez-utils-2.8 package.

I got no feedback on the HIDP patch for the 2.4 kernel series. Should I
assume that there is no interest in it?

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Bluez-devel] HIDP backport for 2.4
  2004-07-25 12:52 ` Marcel Holtmann
@ 2004-07-25 16:57   ` Michael Frey
  2004-07-26 17:24   ` Michael Frey
  1 sibling, 0 replies; 22+ messages in thread
From: Michael Frey @ 2004-07-25 16:57 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: BlueZ Mailing List

Marcel,

I am interested.  However I have not had time to apply and test the 
patch.

Michael

On Jul 25, 2004, at 8:52 AM, Marcel Holtmann wrote:

> Hi again,
>
>> attached is a backport patch of the HIDP support from 2.6.8-rc1 for 
>> the
>> 2.4 kernel series. I didn't tested this patch with any of my systems. 
>> I
>> only know that it compiles clean. So test this with the hidd daemon 
>> from
>> the bluez-utils-2.8 package.
>
> I got no feedback on the HIDP patch for the 2.4 kernel series. Should I
> assume that there is no interest in it?
>
> Regards
>
> Marcel
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by BEA Weblogic Workshop
> FREE Java Enterprise J2EE developer tools!
> Get your free copy of BEA WebLogic Workshop 8.1 today.
> http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Bluez-devel] HIDP backport for 2.4
  2004-07-25 12:52 ` Marcel Holtmann
  2004-07-25 16:57   ` Michael Frey
@ 2004-07-26 17:24   ` Michael Frey
  2004-07-26 17:47     ` Marcel Holtmann
  1 sibling, 1 reply; 22+ messages in thread
From: Michael Frey @ 2004-07-26 17:24 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: BlueZ Mailing List

Marcel,

I get the following build errors.  I am using MontaVista Linux 2.4.20

In file included from core.c:46:
hidp.h:72: warning: no semicolon at end of struct or union
hidp.h:72: error: parse error before '*' token
core.c: In function `hidp_session':
core.c:344: error: structure has no member named `nice'
core.c: In function `hidp_get_connlist':
core.c:598: error: dereferencing pointer to incomplete type
core.c:603: error: dereferencing pointer to incomplete type
core.c:606: error: dereferencing pointer to incomplete type
core.c:608: error: dereferencing pointer to incomplete type

Any ideas?

Michael

On Jul 25, 2004, at 8:52 AM, Marcel Holtmann wrote:

> Hi again,
>
>> attached is a backport patch of the HIDP support from 2.6.8-rc1 for 
>> the
>> 2.4 kernel series. I didn't tested this patch with any of my systems. 
>> I
>> only know that it compiles clean. So test this with the hidd daemon 
>> from
>> the bluez-utils-2.8 package.
>
> I got no feedback on the HIDP patch for the 2.4 kernel series. Should I
> assume that there is no interest in it?
>
> Regards
>
> Marcel
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by BEA Weblogic Workshop
> FREE Java Enterprise J2EE developer tools!
> Get your free copy of BEA WebLogic Workshop 8.1 today.
> http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Bluez-devel] HIDP backport for 2.4
  2004-07-26 17:24   ` Michael Frey
@ 2004-07-26 17:47     ` Marcel Holtmann
  2004-07-26 18:05       ` Michael Frey
  0 siblings, 1 reply; 22+ messages in thread
From: Marcel Holtmann @ 2004-07-26 17:47 UTC (permalink / raw)
  To: Michael Frey; +Cc: BlueZ Mailing List

Hi Michael,

> I get the following build errors.  I am using MontaVista Linux 2.4.20
> 
> In file included from core.c:46:
> hidp.h:72: warning: no semicolon at end of struct or union
> hidp.h:72: error: parse error before '*' token

this one is easy. Remove the __user from that line. It is only useful in
a 2.6 kernel.

> core.c: In function `hidp_session':
> core.c:344: error: structure has no member named `nice'

Remove that line and try again. Maybe the MontaVista kernel has a
special backport.

> core.c: In function `hidp_get_connlist':
> core.c:598: error: dereferencing pointer to incomplete type
> core.c:603: error: dereferencing pointer to incomplete type
> core.c:606: error: dereferencing pointer to incomplete type
> core.c:608: error: dereferencing pointer to incomplete type

These are related to error number one.

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Bluez-devel] HIDP backport for 2.4
  2004-07-26 17:47     ` Marcel Holtmann
@ 2004-07-26 18:05       ` Michael Frey
  2004-07-26 18:16         ` Marcel Holtmann
  0 siblings, 1 reply; 22+ messages in thread
From: Michael Frey @ 2004-07-26 18:05 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: BlueZ Mailing List

Marcel,

ok -- got past those -- now here are some more.

sock.c: In function `hidp_sock_ioctl':
sock.c:84: warning: implicit declaration of function `sockfd_lookup'
sock.c:84: warning: assignment makes pointer from integer without a cast
sock.c:88: warning: assignment makes pointer from integer without a cast
sock.c: In function `hidp_init_sockets':
sock.c:200: error: `BTPROTO_HIDP' undeclared (first use in this 
function)
sock.c:200: error: (Each undeclared identifier is reported only once
sock.c:200: error: for each function it appears in.)
sock.c: In function `hidp_cleanup_sockets':
sock.c:210: error: `BTPROTO_HIDP' undeclared (first use in this 
function)
make[3]: *** [sock.o] Error 1


Michael

On Jul 26, 2004, at 1:47 PM, Marcel Holtmann wrote:

> Hi Michael,
>
>> I get the following build errors.  I am using MontaVista Linux 2.4.20
>>
>> In file included from core.c:46:
>> hidp.h:72: warning: no semicolon at end of struct or union
>> hidp.h:72: error: parse error before '*' token
>
> this one is easy. Remove the __user from that line. It is only useful 
> in
> a 2.6 kernel.
>
>> core.c: In function `hidp_session':
>> core.c:344: error: structure has no member named `nice'
>
> Remove that line and try again. Maybe the MontaVista kernel has a
> special backport.
>
>> core.c: In function `hidp_get_connlist':
>> core.c:598: error: dereferencing pointer to incomplete type
>> core.c:603: error: dereferencing pointer to incomplete type
>> core.c:606: error: dereferencing pointer to incomplete type
>> core.c:608: error: dereferencing pointer to incomplete type
>
> These are related to error number one.
>
> Regards
>
> Marcel
>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Bluez-devel] HIDP backport for 2.4
  2004-07-26 18:05       ` Michael Frey
@ 2004-07-26 18:16         ` Marcel Holtmann
  2004-07-26 18:49           ` Michael Frey
  0 siblings, 1 reply; 22+ messages in thread
From: Marcel Holtmann @ 2004-07-26 18:16 UTC (permalink / raw)
  To: Michael Frey; +Cc: BlueZ Mailing List

Hi Michael,

> ok -- got past those -- now here are some more.

your kernel is a little bit outdated ;)

> sock.c: In function `hidp_sock_ioctl':
> sock.c:84: warning: implicit declaration of function `sockfd_lookup'
> sock.c:84: warning: assignment makes pointer from integer without a cast
> sock.c:88: warning: assignment makes pointer from integer without a cast

Copy sockfd_lookup() from net/bluetooth/bnep/core.c

> sock.c: In function `hidp_init_sockets':
> sock.c:200: error: `BTPROTO_HIDP' undeclared (first use in this 
> function)
> sock.c:200: error: (Each undeclared identifier is reported only once
> sock.c:200: error: for each function it appears in.)
> sock.c: In function `hidp_cleanup_sockets':
> sock.c:210: error: `BTPROTO_HIDP' undeclared (first use in this 
> function)
> make[3]: *** [sock.o] Error 1

Here is a patch for that problem. It is already in the mainline tree.

diff -Nru a/include/net/bluetooth/bluetooth.h
b/include/net/bluetooth/bluetooth.h
--- a/include/net/bluetooth/bluetooth.h 2004-07-26 20:15:15 +02:00
+++ b/include/net/bluetooth/bluetooth.h 2004-07-26 20:15:15 +02:00
@@ -52,6 +52,7 @@
 #define BTPROTO_RFCOMM 3
 #define BTPROTO_BNEP   4
 #define BTPROTO_CMTP   5
+#define BTPROTO_HIDP   6
 
 #define SOL_HCI     0
 #define SOL_L2CAP   6
diff -Nru a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c
--- a/net/bluetooth/af_bluetooth.c      2004-07-26 20:15:15 +02:00
+++ b/net/bluetooth/af_bluetooth.c      2004-07-26 20:15:15 +02:00
@@ -57,7 +57,7 @@
 #endif
 
 /* Bluetooth sockets */
-#define BLUEZ_MAX_PROTO        6
+#define BLUEZ_MAX_PROTO        7
 static struct net_proto_family *bluez_proto[BLUEZ_MAX_PROTO];
 
 int bluez_sock_register(int proto, struct net_proto_family *ops)

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Bluez-devel] HIDP backport for 2.4
  2004-07-26 18:16         ` Marcel Holtmann
@ 2004-07-26 18:49           ` Michael Frey
  2004-07-26 21:01             ` Marcel Holtmann
  0 siblings, 1 reply; 22+ messages in thread
From: Michael Frey @ 2004-07-26 18:49 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: BlueZ Mailing List

Marcel,

Thanks for the help.  However I do not have sockfd_lookup()  in 
net/bluetooth/bnep/core.c
Am I that out of date?  Is there a more recent patch I should apply?

Michael


On Jul 26, 2004, at 2:16 PM, Marcel Holtmann wrote:

> Hi Michael,
>
>> ok -- got past those -- now here are some more.
>
> your kernel is a little bit outdated ;)
>
>> sock.c: In function `hidp_sock_ioctl':
>> sock.c:84: warning: implicit declaration of function `sockfd_lookup'
>> sock.c:84: warning: assignment makes pointer from integer without a 
>> cast
>> sock.c:88: warning: assignment makes pointer from integer without a 
>> cast
>
> Copy sockfd_lookup() from net/bluetooth/bnep/core.c
>
>> sock.c: In function `hidp_init_sockets':
>> sock.c:200: error: `BTPROTO_HIDP' undeclared (first use in this
>> function)
>> sock.c:200: error: (Each undeclared identifier is reported only once
>> sock.c:200: error: for each function it appears in.)
>> sock.c: In function `hidp_cleanup_sockets':
>> sock.c:210: error: `BTPROTO_HIDP' undeclared (first use in this
>> function)
>> make[3]: *** [sock.o] Error 1
>
> Here is a patch for that problem. It is already in the mainline tree.
>
> diff -Nru a/include/net/bluetooth/bluetooth.h
> b/include/net/bluetooth/bluetooth.h
> --- a/include/net/bluetooth/bluetooth.h 2004-07-26 20:15:15 +02:00
> +++ b/include/net/bluetooth/bluetooth.h 2004-07-26 20:15:15 +02:00
> @@ -52,6 +52,7 @@
>  #define BTPROTO_RFCOMM 3
>  #define BTPROTO_BNEP   4
>  #define BTPROTO_CMTP   5
> +#define BTPROTO_HIDP   6
>
>  #define SOL_HCI     0
>  #define SOL_L2CAP   6
> diff -Nru a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c
> --- a/net/bluetooth/af_bluetooth.c      2004-07-26 20:15:15 +02:00
> +++ b/net/bluetooth/af_bluetooth.c      2004-07-26 20:15:15 +02:00
> @@ -57,7 +57,7 @@
>  #endif
>
>  /* Bluetooth sockets */
> -#define BLUEZ_MAX_PROTO        6
> +#define BLUEZ_MAX_PROTO        7
>  static struct net_proto_family *bluez_proto[BLUEZ_MAX_PROTO];
>
>  int bluez_sock_register(int proto, struct net_proto_family *ops)
>
> Regards
>
> Marcel
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by BEA Weblogic Workshop
> FREE Java Enterprise J2EE developer tools!
> Get your free copy of BEA WebLogic Workshop 8.1 today.
> http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Bluez-devel] HIDP backport for 2.4
  2004-07-26 18:49           ` Michael Frey
@ 2004-07-26 21:01             ` Marcel Holtmann
  2004-07-27  0:31               ` Michael Frey
  0 siblings, 1 reply; 22+ messages in thread
From: Marcel Holtmann @ 2004-07-26 21:01 UTC (permalink / raw)
  To: Michael Frey; +Cc: BlueZ Mailing List

Hi Michael,

> Thanks for the help.  However I do not have sockfd_lookup()  in 
> net/bluetooth/bnep/core.c

it should be present in any 2.4.20 kernel.

> Am I that out of date?  Is there a more recent patch I should apply?

Your kernel is out of date, because I made the patch against the latest
2.4.27-rc3. Take another kernel source and simply copy that function.

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Bluez-devel] HIDP backport for 2.4
  2004-07-26 21:01             ` Marcel Holtmann
@ 2004-07-27  0:31               ` Michael Frey
  2004-07-27  8:18                 ` Marcel Holtmann
  0 siblings, 1 reply; 22+ messages in thread
From: Michael Frey @ 2004-07-27  0:31 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: BlueZ Mailing List

Marcel,

ok, got it working.  However -- when typing fast on my keyboard I get 
incorrect characters.  This does not happen when using bthid.  Also,  
my mouse does not work,  where using bthid it does.

How should I go about debugging this?

Michael

On Jul 26, 2004, at 5:01 PM, Marcel Holtmann wrote:

> Hi Michael,
>
>> Thanks for the help.  However I do not have sockfd_lookup()  in
>> net/bluetooth/bnep/core.c
>
> it should be present in any 2.4.20 kernel.
>
>> Am I that out of date?  Is there a more recent patch I should apply?
>
> Your kernel is out of date, because I made the patch against the latest
> 2.4.27-rc3. Take another kernel source and simply copy that function.
>
> Regards
>
> Marcel
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by BEA Weblogic Workshop
> FREE Java Enterprise J2EE developer tools!
> Get your free copy of BEA WebLogic Workshop 8.1 today.
> http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Bluez-devel] HIDP backport for 2.4
  2004-07-27  0:31               ` Michael Frey
@ 2004-07-27  8:18                 ` Marcel Holtmann
  2004-07-27 14:53                   ` Michael Frey
  0 siblings, 1 reply; 22+ messages in thread
From: Marcel Holtmann @ 2004-07-27  8:18 UTC (permalink / raw)
  To: Michael Frey; +Cc: BlueZ Mailing List

Hi Michael,

> ok, got it working.  However -- when typing fast on my keyboard I get 
> incorrect characters.  This does not happen when using bthid.  Also,  
> my mouse does not work,  where using bthid it does.

try to add

	input_event(dev, EV_RST, 0, 0); 

at the end of hidp_input_report() and see if this helps out for your
keyboard and mouse problems. What do "hidd -l" say after you have
connected the devices? What devices do you use?

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Bluez-devel] HIDP backport for 2.4
  2004-07-27  8:18                 ` Marcel Holtmann
@ 2004-07-27 14:53                   ` Michael Frey
  2004-07-27 15:01                     ` Marcel Holtmann
  0 siblings, 1 reply; 22+ messages in thread
From: Michael Frey @ 2004-07-27 14:53 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: BlueZ Mailing List


On Jul 27, 2004, at 4:18 AM, Marcel Holtmann wrote:

> Hi Michael,
>
>> ok, got it working.  However -- when typing fast on my keyboard I get
>> incorrect characters.  This does not happen when using bthid.  Also,
>> my mouse does not work,  where using bthid it does.
>
> try to add
>
> 	input_event(dev, EV_RST, 0, 0);
This seems to help with the incorrect characters.  But still no mouse.

>
> at the end of hidp_input_report() and see if this helps out for your
> keyboard and mouse problems. What do "hidd -l" say after you have
> connected the devices? What devices do you use?

root@(none):~# hidd -l
00:02:72:40:8A:97 HID Boot Device [0000:0000] connected

I am using a Keyboard with integrated mouse.  So I guess it is 
technically one device.  The mouse is a track ball embedded in the 
keyboard.  The keyboard is made by BlueLogic.

Michael
>
> Regards
>
> Marcel
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by BEA Weblogic Workshop
> FREE Java Enterprise J2EE developer tools!
> Get your free copy of BEA WebLogic Workshop 8.1 today.
> http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Bluez-devel] HIDP backport for 2.4
  2004-07-27 14:53                   ` Michael Frey
@ 2004-07-27 15:01                     ` Marcel Holtmann
  2004-07-27 15:14                       ` Michael Frey
  0 siblings, 1 reply; 22+ messages in thread
From: Marcel Holtmann @ 2004-07-27 15:01 UTC (permalink / raw)
  To: Michael Frey; +Cc: BlueZ Mailing List

Hi Michael,

> > at the end of hidp_input_report() and see if this helps out for your
> > keyboard and mouse problems. What do "hidd -l" say after you have
> > connected the devices? What devices do you use?
> 
> root@(none):~# hidd -l
> 00:02:72:40:8A:97 HID Boot Device [0000:0000] connected
> 
> I am using a Keyboard with integrated mouse.  So I guess it is 
> technically one device.  The mouse is a track ball embedded in the 
> keyboard.  The keyboard is made by BlueLogic.

you should have said this earlier. Do you have a website for me? I need
more information about this device. Please use sdptest from libs2 CVS
repository to get the SDP record.

	./sdptest records 00:xx:xx:xx:xx:xx > sdp_record.txt

Send me that file. I also need the information from "hcitool inq" and
from "hcitool info" for that device.

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Bluez-devel] HIDP backport for 2.4
  2004-07-27 15:01                     ` Marcel Holtmann
@ 2004-07-27 15:14                       ` Michael Frey
  2004-07-27 15:24                         ` Marcel Holtmann
  0 siblings, 1 reply; 22+ messages in thread
From: Michael Frey @ 2004-07-27 15:14 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: BlueZ Mailing List

[-- Attachment #1: Type: text/plain, Size: 988 bytes --]

Marcel,

Here we go:

root@(none):/usr/bin# hcitool inq
Inquiring ...
         00:02:72:40:8A:97       clock offset: 0x4a58    class: 0x002540

root@(none):/usr/bin# hcitool info 00:02:72:40:8A:97
Requesting information ...
bcsp_timed_event: Timeout, retransmitting 1 pkts
         BD Address:  00:02:72:40:8A:97
         Device Name: BlueLogic Keyboard
         LMP Version: 1.1 (0x1) LMP Subversion: 0x1a5
         Manufacturer: Cambridge Silicon Radio (10)
         Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
                 <3-slot packets> <5-slot packets> <encryption> <slot 
offset>
                 <timing accuracy> <role switch> <hold mode> <sniff mode>
                 <park state> <RSSI> <channel quality> <SCO link> <HV2 
packets>
                 <HV3 packets> <u-law log> <A-law log> <CVSD> <paging 
scheme>
                 <power control> <transparent SCO>


The website is http://www.bluelogic.co.kr/main_eng.php

I have attached the sdp records file.

Michael

[-- Attachment #2: sdp_records.txt --]
[-- Type: text/plain, Size: 2007 bytes --]

Sequence
	Attribute 0x0000 - Service record handle
		UINT32 0x00010000
	Attribute 0x0001 - Service class ID list
		Sequence
			UUID16 0x1124 - Human Interface Device Service
	Attribute 0x0004 - Protocol descriptor list
		Sequence
			Sequence
				UUID16 0x0100 - L2CAP
				UINT16 0x0011
			Sequence
				UUID16 0x0011 - HIDP
	Attribute 0x0006 - Language base attribute ID list
		Sequence
			UINT16 0x656e
			UINT16 0x006a
			UINT16 0x0100
	Attribute 0x0009 - Bluetooth profile descriptor list
		Sequence
			Sequence
				UUID16 0x0011 - HIDP
				UINT16 0x0100
	Attribute 0x000d - Additional protocol descriptor lists
		Sequence
			Sequence
				UUID16 0x0100 - L2CAP
				UINT16 0x0013
			Sequence
				UUID16 0x0011 - HIDP
	Attribute 0x0200
		UINT16 0x0100
	Attribute 0x0201
		UINT16 0x0111
	Attribute 0x0202
		UINT8 0x40
	Attribute 0x0203
		UINT8 0x21
	Attribute 0x0204
		Bool True
	Attribute 0x0205
		Bool True
	Attribute 0x0206
		Sequence
			Sequence
				UINT8 0x22
				String 05 01 09 06 a1 01 85 01 05 07 19 e0 29 e7 15 00 25 01 75 01 95 08 81 02 95 01 75 08 81 01 95 05 75 01 05 08 19 01 29 05 91 02 95 01 75 03 91 01 95 05 75 08 15 00 25 65 05 07 19 00 29 ff 81 00 c0 05 01 09 02 a1 01 85 02 09 01 a1 00 05 09 19 01 29 03 15 00 25 01 95 03 75 01 81 02 95 01 75 05 81 01 05 01 09 30 09 31 09 38 15 81 25 7f 95 03 75 08 81 06 c0 c0 05 0c 09 01 a1 01 85 03 15 00 25 01 09 e9 09 ea 75 01 95 02 81 02 95 06 81 01 c0 05 01 09 80 a1 01 85 04 19 81 29 83 15 00 25 01 75 01 95 03 81 02 75 05 95 01 81 01 c0 05 0c 09 01 a1 01 85 05 95 08 75 01 15 00 25 01 0a 93 01 0a cd 00 0a b7 00 0a e2 00 0a ea 00 0a e9 00 0a 2a 02 0a 23 02 81 02 05 0c 0a 27 02 0a 8a 01 0a 26 02 15 00 25 01 95 03 75 01 81 02 95 05 75 01 81 01 c0
	Attribute 0x0207
		Sequence
			Sequence
				UINT16 0x0309
				UINT16 0x0100
	Attribute 0x0208
		Bool False
	Attribute 0x0209
		Bool True
	Attribute 0x020a
		Bool True
	Attribute 0x020b
		UINT16 0x0100
	Attribute 0x020c
		UINT16 0x1f40
	Attribute 0x020d
		Bool False
	Attribute 0x020e
		Bool True

[-- Attachment #3: Type: text/plain, Size: 923 bytes --]



On Jul 27, 2004, at 11:01 AM, Marcel Holtmann wrote:

> Hi Michael,
>
>>> at the end of hidp_input_report() and see if this helps out for your
>>> keyboard and mouse problems. What do "hidd -l" say after you have
>>> connected the devices? What devices do you use?
>>
>> root@(none):~# hidd -l
>> 00:02:72:40:8A:97 HID Boot Device [0000:0000] connected
>>
>> I am using a Keyboard with integrated mouse.  So I guess it is
>> technically one device.  The mouse is a track ball embedded in the
>> keyboard.  The keyboard is made by BlueLogic.
>
> you should have said this earlier. Do you have a website for me? I need
> more information about this device. Please use sdptest from libs2 CVS
> repository to get the SDP record.
>
> 	./sdptest records 00:xx:xx:xx:xx:xx > sdp_record.txt
>
> Send me that file. I also need the information from "hcitool inq" and
> from "hcitool info" for that device.
>
> Regards
>
> Marcel
>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Bluez-devel] HIDP backport for 2.4
  2004-07-27 15:14                       ` Michael Frey
@ 2004-07-27 15:24                         ` Marcel Holtmann
       [not found]                           ` <86089F56-DFE5-11D8-BE76-00039390D626@pepper.com>
  0 siblings, 1 reply; 22+ messages in thread
From: Marcel Holtmann @ 2004-07-27 15:24 UTC (permalink / raw)
  To: Michael Frey; +Cc: BlueZ Mailing List

Hi Michael,

> root@(none):/usr/bin# hcitool inq
> Inquiring ...
>          00:02:72:40:8A:97       clock offset: 0x4a58    class: 0x002540

the subclass value is 0x40 which means that this is only a keyboard. The
problem can be that they really only support the keyboard in boot mode
or that they simply set the subclass value wrong. If the kernel things
that this is only a keyboard it don't creates a mouse device. Try this
patch for the hidd to tell the kernel it is also a mouse:

RCS file: /cvsroot/bluez/utils/hidd/sdp.c,v
retrieving revision 1.4
diff -u -r1.4 sdp.c
--- hidd/sdp.c  4 Jul 2004 15:41:53 -0000       1.4
+++ hidd/sdp.c  27 Jul 2004 15:17:34 -0000
@@ -126,6 +126,7 @@
 
        pdlist = sdp_data_get(rec, 0x0202);
        req->subclass = pdlist ? pdlist->val.uint8 : 0;
+       req->subclass = 0x40 | 0x80;
 
        pdlist = sdp_data_get(rec, 0x0203);
        req->country = pdlist ? pdlist->val.uint8 : 0;

To check what is really going on run "hcidump -x" as root and use the
mouse.

Do you ever checked if 2.6.7-mh2 is working for you?

> The website is http://www.bluelogic.co.kr/main_eng.php

Will anyone buy one of these for me so I get one for testing?

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Bluez-devel] HIDP backport for 2.4
       [not found]                           ` <86089F56-DFE5-11D8-BE76-00039390D626@pepper.com>
@ 2004-08-01 15:57                             ` Marcel Holtmann
  2004-08-11 21:19                               ` Michael Frey
  0 siblings, 1 reply; 22+ messages in thread
From: Marcel Holtmann @ 2004-08-01 15:57 UTC (permalink / raw)
  To: Michael Frey; +Cc: BlueZ Mailing List

Hi Michael,

> That worked..  I can now use both mouse and keyboard.
> 
> You asked if I tried 2.6.7-mh2.  I assume you mean the back-ported 
> patch?  If so, that is what I am using.

I've now put out another bunch of -mh patches for the 2.4 series. They
include all updates and also the HIDP support. May you wanna try them
out. Besides this the hidd from bluez-utils-2.9 got an extra option
--subclass for overriding the subclass value.

Regards

Marcel




-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Bluez-devel] HIDP backport for 2.4
  2004-08-01 15:57                             ` Marcel Holtmann
@ 2004-08-11 21:19                               ` Michael Frey
  2004-08-11 22:11                                 ` Marcel Holtmann
  0 siblings, 1 reply; 22+ messages in thread
From: Michael Frey @ 2004-08-11 21:19 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: BlueZ Mailing List

Marcel,

OK -- I am using the new patches and all is well except for one thing.  
My keyboard seems to not be able to re-connect after it goes to sleep 
about 5 times.  It is almost like connections are left open and the 
hidd server does not allow the keyboard to re-connect.

The only way I get it back is to restart hidd.

Any ideas?

Michael

On Aug 1, 2004, at 11:57 AM, Marcel Holtmann wrote:

> Hi Michael,
>
>> That worked..  I can now use both mouse and keyboard.
>>
>> You asked if I tried 2.6.7-mh2.  I assume you mean the back-ported
>> patch?  If so, that is what I am using.
>
> I've now put out another bunch of -mh patches for the 2.4 series. They
> include all updates and also the HIDP support. May you wanna try them
> out. Besides this the hidd from bluez-utils-2.9 got an extra option
> --subclass for overriding the subclass value.
>
> Regards
>
> Marcel
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by OSTG. Have you noticed the changes on
> Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
> one more big change to announce. We are now OSTG- Open Source 
> Technology
> Group. Come see the changes on the new OSTG site. www.ostg.com
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Bluez-devel] HIDP backport for 2.4
  2004-08-11 21:19                               ` Michael Frey
@ 2004-08-11 22:11                                 ` Marcel Holtmann
  2004-08-13 17:27                                   ` Michael Frey
  0 siblings, 1 reply; 22+ messages in thread
From: Marcel Holtmann @ 2004-08-11 22:11 UTC (permalink / raw)
  To: Michael Frey; +Cc: BlueZ Mailing List

Hi Michael,

> OK -- I am using the new patches and all is well except for one thing.  
> My keyboard seems to not be able to re-connect after it goes to sleep 
> about 5 times.  It is almost like connections are left open and the 
> hidd server does not allow the keyboard to re-connect.
> 
> The only way I get it back is to restart hidd.

this sounds very weird. Please run "hcidump -x" as root and show it to
us. What is the content of /proc/bluetooth/l2cap at that time? Do
"hcitool con" show any connections?

Regards

Marcel




-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Bluez-devel] HIDP backport for 2.4
  2004-08-11 22:11                                 ` Marcel Holtmann
@ 2004-08-13 17:27                                   ` Michael Frey
  2004-08-13 17:53                                     ` Marcel Holtmann
  0 siblings, 1 reply; 22+ messages in thread
From: Michael Frey @ 2004-08-13 17:27 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: BlueZ Mailing List

Marcel,

I now see what is going on.  I checked the system log and found these 
messages when the problem occurs.
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
bcsp_handle_le_pkt: Found a LE sync pkt, card has reset

What exactly does this mean?

Michael

On Aug 11, 2004, at 6:11 PM, Marcel Holtmann wrote:

> Hi Michael,
>
>> OK -- I am using the new patches and all is well except for one thing.
>> My keyboard seems to not be able to re-connect after it goes to sleep
>> about 5 times.  It is almost like connections are left open and the
>> hidd server does not allow the keyboard to re-connect.
>>
>> The only way I get it back is to restart hidd.
>
> this sounds very weird. Please run "hcidump -x" as root and show it to
> us. What is the content of /proc/bluetooth/l2cap at that time? Do
> "hcitool con" show any connections?
>
> Regards
>
> Marcel
>
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
> 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
> Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
> http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Bluez-devel] HIDP backport for 2.4
  2004-08-13 17:27                                   ` Michael Frey
@ 2004-08-13 17:53                                     ` Marcel Holtmann
  2004-08-13 18:16                                       ` Michael Frey
  0 siblings, 1 reply; 22+ messages in thread
From: Marcel Holtmann @ 2004-08-13 17:53 UTC (permalink / raw)
  To: Michael Frey; +Cc: BlueZ Mailing List

Hi Michael,

> I now see what is going on.  I checked the system log and found these 
> messages when the problem occurs.
> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
> 
> What exactly does this mean?

this is part of the BCSP host transport driver. Maybe your serial port
is a little bit buggy or something else. I don't know. What kernel are
you using? Is there a previous that is still working without any
troubles?

Regards

Marcel




-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Bluez-devel] HIDP backport for 2.4
  2004-08-13 17:53                                     ` Marcel Holtmann
@ 2004-08-13 18:16                                       ` Michael Frey
  2004-08-13 18:21                                         ` Marcel Holtmann
  0 siblings, 1 reply; 22+ messages in thread
From: Michael Frey @ 2004-08-13 18:16 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: BlueZ Mailing List

Marcel,

Can you explain to me the difference between CSR mode and bcsp?  I have 
a CSR bluetooth module but have never been able to run in CSR mode.  
What could be the reason for this?

Michael

On Aug 13, 2004, at 1:53 PM, Marcel Holtmann wrote:

> Hi Michael,
>
>> I now see what is going on.  I checked the system log and found these
>> messages when the problem occurs.
>> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
>> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
>> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
>> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
>> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
>> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
>> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
>> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
>> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
>> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
>> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
>> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
>> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
>> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
>> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
>> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
>> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
>> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
>> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
>> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
>> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
>> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
>> bcsp_handle_le_pkt: Found a LE sync pkt, card has reset
>>
>> What exactly does this mean?
>
> this is part of the BCSP host transport driver. Maybe your serial port
> is a little bit buggy or something else. I don't know. What kernel are
> you using? Is there a previous that is still working without any
> troubles?
>
> Regards
>
> Marcel
>
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
> 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
> Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
> http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [Bluez-devel] HIDP backport for 2.4
  2004-08-13 18:16                                       ` Michael Frey
@ 2004-08-13 18:21                                         ` Marcel Holtmann
  0 siblings, 0 replies; 22+ messages in thread
From: Marcel Holtmann @ 2004-08-13 18:21 UTC (permalink / raw)
  To: Michael Frey; +Cc: BlueZ Mailing List

Hi Michael,

> Can you explain to me the difference between CSR mode and bcsp?  I have 
> a CSR bluetooth module but have never been able to run in CSR mode.  
> What could be the reason for this?

the CSR chips can work in H4 or BCSP mode over UART depending on the
settings of some specific PS keys. Both are host transport protocols for
the HCI layer. Check the CSR documention from your vendor or the mailing
list archive for more information.

Regards

Marcel




-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2004-08-13 18:21 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-17  8:58 [Bluez-devel] HIDP backport for 2.4 Marcel Holtmann
2004-07-25 12:52 ` Marcel Holtmann
2004-07-25 16:57   ` Michael Frey
2004-07-26 17:24   ` Michael Frey
2004-07-26 17:47     ` Marcel Holtmann
2004-07-26 18:05       ` Michael Frey
2004-07-26 18:16         ` Marcel Holtmann
2004-07-26 18:49           ` Michael Frey
2004-07-26 21:01             ` Marcel Holtmann
2004-07-27  0:31               ` Michael Frey
2004-07-27  8:18                 ` Marcel Holtmann
2004-07-27 14:53                   ` Michael Frey
2004-07-27 15:01                     ` Marcel Holtmann
2004-07-27 15:14                       ` Michael Frey
2004-07-27 15:24                         ` Marcel Holtmann
     [not found]                           ` <86089F56-DFE5-11D8-BE76-00039390D626@pepper.com>
2004-08-01 15:57                             ` Marcel Holtmann
2004-08-11 21:19                               ` Michael Frey
2004-08-11 22:11                                 ` Marcel Holtmann
2004-08-13 17:27                                   ` Michael Frey
2004-08-13 17:53                                     ` Marcel Holtmann
2004-08-13 18:16                                       ` Michael Frey
2004-08-13 18:21                                         ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).