public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] [BLUETOOTH] Disable incoming connection tracking in DUT mode
@ 2008-09-25  7:59 Ville Tervo
  2008-09-27  5:29 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Ville Tervo @ 2008-09-25  7:59 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Ville Tervo

Bluetooth testers establish only low level connection and they won't
connect to any service. If connection tracking is enabled the connection
will drop in 10 seconds. This patch adds support for detecting DUT mode
event and disables incoming connection tracking is status code was
succesfull.

Signed-off-by: Ville Tervo <ville.tervo@nokia.com>
---
 include/net/bluetooth/hci.h      |    7 +++++++
 include/net/bluetooth/hci_core.h |    3 +++
 net/bluetooth/hci_event.c        |   12 ++++++++++++
 3 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 3cc2949..1279788 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -72,6 +72,8 @@ enum {
 	HCI_INQUIRY,
 
 	HCI_RAW,
+
+	HCI_DUT_MODE,
 };
 
 /* HCI ioctl defines */
@@ -577,6 +579,11 @@ struct hci_rp_read_bd_addr {
 	bdaddr_t bdaddr;
 } __attribute__ ((packed));
 
+#define HCI_OP_ENABLE_DUT_MODE		0x1803
+struct hci_rp_enable_dut_mode {
+	__u8	status;
+} __attribute__ ((packed));
+
 /* ---- HCI Events ---- */
 #define HCI_EV_INQUIRY_COMPLETE		0x01
 
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 46a43b7..019cd93 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -355,6 +355,9 @@ static inline void hci_conn_put(struct hci_conn *conn)
 				timeo = msecs_to_jiffies(10);
 		} else
 			timeo = msecs_to_jiffies(10);
+
+		if (test_bit(HCI_DUT_MODE, &conn->hdev->flags) && !conn->out)
+			return;
 		mod_timer(&conn->disc_timer, jiffies + timeo);
 	}
 }
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index ad7a553..f2227d0 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -535,6 +535,14 @@ static void hci_cc_read_bd_addr(struct hci_dev *hdev, struct sk_buff *skb)
 	hci_req_complete(hdev, rp->status);
 }
 
+static void hci_cc_enable_dut_mode(struct hci_dev *hdev, struct sk_buff *skb)
+{
+	struct hci_rp_enable_dut_mode *rp = (void *) skb->data;
+
+	if (!rp->status)
+		set_bit(HCI_DUT_MODE, &hdev->flags);
+}
+
 static inline void hci_cs_inquiry(struct hci_dev *hdev, __u8 status)
 {
 	BT_DBG("%s status 0x%x", hdev->name, status);
@@ -1294,6 +1302,10 @@ static inline void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *sk
 		hci_cc_read_bd_addr(hdev, skb);
 		break;
 
+	case HCI_OP_ENABLE_DUT_MODE:
+		hci_cc_enable_dut_mode(hdev, skb);
+		break;
+
 	default:
 		BT_DBG("%s opcode 0x%x", hdev->name, opcode);
 		break;
-- 
1.5.6.3


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

* Re: [PATCH 1/1] [BLUETOOTH] Disable incoming connection tracking in DUT mode
  2008-09-25  7:59 [PATCH 1/1] [BLUETOOTH] Disable incoming connection tracking in DUT mode Ville Tervo
@ 2008-09-27  5:29 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2008-09-27  5:29 UTC (permalink / raw)
  To: Ville Tervo; +Cc: linux-bluetooth

Hi Ville,

> Bluetooth testers establish only low level connection and they won't
> connect to any service. If connection tracking is enabled the connection
> will drop in 10 seconds. This patch adds support for detecting DUT mode
> event and disables incoming connection tracking is status code was
> succesfull.

I think we should just put the device into RAW mode. Having another flag
for DUT is not useful and RAW mode is already handled special.

Regards

Marcel



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

end of thread, other threads:[~2008-09-27  5:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-25  7:59 [PATCH 1/1] [BLUETOOTH] Disable incoming connection tracking in DUT mode Ville Tervo
2008-09-27  5:29 ` Marcel Holtmann

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