Skip to content

Commit

Permalink
Bluetooth: Add flag to track managment controlled adapters
Browse files Browse the repository at this point in the history
This patch adds a HCI_MGMT flag to track adapters which are under the
control of the management interface. This is needed to make sure that
new kernels will work with old user space versions. I.e. behaviour which
could break old user space versions (but is needed by the management
interface) should not be exhibited when the HCI_MGMT flag is not set.

Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
  • Loading branch information
Johan Hedberg authored and Gustavo F. Padovan committed Feb 8, 2011
1 parent 72a734e commit ebc99fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/net/bluetooth/hci.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ enum {

HCI_SETUP,
HCI_AUTO_OFF,
HCI_MGMT,
};

/* HCI ioctl defines */
Expand Down
4 changes: 4 additions & 0 deletions net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ static int read_index_list(struct sock *sk)

hci_del_off_timer(d);

set_bit(HCI_MGMT, &d->flags);

if (test_bit(HCI_SETUP, &d->flags))
continue;

Expand Down Expand Up @@ -200,6 +202,8 @@ static int read_controller_info(struct sock *sk, unsigned char *data, u16 len)

hci_dev_lock_bh(hdev);

set_bit(HCI_MGMT, &hdev->flags);

put_unaligned_le16(hdev->id, &rp->index);
rp->type = hdev->dev_type;

Expand Down

0 comments on commit ebc99fe

Please sign in to comment.