1. 08 2月, 2011 6 次提交
    • J
      Bluetooth: Add support for set_powered management command · eec8d2bc
      Johan Hedberg 提交于
      This patch adds a set_powered command to the management interface
      through which the powered state of local adapters can be controlled.
      Signed-off-by: NJohan Hedberg <johan.hedberg@nokia.com>
      Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
      eec8d2bc
    • J
      Bluetooth: Add support for management powered event · 5add6af8
      Johan Hedberg 提交于
      This patch adds support for the powered event that's used to indicate to
      userspace when the powered state of a local adapter changes.
      Signed-off-by: NJohan Hedberg <johan.hedberg@nokia.com>
      Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
      5add6af8
    • J
      Bluetooth: Implement automatic setup procedure for local adapters · ab81cbf9
      Johan Hedberg 提交于
      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: NJohan Hedberg <johan.hedberg@nokia.com>
      Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
      ab81cbf9
    • G
      Bluetooth: Fix setting of MTU for ERTM and Streaming Mode · 7990681c
      Gustavo F. Padovan 提交于
      The desired MTU should be sent in an Config_Req for all modes.
      Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
      7990681c
    • A
      Bluetooth: Use non-flushable by default L2CAP data packets · e702112f
      Andrei Emeltchenko 提交于
      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: NAndrei Emeltchenko <andrei.emeltchenko@nokia.com>
      Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
      e702112f
    • J
      Bluetooth: Fix failure to release lock in read_index_list() · b2c60d42
      Jesper Juhl 提交于
      If alloc_skb() fails in read_index_list() we'll return -ENOMEM without
      releasing 'hci_dev_list_lock'.
      Signed-off-by: NJesper Juhl <jj@chaosbits.net>
      Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
      b2c60d42
  2. 02 2月, 2011 1 次提交
    • B
      Bluetooth: Set conn state to BT_DISCONN to avoid multiple responses · e733fb62
      Bao Liang 提交于
      This patch fixes a minor issue that two connection responses will be sent
      for one L2CAP connection request. If the L2CAP connection request is first
      blocked due to security reason and responded with reason "security block",
      the state of the connection remains BT_CONNECT2. If a pairing procedure
      completes successfully before the ACL connection is down, local host will
      send another connection complete response. See the following packets
      captured by hcidump.
      
      2010-12-07 22:21:24.928096 < ACL data: handle 12 flags 0x00 dlen 16
          0000: 0c 00 01 00 03 19 08 00  41 00 53 00 03 00 00 00  ........A.S.....
      ... ...
      
      2010-12-07 22:21:35.791747 > HCI Event: Auth Complete (0x06) plen 3
          status 0x00 handle 12
      ... ...
      
      2010-12-07 22:21:35.872372 > ACL data: handle 12 flags 0x02 dlen 16
          L2CAP(s): Connect rsp: dcid 0x0054 scid 0x0040 result 0 status 0
            Connection successful
      Signed-off-by: NLiang Bao <tim.bao@gmail.com>
      Acked-by: NVille Tervo <ville.tervo@nokia.com>
      Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
      e733fb62
  3. 20 1月, 2011 8 次提交
  4. 23 12月, 2010 7 次提交
  5. 08 12月, 2010 2 次提交
  6. 07 12月, 2010 3 次提交
  7. 02 12月, 2010 13 次提交