1. 08 11月, 2011 13 次提交
    • S
      Bluetooth: Increase HCI reset timeout in hci_dev_do_close · 43611a7b
      Szymon Janc 提交于
      I've noticed that my CSR usb dongle was not working if it was plugged in when
      PC was booting. It looks like I get two HCI reset command complete events (see
      hcidump logs below).
      The root cause is reset called from off_timer. Timeout for this reset to
      complete is set to 250ms and my bt dongle requires more time for replying with
      command complete event. After that, chip seems to reply with reset command
      complete event for next non-reset command.
      
      Attached patch increase mentioned timeout to HCI_INIT_TIMEOUT, this value is
      already used for timeouting hci_reset_req in hci_dev_reset().
      
      This might also be related to BT not working after suspend that was reported
      here some time ago.
      
      Hcidump log:
      
      2011-09-12 23:13:27.379465 < HCI Command: Reset (0x03|0x0003) plen 0
      2011-09-12 23:13:27.380797 > HCI Event: Command Complete (0x0e) plen 4
          Reset (0x03|0x0003) ncmd 1
          status 0x00
      2011-09-12 23:13:27.380859 < HCI Command: Read Local Supported Features (0x04|0x000
      3) plen 0
      2011-09-12 23:13:27.760789 > HCI Event: Command Complete (0x0e) plen 4
          Reset (0x03|0x0003) ncmd 1
          status 0x00
      2011-09-12 23:13:27.760831 < HCI Command: Read Local Version Information (0x04|0x00
      01) plen 0
      2011-09-12 23:13:27.764780 > HCI Event: Command Complete (0x0e) plen 12
          Read Local Version Information (0x04|0x0001) ncmd 1
          status 0x00
          HCI Version: 1.1 (0x1) HCI Revision: 0x36f
          LMP Version: 1.1 (0x1) LMP Subversion: 0x36f
          Manufacturer: Cambridge Silicon Radio (10)
      Signed-off-by: NSzymon Janc <szymon@janc.net.pl>
      Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
      43611a7b
    • S
      Bluetooth: rfcomm: Fix sleep in invalid context in rfcomm_security_cfm · db54467a
      Szymon Janc 提交于
      This was triggered by turning off encryption on ACL link when rfcomm
      was using high security. rfcomm_security_cfm (which is called from rx
      task) was closing DLC and this involves sending disconnect message
      (and locking socket).
      
      Move closing DLC to rfcomm_process_dlcs and only flag DLC for closure
      in rfcomm_security_cfm.
      
      BUG: sleeping function called from invalid context at net/core/sock.c:2032
      in_atomic(): 1, irqs_disabled(): 0, pid: 1788, name: kworker/0:3
      [<c0068a08>] (unwind_backtrace+0x0/0x108) from [<c05e25dc>] (dump_stack+0x20/0x24)
      [<c05e25dc>] (dump_stack+0x20/0x24) from [<c0087ba8>] (__might_sleep+0x110/0x12c)
      [<c0087ba8>] (__might_sleep+0x110/0x12c) from [<c04801d8>] (lock_sock_nested+0x2c/0x64)
      [<c04801d8>] (lock_sock_nested+0x2c/0x64) from [<c05670c8>] (l2cap_sock_sendmsg+0x58/0xcc)
      [<c05670c8>] (l2cap_sock_sendmsg+0x58/0xcc) from [<c047cf6c>] (sock_sendmsg+0xb0/0xd0)
      [<c047cf6c>] (sock_sendmsg+0xb0/0xd0) from [<c047cfc8>] (kernel_sendmsg+0x3c/0x44)
      [<c047cfc8>] (kernel_sendmsg+0x3c/0x44) from [<c056b0e8>] (rfcomm_send_frame+0x50/0x58)
      [<c056b0e8>] (rfcomm_send_frame+0x50/0x58) from [<c056b168>] (rfcomm_send_disc+0x78/0x80)
      [<c056b168>] (rfcomm_send_disc+0x78/0x80) from [<c056b9f4>] (__rfcomm_dlc_close+0x2d0/0x2fc)
      [<c056b9f4>] (__rfcomm_dlc_close+0x2d0/0x2fc) from [<c056bbac>] (rfcomm_security_cfm+0x140/0x1e0)
      [<c056bbac>] (rfcomm_security_cfm+0x140/0x1e0) from [<c0555ec0>] (hci_event_packet+0x1ce8/0x4d84)
      [<c0555ec0>] (hci_event_packet+0x1ce8/0x4d84) from [<c0550380>] (hci_rx_task+0x1d0/0x2d0)
      [<c0550380>] (hci_rx_task+0x1d0/0x2d0) from [<c009ee04>] (tasklet_action+0x138/0x1e4)
      [<c009ee04>] (tasklet_action+0x138/0x1e4) from [<c009f21c>] (__do_softirq+0xcc/0x274)
      [<c009f21c>] (__do_softirq+0xcc/0x274) from [<c009f6c0>] (do_softirq+0x60/0x6c)
      [<c009f6c0>] (do_softirq+0x60/0x6c) from [<c009f794>] (local_bh_enable_ip+0xc8/0xd4)
      [<c009f794>] (local_bh_enable_ip+0xc8/0xd4) from [<c05e5804>] (_raw_spin_unlock_bh+0x48/0x4c)
      [<c05e5804>] (_raw_spin_unlock_bh+0x48/0x4c) from [<c040d470>] (data_from_chip+0xf4/0xaec)
      [<c040d470>] (data_from_chip+0xf4/0xaec) from [<c04136c0>] (send_skb_to_core+0x40/0x178)
      [<c04136c0>] (send_skb_to_core+0x40/0x178) from [<c04139f4>] (cg2900_hu_receive+0x15c/0x2d0)
      [<c04139f4>] (cg2900_hu_receive+0x15c/0x2d0) from [<c0414cb8>] (hci_uart_tty_receive+0x74/0xa0)
      [<c0414cb8>] (hci_uart_tty_receive+0x74/0xa0) from [<c02cbd9c>] (flush_to_ldisc+0x188/0x198)
      [<c02cbd9c>] (flush_to_ldisc+0x188/0x198) from [<c00b2774>] (process_one_work+0x144/0x4b8)
      [<c00b2774>] (process_one_work+0x144/0x4b8) from [<c00b2e8c>] (worker_thread+0x198/0x468)
      [<c00b2e8c>] (worker_thread+0x198/0x468) from [<c00b9bc8>] (kthread+0x98/0xa0)
      [<c00b9bc8>] (kthread+0x98/0xa0) from [<c0061744>] (kernel_thread_exit+0x0/0x8)
      Signed-off-by: NSzymon Janc <szymon.janc@tieto.com>
      Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
      db54467a
    • J
      Bluetooth: Fix command complete/status for discovery commands · 164a6e78
      Johan Hedberg 提交于
      This patch adds the necessary code to send proper command status or
      command complete events to the start/stop discovery management commands.
      Before this patch these events were completely missing.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
      164a6e78
    • L
    • L
      Bluetooth: set skbuffer priority based on L2CAP socket priority · 5e59b791
      Luiz Augusto von Dentz 提交于
      This uses SO_PRIORITY to set the skbuffer priority field
      Signed-off-by: NLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
      5e59b791
    • L
      Bluetooth: replace list_for_each with list_for_each_entry whenever possible · 8035ded4
      Luiz Augusto von Dentz 提交于
      When all items in the list have the same type there is no much of a point
      to use list_for_each except if you want to use the list pointer itself.
      Signed-off-by: NLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
      Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
      8035ded4
    • A
      Bluetooth: correct debug output · 457f4850
      Andrei Emeltchenko 提交于
      l2cap_set_timer function prints sk instead of chan pointer.
      Signed-off-by: NAndrei Emeltchenko <andrei.emeltchenko@intel.com>
      Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
      457f4850
    • A
      Bluetooth: remove magic offset and size · c6337ea6
      Andrei Emeltchenko 提交于
      make code readable by removing magic numbers
      Signed-off-by: NAndrei Emeltchenko <andrei.emeltchenko@intel.com>
      Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
      c6337ea6
    • G
      3e6b3b95
    • A
      Bluetooth: EFS: implement L2CAP config pending state · 0e8b207e
      Andrei Emeltchenko 提交于
      Add L2CAP Config Pending state for EFS. Currently after receiving
      Config Response Pending respond with Config Response Success.
      
      ...
      > ACL data: handle 1 flags 0x02 dlen 16
          L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0040 result 0 status 0
            Connection successful
      > ACL data: handle 1 flags 0x02 dlen 45
          L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 33
            RFC 0x03 (Enhanced Retransmission, TxWin 63, MaxTx 3, RTo 0, MTo 0, MPS 1009)
            EFS (Id 0x01, SerType Best Effort, MaxSDU 0xffff, SDUitime 0xffffffff,
                AccLat 0xffffffff, FlushTO 0x0000ffff)
      < ACL data: handle 1 flags 0x00 dlen 45
          L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 33
            RFC 0x03 (Enhanced Retransmission, TxWin 63, MaxTx 3, RTo 0, MTo 0, MPS 498)
            EFS (Id 0x01, SerType Best Effort, MaxSDU 0xffff, SDUitime 0xffffffff,
                AccLat 0xffffffff, FlushTO 0x0000ffff)
      < ACL data: handle 1 flags 0x00 dlen 47
          L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 4 clen 33
            Pending
            MTU 672
            RFC 0x03 (Enhanced Retransmission, TxWin 63, MaxTx 3, RTo 2000, MTo 12000, MPS 498)
            EFS (Id 0x01, SerType Best Effort, MaxSDU 0xffff, SDUitime 0xffffffff,
                AccLat 0xffffffff, FlushTO 0x0000ffff)
      > ACL data: handle 1 flags 0x02 dlen 47
          L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 4 clen 33
            Pending
            MTU 672
            RFC 0x03 (Enhanced Retransmission, TxWin 63, MaxTx 3, RTo 2000, MTo 12000, MPS 498)
            EFS (Id 0x01, SerType Best Effort, MaxSDU 0xffff, SDUitime 0xffffffff,
                AccLat 0xffffffff, FlushTO 0x0000ffff)
      > ACL data: handle 1 flags 0x02 dlen 14
          L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 0
            Success
      < ACL data: handle 1 flags 0x00 dlen 14
          L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 0
            Success
      < ACL data: handle 1 flags 0x00 dlen 510
          L2CAP(d): cid 0x0040 len 506 ext_ctrl 0x00010000 fcs 0xebe0 [psm 4113]
            I-frame: Start (len 672) TxSeq 0 ReqSeq 0
      ...
      Signed-off-by: NAndrei Emeltchenko <andrei.emeltchenko@intel.com>
      Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
      0e8b207e
    • D
      Bluetooth: Make hci_unregister_dev return void · 59735631
      David Herrmann 提交于
      hci_unregister_dev cannot fail and always returns 0. The drivers already ignore
      the return value so we can safely make it return void.
      Signed-off-by: NDavid Herrmann <dh.herrmann@googlemail.com>
      Acked-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
      59735631
    • D
      Bluetooth: Replace rfcomm tty tasklet by workqueue · 96af7391
      David Herrmann 提交于
      Remove old tasklets and replace by workqueue. To avoid reentrancy (which
      tasklets always avoid) we use the system_nrt_wq.
      Signed-off-by: NDavid Herrmann <dh.herrmann@googlemail.com>
      Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
      96af7391
    • D
      Bluetooth: Return proper error codes on rfcomm tty init · 5ada9913
      David Herrmann 提交于
      Forward error codes from tty core to the rfcomm_init caller instead of using
      generic -1 errors.
      Signed-off-by: NDavid Herrmann <dh.herrmann@googlemail.com>
      Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
      5ada9913
  2. 18 10月, 2011 5 次提交
  3. 16 10月, 2011 1 次提交
  4. 15 10月, 2011 6 次提交
  5. 14 10月, 2011 12 次提交
  6. 12 10月, 2011 1 次提交
  7. 11 10月, 2011 2 次提交