Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 290868
b: refs/heads/master
c: a8b2d5c
h: refs/heads/master
v: v3
  • Loading branch information
Johan Hedberg committed Feb 13, 2012
1 parent 72eb26d commit 145b0f2
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 62 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cbe8fed490601862310f035b9973509b8634998e
refs/heads/master: a8b2d5c2cfe1c6398e3fdd4372c4ae7f74fb4493
16 changes: 8 additions & 8 deletions trunk/include/net/bluetooth/hci.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,6 @@ enum {

HCI_RAW,

HCI_SETUP,
HCI_AUTO_OFF,
HCI_MGMT,
HCI_PAIRABLE,
HCI_SERVICE_CACHE,
HCI_LINK_KEYS,
HCI_DEBUG_KEYS,

HCI_RESET,
};

Expand All @@ -93,6 +85,14 @@ enum {
* states from the controller.
*/
enum {
HCI_SETUP,
HCI_AUTO_OFF,
HCI_MGMT,
HCI_PAIRABLE,
HCI_SERVICE_CACHE,
HCI_LINK_KEYS,
HCI_DEBUG_KEYS,

HCI_LE_SCAN,
};

Expand Down
30 changes: 15 additions & 15 deletions trunk/net/bluetooth/hci_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ int hci_dev_open(__u16 dev)
hci_dev_hold(hdev);
set_bit(HCI_UP, &hdev->flags);
hci_notify(hdev, HCI_DEV_UP);
if (!test_bit(HCI_SETUP, &hdev->flags)) {
if (!test_bit(HCI_SETUP, &hdev->dev_flags)) {
hci_dev_lock(hdev);
mgmt_powered(hdev, 1);
hci_dev_unlock(hdev);
Expand Down Expand Up @@ -722,10 +722,10 @@ static int hci_dev_do_close(struct hci_dev *hdev)
hdev->discov_timeout = 0;
}

if (test_and_clear_bit(HCI_AUTO_OFF, &hdev->flags))
if (test_and_clear_bit(HCI_AUTO_OFF, &hdev->dev_flags))
cancel_delayed_work(&hdev->power_off);

if (test_and_clear_bit(HCI_SERVICE_CACHE, &hdev->flags))
if (test_and_clear_bit(HCI_SERVICE_CACHE, &hdev->dev_flags))
cancel_delayed_work(&hdev->service_cache);

hci_dev_lock(hdev);
Expand Down Expand Up @@ -947,11 +947,11 @@ int hci_get_dev_list(void __user *arg)

read_lock(&hci_dev_list_lock);
list_for_each_entry(hdev, &hci_dev_list, list) {
if (test_and_clear_bit(HCI_AUTO_OFF, &hdev->flags))
if (test_and_clear_bit(HCI_AUTO_OFF, &hdev->dev_flags))
cancel_delayed_work(&hdev->power_off);

if (!test_bit(HCI_MGMT, &hdev->flags))
set_bit(HCI_PAIRABLE, &hdev->flags);
if (!test_bit(HCI_MGMT, &hdev->dev_flags))
set_bit(HCI_PAIRABLE, &hdev->dev_flags);

(dr + n)->dev_id = hdev->id;
(dr + n)->dev_opt = hdev->flags;
Expand Down Expand Up @@ -983,11 +983,11 @@ int hci_get_dev_info(void __user *arg)
if (!hdev)
return -ENODEV;

if (test_and_clear_bit(HCI_AUTO_OFF, &hdev->flags))
if (test_and_clear_bit(HCI_AUTO_OFF, &hdev->dev_flags))
cancel_delayed_work_sync(&hdev->power_off);

if (!test_bit(HCI_MGMT, &hdev->flags))
set_bit(HCI_PAIRABLE, &hdev->flags);
if (!test_bit(HCI_MGMT, &hdev->dev_flags))
set_bit(HCI_PAIRABLE, &hdev->dev_flags);

strcpy(di.name, hdev->name);
di.bdaddr = hdev->bdaddr;
Expand Down Expand Up @@ -1067,11 +1067,11 @@ static void hci_power_on(struct work_struct *work)
if (hci_dev_open(hdev->id) < 0)
return;

if (test_bit(HCI_AUTO_OFF, &hdev->flags))
if (test_bit(HCI_AUTO_OFF, &hdev->dev_flags))
schedule_delayed_work(&hdev->power_off,
msecs_to_jiffies(AUTO_OFF_TIMEOUT));

if (test_and_clear_bit(HCI_SETUP, &hdev->flags))
if (test_and_clear_bit(HCI_SETUP, &hdev->dev_flags))
mgmt_index_added(hdev);
}

Expand All @@ -1082,7 +1082,7 @@ static void hci_power_off(struct work_struct *work)

BT_DBG("%s", hdev->name);

clear_bit(HCI_AUTO_OFF, &hdev->flags);
clear_bit(HCI_AUTO_OFF, &hdev->dev_flags);

hci_dev_close(hdev->id);
}
Expand Down Expand Up @@ -1649,8 +1649,8 @@ int hci_register_dev(struct hci_dev *hdev)
}
}

set_bit(HCI_AUTO_OFF, &hdev->flags);
set_bit(HCI_SETUP, &hdev->flags);
set_bit(HCI_AUTO_OFF, &hdev->dev_flags);
set_bit(HCI_SETUP, &hdev->dev_flags);
schedule_work(&hdev->power_on);

hci_notify(hdev, HCI_DEV_REG);
Expand Down Expand Up @@ -1686,7 +1686,7 @@ void hci_unregister_dev(struct hci_dev *hdev)
kfree_skb(hdev->reassembly[i]);

if (!test_bit(HCI_INIT, &hdev->flags) &&
!test_bit(HCI_SETUP, &hdev->flags)) {
!test_bit(HCI_SETUP, &hdev->dev_flags)) {
hci_dev_lock(hdev);
mgmt_index_removed(hdev);
hci_dev_unlock(hdev);
Expand Down
44 changes: 22 additions & 22 deletions trunk/net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ static void hci_cc_write_local_name(struct hci_dev *hdev, struct sk_buff *skb)

hci_dev_lock(hdev);

if (test_bit(HCI_MGMT, &hdev->flags))
if (test_bit(HCI_MGMT, &hdev->dev_flags))
mgmt_set_local_name_complete(hdev, sent, status);

if (status == 0)
Expand Down Expand Up @@ -890,7 +890,7 @@ static void hci_cc_pin_code_reply(struct hci_dev *hdev, struct sk_buff *skb)

hci_dev_lock(hdev);

if (test_bit(HCI_MGMT, &hdev->flags))
if (test_bit(HCI_MGMT, &hdev->dev_flags))
mgmt_pin_code_reply_complete(hdev, &rp->bdaddr, rp->status);

if (rp->status != 0)
Expand All @@ -916,7 +916,7 @@ static void hci_cc_pin_code_neg_reply(struct hci_dev *hdev, struct sk_buff *skb)

hci_dev_lock(hdev);

if (test_bit(HCI_MGMT, &hdev->flags))
if (test_bit(HCI_MGMT, &hdev->dev_flags))
mgmt_pin_code_neg_reply_complete(hdev, &rp->bdaddr,
rp->status);

Expand Down Expand Up @@ -951,7 +951,7 @@ static void hci_cc_user_confirm_reply(struct hci_dev *hdev, struct sk_buff *skb)

hci_dev_lock(hdev);

if (test_bit(HCI_MGMT, &hdev->flags))
if (test_bit(HCI_MGMT, &hdev->dev_flags))
mgmt_user_confirm_reply_complete(hdev, &rp->bdaddr,
rp->status);

Expand All @@ -967,7 +967,7 @@ static void hci_cc_user_confirm_neg_reply(struct hci_dev *hdev,

hci_dev_lock(hdev);

if (test_bit(HCI_MGMT, &hdev->flags))
if (test_bit(HCI_MGMT, &hdev->dev_flags))
mgmt_user_confirm_neg_reply_complete(hdev, &rp->bdaddr,
rp->status);

Expand All @@ -982,7 +982,7 @@ static void hci_cc_user_passkey_reply(struct hci_dev *hdev, struct sk_buff *skb)

hci_dev_lock(hdev);

if (test_bit(HCI_MGMT, &hdev->flags))
if (test_bit(HCI_MGMT, &hdev->dev_flags))
mgmt_user_passkey_reply_complete(hdev, &rp->bdaddr,
rp->status);

Expand All @@ -998,7 +998,7 @@ static void hci_cc_user_passkey_neg_reply(struct hci_dev *hdev,

hci_dev_lock(hdev);

if (test_bit(HCI_MGMT, &hdev->flags))
if (test_bit(HCI_MGMT, &hdev->dev_flags))
mgmt_user_passkey_neg_reply_complete(hdev, &rp->bdaddr,
rp->status);

Expand Down Expand Up @@ -1110,7 +1110,7 @@ static inline void hci_cs_inquiry(struct hci_dev *hdev, __u8 status)
hci_req_complete(hdev, HCI_OP_INQUIRY, status);
hci_conn_check_pending(hdev);
hci_dev_lock(hdev);
if (test_bit(HCI_MGMT, &hdev->flags))
if (test_bit(HCI_MGMT, &hdev->dev_flags))
mgmt_start_discovery_failed(hdev, status);
hci_dev_unlock(hdev);
return;
Expand Down Expand Up @@ -1333,7 +1333,7 @@ static void hci_cs_remote_name_req(struct hci_dev *hdev, __u8 status)

hci_dev_lock(hdev);

if (test_bit(HCI_MGMT, &hdev->flags))
if (test_bit(HCI_MGMT, &hdev->dev_flags))
hci_resolve_next_name(hdev, &cp->bdaddr);

conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &cp->bdaddr);
Expand Down Expand Up @@ -1555,7 +1555,7 @@ static inline void hci_inquiry_complete_evt(struct hci_dev *hdev, struct sk_buff
if (!test_and_clear_bit(HCI_INQUIRY, &hdev->flags))
return;

if (!test_bit(HCI_MGMT, &hdev->flags))
if (!test_bit(HCI_MGMT, &hdev->dev_flags))
return;

hci_dev_lock(hdev);
Expand Down Expand Up @@ -1876,7 +1876,7 @@ static inline void hci_remote_name_evt(struct hci_dev *hdev, struct sk_buff *skb

hci_dev_lock(hdev);

if (test_bit(HCI_MGMT, &hdev->flags)) {
if (test_bit(HCI_MGMT, &hdev->dev_flags)) {
if (ev->status == 0)
mgmt_remote_name(hdev, &ev->bdaddr, ev->name);

Expand Down Expand Up @@ -2505,10 +2505,10 @@ static inline void hci_pin_code_request_evt(struct hci_dev *hdev, struct sk_buff
hci_conn_put(conn);
}

if (!test_bit(HCI_PAIRABLE, &hdev->flags))
if (!test_bit(HCI_PAIRABLE, &hdev->dev_flags))
hci_send_cmd(hdev, HCI_OP_PIN_CODE_NEG_REPLY,
sizeof(ev->bdaddr), &ev->bdaddr);
else if (test_bit(HCI_MGMT, &hdev->flags)) {
else if (test_bit(HCI_MGMT, &hdev->dev_flags)) {
u8 secure;

if (conn->pending_sec_level == BT_SECURITY_HIGH)
Expand All @@ -2532,7 +2532,7 @@ static inline void hci_link_key_request_evt(struct hci_dev *hdev, struct sk_buff

BT_DBG("%s", hdev->name);

if (!test_bit(HCI_LINK_KEYS, &hdev->flags))
if (!test_bit(HCI_LINK_KEYS, &hdev->dev_flags))
return;

hci_dev_lock(hdev);
Expand All @@ -2547,7 +2547,7 @@ static inline void hci_link_key_request_evt(struct hci_dev *hdev, struct sk_buff
BT_DBG("%s found key type %u for %s", hdev->name, key->type,
batostr(&ev->bdaddr));

if (!test_bit(HCI_DEBUG_KEYS, &hdev->flags) &&
if (!test_bit(HCI_DEBUG_KEYS, &hdev->dev_flags) &&
key->type == HCI_LK_DEBUG_COMBINATION) {
BT_DBG("%s ignoring debug key", hdev->name);
goto not_found;
Expand Down Expand Up @@ -2609,7 +2609,7 @@ static inline void hci_link_key_notify_evt(struct hci_dev *hdev, struct sk_buff
hci_conn_put(conn);
}

if (test_bit(HCI_LINK_KEYS, &hdev->flags))
if (test_bit(HCI_LINK_KEYS, &hdev->dev_flags))
hci_add_link_key(hdev, conn, 1, &ev->bdaddr, ev->link_key,
ev->key_type, pin_len);

Expand Down Expand Up @@ -2890,7 +2890,7 @@ static inline void hci_extended_inquiry_result_evt(struct hci_dev *hdev, struct
data.rssi = info->rssi;
data.ssp_mode = 0x01;

if (test_bit(HCI_MGMT, &hdev->flags))
if (test_bit(HCI_MGMT, &hdev->dev_flags))
name_known = eir_has_complete_name(info->data,
sizeof(info->data));
else
Expand Down Expand Up @@ -2939,10 +2939,10 @@ static inline void hci_io_capa_request_evt(struct hci_dev *hdev, struct sk_buff

hci_conn_hold(conn);

if (!test_bit(HCI_MGMT, &hdev->flags))
if (!test_bit(HCI_MGMT, &hdev->dev_flags))
goto unlock;

if (test_bit(HCI_PAIRABLE, &hdev->flags) ||
if (test_bit(HCI_PAIRABLE, &hdev->dev_flags) ||
(conn->remote_auth & ~0x01) == HCI_AT_NO_BONDING) {
struct hci_cp_io_capability_reply cp;

Expand Down Expand Up @@ -3005,7 +3005,7 @@ static inline void hci_user_confirm_request_evt(struct hci_dev *hdev,

hci_dev_lock(hdev);

if (!test_bit(HCI_MGMT, &hdev->flags))
if (!test_bit(HCI_MGMT, &hdev->dev_flags))
goto unlock;

conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr);
Expand Down Expand Up @@ -3071,7 +3071,7 @@ static inline void hci_user_passkey_request_evt(struct hci_dev *hdev,

hci_dev_lock(hdev);

if (test_bit(HCI_MGMT, &hdev->flags))
if (test_bit(HCI_MGMT, &hdev->dev_flags))
mgmt_user_passkey_request(hdev, &ev->bdaddr);

hci_dev_unlock(hdev);
Expand Down Expand Up @@ -3130,7 +3130,7 @@ static inline void hci_remote_oob_data_request_evt(struct hci_dev *hdev,

hci_dev_lock(hdev);

if (!test_bit(HCI_MGMT, &hdev->flags))
if (!test_bit(HCI_MGMT, &hdev->dev_flags))
goto unlock;

data = hci_find_remote_oob_data(hdev, &ev->bdaddr);
Expand Down
Loading

0 comments on commit 145b0f2

Please sign in to comment.