Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 2/3] Bluetooth: 6lowpan: Fix lockdep splats
From: Jukka Rissanen @ 2014-10-17 13:56 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1413554186-27096-1-git-send-email-jukka.rissanen@linux.intel.com>

When a device ndo_start_xmit() calls again dev_queue_xmit(),
lockdep can complain because dev_queue_xmit() is re-entered and the
spinlocks protecting tx queues share a common lockdep class.

Same issue was fixed for ieee802162 in commit "20e7c4e80dcd"

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
---
 net/bluetooth/6lowpan.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index 1fb8e67..b407457 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -653,7 +653,26 @@ static netdev_tx_t bt_xmit(struct sk_buff *skb, struct net_device *netdev)
 	return err < 0 ? NET_XMIT_DROP : err;
 }
 
+static struct lock_class_key bt_tx_busylock;
+static struct lock_class_key bt_netdev_xmit_lock_key;
+
+static void bt_set_lockdep_class_one(struct net_device *dev,
+				     struct netdev_queue *txq,
+				     void *_unused)
+{
+	lockdep_set_class(&txq->_xmit_lock, &bt_netdev_xmit_lock_key);
+}
+
+static int bt_dev_init(struct net_device *dev)
+{
+	netdev_for_each_tx_queue(dev, bt_set_lockdep_class_one, NULL);
+	dev->qdisc_tx_busylock = &bt_tx_busylock;
+
+	return 0;
+}
+
 static const struct net_device_ops netdev_ops = {
+	.ndo_init		= bt_dev_init,
 	.ndo_start_xmit		= bt_xmit,
 };
 
-- 
1.8.3.1


^ permalink raw reply related

* [PATCH 3/3] Bluetooth: Wrong style spin lock used
From: Jukka Rissanen @ 2014-10-17 13:56 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1413554186-27096-1-git-send-email-jukka.rissanen@linux.intel.com>

Use spin_lock_bh() as the code is called from softirq in networking subsystem.
This is needed to prevent deadlocks when 6lowpan link is in use.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
---
 net/bluetooth/hci_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index cb05d7f..0242e01 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -4662,7 +4662,7 @@ static void hci_queue_acl(struct hci_chan *chan, struct sk_buff_head *queue,
 		skb_shinfo(skb)->frag_list = NULL;
 
 		/* Queue all fragments atomically */
-		spin_lock(&queue->lock);
+		spin_lock_bh(&queue->lock);
 
 		__skb_queue_tail(queue, skb);
 
@@ -4679,7 +4679,7 @@ static void hci_queue_acl(struct hci_chan *chan, struct sk_buff_head *queue,
 			__skb_queue_tail(queue, skb);
 		} while (list);
 
-		spin_unlock(&queue->lock);
+		spin_unlock_bh(&queue->lock);
 	}
 }
 
-- 
1.8.3.1


^ permalink raw reply related

* Re: [PATCH] Bluetooth: 6lowpan: remove unnecessary codes in give_skb_to_upper
From: Marcel Holtmann @ 2014-10-17 14:08 UTC (permalink / raw)
  To: Jukka Rissanen
  Cc: roy.qing.li, linux-bluetooth, Gustavo F. Padovan, Johan Hedberg
In-Reply-To: <1413551445.2705.152.camel@jrissane-mobl.ger.corp.intel.com>

Hi Jukka,

>> From: Li RongQing <roy.qing.li@gmail.com>
>> 
>> netif_rx() only returns NET_RX_DROP and NET_RX_SUCCESS, not returns
>> negative value
>> 
>> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
>> ---
>> net/bluetooth/6lowpan.c |    9 +--------
>> 1 file changed, 1 insertion(+), 8 deletions(-)
>> 
>> diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
>> index c2e0d14..9b5c89b 100644
>> --- a/net/bluetooth/6lowpan.c
>> +++ b/net/bluetooth/6lowpan.c
>> @@ -249,19 +249,12 @@ static struct lowpan_dev *lookup_dev(struct l2cap_conn *conn)
>> static int give_skb_to_upper(struct sk_buff *skb, struct net_device *dev)
>> {
>> 	struct sk_buff *skb_cp;
>> -	int ret;
>> 
>> 	skb_cp = skb_copy(skb, GFP_ATOMIC);
>> 	if (!skb_cp)
>> 		return -ENOMEM;
>> 
>> -	ret = netif_rx(skb_cp);
>> -	if (ret < 0) {
>> -		BT_DBG("receive skb %d", ret);
>> -		return NET_RX_DROP;
>> -	}
>> -
>> -	return ret;
>> +	return netif_rx(skb_cp);
>> }
>> 
>> static int process_data(struct sk_buff *skb, struct net_device *netdev,
> 
> Ack to this.
> 
> Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>

this should be acked-by or reviewed-by and not signed-off-by. The signed-off-by is only if you would send Roy's original patch on his behalf or you would be in the chain of sending patches along the maintainer trees.

Regards

Marcel


^ permalink raw reply

* Re: [PATCH] Bluetooth: 6lowpan: remove unnecessary codes in give_skb_to_upper
From: Marcel Holtmann @ 2014-10-17 14:11 UTC (permalink / raw)
  To: roy.qing.li; +Cc: linux-bluetooth, Gustavo F. Padovan, Johan Hedberg
In-Reply-To: <1413426115-17077-1-git-send-email-roy.qing.li@gmail.com>

Hi Roy,

> From: Li RongQing <roy.qing.li@gmail.com>
> 
> netif_rx() only returns NET_RX_DROP and NET_RX_SUCCESS, not returns
> negative value
> 
> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
> ---
> net/bluetooth/6lowpan.c |    9 +--------
> 1 file changed, 1 insertion(+), 8 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply

* Re: [PATCH v6 bluetooth-next] 6lowpan: Use skb_cow in IPHC decompression.
From: Marcel Holtmann @ 2014-10-17 14:15 UTC (permalink / raw)
  To: Martin Townsend
  Cc: linux-bluetooth, linux-wpan, alex.aring, jukka.rissanen,
	Martin Townsend
In-Reply-To: <1413194456-26351-2-git-send-email-martin.townsend@xsilon.com>

Hi Martin,

> Currently there are potentially 2 skb_copy_expand calls in IPHC
> decompression.  This patch replaces this with one call to
> skb_cow which will check to see if there is enough headroom
> first to ensure it's only done if necessary and will handle
> alignment issues for cache.
> As skb_cow uses pskb_expand_head we ensure the skb isn't shared from
> bluetooth and ieee802.15.4 code that use the IPHC decompression.
> 
> Signed-off-by: Martin Townsend <martin.townsend@xsilon.com>
> ---
> net/6lowpan/iphc.c      | 47 +++++++++++++++++++++--------------------------
> net/bluetooth/6lowpan.c |  4 ++++
> 2 files changed, 25 insertions(+), 26 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply

* Re: [PATCH bluetooth] Bluetooth: Fix missing channel unlock in l2cap_le_credits
From: Marcel Holtmann @ 2014-10-17 14:18 UTC (permalink / raw)
  To: Martin Townsend; +Cc: linux-bluetooth, jukka.rissanen, Johan Hedberg
In-Reply-To: <1413224685-3700-1-git-send-email-mtownsend1973@gmail.com>

Hi Martin,

> In the error case where credits is greater than max_credits there
> is a missing l2cap_chan_unlock before returning.
> 
> Signed-off-by: Martin Townsend <mtownsend1973@gmail.com>
> ---
> net/bluetooth/l2cap_core.c | 1 +
> 1 file changed, 1 insertion(+)

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply

* Re: [PATCH] Bluetooth: 6lowpan: remove unnecessary codes in give_skb_to_upper
From: Jukka Rissanen @ 2014-10-17 14:20 UTC (permalink / raw)
  To: Marcel Holtmann
  Cc: roy.qing.li, linux-bluetooth, Gustavo F. Padovan, Johan Hedberg
In-Reply-To: <CE81865A-F3BE-4177-BF79-E66CFAAFEA72@holtmann.org>

On pe, 2014-10-17 at 16:08 +0200, Marcel Holtmann wrote:
> Hi Jukka,
> 
> >> From: Li RongQing <roy.qing.li@gmail.com>
> >> 
> >> netif_rx() only returns NET_RX_DROP and NET_RX_SUCCESS, not returns
> >> negative value
> >> 
> >> Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
> >> ---
> >> net/bluetooth/6lowpan.c |    9 +--------
> >> 1 file changed, 1 insertion(+), 8 deletions(-)
> >> 
> >> diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
> >> index c2e0d14..9b5c89b 100644
> >> --- a/net/bluetooth/6lowpan.c
> >> +++ b/net/bluetooth/6lowpan.c
> >> @@ -249,19 +249,12 @@ static struct lowpan_dev *lookup_dev(struct l2cap_conn *conn)
> >> static int give_skb_to_upper(struct sk_buff *skb, struct net_device *dev)
> >> {
> >> 	struct sk_buff *skb_cp;
> >> -	int ret;
> >> 
> >> 	skb_cp = skb_copy(skb, GFP_ATOMIC);
> >> 	if (!skb_cp)
> >> 		return -ENOMEM;
> >> 
> >> -	ret = netif_rx(skb_cp);
> >> -	if (ret < 0) {
> >> -		BT_DBG("receive skb %d", ret);
> >> -		return NET_RX_DROP;
> >> -	}
> >> -
> >> -	return ret;
> >> +	return netif_rx(skb_cp);
> >> }
> >> 
> >> static int process_data(struct sk_buff *skb, struct net_device *netdev,
> > 
> > Ack to this.
> > 
> > Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
> 
> this should be acked-by or reviewed-by and not signed-off-by. The signed-off-by is only if you would send Roy's original patch on his behalf or you would be in the chain of sending patches along the maintainer trees.

Do'h! Yep, I meant to say Acked-by (too many things going on same
time :)

Acked-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>


> 
> Regards
> 
> Marcel
> 


Cheers,
Jukka

^ permalink raw reply

* Re: [PATCH] Bluetooth: 6lowpan: remove unnecessary codes in give_skb_to_upper
From: Alexander Aring @ 2014-10-17 15:01 UTC (permalink / raw)
  To: Jukka Rissanen
  Cc: roy.qing.li, linux-bluetooth, marcel, gustavo, johan.hedberg
In-Reply-To: <1413551445.2705.152.camel@jrissane-mobl.ger.corp.intel.com>

Hi Jukka,

On Fri, Oct 17, 2014 at 04:10:45PM +0300, Jukka Rissanen wrote:
> Hi,
> 
> On to, 2014-10-16 at 10:21 +0800, roy.qing.li@gmail.com wrote:
> > From: Li RongQing <roy.qing.li@gmail.com>
> > 
> > netif_rx() only returns NET_RX_DROP and NET_RX_SUCCESS, not returns
> > negative value
> > 
> > Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
> > ---
> >  net/bluetooth/6lowpan.c |    9 +--------
> >  1 file changed, 1 insertion(+), 8 deletions(-)
> > 
> > diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
> > index c2e0d14..9b5c89b 100644
> > --- a/net/bluetooth/6lowpan.c
> > +++ b/net/bluetooth/6lowpan.c
> > @@ -249,19 +249,12 @@ static struct lowpan_dev *lookup_dev(struct l2cap_conn *conn)
> >  static int give_skb_to_upper(struct sk_buff *skb, struct net_device *dev)
> >  {
> >  	struct sk_buff *skb_cp;
> > -	int ret;
> >  
> >  	skb_cp = skb_copy(skb, GFP_ATOMIC);
> >  	if (!skb_cp)
> >  		return -ENOMEM;
> >  
> > -	ret = netif_rx(skb_cp);
> > -	if (ret < 0) {
> > -		BT_DBG("receive skb %d", ret);
> > -		return NET_RX_DROP;
> > -	}
> > -
> > -	return ret;
> > +	return netif_rx(skb_cp);
> >  }
> >  
> >  static int process_data(struct sk_buff *skb, struct net_device *netdev,
> 
> Ack to this.
> 

Just for notice: this doesn't fix anything, because it's currently
broken.

This is part of issue that lowpan_process_data returns sometimes errno
and (NET_RX_DROP or NET_RX_SUCCESS).

Martin tries to fix this issue, but it seems that this isn't easy.

The lowpan_process_data function still returns sometimes a errno or
NET_RX_DROP. So a check on (ret < 0) or (ret == NET_RX_DROP) doesn't
work. I mean this patch is okay for me, but there still are some
problems around. :-)

Simple we can't return errno or NET_RX_FOO in lowpan_process_data, but I
am sure Martin still working on a fix for this issue. We need to change
everything to returning errno's only.

- Alex

^ permalink raw reply

* [PATCH] android/pts: Update PAN PTS tests
From: Grzegorz Kolodziejczyk @ 2014-10-17 15:42 UTC (permalink / raw)
  To: linux-bluetooth

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:
-- 
1.9.3


^ permalink raw reply related

* [PATCH bluetooth-next 0/5] Move skb delivery out of 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

This series moves skb delivery out of IPHC and into the receive routines of
both bluetooth and 802.15.4.  The reason is that we need to support more
(de)compression schemes in the future.  It also means that calling 
lowpan_process_data now only returns error codes or 0 for success so 
this has been cleaned up.  The final patch then renames occurences of
lowpan_process_data and process_data to something more meaningful.

Martin Townsend (5):
  Remove skb_deliver from IPHC.
  Fix process_data return values
  Use consume_skb when packet processed successfully.
  Remove unused skb_delivery_cb typedef.
  Rename process_data and lowpan_process_data.

 include/net/6lowpan.h         | 12 ++++++------
 net/6lowpan/iphc.c            | 42 ++++++++++++------------------------------
 net/bluetooth/6lowpan.c       | 29 ++++++++++++++++++++---------
 net/ieee802154/6lowpan_rtnl.c | 34 +++++++++++++++-------------------
 4 files changed, 53 insertions(+), 64 deletions(-)

-- 
1.9.1

^ permalink raw reply

* [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
Im1vZHVsZS1ibHVlejUtZGV2aWNlIiAoaW5kZXg6IC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aXMgdGhlIGlzc3VlIG9mIGh0dHBz
Oi8vYnVncy50aXplbi5vcmcvamlyYS9icm93c2UvVEMtMTYwLg0KDQpZZXMsIGJ5IGRlc2lnbiBp
dCBpcyBkdXBsZXggc28gYm90aCBzaW5rIGFuZCBzb3VyY2Ugd29ya3Mgc2ltdWx0YW5lb3VzbHks
IHBlcmhhcHMgeW91IGFyZSB0YWxraW5nIGFib3V0IG9mIHNlbmRpbmcgdGhlIG1pY3JvcGhvbmUg
ZGF0YSB0byB0aGUgb3RoZXIgZW5kIHdoaWNoIGhhcyBwcm9iYWJseSBub3RoaW5nIHRvIGRvIHdp
dGggQmx1ZXRvb3RoIGJ1dCB3aXRoIGF1ZGlvIHJvdXRpbmcgbm90IGJlaW5nIHByb3Blcmx5IGNv
bmZpZ3VyZWQuDQoNCg0KLS0NCkx1aXogQXVndXN0byB2b24gRGVudHoNCg==

^ 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