Linux bluetooth development
 help / color / mirror / Atom feed
* Re: [PATCH 1/5] Bluetooth: Only enable for L2CAP FCS for ERTM or streaming
From: Gustavo F. Padovan @ 2010-08-25 17:11 UTC (permalink / raw)
  To: Mat Martineau; +Cc: linux-bluetooth, marcel, gustavo, rshaffer, linux-arm-msm
In-Reply-To: <1282689346-20371-2-git-send-email-mathewm@codeaurora.org>

Hi Mat,

* Mat Martineau <mathewm@codeaurora.org> [2010-08-24 15:35:42 -0700]:

> This fixes a bug which caused the FCS setting to show L2CAP_FCS_CRC16
> with L2CAP modes other than ERTM or streaming.  At present, this only
> affects the FCS value shown with getsockopt() for basic mode.
> 
> Signed-off-by: Mat Martineau <mathewm@codeaurora.org>
> ---
>  net/bluetooth/l2cap.c |   19 +++++++++++++------
>  1 files changed, 13 insertions(+), 6 deletions(-)

This one is on bluetooth-testing, but Marcel should move it to
bluetooth-2.6 as this patch is planned to go into 2.6.36

-- 
Gustavo F. Padovan
ProFUSION embedded systems - http://profusion.mobi

^ permalink raw reply

* Re: [PATCH v2 0/4] Fix error reporting for SDP Requests
From: Johan Hedberg @ 2010-08-25 17:11 UTC (permalink / raw)
  To: Angela Bartholomaus; +Cc: linux-bluetooth, rshaffer, marcel
In-Reply-To: <1282755705-28400-1-git-send-email-angelab@codeaurora.org>

Hi Angela,

On Wed, Aug 25, 2010, Angela Bartholomaus wrote:
> Fixed the following issues revealed while performing bluez qualification: 
> - Incorrect error code was being reported for requests with invalid PDU size;
> - No error was being reported if a request less than 0x07 was received.

Thanks. All four patches have been pushed upstream.

Johan

^ permalink raw reply

* Re: 2.6.36-rc1 on zaurus: bluetooth regression
From: Maciej Rutecki @ 2010-08-25 18:55 UTC (permalink / raw)
  To: Pavel Machek
  Cc: rpurdie, lenz, kernel list, arminlitzel, Cyril Hrubis,
	thommycheck, linux-arm-kernel, dbaryshkov, omegamoon, eric.y.miao,
	utx, zaurus-devel, Rafael J. Wysocki, linux-bluetooth
In-Reply-To: <20100821152445.GA1536@ucw.cz>

On sobota, 21 sierpnia 2010 o 17:24:45 Pavel Machek wrote:
> Hi!
> 
> Good news is that it boots, suspends and resumes.
> 
> Bad news is that bluetooth broke for me. I'm using CF bluetooth
> card.
> 
> Socket 0 Bridge:   	[pxa2xx-pcmcia] 	(bus ID: pxa2xx-pcmcia)
> 	Configuration:	state: on	ready: yes
> 			Voltage: 3.3V Vcc: 3.3V Vpp: 0.0V
> Socket 0 Device 0:	[serial_cs]		(bus ID: 0.0)
> 	Configuration:	state: on
> 	Product Name:   Compact Flash Bluetooth Card
> 	Identification:	manf_id: 0x0279	card_id: 0x950b
> 			function: 2 (serial)
> 			prod_id(1): "Compact Flash" (0x95521410)
> 			prod_id(2): "Bluetooth Card" (0x7664fb1d)
> 			prod_id(3): --- (---)
> 			prod_id(4): --- (---)
> Socket 1 Bridge:   	[pxa2xx-pcmcia] 	(bus ID: pxa2xx-pcmcia)
> 	Configuration:	state: on	ready: yes
> 			Voltage: 3.3V Vcc: 3.3V Vpp: 0.0V
> Socket 1 Device 0:	[ide-cs]		(bus ID: 1.0)
> 	Configuration:	state: on
> 	Product Name:   HITACHI microdrive
> 	Identification:	manf_id: 0x0319	card_id: 0x0000
> 			function: 4 (fixed disk)
> 			prod_id(1): "HITACHI" (0xf4f43949)
> 			prod_id(2): "microdrive" (0xa6d76178)
> 			prod_id(3): --- (---)
> 			prod_id(4): --- (---)
> 
> 
> In 2.6.35, I have lots of messages in the syslog, and speed is slow,
> but it works.
> 
> Aug 19 08:01:06 toy kernel: bcsp_recv: Out-of-order packet arrived, got 3
> expected 2 Aug 19 08:01:06 toy kernel: bcsp_recv: Out-of-order packet
> arrived, got 4 expected 2 Aug 19 08:01:11 toy kernel: bcsp_recv: Short
> BCSP packet
> Aug 19 08:01:11 toy kernel: bcsp_recv: Out-of-order packet arrived, got 3
> expected 2 Aug 19 08:01:11 toy kernel: bcsp_recv: Out-of-order packet
> arrived, got 4 expected 2 Aug 19 08:01:12 toy kernel: bcsp_recv:
> Out-of-order packet arrived, got 5 expected 2 Aug 19 08:01:16 toy kernel:
> bcsp_recv: Short BCSP packet
> Aug 19 08:01:16 toy kernel: bcsp_recv: Out-of-order packet arrived, got 2
> expected 1 Aug 19 08:01:16 toy kernel: bcsp_recv: Out-of-order packet
> arrived, got 3 expected 1 Aug 19 08:01:16 toy kernel: bcsp_recv:
> Out-of-order packet arrived, got 4 expected 1
> 
> In 2.6.36-rc1, I get:
> 
> Aug 20 08:38:27 toy bluetoothd[1318]: HCI dev 0 down
> Aug 20 08:38:27 toy bluetoothd[1318]: Adapter /org/bluez/1318/hci0 has been
> disabled Aug 20 08:38:27 toy bluetoothd[1318]: Stopping security manager 0
> Aug 20 08:38:27 toy kernel: pcmcia_socket pcmcia_socket0: pccard: card
> ejected from slot 0 Aug 20 08:38:27 toy kernel: PM: Removing info for
> pcmcia:0.0
> Aug 20 08:38:27 toy kernel: PM: Removing info for No Bus:ttyS0
> Aug 20 08:38:27 toy bluetoothd[1318]: HCI dev 0 unregistered
> Aug 20 08:38:27 toy bluetoothd[1318]: Unregister path: /org/bluez/1318/hci0
> Aug 20 08:38:27 toy kernel: PM: Removing info for No Bus:hci0
> Aug 20 08:38:27 toy kernel: PM: Adding info for No Bus:ttyS0
> Aug 20 08:38:31 toy kernel: pcmcia_socket pcmcia_socket0: pccard: PCMCIA
> card inserted into slot 0 Aug 20 08:38:31 toy kernel: pcmcia 0.0: pcmcia:
> registering new device pcmcia0.0 (IRQ: 201) Aug 20 08:38:31 toy kernel:
> PM: Adding info for pcmcia:0.0
> Aug 20 08:38:31 toy kernel: PM: Removing info for No Bus:ttyS0
> Aug 20 08:38:31 toy kernel: 0.0: ttyS0 at I/O 0xc48402f8 (irq = 201) is a
> 16C950/954 Aug 20 08:38:31 toy kernel: PM: Adding info for No Bus:ttyS0
> Aug 20 08:38:36 toy bluetoothd[1318]: HCI dev 0 registered
> Aug 20 08:38:36 toy kernel: PM: Adding info for No Bus:hci0
> Aug 20 08:38:36 toy kernel: bcsp_recv: Out-of-order packet arrived, got 1
> expected 0 Aug 20 08:38:37 toy bluetoothd[1318]: accept: Socket operation
> on non-socket (88) Aug 20 08:38:37 toy bluetoothd[1318]: HCI dev 0 up
> Aug 20 08:38:37 toy bluetoothd[1318]: Starting security manager 0
> Aug 20 08:38:37 toy kernel: bcsp_recv: Short BCSP packet
> Aug 20 08:38:39 toy kernel: PM: Removing info for No Bus:rfcomm1
> Aug 20 08:38:39 toy kernel: PM: Adding info for No Bus:rfcomm1
> Aug 20 08:38:40 toy pand[1546]: Bluetooth PAN daemon version 4.66
> Aug 20 08:38:40 toy pand[1546]: Connecting to 00:21:BA:FF:2D:37
> Aug 20 08:38:40 toy kernel: hci_cmd_task: hci0 command tx timeout
> Aug 20 08:38:42 toy bluetoothd[1318]: Can't read version info for
> /org/bluez/1318/hci0: Connection timed out (110) Aug 20 08:38:44 toy
> modprobe: FATAL: Could not load /lib/modules/2.6.36-rc1/modules.dep: No
> such file or directory
> 
> Any ideas?
> 							Pavel


I created a Bugzilla entry at 
https://bugzilla.kernel.org/show_bug.cgi?id=17061
for your bug report, please add your address to the CC list in there, thanks!

-- 
Maciej Rutecki
http://www.maciek.unixy.pl

^ permalink raw reply

* Re: bluetoothd does not check remote names for valid utf8 data
From: Johan Hedberg @ 2010-08-25 21:38 UTC (permalink / raw)
  To: David Vrabel, Marcel Holtmann, linux-bluetooth
In-Reply-To: <20100825150323.GA28680@jh-x301>

Hi again,

On Wed, Aug 25, 2010, Johan Hedberg wrote:
> Good catch. At least the legacy name queries are already protected
> (remote_name_information function in security.c) so I think this is the only
> place missing the UTF-8 validation. However, your patch doesn't compile cleanly
> so some fine tuning is still needed (always check compilation with
> "./bootstrap-configure && make" before sending upstream):
> 
> src/dbus-hci.c: In function ‘extract_eir_name’:
> src/dbus-hci.c:466: error: pointer targets in passing argument 1 of ‘g_utf8_validate’ differ in signedness
> /usr/include/glib-2.0/glib/gunicode.h:356: note: expected ‘const gchar *’ but argument is of type ‘uint8_t *’
> make[1]: *** [src/dbus-hci.o] Error 1

Since this was the only thing blocking a new release I went ahead and
fixed the issue myself. The (fixed) patch is now upstream.

Johan

^ permalink raw reply

* [PATCH 01/22] Add eL2cap signal macro definition
From: haijun liu @ 2010-08-25 22:22 UTC (permalink / raw)
  To: linux-bluetooth

>From 0ce1315590e4bfe0d344acad7e770710833795aa Mon Sep 17 00:00:00 2001
From: haijun <haijun@haijun-laptop.(none)>
Date: Wed, 18 Aug 2010 22:26:19 +0800
Subject: [PATCH 01/22] Add eL2cap signal macro definition.

---
 include/net/bluetooth/l2cap.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 7df70e4..bf0ea10 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -86,6 +86,12 @@ struct l2cap_conninfo {
 #define L2CAP_ECHO_RSP		0x09
 #define L2CAP_INFO_REQ		0x0a
 #define L2CAP_INFO_RSP		0x0b
+#define L2CAP_CREATECHAN_REQ	0x0c
+#define L2CAP_CREATECHAN_RSP	0x0d
+#define L2CAP_MOVECHAN_REQ	0x0e
+#define L2CAP_MOVECHAN_RSP	0x0f
+#define L2CAP_MOVECHAN_CFM	0x10
+#define L2CAP_MOVECHAN_CFM_RSP	0x11

 /* L2CAP feature mask */
 #define L2CAP_FEAT_FLOWCTL	0x00000001
-- 
1.6.3.3

^ permalink raw reply related

* [PATCH 02/22] Add eL2cap new features macro definition
From: haijun liu @ 2010-08-25 22:27 UTC (permalink / raw)
  To: linux-bluetooth

>From fb2a4d17435dbd6d8787e6928c1da4f12a839265 Mon Sep 17 00:00:00 2001
From: haijun.liu <haijun.liu@atheros.com>
Date: Wed, 18 Aug 2010 22:33:22 +0800
Subject: [PATCH 02/22] Add eL2cap new features macro definition.

---
 include/net/bluetooth/l2cap.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index bf0ea10..2e782d0 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -99,7 +99,11 @@ struct l2cap_conninfo {
 #define L2CAP_FEAT_ERTM		0x00000008
 #define L2CAP_FEAT_STREAMING	0x00000010
 #define L2CAP_FEAT_FCS		0x00000020
+#define L2CAP_FEAT_EFS_BREDR	0x00000040
 #define L2CAP_FEAT_FIXED_CHAN	0x00000080
+#define L2CAP_FEAT_EXT_WINSIZE	0x00000100
+#define L2CAP_FEAT_UCDR		0x00000200
+#define L2CAP_FEAT_RESERVED	0x80000000

 /* L2CAP checksum option */
 #define L2CAP_FCS_NONE		0x00
-- 
1.6.3.3

^ permalink raw reply related

* [PATCH 03/22] Add eL2cap fixed channel bitmask definition
From: haijun liu @ 2010-08-25 22:29 UTC (permalink / raw)
  To: linux-bluetooth

>From 7cee9cfecbe626a5671db96c30d4e60b69f0d191 Mon Sep 17 00:00:00 2001
From: haijun.liu <haijun.liu@atheros.com>
Date: Wed, 18 Aug 2010 22:34:56 +0800
Subject: [PATCH 03/22] Add eL2cap fixed channel bitmask definition.

---
 include/net/bluetooth/l2cap.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 2e782d0..39f8118 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -105,6 +105,12 @@ struct l2cap_conninfo {
 #define L2CAP_FEAT_UCDR		0x00000200
 #define L2CAP_FEAT_RESERVED	0x80000000

+/* L2CAP fixed channel bitmask */
+#define L2CAP_FIXCHAN_NULLID	0x01
+#define L2CAP_FIXCHAN_SIG	0x02
+#define L2CAP_FIXCHAN_CL	0x04
+#define L2CAP_FIXCHAN_A2MP	0x08
+
 /* L2CAP checksum option */
 #define L2CAP_FCS_NONE		0x00
 #define L2CAP_FCS_CRC16		0x01
-- 
1.6.3.3

^ permalink raw reply related

* [PATCH 04/22] Add L2CAP_CID_A2MP_CHAN definition, it's fixed channel 3
From: haijun liu @ 2010-08-25 22:30 UTC (permalink / raw)
  To: linux-bluetooth

>From cfa4ccc6baa017ffb3deea50286467de03176632 Mon Sep 17 00:00:00 2001
From: haijun.liu <haijun.liu@atheros.com>
Date: Sun, 22 Aug 2010 23:35:19 +0800
Subject: [PATCH 04/22] Add L2CAP_CID_A2MP_CHAN definition, it's fixed channel 3.

---
 include/net/bluetooth/l2cap.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 39f8118..0d48e61 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -174,6 +174,7 @@ struct l2cap_conn_rsp {
 /* channel indentifier */
 #define L2CAP_CID_SIGNALING	0x0001
 #define L2CAP_CID_CONN_LESS	0x0002
+#define L2CAP_CID_A2MP_CHAN	0x0003
 #define L2CAP_CID_DYN_START	0x0040
 #define L2CAP_CID_DYN_END	0xffff

-- 
1.6.3.3

^ permalink raw reply related

* [PATCH 05/22] Add two new configuration items id of efs&wfs
From: haijun liu @ 2010-08-25 22:31 UTC (permalink / raw)
  To: linux-bluetooth

>From b891acaee7f0b77daa2e3f1ba201c76604bf4594 Mon Sep 17 00:00:00 2001
From: haijun.liu <haijun.liu@atheros.com>
Date: Sun, 22 Aug 2010 23:39:40 +0800
Subject: [PATCH 05/22] Add two new configuration items id of efs&wfs.

---
 include/net/bluetooth/l2cap.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 0d48e61..fe95a63 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -223,6 +223,8 @@ struct l2cap_conf_opt {
 #define L2CAP_CONF_QOS		0x03
 #define L2CAP_CONF_RFC		0x04
 #define L2CAP_CONF_FCS		0x05
+#define L2CAP_CONF_EFS		0x06
+#define L2CAP_CONF_EWS		0x07

 #define L2CAP_CONF_MAX_SIZE	22

-- 
1.6.3.3

^ permalink raw reply related

* [PATCH 06/22] Add two new configuration status definition
From: haijun liu @ 2010-08-25 22:31 UTC (permalink / raw)
  To: linux-bluetooth

>From 8bfa66f68795e697e23cf4efe8fa7d2d135c176c Mon Sep 17 00:00:00 2001
From: haijun.liu <haijun.liu@atheros.com>
Date: Sun, 22 Aug 2010 23:41:02 +0800
Subject: [PATCH 06/22] Add two new configuration status definition.

---
 include/net/bluetooth/l2cap.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index fe95a63..9df9d70 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -207,6 +207,8 @@ struct l2cap_conf_rsp {
 #define L2CAP_CONF_UNACCEPT	0x0001
 #define L2CAP_CONF_REJECT	0x0002
 #define L2CAP_CONF_UNKNOWN	0x0003
+#define L2CAP_CONF_PENDING	0x0004
+#define L2CAP_CONF_FLOWSPEC_REJECT	0x0005

 struct l2cap_conf_opt {
 	__u8       type;
-- 
1.6.3.3

^ permalink raw reply related

* [PATCH 07/22] Add a candidate value definition for flag of configuration response packet
From: haijun liu @ 2010-08-25 22:33 UTC (permalink / raw)
  To: linux-bluetooth

>From 27541871ae9d3a2a510349bae155a63e8adf91f0 Mon Sep 17 00:00:00 2001
From: haijun.liu <haijun.liu@atheros.com>
Date: Sun, 22 Aug 2010 23:46:58 +0800
Subject: [PATCH 07/22] Add a candidate value definition for flag of
configuration response packet.

---
 include/net/bluetooth/l2cap.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 9df9d70..a1931ae 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -210,6 +210,8 @@ struct l2cap_conf_rsp {
 #define L2CAP_CONF_PENDING	0x0004
 #define L2CAP_CONF_FLOWSPEC_REJECT	0x0005

+#define L2CAP_CONF_FLAG_CONT	0x0001
+
 struct l2cap_conf_opt {
 	__u8       type;
 	__u8       len;
-- 
1.6.3.3

^ permalink raw reply related

* [PATCH 08/22] Add struct l2cap_conf_efs for configuration process
From: haijun liu @ 2010-08-25 22:33 UTC (permalink / raw)
  To: linux-bluetooth

>From dc02dc170ea5bc4106e49307e57fafca57afbc9c Mon Sep 17 00:00:00 2001
From: haijun.liu <haijun.liu@atheros.com>
Date: Sun, 22 Aug 2010 23:49:37 +0800
Subject: [PATCH 08/22] Add struct l2cap_conf_efs for configuration process.

---
 include/net/bluetooth/l2cap.h |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index a1931ae..4bbc1ff 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -241,6 +241,15 @@ struct l2cap_conf_rfc {
 	__le16     max_pdu_size;
 } __attribute__ ((packed));

+struct l2cap_conf_efs {
+	__u8       id;
+	__u8       service_type;
+	__le16     max_sdu_size;
+	__le32     sdu_inter_time;
+	__le32     access_latency;
+	__le32     flush_timeout;
+} __attribute__ ((packed));
+
 #define L2CAP_MODE_BASIC	0x00
 #define L2CAP_MODE_RETRANS	0x01
 #define L2CAP_MODE_FLOWCTL	0x02
-- 
1.6.3.3

^ permalink raw reply related

* [PATCH 09/22] Add candidate values for service type
From: haijun liu @ 2010-08-25 22:34 UTC (permalink / raw)
  To: linux-bluetooth

>From 7e080dd0ad217e69b3abd614a981a861febbefa8 Mon Sep 17 00:00:00 2001
From: haijun.liu <haijun.liu@atheros.com>
Date: Sun, 22 Aug 2010 23:50:53 +0800
Subject: [PATCH 09/22] Add candidate values for service type.

---
 include/net/bluetooth/l2cap.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 4bbc1ff..c609e04 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -256,6 +256,10 @@ struct l2cap_conf_efs {
 #define L2CAP_MODE_ERTM		0x03
 #define L2CAP_MODE_STREAMING	0x04

+#define L2CAP_SERVTYPE_NOTRAFIC		0x00
+#define L2CAP_SERVTYPE_BESTEFFORT	0x01
+#define L2CAP_SERVTYPE_GUARANTEED	0x02
+
 struct l2cap_disconn_req {
 	__le16     dcid;
 	__le16     scid;
-- 
1.6.3.3

^ permalink raw reply related

* [PATCH 10/22] Add new configuration states for state machine of configuration
From: haijun liu @ 2010-08-25 22:34 UTC (permalink / raw)
  To: linux-bluetooth

>From bc3e50d857279661e84ddadd4bf99de1290b5601 Mon Sep 17 00:00:00 2001
From: haijun.liu <haijun.liu@atheros.com>
Date: Sun, 22 Aug 2010 23:54:19 +0800
Subject: [PATCH 10/22] Add new configuration states for state machine
of configuration.

---
 include/net/bluetooth/l2cap.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index c609e04..4a18567 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -415,6 +415,10 @@ struct l2cap_pinfo {
 #define L2CAP_CONF_CONNECT_PEND   0x20
 #define L2CAP_CONF_NO_FCS_RECV    0x40
 #define L2CAP_CONF_STATE2_DEVICE  0x80
+#define L2CAP_CONF_LOCAL_PEND		0x100
+#define L2CAP_CONF_REMOTE_PEND		0x200
+#define L2CAP_CONF_EXTFLOWSPEC_DONE	0x400
+#define L2CAP_CONF_EXTWINSIZE_DONE	0x800

 #define L2CAP_CONF_MAX_CONF_REQ 2
 #define L2CAP_CONF_MAX_CONF_RSP 2
-- 
1.6.3.3

^ permalink raw reply related

* [PATCH 11/22] Add two timeout values for configuration process
From: haijun liu @ 2010-08-25 22:35 UTC (permalink / raw)
  To: linux-bluetooth

>From 92a177d2d601c4ed502d3b1f618dfbe3084d01cb Mon Sep 17 00:00:00 2001
From: haijun.liu <haijun.liu@atheros.com>
Date: Sun, 22 Aug 2010 23:55:44 +0800
Subject: [PATCH 11/22] Add two timeout values for configuration process.

---
 include/net/bluetooth/l2cap.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 4a18567..fe411e2 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -38,6 +38,8 @@
 #define L2CAP_LOCAL_BUSY_TRIES		12

 #define L2CAP_CONN_TIMEOUT	(40000) /* 40 seconds */
+#define L2CAP_CONFIG_TIMEOUT	(40000) /* 40 seconds */
+#define L2CAP_PENDING_TIMEOUT	(120000) /* 120 seconds */
 #define L2CAP_INFO_TIMEOUT	(4000)  /*  4 seconds */

 /* L2CAP socket address */
-- 
1.6.3.3

^ permalink raw reply related

* [PATCH 12/22] Add some default values for configuration process
From: haijun liu @ 2010-08-25 22:35 UTC (permalink / raw)
  To: linux-bluetooth

>From 2d21459fa52b754ce0f666ccefc0175bc7f04420 Mon Sep 17 00:00:00 2001
From: haijun.liu <haijun.liu@atheros.com>
Date: Sun, 22 Aug 2010 23:57:09 +0800
Subject: [PATCH 12/22] Add some default values for configuration process.

---
 include/net/bluetooth/l2cap.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index fe411e2..d0ae9f5 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -36,6 +36,11 @@
 #define L2CAP_DEFAULT_MAX_PDU_SIZE	672
 #define L2CAP_DEFAULT_ACK_TO		200
 #define L2CAP_LOCAL_BUSY_TRIES		12
+#define L2CAP_DEFAULT_MAX_SDU_SIZE	0xFFFF
+#define L2CAP_DEFAULT_SDU_ARRIVAL_TIME	0xFFFFFFFF
+#define L2CAP_DEFAULT_FLUSH_TIMEOUT	0xFFFFFFFF
+#define L2CAP_DEFAULT_ACCESS_LATENCY	0xFFFFFFFF
+#define L2CAP_DEFAULT_EXT_WINSIZE	1024

 #define L2CAP_CONN_TIMEOUT	(40000) /* 40 seconds */
 #define L2CAP_CONFIG_TIMEOUT	(40000) /* 40 seconds */
-- 
1.6.3.3

^ permalink raw reply related

* [PATCH 13/22] Add three new options for l2cap_options which used in setsockopt & getsockopt
From: haijun liu @ 2010-08-25 22:36 UTC (permalink / raw)
  To: linux-bluetooth

>From 897b281d14ba4cf9a5fbbf5ba65b84c85e688737 Mon Sep 17 00:00:00 2001
From: haijun.liu <haijun.liu@atheros.com>
Date: Mon, 23 Aug 2010 00:00:26 +0800
Subject: [PATCH 13/22] Add three new options for l2cap_options which
used in setsockopt & getsockopt.

---
 include/net/bluetooth/l2cap.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index d0ae9f5..4f87aec 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -65,6 +65,9 @@ struct l2cap_options {
 	__u8  fcs;
 	__u8  max_tx;
 	__u16 txwin_size;
+	__u8  hschan_req;
+	__u8  guaranteed;
+	__u8  reconfig;
 };

 #define L2CAP_CONNINFO	0x02
-- 
1.6.3.3

^ permalink raw reply related

* [PATCH 14/22] Add three new options for l2cap_pinfo
From: haijun liu @ 2010-08-25 22:36 UTC (permalink / raw)
  To: linux-bluetooth

>From 06124ba36c1f6c9cf5bef861751ce749712cecb0 Mon Sep 17 00:00:00 2001
From: haijun.liu <haijun.liu@atheros.com>
Date: Mon, 23 Aug 2010 00:03:39 +0800
Subject: [PATCH 14/22] Add three new options for l2cap_pinfo.

---
 include/net/bluetooth/l2cap.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 4f87aec..7a9bec4 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -367,6 +367,10 @@ struct l2cap_pinfo {
 	__u8		num_conf_req;
 	__u8		num_conf_rsp;

+	__u8		hschan_req;
+	__u8		guaranteed;
+	__u8		reconfig;
+
 	__u8		fcs;
 	__u8		sec_level;
 	__u8		role_switch;
-- 
1.6.3.3

^ permalink raw reply related

* [PATCH 15/22] Enlarge value scope of conf_state in l2cap_pinfo to hold new states for lock step configuration
From: haijun liu @ 2010-08-25 22:36 UTC (permalink / raw)
  To: linux-bluetooth

>From ff97115044570dae7e88dd665a0e82d6b542da5b Mon Sep 17 00:00:00 2001
From: haijun.liu <haijun.liu@atheros.com>
Date: Mon, 23 Aug 2010 00:05:43 +0800
Subject: [PATCH 15/22] Enlarge value scope of conf_state in
l2cap_pinfo to hold new states for lock step configuration.

---
 include/net/bluetooth/l2cap.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 7a9bec4..2d864d4 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -378,7 +378,7 @@ struct l2cap_pinfo {

 	__u8		conf_req[64];
 	__u8		conf_len;
-	__u8		conf_state;
+	__u16		conf_state;
 	__u16		conn_state;

 	__u8		next_tx_seq;
-- 
1.6.3.3

^ permalink raw reply related

* [PATCH 16/22] Store new configuration values in l2cap_pinfo
From: haijun liu @ 2010-08-25 22:37 UTC (permalink / raw)
  To: linux-bluetooth

>From d093975dde6d85c824a5aaac943d676100810010 Mon Sep 17 00:00:00 2001
From: haijun.liu <haijun.liu@atheros.com>
Date: Mon, 23 Aug 2010 00:09:56 +0800
Subject: [PATCH 16/22] Store new configuration values in l2cap_pinfo.

---
 include/net/bluetooth/l2cap.h |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 2d864d4..f2dd65d 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -406,6 +406,15 @@ struct l2cap_pinfo {
 	__u16		remote_mps;
 	__u16		mps;

+	__u8		ext_flowspec_enable;
+	struct ext_flow_spec	loc_efs;
+	struct ext_flow_spec	rem_efs;
+
+	__u8		extwin_enable;
+	__u16		extwin_size;
+	__u8		rem_extwin_enable;
+	__u16		rem_extwin_size;
+
 	__le16		sport;

 	struct timer_list	retrans_timer;
-- 
1.6.3.3

^ permalink raw reply related

* Add parameter enable_highspeed to control highspeed code in running phase
From: haijun liu @ 2010-08-25 22:37 UTC (permalink / raw)
  To: linux-bluetooth

>From c3fba9b5d7546576d9eb1d30eb45c453c8ee1dff Mon Sep 17 00:00:00 2001
From: haijun.liu <haijun.liu@atheros.com>
Date: Mon, 23 Aug 2010 00:17:24 +0800
Subject: [PATCH 17/22] Add parameter enable_highspeed to control
highspeed code in running phase.

---
 net/bluetooth/l2cap.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 449cbdd..e7f7067 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -4851,6 +4851,9 @@ module_exit(l2cap_exit);
 module_param(enable_ertm, bool, 0644);
 MODULE_PARM_DESC(enable_ertm, "Enable enhanced retransmission mode");

+module_param(enable_highspeed, bool, 0644);
+MODULE_PARM_DESC(enable_highspeed, "Enable Bluetooth V3.0+HS
highspeed feature");
+
 MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
 MODULE_DESCRIPTION("Bluetooth L2CAP ver " VERSION);
 MODULE_VERSION(VERSION);
-- 
1.6.3.3

^ permalink raw reply related

* [PATCH 17/22] Add parameter enable_highspeed to control highspeed code in running phase
From: haijun liu @ 2010-08-25 22:38 UTC (permalink / raw)
  To: linux-bluetooth

>From c3fba9b5d7546576d9eb1d30eb45c453c8ee1dff Mon Sep 17 00:00:00 2001
From: haijun.liu <haijun.liu@atheros.com>
Date: Mon, 23 Aug 2010 00:17:24 +0800
Subject: [PATCH 17/22] Add parameter enable_highspeed to control
highspeed code in running phase.

---
 net/bluetooth/l2cap.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 449cbdd..e7f7067 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -4851,6 +4851,9 @@ module_exit(l2cap_exit);
 module_param(enable_ertm, bool, 0644);
 MODULE_PARM_DESC(enable_ertm, "Enable enhanced retransmission mode");

+module_param(enable_highspeed, bool, 0644);
+MODULE_PARM_DESC(enable_highspeed, "Enable Bluetooth V3.0+HS
highspeed feature");
+
 MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
 MODULE_DESCRIPTION("Bluetooth L2CAP ver " VERSION);
 MODULE_VERSION(VERSION);
-- 
1.6.3.3

^ permalink raw reply related

* [PATCH 18/22] Add physical link status definition
From: haijun liu @ 2010-08-25 22:39 UTC (permalink / raw)
  To: linux-bluetooth

>From 45246346bed4c351f61b6c71002dccaff88be6ac Mon Sep 17 00:00:00 2001
From: haijun.liu <haijun.liu@atheros.com>
Date: Mon, 23 Aug 2010 00:20:59 +0800
Subject: [PATCH 18/22] Add physical link status definition.

---
 include/net/bluetooth/l2cap.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index f2dd65d..f91111c 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -299,6 +299,11 @@ struct l2cap_info_rsp {
 #define L2CAP_IR_SUCCESS    0x0000
 #define L2CAP_IR_NOTSUPP    0x0001

+/* physical link status */
+#define L2CAP_PHYLINK_NOAVL	0x0000
+#define L2CAP_PHYLINK_CREATING	0x0001
+#define L2CAP_PHYLINK_READY	0x0002
+
 /* ----- L2CAP connections ----- */
 struct l2cap_chan_list {
 	struct sock	*head;
-- 
1.6.3.3

^ permalink raw reply related

* [PATCH 19/22] Store physical link status in l2cap_conn
From: haijun liu @ 2010-08-25 22:39 UTC (permalink / raw)
  To: linux-bluetooth

>From df717c32ff5e397dc7860f7ce93b3aa734aeac73 Mon Sep 17 00:00:00 2001
From: haijun.liu <haijun.liu@atheros.com>
Date: Mon, 23 Aug 2010 00:23:32 +0800
Subject: [PATCH 19/22] Store physical link status in l2cap_conn.

---
 include/net/bluetooth/l2cap.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index f91111c..8a544a0 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -336,6 +336,8 @@ struct l2cap_conn {
 	__u8		disc_reason;

 	struct l2cap_chan_list chan_list;
+
+	__u8 phyl_status;
 };

 struct sock_del_list {
-- 
1.6.3.3

^ permalink raw reply related

* [PATCH 20/22] Add EFS & EWS config parameters for ERTM & Streaming modes in l2cap_build_conf_req
From: haijun liu @ 2010-08-25 22:40 UTC (permalink / raw)
  To: linux-bluetooth

>From 74b6581d7fdb0d3e5c0cd9546b15d58357c3758c Mon Sep 17 00:00:00 2001
From: haijun.liu <haijun.liu@atheros.com>
Date: Tue, 24 Aug 2010 15:52:49 +0800
Subject: [PATCH 20/22] Add EFS & EWS config parameters for ERTM &
Streaming modes in l2cap_build_conf_req.

---
 net/bluetooth/l2cap.c |   67 ++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 64 insertions(+), 3 deletions(-)

diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index e7f7067..73142ae 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -2500,6 +2500,7 @@ static int l2cap_build_conf_req(struct sock *sk,
void *data)
 	struct l2cap_pinfo *pi = l2cap_pi(sk);
 	struct l2cap_conf_req *req = data;
 	struct l2cap_conf_rfc rfc = { .mode = pi->mode };
+	struct l2cap_conf_efs efs = { .service_type = L2CAP_SERVTYPE_BESTEFFORT };
 	void *ptr = req->data;

 	BT_DBG("sk %p", sk);
@@ -2510,10 +2511,25 @@ static int l2cap_build_conf_req(struct sock
*sk, void *data)
 	switch (pi->mode) {
 	case L2CAP_MODE_STREAMING:
 	case L2CAP_MODE_ERTM:
-		if (pi->conf_state & L2CAP_CONF_STATE2_DEVICE)
-			break;
+		pi->conf_state |= L2CAP_CONF_STATE2_DEVICE;

-		/* fall through */
+		if (enable_highspeed && pi->hschan_req) {
+			pi->ext_flowspec_enable = 1;
+
+			pi->loc_efs.service_type = (!pi->guaranteed) ?
+				L2CAP_SERVTYPE_BESTEFFORT : L2CAP_SERVTYPE_GUARANTEED;
+			pi->loc_efs.max_sdu_size = L2CAP_DEFAULT_MAX_SDU_SIZE;
+			pi->loc_efs.sdu_inter_time = L2CAP_DEFAULT_SDU_ARRIVAL_TIME;
+			pi->loc_efs.access_latency = L2CAP_DEFAULT_ACCESS_LATENCY;
+			pi->loc_efs.flush_timeout = L2CAP_DEFAULT_FLUSH_TIMEOUT;
+		}
+		if (enable_highspeed && (pi->conn->feat_mask & L2CAP_FEAT_EXT_WINSIZE)) {
+			pi->extwin_enable = 1;
+			pi->extwin_size = L2CAP_DEFAULT_EXT_WINSIZE;
+		}
+		if (!l2cap_mode_supported(pi->mode, pi->conn->feat_mask))
+			l2cap_send_disconn_req(pi->conn, sk, ECONNRESET);
+		break;
 	default:
 		pi->mode = l2cap_select_mode(rfc.mode, pi->conn->feat_mask);
 		break;
@@ -2552,6 +2568,33 @@ done:
 			pi->fcs = L2CAP_FCS_NONE;
 			l2cap_add_conf_opt(&ptr, L2CAP_CONF_FCS, 1, pi->fcs);
 		}
+
+		if (pi->ext_flowspec_enable) {
+			efs.service_type = pi->loc_efs.service_type;
+			efs.max_sdu_size = cpu_to_le16(pi->loc_efs.max_sdu_size);
+			efs.sdu_inter_time = cpu_to_le32(pi->loc_efs.sdu_inter_time);
+			if (pi->loc_efs.service_type == L2CAP_SERVTYPE_BESTEFFORT) {
+				pi->loc_efs.id = 1;
+				efs.id = pi->loc_efs.id;
+				efs.access_latency = cpu_to_le32(0xFFFFFFFF);
+				efs.flush_timeout = cpu_to_le32(0xFFFFFFFF);
+			} else {
+				/* As spec, the ident shall be unique within
+				   the scope of a physical link.
+				*/
+				pi->loc_efs.id = l2cap_flowspec_ident(l2cap_pi(sk)->conn);
+				efs.id = pi->loc_efs.id;
+				efs.access_latency = cpu_to_le32(pi->loc_efs.access_latency);
+				efs.flush_timeout = cpu_to_le32(pi->loc_efs.flush_timeout);
+			}
+			l2cap_add_conf_opt(&ptr, L2CAP_CONF_EFS,
+						sizeof(efs), (unsigned long) &efs);
+		}
+
+		if (pi->extwin_enable) {
+			pi->extwin_size = max_t(__u16, pi->extwin_size, 0x01);
+			l2cap_add_conf_opt(&ptr, L2CAP_CONF_EWS, 4, pi->extwin_size);
+		}
 		break;

 	case L2CAP_MODE_STREAMING:
@@ -2572,6 +2615,24 @@ done:
 			pi->fcs = L2CAP_FCS_NONE;
 			l2cap_add_conf_opt(&ptr, L2CAP_CONF_FCS, 1, pi->fcs);
 		}
+
+		if (pi->ext_flowspec_enable) {
+			efs.id = 1;
+			efs.service_type = L2CAP_SERVTYPE_BESTEFFORT;
+			efs.max_sdu_size = cpu_to_le16(pi->loc_efs.max_sdu_size);
+			efs.sdu_inter_time = cpu_to_le32(pi->loc_efs.sdu_inter_time);
+			efs.access_latency = 0;
+			efs.flush_timeout = 0;
+
+			l2cap_add_conf_opt(&ptr, L2CAP_CONF_EFS,
+						sizeof(efs), (unsigned long) &efs);
+		}
+
+		if (pi->extwin_enable) {
+			pi->extwin_enable = 1;
+			pi->extwin_size = 0;
+			l2cap_add_conf_opt(&ptr, L2CAP_CONF_EWS, 4, pi->extwin_size);
+		}
 		break;
 	}

-- 
1.6.3.3

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox