Bluetooth: bt net interface can't be set up after 6lowpan connection
Subsystems (2)
PATCH 1/1 Bluetooth: bt net interface can't be set up after 6lowpan connection
After set 'hciconfig leadv', bt net interface can't be created when the 6lowpan over bluetooth le connection is established by another bluetooth le device.
When the the 6lowpan over bluetooth le connection is established, the function of chan_open in the file of 6lowpan.c is invoked. chan->state is set to the state of BT_CONNECTED.
Then l2cap_chan_ready in the file of l2cap_core.c is invoked. However, when chan->state is BT_CONNECTED, chan_ready_cb is not invoked.
It results in that bt net interface(such as bt0) can't be created.
Removing "chan->state = BT_CONNECTED" in chan_open can make chan->state set the right state and fixing the issue.
--- net/bluetooth/6lowpan.c | 2 -- 1 file changed, 2 deletions(-)
net/bluetooth/6lowpan.c +0 -2
@@ -792,8 +792,6 @@ static struct l2cap_chan *chan_open(struct l2cap_chan *pchan) chan->remote_mps = chan->omtu; chan->mps = chan->omtu; - chan->state =BT_CONNECTED ; -return chan; }
Signature · 1 line
2.1.4
Hi Zheng Wu,
Quoted 26 lines · Wu Zheng
After set 'hciconfig leadv', bt net interface can't be created when the 6lowpan over bluetooth le connection is established by another bluetooth le device.
When the the 6lowpan over bluetooth le connection is established, the function of
chan_openin the file of6lowpan.cis invoked.chan->stateis set to the state ofBT_CONNECTED.Then
l2cap_chan_readyin the file ofl2cap_core.cis invoked. However, whenchan->stateisBT_CONNECTED,chan_ready_cbis not invoked.It results in that bt net interface(such as bt0) can't be created.
Removing "
chan->state=BT_CONNECTED" inchan_opencan makechan->stateset the right state and fixing the issue.Signed-off-by Wu Zheng <[email protected]>--- net/bluetooth/6lowpan.c | 2 -- 1 file changed, 2 deletions(-)net/bluetooth/6lowpan.c +0
-0
net/bluetooth/6lowpan.c static struct l2cap_chan *chan_open(struct l2cap_chan *pchan) · line 795
Quoted 6 lines
net/bluetooth/6lowpan.c +0
-2@@ -792,8 +792,6 @@ static struct l2cap_chan *chan_open(struct l2cap_chan *pchan) chan->remote_mps = chan->omtu; chan->mps = chan->omtu; - chan->state =BT_CONNECTED ; -return chan;
This is actually already covered by my 6lowpan patch set that I sent a few days ago (Jukka already acked it but Marcel didn't apply it yet).
Johan
Hi Johan,
Thanks for your info.
Best Regards
Zheng Wu
-----Original Message-----
From: Johan Hedberg [mailto:[email protected]]
Sent: Thursday, October 8, 2015 1:36 PM
To: Zheng, Wu
Cc: [email protected]
Subject: Re: [PATCH] Bluetooth: bt net interface can't be set up after 6lowpan connection
Hi Zheng Wu,
Quoted 26 lines · Wu Zheng
After set 'hciconfig leadv', bt net interface can't be created when the 6lowpan over bluetooth le connection is established by another bluetooth le device.
When the the 6lowpan over bluetooth le connection is established, the function of
chan_openin the file of6lowpan.cis invoked.chan->stateis set to the state ofBT_CONNECTED.Then
l2cap_chan_readyin the file ofl2cap_core.cis invoked. However, whenchan->stateisBT_CONNECTED,chan_ready_cbis not invoked.It results in that bt net interface(such as bt0) can't be created.
Removing "
chan->state=BT_CONNECTED" inchan_opencan makechan->stateset the right state and fixing the issue.Signed-off-by Wu Zheng <[email protected]>--- net/bluetooth/6lowpan.c | 2 -- 1 file changed, 2 deletions(-)net/bluetooth/6lowpan.c index renamed from net/bluetooth/6lowpan.c +0
-0131e79c..bc177c5 100644
net/bluetooth/6lowpan.c static struct l2cap_chan *chan_open(struct l2cap_chan *pchan) · line 795
Quoted 6 lines
net/bluetooth/6lowpan.c +0
-2@@ -792,8 +792,6 @@ static struct l2cap_chan *chan_open(struct l2cap_chan *pchan) chan->remote_mps = chan->omtu; chan->mps = chan->omtu; - chan->state =BT_CONNECTED ; -return chan;
This is actually already covered by my 6lowpan patch set that I sent a few days ago (Jukka already acked it but Marcel didn't apply it yet).
Johan