All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/7] Add support for RFCOMM in btmon
@ 2014-10-31 15:08 Gowtham Anandha Babu
  2014-10-31 15:08 ` [PATCH v1 1/7] monitor/rfcomm: Add RFCOMM support to btmon Gowtham Anandha Babu
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Gowtham Anandha Babu @ 2014-10-31 15:08 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: d.kasatkin, bharat.panda, cpgs, Gowtham Anandha Babu

Adds an initial implementation for RFCOMM in Bluetooth monitor.

Implementation for Decoding MSC, RPN, RLS, PN, NSC frames 
will  be covered in the next patch-set.

v1: Added rfcomm.c file in Android.mk

Bharat Panda (2):
  monitor/rfcomm: Add handlers for mcc frame type
  monitor/rfcomm: Add mcc type handlers code

Gowtham Anandha Babu (5):
  monitor/rfcomm: Add RFCOMM support to btmon
  monitor/rfcomm: Add support for RFCOMM commands
  monitor/rfcomm: Add support for UIH frame decoding
  monitor/rfcomm: Add support for mcc frame decoding
  monitor/rfcomm: Add rfcomm file in Android.mk

 Makefile.tools     |   1 +
 android/Android.mk |   1 +
 monitor/l2cap.c    |   4 +
 monitor/l2cap.h    |   1 +
 monitor/rfcomm.c   | 333 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 340 insertions(+)
 create mode 100644 monitor/rfcomm.c

-- 
1.9.1


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

* [PATCH v1 1/7] monitor/rfcomm: Add RFCOMM support to btmon
  2014-10-31 15:08 [PATCH v1 0/7] Add support for RFCOMM in btmon Gowtham Anandha Babu
@ 2014-10-31 15:08 ` Gowtham Anandha Babu
  2014-10-31 15:08 ` [PATCH v1 2/7] monitor/rfcomm: Add support for RFCOMM commands Gowtham Anandha Babu
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Gowtham Anandha Babu @ 2014-10-31 15:08 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: d.kasatkin, bharat.panda, cpgs, Gowtham Anandha Babu

Changes made to add initial code to support RFCOMM frame in btmon.
---
 Makefile.tools   |  1 +
 monitor/l2cap.c  |  4 ++++
 monitor/l2cap.h  |  1 +
 monitor/rfcomm.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 67 insertions(+)
 create mode 100644 monitor/rfcomm.c

diff --git a/Makefile.tools b/Makefile.tools
index 42cccc6..75a6faa 100644
--- a/Makefile.tools
+++ b/Makefile.tools
@@ -26,6 +26,7 @@ monitor_btmon_SOURCES = monitor/main.c monitor/bt.h \
 				monitor/l2cap.h monitor/l2cap.c \
 				monitor/sdp.h monitor/sdp.c \
 				monitor/avctp.h monitor/avctp.c \
+				monitor/rfcomm.h monitor/rfcomm.c \
 				monitor/uuid.h monitor/uuid.c \
 				monitor/hwdb.h monitor/hwdb.c \
 				monitor/keys.h monitor/keys.c \
diff --git a/monitor/l2cap.c b/monitor/l2cap.c
index c004d6b..ebdd20f 100644
--- a/monitor/l2cap.c
+++ b/monitor/l2cap.c
@@ -42,6 +42,7 @@
 #include "keys.h"
 #include "sdp.h"
 #include "avctp.h"
+#include "rfcomm.h"
 
 #define MAX_CHAN 64
 
@@ -2643,6 +2644,9 @@ static void l2cap_frame(uint16_t index, bool in, uint16_t handle,
 		case 0x0001:
 			sdp_packet(&frame);
 			break;
+		case 0x0003:
+			rfcomm_packet(&frame);
+			break;
 		case 0x001f:
 			att_packet(index, in, handle, cid, data, size);
 			break;
diff --git a/monitor/l2cap.h b/monitor/l2cap.h
index 5faaea6..1f70b68 100644
--- a/monitor/l2cap.h
+++ b/monitor/l2cap.h
@@ -153,3 +153,4 @@ static inline bool l2cap_frame_get_le64(struct l2cap_frame *frame,
 
 void l2cap_packet(uint16_t index, bool in, uint16_t handle, uint8_t flags,
 					const void *data, uint16_t size);
+void rfcomm_packet(const struct l2cap_frame *frame);
diff --git a/monitor/rfcomm.c b/monitor/rfcomm.c
new file mode 100644
index 0000000..7d38a28
--- /dev/null
+++ b/monitor/rfcomm.c
@@ -0,0 +1,61 @@
+/*
+ *
+ *  BlueZ - Bluetooth protocol stack for Linux
+ *
+ *  Copyright (C) 2011-2014  Intel Corporation
+ *  Copyright (C) 2002-2010  Marcel Holtmann <marcel@holtmann.org>
+ *
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2.1 of the License, or (at your option) any later version.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <inttypes.h>
+
+#include <bluetooth/bluetooth.h>
+
+#include "src/shared/util.h"
+#include "bt.h"
+#include "packet.h"
+#include "display.h"
+#include "l2cap.h"
+#include "uuid.h"
+#include "keys.h"
+#include "sdp.h"
+#include "rfcomm.h"
+
+const char *opcode_color;
+
+void rfcomm_packet(const struct l2cap_frame *frame)
+{
+	if (frame->in)
+		opcode_color = COLOR_MAGENTA;
+	else
+		opcode_color = COLOR_BLUE;
+
+	print_indent(7, opcode_color, "RFCOMM: ", "", 
+							COLOR_OFF, "");
+
+	packet_hexdump(frame->data, frame->size);
+	return;
+}
-- 
1.9.1


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

* [PATCH v1 2/7] monitor/rfcomm: Add support for RFCOMM commands
  2014-10-31 15:08 [PATCH v1 0/7] Add support for RFCOMM in btmon Gowtham Anandha Babu
  2014-10-31 15:08 ` [PATCH v1 1/7] monitor/rfcomm: Add RFCOMM support to btmon Gowtham Anandha Babu
@ 2014-10-31 15:08 ` Gowtham Anandha Babu
  2014-10-31 15:08 ` [PATCH v1 3/7] monitor/rfcomm: Add support for UIH frame decoding Gowtham Anandha Babu
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Gowtham Anandha Babu @ 2014-10-31 15:08 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: d.kasatkin, bharat.panda, cpgs, Gowtham Anandha Babu

Changes made to decode RFCOMM specific commands in btmon.
---
 monitor/rfcomm.c | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 71 insertions(+), 2 deletions(-)

diff --git a/monitor/rfcomm.c b/monitor/rfcomm.c
index 7d38a28..395a7b8 100644
--- a/monitor/rfcomm.c
+++ b/monitor/rfcomm.c
@@ -44,18 +44,87 @@
 #include "sdp.h"
 #include "rfcomm.h"
 
+#define GET_LEN8(length) ((length & 0xfe) >> 1)
+#define GET_LEN16(length) ((length & 0xfffe) >> 1)
+
+struct rfcomm_lhdr {
+	uint8_t address;
+	uint8_t control;
+	uint16_t length;
+} __attribute__((packed));
+
 const char *opcode_color;
 
+static void print_rfcomm_hdr(const struct l2cap_frame *frame,
+						struct rfcomm_lhdr hdr)
+{
+}
+
+static bool uih_frame(const struct l2cap_frame *frame, struct rfcomm_lhdr hdr)
+{
+	return true;
+}
+
 void rfcomm_packet(const struct l2cap_frame *frame)
 {
+	uint8_t ctr_type, length, ex_length;
+	const char *opcode_str;
+	struct rfcomm_lhdr hdr;
+	struct l2cap_frame rfcomm_frame;
+
+	l2cap_frame_pull(&rfcomm_frame, frame, 0);
+
+	if (!l2cap_frame_get_u8(&rfcomm_frame, &hdr.address) ||
+			!l2cap_frame_get_u8(&rfcomm_frame, &hdr.control) ||
+			!l2cap_frame_get_u8(&rfcomm_frame, &length))
+		goto fail;
+
+	if (RFCOMM_TEST_EA(length))
+		hdr.length = (uint16_t) GET_LEN8(length);
+	else {
+		if (!l2cap_frame_get_u8(&rfcomm_frame, &ex_length))
+			goto fail;
+		hdr.length = ((uint16_t)length << 8) | ex_length;
+		hdr.length = GET_LEN16(hdr.length);
+	}
+
 	if (frame->in)
 		opcode_color = COLOR_MAGENTA;
 	else
 		opcode_color = COLOR_BLUE;
 
-	print_indent(7, opcode_color, "RFCOMM: ", "", 
-							COLOR_OFF, "");
+	ctr_type = RFCOMM_GET_TYPE(hdr.control);
+
+	if (ctr_type == RFCOMM_UIH) {
+		if (uih_frame(&rfcomm_frame, hdr))
+			return;
+		goto fail;
+	} else {
+		switch (ctr_type) {
+		case RFCOMM_SABM:
+			opcode_str = "SABM";
+			break;
+		case RFCOMM_UA:
+			opcode_str = "UA";
+			break;
+		case RFCOMM_DM:
+			opcode_str = "DM";
+			break;
+		case RFCOMM_DISC:
+			opcode_str = "DISC";
+			break;
+		default:
+			opcode_str = "ERR";
+		}
+
+		print_indent(7, opcode_color, "RFCOMM(s): ", opcode_str,
+								COLOR_OFF, "");
+		print_rfcomm_hdr(&rfcomm_frame, hdr);
+		return;
+	}
 
+fail:
+	print_text(COLOR_ERROR, "Frame too short");
 	packet_hexdump(frame->data, frame->size);
 	return;
 }
-- 
1.9.1


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

* [PATCH v1 3/7] monitor/rfcomm: Add support for UIH frame decoding
  2014-10-31 15:08 [PATCH v1 0/7] Add support for RFCOMM in btmon Gowtham Anandha Babu
  2014-10-31 15:08 ` [PATCH v1 1/7] monitor/rfcomm: Add RFCOMM support to btmon Gowtham Anandha Babu
  2014-10-31 15:08 ` [PATCH v1 2/7] monitor/rfcomm: Add support for RFCOMM commands Gowtham Anandha Babu
@ 2014-10-31 15:08 ` Gowtham Anandha Babu
  2014-10-31 15:08 ` [PATCH v1 4/7] monitor/rfcomm: Add support for mcc " Gowtham Anandha Babu
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Gowtham Anandha Babu @ 2014-10-31 15:08 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: d.kasatkin, bharat.panda, cpgs, Gowtham Anandha Babu

Changes made to decode UIH frame in btmon.
---
 monitor/rfcomm.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/monitor/rfcomm.c b/monitor/rfcomm.c
index 395a7b8..6994ffd 100644
--- a/monitor/rfcomm.c
+++ b/monitor/rfcomm.c
@@ -46,6 +46,7 @@
 
 #define GET_LEN8(length) ((length & 0xfe) >> 1)
 #define GET_LEN16(length) ((length & 0xfffe) >> 1)
+#define GET_PF(ctr) (((ctr) >> 4) & 0x1)
 
 struct rfcomm_lhdr {
 	uint8_t address;
@@ -60,8 +61,36 @@ static void print_rfcomm_hdr(const struct l2cap_frame *frame,
 {
 }
 
+static inline bool mcc_frame(const struct l2cap_frame *frame,
+						struct rfcomm_lhdr hdr)
+{
+	packet_hexdump(frame->data, frame->size);
+	return true;
+}
+
 static bool uih_frame(const struct l2cap_frame *frame, struct rfcomm_lhdr hdr)
 {
+	uint8_t credits;
+
+	struct l2cap_frame rfcomm_frame;
+
+	l2cap_frame_pull(&rfcomm_frame, frame, 0);
+
+	if (!RFCOMM_GET_CHANNEL(hdr.address)) {
+		return mcc_frame(&rfcomm_frame, hdr);
+	} else {
+		print_indent(7, opcode_color, "RFCOMM(d): UIH ", "",
+								COLOR_OFF, "");
+		print_rfcomm_hdr(&rfcomm_frame, hdr);
+		if (GET_PF(hdr.control)) {
+			if (!l2cap_frame_get_u8(&rfcomm_frame, &credits))
+				return false;
+			print_field("Credits %d", credits);
+			return true;
+		}
+	}
+
+	packet_hexdump(rfcomm_frame.data, rfcomm_frame.size);
 	return true;
 }
 
-- 
1.9.1


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

* [PATCH v1 4/7] monitor/rfcomm: Add support for mcc frame decoding
  2014-10-31 15:08 [PATCH v1 0/7] Add support for RFCOMM in btmon Gowtham Anandha Babu
                   ` (2 preceding siblings ...)
  2014-10-31 15:08 ` [PATCH v1 3/7] monitor/rfcomm: Add support for UIH frame decoding Gowtham Anandha Babu
@ 2014-10-31 15:08 ` Gowtham Anandha Babu
  2014-10-31 15:08 ` [PATCH v1 5/7] monitor/rfcomm: Add handlers for mcc frame type Gowtham Anandha Babu
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Gowtham Anandha Babu @ 2014-10-31 15:08 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: d.kasatkin, bharat.panda, cpgs, Gowtham Anandha Babu

Changes made to decode MCC frame in RFCOMM for btmon.
---
 monitor/rfcomm.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 80 insertions(+), 1 deletion(-)

diff --git a/monitor/rfcomm.c b/monitor/rfcomm.c
index 6994ffd..a43b2a2 100644
--- a/monitor/rfcomm.c
+++ b/monitor/rfcomm.c
@@ -44,8 +44,15 @@
 #include "sdp.h"
 #include "rfcomm.h"
 
+static char *cr_str[] = {
+	"RSP",
+	"CMD"
+};
+
+#define CR_STR(type) cr_str[GET_CR(type)]
 #define GET_LEN8(length) ((length & 0xfe) >> 1)
 #define GET_LEN16(length) ((length & 0xfffe) >> 1)
+#define GET_CR(type)	((type & 0x02) >> 1)
 #define GET_PF(ctr) (((ctr) >> 4) & 0x1)
 
 struct rfcomm_lhdr {
@@ -54,17 +61,89 @@ struct rfcomm_lhdr {
 	uint16_t length;
 } __attribute__((packed));
 
+struct rfcomm_lmcc {
+	uint8_t type;
+	uint16_t length;
+} __attribute__((packed));
+
+
 const char *opcode_color;
 
 static void print_rfcomm_hdr(const struct l2cap_frame *frame,
 						struct rfcomm_lhdr hdr)
 {
+	uint8_t pf, dlci, fcs, cr, ilen;
+	const void *ptr;
+
+	dlci = RFCOMM_GET_DLCI(hdr.address);
+	pf = GET_PF(hdr.control);
+	cr = GET_CR(hdr.address);
+	ilen = hdr.length;
+	ptr = (frame->data)+frame->size-1;
+	fcs = *(uint8_t *)(ptr);
+
+	print_field("Address : (0x%2.2x)", hdr.address);
+	print_field("CR Bit: %d", cr);
+	print_field("DLCI : (0x%2.2x)", dlci);
+	print_field("Poll/FInal Bit : %d", pf);
+	print_field("Length : %d", ilen);
+	print_field("FCS : (0x%2.2x)", fcs);
+}
+
+static const char *type2str(uint8_t type)
+{
+	switch (type) {
+	case RFCOMM_TEST:
+		return "TEST";
+	case RFCOMM_FCON:
+		return "FCON";
+	case RFCOMM_FCOFF:
+		return "FCOFF";
+	case RFCOMM_MSC:
+		return "MSC";
+	case RFCOMM_RPN:
+		return "RPN";
+	case RFCOMM_RLS:
+		return "RLS";
+	case RFCOMM_PN:
+		return "PN";
+	case RFCOMM_NSC:
+		return "NSC";
+	default:
+		return "Unknown";
+	}
 }
 
 static inline bool mcc_frame(const struct l2cap_frame *frame,
 						struct rfcomm_lhdr hdr)
 {
-	packet_hexdump(frame->data, frame->size);
+	uint8_t length, ex_length, type;
+	struct l2cap_frame rfcomm_frame;
+	struct rfcomm_lmcc mcc;
+
+	l2cap_frame_pull(&rfcomm_frame, frame, 0);
+
+	if (!l2cap_frame_get_u8(&rfcomm_frame, &mcc.type) ||
+			!l2cap_frame_get_u8(&rfcomm_frame, &length))
+		return false;
+
+	if (RFCOMM_TEST_EA(length))
+		mcc.length = (uint16_t) GET_LEN8(length);
+	else {
+		if (!l2cap_frame_get_u8(&rfcomm_frame, &ex_length))
+			return false;
+		mcc.length = ((uint16_t) length << 8) | ex_length;
+		mcc.length = GET_LEN16(hdr.length);
+	}
+
+	type = RFCOMM_GET_MCC_TYPE(mcc.type);
+
+	print_indent(7, opcode_color, "RFCOMM(s): ", "", COLOR_OFF, "%s %s",
+					type2str(type), CR_STR(mcc.type));
+
+	print_rfcomm_hdr(&rfcomm_frame, hdr);
+	packet_hexdump(rfcomm_frame.data, rfcomm_frame.size);
+
 	return true;
 }
 
-- 
1.9.1


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

* [PATCH v1 5/7] monitor/rfcomm: Add handlers for mcc frame type
  2014-10-31 15:08 [PATCH v1 0/7] Add support for RFCOMM in btmon Gowtham Anandha Babu
                   ` (3 preceding siblings ...)
  2014-10-31 15:08 ` [PATCH v1 4/7] monitor/rfcomm: Add support for mcc " Gowtham Anandha Babu
@ 2014-10-31 15:08 ` Gowtham Anandha Babu
  2014-10-31 15:08 ` [PATCH v1 6/7] monitor/rfcomm: Add mcc type handlers code Gowtham Anandha Babu
  2014-10-31 15:08 ` [PATCH v1 7/7] monitor/rfcomm: Add rfcomm file in Android.mk Gowtham Anandha Babu
  6 siblings, 0 replies; 12+ messages in thread
From: Gowtham Anandha Babu @ 2014-10-31 15:08 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: d.kasatkin, bharat.panda, cpgs

From: Bharat Panda <bharat.panda@samsung.com>

Changes made to decode different mcc frame type in RFCOMM
for btmon.
---
 monitor/rfcomm.c | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 76 insertions(+), 2 deletions(-)

diff --git a/monitor/rfcomm.c b/monitor/rfcomm.c
index a43b2a2..b85e8fd 100644
--- a/monitor/rfcomm.c
+++ b/monitor/rfcomm.c
@@ -90,6 +90,51 @@ static void print_rfcomm_hdr(const struct l2cap_frame *frame,
 	print_field("FCS : (0x%2.2x)", fcs);
 }
 
+static inline void mcc_test(const struct l2cap_frame *frame,
+				struct rfcomm_lhdr hdr, struct rfcomm_lmcc mcc)
+{
+}
+
+static inline void mcc_fcon(const struct l2cap_frame *frame,
+				struct rfcomm_lhdr hdr, struct rfcomm_lmcc mcc)
+{
+}
+
+static inline void mcc_fcoff(const struct l2cap_frame *frame,
+				struct rfcomm_lhdr hdr, struct rfcomm_lmcc mcc)
+{
+}
+
+static inline void mcc_msc(const struct l2cap_frame *frame,
+				struct rfcomm_lhdr hdr, struct rfcomm_lmcc mcc)
+{
+	packet_hexdump(frame->data, frame->size);
+}
+
+static inline void mcc_rpn(const struct l2cap_frame *frame,
+				struct rfcomm_lhdr hdr, struct rfcomm_lmcc mcc)
+{
+	packet_hexdump(frame->data, frame->size);
+}
+
+static inline void mcc_rls(const struct l2cap_frame *frame,
+				struct rfcomm_lhdr hdr, struct rfcomm_lmcc mcc)
+{
+	packet_hexdump(frame->data, frame->size);
+}
+
+static inline void mcc_pn(const struct l2cap_frame *frame,
+				struct rfcomm_lhdr hdr, struct rfcomm_lmcc mcc)
+{
+	packet_hexdump(frame->data, frame->size);
+}
+
+static inline void mcc_nsc(const struct l2cap_frame *frame,
+				struct rfcomm_lhdr hdr, struct rfcomm_lmcc mcc)
+{
+	packet_hexdump(frame->data, frame->size);
+}
+
 static const char *type2str(uint8_t type)
 {
 	switch (type) {
@@ -141,8 +186,37 @@ static inline bool mcc_frame(const struct l2cap_frame *frame,
 	print_indent(7, opcode_color, "RFCOMM(s): ", "", COLOR_OFF, "%s %s",
 					type2str(type), CR_STR(mcc.type));
 
-	print_rfcomm_hdr(&rfcomm_frame, hdr);
-	packet_hexdump(rfcomm_frame.data, rfcomm_frame.size);
+	switch (type) {
+	case RFCOMM_TEST:
+		mcc_test(&rfcomm_frame, hdr, mcc);
+		packet_hexdump(rfcomm_frame.data, rfcomm_frame.size);
+		break;
+	case RFCOMM_FCON:
+		mcc_fcon(&rfcomm_frame, hdr, mcc);
+		break;
+	case RFCOMM_FCOFF:
+		mcc_fcoff(&rfcomm_frame, hdr, mcc);
+		break;
+	case RFCOMM_MSC:
+		mcc_msc(&rfcomm_frame, hdr, mcc);
+		break;
+	case RFCOMM_RPN:
+		mcc_rpn(&rfcomm_frame, hdr, mcc);
+		break;
+	case RFCOMM_RLS:
+		mcc_rls(&rfcomm_frame, hdr, mcc);
+		break;
+	case RFCOMM_PN:
+		mcc_pn(&rfcomm_frame, hdr, mcc);
+		break;
+	case RFCOMM_NSC:
+		mcc_nsc(&rfcomm_frame, hdr, mcc);
+		break;
+	default:
+		print_field("MCC message type 0x%02x: ", type);
+		print_rfcomm_hdr(&rfcomm_frame, hdr);
+		packet_hexdump(rfcomm_frame.data, rfcomm_frame.size);
+	}
 
 	return true;
 }
-- 
1.9.1


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

* [PATCH v1 6/7] monitor/rfcomm: Add mcc type handlers code
  2014-10-31 15:08 [PATCH v1 0/7] Add support for RFCOMM in btmon Gowtham Anandha Babu
                   ` (4 preceding siblings ...)
  2014-10-31 15:08 ` [PATCH v1 5/7] monitor/rfcomm: Add handlers for mcc frame type Gowtham Anandha Babu
@ 2014-10-31 15:08 ` Gowtham Anandha Babu
  2014-10-31 15:08 ` [PATCH v1 7/7] monitor/rfcomm: Add rfcomm file in Android.mk Gowtham Anandha Babu
  6 siblings, 0 replies; 12+ messages in thread
From: Gowtham Anandha Babu @ 2014-10-31 15:08 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: d.kasatkin, bharat.panda, cpgs

From: Bharat Panda <bharat.panda@samsung.com>

Adds different mcc type handlers code to print in btmon.
---
 monitor/rfcomm.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/monitor/rfcomm.c b/monitor/rfcomm.c
index b85e8fd..10dc4e8 100644
--- a/monitor/rfcomm.c
+++ b/monitor/rfcomm.c
@@ -90,48 +90,69 @@ static void print_rfcomm_hdr(const struct l2cap_frame *frame,
 	print_field("FCS : (0x%2.2x)", fcs);
 }
 
+static void print_mcc(struct rfcomm_lmcc mcc)
+{
+	print_field("MCC Length %d", mcc.length);
+}
+
 static inline void mcc_test(const struct l2cap_frame *frame,
 				struct rfcomm_lhdr hdr, struct rfcomm_lmcc mcc)
 {
+	print_rfcomm_hdr(frame, hdr);
+	print_mcc(mcc);
 }
 
 static inline void mcc_fcon(const struct l2cap_frame *frame,
 				struct rfcomm_lhdr hdr, struct rfcomm_lmcc mcc)
 {
+	print_rfcomm_hdr(frame, hdr);
+	print_mcc(mcc);
 }
 
 static inline void mcc_fcoff(const struct l2cap_frame *frame,
 				struct rfcomm_lhdr hdr, struct rfcomm_lmcc mcc)
 {
+	print_rfcomm_hdr(frame, hdr);
+	print_mcc(mcc);
 }
 
 static inline void mcc_msc(const struct l2cap_frame *frame,
 				struct rfcomm_lhdr hdr, struct rfcomm_lmcc mcc)
 {
+	print_rfcomm_hdr(frame, hdr);
+	print_mcc(mcc);
 	packet_hexdump(frame->data, frame->size);
 }
 
 static inline void mcc_rpn(const struct l2cap_frame *frame,
 				struct rfcomm_lhdr hdr, struct rfcomm_lmcc mcc)
 {
+	print_rfcomm_hdr(frame, hdr);
+	print_mcc(mcc);
 	packet_hexdump(frame->data, frame->size);
 }
 
 static inline void mcc_rls(const struct l2cap_frame *frame,
 				struct rfcomm_lhdr hdr, struct rfcomm_lmcc mcc)
 {
+	print_rfcomm_hdr(frame, hdr);
+	print_mcc(mcc);
 	packet_hexdump(frame->data, frame->size);
 }
 
 static inline void mcc_pn(const struct l2cap_frame *frame,
 				struct rfcomm_lhdr hdr, struct rfcomm_lmcc mcc)
 {
+	print_rfcomm_hdr(frame, hdr);
+	print_mcc(mcc);
 	packet_hexdump(frame->data, frame->size);
 }
 
 static inline void mcc_nsc(const struct l2cap_frame *frame,
 				struct rfcomm_lhdr hdr, struct rfcomm_lmcc mcc)
 {
+	print_rfcomm_hdr(frame, hdr);
+	print_mcc(mcc);
 	packet_hexdump(frame->data, frame->size);
 }
 
-- 
1.9.1


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

* [PATCH v1 7/7] monitor/rfcomm: Add rfcomm file in Android.mk
  2014-10-31 15:08 [PATCH v1 0/7] Add support for RFCOMM in btmon Gowtham Anandha Babu
                   ` (5 preceding siblings ...)
  2014-10-31 15:08 ` [PATCH v1 6/7] monitor/rfcomm: Add mcc type handlers code Gowtham Anandha Babu
@ 2014-10-31 15:08 ` Gowtham Anandha Babu
  2014-11-03  9:04   ` Luiz Augusto von Dentz
  6 siblings, 1 reply; 12+ messages in thread
From: Gowtham Anandha Babu @ 2014-10-31 15:08 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: d.kasatkin, bharat.panda, cpgs, Gowtham Anandha Babu

---
 android/Android.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/android/Android.mk b/android/Android.mk
index aefe41c..eebd863 100644
--- a/android/Android.mk
+++ b/android/Android.mk
@@ -289,6 +289,7 @@ LOCAL_SRC_FILES := \
 	bluez/monitor/packet.c \
 	bluez/monitor/l2cap.c \
 	bluez/monitor/avctp.c \
+	bluez/monitor/rfcomm.c \
 	bluez/monitor/uuid.c \
 	bluez/monitor/sdp.c \
 	bluez/monitor/vendor.c \
-- 
1.9.1


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

* Re: [PATCH v1 7/7] monitor/rfcomm: Add rfcomm file in Android.mk
  2014-10-31 15:08 ` [PATCH v1 7/7] monitor/rfcomm: Add rfcomm file in Android.mk Gowtham Anandha Babu
@ 2014-11-03  9:04   ` Luiz Augusto von Dentz
  2014-11-03  9:21     ` Gowtham Anandha Babu
  0 siblings, 1 reply; 12+ messages in thread
From: Luiz Augusto von Dentz @ 2014-11-03  9:04 UTC (permalink / raw)
  To: Gowtham Anandha Babu; +Cc: linux-bluetooth, Dmitry Kasatkin, Bharat Panda, cpgs

Hi,

On Fri, Oct 31, 2014 at 5:08 PM, Gowtham Anandha Babu
<gowtham.ab@samsung.com> wrote:
> ---
>  android/Android.mk | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/android/Android.mk b/android/Android.mk
> index aefe41c..eebd863 100644
> --- a/android/Android.mk
> +++ b/android/Android.mk
> @@ -289,6 +289,7 @@ LOCAL_SRC_FILES := \
>         bluez/monitor/packet.c \
>         bluez/monitor/l2cap.c \
>         bluez/monitor/avctp.c \
> +       bluez/monitor/rfcomm.c \
>         bluez/monitor/uuid.c \
>         bluez/monitor/sdp.c \
>         bluez/monitor/vendor.c \
> --
> 1.9.1

Usually we try very hard to avoid breaking the build even within the
same patch-set, so if possible please squash this change.


-- 
Luiz Augusto von Dentz

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

* RE: [PATCH v1 7/7] monitor/rfcomm: Add rfcomm file in Android.mk
  2014-11-03  9:04   ` Luiz Augusto von Dentz
@ 2014-11-03  9:21     ` Gowtham Anandha Babu
  2014-11-03 10:11       ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 12+ messages in thread
From: Gowtham Anandha Babu @ 2014-11-03  9:21 UTC (permalink / raw)
  To: 'Luiz Augusto von Dentz'
  Cc: linux-bluetooth, 'Dmitry Kasatkin', 'Bharat Panda', cpgs

Hi,

> -----Original Message-----
> From: Luiz Augusto von Dentz [mailto:luiz.dentz@gmail.com]
> Sent: Monday, November 03, 2014 2:35 PM
> To: Gowtham Anandha Babu
> Cc: linux-bluetooth@vger.kernel.org; Dmitry Kasatkin; Bharat Panda;
> cpgs@samsung.com
> Subject: Re: [PATCH v1 7/7] monitor/rfcomm: Add rfcomm file in Android.mk
> 
> Hi,
> 
> On Fri, Oct 31, 2014 at 5:08 PM, Gowtham Anandha Babu
> <gowtham.ab@samsung.com> wrote:
> > ---
> >  android/Android.mk | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/android/Android.mk b/android/Android.mk index
> > aefe41c..eebd863 100644
> > --- a/android/Android.mk
> > +++ b/android/Android.mk
> > @@ -289,6 +289,7 @@ LOCAL_SRC_FILES := \
> >         bluez/monitor/packet.c \
> >         bluez/monitor/l2cap.c \
> >         bluez/monitor/avctp.c \
> > +       bluez/monitor/rfcomm.c \
> >         bluez/monitor/uuid.c \
> >         bluez/monitor/sdp.c \
> >         bluez/monitor/vendor.c \
> > --
> > 1.9.1
> 
> Usually we try very hard to avoid breaking the build even within the same
> patch-set, so if possible please squash this change.
> 
> 
> --
> Luiz Augusto von Dentz


Do you want me to send this one(Android.mk) as a separate patch (out of this patch-set) or merge this one to first patch ?

Regards,
Gowtham Anandha Babu


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

* Re: [PATCH v1 7/7] monitor/rfcomm: Add rfcomm file in Android.mk
  2014-11-03  9:21     ` Gowtham Anandha Babu
@ 2014-11-03 10:11       ` Luiz Augusto von Dentz
  2014-11-03 10:47         ` Gowtham Anandha Babu
  0 siblings, 1 reply; 12+ messages in thread
From: Luiz Augusto von Dentz @ 2014-11-03 10:11 UTC (permalink / raw)
  To: Gowtham Anandha Babu; +Cc: linux-bluetooth, Dmitry Kasatkin, Bharat Panda, cpgs

Hi,

On Mon, Nov 3, 2014 at 11:21 AM, Gowtham Anandha Babu
<gowtham.ab@samsung.com> wrote:
> Hi,
>
>> -----Original Message-----
>> From: Luiz Augusto von Dentz [mailto:luiz.dentz@gmail.com]
>> Sent: Monday, November 03, 2014 2:35 PM
>> To: Gowtham Anandha Babu
>> Cc: linux-bluetooth@vger.kernel.org; Dmitry Kasatkin; Bharat Panda;
>> cpgs@samsung.com
>> Subject: Re: [PATCH v1 7/7] monitor/rfcomm: Add rfcomm file in Android.mk
>>
>> Hi,
>>
>> On Fri, Oct 31, 2014 at 5:08 PM, Gowtham Anandha Babu
>> <gowtham.ab@samsung.com> wrote:
>> > ---
>> >  android/Android.mk | 1 +
>> >  1 file changed, 1 insertion(+)
>> >
>> > diff --git a/android/Android.mk b/android/Android.mk index
>> > aefe41c..eebd863 100644
>> > --- a/android/Android.mk
>> > +++ b/android/Android.mk
>> > @@ -289,6 +289,7 @@ LOCAL_SRC_FILES := \
>> >         bluez/monitor/packet.c \
>> >         bluez/monitor/l2cap.c \
>> >         bluez/monitor/avctp.c \
>> > +       bluez/monitor/rfcomm.c \
>> >         bluez/monitor/uuid.c \
>> >         bluez/monitor/sdp.c \
>> >         bluez/monitor/vendor.c \
>> > --
>> > 1.9.1
>>
>> Usually we try very hard to avoid breaking the build even within the same
>> patch-set, so if possible please squash this change.
>>
>>
>> --
>> Luiz Augusto von Dentz
>
>
> Do you want me to send this one(Android.mk) as a separate patch (out of this patch-set) or merge this one to first patch ?

Please merge, you can use git commit --squash/--fixup=<patch> and then
git rebase --autosquash, there are actually many ways to do it.

-- 
Luiz Augusto von Dentz

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

* RE: [PATCH v1 7/7] monitor/rfcomm: Add rfcomm file in Android.mk
  2014-11-03 10:11       ` Luiz Augusto von Dentz
@ 2014-11-03 10:47         ` Gowtham Anandha Babu
  0 siblings, 0 replies; 12+ messages in thread
From: Gowtham Anandha Babu @ 2014-11-03 10:47 UTC (permalink / raw)
  To: 'Luiz Augusto von Dentz'
  Cc: linux-bluetooth, 'Dmitry Kasatkin', 'Bharat Panda', cpgs

Hi,

> -----Original Message-----
> From: Luiz Augusto von Dentz [mailto:luiz.dentz@gmail.com]
> Sent: Monday, November 03, 2014 3:41 PM
> To: Gowtham Anandha Babu
> Cc: linux-bluetooth@vger.kernel.org; Dmitry Kasatkin; Bharat Panda;
> cpgs@samsung.com
> Subject: Re: [PATCH v1 7/7] monitor/rfcomm: Add rfcomm file in Android.mk
> 
> Hi,
> 
> On Mon, Nov 3, 2014 at 11:21 AM, Gowtham Anandha Babu
> <gowtham.ab@samsung.com> wrote:
> > Hi,
> >
> >> -----Original Message-----
> >> From: Luiz Augusto von Dentz [mailto:luiz.dentz@gmail.com]
> >> Sent: Monday, November 03, 2014 2:35 PM
> >> To: Gowtham Anandha Babu
> >> Cc: linux-bluetooth@vger.kernel.org; Dmitry Kasatkin; Bharat Panda;
> >> cpgs@samsung.com
> >> Subject: Re: [PATCH v1 7/7] monitor/rfcomm: Add rfcomm file in
> >> Android.mk
> >>
> >> Hi,
> >>
> >> On Fri, Oct 31, 2014 at 5:08 PM, Gowtham Anandha Babu
> >> <gowtham.ab@samsung.com> wrote:
> >> > ---
> >> >  android/Android.mk | 1 +
> >> >  1 file changed, 1 insertion(+)
> >> >
> >> > diff --git a/android/Android.mk b/android/Android.mk index
> >> > aefe41c..eebd863 100644
> >> > --- a/android/Android.mk
> >> > +++ b/android/Android.mk
> >> > @@ -289,6 +289,7 @@ LOCAL_SRC_FILES := \
> >> >         bluez/monitor/packet.c \
> >> >         bluez/monitor/l2cap.c \
> >> >         bluez/monitor/avctp.c \
> >> > +       bluez/monitor/rfcomm.c \
> >> >         bluez/monitor/uuid.c \
> >> >         bluez/monitor/sdp.c \
> >> >         bluez/monitor/vendor.c \
> >> > --
> >> > 1.9.1
> >>
> >> Usually we try very hard to avoid breaking the build even within the
> >> same patch-set, so if possible please squash this change.
> >>
> >>
> >> --
> >> Luiz Augusto von Dentz
> >
> >
> > Do you want me to send this one(Android.mk) as a separate patch (out of
> this patch-set) or merge this one to first patch ?
> 
> Please merge, you can use git commit --squash/--fixup=<patch> and then git
> rebase --autosquash, there are actually many ways to do it.
> 
> --
> Luiz Augusto von Dentz

I have done the squash and git rebase and submitted the v1 for the same.

Regards,
Gowtham Anandha Babu


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

end of thread, other threads:[~2014-11-03 10:47 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-31 15:08 [PATCH v1 0/7] Add support for RFCOMM in btmon Gowtham Anandha Babu
2014-10-31 15:08 ` [PATCH v1 1/7] monitor/rfcomm: Add RFCOMM support to btmon Gowtham Anandha Babu
2014-10-31 15:08 ` [PATCH v1 2/7] monitor/rfcomm: Add support for RFCOMM commands Gowtham Anandha Babu
2014-10-31 15:08 ` [PATCH v1 3/7] monitor/rfcomm: Add support for UIH frame decoding Gowtham Anandha Babu
2014-10-31 15:08 ` [PATCH v1 4/7] monitor/rfcomm: Add support for mcc " Gowtham Anandha Babu
2014-10-31 15:08 ` [PATCH v1 5/7] monitor/rfcomm: Add handlers for mcc frame type Gowtham Anandha Babu
2014-10-31 15:08 ` [PATCH v1 6/7] monitor/rfcomm: Add mcc type handlers code Gowtham Anandha Babu
2014-10-31 15:08 ` [PATCH v1 7/7] monitor/rfcomm: Add rfcomm file in Android.mk Gowtham Anandha Babu
2014-11-03  9:04   ` Luiz Augusto von Dentz
2014-11-03  9:21     ` Gowtham Anandha Babu
2014-11-03 10:11       ` Luiz Augusto von Dentz
2014-11-03 10:47         ` Gowtham Anandha Babu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.