20 Oct, 2016

1 commit


06 Oct, 2016

1 commit


20 Sep, 2016

1 commit

  • When an Advertising Instance is removed, the Advertising Removed event
    shouldn't be sent to the same socket that issued the Remove
    Advertising command (it gets a command complete event instead). The
    mgmt_advertising_removed() function already has a parameter for
    skipping a specific socket, but there was no code to propagate the
    right value to this parameter. This patch fixes the issue by making
    sure the intermediate hci_req_clear_adv_instance() function gets the
    socket pointer.

    Signed-off-by: Johan Hedberg
    Signed-off-by: Marcel Holtmann

    Johan Hedberg
     

11 Mar, 2016

1 commit

  • Introduce a limited privacy mode indicated by value 0x02 to the mgmt
    Set Privacy command.

    With value 0x02 the kernel will use privacy mode with a resolvable
    private address. In case the controller is bondable and discoverable
    the identity address will be used.

    Signed-off-by: Johan Hedberg
    Signed-off-by: Marcel Holtmann

    Johan Hedberg
     

10 Dec, 2015

8 commits

  • We can simplify a lot of code by making sure hdev->cur_adv_instance is
    always up-to-date. This allows e.g. the removal of the
    get_current_adv_instance() helper function and the special
    HCI_ADV_CURRENT value. This patch also makes selecting instance 0x00
    explicit in the various calls where advertising instances aren't
    enabled, e.g. when HCI_ADVERTISING is set or we've just finished
    enabling LE.

    Signed-off-by: Johan Hedberg
    Signed-off-by: Marcel Holtmann

    Johan Hedberg
     
  • The request to update HCI during power on is always coming either from
    hdev->req_workqueue or through an ioctl, so it's safe to use
    hci_req_sync for it. This way we also eliminate potential races with
    incoming mgmt commands or other actions while powering on.

    Part of this refactoring is the splitting of mgmt_powered() into
    mgmt_power_on() and __mgmt_power_off() functions. The main reason is
    the different requirements as far as hdev locking is concerned, as
    highlighted with the __ prefix of the power off API.

    Since the power on in the case of clearing the AUTO_OFF flag cannot be
    done synchronously in the set_powered mgmt handler, the hci_power_on
    work callback is extended to cover this (which also simplifies the
    set_powered helper a lot).

    Signed-off-by: Johan Hedberg
    Signed-off-by: Marcel Holtmann

    Johan Hedberg
     
  • We'll soon need this both in hci_request.c and mgmt.c so move it to
    hci_request.c as a generic helper.

    Signed-off-by: Johan Hedberg
    Signed-off-by: Marcel Holtmann

    Johan Hedberg
     
  • We'll soon need to update the EIR both from hci_request.c and mgmt.c
    so move update_eir() as a more generic request helper to
    hci_request.c.

    Signed-off-by: Johan Hedberg
    Signed-off-by: Marcel Holtmann

    Johan Hedberg
     
  • We'll soon need this both from hci_request.c and mgmt.c so move it as
    a request helper function to hci_request.c.

    Signed-off-by: Johan Hedberg
    Signed-off-by: Marcel Holtmann

    Johan Hedberg
     
  • The Class of Device needs to be changed e.g. for limited discoverable
    mode. In preparation of moving the discoverable mode to hci_request.c
    and hdev->req_workqueue, move the Class of Device helpers there first.

    Signed-off-by: Johan Hedberg
    Signed-off-by: Marcel Holtmann

    Johan Hedberg
     
  • This paves the way for eventually performing advertising changes
    through the hdev->req_workqueue. Some new APIs need to be exposed from
    mgmt.c to hci_request.c and vice-versa, but many of them will go away
    once hdev->req_workqueue gets used.

    Signed-off-by: Johan Hedberg
    Signed-off-by: Marcel Holtmann

    Johan Hedberg
     
  • Since Add/Remove Device perform the page scan updates independently
    from the HCI command completion we've introduced a potential race when
    multiple mgmt commands are queued. Doing the page scan updates through
    the req_workqueue ensures that the state changes are performed in a
    race-free manner.

    At the same time, to make the request helper more widely usable,
    extend it to also cover Inquiry Scan changes since those are behind
    the same HCI command. This is also reflected in the new name of the
    API as well as the work struct name.

    Signed-off-by: Johan Hedberg
    Signed-off-by: Marcel Holtmann

    Johan Hedberg
     

20 Nov, 2015

8 commits


22 Oct, 2015

1 commit


02 Apr, 2015

1 commit

  • This patch adds a second possible callback for HCI requests where the
    callback will receive the full skb of the last successfully completed
    HCI command. This API is useful for cases where we want to use a request
    to read some data and the existing hci_event.c handlers do not store it
    e.g. in the hci_dev struct.

    The reason the patch is a bit bigger than just adding the new API is
    because the hci_req_cmd_complete() functions required some refactoring
    to enable it: now hci_req_cmd_complete() is simply used to request the
    callback pointers if any, and the actual calling of them happens from a
    single place at the end of hci_event_packet(). The reason for this is
    that we need to pass the original skb (without any skb_pull, etc
    modifications done to it) and it's simplest to keep track of it within
    the hci_event_packet() function.

    Signed-off-by: Johan Hedberg
    Signed-off-by: Marcel Holtmann

    Johan Hedberg
     

20 Dec, 2014

1 commit

  • Many places using hci_update_background_scan() try to synchronize
    whatever they're doing with the help of hci_request callbacks. However,
    since the hci_update_background_scan() function hasn't so far accepted a
    hci_request pointer any commands triggered by it have been left out by
    the synchronization. This patch modifies the API in a similar way as was
    done for hci_update_page_scan, i.e. there's a variant that takes a
    hci_request and another one that takes a hci_dev.

    Signed-off-by: Johan Hedberg
    Signed-off-by: Marcel Holtmann

    Johan Hedberg
     

19 Dec, 2014

1 commit

  • None of the hci_request related things in net/bluetooth/hci_core.h are
    needed anywhere outside of the core bluetooth module. This patch creates
    a new net/bluetooth/hci_request.c file with its corresponding h-file and
    moves the functionality there from hci_core.c and hci_core.h.

    Signed-off-by: Johan Hedberg
    Signed-off-by: Marcel Holtmann

    Johan Hedberg