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

Re: [bluetooth-dev] my branch



gordon,

there was a typo in your line 875 in hci.c

it must say:

#define inq_timeout(ptr)


and not inq_timeour(ptr)



it works now..



jb



Gordon McNutt wrote:
> 
> Jan Beutel wrote:
> 
> > did you see all those
> >
> > Mar 22 17:44:35 tec-pc-jg kernel: HCI: send_cmd_queue, end : 0 cmds left
> > in queue
> >
> > and then a
> >
> > Mar 22 17:45:00 tec-pc-jg kernel: HCI: send_cmd_queue, end : 1 cmds left
> > in queue
> >
> > in the HCIINQUIRY?
> 
> Ah, that's it! Good catch. All of the commands except for the last were sent
> blocking, which means the timer was set. If the timer expires we automatically
> increment the number of HCI command buffers. But in the case of the last
> command, to set the baud rate, we don't start a timer. And since the card never
> responds with a Command Complete event, we never increment our HCI command
> buffer count. Therefore, when you send the Inquiry, the stack can't send ever
> send it because it thinks we have no command buffers.
> 
> Ok. That baud rate thing is really going to screw us on this one. I'll need to
> think about this some more. The reason I didn't see the problem on my system is
> because I always leave the baud rate at 57600.
> 
> --gmcnutt
> 
> >
> > > > Mar 22 17:43:47 tec-pc-jg kernel: Bluetooth Driver v1.2, Copyright (c)
> > > > 2000 Axis Communications AB
> > > > Mar 22 17:43:47 tec-pc-jg kernel: BT SYS: Bluetooth driver registered in
> > > > ttyBT
> > > > Mar 22 17:43:47 tec-pc-jg kernel: BT SYS: Bluetooth line discipline
> > > > registered.
> > > > Mar 22 17:43:47 tec-pc-jg kernel: BT (driver) Initiating bt ctrl struct
> > > > Mar 22 17:43:47 tec-pc-jg kernel: BT SYS: Registering BT proc files
> > > > Mar 22 17:43:47 tec-pc-jg kernel: BT SYS: Bluetooth Driver Using
> > > > ttyBT[0-6] (data), ttyBTC (ctrl [7])
> > > > Mar 22 17:44:15 tec-pc-jg btd: Initiating signal handler
> > > > Mar 22 17:44:15 tec-pc-jg btd: Opening dev /dev/ttyS0
> > > > Mar 22 17:44:15 tec-pc-jg kernel: BT (ldisc) bt_tty_open
> > > > Mar 22 17:44:15 tec-pc-jg kernel: BT SYS: Setting BT driver to use
> > > > serial tty
> > > > Mar 22 17:44:15 tec-pc-jg btd: Opening dev /dev/ttyBTC
> > > > Mar 22 17:44:15 tec-pc-jg kernel: BT (driver) bt_open on line 7
> > > > Mar 22 17:44:15 tec-pc-jg kernel: BT SYS: Registering tty on line 7
> > > > Mar 22 17:44:15 tec-pc-jg kernel: BT SYS: Now 1 open fd:s for ttyBTC
> > > > Mar 22 17:44:15 tec-pc-jg kernel: BT (driver) bt_ioctl: forwarding ioctl
> > > > 0x540b to serial driver
> > > > Mar 22 17:44:15 tec-pc-jg kernel: BT (driver) bt_flush_buffer
> > > > Mar 22 17:44:15 tec-pc-jg kernel: BT SYS: Initialising Bluetooth Stack
> > > > Mar 22 17:44:15 tec-pc-jg kernel: BT SYS: hci_init, Initialising HCI
> > > > Mar 22 17:44:15 tec-pc-jg kernel: BT SYS: HCI emulator off
> > > > Mar 22 17:44:15 tec-pc-jg kernel: BT SYS: hci_init, Initialising HCI
> > > > inbuffers [800]
> > > > Mar 22 17:44:15 tec-pc-jg kernel: HCI: init_cmd_buf, Initializing
> > > > Mar 22 17:44:15 tec-pc-jg kernel: BT SYS: hci_init, Reading buffer sizes
> > > > in the module...
> > > > Mar 22 17:44:15 tec-pc-jg kernel: HCI: hci_read_buffer_size
> > > > Mar 22 17:44:15 tec-pc-jg kernel: HCI: insert_cmd
> > > > Mar 22 17:44:15 tec-pc-jg kernel: HCI: start_cmd_timer
> > > > Mar 22 17:44:15 tec-pc-jg kernel: HCI: send_cmd_queue, start:
> > > > Num_HCI_Command_Packets=1
> > > > Mar 22 17:44:15 tec-pc-jg kernel:
> > > > Mar 22 17:44:15 tec-pc-jg kernel: send_cmd_queue,  (4)
> > > > Mar 22 17:44:15 tec-pc-jg kernel:    0x01 0x05 0x10 0x00
> > > > Mar 22 17:44:15 tec-pc-jg kernel: BT DATA <--|X|      4
> > > > Mar 22 17:44:15 tec-pc-jg kernel:
> > > > Mar 22 17:44:15 tec-pc-jg kernel: bt_write_lower_driver : (4)
> > > > Mar 22 17:44:15 tec-pc-jg kernel:    0x01 0x05 0x10 0x00
> > > > Mar 22 17:44:15 tec-pc-jg kernel: HCI: send_cmd_queue, sent data...,
> > > > freeing memory
> > > > Mar 22 17:44:15 tec-pc-jg kernel: HCI: send_cmd_queue, end : 0 cmds left
> > > > in queue
> > > > Mar 22 17:44:18 tec-pc-jg kernel: cmd_timeout, Timeout when waiting for
> > > > command response
> > >
> > > You never got a response from your hardware. In fact, you never do get a
> > > response from your hardware in the rest of this log for ANY commands which
> > > the stack sends.
> > >
> > > Did you reset your hardware first before starting btd?
> > >
> > > >
> > > > Mar 22 17:44:18 tec-pc-jg kernel: HCI: hci_read_firmware_rev_info
> > > > Mar 22 17:44:18 tec-pc-jg kernel: HCI: insert_cmd
> > > > Mar 22 17:44:18 tec-pc-jg kernel: HCI: start_cmd_timer
> > > > Mar 22 17:44:18 tec-pc-jg kernel: HCI: send_cmd_queue, start:
> > > > Num_HCI_Command_Packets=1
> > > > Mar 22 17:44:18 tec-pc-jg kernel:
> > > > Mar 22 17:44:18 tec-pc-jg kernel: send_cmd_queue,  (4)
> > > > Mar 22 17:44:18 tec-pc-jg kernel:    0x01 0x0f 0xfc 0x00
> > > > Mar 22 17:44:18 tec-pc-jg kernel: BT DATA <--|X|      4
> > > > Mar 22 17:44:18 tec-pc-jg kernel:
> > > > Mar 22 17:44:18 tec-pc-jg kernel: bt_write_lower_driver : (4)
> > > > Mar 22 17:44:18 tec-pc-jg kernel:    0x01 0x0f 0xfc 0x00
> > > > Mar 22 17:44:18 tec-pc-jg kernel: HCI: send_cmd_queue, sent data...,
> > > > freeing memory
> > > > Mar 22 17:44:18 tec-pc-jg kernel: HCI: send_cmd_queue, end : 0 cmds left
> > > > in queue
> > > > Mar 22 17:44:21 tec-pc-jg kernel: cmd_timeout, Timeout when waiting for
> > > > command response
> > > > Mar 22 17:44:21 tec-pc-jg kernel: BT SYS: hci_init, Host flow control
> > > > not enabled
> > > > Mar 22 17:44:21 tec-pc-jg kernel: BT SYS: Initialising L2CAP
> > > > Mar 22 17:44:21 tec-pc-jg kernel: HCI: hci_read_local_bd
> > > > Mar 22 17:44:21 tec-pc-jg kernel: HCI: insert_cmd
> > > > Mar 22 17:44:21 tec-pc-jg kernel: HCI: start_cmd_timer
> > > > Mar 22 17:44:21 tec-pc-jg kernel: HCI: send_cmd_queue, start:
> > > > Num_HCI_Command_Packets=1
> > > > Mar 22 17:44:21 tec-pc-jg kernel:
> > > > Mar 22 17:44:21 tec-pc-jg kernel: send_cmd_queue,  (4)
> > > > Mar 22 17:44:21 tec-pc-jg kernel:    0x01 0x09 0x10 0x00
> > > > Mar 22 17:44:21 tec-pc-jg kernel: BT DATA <--|X|      4
> > > > Mar 22 17:44:21 tec-pc-jg kernel:
> > > > Mar 22 17:44:21 tec-pc-jg kernel: bt_write_lower_driver : (4)
> > > > Mar 22 17:44:21 tec-pc-jg kernel:    0x01 0x09 0x10 0x00
> > > > Mar 22 17:44:21 tec-pc-jg kernel: HCI: send_cmd_queue, sent data...,
> > > > freeing memory
> > > > Mar 22 17:44:21 tec-pc-jg kernel: HCI: send_cmd_queue, end : 0 cmds left
> > > > in queue
> > > > Mar 22 17:44:24 tec-pc-jg kernel: cmd_timeout, Timeout when waiting for
> > > > command response
> > > > Mar 22 17:44:24 tec-pc-jg kernel: BT SYS: ERROR :Failed to get local BD
> > > > addr
> > > > Mar 22 17:44:24 tec-pc-jg kernel: BT SYS: Initialising RFCOMM
> > > > Mar 22 17:44:24 tec-pc-jg kernel: BT SYS: Initialising SDP
> > > > Mar 22 17:44:24 tec-pc-jg kernel: BT SYS: sdp_init, Init sdp as server
> > > > Mar 22 17:44:24 tec-pc-jg kernel: BT SYS: Initialising TCS
> > > > Mar 22 17:44:24 tec-pc-jg kernel: BT SYS: Initialising BTMEM [2500
> > > > bytes]
> > > > Mar 22 17:44:24 tec-pc-jg kernel: HCI: hci_write_class_of_deviceService
> > > > class 0x10, major:0x3, minor:0x0
> > > > Mar 22 17:44:24 tec-pc-jg kernel: HCI: hci_write_class_of_device2:3:0
> > > > Mar 22 17:44:24 tec-pc-jg kernel: HCI: insert_cmd
> > > > Mar 22 17:44:24 tec-pc-jg kernel: HCI: start_cmd_timer
> > > > Mar 22 17:44:24 tec-pc-jg kernel: HCI: send_cmd_queue, start:
> > > > Num_HCI_Command_Packets=1
> > > > Mar 22 17:44:24 tec-pc-jg kernel:
> > > > Mar 22 17:44:24 tec-pc-jg kernel: send_cmd_queue,  (7)
> > > > Mar 22 17:44:24 tec-pc-jg kernel:    0x01 0x24 0x0c 0x03 0x00 0x03 0x02
> > > > Mar 22 17:44:24 tec-pc-jg kernel: BT DATA <--|X|      7
> > > > Mar 22 17:44:24 tec-pc-jg kernel:
> > > > Mar 22 17:44:24 tec-pc-jg kernel: bt_write_lower_driver : (7)
> > > > Mar 22 17:44:24 tec-pc-jg kernel:    0x01 0x24 0x0c 0x03 0x00 0x03 0x02
> > > > Mar 22 17:44:24 tec-pc-jg kernel: HCI: send_cmd_queue, sent data...,
> > > > freeing memory
> > > > Mar 22 17:44:24 tec-pc-jg kernel: HCI: send_cmd_queue, end : 0 cmds left
> > > > in queue
> > > > Mar 22 17:44:27 tec-pc-jg kernel: cmd_timeout, Timeout when waiting for
> > > > command response
> > > > Mar 22 17:44:27 tec-pc-jg kernel: HCI: hci_change_local_name, New name:
> > > > tec-pc-jg.ethz.ch
> > > > Mar 22 17:44:27 tec-pc-jg kernel: HCI: insert_cmd
> > > > Mar 22 17:44:27 tec-pc-jg kernel: HCI: start_cmd_timer
> > > > Mar 22 17:44:27 tec-pc-jg kernel: HCI: send_cmd_queue, start:
> > > > Num_HCI_Command_Packets=1
> > > > Mar 22 17:44:27 tec-pc-jg kernel:
> > > > Mar 22 17:44:27 tec-pc-jg kernel: send_cmd_queue,  (252)
> > > > Mar 22 17:44:27 tec-pc-jg kernel:    0x01 0x13 0x0c 0xf8 0x74 0x65 0x63
> > > > 0x2d 0x70 0x63 0x2d 0x6a 0x67 0x2e 0x65 0x74
> > > > Mar 22 17:44:27 tec-pc-jg kernel:    0x68 0x7a 0x2e 0x63 0x68 0x00 0x00
> > > > 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
> > > > Mar 22 17:44:27 tec-pc-jg kernel:    0x00 0x00 0x00 0x00 0x00 0x00 0x00
> > > > 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
> > > > Mar 22 17:44:27 tec-pc-jg last message repeated 12 times
> > > > Mar 22 17:44:27 tec-pc-jg kernel:    0x00 0x00 0x00 0x00 0x00 0x00 0x00
> > > > 0x00 0x00 0x00 0x00 0x00
> > > > Mar 22 17:44:27 tec-pc-jg kernel: BT DATA <--|X|    252
> > > > Mar 22 17:44:27 tec-pc-jg kernel:
> > > > Mar 22 17:44:27 tec-pc-jg kernel: bt_write_lower_driver : (252)
> > > > Mar 22 17:44:27 tec-pc-jg kernel:    0x01 0x13 0x0c 0xf8 0x74 0x65 0x63
> > > > 0x2d 0x70 0x63 0x2d 0x6a 0x67 0x2e 0x65 0x74
> > > > Mar 22 17:44:27 tec-pc-jg kernel:    0x68 0x7a 0x2e 0x63 0x68 0x00 0x00
> > > > 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
> > > > Mar 22 17:44:27 tec-pc-jg kernel:    0x00 0x00 0x00 0x00 0x00 0x00 0x00
> > > > 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
> > > > Mar 22 17:44:27 tec-pc-jg last message repeated 12 times
> > > > Mar 22 17:44:27 tec-pc-jg kernel:    0x00 0x00 0x00 0x00 0x00 0x00 0x00
> > > > 0x00 0x00 0x00 0x00 0x00
> > > > Mar 22 17:44:27 tec-pc-jg kernel: HCI: send_cmd_queue, sent data...,
> > > > freeing memory
> > > > Mar 22 17:44:27 tec-pc-jg kernel: HCI: send_cmd_queue, end : 0 cmds left
> > > > in queue
> > > > Mar 22 17:44:30 tec-pc-jg kernel: cmd_timeout, Timeout when waiting for
> > > > command response
> > > > Mar 22 17:44:31 tec-pc-jg kernel: BT (driver) setting write scan enable
> > > > : [0x3]
> > > > Mar 22 17:44:31 tec-pc-jg kernel: hci_write_scan_enable, enable 3
> > > > Mar 22 17:44:31 tec-pc-jg kernel: HCI: insert_cmd
> > > > Mar 22 17:44:31 tec-pc-jg kernel: HCI: start_cmd_timer
> > > > Mar 22 17:44:31 tec-pc-jg kernel: HCI: send_cmd_queue, start:
> > > > Num_HCI_Command_Packets=1
> > > > Mar 22 17:44:31 tec-pc-jg kernel:
> > > > Mar 22 17:44:31 tec-pc-jg kernel: send_cmd_queue,  (5)
> > > > Mar 22 17:44:31 tec-pc-jg kernel:    0x01 0x1a 0x0c 0x01 0x03
> > > > Mar 22 17:44:31 tec-pc-jg kernel: BT DATA <--|X|      5
> > > > Mar 22 17:44:31 tec-pc-jg kernel:
> > > > Mar 22 17:44:31 tec-pc-jg kernel: bt_write_lower_driver : (5)
> > > > Mar 22 17:44:31 tec-pc-jg kernel:    0x01 0x1a 0x0c 0x01 0x03
> > > > Mar 22 17:44:31 tec-pc-jg kernel: HCI: send_cmd_queue, sent data...,
> > > > freeing memory
> > > > Mar 22 17:44:31 tec-pc-jg kernel: HCI: send_cmd_queue, end : 0 cmds left
> > > > in queue
> > > > Mar 22 17:44:34 tec-pc-jg kernel: cmd_timeout, Timeout when waiting for
> > > > command response
> > > > Mar 22 17:44:35 tec-pc-jg kernel: HCI: hci_set_event_filter
> > > > Mar 22 17:44:35 tec-pc-jg kernel: HCI: insert_cmd
> > > > Mar 22 17:44:35 tec-pc-jg kernel: HCI: start_cmd_timer
> > > > Mar 22 17:44:35 tec-pc-jg kernel: HCI: send_cmd_queue, start:
> > > > Num_HCI_Command_Packets=1
> > > > Mar 22 17:44:35 tec-pc-jg kernel:
> > > > Mar 22 17:44:35 tec-pc-jg kernel: send_cmd_queue,  (7)
> > > > Mar 22 17:44:35 tec-pc-jg kernel:    0x01 0x05 0x0c 0x03 0x02 0x00 0x01
> > > > Mar 22 17:44:35 tec-pc-jg kernel: BT DATA <--|X|      7
> > > > Mar 22 17:44:35 tec-pc-jg kernel:
> > > > Mar 22 17:44:35 tec-pc-jg kernel: bt_write_lower_driver : (7)
> > > > Mar 22 17:44:35 tec-pc-jg kernel:    0x01 0x05 0x0c 0x03 0x02 0x00 0x01
> > > > Mar 22 17:44:35 tec-pc-jg kernel: HCI: send_cmd_queue, sent data...,
> > > > freeing memory
> > > > Mar 22 17:44:35 tec-pc-jg kernel: HCI: send_cmd_queue, end : 0 cmds left
> > > > in queue
> > > > Mar 22 17:44:38 tec-pc-jg kernel: cmd_timeout, Timeout when waiting for
> > > > command response
> > > > Mar 22 17:44:39 tec-pc-jg kernel: BT (driver) bt_ioctl: Setting baudrate
> > > > in host controller to 115200
> > > > Mar 22 17:44:39 tec-pc-jg kernel: HCI: hci_set_baudrate(115200 baud)
> > > > Mar 22 17:44:39 tec-pc-jg kernel: BT DATA <--|X|      5
> > > > Mar 22 17:44:39 tec-pc-jg kernel:
> > > > Mar 22 17:44:39 tec-pc-jg kernel: bt_write_lower_driver : (5)
> > > > Mar 22 17:44:39 tec-pc-jg kernel:    0x01 0x09 0xfc 0x01 0x02
> > > > Mar 22 17:44:39 tec-pc-jg kernel: BT (ldisc) bt_tty_ioctl cmd 0x5401
> > > > Mar 22 17:44:39 tec-pc-jg kernel: BT (ldisc) bt_tty_ioctl: forwarding
> > > > ioctl 0x5401 to n_tty line disc
> > > > Mar 22 17:44:39 tec-pc-jg kernel: BT (ldisc) bt_tty_ioctl cmd 0x5402
> > > > Mar 22 17:44:39 tec-pc-jg kernel: BT (ldisc) bt_tty_ioctl: forwarding
> > > > ioctl 0x5402 to n_tty line disc
> > > > Mar 22 17:44:39 tec-pc-jg kernel: BT (ldisc) bt_tty_ioctl cmd 0x5401
> > > > Mar 22 17:44:39 tec-pc-jg kernel: BT (ldisc) bt_tty_ioctl: forwarding
> > > > ioctl 0x5401 to n_tty line disc
> > > > Mar 22 17:44:39 tec-pc-jg kernel: BT (ldisc) bt_tty_ioctl cmd 0x540b
> > > > Mar 22 17:44:39 tec-pc-jg kernel: BT (ldisc) bt_tty_ioctl: forwarding
> > > > ioctl 0x540b to n_tty line disc
> > > > Mar 22 17:45:00 tec-pc-jg kernel: BT (driver) bt_ioctl: HCINQUIRY
> > > > Mar 22 17:45:00 tec-pc-jg kernel: HCI: hci_inquiry
> > > > Mar 22 17:45:00 tec-pc-jg kernel:
> > > > Mar 22 17:45:00 tec-pc-jg kernel: LAP: (3)
> > > > Mar 22 17:45:00 tec-pc-jg kernel:    0x33 0x8b 0x9e
> > > > Mar 22 17:45:00 tec-pc-jg kernel:
> > > > Mar 22 17:45:00 tec-pc-jg kernel: hci_inquiry (9)
> > > > Mar 22 17:45:00 tec-pc-jg kernel:    0x01 0x01 0x04 0x05 0x33 0x8b 0x9e
> > > > 0x64 0x0a
> > > > Mar 22 17:45:00 tec-pc-jg kernel: HCI: insert_cmd
> > > > Mar 22 17:45:00 tec-pc-jg kernel: HCI: start_cmd_timer
> > > > Mar 22 17:45:00 tec-pc-jg kernel: HCI: send_cmd_queue, start:
> > > > Num_HCI_Command_Packets=0
> > > > Mar 22 17:45:00 tec-pc-jg kernel: HCI: send_cmd_queue, end : 1 cmds left
> > > > in queue
> > > > Mar 22 17:45:03 tec-pc-jg kernel: cmd_timeout, Timeout when waiting for
> > > > command response
> > >
> > > It's no surprise that the Inquiry times out at this point.
> > >
> > > --gmcnutt
> >
> > --
> > Jan Beutel                                 j.beutel@xxxxxxx.org
> > Computer Engineering and Networks Laboratory, ETZ G63
> > ETH Zurich                              +41 1 632 70 32 Phone
> > Gloriastrasse 35                          +41 1 632 10 35 Fax
> > CH 8092 Zurich/Switzerland  http://www.tik.ee.ethz.ch/~beutel

-- 
Jan Beutel                                 j.beutel@xxxxxxx.org
Computer Engineering and Networks Laboratory, ETZ G63
ETH Zurich                              +41 1 632 70 32 Phone
Gloriastrasse 35                          +41 1 632 10 35 Fax
CH 8092 Zurich/Switzerland  http://www.tik.ee.ethz.ch/~beutel
-
To unsubscribe from this list: send the line "unsubscribe bluetooth-dev" in
the body of a message to majordomo@xxxxxxx.com