Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 18/18] android/hal-gatt-api: Add Client Listen event
From: Jakub Tyszkowski @ 2014-02-28 10:24 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Jakub Tyszkowski
In-Reply-To: <1393583043-23455-1-git-send-email-jakub.tyszkowski@tieto.com>

---
 android/hal-ipc-api.txt | 3 +++
 android/hal-msg.h       | 6 ++++++
 2 files changed, 9 insertions(+)

diff --git a/android/hal-ipc-api.txt b/android/hal-ipc-api.txt
index 5f2561a..04c0b7c 100644
--- a/android/hal-ipc-api.txt
+++ b/android/hal-ipc-api.txt
@@ -1946,6 +1946,9 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 
 	Opcode 0x92 - Listen notification
 
+		Notification parameters: Status (4 octets)
+		                         Server Interface (4 octets)
+
 	Opcode 0x93 - Register Server notification
 	Opcode 0x94 - Connection notification
 	Opcode 0x95 - Service Added notification
diff --git a/android/hal-msg.h b/android/hal-msg.h
index b7c351d..95ce551 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
@@ -1392,3 +1392,9 @@ struct hal_ev_gatt_client_read_remote_rssi {
 	int32_t rssi;
 	int32_t status;
 } __attribute__((packed));
+
+#define HAL_EV_GATT_CLIENT_LISTEN		0x92
+struct hal_ev_gatt_client_listen {
+	int32_t status;
+	int32_t server_if;
+} __attribute__((packed));
-- 
1.9.0


^ permalink raw reply related

* Re: partial success with PS3 sixaxis
From: Szymon Janc @ 2014-02-28 10:35 UTC (permalink / raw)
  To: Andrea; +Cc: linux-bluetooth
In-Reply-To: <53086B93.3080503@gmail.com>

Hi Andrea,

On Saturday 22 of February 2014 09:19:15 Andrea wrote:
> On 20/02/14 09:47, Szymon Janc wrote:
> > Hi Andrea,
> > 
> > 
> > This is a known regression on kernels >3.9. Should be fixed in 3.15 AFAIR.
> > 
> 
> you really mean 3.15? not even 3.14?

AFAIK yes, this regression was only spotted in mid December when sixaxis
patches were submitted and proper fix turns out to be not that trivial.

> then, my last issue is the following:
> 
> on Fedora 19 x86 things work with a Bluetooth 4.0 dongle
> 
> 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
> 
> running 3.12.11 (Fedora version)
> 
> 
> 
> unfortunately on a Raspberry Pi ARM6, Arch Linux with kernel 3.13.3 I get a strange kernel oops
> after a random time of successful usage (could be 1 minute or 2 days)
> 
> I struggle to get a meaningful stack trace (the whole system dies, need to attach a serial console),
> would you know of any issues on this architecture? it seems to be a NULL pointer exception.
> The same crash happens with a different dongle (older bluetooth 2 from broadcom)

I haven't seen any issues on my PC but I wasn't using it on any ARM device.

-- 
Best regards, 
Szymon Janc

^ permalink raw reply

* [PATCH] avrcp: Fix buffer size
From: Andrei Emeltchenko @ 2014-02-28 10:44 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

For avrcp_get_current_player_value() buffer size needs to be
AVRCP_ATTRIBUTE_LAST + 1 for all attributes + 1 for number of attributes
written first, not counting header.
---
 profiles/audio/avrcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index c0e5d07..8098c62 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -1905,7 +1905,7 @@ static gboolean avrcp_player_value_rsp(struct avctp *conn,
 static void avrcp_get_current_player_value(struct avrcp *session,
 						uint8_t *attrs, uint8_t count)
 {
-	uint8_t buf[AVRCP_HEADER_LENGTH + AVRCP_ATTRIBUTE_LAST + 1];
+	uint8_t buf[AVRCP_HEADER_LENGTH + AVRCP_ATTRIBUTE_LAST + 2];
 	struct avrcp_header *pdu = (void *) buf;
 	uint16_t length = AVRCP_HEADER_LENGTH + count + 1;
 
-- 
1.8.3.2


^ permalink raw reply related

* Re: partial success with PS3 sixaxis
From: Szymon Janc @ 2014-02-28 10:47 UTC (permalink / raw)
  To: Andrea; +Cc: linux-bluetooth
In-Reply-To: <52FF593F.30007@gmail.com>

Hi Andrea,

On Saturday 15 of February 2014 12:10:39 Andrea wrote:
> On 13/02/14 09:25, Szymon Janc wrote:
> > Hi Andrea,
> > 
> 
> > This should "just work". Since 5.14 there is authorization needed when DS3 is
> > connecting (device is not marked as trusted when connected on USB) so please
> > make sure you have default agent registered.
> > 
> > I assume you are using bluetoothctl so do:
> > agent on
> > default-agent
> > 
> > Then you should get authorization request in bluetoothctl when DS3 is connecting.
> > 
> 
> I think the problem is not authorisation (I do not get such a request, by I did use the trust
> command, so maybe it is not necessary any more). It gets connected, it creates /dev/input/js0 but it
> deletes it shortly after.
> 
> I run bluetoothd in debug mode and this is what it prints
> 
> bluetoothd[13678]: src/adapter.c:connected_callback() hci0 device 00:1B:FB:63:F2:64 connected eir_len 5
> bluetoothd[13678]: profiles/input/server.c:connect_event_cb() Incoming connection from
> 00:1B:FB:63:F2:64 on PSM 17
> bluetoothd[13678]: profiles/input/device.c:input_device_set_channel() idev 0x1dec160 psm 17
> bluetoothd[13678]: profiles/input/server.c:confirm_event_cb()
> bluetoothd[13678]: profiles/input/server.c:connect_event_cb() Incoming connection from
> 00:1B:FB:63:F2:64 on PSM 19
> bluetoothd[13678]: profiles/input/device.c:input_device_set_channel() idev 0x1dec160 psm 19
> bluetoothd[13678]: src/service.c:change_state() 0x1deb1c0: device 00:1B:FB:63:F2:64 profile
> input-hid state changed: disconnected -> connected (0)
> bluetoothd[13678]: sixaxis: compatible device connected: PLAYSTATION(R)3 Controller (054C:0268)
> 
> < ===================================== here I disconnect manually, as /dev/input/js0 has already
> been deleted>
> 
> bluetoothd[13678]: src/service.c:change_state() 0x1deb1c0: device 00:1B:FB:63:F2:64 profile
> input-hid state changed: connected -> disconnecting (0)
> bluetoothd[13678]: profiles/input/device.c:input_device_disconnect()
> bluetoothd[13678]: Input: disconnect /org/bluez/hci0/dev_00_1B_FB_63_F2_64
> bluetoothd[13678]: profiles/input/device.c:ctrl_watch_cb() Device 00:1B:FB:63:F2:64 disconnected
> bluetoothd[13678]: profiles/input/device.c:intr_watch_cb() Device 00:1B:FB:63:F2:64 disconnected
> bluetoothd[13678]: src/service.c:change_state() 0x1deb1c0: device 00:1B:FB:63:F2:64 profile
> input-hid state changed: disconnecting -> disconnected (0)
> bluetoothd[13678]: profiles/input/device.c:input_device_enter_reconnect_mode()
> path=/org/bluez/hci0/dev_00_1B_FB_63_F2_64 reconnect_mode=device
> bluetoothd[13678]: src/adapter.c:dev_disconnected() Device 00:1B:FB:63:F2:64 disconnected, reason 2
> bluetoothd[13678]: src/adapter.c:adapter_remove_connection()
> bluetoothd[13678]: src/adapter.c:bonding_attempt_complete() hci0 bdaddr 00:1B:FB:63:F2:64 type 0
> status 0xe
> bluetoothd[13678]: src/device.c:device_bonding_complete() bonding (nil) status 0x0e
> bluetoothd[13678]: src/device.c:device_bonding_failed() status 14
> bluetoothd[13678]: src/adapter.c:resume_discovery()
> 
> Halfway through I disconnected the controller with
> 
> disconnect XX:XX:XX:XX:XX in bluetoothtcl
> 
> at the same time in the kernel log I can see
> 
> Feb 15 12:08:29 alarmpi kernel: sony 0005:054C:0268.0010: Fixing up Sony Sixaxis report descriptor
> Feb 15 12:08:29 alarmpi kernel: sony 0005:054C:0268.0010: unknown main item tag 0x0
> Feb 15 12:08:29 alarmpi kernel: input: PLAYSTATION(R)3 Controller as
> /devices/platform/bcm2708_usb/usb1/1-1/1-1.3/1-1.3.1/1-1.3.1:1.0/blu
> Feb 15 12:08:29 alarmpi kernel: sony 0005:054C:0268.0010: input,hidraw0: BLUETOOTH HID v1.00
> Joystick [PLAYSTATION(R)3 Controller] on 00:
> Feb 15 12:08:39 alarmpi kernel: sony: probe of 0005:054C:0268.0010 failed with error -5
> 
> which mention some issues with descriptor, tag and probe.

Failing probe is a problem here. Do you use same dongle on RaspPi as on Fedora?
I've seen that DS3 is not playing well with some controllers i.e. it doesn't work
with one on my CSR 2.0 USB dongle.

> I am not too familiar with whom is responsible for /dev/input/js0? kernel? bluez? the sixaxis plugin?

Kernel. sixaxis plugin is used only to associate DS3 with host controller (and to set LEDs).

> Since this controller always works with the alternative sixad daemon, can I log the traffic and
> compare it? or maybe post it here so some of you guys can help me?

Yeap, btmon logs could give us some more info what is going on.

-- 
Best regards, 
Szymon Janc

^ permalink raw reply

* [PATCH v2 0/4] Bluetooth: Fix initiator/responder addresses for SMP
From: johan.hedberg @ 2014-02-28 10:54 UTC (permalink / raw)
  To: linux-bluetooth

Hi,

Here's a second attempt to fix the initiator/responder addresses when
using privacy. The main difference to the previous attempt is an added
protection to HCI_Set_Random_Address so we don't do that while
connecting or advertising, and a clarification for the white list corner
case in aptch 3/4 that we're taking a "best effort" approach while
lacking full tracking of white list initiated connections.

Johan

----------------------------------------------------------------
Johan Hedberg (4):
      Bluetooth: Add protections for updating local random address
      Bluetooth: Fix updating connection state to BT_CONNECT too early
      Bluetooth: Track LE initiator and responder address information
      Bluetooth: Use hdev->init/resp_addr values for smp_c1 function

 include/net/bluetooth/hci_core.h |  4 ++
 net/bluetooth/hci_conn.c         |  3 +-
 net/bluetooth/hci_core.c         | 27 ++++++++++++-
 net/bluetooth/hci_event.c        | 78 ++++++++++++++++++++++++++++++++++++
 net/bluetooth/mgmt.c             |  7 ++++
 net/bluetooth/smp.c              | 22 +++-------
 6 files changed, 122 insertions(+), 19 deletions(-)


^ permalink raw reply

* [PATCH v2 1/4] Bluetooth: Add protections for updating local random address
From: johan.hedberg @ 2014-02-28 10:54 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1393584857-30375-1-git-send-email-johan.hedberg@gmail.com>

From: Johan Hedberg <johan.hedberg@intel.com>

Different controllers behave differently when HCI_Set_Random_Address is
called while they are advertising or have a HCI_LE_Create_Connection in
progress. Some take the newly written address into use for the pending
operation while others use the random address that we had at the time
that the operation started.

Due to this undefined behavior and for the fact that we want to reliably
determine the initiator address of all connections for the sake of SMP
it's best to simply prevent the random address update if we have these
problematic operations in progress.

This patch adds a set_random_addr() helper function for the use of
hci_update_random_address which contains the necessary checks for
advertising and ongoing LE connections.

One extra thing we need to do is to clear the HCI_ADVERTISING flag in
the enable_advertising() function before sending any commands. Since
re-enabling advertising happens by calling first disable_advertising()
and then enable_advertising() all while having the HCI_ADVERTISING flag
set. Clearing the flag lets the set_random_addr() function know that
it's safe to write a new address at least as far as advertising is
concerned.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
---
 net/bluetooth/hci_core.c | 27 +++++++++++++++++++++++++--
 net/bluetooth/mgmt.c     |  7 +++++++
 2 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 32c0c2c58f66..8bbfdea9cbec 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -3649,6 +3649,29 @@ static void le_scan_disable_work(struct work_struct *work)
 		BT_ERR("Disable LE scanning request failed: err %d", err);
 }
 
+static void set_random_addr(struct hci_request *req, bdaddr_t *rpa)
+{
+	struct hci_dev *hdev = req->hdev;
+
+	/* If we're advertising or initiating an LE connection we can't
+	 * go ahead and change the random address at this time. This is
+	 * because the eventual initiator address used for the
+	 * subsequently created connection will be undefined (some
+	 * controllers use the new address and others the one we had
+	 * when the operation started).
+	 *
+	 * In this kind of scenario skip the update and let the random
+	 * address be updated at the next cycle.
+	 */
+	if (test_bit(HCI_ADVERTISING, &hdev->dev_flags) ||
+	    hci_conn_hash_lookup_state(hdev, LE_LINK, BT_CONNECT)) {
+		BT_DBG("Deferring random address update");
+		return;
+	}
+
+	hci_req_add(req, HCI_OP_LE_SET_RANDOM_ADDR, 6, rpa);
+}
+
 int hci_update_random_address(struct hci_request *req, bool require_privacy,
 			      u8 *own_addr_type)
 {
@@ -3674,7 +3697,7 @@ int hci_update_random_address(struct hci_request *req, bool require_privacy,
 			return err;
 		}
 
-		hci_req_add(req, HCI_OP_LE_SET_RANDOM_ADDR, 6, &hdev->rpa);
+		set_random_addr(req, &hdev->rpa);
 
 		to = msecs_to_jiffies(hdev->rpa_timeout * 1000);
 		queue_delayed_work(hdev->workqueue, &hdev->rpa_expired, to);
@@ -3693,7 +3716,7 @@ int hci_update_random_address(struct hci_request *req, bool require_privacy,
 		urpa.b[5] &= 0x3f;	/* Clear two most significant bits */
 
 		*own_addr_type = ADDR_LE_DEV_RANDOM;
-		hci_req_add(req, HCI_OP_LE_SET_RANDOM_ADDR, 6, &urpa);
+		set_random_addr(req, &urpa);
 		return 0;
 	}
 
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 2d11c817d082..98e9df3556e7 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -840,6 +840,13 @@ static void enable_advertising(struct hci_request *req)
 	u8 own_addr_type, enable = 0x01;
 	bool connectable;
 
+	/* Clear the HCI_ADVERTISING bit temporarily so that the
+	 * hci_update_random_address knows that it's safe to go ahead
+	 * and write a new random address. The flag will be set back on
+	 * as soon as the SET_ADV_ENABLE HCI command completes.
+	 */
+	clear_bit(HCI_ADVERTISING, &hdev->dev_flags);
+
 	connectable = get_connectable(hdev);
 
 	/* Set require_privacy to true only when non-connectable
-- 
1.8.5.3


^ permalink raw reply related

* [PATCH v2 2/4] Bluetooth: Fix updating connection state to BT_CONNECT too early
From: johan.hedberg @ 2014-02-28 10:54 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1393584857-30375-1-git-send-email-johan.hedberg@gmail.com>

From: Johan Hedberg <johan.hedberg@intel.com>

We shouldn't update the hci_conn state to BT_CONNECT until the moment
that we're ready to send the initiating HCI command for it. If the
connection has the BT_CONNECT state too early the code responsible for
updating the local random address may incorrectly think there's a
pending connection in progress and refuse to update the address.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
---
 net/bluetooth/hci_conn.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 5b0802994cbb..818330c1b2a2 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -588,6 +588,8 @@ static void hci_req_add_le_create_conn(struct hci_request *req,
 	cp.max_ce_len = __constant_cpu_to_le16(0x0000);
 
 	hci_req_add(req, HCI_OP_LE_CREATE_CONN, sizeof(cp), &cp);
+
+	conn->state = BT_CONNECT;
 }
 
 static void stop_scan_complete(struct hci_dev *hdev, u8 status)
@@ -689,7 +691,6 @@ struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
 
 	conn->dst_type = dst_type;
 
-	conn->state = BT_CONNECT;
 	conn->out = true;
 	conn->link_mode |= HCI_LM_MASTER;
 	conn->sec_level = BT_SECURITY_LOW;
-- 
1.8.5.3


^ permalink raw reply related

* [PATCH v2 3/4] Bluetooth: Track LE initiator and responder address information
From: johan.hedberg @ 2014-02-28 10:54 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1393584857-30375-1-git-send-email-johan.hedberg@gmail.com>

From: Johan Hedberg <johan.hedberg@intel.com>

For SMP we need the local and remote addresses (and their types) that
were used to establish the connection. These may be different from the
Identity Addresses or even the current RPA. To guarantee that we have
this information available and it is correct track these values
separately from the very beginning of the connection.

For outgoing connections we set the values as soon as we get a
successful command status for HCI_LE_Create_Connection (for which the
patch adds a command status handler function) and for incoming
connections as soon as we get a LE Connection Complete HCI event.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
---
 include/net/bluetooth/hci_core.h |  4 +++
 net/bluetooth/hci_event.c        | 78 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 82 insertions(+)

diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 0c63a7e12d90..edf194679b7d 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -332,6 +332,10 @@ struct hci_conn {
 	__u8		dst_type;
 	bdaddr_t	src;
 	__u8		src_type;
+	bdaddr_t	init_addr;
+	__u8		init_addr_type;
+	bdaddr_t	resp_addr;
+	__u8		resp_addr_type;
 	__u16		handle;
 	__u16		state;
 	__u8		mode;
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index e3d7151e808e..3ae8ae1a029c 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1641,6 +1641,47 @@ static void hci_cs_accept_phylink(struct hci_dev *hdev, u8 status)
 	amp_write_remote_assoc(hdev, cp->phy_handle);
 }
 
+static void hci_cs_le_create_conn(struct hci_dev *hdev, u8 status)
+{
+	struct hci_cp_le_create_conn *cp;
+	struct hci_conn *conn;
+
+	BT_DBG("%s status 0x%2.2x", hdev->name, status);
+
+	/* All connection failure handling is taken care of by the
+	 * hci_le_conn_failed function which is triggered by the HCI
+	 * request completion callbacks used for connecting.
+	 */
+	if (status)
+		return;
+
+	cp = hci_sent_cmd_data(hdev, HCI_OP_LE_CREATE_CONN);
+	if (!cp)
+		return;
+
+	hci_dev_lock(hdev);
+
+	conn = hci_conn_hash_lookup_ba(hdev, LE_LINK, &cp->peer_addr);
+	if (!conn)
+		goto unlock;
+
+	/* Store the initiator and responder address information which
+	 * is needed for SMP. These values will not change during the
+	 * lifetime of the connection.
+	 */
+	conn->init_addr_type = cp->own_address_type;
+	if (cp->own_address_type == ADDR_LE_DEV_RANDOM)
+		bacpy(&conn->init_addr, &hdev->random_addr);
+	else
+		bacpy(&conn->init_addr, &hdev->bdaddr);
+
+	conn->resp_addr_type = cp->peer_addr_type;
+	bacpy(&conn->resp_addr, &cp->peer_addr);
+
+unlock:
+	hci_dev_unlock(hdev);
+}
+
 static void hci_inquiry_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
 {
 	__u8 status = *((__u8 *) skb->data);
@@ -2532,6 +2573,10 @@ static void hci_cmd_status_evt(struct hci_dev *hdev, struct sk_buff *skb)
 		hci_cs_accept_phylink(hdev, ev->status);
 		break;
 
+	case HCI_OP_LE_CREATE_CONN:
+		hci_cs_le_create_conn(hdev, ev->status);
+		break;
+
 	default:
 		BT_DBG("%s opcode 0x%4.4x", hdev->name, opcode);
 		break;
@@ -3716,6 +3761,39 @@ static void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
 			conn->out = true;
 			conn->link_mode |= HCI_LM_MASTER;
 		}
+
+		/* If we didn't have a hci_conn object previously
+		 * but we're in master role this must be something
+		 * initiated using a white list. Since white list based
+		 * connections are not "first class citizens" we don't
+		 * have full tracking of them. Therefore, we go ahead
+		 * with a "best effort" approach of determining the
+		 * initiator address based on the HCI_PRIVACY flag.
+		 */
+		if (conn->out) {
+			conn->resp_addr_type = ev->bdaddr_type;
+			bacpy(&conn->resp_addr, &ev->bdaddr);
+			if (test_bit(HCI_PRIVACY, &hdev->dev_flags)) {
+				conn->init_addr_type = ADDR_LE_DEV_RANDOM;
+				bacpy(&conn->init_addr, &hdev->rpa);
+			} else {
+				hci_copy_identity_address(hdev,
+							  &conn->init_addr,
+							  &conn->init_addr_type);
+			}
+		} else {
+			/* Set the responder (our side) address type based on
+			 * the advertising address type.
+			 */
+			conn->resp_addr_type = hdev->adv_addr_type;
+			if (hdev->adv_addr_type == ADDR_LE_DEV_RANDOM)
+				bacpy(&conn->resp_addr, &hdev->random_addr);
+			else
+				bacpy(&conn->resp_addr, &hdev->bdaddr);
+
+			conn->init_addr_type = ev->bdaddr_type;
+			bacpy(&conn->init_addr, &ev->bdaddr);
+		}
 	}
 
 	/* Ensure that the hci_conn contains the identity address type
-- 
1.8.5.3


^ permalink raw reply related

* [PATCH v2 4/4] Bluetooth: Use hdev->init/resp_addr values for smp_c1 function
From: johan.hedberg @ 2014-02-28 10:54 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1393584857-30375-1-git-send-email-johan.hedberg@gmail.com>

From: Johan Hedberg <johan.hedberg@intel.com>

Now that we have nicely tracked values of the initiator and responder
address information we can pass that directly to the smp_c1 function
without worrying e.g. about who initiated the connection. This patch
updates the two places in smp.c to use the new variables.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
---
 net/bluetooth/smp.c | 22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index f1cb6a32e93f..4f4ff36f5f34 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -445,14 +445,9 @@ static void confirm_work(struct work_struct *work)
 	/* Prevent mutual access to hdev->tfm_aes */
 	hci_dev_lock(hdev);
 
-	if (conn->hcon->out)
-		ret = smp_c1(tfm, smp->tk, smp->prnd, smp->preq, smp->prsp,
-			     conn->hcon->src_type, &conn->hcon->src,
-			     conn->hcon->dst_type, &conn->hcon->dst, res);
-	else
-		ret = smp_c1(tfm, smp->tk, smp->prnd, smp->preq, smp->prsp,
-			     conn->hcon->dst_type, &conn->hcon->dst,
-			     conn->hcon->src_type, &conn->hcon->src, res);
+	ret = smp_c1(tfm, smp->tk, smp->prnd, smp->preq, smp->prsp,
+		     conn->hcon->init_addr_type, &conn->hcon->init_addr,
+		     conn->hcon->resp_addr_type, &conn->hcon->resp_addr, res);
 
 	hci_dev_unlock(hdev);
 
@@ -492,14 +487,9 @@ static void random_work(struct work_struct *work)
 	/* Prevent mutual access to hdev->tfm_aes */
 	hci_dev_lock(hdev);
 
-	if (hcon->out)
-		ret = smp_c1(tfm, smp->tk, smp->rrnd, smp->preq, smp->prsp,
-			     hcon->src_type, &hcon->src,
-			     hcon->dst_type, &hcon->dst, res);
-	else
-		ret = smp_c1(tfm, smp->tk, smp->rrnd, smp->preq, smp->prsp,
-			     hcon->dst_type, &hcon->dst,
-			     hcon->src_type, &hcon->src, res);
+	ret = smp_c1(tfm, smp->tk, smp->rrnd, smp->preq, smp->prsp,
+		     hcon->init_addr_type, &hcon->init_addr,
+		     hcon->resp_addr_type, &hcon->resp_addr, res);
 
 	hci_dev_unlock(hdev);
 
-- 
1.8.5.3


^ permalink raw reply related

* Re: [PATCH] avrcp: Fix buffer size
From: Andrei Emeltchenko @ 2014-02-28 11:17 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1393584252-10947-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>

On Fri, Feb 28, 2014 at 12:44:12PM +0200, Andrei Emeltchenko wrote:
> From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> 
> For avrcp_get_current_player_value() buffer size needs to be
> AVRCP_ATTRIBUTE_LAST + 1 for all attributes + 1 for number of attributes
> written first, not counting header.

Sorry, please disregard this, attribute 0 should not be used.

> ---
>  profiles/audio/avrcp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
> index c0e5d07..8098c62 100644
> --- a/profiles/audio/avrcp.c
> +++ b/profiles/audio/avrcp.c
> @@ -1905,7 +1905,7 @@ static gboolean avrcp_player_value_rsp(struct avctp *conn,
>  static void avrcp_get_current_player_value(struct avrcp *session,
>  						uint8_t *attrs, uint8_t count)
>  {
> -	uint8_t buf[AVRCP_HEADER_LENGTH + AVRCP_ATTRIBUTE_LAST + 1];
> +	uint8_t buf[AVRCP_HEADER_LENGTH + AVRCP_ATTRIBUTE_LAST + 2];
>  	struct avrcp_header *pdu = (void *) buf;
>  	uint16_t length = AVRCP_HEADER_LENGTH + count + 1;
>  
> -- 
> 1.8.3.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH 01/13] android/hal-gatt-api: Add Server Register Notification
From: Grzegorz Kolodziejczyk @ 2014-02-28 11:19 UTC (permalink / raw)
  To: linux-bluetooth

---
 android/hal-ipc-api.txt | 5 +++++
 android/hal-msg.h       | 7 +++++++
 2 files changed, 12 insertions(+)

diff --git a/android/hal-ipc-api.txt b/android/hal-ipc-api.txt
index 04c0b7c..bed8caf 100644
--- a/android/hal-ipc-api.txt
+++ b/android/hal-ipc-api.txt
@@ -1950,6 +1950,11 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		                         Server Interface (4 octets)
 
 	Opcode 0x93 - Register Server notification
+
+		Notification parameters: Status (4 octets)
+		                         Server (4 octets)
+		                         UUID (16 octets)
+
 	Opcode 0x94 - Connection notification
 	Opcode 0x95 - Service Added notification
 	Opcode 0x96 - Included Service Added notification
diff --git a/android/hal-msg.h b/android/hal-msg.h
index 95ce551..340f7ee 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
@@ -1398,3 +1398,10 @@ struct hal_ev_gatt_client_listen {
 	int32_t status;
 	int32_t server_if;
 } __attribute__((packed));
+
+#define HAL_EV_GATT_SERVER_REGISTER		0x93
+struct hal_ev_gatt_server_register {
+	int32_t status;
+	int32_t server_if;
+	uint8_t uuid[16];
+} __attribute__((packed));
-- 
1.8.5.2


^ permalink raw reply related

* [PATCH 02/13] android/hal-gatt-api: Add Server Connection Notification
From: Grzegorz Kolodziejczyk @ 2014-02-28 11:19 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1393586404-25190-1-git-send-email-grzegorz.kolodziejczyk@tieto.com>

---
 android/hal-ipc-api.txt | 6 ++++++
 android/hal-msg.h       | 8 ++++++++
 2 files changed, 14 insertions(+)

diff --git a/android/hal-ipc-api.txt b/android/hal-ipc-api.txt
index bed8caf..70dfb90 100644
--- a/android/hal-ipc-api.txt
+++ b/android/hal-ipc-api.txt
@@ -1956,6 +1956,12 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		                         UUID (16 octets)
 
 	Opcode 0x94 - Connection notification
+
+		Notification parameters: Connection ID (4 octets)
+		                         Server (4 octets)
+		                         Connected (4 octets)
+		                         Address (6 octets)
+
 	Opcode 0x95 - Service Added notification
 	Opcode 0x96 - Included Service Added notification
 	Opcode 0x97 - Characteristic Added notification
diff --git a/android/hal-msg.h b/android/hal-msg.h
index 340f7ee..bfc6fce 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
@@ -1405,3 +1405,11 @@ struct hal_ev_gatt_server_register {
 	int32_t server_if;
 	uint8_t uuid[16];
 } __attribute__((packed));
+
+#define HAL_EV_GATT_SERVER_CONNECTION		0x94
+struct hal_ev_gatt_server_connection {
+	int32_t conn_id;
+	int32_t server_if;
+	int32_t connected;
+	uint8_t bdaddr[6];
+} __attribute__((packed));
-- 
1.8.5.2


^ permalink raw reply related

* [PATCH 03/13] android/hal-gatt-api: Add Server Service Added Notification
From: Grzegorz Kolodziejczyk @ 2014-02-28 11:19 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1393586404-25190-1-git-send-email-grzegorz.kolodziejczyk@tieto.com>

---
 android/hal-ipc-api.txt | 12 ++++++++++++
 android/hal-msg.h       |  8 ++++++++
 2 files changed, 20 insertions(+)

diff --git a/android/hal-ipc-api.txt b/android/hal-ipc-api.txt
index 70dfb90..eb879ce 100644
--- a/android/hal-ipc-api.txt
+++ b/android/hal-ipc-api.txt
@@ -1963,6 +1963,18 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		                         Address (6 octets)
 
 	Opcode 0x95 - Service Added notification
+
+		Notification parameters: Status (4 octets)
+		                         Server (4 octets)
+		                         Service ID (18 octets)
+		                         Service Handle (4 octets)
+
+		Valid Service ID: ID (17 octets)
+		                  Is Primary (1 octet)
+
+		Valid ID: UUID (16 octets)
+		          Instance ID (1 octet)
+
 	Opcode 0x96 - Included Service Added notification
 	Opcode 0x97 - Characteristic Added notification
 	Opcode 0x98 - Descriptor Added notification
diff --git a/android/hal-msg.h b/android/hal-msg.h
index bfc6fce..03267f7 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
@@ -1413,3 +1413,11 @@ struct hal_ev_gatt_server_connection {
 	int32_t connected;
 	uint8_t bdaddr[6];
 } __attribute__((packed));
+
+#define HAL_EV_GATT_SERVER_SERVICE_ADDED	0x95
+struct hal_ev_gatt_server_service_added {
+	int32_t status;
+	int32_t server_if;
+	struct hal_gatt_srvc_id srvc_id;
+	int32_t srvc_handle;
+} __attribute__((packed));
-- 
1.8.5.2


^ permalink raw reply related

* [PATCH 04/13] android/hal-gatt-api: Add Server Included Service Added Notification
From: Grzegorz Kolodziejczyk @ 2014-02-28 11:19 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1393586404-25190-1-git-send-email-grzegorz.kolodziejczyk@tieto.com>

---
 android/hal-ipc-api.txt | 6 ++++++
 android/hal-msg.h       | 8 ++++++++
 2 files changed, 14 insertions(+)

diff --git a/android/hal-ipc-api.txt b/android/hal-ipc-api.txt
index eb879ce..454694d 100644
--- a/android/hal-ipc-api.txt
+++ b/android/hal-ipc-api.txt
@@ -1976,6 +1976,12 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		          Instance ID (1 octet)
 
 	Opcode 0x96 - Included Service Added notification
+
+		Notification patemeters: Status (4 octets)
+		                         Server (4 octets)
+		                         Service Handle (4 octets)
+		                         Included Service Handle (4 octets)
+
 	Opcode 0x97 - Characteristic Added notification
 	Opcode 0x98 - Descriptor Added notification
 	Opcode 0x99 - Service Started notification
diff --git a/android/hal-msg.h b/android/hal-msg.h
index 03267f7..0452856 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
@@ -1421,3 +1421,11 @@ struct hal_ev_gatt_server_service_added {
 	struct hal_gatt_srvc_id srvc_id;
 	int32_t srvc_handle;
 } __attribute__((packed));
+
+#define HAL_EV_GATT_SERVER_INC_SRVC_ADDED	0x96
+struct hal_ev_gatt_server_inc_srvc_added {
+	int32_t status;
+	int32_t server_if;
+	int32_t srvc_handle;
+	int32_t incl_srvc_handle;
+} __attribute__((packed));
-- 
1.8.5.2


^ permalink raw reply related

* [PATCH 05/13] android/hal-gatt-api: Add Server Characteristic Added Notification
From: Grzegorz Kolodziejczyk @ 2014-02-28 11:19 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1393586404-25190-1-git-send-email-grzegorz.kolodziejczyk@tieto.com>

---
 android/hal-ipc-api.txt | 7 +++++++
 android/hal-msg.h       | 9 +++++++++
 2 files changed, 16 insertions(+)

diff --git a/android/hal-ipc-api.txt b/android/hal-ipc-api.txt
index 454694d..88bcc12 100644
--- a/android/hal-ipc-api.txt
+++ b/android/hal-ipc-api.txt
@@ -1983,6 +1983,13 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		                         Included Service Handle (4 octets)
 
 	Opcode 0x97 - Characteristic Added notification
+
+		Notification parameters: Status (4 octets)
+		                         Server (4 octets)
+		                         UUID (16 octets)
+		                         Service Handle (4 octets)
+		                         Characteristic Handle (4 octets)
+
 	Opcode 0x98 - Descriptor Added notification
 	Opcode 0x99 - Service Started notification
 	Opcode 0x9a - Service Stopped notification
diff --git a/android/hal-msg.h b/android/hal-msg.h
index 0452856..37d1252 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
@@ -1429,3 +1429,12 @@ struct hal_ev_gatt_server_inc_srvc_added {
 	int32_t srvc_handle;
 	int32_t incl_srvc_handle;
 } __attribute__((packed));
+
+#define HAL_EV_GATT_SERVER_CHAR_ADDED		0x97
+struct hal_ev_gatt_server_characteristic_added {
+	int32_t status;
+	int32_t server_if;
+	uint8_t uuid[16];
+	int32_t srvc_handle;
+	int32_t char_handle;
+} __attribute__((packed));
-- 
1.8.5.2


^ permalink raw reply related

* [PATCH 06/13] android/hal-gatt-api: Add Server Descriptor Added Notification
From: Grzegorz Kolodziejczyk @ 2014-02-28 11:19 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1393586404-25190-1-git-send-email-grzegorz.kolodziejczyk@tieto.com>

---
 android/hal-ipc-api.txt | 7 +++++++
 android/hal-msg.h       | 9 +++++++++
 2 files changed, 16 insertions(+)

diff --git a/android/hal-ipc-api.txt b/android/hal-ipc-api.txt
index 88bcc12..f7c9f7d 100644
--- a/android/hal-ipc-api.txt
+++ b/android/hal-ipc-api.txt
@@ -1991,6 +1991,13 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		                         Characteristic Handle (4 octets)
 
 	Opcode 0x98 - Descriptor Added notification
+
+		Notification parameters: Status (4 octets)
+		                         Server (4 octets)
+		                         UUID (6 octets)
+		                         Service Handle (4 octets)
+		                         Descriptor Handle (4 octets)
+
 	Opcode 0x99 - Service Started notification
 	Opcode 0x9a - Service Stopped notification
 	Opcode 0x9b - Service Deleted notification
diff --git a/android/hal-msg.h b/android/hal-msg.h
index 37d1252..e411728 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
@@ -1438,3 +1438,12 @@ struct hal_ev_gatt_server_characteristic_added {
 	int32_t srvc_handle;
 	int32_t char_handle;
 } __attribute__((packed));
+
+#define HAL_EV_GATT_SERVER_DESCRIPTOR_ADDED	0x98
+struct hal_ev_gatt_server_descriptor_added {
+	int32_t status;
+	int32_t server_if;
+	uint8_t uuid[16];
+	int32_t srvc_handle;
+	int32_t descr_handle;
+} __attribute__((packed));
-- 
1.8.5.2


^ permalink raw reply related

* [PATCH 07/13] android/hal-gatt-api: Add Server Service Started Notification
From: Grzegorz Kolodziejczyk @ 2014-02-28 11:19 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1393586404-25190-1-git-send-email-grzegorz.kolodziejczyk@tieto.com>

---
 android/hal-ipc-api.txt | 5 +++++
 android/hal-msg.h       | 7 +++++++
 2 files changed, 12 insertions(+)

diff --git a/android/hal-ipc-api.txt b/android/hal-ipc-api.txt
index f7c9f7d..8bf8af6 100644
--- a/android/hal-ipc-api.txt
+++ b/android/hal-ipc-api.txt
@@ -1999,6 +1999,11 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		                         Descriptor Handle (4 octets)
 
 	Opcode 0x99 - Service Started notification
+
+		Notification parameters: Status (4 octets)
+		                         Server (4 octets)
+		                         Service Handle (4 octets)
+
 	Opcode 0x9a - Service Stopped notification
 	Opcode 0x9b - Service Deleted notification
 	Opcode 0x9c - Request Read notification
diff --git a/android/hal-msg.h b/android/hal-msg.h
index e411728..7bba250 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
@@ -1447,3 +1447,10 @@ struct hal_ev_gatt_server_descriptor_added {
 	int32_t srvc_handle;
 	int32_t descr_handle;
 } __attribute__((packed));
+
+#define HAL_EV_GATT_SERVER_SERVICE_STARTED	0x99
+struct hal_ev_gatt_server_service_started {
+	int32_t status;
+	int32_t server_if;
+	int32_t srvc_handle;
+} __attribute__((packed));
-- 
1.8.5.2


^ permalink raw reply related

* [PATCH 08/13] android/hal-gatt-api: Add Server Service Stopped Notification
From: Grzegorz Kolodziejczyk @ 2014-02-28 11:19 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1393586404-25190-1-git-send-email-grzegorz.kolodziejczyk@tieto.com>

---
 android/hal-ipc-api.txt | 5 +++++
 android/hal-msg.h       | 7 +++++++
 2 files changed, 12 insertions(+)

diff --git a/android/hal-ipc-api.txt b/android/hal-ipc-api.txt
index 8bf8af6..116dfba 100644
--- a/android/hal-ipc-api.txt
+++ b/android/hal-ipc-api.txt
@@ -2005,6 +2005,11 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		                         Service Handle (4 octets)
 
 	Opcode 0x9a - Service Stopped notification
+
+		Notification parameters: Status (4 octets)
+		                         Server (4 octets)
+		                         Service Handle (4 octets)
+
 	Opcode 0x9b - Service Deleted notification
 	Opcode 0x9c - Request Read notification
 	Opcode 0x9d - Request Write notification
diff --git a/android/hal-msg.h b/android/hal-msg.h
index 7bba250..4219312 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
@@ -1454,3 +1454,10 @@ struct hal_ev_gatt_server_service_started {
 	int32_t server_if;
 	int32_t srvc_handle;
 } __attribute__((packed));
+
+#define HAL_EV_GATT_SERVER_SERVICE_STOPPED	0x9a
+struct hal_ev_gatt_server_service_stopped {
+	int32_t status;
+	int32_t server_if;
+	int32_t srvc_handle;
+} __attribute__((packed));
-- 
1.8.5.2


^ permalink raw reply related

* [PATCH 09/13] android/hal-gatt-api: Add Server Service Deleted Notification
From: Grzegorz Kolodziejczyk @ 2014-02-28 11:20 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1393586404-25190-1-git-send-email-grzegorz.kolodziejczyk@tieto.com>

---
 android/hal-ipc-api.txt | 5 +++++
 android/hal-msg.h       | 7 +++++++
 2 files changed, 12 insertions(+)

diff --git a/android/hal-ipc-api.txt b/android/hal-ipc-api.txt
index 116dfba..5cf22a8 100644
--- a/android/hal-ipc-api.txt
+++ b/android/hal-ipc-api.txt
@@ -2011,6 +2011,11 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		                         Service Handle (4 octets)
 
 	Opcode 0x9b - Service Deleted notification
+
+		Notification parameters: Status (4 octets)
+		                         Server (4 octets)
+		                         Service Handle (4 octets)
+
 	Opcode 0x9c - Request Read notification
 	Opcode 0x9d - Request Write notification
 	Opcode 0x9e - Request Execute Write notification
diff --git a/android/hal-msg.h b/android/hal-msg.h
index 4219312..ee4ac18 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
@@ -1461,3 +1461,10 @@ struct hal_ev_gatt_server_service_stopped {
 	int32_t server_if;
 	int32_t srvc_handle;
 } __attribute__((packed));
+
+#define HAL_EV_GATT_SERVER_SERVICE_DELETED	0x9b
+struct hal_ev_gatt_server_service_deleted {
+	int32_t status;
+	int32_t server_if;
+	int32_t srvc_handle;
+} __attribute__((packed));
-- 
1.8.5.2


^ permalink raw reply related

* [PATCH 10/13] android/hal-gatt-api: Add Server Request Read Notification
From: Grzegorz Kolodziejczyk @ 2014-02-28 11:20 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1393586404-25190-1-git-send-email-grzegorz.kolodziejczyk@tieto.com>

---
 android/hal-ipc-api.txt |  8 ++++++++
 android/hal-msg.h       | 10 ++++++++++
 2 files changed, 18 insertions(+)

diff --git a/android/hal-ipc-api.txt b/android/hal-ipc-api.txt
index 5cf22a8..08dbed6 100644
--- a/android/hal-ipc-api.txt
+++ b/android/hal-ipc-api.txt
@@ -2017,6 +2017,14 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		                         Service Handle (4 octets)
 
 	Opcode 0x9c - Request Read notification
+
+		Notification parameters: Connection ID (4 octets)
+		                         Trans ID (4 octets)
+		                         Address (6 octets)
+		                         Attribute Handle (4 octets)
+		                         Offset (4 octets)
+		                         Is Long (1 octet)
+
 	Opcode 0x9d - Request Write notification
 	Opcode 0x9e - Request Execute Write notification
 	Opcode 0x9f - Response Confirmation notification
diff --git a/android/hal-msg.h b/android/hal-msg.h
index ee4ac18..7d54d29 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
@@ -1468,3 +1468,13 @@ struct hal_ev_gatt_server_service_deleted {
 	int32_t server_if;
 	int32_t srvc_handle;
 } __attribute__((packed));
+
+#define HAL_EV_GATT_SERVER_REQUEST_READ		0x9c
+struct hal_ev_gatt_server_request_read {
+	int32_t conn_id;
+	int32_t trans_id;
+	uint8_t bdaddr[6];
+	int32_t attr_handle;
+	int32_t offset;
+	uint8_t is_long;
+} __attribute__((packed));
-- 
1.8.5.2


^ permalink raw reply related

* [PATCH 11/13] android/hal-gatt-api: Add Server Request Write Notification
From: Grzegorz Kolodziejczyk @ 2014-02-28 11:20 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1393586404-25190-1-git-send-email-grzegorz.kolodziejczyk@tieto.com>

---
 android/hal-ipc-api.txt | 11 +++++++++++
 android/hal-msg.h       | 13 +++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/android/hal-ipc-api.txt b/android/hal-ipc-api.txt
index 08dbed6..9aee3ab 100644
--- a/android/hal-ipc-api.txt
+++ b/android/hal-ipc-api.txt
@@ -2026,5 +2026,16 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		                         Is Long (1 octet)
 
 	Opcode 0x9d - Request Write notification
+
+		Notification parameters: Connection ID (4 octets)
+		                         Trans ID (4 octets)
+		                         Address (6 octets)
+		                         Attribute Handle (4 octets)
+		                         Offset (4 octets)
+		                         Length (4 octets)
+		                         Need Response (4 octets)
+		                         Is Prepare (1 octet)
+		                         Value (variable)
+
 	Opcode 0x9e - Request Execute Write notification
 	Opcode 0x9f - Response Confirmation notification
diff --git a/android/hal-msg.h b/android/hal-msg.h
index 7d54d29..ad57e23 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
@@ -1478,3 +1478,16 @@ struct hal_ev_gatt_server_request_read {
 	int32_t offset;
 	uint8_t is_long;
 } __attribute__((packed));
+
+#define HAL_EV_GATT_SERVER_REQUEST_WRITE	0x9d
+struct hal_ev_gatt_server_request_write {
+	int32_t conn_id;
+	int32_t trans_id;
+	uint8_t bdaddr[6];
+	int32_t attr_handle;
+	int32_t offset;
+	int32_t length;
+	uint8_t need_rsp;
+	uint8_t is_prep;
+	uint8_t value[0];
+} __attribute__((packed));
-- 
1.8.5.2


^ permalink raw reply related

* [PATCH 12/13] android/hal-gatt-api: Add Server Request Execute Write Notification
From: Grzegorz Kolodziejczyk @ 2014-02-28 11:20 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1393586404-25190-1-git-send-email-grzegorz.kolodziejczyk@tieto.com>

---
 android/hal-ipc-api.txt | 6 ++++++
 android/hal-msg.h       | 8 ++++++++
 2 files changed, 14 insertions(+)

diff --git a/android/hal-ipc-api.txt b/android/hal-ipc-api.txt
index 9aee3ab..f4d5c91 100644
--- a/android/hal-ipc-api.txt
+++ b/android/hal-ipc-api.txt
@@ -2038,4 +2038,10 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		                         Value (variable)
 
 	Opcode 0x9e - Request Execute Write notification
+
+		Notification parameters: Connection ID (4 octets)
+		                         Trans ID (4 octets)
+		                         Address (6 octets)
+		                         Execute Write (4 octets)
+
 	Opcode 0x9f - Response Confirmation notification
diff --git a/android/hal-msg.h b/android/hal-msg.h
index ad57e23..12dc8dc 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
@@ -1491,3 +1491,11 @@ struct hal_ev_gatt_server_request_write {
 	uint8_t is_prep;
 	uint8_t value[0];
 } __attribute__((packed));
+
+#define HAL_EV_GATT_SERVER_REQUEST_EXEC_WRITE	0x9e
+struct hal_ev_gatt_server_request_exec_write {
+	int32_t conn_id;
+	int32_t trans_id;
+	uint8_t bdaddr[6];
+	int32_t exec_write;
+} __attribute__((packed));
-- 
1.8.5.2


^ permalink raw reply related

* [PATCH 13/13] android/hal-gatt-api: Add Server Response Confirmation Notification
From: Grzegorz Kolodziejczyk @ 2014-02-28 11:20 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1393586404-25190-1-git-send-email-grzegorz.kolodziejczyk@tieto.com>

---
 android/hal-ipc-api.txt | 3 +++
 android/hal-msg.h       | 6 ++++++
 2 files changed, 9 insertions(+)

diff --git a/android/hal-ipc-api.txt b/android/hal-ipc-api.txt
index f4d5c91..0518c2f 100644
--- a/android/hal-ipc-api.txt
+++ b/android/hal-ipc-api.txt
@@ -2045,3 +2045,6 @@ Android HAL name: "gatt" (BT_PROFILE_GATT_ID)
 		                         Execute Write (4 octets)
 
 	Opcode 0x9f - Response Confirmation notification
+
+		Notification parameters: Status (4 octets)
+		                         Handle (4 octets)
diff --git a/android/hal-msg.h b/android/hal-msg.h
index 12dc8dc..d885eb1 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
@@ -1499,3 +1499,9 @@ struct hal_ev_gatt_server_request_exec_write {
 	uint8_t bdaddr[6];
 	int32_t exec_write;
 } __attribute__((packed));
+
+#define HAL_EV_GATT_SERVER_RSP_CONFIRMATION	0x9f
+struct hal_ev_gatt_server_rsp_confirmation {
+	int32_t status;
+	int32_t handle;
+} __attribute__((packed));
-- 
1.8.5.2


^ permalink raw reply related

* [PATCH] avrcp: Fix buffer size check
From: Andrei Emeltchenko @ 2014-02-28 11:32 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1393584252-10947-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

Fix size check taking into account that attributes starts from 1 (0 is
illegal).
---
 profiles/audio/avrcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index c0e5d07..48c3355 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -1909,7 +1909,7 @@ static void avrcp_get_current_player_value(struct avrcp *session,
 	struct avrcp_header *pdu = (void *) buf;
 	uint16_t length = AVRCP_HEADER_LENGTH + count + 1;
 
-	if (count > AVRCP_ATTRIBUTE_LAST + 1)
+	if (count > AVRCP_ATTRIBUTE_LAST)
 		return;
 
 	memset(buf, 0, sizeof(buf));
-- 
1.8.3.2


^ permalink raw reply related

* Re: [v2] android/pics: Add PICS and PIXIT for HSP
From: Szymon Janc @ 2014-02-28 12:11 UTC (permalink / raw)
  To: Sebastian Chlad; +Cc: linux-bluetooth
In-Reply-To: <1393330071-30103-1-git-send-email-sebastian.chlad@tieto.com>

Hi Sebastian,

On Tuesday 25 of February 2014 13:07:51 Sebastian Chlad wrote:
> Added PICS and PIXIT target Android 4.4
> ---
>  android/Makefile.am   |   2 +
>  android/pics-hsp.txt  | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++
>  android/pixit-hsp.txt |  30 +++++++++++++++
>  3 files changed, 135 insertions(+)
>  create mode 100644 android/pics-hsp.txt
>  create mode 100644 android/pixit-hsp.txt
> 
> diff --git a/android/Makefile.am b/android/Makefile.am
> index 50d0dc0..58cfbae 100644
> --- a/android/Makefile.am
> +++ b/android/Makefile.am
> @@ -188,6 +188,7 @@ EXTRA_DIST += android/Android.mk android/README \
>  				android/pics-a2dp.txt \
>  				android/pics-avctp.txt \
>  				android/pics-avrcp.txt \
> +				android/pics-hsp.txt \
>  				android/pixit-l2cap.txt \
>  				android/pixit-gap.txt \
>  				android/pixit-did.txt \
> @@ -199,6 +200,7 @@ EXTRA_DIST += android/Android.mk android/README \
>  				android/pixit-a2dp.txt \
>  				android/pixit-avctp.txt \
>  				android/pixit-avrcp.txt \
> +				android/pixit-hsp.txt \
>  				android/pts-l2cap.txt \
>  				android/pts-gap.txt \
>  				android/pts-did.txt \
> diff --git a/android/pics-hsp.txt b/android/pics-hsp.txt
> new file mode 100644
> index 0000000..3e996ab
> --- /dev/null
> +++ b/android/pics-hsp.txt
> @@ -0,0 +1,103 @@
> +HSP PICS for the PTS tool.
> +
> +PTS version: 5.0
> +
> +* - different than PTS defaults
> +# - not yet implemented/supported
> +
> +M - mandatory
> +O - optional
> +
> +		Version
> +-------------------------------------------------------------------------------
> +Parameter Name	Selected	Description
> +-------------------------------------------------------------------------------
> +TSPC_HSP_0_1	False		Version: Headset Profile v1.1 (C.1)
> +TSPC_HSP_0_2	True (*)	Version: Headset Profile v1.2 (C.1)
> +-------------------------------------------------------------------------------
> +C.1: Mandatory to support one and only one of these versions.
> +-------------------------------------------------------------------------------
> +
> +
> +		Roles
> +-------------------------------------------------------------------------------
> +Parameter Name	Selected	Description
> +-------------------------------------------------------------------------------
> +TSPC_HSP_1_1	True (*)	Role: Audio Gateway (AG) (C.1)
> +TSPC_HSP_1_2	False		Role: Headset (HS) (C.1)
> +-------------------------------------------------------------------------------
> +C.1: Mandatory to support at least one of the defined roles.
> +-------------------------------------------------------------------------------
> +
> +
> +		Audio Gateway Role
> +-------------------------------------------------------------------------------
> +Parameter Name	Selected	Description
> +-------------------------------------------------------------------------------
> +TSPC_HSP_2_1	True		Incoming audio connection establishment (M)
> +TSPC_HSP_2_2	True (*)	Ring (AT command) (C.3)
> +TSPC_HSP_2_3	False 		Inband ring tone (O)
> +TSPC_HSP_2_4	True (*)	Outgoing audio connection establishment (O)
> +TSPC_HSP_2_5	True (*)	Audio connection release from HS (C.5)
> +TSPC_HSP_2_6	True 		Audio connection release from AG (M)
> +TSPC_HSP_2_7	True		Audio connection transfer: AG to HS (M)
> +TSPC_HSP_2_8	True		Audio connection transfer: HS to AG (M)
> +TSPC_HSP_2_9	False		Remote audio volume control (C.1)
> +TSPC_HSP_2_10	False		HS informs AG about local changes of audio
> +					volume (O)
> +TSPC_HSP_2_11	False		Audio volume setting storage by HS (O)
> +TSPC_HSP_2_12	False		Remote microphone gain control (C.2)
> +TSPC_HSP_2_13	False		HS informs AG about local changes of microphone
> +					gain (O)
> +TSPC_HSP_2_14	False		Microphone gain setting storage by HS (O)
> +TSPC_HSP_2_15	True		Connection handling with Detach/Page (M)
> +TSPC_HSP_2_16	False		Connection handling with Park Mode (C.4)
> +-------------------------------------------------------------------------------
> +C.1: Mandatory if TSPC_HSP_2_10 is supported, otherwise optional
> +C:2: Mandatory if TSPC_HSP_2_13 is supported, otherwise optional
> +C.3: Excluded if TSPC_HSP_2_3 and TSPC_HSP_4_1 ("Show that in-band
> +	ringing and RING are mutually exclusive") are supported,
> +	otherwise optional
> +C.4: Excluded if TSPC_HSP_0_2 is supported, otherwise optional
> +C.5: Mandatory if TSPC_HSP_0_1 is supported, otherwise optional
> +-------------------------------------------------------------------------------
> +
> +
> +		Headset Application Features
> +-------------------------------------------------------------------------------
> +Parameter Name	Selected	Description
> +-------------------------------------------------------------------------------
> +TSPC_HSP_3_1	False (*)	Incoming audio connection establishment (M)
> +TSPC_HSP_3_2	False (*)	Ring (AT command) (M)
> +TSPC_HSP_3_3	False (*)	Inband ring tone (M)
> +TSPC_HSP_3_4	False (*)	Outgoing audio connection establishment (M)
> +TSPC_HSP_3_5	False (*)	Audio connection release from HS (M)
> +TSPC_HSP_3_6	False (*)	Audio connection release from AG (M)
> +TSPC_HSP_3_7	False (*)	Audio connection transfer: AG to HS (M)
> +TSPC_HSP_3_8	False (*)	Audio connection transfer: HS to AG (M)
> +TSPC_HSP_3_9	False		Remote audio volume control (C.1)
> +TSPC_HSP_3_10	False		HS informs AG about local changes of audio
> +                                        volume (O)
> +TSPC_HSP_3_11	False		Audio volume setting storage by HS (O)
> +TSPC_HSP_3_12	False		Remote microphone gain control (C.2)
> +TSPC_HSP_3_13	False		HS informs AG about local changes of microphone
> +                                        gain (O)
> +TSPC_HSP_3_14	False (*)	Microphone gain setting storage by HS (O)
> +TSPC_HSP_3_15	False		Connection handling with Detach/Page (M)
> +TSPC_HSP_3_16	False		Connection handling with Park Mode (C.3)
> +-------------------------------------------------------------------------------
> +C.1: Mandatory if TSPC_HSP_3_10 is supported, otherwise optional
> +C.2: Mandatory if TSPC_HSP_2_13 is supported, otherwise optional
> +C.3: Excluded if TSPC_HSP_0_2 is supported, otherwise optional
> +-------------------------------------------------------------------------------
> +
> +
> +		Errata Service Releases
> +-------------------------------------------------------------------------------
> +Parameter Name	Selected	Description
> +-------------------------------------------------------------------------------
> +TSPC_HSP_4_1	False		Show that in-band ringing and RING are
> +					mutually exclusive (C.1)
> +-------------------------------------------------------------------------------
> +C.1: Excluded if TSPC_HSP_0_2 is supported, otherwise optional
> +-------------------------------------------------------------------------------
> diff --git a/android/pixit-hsp.txt b/android/pixit-hsp.txt
> new file mode 100644
> index 0000000..a2c1181
> --- /dev/null
> +++ b/android/pixit-hsp.txt
> @@ -0,0 +1,30 @@
> +HSP PIXIT for the PTS tool.
> +
> +PTS version: 5.0
> +
> +* - different than PTS defaults
> +& - should be set to IUT Bluetooth address
> +
> +		Required PIXIT settings
> +-------------------------------------------------------------------------------
> +Parameter Name						Value
> +-------------------------------------------------------------------------------
> +TSPX_security_enabled					TRUE
> +TSPX_bd_addr_iut					012345678901 (*&)
> +TSPX_hs_class_of_device					200404
> +TSPX_ag_class_of_device					400204
> +TSPX_packet_type_sco					00A0
> +TSPX_pin_code						0000
> +TSPX_time_guard						20000000
> +TSPX_use_implicit_send					TRUE
> +TSPX_verbose_implicit_send				FALSE
> +TSPX_delete_link_key					FALSE
> +TSPX_server_channel_tester				01
> +TSPX_server_channel_iut					00
> +TSPX_no_fail_verdict					FALSE
> +TSPX_remote_audio_volume_control			TRUE
> +TSPX_secure_simple_pairing_pass_key_confirmation	FALSE
> +TSPX_inband_ring_only					FALSE
> +TSPX_no_ring_or_inband_ring_tone			FALSE
> +TSPX_iut_establish_audio_before_RING			FALSE
> +-------------------------------------------------------------------------------
> 

Applied, thanks.

-- 
Best regards, 
Szymon Janc

^ permalink raw reply


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