* [PATCH 1/2] Bluetooth: Use GFP_KERNEL in user context
From: Gustavo F. Padovan @ 2011-04-04 22:08 UTC (permalink / raw)
To: linux-bluetooth
Some of the allocations in the mgmt code are in user context, so it's no
recommended the use of GFP_ATOMIC there.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
---
net/bluetooth/mgmt.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 9a61320..bab8b58 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -133,7 +133,7 @@ static int read_index_list(struct sock *sk)
}
rp_len = sizeof(*rp) + (2 * count);
- rp = kmalloc(rp_len, GFP_ATOMIC);
+ rp = kmalloc(rp_len, GFP_KERNEL);
if (!rp) {
read_unlock(&hci_dev_list_lock);
return -ENOMEM;
@@ -226,14 +226,14 @@ static struct pending_cmd *mgmt_pending_add(struct sock *sk, u16 opcode,
{
struct pending_cmd *cmd;
- cmd = kmalloc(sizeof(*cmd), GFP_ATOMIC);
+ cmd = kmalloc(sizeof(*cmd), GFP_KERNEL);
if (!cmd)
return NULL;
cmd->opcode = opcode;
cmd->index = index;
- cmd->param = kmalloc(len, GFP_ATOMIC);
+ cmd->param = kmalloc(len, GFP_KERNEL);
if (!cmd->param) {
kfree(cmd);
return NULL;
@@ -741,7 +741,7 @@ static int add_uuid(struct sock *sk, u16 index, unsigned char *data, u16 len)
hci_dev_lock_bh(hdev);
- uuid = kmalloc(sizeof(*uuid), GFP_ATOMIC);
+ uuid = kmalloc(sizeof(*uuid), GFP_KERNEL);
if (!uuid) {
err = -ENOMEM;
goto failed;
@@ -1081,7 +1081,7 @@ static int get_connections(struct sock *sk, u16 index)
}
rp_len = sizeof(*rp) + (count * sizeof(bdaddr_t));
- rp = kmalloc(rp_len, GFP_ATOMIC);
+ rp = kmalloc(rp_len, GFP_KERNEL);
if (!rp) {
err = -ENOMEM;
goto unlock;
@@ -1581,7 +1581,7 @@ int mgmt_control(struct sock *sk, struct msghdr *msg, size_t msglen)
if (msglen < sizeof(*hdr))
return -EINVAL;
- buf = kmalloc(msglen, GFP_ATOMIC);
+ buf = kmalloc(msglen, GFP_KERNEL);
if (!buf)
return -ENOMEM;
--
1.7.4.1
^ permalink raw reply related
* Re: [PATCH] kstrtox: convert net/bluetooth/
From: Gustavo F. Padovan @ 2011-04-04 22:00 UTC (permalink / raw)
To: Alexey Dobriyan; +Cc: marcel, linux-bluetooth
In-Reply-To: <20110402111941.GB19357@p183.telecom.by>
Hi Alexey,
* Alexey Dobriyan <adobriyan@gmail.com> [2011-04-02 14:19:41 +0300]:
> Convert from strict_strto*() interfaces to kstrto*() interfaces.
>
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> ---
>
> net/bluetooth/hci_sysfs.c | 37 +++++++++++++++++--------------------
> 1 file changed, 17 insertions(+), 20 deletions(-)
>
> --- a/net/bluetooth/hci_sysfs.c
> +++ b/net/bluetooth/hci_sysfs.c
> @@ -277,11 +277,12 @@ static ssize_t show_idle_timeout(struct device *dev, struct device_attribute *at
> static ssize_t store_idle_timeout(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
> {
> struct hci_dev *hdev = dev_get_drvdata(dev);
> - unsigned long val;
> -
> - if (strict_strtoul(buf, 0, &val) < 0)
> - return -EINVAL;
> + unsigned int val;
> + int rv;
>
> + rv = kstrtouint(buf, 0, &val);
> + if (rv < 0)
> + return rv;
Add a empty line here, please.
> if (val != 0 && (val < 500 || val > 3600000))
> return -EINVAL;
>
> @@ -299,15 +300,13 @@ static ssize_t show_sniff_max_interval(struct device *dev, struct device_attribu
> static ssize_t store_sniff_max_interval(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
> {
> struct hci_dev *hdev = dev_get_drvdata(dev);
> - unsigned long val;
> -
> - if (strict_strtoul(buf, 0, &val) < 0)
> - return -EINVAL;
> -
> - if (val < 0x0002 || val > 0xFFFE || val % 2)
> - return -EINVAL;
> + u16 val;
> + int rv;
>
> - if (val < hdev->sniff_min_interval)
> + rv = kstrtou16(buf, 0, &val);
> + if (rv < 0)
> + return rv;
> + if (val == 0 || val % 2 || val < hdev->sniff_min_interval)
> return -EINVAL;
Why are you changing other things besides the string conversions? The checks
for val should stay the same.
>
> hdev->sniff_max_interval = val;
> @@ -324,15 +323,13 @@ static ssize_t show_sniff_min_interval(struct device *dev, struct device_attribu
> static ssize_t store_sniff_min_interval(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
> {
> struct hci_dev *hdev = dev_get_drvdata(dev);
> - unsigned long val;
> -
> - if (strict_strtoul(buf, 0, &val) < 0)
> - return -EINVAL;
> -
> - if (val < 0x0002 || val > 0xFFFE || val % 2)
> - return -EINVAL;
> + u16 val;
> + int rv;
>
> - if (val > hdev->sniff_max_interval)
> + rv = kstrtou16(buf, 0, &val);
> + if (rv < 0)
> + return rv;
> + if (val == 0 || val % 2 || val > hdev->sniff_max_interval)
> return -EINVAL;
Same problem here.
--
Gustavo F. Padovan
http://profusion.mobi
^ permalink raw reply
* Re: [PATCH 1/2 v2] Bluetooth: Add mgmt_device_found event
From: Gustavo F. Padovan @ 2011-04-04 21:49 UTC (permalink / raw)
To: johan.hedberg; +Cc: linux-bluetooth
In-Reply-To: <1301518636-25086-1-git-send-email-johan.hedberg@gmail.com>
Hi Johan,
* johan.hedberg@gmail.com <johan.hedberg@gmail.com> [2011-03-30 23:57:16 +0300]:
> From: Johan Hedberg <johan.hedberg@nokia.com>
>
> This patch adds a device_found event to the Management interface. For
> now the event only maps to BR/EDR inquiry result HCI events, but in the
> future the plan is to also use it for the LE device discovery process.
>
> Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com>
> ---
> v2: comments from Lizardo taken into account
>
> include/net/bluetooth/hci_core.h | 2 ++
> include/net/bluetooth/mgmt.h | 8 ++++++++
> net/bluetooth/hci_event.c | 22 ++++++++++++++--------
> net/bluetooth/mgmt.c | 17 +++++++++++++++++
> 4 files changed, 41 insertions(+), 8 deletions(-)
Both patches were applied, thanks.
--
Gustavo F. Padovan
http://profusion.mobi
^ permalink raw reply
* Re: [PATCH] Bluetooth: change gfp type in hci_recv_stream_fragment()
From: Gustavo F. Padovan @ 2011-04-04 21:16 UTC (permalink / raw)
To: Zhang Jiejing; +Cc: suraj, marcel, linux-bluetooth
In-Reply-To: <1301554616-27595-1-git-send-email-jiejing.zhang@freescale.com>
Hi Zhang,
* Zhang Jiejing <jiejing.zhang@freescale.com> [2011-03-31 14:56:56 +0800]:
> change gfp type passed to hci_reassembly(), replace GFP_ATOMIC
> to GFP_KERNEL. Since some HCI_ACLDATA may request 1024+4 bytes
> some time GFP_ATOMIC will failed to allocation memory during
> large file FTP transfer in high baud rate.
>
> Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
> ---
> net/bluetooth/hci_core.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
> index 9c4541b..22b3ded 100644
> --- a/net/bluetooth/hci_core.c
> +++ b/net/bluetooth/hci_core.c
> @@ -1214,7 +1214,7 @@ int hci_recv_stream_fragment(struct hci_dev *hdev, void *data, int count)
> type = bt_cb(skb)->pkt_type;
>
> rem = hci_reassembly(hdev, type, data,
> - count, STREAM_REASSEMBLY, GFP_ATOMIC);
> + count, STREAM_REASSEMBLY, GFP_KERNEL);
We can't use GFP_KERNEL in a interrupt context, we can't sleep here and
GFP_ATOMIC guarantees that.
--
Gustavo F. Padovan
http://profusion.mobi
^ permalink raw reply
* Re: [PATCH 12/15] Bluetooth: Move ERTM timers to struct l2cap_chan
From: Gustavo F. Padovan @ 2011-04-04 21:05 UTC (permalink / raw)
To: Anderson Lizardo; +Cc: linux-bluetooth
In-Reply-To: <BANLkTikP-bL5LUmmim7Y3dxrsU7Qwuhm0Q@mail.gmail.com>
Hi Lizardo,
* Anderson Lizardo <anderson.lizardo@openbossa.org> [2011-04-04 17:00:17 -0400]:
> Hi Gustavo,
>
> On Fri, Apr 1, 2011 at 6:33 PM, Gustavo F. Padovan
> <padovan@profusion.mobi> wrote:
> > @@ -958,7 +961,7 @@ static void l2cap_monitor_timeout(unsigned long arg)
> >
> > bh_lock_sock(sk);
> > if (chan->retry_count >= chan->remote_max_tx) {
> > - l2cap_send_disconn_req(l2cap_pi(sk)->conn, sk, ECONNABORTED);
> > + l2cap_send_disconn_req(l2cap_pi(chan)->conn, chan, ECONNABORTED);
> > bh_unlock_sock(sk);
> > return;
> > }
>
> Why "l2cap_pi(chan)" ? This looks strange.
Indeed, I'll fix it.
--
Gustavo F. Padovan
http://profusion.mobi
^ permalink raw reply
* Re: [PATCH 12/15] Bluetooth: Move ERTM timers to struct l2cap_chan
From: Anderson Lizardo @ 2011-04-04 21:00 UTC (permalink / raw)
To: Gustavo F. Padovan; +Cc: linux-bluetooth
In-Reply-To: <1301697200-2446-13-git-send-email-padovan@profusion.mobi>
Hi Gustavo,
On Fri, Apr 1, 2011 at 6:33 PM, Gustavo F. Padovan
<padovan@profusion.mobi> wrote:
> @@ -958,7 +961,7 @@ static void l2cap_monitor_timeout(unsigned long arg)
>
> bh_lock_sock(sk);
> if (chan->retry_count >= chan->remote_max_tx) {
> - l2cap_send_disconn_req(l2cap_pi(sk)->conn, sk, ECONNABORTED);
> + l2cap_send_disconn_req(l2cap_pi(chan)->conn, chan, ECONNABORTED);
> bh_unlock_sock(sk);
> return;
> }
Why "l2cap_pi(chan)" ? This looks strange.
Regards,
--
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil
^ permalink raw reply
* Re: [PATCH 07/15] Bluetooth: Move conn_state to struct l2cap_chan
From: Gustavo F. Padovan @ 2011-04-04 20:58 UTC (permalink / raw)
To: Anderson Lizardo; +Cc: linux-bluetooth
In-Reply-To: <BANLkTinLMLapNTfDD+URnAcb8GZZP4UyXQ@mail.gmail.com>
Hi Lizardo,
* Anderson Lizardo <anderson.lizardo@openbossa.org> [2011-04-04 16:50:13 -0400]:
> Hi Gustavo,
>
> (patch too big for me to review properly...)
>
> On Fri, Apr 1, 2011 at 6:33 PM, Gustavo F. Padovan
> <padovan@profusion.mobi> wrote:
> > static void l2cap_retrans_timeout(unsigned long arg)
> > {
> > - struct sock *sk = (void *) arg;
> > + struct l2cap_chan *chan = (void *) arg;
> > + struct sock *sk = chan->sk;
> >
> > BT_DBG("sk %p", sk);
> >
> > @@ -978,9 +983,9 @@ static void l2cap_retrans_timeout(unsigned long arg)
> > l2cap_pi(sk)->retry_count = 1;
> > __mod_monitor_timer();
> >
> > - l2cap_pi(sk)->conn_state |= L2CAP_CONN_WAIT_F;
> > + chan->conn_state |= L2CAP_CONN_WAIT_F;
>
> I suppose the above requires a lock ?
It has one, the socket lock. It's completely safe use it here.
>
> In general it seems that by creating the additional "l2cap_chan"
> layer, all lock usages need to be reviewed (IMHO).
Yes, that will be done in an next step. I'm going to remove any sock reference
from l2cap_core.c, so a new locking system will be needed.
--
Gustavo F. Padovan
http://profusion.mobi
^ permalink raw reply
* Re: [PATCH 07/15] Bluetooth: Move conn_state to struct l2cap_chan
From: Anderson Lizardo @ 2011-04-04 20:50 UTC (permalink / raw)
To: Gustavo F. Padovan; +Cc: linux-bluetooth
In-Reply-To: <1301697200-2446-8-git-send-email-padovan@profusion.mobi>
Hi Gustavo,
(patch too big for me to review properly...)
On Fri, Apr 1, 2011 at 6:33 PM, Gustavo F. Padovan
<padovan@profusion.mobi> wrote:
> static void l2cap_retrans_timeout(unsigned long arg)
> {
> - struct sock *sk = (void *) arg;
> + struct l2cap_chan *chan = (void *) arg;
> + struct sock *sk = chan->sk;
>
> BT_DBG("sk %p", sk);
>
> @@ -978,9 +983,9 @@ static void l2cap_retrans_timeout(unsigned long arg)
> l2cap_pi(sk)->retry_count = 1;
> __mod_monitor_timer();
>
> - l2cap_pi(sk)->conn_state |= L2CAP_CONN_WAIT_F;
> + chan->conn_state |= L2CAP_CONN_WAIT_F;
I suppose the above requires a lock ?
In general it seems that by creating the additional "l2cap_chan"
layer, all lock usages need to be reviewed (IMHO).
>
> - l2cap_send_rr_or_rnr(l2cap_pi(sk), L2CAP_CTRL_POLL);
> + l2cap_send_rr_or_rnr(chan, L2CAP_CTRL_POLL);
> bh_unlock_sock(sk);
> }
>
Regards,
--
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil
^ permalink raw reply
* Re: [PATCH 02/15] Bluetooth: Use struct list_head for L2CAP channels list
From: Anderson Lizardo @ 2011-04-04 20:28 UTC (permalink / raw)
To: Gustavo F. Padovan; +Cc: linux-bluetooth
In-Reply-To: <1301697200-2446-3-git-send-email-padovan@profusion.mobi>
Hi Gustavo,
On Fri, Apr 1, 2011 at 6:33 PM, Gustavo F. Padovan
<padovan@profusion.mobi> wrote:
> @@ -724,26 +709,27 @@ static void l2cap_conn_ready(struct l2cap_conn *conn)
> bh_unlock_sock(sk);
> }
>
> - read_unlock(&l->lock);
> + read_unlock(&conn->chan_lock);
> }
>
> /* Notify sockets that we cannot guaranty reliability anymore */
> static void l2cap_conn_unreliable(struct l2cap_conn *conn, int err)
> {
> - struct l2cap_chan_list *l = &conn->chan_list;
> struct l2cap_chan *chan;
> + struct sock *sk;
You can move this declaration to the list_for_each_entry() block
(like you did in other places).
>
> BT_DBG("conn %p", conn);
>
> - read_lock(&l->lock);
> + read_lock(&conn->chan_lock);
> +
> + list_for_each_entry(chan, &conn->chan_l, list) {
> + sk = chan->sk;
>
> - for (chan = l->head; chan; chan = chan->next_c) {
> - struct sock *sk = chan->sk;
> if (l2cap_pi(sk)->force_reliable)
> sk->sk_err = err;
> }
>
> - read_unlock(&l->lock);
> + read_unlock(&conn->chan_lock);
> }
>
> static void l2cap_info_timeout(unsigned long arg)
> @@ -783,7 +769,9 @@ static struct l2cap_conn *l2cap_conn_add(struct hci_conn *hcon, u8 status)
> conn->feat_mask = 0;
>
> spin_lock_init(&conn->lock);
> - rwlock_init(&conn->chan_list.lock);
> + rwlock_init(&conn->chan_lock);
> +
> + INIT_LIST_HEAD(&conn->chan_l);
>
> if (hcon->type != LE_LINK)
> setup_timer(&conn->info_timer, l2cap_info_timeout,
> @@ -797,7 +785,7 @@ static struct l2cap_conn *l2cap_conn_add(struct hci_conn *hcon, u8 status)
> static void l2cap_conn_del(struct hci_conn *hcon, int err)
> {
> struct l2cap_conn *conn = hcon->l2cap_data;
> - struct l2cap_chan *chan;
> + struct l2cap_chan *chan, *l;
> struct sock *sk;
>
> if (!conn)
> @@ -808,7 +796,7 @@ static void l2cap_conn_del(struct hci_conn *hcon, int err)
> kfree_skb(conn->rx_skb);
>
> /* Kill channels */
> - while ((chan = conn->chan_list.head)) {
> + list_for_each_entry_safe(chan, l, &conn->chan_l, list) {
> sk = chan->sk;
> bh_lock_sock(sk);
> l2cap_chan_del(chan, err);
> @@ -825,10 +813,9 @@ static void l2cap_conn_del(struct hci_conn *hcon, int err)
>
> static inline void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan)
> {
> - struct l2cap_chan_list *l = &conn->chan_list;
> - write_lock_bh(&l->lock);
> + write_lock_bh(&conn->chan_lock);
> __l2cap_chan_add(conn, chan);
> - write_unlock_bh(&l->lock);
> + write_unlock_bh(&conn->chan_lock);
> }
>
> /* ---- Socket interface ---- */
> @@ -1426,14 +1413,13 @@ static void l2cap_chan_ready(struct sock *sk)
> /* Copy frame to all raw sockets on that connection */
> static void l2cap_raw_recv(struct l2cap_conn *conn, struct sk_buff *skb)
> {
> - struct l2cap_chan_list *l = &conn->chan_list;
> struct sk_buff *nskb;
> struct l2cap_chan *chan;
>
> BT_DBG("conn %p", conn);
>
> - read_lock(&l->lock);
> - for (chan = l->head; chan; chan = chan->next_c) {
> + read_lock(&conn->chan_lock);
> + list_for_each_entry(chan, &conn->chan_l, list) {
> struct sock *sk = chan->sk;
> if (sk->sk_type != SOCK_RAW)
> continue;
> @@ -1448,7 +1434,7 @@ static void l2cap_raw_recv(struct l2cap_conn *conn, struct sk_buff *skb)
> if (sock_queue_rcv_skb(sk, nskb))
> kfree_skb(nskb);
> }
> - read_unlock(&l->lock);
> + read_unlock(&conn->chan_lock);
> }
>
> /* ---- L2CAP signalling commands ---- */
> @@ -2015,7 +2001,6 @@ static inline int l2cap_command_rej(struct l2cap_conn *conn, struct l2cap_cmd_hd
>
> static inline int l2cap_connect_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr *cmd, u8 *data)
> {
> - struct l2cap_chan_list *list = &conn->chan_list;
> struct l2cap_conn_req *req = (struct l2cap_conn_req *) data;
> struct l2cap_conn_rsp rsp;
> struct l2cap_chan *chan;
> @@ -2062,11 +2047,11 @@ static inline int l2cap_connect_req(struct l2cap_conn *conn, struct l2cap_cmd_hd
> goto response;
> }
>
> - write_lock_bh(&list->lock);
> + write_lock_bh(&conn->chan_lock);
>
> /* Check if we already have channel with that dcid */
> - if (__l2cap_get_chan_by_dcid(list, scid)) {
> - write_unlock_bh(&list->lock);
> + if (__l2cap_get_chan_by_dcid(conn, scid)) {
> + write_unlock_bh(&conn->chan_lock);
> sock_set_flag(sk, SOCK_ZAPPED);
> l2cap_sock_kill(sk);
> goto response;
> @@ -2115,7 +2100,7 @@ static inline int l2cap_connect_req(struct l2cap_conn *conn, struct l2cap_cmd_hd
> status = L2CAP_CS_NO_INFO;
> }
>
> - write_unlock_bh(&list->lock);
> + write_unlock_bh(&conn->chan_lock);
>
> response:
> bh_unlock_sock(parent);
> @@ -2169,11 +2154,11 @@ static inline int l2cap_connect_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hd
> BT_DBG("dcid 0x%4.4x scid 0x%4.4x result 0x%2.2x status 0x%2.2x", dcid, scid, result, status);
>
> if (scid) {
> - chan = l2cap_get_chan_by_scid(&conn->chan_list, scid);
> + chan = l2cap_get_chan_by_scid(conn, scid);
> if (!chan)
> return -EFAULT;
> } else {
> - chan = l2cap_get_chan_by_ident(&conn->chan_list, cmd->ident);
> + chan = l2cap_get_chan_by_ident(conn, cmd->ident);
> if (!chan)
> return -EFAULT;
> }
> @@ -2243,7 +2228,7 @@ static inline int l2cap_config_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr
>
> BT_DBG("dcid 0x%4.4x flags 0x%2.2x", dcid, flags);
>
> - chan = l2cap_get_chan_by_scid(&conn->chan_list, dcid);
> + chan = l2cap_get_chan_by_scid(conn, dcid);
> if (!chan)
> return -ENOENT;
>
> @@ -2338,7 +2323,7 @@ static inline int l2cap_config_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hdr
> BT_DBG("scid 0x%4.4x flags 0x%2.2x result 0x%2.2x",
> scid, flags, result);
>
> - chan = l2cap_get_chan_by_scid(&conn->chan_list, scid);
> + chan = l2cap_get_chan_by_scid(conn, scid);
> if (!chan)
> return 0;
>
> @@ -2418,7 +2403,7 @@ static inline int l2cap_disconnect_req(struct l2cap_conn *conn, struct l2cap_cmd
>
> BT_DBG("scid 0x%4.4x dcid 0x%4.4x", scid, dcid);
>
> - chan = l2cap_get_chan_by_scid(&conn->chan_list, dcid);
> + chan = l2cap_get_chan_by_scid(conn, dcid);
> if (!chan)
> return 0;
>
> @@ -2458,7 +2443,7 @@ static inline int l2cap_disconnect_rsp(struct l2cap_conn *conn, struct l2cap_cmd
>
> BT_DBG("dcid 0x%4.4x scid 0x%4.4x", dcid, scid);
>
> - chan = l2cap_get_chan_by_scid(&conn->chan_list, scid);
> + chan = l2cap_get_chan_by_scid(conn, scid);
> if (!chan)
> return 0;
>
> @@ -3612,7 +3597,7 @@ static inline int l2cap_data_channel(struct l2cap_conn *conn, u16 cid, struct sk
> u8 tx_seq;
> int len;
>
> - chan = l2cap_get_chan_by_scid(&conn->chan_list, cid);
> + chan = l2cap_get_chan_by_scid(conn, cid);
> if (!chan) {
> BT_DBG("unknown cid 0x%4.4x", cid);
> goto drop;
> @@ -3855,21 +3840,20 @@ static inline void l2cap_check_encryption(struct sock *sk, u8 encrypt)
>
> static int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
> {
> - struct l2cap_chan_list *l;
> struct l2cap_conn *conn = hcon->l2cap_data;
> struct l2cap_chan *chan;
> + struct sock *sk;
Same here.
>
> if (!conn)
> return 0;
>
> - l = &conn->chan_list;
> -
> BT_DBG("conn %p", conn);
>
> - read_lock(&l->lock);
> + read_lock(&conn->chan_lock);
> +
> + list_for_each_entry(chan, &conn->chan_l, list) {
> + sk = chan->sk;
>
> - for (chan = l->head; chan; chan = chan->next_c) {
> - struct sock *sk = chan->sk;
> bh_lock_sock(sk);
>
> if (l2cap_pi(sk)->conf_state & L2CAP_CONF_CONNECT_PEND) {
> @@ -3923,7 +3907,7 @@ static int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
> bh_unlock_sock(sk);
> }
>
> - read_unlock(&l->lock);
> + read_unlock(&conn->chan_lock);
>
> return 0;
> }
> @@ -3980,7 +3964,7 @@ static int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 fl
> goto drop;
> }
>
> - chan = l2cap_get_chan_by_scid(&conn->chan_list, cid);
> + chan = l2cap_get_chan_by_scid(conn, cid);
>
> if (chan && chan->sk) {
> struct sock *sk = chan->sk;
> @@ -3996,6 +3980,7 @@ static int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 fl
> bh_unlock_sock(sk);
> }
>
> +
Unnecessary empty line.
> /* Allocate skb for the complete frame (with header) */
> conn->rx_skb = bt_skb_alloc(len, GFP_ATOMIC);
> if (!conn->rx_skb)
Regards,
--
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil
^ permalink raw reply
* Re: [PATCH 01/15] Bluetooth: Create struct l2cap_chan
From: Gustavo F. Padovan @ 2011-04-04 20:07 UTC (permalink / raw)
To: Anderson Lizardo; +Cc: linux-bluetooth
In-Reply-To: <BANLkTi=Ct=DwwJaU+qCk=SYFcD-ELz4XiA@mail.gmail.com>
Hi Lizardo.
* Anderson Lizardo <anderson.lizardo@openbossa.org> [2011-04-04 15:22:29 -0400]:
> Hi Gustavo,
>
> On Fri, Apr 1, 2011 at 6:33 PM, Gustavo F. Padovan
> <padovan@profusion.mobi> wrote:
> > @@ -203,13 +217,14 @@ static void __l2cap_chan_add(struct l2cap_conn *conn, struct sock *sk)
> > l2cap_pi(sk)->omtu = L2CAP_DEFAULT_MTU;
> > }
> >
> > - __l2cap_chan_link(l, sk);
> > + __l2cap_chan_link(l, chan);
> > }
> >
> > /* Delete channel.
> > * Must be called on the locked socket. */
> > -void l2cap_chan_del(struct sock *sk, int err)
> > +void l2cap_chan_del(struct l2cap_chan *chan, int err)
> > {
> > + struct sock *sk = chan->sk;
> > struct l2cap_conn *conn = l2cap_pi(sk)->conn;
> > struct sock *parent = bt_sk(sk)->parent;
> >
> > @@ -219,7 +234,7 @@ void l2cap_chan_del(struct sock *sk, int err)
> >
> > if (conn) {
> > /* Unlink from channel list */
> > - l2cap_chan_unlink(&conn->chan_list, sk);
> > + l2cap_chan_unlink(&conn->chan_list, chan);
> > l2cap_pi(sk)->conn = NULL;
> > hci_conn_put(conn->hcon);
> > }
> > @@ -253,6 +268,8 @@ void l2cap_chan_del(struct sock *sk, int err)
> > kfree(l);
> > }
> > }
> > +
> > + kfree(chan);
>
> Just wondering: isn't also necessary to do "l2cap_pi(sk)->chan =
> NULL;" here, supposing the underlying struct sock will still be
> allocated?
No, it is always allocated. Just check the the comment on the top of the
function "Must be called on the locked socket" or the code itself.
--
Gustavo F. Padovan
http://profusion.mobi
^ permalink raw reply
* Re: [PATCH 01/15] Bluetooth: Create struct l2cap_chan
From: Anderson Lizardo @ 2011-04-04 19:22 UTC (permalink / raw)
To: Gustavo F. Padovan; +Cc: linux-bluetooth
In-Reply-To: <1301697200-2446-2-git-send-email-padovan@profusion.mobi>
Hi Gustavo,
On Fri, Apr 1, 2011 at 6:33 PM, Gustavo F. Padovan
<padovan@profusion.mobi> wrote:
> @@ -203,13 +217,14 @@ static void __l2cap_chan_add(struct l2cap_conn *conn, struct sock *sk)
> l2cap_pi(sk)->omtu = L2CAP_DEFAULT_MTU;
> }
>
> - __l2cap_chan_link(l, sk);
> + __l2cap_chan_link(l, chan);
> }
>
> /* Delete channel.
> * Must be called on the locked socket. */
> -void l2cap_chan_del(struct sock *sk, int err)
> +void l2cap_chan_del(struct l2cap_chan *chan, int err)
> {
> + struct sock *sk = chan->sk;
> struct l2cap_conn *conn = l2cap_pi(sk)->conn;
> struct sock *parent = bt_sk(sk)->parent;
>
> @@ -219,7 +234,7 @@ void l2cap_chan_del(struct sock *sk, int err)
>
> if (conn) {
> /* Unlink from channel list */
> - l2cap_chan_unlink(&conn->chan_list, sk);
> + l2cap_chan_unlink(&conn->chan_list, chan);
> l2cap_pi(sk)->conn = NULL;
> hci_conn_put(conn->hcon);
> }
> @@ -253,6 +268,8 @@ void l2cap_chan_del(struct sock *sk, int err)
> kfree(l);
> }
> }
> +
> + kfree(chan);
Just wondering: isn't also necessary to do "l2cap_pi(sk)->chan =
NULL;" here, supposing the underlying struct sock will still be
allocated?
Regards,
--
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil
^ permalink raw reply
* Re: Question about supported profiles
From: Vinicius Costa Gomes @ 2011-04-04 13:46 UTC (permalink / raw)
To: Ferraton, Jean RegisX; +Cc: linux-bluetooth@vger.kernel.org
In-Reply-To: <6E42A1B4DD2F7B4D80A1F26BB498BF9F8CC70E3EC6@irsmsx501.ger.corp.intel.com>
Hi Jean,
On 09:32 Mon 04 Apr, Ferraton, Jean RegisX wrote:
> Hi Arun,
>
> > -----Original Message-----
> > From: Arun K. Singh [mailto:arunkat@gmail.com]
> > Sent: Friday, April 01, 2011 7:06 PM
> > To: Ferraton, Jean RegisX
> > Cc: linux-bluetooth@vger.kernel.org
> > Subject: Re: Question about supported profiles
> >
> > Hi Jean,
> >
> > > I have a question about supported profiles under linux-bluez.
> > > Where and how are defined the default supported profiles? Is it a conf
> > file?
> > > In our case, by default we support HFP, A2DP, OPP, AVRCP...
> > > But if we want to use FTP or DUN, we have to enter "sdptool add DUN" or
> > " sdptool add FTP"
> > > Can anyone tell me how to change the default params?
> >
> > First of all its not clear what exactly are you looking for? in case
> > you need to know which all profiles are supported in bluez,
> > ./configure --help should help! Most of the profiles are implemented
> > as plugins to either bluetoothd or obexd.
> > Few of the profiles are also supported via daemons. All data profiles,
> > such as FTP/OPP/PBAP they are supported as obex plugins.
> > hope this helps.
> >
> > thanks,
> > Arun
>
> To clarify my question, I want to know where is stored the information of profiles supported by our device when we launch the command "sdptool browse BDADDR" from an external device. This command gives us our platform default supported profiles.
> If I launch additional commands like "sdptool add DUN" or " sdptool add FTP", my platform is seen as supporting more profiles.
> Where and how can I modify this default profile list?
Normally those SDP records are added by bluetoothd services (audio and
network, for example) or some external service (obexd is a good example).
For the bluetoothd services case, you can disable the services that you
don't want editing the configuration file (by default,
/etc/bluetooth/main.conf), for obexd you have to edit its command line
parameters.
> Thanks
> Regards
> Jean
> ---------------------------------------------------------------------
> Intel Corporation SAS (French simplified joint stock company)
> Registered headquarters: "Les Montalets"- 2, rue de Paris,
> 92196 Meudon Cedex, France
> Registration Number: 302 456 199 R.C.S. NANTERRE
> Capital: 4,572,000 Euros
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
Cheers,
--
Vinicius
^ permalink raw reply
* Re: [GSoC] about "Improve A2DP support"
From: Cui Xiang @ 2011-04-04 11:39 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
In-Reply-To: <BANLkTi=YSMeNpFoi8mwHz-8SjiQOPu6G5g@mail.gmail.com>
Thanks for the reply. I will begin as the guide, and finish the proposal.
2011/4/4 Luiz Augusto von Dentz <luiz.dentz@gmail.com>:
> Hi,
>
> On Mon, Apr 4, 2011 at 4:24 AM, Vincent Medivh <medivhc@gmail.com> wrote:
>> Hi
>>
>> I am interested in the idea "Improve A2DP support". I knew a little
>> knowledge of Bluetooth. After some "googling", I still have some
>> confusion about "Improve support for Sink role and coexistence with
>> HFP gateway role. " Does it mean while I am using the Bluetooth kit as
>> the speaker of some mp3 player, still I can use the kit to make a
>> phone call via Bluetooth HFP?
>>
>> I also have a question that I now have a USB Bluetooth dongle, a iPod
>> touch and a cellphone(Nokia 6120c), are those things enough to build
>> the test environment?
>
> You will probably need a pc running linux, but I guess you already
> figured that out don't you?
>
>> I have a little experience of Linux multimedia programming (a mp3
>> player program on ARM development board). I am good at C and have some
>> experience of hacking Linux kernel. I think I am also a fast learner.
>> Am I qualified to the Google Summer of Code project?
>
> Yes, but you do have understand that you are qualified to apply to
> project which doesn't mean you will get one for sure.
>
>> Recently I am reading the the code of the BlueZ and the Bluetooth
>> specification, but I still don't get the full understanding of the
>> structure of BlueZ. Could someone guide me about which I should focus
>> on to implement the idea? I am also writing the proposal,but have no
>> ideas about the project milestones. I will be grateful if someone
>> could give some suggestions.
>
> A good start is, audio/a2dp.c and audio/avdtp.c and take a look at
> a2dp and avdtp specs on bluetooth.org.
>
>> Here is more information about me, the answers to the questions.
>>
>> https://docs.google.com/document/d/1HmDybIBT9GMNaByLy8EpW0RwzLcMtyrHuCPA54NHl5I/edit?hl=en
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
>
>
> --
> Luiz Augusto von Dentz
> Computer Engineer
>
^ permalink raw reply
* Re: [PATCH] Fix check for valid SCO socket before shutdown
From: Luiz Augusto von Dentz @ 2011-04-04 9:08 UTC (permalink / raw)
To: Daniel Örstadius; +Cc: linux-bluetooth
In-Reply-To: <BANLkTi=ce+qfeS14zX-k0qrt75iGP1d7ig@mail.gmail.com>
Hi,
On Fri, Apr 1, 2011 at 5:20 PM, Daniel Örstadius
<daniel.orstadius@gmail.com> wrote:
>
>
Ack, this is actually a regression create by commit
d3f69537a46b1050d2415ca4afcdedba967096e8
--
Luiz Augusto von Dentz
Computer Engineer
^ permalink raw reply
* Re: [GSoC] about "Improve A2DP support"
From: Luiz Augusto von Dentz @ 2011-04-04 9:02 UTC (permalink / raw)
To: Vincent Medivh; +Cc: linux-bluetooth
In-Reply-To: <BANLkTikpv9_MgFtHmxAb_zzmCQVX78HQ+Q@mail.gmail.com>
Hi,
On Mon, Apr 4, 2011 at 4:24 AM, Vincent Medivh <medivhc@gmail.com> wrote:
> Hi
>
> I am interested in the idea "Improve A2DP support". I knew a little
> knowledge of Bluetooth. After some "googling", I still have some
> confusion about "Improve support for Sink role and coexistence with
> HFP gateway role. " Does it mean while I am using the Bluetooth kit as
> the speaker of some mp3 player, still I can use the kit to make a
> phone call via Bluetooth HFP?
>
> I also have a question that I now have a USB Bluetooth dongle, a iPod
> touch and a cellphone(Nokia 6120c), are those things enough to build
> the test environment?
You will probably need a pc running linux, but I guess you already
figured that out don't you?
> I have a little experience of Linux multimedia programming (a mp3
> player program on ARM development board). I am good at C and have some
> experience of hacking Linux kernel. I think I am also a fast learner.
> Am I qualified to the Google Summer of Code project?
Yes, but you do have understand that you are qualified to apply to
project which doesn't mean you will get one for sure.
> Recently I am reading the the code of the BlueZ and the Bluetooth
> specification, but I still don't get the full understanding of the
> structure of BlueZ. Could someone guide me about which I should focus
> on to implement the idea? I am also writing the proposal,but have no
> ideas about the project milestones. I will be grateful if someone
> could give some suggestions.
A good start is, audio/a2dp.c and audio/avdtp.c and take a look at
a2dp and avdtp specs on bluetooth.org.
> Here is more information about me, the answers to the questions.
>
> https://docs.google.com/document/d/1HmDybIBT9GMNaByLy8EpW0RwzLcMtyrHuCPA54NHl5I/edit?hl=en
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
Luiz Augusto von Dentz
Computer Engineer
^ permalink raw reply
* [PATCH 3/3] Fix not removing source when removing setup callback
From: Luiz Augusto von Dentz @ 2011-04-04 9:00 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1301907619-6684-1-git-send-email-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>
In rare situation this may lead to access invalid memory since setup can
be freed before idle callback is called.
---
audio/a2dp.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/audio/a2dp.c b/audio/a2dp.c
index d51276d..1f3bc99 100644
--- a/audio/a2dp.c
+++ b/audio/a2dp.c
@@ -82,6 +82,7 @@ struct a2dp_setup_cb {
a2dp_config_cb_t config_cb;
a2dp_stream_cb_t resume_cb;
a2dp_stream_cb_t suspend_cb;
+ guint source_id;
void *user_data;
unsigned int id;
};
@@ -197,6 +198,9 @@ static void setup_cb_free(struct a2dp_setup_cb *cb)
{
struct a2dp_setup *setup = cb->setup;
+ if (cb->source_id)
+ g_source_remove(cb->source_id);
+
setup->cb = g_slist_remove(setup->cb, cb);
setup_unref(cb->setup);
g_free(cb);
@@ -2120,7 +2124,8 @@ unsigned int a2dp_config(struct avdtp *session, struct a2dp_sep *sep,
case AVDTP_STATE_STREAMING:
if (avdtp_stream_has_capabilities(setup->stream, caps)) {
DBG("Configuration match: resuming");
- g_idle_add(finalize_config, setup);
+ cb_data->source_id = g_idle_add(finalize_config,
+ setup);
} else if (!setup->reconfigure) {
setup->reconfigure = TRUE;
if (avdtp_close(session, sep->stream, FALSE) < 0) {
@@ -2178,7 +2183,8 @@ unsigned int a2dp_resume(struct avdtp *session, struct a2dp_sep *sep,
if (sep->suspending)
setup->start = TRUE;
else
- g_idle_add(finalize_resume, setup);
+ cb_data->source_id = g_idle_add(finalize_resume,
+ setup);
break;
default:
error("SEP in bad state for resume");
@@ -2215,7 +2221,7 @@ unsigned int a2dp_suspend(struct avdtp *session, struct a2dp_sep *sep,
goto failed;
break;
case AVDTP_STATE_OPEN:
- g_idle_add(finalize_suspend, setup);
+ cb_data->source_id = g_idle_add(finalize_suspend, setup);
break;
case AVDTP_STATE_STREAMING:
if (avdtp_suspend(session, sep->stream) < 0) {
--
1.7.1
^ permalink raw reply related
* [PATCH 2/3] Refactore a2dp finalize_*_errno functions
From: Luiz Augusto von Dentz @ 2011-04-04 9:00 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1301907619-6684-1-git-send-email-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>
There were a lot of duplicate code in them so they are now replaced by
finalize_setup_errno which can deal with multiple callbacks reusing the
same error.
---
audio/a2dp.c | 88 +++++++++++++++++++++++++++-------------------------------
1 files changed, 41 insertions(+), 47 deletions(-)
diff --git a/audio/a2dp.c b/audio/a2dp.c
index 1208ad1..d51276d 100644
--- a/audio/a2dp.c
+++ b/audio/a2dp.c
@@ -202,8 +202,32 @@ static void setup_cb_free(struct a2dp_setup_cb *cb)
g_free(cb);
}
-static gboolean finalize_config(struct a2dp_setup *s)
+static void finalize_setup_errno(struct a2dp_setup *s, int err,
+ GSourceFunc cb1, ...)
{
+ GSourceFunc finalize;
+ va_list args;
+ struct avdtp_error avdtp_err;
+
+ if (err < 0) {
+ avdtp_error_init(&avdtp_err, AVDTP_ERRNO, -err);
+ s->err = &avdtp_err;
+ }
+
+ va_start(args, cb1);
+ finalize = cb1;
+ setup_ref(s);
+ while (finalize != NULL) {
+ finalize(s);
+ finalize = va_arg(args, GSourceFunc);
+ }
+ setup_unref(s);
+ va_end(args);
+}
+
+static gboolean finalize_config(gpointer data)
+{
+ struct a2dp_setup *s = data;
GSList *l;
struct avdtp_stream *stream = s->err ? NULL : s->stream;
@@ -223,18 +247,9 @@ static gboolean finalize_config(struct a2dp_setup *s)
return FALSE;
}
-static gboolean finalize_config_errno(struct a2dp_setup *s, int err)
-{
- struct avdtp_error avdtp_err;
-
- avdtp_error_init(&avdtp_err, AVDTP_ERRNO, -err);
- s->err = err ? &avdtp_err : NULL;
-
- return finalize_config(s);
-}
-
-static gboolean finalize_resume(struct a2dp_setup *s)
+static gboolean finalize_resume(gpointer data)
{
+ struct a2dp_setup *s = data;
GSList *l;
for (l = s->cb; l != NULL; ) {
@@ -252,18 +267,9 @@ static gboolean finalize_resume(struct a2dp_setup *s)
return FALSE;
}
-static gboolean finalize_resume_errno(struct a2dp_setup *s, int err)
-{
- struct avdtp_error avdtp_err;
-
- avdtp_error_init(&avdtp_err, AVDTP_ERRNO, -err);
- s->err = err ? &avdtp_err : NULL;
-
- return finalize_resume(s);
-}
-
-static gboolean finalize_suspend(struct a2dp_setup *s)
+static gboolean finalize_suspend(gpointer data)
{
+ struct a2dp_setup *s = data;
GSList *l;
for (l = s->cb; l != NULL; ) {
@@ -281,17 +287,7 @@ static gboolean finalize_suspend(struct a2dp_setup *s)
return FALSE;
}
-static gboolean finalize_suspend_errno(struct a2dp_setup *s, int err)
-{
- struct avdtp_error avdtp_err;
-
- avdtp_error_init(&avdtp_err, AVDTP_ERRNO, -err);
- s->err = err ? &avdtp_err : NULL;
-
- return finalize_suspend(s);
-}
-
-static gboolean finalize_select(struct a2dp_setup *s)
+static void finalize_select(struct a2dp_setup *s)
{
GSList *l;
@@ -306,8 +302,6 @@ static gboolean finalize_select(struct a2dp_setup *s)
cb->select_cb(s->session, s->sep, s->caps, cb->user_data);
setup_cb_free(cb);
}
-
- return FALSE;
}
static struct a2dp_setup *find_setup_by_session(struct avdtp *session)
@@ -777,7 +771,7 @@ static void endpoint_open_cb(struct media_endpoint *endpoint, void *ret,
if (ret == NULL) {
setup->stream = NULL;
- finalize_config_errno(setup, -EPERM);
+ finalize_setup_errno(setup, -EPERM, finalize_config);
return;
}
@@ -787,7 +781,7 @@ static void endpoint_open_cb(struct media_endpoint *endpoint, void *ret,
error("Error on avdtp_open %s (%d)", strerror(-err), -err);
setup->stream = NULL;
- finalize_config_errno(setup, err);
+ finalize_setup_errno(setup, err, finalize_config);
}
static void setconf_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
@@ -844,7 +838,7 @@ static void setconf_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
return;
setup->stream = NULL;
- finalize_config_errno(setup, -EPERM);
+ finalize_setup_errno(setup, -EPERM, finalize_config);
return;
}
@@ -852,7 +846,7 @@ static void setconf_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
if (ret < 0) {
error("Error on avdtp_open %s (%d)", strerror(-ret), -ret);
setup->stream = NULL;
- finalize_config_errno(setup, ret);
+ finalize_setup_errno(setup, ret, finalize_config);
}
}
@@ -1045,7 +1039,7 @@ static void suspend_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
perr = avdtp_start(session, a2dp_sep->stream);
if (perr < 0) {
error("Error on avdtp_start %s (%d)", strerror(-perr), -perr);
- finalize_resume_errno(setup, perr);
+ finalize_setup_errno(setup, -EIO, finalize_suspend);
}
}
@@ -1065,8 +1059,8 @@ static gboolean close_ind(struct avdtp *session, struct avdtp_local_sep *sep,
if (!setup)
return TRUE;
- finalize_suspend_errno(setup, -ECONNRESET);
- finalize_resume_errno(setup, -ECONNRESET);
+ finalize_setup_errno(setup, -ECONNRESET, finalize_suspend,
+ finalize_resume);
return TRUE;
}
@@ -1099,7 +1093,7 @@ static gboolean a2dp_reconfigure(gpointer data)
return FALSE;
failed:
- finalize_config_errno(setup, posix_err);
+ finalize_setup_errno(setup, posix_err, finalize_config);
return FALSE;
}
@@ -2126,7 +2120,7 @@ unsigned int a2dp_config(struct avdtp *session, struct a2dp_sep *sep,
case AVDTP_STATE_STREAMING:
if (avdtp_stream_has_capabilities(setup->stream, caps)) {
DBG("Configuration match: resuming");
- g_idle_add((GSourceFunc) finalize_config, setup);
+ g_idle_add(finalize_config, setup);
} else if (!setup->reconfigure) {
setup->reconfigure = TRUE;
if (avdtp_close(session, sep->stream, FALSE) < 0) {
@@ -2184,7 +2178,7 @@ unsigned int a2dp_resume(struct avdtp *session, struct a2dp_sep *sep,
if (sep->suspending)
setup->start = TRUE;
else
- g_idle_add((GSourceFunc) finalize_resume, setup);
+ g_idle_add(finalize_resume, setup);
break;
default:
error("SEP in bad state for resume");
@@ -2221,7 +2215,7 @@ unsigned int a2dp_suspend(struct avdtp *session, struct a2dp_sep *sep,
goto failed;
break;
case AVDTP_STATE_OPEN:
- g_idle_add((GSourceFunc) finalize_suspend, setup);
+ g_idle_add(finalize_suspend, setup);
break;
case AVDTP_STATE_STREAMING:
if (avdtp_suspend(session, sep->stream) < 0) {
--
1.7.1
^ permalink raw reply related
* [PATCH 1/3] Fix handling of suspend response
From: Luiz Augusto von Dentz @ 2011-04-04 9:00 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>
finalize_suspend is being called twice when a resume request is queue
after it or if start fails.
---
audio/a2dp.c | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/audio/a2dp.c b/audio/a2dp.c
index 9d9c61d..1208ad1 100644
--- a/audio/a2dp.c
+++ b/audio/a2dp.c
@@ -1011,6 +1011,7 @@ static void suspend_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
struct a2dp_sep *a2dp_sep = user_data;
struct a2dp_setup *setup;
gboolean start;
+ int perr;
if (a2dp_sep->type == AVDTP_SEP_TYPE_SINK)
DBG("Sink %p: Suspend_Cfm", sep);
@@ -1029,23 +1030,22 @@ static void suspend_cfm(struct avdtp *session, struct avdtp_local_sep *sep,
if (err) {
setup->stream = NULL;
setup->err = err;
- finalize_suspend(setup);
}
- else
- finalize_suspend_errno(setup, 0);
+
+ finalize_suspend(setup);
if (!start)
return;
if (err) {
- setup->err = err;
- finalize_suspend(setup);
- } else if (avdtp_start(session, a2dp_sep->stream) < 0) {
- struct avdtp_error start_err;
- error("avdtp_start failed");
- avdtp_error_init(&start_err, AVDTP_ERRNO, EIO);
- setup->err = err;
- finalize_suspend(setup);
+ finalize_resume(setup);
+ return;
+ }
+
+ perr = avdtp_start(session, a2dp_sep->stream);
+ if (perr < 0) {
+ error("Error on avdtp_start %s (%d)", strerror(-perr), -perr);
+ finalize_resume_errno(setup, perr);
}
}
--
1.7.1
^ permalink raw reply related
* RE: Question about supported profiles
From: Ferraton, Jean RegisX @ 2011-04-04 8:32 UTC (permalink / raw)
To: Arun K. Singh; +Cc: linux-bluetooth@vger.kernel.org
In-Reply-To: <AANLkTim3NBH2dB=EF2pZDEoj+77Gv+k3JKvqSwc=6sFk@mail.gmail.com>
SGkgQXJ1biwNCg0KPiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiBGcm9tOiBBcnVuIEsu
IFNpbmdoIFttYWlsdG86YXJ1bmthdEBnbWFpbC5jb21dDQo+IFNlbnQ6IEZyaWRheSwgQXByaWwg
MDEsIDIwMTEgNzowNiBQTQ0KPiBUbzogRmVycmF0b24sIEplYW4gUmVnaXNYDQo+IENjOiBsaW51
eC1ibHVldG9vdGhAdmdlci5rZXJuZWwub3JnDQo+IFN1YmplY3Q6IFJlOiBRdWVzdGlvbiBhYm91
dCBzdXBwb3J0ZWQgcHJvZmlsZXMNCj4gDQo+IEhpIEplYW4sDQo+IA0KPiA+IEkgaGF2ZSBhIHF1
ZXN0aW9uIGFib3V0IHN1cHBvcnRlZCBwcm9maWxlcyB1bmRlciBsaW51eC1ibHVlei4NCj4gPiBX
aGVyZSBhbmQgaG93IGFyZSBkZWZpbmVkIHRoZSBkZWZhdWx0IHN1cHBvcnRlZCBwcm9maWxlcz8g
SXMgaXQgYSBjb25mDQo+IGZpbGU/DQo+ID4gSW4gb3VyIGNhc2UsIGJ5IGRlZmF1bHQgd2Ugc3Vw
cG9ydCBIRlAsIEEyRFAsIE9QUCwgQVZSQ1AuLi4NCj4gPiBCdXQgaWYgd2Ugd2FudCB0byB1c2Ug
RlRQIG9yIERVTiwgd2UgaGF2ZSB0byBlbnRlciAic2RwdG9vbCBhZGQgRFVOIiBvcg0KPiAiIHNk
cHRvb2wgYWRkIEZUUCINCj4gPiBDYW4gYW55b25lIHRlbGwgbWUgaG93IHRvIGNoYW5nZSB0aGUg
ZGVmYXVsdCBwYXJhbXM/DQo+IA0KPiBGaXJzdCBvZiBhbGwgaXRzIG5vdCBjbGVhciB3aGF0IGV4
YWN0bHkgYXJlIHlvdSBsb29raW5nIGZvcj8gaW4gY2FzZQ0KPiB5b3UgbmVlZCB0byBrbm93IHdo
aWNoIGFsbCBwcm9maWxlcyBhcmUgc3VwcG9ydGVkIGluIGJsdWV6LA0KPiAuL2NvbmZpZ3VyZSAt
LWhlbHAgc2hvdWxkIGhlbHAhIE1vc3Qgb2YgdGhlIHByb2ZpbGVzIGFyZSBpbXBsZW1lbnRlZA0K
PiBhcyBwbHVnaW5zIHRvIGVpdGhlciBibHVldG9vdGhkIG9yIG9iZXhkLg0KPiBGZXcgb2YgdGhl
IHByb2ZpbGVzIGFyZSBhbHNvIHN1cHBvcnRlZCB2aWEgZGFlbW9ucy4gQWxsIGRhdGEgcHJvZmls
ZXMsDQo+IHN1Y2ggYXMgRlRQL09QUC9QQkFQIHRoZXkgYXJlIHN1cHBvcnRlZCBhcyBvYmV4IHBs
dWdpbnMuDQo+IGhvcGUgdGhpcyBoZWxwcy4NCj4gDQo+IHRoYW5rcywNCj4gQXJ1bg0KDQpUbyBj
bGFyaWZ5IG15IHF1ZXN0aW9uLCBJIHdhbnQgdG8ga25vdyB3aGVyZSBpcyBzdG9yZWQgdGhlIGlu
Zm9ybWF0aW9uIG9mIHByb2ZpbGVzIHN1cHBvcnRlZCBieSBvdXIgZGV2aWNlIHdoZW4gd2UgbGF1
bmNoIHRoZSBjb21tYW5kICJzZHB0b29sIGJyb3dzZSBCREFERFIiIGZyb20gYW4gZXh0ZXJuYWwg
ZGV2aWNlLiBUaGlzIGNvbW1hbmQgZ2l2ZXMgdXMgb3VyIHBsYXRmb3JtIGRlZmF1bHQgc3VwcG9y
dGVkIHByb2ZpbGVzLg0KSWYgSSBsYXVuY2ggYWRkaXRpb25hbCBjb21tYW5kcyBsaWtlICJzZHB0
b29sIGFkZCBEVU4iIG9yICIgc2RwdG9vbCBhZGQgRlRQIiwgbXkgcGxhdGZvcm0gaXMgc2VlbiBh
cyBzdXBwb3J0aW5nIG1vcmUgcHJvZmlsZXMuDQpXaGVyZSBhbmQgaG93IGNhbiBJIG1vZGlmeSB0
aGlzIGRlZmF1bHQgcHJvZmlsZSBsaXN0Pw0KVGhhbmtzDQpSZWdhcmRzDQpKZWFuDQotLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0KSW50ZWwgQ29ycG9yYXRpb24gU0FTIChGcmVuY2ggc2ltcGxpZmllZCBqb2ludCBzdG9j
ayBjb21wYW55KQpSZWdpc3RlcmVkIGhlYWRxdWFydGVyczogIkxlcyBNb250YWxldHMiLSAyLCBy
dWUgZGUgUGFyaXMsIAo5MjE5NiBNZXVkb24gQ2VkZXgsIEZyYW5jZQpSZWdpc3RyYXRpb24gTnVt
YmVyOiAgMzAyIDQ1NiAxOTkgUi5DLlMuIE5BTlRFUlJFCkNhcGl0YWw6IDQsNTcyLDAwMCBFdXJv
cwoKVGhpcyBlLW1haWwgYW5kIGFueSBhdHRhY2htZW50cyBtYXkgY29udGFpbiBjb25maWRlbnRp
YWwgbWF0ZXJpYWwgZm9yCnRoZSBzb2xlIHVzZSBvZiB0aGUgaW50ZW5kZWQgcmVjaXBpZW50KHMp
LiBBbnkgcmV2aWV3IG9yIGRpc3RyaWJ1dGlvbgpieSBvdGhlcnMgaXMgc3RyaWN0bHkgcHJvaGli
aXRlZC4gSWYgeW91IGFyZSBub3QgdGhlIGludGVuZGVkCnJlY2lwaWVudCwgcGxlYXNlIGNvbnRh
Y3QgdGhlIHNlbmRlciBhbmQgZGVsZXRlIGFsbCBjb3BpZXMuCg==
^ permalink raw reply
* RE: [PATCH] linux-firmware: Add patch and sysconfig files
From: Jothikumar Mothilal @ 2011-04-04 6:58 UTC (permalink / raw)
To: Jothikumar Mothilal, dwmw2@infradead.org
Cc: linux-bluetooth@vger.kernel.org, Shanmugamkamatchi Balashanmugam
In-Reply-To: <1301649288-3315-1-git-send-email-jkumar@atheros.com>
Hi David,
-----Original Message-----
From: Jothikumar Mothilal
Sent: Friday, April 01, 2011 2:45 PM
To: dwmw2@infradead.org
Cc: linux-bluetooth@vger.kernel.org; Shanmugamkamatchi Balashanmugam; Jothikumar Mothilal
>Subject: [PATCH] linux-firmware: Add patch and sysconfig files
>Added files for AR3012 version 2.2
>Signed-off-by: Jothikumar Mothilal <jkumar@atheros.com>
>---
> WHENCE | 2 ++
> ar3k/AthrBT_0x01020200.dfu | Bin 0 -> 40596 bytes
> ar3k/ramps_0x01020200_26.dfu | Bin 0 -> 1262 bytes
> 3 files changed, 2 insertions(+), 0 deletions(-)
> create mode 100644 ar3k/AthrBT_0x01020200.dfu
>create mode 100644 ar3k/ramps_0x01020200_26.dfu
>diff --git a/WHENCE b/WHENCE
>index 6632b85..f6a0ec1 100644
>--- a/WHENCE
>+++ b/WHENCE
>@@ -1555,6 +1555,8 @@ Driver: DFU Driver for Atheros bluetooth chipset AR3012
> File: ar3k/AthrBT_0x01020001.dfu
> File: ar3k/ramps_0x01020001_26.dfu
>+File: ar3k/AthrBT_0x01020200.dfu
>+File: ar3k/ramps_0x01020200_26.dfu
>Licence: Redistributable. See LICENCE.atheros_firmware for details
>diff --git a/ar3k/AthrBT_0x01020200.dfu b/ar3k/AthrBT_0x01020200.dfu
>new file mode 100644
> literal 0
>HcmV?d00001
> --
> 1.6.3.3
Can you please push this firmware patch upstream if you have no comments.
Thanks,
Jothi
^ permalink raw reply
* [GSoC] about "Improve A2DP support"
From: Vincent Medivh @ 2011-04-04 1:24 UTC (permalink / raw)
To: linux-bluetooth
Hi
I am interested in the idea "Improve A2DP support". I knew a little
knowledge of Bluetooth. After some "googling", I still have some
confusion about "Improve support for Sink role and coexistence with
HFP gateway role. " Does it mean while I am using the Bluetooth kit as
the speaker of some mp3 player, still I can use the kit to make a
phone call via Bluetooth HFP?
I also have a question that I now have a USB Bluetooth dongle, a iPod
touch and a cellphone(Nokia 6120c), are those things enough to build
the test environment?
I have a little experience of Linux multimedia programming (a mp3
player program on ARM development board). I am good at C and have some
experience of hacking Linux kernel. I think I am also a fast learner.
Am I qualified to the Google Summer of Code project?
Recently I am reading the the code of the BlueZ and the Bluetooth
specification, but I still don't get the full understanding of the
structure of BlueZ. Could someone guide me about which I should focus
on to implement the idea? I am also writing the proposal,but have no
ideas about the project milestones. I will be grateful if someone
could give some suggestions.
Here is more information about me, the answers to the questions.
https://docs.google.com/document/d/1HmDybIBT9GMNaByLy8EpW0RwzLcMtyrHuCPA54NHl5I/edit?hl=en
^ permalink raw reply
* [PATCH 3/3] Support hardcoded Nintendo Wii Remote pins
From: David Herrmann @ 2011-04-02 19:51 UTC (permalink / raw)
To: linux-bluetooth; +Cc: hadess, marcel, David Herrmann
In-Reply-To: <1301773863-16297-1-git-send-email-dh.herrmann@googlemail.com>
The Nintendo Wii Remote requires the destination bluetooth address
as pincode. This changes the pin handling by skipping the agent
module and sending an hardcoded pin if the target device is a
Nintendo Wii Remote.
---
src/event.c | 20 +++++++++++++++++++-
1 files changed, 19 insertions(+), 1 deletions(-)
diff --git a/src/event.c b/src/event.c
index 91343d4..ec05e95 100644
--- a/src/event.c
+++ b/src/event.c
@@ -129,6 +129,24 @@ fail:
error("Sending PIN code reply failed: %s (%d)", strerror(-err), -err);
}
+static int get_pin(bdaddr_t *sba, bdaddr_t *dba, char *pinbuf)
+{
+ uint16_t vendor, product;
+ char src_addr[18], dst_addr[18];
+
+ ba2str(sba, src_addr);
+ ba2str(dba, dst_addr);
+ if (0 == read_device_id(src_addr, dst_addr, NULL, &vendor, &product, NULL)) {
+ /* Nintendo Wii Remote uses destination address as PIN */
+ if (vendor == 0x057e && product == 0x0306) {
+ memcpy(pinbuf, dba, 6);
+ return 6;
+ }
+ }
+
+ return read_pin_code(sba, dba, pinbuf);
+}
+
int btd_event_request_pin(bdaddr_t *sba, bdaddr_t *dba)
{
struct btd_adapter *adapter;
@@ -140,7 +158,7 @@ int btd_event_request_pin(bdaddr_t *sba, bdaddr_t *dba)
return -ENODEV;
memset(pin, 0, sizeof(pin));
- pinlen = read_pin_code(sba, dba, pin);
+ pinlen = get_pin(sba, dba, pin);
if (pinlen > 0) {
btd_adapter_pincode_reply(adapter, dba, pin, pinlen);
return 0;
--
1.7.4.2
^ permalink raw reply related
* [PATCH 2/3] Make adapter API accept binary pincodes
From: David Herrmann @ 2011-04-02 19:51 UTC (permalink / raw)
To: linux-bluetooth; +Cc: hadess, marcel, David Herrmann
In-Reply-To: <1301773863-16297-1-git-send-email-dh.herrmann@googlemail.com>
Add pin-length argument to adapter API to allow passing binary pins
containing \0 characters to the hci handler.
---
src/adapter.c | 4 ++--
src/adapter.h | 2 +-
src/event.c | 6 +++---
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/adapter.c b/src/adapter.c
index 83f3217..14516ac 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -3701,9 +3701,9 @@ int btd_adapter_remove_bonding(struct btd_adapter *adapter, bdaddr_t *bdaddr)
}
int btd_adapter_pincode_reply(struct btd_adapter *adapter, bdaddr_t *bdaddr,
- const char *pin)
+ const char *pin, size_t pinlen)
{
- return adapter_ops->pincode_reply(adapter->dev_id, bdaddr, pin, pin ? strlen(pin) : 0);
+ return adapter_ops->pincode_reply(adapter->dev_id, bdaddr, pin, pinlen);
}
int btd_adapter_confirm_reply(struct btd_adapter *adapter, bdaddr_t *bdaddr,
diff --git a/src/adapter.h b/src/adapter.h
index fd2fc12..b507506 100644
--- a/src/adapter.h
+++ b/src/adapter.h
@@ -273,7 +273,7 @@ int btd_adapter_disconnect_device(struct btd_adapter *adapter,
int btd_adapter_remove_bonding(struct btd_adapter *adapter, bdaddr_t *bdaddr);
int btd_adapter_pincode_reply(struct btd_adapter *adapter, bdaddr_t *bdaddr,
- const char *pin);
+ const char *pin, size_t pinlen);
int btd_adapter_confirm_reply(struct btd_adapter *adapter, bdaddr_t *bdaddr,
gboolean success);
int btd_adapter_passkey_reply(struct btd_adapter *adapter, bdaddr_t *bdaddr,
diff --git a/src/event.c b/src/event.c
index 4ca1be5..91343d4 100644
--- a/src/event.c
+++ b/src/event.c
@@ -111,13 +111,13 @@ static void pincode_cb(struct agent *agent, DBusError *derr,
device_get_address(device, &dba);
if (derr) {
- err = btd_adapter_pincode_reply(adapter, &dba, NULL);
+ err = btd_adapter_pincode_reply(adapter, &dba, NULL, 0);
if (err < 0)
goto fail;
return;
}
- err = btd_adapter_pincode_reply(adapter, &dba, pincode);
+ err = btd_adapter_pincode_reply(adapter, &dba, pincode, pincode ? strlen(pincode) : 0);
if (err < 0)
goto fail;
@@ -142,7 +142,7 @@ int btd_event_request_pin(bdaddr_t *sba, bdaddr_t *dba)
memset(pin, 0, sizeof(pin));
pinlen = read_pin_code(sba, dba, pin);
if (pinlen > 0) {
- btd_adapter_pincode_reply(adapter, dba, pin);
+ btd_adapter_pincode_reply(adapter, dba, pin, pinlen);
return 0;
}
--
1.7.4.2
^ permalink raw reply related
* [PATCH 1/3] Add length argument to hci pincode reply
From: David Herrmann @ 2011-04-02 19:51 UTC (permalink / raw)
To: linux-bluetooth; +Cc: hadess, marcel, David Herrmann
In-Reply-To: <1301773863-16297-1-git-send-email-dh.herrmann@googlemail.com>
This adds a new "length" argument to the hci pincode reply to allow
sending binary pins including \0 characters.
---
plugins/hciops.c | 9 ++++-----
plugins/mgmtops.c | 14 ++++++--------
src/adapter.c | 2 +-
src/adapter.h | 2 +-
4 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/plugins/hciops.c b/plugins/hciops.c
index 93f6f21..afac330 100644
--- a/plugins/hciops.c
+++ b/plugins/hciops.c
@@ -3296,7 +3296,7 @@ static int hciops_remove_bonding(int index, bdaddr_t *bdaddr)
return 0;
}
-static int hciops_pincode_reply(int index, bdaddr_t *bdaddr, const char *pin)
+static int hciops_pincode_reply(int index, bdaddr_t *bdaddr, const char *pin, size_t pinlen)
{
struct dev_info *dev = &devs[index];
char addr[18];
@@ -3307,14 +3307,13 @@ static int hciops_pincode_reply(int index, bdaddr_t *bdaddr, const char *pin)
if (pin) {
pin_code_reply_cp pr;
- size_t len = strlen(pin);
- dev->pin_length = len;
+ dev->pin_length = pinlen;
memset(&pr, 0, sizeof(pr));
bacpy(&pr.bdaddr, bdaddr);
- memcpy(pr.pin_code, pin, len);
- pr.pin_len = len;
+ memcpy(pr.pin_code, pin, pinlen);
+ pr.pin_len = pinlen;
err = hci_send_cmd(dev->sk, OGF_LINK_CTL,
OCF_PIN_CODE_REPLY,
PIN_CODE_REPLY_CP_SIZE, &pr);
diff --git a/plugins/mgmtops.c b/plugins/mgmtops.c
index 042afc5..d03a29d 100644
--- a/plugins/mgmtops.c
+++ b/plugins/mgmtops.c
@@ -493,7 +493,7 @@ static void mgmt_connect_failed(int sk, uint16_t index, void *buf, size_t len)
btd_event_bonding_complete(&info->bdaddr, &ev->bdaddr, ev->status);
}
-static int mgmt_pincode_reply(int index, bdaddr_t *bdaddr, const char *pin)
+static int mgmt_pincode_reply(int index, bdaddr_t *bdaddr, const char *pin, size_t pinlen)
{
char buf[MGMT_HDR_SIZE + sizeof(struct mgmt_cp_pin_code_reply)];
struct mgmt_hdr *hdr = (void *) buf;
@@ -501,7 +501,7 @@ static int mgmt_pincode_reply(int index, bdaddr_t *bdaddr, const char *pin)
char addr[18];
ba2str(bdaddr, addr);
- DBG("index %d addr %s pin %s", index, addr, pin ? pin : "<none>");
+ DBG("index %d addr %s pinlen %lu", index, addr, pinlen);
memset(buf, 0, sizeof(buf));
@@ -518,10 +518,8 @@ static int mgmt_pincode_reply(int index, bdaddr_t *bdaddr, const char *pin)
buf_len = sizeof(*hdr) + sizeof(*cp);
} else {
struct mgmt_cp_pin_code_reply *cp;
- size_t pin_len;
- pin_len = strlen(pin);
- if (pin_len > 16)
+ if (pinlen > 16)
return -EINVAL;
hdr->opcode = htobs(MGMT_OP_PIN_CODE_REPLY);
@@ -530,8 +528,8 @@ static int mgmt_pincode_reply(int index, bdaddr_t *bdaddr, const char *pin)
cp = (void *) &buf[sizeof(*hdr)];
bacpy(&cp->bdaddr, bdaddr);
- cp->pin_len = pin_len;
- memcpy(cp->pin_code, pin, pin_len);
+ cp->pin_len = pinlen;
+ memcpy(cp->pin_code, pin, pinlen);
buf_len = sizeof(*hdr) + sizeof(*cp);
}
@@ -568,7 +566,7 @@ static void mgmt_pin_code_request(int sk, uint16_t index, void *buf, size_t len)
err = btd_event_request_pin(&info->bdaddr, &ev->bdaddr);
if (err < 0) {
error("btd_event_request_pin: %s", strerror(-err));
- mgmt_pincode_reply(index, &ev->bdaddr, NULL);
+ mgmt_pincode_reply(index, &ev->bdaddr, NULL, 0);
}
}
diff --git a/src/adapter.c b/src/adapter.c
index c400bfd..83f3217 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -3703,7 +3703,7 @@ int btd_adapter_remove_bonding(struct btd_adapter *adapter, bdaddr_t *bdaddr)
int btd_adapter_pincode_reply(struct btd_adapter *adapter, bdaddr_t *bdaddr,
const char *pin)
{
- return adapter_ops->pincode_reply(adapter->dev_id, bdaddr, pin);
+ return adapter_ops->pincode_reply(adapter->dev_id, bdaddr, pin, pin ? strlen(pin) : 0);
}
int btd_adapter_confirm_reply(struct btd_adapter *adapter, bdaddr_t *bdaddr,
diff --git a/src/adapter.h b/src/adapter.h
index 308af75..fd2fc12 100644
--- a/src/adapter.h
+++ b/src/adapter.h
@@ -221,7 +221,7 @@ struct btd_adapter_ops {
int (*read_local_features) (int index, uint8_t *features);
int (*disconnect) (int index, bdaddr_t *bdaddr);
int (*remove_bonding) (int index, bdaddr_t *bdaddr);
- int (*pincode_reply) (int index, bdaddr_t *bdaddr, const char *pin);
+ int (*pincode_reply) (int index, bdaddr_t *bdaddr, const char *pin, size_t pinlen);
int (*confirm_reply) (int index, bdaddr_t *bdaddr, gboolean success);
int (*passkey_reply) (int index, bdaddr_t *bdaddr, uint32_t passkey);
int (*enable_le) (int index);
--
1.7.4.2
^ permalink raw reply related
* [PATCH 0/3] Support binary pin codes
From: David Herrmann @ 2011-04-02 19:51 UTC (permalink / raw)
To: linux-bluetooth; +Cc: hadess, marcel, David Herrmann
This patch series allows passing binary bluetooth PINs to the hci handlers
by adding a pin_len argument. This is required to support devices which
require binary PINs like the Nintendo Wii Remote.
This patch series also adds Nintendo Wii Remote pairing support by hardcoding
the PIN. This was discussed earlier in:
http://thread.gmane.org/gmane.linux.bluez.kernel/3961
Marcel suggested automatic pairing inside the daemon by VID/PID detection
and this patch implements this approach. See:
http://thread.gmane.org/gmane.linux.bluez.kernel/3964
Regards
David
^ 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