Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH bluetooth-next 1/5] Remove skb_deliver from IPHC.
From: Martin Townsend @ 2014-10-18  7:09 UTC (permalink / raw)
  To: linux-bluetooth, linux-wpan
  Cc: marcel, alex.aring, jukka.rissanen, Martin Townsend
In-Reply-To: <1413616153-7562-1-git-send-email-mtownsend1973@gmail.com>

Separating skb delivery from decompression ensures that we can support further
decompression schemes and removes the mixed return value of error codes with
NET_RX_FOO.

Signed-off-by: Martin Townsend <mtownsend1973@gmail.com>
---
 include/net/6lowpan.h         |  2 +-
 net/6lowpan/iphc.c            | 32 ++++++--------------------------
 net/bluetooth/6lowpan.c       | 12 +++++++++++-
 net/ieee802154/6lowpan_rtnl.c | 15 +++++----------
 4 files changed, 23 insertions(+), 38 deletions(-)

diff --git a/include/net/6lowpan.h b/include/net/6lowpan.h
index d184df1..99aa7e3 100644
--- a/include/net/6lowpan.h
+++ b/include/net/6lowpan.h
@@ -377,7 +377,7 @@ typedef int (*skb_delivery_cb)(struct sk_buff *skb, struct net_device *dev);
 int lowpan_process_data(struct sk_buff *skb, struct net_device *dev,
 		const u8 *saddr, const u8 saddr_type, const u8 saddr_len,
 		const u8 *daddr, const u8 daddr_type, const u8 daddr_len,
-		u8 iphc0, u8 iphc1, skb_delivery_cb skb_deliver);
+		u8 iphc0, u8 iphc1);
 int lowpan_header_compress(struct sk_buff *skb, struct net_device *dev,
 			unsigned short type, const void *_daddr,
 			const void *_saddr, unsigned int len);
diff --git a/net/6lowpan/iphc.c b/net/6lowpan/iphc.c
index 747b3cc..45714fe 100644
--- a/net/6lowpan/iphc.c
+++ b/net/6lowpan/iphc.c
@@ -171,29 +171,6 @@ static int uncompress_context_based_src_addr(struct sk_buff *skb,
 	return 0;
 }
 
-static int skb_deliver(struct sk_buff *skb, struct ipv6hdr *hdr,
-		       struct net_device *dev, skb_delivery_cb deliver_skb)
-{
-	int stat;
-
-	skb_push(skb, sizeof(struct ipv6hdr));
-	skb_reset_network_header(skb);
-	skb_copy_to_linear_data(skb, hdr, sizeof(struct ipv6hdr));
-
-	skb->protocol = htons(ETH_P_IPV6);
-	skb->pkt_type = PACKET_HOST;
-	skb->dev = dev;
-
-	raw_dump_table(__func__, "raw skb data dump before receiving",
-		       skb->data, skb->len);
-
-	stat = deliver_skb(skb, dev);
-
-	consume_skb(skb);
-
-	return stat;
-}
-
 /* Uncompress function for multicast destination address,
  * when M bit is set.
  */
@@ -327,7 +304,7 @@ static const u8 lowpan_ttl_values[] = { 0, 1, 64, 255 };
 int lowpan_process_data(struct sk_buff *skb, struct net_device *dev,
 			const u8 *saddr, const u8 saddr_type, const u8 saddr_len,
 			const u8 *daddr, const u8 daddr_type, const u8 daddr_len,
-			u8 iphc0, u8 iphc1, skb_delivery_cb deliver_skb)
+			u8 iphc0, u8 iphc1)
 {
 	struct ipv6hdr hdr = {};
 	u8 tmp, num_context = 0;
@@ -492,10 +469,13 @@ int lowpan_process_data(struct sk_buff *skb, struct net_device *dev,
 		hdr.version, ntohs(hdr.payload_len), hdr.nexthdr,
 		hdr.hop_limit, &hdr.daddr);
 
-	raw_dump_table(__func__, "raw header dump", (u8 *)&hdr, sizeof(hdr));
+	skb_push(skb, sizeof(hdr));
+	skb_reset_network_header(skb);
+	skb_copy_to_linear_data(skb, &hdr, sizeof(hdr));
 
-	return skb_deliver(skb, &hdr, dev, deliver_skb);
+	raw_dump_table(__func__, "raw header dump", (u8 *)&hdr, sizeof(hdr));
 
+	return 0;
 drop:
 	kfree_skb(skb);
 	return -EINVAL;
diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index 6c5c2ef..03787e0 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -290,7 +290,7 @@ static int process_data(struct sk_buff *skb, struct net_device *netdev,
 	return lowpan_process_data(skb, netdev,
 				   saddr, IEEE802154_ADDR_LONG, EUI64_ADDR_LEN,
 				   daddr, IEEE802154_ADDR_LONG, EUI64_ADDR_LEN,
-				   iphc0, iphc1, give_skb_to_upper);
+				   iphc0, iphc1);
 
 drop:
 	kfree_skb(skb);
@@ -350,6 +350,16 @@ static int recv_pkt(struct sk_buff *skb, struct net_device *dev,
 			if (ret != NET_RX_SUCCESS)
 				goto drop;
 
+			local_skb->protocol = htons(ETH_P_IPV6);
+			local_skb->pkt_type = PACKET_HOST;
+			local_skb->dev = dev;
+
+			if (give_skb_to_upper(local_skb, dev)
+					!= NET_RX_SUCCESS) {
+				kfree_skb(local_skb);
+				goto drop;
+			}
+
 			dev->stats.rx_bytes += skb->len;
 			dev->stats.rx_packets++;
 
diff --git a/net/ieee802154/6lowpan_rtnl.c b/net/ieee802154/6lowpan_rtnl.c
index 0c1a49b..82ef0df 100644
--- a/net/ieee802154/6lowpan_rtnl.c
+++ b/net/ieee802154/6lowpan_rtnl.c
@@ -190,8 +190,7 @@ static int process_data(struct sk_buff *skb, const struct ieee802154_hdr *hdr)
 
 	return lowpan_process_data(skb, skb->dev, sap, sa.addr_type,
 				   IEEE802154_ADDR_LEN, dap, da.addr_type,
-				   IEEE802154_ADDR_LEN, iphc0, iphc1,
-				   lowpan_give_skb_to_devices);
+				   IEEE802154_ADDR_LEN, iphc0, iphc1);
 
 drop:
 	kfree_skb(skb);
@@ -528,15 +527,8 @@ static int lowpan_rcv(struct sk_buff *skb, struct net_device *dev,
 
 	/* check that it's our buffer */
 	if (skb->data[0] == LOWPAN_DISPATCH_IPV6) {
-		skb->protocol = htons(ETH_P_IPV6);
-		skb->pkt_type = PACKET_HOST;
-
 		/* Pull off the 1-byte of 6lowpan header. */
 		skb_pull(skb, 1);
-
-		ret = lowpan_give_skb_to_devices(skb, NULL);
-		if (ret == NET_RX_DROP)
-			goto drop;
 	} else {
 		switch (skb->data[0] & 0xe0) {
 		case LOWPAN_DISPATCH_IPHC:	/* ipv6 datagram */
@@ -565,7 +557,10 @@ static int lowpan_rcv(struct sk_buff *skb, struct net_device *dev,
 		}
 	}
 
-	return NET_RX_SUCCESS;
+	/* Pass IPv6 packet up to the next layer */
+	skb->protocol = htons(ETH_P_IPV6);
+	skb->pkt_type = PACKET_HOST;
+	return lowpan_give_skb_to_devices(skb, NULL);
 drop_skb:
 	kfree_skb(skb);
 drop:
-- 
1.9.1

^ permalink raw reply related

* [PATCH bluetooth-next 2/5] Fix process_data return values
From: Martin Townsend @ 2014-10-18  7:09 UTC (permalink / raw)
  To: linux-bluetooth, linux-wpan
  Cc: marcel, alex.aring, jukka.rissanen, Martin Townsend
In-Reply-To: <1413616153-7562-1-git-send-email-mtownsend1973@gmail.com>

As process_data now returns just error codes fix up the calls to this
function to only drop the skb if an error code is returned.

Signed-off-by: Martin Townsend <mtownsend1973@gmail.com>
---
 net/bluetooth/6lowpan.c       | 2 +-
 net/ieee802154/6lowpan_rtnl.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index 03787e0..702bf3c 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -347,7 +347,7 @@ static int recv_pkt(struct sk_buff *skb, struct net_device *dev,
 				goto drop;
 
 			ret = process_data(local_skb, dev, chan);
-			if (ret != NET_RX_SUCCESS)
+			if (ret < 0)
 				goto drop;
 
 			local_skb->protocol = htons(ETH_P_IPV6);
diff --git a/net/ieee802154/6lowpan_rtnl.c b/net/ieee802154/6lowpan_rtnl.c
index 82ef0df..2c6bc36 100644
--- a/net/ieee802154/6lowpan_rtnl.c
+++ b/net/ieee802154/6lowpan_rtnl.c
@@ -533,14 +533,14 @@ static int lowpan_rcv(struct sk_buff *skb, struct net_device *dev,
 		switch (skb->data[0] & 0xe0) {
 		case LOWPAN_DISPATCH_IPHC:	/* ipv6 datagram */
 			ret = process_data(skb, &hdr);
-			if (ret == NET_RX_DROP)
+			if (ret < 0)
 				goto drop;
 			break;
 		case LOWPAN_DISPATCH_FRAG1:	/* first fragment header */
 			ret = lowpan_frag_rcv(skb, LOWPAN_DISPATCH_FRAG1);
 			if (ret == 1) {
 				ret = process_data(skb, &hdr);
-				if (ret == NET_RX_DROP)
+				if (ret < 0)
 					goto drop;
 			}
 			break;
@@ -548,7 +548,7 @@ static int lowpan_rcv(struct sk_buff *skb, struct net_device *dev,
 			ret = lowpan_frag_rcv(skb, LOWPAN_DISPATCH_FRAGN);
 			if (ret == 1) {
 				ret = process_data(skb, &hdr);
-				if (ret == NET_RX_DROP)
+				if (ret < 0)
 					goto drop;
 			}
 			break;
-- 
1.9.1

^ permalink raw reply related

* [PATCH bluetooth-next 3/5] Use consume_skb when packet processed successfully.
From: Martin Townsend @ 2014-10-18  7:09 UTC (permalink / raw)
  To: linux-bluetooth, linux-wpan
  Cc: marcel, alex.aring, jukka.rissanen, Martin Townsend
In-Reply-To: <1413616153-7562-1-git-send-email-mtownsend1973@gmail.com>

Signed-off-by: Martin Townsend <mtownsend1973@gmail.com>
---
 net/bluetooth/6lowpan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index 702bf3c..ec68706 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -363,7 +363,7 @@ static int recv_pkt(struct sk_buff *skb, struct net_device *dev,
 			dev->stats.rx_bytes += skb->len;
 			dev->stats.rx_packets++;
 
-			kfree_skb(skb);
+			consume_skb(skb);
 			break;
 		default:
 			break;
-- 
1.9.1

^ permalink raw reply related

* [PATCH bluetooth-next 4/5] Remove unused skb_delivery_cb typedef.
From: Martin Townsend @ 2014-10-18  7:09 UTC (permalink / raw)
  To: linux-bluetooth, linux-wpan
  Cc: marcel, alex.aring, jukka.rissanen, Martin Townsend
In-Reply-To: <1413616153-7562-1-git-send-email-mtownsend1973@gmail.com>

Signed-off-by: Martin Townsend <mtownsend1973@gmail.com>
---
 include/net/6lowpan.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/net/6lowpan.h b/include/net/6lowpan.h
index 99aa7e3..abfa359 100644
--- a/include/net/6lowpan.h
+++ b/include/net/6lowpan.h
@@ -372,8 +372,6 @@ lowpan_uncompress_size(const struct sk_buff *skb, u16 *dgram_offset)
 	return skb->len + uncomp_header - ret;
 }
 
-typedef int (*skb_delivery_cb)(struct sk_buff *skb, struct net_device *dev);
-
 int lowpan_process_data(struct sk_buff *skb, struct net_device *dev,
 		const u8 *saddr, const u8 saddr_type, const u8 saddr_len,
 		const u8 *daddr, const u8 daddr_type, const u8 daddr_len,
-- 
1.9.1

^ permalink raw reply related

* [PATCH bluetooth-next 5/5] Rename process_data and lowpan_process_data.
From: Martin Townsend @ 2014-10-18  7:09 UTC (permalink / raw)
  To: linux-bluetooth, linux-wpan
  Cc: marcel, alex.aring, jukka.rissanen, Martin Townsend
In-Reply-To: <1413616153-7562-1-git-send-email-mtownsend1973@gmail.com>

As we have decouple decompression from data delivery we can now rename all
occurences of process_data in receive path.

Signed-off-by: Martin Townsend <mtownsend1973@gmail.com>
---
 include/net/6lowpan.h         | 10 ++++++----
 net/6lowpan/iphc.c            | 12 +++++++-----
 net/bluetooth/6lowpan.c       | 15 ++++++++-------
 net/ieee802154/6lowpan_rtnl.c | 15 ++++++++-------
 4 files changed, 29 insertions(+), 23 deletions(-)

diff --git a/include/net/6lowpan.h b/include/net/6lowpan.h
index abfa359..dc03d77 100644
--- a/include/net/6lowpan.h
+++ b/include/net/6lowpan.h
@@ -372,10 +372,12 @@ lowpan_uncompress_size(const struct sk_buff *skb, u16 *dgram_offset)
 	return skb->len + uncomp_header - ret;
 }
 
-int lowpan_process_data(struct sk_buff *skb, struct net_device *dev,
-		const u8 *saddr, const u8 saddr_type, const u8 saddr_len,
-		const u8 *daddr, const u8 daddr_type, const u8 daddr_len,
-		u8 iphc0, u8 iphc1);
+int
+lowpan_header_decompress(struct sk_buff *skb, struct net_device *dev,
+			 const u8 *saddr, const u8 saddr_type,
+			 const u8 saddr_len, const u8 *daddr,
+			 const u8 daddr_type, const u8 daddr_len,
+			 u8 iphc0, u8 iphc1);
 int lowpan_header_compress(struct sk_buff *skb, struct net_device *dev,
 			unsigned short type, const void *_daddr,
 			const void *_saddr, unsigned int len);
diff --git a/net/6lowpan/iphc.c b/net/6lowpan/iphc.c
index 45714fe..73a7065 100644
--- a/net/6lowpan/iphc.c
+++ b/net/6lowpan/iphc.c
@@ -301,10 +301,12 @@ err:
 /* TTL uncompression values */
 static const u8 lowpan_ttl_values[] = { 0, 1, 64, 255 };
 
-int lowpan_process_data(struct sk_buff *skb, struct net_device *dev,
-			const u8 *saddr, const u8 saddr_type, const u8 saddr_len,
-			const u8 *daddr, const u8 daddr_type, const u8 daddr_len,
-			u8 iphc0, u8 iphc1)
+int
+lowpan_header_decompress(struct sk_buff *skb, struct net_device *dev,
+			 const u8 *saddr, const u8 saddr_type,
+			 const u8 saddr_len, const u8 *daddr,
+			 const u8 daddr_type, const u8 daddr_len,
+			 u8 iphc0, u8 iphc1)
 {
 	struct ipv6hdr hdr = {};
 	u8 tmp, num_context = 0;
@@ -480,7 +482,7 @@ drop:
 	kfree_skb(skb);
 	return -EINVAL;
 }
-EXPORT_SYMBOL_GPL(lowpan_process_data);
+EXPORT_SYMBOL_GPL(lowpan_header_decompress);
 
 static u8 lowpan_compress_addr_64(u8 **hc_ptr, u8 shift,
 				  const struct in6_addr *ipaddr,
diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index ec68706..32630c8 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -257,8 +257,8 @@ static int give_skb_to_upper(struct sk_buff *skb, struct net_device *dev)
 	return netif_rx(skb_cp);
 }
 
-static int process_data(struct sk_buff *skb, struct net_device *netdev,
-			struct l2cap_chan *chan)
+static int iphc_decompress(struct sk_buff *skb, struct net_device *netdev,
+			   struct l2cap_chan *chan)
 {
 	const u8 *saddr, *daddr;
 	u8 iphc0, iphc1;
@@ -287,10 +287,11 @@ static int process_data(struct sk_buff *skb, struct net_device *netdev,
 	if (lowpan_fetch_skb_u8(skb, &iphc1))
 		goto drop;
 
-	return lowpan_process_data(skb, netdev,
-				   saddr, IEEE802154_ADDR_LONG, EUI64_ADDR_LEN,
-				   daddr, IEEE802154_ADDR_LONG, EUI64_ADDR_LEN,
-				   iphc0, iphc1);
+	return lowpan_header_decompress(skb, netdev,
+					saddr, IEEE802154_ADDR_LONG,
+					EUI64_ADDR_LEN, daddr,
+					IEEE802154_ADDR_LONG, EUI64_ADDR_LEN,
+					iphc0, iphc1);
 
 drop:
 	kfree_skb(skb);
@@ -346,7 +347,7 @@ static int recv_pkt(struct sk_buff *skb, struct net_device *dev,
 			if (!local_skb)
 				goto drop;
 
-			ret = process_data(local_skb, dev, chan);
+			ret = iphc_decompress(local_skb, dev, chan);
 			if (ret < 0)
 				goto drop;
 
diff --git a/net/ieee802154/6lowpan_rtnl.c b/net/ieee802154/6lowpan_rtnl.c
index 2c6bc36..f33ec10 100644
--- a/net/ieee802154/6lowpan_rtnl.c
+++ b/net/ieee802154/6lowpan_rtnl.c
@@ -158,7 +158,8 @@ static int lowpan_give_skb_to_devices(struct sk_buff *skb,
 	return stat;
 }
 
-static int process_data(struct sk_buff *skb, const struct ieee802154_hdr *hdr)
+static int
+iphc_decompress(struct sk_buff *skb, const struct ieee802154_hdr *hdr)
 {
 	u8 iphc0, iphc1;
 	struct ieee802154_addr_sa sa, da;
@@ -188,9 +189,9 @@ static int process_data(struct sk_buff *skb, const struct ieee802154_hdr *hdr)
 	else
 		dap = &da.hwaddr;
 
-	return lowpan_process_data(skb, skb->dev, sap, sa.addr_type,
-				   IEEE802154_ADDR_LEN, dap, da.addr_type,
-				   IEEE802154_ADDR_LEN, iphc0, iphc1);
+	return lowpan_header_decompress(skb, skb->dev, sap, sa.addr_type,
+					IEEE802154_ADDR_LEN, dap, da.addr_type,
+					IEEE802154_ADDR_LEN, iphc0, iphc1);
 
 drop:
 	kfree_skb(skb);
@@ -532,14 +533,14 @@ static int lowpan_rcv(struct sk_buff *skb, struct net_device *dev,
 	} else {
 		switch (skb->data[0] & 0xe0) {
 		case LOWPAN_DISPATCH_IPHC:	/* ipv6 datagram */
-			ret = process_data(skb, &hdr);
+			ret = iphc_decompress(skb, &hdr);
 			if (ret < 0)
 				goto drop;
 			break;
 		case LOWPAN_DISPATCH_FRAG1:	/* first fragment header */
 			ret = lowpan_frag_rcv(skb, LOWPAN_DISPATCH_FRAG1);
 			if (ret == 1) {
-				ret = process_data(skb, &hdr);
+				ret = iphc_decompress(skb, &hdr);
 				if (ret < 0)
 					goto drop;
 			}
@@ -547,7 +548,7 @@ static int lowpan_rcv(struct sk_buff *skb, struct net_device *dev,
 		case LOWPAN_DISPATCH_FRAGN:	/* next fragments headers */
 			ret = lowpan_frag_rcv(skb, LOWPAN_DISPATCH_FRAGN);
 			if (ret == 1) {
-				ret = process_data(skb, &hdr);
+				ret = iphc_decompress(skb, &hdr);
 				if (ret < 0)
 					goto drop;
 			}
-- 
1.9.1

^ permalink raw reply related

* Re: [PATCH bluetooth-next 0/5] Move skb delivery out of IPHC.
From: Alexander Aring @ 2014-10-20  7:25 UTC (permalink / raw)
  To: Martin Townsend; +Cc: linux-bluetooth, linux-wpan, marcel, jukka.rissanen
In-Reply-To: <1413616153-7562-1-git-send-email-mtownsend1973@gmail.com>

Hi Martin,

I did a fast quick test and it's still working. I see now the conversion
from to errno, but you didn't change/fix the behaviour with kfree_skb. I
am pretty sure this is still broken with and without your patch.

I know you want to make smaller patches but can you please add the
conversion simple to this patch series? What I see now is the change
from if (ret != NET_RX_FOO) to errno. This change the behaviour of
current somewhat working state. What I mean, it's okay to change that
but please in a serie which contains also fixes for the kfree_skb thing.

Important:
All patches should be compileable after each patch keyword "bisectable"
otherwise people can't use "git bisect".

But in your case this should be fine.

It should also not broken between them, but this is a bigger issue.
Smaller patches for better review are welcome.


To your patch series:

- You missed a tag "6lowpan:", "ieee802154: 6lowpan:" or "bluetooth: 6lowpan:"
  Use the tag which best fit to your patch. Also add a tag to the
  cover-letter "6lowpan:"

- Please "fixup" patch 4/5 with patch 1/5. "fixup" is some git language,
  what I mean is just include the remove of "skb_delivery_cb skb_deliver", when
  remove the use of that. Now you have two patches for this in your git
  history, with "git rebase -i" and a fixup you don't need to touch the
  patch again. Just for information, maybe you don't know that. Fast
  googleing results [0] tutorial.

- Sometimes you add a dot in commit message, sometimes not. Please start
  the commit msg in lower case and remove the dot.


- Alex

[0] http://fle.github.io/git-tip-keep-your-branch-clean-with-fixup-and-autosquash.html

^ permalink raw reply

* Use HFP as sco sink and source at the same time
From: Zheng, Wu @ 2014-10-20  8:15 UTC (permalink / raw)
  To: Von Dentz, Luiz; +Cc: linux-bluetooth@vger.kernel.org

Hi Luiz,

HFP is used on IVI and meet some issues.

EXACT STEPS LEADING TO PROBLEM:
===========================================================
1. pair BT phone by bluetoothctl
2. launch dialer app
3. make voice call and answer, the voice can be heard from IVI speaker
4. pair and connect BT headset with bluetoothctl

EXPECTED OUTCOME:
===================
Voice send out from the BT headset
ACTUAL OUTCOME
===================
sound still heard from IVI speaker, doesn't auto switch to BT handset

I don't make sure if Bluez can support it or not?

Question: the SCOs connection of HFP on IVI can be used as SCO sink and source at the same time?

It is the issue of https://bugs.tizen.org/jira/browse/TC-160.

Thanks.

Best Regards
Zheng Wu

^ permalink raw reply

* [PATCH 1/2] android/pts: Update PICS and PIXIT for IOPT
From: Marcin Kraglak @ 2014-10-20  8:27 UTC (permalink / raw)
  To: linux-bluetooth

---
 android/pics-iopt.txt  | 2 +-
 android/pixit-iopt.txt | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/android/pics-iopt.txt b/android/pics-iopt.txt
index 61b5697..0b7446e 100644
--- a/android/pics-iopt.txt
+++ b/android/pics-iopt.txt
@@ -1,6 +1,6 @@
 IOPT PICS for the PTS tool.
 
-PTS version: 5.2
+PTS version: 5.3
 
 * - different than PTS defaults
 # - not yet implemented/supported
diff --git a/android/pixit-iopt.txt b/android/pixit-iopt.txt
index 85a8fcb..53837de 100644
--- a/android/pixit-iopt.txt
+++ b/android/pixit-iopt.txt
@@ -1,6 +1,6 @@
 IOPT PIXIT for the PTS tool.
 
-PTS version: 5.2
+PTS version: 5.3
 
 * - different than PTS defaults
 & - should be set to IUT Bluetooth address
-- 
1.9.3


^ permalink raw reply related

* [PATCH 2/2] android/pts: Update test results for IOPT
From: Marcin Kraglak @ 2014-10-20  8:27 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1413793642-5431-1-git-send-email-marcin.kraglak@tieto.com>

---
 android/pts-iopt.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/android/pts-iopt.txt b/android/pts-iopt.txt
index 2ce572c..c13b6e5 100644
--- a/android/pts-iopt.txt
+++ b/android/pts-iopt.txt
@@ -1,7 +1,7 @@
 PTS test results for IOPT
 
-PTS version: 5.2
-Tested: 11-August-2014
+PTS version: 5.3
+Tested: 20-October-2014
 Android version: 4.4.4
 
 Results:
-- 
1.9.3


^ permalink raw reply related

* Re: [PATCH bluetooth-next 0/5] Move skb delivery out of IPHC.
From: Martin Townsend @ 2014-10-20  8:34 UTC (permalink / raw)
  To: Alexander Aring, Martin Townsend
  Cc: linux-bluetooth, linux-wpan, marcel, jukka.rissanen
In-Reply-To: <20141020072520.GA5404@omega>

Hi Alex,

On 20/10/14 08:25, Alexander Aring wrote:
> Hi Martin,
>
> I did a fast quick test and it's still working. I see now the conversion
> from to errno, but you didn't change/fix the behaviour with kfree_skb. I
> am pretty sure this is still broken with and without your patch.
>
> I know you want to make smaller patches but can you please add the
> conversion simple to this patch series? What I see now is the change
> from if (ret != NET_RX_FOO) to errno. This change the behaviour of
> current somewhat working state. What I mean, it's okay to change that
> but please in a serie which contains also fixes for the kfree_skb thing.
Is this the kfree_skb in lowpan_give_skb_to_devices? I'll add it in.
> Important:
> All patches should be compileable after each patch keyword "bisectable"
> otherwise people can't use "git bisect".
After each patch everything should be compilable or at least I thought is was :)
> But in your case this should be fine.
>
> It should also not broken between them, but this is a bigger issue.
> Smaller patches for better review are welcome.
>
>
> To your patch series:
>
> - You missed a tag "6lowpan:", "ieee802154: 6lowpan:" or "bluetooth: 6lowpan:"
>   Use the tag which best fit to your patch. Also add a tag to the
>   cover-letter "6lowpan:"
will do
>
> - Please "fixup" patch 4/5 with patch 1/5. "fixup" is some git language,
>   what I mean is just include the remove of "skb_delivery_cb skb_deliver", when
>   remove the use of that. Now you have two patches for this in your git
>   history, with "git rebase -i" and a fixup you don't need to touch the
>   patch again. Just for information, maybe you don't know that. Fast
>   googleing results [0] tutorial.
no probs
>
> - Sometimes you add a dot in commit message, sometimes not. Please start
>   the commit msg in lower case and remove the dot.
>
ok.
> - Alex
>
> [0] http://fle.github.io/git-tip-keep-your-branch-clean-with-fixup-and-autosquash.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wpan" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

- Martin.

^ permalink raw reply

* Re: [PATCH bluetooth-next 0/5] Move skb delivery out of IPHC.
From: Alexander Aring @ 2014-10-20  8:55 UTC (permalink / raw)
  To: Martin Townsend
  Cc: Martin Townsend, linux-bluetooth, linux-wpan, marcel,
	jukka.rissanen
In-Reply-To: <5444C90D.9020402@xsilon.com>

Hi Martin,

On Mon, Oct 20, 2014 at 09:34:21AM +0100, Martin Townsend wrote:
> Hi Alex,
> 
> On 20/10/14 08:25, Alexander Aring wrote:
> > Hi Martin,
> >
> > I did a fast quick test and it's still working. I see now the conversion
> > from to errno, but you didn't change/fix the behaviour with kfree_skb. I
> > am pretty sure this is still broken with and without your patch.
> >
> > I know you want to make smaller patches but can you please add the
> > conversion simple to this patch series? What I see now is the change
> > from if (ret != NET_RX_FOO) to errno. This change the behaviour of
> > current somewhat working state. What I mean, it's okay to change that
> > but please in a serie which contains also fixes for the kfree_skb thing.
> Is this the kfree_skb in lowpan_give_skb_to_devices? I'll add it in.

mhh no, I thought you main goal was to move out the error handling of
lowpan_process_header function (don't know the new name, maybe it is
iphc_decompression).

- Alex

^ permalink raw reply

* Re: [PATCH bluetooth-next 0/5] Move skb delivery out of IPHC.
From: Martin Townsend @ 2014-10-20  9:02 UTC (permalink / raw)
  To: Alexander Aring
  Cc: Martin Townsend, linux-bluetooth, linux-wpan, marcel,
	jukka.rissanen
In-Reply-To: <20141020085555.GB5404@omega>

Hi Alex,

I've completely forgotten what the original problem was it was so long ago :)  , let me dig through the old emails and see if I can jog my memory. 

My intention was to do the kfree_skb patch in my next submission but I'll see what I can do.

- Martin.



On 20/10/14 09:55, Alexander Aring wrote:
> Hi Martin,
>
> On Mon, Oct 20, 2014 at 09:34:21AM +0100, Martin Townsend wrote:
>> Hi Alex,
>>
>> On 20/10/14 08:25, Alexander Aring wrote:
>>> Hi Martin,
>>>
>>> I did a fast quick test and it's still working. I see now the conversion
>>> from to errno, but you didn't change/fix the behaviour with kfree_skb. I
>>> am pretty sure this is still broken with and without your patch.
>>>
>>> I know you want to make smaller patches but can you please add the
>>> conversion simple to this patch series? What I see now is the change
>>> from if (ret != NET_RX_FOO) to errno. This change the behaviour of
>>> current somewhat working state. What I mean, it's okay to change that
>>> but please in a serie which contains also fixes for the kfree_skb thing.
>> Is this the kfree_skb in lowpan_give_skb_to_devices? I'll add it in.
> mhh no, I thought you main goal was to move out the error handling of
> lowpan_process_header function (don't know the new name, maybe it is
> iphc_decompression).
>
> - Alex


^ permalink raw reply

* Re: Use HFP as sco sink and source at the same time
From: Luiz Augusto von Dentz @ 2014-10-20  9:02 UTC (permalink / raw)
  To: Zheng, Wu; +Cc: Von Dentz, Luiz, linux-bluetooth@vger.kernel.org
In-Reply-To: <2CF57A644018A745B8FE029C7223E16E11964A9B@SHSMSX104.ccr.corp.intel.com>

Hi,

On Mon, Oct 20, 2014 at 11:15 AM, Zheng, Wu <wu.zheng@intel.com> wrote:
> Hi Luiz,
>
> HFP is used on IVI and meet some issues.
>
> EXACT STEPS LEADING TO PROBLEM:
> ===========================================================
> 1. pair BT phone by bluetoothctl
> 2. launch dialer app
> 3. make voice call and answer, the voice can be heard from IVI speaker
> 4. pair and connect BT headset with bluetoothctl
>
> EXPECTED OUTCOME:
> ===================
> Voice send out from the BT headset
> ACTUAL OUTCOME
> ===================
> sound still heard from IVI speaker, doesn't auto switch to BT handset
>
> I don't make sure if Bluez can support it or not?
>
> Question: the SCOs connection of HFP on IVI can be used as SCO sink and source at the same time?
>
> It is the issue of https://bugs.tizen.org/jira/browse/TC-160.

Yes, by design it is duplex so both sink and source works
simultaneously, perhaps you are talking about of sending the
microphone data to the other end which has probably nothing to do with
Bluetooth but with audio routing not being properly configured.


-- 
Luiz Augusto von Dentz

^ permalink raw reply

* Re: [PATCH bluetooth-next 0/5] Move skb delivery out of IPHC.
From: Alexander Aring @ 2014-10-20  9:10 UTC (permalink / raw)
  To: Martin Townsend
  Cc: Martin Townsend, linux-bluetooth, linux-wpan, marcel,
	jukka.rissanen
In-Reply-To: <5444CF99.4080305@xsilon.com>

On Mon, Oct 20, 2014 at 10:02:17AM +0100, Martin Townsend wrote:
> Hi Alex,
> 
> I've completely forgotten what the original problem was it was so long ago :)  , let me dig through the old emails and see if I can jog my memory. 
> 
> My intention was to do the kfree_skb patch in my next submission but I'll see what I can do.
> 

yea, the problem a general error handling issue in mainly two parts:

 - detection errors. Means the NET_RX_FOO conversion to errno. But you
   put out the netif_rx call outside of lowpan_header_create which is
   very well. I approve that one. Now it's important that the "lowpan
   give to upper layer" functions not returning ERRNO's and NET_RX_FOO.

   Again, errno is a negative value and NET_RX_FOO is 0 or 1. We can't
   check on a error with if (ret < 0) or (ret == NET_RX_DROP). Also
   (ret != NET_RX_SUCCESS) will not work because it's "1" and "0"
   indicate successful or sometimes not successful because NET_RX_DROP
   was returned and this is "0". Lot of confusing here.

   For the "lowpan give to upper layer" functions doesn't matter if
   errno is returned or NET_RX_FOO, but don't a mix of both!
   The "lowpan_header_create" should return errno's.

 - Second issue was a complete wrong reaction on error handling and
   memory managment with "kfree_skb" which needs a fix of the above one
   at first to introduce a correct error handling.


Now I see a little bit the fix of the first one. But not the second one.
Or should these things all fine now, otherwise I will take a more
careful review.

- Alex

^ permalink raw reply

* RE: Use HFP as sco sink and source at the same time
From: Zheng, Wu @ 2014-10-20  9:16 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: 'linux-bluetooth@vger.kernel.org'
In-Reply-To: <CABBYNZKoNVhj91NQ1e3PF2ORaAcMs4NsX300bj0cLic1=Joicw@mail.gmail.com>

SGkgTHVpeiwNCg0KVGhhbmtzIGZvciB5b3VyIHJlc3BvbnNlLg0KDQpGb3IgaHR0cHM6Ly9idWdz
LnRpemVuLm9yZy9qaXJhL2Jyb3dzZS9UQy0xNjAsIHdlIGNhbiBnZXQgdGhlIHJlbGF0ZWQgbG9n
IG9mIHB1bHNlYXVkaW8uDQoNCltwdWxzZWF1ZGlvXSByb3V0ZXIuYzogcm91dGluZyAnZGlhbGVy
JyA9PiAnQmx1ZXRvb3RoIE1vbm8gSGFuZHNmcmVlJw0KRDogW3B1bHNlYXVkaW9dIGF1ZGlvbWdy
LmM6IHNraXAgcmVnaXN0ZXJpbmcgbm9kZXMgd2hpbGUgdGhlIGRvbWFpbiBpcyBkb3duDQpEOiBb
cHVsc2VhdWRpb10gY29uc3RyYWluLmM6IG5vZGUgJ0JsdWV0b290aCBNb25vIEhhbmRzZnJlZScg
YWRkZWQgdG8gY29uc3RyYWluIHByb2ZpbGUvYmx1ZXpfY2FyZC4wMF8xNl80NF9GRF8zNV9EMg0K
RDogW3B1bHNlYXVkaW9dIGRpc2NvdmVyLmM6IGNhcmQgJ2JsdWV6X2NhcmQuMDBfMTZfNDRfRkRf
MzVfRDInIGRlZmF1bHQgcHJvZmlsZSAnb2ZmJw0KRDogW3B1bHNlYXVkaW9dIGRpc2NvdmVyLmM6
IHNjaGVkdWxpbmcgY2FyZCBjaGVjaw0KSTogW3B1bHNlYXVkaW9dIG1vZHVsZS5jOiBMb2FkZWQg
Im1vZHVsZS1ibHVlejUtZGV2aWNlIiAoaW5kZXg6ICMyMTsgYXJndW1lbnQ6ICJwYXRoPS9vcmcv
Ymx1ZXovaGNpMC9kZXZfMDBfMTZfNDRfRkRfMzVfRDIiKS4NCkQ6IFtwdWxzZWF1ZGlvXSBibHVl
ejUtdXRpbC5jOiBUcmFuc3BvcnQgL29yZy9ibHVlei9oY2kwL2Rldl8wMF8xNl80NF9GRF8zNV9E
Mi9mZDEgYXZhaWxhYmxlIGZvciBwcm9maWxlIGEyZHBfc2luaw0KRDogW3B1bHNlYXVkaW9dIGRp
c2NvdmVyLmM6IGNhcmQgY2hlY2sgc3RhcnRzDQpEOiBbcHVsc2VhdWRpb10gZGlzY292ZXIuYzog
Y2FyZCAnYmx1ZXpfY2FyZC4wMF8xNl80NF9GRF8zNV9EMicgaGFzIG5vIHNpbmtzL3NvdXJjZXMu
IERvIHJvdXRpbmcgLi4uDQpEOiBbcHVsc2VhdWRpb10gcm91dGVyLmM6IHVzaW5nICdwaG9uZScg
cm91dGVyIGdyb3VwIHdoZW4gcm91dGluZyAnZGlhbGVyJw0KRDogW3B1bHNlYXVkaW9dIGNvbnN0
cmFpbi5jOiBhcHBseWluZyBjb25zdHJhaW4gcHJvZmlsZS9ibHVlel9jYXJkLjAwXzE2XzQ0X0ZE
XzM1X0QyDQpEOiBbcHVsc2VhdWRpb10gY29uc3RyYWluLmM6ICAgIHVuYmxvY2tpbmcgJ0JsdWV0
b290aCBNb25vIEhhbmRzZnJlZScgaW4gdGFibGUgJ2RlZmF1bHRfZHJpdmVyJw0KRDogW3B1bHNl
YXVkaW9dIGNvbnN0cmFpbi5jOiAgICB1bmJsb2NraW5nICdCbHVldG9vdGggTW9ubyBIYW5kc2Zy
ZWUnIGluIHRhYmxlICdwaG9uZScNCkQ6IFtwdWxzZWF1ZGlvXSBjb25zdHJhaW4uYzogICAgYmxv
Y2tpbmcgJ0JsdWV0b290aCBTdGVyZW8gSGVhZHBob25lJyBpbiB0YWJsZSAnZGVmYXVsdF9kcml2
ZXInDQpEOiBbcHVsc2VhdWRpb10gY29uc3RyYWluLmM6ICAgIHVuYmxvY2tpbmcgJ0JsdWV0b290
aCBNb25vIEhhbmRzZnJlZScgaW4gdGFibGUgJ3Bob25lJw0KRDogW3B1bHNlYXVkaW9dIHJvdXRl
ci5jOiByb3V0aW5nICdkaWFsZXInID0+ICdCbHVldG9vdGggTW9ubyBIYW5kc2ZyZWUnDQpEOiBb
cHVsc2VhdWRpb10gYXVkaW9tZ3IuYzogaWdub3JpbmcgZGVmYXVsdCByb3V0ZSBkaWFsZXIgPT4g
Qmx1ZXRvb3RoIE1vbm8gSGFuZHNmcmVlOiBpbmNvbXBsZXRlIGlucHV0IG9yIG91dHB1dA0KRDog
W3B1bHNlYXVkaW9dIHN3aXRjaC5jOiBjaGFuZ2luZyBwcm9maWxlICdvZmYnID0+ICdoc3AnDQpX
OiBbcHVsc2VhdWRpb10gbW9kdWxlLWJsdWV6NS1kZXZpY2UuYzogUmVmdXNlZCB0byBzd2l0Y2gg
cHJvZmlsZSB0byBoc3A6IE5vdCBjb25uZWN0ZWQNCkQ6IFtwdWxzZWF1ZGlvXSBzd2l0Y2guYzog
Y2FuJ3Qgcm91dGUgdG8gJ0JsdWV0b290aCBNb25vIEhhbmRzZnJlZSc6IG5vIHNpbmsNCkQ6IFtw
dWxzZWF1ZGlvXSB2b2x1bWUuYzogcmVzZXQgdm9sdW1lIGNsYXNzZXMgb24gbm9kZSAnQmx1ZXRv
b3RoIE1vbm8gSGFuZHNmcmVlJw0KRDogW3B1bHNlYXVkaW9dIHZvbHVtZS5jOiBhZGQgdm9sdW1l
IGNsYXNzIDcgKFBob25lKSB0byBub2RlICdCbHVldG9vdGggTW9ubyBIYW5kc2ZyZWUnIChjbG1h
c2sgMHgwKQ0KRDogW3B1bHNlYXVkaW9dIHJvdXRlci5jOiB1c2luZyAncGhvbmUnIHJvdXRlciBn
cm91cCB3aGVuIHJvdXRpbmcgJ0NhciBLaXQnDQpEOiBbcHVsc2VhdWRpb10gcm91dGVyLmM6IHJv
dXRpbmcgJ0NhciBLaXQnID0+ICdCbHVldG9vdGggTW9ubyBIYW5kc2ZyZWUnDQpEOiBbcHVsc2Vh
dWRpb10gYXVkaW9tZ3IuYzogaWdub3JpbmcgZGVmYXVsdCByb3V0ZSBDYXIgS2l0ID0+IEJsdWV0
b290aCBNb25vIEhhbmRzZnJlZTogaW5jb21wbGV0ZSBpbnB1dCBvciBvdXRwdXQNCkQ6IFtwdWxz
ZWF1ZGlvXSBzd2l0Y2guYzogY2hhbmdpbmcgcHJvZmlsZSAnb2ZmJyA9PiAnaHNwJw0KVzogW3B1
bHNlYXVkaW9dIG1vZHVsZS1ibHVlejUtZGV2aWNlLmM6IFJlZnVzZWQgdG8gc3dpdGNoIHByb2Zp
bGUgdG8gaHNwOiBOb3QgY29ubmVjdGVkDQpEOiBbcHVsc2VhdWRpb10gc3dpdGNoLmM6IGNhbid0
IHJvdXRlIHRvICdCbHVldG9vdGggTW9ubyBIYW5kc2ZyZWUnOiBubyBzaW5rDQoNCk5vdCBtYWtl
IHN1cmUgaWYgdGhlIEJsdWV0b290aCBoYW5kbGUgdG8gcHVsc2VhdWRpbyBjYW4gd29yayB3ZWxs
IG9yIG5vdO+8nw0KDQpXaGF0IGRvIHlvdSB0aGluaz8NCg0KQmVzdCBSZWdhcmRzDQpaaGVuZyBX
dQ0KDQoNCi0tLS0tT3JpZ2luYWwgTWVzc2FnZS0tLS0tDQpGcm9tOiBMdWl6IEF1Z3VzdG8gdm9u
IERlbnR6IFttYWlsdG86bHVpei5kZW50ekBnbWFpbC5jb21dIA0KU2VudDogTW9uZGF5LCBPY3Rv
YmVyIDIwLCAyMDE0IDU6MDMgUE0NClRvOiBaaGVuZywgV3UNCkNjOiBWb24gRGVudHosIEx1aXo7
IGxpbnV4LWJsdWV0b290aEB2Z2VyLmtlcm5lbC5vcmcNClN1YmplY3Q6IFJlOiBVc2UgSEZQIGFz
IHNjbyBzaW5rIGFuZCBzb3VyY2UgYXQgdGhlIHNhbWUgdGltZQ0KDQpIaSwNCg0KT24gTW9uLCBP
Y3QgMjAsIDIwMTQgYXQgMTE6MTUgQU0sIFpoZW5nLCBXdSA8d3UuemhlbmdAaW50ZWwuY29tPiB3
cm90ZToNCj4gSGkgTHVpeiwNCj4NCj4gSEZQIGlzIHVzZWQgb24gSVZJIGFuZCBtZWV0IHNvbWUg
aXNzdWVzLg0KPg0KPiBFWEFDVCBTVEVQUyBMRUFESU5HIFRPIFBST0JMRU06DQo+ID09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQo+IDEu
IHBhaXIgQlQgcGhvbmUgYnkgYmx1ZXRvb3RoY3RsDQo+IDIuIGxhdW5jaCBkaWFsZXIgYXBwDQo+
IDMuIG1ha2Ugdm9pY2UgY2FsbCBhbmQgYW5zd2VyLCB0aGUgdm9pY2UgY2FuIGJlIGhlYXJkIGZy
b20gSVZJIHNwZWFrZXIgDQo+IDQuIHBhaXIgYW5kIGNvbm5lY3QgQlQgaGVhZHNldCB3aXRoIGJs
dWV0b290aGN0bA0KPg0KPiBFWFBFQ1RFRCBPVVRDT01FOg0KPiA9PT09PT09PT09PT09PT09PT09
DQo+IFZvaWNlIHNlbmQgb3V0IGZyb20gdGhlIEJUIGhlYWRzZXQNCj4gQUNUVUFMIE9VVENPTUUN
Cj4gPT09PT09PT09PT09PT09PT09PQ0KPiBzb3VuZCBzdGlsbCBoZWFyZCBmcm9tIElWSSBzcGVh
a2VyLCBkb2Vzbid0IGF1dG8gc3dpdGNoIHRvIEJUIGhhbmRzZXQNCj4NCj4gSSBkb24ndCBtYWtl
IHN1cmUgaWYgQmx1ZXogY2FuIHN1cHBvcnQgaXQgb3Igbm90Pw0KPg0KPiBRdWVzdGlvbjogdGhl
IFNDT3MgY29ubmVjdGlvbiBvZiBIRlAgb24gSVZJIGNhbiBiZSB1c2VkIGFzIFNDTyBzaW5rIGFu
ZCBzb3VyY2UgYXQgdGhlIHNhbWUgdGltZT8NCj4NCj4gSXQgaXMgdGhlIGlzc3VlIG9mIGh0dHBz
Oi8vYnVncy50aXplbi5vcmcvamlyYS9icm93c2UvVEMtMTYwLg0KDQpZZXMsIGJ5IGRlc2lnbiBp
dCBpcyBkdXBsZXggc28gYm90aCBzaW5rIGFuZCBzb3VyY2Ugd29ya3Mgc2ltdWx0YW5lb3VzbHks
IHBlcmhhcHMgeW91IGFyZSB0YWxraW5nIGFib3V0IG9mIHNlbmRpbmcgdGhlIG1pY3JvcGhvbmUg
ZGF0YSB0byB0aGUgb3RoZXIgZW5kIHdoaWNoIGhhcyBwcm9iYWJseSBub3RoaW5nIHRvIGRvIHdp
dGggQmx1ZXRvb3RoIGJ1dCB3aXRoIGF1ZGlvIHJvdXRpbmcgbm90IGJlaW5nIHByb3Blcmx5IGNv
bmZpZ3VyZWQuDQoNCg0KLS0NCkx1aXogQXVndXN0byB2b24gRGVudHoNCg==

^ permalink raw reply

* Re: [PATCH v3 3/5] android/map-client: Add support for get remote MAS instances
From: Grzegorz Kolodziejczyk @ 2014-10-20 10:01 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1413383281-17292-4-git-send-email-grzegorz.kolodziejczyk@tieto.com>

Hi,

On 15 October 2014 16:27, Grzegorz Kolodziejczyk
<grzegorz.kolodziejczyk@tieto.com> wrote:
>
> This allows to get remote mas instances. In case of wrong sdp record
> fail status will be returned in notification.
> ---
>  android/map-client.c | 131 ++++++++++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 130 insertions(+), 1 deletion(-)
>
> diff --git a/android/map-client.c b/android/map-client.c
> index 142c680..12f600b 100644
> --- a/android/map-client.c
> +++ b/android/map-client.c
> @@ -30,21 +30,150 @@
>  #include <stdint.h>
>  #include <glib.h>
>
> +#include "lib/sdp.h"
> +#include "lib/sdp_lib.h"
> +#include "src/sdp-client.h"
> +
>  #include "ipc.h"
>  #include "lib/bluetooth.h"
>  #include "map-client.h"
>  #include "src/log.h"
>  #include "hal-msg.h"
> +#include "ipc-common.h"
> +#include "utils.h"
> +#include "src/shared/util.h"
>
>  static struct ipc *hal_ipc = NULL;
>  static bdaddr_t adapter_addr;
>
> +static int fill_mce_inst(void *buf, int32_t id, int32_t scn, int32_t msg_type,
> +                                       const void *name, uint8_t name_len)
> +{
> +       struct hal_map_client_mas_instance *inst = buf;
> +
> +       inst->id = id;
> +       inst->scn = scn;
> +       inst->msg_types = msg_type;
> +       inst->name_len = name_len;
> +
> +       if (name_len)
> +               memcpy(inst->name, name, name_len);
> +
> +       return sizeof(*inst) + name_len;
> +}
> +
> +static void map_client_sdp_search_cb(sdp_list_t *recs, int err, gpointer data)
> +{
> +       uint8_t buf[IPC_MTU];
> +       struct hal_ev_map_client_remote_mas_instances *ev = (void *) buf;
> +       bdaddr_t *dst = data;
> +       sdp_list_t *list, *protos;
> +       uint8_t status;
> +       int32_t id, scn, msg_type, name_len, num_instances = 0;
> +       char *name;
> +       size_t size;
> +
> +       size = sizeof(*ev);
> +       bdaddr2android(dst, &ev->bdaddr);
> +
> +       if (err < 0) {
> +               error("mce: Unable to get SDP record: %s", strerror(-err));
> +               status = HAL_STATUS_FAILED;
> +               goto fail;
> +       }
> +
> +       for (list = recs; list != NULL; list = list->next) {
> +               sdp_record_t *rec = list->data;
> +               sdp_data_t *data;
> +
> +               data = sdp_data_get(rec, SDP_ATTR_MAS_INSTANCE_ID);
> +               if (!data) {
> +                       error("mce: cannot get mas instance id");
> +                       continue;
> +               }
> +
> +               id = data->val.uint8;
> +
> +               data = sdp_data_get(rec, SDP_ATTR_SVCNAME_PRIMARY);
> +               if (!data) {
> +                       error("mce: cannot get mas instance name");
> +                       continue;
> +               }
> +
> +               name = data->val.str;
> +               name_len = data->unitSize;
> +
> +               data = sdp_data_get(rec, SDP_ATTR_SUPPORTED_MESSAGE_TYPES);
> +               if (!data) {
> +                       error("mce: cannot get mas instance msg type");
> +                       continue;
> +               }
> +
> +               msg_type = data->val.uint8;
> +
> +               if (sdp_get_access_protos(rec, &protos) < 0) {
> +                       error("mce: cannot get mas instance sdp protocol list");
> +                       continue;
> +               }
> +
> +               scn = sdp_get_proto_port(protos, RFCOMM_UUID);
> +
> +               sdp_list_foreach(protos, (sdp_list_func_t) sdp_list_free, NULL);
> +               sdp_list_free(protos, NULL);
> +
> +               if (!scn) {
> +                       error("mce: cannot get mas instance rfcomm channel");
> +                       continue;
> +               }
> +
> +               size += fill_mce_inst(buf + size, id, scn, msg_type, name,
> +                                                               name_len);
> +               num_instances++;
> +       }
> +
> +       status = HAL_STATUS_SUCCESS;
> +
> +fail:
> +       ev->num_instances = num_instances;
> +       ev->status = status;
> +
> +       ipc_send_notif(hal_ipc, HAL_SERVICE_ID_MAP_CLIENT,
> +                       HAL_EV_MAP_CLIENT_REMOTE_MAS_INSTANCES, size, buf);
> +
> +       free(dst);


This "free(dst)" should also be removed while using bt_destroy function.

>
> +}
> +
>  static void handle_get_instances(const void *buf, uint16_t len)
>  {
> +       const struct hal_cmd_map_client_get_instances *cmd = buf;
> +       uint8_t status;
> +       bdaddr_t *dst;
> +       uuid_t uuid;
> +
>         DBG("");
>
> +       dst = new0(bdaddr_t, 1);
> +       if (!dst) {
> +               error("mce: Fail to allocate cb data");
> +               status = HAL_STATUS_FAILED;
> +               goto failed;
> +       }
> +
> +       android2bdaddr(&cmd->bdaddr, dst);
> +       sdp_uuid16_create(&uuid, MAP_MSE_SVCLASS_ID);
> +
> +       if (bt_search_service(&adapter_addr, dst, &uuid,
> +                               map_client_sdp_search_cb, dst, free, 0)) {
> +               error("mce: Failed to search SDP details");
> +               status = HAL_STATUS_FAILED;
> +               goto failed;
> +       }
> +
> +       status = HAL_STATUS_SUCCESS;
> +
> +failed:
>         ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_MAP_CLIENT,
> -                       HAL_OP_MAP_CLIENT_GET_INSTANCES, HAL_STATUS_FAILED);
> +                               HAL_OP_MAP_CLIENT_GET_INSTANCES, status);
>  }
>
>  static const struct ipc_handler cmd_handlers[] = {
> --
> 1.9.3
>

Best regards,
Grzegorz

^ permalink raw reply

* Re: [PATCH bluetooth-next 0/5] Move skb delivery out of IPHC.
From: Martin Townsend @ 2014-10-20 10:06 UTC (permalink / raw)
  To: Alexander Aring
  Cc: Martin Townsend, linux-bluetooth, linux-wpan, marcel,
	jukka.rissanen
In-Reply-To: <20141020091043.GC5404@omega>

Hi Alex,

I think if I put the skb free stuff in lowpan_give_skb_to_devices then it should all be fixed.

- lowpan_process_data or now lowpan_header_decompress will either
     - always free the skb on error and return an error code
     - or return 0.  So there is no chance of NET_RX_FOO codes being returned as we have moved skb deilvery out of this path.

- This means that lowpan_recv can now checks to see if ret < 0, I could change this to ret != 0 if you want but the outcome is the same, if decompression fails then skb has been freed so goto drop.

- This leaves the last part lowpan_give_skb_to_devices must now free or consume the skb (which I've just added).

Hopefully this sorts out the original problem? or have I missed something.

My next patch series will remove all the kfree_skb's from decompression but I don't think this fixes anything just makes the code more maintainable in that we don't have to worry about making sure all error paths are covered.

Let me know what you think and then I'll send v2.

- Martin.



On 20/10/14 10:10, Alexander Aring wrote:
> On Mon, Oct 20, 2014 at 10:02:17AM +0100, Martin Townsend wrote:
>> Hi Alex,
>>
>> I've completely forgotten what the original problem was it was so long ago :)  , let me dig through the old emails and see if I can jog my memory. 
>>
>> My intention was to do the kfree_skb patch in my next submission but I'll see what I can do.
>>
> yea, the problem a general error handling issue in mainly two parts:
>
>  - detection errors. Means the NET_RX_FOO conversion to errno. But you
>    put out the netif_rx call outside of lowpan_header_create which is
>    very well. I approve that one. Now it's important that the "lowpan
>    give to upper layer" functions not returning ERRNO's and NET_RX_FOO.
>
>    Again, errno is a negative value and NET_RX_FOO is 0 or 1. We can't
>    check on a error with if (ret < 0) or (ret == NET_RX_DROP). Also
>    (ret != NET_RX_SUCCESS) will not work because it's "1" and "0"
>    indicate successful or sometimes not successful because NET_RX_DROP
>    was returned and this is "0". Lot of confusing here.
>
>    For the "lowpan give to upper layer" functions doesn't matter if
>    errno is returned or NET_RX_FOO, but don't a mix of both!
>    The "lowpan_header_create" should return errno's.
>
>  - Second issue was a complete wrong reaction on error handling and
>    memory managment with "kfree_skb" which needs a fix of the above one
>    at first to introduce a correct error handling.
>
>
> Now I see a little bit the fix of the first one. But not the second one.
> Or should these things all fine now, otherwise I will take a more
> careful review.
>
> - Alex
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wpan" 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

* Re: [PATCH 1/2] android/pts: Update PICS and PIXIT for IOPT
From: Szymon Janc @ 2014-10-20 10:07 UTC (permalink / raw)
  To: Marcin Kraglak; +Cc: linux-bluetooth
In-Reply-To: <1413793642-5431-1-git-send-email-marcin.kraglak@tieto.com>

Hi Marcin,

On Monday 20 of October 2014 10:27:21 Marcin Kraglak wrote:
> ---
>  android/pics-iopt.txt  | 2 +-
>  android/pixit-iopt.txt | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/android/pics-iopt.txt b/android/pics-iopt.txt
> index 61b5697..0b7446e 100644
> --- a/android/pics-iopt.txt
> +++ b/android/pics-iopt.txt
> @@ -1,6 +1,6 @@
>  IOPT PICS for the PTS tool.
>  
> -PTS version: 5.2
> +PTS version: 5.3
>  
>  * - different than PTS defaults
>  # - not yet implemented/supported
> diff --git a/android/pixit-iopt.txt b/android/pixit-iopt.txt
> index 85a8fcb..53837de 100644
> --- a/android/pixit-iopt.txt
> +++ b/android/pixit-iopt.txt
> @@ -1,6 +1,6 @@
>  IOPT PIXIT for the PTS tool.
>  
> -PTS version: 5.2
> +PTS version: 5.3
>  
>  * - different than PTS defaults
>  & - should be set to IUT Bluetooth address
> 

Applied. Thanks.

-- 
Best regards, 
Szymon Janc

^ permalink raw reply

* Re: [PATCH] android/pts: Update PAN PTS tests
From: Szymon Janc @ 2014-10-20 10:08 UTC (permalink / raw)
  To: Grzegorz Kolodziejczyk; +Cc: linux-bluetooth
In-Reply-To: <1413560573-3261-1-git-send-email-grzegorz.kolodziejczyk@tieto.com>

Hi Grzegorz,

On Friday 17 of October 2014 17:42:53 Grzegorz Kolodziejczyk wrote:
> Checked and tested against PTS 5.3
> ---
>  android/pics-pan.txt  | 2 +-
>  android/pixit-pan.txt | 2 +-
>  android/pts-pan.txt   | 4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/android/pics-pan.txt b/android/pics-pan.txt
> index 20b91c7..7c4939a 100644
> --- a/android/pics-pan.txt
> +++ b/android/pics-pan.txt
> @@ -1,6 +1,6 @@
>  PAN PICS for the PTS tool.
>  
> -PTS version: 5.2
> +PTS version: 5.3
>  
>  * - different than PTS defaults
>  # - not yet implemented/supported
> diff --git a/android/pixit-pan.txt b/android/pixit-pan.txt
> index a4233c6..680abb2 100644
> --- a/android/pixit-pan.txt
> +++ b/android/pixit-pan.txt
> @@ -1,6 +1,6 @@
>  PAN PIXIT for the PTS tool.
>  
> -PTS version: 5.2
> +PTS version: 5.3
>  
>  * - different than PTS defaults
>  & - should be set to IUT or PTS Bluetooth address respectively
> diff --git a/android/pts-pan.txt b/android/pts-pan.txt
> index 0af186c..dac1dec 100644
> --- a/android/pts-pan.txt
> +++ b/android/pts-pan.txt
> @@ -1,7 +1,7 @@
>  PTS test results for PAN
>  
> -PTS version: 5.2
> -Tested: 05-August-2014
> +PTS version: 5.3
> +Tested: 17-October-2014
>  Android version: 4.4.4
>  
>  Results:
> 

Applied. Thanks.

-- 
Best regards, 
Szymon Janc

^ permalink raw reply

* Re: [PATCH] android/pts: Update PTS files for DIS
From: Szymon Janc @ 2014-10-20 10:08 UTC (permalink / raw)
  To: Sebastian Chlad; +Cc: linux-bluetooth
In-Reply-To: <1413551299-32329-1-git-send-email-sebastian.chlad@tieto.com>

Hi Sebastian,

On Friday 17 of October 2014 15:08:19 Sebastian Chlad wrote:
> PICS and PIXITs updated to PTS 5.3. Regression done for Android
> 4.4.4.
> ---
>  android/pics-dis.txt  | 2 +-
>  android/pixit-dis.txt | 4 ++--
>  android/pts-dis.txt   | 7 +++++--
>  3 files changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/android/pics-dis.txt b/android/pics-dis.txt
> index 0a1ab3f..169173d 100644
> --- a/android/pics-dis.txt
> +++ b/android/pics-dis.txt
> @@ -1,6 +1,6 @@
>  DIS PICS for the PTS tool.
>  
> -PTS version: 5.2
> +PTS version: 5.3
>  
>  * - different than PTS defaults
>  
> diff --git a/android/pixit-dis.txt b/android/pixit-dis.txt
> index c29ec36..71729fe 100644
> --- a/android/pixit-dis.txt
> +++ b/android/pixit-dis.txt
> @@ -1,6 +1,6 @@
>  DIS PIXIT for the PTS tool.
>  
> -PTS version: 5.2
> +PTS version: 5.3
>  
>  * - different than PTS defaults
>  & - should be set to IUT Bluetooth address
> @@ -19,7 +19,7 @@ TSPX_delete_link_key					FALSE
>  TSPX_pin_code						0000
>  TSPX_use_dynamic_pin					FALSE
>  TSPX_delete_ltk						FALSE
> -TSPX_security_enabled					TRUE
> +TSPX_security_enabled					TRUE (*)
>  TSPX_iut_setup_att_over_br_edr				FALSE
>  TSPX_tester_appearance					0000
>  -------------------------------------------------------------------------------
> diff --git a/android/pts-dis.txt b/android/pts-dis.txt
> index 8489430..215baa2 100644
> --- a/android/pts-dis.txt
> +++ b/android/pts-dis.txt
> @@ -1,7 +1,7 @@
>  PTS test results for DIS
>  
> -PTS version: 5.2
> -Tested: 29-July-2014
> +PTS version: 5.3
> +Tested: 18-October-2014
>  Android version: 4.4.4
>  
>  Results:
> @@ -11,6 +11,9 @@ INC	test is inconclusive
>  N/A	test is disabled due to PICS setup
>  NONE	test result is none
>  
> +NOTE: DIS testing might require some extra properties to be set. Please refer
> +to the README file in android folder. Section: Customization.
> +
>  -------------------------------------------------------------------------------
>  Test Name		Result	Notes
>  -------------------------------------------------------------------------------
> 

Patch applied, thanks.

-- 
Best regards, 
Szymon Janc

^ permalink raw reply

* Re: [PATCH] android/tester: Add missing hook removal
From: Szymon Janc @ 2014-10-20 10:10 UTC (permalink / raw)
  To: Jakub Tyszkowski; +Cc: linux-bluetooth
In-Reply-To: <1413547812-12345-1-git-send-email-jakub.tyszkowski@tieto.com>

Hi Jakub,

On Friday 17 of October 2014 14:10:12 Jakub Tyszkowski wrote:
> Missing hook removal was resulting in memory leak:
> 936 bytes in 39 blocks are definitely lost in loss record 42 of 45
> ==15026==    at 0x4C2AB80: malloc (in
> /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==15026==    by 0x407D60: btdev_add_hook (btdev.c:3226)
> ==15026==    by 0x40EB75: read_info_callback (tester-main.c:364)
> ==15026==    by 0x4142B5: request_complete (mgmt.c:245)
> ==15026==    by 0x41441A: can_read_data (mgmt.c:349)
> ==15026==    by 0x41663C: read_callback (io-glib.c:170)
> ==15026==    by 0x5083CE4: g_main_context_dispatch (in
> /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
> ==15026==    by 0x5084047: ??? (in
> /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
> ==15026==    by 0x5084309: g_main_loop_run (in
> /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
> ==15026==    by 0x4162D0: tester_run (tester.c:815)
> ==15026==    by 0x40263E: main (tester-main.c:2716)
> ---
>  android/tester-main.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/android/tester-main.c b/android/tester-main.c
> index a804f11..fc1de06 100644
> --- a/android/tester-main.c
> +++ b/android/tester-main.c
> @@ -212,6 +212,9 @@ static void test_post_teardown(const void *test_data)
>  {
>  	struct test_data *data = tester_get_data();
>  
> +	/* remove hook for encryption change */
> +	hciemu_del_hook(data->hciemu, HCIEMU_HOOK_POST_EVT, 0x08);
> +
>  	hciemu_unref(data->hciemu);
>  	data->hciemu = NULL;
>  
> 

Applied, thanks.

-- 
Best regards, 
Szymon Janc

^ permalink raw reply

* Re: [PATCH] android/pts: Update PTS files for HFP
From: Szymon Janc @ 2014-10-20 10:10 UTC (permalink / raw)
  To: Sebastian Chlad; +Cc: linux-bluetooth
In-Reply-To: <1413546696-25699-1-git-send-email-sebastian.chlad@tieto.com>

Hi Sebastian,

On Friday 17 of October 2014 13:51:36 Sebastian Chlad wrote:
> PICS and PIXITs updated to PTS 5.3. Regression done for Android
> 4.4.4.
> ---
>  android/pics-hfp.txt  | 22 ++++++++++++++++++++--
>  android/pixit-hfp.txt |  5 ++++-
>  android/pts-hfp.txt   | 14 ++++++++------
>  3 files changed, 32 insertions(+), 9 deletions(-)
> 
> diff --git a/android/pics-hfp.txt b/android/pics-hfp.txt
> index acbd25c..65f5112 100644
> --- a/android/pics-hfp.txt
> +++ b/android/pics-hfp.txt
> @@ -1,6 +1,6 @@
>  HFP PICS for the PTS tool.
>  
> -PTS version: 5.2
> +PTS version: 5.3
>  
>  * - different than PTS defaults
>  # - not yet implemented/supported
> @@ -14,6 +14,7 @@ Parameter Name	Selected	Description
>  -------------------------------------------------------------------------------
>  TSPC_HFP_0_1	False		Version: Hands-Free Profile v1.5 (O.1)
>  TSPC_HFP_0_2	True (*)	Version: Hands-Free Profile v1.6 (O.1)
> +TSPC_HFP_0_3	False		Version: Hands-Free Profile v1.7 (O.1)
>  -------------------------------------------------------------------------------
>  O.1: It is mandatory to support only one of the adopted versions.
>  -------------------------------------------------------------------------------
> @@ -83,8 +84,10 @@ TSPC_HFP_2_21c	True (*)	Enhanced Call Status with limited network
>  					notification (C.4)
>  TSPC_HFP_2_22	False		Support for automatic link loss recovery (O)
>  TSPC_HFP_2_23	True (*)	Individual Indicator Activation (C.9)
> -TSPC_HFP_2_24	True (*)s	Wide Band Speech service (C.8)
> +TSPC_HFP_2_24	True (*)	Wide Band Speech service (C.8)
>  TSPC_HFP_2_25	False		Support roaming function (O)
> +TSPC_HFP_2_26	False		HF Indicators (C.11)
> +TSPC_HFP_2_27	False		Support CVSD eSCO s4 setting (C.12)
>  -------------------------------------------------------------------------------
>  C.1:  The AG must support one of item TSPC_HFP_2_4a or TSPC_HFP_2_4b
>  C.2:  Mandatory if TSPC_HFP_2_12is TRUE; otherwise excluded
> @@ -96,6 +99,10 @@ C.7:  Mandatory if TSPC_HFP_2_24 otherwise excluded
>  C.8:  Excluded if TSPC_HFP_0_1 otherwise optional
>  C.9:  Excluded if TSPC_HFP_0_1 otherwise mandatory
>  C.10: Mandatory if TSPC_HFP_2_24 otherwise optional
> +C.11: Optional IF HFP v1.5 (TSPC_HFP_0_1) OR HFP v1.6 (TSPC_HFP_0_2) is NOT
> +	supported, otherwise Excluded.
> +C.12: Excluded IF HFP v1.5 (TSPC_HFP_0_1) OR HFP v1.6 (TSPC_HFP_0_2) is
> +	supported, otherwise Mandatory.
>  -------------------------------------------------------------------------------
>  
>  
> @@ -161,6 +168,8 @@ TSPC_HFP_3_21b	False		Enhanced Call Control (C.2)
>  TSPC_HFP_3_22	False		Support for automatic link loss recovery (O)
>  TSPC_HFP_3_23	False		Individual Indicator Activation (C.6)
>  TSPC_HFP_3_24	False		Wide Band Speech service (C.6)
> +TSPC_HFP_3_25	False		HF Indicators (C.8)
> +TSPC_HFP_3_36	False		Support CVSD eSCO S4 setting (C.9)
>  -------------------------------------------------------------------------------
>  C.1: Mandatory if TSPC_HFP_3_12; otherwise excluded
>  C.2: Optional if TSPC_HFP_3_12; otherwise excluded
> @@ -169,6 +178,10 @@ C.4: Mandatory if TSPC_HFP_3_18a, otherwise optional
>  C.5: Mandatory if TSPC_HFP_3_24 otherwise excluded
>  C.6: Excluded if TSPC_HFP_0_1 otherwise optional
>  C.7: Mandatory if TSPC_HFP_3_24 otherwise optional
> +C.8: Optional IF HFP v1.5 (TSPC_HFP_0_1) OR HFP v1.6 (TSPC_HFP_0_2) is NOT
> +	supported, otherwise Excluded.
> +C.9: Excluded IF HFP v1.5 (TSPC_HFP_0_1) OR HFP v1.6 (TSPC_HFP_0_2) is
> +	supported, otherwise Mandatory.
>  -------------------------------------------------------------------------------
>  
>  
> @@ -178,9 +191,14 @@ Parameter Name	Selected	Description
>  -------------------------------------------------------------------------------
>  TSPC_HFP_4_1	True		CVSD audio coding over SCO (M)
>  TSPC_HFP_4_2	True (*)	mSBC audio coding over eSCO (C.1)
> +TSPC_HFP_4_3	True (*)	CVSD audio coding over eSCO (Initiating) (C.2)
> +TSPC_HFP_4_2	True (*)	CVSD audio coding over eSCO (Accepting) (C.2)
>  -------------------------------------------------------------------------------
>  C.1: Mandatory if Wide band speech service is supported TSPC_HFP_2_24 or
>  	TSPC_HFP_3_24, otherwise excluded
> +C.2: Mandatory IF TPSC_HFP_2_3b (eSCO support in Audio Connection - AG) OR
> +	TSPC_HFP_3_3b (eSCO support in Audio Connection - HF); otherwise
> +	Excluded.
>  -------------------------------------------------------------------------------
>  
>  
> diff --git a/android/pixit-hfp.txt b/android/pixit-hfp.txt
> index eaccc75..bf1b7e5 100644
> --- a/android/pixit-hfp.txt
> +++ b/android/pixit-hfp.txt
> @@ -1,6 +1,6 @@
>  HFP PIXIT for the PTS tool.
>  
> -PTS version: 5.2
> +PTS version: 5.3
>  
>  * - different than PTS defaults
>  & - should be set to IUT Bluetooth address
> @@ -35,4 +35,7 @@ TSPX_no_fail_verdict					FALSE
>  TSPX_network_supports_correct_call_and_callstatus	TRUE
>  TSPX_secure_simple_pairing_pass_key_confirmation	FALSE
>  TSPX_AG_match_tester_BRSF_codec_negotiation_bit		FALSE
> +TSPX_HFP_Unsupported_HF_Indicator_1			99
> +TSPX_HFP_Supported_HF_Indiccator_1			1
> +TSPX_Automation						FALSE
>  -------------------------------------------------------------------------------
> diff --git a/android/pts-hfp.txt b/android/pts-hfp.txt
> index a281d6b..8d75766 100644
> --- a/android/pts-hfp.txt
> +++ b/android/pts-hfp.txt
> @@ -1,7 +1,7 @@
>  PTS test results for HFP
>  
> -PTS version: 5.2
> -Tested: 14-Jul-2014
> +PTS version: 5.3
> +Tested: 16-October-2014
>  Android version: 4.4.4
>  
>  Results:
> @@ -28,6 +28,7 @@ TC_AG_ACS_BV_08_I	PASS
>  TC_AG_ACS_BV_10_I	N/A
>  TC_AG_ACS_BV_11_I	PASS
>  TC_AG_ACS_BI_14_I	PASS
> +TC_AG_ACS_BI_16_I	N/A
>  TC_AG_ACR_BV_01_I	PASS
>  TC_AG_ACR_BV_02_I	PASS
>  TC_AG_CLI_BV_01_I	PASS
> @@ -66,7 +67,7 @@ TC_AG_ENO_BV_02_I	N/A
>  TC_AG_VRA_BV_01_I	PASS
>  TC_AG_VRA_BV_02_I	PASS
>  TC_AG_VRA_BI_01_I	PASS
> -TC_AG_VRD_BV_01_I	PASS
> +TC_AG_VRD_BV_01_I	N/A
>  TC_AG_VTG_BV_01_I	N/A
>  TC_AG_TDC_BV_01_I	PASS
>  TC_AG_RSV_BV_01_I	PASS
> @@ -98,6 +99,8 @@ TC_AG_SLC_BV_04_C	PASS
>  TC_AG_SLC_BV_05_I	PASS
>  TC_AG_SLC_BV_06_I	PASS
>  TC_AG_SLC_BV_07_I	PASS
> +TC_AG_SLC_BV_09_I	N/A
> +TC_AG_SLC_BV_10_I	N/A
>  TC_AG_ACC_BV_08_I	INC	Possible PTS issue #12039
>  TC_AG_ACC_BV_09_I	PASS
>  TC_AG_ACC_BV_10_I	INC	Possible PTS issue #12039
> @@ -120,7 +123,8 @@ TC_AG_IID_BV_04_I	PASS
>  TC_AG_IIC_BV_01_I	PASS
>  TC_AG_IIC_BV_02_I	PASS
>  TC_AG_IIC_BV_03_I	PASS
> -
> +TC_AG_HFI_BV_02_I	N/A
> +TC_AG_HFI_BV_03_I	N/A
>  TC_HF_OOR_BV_01_I	N/A
>  TC_HF_OOR_BV_02_I	N/A
>  TC_HF_TRS_BV_01_I	N/A
> @@ -223,7 +227,6 @@ TC_HF_SDP_BV_03_C	N/A
>  TC_HF_ATAH_BV_01_I	N/A
>  TC_HF_OCA_BV_01_I	N/A
>  TC_HF_IIA_BV_04_I	N/A
> -
>  TC_AG_COD_BV_02_I	PASS
>  TC_AG_ATAH_BV_03_I	PASS
>  TC_AG_ATA_BV_03_I	PASS
> @@ -236,7 +239,6 @@ TC_AG_ICA_BV_09_I	PASS
>  TC_AG_VRA_BV_03_I	PASS
>  TC_AG_OCA_BV_01_I	PASS
>  TC_AG_TCA_BV_06_I	PASS
> -
>  TC_HF_ATAH_BV_03_I	N/A
>  TC_HF_ATA_BV_03_I	N/A
>  TC_HF_ATH_BV_09_I	N/A
> 

Applied, thanks.

-- 
Best regards, 
Szymon Janc

^ permalink raw reply

* Re: [PATCH 1/2] android/pts: Update PICS and PIXIT for GATT
From: Szymon Janc @ 2014-10-20 10:11 UTC (permalink / raw)
  To: Marcin Kraglak; +Cc: linux-bluetooth
In-Reply-To: <1413463262-4090-1-git-send-email-marcin.kraglak@tieto.com>

Hi Marcin,

On Thursday 16 of October 2014 14:41:01 Marcin Kraglak wrote:
> ---
>  android/pics-gatt.txt  | 2 +-
>  android/pixit-gatt.txt | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/android/pics-gatt.txt b/android/pics-gatt.txt
> index 0cd67b6..6ff9c55 100644
> --- a/android/pics-gatt.txt
> +++ b/android/pics-gatt.txt
> @@ -1,6 +1,6 @@
>  GATT PICS for the PTS tool.
>  
> -PTS version: 5.2
> +PTS version: 5.3
>  
>  * - different than PTS defaults
>  
> diff --git a/android/pixit-gatt.txt b/android/pixit-gatt.txt
> index 08a80a3..191e2c9 100644
> --- a/android/pixit-gatt.txt
> +++ b/android/pixit-gatt.txt
> @@ -1,6 +1,6 @@
>  GATT PIXIT for the PTS tool.
>  
> -PTS version: 5.2
> +PTS version: 5.3
>  
>  * - different than PTS defaults
>  & - should be set to IUT Bluetooth address
> 

Both patches applied, thanks.

-- 
Best regards, 
Szymon Janc

^ permalink raw reply

* Re: [PATCH ] audio/avrcp: Add Support for PLAYBACK_POS_CHANGED_EVENT
From: Luiz Augusto von Dentz @ 2014-10-20 11:17 UTC (permalink / raw)
  To: Bharat Panda; +Cc: linux-bluetooth@vger.kernel.org, cpgs
In-Reply-To: <1412610595-16393-1-git-send-email-bharat.panda@samsung.com>

Hi,

On Mon, Oct 6, 2014 at 6:49 PM, Bharat Panda <bharat.panda@samsung.com> wrote:
> As per AVRCP 1.5 spec, 6.7.2, page 57.
>
> EVENT_PLAYBACK_POS_CHANGED shall be notified in the following conditions:
>
>         1. TG has reached the registered playback Interval time.
>         2. Changed PLAY STATUS.
>         3. Changed Current Track.
>         4. Reached end or beginning of track.
> ---
>  profiles/audio/avrcp.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
>  profiles/audio/avrcp.h |  1 +
>  profiles/audio/media.c | 23 ++++++++++++++---------
>  3 files changed, 64 insertions(+), 9 deletions(-)
>
> diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
> index 5c3c4f9..77f1dcb 100644
> --- a/profiles/audio/avrcp.c
> +++ b/profiles/audio/avrcp.c
> @@ -198,6 +198,7 @@ struct pending_list_items {
>  struct avrcp_player {
>         struct avrcp_server *server;
>         GSList *sessions;
> +       uint16_t pos_timer;
>         uint16_t id;
>         uint8_t scope;
>         uint64_t uid;
> @@ -627,6 +628,7 @@ void avrcp_player_event(struct avrcp_player *player, uint8_t id,
>         uint8_t buf[AVRCP_HEADER_LENGTH + 9];
>         struct avrcp_header *pdu = (void *) buf;
>         uint16_t size;
> +       uint32_t *pos = NULL;
>         GSList *l;
>         int attr;
>         int val;
> @@ -673,6 +675,18 @@ void avrcp_player_event(struct avrcp_player *player, uint8_t id,
>                 pdu->params[size++] = attr;
>                 pdu->params[size++] = val;
>                 break;
> +       case AVRCP_EVENT_PLAYBACK_POS_CHANGED:
> +               size = 5;
> +               pos = (uint32_t *) data;
> +
> +               be32toh(*pos);
> +               memcpy(&pdu->params[1], pos, sizeof(uint32_t));
> +
> +               if (player->pos_timer > 0) {
> +                       g_source_remove(player->pos_timer);
> +                       player->pos_timer = 0;
> +               }
> +               break;

Note that it is meant to be playback interval, so if it is not playing
we should not send anything.

>         default:
>                 error("Unknown event %u", id);
>                 return;
> @@ -1429,6 +1443,19 @@ static bool handle_passthrough(struct avctp *conn, uint8_t op, bool pressed,
>         return handler->func(session);
>  }
>
> +static gboolean interval_timeout(gpointer user_data)
> +{
> +       uint32_t pos;
> +       struct avrcp_player *mp = user_data;
> +
> +       pos = player_get_position(mp);
> +       mp->pos_timer = 0;
> +       avrcp_player_event(mp, AVRCP_EVENT_PLAYBACK_POS_CHANGED,
> +                                               &pos);
> +
> +       return FALSE;
> +}
> +
>  static uint8_t avrcp_handle_register_notification(struct avrcp *session,
>                                                 struct avrcp_header *pdu,
>                                                 uint8_t transaction)
> @@ -1436,6 +1463,8 @@ static uint8_t avrcp_handle_register_notification(struct avrcp *session,
>         struct avrcp_player *player = target_get_player(session);
>         struct btd_device *dev = session->dev;
>         uint16_t len = ntohs(pdu->params_len);
> +       uint32_t interval;
> +       uint32_t pos;
>         uint64_t uid;
>         GList *settings;
>
> @@ -1467,6 +1496,20 @@ static uint8_t avrcp_handle_register_notification(struct avrcp *session,
>         case AVRCP_EVENT_TRACK_REACHED_START:
>                 len = 1;
>                 break;
> +       case AVRCP_EVENT_PLAYBACK_POS_CHANGED:
> +               len = 5;
> +
> +               interval = htole32(pdu->params[1]);
> +               player->pos_timer = g_timeout_add_seconds(interval,
> +                                                               interval_timeout, player);
> +
> +               pos = player_get_position(player);
> +               be32toh(pos);
> +               /* Fill the value for sending INTERIM response */
> +               memcpy(&pdu->params[1], &pos, sizeof(uint32_t));
> +
> +               break;
> +
>         case AVRCP_EVENT_SETTINGS_CHANGED:
>                 len = 1;
>                 settings = player_list_settings(player);
> @@ -2949,6 +2992,11 @@ static void player_destroy(gpointer data)
>         if (player->destroy)
>                 player->destroy(player->user_data);
>
> +       if (player->pos_timer != 0) {
> +               g_source_remove(player->pos_timer);
> +               player->pos_timer = 0;
> +       }
> +
>         g_slist_free(player->sessions);
>         g_free(player->path);
>         g_free(player->change_path);
> @@ -3407,6 +3455,7 @@ static void target_init(struct avrcp *session)
>                                 (1 << AVRCP_EVENT_TRACK_CHANGED) |
>                                 (1 << AVRCP_EVENT_TRACK_REACHED_START) |
>                                 (1 << AVRCP_EVENT_TRACK_REACHED_END) |
> +                               (1 << AVRCP_EVENT_PLAYBACK_POS_CHANGED) |
>                                 (1 << AVRCP_EVENT_SETTINGS_CHANGED);
>
>         if (target->version < 0x0104)
> diff --git a/profiles/audio/avrcp.h b/profiles/audio/avrcp.h
> index 6ac5294..4816e4b 100644
> --- a/profiles/audio/avrcp.h
> +++ b/profiles/audio/avrcp.h
> @@ -74,6 +74,7 @@
>  #define AVRCP_EVENT_TRACK_CHANGED              0x02
>  #define AVRCP_EVENT_TRACK_REACHED_END          0x03
>  #define AVRCP_EVENT_TRACK_REACHED_START                0x04
> +#define        AVRCP_EVENT_PLAYBACK_POS_CHANGED        0x05
>  #define AVRCP_EVENT_SETTINGS_CHANGED           0x08
>  #define AVRCP_EVENT_AVAILABLE_PLAYERS_CHANGED  0x0a
>  #define AVRCP_EVENT_ADDRESSED_PLAYER_CHANGED   0x0b
> diff --git a/profiles/audio/media.c b/profiles/audio/media.c
> index ef7b910..cc19c61 100644
> --- a/profiles/audio/media.c
> +++ b/profiles/audio/media.c
> @@ -1305,6 +1305,9 @@ static gboolean set_status(struct media_player *mp, DBusMessageIter *iter)
>         mp->status = g_strdup(value);
>
>         avrcp_player_event(mp->player, AVRCP_EVENT_STATUS_CHANGED, mp->status);
> +       avrcp_player_event(mp->player,
> +                                       AVRCP_EVENT_PLAYBACK_POS_CHANGED,
> +                                       &mp->position);
>
>         return TRUE;
>  }
> @@ -1312,7 +1315,6 @@ static gboolean set_status(struct media_player *mp, DBusMessageIter *iter)
>  static gboolean set_position(struct media_player *mp, DBusMessageIter *iter)
>  {
>         uint64_t value;
> -       const char *status;
>
>         if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_INT64)
>                         return FALSE;
> @@ -1321,11 +1323,6 @@ static gboolean set_position(struct media_player *mp, DBusMessageIter *iter)
>
>         value /= 1000;
>
> -       if (value > get_position(mp))
> -               status = "forward-seek";
> -       else
> -               status = "reverse-seek";
> -

Not sure what is reasoning of removing these, the remote side may not
register for position change and in that case it would not get any
seek event to synchronize the position.

>         mp->position = value;
>         g_timer_start(mp->timer);
>
> @@ -1334,6 +1331,9 @@ static gboolean set_position(struct media_player *mp, DBusMessageIter *iter)
>         if (!mp->position) {
>                 avrcp_player_event(mp->player,
>                                         AVRCP_EVENT_TRACK_REACHED_START, NULL);
> +               avrcp_player_event(mp->player,
> +                                       AVRCP_EVENT_PLAYBACK_POS_CHANGED,
> +                                       &mp->position);
>                 return TRUE;
>         }
>
> @@ -1344,11 +1344,13 @@ static gboolean set_position(struct media_player *mp, DBusMessageIter *iter)
>         if (mp->position == UINT32_MAX || mp->position >= mp->duration) {
>                 avrcp_player_event(mp->player, AVRCP_EVENT_TRACK_REACHED_END,
>                                                                         NULL);
> +               avrcp_player_event(mp->player,
> +                                       AVRCP_EVENT_PLAYBACK_POS_CHANGED,
> +                                       &mp->position);
>                 return TRUE;
>         }
> -
> -       /* Send a status change to force resync the position */
> -       avrcp_player_event(mp->player, AVRCP_EVENT_STATUS_CHANGED, status);
> +       avrcp_player_event(mp->player, AVRCP_EVENT_PLAYBACK_POS_CHANGED,
> +                                                               &mp->position);
>
>         return TRUE;
>  }
> @@ -1456,6 +1458,7 @@ static gboolean parse_player_metadata(struct media_player *mp,
>         int ctype;
>         gboolean title = FALSE;
>         uint64_t uid;
> +       uint32_t pos;
>
>         ctype = dbus_message_iter_get_arg_type(iter);
>         if (ctype != DBUS_TYPE_ARRAY)
> @@ -1521,9 +1524,11 @@ static gboolean parse_player_metadata(struct media_player *mp,
>         mp->position = 0;
>         g_timer_start(mp->timer);
>         uid = get_uid(mp);
> +       pos = get_position(mp);
>
>         avrcp_player_event(mp->player, AVRCP_EVENT_TRACK_CHANGED, &uid);
>         avrcp_player_event(mp->player, AVRCP_EVENT_TRACK_REACHED_START, NULL);
> +       avrcp_player_event(mp->player, AVRCP_EVENT_PLAYBACK_POS_CHANGED, &pos);
>
>         return TRUE;
>  }
> --
> 1.9.1

Overall EVENT_PLAYBACK_POS_CHANGED cause more problems than it solves,
because position is already part of the play status and that normally
has to be queried anyway, also self synchronizing is way more
efficient since we can't estimate the speed when the playback is
fast-foward or rewind, and even if we could that would generate a lot
of traffic depending on what interval the remote side wants to be
updated.


-- 
Luiz Augusto von Dentz

^ permalink raw reply

* Re: [PATCH BlueZ] android/avrcp-lib: Use cpu_to_* and *_to_cpu
From: Luiz Augusto von Dentz @ 2014-10-20 12:05 UTC (permalink / raw)
  To: linux-bluetooth@vger.kernel.org
In-Reply-To: <1413536909-13049-1-git-send-email-luiz.dentz@gmail.com>

Hi,

On Fri, Oct 17, 2014 at 12:08 PM, Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> For PDU which have packed struct it is not necessary to use put_*
> and get_* since it should be already aligned.
> ---
>  android/avrcp-lib.c | 136 ++++++++++++++++++++++++++--------------------------
>  1 file changed, 68 insertions(+), 68 deletions(-)
>
> diff --git a/android/avrcp-lib.c b/android/avrcp-lib.c
> index 2c3d2e9..cff37a8 100644
> --- a/android/avrcp-lib.c
> +++ b/android/avrcp-lib.c
> @@ -929,7 +929,7 @@ static bool parse_attributes(uint32_t *params, uint16_t params_len,
>
>         for (i = 0; i < number && params_len >= sizeof(*attrs); i++,
>                                         params_len -= sizeof(*attrs)) {
> -               attrs[i] = get_be32(&params[i]);
> +               attrs[i] = be32_to_cpu(params[i]);
>
>                 if (attrs[i] == AVRCP_MEDIA_ATTRIBUTE_ILLEGAL ||
>                                 attrs[i] > AVRCP_MEDIA_ATTRIBUTE_LAST)
> @@ -988,7 +988,7 @@ static ssize_t register_notification(struct avrcp *session, uint8_t transaction,
>
>         req = (void *) params;
>
> -       interval = get_be32(&req->interval);
> +       interval = be32_to_cpu(req->interval);
>
>         return player->ind->register_notification(session, transaction,
>                                                         req->event, interval,
> @@ -1037,7 +1037,7 @@ static ssize_t set_addressed(struct avrcp *session, uint8_t transaction,
>
>         req = (void *) params;
>
> -       id = get_be16(&req->id);
> +       id = be16_to_cpu(req->id);
>
>         return player->ind->set_addressed(session, transaction, id,
>                                                         player->user_data);
> @@ -1271,7 +1271,7 @@ static ssize_t set_browsed(struct avrcp *session, uint8_t transaction,
>
>         req = (void *) params;
>
> -       id = get_be16(&req->id);
> +       id = be16_to_cpu(req->id);
>
>         return player->ind->set_browsed(session, transaction, id,
>                                                         player->user_data);
> @@ -1301,16 +1301,16 @@ static ssize_t get_folder_items(struct avrcp *session, uint8_t transaction,
>         if (req->scope > AVRCP_MEDIA_NOW_PLAYING)
>                 return -EBADRQC;
>
> -       start = get_be32(&req->start);
> -       end = get_be32(&req->end);
> +       start = be32_to_cpu(req->start);
> +       end = be32_to_cpu(req->end);
>
>         if (start > end)
>                 return -ERANGE;
>
> -       number = get_be16(&req->number);
> +       number = be16_to_cpu(req->number);
>
>         for (i = 0; i < number; i++) {
> -               attrs[i] = get_be32(&req->attrs[i]);
> +               attrs[i] = be32_to_cpu(req->attrs[i]);
>
>                 if (attrs[i] == AVRCP_MEDIA_ATTRIBUTE_ILLEGAL ||
>                                 attrs[i] > AVRCP_MEDIA_ATTRIBUTE_LAST)
> @@ -1341,8 +1341,8 @@ static ssize_t change_path(struct avrcp *session, uint8_t transaction,
>
>         req = (void *) params;
>
> -       counter = get_be16(&req->counter);
> -       uid = get_be64(&req->uid);
> +       counter = be16_to_cpu(req->counter);
> +       uid = be64_to_cpu(req->uid);
>
>         return player->ind->change_path(session, transaction, counter,
>                                         req->direction, uid, player->user_data);
> @@ -1372,11 +1372,11 @@ static ssize_t get_item_attributes(struct avrcp *session, uint8_t transaction,
>         if (req->scope > AVRCP_MEDIA_NOW_PLAYING)
>                 return -EBADRQC;
>
> -       uid = get_be64(&req->uid);
> -       counter = get_be16(&req->counter);
> +       uid = be64_to_cpu(req->uid);
> +       counter = be16_to_cpu(req->counter);
>
>         for (i = 0; i < req->number; i++) {
> -               attrs[i] = get_be32(&req->attrs[i]);
> +               attrs[i] = be32_to_cpu(req->attrs[i]);
>
>                 if (attrs[i] == AVRCP_MEDIA_ATTRIBUTE_ILLEGAL ||
>                                 attrs[i] > AVRCP_MEDIA_ATTRIBUTE_LAST)
> @@ -1411,8 +1411,8 @@ static ssize_t play_item(struct avrcp *session, uint8_t transaction,
>         if (req->scope > AVRCP_MEDIA_NOW_PLAYING)
>                 return -EBADRQC;
>
> -       uid = get_be64(&params[1]);
> -       counter = get_be16(&params[9]);
> +       uid = be64_to_cpu(req->uid);
> +       counter = be16_to_cpu(req->counter);
>
>         return player->ind->play_item(session, transaction, req->scope, uid,
>                                                 counter, player->user_data);
> @@ -1438,7 +1438,7 @@ static ssize_t search(struct avrcp *session, uint8_t transaction,
>
>         req = (void *) params;
>
> -       len = get_be16(&req->len);
> +       len = be16_to_cpu(req->len);
>         if (!len)
>                 return -EINVAL;
>
> @@ -1474,8 +1474,8 @@ static ssize_t add_to_now_playing(struct avrcp *session, uint8_t transaction,
>         if (req->scope > AVRCP_MEDIA_NOW_PLAYING)
>                 return -EBADRQC;
>
> -       uid = get_be64(&req->uid);
> -       counter = get_be16(&req->counter);
> +       uid = be64_to_cpu(req->uid);
> +       counter = be16_to_cpu(req->counter);
>
>         return player->ind->add_to_now_playing(session, transaction, req->scope,
>                                                         uid, counter,
> @@ -1859,7 +1859,7 @@ int avrcp_register_notification(struct avrcp *session, uint8_t event,
>                 return -EINVAL;
>
>         req.event = event;
> -       put_be32(interval, &req.interval);
> +       req.interval = cpu_to_be32(interval);
>
>         iov.iov_base = &req;
>         iov.iov_len = sizeof(req);
> @@ -2345,8 +2345,8 @@ static gboolean get_play_status_rsp(struct avctp *conn,
>
>         rsp = (void *) pdu->params;
>
> -       duration = get_be32(&rsp->duration);
> -       position = get_be32(&rsp->position);
> +       duration = be32_to_cpu(rsp->duration);
> +       position = be32_to_cpu(rsp->position);
>         status = rsp->status;
>         err = 0;
>
> @@ -2432,9 +2432,9 @@ static int parse_attribute_list(uint8_t *params, uint16_t params_len,
>         for (i = 0; i < number && params_len >= sizeof(*item); i++) {
>                 item = (void *) params;
>
> -               item->attr = get_be32(&item->attr);
> -               item->charset = get_be16(&item->charset);
> -               item->len = get_be16(&item->len);
> +               item->attr = be32_to_cpu(item->attr);
> +               item->charset = be16_to_cpu(item->charset);
> +               item->len = be16_to_cpu(item->len);
>
>                 params_len -= sizeof(*item);
>                 params += sizeof(*item);
> @@ -2584,7 +2584,7 @@ int avrcp_set_addressed_player(struct avrcp *session, uint16_t player_id)
>         struct iovec iov;
>         struct set_addressed_req req;
>
> -       put_be16(player_id, &req.id);
> +       req.id = cpu_to_be16(player_id);
>
>         iov.iov_base = &req;
>         iov.iov_len = sizeof(req);
> @@ -2658,8 +2658,8 @@ static gboolean set_browsed_rsp(struct avctp *conn, uint8_t *operands,
>
>         rsp = (void *) pdu->params;
>
> -       counter = get_be16(&rsp->counter);
> -       items = get_be32(&rsp->items);
> +       counter = be16_to_cpu(rsp->counter);
> +       items = be32_to_cpu(rsp->items);
>
>         path = parse_folder_list(rsp->data, pdu->params_len - sizeof(*rsp),
>                                                                 rsp->depth);
> @@ -2676,12 +2676,12 @@ done:
>  int avrcp_set_browsed_player(struct avrcp *session, uint16_t player_id)
>  {
>         struct iovec iov;
> -       uint8_t pdu[2];
> +       struct set_browsed_req req;
>
> -       put_be16(player_id, pdu);
> +       req.id = cpu_to_be16(player_id);
>
> -       iov.iov_base = pdu;
> -       iov.iov_len = sizeof(pdu);
> +       iov.iov_base = &req;
> +       iov.iov_len = sizeof(req);
>
>         return avrcp_send_browsing_req(session, AVRCP_SET_BROWSED_PLAYER,
>                                         &iov, 1, set_browsed_rsp, session);
> @@ -2721,8 +2721,8 @@ static gboolean get_folder_items_rsp(struct avctp *conn,
>
>         rsp = (void *) pdu->params;
>
> -       counter = get_be16(&rsp->counter);
> -       number = get_be16(&rsp->number);
> +       counter = be16_to_cpu(rsp->counter);
> +       number = be16_to_cpu(rsp->number);
>         params = rsp->data;
>
>         /* FIXME: Add proper parsing for each item type */
> @@ -2744,8 +2744,8 @@ int avrcp_get_folder_items(struct avrcp *session, uint8_t scope,
>         int i;
>
>         req.scope = scope;
> -       put_be32(start, &req.start);
> -       put_be32(end, &req.end);
> +       req.start = cpu_to_be32(start);
> +       req.end = cpu_to_be32(end);
>         req.number = number;
>
>         iov[0].iov_base = &req;
> @@ -2757,7 +2757,7 @@ int avrcp_get_folder_items(struct avrcp *session, uint8_t scope,
>                                                 session);
>
>         for (i = 0; i < number; i++)
> -               put_be32(attrs[i], &attrs[i]);
> +               attrs[i] = cpu_to_be32(attrs[i]);
>
>         iov[1].iov_base = attrs;
>         iov[1].iov_len = number * sizeof(*attrs);
> @@ -2798,7 +2798,7 @@ static gboolean change_path_rsp(struct avctp *conn, uint8_t *operands,
>
>         rsp = (void *) pdu->params;
>
> -       items = get_be32(&rsp->items);
> +       items = be32_to_cpu(rsp->items);
>
>  done:
>         player->cfm->change_path(session, err, items, player->user_data);
> @@ -2812,9 +2812,9 @@ int avrcp_change_path(struct avrcp *session, uint8_t direction, uint64_t uid,
>         struct iovec iov;
>         struct change_path_req req;
>
> -       put_be16(counter, &req.counter);
> +       req.counter = cpu_to_be16(counter);
>         req.direction = direction;
> -       put_be64(uid, &req.uid);
> +       req.uid = cpu_to_be64(uid);
>
>         iov.iov_base = &req;
>         iov.iov_len = sizeof(req);
> @@ -2867,8 +2867,8 @@ int avrcp_get_item_attributes(struct avrcp *session, uint8_t scope,
>         int i;
>
>         req.scope = scope;
> -       put_be64(uid, &req.uid);
> -       put_be16(counter, &req.counter);
> +       req.uid = cpu_to_be64(uid);
> +       req.counter = cpu_to_be16(counter);
>         req.number = number;
>
>         iov[0].iov_base = &req;
> @@ -2887,7 +2887,7 @@ int avrcp_get_item_attributes(struct avrcp *session, uint8_t scope,
>                 if (attrs[i] > AVRCP_MEDIA_ATTRIBUTE_LAST ||
>                                 attrs[i] == AVRCP_MEDIA_ATTRIBUTE_ILLEGAL)
>                         return -EINVAL;
> -               put_be32(attrs[i], &attrs[i]);
> +               attrs[i] = cpu_to_be32(attrs[i]);
>         }
>
>         iov[1].iov_base = attrs;
> @@ -2935,8 +2935,8 @@ int avrcp_play_item(struct avrcp *session, uint8_t scope, uint64_t uid,
>                 return -EINVAL;
>
>         req.scope = scope;
> -       put_be64(uid, &req.uid);
> -       put_be16(counter, &req.counter);
> +       req.uid = cpu_to_be64(uid);
> +       req.counter = cpu_to_be16(counter);
>
>         iov.iov_base = &req;
>         iov.iov_len = sizeof(req);
> @@ -2978,8 +2978,8 @@ static gboolean search_rsp(struct avctp *conn, uint8_t *operands,
>
>         rsp = (void *) pdu->params;
>
> -       counter = get_be16(&rsp->counter);
> -       items = get_be32(&rsp->items);
> +       counter = be16_to_cpu(rsp->counter);
> +       items = be32_to_cpu(rsp->items);
>
>         err = 0;
>
> @@ -3000,8 +3000,8 @@ int avrcp_search(struct avrcp *session, const char *string)
>
>         len = strnlen(string, UINT8_MAX);
>
> -       put_be16(AVRCP_CHARSET_UTF8, &req.charset);
> -       put_be16(len, &req.len);
> +       req.charset = cpu_to_be16(AVRCP_CHARSET_UTF8);
> +       req.len = cpu_to_be16(len);
>
>         iov[0].iov_base = &req;
>         iov[0].iov_len = sizeof(req);
> @@ -3050,8 +3050,8 @@ int avrcp_add_to_now_playing(struct avrcp *session, uint8_t scope, uint64_t uid,
>                 return -EINVAL;
>
>         req.scope = scope;
> -       put_be64(uid, &req.uid);
> -       put_be16(counter, &req.counter);
> +       req.uid = cpu_to_be64(uid);
> +       req.counter = cpu_to_be16(counter);
>
>         iov.iov_base = &req;
>         iov.iov_len = sizeof(req);
> @@ -3136,7 +3136,7 @@ int avrcp_get_player_attribute_text_rsp(struct avrcp *session,
>                         len = strlen(text[i]);
>
>                 val[i].attr = attrs[i];
> -               put_be16(AVRCP_CHARSET_UTF8, &val[i].charset);
> +               val[i].charset = cpu_to_be16(AVRCP_CHARSET_UTF8);
>                 val[i].len = len;
>
>                 iov[i + 1].iov_base = &val[i];
> @@ -3177,8 +3177,8 @@ int avrcp_get_play_status_rsp(struct avrcp *session, uint8_t transaction,
>         struct iovec iov;
>         struct get_play_status_rsp rsp;
>
> -       put_be32(duration, &rsp.duration);
> -       put_be32(position, &rsp.position);
> +       rsp.duration = cpu_to_be32(duration);
> +       rsp.position = cpu_to_be32(position);
>         rsp.status = status;
>
>         iov.iov_base = &rsp;
> @@ -3210,7 +3210,7 @@ int avrcp_get_player_values_text_rsp(struct avrcp *session,
>                         len = strlen(text[i]);
>
>                 val[i].attr = values[i];
> -               put_be16(AVRCP_CHARSET_UTF8, &val[i].charset);
> +               val[i].charset = cpu_to_be16(AVRCP_CHARSET_UTF8);
>                 val[i].len = len;
>
>                 iov[i + 1].iov_base = &val[i];
> @@ -3314,8 +3314,8 @@ int avrcp_register_notification_rsp(struct avrcp *session, uint8_t transaction,
>                         return -EINVAL;
>
>                 player = data;
> -               put_be16(player[0], &player[0]);
> -               put_be16(player[1], &player[1]);
> +               player[0] = cpu_to_be16(player[0]);
> +               player[1] = cpu_to_be16(player[1]);
>
>                 break;
>         case AVRCP_EVENT_SETTINGS_CHANGED:
> @@ -3398,9 +3398,9 @@ int avrcp_set_browsed_player_rsp(struct avrcp *session, uint8_t transaction,
>                                         AVRCP_SET_BROWSED_PLAYER, status);
>
>         rsp.status = status;
> -       put_be16(counter, &rsp.counter);
> -       put_be32(items, &rsp.items);
> -       put_be16(AVRCP_CHARSET_UTF8, &rsp.charset);
> +       rsp.counter = cpu_to_be16(counter);
> +       rsp.items = cpu_to_be32(items);
> +       rsp.charset = cpu_to_be16(AVRCP_CHARSET_UTF8);
>         rsp.depth = depth;
>
>         iov[0].iov_base = &rsp;
> @@ -3420,7 +3420,7 @@ int avrcp_set_browsed_player_rsp(struct avrcp *session, uint8_t transaction,
>                 iov[i * 2 + 2].iov_base = (void *) folders[i];
>                 iov[i * 2 + 2].iov_len = len[i];
>
> -               put_be16(len[i], &len[i]);
> +               len[i] = cpu_to_be16(len[i]);
>
>                 iov[i * 2 + 1].iov_base = &len[i];
>                 iov[i * 2 + 1].iov_len = sizeof(len[i]);
> @@ -3446,8 +3446,8 @@ int avrcp_get_folder_items_rsp(struct avrcp *session, uint8_t transaction,
>                                         AVRCP_GET_FOLDER_ITEMS, status);
>
>         rsp.status = status;
> -       put_be16(counter, &rsp.counter);
> -       put_be16(number, &rsp.number);
> +       rsp.counter = cpu_to_be16(counter);
> +       rsp.number = cpu_to_be16(number);
>
>         iov[0].iov_base = &rsp;
>         iov[0].iov_len = sizeof(rsp);
> @@ -3478,7 +3478,7 @@ int avrcp_change_path_rsp(struct avrcp *session, uint8_t transaction,
>                                                                         status);
>
>         rsp.status = status;
> -       put_be32(items, &rsp.items);
> +       rsp.items = cpu_to_be32(items);
>
>         iov.iov_base = &rsp;
>         iov.iov_len = sizeof(rsp);
> @@ -3503,9 +3503,9 @@ static bool pack_attribute_list(struct iovec *iov, uint8_t number,
>                 if (text[i])
>                         len = strlen(text[i]);
>
> -               put_be32(attrs[i], &val[i].attr);
> -               put_be16(AVRCP_CHARSET_UTF8, &val[i].charset);
> -               put_be16(len, &val[i].len);
> +               val[i].attr = cpu_to_be32(attrs[i]);
> +               val[i].charset = cpu_to_be16(AVRCP_CHARSET_UTF8);
> +               val[i].len = cpu_to_be16(len);
>
>                 iov[i].iov_base = &val[i];
>                 iov[i].iov_len = sizeof(val[i]);
> @@ -3563,8 +3563,8 @@ int avrcp_search_rsp(struct avrcp *session, uint8_t transaction, uint8_t status,
>                                                                 status);
>
>         rsp.status = status;
> -       put_be16(counter, &rsp.counter);
> -       put_be32(items, &rsp.items);
> +       rsp.counter = cpu_to_be16(counter);
> +       rsp.items = cpu_to_be32(items);
>
>         iov.iov_base = &rsp;
>         iov.iov_len = sizeof(rsp);
> --
> 1.9.3

Pushed.


-- 
Luiz Augusto von Dentz

^ 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