linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/2] Add BT 3.0+HS definitions
@ 2012-03-06  0:34 Peter Krystad
  2012-03-06  0:34 ` [PATCH v4 1/2] lib: Add A2MP definitions Peter Krystad
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Peter Krystad @ 2012-03-06  0:34 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: johan.hedberg, Peter Krystad

v4 - put Makefile.am change into separate commit

Peter Krystad (2):
  lib: Add A2MP definitions
  Add a2mp.h to library_sources

 Makefile.am |    4 +-
 lib/a2mp.h  |  115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 117 insertions(+), 2 deletions(-)

-- 
1.7.4.1

--
Peter Krystad
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

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

* [PATCH v4 1/2] lib: Add A2MP definitions
  2012-03-06  0:34 [PATCH v4 0/2] Add BT 3.0+HS definitions Peter Krystad
@ 2012-03-06  0:34 ` Peter Krystad
  2012-03-06  0:34 ` [PATCH v4 2/2] Add a2mp.h to library_sources Peter Krystad
  2012-03-06  0:44 ` [PATCH v4 0/2] Add BT 3.0+HS definitions Johan Hedberg
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Krystad @ 2012-03-06  0:34 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: johan.hedberg, Peter Krystad

---
 lib/a2mp.h |  115 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 115 insertions(+), 0 deletions(-)

diff --git a/lib/a2mp.h b/lib/a2mp.h
index f6d07df..5d4f0ab 100644
--- a/lib/a2mp.h
+++ b/lib/a2mp.h
@@ -2,6 +2,7 @@
  *
  *  BlueZ - Bluetooth protocol stack for Linux
  *
+ *  Copyright (c) 2012  Code Aurora Forum. All rights reserved.
  *  Copyright (C) 2012  Intel Corporation. All rights reserved.
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -27,6 +28,120 @@
 extern "C" {
 #endif
 
+/* A2MP Protocol */
+
+/* A2MP command codes */
+
+#define A2MP_COMMAND_REJ	0x01
+#define A2MP_DISCOVER_REQ	0x02
+#define A2MP_DISCOVER_RSP	0x03
+#define A2MP_CHANGE_NOTIFY	0x04
+#define A2MP_CHANGE_RSP		0x05
+#define A2MP_INFO_REQ		0x06
+#define A2MP_INFO_RSP		0x07
+#define A2MP_ASSOC_REQ		0x08
+#define A2MP_ASSOC_RSP		0x09
+#define A2MP_CREATE_REQ		0x0a
+#define A2MP_CREATE_RSP		0x0b
+#define A2MP_DISCONN_REQ	0x0c
+#define A2MP_DISCONN_RSP	0x0d
+
+struct a2mp_hdr {
+	uint8_t		code;
+	uint8_t		ident;
+	uint16_t	len;
+} __attribute__ ((packed));
+#define A2MP_HDR_SIZE 4
+
+struct a2mp_command_rej {
+	uint16_t	reason;
+} __attribute__ ((packed));
+
+struct a2mp_discover_req {
+	uint16_t	mtu;
+	uint16_t	mask;
+} __attribute__ ((packed));
+
+struct a2mp_ctrl {
+	uint8_t		id;
+	uint8_t		type;
+	uint8_t		status;
+} __attribute__ ((packed));
+
+struct a2mp_discover_rsp {
+	uint16_t	mtu;
+	uint16_t	mask;
+	struct a2mp_ctrl ctrl_list[0];
+} __attribute__ ((packed));
+
+struct a2mp_info_req {
+	uint8_t		id;
+} __attribute__ ((packed));
+
+struct a2mp_info_rsp {
+	uint8_t		id;
+	uint8_t		status;
+	uint32_t	total_bw;
+	uint32_t	max_bw;
+	uint32_t	min_latency;
+	uint16_t	pal_caps;
+	uint16_t	assoc_size;
+} __attribute__ ((packed));
+
+struct a2mp_assoc_req {
+	uint8_t		id;
+} __attribute__ ((packed));
+
+struct a2mp_assoc_rsp {
+	uint8_t		id;
+	uint8_t		status;
+	uint8_t		assoc_data[0];
+} __attribute__ ((packed));
+
+struct a2mp_create_req {
+	uint8_t		local_id;
+	uint8_t		remote_id;
+	uint8_t		assoc_data[0];
+} __attribute__ ((packed));
+
+struct a2mp_create_rsp {
+	uint8_t		local_id;
+	uint8_t		remote_id;
+	uint8_t		status;
+} __attribute__ ((packed));
+
+struct a2mp_disconn_req {
+	uint8_t		local_id;
+	uint8_t		remote_id;
+} __attribute__ ((packed));
+
+struct a2mp_disconn_rsp {
+	uint8_t		local_id;
+	uint8_t		remote_id;
+	uint8_t		status;
+} __attribute__ ((packed));
+
+#define A2MP_COMMAND_NOT_RECOGNIZED 0x0000
+
+/* AMP controller status */
+#define AMP_CTRL_POWERED_DOWN		0x00
+#define AMP_CTRL_BLUETOOTH_ONLY		0x01
+#define AMP_CTRL_NO_CAPACITY		0x02
+#define AMP_CTRL_LOW_CAPACITY		0x03
+#define AMP_CTRL_MEDIUM_CAPACITY	0x04
+#define AMP_CTRL_HIGH_CAPACITY		0x05
+#define AMP_CTRL_FULL_CAPACITY		0x06
+
+/* A2MP response status */
+#define A2MP_STATUS_SUCCESS				0x00
+#define A2MP_STATUS_INVALID_CTRL_ID			0x01
+#define A2MP_STATUS_UNABLE_START_LINK_CREATION		0x02
+#define A2MP_STATUS_NO_PHYSICAL_LINK_EXISTS		0x02
+#define A2MP_STATUS_COLLISION_OCCURED			0x03
+#define A2MP_STATUS_DISCONN_REQ_RECVD			0x04
+#define A2MP_STATUS_PHYS_LINK_EXISTS			0x05
+#define A2MP_STATUS_SECURITY_VIOLATION			0x06
+
 #ifdef __cplusplus
 }
 #endif
-- 
1.7.4.1

--
Peter Krystad
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

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

* [PATCH v4 2/2] Add a2mp.h to library_sources
  2012-03-06  0:34 [PATCH v4 0/2] Add BT 3.0+HS definitions Peter Krystad
  2012-03-06  0:34 ` [PATCH v4 1/2] lib: Add A2MP definitions Peter Krystad
@ 2012-03-06  0:34 ` Peter Krystad
  2012-03-06  0:44 ` [PATCH v4 0/2] Add BT 3.0+HS definitions Johan Hedberg
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Krystad @ 2012-03-06  0:34 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: johan.hedberg, Peter Krystad

---
 Makefile.am |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index b419d84..12cb0b7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -58,8 +58,8 @@ plugin_LTLIBRARIES =
 
 
 lib_headers = lib/bluetooth.h lib/hci.h lib/hci_lib.h lib/mgmt.h \
-		lib/sco.h lib/l2cap.h lib/sdp.h lib/sdp_lib.h lib/uuid.h \
-		lib/rfcomm.h lib/bnep.h lib/cmtp.h lib/hidp.h
+		lib/sco.h lib/l2cap.h lib/a2mp.h lib/sdp.h lib/sdp_lib.h \
+		lib/uuid.h lib/rfcomm.h lib/bnep.h lib/cmtp.h lib/hidp.h
 local_headers = $(foreach file,$(lib_headers), lib/bluetooth/$(notdir $(file)))
 
 BUILT_SOURCES = $(local_headers) src/builtin.h
-- 
1.7.4.1

--
Peter Krystad
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

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

* Re: [PATCH v4 0/2] Add BT 3.0+HS definitions
  2012-03-06  0:34 [PATCH v4 0/2] Add BT 3.0+HS definitions Peter Krystad
  2012-03-06  0:34 ` [PATCH v4 1/2] lib: Add A2MP definitions Peter Krystad
  2012-03-06  0:34 ` [PATCH v4 2/2] Add a2mp.h to library_sources Peter Krystad
@ 2012-03-06  0:44 ` Johan Hedberg
  2 siblings, 0 replies; 4+ messages in thread
From: Johan Hedberg @ 2012-03-06  0:44 UTC (permalink / raw)
  To: Peter Krystad; +Cc: linux-bluetooth

Hi Peter,

On Mon, Mar 05, 2012, Peter Krystad wrote:
> v4 - put Makefile.am change into separate commit
> 
> Peter Krystad (2):
>   lib: Add A2MP definitions
>   Add a2mp.h to library_sources
> 
>  Makefile.am |    4 +-
>  lib/a2mp.h  |  115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 117 insertions(+), 2 deletions(-)

Applied. Thanks.

Johan

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

end of thread, other threads:[~2012-03-06  0:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-06  0:34 [PATCH v4 0/2] Add BT 3.0+HS definitions Peter Krystad
2012-03-06  0:34 ` [PATCH v4 1/2] lib: Add A2MP definitions Peter Krystad
2012-03-06  0:34 ` [PATCH v4 2/2] Add a2mp.h to library_sources Peter Krystad
2012-03-06  0:44 ` [PATCH v4 0/2] Add BT 3.0+HS definitions Johan Hedberg

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).