Skip to contentSkip to conversation

Bluetooth: Add support for setting SSP debug mode

PATCH In review Marcel Holtmann 2 participants 2 messages Oct 19, 2013

Subsystems (2)
lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH v2 1/3 Bluetooth: Add support for setting SSP debug mode

Enabling and disabling SSP debug mode is useful for development. This adds a debugfs entry that allows to configure the SSP debug mode.

On purpose this has been implemented as debugfs entry and not a public API since it is really only useful during testing and development.

---
 include/net/bluetooth/hci.h      |  2 ++
 include/net/bluetooth/hci_core.h |  1 +
 net/bluetooth/hci_core.c         | 54 +++++++++++++++++++++++++++++++++++++++-
 net/bluetooth/hci_event.c        |  2 ++
 4 files changed, 58 insertions(+), 1 deletion(-)
include/net/bluetooth/hci.h +2 -0
index 77a971a..ac9c4a7 100644
@@ -1043,6 +1043,8 @@ struct hci_rp_write_remote_amp_assoc {
 	__u8     phy_handle;
 } __packed;
 
+#define HCI_OP_WRITE_SSP_DEBUG_MODE	0x1804
+
 #define HCI_OP_LE_SET_EVENT_MASK	0x2001
 struct hci_cp_le_set_event_mask {
 	__u8     mask[8];
include/net/bluetooth/hci_core.h +1 -0
index c689bcf..d50cc7a 100644
@@ -169,6 +169,7 @@ struct hci_dev {
 	__u8		page_scan_type;
 	__u16		le_scan_interval;
 	__u16		le_scan_window;
+	__u8		ssp_debug_mode;
 
 	__u16		devid_source;
 	__u16		devid_vendor;
net/bluetooth/hci_core.c +53 -1

68 lines not on this page · raw message

net/bluetooth/hci_event.c +2 -0
index 1214d4b..5935f74 100644
@@ -198,6 +198,8 @@ static void hci_cc_reset(struct hci_dev *hdev, struct sk_buff *skb)
 
 	memset(hdev->scan_rsp_data, 0, sizeof(hdev->scan_rsp_data));
 	hdev->scan_rsp_data_len = 0;
+
+	hdev->ssp_debug_mode = 0;
 }
 
 static void hci_cc_write_local_name(struct hci_dev *hdev, struct sk_buff *skb)
Signature · 1 line
1.8.3.1
#1 lore raw

Hi Marcel,

Quoted 6 lines · Marcel Holtmann

Enabling and disabling SSP debug mode is useful for development. This adds a debugfs entry that allows to configure the SSP debug mode.

On purpose this has been implemented as debugfs entry and not a public API since it is really only useful during testing and development.

Quoted 7 lines
---
 include/net/bluetooth/hci.h      |  2 ++
 include/net/bluetooth/hci_core.h |  1 +
 net/bluetooth/hci_core.c         | 54 +++++++++++++++++++++++++++++++++++++++-
 net/bluetooth/hci_event.c        |  2 ++
 4 files changed, 58 insertions(+), 1 deletion(-)

All three patches have been applied to bluetooth-next. Thanks.

Johan