Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCHv1 2/5] Bluetooth: rm581: pm constraints support
From: Emeltchenko Andrei @ 2010-10-01 12:47 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1285937230-547-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>

From: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>

Add pm_limits callback

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
---
 arch/arm/mach-omap2/board-rm581-peripherals.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-rm581-peripherals.c b/arch/arm/mach-omap2/board-rm581-peripherals.c
index 4e98c6b..673f270 100644
--- a/arch/arm/mach-omap2/board-rm581-peripherals.c
+++ b/arch/arm/mach-omap2/board-rm581-peripherals.c
@@ -45,6 +45,7 @@
 #include <plat/mmc.h>
 #include <plat/board-nokia.h>
 #include <plat/ssi.h>
+#include <plat/omap-pm.h>
 
 #include "hsmmc.h"
 
@@ -1124,6 +1125,12 @@ static int __init rm581_i2c_init(void)
 	return 0;
 }
 
+/* Use wakeup latency only for now */
+static void rm581_bt_set_pm_limits(struct device *dev, bool set)
+{
+	omap_pm_set_max_mpu_wakeup_lat(dev, set ? 10 : -1);
+}
+
 static struct omap_bluetooth_config rm581_bt_config = {
 	.chip_type		= BT_CHIP_TI,
 	.bt_wakeup_gpio		= 37,
@@ -1131,6 +1138,7 @@ static struct omap_bluetooth_config rm581_bt_config = {
 	.reset_gpio		= 26,
 	.bt_uart		= 2,
 	.bt_sysclk		= BT_SYSCLK_38_4,
+	.set_pm_limits		= rm581_bt_set_pm_limits,
 };
 
 static struct omap_ssi_board_config __initdata rm581_ssi_config = {
-- 
1.7.0.4


^ permalink raw reply related

* [PATCHv1 1/5] Bluetooth: board support for pm_limits
From: Emeltchenko Andrei @ 2010-10-01 12:47 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1285937230-547-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>

From: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
---
 arch/arm/plat-omap/include/plat/board-nokia.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/include/plat/board-nokia.h b/arch/arm/plat-omap/include/plat/board-nokia.h
index 62718e5..489466d 100644
--- a/arch/arm/plat-omap/include/plat/board-nokia.h
+++ b/arch/arm/plat-omap/include/plat/board-nokia.h
@@ -55,6 +55,7 @@ struct omap_bluetooth_config {
 	u8    bt_uart;
 	u8    bd_addr[6];
 	u8    bt_sysclk;
+	void  (*set_pm_limits)(struct device *dev, bool set);
 };
 
 struct omap_wlan_cx3110x_config {
-- 
1.7.0.4


^ permalink raw reply related

* [PATCHv1 0/5] Bluetooth: experimental support for pm_limits
From: Emeltchenko Andrei @ 2010-10-01 12:47 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>

First version of using power constraints interface to achieve
maximum bluetooth transfer speed. Otherwise HW goes to idle mode
and speed decreases 3 times.

Use empirical power management analyzer (TM) to define amount
of time device set high power constraints for.

May include hacks :-)

Andrei Emeltchenko (5):
  Bluetooth: board support for pm_limits
  Bluetooth: rm581: pm constraints support
  Bluetooth: rm680: pm constraints support
  Bluetooth: rm696: pm constraints support
  Bluetooth: pm constraints in bt transfer mode

 arch/arm/mach-omap2/board-rm581-peripherals.c |    8 ++
 arch/arm/mach-omap2/board-rm680-peripherals.c |    8 ++
 arch/arm/mach-omap2/board-rm696-peripherals.c |    8 ++
 arch/arm/plat-omap/include/plat/board-nokia.h |    1 +
 drivers/bluetooth/hci_h4p/core.c              |   92 ++++++++++++++++++++++++-
 drivers/bluetooth/hci_h4p/hci_h4p.h           |    1 +
 6 files changed, 117 insertions(+), 1 deletions(-)


^ permalink raw reply

* [PATCH] Added firmware load patch to crap directory. This patch loads firmware from btusb when device is plugged in.
From: Bala Shanmugam @ 2010-10-01 11:12 UTC (permalink / raw)
  To: linux-wireless; +Cc: marcel, linux-bluetooth, linux-kernel, Bala Shanmugam

Disabled staging directory compilation for bt target.
Signed-off-by: Bala Shanmugam <sbalashanmugam@atheros.com>
---
 Makefile                                  |    9 +-
 crap/0003-btusb-Add-fw-load-support.patch |  424 +++++++++++++++++++++++++++++
 2 files changed, 428 insertions(+), 5 deletions(-)
 create mode 100644 crap/0003-btusb-Add-fw-load-support.patch

diff --git a/Makefile b/Makefile
index e2c594a..4505080 100644
--- a/Makefile
+++ b/Makefile
@@ -31,17 +31,16 @@ obj-$(CONFIG_COMPAT_NET_USB_MODULES) += drivers/net/usb/
 
 obj-$(CONFIG_COMPAT_NETWORK_MODULES) += drivers/net/
 obj-$(CONFIG_COMPAT_VAR_MODULES) +=  drivers/ssb/ drivers/misc/eeprom/
-endif
-
-obj-$(CONFIG_COMPAT_BLUETOOTH) += net/bluetooth/
-obj-$(CONFIG_COMPAT_BLUETOOTH_MODULES) += drivers/bluetooth/
-
 
 ifeq ($(CONFIG_STAGING_EXCLUDE_BUILD),)
 obj-$(CONFIG_COMPAT_STAGING) += drivers/staging/ath6kl/
 obj-$(CONFIG_COMPAT_STAGING) += drivers/staging/brcm80211/
 endif
 
+endif
+
+obj-$(CONFIG_COMPAT_BLUETOOTH) += net/bluetooth/
+obj-$(CONFIG_COMPAT_BLUETOOTH_MODULES) += drivers/bluetooth/
 
 else
 
diff --git a/crap/0003-btusb-Add-fw-load-support.patch b/crap/0003-btusb-Add-fw-load-support.patch
new file mode 100644
index 0000000..2fc1abe
--- /dev/null
+++ b/crap/0003-btusb-Add-fw-load-support.patch
@@ -0,0 +1,424 @@
+Reason for not yet publishing: Marcel feels that Atheros sflash based BT device
+doesn't follow bluetooth H:2 specification and HCI commands should be supported
+in firmware if it is detected as bluetooth device. Using HCI command, firmware
+should be loaded.
+
+In sfash based device we don't have enough memory to support HCI commands in firmware.
+So load firmware from btusb when the device comes up.
+
+From 4ac276c14578b380d0c6a27658eeaa364efe6432 Mon Sep 17 00:00:00 2001
+From: Bala Shanmugam <sbalashanmugam@atheros.com>
+Date: Fri, 1 Oct 2010 15:18:02 +0530
+Subject: [PATCH] Added support to load firmware to target RAM from btusb transport driver.
+ Each BT device vendor can add their product ID, firmware file, load and unload function
+ to btusb_fwcbs array. When the device is inserted btusb will call appropriate
+ firmware load function.  This support will significantly reduce cost of
+ BT chip because of RAM based firmware.
+ Signed-off-by: Bala Shanmugam <sbalashanmugam@atheros.com>
+
+---
+ drivers/bluetooth/Makefile |    1 +
+ drivers/bluetooth/btusb.c  |   67 +++++++++++++++
+ drivers/bluetooth/fwload.c |  199 ++++++++++++++++++++++++++++++++++++++++++++
+ drivers/bluetooth/fwload.h |   39 +++++++++
+ 4 files changed, 306 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/bluetooth/fwload.c
+ create mode 100644 drivers/bluetooth/fwload.h
+
+diff --git a/drivers/bluetooth/Makefile b/drivers/bluetooth/Makefile
+index 71bdf13..5a55cbb 100644
+--- a/drivers/bluetooth/Makefile
++++ b/drivers/bluetooth/Makefile
+@@ -13,6 +13,7 @@ obj-$(CONFIG_BT_HCIBLUECARD)	+= bluecard_cs.o
+ obj-$(CONFIG_BT_HCIBTUART)	+= btuart_cs.o
+
+ obj-$(CONFIG_BT_HCIBTUSB)	+= btusb.o
++obj-$(CONFIG_BT_HCIBTUSB)	+= fwload.o
+ obj-$(CONFIG_BT_HCIBTSDIO)	+= btsdio.o
+
+ obj-$(CONFIG_BT_ATH3K)		+= ath3k.o
+diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
+index d22ce3c..13e0fb8 100644
+--- a/drivers/bluetooth/btusb.c
++++ b/drivers/bluetooth/btusb.c
+@@ -34,6 +34,7 @@
+
+ #include <net/bluetooth/bluetooth.h>
+ #include <net/bluetooth/hci_core.h>
++#include "fwload.h"
+
+ #define VERSION "0.6"
+
+@@ -55,6 +56,26 @@ static struct usb_driver btusb_driver;
+ #define BTUSB_BROKEN_ISOC	0x20
+ #define BTUSB_WRONG_SCO_MTU	0x40
+
++static struct usb_device_id ath_table[] = {
++	/* Atheros AR3011 */
++	{ USB_DEVICE(0x0CF3, 0x3002) },
++	{ USB_DEVICE(0x13D3, 0x3304) },
++	{ }	/* Terminating entry */
++};
++
++/* Add firmware file, load and unload function
++ * to download the firmware to target RAM
++ */
++static struct fw_cb_config btusb_fwcbs[] = {
++	{
++		.fwfile = "ath3k-1.fw",
++		.usb_id_table = ath_table,
++		.fwload = ath_fw_load,
++		.fwunload = ath_fw_unload
++	},
++	{}
++};
++
+ static struct usb_device_id btusb_table[] = {
+ 	/* Generic Bluetooth USB device */
+ 	{ USB_DEVICE_INFO(0xe0, 0x01, 0x01) },
+@@ -863,6 +884,7 @@ static int btusb_probe(struct usb_interface *intf,
+ 	struct btusb_data *data;
+ 	struct hci_dev *hdev;
+ 	int i, err;
++	const struct usb_device_id *match;
+
+ 	BT_DBG("intf %p id %p", intf, id);
+
+@@ -922,6 +944,19 @@ static int btusb_probe(struct usb_interface *intf,
+ 	data->udev = interface_to_usbdev(intf);
+ 	data->intf = intf;
+
++	for (i = 0; btusb_fwcbs[i].fwfile; i++) {
++		match = usb_match_id(intf, btusb_fwcbs[i].usb_id_table);
++		if (match) {
++			if (btusb_fwcbs[i].fwload) {
++				btusb_fwcbs[i].data =
++					btusb_fwcbs[i].fwload(intf,
++						btusb_fwcbs[i].fwfile,
++						&btusb_fwcbs[i].bsuspend);
++			}
++			break;
++		}
++	}
++
+ 	spin_lock_init(&data->lock);
+
+ 	INIT_WORK(&data->work, btusb_work);
+@@ -1030,12 +1065,26 @@ static void btusb_disconnect(struct usb_interface *intf)
+ {
+ 	struct btusb_data *data = usb_get_intfdata(intf);
+ 	struct hci_dev *hdev;
++	const struct usb_device_id *match;
++	int i;
+
+ 	BT_DBG("intf %p", intf);
+
+ 	if (!data)
+ 		return;
+
++	for (i = 0; btusb_fwcbs[i].fwfile; i++) {
++		match = usb_match_id(intf, btusb_fwcbs[i].usb_id_table);
++		if (match) {
++			if (btusb_fwcbs[i].fwunload) {
++				btusb_fwcbs[i].fwunload(btusb_fwcbs[i].data,
++						btusb_fwcbs[i].bsuspend);
++				btusb_fwcbs[i].data = NULL;
++			}
++			break;
++		}
++	}
++
+ 	hdev = data->hdev;
+
+ 	__hci_dev_hold(hdev);
+@@ -1061,12 +1110,22 @@ static void btusb_disconnect(struct usb_interface *intf)
+ static int btusb_suspend(struct usb_interface *intf, pm_message_t message)
+ {
+ 	struct btusb_data *data = usb_get_intfdata(intf);
++	const struct usb_device_id *match;
++	int i;
+
+ 	BT_DBG("intf %p", intf);
+
+ 	if (data->suspend_count++)
+ 		return 0;
+
++	for (i = 0; btusb_fwcbs[i].fwfile; i++) {
++		match = usb_match_id(intf, btusb_fwcbs[i].usb_id_table);
++		if (match) {
++			btusb_fwcbs[i].bsuspend = 1;
++			break;
++		}
++	}
++
+ 	spin_lock_irq(&data->txlock);
+ 	if (!((message.event & PM_EVENT_AUTO) && data->tx_in_flight)) {
+ 		set_bit(BTUSB_SUSPENDING, &data->flags);
+@@ -1179,6 +1238,14 @@ static int __init btusb_init(void)
+
+ static void __exit btusb_exit(void)
+ {
++	int i;
++	for (i = 0; btusb_fwcbs[i].fwfile; i++) {
++		if (btusb_fwcbs[i].fwunload && btusb_fwcbs[i].data) {
++			btusb_fwcbs[i].fwunload(btusb_fwcbs[i].data,
++					btusb_fwcbs[i].bsuspend);
++			btusb_fwcbs[i].data = NULL;
++		}
++	}
+ 	usb_deregister(&btusb_driver);
+ }
+
+diff --git a/drivers/bluetooth/fwload.c b/drivers/bluetooth/fwload.c
+new file mode 100644
+index 0000000..a9a586a
+--- /dev/null
++++ b/drivers/bluetooth/fwload.c
+@@ -0,0 +1,199 @@
++/*
++ *
++ *  Generic Bluetooth USB DFU driver to download firmware to target RAM
++ *
++ *  Copyright (c) 2009-2010 Atheros Communications Inc.
++ *
++ *  This program is free software; you can redistribute it and/or modify
++ *  it under the terms of the GNU General Public License as published by
++ *  the Free Software Foundation; either version 2 of the License, or
++ *  (at your option) any later version.
++ *
++ *  This program is distributed in the hope that it will be useful,
++ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ *  GNU General Public License for more details.
++ *
++ *  You should have received a copy of the GNU General Public License
++ *  along with this program; if not, write to the Free Software
++ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
++ *
++ */
++
++#include <linux/module.h>
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/slab.h>
++#include <linux/types.h>
++#include <linux/device.h>
++#include <linux/firmware.h>
++#include <linux/usb.h>
++#include <net/bluetooth/bluetooth.h>
++
++#define USB_REQ_DFU_DNLOAD	1
++#define USB_REQ_GET_STATE	5
++#define USB_FIRMWARE_RAM_MODE 11
++#define USB_FIRMWARE_FLASH_MODE 12
++#define BULK_SIZE		4096
++#define VERSION "1.0"
++
++struct firmware_data {
++	struct usb_device *udev;
++	u8 *fw_data;
++	u32 fw_size;
++	u32 fw_sent;
++};
++
++static int load_firmware(struct firmware_data *data,
++				unsigned char *firmware,
++				int count)
++{
++	u8 *send_buf;
++	int err, pipe, len, size, sent = 0;
++	char ucFirmware = 0;
++
++	BT_DBG("ath3k %p udev %p", data, data->udev);
++
++	if ((usb_control_msg(data->udev, usb_rcvctrlpipe(data->udev, 0),
++				USB_REQ_GET_STATE,
++				USB_TYPE_VENDOR | USB_DIR_IN, 0, 0,
++				&ucFirmware, 1, USB_CTRL_SET_TIMEOUT)) < 0) {
++		BT_ERR("Can't change to loading configuration err");
++		return -EBUSY;
++	}
++
++	if (ucFirmware == USB_FIRMWARE_RAM_MODE) {
++		/* RAM based firmware is available in the target.
++		 * No need to load the firmware to RAM */
++		BT_DBG("RAM based firmware is available");
++		return 0;
++	}
++
++	pipe = usb_sndctrlpipe(data->udev, 0);
++	if ((usb_control_msg(data->udev, pipe,
++				USB_REQ_DFU_DNLOAD,
++				USB_TYPE_VENDOR, 0, 0,
++				firmware, 20, USB_CTRL_SET_TIMEOUT)) < 0) {
++		BT_ERR("Can't change to loading configuration err");
++		return -EBUSY;
++	}
++	sent += 20;
++	count -= 20;
++
++	send_buf = kmalloc(BULK_SIZE, GFP_ATOMIC);
++	if (!send_buf) {
++		BT_ERR("Can't allocate memory chunk for firmware");
++		return -ENOMEM;
++	}
++
++	while (count) {
++		size = min_t(uint, count, BULK_SIZE);
++		pipe = usb_sndbulkpipe(data->udev, 0x02);
++		memcpy(send_buf, firmware + sent, size);
++
++		err = usb_bulk_msg(data->udev, pipe, send_buf, size,
++					&len, 3000);
++
++		if (err || (len != size)) {
++			BT_ERR("Error in firmware loading err = %d,"
++				"len = %d, size = %d", err, len, size);
++			goto error;
++		}
++
++		sent  += size;
++		count -= size;
++	}
++
++	kfree(send_buf);
++	return 0;
++
++error:
++	kfree(send_buf);
++	return err;
++}
++
++void *ath_fw_load(struct usb_interface *intf,
++			const char *fwfile, bool *suspend)
++{
++	const struct firmware *firmware;
++	struct usb_device *udev = interface_to_usbdev(intf);
++	static struct firmware_data *data;
++	int size;
++
++	BT_DBG("\nintf %p suspend %d\n", intf, *suspend);
++
++	if (*suspend) {
++		load_firmware(data, data->fw_data, data->fw_size);
++		*suspend = 0;
++		return data;
++	}
++
++	if (intf->cur_altsetting->desc.bInterfaceNumber != 0)
++		return NULL;
++
++	data = kzalloc(sizeof(*data), GFP_KERNEL);
++	if (!data)
++		return NULL;
++	data->udev = udev;
++
++	if (request_firmware(&firmware, fwfile, &udev->dev) < 0) {
++		kfree(data);
++		return NULL;
++	}
++
++	size = max_t(uint, firmware->size, 4096);
++	data->fw_data = kmalloc(size, GFP_KERNEL);
++	if (!data->fw_data) {
++		release_firmware(firmware);
++		kfree(data);
++		return NULL;
++	}
++
++	memcpy(data->fw_data, firmware->data, firmware->size);
++	data->fw_size = firmware->size;
++	data->fw_sent = 0;
++	release_firmware(firmware);
++
++	if (load_firmware(data, data->fw_data, data->fw_size)) {
++		kfree(data->fw_data);
++		kfree(data);
++		return NULL;
++	}
++	return data;
++}
++EXPORT_SYMBOL(ath_fw_load);
++
++void ath_fw_unload(void *pdata, bool bsuspend)
++{
++	struct firmware_data *data = (struct firmware_data *)pdata;
++
++	if (data == NULL)
++		return;
++
++	/* do not free the data on suspend as we will
++	 * use it on resume */
++	if (!bsuspend) {
++		kfree(data->fw_data);
++		kfree(data);
++	}
++}
++EXPORT_SYMBOL(ath_fw_unload);
++
++static int __init fwload_init(void)
++{
++	BT_INFO("Firmware load driver init. Version:%s", VERSION);
++	return 0;
++}
++
++static void __exit fwload_deinit(void)
++{
++	BT_INFO("Firmware load driver deinit");
++}
++
++module_init(fwload_init);
++module_exit(fwload_deinit);
++
++MODULE_AUTHOR("Atheros Communications");
++MODULE_DESCRIPTION("Firmware load driver");
++MODULE_VERSION(VERSION);
++MODULE_LICENSE("GPL");
+diff --git a/drivers/bluetooth/fwload.h b/drivers/bluetooth/fwload.h
+new file mode 100644
+index 0000000..5c1136a
+--- /dev/null
++++ b/drivers/bluetooth/fwload.h
+@@ -0,0 +1,39 @@
++/*
++ *
++ *  Generic Bluetooth USB DFU driver to download firmware to target RAM
++ *
++ *  Copyright (c) 2009-2010 Atheros Communications Inc.
++ *
++ *  This program is free software; you can redistribute it and/or modify
++ *  it under the terms of the GNU General Public License as published by
++ *  the Free Software Foundation; either version 2 of the License, or
++ *  (at your option) any later version.
++ *
++ *  This program is distributed in the hope that it will be useful,
++ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ *  GNU General Public License for more details.
++ *
++ *  You should have received a copy of the GNU General Public License
++ *  along with this program; if not, write to the Free Software
++ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
++ *
++ */
++#ifndef _FWLOAD_H_
++#define _FWLOAD_H_
++
++/* callbacks to load firmware to BT device RAM
++ * when it is inserted */
++struct fw_cb_config {
++	const char *fwfile;
++	void * (*fwload)(struct usb_interface *intf, const char *fwfile,
++			 bool *bsuspend);
++	void (*fwunload)(void *, bool);
++	const struct usb_device_id *usb_id_table;
++	void *data;
++	bool bsuspend;
++};
++void *ath_fw_load(struct usb_interface *intf, const char *, bool *);
++void ath_fw_unload(void *pdata, bool bsuspend);
++
++#endif /* _FWLOAD_H_ */
+--
+1.6.3.3
+
-- 
1.6.3.3

^ permalink raw reply related

* Re: How to ensure pairing is done
From: Yedire, Sandeep @ 2010-10-01 10:59 UTC (permalink / raw)
  To: Waldemar.Rymarkiewicz; +Cc: linux-bluetooth
In-Reply-To: <99B09243E1A5DA4898CDD8B700111448097CF4A9D9@EXMB04.eu.tieto.com>

Thanks for help. I could not make out "Connection Refused - security block"

Please find my hcidump log message below. I have taken this during
./agent 0000 <bdaddr> and  executing ex_3_5.c application to test my
L2CAP connection. Please find source ex_3_5.c file below this email.

hcidump during agent 0000 <bdaddr>
_________________________________
#
# lockd: cannot monitor 136.170.194.184
lockd: failed to monitor 136.170.194.184
lockd: cannot monitor 136.170.194.184
lockd: failed to monitor 136.170.194.184
lockd: cannot monitor 136.170.194.184
lockd: failed to monitor 136.170.194.184
< HCI Command: Create Connection (0x01|0x0005) plen 13
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Connect Complete (0x03) plen 11
< HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
> HCI Event: Command Status (0x0f) plen 4
< HCI Command: Write Link Policy Settings (0x02|0x000d) plen 4
> HCI Event: Read Remote Supported
Features (0x0b) plen 11
> HCI Event: Command Complete (0x0e) plen 6
< HCI Command: Authentication Requested (0x01|0x0011) plen 2
> HCI Event: Command Status (0x0f) plen 4
< HCI Command: Remote Name Request (0x01|0x0019) plen 10
> HCI Event: Link Key Request (0x17) plen 6
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Page Scan Repetition Mode Change (0x20) plen 7
< HCI Command: Link Key Request Negative Reply (0x01|0x000c) plen 6
> HCI Event: Max Slots Change (0x1b) plen 3
> HCI Event: Command Complete (0x0e) plen 10
> HCI Event: PIN Code Request (0x16) plen 6
< HCI Command: PIN Code Request Reply (0x01|0x000d) plen 23
> HCI Event: Command Complete (0x0e) plen 10
> HCI Event: Remote Name Req Complete (0x07) plen 3
< HCI Command: Read Remote Version Information (0x01|0x001d) plen 2
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Read Remote Ver Info Complete (0x0c) plen 8
> HCI Event: Link Key Notification (0x18) plen 23
> HCI Event: Auth Complete (0x06) plen 3
< HCI Command: Disconnect (0x01|0x0006) plen 3
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Disconn Complete (0x05) plen 4

--------------------------------------------------------------------------------
hcidump during ex_3 application.
< HCI Command: Create Connection (0x01|0x0005) plen 13
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Connect Complete (0x03) plen 11
< ACL data: handle 11 flags 0x02 dlen 12
    L2CAP(s): Connect req: psm 25 scid 0x0040
< HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
> HCI Event: Command Status (0x0f) plen 4
< HCI Command: Write Link
Policy Settings (0x02|0x000d) plen 4
> HCI Event: Read Remote Supported Feature
s (0x0b) plen 11
> HCI Event: Command Complete (0x0e) plen 6
> HCI Event: Page Scan Repetition Mode Change (0x20) plen 7
> HCI Event: Max Slots Change (0x1b) plen 3
< HCI Command: Remote Name Request (0x01|0x0019) plen 10
> ACL data: handle 11 flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0041 scid 0x0040 result 1 status 2
      Connection pending - Authorization pending
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Remote Name Req Complete (0x07) plen 255
< HCI Command: Read Remote Version Information (0x01|0x001d) plen 2
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Read Remote Ver Info Complete (0x0c) plen 8
> HCI Event: Link Key Request (0x17) plen 6
lockd: failed to monitor 136.170.194.184
> HCI Event: Number of Completed Packets (0x13) plen 5
< HCI Command: Link Key Request Negative Reply (0x01|0x000c) plen 6
> HCI Event: Command Complete (0x0e) plen 10
> ACL data: handle 11 flags 0x02 dlen 16
    L2CAP(s): Connect rsp: dcid 0x0000 scid 0x0040 result 3 status 0
      Connection refused - security block
> HCI Event: Disconn Complete (0x05) plen 4
-----------------------------------------------------------------------------------------
#include<stdio.h>
#include<unistd.h>
#include<sys/socket.h>
#include<bluetooth/bluetooth.h>
#include<bluetooth/l2cap.h>
#include<errno.h>
int main(int argc,char **argv)
{
	struct sockaddr_l2 addr = { 0 } ;
	int s , status;
	short i = 0;
	char dest[18] = "00:1E:7C:00:B7:AD" ;
	/*if(argc < 2){
		fprintf(stderr , "usage: %s <bt_addr>\n" , argv [0]) ;
		return 1;
	}*/
	//strncpy(dest , argv[1] , 18);
	//allocate a socket
	s = socket(AF_BLUETOOTH , SOCK_SEQPACKET , BTPROTO_L2CAP ) ;
	//set the connection parameters (who to connect to)
	addr.l2_family = AF_BLUETOOTH;
	addr.l2_psm = htobs(25);
	str2ba (dest,&addr.l2_bdaddr);
	//connect to server
	if(status = connect (s, (struct sockaddr *)&addr, sizeof(addr))<0){
		fprintf(stderr,"Connection error errno-%s(%d\n",strerror(errno),errno);
		perror(errno);
		exit(-1);
	}
	else
		printf("Connected-Status =%d\n",status);
		 ;
	//send a message
	for(i=0 ; i< 10; i++){
	//if(0 == status){
		status = send(s,"hello!", 6, 0);
		printf("send return-%d\n",status);
	}
	//}
	if(status <0) perror("uh oh") ;
	close (s ) ;
	return 0;
}
----------------------------------------------------------------------------------------------
Regards,
Sandeep.Yedire

----------------------------------------------------------
T.Jefferson, 'Victory and defeat are each of the same price"



On 1 October 2010 12:21,  <Waldemar.Rymarkiewicz@tieto.com> wrote:
> Hi
>
>>I get below error message
>>l2test[476]: Can't connect: Connection refused (146)
>>
>
> I suggest to analyse hcidump first.
>
> Regards,
> /Waldek
>

^ permalink raw reply

* [PATCH] Bluetooth: clean up rfcomm code
From: Emeltchenko Andrei @ 2010-10-01  9:05 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>

Remove dead code and unused rfcomm thread events

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
---
 include/net/bluetooth/rfcomm.h |    5 -----
 net/bluetooth/rfcomm/core.c    |   29 ++++++++++++++---------------
 2 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h
index a140847..71047bc 100644
--- a/include/net/bluetooth/rfcomm.h
+++ b/include/net/bluetooth/rfcomm.h
@@ -213,11 +213,6 @@ struct rfcomm_dlc {
 #define RFCOMM_DEFER_SETUP  8
 
 /* Scheduling flags and events */
-#define RFCOMM_SCHED_STATE  0
-#define RFCOMM_SCHED_RX     1
-#define RFCOMM_SCHED_TX     2
-#define RFCOMM_SCHED_TIMEO  3
-#define RFCOMM_SCHED_AUTH   4
 #define RFCOMM_SCHED_WAKEUP 31
 
 /* MSC exchange flags */
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
index d326ad7..7af619c 100644
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -113,11 +113,10 @@ static void rfcomm_session_del(struct rfcomm_session *s);
 #define __get_rpn_stop_bits(line) (((line) >> 2) & 0x1)
 #define __get_rpn_parity(line)    (((line) >> 3) & 0x7)
 
-static inline void rfcomm_schedule(uint event)
+static inline void rfcomm_schedule(void)
 {
 	if (!rfcomm_thread)
 		return;
-	//set_bit(event, &rfcomm_event);
 	set_bit(RFCOMM_SCHED_WAKEUP, &rfcomm_event);
 	wake_up_process(rfcomm_thread);
 }
@@ -203,13 +202,13 @@ static inline int __check_fcs(u8 *data, int type, u8 fcs)
 static void rfcomm_l2state_change(struct sock *sk)
 {
 	BT_DBG("%p state %d", sk, sk->sk_state);
-	rfcomm_schedule(RFCOMM_SCHED_STATE);
+	rfcomm_schedule();
 }
 
 static void rfcomm_l2data_ready(struct sock *sk, int bytes)
 {
 	BT_DBG("%p bytes %d", sk, bytes);
-	rfcomm_schedule(RFCOMM_SCHED_RX);
+	rfcomm_schedule();
 }
 
 static int rfcomm_l2sock_create(struct socket **sock)
@@ -255,7 +254,7 @@ static void rfcomm_session_timeout(unsigned long arg)
 	BT_DBG("session %p state %ld", s, s->state);
 
 	set_bit(RFCOMM_TIMED_OUT, &s->flags);
-	rfcomm_schedule(RFCOMM_SCHED_TIMEO);
+	rfcomm_schedule();
 }
 
 static void rfcomm_session_set_timer(struct rfcomm_session *s, long timeout)
@@ -283,7 +282,7 @@ static void rfcomm_dlc_timeout(unsigned long arg)
 
 	set_bit(RFCOMM_TIMED_OUT, &d->flags);
 	rfcomm_dlc_put(d);
-	rfcomm_schedule(RFCOMM_SCHED_TIMEO);
+	rfcomm_schedule();
 }
 
 static void rfcomm_dlc_set_timer(struct rfcomm_dlc *d, long timeout)
@@ -465,7 +464,7 @@ static int __rfcomm_dlc_close(struct rfcomm_dlc *d, int err)
 	case BT_CONFIG:
 		if (test_and_clear_bit(RFCOMM_DEFER_SETUP, &d->flags)) {
 			set_bit(RFCOMM_AUTH_REJECT, &d->flags);
-			rfcomm_schedule(RFCOMM_SCHED_AUTH);
+			rfcomm_schedule();
 			break;
 		}
 		/* Fall through */
@@ -485,7 +484,7 @@ static int __rfcomm_dlc_close(struct rfcomm_dlc *d, int err)
 	case BT_CONNECT2:
 		if (test_and_clear_bit(RFCOMM_DEFER_SETUP, &d->flags)) {
 			set_bit(RFCOMM_AUTH_REJECT, &d->flags);
-			rfcomm_schedule(RFCOMM_SCHED_AUTH);
+			rfcomm_schedule();
 			break;
 		}
 		/* Fall through */
@@ -533,7 +532,7 @@ int rfcomm_dlc_send(struct rfcomm_dlc *d, struct sk_buff *skb)
 	skb_queue_tail(&d->tx_queue, skb);
 
 	if (!test_bit(RFCOMM_TX_THROTTLED, &d->flags))
-		rfcomm_schedule(RFCOMM_SCHED_TX);
+		rfcomm_schedule();
 	return len;
 }
 
@@ -545,7 +544,7 @@ void __rfcomm_dlc_throttle(struct rfcomm_dlc *d)
 		d->v24_sig |= RFCOMM_V24_FC;
 		set_bit(RFCOMM_MSC_PENDING, &d->flags);
 	}
-	rfcomm_schedule(RFCOMM_SCHED_TX);
+	rfcomm_schedule();
 }
 
 void __rfcomm_dlc_unthrottle(struct rfcomm_dlc *d)
@@ -556,7 +555,7 @@ void __rfcomm_dlc_unthrottle(struct rfcomm_dlc *d)
 		d->v24_sig &= ~RFCOMM_V24_FC;
 		set_bit(RFCOMM_MSC_PENDING, &d->flags);
 	}
-	rfcomm_schedule(RFCOMM_SCHED_TX);
+	rfcomm_schedule();
 }
 
 /*
@@ -577,7 +576,7 @@ int rfcomm_dlc_set_modem_status(struct rfcomm_dlc *d, u8 v24_sig)
 	d->v24_sig = v24_sig;
 
 	if (!test_and_set_bit(RFCOMM_MSC_PENDING, &d->flags))
-		rfcomm_schedule(RFCOMM_SCHED_TX);
+		rfcomm_schedule();
 
 	return 0;
 }
@@ -816,7 +815,7 @@ static int rfcomm_queue_disc(struct rfcomm_dlc *d)
 	cmd->fcs  = __fcs2((u8 *) cmd);
 
 	skb_queue_tail(&d->tx_queue, skb);
-	rfcomm_schedule(RFCOMM_SCHED_TX);
+	rfcomm_schedule();
 	return 0;
 }
 
@@ -1884,7 +1883,7 @@ static inline void rfcomm_accept_connection(struct rfcomm_session *s)
 		 * L2CAP MTU minus UIH header and FCS. */
 		s->mtu = min(l2cap_pi(nsock->sk)->omtu, l2cap_pi(nsock->sk)->imtu) - 5;
 
-		rfcomm_schedule(RFCOMM_SCHED_RX);
+		rfcomm_schedule();
 	} else
 		sock_release(nsock);
 }
@@ -2093,7 +2092,7 @@ static void rfcomm_security_cfm(struct hci_conn *conn, u8 status, u8 encrypt)
 
 	rfcomm_session_put(s);
 
-	rfcomm_schedule(RFCOMM_SCHED_AUTH);
+	rfcomm_schedule();
 }
 
 static struct hci_cb rfcomm_cb = {
-- 
1.7.0.4


^ permalink raw reply related

* Re: Pull request: git://git.infradead.org/users/cktakahasi/bluez.git for-upstream-doc
From: Johan Hedberg @ 2010-10-01  7:29 UTC (permalink / raw)
  To: Claudio Takahasi; +Cc: BlueZ development
In-Reply-To: <AANLkTinH3aXNZNiK-u-wL01SxCH9aPU+PRr6BTRPedjb@mail.gmail.com>

Hi Claudio,

On Thu, Sep 30, 2010, Claudio Takahasi wrote:
> The following changes since commit 3a8386d428e385d97b95a890623362321a7e3a19:
> 
>   Fix left open socket warning for attribute server (2010-09-30 17:26:55 -0300)
> 
> are available in the git repository at:
>   git://git.infradead.org/users/cktakahasi/bluez.git for-upstream-doc
> 
> Claudio Takahasi (3):
>       Add GetProperties method in the Device service hierarchy
>       Add SetProperty in the Device characteristic hierarchy
>       Fix object path in the register watcher method
> 
>  doc/attribute-api.txt |   46 ++++++++++++++--------------------------------
>  1 files changed, 14 insertions(+), 32 deletions(-)

Thanks. All patches have been pushed upstream.

Johan

^ permalink raw reply

* RE: How to ensure pairing is done
From: Waldemar.Rymarkiewicz @ 2010-10-01  6:51 UTC (permalink / raw)
  To: syedire, linux-bluetooth
In-Reply-To: <AANLkTimDw_obL=cV-CjU5OPCH+PiTqSyQ+0JTy1o+=3Q@mail.gmail.com>

Hi 

>I get below error message
>l2test[476]: Can't connect: Connection refused (146)
>

I suggest to analyse hcidump first.

Regards,
/Waldek

^ permalink raw reply

* How to ensure pairing is done
From: Yedire, Sandeep @ 2010-10-01  6:25 UTC (permalink / raw)
  To: linux-bluetooth

Hi there,
I am currently working with A2DP. I have installed Bluez-4.69 for
target(MIPS). I have also set-up dbus-daemon and bluetoothd deamon. By
executing the test programs on Bluez-4.69

./l2test -c <bdaddr>

I get below error message
l2test[476]: Can't connect: Connection refused (146)

I could connect the device by SOCK_RAW mode and able to send. But in
SOCK_SEQPACKET,  I am unable to connect and will get the above error.

Now my doubt: How do I ensure pairing is done properly?

I followed these steps below for dbus-daemon, bluetoothd
<>dbus-uuidgen --ensure
<>export DBUG_VERBOSE=1
<>adduser -DH messagebus
<>addgroup messagebus messagebus
<>dbus-daemon --system
<>bluetoothd -d
<>ps -ef to check dbus-daemon, bluetoothd running
<>./agent 0000 <baddr>

After executing the last command (./agent 000 <baddr>) the headset
changes its blinking pattern from red-blue blink to blue-blue blink.
The same behaviour happens with my mobile during pairing with my
mobile.

Please let me know if any one is aware why in  SOCK_SEQPACKET mode,
connect system call will fail.
 What is the cause of this error? I get <146> connection refused.

 How to ensure this pairing is done?

below is log message attached during execution of (./agent 0000 <baddr>)
________________________________________________________________
./agent --adapter hci0 0000 00:1E:7C:00:B7:AD
lockd: cannot monitor 136.170.194.184
lockd: failed to monitor 136.170.194.184
lockd: cannot monitor 136.170.194.184
lockd: failed to monitor 136.170.194.184
lockd: cannot monitor 136.170.194.184
lockd: failed to monitor 136.170.194.184
lockd: cannot monitor 136.170.194.184
lockd: failed to monitor 136.170.194.184
lockd: cannot monitor 136.170.194.184
lockd: failed to monitor 136.170.194.184
lockd: cannot monitor 136.170.194.184
lockd: failed to monitor 136.170.194.184
lockd: cannot monitor 136.170.194.184
lockd: failed to monitor 136.170.194.184
lockd: cannot monitor 136.170.194.184
lockd: failed to monitor 136.170.194.184
Pincode request for device /org/bluez/379/hci0/dev_00_1E_7C_00_B7_AD
lockd: cannot monitor 136.170.194.184
lockd: failed to monitor 136.170.194.184
lockd: cannot monitor 136.170.194.184
lockd: failed to monitor 136.170.194.184
lockd: cannot monitor 136.170.194.184
lockd: failed to monitor 136.170.194.184
lockd: cannot monitor 136.170.194.184
lockd: failed to monitor 136.170.194.184
Agent has been released
<>
Regards,
Sandeep.Yedire

----------------------------------------------------------
T.Jefferson, 'Victory and defeat are each of the same price"

^ permalink raw reply

* Re: pull-request: bluetooth-2.6 2010-09-27
From: Gustavo F. Padovan @ 2010-10-01  1:22 UTC (permalink / raw)
  To: David Miller; +Cc: linville, marcel, linux-bluetooth, netdev
In-Reply-To: <20100930.172657.123994559.davem@davemloft.net>

Hi Dave,

* David Miller <davem@davemloft.net> [2010-09-30 17:26:57 -0700]:

> From: "Gustavo F. Padovan" <padovan@profusion.mobi>
> Date: Tue, 28 Sep 2010 19:49:41 -0300
> 
> > Actually sk_stream_wait_memory is another point why it's safe to release
> > the lock and block waiting for memory. We've been doing that safely in
> > protocols like TCP, SCTP and DCCP for a long time.
> 
> Do you notice what TCP does when sk_stream_wait_memory() returns?
> 
> It reloads all volatile state that might have changed in the socket
> while the lock was dropped.
> 
> For example, TCP will reload the current MSS that can change
> asynchronously while we don't have the socket lock.

I got your point. And what I tried to say in the last e-mail is that
ERTM doesn't have such volatile states that need to restore after get
the lock back. The others code path it affect are very simple and also
doesn't have such problem. So we are safe against asynchronous changes.
We obvious have volatiles states, but the code paths where
bt_skb_send_alloc() is used doesn't rely on that states. I'm seeing no
problem on release the lock, alloc memory, and lock it again.

-- 
Gustavo F. Padovan
ProFUSION embedded systems - http://profusion.mobi

^ permalink raw reply

* Re: pull-request: bluetooth-2.6 2010-09-27
From: David Miller @ 2010-10-01  0:26 UTC (permalink / raw)
  To: padovan; +Cc: linville, marcel, linux-bluetooth, netdev
In-Reply-To: <20100928224941.GA19409@vigoh>

From: "Gustavo F. Padovan" <padovan@profusion.mobi>
Date: Tue, 28 Sep 2010 19:49:41 -0300

> Actually sk_stream_wait_memory is another point why it's safe to release
> the lock and block waiting for memory. We've been doing that safely in
> protocols like TCP, SCTP and DCCP for a long time.

Do you notice what TCP does when sk_stream_wait_memory() returns?

It reloads all volatile state that might have changed in the socket
while the lock was dropped.

For example, TCP will reload the current MSS that can change
asynchronously while we don't have the socket lock.

^ permalink raw reply

* Pull request: git://git.infradead.org/users/cktakahasi/bluez.git for-upstream-doc
From: Claudio Takahasi @ 2010-09-30 21:57 UTC (permalink / raw)
  To: BlueZ development; +Cc: CLAUDIO TAKAHASI

The following changes since commit 3a8386d428e385d97b95a890623362321a7e3a19:

  Fix left open socket warning for attribute server (2010-09-30 17:26:55 -0300)

are available in the git repository at:
  git://git.infradead.org/users/cktakahasi/bluez.git for-upstream-doc

Claudio Takahasi (3):
      Add GetProperties method in the Device service hierarchy
      Add SetProperty in the Device characteristic hierarchy
      Fix object path in the register watcher method

 doc/attribute-api.txt |   46 ++++++++++++++--------------------------------
 1 files changed, 14 insertions(+), 32 deletions(-)

^ permalink raw reply

* Re: Pull request: git://git.infradead.org/users/cktakahasi/bluez.git for-upstream
From: Claudio Takahasi @ 2010-09-30 21:51 UTC (permalink / raw)
  To: Claudio Takahasi, BlueZ development
In-Reply-To: <AANLkTikADcqHYfOjmRQVEDdPuU9mrGVvAVGNUdRTsQcd@mail.gmail.com>

On Thu, Sep 30, 2010 at 11:28 AM, Claudio Takahasi
<claudio.takahasi@openbossa.org> wrote:
> On Thu, Sep 30, 2010 at 4:39 AM, Johan Hedberg <johan.hedberg@gmail.com> wrote:
>> Hi Claudio,
>>
>> On Wed, Sep 29, 2010, Claudio Takahasi wrote:
>>> StartDiscovery() triggers all the process. The adapter type: BR/EDR
>>> only/LE only or dual mode is hidden from the higher layers.
>>> So, your suggestion it try to hide all discovery details inside the
>>> hciops as much as possible?
>>
>> That was the idea yes, but I'm not 100% sure that it's the best
>> approach. Another question is also how do we want to represent this with
>> the new management interface. Should the kernel do it "all" through a
>> single request from userspace or should userspace control the separate
>> BR/EDR and LE discoveries. If it's the former, then having a single
>> adapter_ops callback makes sense. If it's the later then we should
>> probably have two separate ones. Either way I now realize that to
>> implement this with a single callback we'd need to have the HCI event
>> processing moved over to hciops and that's not something that will
>> happen very quickly. So maybe it's better to have these as two separate
>> adapter_ops callbacks for now.
>>
>> Johan
>>
>
> Another point is: scanning needs to be disabled "actively", it is not
> possible to inform a scanning length like inquiry, it is necessary to
> create a timeout to disable the scanning. Joining inquiry and scanning
> inside a single adapter_ops callback will be hard to control the
> discovery procedure "states". So for now, I prefer two separate
> callbacks due the scanning timeout and HCI events processing.
>
> However, for the new management interface, one single request seems to
> be more appropriate but extra requests will be necessary to setup the
> scan and inquiry parameters.
>
> Claudio
>

New pull request! Patches rebased and a new hciops callback function
has been added to export the write LE host supported command.

The following changes since commit 3a8386d428e385d97b95a890623362321a7e3a19:

  Fix left open socket warning for attribute server (2010-09-30 17:26:55 -0300)

are available in the git repository at:
  git://git.infradead.org/users/cktakahasi/bluez.git for-upstream

Claudio Takahasi (23):
      Add LE start and stop scanning
      Remove RSSI field from the advertising report event
      Decoding the RSSI parameter from the advertising report event
      Send Discovering property "FALSE" when the interleave finishes
      Add length argument on hciops start discovery function
      Stop inquiry using the length parameter
      Fix remote name resolution for interleave discovery
      Add Write LE host supported function
      Set the LE host supported and disable simultaneous LE and BR/EDR flags
      Add extended feature mask constants definition
      Read the local extended features
      Stop LE scanning when discovery is suspended
      Rename hciops {start, stop}_discovery to {start, stop}_inquiry
      Don't enter on interleave mode if there isn't active sessions
      Code cleanup: improving inquiry logic
      Clear the remote device found list in the state transition
      Fix periodic inquiry signals
      Fixing DeviceDisappeared signal
      Postpone discovery if still resolving names
      Add adapter discovery type function
      Do not send another Discovering TRUE signal if still resolving names
      Forcing periodic inquiry exit
      Fix interleave scanning

Vinicius Costa Gomes (1):
      Add BR/EDR LE interleaved discovery

 lib/hci.c        |   29 +++++
 lib/hci.h        |   17 +++-
 lib/hci_lib.h    |    1 +
 plugins/hciops.c |   69 +++++++++++-
 src/adapter.c    |  301 +++++++++++++++++++++++++++++++++++++-----------------
 src/adapter.h    |   38 ++++---
 src/dbus-hci.c   |   45 +++++++--
 src/dbus-hci.h   |    1 +
 src/security.c   |  131 ++++++++++++++----------
 9 files changed, 449 insertions(+), 183 deletions(-)

^ permalink raw reply

* Re: Pull request: git://git.infradead.org/users/cktakahasi/bluez.git for-upstream-attrib
From: Johan Hedberg @ 2010-09-30 21:04 UTC (permalink / raw)
  To: Claudio Takahasi; +Cc: BlueZ development
In-Reply-To: <AANLkTi=m3MrgF=mJ54wMVH+0b5O9jwciw-HcChpF7HiG@mail.gmail.com>

Hi Claudio,

On Thu, Sep 30, 2010, Claudio Takahasi wrote:
> New pull request, patches rebased!
> 
> The following changes since commit f7b4b3fcd1190d231b864730c821b98fb945e439:
> 
>   Move connection list fetching to hciops (2010-09-30 22:12:37 +0300)
> 
> are available in the git repository at:
>   git://git.infradead.org/users/cktakahasi/bluez.git for-upstream-attrib
> 
> Bruna Moreira (1):
>       Use bt_io_connect in gatttool
> 
> Claudio Takahasi (4):
>       Add L2CAP fixed channels support for BTIO
>       Add characteristic SetProperty implementation
>       Fix invalid read and memory leak in the attribute server
>       Fix left open socket warning for attribute server
> 
> Gustavo F. Padovan (1):
>       l2test: add support to the fixed channels
> 
> Vinicius Costa Gomes (5):
>       Fix filtering out LE events
>       Add support for LE connections to gatttool
>       Add support for LE connections to the GATT server
>       Fix ValueChanged not being called on registered agents
>       Add "Services" property in the org.bluez.Device interface
> 
>  Makefile.am         |    2 +-
>  attrib/client.c     |  122 +++++++++++++++++++++++++++++++++++++++------------
>  attrib/client.h     |    5 +-
>  attrib/gatttool.c   |  121 +++++++++++++++-----------------------------------
>  attrib/manager.c    |   12 +----
>  btio/btio.c         |   37 +++++++++++----
>  btio/btio.h         |    1 +
>  src/adapter.c       |    3 +
>  src/attrib-server.c |   29 ++++++++++--
>  src/device.c        |   29 ++++++++++--
>  src/device.h        |    1 +
>  src/security.c      |    1 +
>  test/l2test.c       |   26 +++++++++--
>  13 files changed, 238 insertions(+), 151 deletions(-)

Thanks. All patches have been pushed upstream.

Johan

^ permalink raw reply

* Re: Pull request: git://git.infradead.org/users/cktakahasi/bluez.git for-upstream-attrib
From: Claudio Takahasi @ 2010-09-30 20:34 UTC (permalink / raw)
  To: BlueZ development; +Cc: CLAUDIO TAKAHASI
In-Reply-To: <AANLkTinG4Bpq7uo7v8OrSLjozjJG4XOviGuTnaSbS_Nz@mail.gmail.com>

On Thu, Sep 30, 2010 at 11:24 AM, Claudio Takahasi
<claudio.takahasi@openbossa.org> wrote:
> The following changes since commit b5c556ef59a9a8318b239453c3d4a8aad951689f:
>
>  Move adapter address reading to hciops (2010-09-29 16:34:55 +0300)
>
> are available in the git repository at:
>  git://git.infradead.org/users/cktakahasi/bluez.git for-upstream-attrib
>
> Bruna Moreira (1):
>      Use bt_io_connect in gatttool
>
> Claudio Takahasi (4):
>      Add L2CAP fixed channels support for BTIO
>      Add characteristic SetProperty implementation
>      Fix invalid read and memory leak in the attribute server
>      Fix left open socket warning for attribute server
>
> Gustavo F. Padovan (1):
>      l2test: add support to the fixed channels
>
> Vinicius Costa Gomes (5):
>      Fix filtering out LE events
>      Add support for LE connections to gatttool
>      Add support for LE connections to the GATT server
>      Fix ValueChanged not being called on registered agents
>      Add "Services" property in the org.bluez.Device interface
>
>  Makefile.am         |    2 +-
>  attrib/client.c     |  122 +++++++++++++++++++++++++++++++++++++++------------
>  attrib/client.h     |    5 +-
>  attrib/gatttool.c   |  121 +++++++++++++++-----------------------------------
>  attrib/manager.c    |   12 +----
>  btio/btio.c         |   37 +++++++++++----
>  btio/btio.h         |    1 +
>  src/adapter.c       |    3 +
>  src/attrib-server.c |   29 ++++++++++--
>  src/device.c        |   29 ++++++++++--
>  src/device.h        |    1 +
>  src/security.c      |    1 +
>  test/l2test.c       |   26 +++++++++--
>  13 files changed, 238 insertions(+), 151 deletions(-)
>

New pull request, patches rebased!

The following changes since commit f7b4b3fcd1190d231b864730c821b98fb945e439:

  Move connection list fetching to hciops (2010-09-30 22:12:37 +0300)

are available in the git repository at:
  git://git.infradead.org/users/cktakahasi/bluez.git for-upstream-attrib

Bruna Moreira (1):
      Use bt_io_connect in gatttool

Claudio Takahasi (4):
      Add L2CAP fixed channels support for BTIO
      Add characteristic SetProperty implementation
      Fix invalid read and memory leak in the attribute server
      Fix left open socket warning for attribute server

Gustavo F. Padovan (1):
      l2test: add support to the fixed channels

Vinicius Costa Gomes (5):
      Fix filtering out LE events
      Add support for LE connections to gatttool
      Add support for LE connections to the GATT server
      Fix ValueChanged not being called on registered agents
      Add "Services" property in the org.bluez.Device interface

 Makefile.am         |    2 +-
 attrib/client.c     |  122 +++++++++++++++++++++++++++++++++++++++------------
 attrib/client.h     |    5 +-
 attrib/gatttool.c   |  121 +++++++++++++++-----------------------------------
 attrib/manager.c    |   12 +----
 btio/btio.c         |   37 +++++++++++----
 btio/btio.h         |    1 +
 src/adapter.c       |    3 +
 src/attrib-server.c |   29 ++++++++++--
 src/device.c        |   29 ++++++++++--
 src/device.h        |    1 +
 src/security.c      |    1 +
 test/l2test.c       |   26 +++++++++--
 13 files changed, 238 insertions(+), 151 deletions(-)

^ permalink raw reply

* Re: [PATCH] Change "websiteUrl" query field to more general
From: Johan Hedberg @ 2010-09-30 20:22 UTC (permalink / raw)
  To: Rafal Michalski; +Cc: linux-bluetooth
In-Reply-To: <1285854113-13649-1-git-send-email-michalski.raf@gmail.com>

Hi Rafal,

On Thu, Sep 30, 2010, Rafal Michalski wrote:
> "websiteUrl" query field is replaced by more general "url" because
> previously web address wasn't downloaded in each case.
> ---
>  plugins/phonebook-tracker.c |   12 ++++++------
>  1 files changed, 6 insertions(+), 6 deletions(-)

The patch has been pushed upstream. Thanks.

Johan

^ permalink raw reply

* Re: [PATCH 1/4] Add the Attribute interface to the API
From: Claudio Takahasi @ 2010-09-30 18:48 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth, Vinicius Costa Gomes
In-Reply-To: <AANLkTinp8bmy9y-GrQsFPDxdJkPK7n5dixaKsVZtJv0h@mail.gmail.com>

On Wed, Sep 29, 2010 at 5:00 PM, Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
> Hi,
>
> On Wed, Sep 29, 2010 at 5:52 PM, Claudio Takahasi
> <claudio.takahasi@openbossa.org> wrote:
>>>
>>> What's the motivation of moving this into its own D-Bus interface? I
>>> thought the plan was to abstract both traditional SDP and ATT behind the
>>> same API in which case having this in the Device interface makes more
>>> sense imho.
>>>
>>> Johan
>>>
>>
>> Hi Johan,
>>
>> we forgot the SDP integration plan. Forget this patch.
>>
>> From the implementation point of view, implement inside the attrib
>> client plugin was the easiest way, if we keep this property inside the
>> Device interface a new function needs to be created in device.h to
>> register the available primary services object paths.
>
> Well there is a more complicated way, which is to add support for
> user_data per method/property, so a plugin could directly register
> their methods and properties in e.g. Adapter and Device interfaces. Of
> course this has drawbacks since the API could really became a mess
> with plugins doing there thing carelessly, but in the other hand it
> can greatly simplify the interfaces like Device.Disconnect()
> propagation.
>
> Just a crazy idea I had late in the night :D
>
> --
> Luiz Augusto von Dentz
> Computer Engineer
>

Please ignore this patch sequence. A proper pull request will be sent
to the ML containing the last 3 patches only.
This patch [PATCH 1/4] will be removed.


Claudio

^ permalink raw reply

* Re: [PATCH] Fix handlig for gboolean mce_bt_set field
From: Anderson Lizardo @ 2010-09-30 15:15 UTC (permalink / raw)
  To: Gustavo F. Padovan; +Cc: Rafal Michalski, linux-bluetooth
In-Reply-To: <20100930085136.GC3048@vigoh>

On Thu, Sep 30, 2010 at 4:51 AM, Gustavo F. Padovan
<padovan@profusion.mobi> wrote:
>> diff --git a/plugins/maemo6.c b/plugins/maemo6.c
>> index c96731d..45d96b8 100644
>> --- a/plugins/maemo6.c
>> +++ b/plugins/maemo6.c
>> @@ -71,7 +71,8 @@ static gboolean mce_signal_callback(DBusConnection *connection,
>>
>>               /* set the adapter according to the mce signal
>>                  and remember the value */
>> -             mce_bt_set = sigvalue & MCE_RADIO_STATE_BLUETOOTH;
>> +             mce_bt_set = (sigvalue & MCE_RADIO_STATE_BLUETOOTH) ==
>> +                                             MCE_RADIO_STATE_BLUETOOTH;
>
> Alternatively you can do
>        mce_bt_set = !!(sigvalue & MCE_RADIO_STATE_BLUETOOTH)

I'm a bit late, but:

mce_bt_set = (sigvalue & MCE_RADIO_STATE_BLUETOOTH) != 0;

would equally work.

PS: yes, I know it's already commited. :). Interestingly, there is
only one more occurrence of this idiom already in bluez code:

input/device.c:	connected = !!g_slist_find_custom(idev->connections, NULL,

Regards,
-- 
Anderson Lizardo
OpenBossa Labs - INdT
Manaus - Brazil

^ permalink raw reply

* Re: Pull request: git://git.infradead.org/users/cktakahasi/bluez.git for-upstream
From: Claudio Takahasi @ 2010-09-30 14:28 UTC (permalink / raw)
  To: Claudio Takahasi, BlueZ development
In-Reply-To: <20100930073938.GA6964@jh-x301>

On Thu, Sep 30, 2010 at 4:39 AM, Johan Hedberg <johan.hedberg@gmail.com> wrote:
> Hi Claudio,
>
> On Wed, Sep 29, 2010, Claudio Takahasi wrote:
>> StartDiscovery() triggers all the process. The adapter type: BR/EDR
>> only/LE only or dual mode is hidden from the higher layers.
>> So, your suggestion it try to hide all discovery details inside the
>> hciops as much as possible?
>
> That was the idea yes, but I'm not 100% sure that it's the best
> approach. Another question is also how do we want to represent this with
> the new management interface. Should the kernel do it "all" through a
> single request from userspace or should userspace control the separate
> BR/EDR and LE discoveries. If it's the former, then having a single
> adapter_ops callback makes sense. If it's the later then we should
> probably have two separate ones. Either way I now realize that to
> implement this with a single callback we'd need to have the HCI event
> processing moved over to hciops and that's not something that will
> happen very quickly. So maybe it's better to have these as two separate
> adapter_ops callbacks for now.
>
> Johan
>

Another point is: scanning needs to be disabled "actively", it is not
possible to inform a scanning length like inquiry, it is necessary to
create a timeout to disable the scanning. Joining inquiry and scanning
inside a single adapter_ops callback will be hard to control the
discovery procedure "states". So for now, I prefer two separate
callbacks due the scanning timeout and HCI events processing.

However, for the new management interface, one single request seems to
be more appropriate but extra requests will be necessary to setup the
scan and inquiry parameters.

Claudio

^ permalink raw reply

* Pull request: git://git.infradead.org/users/cktakahasi/bluez.git for-upstream-attrib
From: Claudio Takahasi @ 2010-09-30 14:24 UTC (permalink / raw)
  To: BlueZ development; +Cc: CLAUDIO TAKAHASI

The following changes since commit b5c556ef59a9a8318b239453c3d4a8aad951689f:

  Move adapter address reading to hciops (2010-09-29 16:34:55 +0300)

are available in the git repository at:
  git://git.infradead.org/users/cktakahasi/bluez.git for-upstream-attrib

Bruna Moreira (1):
      Use bt_io_connect in gatttool

Claudio Takahasi (4):
      Add L2CAP fixed channels support for BTIO
      Add characteristic SetProperty implementation
      Fix invalid read and memory leak in the attribute server
      Fix left open socket warning for attribute server

Gustavo F. Padovan (1):
      l2test: add support to the fixed channels

Vinicius Costa Gomes (5):
      Fix filtering out LE events
      Add support for LE connections to gatttool
      Add support for LE connections to the GATT server
      Fix ValueChanged not being called on registered agents
      Add "Services" property in the org.bluez.Device interface

 Makefile.am         |    2 +-
 attrib/client.c     |  122 +++++++++++++++++++++++++++++++++++++++------------
 attrib/client.h     |    5 +-
 attrib/gatttool.c   |  121 +++++++++++++++-----------------------------------
 attrib/manager.c    |   12 +----
 btio/btio.c         |   37 +++++++++++----
 btio/btio.h         |    1 +
 src/adapter.c       |    3 +
 src/attrib-server.c |   29 ++++++++++--
 src/device.c        |   29 ++++++++++--
 src/device.h        |    1 +
 src/security.c      |    1 +
 test/l2test.c       |   26 +++++++++--
 13 files changed, 238 insertions(+), 151 deletions(-)

^ permalink raw reply

* Re: [PATCH 2/2] Bluetooth: Update conf_state with L2CAP_CONF_REQ_SENT before send config_req out in l2cap_config_req().
From: Gustavo F. Padovan @ 2010-09-30 14:00 UTC (permalink / raw)
  To: Haijun.Liu; +Cc: linux-bluetooth, ville.tervo, dan.tian, suraj
In-Reply-To: <1285836760-3234-2-git-send-email-haijun.liu@atheros.com>

Hi Haijun,

* Haijun.Liu <haijun.liu@atheros.com> [2010-09-30 16:52:40 +0800]:

> 
> Signed-off-by: Haijun.Liu <haijun.liu@atheros.com>
> ---
>  net/bluetooth/l2cap_core.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
> index 279f98a..9e788c2 100644
> --- a/net/bluetooth/l2cap_core.c
> +++ b/net/bluetooth/l2cap_core.c

Patch has been applied to my bluetooth-next-2.6 tree with modifications
to the commit message and subject. Next time pay attention to not
overstep the 72 characters in the commit subject and do not add a "." in
the end of your subject. Thanks.

-- 
Gustavo F. Padovan
ProFUSION embedded systems - http://profusion.mobi

^ permalink raw reply

* Re: [PATCH 1/2] Bluetooth: Replace hard code of configuration flag with self-comment macro.
From: Gustavo F. Padovan @ 2010-09-30 13:56 UTC (permalink / raw)
  To: Haijun.Liu; +Cc: linux-bluetooth, ville.tervo, dan.tian, suraj
In-Reply-To: <1285836760-3234-1-git-send-email-haijun.liu@atheros.com>

Hi Haijun,

* Haijun.Liu <haijun.liu@atheros.com> [2010-09-30 16:52:39 +0800]:

> 
> Signed-off-by: Haijun.Liu <haijun.liu@atheros.com>
> ---
>  net/bluetooth/l2cap_core.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)

Your patch doesn't build:

net/bluetooth/l2cap_core.c: In function 'l2cap_config_req':
net/bluetooth/l2cap_core.c:2988: error: 'L2CAP_CONF_FLAG_CONT'
undeclared (first use in this function)                                                                
net/bluetooth/l2cap_core.c:2988: error: (Each undeclared identifier is
reported only once                                                                             
net/bluetooth/l2cap_core.c:2988: error: for each function it appears
in.)
net/bluetooth/l2cap_core.c: In function 'l2cap_config_rsp':
net/bluetooth/l2cap_core.c:3096: error: 'L2CAP_CONF_FLAG_CONT'
undeclared (first use in this function) 


You also have to fix your commit subject, it would be good if you can do
it with 50 characters, but never overstep the 72 characters. If need to
add more info the commit message is there for you ;)

-- 
Gustavo F. Padovan
ProFUSION embedded systems - http://profusion.mobi

^ permalink raw reply

* [PATCH] Change "websiteUrl" query field to more general
From: Rafal Michalski @ 2010-09-30 13:41 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Rafal Michalski

"websiteUrl" query field is replaced by more general "url" because
previously web address wasn't downloaded in each case.
---
 plugins/phonebook-tracker.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/plugins/phonebook-tracker.c b/plugins/phonebook-tracker.c
index 2d94bc6..c10491d 100644
--- a/plugins/phonebook-tracker.c
+++ b/plugins/phonebook-tracker.c
@@ -64,7 +64,7 @@
 	"nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) "	\
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) ?f nco:emailAddress(?ew) "	\
-	"nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) "	\
+	"nco:birthDate(?c) nco:nickname(?c) nco:url(?c) "		\
 	"nco:photo(?c) nco:fullname(?o) nco:department(?a) "		\
 	"nco:role(?a) nco:pobox(?pw) nco:extendedAddress(?pw) "		\
 	"nco:streetAddress(?pw) nco:locality(?pw) nco:region(?pw) "	\
@@ -116,7 +116,7 @@
 	"nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) "	\
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) \"\" nco:emailAddress(?ew) "\
-	"nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) "	\
+	"nco:birthDate(?c) nco:nickname(?c) nco:url(?c) "		\
 	"nco:photo(?c) nco:fullname(?o) nco:department(?a) "		\
 	"nco:role(?a) nco:pobox(?pw) nco:extendedAddress(?pw) "		\
 	"nco:streetAddress(?pw) nco:locality(?pw) nco:region(?pw) "	\
@@ -188,7 +188,7 @@
 	"nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) "	\
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) \"\" nco:emailAddress(?ew) "\
-	"nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) "	\
+	"nco:birthDate(?c) nco:nickname(?c) nco:url(?c) "		\
 	"nco:photo(?c) nco:fullname(?o) nco:department(?a) "		\
 	"nco:role(?a) nco:pobox(?pw) nco:extendedAddress(?pw) "		\
 	"nco:streetAddress(?pw) nco:locality(?pw) nco:region(?pw) "	\
@@ -260,7 +260,7 @@
 	"nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) "	\
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) \"\" nco:emailAddress(?ew)"	\
-	"nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) "	\
+	"nco:birthDate(?c) nco:nickname(?c) nco:url(?c) "		\
 	"nco:photo(?c) nco:fullname(?o) nco:department(?a) "		\
 	"nco:role(?a) nco:pobox(?pw) nco:extendedAddress(?pw) "		\
 	"nco:streetAddress(?pw) nco:locality(?pw) nco:region(?pw) "	\
@@ -328,7 +328,7 @@
 	"nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) "	\
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) \"\" nco:emailAddress(?ew) "\
-	"nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) "	\
+	"nco:birthDate(?c) nco:nickname(?c) nco:url(?c) "		\
 	"nco:photo(?c) nco:fullname(?o) nco:department(?a) "		\
 	"nco:role(?a) nco:pobox(?pw) nco:extendedAddress(?pw) "		\
 	"nco:streetAddress(?pw) nco:locality(?pw) nco:region(?pw) "	\
@@ -443,7 +443,7 @@
 	"nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) "	\
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) ?f  nco:emailAddress(?ew)"	\
-	"nco:birthDate(<%s>) nco:nickname(<%s>) nco:websiteUrl(<%s>) "	\
+	"nco:birthDate(<%s>) nco:nickname(<%s>) nco:url(<%s>) "		\
 	"nco:photo(<%s>) nco:fullname(?o) nco:department(?a) "		\
 	"nco:role(?a) nco:pobox(?pw) nco:extendedAddress(?pw) "		\
 	"nco:streetAddress(?pw) nco:locality(?pw) nco:region(?pw) "	\
-- 
1.6.3.3


^ permalink raw reply related

* Re: [PATCH] Fix handlig for gboolean mce_bt_set field
From: Johan Hedberg @ 2010-09-30 10:49 UTC (permalink / raw)
  To: Rafal Michalski; +Cc: linux-bluetooth
In-Reply-To: <1285842160-4127-1-git-send-email-michalski.raf@gmail.com>

Hi Rafal,

On Thu, Sep 30, 2010, Rafal Michalski wrote:
> Expression (sigvalue & MCE_RADIO_STATE_BLUETOOTH) is invalid because it makes
> wrong assumption about that it evaluates to TRUE, when bit
> MCE_RADIO_STATE_BLUETOOTH is set. In this case, assignment
> mce_bt_set = (sigvalue & MCE_RADIO_STATE_BLUETOOTH) makes that gboolean
> "mce_bt_set" receives value equal 8 instead of TRUE (equal 1). So condition in
> "if (mce_bt_set == powered)" statement will never evaluate to true because
> gboolean "powered" receives only TRUE (equal 1) or FALSE (equal 0) value.
> We should remember that gboolean type is not bool type in C++ sense.
> It's simply typedef of gint (int), so assignmnet:
> mce_bt_set = (sigvalue & MCE_RADIO_STATE_BLUETOOTH) is valid for compiler but
> in our case it makes a bug. So normalization (double negation) in assignment:
> mce_bt_set = !!(sigvalue & MCE_RADIO_STATE_BLUETOOTH) preserves that
> "mce_bt_set" will receive only TRUE or FALSE value.
> ---
>  plugins/maemo6.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Thanks. The patch has been pushed upstream with a much simplified commit
message (the above is really quite complicated to read compared to the
simplicity of the actual fix).

Johan

^ permalink raw reply

* [PATCH] Fix handlig for gboolean mce_bt_set field
From: Rafal Michalski @ 2010-09-30 10:22 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Rafal Michalski

Expression (sigvalue & MCE_RADIO_STATE_BLUETOOTH) is invalid because it makes
wrong assumption about that it evaluates to TRUE, when bit
MCE_RADIO_STATE_BLUETOOTH is set. In this case, assignment
mce_bt_set = (sigvalue & MCE_RADIO_STATE_BLUETOOTH) makes that gboolean
"mce_bt_set" receives value equal 8 instead of TRUE (equal 1). So condition in
"if (mce_bt_set == powered)" statement will never evaluate to true because
gboolean "powered" receives only TRUE (equal 1) or FALSE (equal 0) value.
We should remember that gboolean type is not bool type in C++ sense.
It's simply typedef of gint (int), so assignmnet:
mce_bt_set = (sigvalue & MCE_RADIO_STATE_BLUETOOTH) is valid for compiler but
in our case it makes a bug. So normalization (double negation) in assignment:
mce_bt_set = !!(sigvalue & MCE_RADIO_STATE_BLUETOOTH) preserves that
"mce_bt_set" will receive only TRUE or FALSE value.
---
 plugins/maemo6.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/plugins/maemo6.c b/plugins/maemo6.c
index c96731d..c396db0 100644
--- a/plugins/maemo6.c
+++ b/plugins/maemo6.c
@@ -71,7 +71,7 @@ static gboolean mce_signal_callback(DBusConnection *connection,
 
 		/* set the adapter according to the mce signal
 		   and remember the value */
-		mce_bt_set = sigvalue & MCE_RADIO_STATE_BLUETOOTH;
+		mce_bt_set = !!(sigvalue & MCE_RADIO_STATE_BLUETOOTH);
 
 		if (mce_bt_set)
 			btd_adapter_switch_online(adapter);
-- 
1.6.3.3


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox