linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
To: linux-bluetooth@vger.kernel.org
Cc: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Subject: [PATCH_v5 1/5] android/pan: shutdown io channel on disconnect call
Date: Thu, 19 Dec 2013 10:48:49 +0200	[thread overview]
Message-ID: <1387442933-20681-1-git-send-email-ravikumar.veeramally@linux.intel.com> (raw)

Shutdown io channel and send DISCONNECTING notification and send
DISCONNECTED notification and free the device on callback.
---
 android/pan.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/android/pan.c b/android/pan.c
index b83f534..187953b 100644
--- a/android/pan.c
+++ b/android/pan.c
@@ -284,14 +284,16 @@ static void bt_pan_disconnect(const void *buf, uint16_t len)
 	}
 
 	dev = l->data;
-	if (dev->watch) {
-		g_source_remove(dev->watch);
-		dev->watch = 0;
+
+	if (dev->io)
+		g_io_channel_shutdown(dev->io, TRUE, NULL);
+
+	if (dev->conn_state == HAL_PAN_STATE_CONNECTED) {
+		bnep_if_down(dev->iface);
+		bnep_conndel(&dst);
 	}
 
-	bnep_if_down(dev->iface);
-	bnep_conndel(&dst);
-	bt_pan_notify_conn_state(dev, HAL_PAN_STATE_DISCONNECTED);
+	bt_pan_notify_conn_state(dev, HAL_PAN_STATE_DISCONNECTING);
 	status = HAL_STATUS_SUCCESS;
 
 failed:
-- 
1.8.3.2


             reply	other threads:[~2013-12-19  8:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-19  8:48 Ravi kumar Veeramally [this message]
2013-12-19  8:48 ` [PATCH_v5 2/5] bnep: Rename struct bnep_conn to struct bnep for better readability Ravi kumar Veeramally
2013-12-19  8:48 ` [PATCH_v5 3/5] bnep: Add bnep_new and bnep_free api's Ravi kumar Veeramally
2013-12-19  8:48 ` [PATCH_v5 4/5] bnep: Refactored bnep connect and disconnect calls Ravi kumar Veeramally
2013-12-19  8:48 ` [PATCH_v5 5/5] bnep: Refactored bnep server apis for bridge addition and deletion Ravi kumar Veeramally
  -- strict thread matches above, loose matches on Subject: below --
2013-12-19  9:15 [PATCH_v5 1/5] android/pan: shutdown io channel on disconnect call Ravi kumar Veeramally

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1387442933-20681-1-git-send-email-ravikumar.veeramally@linux.intel.com \
    --to=ravikumar.veeramally@linux.intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).