summaryrefslogtreecommitdiffstats
path: root/input/device.c
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/device.c
parenteb5c0bd71f2e1c427ce197f9c94ab9540d305922 (diff)
Don't set MTU value to 48
Diffstat (limited to 'input/device.c')
-rw-r--r--input/device.c12
1 files changed, 7 insertions, 5 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);