1. 10 3月, 2013 2 次提交
  2. 08 3月, 2013 9 次提交
    • J
      Bluetooth: Remove unused hdev->init_last_cmd · cecbb967
      Johan Hedberg 提交于
      This variable is no longer needed (due to async HCI request support and
      the conversion of hci_req_sync to use it), so it can be safely removed.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Acked-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
      cecbb967
    • J
      Bluetooth: Use async requests internally in hci_req_sync · 42c6b129
      Johan Hedberg 提交于
      This patch converts the hci_req_sync() procedure to internaly use the
      asynchronous HCI requests.
      
      The hci_req_sync mechanism relies on hci_req_complete() calls from
      hci_event.c into hci_core.c whenever a HCI command completes. This is
      very similar to what asynchronous requests do and makes the conversion
      fairly straight forward by converting hci_req_complete into a request
      complete callback. By this change hci_req_complete (renamed to
      hci_req_sync_complete) becomes private to hci_core.c and all calls to it
      can be removed from hci_event.c.
      
      The commands in each hci_req_sync procedure are collected into their own
      request by passing the hci_request pointer to the request callback
      (instead of the hci_dev pointer). The one slight exception is the HCI
      init request which has the special handling of HCI driver specific
      initialization commands. These commands are run in their own request
      prior to the "main" init request.
      
      One other extra change that this patch must contain is the handling of
      spontaneous HCI reset complete events that some controllers exhibit.
      These were previously handled in the hci_req_complete function but the
      right place for them now becomes the hci_req_cmd_complete function.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Acked-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
      42c6b129
    • J
      Bluetooth: Add request cmd_complete and cmd_status functions · 9238f36a
      Johan Hedberg 提交于
      This patch introduces functions to process the HCI request state when
      receiving HCI Command Status or Command Complete events. Some HCI
      commands, like Inquiry do not result in a Command complete event so
      special handling is needed for them. Inquiry is a particularly important
      one since it is the only forseeable "non-cmd_complete" command that will
      make good use of the request functionality, and its completion is either
      indicated by an Inquiry Complete event of a successful Command Complete
      for HCI_Inquiry_Cancel.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Acked-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
      9238f36a
    • J
      Bluetooth: Introduce new hci_req_add function · 71c76a17
      Johan Hedberg 提交于
      This function is analogous to hci_send_cmd() but instead of directly
      queuing the command to hdev->cmd_q it adds it to the local queue of the
      asynchronous HCI request being build (inside struct hci_request).
      
      This is the main function used for building asynchronous requests and
      there should be one or more calls to it between calls to hci_req_init
      and hci_req_run.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Acked-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
      71c76a17
    • J
      Bluetooth: Add initial skeleton for asynchronous HCI requests · 3119ae95
      Johan Hedberg 提交于
      This patch adds the initial definitions and functions for asynchronous
      HCI requests. Asynchronous requests are essentially a group of HCI
      commands together with an optional completion callback. The request is
      tracked through the already existing command queue by having the
      necessary context information as part of the control buffer of each skb.
      
      The only information needed in the skb control buffer is a flag for
      indicating that the skb is the start of a request as well as the
      optional complete callback that should be used when the request is
      complete (this will be found in the last skb of the request).
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Acked-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
      3119ae95
    • D
      Bluetooth: Remove RFCOMM session refcnt · 08c30aca
      Dean Jenkins 提交于
      Previous commits have improved the handling of the RFCOMM session
      timer and the RFCOMM session pointers such that freed RFCOMM
      session structures should no longer be erroneously accessed. The
      RFCOMM session refcnt now has no purpose and will be deleted by
      this commit.
      
      Note that the RFCOMM session is now deleted as soon as the
      RFCOMM control channel link is no longer required. This makes the
      lifetime of the RFCOMM session deterministic and absolute.
      Previously with the refcnt, there was uncertainty about when
      the session structure would be deleted because the relative
      refcnt prevented the session structure from being deleted at will.
      
      It was noted that the refcnt could malfunction under very heavy
      real-time processor loading in embedded SMP environments. This
      could cause premature RFCOMM session deletion or double session
      deletion that could result in kernel crashes. Removal of the
      refcnt prevents this issue.
      
      There are 4 connection / disconnection RFCOMM session scenarios:
      host initiated control link ---> host disconnected control link
      host initiated ctrl link ---> remote device disconnected ctrl link
      remote device initiated ctrl link ---> host disconnected ctrl link
      remote device initiated ctrl link ---> remote device disc'ed ctrl link
      
      The control channel connection procedures are independent of the
      disconnection procedures. Strangely, the RFCOMM session refcnt was
      applying special treatment so erroneously combining connection and
      disconnection events. This commit fixes this issue by removing
      some session code that used the "initiator" member of the session
      structure that was intended for use with the data channels.
      Signed-off-by: NDean Jenkins <Dean_Jenkins@mentor.com>
      Acked-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
      08c30aca
    • D
      Bluetooth: Return RFCOMM session ptrs to avoid freed session · 8ff52f7d
      Dean Jenkins 提交于
      Unfortunately, the design retains local copies of the s RFCOMM
      session pointer in various code blocks and this invites the erroneous
      access to a freed RFCOMM session structure.
      
      Therefore, return the RFCOMM session pointer back up the call stack
      to avoid accessing a freed RFCOMM session structure. When the RFCOMM
      session is deleted, NULL is passed up the call stack.
      
      If active DLCs exist when the rfcomm session is terminating,
      avoid a memory leak of rfcomm_dlc structures by ensuring that
      rfcomm_session_close() is used instead of rfcomm_session_del().
      Signed-off-by: NDean Jenkins <Dean_Jenkins@mentor.com>
      Acked-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
      8ff52f7d
    • D
      Bluetooth: change bt_sock_unregister() to return void · be9f97f0
      David Herrmann 提交于
      There is no reason a caller ever wants to check the return type of this
      call. _Iff_ a user successfully called bt_sock_register(), they're allowed
      to call bt_sock_unregister().
      All other calls in the kernel (device_del, device_unregister, kfree(), ..)
      that are logically equivalent return void. Lets not make callers think
      they have to check the return type of this call and instead simply return
      void.
      
      We guarantee that after bt_sock_unregister() is called, the socket type
      _is_ unregistered. If that is not what the caller wants, they're using the
      wrong function, anyway.
      Signed-off-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
      be9f97f0
    • A
      Bluetooth: Rename hci_acl_disconn · bed71748
      Andre Guedes 提交于
      As hci_acl_disconn function basically sends the HCI Disconnect Command
      and it is used to disconnect ACL, SCO and LE links, renaming it to
      hci_disconnect is more suitable.
      Signed-off-by: NAndre Guedes <andre.guedes@openbossa.org>
      Signed-off-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
      bed71748
  3. 02 2月, 2013 1 次提交
  4. 23 1月, 2013 4 次提交
  5. 18 1月, 2013 1 次提交
  6. 10 1月, 2013 3 次提交
  7. 04 12月, 2012 4 次提交
  8. 20 11月, 2012 2 次提交
  9. 19 11月, 2012 3 次提交
  10. 02 11月, 2012 11 次提交