Re: [PATCH 1/2] Bluetooth: Add Fixed Channels support to bind syscall.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 12, 2010 at 6:19 PM, Gustavo F. Padovan <gustavo@xxxxxxxxxxx> wrote:
> diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
> index 449cbdd..39f047b 100644
> --- a/net/bluetooth/l2cap.c
> +++ b/net/bluetooth/l2cap.c
> @@ -726,7 +726,7 @@ static inline void l2cap_chan_add(struct l2cap_conn *conn, struct sock *sk, stru
>  }
>
>  /* ---- Socket interface ---- */
> -static struct sock *__l2cap_get_sock_by_addr(__le16 psm, bdaddr_t *src)
> +static struct sock *__l2cap_sock_by_psm_addr(__le16 psm, bdaddr_t *src)
>  {
>        struct sock *sk;
>        struct hlist_node *node;
> @@ -738,6 +738,16 @@ found:
>        return sk;
>  }
>
> +static struct sock *__l2cap_sock_by_cid_addr(__le16 cid, bdaddr_t *src)
> +{
> +       struct sock *sk;
> +       struct hlist_node *node;
> +       sk_for_each(sk, node, &l2cap_sk_list.head)
> +               if (l2cap_pi(sk)->scid == cid && !bacmp(&bt_sk(sk)->src, src))
> +                       return sk;
> +       return NULL;
> +}
> +

If sk->sport is always filled with either cid or psm , why not have
just a single "__l2cap_sock_addr"  function ?

Regads,
-- 
Anderson Lizardo
OpenBossa Labs - INdT
Manaus - Brazil
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux