All of lore.kernel.org
 help / color / mirror / Atom feed
From: Santiago Carot-Nemesio <sancane@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Santiago Carot-Nemesio <sancane@gmail.com>
Subject: [PATCH 06/11] attrib-server: Remove global le_io variable
Date: Fri, 16 Dec 2011 17:09:54 +0100	[thread overview]
Message-ID: <1324051799-21439-7-git-send-email-sancane@gmail.com> (raw)
In-Reply-To: <1324051799-21439-6-git-send-email-sancane@gmail.com>

Get ride of the global low energy channel in order to use the low
energy channel managed in each adapter.
---
 src/attrib-server.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/attrib-server.c b/src/attrib-server.c
index 453bdd7..c7a9a67 100644
--- a/src/attrib-server.c
+++ b/src/attrib-server.c
@@ -71,8 +71,6 @@ struct group_elem {
 	uint16_t len;
 };
 
-static GIOChannel *le_io = NULL;
-
 struct gatt_adapter {
 	struct btd_adapter	*adapter;
 	GIOChannel		*l2cap_io;
@@ -861,6 +859,7 @@ static uint16_t write_value(struct gatt_channel *channel, uint16_t handle,
 static uint16_t mtu_exchange(struct gatt_channel *channel, uint16_t mtu,
 		uint8_t *pdu, int len)
 {
+	struct gatt_adapter *gatt_adapter;
 	guint old_mtu = channel->mtu;
 
 	if (mtu < ATT_DEFAULT_LE_MTU)
@@ -868,7 +867,11 @@ static uint16_t mtu_exchange(struct gatt_channel *channel, uint16_t mtu,
 	else
 		channel->mtu = MIN(mtu, channel->mtu);
 
-	bt_io_set(le_io, BT_IO_L2CAP, NULL,
+	gatt_adapter = find_gatt_adapter(&channel->src);
+	if (gatt_adapter == NULL)
+		return 0;
+
+	bt_io_set(gatt_adapter->le_io, BT_IO_L2CAP, NULL,
 			BT_IO_OPT_OMTU, channel->mtu,
 			BT_IO_OPT_INVALID);
 
-- 
1.7.8


  reply	other threads:[~2011-12-16 16:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-16 16:09 RFC: GATT server multi-adapter support Santiago Carot-Nemesio
2011-12-16 16:09 ` [PATCH 01/11] attrib-server: Initial steps to provide multi-adapter GATT server support Santiago Carot-Nemesio
2011-12-16 16:09   ` [PATCH 02/11] attrib-server: Register GATT SDP record per each adapter Santiago Carot-Nemesio
2011-12-16 16:09     ` [PATCH 03/11] attrib-server: Add attributes in adapter database Santiago Carot-Nemesio
2011-12-16 16:09       ` [PATCH 04/11] attrib-server: Attach attrib_channel in adapter clients list Santiago Carot-Nemesio
2011-12-16 16:09         ` [PATCH 05/11] attrib-server: Remove global client list Santiago Carot-Nemesio
2011-12-16 16:09           ` Santiago Carot-Nemesio [this message]
2011-12-16 16:09             ` [PATCH 07/11] attrib-server: Attah gatt channels to a adapters Santiago Carot-Nemesio
2011-12-16 16:09               ` [PATCH 08/11] attrib-server: Remove global database list Santiago Carot-Nemesio
2011-12-16 16:09                 ` [PATCH 09/11] attrib-server: Mark attrib_channel_detach as deprecated Santiago Carot-Nemesio
2011-12-16 16:09                   ` [PATCH 10/11] attrib-server: Remove attrib_server_exit/attrib_server_exit functions Santiago Carot-Nemesio
2011-12-16 16:09                     ` [PATCH 11/11] gatt-example: Use adapter driver to register GATT attributes Santiago Carot-Nemesio
2011-12-17  9:28                       ` Santiago Carot
2011-12-19 14:08   ` [PATCH 01/11] attrib-server: Initial steps to provide multi-adapter GATT server support Claudio Takahasi
2011-12-19 14:35     ` Anderson Lizardo
2011-12-19 14:35     ` Santiago Carot
2011-12-19 14:41       ` Anderson Lizardo
2011-12-19 14:51         ` Santiago Carot
2011-12-19 14:54           ` Santiago Carot
2011-12-19 16:17             ` Anderson Lizardo
2011-12-19 18:13               ` Santiago Carot

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=1324051799-21439-7-git-send-email-sancane@gmail.com \
    --to=sancane@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.