summaryrefslogtreecommitdiffstats
path: root/input
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-05-29 03:58:10 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-05-29 03:58:10 +0000
commit6de268e32d69d08a9cf50c41f4a3ee67ade3ec99 (patch)
tree3f021eda890caebf8c82e8198659644cfe74b92f /input
parenteb5c0bd71f2e1c427ce197f9c94ab9540d305922 (diff)
Don't set MTU value to 48
Diffstat (limited to 'input')
-rw-r--r--input/device.c12
-rw-r--r--input/device.h9
2 files changed, 12 insertions, 9 deletions
diff --git a/input/device.c b/input/device.c
index d85aae55..1310b7fb 100644
--- a/input/device.c
+++ b/input/device.c
@@ -797,7 +797,6 @@ static DBusHandlerResult device_connect(DBusConnection *conn,
/* HID devices */
if (l2cap_connect(&idev->src, &idev->dst, L2CAP_PSM_HIDP_CTRL,
(GIOFunc) control_connect_cb, idev) < 0) {
-
int err = errno;
error("L2CAP connect failed: %s(%d)", strerror(err), err);
@@ -1087,14 +1086,16 @@ int input_device_get_bdaddr(DBusConnection *conn, const char *path,
return 0;
}
-int l2cap_connect(bdaddr_t *src, bdaddr_t *dst, unsigned short psm, GIOFunc cb, void *data)
+int l2cap_connect(bdaddr_t *src, bdaddr_t *dst, unsigned short psm,
+ GIOFunc cb, void *data)
{
GIOChannel *io;
struct sockaddr_l2 addr;
struct l2cap_options opts;
int sk, err;
- if ((sk = socket(PF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP)) < 0)
+ sk = socket(PF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP);
+ if (sk < 0)
return -1;
memset(&addr, 0, sizeof(addr));
@@ -1108,12 +1109,14 @@ int l2cap_connect(bdaddr_t *src, bdaddr_t *dst, unsigned short psm, GIOFunc cb,
goto failed;
memset(&opts, 0, sizeof(opts));
+#if 0
opts.imtu = HIDP_DEFAULT_MTU;
opts.omtu = HIDP_DEFAULT_MTU;
opts.flush_to = 0xffff;
if (setsockopt(sk, SOL_L2CAP, L2CAP_OPTIONS, &opts, sizeof(opts)) < 0)
goto failed;
+#endif
memset(&addr, 0, sizeof(addr));
addr.l2_family = AF_BLUETOOTH;
@@ -1131,9 +1134,8 @@ int l2cap_connect(bdaddr_t *src, bdaddr_t *dst, unsigned short psm, GIOFunc cb,
g_io_add_watch(io, G_IO_OUT | G_IO_ERR | G_IO_HUP | G_IO_NVAL,
(GIOFunc) cb, data);
- } else {
+ } else
cb(io, G_IO_OUT, data);
- }
g_io_channel_unref(io);
diff --git a/input/device.h b/input/device.h
index b3316841..5501d3b9 100644
--- a/input/device.h
+++ b/input/device.h
@@ -20,11 +20,12 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
-#define L2CAP_PSM_HIDP_CTRL 0x11
-#define L2CAP_PSM_HIDP_INTR 0x13
+
+#define L2CAP_PSM_HIDP_CTRL 0x11
+#define L2CAP_PSM_HIDP_INTR 0x13
int input_device_register(DBusConnection *conn, bdaddr_t *src, bdaddr_t *dst,
- struct hidp_connadd_req *hidp, const char **ppath);
+ struct hidp_connadd_req *hidp, const char **ppath);
int fake_input_register(DBusConnection *conn, bdaddr_t *src,
bdaddr_t *dst, uint8_t ch, const char **ppath);
int input_device_unregister(DBusConnection *conn, const char *path);
@@ -32,4 +33,4 @@ int input_device_unregister(DBusConnection *conn, const char *path);
int input_device_get_bdaddr(DBusConnection *conn, const char *path,
bdaddr_t *src, bdaddr_t *dst);
int l2cap_connect(bdaddr_t *src, bdaddr_t *dst,
- unsigned short psm, GIOFunc cb, void *data);
+ unsigned short psm, GIOFunc cb, void *data);