1. 08 2月, 2011 8 次提交
    • J
      Bluetooth: Add controller side link key clearing to hci_init_req · b0916ea0
      Johan Hedberg 提交于
      The controller may have link keys in its own memory and these keys could
      be used for secure connections. However, since the interface to access
      these keys doesn't provide information about the key types (which would
      be needed to infer the level of security each key provides) using these
      keys is rather useless. Therefore, simply clear the controller side list
      in the initialization procedure.
      Signed-off-by: NJohan Hedberg <johan.hedberg@nokia.com>
      Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
      b0916ea0
    • J
      Bluetooth: Add special handling with __hci_request and HCI_INIT · a5040efa
      Johan Hedberg 提交于
      To support a more dynamic HCI initialization sequence the __hci_request
      behavior requires some more changes. Particularly, the init sequence
      should be able to have conditionals in it (sending some HCI commands
      depending on the outcome of a previous command) instead of being a fixed
      list as it is right now.
      
      The reasons for these additional requirements are the moving all
      previously user space driven initialization commands to the kernel side
      as well as the support the Low Energy controllers.
      
      To fulfull these requirements the init sequence is made the only special
      case for multi-command requests and req_last_cmd is renamed to
      init_last_cmd. The hci_send_cmd function is changed to update
      init_last_cmd as long as the HCI_INIT flag is set.
      Signed-off-by: NJohan Hedberg <johan.hedberg@nokia.com>
      Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
      a5040efa
    • J
      Bluetooth: Implement UUID handling through the management interface · 2aeb9a1a
      Johan Hedberg 提交于
      This patch adds methods to the management interface for userspace to
      notify the kernel of which services have been registered for specific
      adapters. This information is needed for setting the appropriate Class
      of Device value as well as the Extended Inquiry Response value. This
      patch doesn't actually implement setting of these values but just
      provides the storage of the UUIDs so the needed functionality can be
      built on top of it.
      Signed-off-by: NJohan Hedberg <johan.hedberg@nokia.com>
      Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
      2aeb9a1a
    • J
      Bluetooth: Implement set_pairable managment command · c542a06c
      Johan Hedberg 提交于
      This patch implements a new set_pairable management command to control
      the pairable state of local adapters. The state is represented using a
      new HCI_PAIRABLE flag in the hci_dev struct.
      
      For backwards compatibility with older user space versions the
      HCI_PAIRABLE flag gets automatically set when the existence of an
      adapter is reported to user space through legacy methods and the
      HCI_MGMT flag is not set.
      Signed-off-by: NJohan Hedberg <johan.hedberg@nokia.com>
      Signed-off-by: NGustavo F. Padovan <padovan@profusion.mobi>
      c542a06c
    • 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
    • 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
  2. 20 1月, 2011 1 次提交
  3. 23 12月, 2010 2 次提交
  4. 02 12月, 2010 1 次提交
  5. 12 10月, 2010 1 次提交
  6. 01 8月, 2010 1 次提交
  7. 28 7月, 2010 1 次提交
  8. 22 7月, 2010 5 次提交
  9. 18 5月, 2010 1 次提交
  10. 10 5月, 2010 3 次提交
  11. 27 2月, 2010 2 次提交
  12. 04 12月, 2009 2 次提交
  13. 23 8月, 2009 1 次提交
  14. 08 6月, 2009 1 次提交
  15. 27 2月, 2009 1 次提交
  16. 30 11月, 2008 3 次提交
    • M
      Bluetooth: Enable per-module dynamic debug messages · a418b893
      Marcel Holtmann 提交于
      With the introduction of CONFIG_DYNAMIC_PRINTK_DEBUG it is possible to
      allow debugging without having to recompile the kernel. This patch turns
      all BT_DBG() calls into pr_debug() to support dynamic debug messages.
      
      As a side effect all CONFIG_BT_*_DEBUG statements are now removed and
      some broken debug entries have been fixed.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      a418b893
    • M
      Bluetooth: Send HCI Reset command by default on device initialization · 7a9d4020
      Marcel Holtmann 提交于
      The Bluetooth subsystem was not using the HCI Reset command when doing
      device initialization. The Bluetooth 1.0b specification was ambiguous
      on how the device firmware was suppose to handle it. Almost every device
      was triggering a transport reset at the same time. In case of USB this
      ended up in disconnects from the bus.
      
      All modern Bluetooth dongles handle this perfectly fine and a lot of
      them actually require that HCI Reset is sent. If not then they are
      either stuck in their HID Proxy mode or their internal structures for
      inquiry and paging are not correctly setup.
      
      To handle old and new devices smoothly the Bluetooth subsystem contains
      a quirk to force the HCI Reset on initialization. However maintaining
      such a quirk becomes more and more complicated. This patch turns the
      logic around and lets the old devices disable the HCI Reset command.
      
      The only device where the HCI_QUIRK_NO_RESET is still needed are the
      original Digianswer devices and dongles with an early CSR firmware.
      
      CSR reported that they fixed this for version 12 firmware. The last
      official release of version 11 firmware is build ID 115. The first
      version 12 candidate was build ID 117.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      7a9d4020
    • V
      Bluetooth: Fix leak of uninitialized data to userspace · c6bf514c
      Vegard Nossum 提交于
          struct hci_dev_list_req {
                  __u16  dev_num;
                  struct hci_dev_req dev_req[0];  /* hci_dev_req structures */
          };
      
      sizeof(struct hci_dev_list_req) == 4, so the two bytes immediately
      following "dev_num" will never be initialized. When this structure
      is copied to userspace, these uninitialized bytes are leaked.
      
      Fix by using kzalloc() instead of kmalloc(). Found using kmemcheck.
      Signed-off-by: NVegard Nossum <vegard.nossum@gmail.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      c6bf514c
  17. 12 9月, 2008 1 次提交
    • M
      [Bluetooth] Fix regression from using default link policy · 7c6a329e
      Marcel Holtmann 提交于
      To speed up the Simple Pairing connection setup, the support for the
      default link policy has been enabled. This is in contrast to settings
      the link policy on every connection setup. Using the default link policy
      is the preferred way since there is no need to dynamically change it for
      every connection.
      
      For backward compatibility reason and to support old userspace the
      HCISETLINKPOL ioctl has been switched over to using hci_request() to
      issue the HCI command for setting the default link policy instead of
      just storing it in the HCI device structure.
      
      However the hci_request() can only be issued when the device is
      brought up. If used on a device that is registered, but still down
      it will timeout and fail. This is problematic since the command is
      put on the TX queue and the Bluetooth core tries to submit it to
      hardware that is not ready yet. The timeout for these requests is
      10 seconds and this causes a significant regression when setting up
      a new device.
      
      The userspace can perfectly handle a failure of the HCISETLINKPOL
      ioctl and will re-submit it later, but the 10 seconds delay causes
      a problem. So in case hci_request() is called on a device that is
      still down, just fail it with ENETDOWN to indicate what happens.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      7c6a329e
  18. 15 7月, 2008 2 次提交
    • M
      [Bluetooth] Use ACL config stage to retrieve remote features · 769be974
      Marcel Holtmann 提交于
      The Bluetooth technology introduces new features on a regular basis
      and for some of them it is important that the hardware on both sides
      support them. For features like Simple Pairing it is important that
      the host stacks on both sides have switched this feature on. To make
      valid decisions, a config stage during ACL link establishment has been
      introduced that retrieves remote features and if needed also the remote
      extended features (known as remote host features) before signalling
      this link as connected.
      
      This change introduces full reference counting of incoming and outgoing
      ACL links and the Bluetooth core will disconnect both if no owner of it
      is present. To better handle interoperability during the pairing phase
      the disconnect timeout for incoming connections has been increased to
      10 seconds. This is five times more than for outgoing connections.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      769be974
    • M
      [Bluetooth] Make use of the default link policy settings · e4e8e37c
      Marcel Holtmann 提交于
      The Bluetooth specification supports the default link policy settings
      on a per host controller basis. For every new connection the link
      manager would then use these settings. It is better to use this instead
      of bothering the controller on every connection setup to overwrite the
      default settings.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      e4e8e37c
  19. 06 3月, 2008 1 次提交
    • D
      bluetooth: hci_core: defer hci_unregister_sysfs() · 147e2d59
      Dave Young 提交于
      Alon Bar-Lev reports:
      
       Feb 16 23:41:33 alon1 usb 3-1: configuration #1 chosen from 1 choice
      Feb 16 23:41:33 alon1 BUG: unable to handle kernel NULL pointer  
      dereference at virtual address 00000008
      Feb 16 23:41:33 alon1 printing eip: c01b2db6 *pde = 00000000
      Feb 16 23:41:33 alon1 Oops: 0000 [#1] PREEMPT
      Feb 16 23:41:33 alon1 Modules linked in: ppp_deflate zlib_deflate  
      zlib_inflate bsd_comp ppp_async rfcomm l2cap hci_usb vmnet(P)  
      vmmon(P) tun radeon drm autofs4 ipv6 aes_generic crypto_algapi  
      ieee80211_crypt_ccmp nf_nat_irc nf_nat_ftp nf_conntrack_irc  
      nf_conntrack_ftp ipt_MASQUERADE iptable_nat nf_nat ipt_REJECT  
      xt_tcpudp ipt_LOG xt_limit xt_state nf_conntrack_ipv4 nf_conntrack  
      iptable_filter ip_tables x_tables snd_pcm_oss snd_mixer_oss  
      snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device  
      bluetooth ppp_generic slhc ioatdma dca cfq_iosched cpufreq_powersave  
      cpufreq_ondemand cpufreq_conservative acpi_cpufreq freq_table uinput  
      fan af_packet nls_cp1255 nls_iso8859_1 nls_utf8 nls_base pcmcia  
      snd_intel8x0 snd_ac97_codec ac97_bus snd_pcm nsc_ircc snd_timer  
      ipw2200 thinkpad_acpi irda snd ehci_hcd yenta_socket uhci_hcd  
      psmouse ieee80211 soundcore intel_agp hwmon rsrc_nonstatic pcspkr  
      e1000 crc_ccitt snd_page_alloc i2c_i801 ieee80211_crypt pcmcia_core  
      agpgart thermal bat!
      tery nvram rtc sr_mod ac sg firmware_class button processor cdrom  
      unix usbcore evdev ext3 jbd ext2 mbcache loop ata_piix libata sd_mod  
      scsi_mod
      Feb 16 23:41:33 alon1
      Feb 16 23:41:33 alon1 Pid: 4, comm: events/0 Tainted: P         
      (2.6.24-gentoo-r2 #1)
      Feb 16 23:41:33 alon1 EIP: 0060:[<c01b2db6>] EFLAGS: 00010282 CPU: 0
      Feb 16 23:41:33 alon1 EIP is at sysfs_get_dentry+0x26/0x80
      Feb 16 23:41:33 alon1 EAX: 00000000 EBX: 00000000 ECX: 00000000 EDX:  
      f48a2210
      Feb 16 23:41:33 alon1 ESI: f72eb900 EDI: f4803ae0 EBP: f4803ae0 ESP:  
      f7c49efc
      Feb 16 23:41:33 alon1 hcid[7004]: HCI dev 0 registered
      Feb 16 23:41:33 alon1 DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068
      Feb 16 23:41:33 alon1 Process events/0 (pid: 4, ti=f7c48000  
      task=f7c3efc0 task.ti=f7c48000)
      Feb 16 23:41:33 alon1 Stack: f7cb6140 f4822668 f7e71e10 c01b304d  
      ffffffff ffffffff fffffffe c030ba9c
      Feb 16 23:41:33 alon1 f7cb6140 f4822668 f6da6720 f7cb6140 f4822668  
      f6da6720 c030ba8e c01ce20b
      Feb 16 23:41:33 alon1 f6e9dd00 c030ba8e f6da6720 f6e9dd00 f6e9dd00  
      00000000 f4822600 00000000
      Feb 16 23:41:33 alon1 Call Trace:
      Feb 16 23:41:33 alon1 [<c01b304d>] sysfs_move_dir+0x3d/0x1f0
      Feb 16 23:41:33 alon1 [<c01ce20b>] kobject_move+0x9b/0x120
      Feb 16 23:41:33 alon1 [<c0241711>] device_move+0x51/0x110
      Feb 16 23:41:33 alon1 [<f9aaed80>] del_conn+0x0/0x70 [bluetooth]
      Feb 16 23:41:33 alon1 [<f9aaed99>] del_conn+0x19/0x70 [bluetooth]
      Feb 16 23:41:33 alon1 [<c012c1a1>] run_workqueue+0x81/0x140
      Feb 16 23:41:33 alon1 [<c02c0c88>] schedule+0x168/0x2e0
      Feb 16 23:41:33 alon1 [<c012fc70>] autoremove_wake_function+0x0/0x50
      Feb 16 23:41:33 alon1 [<c012c9cb>] worker_thread+0x9b/0xf0
      Feb 16 23:41:33 alon1 [<c012fc70>] autoremove_wake_function+0x0/0x50
      Feb 16 23:41:33 alon1 [<c012c930>] worker_thread+0x0/0xf0
      Feb 16 23:41:33 alon1 [<c012f962>] kthread+0x42/0x70
      Feb 16 23:41:33 alon1 [<c012f920>] kthread+0x0/0x70
      Feb 16 23:41:33 alon1 [<c0104c2f>] kernel_thread_helper+0x7/0x18
      Feb 16 23:41:33 alon1 =======================
      Feb 16 23:41:33 alon1 Code: 26 00 00 00 00 57 89 c7 a1 50 1b 3a c0  
      56 53 8b 70 38 85 f6 74 08 8b 0e 85 c9 74 58 ff 06 8b 56 50 39 fa 74  
      47 89 fb eb 02 89 c3 <8b> 43 08 39 c2 75 f7 8b 46 08 83 c0 68 e8 98  
      e7 10 00 8b 43 10
      Feb 16 23:41:33 alon1 EIP: [<c01b2db6>] sysfs_get_dentry+0x26/0x80  
      SS:ESP 0068:f7c49efc
      Feb 16 23:41:33 alon1 ---[ end trace aae864e9592acc1d ]---
      
      Defer hci_unregister_sysfs because hci device could be destructed
      while hci conn devices still there.
      Signed-off-by: NDave Young <hidave.darkstar@gmail.com>
      Tested-by: NStefan Seyfried <seife@suse.de>
      Acked-by: NAlon Bar-Lev <alon.barlev@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Acked-by: NMarcel Holtmann <marcel@holtmann.org>
      147e2d59
  20. 18 2月, 2008 1 次提交
  21. 22 10月, 2007 1 次提交