* [PATCH BlueZ 1/5] audio/AVDTP: Remove unused code
@ 2013-11-18 11:50 Luiz Augusto von Dentz
2013-11-18 11:50 ` [PATCH BlueZ 2/5] audio/AVDTP: Remove public function that are only used locally Luiz Augusto von Dentz
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2013-11-18 11:50 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
profiles/audio/avdtp.c | 20 --------------------
profiles/audio/avdtp.h | 8 --------
2 files changed, 28 deletions(-)
diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c
index 9378350..25b7525 100644
--- a/profiles/audio/avdtp.c
+++ b/profiles/audio/avdtp.c
@@ -3283,31 +3283,11 @@ struct avdtp_remote_sep *avdtp_get_remote_sep(struct avdtp *session,
return NULL;
}
-uint8_t avdtp_get_seid(struct avdtp_remote_sep *sep)
-{
- return sep->seid;
-}
-
-uint8_t avdtp_get_type(struct avdtp_remote_sep *sep)
-{
- return sep->type;
-}
-
struct avdtp_service_capability *avdtp_get_codec(struct avdtp_remote_sep *sep)
{
return sep->codec;
}
-gboolean avdtp_get_delay_reporting(struct avdtp_remote_sep *sep)
-{
- return sep->delay_reporting;
-}
-
-struct avdtp_stream *avdtp_get_stream(struct avdtp_remote_sep *sep)
-{
- return sep->stream;
-}
-
struct avdtp_service_capability *avdtp_service_cap_new(uint8_t category,
void *data, int length)
{
diff --git a/profiles/audio/avdtp.h b/profiles/audio/avdtp.h
index 5606506..30ade86 100644
--- a/profiles/audio/avdtp.h
+++ b/profiles/audio/avdtp.h
@@ -224,16 +224,8 @@ struct avdtp_service_capability *avdtp_service_cap_new(uint8_t category,
struct avdtp_remote_sep *avdtp_get_remote_sep(struct avdtp *session,
uint8_t seid);
-uint8_t avdtp_get_seid(struct avdtp_remote_sep *sep);
-
-uint8_t avdtp_get_type(struct avdtp_remote_sep *sep);
-
struct avdtp_service_capability *avdtp_get_codec(struct avdtp_remote_sep *sep);
-gboolean avdtp_get_delay_reporting(struct avdtp_remote_sep *sep);
-
-struct avdtp_stream *avdtp_get_stream(struct avdtp_remote_sep *sep);
-
int avdtp_discover(struct avdtp *session, avdtp_discover_cb_t cb,
void *user_data);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH BlueZ 2/5] audio/AVDTP: Remove public function that are only used locally
2013-11-18 11:50 [PATCH BlueZ 1/5] audio/AVDTP: Remove unused code Luiz Augusto von Dentz
@ 2013-11-18 11:50 ` Luiz Augusto von Dentz
2013-11-18 11:50 ` [PATCH BlueZ 3/5] audio/source: Remove shutdown parameter from source_disconnect Luiz Augusto von Dentz
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2013-11-18 11:50 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
profiles/audio/avdtp.c | 30 ++++++++++++------------------
profiles/audio/avdtp.h | 5 -----
2 files changed, 12 insertions(+), 23 deletions(-)
diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c
index 25b7525..de31e12 100644
--- a/profiles/audio/avdtp.c
+++ b/profiles/audio/avdtp.c
@@ -3183,8 +3183,8 @@ struct avdtp_service_capability *avdtp_stream_get_codec(
return NULL;
}
-gboolean avdtp_stream_has_capability(struct avdtp_stream *stream,
- struct avdtp_service_capability *cap)
+static gboolean avdtp_stream_has_capability(struct avdtp_stream *stream,
+ struct avdtp_service_capability *cap)
{
GSList *l;
struct avdtp_service_capability *stream_cap;
@@ -3219,7 +3219,16 @@ gboolean avdtp_stream_has_capabilities(struct avdtp_stream *stream,
struct avdtp_remote_sep *avdtp_stream_get_remote_sep(
struct avdtp_stream *stream)
{
- return avdtp_get_remote_sep(stream->session, stream->rseid);
+ GSList *l;
+
+ for (l = stream->session->seps; l; l = l->next) {
+ struct avdtp_remote_sep *sep = l->data;
+
+ if (sep->seid == stream->rseid)
+ return sep;
+ }
+
+ return NULL;
}
gboolean avdtp_stream_get_transport(struct avdtp_stream *stream, int *sock,
@@ -3268,21 +3277,6 @@ static int process_queue(struct avdtp *session)
return send_req(session, FALSE, req);
}
-struct avdtp_remote_sep *avdtp_get_remote_sep(struct avdtp *session,
- uint8_t seid)
-{
- GSList *l;
-
- for (l = session->seps; l; l = l->next) {
- struct avdtp_remote_sep *sep = l->data;
-
- if (sep->seid == seid)
- return sep;
- }
-
- return NULL;
-}
-
struct avdtp_service_capability *avdtp_get_codec(struct avdtp_remote_sep *sep)
{
return sep->codec;
diff --git a/profiles/audio/avdtp.h b/profiles/audio/avdtp.h
index 30ade86..3c30d78 100644
--- a/profiles/audio/avdtp.h
+++ b/profiles/audio/avdtp.h
@@ -221,9 +221,6 @@ struct avdtp *avdtp_ref(struct avdtp *session);
struct avdtp_service_capability *avdtp_service_cap_new(uint8_t category,
void *data, int size);
-struct avdtp_remote_sep *avdtp_get_remote_sep(struct avdtp *session,
- uint8_t seid);
-
struct avdtp_service_capability *avdtp_get_codec(struct avdtp_remote_sep *sep);
int avdtp_discover(struct avdtp *session, avdtp_discover_cb_t cb,
@@ -243,8 +240,6 @@ gboolean avdtp_stream_get_transport(struct avdtp_stream *stream, int *sock,
GSList **caps);
struct avdtp_service_capability *avdtp_stream_get_codec(
struct avdtp_stream *stream);
-gboolean avdtp_stream_has_capability(struct avdtp_stream *stream,
- struct avdtp_service_capability *cap);
gboolean avdtp_stream_has_capabilities(struct avdtp_stream *stream,
GSList *caps);
struct avdtp_remote_sep *avdtp_stream_get_remote_sep(
--
1.8.3.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH BlueZ 3/5] audio/source: Remove shutdown parameter from source_disconnect
2013-11-18 11:50 [PATCH BlueZ 1/5] audio/AVDTP: Remove unused code Luiz Augusto von Dentz
2013-11-18 11:50 ` [PATCH BlueZ 2/5] audio/AVDTP: Remove public function that are only used locally Luiz Augusto von Dentz
@ 2013-11-18 11:50 ` Luiz Augusto von Dentz
2013-11-18 11:50 ` [PATCH BlueZ 4/5] audio/sink: Remove shutdown parameter from sink_disconnect Luiz Augusto von Dentz
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2013-11-18 11:50 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This parameter is always false so it never do anything.
---
profiles/audio/a2dp.c | 2 +-
profiles/audio/source.c | 5 +----
profiles/audio/source.h | 2 +-
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
index 864cb18..95ffa12 100644
--- a/profiles/audio/a2dp.c
+++ b/profiles/audio/a2dp.c
@@ -1887,7 +1887,7 @@ static int a2dp_source_disconnect(struct btd_service *service)
DBG("path %s", path);
- return source_disconnect(service, FALSE);
+ return source_disconnect(service);
}
static int a2dp_sink_connect(struct btd_service *service)
diff --git a/profiles/audio/source.c b/profiles/audio/source.c
index 24a4353..7b129b7 100644
--- a/profiles/audio/source.c
+++ b/profiles/audio/source.c
@@ -380,16 +380,13 @@ gboolean source_new_stream(struct btd_service *service, struct avdtp *session,
return TRUE;
}
-int source_disconnect(struct btd_service *service, gboolean shutdown)
+int source_disconnect(struct btd_service *service)
{
struct source *source = btd_service_get_user_data(service);
if (!source->session)
return -ENOTCONN;
- if (shutdown)
- avdtp_set_device_disconnect(source->session, TRUE);
-
/* cancel pending connect */
if (source->connect_id > 0) {
a2dp_cancel(source->connect_id);
diff --git a/profiles/audio/source.h b/profiles/audio/source.h
index c16fb4b..a014c68 100644
--- a/profiles/audio/source.h
+++ b/profiles/audio/source.h
@@ -48,4 +48,4 @@ gboolean source_new_stream(struct btd_service *service, struct avdtp *session,
struct avdtp_stream *stream);
gboolean source_setup_stream(struct btd_service *service,
struct avdtp *session);
-int source_disconnect(struct btd_service *service, gboolean shutdown);
+int source_disconnect(struct btd_service *service);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH BlueZ 4/5] audio/sink: Remove shutdown parameter from sink_disconnect
2013-11-18 11:50 [PATCH BlueZ 1/5] audio/AVDTP: Remove unused code Luiz Augusto von Dentz
2013-11-18 11:50 ` [PATCH BlueZ 2/5] audio/AVDTP: Remove public function that are only used locally Luiz Augusto von Dentz
2013-11-18 11:50 ` [PATCH BlueZ 3/5] audio/source: Remove shutdown parameter from source_disconnect Luiz Augusto von Dentz
@ 2013-11-18 11:50 ` Luiz Augusto von Dentz
2013-11-18 11:50 ` [PATCH BlueZ 5/5] audio/AVDTP: Remove unused avdtp_set_device_disconnect Luiz Augusto von Dentz
2013-11-18 12:11 ` [PATCH BlueZ 1/5] audio/AVDTP: Remove unused code Johan Hedberg
4 siblings, 0 replies; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2013-11-18 11:50 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This parameter is always false so it never do anything.
---
profiles/audio/a2dp.c | 2 +-
profiles/audio/sink.c | 5 +----
profiles/audio/sink.h | 2 +-
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
index 95ffa12..29a1593 100644
--- a/profiles/audio/a2dp.c
+++ b/profiles/audio/a2dp.c
@@ -1919,7 +1919,7 @@ static int a2dp_sink_disconnect(struct btd_service *service)
DBG("path %s", path);
- return sink_disconnect(service, FALSE);
+ return sink_disconnect(service);
}
static int a2dp_source_server_probe(struct btd_profile *p,
diff --git a/profiles/audio/sink.c b/profiles/audio/sink.c
index 400af06..4f39622 100644
--- a/profiles/audio/sink.c
+++ b/profiles/audio/sink.c
@@ -388,16 +388,13 @@ gboolean sink_new_stream(struct btd_service *service, struct avdtp *session,
return TRUE;
}
-int sink_disconnect(struct btd_service *service, gboolean shutdown)
+int sink_disconnect(struct btd_service *service)
{
struct sink *sink = btd_service_get_user_data(service);
if (!sink->session)
return -ENOTCONN;
- if (shutdown)
- avdtp_set_device_disconnect(sink->session, TRUE);
-
/* cancel pending connect */
if (sink->connect_id > 0) {
a2dp_cancel(sink->connect_id);
diff --git a/profiles/audio/sink.h b/profiles/audio/sink.h
index 904a33d..93c62a2 100644
--- a/profiles/audio/sink.h
+++ b/profiles/audio/sink.h
@@ -47,4 +47,4 @@ int sink_connect(struct btd_service *service);
gboolean sink_new_stream(struct btd_service *service, struct avdtp *session,
struct avdtp_stream *stream);
gboolean sink_setup_stream(struct btd_service *service, struct avdtp *session);
-int sink_disconnect(struct btd_service *service, gboolean shutdown);
+int sink_disconnect(struct btd_service *service);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH BlueZ 5/5] audio/AVDTP: Remove unused avdtp_set_device_disconnect
2013-11-18 11:50 [PATCH BlueZ 1/5] audio/AVDTP: Remove unused code Luiz Augusto von Dentz
` (2 preceding siblings ...)
2013-11-18 11:50 ` [PATCH BlueZ 4/5] audio/sink: Remove shutdown parameter from sink_disconnect Luiz Augusto von Dentz
@ 2013-11-18 11:50 ` Luiz Augusto von Dentz
2013-11-18 12:11 ` [PATCH BlueZ 1/5] audio/AVDTP: Remove unused code Johan Hedberg
4 siblings, 0 replies; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2013-11-18 11:50 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
profiles/audio/avdtp.c | 13 -------------
profiles/audio/avdtp.h | 2 --
2 files changed, 15 deletions(-)
diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c
index de31e12..b7a7d9c 100644
--- a/profiles/audio/avdtp.c
+++ b/profiles/audio/avdtp.c
@@ -394,9 +394,6 @@ struct avdtp {
avdtp_session_state_t state;
- /* True if the entire device is being disconnected */
- gboolean device_disconnect;
-
guint auth_id;
GIOChannel *io;
@@ -1200,11 +1197,6 @@ static void set_disconnect_timer(struct avdtp *session)
if (session->dc_timer)
remove_disconnect_timer(session);
- if (session->device_disconnect) {
- session->dc_timer = g_idle_add(disconnect_timeout, session);
- return;
- }
-
session->dc_timer = g_timeout_add_seconds(DISCONNECT_TIMEOUT,
disconnect_timeout,
session);
@@ -3841,11 +3833,6 @@ gboolean avdtp_has_stream(struct avdtp *session, struct avdtp_stream *stream)
return g_slist_find(session->streams, stream) ? TRUE : FALSE;
}
-void avdtp_set_device_disconnect(struct avdtp *session, gboolean dev_dc)
-{
- session->device_disconnect = dev_dc;
-}
-
unsigned int avdtp_add_state_cb(struct btd_device *dev,
avdtp_session_state_cb cb, void *user_data)
{
diff --git a/profiles/audio/avdtp.h b/profiles/audio/avdtp.h
index 3c30d78..390c154 100644
--- a/profiles/audio/avdtp.h
+++ b/profiles/audio/avdtp.h
@@ -293,5 +293,3 @@ int avdtp_error_posix_errno(struct avdtp_error *err);
struct btd_adapter *avdtp_get_adapter(struct avdtp *session);
struct btd_device *avdtp_get_device(struct avdtp *session);
-
-void avdtp_set_device_disconnect(struct avdtp *session, gboolean dev_dc);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH BlueZ 1/5] audio/AVDTP: Remove unused code
2013-11-18 11:50 [PATCH BlueZ 1/5] audio/AVDTP: Remove unused code Luiz Augusto von Dentz
` (3 preceding siblings ...)
2013-11-18 11:50 ` [PATCH BlueZ 5/5] audio/AVDTP: Remove unused avdtp_set_device_disconnect Luiz Augusto von Dentz
@ 2013-11-18 12:11 ` Johan Hedberg
4 siblings, 0 replies; 6+ messages in thread
From: Johan Hedberg @ 2013-11-18 12:11 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
Hi Luiz,
On Mon, Nov 18, 2013, Luiz Augusto von Dentz wrote:
> ---
> profiles/audio/avdtp.c | 20 --------------------
> profiles/audio/avdtp.h | 8 --------
> 2 files changed, 28 deletions(-)
All five patches have been applied. Thanks.
Johan
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-11-18 12:11 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-18 11:50 [PATCH BlueZ 1/5] audio/AVDTP: Remove unused code Luiz Augusto von Dentz
2013-11-18 11:50 ` [PATCH BlueZ 2/5] audio/AVDTP: Remove public function that are only used locally Luiz Augusto von Dentz
2013-11-18 11:50 ` [PATCH BlueZ 3/5] audio/source: Remove shutdown parameter from source_disconnect Luiz Augusto von Dentz
2013-11-18 11:50 ` [PATCH BlueZ 4/5] audio/sink: Remove shutdown parameter from sink_disconnect Luiz Augusto von Dentz
2013-11-18 11:50 ` [PATCH BlueZ 5/5] audio/AVDTP: Remove unused avdtp_set_device_disconnect Luiz Augusto von Dentz
2013-11-18 12:11 ` [PATCH BlueZ 1/5] audio/AVDTP: Remove unused code Johan Hedberg
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).