* Re: [RFC 4/4] Bluetooth: AMP: Set no FCS for incoming L2CAP chan
From: Gustavo Padovan @ 2012-11-20 17:56 UTC (permalink / raw)
To: Andrei Emeltchenko; +Cc: linux-bluetooth
In-Reply-To: <1353424582-26042-5-git-send-email-Andrei.Emeltchenko.news@gmail.com>
Hi Andrei,
* Andrei Emeltchenko <Andrei.Emeltchenko.news@gmail.com> [2012-11-20 17:16:22 +0200]:
> From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
>
> When receiving L2CAP Create Channel Request set the channel as
> L2CAP_FCS_NONE. Then in "L2CAP Config req" following field will
> be set: "FCS Option 0x00 (No FCS)". So by default High Speed
> channels have no FCS.
>
> Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
> ---
> net/bluetooth/l2cap_core.c | 1 +
> 1 file changed, 1 insertion(+)
All 4 patches have been applied to bluetooth-next. Thanks.
Gustavo
^ permalink raw reply
* Re: [PATCH 2/2] Bluetooth: Implement deferred sco socket setup
From: Frédéric Dalleau @ 2012-11-20 17:55 UTC (permalink / raw)
To: Gustavo Padovan, linux-bluetooth
In-Reply-To: <20121120173734.GG14006@joana>
Hi Gustavo,
I'm taking your remarks into account asap
On 11/20/2012 06:37 PM, Gustavo Padovan wrote:
> Where do you set sk_state to BT_CONNECTED. Doesn't it need to be here?
The state is set to BT_CONNECTED in hci_sync_conn_complete_evt. ie when
the connection is effectively created.
My understanding is that BT_CONFIG state indicate the configuration has
been requested, in case recvmsg() is called twice.
Regards,
Frédéric
^ permalink raw reply
* Re: [RFC v2 obexd 04/11] fuse: Add request helpers and setpath operation
From: Michał Poczwardowski @ 2012-11-20 17:52 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
In-Reply-To: <CAKZqhqeN35tGfw3v=rmGY63+27s79K7t2DioRmBEjFCUAtVAXQ@mail.gmail.com>
Hi Luiz,
Sorry for delay - I was a little overwhelmed by university stuff. I've
just replaced suspend/resume with g_main_context_iteration() but
unfortunately it doesn't work in this case.
Regarding requests queue - fuse handles it, also in single threaded mode :)
On 1 November 2012 22:59, Michał Poczwardowski <dmp0x7c5@gmail.com> wrote:
> Hi Luiz,
>
> On 30 October 2012 10:35, Luiz Augusto von Dentz <luiz.dentz@gmail.com> wrote:
>> Hi Michal,
>>
>> On Sun, Oct 28, 2012 at 2:29 AM, Michał Poczwardowski
>> <dmp0x7c5@gmail.com> wrote:
>>> ---
>>> fuse/helpers.c | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>> 1 files changed, 108 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/fuse/helpers.c b/fuse/helpers.c
>>> index 856e1d5..1b8082f 100644
>>> --- a/fuse/helpers.c
>>> +++ b/fuse/helpers.c
>>> @@ -273,3 +273,111 @@ void gobexhlp_disconnect(struct gobexhlp_session* session)
>>>
>>> g_free(session);
>>> }
>>> +
>>> +void request_new(struct gobexhlp_session *session,
>>> + gchar *name)
>>> +{
>>> + g_print("REQUEST %s\n", name);
>>> +
>>> + if (session->request != NULL)
>>> + g_error("Another request (%s) active!\n",
>>> + session->request->name);
>>> +
>>> + session->status = 0;
>>> + session->request = g_malloc0(sizeof(struct gobexhlp_request));
>>> + session->request->name = name;
>>> +
>>> + /*
>>> + * suspend/resume operations recreates g_io_add_watch(),
>>> + * it fixes obex->io freeze during transfer
>>> + */
>>> + g_obex_suspend(session->obex);
>>> + g_obex_resume(session->obex);
>>
>> It seems the issue here is that the mainloop is blocked then you have
>> to force the io checking by doing g_io_add_watch in a different
>> thread, we have dealt with this kind of problem before using
>> g_main_context_iteration. I would have been better if fuse supported
>> async io, but apparently all operations are blocking.
>>
>> --
>> Luiz Augusto von Dentz
>
> I'll try g_main_context_iteration way to avoid the io freeze.
> Unfortunately fuse with obex should use blocking operations.
>
> Thanks,
> Michal
^ permalink raw reply
* Re: [PATCH BlueZ 2/2 v1] l2test: Add support to test auto select PSM
From: Gustavo Padovan @ 2012-11-20 17:52 UTC (permalink / raw)
To: Syam Sidhardhan; +Cc: linux-bluetooth
In-Reply-To: <1353428151-11925-1-git-send-email-s.syam@samsung.com>
Hi Syam,
* Syam Sidhardhan <s.syam@samsung.com> [2012-11-20 21:45:51 +0530]:
> This patch enable us to test the auto select PSM for server by passing
> PSM value as 0.
>
> Ex: l2test -d -P 0
> l2test[2585]: Waiting for connection on psm 4097 ...
> ---
> v1-> Corrected the misplaced code
>
> test/l2test.c | 4 +---
> 1 files changed, 1 insertions(+), 3 deletions(-)
>
> diff --git a/test/l2test.c b/test/l2test.c
> index 7645681..485887f 100644
> --- a/test/l2test.c
> +++ b/test/l2test.c
> @@ -87,7 +87,7 @@ static long buffer_size = 2048;
>
> /* Default addr and psm and cid */
> static bdaddr_t bdaddr;
> -static unsigned short psm = 0x1011;
> +static unsigned short psm = 0;
Your patch makes the client side to always pass the psm option and I don't
think this is a good approach. I think we need something smarter here to not
break things.
Gustavo
^ permalink raw reply
* Re: [PATCH 2/2] Bluetooth: Implement deferred sco socket setup
From: Gustavo Padovan @ 2012-11-20 17:37 UTC (permalink / raw)
To: Frédéric Dalleau; +Cc: linux-bluetooth
In-Reply-To: <1353342958-25303-3-git-send-email-frederic.dalleau@linux.intel.com>
Hi Frédéric,
* Frédéric Dalleau <frederic.dalleau@linux.intel.com> [2012-11-19 17:35:57 +0100]:
> In order to authenticate and configure an incoming SCO connection, the
> BT_DEFER_SETUP option was added. This option is intended to defer reply
> to Connect Request on SCO sockets.
> When a connection is requested, the listening socket is unblocked but
> the effective connection setup happens only on first recv. Any send
> between accept and recv fails with -ENOTCONN.
> ---
> include/net/bluetooth/hci_core.h | 9 ++++---
> net/bluetooth/hci_event.c | 53 +++++++++++++++++++++++++++++++++++---
> net/bluetooth/sco.c | 35 ++++++++++++++++++++++---
> 3 files changed, 87 insertions(+), 10 deletions(-)
>
> diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
> index ef5b85d..8fceb35 100644
> --- a/include/net/bluetooth/hci_core.h
> +++ b/include/net/bluetooth/hci_core.h
> @@ -376,7 +376,7 @@ extern int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt);
> extern int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb,
> u16 flags);
>
> -extern int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr);
> +extern int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 *flags);
> extern void sco_connect_cfm(struct hci_conn *hcon, __u8 status);
> extern void sco_disconn_cfm(struct hci_conn *hcon, __u8 reason);
> extern int sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb);
> @@ -577,6 +577,7 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst);
> int hci_conn_del(struct hci_conn *conn);
> void hci_conn_hash_flush(struct hci_dev *hdev);
> void hci_conn_check_pending(struct hci_dev *hdev);
> +void hci_conn_accept(struct hci_conn *conn, int mask);
>
> struct hci_chan *hci_chan_create(struct hci_conn *conn);
> void hci_chan_del(struct hci_chan *chan);
> @@ -779,8 +780,10 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
> #define lmp_host_le_br_capable(dev) ((dev)->host_features[0] & LMP_HOST_LE_BREDR)
>
> /* ----- HCI protocols ----- */
> +#define HCI_PROTO_DEFER 0x01
> +
> static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr,
> - __u8 type)
> + __u8 type, __u8 *flags)
Please fix the coding style here.
> {
> switch (type) {
> case ACL_LINK:
> @@ -788,7 +791,7 @@ static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr,
>
> case SCO_LINK:
> case ESCO_LINK:
> - return sco_connect_ind(hdev, bdaddr);
> + return sco_connect_ind(hdev, bdaddr, flags);
>
> default:
> BT_ERR("unknown link type %d", type);
> diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
> index 9f5c5f2..f883ef5 100644
> --- a/net/bluetooth/hci_event.c
> +++ b/net/bluetooth/hci_event.c
> @@ -2047,15 +2047,54 @@ unlock:
> hci_conn_check_pending(hdev);
> }
>
> +void hci_conn_accept(struct hci_conn *conn, int mask)
> +{
> + struct hci_dev *hdev = conn->hdev;
> +
> + BT_DBG("conn %p", conn);
> +
> + if (!lmp_esco_capable(hdev)) {
> + struct hci_cp_accept_conn_req cp;
> +
> + conn->state = BT_CONFIG;
> + bacpy(&cp.bdaddr, &conn->dst);
> +
> + if (lmp_rswitch_capable(hdev) && (mask & HCI_LM_MASTER))
> + cp.role = 0x00; /* Become master */
> + else
> + cp.role = 0x01; /* Remain slave */
> +
> + hci_send_cmd(hdev, HCI_OP_ACCEPT_CONN_REQ, sizeof(cp),
> + &cp);
I don't think you need to break a line for this hci_send_cmd(), it won't cross
the column 80.
> + } else /* lmp_esco_capable(hdev)) */ {
> + struct hci_cp_accept_sync_conn_req cp;
> +
> + conn->state = BT_CONFIG;
> + bacpy(&cp.bdaddr, &conn->dst);
> + cp.pkt_type = cpu_to_le16(conn->pkt_type);
> +
> + cp.tx_bandwidth = __constant_cpu_to_le32(0x00001f40);
> + cp.rx_bandwidth = __constant_cpu_to_le32(0x00001f40);
> + cp.max_latency = __constant_cpu_to_le16(0xffff);
> + cp.content_format = cpu_to_le16(hdev->voice_setting);
> + cp.retrans_effort = 0xff;
> +
> + hci_send_cmd(hdev, HCI_OP_ACCEPT_SYNC_CONN_REQ,
> + sizeof(cp), &cp);
> + }
> +}
> +
> static void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
> {
> struct hci_ev_conn_request *ev = (void *) skb->data;
> int mask = hdev->link_mode;
> + __u8 flags = 0;
>
> BT_DBG("%s bdaddr %pMR type 0x%x", hdev->name, &ev->bdaddr,
> ev->link_type);
>
> - mask |= hci_proto_connect_ind(hdev, &ev->bdaddr, ev->link_type);
> + mask |= hci_proto_connect_ind(hdev, &ev->bdaddr, ev->link_type,
> + &flags);
>
> if ((mask & HCI_LM_ACCEPT) &&
> !hci_blacklist_lookup(hdev, &ev->bdaddr)) {
> @@ -2081,12 +2120,13 @@ static void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
> }
>
> memcpy(conn->dev_class, ev->dev_class, 3);
> - conn->state = BT_CONNECT;
>
> hci_dev_unlock(hdev);
>
> - if (ev->link_type == ACL_LINK || !lmp_esco_capable(hdev)) {
> + if (ev->link_type == ACL_LINK ||
> + (!(flags & HCI_PROTO_DEFER) && !lmp_esco_capable(hdev))) {
> struct hci_cp_accept_conn_req cp;
> + conn->state = BT_CONNECT;
>
> bacpy(&cp.bdaddr, &ev->bdaddr);
>
> @@ -2097,8 +2137,9 @@ static void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
>
> hci_send_cmd(hdev, HCI_OP_ACCEPT_CONN_REQ, sizeof(cp),
> &cp);
> - } else {
> + } else if (!(flags & HCI_PROTO_DEFER)) {
> struct hci_cp_accept_sync_conn_req cp;
> + conn->state = BT_CONNECT;
>
> bacpy(&cp.bdaddr, &ev->bdaddr);
> cp.pkt_type = cpu_to_le16(conn->pkt_type);
> @@ -2111,6 +2152,10 @@ static void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
>
> hci_send_cmd(hdev, HCI_OP_ACCEPT_SYNC_CONN_REQ,
> sizeof(cp), &cp);
> + } else {
> + conn->state = BT_CONNECT2;
> + hci_proto_connect_cfm(conn, 0);
> + hci_conn_put(conn);
> }
> } else {
> /* Connection rejected */
> diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
> index c6678f2..77210bf 100644
> --- a/net/bluetooth/sco.c
> +++ b/net/bluetooth/sco.c
> @@ -397,6 +397,7 @@ static void sco_sock_init(struct sock *sk, struct sock *parent)
>
> if (parent) {
> sk->sk_type = parent->sk_type;
> + bt_sk(sk)->flags = bt_sk(parent)->flags;
> security_sk_clone(parent, sk);
> }
> }
> @@ -662,6 +663,28 @@ static int sco_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
> return err;
> }
>
> +static int sco_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
> + struct msghdr *msg, size_t len, int flags)
> +{
> + struct sock *sk = sock->sk;
> + struct sco_pinfo *pi = sco_pi(sk);
> +
> + lock_sock(sk);
> +
> + if (sk->sk_state == BT_CONNECT2 &&
> + test_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags)) {
Wrong coding style here.
> + hci_conn_accept(pi->conn->hcon, 0);
> + sk->sk_state = BT_CONFIG;
Where do you set sk_state to BT_CONNECTED. Doesn't it need to be here?
Gustavo
^ permalink raw reply
* [PATCH BlueZ 2/2 v1] l2test: Add support to test auto select PSM
From: Syam Sidhardhan @ 2012-11-20 16:15 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Syam Sidhardhan
This patch enable us to test the auto select PSM for server by passing
PSM value as 0.
Ex: l2test -d -P 0
l2test[2585]: Waiting for connection on psm 4097 ...
---
v1-> Corrected the misplaced code
test/l2test.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/test/l2test.c b/test/l2test.c
index 7645681..485887f 100644
--- a/test/l2test.c
+++ b/test/l2test.c
@@ -87,7 +87,7 @@ static long buffer_size = 2048;
/* Default addr and psm and cid */
static bdaddr_t bdaddr;
-static unsigned short psm = 0x1011;
+static unsigned short psm = 0;
static unsigned short cid = 0;
/* Default number of frames to send (-1 = infinite) */
@@ -458,8 +458,6 @@ static void do_listen(void (*handler)(int sk))
addr.l2_cid = htobs(cid);
else if (psm)
addr.l2_psm = htobs(psm);
- else
- goto error;
if (bind(sk, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
syslog(LOG_ERR, "Can't bind socket: %s (%d)",
--
1.7.4.1
^ permalink raw reply related
* [PATCH v3 3/3] sink: Add profile .connect and .disconnect
From: Mikel Astiz @ 2012-11-20 16:10 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Mikel Astiz
In-Reply-To: <1353427851-4165-1-git-send-email-mikel.astiz.oss@gmail.com>
From: Mikel Astiz <mikel.astiz@bmw-carit.de>
Add the connection and disconnection hooks to the a2dp_sink btd_profile.
---
profiles/audio/manager.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)
diff --git a/profiles/audio/manager.c b/profiles/audio/manager.c
index 64df824..38e3c2b 100644
--- a/profiles/audio/manager.c
+++ b/profiles/audio/manager.c
@@ -261,6 +261,56 @@ static int a2dp_source_disconnect(struct btd_device *dev,
return 0;
}
+static int a2dp_sink_connect(struct btd_device *dev,
+ struct btd_profile *profile,
+ btd_profile_cb cb)
+{
+ struct audio_device *audio_dev;
+ struct profile_req *req;
+ int err;
+
+ audio_dev = get_audio_dev(dev);
+ if (!audio_dev) {
+ DBG("unable to get a device object");
+ return -1;
+ }
+
+ req = new_profile_request(dev, profile, cb);
+
+ err = sink_connect(audio_dev, profile_cb, req);
+ if (err < 0) {
+ g_free(req);
+ return err;
+ }
+
+ return 0;
+}
+
+static int a2dp_sink_disconnect(struct btd_device *dev,
+ struct btd_profile *profile,
+ btd_profile_cb cb)
+{
+ struct audio_device *audio_dev;
+ struct profile_req *req;
+ int err;
+
+ audio_dev = get_audio_dev(dev);
+ if (!audio_dev) {
+ DBG("unable to get a device object");
+ return -1;
+ }
+
+ req = new_profile_request(dev, profile, cb);
+
+ err = sink_disconnect(audio_dev, FALSE, profile_cb, req);
+ if (err < 0) {
+ g_free(req);
+ return err;
+ }
+
+ return 0;
+}
+
static struct audio_adapter *audio_adapter_ref(struct audio_adapter *adp)
{
adp->ref++;
@@ -480,6 +530,9 @@ static struct btd_profile a2dp_sink_profile = {
.device_probe = a2dp_sink_probe,
.device_remove = audio_remove,
+ .connect = a2dp_sink_connect,
+ .disconnect = a2dp_sink_disconnect,
+
.adapter_probe = a2dp_sink_server_probe,
};
--
1.7.11.7
^ permalink raw reply related
* [PATCH v3 2/3] source: Add profile .connect and .disconnect
From: Mikel Astiz @ 2012-11-20 16:10 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Mikel Astiz
In-Reply-To: <1353427851-4165-1-git-send-email-mikel.astiz.oss@gmail.com>
From: Mikel Astiz <mikel.astiz@bmw-carit.de>
Add the connection and disconnection hooks to the a2dp_source
btd_profile.
---
profiles/audio/manager.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 82 insertions(+)
diff --git a/profiles/audio/manager.c b/profiles/audio/manager.c
index d7c1717..64df824 100644
--- a/profiles/audio/manager.c
+++ b/profiles/audio/manager.c
@@ -80,6 +80,12 @@ struct audio_adapter {
gint ref;
};
+struct profile_req {
+ struct btd_device *device;
+ struct btd_profile *profile;
+ btd_profile_cb cb;
+};
+
static gboolean auto_connect = TRUE;
static int max_connected_headsets = 1;
static GKeyFile *config = NULL;
@@ -182,6 +188,79 @@ static int avrcp_probe(struct btd_profile *p, struct btd_device *device,
return 0;
}
+static struct profile_req *new_profile_request(struct btd_device *dev,
+ struct btd_profile *profile,
+ btd_profile_cb cb)
+{
+ struct profile_req *req;
+
+ req = g_new0(struct profile_req, 1);
+ req->device = dev;
+ req->profile = profile;
+ req->cb = cb;
+
+ return req;
+}
+
+static void profile_cb(struct audio_device *dev, int err, void *data)
+{
+ struct profile_req *req = data;
+
+ req->cb(req->profile, req->device, err);
+
+ g_free(req);
+}
+
+static int a2dp_source_connect(struct btd_device *dev,
+ struct btd_profile *profile,
+ btd_profile_cb cb)
+{
+ struct audio_device *audio_dev;
+ struct profile_req *req;
+ int err;
+
+ audio_dev = get_audio_dev(dev);
+ if (!audio_dev) {
+ DBG("unable to get a device object");
+ return -1;
+ }
+
+ req = new_profile_request(dev, profile, cb);
+
+ err = source_connect(audio_dev, profile_cb, req);
+ if (err < 0) {
+ g_free(req);
+ return err;
+ }
+
+ return 0;
+}
+
+static int a2dp_source_disconnect(struct btd_device *dev,
+ struct btd_profile *profile,
+ btd_profile_cb cb)
+{
+ struct audio_device *audio_dev;
+ struct profile_req *req;
+ int err;
+
+ audio_dev = get_audio_dev(dev);
+ if (!audio_dev) {
+ DBG("unable to get a device object");
+ return -1;
+ }
+
+ req = new_profile_request(dev, profile, cb);
+
+ err = source_disconnect(audio_dev, FALSE, profile_cb, req);
+ if (err < 0) {
+ g_free(req);
+ return err;
+ }
+
+ return 0;
+}
+
static struct audio_adapter *audio_adapter_ref(struct audio_adapter *adp)
{
adp->ref++;
@@ -387,6 +466,9 @@ static struct btd_profile a2dp_source_profile = {
.device_probe = a2dp_source_probe,
.device_remove = audio_remove,
+ .connect = a2dp_source_connect,
+ .disconnect = a2dp_source_disconnect,
+
.adapter_probe = a2dp_source_server_probe,
};
--
1.7.11.7
^ permalink raw reply related
* [PATCH v3 1/3] audio: Split A2DP into three btd_profile
From: Mikel Astiz @ 2012-11-20 16:10 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Mikel Astiz
In-Reply-To: <1353427851-4165-1-git-send-email-mikel.astiz.oss@gmail.com>
From: Mikel Astiz <mikel.astiz@bmw-carit.de>
Merging the three audio profiles (AVDTP, A2DP sink and A2DP source)
into one was convenient in the past was doesn't fit very well the new
btd_profile approach. The split is also more consistent with other
existing profiles.
---
profiles/audio/a2dp.c | 74 +++++++++++++++-----------------
profiles/audio/a2dp.h | 4 +-
profiles/audio/manager.c | 107 ++++++++++++++++++++++++++++++++++++++++-------
3 files changed, 128 insertions(+), 57 deletions(-)
diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
index 50c0f43..e199849 100644
--- a/profiles/audio/a2dp.c
+++ b/profiles/audio/a2dp.c
@@ -1166,63 +1166,57 @@ static struct a2dp_server *find_server(GSList *list, const bdaddr_t *src)
return NULL;
}
-int a2dp_register(const bdaddr_t *src, GKeyFile *config)
+int a2dp_server_register(const bdaddr_t *src, GKeyFile *config)
{
- gboolean source = TRUE, sink = FALSE;
- char *str;
- GError *err = NULL;
struct a2dp_server *server;
+ int av_err;
- if (!config)
- goto proceed;
+ server = find_server(servers, src);
+ if (server)
+ return 0;
- str = g_key_file_get_string(config, "General", "Enable", &err);
+ server = g_new0(struct a2dp_server, 1);
- if (err) {
- DBG("audio.conf: %s", err->message);
- g_clear_error(&err);
- } else {
- if (strstr(str, "Sink"))
- source = TRUE;
- if (strstr(str, "Source"))
- sink = TRUE;
- g_free(str);
+ av_err = avdtp_init(src, config);
+ if (av_err < 0) {
+ g_free(server);
+ return av_err;
}
- str = g_key_file_get_string(config, "General", "Disable", &err);
+ bacpy(&server->src, src);
+ servers = g_slist_append(servers, server);
- if (err) {
- DBG("audio.conf: %s", err->message);
- g_clear_error(&err);
- } else {
- if (strstr(str, "Sink"))
- source = FALSE;
- if (strstr(str, "Source"))
- sink = FALSE;
- g_free(str);
- }
+ return 0;
+}
-proceed:
+int a2dp_source_register(const bdaddr_t *src, GKeyFile *config)
+{
+ struct a2dp_server *server;
server = find_server(servers, src);
if (!server) {
- int av_err;
+ DBG("AVDTP not registered");
+ return -EPROTONOSUPPORT;
- server = g_new0(struct a2dp_server, 1);
+ }
- av_err = avdtp_init(src, config);
- if (av_err < 0) {
- g_free(server);
- return av_err;
- }
+ server->source_enabled = TRUE;
- bacpy(&server->src, src);
- servers = g_slist_append(servers, server);
- }
+ return 0;
+}
- server->source_enabled = source;
+int a2dp_sink_register(const bdaddr_t *src, GKeyFile *config)
+{
+ struct a2dp_server *server;
+
+ server = find_server(servers, src);
+ if (!server) {
+ DBG("AVDTP not registered");
+ return -EPROTONOSUPPORT;
+
+ }
- server->sink_enabled = sink;
+ server->sink_enabled = TRUE;
return 0;
}
diff --git a/profiles/audio/a2dp.h b/profiles/audio/a2dp.h
index 736bc66..c471499 100644
--- a/profiles/audio/a2dp.h
+++ b/profiles/audio/a2dp.h
@@ -64,7 +64,9 @@ typedef void (*a2dp_stream_cb_t) (struct avdtp *session,
struct avdtp_error *err,
void *user_data);
-int a2dp_register(const bdaddr_t *src, GKeyFile *config);
+int a2dp_server_register(const bdaddr_t *src, GKeyFile *config);
+int a2dp_source_register(const bdaddr_t *src, GKeyFile *config);
+int a2dp_sink_register(const bdaddr_t *src, GKeyFile *config);
void a2dp_unregister(const bdaddr_t *src);
struct a2dp_sep *a2dp_add_sep(const bdaddr_t *src, uint8_t type,
diff --git a/profiles/audio/manager.c b/profiles/audio/manager.c
index 19aeb24..d7c1717 100644
--- a/profiles/audio/manager.c
+++ b/profiles/audio/manager.c
@@ -128,7 +128,7 @@ static void audio_remove(struct btd_profile *p, struct btd_device *device)
audio_device_unregister(dev);
}
-static int a2dp_probe(struct btd_profile *p, struct btd_device *device,
+static int a2dp_source_probe(struct btd_profile *p, struct btd_device *device,
GSList *uuids)
{
struct audio_device *audio_dev;
@@ -139,13 +139,23 @@ static int a2dp_probe(struct btd_profile *p, struct btd_device *device,
return -1;
}
- if (g_slist_find_custom(uuids, A2DP_SINK_UUID, bt_uuid_strcmp) &&
- audio_dev->sink == NULL)
- audio_dev->sink = sink_init(audio_dev);
+ audio_dev->source = source_init(audio_dev);
- if (g_slist_find_custom(uuids, A2DP_SOURCE_UUID, bt_uuid_strcmp) &&
- audio_dev->source == NULL)
- audio_dev->source = source_init(audio_dev);
+ return 0;
+}
+
+static int a2dp_sink_probe(struct btd_profile *p, struct btd_device *device,
+ GSList *uuids)
+{
+ struct audio_device *audio_dev;
+
+ audio_dev = get_audio_dev(device);
+ if (!audio_dev) {
+ DBG("unable to get a device object");
+ return -1;
+ }
+
+ audio_dev->sink = sink_init(audio_dev);
return 0;
}
@@ -232,7 +242,7 @@ static int a2dp_server_probe(struct btd_profile *p,
if (!adp)
return -EINVAL;
- err = a2dp_register(adapter_get_address(adapter), config);
+ err = a2dp_server_register(adapter_get_address(adapter), config);
if (err < 0)
audio_adapter_unref(adp);
@@ -255,6 +265,40 @@ static void a2dp_server_remove(struct btd_profile *p,
audio_adapter_unref(adp);
}
+static int a2dp_source_server_probe(struct btd_profile *p,
+ struct btd_adapter *adapter)
+{
+ struct audio_adapter *adp;
+ const gchar *path = adapter_get_path(adapter);
+
+ DBG("path %s", path);
+
+ adp = audio_adapter_get(adapter);
+ if (!adp)
+ return -EINVAL;
+
+ audio_adapter_unref(adp); /* Referenced by a2dp server */
+
+ return a2dp_source_register(adapter_get_address(adapter), config);
+}
+
+static int a2dp_sink_server_probe(struct btd_profile *p,
+ struct btd_adapter *adapter)
+{
+ struct audio_adapter *adp;
+ const gchar *path = adapter_get_path(adapter);
+
+ DBG("path %s", path);
+
+ adp = audio_adapter_get(adapter);
+ if (!adp)
+ return -EINVAL;
+
+ audio_adapter_unref(adp); /* Referenced by a2dp server */
+
+ return a2dp_sink_register(adapter_get_address(adapter), config);
+}
+
static int avrcp_server_probe(struct btd_profile *p,
struct btd_adapter *adapter)
{
@@ -325,19 +369,38 @@ static void media_server_remove(struct btd_adapter *adapter)
audio_adapter_unref(adp);
}
-static struct btd_profile a2dp_profile = {
- .name = "audio-a2dp",
+static struct btd_profile avdtp_profile = {
+ .name = "audio-avdtp",
.priority = BTD_PROFILE_PRIORITY_MEDIUM,
- .remote_uuids = BTD_UUIDS(A2DP_SOURCE_UUID, A2DP_SINK_UUID,
- ADVANCED_AUDIO_UUID),
- .device_probe = a2dp_probe,
- .device_remove = audio_remove,
+ .remote_uuids = BTD_UUIDS(ADVANCED_AUDIO_UUID),
.adapter_probe = a2dp_server_probe,
.adapter_remove = a2dp_server_remove,
};
+static struct btd_profile a2dp_source_profile = {
+ .name = "audio-source",
+ .priority = BTD_PROFILE_PRIORITY_MEDIUM,
+
+ .remote_uuids = BTD_UUIDS(A2DP_SOURCE_UUID),
+ .device_probe = a2dp_source_probe,
+ .device_remove = audio_remove,
+
+ .adapter_probe = a2dp_source_server_probe,
+};
+
+static struct btd_profile a2dp_sink_profile = {
+ .name = "audio-sink",
+ .priority = BTD_PROFILE_PRIORITY_MEDIUM,
+
+ .remote_uuids = BTD_UUIDS(A2DP_SINK_UUID),
+ .device_probe = a2dp_sink_probe,
+ .device_remove = audio_remove,
+
+ .adapter_probe = a2dp_sink_server_probe,
+};
+
static struct btd_profile avrcp_profile = {
.name = "audio-avrcp",
@@ -409,7 +472,13 @@ int audio_manager_init(GKeyFile *conf)
proceed:
if (enabled.source || enabled.sink)
- btd_profile_register(&a2dp_profile);
+ btd_profile_register(&avdtp_profile);
+
+ if (enabled.source)
+ btd_profile_register(&a2dp_source_profile);
+
+ if (enabled.sink)
+ btd_profile_register(&a2dp_sink_profile);
if (enabled.control)
btd_profile_register(&avrcp_profile);
@@ -426,8 +495,14 @@ void audio_manager_exit(void)
config = NULL;
}
+ if (enabled.source)
+ btd_profile_unregister(&a2dp_source_profile);
+
+ if (enabled.sink)
+ btd_profile_unregister(&a2dp_sink_profile);
+
if (enabled.source || enabled.sink)
- btd_profile_unregister(&a2dp_profile);
+ btd_profile_unregister(&avdtp_profile);
if (enabled.control)
btd_profile_unregister(&avrcp_profile);
--
1.7.11.7
^ permalink raw reply related
* [PATCH v3 0/3] Adopt btd_profile for A2DP
From: Mikel Astiz @ 2012-11-20 16:10 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Mikel Astiz
From: Mikel Astiz <mikel.astiz@bmw-carit.de>
The proposal is to split A2DP roles into different btd_profile instances, in order to expose .connect and .disconnect.
v3 includes the remaning patches -without changes- rebased on the latest master.
Mikel Astiz (3):
audio: Split A2DP into three btd_profile
source: Add profile .connect and .disconnect
sink: Add profile .connect and .disconnect
profiles/audio/a2dp.c | 74 +++++++--------
profiles/audio/a2dp.h | 4 +-
profiles/audio/manager.c | 242 +++++++++++++++++++++++++++++++++++++++++++----
3 files changed, 263 insertions(+), 57 deletions(-)
--
1.7.11.7
^ permalink raw reply
* [RFC 4/4] Bluetooth: AMP: Set no FCS for incoming L2CAP chan
From: Andrei Emeltchenko @ 2012-11-20 15:16 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1353424582-26042-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
When receiving L2CAP Create Channel Request set the channel as
L2CAP_FCS_NONE. Then in "L2CAP Config req" following field will
be set: "FCS Option 0x00 (No FCS)". So by default High Speed
channels have no FCS.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
net/bluetooth/l2cap_core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index f44c542..b52f66d 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -4286,6 +4286,7 @@ static int l2cap_create_channel_req(struct l2cap_conn *conn,
mgr->bredr_chan = chan;
chan->hs_hcon = hs_hcon;
+ chan->fcs = L2CAP_FCS_NONE;
conn->mtu = hdev->block_mtu;
}
--
1.7.10.4
^ permalink raw reply related
* [RFC 3/4] Bluetooth: Improve error message printing
From: Andrei Emeltchenko @ 2012-11-20 15:16 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1353424582-26042-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Instead of printing:
"[ 7763.082007] Bluetooth: 2"
print something like:
"[ 7763.082007] Bluetooth: Trailing bytes: 2 in sframe"
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
net/bluetooth/l2cap_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 7114bdf..f44c542 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -6091,7 +6091,7 @@ static int l2cap_data_rcv(struct l2cap_chan *chan, struct sk_buff *skb)
control->super);
if (len != 0) {
- BT_ERR("%d", len);
+ BT_ERR("Trailing bytes: %d in sframe", len);
l2cap_send_disconn_req(chan->conn, chan, ECONNRESET);
goto drop;
}
--
1.7.10.4
^ permalink raw reply related
* [RFC 2/4] Bluetooth: Set local_amp_id after getting Phylink Completed evt
From: Andrei Emeltchenko @ 2012-11-20 15:16 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1353424582-26042-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
local_amp_id is used in l2cap_physical_cfm and shall be set up
before calling it.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
net/bluetooth/amp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/bluetooth/amp.c b/net/bluetooth/amp.c
index 0258b26..1b0d92c 100644
--- a/net/bluetooth/amp.c
+++ b/net/bluetooth/amp.c
@@ -390,6 +390,7 @@ void amp_physical_cfm(struct hci_conn *bredr_hcon, struct hci_conn *hs_hcon)
set_bit(FLAG_EFS_ENABLE, &bredr_chan->flags);
bredr_chan->remote_amp_id = hs_hcon->remote_id;
+ bredr_chan->local_amp_id = hs_hcon->hdev->id;
bredr_chan->hs_hcon = hs_hcon;
bredr_chan->conn->mtu = hs_hcon->hdev->block_mtu;
--
1.7.10.4
^ permalink raw reply related
* [RFC 1/4] Bluetooth: Fix sending L2CAP Create Chan Req
From: Andrei Emeltchenko @ 2012-11-20 15:16 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1353424582-26042-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
When receiving Physical Link Completed event we need to create L2CAP
channel with L2CAP Create Chan Request. Current code was sending
this command only if connection was pending (which is probably
needed in channel move case). If channel is not moved but created
Create Chan should be sent for outgoing channel which is checked
with BT_CONNECT flag.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
net/bluetooth/l2cap_core.c | 29 ++++++++++++++++++-----------
1 file changed, 18 insertions(+), 11 deletions(-)
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 3ed9393..7114bdf 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -4517,15 +4517,31 @@ void l2cap_move_start(struct l2cap_chan *chan)
static void l2cap_do_create(struct l2cap_chan *chan, int result,
u8 local_amp_id, u8 remote_amp_id)
{
+ BT_DBG("chan %p state %s %u -> %u", chan, state_to_string(chan->state),
+ local_amp_id, remote_amp_id);
+
chan->fcs = L2CAP_FCS_NONE;
- if (!test_bit(CONF_CONNECT_PEND, &chan->conf_state)) {
+ /* Outgoing channel on AMP */
+ if (chan->state == BT_CONNECT) {
+ if (result == L2CAP_CR_SUCCESS) {
+ chan->local_amp_id = local_amp_id;
+ l2cap_send_create_chan_req(chan, remote_amp_id);
+ } else {
+ /* Revert to BR/EDR connect */
+ l2cap_send_conn_req(chan);
+ }
+
+ return;
+ }
+
+ /* Incoming channel on AMP */
+ if (__l2cap_no_conn_pending(chan)) {
struct l2cap_conn_rsp rsp;
char buf[128];
rsp.scid = cpu_to_le16(chan->dcid);
rsp.dcid = cpu_to_le16(chan->scid);
- /* Incoming channel on AMP */
if (result == L2CAP_CR_SUCCESS) {
/* Send successful response */
rsp.result = __constant_cpu_to_le16(L2CAP_CR_SUCCESS);
@@ -4547,15 +4563,6 @@ static void l2cap_do_create(struct l2cap_chan *chan, int result,
l2cap_build_conf_req(chan, buf), buf);
chan->num_conf_req++;
}
- } else {
- /* Outgoing channel on AMP */
- if (result == L2CAP_CR_SUCCESS) {
- chan->local_amp_id = local_amp_id;
- l2cap_send_create_chan_req(chan, remote_amp_id);
- } else {
- /* Revert to BR/EDR connect */
- l2cap_send_conn_req(chan);
- }
}
}
--
1.7.10.4
^ permalink raw reply related
* [RFC 0/4] Bluetooth: AMP fixes
From: Andrei Emeltchenko @ 2012-11-20 15:16 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <20121119212812.GB14006@joana>
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Set of fixes fixing remaining issues after merging Mat and mine patches.
Andrei Emeltchenko (4):
Bluetooth: Fix sending L2CAP Create Chan Req
Bluetooth: Set local_amp_id after getting Phylink Completed evt
Bluetooth: Improve error message printing
Bluetooth: AMP: Set no FCS for incoming L2CAP chan
net/bluetooth/amp.c | 1 +
net/bluetooth/l2cap_core.c | 32 ++++++++++++++++++++------------
2 files changed, 21 insertions(+), 12 deletions(-)
--
1.7.10.4
^ permalink raw reply
* [RFC] Bluetooth: Provide mgmt API for reading list of supported codecs
From: Michael Knudsen @ 2012-11-20 14:27 UTC (permalink / raw)
To: linux-bluetooth
Provide an API for allowing user space to read the list of codecs
supported by a given controller. For now the list is hardwired in
hci_core but later devices that support the appropriate HCI command
will read out the actual list during controller initialisation.
The intention is that this should be used together with the socket
options that I mailed out a diff for earlier.
Comments?
Specifically, I wonder if it is too much to embed the codecs buffer
in the structure since most of the time very little of it will be
used.
Maybe this needs to be split into multiple diffs, but for now here
it is in one go.
-m.
---
include/net/bluetooth/hci.h | 9 +++++++++
include/net/bluetooth/hci_core.h | 2 ++
include/net/bluetooth/mgmt.h | 7 +++++++
net/bluetooth/hci_core.c | 5 +++++
net/bluetooth/mgmt.c | 36
++++++++++++++++++++++++++++++++++++
5 files changed, 59 insertions(+)
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 45eee08..9455cbe 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -283,6 +283,15 @@ enum {
#define HCI_LM_RELIABLE 0x0010
#define HCI_LM_SECURE 0x0020
+/* Coding Format */
+#define HCI_FORMAT_ULAW 0x00
+#define HCI_FORMAT_ALAW 0x01
+#define HCI_FORMAT_CVSD 0x02
+#define HCI_FORMAT_TRANSPARENT 0x03
+#define HCI_FORMAT_PCM 0x04
+#define HCI_FORMAT_MSBC 0x05
+#define HCI_FORMAT_VENDOR 0xff
+
/* Authentication types */
#define HCI_AT_NO_BONDING 0x00
#define HCI_AT_NO_BONDING_MITM 0x01
diff --git a/include/net/bluetooth/hci_core.h
b/include/net/bluetooth/hci_core.h
index ef5b85d..79fe128 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -153,6 +153,8 @@ struct hci_dev {
__u8 features[8];
__u8 host_features[8];
__u8 commands[64];
+ __u8 codecs;
+ __u8 codec[255];
__u8 hci_ver;
__u16 hci_rev;
__u8 lmp_ver;
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 22980a7..523dc58 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -350,6 +350,13 @@ struct mgmt_cp_set_device_id {
} __packed;
#define MGMT_SET_DEVICE_ID_SIZE 8
+#define MGMT_OP_READ_CODECS 0x0029
+#define MGMT_READ_CODECS_SIZE 0
+struct mgmt_rp_read_codecs {
+ __u8 count;
+ __u8 codec[0];
+} __packed;
+
#define MGMT_EV_CMD_COMPLETE 0x0001
struct mgmt_ev_cmd_complete {
__le16 opcode;
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index e3a49db..cbc7c62 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1706,6 +1706,11 @@ struct hci_dev *hci_alloc_dev(void)
hdev->sniff_max_interval = 800;
hdev->sniff_min_interval = 80;
+ hdev->codecs = 3;
+ hdev->codec[0] = HCI_FORMAT_CVSD;
+ hdev->codec[1] = HCI_FORMAT_PCM;
+ hdev->codec[2] = HCI_FORMAT_TRANSPARENT;
+
mutex_init(&hdev->lock);
mutex_init(&hdev->req_lock);
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index dedbb1d..a47fda2 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -76,6 +76,7 @@ static const u16 mgmt_commands[] = {
MGMT_OP_BLOCK_DEVICE,
MGMT_OP_UNBLOCK_DEVICE,
MGMT_OP_SET_DEVICE_ID,
+ MGMT_OP_READ_CODECS,
};
static const u16 mgmt_events[] = {
@@ -319,6 +320,40 @@ static int read_commands(struct sock *sk, struct
hci_dev *hdev, void *data,
return err;
}
+static int read_codecs(struct sock *sk, struct hci_dev *hdev, void *data,
+ u16 len)
+{
+ struct mgmt_rp_read_codecs *rp;
+ int err;
+ size_t rp_size;
+
+ BT_DBG("sock %p %s", sk, hdev->name);
+
+ hci_dev_lock(hdev);
+
+ rp_size = sizeof(*rp) + hdev->codecs;
+
+ rp = kmalloc(rp_size, GFP_KERNEL);
+ if (!rp) {
+ hci_dev_unlock(hdev);
+ return -ENOMEM;
+ }
+
+ memset(rp, 0, sizeof(rp));
+
+ rp->count = hdev->codecs;
+ memcpy(rp->codec, hdev->codec, hdev->codecs);
+
+ hci_dev_unlock(hdev);
+
+ err = cmd_complete(sk, hdev->id, MGMT_OP_READ_CODECS, 0, rp,
+ rp_size);
+
+ kfree(rp);
+
+ return err;
+}
+
static int read_index_list(struct sock *sk, struct hci_dev *hdev, void
*data,
u16 data_len)
{
@@ -2748,6 +2783,7 @@ static const struct mgmt_handler {
{ block_device, false, MGMT_BLOCK_DEVICE_SIZE },
{ unblock_device, false, MGMT_UNBLOCK_DEVICE_SIZE },
{ set_device_id, false, MGMT_SET_DEVICE_ID_SIZE },
+ { read_codecs, true, MGMT_READ_CODECS_SIZE },
};
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH 0/3] Fix corrupted SDP response for sequence size > 256
From: Johan Hedberg @ 2012-11-20 12:57 UTC (permalink / raw)
To: Bart Westgeest; +Cc: linux-bluetooth
In-Reply-To: <1353351872-10628-1-git-send-email-bart@elbrys.com>
Hi Bart,
On Mon, Nov 19, 2012, Bart Westgeest wrote:
> This patchset includes minor refactoring and a bug fix. The bug
> is exposed when a data sequence grows beyond 256 bytes, in this case the
> complete sequence data is written, but the size is truncated to one
> byte, resulting in a corrupted SDP response.
>
> RE: Feedback on potential fix for issue while advertising Feature List
>
> Bart Westgeest (3):
> sdp: Inlined single use of function sdp_set_data_type
> sdp: Limit side effects of sdp_get_data_type and sdp_get_data_size
> sdp: Upgrade datatype SEQ8 to SEQ16 when data size is greater than
> 256
>
> lib/sdp.c | 56 +++++++++++++++++++++++---------------------------------
> 1 file changed, 23 insertions(+), 33 deletions(-)
I'm happy with these as well as your responses to the feedback you got,
so the patches are now pushed upstream.
Regarding the SDP code needing cleanups/fixing/rewriting in general, we
know :) This is one of the oldest pieces of code in the stack which
could definitely use a rewrite. However, no one has come along with the
time to do it yet.
Johan
^ permalink raw reply
* Re: [PATCH] hid2hci: change subsystem in udev rule from usb to usb*
From: Alexander Holler @ 2012-11-20 12:31 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <20121120122345.GA14255@x220.ger.corp.intel.com>
Am 20.11.2012 13:23, schrieb Johan Hedberg:
> Thanks. The patch has been applied (after fixing up the commit message
> to not include the signed-off-by and to have sensible line widths).
Thanks and sorry for the long lines. I've used to use the comments as
reference (when invoking git commit), but unfortunately they got longer
since they recently got translated (to german) when using LANG != C.
Regards,
Alexander
^ permalink raw reply
* Re: [PATCH v2] Bluetooth: Remove OOB data if device was discovered in band
From: Johan Hedberg @ 2012-11-20 12:24 UTC (permalink / raw)
To: Szymon Janc; +Cc: linux-bluetooth
In-Reply-To: <1353407934-17831-1-git-send-email-szymon.janc@tieto.com>
Hi Szymon,
On Tue, Nov 20, 2012, Szymon Janc wrote:
> OOB authentication mechanism should be used only if pairing process
> has been activated by previous OOB information exchange (Core Spec
> 4.0 , vol. 1, Part A, 5.1.4.3). Stored OOB data for specific device
> should be removed if that device was discovered in band later on.
>
> Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
> ---
> V2:
> Move OOB data removal to hci_inquiry_cache_update to cover all inquiry
> events (ext/rssi) in one place.
>
> net/bluetooth/hci_core.c | 2 ++
> 1 file changed, 2 insertions(+)
Acked-by: Johan Hedberg <johan.hedberg@intel.com>
Johan
^ permalink raw reply
* Re: [PATCH] hid2hci: change subsystem in udev rule from usb to usb*
From: Johan Hedberg @ 2012-11-20 12:23 UTC (permalink / raw)
To: Alexander Holler; +Cc: linux-bluetooth
In-Reply-To: <1353412028-5677-1-git-send-email-holler@ahsoftware.de>
Hi Alexander,
On Tue, Nov 20, 2012, Alexander Holler wrote:
> With kernel 3.6 (commit 7e97243c2080ecae7129e83635227fdebd4feef6) the class for some
> devices (e.g. dongles from Logitech) were changed from usb to usbmisc. As consequence
> the udev rule for hid2hci didn't work anymore with kernels >= 3.6.
>
> Changing the subsystem from "usb" to "usb*" matches both "usb" and "usbmisc" and works
> with all kernels.
>
> Signed-off-by: Alexander Holler <holler@ahsoftware.de>
> ---
> scripts/bluetooth-hid2hci.rules | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks. The patch has been applied (after fixing up the commit message
to not include the signed-off-by and to have sensible line widths).
Johan
^ permalink raw reply
* Sco issue:iogear dongle
From: Deepthi @ 2012-11-20 12:12 UTC (permalink / raw)
To: linux-bluetooth
Hello,
I 'm facing an issue regarding the sco data transfer in iogear dongle
4.0 in linux-3.2.5 kernel version. sco is connected with sco handle as
1, but i could see no sco data transfer .
Please help,
--
Thanks & Regards,
Deepthi Elizabeth P V
^ permalink raw reply
* Re: [PATCH v2 0/8] Adopt btd_profile for A2DP
From: Luiz Augusto von Dentz @ 2012-11-20 11:47 UTC (permalink / raw)
To: Mikel Astiz; +Cc: linux-bluetooth@vger.kernel.org, Mikel Astiz
In-Reply-To: <1352964460-8531-1-git-send-email-mikel.astiz.oss@gmail.com>
Hi Mikel,
On Thu, Nov 15, 2012 at 9:27 AM, Mikel Astiz <mikel.astiz.oss@gmail.com> wrote:
> From: Mikel Astiz <mikel.astiz@bmw-carit.de>
>
> The proposal is to split A2DP roles into different btd_profile instances, in order to expose .connect and .disconnect.
>
> The changes in v2 include:
>
> - Renaming of functions as suggested by Luiz (avoid using local_xxx)
> - Merge of source_shutdown and source_disconnect: they were quite similar and having a generalized function seems a better idea (to be discussed if we can get rid of the gboolean shutdown parameter)
> - New patches have been added to address the sink part as well (v1 focused on the source role)
>
> Mikel Astiz (8):
> audio: Trivial function renames
> sink: Generalize disconnection function
> source: Add missing code in source_disconnect()
> source: Expose internal connection API
> sink: Expose internal connection API
> audio: Split A2DP into three btd_profile
> source: Add profile .connect and .disconnect
> sink: Add profile .connect and .disconnect
>
> profiles/audio/a2dp.c | 88 ++++++++---------
> profiles/audio/a2dp.h | 4 +-
> profiles/audio/device.c | 4 +-
> profiles/audio/device.h | 3 +
> profiles/audio/manager.c | 242 +++++++++++++++++++++++++++++++++++++++++++----
> profiles/audio/sink.c | 179 ++++++++++++++++++-----------------
> profiles/audio/sink.h | 4 +-
> profiles/audio/source.c | 189 ++++++++++++++++++++----------------
> profiles/audio/source.h | 4 +-
> 9 files changed, 480 insertions(+), 237 deletions(-)
>
> --
> 1.7.11.7
First 5 patches are now pushed, I had to changed sink_disconnect and
source_disconnect since they were crashing. Please rebase the rest and
reasend.
--
Luiz Augusto von Dentz
^ permalink raw reply
* [PATCH] hid2hci: change subsystem in udev rule from usb to usb*
From: Alexander Holler @ 2012-11-20 11:47 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Alexander Holler
In-Reply-To: <50AB6B96.20209@ahsoftware.de>
With kernel 3.6 (commit 7e97243c2080ecae7129e83635227fdebd4feef6) the class for some
devices (e.g. dongles from Logitech) were changed from usb to usbmisc. As consequence
the udev rule for hid2hci didn't work anymore with kernels >= 3.6.
Changing the subsystem from "usb" to "usb*" matches both "usb" and "usbmisc" and works
with all kernels.
Signed-off-by: Alexander Holler <holler@ahsoftware.de>
---
scripts/bluetooth-hid2hci.rules | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/bluetooth-hid2hci.rules b/scripts/bluetooth-hid2hci.rules
index 0687c8a..db6bb03 100644
--- a/scripts/bluetooth-hid2hci.rules
+++ b/scripts/bluetooth-hid2hci.rules
@@ -1,7 +1,7 @@
# do not edit this file, it will be overwritten on update
ACTION=="remove", GOTO="hid2hci_end"
-SUBSYSTEM!="usb", GOTO="hid2hci_end"
+SUBSYSTEM!="usb*", GOTO="hid2hci_end"
# Variety of Dell Bluetooth devices - match on a mouse device that is
# self powered and where a HID report needs to be sent to switch modes
--
1.7.11.7
^ permalink raw reply related
* udev rule for hid2hci and Logitech dongles doesn't work with kernels >= 3.6
From: Alexander Holler @ 2012-11-20 11:37 UTC (permalink / raw)
To: linux-bluetooth
Hello,
I've recently noticed that the udev rule for hid2hci with Logitech
dongles doesn't work anymore. The reason is commit
7e97243c2080ecae7129e83635227fdebd4feef6 which changes the class
(subsystem) for those dongles from usb to usbmisc. I've already filed a
bug for Fedora (https://bugzilla.redhat.com/show_bug.cgi?id=877998) but
I thought I should write a note here too, to inform non-Fedora users too.
My suggestion is to use "usb*" instead of "usb" for the subsystem, this
works with all kernels regardless if the subsystem is "usb" or "usbmisc".
Regards,
Alexander
^ permalink raw reply
* Re: [PATCH 0/2] sco: BT_DEFER_SETUP for SCO sockets
From: Frédéric Dalleau @ 2012-11-20 10:39 UTC (permalink / raw)
To: Gustavo Padovan, linux-bluetooth
In-Reply-To: <20121119201958.GA14006@joana>
Hi Gustavo,
On 11/19/2012 09:19 PM, Gustavo Padovan wrote:
> Hi Frédéric,
>
> * Frédéric Dalleau <frederic.dalleau@linux.intel.com> [2012-11-19 17:35:55 +0100]:
>> Regarding testing, I'm still stuck by a txt timeout issue however, if the
>> delay between accept and recv is set to 0, then the connection is working fine.
>> And I even managed to get the sco connection established correctly once. So I
>> believed this emulator problem.
>
> You are telling me that your patch is not really working, I suggest you call
> this series RFC before you get everything sorted out. The approach in general
> is good, but I'd need confirmation that it works for actual defer delays, 3
> seconds for example, and not 0.
Sorry, I have been a bit premature, but for the reason explained
above I was confident.
So now I'm quite happy to say I successfully tested this series this
morning, based on bluetooth-next, using delays from 0 to 35 secs several
times in a row.
Regards,
Frédéric
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox