* Re: Pull request git://gitorious.org/~vudentz/bluez/vudentzs-clone.git for-upstream
From: Johan Hedberg @ 2011-01-19 15:06 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
In-Reply-To: <AANLkTikmELbxWrZkTe_9UcK0q01cwJoQsmFkMzppsEtV@mail.gmail.com>
Hi Luiz,
On Wed, Jan 19, 2011, Luiz Augusto von Dentz wrote:
> The following changes since commit effe770cd43cf53fa5842291941dbfc82beab645:
>
> Use -DG_DISABLE_DEPRECATED compiler define (2011-01-18 14:56:31 +0100)
>
> are available in the git repository at:
> git://gitorious.org/~vudentz/bluez/vudentzs-clone.git for-upstream
>
> Luiz Augusto von Dentz (7):
> Fix use of deprecated glib on audio plugin
> Fix use of deprecated glib on input plugin
> Fix use of deprecated glib on network plugin
> Fix use of deprecated glib on serial plugin
> Fix use of deprecated glib on hciops plugin
> Fix use of deprecated glib on core
> Fix use of deprecated glib on tests
>
> audio/avdtp.c | 10 ++-
> audio/gstavdtpsink.c | 162 +++++++++++++++++++++++++-------------------------
> audio/headset.c | 13 +++--
> audio/unix.c | 2 +-
> input/device.c | 12 +++-
> input/fakehid.c | 10 ++-
> network/connection.c | 14 ++--
> plugins/hciops.c | 24 ++++---
> serial/proxy.c | 40 ++++++------
> src/rfkill.c | 11 ++--
> src/storage.c | 2 +-
> test/hciemu.c | 15 +++--
> 12 files changed, 168 insertions(+), 147 deletions(-)
All patches have been pushed upstream. Thanks.
Johan
^ permalink raw reply
* Re: [Patch] Kill off warning: ‘inline’ is not at beginning of declaration
From: Mauro Carvalho Chehab @ 2011-01-19 14:49 UTC (permalink / raw)
To: Jiri Kosina
Cc: Jesper Juhl, linux-kernel, alsa-devel, linux-wireless, netdev,
ocfs2-devel, linux-edac, linux-bluetooth, oprofile-list,
Andi Kleen, David Teigland, Jens Axboe, Stephen Hemminger,
Greg Kroah-Hartman, Takashi Iwai, Jaroslav Kysela,
John W. Linville, Johannes Berg, Patrick McHardy,
Hideaki YOSHIFUJI, James Morris, Pekka Savola (ipv6),
Alexey Kuznetsov, David S. Miller, Frederic Weisbecker,
Joel Becker, Mark Fasheh, Gustavo F. Padovan, Marcel Holtmann,
x86, H. Peter Anvin, Ingo Molnar, Thomas Gleixner, Robert Richter
In-Reply-To: <alpine.LNX.2.00.1101191543110.26685@pobox.suse.cz>
Em 19-01-2011 12:44, Jiri Kosina escreveu:
> On Mon, 17 Jan 2011, Jesper Juhl wrote:
>
>> Fix a bunch of
>> warning: ‘inline’ is not at beginning of declaration
>> messages when building a 'make allyesconfig' kernel with -Wextra.
>>
>> These warnings are trivial to kill, yet rather annoying when building with
>> -Wextra.
>> The more we can cut down on pointless crap like this the better (IMHO).
>>
>> A previous patch to do this for a 'allnoconfig' build has already been
>> merged. This just takes the cleanup a little further.
>>
>> Signed-off-by: Jesper Juhl <jj@chaosbits.net>
>> ---
>> arch/x86/oprofile/op_model_p4.c | 2 +-
>> drivers/bluetooth/btusb.c | 4 ++--
>> drivers/cpuidle/sysfs.c | 2 +-
>> drivers/edac/i7300_edac.c | 2 +-
For the i7300_edac driver:
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
>> fs/ocfs2/dir.c | 2 +-
>> kernel/trace/ring_buffer.c | 2 +-
>> net/ipv6/inet6_hashtables.c | 2 +-
>> net/mac80211/tx.c | 2 +-
>> sound/pci/au88x0/au88x0.h | 4 ++--
>> sound/pci/au88x0/au88x0_core.c | 4 ++--
>> 10 files changed, 13 insertions(+), 13 deletions(-)
>>
>> diff --git a/arch/x86/oprofile/op_model_p4.c b/arch/x86/oprofile/op_model_p4.c
>> index 9fadec0..98ab130 100644
>> --- a/arch/x86/oprofile/op_model_p4.c
>> +++ b/arch/x86/oprofile/op_model_p4.c
>> @@ -50,7 +50,7 @@ static inline void setup_num_counters(void)
>> #endif
>> }
>>
>> -static int inline addr_increment(void)
>> +static inline int addr_increment(void)
>> {
>> #ifdef CONFIG_SMP
>> return smp_num_siblings == 2 ? 2 : 1;
>> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
>> index 1da773f..92d29bf 100644
>> --- a/drivers/bluetooth/btusb.c
>> +++ b/drivers/bluetooth/btusb.c
>> @@ -424,7 +424,7 @@ static void btusb_isoc_complete(struct urb *urb)
>> }
>> }
>>
>> -static void inline __fill_isoc_descriptor(struct urb *urb, int len, int mtu)
>> +static inline void __fill_isoc_descriptor(struct urb *urb, int len, int mtu)
>> {
>> int i, offset = 0;
>>
>> @@ -775,7 +775,7 @@ static void btusb_notify(struct hci_dev *hdev, unsigned int evt)
>> }
>> }
>>
>> -static int inline __set_isoc_interface(struct hci_dev *hdev, int altsetting)
>> +static inline int __set_isoc_interface(struct hci_dev *hdev, int altsetting)
>> {
>> struct btusb_data *data = hdev->driver_data;
>> struct usb_interface *intf = data->isoc;
>> diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c
>> index 0310ffa..be7917ec 100644
>> --- a/drivers/cpuidle/sysfs.c
>> +++ b/drivers/cpuidle/sysfs.c
>> @@ -300,7 +300,7 @@ static struct kobj_type ktype_state_cpuidle = {
>> .release = cpuidle_state_sysfs_release,
>> };
>>
>> -static void inline cpuidle_free_state_kobj(struct cpuidle_device *device, int i)
>> +static inline void cpuidle_free_state_kobj(struct cpuidle_device *device, int i)
>> {
>> kobject_put(&device->kobjs[i]->kobj);
>> wait_for_completion(&device->kobjs[i]->kobj_unregister);
>> diff --git a/drivers/edac/i7300_edac.c b/drivers/edac/i7300_edac.c
>> index 05523b5..76d1f57 100644
>> --- a/drivers/edac/i7300_edac.c
>> +++ b/drivers/edac/i7300_edac.c
>> @@ -162,7 +162,7 @@ static struct edac_pci_ctl_info *i7300_pci;
>> #define AMBPRESENT_0 0x64
>> #define AMBPRESENT_1 0x66
>>
>> -const static u16 mtr_regs[MAX_SLOTS] = {
>> +static const u16 mtr_regs[MAX_SLOTS] = {
>> 0x80, 0x84, 0x88, 0x8c,
>> 0x82, 0x86, 0x8a, 0x8e
>> };
>> diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c
>> index d417b3f..f97b6f1 100644
>> --- a/fs/ocfs2/dir.c
>> +++ b/fs/ocfs2/dir.c
>> @@ -354,7 +354,7 @@ static inline int ocfs2_match(int len,
>> /*
>> * Returns 0 if not found, -1 on failure, and 1 on success
>> */
>> -static int inline ocfs2_search_dirblock(struct buffer_head *bh,
>> +static inline int ocfs2_search_dirblock(struct buffer_head *bh,
>> struct inode *dir,
>> const char *name, int namelen,
>> unsigned long offset,
>> diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
>> index bd1c35a..6ee56b4 100644
>> --- a/kernel/trace/ring_buffer.c
>> +++ b/kernel/trace/ring_buffer.c
>> @@ -669,7 +669,7 @@ static struct list_head *rb_list_head(struct list_head *list)
>> * the reader page). But if the next page is a header page,
>> * its flags will be non zero.
>> */
>> -static int inline
>> +static inline int
>> rb_is_head_page(struct ring_buffer_per_cpu *cpu_buffer,
>> struct buffer_page *page, struct list_head *list)
>> {
>> diff --git a/net/ipv6/inet6_hashtables.c b/net/ipv6/inet6_hashtables.c
>> index 633a6c2..b531972 100644
>> --- a/net/ipv6/inet6_hashtables.c
>> +++ b/net/ipv6/inet6_hashtables.c
>> @@ -124,7 +124,7 @@ out:
>> }
>> EXPORT_SYMBOL(__inet6_lookup_established);
>>
>> -static int inline compute_score(struct sock *sk, struct net *net,
>> +static inline int compute_score(struct sock *sk, struct net *net,
>> const unsigned short hnum,
>> const struct in6_addr *daddr,
>> const int dif)
>> diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
>> index 5950e3a..a449dd5 100644
>> --- a/net/mac80211/tx.c
>> +++ b/net/mac80211/tx.c
>> @@ -173,7 +173,7 @@ static __le16 ieee80211_duration(struct ieee80211_tx_data *tx, int group_addr,
>> return cpu_to_le16(dur);
>> }
>>
>> -static int inline is_ieee80211_device(struct ieee80211_local *local,
>> +static inline int is_ieee80211_device(struct ieee80211_local *local,
>> struct net_device *dev)
>> {
>> return local == wdev_priv(dev->ieee80211_ptr);
>> diff --git a/sound/pci/au88x0/au88x0.h b/sound/pci/au88x0/au88x0.h
>> index cf46bba..ecb8f4d 100644
>> --- a/sound/pci/au88x0/au88x0.h
>> +++ b/sound/pci/au88x0/au88x0.h
>> @@ -211,7 +211,7 @@ static void vortex_adbdma_startfifo(vortex_t * vortex, int adbdma);
>> //static void vortex_adbdma_stopfifo(vortex_t *vortex, int adbdma);
>> static void vortex_adbdma_pausefifo(vortex_t * vortex, int adbdma);
>> static void vortex_adbdma_resumefifo(vortex_t * vortex, int adbdma);
>> -static int inline vortex_adbdma_getlinearpos(vortex_t * vortex, int adbdma);
>> +static inline int vortex_adbdma_getlinearpos(vortex_t * vortex, int adbdma);
>> static void vortex_adbdma_resetup(vortex_t *vortex, int adbdma);
>>
>> #ifndef CHIP_AU8810
>> @@ -219,7 +219,7 @@ static void vortex_wtdma_startfifo(vortex_t * vortex, int wtdma);
>> static void vortex_wtdma_stopfifo(vortex_t * vortex, int wtdma);
>> static void vortex_wtdma_pausefifo(vortex_t * vortex, int wtdma);
>> static void vortex_wtdma_resumefifo(vortex_t * vortex, int wtdma);
>> -static int inline vortex_wtdma_getlinearpos(vortex_t * vortex, int wtdma);
>> +static inline int vortex_wtdma_getlinearpos(vortex_t * vortex, int wtdma);
>> #endif
>>
>> /* global stuff. */
>> diff --git a/sound/pci/au88x0/au88x0_core.c b/sound/pci/au88x0/au88x0_core.c
>> index 23f49f3..d43252a 100644
>> --- a/sound/pci/au88x0/au88x0_core.c
>> +++ b/sound/pci/au88x0/au88x0_core.c
>> @@ -1249,7 +1249,7 @@ static void vortex_adbdma_resetup(vortex_t *vortex, int adbdma) {
>> }
>> }
>>
>> -static int inline vortex_adbdma_getlinearpos(vortex_t * vortex, int adbdma)
>> +static inline int vortex_adbdma_getlinearpos(vortex_t * vortex, int adbdma)
>> {
>> stream_t *dma = &vortex->dma_adb[adbdma];
>> int temp;
>> @@ -1498,7 +1498,7 @@ static int vortex_wtdma_getcursubuffer(vortex_t * vortex, int wtdma)
>> POS_SHIFT) & POS_MASK);
>> }
>> #endif
>> -static int inline vortex_wtdma_getlinearpos(vortex_t * vortex, int wtdma)
>> +static inline int vortex_wtdma_getlinearpos(vortex_t * vortex, int wtdma)
>> {
>> stream_t *dma = &vortex->dma_wt[wtdma];
>> int temp;
>
> Wow, what a huge CC list for such a simple change. Jesper, I think you
> should re-consider this next time. I bet you used get_maintainer script,
> didn't you? :)
>
> I have applied it to my tree now. If anyone has objections/has already
> applied part of the patch to subsystem tree, please let me know.
>
> Thanks,
>
^ permalink raw reply
* Re: [Patch] Kill off warning: ‘inline’ is not at beginning of declaration
From: Jiri Kosina @ 2011-01-19 14:44 UTC (permalink / raw)
To: Jesper Juhl
Cc: linux-kernel, alsa-devel, linux-wireless, netdev, ocfs2-devel,
linux-edac, linux-bluetooth, oprofile-list, Andi Kleen,
David Teigland, Jens Axboe, Stephen Hemminger, Greg Kroah-Hartman,
Takashi Iwai, Jaroslav Kysela, John W. Linville, Johannes Berg,
Patrick McHardy, Hideaki YOSHIFUJI, James Morris,
Pekka Savola (ipv6), Alexey Kuznetsov, David S. Miller,
Frederic Weisbecker, Frederic Weisbecker, Joel Becker,
Mark Fasheh, Mauro Carvalho Chehab, Gustavo F. Padovan,
Marcel Holtmann, x86, H. Peter Anvin, Ingo Molnar,
Thomas Gleixner, Robert Richter
In-Reply-To: <alpine.LNX.2.00.1101170000270.13377@swampdragon.chaosbits.net>
On Mon, 17 Jan 2011, Jesper Juhl wrote:
> Fix a bunch of
> warning: ‘inline’ is not at beginning of declaration
> messages when building a 'make allyesconfig' kernel with -Wextra.
>
> These warnings are trivial to kill, yet rather annoying when building with
> -Wextra.
> The more we can cut down on pointless crap like this the better (IMHO).
>
> A previous patch to do this for a 'allnoconfig' build has already been
> merged. This just takes the cleanup a little further.
>
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>
> ---
> arch/x86/oprofile/op_model_p4.c | 2 +-
> drivers/bluetooth/btusb.c | 4 ++--
> drivers/cpuidle/sysfs.c | 2 +-
> drivers/edac/i7300_edac.c | 2 +-
> fs/ocfs2/dir.c | 2 +-
> kernel/trace/ring_buffer.c | 2 +-
> net/ipv6/inet6_hashtables.c | 2 +-
> net/mac80211/tx.c | 2 +-
> sound/pci/au88x0/au88x0.h | 4 ++--
> sound/pci/au88x0/au88x0_core.c | 4 ++--
> 10 files changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/arch/x86/oprofile/op_model_p4.c b/arch/x86/oprofile/op_model_p4.c
> index 9fadec0..98ab130 100644
> --- a/arch/x86/oprofile/op_model_p4.c
> +++ b/arch/x86/oprofile/op_model_p4.c
> @@ -50,7 +50,7 @@ static inline void setup_num_counters(void)
> #endif
> }
>
> -static int inline addr_increment(void)
> +static inline int addr_increment(void)
> {
> #ifdef CONFIG_SMP
> return smp_num_siblings == 2 ? 2 : 1;
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index 1da773f..92d29bf 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -424,7 +424,7 @@ static void btusb_isoc_complete(struct urb *urb)
> }
> }
>
> -static void inline __fill_isoc_descriptor(struct urb *urb, int len, int mtu)
> +static inline void __fill_isoc_descriptor(struct urb *urb, int len, int mtu)
> {
> int i, offset = 0;
>
> @@ -775,7 +775,7 @@ static void btusb_notify(struct hci_dev *hdev, unsigned int evt)
> }
> }
>
> -static int inline __set_isoc_interface(struct hci_dev *hdev, int altsetting)
> +static inline int __set_isoc_interface(struct hci_dev *hdev, int altsetting)
> {
> struct btusb_data *data = hdev->driver_data;
> struct usb_interface *intf = data->isoc;
> diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c
> index 0310ffa..be7917ec 100644
> --- a/drivers/cpuidle/sysfs.c
> +++ b/drivers/cpuidle/sysfs.c
> @@ -300,7 +300,7 @@ static struct kobj_type ktype_state_cpuidle = {
> .release = cpuidle_state_sysfs_release,
> };
>
> -static void inline cpuidle_free_state_kobj(struct cpuidle_device *device, int i)
> +static inline void cpuidle_free_state_kobj(struct cpuidle_device *device, int i)
> {
> kobject_put(&device->kobjs[i]->kobj);
> wait_for_completion(&device->kobjs[i]->kobj_unregister);
> diff --git a/drivers/edac/i7300_edac.c b/drivers/edac/i7300_edac.c
> index 05523b5..76d1f57 100644
> --- a/drivers/edac/i7300_edac.c
> +++ b/drivers/edac/i7300_edac.c
> @@ -162,7 +162,7 @@ static struct edac_pci_ctl_info *i7300_pci;
> #define AMBPRESENT_0 0x64
> #define AMBPRESENT_1 0x66
>
> -const static u16 mtr_regs[MAX_SLOTS] = {
> +static const u16 mtr_regs[MAX_SLOTS] = {
> 0x80, 0x84, 0x88, 0x8c,
> 0x82, 0x86, 0x8a, 0x8e
> };
> diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c
> index d417b3f..f97b6f1 100644
> --- a/fs/ocfs2/dir.c
> +++ b/fs/ocfs2/dir.c
> @@ -354,7 +354,7 @@ static inline int ocfs2_match(int len,
> /*
> * Returns 0 if not found, -1 on failure, and 1 on success
> */
> -static int inline ocfs2_search_dirblock(struct buffer_head *bh,
> +static inline int ocfs2_search_dirblock(struct buffer_head *bh,
> struct inode *dir,
> const char *name, int namelen,
> unsigned long offset,
> diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
> index bd1c35a..6ee56b4 100644
> --- a/kernel/trace/ring_buffer.c
> +++ b/kernel/trace/ring_buffer.c
> @@ -669,7 +669,7 @@ static struct list_head *rb_list_head(struct list_head *list)
> * the reader page). But if the next page is a header page,
> * its flags will be non zero.
> */
> -static int inline
> +static inline int
> rb_is_head_page(struct ring_buffer_per_cpu *cpu_buffer,
> struct buffer_page *page, struct list_head *list)
> {
> diff --git a/net/ipv6/inet6_hashtables.c b/net/ipv6/inet6_hashtables.c
> index 633a6c2..b531972 100644
> --- a/net/ipv6/inet6_hashtables.c
> +++ b/net/ipv6/inet6_hashtables.c
> @@ -124,7 +124,7 @@ out:
> }
> EXPORT_SYMBOL(__inet6_lookup_established);
>
> -static int inline compute_score(struct sock *sk, struct net *net,
> +static inline int compute_score(struct sock *sk, struct net *net,
> const unsigned short hnum,
> const struct in6_addr *daddr,
> const int dif)
> diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
> index 5950e3a..a449dd5 100644
> --- a/net/mac80211/tx.c
> +++ b/net/mac80211/tx.c
> @@ -173,7 +173,7 @@ static __le16 ieee80211_duration(struct ieee80211_tx_data *tx, int group_addr,
> return cpu_to_le16(dur);
> }
>
> -static int inline is_ieee80211_device(struct ieee80211_local *local,
> +static inline int is_ieee80211_device(struct ieee80211_local *local,
> struct net_device *dev)
> {
> return local == wdev_priv(dev->ieee80211_ptr);
> diff --git a/sound/pci/au88x0/au88x0.h b/sound/pci/au88x0/au88x0.h
> index cf46bba..ecb8f4d 100644
> --- a/sound/pci/au88x0/au88x0.h
> +++ b/sound/pci/au88x0/au88x0.h
> @@ -211,7 +211,7 @@ static void vortex_adbdma_startfifo(vortex_t * vortex, int adbdma);
> //static void vortex_adbdma_stopfifo(vortex_t *vortex, int adbdma);
> static void vortex_adbdma_pausefifo(vortex_t * vortex, int adbdma);
> static void vortex_adbdma_resumefifo(vortex_t * vortex, int adbdma);
> -static int inline vortex_adbdma_getlinearpos(vortex_t * vortex, int adbdma);
> +static inline int vortex_adbdma_getlinearpos(vortex_t * vortex, int adbdma);
> static void vortex_adbdma_resetup(vortex_t *vortex, int adbdma);
>
> #ifndef CHIP_AU8810
> @@ -219,7 +219,7 @@ static void vortex_wtdma_startfifo(vortex_t * vortex, int wtdma);
> static void vortex_wtdma_stopfifo(vortex_t * vortex, int wtdma);
> static void vortex_wtdma_pausefifo(vortex_t * vortex, int wtdma);
> static void vortex_wtdma_resumefifo(vortex_t * vortex, int wtdma);
> -static int inline vortex_wtdma_getlinearpos(vortex_t * vortex, int wtdma);
> +static inline int vortex_wtdma_getlinearpos(vortex_t * vortex, int wtdma);
> #endif
>
> /* global stuff. */
> diff --git a/sound/pci/au88x0/au88x0_core.c b/sound/pci/au88x0/au88x0_core.c
> index 23f49f3..d43252a 100644
> --- a/sound/pci/au88x0/au88x0_core.c
> +++ b/sound/pci/au88x0/au88x0_core.c
> @@ -1249,7 +1249,7 @@ static void vortex_adbdma_resetup(vortex_t *vortex, int adbdma) {
> }
> }
>
> -static int inline vortex_adbdma_getlinearpos(vortex_t * vortex, int adbdma)
> +static inline int vortex_adbdma_getlinearpos(vortex_t * vortex, int adbdma)
> {
> stream_t *dma = &vortex->dma_adb[adbdma];
> int temp;
> @@ -1498,7 +1498,7 @@ static int vortex_wtdma_getcursubuffer(vortex_t * vortex, int wtdma)
> POS_SHIFT) & POS_MASK);
> }
> #endif
> -static int inline vortex_wtdma_getlinearpos(vortex_t * vortex, int wtdma)
> +static inline int vortex_wtdma_getlinearpos(vortex_t * vortex, int wtdma)
> {
> stream_t *dma = &vortex->dma_wt[wtdma];
> int temp;
Wow, what a huge CC list for such a simple change. Jesper, I think you
should re-consider this next time. I bet you used get_maintainer script,
didn't you? :)
I have applied it to my tree now. If anyone has objections/has already
applied part of the patch to subsystem tree, please let me know.
Thanks,
--
Jiri Kosina
SUSE Labs, Novell Inc.
^ permalink raw reply
* [PATCH] Set connection state to BT_DISCONN to avoid multiple responses
From: tim.bao @ 2011-01-19 13:22 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Bao Liang
From: Bao Liang <tim.bao@gmail.com>
This patch fixes a minor issue that two connection responses will be sent
for one L2CAP connection request. If the L2CAP connection request is first
blocked due to security reason and responded with reason "security block",
the state of the connection remains BT_CONNECT2. If a pairing procedure
completes successfully before the ACL connection is down, local host will
send another connection complete response. See the following packets
captured by hcidump.
2010-12-07 22:21:24.928096 < ACL data: handle 12 flags 0x00 dlen 16
0000: 0c 00 01 00 03 19 08 00 41 00 53 00 03 00 00 00 ........A.S.....
... ...
2010-12-07 22:21:35.791747 > HCI Event: Auth Complete (0x06) plen 3
status 0x00 handle 12
... ...
2010-12-07 22:21:35.872372 > ACL data: handle 12 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x0054 scid 0x0040 result 0 status 0
Connection successful
---
net/bluetooth/l2cap.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index fadf26b..40d70db 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -844,9 +844,10 @@ static void __l2cap_sock_close(struct sock *sk, int reason)
struct l2cap_conn_rsp rsp;
__u16 result;
- if (bt_sk(sk)->defer_setup)
+ if (bt_sk(sk)->defer_setup) {
+ sk->sk_state = BT_DISCONN;
result = L2CAP_CR_SEC_BLOCK;
- else
+ } else
result = L2CAP_CR_BAD_PSM;
rsp.scid = cpu_to_le16(l2cap_pi(sk)->dcid);
--
1.7.1
^ permalink raw reply related
* Re: -DG_DISABLE_DEPRECATED and g_io_channel_*()
From: Luiz Augusto von Dentz @ 2011-01-19 12:17 UTC (permalink / raw)
To: Marcel Holtmann; +Cc: Brian Gix, linux-bluetooth
In-Reply-To: <1295436312.3873.240.camel@aeonflux>
Hi,
On Wed, Jan 19, 2011 at 1:25 PM, Marcel Holtmann <marcel@holtmann.org> wrot=
e:
> Hi Brian,
>
>> There appears to be a number of deprecated g_io_channel_* functions
>> being called from the bluez tip, which are breaking the build due to
>> Marcel's latest commit today:
>>
>> commit effe770cd43cf53fa5842291941dbfc82beab645
>> Author: Marcel Holtmann <marcel@holtmann.org>
>> Date: =A0 Tue Jan 18 14:56:31 2011 +0100
>>
>> =A0 =A0 Use -DG_DISABLE_DEPRECATED compiler define
>>
>>
>> Should this commit be backed out until these deprecated usages have been
>> fixed, or is this the general way that the issue is forced?
>>
>> Obviously deprecated functions should not be used, but it creates an
>> unbuildable bluez in the meantime.
>
> I broke it on purpose to draw some attention to this ;)
I have just send a pull request to fix those problems.
--=20
Luiz Augusto von Dentz
Computer Engineer
^ permalink raw reply
* Re: [PATCH v5 0/4] Adding HID Feature Report Support to hidraw
From: Jiri Kosina @ 2011-01-19 12:17 UTC (permalink / raw)
To: Alan Ott, Marcel Holtmann
Cc: Gustavo F. Padovan, David S. Miller, Michael Poole, Eric Dumazet,
linux-input, linux-kernel, linux-usb, linux-bluetooth, netdev
In-Reply-To: <1295337880-12452-1-git-send-email-alan@signal11.us>
On Tue, 18 Jan 2011, Alan Ott wrote:
> This patch adds Feature Report support for USB and Bluetooth HID devices
> through hidraw.
>
> The first two patches prepare the bluetooth side for the change.
> a. Make sure the hidp_session() thread is started before
> device's probe() functions are called.
> b. Wait for ACK/NAK on sent reports, and return proper
> error codes.
> The third patch is the hidraw core and USB changes.
> The fourth patch is the Bluetooth changes.
>
> Thanks to Antonio Ospite and Bill Good for providing testing and feedback.
>
>
> Alan Ott (4):
> bt hidp: Move hid_add_device() call to after hidp_session() has
> started.
> bt hidp: Wait for ACK on Sent Reports
> HID: Add Support for Setting and Getting Feature Reports from hidraw
> Bluetooth hidp: Add support for hidraw HIDIOCGFEATURE and
> HIDIOCSFEATURE
>
> drivers/hid/hidraw.c | 106 +++++++++++++++++++-
> drivers/hid/usbhid/hid-core.c | 35 +++++++
> include/linux/hid.h | 3 +
> include/linux/hidraw.h | 3 +
> net/bluetooth/hidp/core.c | 214 ++++++++++++++++++++++++++++++++++++++---
> net/bluetooth/hidp/hidp.h | 15 +++
Before proceeding with these patches, I'd really like to have comment
(ideally 'Acked-by') from Marcel on the net/bluetooth/hidp part,
obviously.
Marcel?
Thanks,
--
Jiri Kosina
SUSE Labs, Novell Inc.
^ permalink raw reply
* Pull request git://gitorious.org/~vudentz/bluez/vudentzs-clone.git for-upstream
From: Luiz Augusto von Dentz @ 2011-01-19 12:15 UTC (permalink / raw)
To: linux-bluetooth
The following changes since commit effe770cd43cf53fa5842291941dbfc82beab645:
Use -DG_DISABLE_DEPRECATED compiler define (2011-01-18 14:56:31 +0100)
are available in the git repository at:
git://gitorious.org/~vudentz/bluez/vudentzs-clone.git for-upstream
Luiz Augusto von Dentz (7):
Fix use of deprecated glib on audio plugin
Fix use of deprecated glib on input plugin
Fix use of deprecated glib on network plugin
Fix use of deprecated glib on serial plugin
Fix use of deprecated glib on hciops plugin
Fix use of deprecated glib on core
Fix use of deprecated glib on tests
audio/avdtp.c | 10 ++-
audio/gstavdtpsink.c | 162 +++++++++++++++++++++++++-------------------------
audio/headset.c | 13 +++--
audio/unix.c | 2 +-
input/device.c | 12 +++-
input/fakehid.c | 10 ++-
network/connection.c | 14 ++--
plugins/hciops.c | 24 ++++---
serial/proxy.c | 40 ++++++------
src/rfkill.c | 11 ++--
src/storage.c | 2 +-
test/hciemu.c | 15 +++--
12 files changed, 168 insertions(+), 147 deletions(-)
--
Luiz Augusto von Dentz
Computer Engineer
^ permalink raw reply
* Re: rfkill behavior for internal bluetooth adapters on thinkpads
From: Marcel Holtmann @ 2011-01-19 11:26 UTC (permalink / raw)
To: connman; +Cc: linux-bluetooth
In-Reply-To: <AANLkTimyT9UEfaC+G4ic7iyzcemOt11pYPvLQEG3P1uG@mail.gmail.com>
Hi Alok,
> I have a lenovo thinkpad T410 with integrated bluetooth.
> When I do a rfkill block bluetooth, the internal bluetooth device disappears
> from the list.
> A external USB bluetooth adapter on the system does not disappear.
>
> here are the observations :
>
> A. rfkill list shows 2 bluetooth adapters. hci0 is the internal one and hci1
> is a external bluetooth adapter.
>
> barsode@tatooine:~$ rfkill list
> 1: phy0: Wireless LAN
> Soft blocked: no
> Hard blocked: no
> 2: tpacpi_bluetooth_sw: Bluetooth
> Soft blocked: no
> Hard blocked: no
> 5: hci1: Bluetooth
> Soft blocked: no
> Hard blocked: no
> 8: hci0: Bluetooth
> Soft blocked: no
> Hard blocked: no
>
> B. then I do rfkill block bluetooth. Now rfkill list shows only 1 bluetooth
> device.
>
> barsode@tatooine:~$ rfkill block bluetooth
> barsode@tatooine:~$ rfkill list
> 1: phy0: Wireless LAN
> Soft blocked: no
> Hard blocked: no
> 2: tpacpi_bluetooth_sw: Bluetooth
> Soft blocked: yes
> Hard blocked: no
> 5: hci1: Bluetooth
> Soft blocked: yes
> Hard blocked: no
>
> C. hciconfig -a shows only hci1.
> barsode@tatooine:~$ hciconfig -a
> hci1: Type: USB
> BD Address: 00:1A:9F:92:B3:FC ACL MTU: 1021:7 SCO MTU: 64:1
> DOWN
> RX bytes:3986 acl:0 sco:0 events:128 errors:0
> TX bytes:3909 acl:0 sco:0 commands:128 errors:0
> Features: 0xff 0xff 0x8f 0xfe 0x9b 0xff 0x79 0x83
> Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
> Link policy: RSWITCH HOLD SNIFF PARK
> Link mode: SLAVE ACCEPT
>
> This is a problem for offline mode in connman (which would do "rfkill block
> bluetooth" or "rfkill block all") & the internal bluetooth adapter would
> disappear, which is not expected.
as mentioned on IRC, the way do here is OP_CHANGE_ALL with
TYPE_BLUETOOTH and that fits nicely into the technology concept that
ConnMan already imposes.
So yes, devices might drop of the bus, but the RFKILL switch for
platform devices stays.
Regards
Marcel
^ permalink raw reply
* Re: -DG_DISABLE_DEPRECATED and g_io_channel_*()
From: Marcel Holtmann @ 2011-01-19 11:25 UTC (permalink / raw)
To: Brian Gix; +Cc: linux-bluetooth
In-Reply-To: <1295377703.1774.6.camel@ubuntuLab1>
Hi Brian,
> There appears to be a number of deprecated g_io_channel_* functions
> being called from the bluez tip, which are breaking the build due to
> Marcel's latest commit today:
>
> commit effe770cd43cf53fa5842291941dbfc82beab645
> Author: Marcel Holtmann <marcel@holtmann.org>
> Date: Tue Jan 18 14:56:31 2011 +0100
>
> Use -DG_DISABLE_DEPRECATED compiler define
>
>
> Should this commit be backed out until these deprecated usages have been
> fixed, or is this the general way that the issue is forced?
>
> Obviously deprecated functions should not be used, but it creates an
> unbuildable bluez in the meantime.
I broke it on purpose to draw some attention to this ;)
Regards
Marcel
^ permalink raw reply
* Re: [PATCH 0/5] Fixes for authentication and security level issues
From: Marcel Holtmann @ 2011-01-19 11:24 UTC (permalink / raw)
To: johan.hedberg; +Cc: linux-bluetooth, ville.tervo
In-Reply-To: <1295419012-25717-1-git-send-email-johan.hedberg@gmail.com>
Hi Johan,
> Here's a set of patches that we created based on a recent test-run with
> the BITE tester. They should be fine, but we're still re-running all GAP
> and L2CAP tests during today to see that there aren't any regressions.
besides the typo, I can't spot anything wrong with these patches. So
depending on that these pass BITE testing.
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Regards
Marcel
^ permalink raw reply
* Re: [PATCH 1/5] Revert "Bluetooth: Update sec_level/auth_type for already existing connections"
From: Johan Hedberg @ 2011-01-19 6:49 UTC (permalink / raw)
To: linux-bluetooth; +Cc: ville.tervo
In-Reply-To: <1295419012-25717-2-git-send-email-johan.hedberg@gmail.com>
Hi Gustavo,
On Wed, Jan 19, 2011, johan.hedberg@gmail.com wrote:
> - The conn->sec_level should be updated without performing
Stupid typo: s/should/shouldn't/
Do you want me to resend or will you fix it manually yourself (e.g. git
commit --amend)?
Johan
^ permalink raw reply
* [PATCH 5/5] Bluetooth: Fix race condition with conn->sec_level
From: johan.hedberg @ 2011-01-19 6:36 UTC (permalink / raw)
To: linux-bluetooth; +Cc: ville.tervo
In-Reply-To: <1295419012-25717-1-git-send-email-johan.hedberg@gmail.com>
From: Johan Hedberg <johan.hedberg@nokia.com>
The conn->sec_level value is supposed to represent the current level of
security that the connection has. However, by assigning to it before
requesting authentication it will have the wrong value during the
authentication procedure. To fix this a pending_sec_level variable is
added which is used to track the desired security level while making
sure that sec_level always represents the current level of security.
Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com>
---
include/net/bluetooth/hci_core.h | 1 +
net/bluetooth/hci_conn.c | 8 ++++++--
net/bluetooth/hci_event.c | 9 +++++----
3 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index a29feb0..d2cf884 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -184,6 +184,7 @@ struct hci_conn {
__u32 link_mode;
__u8 auth_type;
__u8 sec_level;
+ __u8 pending_sec_level;
__u8 power_save;
__u16 disc_timeout;
unsigned long pend;
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index fe712a8..99cd8d9 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -379,7 +379,8 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8
hci_conn_hold(acl);
if (acl->state == BT_OPEN || acl->state == BT_CLOSED) {
- acl->sec_level = sec_level;
+ acl->sec_level = BT_SECURITY_LOW;
+ acl->pending_sec_level = sec_level;
acl->auth_type = auth_type;
hci_acl_connect(acl);
}
@@ -437,8 +438,11 @@ static int hci_conn_auth(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
{
BT_DBG("conn %p", conn);
+ if (conn->pending_sec_level > sec_level)
+ sec_level = conn->pending_sec_level;
+
if (sec_level > conn->sec_level)
- conn->sec_level = sec_level;
+ conn->pending_sec_level = sec_level;
else if (conn->link_mode & HCI_LM_AUTH)
return 1;
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 3810017..a290854 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -692,13 +692,13 @@ static int hci_outgoing_auth_needed(struct hci_dev *hdev,
if (conn->state != BT_CONFIG || !conn->out)
return 0;
- if (conn->sec_level == BT_SECURITY_SDP)
+ if (conn->pending_sec_level == BT_SECURITY_SDP)
return 0;
/* Only request authentication for SSP connections or non-SSP
* devices with sec_level HIGH */
if (!(hdev->ssp_mode > 0 && conn->ssp_mode > 0) &&
- conn->sec_level != BT_SECURITY_HIGH)
+ conn->pending_sec_level != BT_SECURITY_HIGH)
return 0;
return 1;
@@ -1095,9 +1095,10 @@ static inline void hci_auth_complete_evt(struct hci_dev *hdev, struct sk_buff *s
conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle));
if (conn) {
- if (!ev->status)
+ if (!ev->status) {
conn->link_mode |= HCI_LM_AUTH;
- else
+ conn->sec_level = conn->pending_sec_level;
+ } else
conn->sec_level = BT_SECURITY_LOW;
clear_bit(HCI_CONN_AUTH_PEND, &conn->pend);
--
1.7.2.3
^ permalink raw reply related
* [PATCH 4/5] Bluetooth: Fix authentication request for L2CAP raw sockets
From: johan.hedberg @ 2011-01-19 6:36 UTC (permalink / raw)
To: linux-bluetooth; +Cc: ville.tervo
In-Reply-To: <1295419012-25717-1-git-send-email-johan.hedberg@gmail.com>
From: Johan Hedberg <johan.hedberg@nokia.com>
When there is an existing connection l2cap_check_security needs to be
called to ensure that the security level of the new socket is fulfilled.
Normally l2cap_do_start takes care of this, but that function doesn't
get called for SOCK_RAW type sockets. This patch adds the necessary
l2cap_check_security call to the appropriate branch in l2cap_do_connect.
Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com>
---
net/bluetooth/l2cap.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index ae227bf..7550abb 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -1106,7 +1106,8 @@ static int l2cap_do_connect(struct sock *sk)
if (sk->sk_type != SOCK_SEQPACKET &&
sk->sk_type != SOCK_STREAM) {
l2cap_sock_clear_timer(sk);
- sk->sk_state = BT_CONNECTED;
+ if (l2cap_check_security(sk))
+ sk->sk_state = BT_CONNECTED;
} else
l2cap_do_start(sk);
}
--
1.7.2.3
^ permalink raw reply related
* [PATCH 3/5] Bluetooth: Create a unified auth_type evaluation function
From: johan.hedberg @ 2011-01-19 6:36 UTC (permalink / raw)
To: linux-bluetooth; +Cc: ville.tervo
In-Reply-To: <1295419012-25717-1-git-send-email-johan.hedberg@gmail.com>
From: Johan Hedberg <johan.hedberg@nokia.com>
The logic for determining the needed auth_type for an L2CAP socket is
rather complicated and has so far been duplicated in
l2cap_check_security as well as l2cap_do_connect. Additionally the
l2cap_check_security code was completely missing the handling of
SOCK_RAW type sockets. This patch creates a unified function for the
evaluation and makes l2cap_do_connect and l2cap_check_security use that
function.
Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com>
---
net/bluetooth/l2cap.c | 77 ++++++++++++++++++-------------------------------
1 files changed, 28 insertions(+), 49 deletions(-)
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 4fd88eb..ae227bf 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -305,33 +305,44 @@ static void l2cap_chan_del(struct sock *sk, int err)
}
}
-/* Service level security */
-static inline int l2cap_check_security(struct sock *sk)
+static inline u8 l2cap_get_auth_type(struct sock *sk)
{
- struct l2cap_conn *conn = l2cap_pi(sk)->conn;
- __u8 auth_type;
+ if (sk->sk_type == SOCK_RAW) {
+ switch (l2cap_pi(sk)->sec_level) {
+ case BT_SECURITY_HIGH:
+ return HCI_AT_DEDICATED_BONDING_MITM;
+ case BT_SECURITY_MEDIUM:
+ return HCI_AT_DEDICATED_BONDING;
+ default:
+ return HCI_AT_NO_BONDING;
+ }
+ } else if (l2cap_pi(sk)->psm == cpu_to_le16(0x0001)) {
+ if (l2cap_pi(sk)->sec_level == BT_SECURITY_LOW)
+ l2cap_pi(sk)->sec_level = BT_SECURITY_SDP;
- if (l2cap_pi(sk)->psm == cpu_to_le16(0x0001)) {
if (l2cap_pi(sk)->sec_level == BT_SECURITY_HIGH)
- auth_type = HCI_AT_NO_BONDING_MITM;
+ return HCI_AT_NO_BONDING_MITM;
else
- auth_type = HCI_AT_NO_BONDING;
-
- if (l2cap_pi(sk)->sec_level == BT_SECURITY_LOW)
- l2cap_pi(sk)->sec_level = BT_SECURITY_SDP;
+ return HCI_AT_NO_BONDING;
} else {
switch (l2cap_pi(sk)->sec_level) {
case BT_SECURITY_HIGH:
- auth_type = HCI_AT_GENERAL_BONDING_MITM;
- break;
+ return HCI_AT_GENERAL_BONDING_MITM;
case BT_SECURITY_MEDIUM:
- auth_type = HCI_AT_GENERAL_BONDING;
- break;
+ return HCI_AT_GENERAL_BONDING;
default:
- auth_type = HCI_AT_NO_BONDING;
- break;
+ return HCI_AT_NO_BONDING;
}
}
+}
+
+/* Service level security */
+static inline int l2cap_check_security(struct sock *sk)
+{
+ struct l2cap_conn *conn = l2cap_pi(sk)->conn;
+ __u8 auth_type;
+
+ auth_type = l2cap_get_auth_type(sk);
return hci_conn_security(conn->hcon, l2cap_pi(sk)->sec_level,
auth_type);
@@ -1068,39 +1079,7 @@ static int l2cap_do_connect(struct sock *sk)
err = -ENOMEM;
- if (sk->sk_type == SOCK_RAW) {
- switch (l2cap_pi(sk)->sec_level) {
- case BT_SECURITY_HIGH:
- auth_type = HCI_AT_DEDICATED_BONDING_MITM;
- break;
- case BT_SECURITY_MEDIUM:
- auth_type = HCI_AT_DEDICATED_BONDING;
- break;
- default:
- auth_type = HCI_AT_NO_BONDING;
- break;
- }
- } else if (l2cap_pi(sk)->psm == cpu_to_le16(0x0001)) {
- if (l2cap_pi(sk)->sec_level == BT_SECURITY_HIGH)
- auth_type = HCI_AT_NO_BONDING_MITM;
- else
- auth_type = HCI_AT_NO_BONDING;
-
- if (l2cap_pi(sk)->sec_level == BT_SECURITY_LOW)
- l2cap_pi(sk)->sec_level = BT_SECURITY_SDP;
- } else {
- switch (l2cap_pi(sk)->sec_level) {
- case BT_SECURITY_HIGH:
- auth_type = HCI_AT_GENERAL_BONDING_MITM;
- break;
- case BT_SECURITY_MEDIUM:
- auth_type = HCI_AT_GENERAL_BONDING;
- break;
- default:
- auth_type = HCI_AT_NO_BONDING;
- break;
- }
- }
+ auth_type = l2cap_get_auth_type(sk);
hcon = hci_connect(hdev, ACL_LINK, dst,
l2cap_pi(sk)->sec_level, auth_type);
--
1.7.2.3
^ permalink raw reply related
* [PATCH 2/5] Bluetooth: Fix MITM protection requirement preservation
From: johan.hedberg @ 2011-01-19 6:36 UTC (permalink / raw)
To: linux-bluetooth; +Cc: ville.tervo
In-Reply-To: <1295419012-25717-1-git-send-email-johan.hedberg@gmail.com>
From: Johan Hedberg <johan.hedberg@nokia.com>
If an existing connection has a MITM protection requirement (the first
bit of the auth_type) then that requirement should not be cleared by new
sockets that reuse the ACL but don't have that requirement.
Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com>
---
net/bluetooth/hci_conn.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 65a3fb5..fe712a8 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -442,6 +442,9 @@ static int hci_conn_auth(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
else if (conn->link_mode & HCI_LM_AUTH)
return 1;
+ /* Make sure we preserve an existing MITM requirement*/
+ auth_type |= (conn->auth_type & 0x01);
+
conn->auth_type = auth_type;
if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->pend)) {
--
1.7.2.3
^ permalink raw reply related
* [PATCH 1/5] Revert "Bluetooth: Update sec_level/auth_type for already existing connections"
From: johan.hedberg @ 2011-01-19 6:36 UTC (permalink / raw)
To: linux-bluetooth; +Cc: ville.tervo
In-Reply-To: <1295419012-25717-1-git-send-email-johan.hedberg@gmail.com>
From: Johan Hedberg <johan.hedberg@nokia.com>
This reverts commit 045309820afe047920a50de25634dab46a1e851d. That
commit is wrong for two reasons:
- The conn->sec_level should be updated without performing
authentication first (as it's supposed to represent the level of
security that the existing connection has)
- A higher auth_type value doesn't mean "more secure" like the commit
seems to assume. E.g. dedicated bonding with MITM protection is 0x03
whereas general bonding without MITM protection is 0x04. hci_conn_auth
already takes care of updating conn->auth_type so hci_connect doesn't
need to do it.
Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com>
---
net/bluetooth/hci_conn.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 6b90a41..65a3fb5 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -382,11 +382,6 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8
acl->sec_level = sec_level;
acl->auth_type = auth_type;
hci_acl_connect(acl);
- } else {
- if (acl->sec_level < sec_level)
- acl->sec_level = sec_level;
- if (acl->auth_type < auth_type)
- acl->auth_type = auth_type;
}
if (type == ACL_LINK)
--
1.7.2.3
^ permalink raw reply related
* [PATCH 0/5] Fixes for authentication and security level issues
From: johan.hedberg @ 2011-01-19 6:36 UTC (permalink / raw)
To: linux-bluetooth; +Cc: ville.tervo
Hi,
Here's a set of patches that we created based on a recent test-run with
the BITE tester. They should be fine, but we're still re-running all GAP
and L2CAP tests during today to see that there aren't any regressions.
Johan
^ permalink raw reply
* Re: [PATCH] bluetooth: Fix failure to release lock in read_index_list() when mem alloc fails.
From: Gustavo F. Padovan @ 2011-01-19 3:38 UTC (permalink / raw)
To: Jesper Juhl
Cc: linux-bluetooth, netdev, linux-kernel, David S. Miller,
Marcel Holtmann
In-Reply-To: <alpine.LNX.2.00.1101140000541.11347@swampdragon.chaosbits.net>
Hi Jesper,
* Jesper Juhl <jj@chaosbits.net> [2011-01-14 00:18:49 +0100]:
> If alloc_skb() fails in read_index_list() we'll return -ENOMEM without
> releasing 'hci_dev_list_lock'.
>
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>
> ---
> mgmt.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
Patch has been applied. Thanks.
--
Gustavo F. Padovan
http://profusion.mobi
^ permalink raw reply
* Re: [PATCH] Bluetooth: Never deallocate a session when some DLC points to it
From: Gustavo F. Padovan @ 2011-01-19 1:11 UTC (permalink / raw)
To: Lukáš Turek; +Cc: linux-bluetooth
In-Reply-To: <201101050243.59801.8an@praha12.net>
Hi Lukáš,
* Lukáš Turek <8an@praha12.net> [2011-01-05 02:43:59 +0100]:
> Fix a bug introduced in commit 9cf5b0ea3a7f1432c61029f7aaf4b8b338628884:
> function rfcomm_recv_ua calls rfcomm_session_put without checking that
> the session is not referenced by some DLC. If the session is freed, that
> DLC would refer to deallocated memory, causing an oops later, as shown
> in this bug report: https://bugzilla.kernel.org/show_bug.cgi?id=15994
>
> Signed-off-by: Lukas Turek <8an@praha12.net>
> ---
> net/bluetooth/rfcomm/core.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
Patch has been applied. Thanks.
--
Gustavo F. Padovan
http://profusion.mobi
^ permalink raw reply
* -DG_DISABLE_DEPRECATED and g_io_channel_*()
From: Brian Gix @ 2011-01-18 19:08 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Marcel Holtmann
Hi All,
There appears to be a number of deprecated g_io_channel_* functions
being called from the bluez tip, which are breaking the build due to
Marcel's latest commit today:
commit effe770cd43cf53fa5842291941dbfc82beab645
Author: Marcel Holtmann <marcel@holtmann.org>
Date: Tue Jan 18 14:56:31 2011 +0100
Use -DG_DISABLE_DEPRECATED compiler define
Should this commit be backed out until these deprecated usages have been
fixed, or is this the general way that the issue is forced?
Obviously deprecated functions should not be used, but it creates an
unbuildable bluez in the meantime.
--
Brian Gix
bgix@codeaurora.org
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum
^ permalink raw reply
* rfkill behavior for internal bluetooth adapters on thinkpads
From: alok barsode @ 2011-01-18 12:24 UTC (permalink / raw)
To: linux-bluetooth; +Cc: connman
Hi,
I have a lenovo thinkpad T410 with integrated bluetooth.
When I do a rfkill block bluetooth, the internal bluetooth device disappears
from the list.
A external USB bluetooth adapter on the system does not disappear.
here are the observations :
A. rfkill list shows 2 bluetooth adapters. hci0 is the internal one and hci1
is a external bluetooth adapter.
barsode@tatooine:~$ rfkill list
1: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
2: tpacpi_bluetooth_sw: Bluetooth
Soft blocked: no
Hard blocked: no
5: hci1: Bluetooth
Soft blocked: no
Hard blocked: no
8: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
B. then I do rfkill block bluetooth. Now rfkill list shows only 1 bluetooth
device.
barsode@tatooine:~$ rfkill block bluetooth
barsode@tatooine:~$ rfkill list
1: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
2: tpacpi_bluetooth_sw: Bluetooth
Soft blocked: yes
Hard blocked: no
5: hci1: Bluetooth
Soft blocked: yes
Hard blocked: no
C. hciconfig -a shows only hci1.
barsode@tatooine:~$ hciconfig -a
hci1: Type: USB
BD Address: 00:1A:9F:92:B3:FC ACL MTU: 1021:7 SCO MTU: 64:1
DOWN
RX bytes:3986 acl:0 sco:0 events:128 errors:0
TX bytes:3909 acl:0 sco:0 commands:128 errors:0
Features: 0xff 0xff 0x8f 0xfe 0x9b 0xff 0x79 0x83
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
This is a problem for offline mode in connman (which would do "rfkill block
bluetooth" or "rfkill block all") & the internal bluetooth adapter would
disappear, which is not expected.
Is this common on laptops or its just thinkpads? I tested this on a HP
laptop which does not remove the internal device when i do rfkill block
bluetooth.
the only way to get around the problem seems to be rfkilling each device
individually or am I missing some info here.
Thanks,
Alok.
_______________________________________________
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman
^ permalink raw reply
* [PATCH 4/4 v2] Add proper tracking mechanism to NREC
From: Luiz Augusto von Dentz @ 2011-01-18 12:11 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>
NREC may change during the connections so it has to be tracked in order
to signal changes to applications.
---
audio/headset.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
audio/headset.h | 6 +++++
audio/transport.c | 19 ++++++++++++++++++
3 files changed, 79 insertions(+), 1 deletions(-)
diff --git a/audio/headset.c b/audio/headset.c
index 53a594d..6c46300 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -109,6 +109,12 @@ struct headset_state_callback {
unsigned int id;
};
+struct headset_nrec_callback {
+ unsigned int id;
+ headset_nrec_cb cb;
+ void *user_data;
+};
+
struct connect_cb {
unsigned int id;
headset_stream_cb_t cb;
@@ -167,6 +173,7 @@ struct headset {
headset_lock_t lock;
struct headset_slc *slc;
+ GSList *nrec_cbs;
};
struct event {
@@ -1096,8 +1103,17 @@ int telephony_nr_and_ec_rsp(void *telephony_device, cme_error_t err)
struct headset *hs = device->headset;
struct headset_slc *slc = hs->slc;
- if (err == CME_ERROR_NONE)
+ if (err == CME_ERROR_NONE) {
+ GSList *l;
+
+ for (l = hs->nrec_cbs; l; l = l->next) {
+ struct headset_nrec_callback *nrec_cb = l->data;
+
+ nrec_cb->cb(device, slc->nrec_req, nrec_cb->user_data);
+ }
+
slc->nrec = hs->slc->nrec_req;
+ }
return telephony_generic_rsp(telephony_device, err);
}
@@ -2121,6 +2137,9 @@ static void headset_free(struct audio_device *dev)
headset_close_rfcomm(dev);
+ g_slist_foreach(hs->nrec_cbs, (GFunc) g_free, NULL);
+ g_slist_free(hs->nrec_cbs);
+
g_free(hs);
dev->headset = NULL;
}
@@ -2638,6 +2657,40 @@ gboolean headset_get_nrec(struct audio_device *dev)
return hs->slc->nrec;
}
+unsigned int headset_add_nrec_cb(struct audio_device *dev,
+ headset_nrec_cb cb, void *user_data)
+{
+ struct headset *hs = dev->headset;
+ struct headset_nrec_callback *nrec_cb;
+ static unsigned int id = 0;
+
+ nrec_cb = g_new(struct headset_nrec_callback, 1);
+ nrec_cb->cb = cb;
+ nrec_cb->user_data = user_data;
+ nrec_cb->id = ++id;
+
+ hs->nrec_cbs = g_slist_prepend(hs->nrec_cbs, nrec_cb);
+
+ return nrec_cb->id;
+}
+
+gboolean headset_remove_nrec_cb(struct audio_device *dev, unsigned int id)
+{
+ struct headset *hs = dev->headset;
+ GSList *l;
+
+ for (l = hs->nrec_cbs; l != NULL; l = l->next) {
+ struct headset_nrec_callback *cb = l->data;
+ if (cb && cb->id == id) {
+ hs->nrec_cbs = g_slist_remove(hs->nrec_cbs, cb);
+ g_free(cb);
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
gboolean headset_get_inband(struct audio_device *dev)
{
struct headset *hs = dev->headset;
diff --git a/audio/headset.h b/audio/headset.h
index 29dc02c..7ce88c8 100644
--- a/audio/headset.h
+++ b/audio/headset.h
@@ -44,6 +44,9 @@ typedef void (*headset_state_cb) (struct audio_device *dev,
headset_state_t old_state,
headset_state_t new_state,
void *user_data);
+typedef void (*headset_nrec_cb) (struct audio_device *dev,
+ gboolean nrec,
+ void *user_data);
unsigned int headset_add_state_cb(headset_state_cb cb, void *user_data);
gboolean headset_remove_state_cb(unsigned int id);
@@ -90,6 +93,9 @@ int headset_get_channel(struct audio_device *dev);
int headset_get_sco_fd(struct audio_device *dev);
gboolean headset_get_nrec(struct audio_device *dev);
+unsigned int headset_add_nrec_cb(struct audio_device *dev,
+ headset_nrec_cb cb, void *user_data);
+gboolean headset_remove_nrec_cb(struct audio_device *dev, unsigned int id);
gboolean headset_get_inband(struct audio_device *dev);
gboolean headset_get_sco_hci(struct audio_device *dev);
diff --git a/audio/transport.c b/audio/transport.c
index b5a9e48..9961684 100644
--- a/audio/transport.c
+++ b/audio/transport.c
@@ -76,6 +76,7 @@ struct media_transport {
uint16_t imtu; /* Transport input mtu */
uint16_t omtu; /* Transport output mtu */
uint16_t delay; /* Transport delay (a2dp only) */
+ unsigned int nrec_id; /* Transport nrec watch (headset only) */
gboolean read_lock;
gboolean write_lock;
gboolean in_use;
@@ -685,6 +686,9 @@ static void media_transport_free(void *data)
if (transport->session)
avdtp_unref(transport->session);
+ if (transport->nrec_id)
+ headset_remove_nrec_cb(transport->device, transport->nrec_id);
+
if (transport->conn)
dbus_connection_unref(transport->conn);
@@ -693,6 +697,18 @@ static void media_transport_free(void *data)
g_free(transport);
}
+static void headset_nrec_changed(struct audio_device *dev, gboolean nrec,
+ void *user_data)
+{
+ struct media_transport *transport = user_data;
+
+ DBG("");
+
+ emit_property_changed(transport->conn, transport->path,
+ MEDIA_TRANSPORT_INTERFACE, "NREC",
+ DBUS_TYPE_BOOLEAN, &nrec);
+}
+
struct media_transport *media_transport_create(DBusConnection *conn,
struct media_endpoint *endpoint,
struct audio_device *device,
@@ -728,6 +744,9 @@ struct media_transport *media_transport_create(DBusConnection *conn,
transport->cancel = cancel_headset;
transport->get_properties = get_properties_headset;
transport->set_property = set_property_headset;
+ transport->nrec_id = headset_add_nrec_cb(device,
+ headset_nrec_changed,
+ transport);
} else
goto fail;
--
1.7.1
^ permalink raw reply related
* [PATCH] Bluetooth: fix crash by disabling tasklet in sock accept
From: Emeltchenko Andrei @ 2011-01-18 11:54 UTC (permalink / raw)
To: linux-bluetooth
From: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
Crash can happen when tasklet handling connect/disconnect requests
preempts socket accept. Can be reproduced with "l2test -r" on one
side and several "l2test -c -b 1000 -i hci0 -P 10 <bdaddr>" on the
other side.
...
[ 3555.897247] Unable to handle kernel NULL pointer dereference at virtual
address 000000bc
[ 3555.915039] pgd = cab9c000
[ 3555.917785] [000000bc] *pgd=8bf3d031, *pte=00000000, *ppte=00000000
[ 3555.928314] Internal error: Oops: 17 [#1] PREEMPT
[ 3555.999786] CPU: 0 Not tainted (2.6.32.21-13874-g67918ef #65)
...
[ 3556.005981] PC is at bt_accept_unlink+0x20/0x58 [bluetooth]
[ 3556.011627] LR is at bt_accept_dequeue+0x3c/0xe8 [bluetooth]
...
[ 3556.161285] [<bf0007fc>] (bt_accept_unlink+0x20/0x58 [bluetooth]) from
[<bf000870>] (bt_accept_dequeue+0x3c/0xe8 [bluetooth])
[ 3556.172729] [<bf000870>] (bt_accept_dequeue+0x3c/0xe8 [bluetooth]) from
[<bf324df8>] (l2cap_sock_accept+0x100/0x15c [l2cap])
[ 3556.184082] [<bf324df8>] (l2cap_sock_accept+0x100/0x15c [l2cap]) from
[<c026a0a8>] (sys_accept4+0x120/0x1e0)
[ 3556.193969] [<c026a0a8>] (sys_accept4+0x120/0x1e0) from [<c002c9a0>]
(ret_fast_syscall+0x0/0x2c)
[ 3556.202819] Code: e5813000 e5901164 e580c160 e580c15c (e1d13bbc)
...
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
---
net/bluetooth/af_bluetooth.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c
index a6732b5..86386e9 100644
--- a/net/bluetooth/af_bluetooth.c
+++ b/net/bluetooth/af_bluetooth.c
@@ -199,6 +199,7 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock)
BT_DBG("parent %p", parent);
+ local_bh_disable();
list_for_each_safe(p, n, &bt_sk(parent)->accept_q) {
sk = (struct sock *) list_entry(p, struct bt_sock, accept_q);
@@ -217,11 +218,14 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock)
if (newsock)
sock_graft(sk, newsock);
release_sock(sk);
+ local_bh_enable();
return sk;
}
release_sock(sk);
}
+ local_bh_enable();
+
return NULL;
}
EXPORT_SYMBOL(bt_accept_dequeue);
--
1.7.1
^ permalink raw reply related
* Re: [PATCH] ath3k: reduce memory usage
From: Bala Shanmugam @ 2011-01-18 10:48 UTC (permalink / raw)
To: Alexander Holler
Cc: Gustavo F. Padovan, Marcel Holtmann, SongXing Xu, Luis Rodriguez,
Vikram Kandukuri, linux-bluetooth@vger.kernel.org
In-Reply-To: <4D2F6DE5.5090109@ahsoftware.de>
On 1/14/2011 2:55 AM, Alexander Holler wrote:
> Hello,
>
> On 13.01.2011 20:08, Gustavo F. Padovan wrote:
>> Hi Alexander,
>>
>> * Alexander Holler<holler@ahsoftware.de> [2010-11-22 21:09:01 +0100]:
>>
>>> There is no need to hold the firmware in memory.
>>>
>>> Signed-off-by: Alexander Holler<holler@ahsoftware.de>
>>> ---
>>> drivers/bluetooth/ath3k.c | 75 ++++++++++++---------------------------------
>>> 1 files changed, 20 insertions(+), 55 deletions(-)
>> I'm assuming you tested it a lot. Patch has been applied. Thanks.
> Yes, I'm using it here haven't had a problem with that patch.
>
> Thanks,
>
> Alexander
> --
> 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
Thanks Alex for the patch.
Its working.
Regards,
Bala.
^ permalink raw reply
* [PATCH 4/4] Add proper tracking mechanism to NREC
From: Luiz Augusto von Dentz @ 2011-01-18 10:00 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1295344815-1404-1-git-send-email-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>
NREC may change during the connections so it has to be tracked in order
to signal changes to applications.
---
audio/headset.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
audio/headset.h | 6 +++++
audio/transport.c | 17 ++++++++++++++
3 files changed, 84 insertions(+), 1 deletions(-)
diff --git a/audio/headset.c b/audio/headset.c
index 53a594d..62596c4 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -109,6 +109,12 @@ struct headset_state_callback {
unsigned int id;
};
+struct headset_nrec_callback {
+ unsigned int id;
+ headset_nrec_cb cb;
+ void *user_data;
+};
+
struct connect_cb {
unsigned int id;
headset_stream_cb_t cb;
@@ -137,6 +143,7 @@ struct headset_slc {
gboolean inband_ring;
gboolean nrec;
gboolean nrec_req;
+ GSList *nrec_cbs;
int sp_gain;
int mic_gain;
@@ -1096,8 +1103,17 @@ int telephony_nr_and_ec_rsp(void *telephony_device, cme_error_t err)
struct headset *hs = device->headset;
struct headset_slc *slc = hs->slc;
- if (err == CME_ERROR_NONE)
+ if (err == CME_ERROR_NONE) {
+ GSList *l;
+
+ for (l = slc->nrec_cbs; l; l = l->next) {
+ struct headset_nrec_callback *nrec_cb = l->data;
+
+ nrec_cb->cb(device, slc->nrec_req, nrec_cb->user_data);
+ }
+
slc->nrec = hs->slc->nrec_req;
+ }
return telephony_generic_rsp(telephony_device, err);
}
@@ -2102,6 +2118,9 @@ static int headset_close_rfcomm(struct audio_device *dev)
hs->rfcomm = NULL;
}
+ g_slist_foreach(hs->slc->nrec_cbs, (GFunc) g_free, NULL);
+ g_slist_free(hs->slc->nrec_cbs);
+
g_free(hs->slc);
hs->slc = NULL;
@@ -2638,6 +2657,47 @@ gboolean headset_get_nrec(struct audio_device *dev)
return hs->slc->nrec;
}
+unsigned int headset_add_nrec_cb(struct audio_device *dev,
+ headset_nrec_cb cb, void *user_data)
+{
+ struct headset *hs = dev->headset;
+ struct headset_nrec_callback *nrec_cb;
+ static unsigned int id = 0;
+
+ if (!hs->slc)
+ return 0;
+
+ nrec_cb = g_new(struct headset_nrec_callback, 1);
+ nrec_cb->cb = cb;
+ nrec_cb->user_data = user_data;
+ nrec_cb->id = ++id;
+
+ hs->slc->nrec_cbs = g_slist_prepend(hs->slc->nrec_cbs, nrec_cb);
+
+ return nrec_cb->id;
+}
+
+gboolean headset_remove_nrec_cb(struct audio_device *dev, unsigned int id)
+{
+ struct headset *hs = dev->headset;
+ GSList *l;
+
+ if (!hs->slc)
+ return FALSE;
+
+ for (l = hs->slc->nrec_cbs; l != NULL; l = l->next) {
+ struct headset_nrec_callback *cb = l->data;
+ if (cb && cb->id == id) {
+ hs->slc->nrec_cbs = g_slist_remove(hs->slc->nrec_cbs,
+ cb);
+ g_free(cb);
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
gboolean headset_get_inband(struct audio_device *dev)
{
struct headset *hs = dev->headset;
diff --git a/audio/headset.h b/audio/headset.h
index 29dc02c..7ce88c8 100644
--- a/audio/headset.h
+++ b/audio/headset.h
@@ -44,6 +44,9 @@ typedef void (*headset_state_cb) (struct audio_device *dev,
headset_state_t old_state,
headset_state_t new_state,
void *user_data);
+typedef void (*headset_nrec_cb) (struct audio_device *dev,
+ gboolean nrec,
+ void *user_data);
unsigned int headset_add_state_cb(headset_state_cb cb, void *user_data);
gboolean headset_remove_state_cb(unsigned int id);
@@ -90,6 +93,9 @@ int headset_get_channel(struct audio_device *dev);
int headset_get_sco_fd(struct audio_device *dev);
gboolean headset_get_nrec(struct audio_device *dev);
+unsigned int headset_add_nrec_cb(struct audio_device *dev,
+ headset_nrec_cb cb, void *user_data);
+gboolean headset_remove_nrec_cb(struct audio_device *dev, unsigned int id);
gboolean headset_get_inband(struct audio_device *dev);
gboolean headset_get_sco_hci(struct audio_device *dev);
diff --git a/audio/transport.c b/audio/transport.c
index b5a9e48..e2c8237 100644
--- a/audio/transport.c
+++ b/audio/transport.c
@@ -76,6 +76,7 @@ struct media_transport {
uint16_t imtu; /* Transport input mtu */
uint16_t omtu; /* Transport output mtu */
uint16_t delay; /* Transport delay (a2dp only) */
+ unsigned int nrec_id; /* Transport nrec watch (headset only) */
gboolean read_lock;
gboolean write_lock;
gboolean in_use;
@@ -685,6 +686,9 @@ static void media_transport_free(void *data)
if (transport->session)
avdtp_unref(transport->session);
+ if (transport->nrec_id)
+ headset_remove_nrec_cb(transport->device, transport->nrec_id);
+
if (transport->conn)
dbus_connection_unref(transport->conn);
@@ -693,6 +697,16 @@ static void media_transport_free(void *data)
g_free(transport);
}
+static void headset_nrec_changed(struct audio_device *dev, gboolean nrec,
+ void *user_data)
+{
+ struct media_transport *transport = user_data;
+
+ emit_property_changed(transport->conn, transport->path,
+ MEDIA_TRANSPORT_INTERFACE, "NREC",
+ DBUS_TYPE_BOOLEAN, &nrec);
+}
+
struct media_transport *media_transport_create(DBusConnection *conn,
struct media_endpoint *endpoint,
struct audio_device *device,
@@ -728,6 +742,9 @@ struct media_transport *media_transport_create(DBusConnection *conn,
transport->cancel = cancel_headset;
transport->get_properties = get_properties_headset;
transport->set_property = set_property_headset;
+ transport->nrec_id = headset_add_nrec_cb(device,
+ headset_nrec_changed,
+ transport);
} else
goto fail;
--
1.7.1
^ permalink raw reply related
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