linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* L2CAP unknown options
@ 2010-07-27  9:07 Ville Tervo
  2010-07-28  3:32 ` Gustavo F. Padovan
  2010-07-28  4:16 ` L2CAP unknown options Gustavo F. Padovan
  0 siblings, 2 replies; 14+ messages in thread
From: Ville Tervo @ 2010-07-27  9:07 UTC (permalink / raw)
  To: linux-bluetooth@vger.kernel.org; +Cc: Gustavo F. Padovan

Hi,

I found following problem with bluetooth-next-2.6.

Kernel disconnects if remote device replies with "unknown options" 
result code. I guess in that case a new config req should be sent 
without unknown option. I didn't check the spec yet.

The remote device is Nokia 9300.

2010-07-27 11:44:07.364827 < ACL data: handle 11 flags 0x02 dlen 10
     L2CAP(s): Info req: type 2
2010-07-27 11:44:07.365337 < HCI Command: Remote Name Request 
(0x01|0x0019) plen 10
     bdaddr 00:12:37:F0:F1:77 mode 2 clkoffset 0x0000
2010-07-27 11:44:07.367793 > HCI Event: Command Status (0x0f) plen 4
     Remote Name Request (0x01|0x0019) status 0x00 ncmd 1
2010-07-27 11:44:07.384797 > HCI Event: Max Slots Change (0x1b) plen 3
     handle 11 slots 5
2010-07-27 11:44:07.406820 > ACL data: handle 11 flags 0x02 dlen 12
     L2CAP(s): Info rsp: type 2 result 1
       Not supported
2010-07-27 11:44:07.406849 < ACL data: handle 11 flags 0x02 dlen 12
     L2CAP(s): Connect req: psm 1 scid 0x0040
2010-07-27 11:44:07.431790 > HCI Event: Remote Name Req Complete (0x07) 
plen 255
     status 0x00 bdaddr 00:12:37:F0:F1:77 name 'vt-m'
2010-07-27 11:44:07.433780 > HCI Event: Number of Completed Packets 
(0x13) plen 5
     handle 11 packets 2
2010-07-27 11:44:07.474801 > ACL data: handle 11 flags 0x02 dlen 16
     L2CAP(s): Connect rsp: dcid 0x0042 scid 0x0040 result 1 status 2
       Connection pending - Authorization pending
2010-07-27 11:44:07.668818 > ACL data: handle 11 flags 0x02 dlen 16
     L2CAP(s): Connect rsp: dcid 0x0042 scid 0x0040 result 0 status 0
       Connection successful
2010-07-27 11:44:07.668851 < ACL data: handle 11 flags 0x02 dlen 23
     L2CAP(s): Config req: dcid 0x0042 flags 0x00 clen 11
       RFC 0x00 (Basic)
2010-07-27 11:44:07.669814 > ACL data: handle 11 flags 0x02 dlen 12
     L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 0
2010-07-27 11:44:07.669840 < ACL data: handle 11 flags 0x02 dlen 18
     L2CAP(s): Config rsp: scid 0x0042 flags 0x00 result 0 clen 4
       MTU 672
2010-07-27 11:44:07.675794 > HCI Event: Number of Completed Packets 
(0x13) plen 5
     handle 11 packets 2
2010-07-27 11:44:07.682822 > ACL data: handle 11 flags 0x02 dlen 19
     L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 3 clen 5
       Failure - unknown options
       RFC QoS 0f 00 42
2010-07-27 11:44:07.682843 < ACL data: handle 11 flags 0x02 dlen 12
     L2CAP(s): Disconn req: dcid 0x0042 scid 0x0040
2010-07-27 11:44:07.693823 > ACL data: handle 11 flags 0x02 dlen 12
     L2CAP(s): Disconn rsp: dcid 0x0042 scid 0x0040

^ permalink raw reply	[flat|nested] 14+ messages in thread
* [PATCH] Bluetooth: Don't send RFC for Basic Mode if only it is supported
@ 2010-08-04  2:49 Gustavo F. Padovan
  2010-08-04 14:27 ` Marcel Holtmann
  0 siblings, 1 reply; 14+ messages in thread
From: Gustavo F. Padovan @ 2010-08-04  2:49 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: marcel, Gustavo F. Padovan

From: Gustavo F. Padovan <padovan@profusion.mobi>

If the remote side doesn't support Enhanced Retransmission Mode neither
Streaming Mode, we shall not send the RFC option.
Some devices that only supports Basic Mode do not understanding the RFC
option. This patch fix the regression found with that devices.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
---
 net/bluetooth/l2cap.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 9ba1e8e..0f34e12 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -2527,6 +2527,10 @@ done:
 		if (pi->imtu != L2CAP_DEFAULT_MTU)
 			l2cap_add_conf_opt(&ptr, L2CAP_CONF_MTU, 2, pi->imtu);
 
+		if (!(pi->conn->feat_mask & L2CAP_FEAT_ERTM) &&
+				!(pi->conn->feat_mask & L2CAP_FEAT_STREAMING))
+			break;
+
 		rfc.mode            = L2CAP_MODE_BASIC;
 		rfc.txwin_size      = 0;
 		rfc.max_transmit    = 0;
@@ -2534,6 +2538,8 @@ done:
 		rfc.monitor_timeout = 0;
 		rfc.max_pdu_size    = 0;
 
+		l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC, sizeof(rfc),
+							(unsigned long) &rfc);
 		break;
 
 	case L2CAP_MODE_ERTM:
@@ -2546,6 +2552,9 @@ done:
 		if (L2CAP_DEFAULT_MAX_PDU_SIZE > pi->conn->mtu - 10)
 			rfc.max_pdu_size = cpu_to_le16(pi->conn->mtu - 10);
 
+		l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC, sizeof(rfc),
+							(unsigned long) &rfc);
+
 		if (!(pi->conn->feat_mask & L2CAP_FEAT_FCS))
 			break;
 
@@ -2566,6 +2575,9 @@ done:
 		if (L2CAP_DEFAULT_MAX_PDU_SIZE > pi->conn->mtu - 10)
 			rfc.max_pdu_size = cpu_to_le16(pi->conn->mtu - 10);
 
+		l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC, sizeof(rfc),
+							(unsigned long) &rfc);
+
 		if (!(pi->conn->feat_mask & L2CAP_FEAT_FCS))
 			break;
 
@@ -2577,9 +2589,6 @@ done:
 		break;
 	}
 
-	l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC, sizeof(rfc),
-						(unsigned long) &rfc);
-
 	/* FIXME: Need actual value of the flush timeout */
 	//if (flush_to != L2CAP_DEFAULT_FLUSH_TO)
 	//   l2cap_add_conf_opt(&ptr, L2CAP_CONF_FLUSH_TO, 2, pi->flush_to);
-- 
1.7.1.1


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

end of thread, other threads:[~2010-08-04 14:27 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-27  9:07 L2CAP unknown options Ville Tervo
2010-07-28  3:32 ` Gustavo F. Padovan
2010-07-28  7:11   ` [PATCH] Bluetooth: Resend ConfigReq on unknown options failure Gustavo F. Padovan
2010-07-28  7:16     ` Gustavo F. Padovan
2010-07-28 12:21       ` Ville Tervo
2010-07-29 18:00         ` [PATCH] Bluetooth: Don't send RFC for Basic Mode if only it is supported Gustavo F. Padovan
2010-07-29 18:04           ` Gustavo F. Padovan
2010-07-30 13:13           ` Ville Tervo
2010-07-31 22:41             ` Gustavo F. Padovan
2010-08-04  1:56               ` Marcel Holtmann
2010-08-04  6:18                 ` Ville Tervo
2010-07-28  4:16 ` L2CAP unknown options Gustavo F. Padovan
  -- strict thread matches above, loose matches on Subject: below --
2010-08-04  2:49 [PATCH] Bluetooth: Don't send RFC for Basic Mode if only it is supported Gustavo F. Padovan
2010-08-04 14:27 ` 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).