* Re: [PATCH] Added firmware load patch to crap directory.
From: Julian Calaby @ 2010-10-03 22:13 UTC (permalink / raw)
To: Bala Shanmugam; +Cc: linux-wireless, marcel, linux-bluetooth, linux-kernel
In-Reply-To: <1286118002-2354-1-git-send-email-sbalashanmugam@atheros.com>
On Mon, Oct 4, 2010 at 02:00, Bala Shanmugam <sbalashanmugam@atheros.com> wrote:
> +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 sflash based device there is not enough memory to support HCI commands in firmware.
> +So load firmware from btusb when the device comes up.
Stupid question: What's to stop you from producing a driver that
connects to this device when unflashed, loads the firmware, then hands
it over to the proper HCI bluetooth driver? (other than it being an
ugly hack)
You could post such a driver to Linux-usb and "solve" the problem in a
way that (should) make everyone happy.
Thanks,
--
Julian Calaby
Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/
^ permalink raw reply
* [PATCH] Added firmware load patch to crap directory.
From: Bala Shanmugam @ 2010-10-03 15:00 UTC (permalink / raw)
To: linux-wireless; +Cc: marcel, linux-bluetooth, linux-kernel, Bala Shanmugam
This patch in crap directory enables btusb to load firmware
to device RAM when it is plugged in.
Signed-off-by: Bala Shanmugam <sbalashanmugam@atheros.com>
---
crap/0003-btusb-Add-fw-load-support.patch | 424 +++++++++++++++++++++++++++++
1 files changed, 424 insertions(+), 0 deletions(-)
create mode 100644 crap/0003-btusb-Add-fw-load-support.patch
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..6642d6b
--- /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 sflash based device there is not 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: a2dp, myth, pulse
From: Brad Midgley @ 2010-10-02 14:21 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <AANLkTikuh82wX5ZhwihKC+WBwdJD78SSDq13Ks=qZCc6@mail.gmail.com>
sorry guys, you can crash mythtv if you don't drain the socket...
#***
#*********************************************************************
#*************************************************************************
#***
#*** GizmoDaemon Config Script
#*** AVRCP controls for MythTV
#***
#*****************************************
#*****************************************
#***
from GizmoDaemon import *
from GizmoScriptEnableChecker import *
import sys
import telnetlib
import time
ENABLED = True
VERSION_NEEDED = 3.2
class AVRCPMythTV(GizmoScriptEnableChecker):
"""
CatchAll Event Mapping for Testing
"""
def msend(self, msg):
telnet = telnetlib.Telnet("localhost", 6546)
telnet.read_until("# ")
time.sleep(0.1)
telnet.write(msg + "\n")
time.sleep(0.1)
telnet.read_eager()
telnet.write("quit\n")
time.sleep(0.1)
telnet.read_all()
telnet.close
def onEvent(self, Event, Gizmo = None):
"""
See GizmodDispatcher.onEvent documention for an explanation of this function
"""
if Event.Remote:
return False
if Event.Class != GizmoEventClass.Standard:
return False
if Event.Type != GizmoEventType.EV_KEY:
return False
if Event.Value != 1:
return False
name = str(Event.Code)
if name == "KEY_NEXTSONG":
self.msend("key right")
return True
elif name == "KEY_PLAYCD" or name == "KEY_PAUSECD":
self.msend("key p")
return True
elif name == "KEY_STOPCD":
self.msend("key escape")
return True
elif name == "KEY_PREVIOUSSONG":
self.msend("key left")
return True
return False
def __init__(self):
"""
Default Constructor
"""
GizmoScriptEnableChecker.__init__(self, ENABLED, VERSION_NEEDED)
AVRCPMythTV()
^ permalink raw reply
* Re: >net-wireless/bluez-4.63 unable to connect audio streams due commit
From: Pacho Ramos @ 2010-10-02 13:58 UTC (permalink / raw)
To: Johan Hedberg; +Cc: linux-bluetooth
In-Reply-To: <20100920184943.GA22968@jh-x301>
[-- Attachment #1.1: Type: text/plain, Size: 1245 bytes --]
El lun, 20-09-2010 a las 21:49 +0300, Johan Hedberg escribió:
> Hi,
>
> On Mon, Sep 20, 2010, Pacho Ramos wrote:
> > Reporter found that the problem with his dongle was introduced in commit
> > aee26b30bbc24cde464ba1a557c2b258ddec6432 "Make BtIO default security
> > level MEDIUM", he asked here, on upstream mailing list, but didn't get
> > any reply clarifying this:
> > http://marc.info/?l=linux-bluetooth&m=127893935109510&w=2
>
> The important piece of info missing here is an HCI trace of the failure
> (i.e. output of hcidump). There was a similar issue reported on IRC a
> few days back and the hcidump there revealed a LMP response timeout
> after BlueZ issues a HCI_Set_Connection_Encryption command. This would
> seem to indicate a bug either in the local adapter or the remote device
> (headset). Only an airtrace would really reveal what's going on.
> However, I suspect it might be possible to work around this by looking
> into possibilities of changing the ordering and timing of when the
> kernel sends the encryption request.
>
> Johan
>
Sorry for the delay but downstream reporter wasn't able to provide the
information sooner.
Attached is hcidump output, I hope it helps :-)
Thanks a lot
[-- Attachment #1.2: hcidump.out --]
[-- Type: text/plain, Size: 6956 bytes --]
HCI sniffer - Bluetooth packet analyzer ver 1.42
device: hci0 snap_len: 1028 filter: 0xffffffffffffffff
< HCI Command: Create Connection (0x01|0x0005) plen 13
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Link Key Request (0x17) plen 6
< HCI Command: Link Key Request Reply (0x01|0x000b) plen 22
> HCI Event: Command Complete (0x0e) plen 10
> 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: Remote Name Request (0x01|0x0019) plen 10
> HCI Event: Read Remote Supported Features (0x0b) plen 11
< ACL data: handle 12 flags 0x02 dlen 10
L2CAP(s): Info req: type 2
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Max Slots Change (0x1b) plen 3
> ACL data: handle 12 flags 0x02 dlen 16
L2CAP(s): Info rsp: type 2 result 0
Extended feature mask 0x0000
< ACL data: handle 12 flags 0x02 dlen 12
L2CAP(s): Connect req: psm 1 scid 0x0040
> ACL data: handle 12 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x0049 scid 0x0040 result 1 status 2
Connection pending - Authorization pending
> HCI Event: Remote Name Req Complete (0x07) plen 255
> ACL data: handle 12 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x0049 scid 0x0040 result 0 status 0
Connection successful
< ACL data: handle 12 flags 0x02 dlen 12
L2CAP(s): Config req: dcid 0x0049 flags 0x00 clen 0
> ACL data: handle 12 flags 0x02 dlen 14
L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 0
Success
> ACL data: handle 12 flags 0x02 dlen 16
L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 4
MTU 48
< ACL data: handle 12 flags 0x02 dlen 18
L2CAP(s): Config rsp: scid 0x0049 flags 0x00 result 0 clen 4
MTU 48
< ACL data: handle 12 flags 0x02 dlen 24
L2CAP(d): cid 0x0049 len 20 [psm 1]
SDP SSA Req: tid 0x0 len 0xf
pat uuid-16 0x111e (Handsfree)
max 65535
aid(s) 0x0000 - 0xffff
cont 00
> HCI Event: Number of Completed Packets (0x13) plen 5
> ACL data: handle 12 flags 0x02 dlen 52
L2CAP(d): cid 0x0040 len 48 [psm 1]
SDP SSA Rsp: tid 0x0 len 0x2b
count 38
cont 02 00 39
< ACL data: handle 12 flags 0x02 dlen 26
L2CAP(d): cid 0x0049 len 22 [psm 1]
SDP SSA Req: tid 0x1 len 0x11
pat uuid-16 0x111e (Handsfree)
max 65535
aid(s) 0x0000 - 0xffff
cont 02 00 39
> ACL data: handle 12 flags 0x02 dlen 52
L2CAP(d): cid 0x0040 len 48 [psm 1]
SDP SSA Rsp: tid 0x1 len 0x2b
count 38
cont 02 00 13
< ACL data: handle 12 flags 0x02 dlen 26
L2CAP(d): cid 0x0049 len 22 [psm 1]
SDP SSA Req: tid 0x2 len 0x11
pat uuid-16 0x111e (Handsfree)
max 65535
aid(s) 0x0000 - 0xffff
cont 02 00 13
> ACL data: handle 12 flags 0x02 dlen 31
L2CAP(d): cid 0x0040 len 27 [psm 1]
SDP SSA Rsp: tid 0x2 len 0x16
count 19
record #0
aid 0x0000 (SrvRecHndl)
uint 0x10002
aid 0x0001 (SrvClassIDList)
< uuid-16 0x111e (Handsfree) uuid-16 0x1203 (Audio) >
aid 0x0004 (ProtocolDescList)
< < uuid-16 0x0100 (L2CAP) > <
uuid-16 0x0003 (RFCOMM) uint 0x1 > >
aid 0x0006 (LangBaseAttrIDList)
< uint 0x656e uint 0x6a uint 0x100 >
aid 0x0009 (BTProfileDescList)
< < uuid-16 0x111e (Handsfree) uint 0x101 > >
aid 0x0100 (SrvName)
str "Hands-Free unit"
aid 0x0311 (SuppFeatures)
uint 0x18
cont 00
< ACL data: handle 12 flags 0x02 dlen 12
L2CAP(s): Connect req: psm 3 scid 0x0041
> HCI Event: Number of Completed Packets (0x13) plen 5
> ACL data: handle 12 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x004a scid 0x0041 result 1 status 2
Connection pending - Authorization pending
> ACL data: handle 12 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x004a scid 0x0041 result 0 status 0
Connection successful
< ACL data: handle 12 flags 0x02 dlen 16
L2CAP(s): Config req: dcid 0x004a flags 0x00 clen 4
MTU 1013
> ACL data: handle 12 flags 0x02 dlen 14
L2CAP(s): Config rsp: scid 0x0041 flags 0x00 result 0 clen 0
Success
> ACL data: handle 12 flags 0x02 dlen 16
L2CAP(s): Config req: dcid 0x0041 flags 0x00 clen 4
MTU 1013
< ACL data: handle 12 flags 0x02 dlen 18
L2CAP(s): Config rsp: scid 0x004a flags 0x00 result 0 clen 4
MTU 1013
< ACL data: handle 12 flags 0x02 dlen 8
L2CAP(d): cid 0x004a len 4 [psm 3]
RFCOMM(s): SABM: cr 1 dlci 0 pf 1 ilen 0 fcs 0x1c
> ACL data: handle 12 flags 0x02 dlen 8
L2CAP(d): cid 0x0041 len 4 [psm 3]
RFCOMM(s): UA: cr 1 dlci 0 pf 1 ilen 0 fcs 0xd7
< HCI Command: Authentication Requested (0x01|0x0011) plen 2
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Auth Complete (0x06) plen 3
< HCI Command: Set Connection Encryption (0x01|0x0013) plen 3
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Number of Completed Packets (0x13) plen 5
< ACL data: handle 12 flags 0x02 dlen 12
L2CAP(s): Disconn req: dcid 0x0049 scid 0x0040
< ACL data: handle 12 flags 0x02 dlen 8
L2CAP(d): cid 0x004a len 4 [psm 3]
RFCOMM(s): DISC: cr 1 dlci 2 pf 1 ilen 0 fcs 0xb8
> HCI Event: Number of Completed Packets (0x13) plen 5
> HCI Event: Disconn Complete (0x05) plen 4
< HCI Command: Create Connection (0x01|0x0005) plen 13
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Link Key Request (0x17) plen 6
< HCI Command: Link Key Request Reply (0x01|0x000b) plen 22
> HCI Event: Command Complete (0x0e) plen 10
> HCI Event: Connect Complete (0x03) plen 11
< HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
> HCI Event: Max Slots Change (0x1b) plen 3
> HCI Event: Command Status (0x0f) plen 4
< HCI Command: Remote Name Request (0x01|0x0019) plen 10
> HCI Event: Read Remote Supported Features (0x0b) plen 11
< ACL data: handle 11 flags 0x02 dlen 10
L2CAP(s): Info req: type 2
> HCI Event: Command Status (0x0f) plen 4
> ACL data: handle 11 flags 0x02 dlen 16
L2CAP(s): Info rsp: type 2 result 0
Extended feature mask 0x0000
< HCI Command: Authentication Requested (0x01|0x0011) plen 2
> HCI Event: Remote Name Req Complete (0x07) plen 255
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Auth Complete (0x06) plen 3
< HCI Command: Set Connection Encryption (0x01|0x0013) plen 3
> HCI Event: Command Status (0x0f) plen 4
> HCI Event: Number of Completed Packets (0x13) plen 5
> HCI Event: Disconn Complete (0x05) plen 4
< HCI Command: Reset (0x03|0x0003) plen 0
> HCI Event: Command Complete (0x0e) plen 4
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* Re: a2dp, myth, pulse
From: Brad Midgley @ 2010-10-02 0:45 UTC (permalink / raw)
To: Sander van Grieken; +Cc: linux-bluetooth
In-Reply-To: <AANLkTi=bx1Bv1GD9SuMGbYcE-NNK5e0x5N3Oz-FkH-Zm@mail.gmail.com>
Guys
> unfortunately there isn't a clear way to merge a udp/hdhomerun remote
> coming in on lircd with avrcp events from inputlircd. I'll take it up
> with the lirc folks and summarize here later.
lirc should be used to inject input events and probably nothing else.
There are three different lirc daemon flavors, each one missing key
features. If you need to merge multiple sources, you have to do a
confusing dance with tcp sockets, master servers, etc. Unfortunately,
the event driver interface is one thing in lirc that apparently
doesn't work at all.
I made it work instead with gizmod talking to the mythtv telnet
control connection, see script.
Gizmod does have a problem with its compile prefix, see
https://bugs.launchpad.net/ubuntu/+source/gizmod/+bug/645058
So, the complete hack under ubuntu 10.04...
* add uinput to /etc/modules
* tell myth to use the pulse device
* add to /etc/pulse/default.pa: load-module module-alsa-sink device=plug:dmix
* click the headset button to connect it
* use pavucontrol to move the myth stream over to the headset
* install the script below in ~/.gizmod/modules.d/001-AVRCP-MythTV.py
* sudo ln -s /etc /usr/etc
* sudo gizmod
--
Brad Midgley
from GizmoDaemon import *
from GizmoScriptEnableChecker import *
import sys
import telnetlib
ENABLED = True
VERSION_NEEDED = 3.2
class AVRCPMythTV(GizmoScriptEnableChecker):
def msend(self, msg):
telnet = telnetlib.Telnet("localhost", 6546)
telnet.read_until("# ")
telnet.write(msg + "\n")
telnet.close
def onEvent(self, Event, Gizmo = None):
if Event.Remote:
return False
if Event.Class != GizmoEventClass.Standard:
return False
if Event.Type != GizmoEventType.EV_KEY:
return False
if Event.Value != 1:
return False
name = str(Event.Code)
if name == "KEY_NEXTSONG":
self.msend("key right")
return True
elif name == "KEY_PLAYCD" or name == "KEY_PAUSECD":
self.msend("key p")
return True
elif name == "KEY_STOPCD":
self.msend("key escape")
return True
elif name == "KEY_PREVIOUSSONG":
self.msend("key left")
return True
return False
def __init__(self):
GizmoScriptEnableChecker.__init__(self, ENABLED, VERSION_NEEDED)
^ permalink raw reply
* Re: [PATCH] ath3k: add support for new firmware
From: Luis R. Rodriguez @ 2010-10-01 20:56 UTC (permalink / raw)
To: Marcel Holtmann; +Cc: Vikram, linux-bluetooth, lrodriguez
In-Reply-To: <1275586452.2182.30.camel@localhost.localdomain>
On Thu, Jun 03, 2010 at 10:34:12AM -0700, Marcel Holtmann wrote:
> Hi Vikram,
>
> > updated new firmware has few critical bug fixes and shared antenna
> > support.
> >
> > Signed-off-by: Vikram Kandukuri <vkandukuri@atheros.com>
> > ---
> > drivers/bluetooth/ath3k.c | 9 ++++++---
> > 1 files changed, 6 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
> > index 128cae4..7bda549 100644
> > --- a/drivers/bluetooth/ath3k.c
> > +++ b/drivers/bluetooth/ath3k.c
> > @@ -122,9 +122,12 @@ static int ath3k_probe(struct usb_interface *intf,
> >
> > data->udev = udev;
> >
> > - if (request_firmware(&firmware, "ath3k-1.fw", &udev->dev) < 0) {
> > - kfree(data);
> > - return -EIO;
> > + if (request_firmware(&firmware, "ath3k-2.fw", &udev->dev) < 0) {
> > + BT_DBG("requesting old firmware");
> > + if (request_firmware(&firmware, "ath3k-1.fw", &udev->dev) < 0) {
> > + kfree(data);
> > + return -EIO;
> > + }
> > }
> >
> > size = max_t(uint, firmware->size, 4096);
>
> can we just have a list of supported firmware in a table instead of just
> hardcoding this. I think something similar to what iwlwifi for WiFi has
> beend doing would be nice.
Vikram, you never followed up so this patch is not yet upstream....
Mind you, ath3k-2.fw is on the linux-firmware.git tree though.
Luis
^ permalink raw reply
* Re: [PATCH] Added firmware load patch to crap directory. This patch loads firmware from btusb when device is plugged in.
From: Luis R. Rodriguez @ 2010-10-01 20:47 UTC (permalink / raw)
To: Bala Shanmugam; +Cc: linux-wireless, marcel, linux-bluetooth, linux-kernel
In-Reply-To: <1285931572-3592-1-git-send-email-sbalashanmugam@atheros.com>
On Fri, Oct 1, 2010 at 4:12 AM, Bala Shanmugam
<sbalashanmugam@atheros.com> wrote:
> Disabled staging directory compilation for bt target.
Huh? This commit log message also is unrelated to the patch below,
please separate and submit two separate patches.
> Signed-off-by: Bala Shanmugam <sbalashanmugam@atheros.com>
> ---
> =C2=A0Makefile =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2=
=A09 +-
> =C2=A0crap/0003-btusb-Add-fw-load-support.patch | =C2=A0424 +++++++++++++=
++++++++++++++++
> =C2=A02 files changed, 428 insertions(+), 5 deletions(-)
> =C2=A0create 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) +=3D drivers/net=
/usb/
>
> =C2=A0obj-$(CONFIG_COMPAT_NETWORK_MODULES) +=3D drivers/net/
> =C2=A0obj-$(CONFIG_COMPAT_VAR_MODULES) +=3D =C2=A0drivers/ssb/ drivers/mi=
sc/eeprom/
> -endif
> -
> -obj-$(CONFIG_COMPAT_BLUETOOTH) +=3D net/bluetooth/
> -obj-$(CONFIG_COMPAT_BLUETOOTH_MODULES) +=3D drivers/bluetooth/
> -
>
> =C2=A0ifeq ($(CONFIG_STAGING_EXCLUDE_BUILD),)
> =C2=A0obj-$(CONFIG_COMPAT_STAGING) +=3D drivers/staging/ath6kl/
> =C2=A0obj-$(CONFIG_COMPAT_STAGING) +=3D drivers/staging/brcm80211/
> =C2=A0endif
>
> +endif
> +
> +obj-$(CONFIG_COMPAT_BLUETOOTH) +=3D net/bluetooth/
> +obj-$(CONFIG_COMPAT_BLUETOOTH_MODULES) +=3D drivers/bluetooth/
>
> =C2=A0else
>
> 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
Actually I'd like to apply this patch to linux-next-pending/ not to
crap/ as you *did* post the patch upstream right? It just is not
getting applied yet for the reasons you stated.
> @@ -0,0 +1,424 @@
> +Reason for not yet publishing:
This not accurate, you did publish the patch, this goes into
linux-next-pending and you instead need a "Reason for not being merged
yet" or for adding it to the linux-next-pending/ directory.
> Marcel feels that Atheros sflash based BT device
> +doesn't follow bluetooth H:2 specification and HCI commands should be su=
pported
> +in firmware if it is detected as bluetooth device. Using HCI command, fi=
rmware
> +should be loaded.
> +
> +In sfash based device we don't have enough memory to support HCI command=
s in firmware.
> +So load firmware from btusb when the device comes up.
> +
You should still ask the maintainer for an alternative, otherwise the
device unusable. Did you submit the patch first in [PATCH] form? If
not please submit the patch, all I saw as an RFC and no followup at
all.
^ permalink raw reply
* Re: HDP development status and collaboration
From: Elvis Pfützenreuter @ 2010-10-01 16:38 UTC (permalink / raw)
To: Jose Antonio Santos Cadenas
Cc: linux-bluetooth, Aldenor Martins, Santiago Carot-Nemesio
In-Reply-To: <AANLkTi=xdBH5prtbfkviPdzfLrBkt5ixGFrM36G-jJ-D@mail.gmail.com>
On 01/10/2010, at 11:29, Jose Antonio Santos Cadenas wrote:
> Hi Elvis,
>
> Find inline comments about the state of the development
>
> 2010/9/29 Elvis Pfützenreuter <epx@signove.com>:
>> Attached is a spreadsheet with a simple breakdown of HDP development tasks. Managers like spreadsheets, most of us don't, so the most relevant part -- the pending tasks -- are listed below for convenience:
>>
>> device.Echo PENDING
>
> Partially done win the CreateChanel petition (almost complete)
>
>> device.CreateChannel IN PROGRESS (OpenHealth)
>
> Done, needs a little bit more testing
>
>> device.DestroyChannel PENDING
>
> In progress
>
>> device.ChannelConnected PENDING
>
> This is already done
>
>> device.ChannelDeleted PENDING
>
> This one is also done.
>
>> device properties PENDING
>> Channel object PENDING
>
> The object channel is also created, but not the methods.
>
>> channel.Acquire PENDING
>> channel.Release PENDING
>> channel properties PENDING
>> HDP verification against PTS PENDING (depends on the rest)
>>
>> I'd say that we are getting near completion. Would be nearer if we could distribute those tasks; currently, only OpenHealth friends are working on HDP code, in their repository.
>>
>> I know it's sometimes difficult to collaborate while working on the very same source files, but we should try; the breakdown by API calls seem to be the way to divide work among available developers.
>>
Lots of progress, congratulations. I had seen some of those in the repository, before the e-mail.
>>
>>
> As you say, the collaboration over the same code is difficult, event
> for Satiago and me working in the same office, because all the code is
> very related. I think that the development is going quite fast and we
> plan to finisht it soon, note that the last week we were a little bit
> delayed because we were creating most of the core functions that will
> be reused for the other petitions, so the development of the other
> functionality will be faster than expected.
Please let us know if you need help in anything.
We will begin to test and PTS the code as it progresses, so at least that one is parallelized.
That Python-based implementation of HDP (HDPy), that mimics the (future) D-Bus BlueZ API, already passes PTS tests, save by 8 of them (which I am investigating). So we have something to compare against, if needed.
>
> Regards.
>
> Jose.
^ permalink raw reply
* [PATCH] Bluetooth: Replace hard code of configuration continuous flag
From: haijun liu @ 2010-10-01 14:43 UTC (permalink / raw)
To: Gustavo F. Padovan, linux-bluetooth@vger.kernel.org
Cc: dan.tian, suraj, Ville Tervo
In-Reply-To: <1285943147-2546-1-git-send-email-haijun.liu@atheros.com>
Replace hard code of configuration continuous flag with
self-commented macro L2CAP_CONF_FLAG_CONT in functions
l2cap_config_req() and l2cap_config_rsp().
Signed-off-by: Haijun.Liu <haijun.liu@atheros.com>
---
include/net/bluetooth/l2cap.h | 2 ++
net/bluetooth/l2cap_core.c | 6 +++---
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index df599dc..2b114ca 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -193,6 +193,8 @@ struct l2cap_conf_rsp {
#define L2CAP_CONF_REJECT 0x0002
#define L2CAP_CONF_UNKNOWN 0x0003
+#define L2CAP_CONF_FLAG_CONT 0x0001
+
struct l2cap_conf_opt {
__u8 type;
__u8 len;
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 07b55c1..9e788c2 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -2985,11 +2985,11 @@ static inline int l2cap_config_req(struct
l2cap_conn *conn, struct l2cap_cmd_hdr
memcpy(l2cap_pi(sk)->conf_req + l2cap_pi(sk)->conf_len, req->data, len);
l2cap_pi(sk)->conf_len += len;
- if (flags & 0x0001) {
+ if (flags & L2CAP_CONF_FLAG_CONT) {
/* Incomplete config. Send empty response. */
l2cap_send_cmd(conn, cmd->ident, L2CAP_CONF_RSP,
l2cap_build_conf_rsp(sk, rsp,
- L2CAP_CONF_SUCCESS, 0x0001), rsp);
+ L2CAP_CONF_SUCCESS,
L2CAP_CONF_FLAG_CONT), rsp);
goto unlock;
}
@@ -3093,7 +3093,7 @@ static inline int l2cap_config_rsp(struct
l2cap_conn *conn, struct l2cap_cmd_hdr
goto done;
}
- if (flags & 0x01)
+ if (flags & L2CAP_CONF_FLAG_CONT)
goto done;
l2cap_pi(sk)->conf_state |= L2CAP_CONF_INPUT_DONE;
--
1.6.3.3
^ permalink raw reply related
* Re: [PATCH 1/2] Bluetooth: Replace hard code of configuration flag with self-comment macro.
From: haijun liu @ 2010-10-01 14:40 UTC (permalink / raw)
To: Gustavo F. Padovan
Cc: Haijun.Liu, linux-bluetooth, ville.tervo, dan.tian, suraj
In-Reply-To: <20100930135618.GA4615@vigoh>
Hi Gustavo,
On Thu, Sep 30, 2010 at 9:56 PM, Gustavo F. Padovan
<padovan@profusion.mobi> wrote:
> 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
> --
> 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
>
Sorry for this mistake, I'll mail out right one soon.
--
Haijun Liu
^ 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: haijun liu @ 2010-10-01 14:31 UTC (permalink / raw)
To: Gustavo F. Padovan
Cc: Haijun.Liu, linux-bluetooth, ville.tervo, dan.tian, suraj
In-Reply-To: <20100930140042.GB4615@vigoh>
Hi Gustavo,
On Thu, Sep 30, 2010 at 10:00 PM, Gustavo F. Padovan
<padovan@profusion.mobi> wrote:
> 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
> --
> 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
>
Thank you.
--
Haijun Liu
^ permalink raw reply
* Re: HDP development status and collaboration
From: Jose Antonio Santos Cadenas @ 2010-10-01 14:29 UTC (permalink / raw)
To: Elvis Pfützenreuter
Cc: linux-bluetooth, Jarvenpaa Jarmo (Nokia/Oulu), Aldenor Martins,
Johan Hedberg, Santiago Carot-Nemesio
In-Reply-To: <1879C724-F5EC-48FE-AD5D-46C8B290DEC6@signove.com>
Hi Elvis,
Find inline comments about the state of the development
2010/9/29 Elvis Pfützenreuter <epx@signove.com>:
> Attached is a spreadsheet with a simple breakdown of HDP development tasks. Managers like spreadsheets, most of us don't, so the most relevant part -- the pending tasks -- are listed below for convenience:
>
> device.Echo PENDING
Partially done win the CreateChanel petition (almost complete)
> device.CreateChannel IN PROGRESS (OpenHealth)
Done, needs a little bit more testing
> device.DestroyChannel PENDING
In progress
> device.ChannelConnected PENDING
This is already done
> device.ChannelDeleted PENDING
This one is also done.
> device properties PENDING
> Channel object PENDING
The object channel is also created, but not the methods.
> channel.Acquire PENDING
> channel.Release PENDING
> channel properties PENDING
> HDP verification against PTS PENDING (depends on the rest)
>
> I'd say that we are getting near completion. Would be nearer if we could distribute those tasks; currently, only OpenHealth friends are working on HDP code, in their repository.
>
> I know it's sometimes difficult to collaborate while working on the very same source files, but we should try; the breakdown by API calls seem to be the way to divide work among available developers.
>
>
>
As you say, the collaboration over the same code is difficult, event
for Satiago and me working in the same office, because all the code is
very related. I think that the development is going quite fast and we
plan to finisht it soon, note that the last week we were a little bit
delayed because we were creating most of the core functions that will
be reused for the other petitions, so the development of the other
functionality will be faster than expected.
Regards.
Jose.
^ permalink raw reply
* Re: [PATCH v4 1/2] HID: Add Support for Setting and Getting Feature Reports from hidraw
From: Jiri Kosina @ 2010-10-01 13:30 UTC (permalink / raw)
To: Antonio Ospite
Cc: Alan Ott, Stefan Achatz, Alexey Dobriyan, Tejun Heo, Alan Stern,
Greg Kroah-Hartman, Marcel Holtmann, Stephane Chatty,
Michael Poole, David S. Miller, Bastien Nocera, Eric Dumazet,
linux-input, linux-kernel, linux-usb, linux-bluetooth, netdev
In-Reply-To: <20100928153011.32750e5d.ospite@studenti.unina.it>
On Tue, 28 Sep 2010, Antonio Ospite wrote:
> Hi Alan, I am doing some stress testing on hidraw, if I have a loop with
> HIDIOCGFEATURE on a given report and I disconnect the device while the
> loop is running I get this:
>
> BUG: unable to handle kernel NULL pointer dereference at 0000000000000028
> IP: [<ffffffffa02c66b4>] hidraw_ioctl+0xfc/0x32c [hid]
>
> Full log attached along with the test program, the device is a Sony PS3
> Controller (sixaxis).
>
> If my objdump analysis is right, hidraw_ioctl+0xfc should be around line
> 361 in hidraw.c (with your patch applied):
>
> struct hid_device *hid = dev->hid;
>
> It looks like 'dev' (which is hidraw_table[minor]) can be NULL
> sometimes, can't it?
> This is not introduced by your changes tho.
>
> Just as a side note, the bug does not show up if the userspace program
> handles return values properly and exits as soon as it gets an error
> from the HID layer, see the XXX comment in test_hidraw_feature.c.
>
> This fixes it, if it looks ok I will resend the patch rebased on
> mainline code:
>
> diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c
> index 7df1310..3c040c6 100644
> --- a/drivers/hid/hidraw.c
> +++ b/drivers/hid/hidraw.c
> @@ -322,6 +322,10 @@ static long hidraw_ioctl(struct file *file, unsigned int cmd,
>
> mutex_lock(&minors_lock);
> dev = hidraw_table[minor];
> + if (!dev) {
> + ret = -ENODEV;
> + goto out;
> + }
>
> switch (cmd) {
> case HIDIOCGRDESCSIZE:
> @@ -412,6 +416,7 @@ static long hidraw_ioctl(struct file *file, unsigned int cmd,
>
> ret = -ENOTTY;
> }
> +out:
> mutex_unlock(&minors_lock);
> return ret;
> }
Yes, this patch makes sense even for current mainline code. Could you
please resend it to me with Signed-off-by: and changelog text, so that I
could apply it?
Thanks!
--
Jiri Kosina
SUSE Labs, Novell Inc.
^ permalink raw reply
* Re: [PATCHv1 0/5] Bluetooth: experimental support for pm_limits
From: Andrei Emeltchenko @ 2010-10-01 12:50 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1285937230-547-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
On Fri, Oct 1, 2010 at 3:47 PM, Emeltchenko Andrei
<Andrei.Emeltchenko.news@gmail.com> wrote:
> 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(-)
>
> --
> 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
>
Sorry our driver is not in upstream yet.
Please discard.
^ permalink raw reply
* [PATCHv1 5/5] Bluetooth: pm constraints in bt transfer mode
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>
When entering BT transfer mode set up pm limits using constraints
to achive maximum BT throughput.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
---
drivers/bluetooth/hci_h4p/core.c | 92 ++++++++++++++++++++++++++++++++++-
drivers/bluetooth/hci_h4p/hci_h4p.h | 1 +
2 files changed, 92 insertions(+), 1 deletions(-)
diff --git a/drivers/bluetooth/hci_h4p/core.c b/drivers/bluetooth/hci_h4p/core.c
index 74e6cfe..10cf8a4 100644
--- a/drivers/bluetooth/hci_h4p/core.c
+++ b/drivers/bluetooth/hci_h4p/core.c
@@ -35,6 +35,7 @@
#include <linux/interrupt.h>
#include <linux/gpio.h>
#include <linux/timer.h>
+#include <linux/kthread.h>
#include <mach/hardware.h>
#include <mach/irqs.h>
@@ -45,6 +46,10 @@
#include "hci_h4p.h"
+#define H4P_SCHED_TRANSFER_MODE 1
+
+static struct task_struct *h4p_thread;
+
/* This should be used in function that cannot release clocks */
static void hci_h4p_set_clk(struct hci_h4p_info *info, int *clock, int enable)
{
@@ -105,6 +110,17 @@ void hci_h4p_smart_idle(struct hci_h4p_info *info, bool enable)
hci_h4p_outb(info, UART_OMAP_SYSC, v);
}
+static inline void h4p_schedule(struct hci_h4p_info *info, uint event)
+{
+ if (unlikely(!h4p_thread))
+ return;
+
+ if (unlikely(!test_bit(event, &info->event))) {
+ set_bit(event, &info->event);
+ wake_up_process(h4p_thread);
+ }
+}
+
static void hci_h4p_disable_tx(struct hci_h4p_info *info)
{
NBT_DBG_POWER("\n");
@@ -128,6 +144,8 @@ void hci_h4p_enable_tx(struct hci_h4p_info *info)
if (!info->pm_enabled)
return;
+ h4p_schedule(info, H4P_SCHED_TRANSFER_MODE);
+
spin_lock_irqsave(&info->lock, flags);
del_timer(&info->lazy_release);
hci_h4p_set_clk(info, &info->tx_clocks_en, 1);
@@ -167,6 +185,8 @@ static void hci_h4p_enable_rx(struct hci_h4p_info *info)
if (!info->pm_enabled)
return;
+ h4p_schedule(info, H4P_SCHED_TRANSFER_MODE);
+
hci_h4p_set_clk(info, &info->rx_clocks_en, 1);
info->rx_enabled = 1;
@@ -613,6 +633,68 @@ static irqreturn_t hci_h4p_wakeup_interrupt(int irq, void *dev_inst)
return IRQ_HANDLED;
}
+static inline void __hci_h4p_change_pm_constraints(struct hci_h4p_info *info,
+ bool set)
+{
+ struct omap_bluetooth_config *bt_config = info->dev->platform_data;
+
+ if (likely(bt_config && bt_config->set_pm_limits)) {
+ BT_DBG("Change pm constraints to: %s", set ? "set" : "clear");
+ bt_config->set_pm_limits(info->dev, set);
+ }
+}
+
+static int h4p_run(void *data)
+{
+#define TIMEOUT_MIN msecs_to_jiffies(100)
+#define TIMEOUT_MAX msecs_to_jiffies(2000)
+ struct hci_h4p_info *info = data;
+ unsigned long last_jiffies = jiffies;
+ unsigned long timeout = TIMEOUT_MIN;
+ BT_DBG("");
+ set_user_nice(current, -10);
+
+ while (!kthread_should_stop()) {
+ set_current_state(TASK_INTERRUPTIBLE);
+ if (!test_bit(H4P_SCHED_TRANSFER_MODE, &info->event)) {
+ /* No pending events. Let's sleep.
+ * Incoming connections and data will wake us up. */
+ BT_DBG("Nothing to do... sleeping.");
+ schedule();
+ }
+
+ BT_DBG("Wake up. %u msec expired since last BT activity.",
+ jiffies_to_msecs(jiffies - last_jiffies));
+
+ /* Empiric analyzer :-) */
+ if (jiffies - last_jiffies < TIMEOUT_MIN) {
+ timeout <<= 1;
+ timeout = (timeout > TIMEOUT_MAX) ?
+ TIMEOUT_MAX : timeout;
+ } else {
+ timeout >>= 1;
+ timeout = (timeout < TIMEOUT_MIN) ?
+ TIMEOUT_MIN : timeout;
+ }
+
+ __hci_h4p_change_pm_constraints(info, true);
+
+ BT_DBG("Set active mode for %u msec.",
+ jiffies_to_msecs(timeout));
+
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout(timeout);
+
+ __hci_h4p_change_pm_constraints(info, false);
+
+ clear_bit(H4P_SCHED_TRANSFER_MODE, &info->event);
+ last_jiffies = jiffies;
+ BT_DBG("Return from active mode. Restore constraints.");
+ }
+
+ return 0;
+}
+
static int hci_h4p_reset(struct hci_h4p_info *info)
{
int err;
@@ -835,6 +917,8 @@ static int hci_h4p_hci_close(struct hci_dev *hdev)
if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags))
return 0;
+ __hci_h4p_change_pm_constraints(info, false);
+
hci_h4p_hci_flush(hdev);
hci_h4p_set_clk(info, &info->tx_clocks_en, 1);
hci_h4p_set_clk(info, &info->rx_clocks_en, 1);
@@ -942,7 +1026,7 @@ static int hci_h4p_register_hdev(struct hci_h4p_info *info)
return 0;
}
-static int hci_h4p_probe(struct platform_device *pdev)
+static int __init hci_h4p_probe(struct platform_device *pdev)
{
struct omap_bluetooth_config *bt_config;
struct hci_h4p_info *info;
@@ -1104,6 +1188,12 @@ static int hci_h4p_probe(struct platform_device *pdev)
goto cleanup_irq;
}
+ h4p_thread = kthread_run(h4p_run, info, "h4p_pm");
+ if (IS_ERR(h4p_thread)) {
+ err = PTR_ERR(h4p_thread);
+ goto cleanup_irq;
+ }
+
return 0;
cleanup_irq:
diff --git a/drivers/bluetooth/hci_h4p/hci_h4p.h b/drivers/bluetooth/hci_h4p/hci_h4p.h
index cd72bba..7d7a0fa 100644
--- a/drivers/bluetooth/hci_h4p/hci_h4p.h
+++ b/drivers/bluetooth/hci_h4p/hci_h4p.h
@@ -98,6 +98,7 @@ struct hci_h4p_info {
int tx_enabled;
int autorts;
int rx_enabled;
+ unsigned long event;
int tx_clocks_en;
int rx_clocks_en;
--
1.7.0.4
^ permalink raw reply related
* [PATCHv1 4/5] Bluetooth: rm696: 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-rm696-peripherals.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/board-rm696-peripherals.c b/arch/arm/mach-omap2/board-rm696-peripherals.c
index 5bc416a..5ee7667 100644
--- a/arch/arm/mach-omap2/board-rm696-peripherals.c
+++ b/arch/arm/mach-omap2/board-rm696-peripherals.c
@@ -49,6 +49,7 @@
#include <plat/board-nokia.h>
#include <plat/ssi.h>
#include <plat/mmc.h>
+#include <plat/omap-pm.h>
#include "hsmmc.h"
#include "board-gpio-export.h"
#include "twl4030.h"
@@ -1337,6 +1338,12 @@ static int __init rm696_i2c_init(void)
return 0;
}
+/* Use wakeup latency only for now */
+static void rm696_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 rm696_bt_config = {
.chip_type = BT_CHIP_TI,
.bt_wakeup_gpio = 37,
@@ -1344,6 +1351,7 @@ static struct omap_bluetooth_config rm696_bt_config = {
.reset_gpio = 26,
.bt_uart = 2,
.bt_sysclk = BT_SYSCLK_38_4,
+ .set_pm_limits = rm696_bt_set_pm_limits,
};
static struct omap_ssi_board_config __initdata rm696_ssi_config = {
--
1.7.0.4
^ permalink raw reply related
* [PATCHv1 3/5] Bluetooth: rm680: 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-rm680-peripherals.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-omap2/board-rm680-peripherals.c b/arch/arm/mach-omap2/board-rm680-peripherals.c
index a8b03f0..94dde4c 100644
--- a/arch/arm/mach-omap2/board-rm680-peripherals.c
+++ b/arch/arm/mach-omap2/board-rm680-peripherals.c
@@ -50,6 +50,7 @@
#include <plat/board-nokia.h>
#include <plat/mmc.h>
#include <plat/ssi.h>
+#include <plat/omap-pm.h>
#include "hsmmc.h"
#include "board-gpio-export.h"
#include "board-rm680-types.h"
@@ -1323,6 +1324,12 @@ static int __init rm680_i2c_init(void)
return 0;
}
+/* Use wakeup latency only for now */
+static void rm680_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 rm680_bt_config = {
.chip_type = BT_CHIP_TI,
.bt_wakeup_gpio = 37,
@@ -1330,6 +1337,7 @@ static struct omap_bluetooth_config rm680_bt_config = {
.reset_gpio = 26,
.bt_uart = 2,
.bt_sysclk = BT_SYSCLK_38_4,
+ .set_pm_limits = rm680_bt_set_pm_limits,
};
static struct omap_ssi_board_config __initdata rm680_ssi_config = {
--
1.7.0.4
^ permalink raw reply related
* [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
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