1. 08 Feb, 2011 5 commits
    • Johan Hedberg's avatar
      Bluetooth: Implement automatic setup procedure for local adapters · ab81cbf9
      Johan Hedberg authored
      This patch implements automatic initialization of basic information
      about newly registered Bluetooth adapters. E.g. the address and features
      are always needed so it makes sense for the kernel to automatically
      power on adapters and read this information. A new HCI_SETUP flag is
      added to track this state.
      
      In order to not consume unnecessary amounts of power if there isn't a
      user space available that could switch the adapter back off, a timer is
      added to do this automatically as long as no Bluetooth user space seems
      to be present. A new HCI_AUTO_OFF flag is added that user space needs to
      clear to avoid the automatic power off.
      
      Additionally, the management interface index_added event is moved to the
      end of the HCI_SETUP stage so a user space supporting the managment
      inteface has all the necessary information available for fetching when
      it gets notified of a new adapter. The HCI_DEV_REG event is kept in the
      same place as before since existing HCI raw socket based user space
      versions depend on seeing the kernels initialization sequence
      (hci_init_req) to determine when the adapter is ready for use.
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@nokia.com>
      Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
      ab81cbf9
    • Gustavo F. Padovan's avatar
      Bluetooth: Fix setting of MTU for ERTM and Streaming Mode · 7990681c
      Gustavo F. Padovan authored
      The desired MTU should be sent in an Config_Req for all modes.
      Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
      7990681c
    • Andrei Emeltchenko's avatar
      Bluetooth: Use non-flushable by default L2CAP data packets · e702112f
      Andrei Emeltchenko authored
      Modification of Nick Pelly <npelly@google.com> patch.
      
      With Bluetooth 2.1 ACL packets can be flushable or non-flushable. This commit
      makes ACL data packets non-flushable by default on compatible chipsets, and
      adds the BT_FLUSHABLE socket option to explicitly request flushable ACL
      data packets for a given L2CAP socket. This is useful for A2DP data which can
      be safely discarded if it can not be delivered within a short time (while
      other ACL data should not be discarded).
      
      Note that making ACL data flushable has no effect unless the automatic flush
      timeout for that ACL link is changed from its default of 0 (infinite).
      
      Default packet types (for compatible chipsets):
      Frame 34: 13 bytes on wire (104 bits), 13 bytes captured (104 bits)
      Bluetooth HCI H4
      Bluetooth HCI ACL Packet
          .... 0000 0000 0010 = Connection Handle: 0x0002
          ..00 .... .... .... = PB Flag: First Non-automatically Flushable Packet (0)
          00.. .... .... .... = BC Flag: Point-To-Point (0)
          Data Total Length: 8
      Bluetooth L2CAP Packet
      
      After setting BT_FLUSHABLE
      (sock.setsockopt(274 /*SOL_BLUETOOTH*/, 8 /* BT_FLUSHABLE */, 1 /* flush */))
      Frame 34: 13 bytes on wire (104 bits), 13 bytes captured (104 bits)
      Bluetooth HCI H4
      Bluetooth HCI ACL Packet
          .... 0000 0000 0010 = Connection Handle: 0x0002
          ..10 .... .... .... = PB Flag: First Automatically Flushable Packet (2)
          00.. .... .... .... = BC Flag: Point-To-Point (0)
          Data Total Length: 8
      Bluetooth L2CAP Packet
      Signed-off-by: default avatarAndrei Emeltchenko <andrei.emeltchenko@nokia.com>
      Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
      e702112f
    • Jesper Juhl's avatar
      Bluetooth: Fix failure to release lock in read_index_list() · b2c60d42
      Jesper Juhl authored
      If alloc_skb() fails in read_index_list() we'll return -ENOMEM without
      releasing 'hci_dev_list_lock'.
      Signed-off-by: default avatarJesper Juhl <jj@chaosbits.net>
      Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
      b2c60d42
    • Gustavo F. Padovan's avatar
      Merge branch 'master' of... · 80f5585a
      Gustavo F. Padovan authored
      Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/padovan/bluetooth-2.6 into wireless
      80f5585a
  2. 07 Feb, 2011 6 commits
  3. 06 Feb, 2011 2 commits
  4. 04 Feb, 2011 27 commits