Skip to contentSkip to conversation

First HCI command sent to a device

Bluez-devel Marcel Holtmann 3 participants 5 messages Mar 4, 2004 – Mar 5, 2004 Bluetooth drivers

lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

Hi Folks,

while debugging the i-Tec dongle with Broadcom HID proxy support I saw that this dongle expects that the first command is a HCI_Reset. I can't remember any time where BlueZ has used this command. Our command sequence on initialization can be found in hci_core.c:hci_init_req() and it looks like this:

/* Mandatory initialization */

        /* Read Local Supported Features */
        hci_send_cmd(hdev, OGF_INFO_PARAM, OCF_READ_LOCAL_FEATURES, 0, NULL);

        /* Read Buffer Size (ACL mtu, max pkt, etc.) */
        hci_send_cmd(hdev, OGF_INFO_PARAM, OCF_READ_BUFFER_SIZE, 0, NULL);

        /* Read BD Address */
        hci_send_cmd(hdev, OGF_INFO_PARAM, OCF_READ_BD_ADDR, 0, NULL);

        /* Read Voice Setting */
        hci_send_cmd(hdev, OGF_HOST_CTL, OCF_READ_VOICE_SETTING, 0, NULL);

/* Optional initialization */

        /* Clear Event Filters */
        cp.flt_type  = HCI_FLT_CLEAR_ALL;
        hci_send_cmd(hdev, OGF_HOST_CTL, OCF_SET_EVENT_FLT, sizeof(cp), &cp);

        /* Page timeout ~20 secs */
        param = __cpu_to_le16(0x8000);
        hci_send_cmd(hdev, OGF_HOST_CTL, OCF_WRITE_PG_TIMEOUT, 2, &param);

        /* Connection accept timeout ~20 secs */
        param = __cpu_to_le16(0x7d00);
        hci_send_cmd(hdev, OGF_HOST_CTL, OCF_WRITE_CA_TIMEOUT, 2, &param);

Until the i-Tec dongle this worked perfect, but now my question is what is the prefered init sequence? How do other stacks do it? Acutally how do Microsoft or Widcomm init a device? Will adding a HCI_Reset break any other Bluetooth adapter? Feedback from everyone is welcome before I am going to make a decission on adding HCI_Reset or not.

Regards

Marcel

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#1 lore raw
Quoted 2 lines · Marcel Holtmann

Will adding a HCI_Reset break any
other Bluetooth adapter?

Sending an HCI_Reset to a CSR device running firmware earlier than 12.0 will cause the device to perform a full system reset. This means that the host transport will be reset (USB devices will drop off the bus and reattach, BCSP devices will need to perform link establishment) and it means that settings will be reloaded from persistent store (so the baud rate will reset).

Firmware version 12.0 and later are better behaved and will reset all the LM and LC settings (drop all links etc.) but leave the host transport up and running.

[For the reasons behind this, see my posting to bluez-devel on 9th October 2003 in the thread "hciconfig":

http://sourceforge.net/mailarchive/message.php?msg_id=6262255
]

- Steven

Signature · 11 lines
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************
author maintainer
#2 lore raw

Hi Steven,

Quoted 10 lines

Sending an HCI_Reset to a CSR device running firmware earlier than 12.0 will cause the device to perform a full system reset. This means that the host transport will be reset (USB devices will drop off the bus and reattach, BCSP devices will need to perform link establishment) and it means that settings will be reloaded from persistent store (so the baud rate will reset).

Firmware version 12.0 and later are better behaved and will reset all the LM and LC settings (drop all links etc.) but leave the host transport up and running.

thanks for reminding me. I thought the reason was some of the Ericsson ROK's that had a problem, but in fact the old CSR firmware don't likes this command ;)

The i-Tec dongle needs the HCI_Reset command to switch from HID to HCI mode and I don't wanna break support for the old CSR firmware, because some of my dongles and some iPAQ's still run HCI 11.x or younger. How do we solve this?

Regards

Marcel

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

#3 lore raw
Quoted 13 lines · On Thu, 04 Mar 2004 16:55:36 +0100 Marcel Holtmann <[email protected]> wrote:

Hi Steven,

Quoted 10 lines

Sending an HCI_Reset to a CSR device running firmware earlier than 12.0 will cause the device to perform a full system reset. This means that the host transport will be reset (USB devices will drop off the bus and reattach, BCSP devices will need to perform link establishment) and it means that settings will be reloaded from persistent store (so the baud rate will reset).

Firmware version 12.0 and later are better behaved and will reset all the LM and LC settings (drop all links etc.) but leave the host transport up and running.

Quoted 8 lines

thanks for reminding me. I thought the reason was some of the Ericsson ROK's that had a problem, but in fact the old CSR firmware don't likes this command ;)

The i-Tec dongle needs the HCI_Reset command to switch from HID to HCI mode and I don't wanna break support for the old CSR firmware, because some of my dongles and some iPAQ's still run HCI 11.x or younger. How do we solve this?

Hi.

I haven't looked at the code so my idea will probably be unusable, but how about maintaining a list of which dongles don't like the reset and send it only to the other ones ?

Or reversing the test, only sending a reset to the dongles that need it.

Of course, it implies that you can identify the device *before* deciding on your action.

AFAIK, there is a similar "black-list" of controllers in the IDE layer of Linux to decide on the supported features..

Charles

Signature · 2 lines
Charles Bueche <[email protected]>
sand, snow, wave, wind and net -surfer
author maintainer
#4 lore raw

Hi Charles,

Quoted 4 lines

I haven't looked at the code so my idea will probably be unusable, but how about maintaining a list of which dongles don't like the reset and send it only to the other ones ?

Quoted 8 lines

Or reversing the test, only sending a reset to the dongles that need it.

Of course, it implies that you can identify the device *before* deciding on your action.

AFAIK, there is a similar "black-list" of controllers in the IDE layer of Linux to decide on the supported features..

I like to identify the dongles that don't like the HCI_Reset, but this is impossible for UART based adapters and even on the USB side this is not very trivial. Actually I chose to introduce a reset quirk for the i-Tec/Broadcom dongle.

Regards

Marcel

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel