diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2012-01-08 16:11:15 -0500 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-02-13 10:01:25 -0500 |
commit | a8b2d5c2cfe1c6398e3fdd4372c4ae7f74fb4493 (patch) | |
tree | 5e732f5143512a52eb7a343c143c1eaeb565c8f7 /net/bluetooth/hci_event.c | |
parent | cbe8fed490601862310f035b9973509b8634998e (diff) |
Bluetooth: Move mgmt related flags from hdev->flags to hdev->dev_flags
There's no point in exposing these to user-space (which is what happens
to everything in hdev->flags) so move them to dev_flags instead.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r-- | net/bluetooth/hci_event.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 0466ed9c1b47..2d39ede1f202 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -211,7 +211,7 @@ static void hci_cc_write_local_name(struct hci_dev *hdev, struct sk_buff *skb) | |||
211 | 211 | ||
212 | hci_dev_lock(hdev); | 212 | hci_dev_lock(hdev); |
213 | 213 | ||
214 | if (test_bit(HCI_MGMT, &hdev->flags)) | 214 | if (test_bit(HCI_MGMT, &hdev->dev_flags)) |
215 | mgmt_set_local_name_complete(hdev, sent, status); | 215 | mgmt_set_local_name_complete(hdev, sent, status); |
216 | 216 | ||
217 | if (status == 0) | 217 | if (status == 0) |
@@ -890,7 +890,7 @@ static void hci_cc_pin_code_reply(struct hci_dev *hdev, struct sk_buff *skb) | |||
890 | 890 | ||
891 | hci_dev_lock(hdev); | 891 | hci_dev_lock(hdev); |
892 | 892 | ||
893 | if (test_bit(HCI_MGMT, &hdev->flags)) | 893 | if (test_bit(HCI_MGMT, &hdev->dev_flags)) |
894 | mgmt_pin_code_reply_complete(hdev, &rp->bdaddr, rp->status); | 894 | mgmt_pin_code_reply_complete(hdev, &rp->bdaddr, rp->status); |
895 | 895 | ||
896 | if (rp->status != 0) | 896 | if (rp->status != 0) |
@@ -916,7 +916,7 @@ static void hci_cc_pin_code_neg_reply(struct hci_dev *hdev, struct sk_buff *skb) | |||
916 | 916 | ||
917 | hci_dev_lock(hdev); | 917 | hci_dev_lock(hdev); |
918 | 918 | ||
919 | if (test_bit(HCI_MGMT, &hdev->flags)) | 919 | if (test_bit(HCI_MGMT, &hdev->dev_flags)) |
920 | mgmt_pin_code_neg_reply_complete(hdev, &rp->bdaddr, | 920 | mgmt_pin_code_neg_reply_complete(hdev, &rp->bdaddr, |
921 | rp->status); | 921 | rp->status); |
922 | 922 | ||
@@ -951,7 +951,7 @@ static void hci_cc_user_confirm_reply(struct hci_dev *hdev, struct sk_buff *skb) | |||
951 | 951 | ||
952 | hci_dev_lock(hdev); | 952 | hci_dev_lock(hdev); |
953 | 953 | ||
954 | if (test_bit(HCI_MGMT, &hdev->flags)) | 954 | if (test_bit(HCI_MGMT, &hdev->dev_flags)) |
955 | mgmt_user_confirm_reply_complete(hdev, &rp->bdaddr, | 955 | mgmt_user_confirm_reply_complete(hdev, &rp->bdaddr, |
956 | rp->status); | 956 | rp->status); |
957 | 957 | ||
@@ -967,7 +967,7 @@ static void hci_cc_user_confirm_neg_reply(struct hci_dev *hdev, | |||
967 | 967 | ||
968 | hci_dev_lock(hdev); | 968 | hci_dev_lock(hdev); |
969 | 969 | ||
970 | if (test_bit(HCI_MGMT, &hdev->flags)) | 970 | if (test_bit(HCI_MGMT, &hdev->dev_flags)) |
971 | mgmt_user_confirm_neg_reply_complete(hdev, &rp->bdaddr, | 971 | mgmt_user_confirm_neg_reply_complete(hdev, &rp->bdaddr, |
972 | rp->status); | 972 | rp->status); |
973 | 973 | ||
@@ -982,7 +982,7 @@ static void hci_cc_user_passkey_reply(struct hci_dev *hdev, struct sk_buff *skb) | |||
982 | 982 | ||
983 | hci_dev_lock(hdev); | 983 | hci_dev_lock(hdev); |
984 | 984 | ||
985 | if (test_bit(HCI_MGMT, &hdev->flags)) | 985 | if (test_bit(HCI_MGMT, &hdev->dev_flags)) |
986 | mgmt_user_passkey_reply_complete(hdev, &rp->bdaddr, | 986 | mgmt_user_passkey_reply_complete(hdev, &rp->bdaddr, |
987 | rp->status); | 987 | rp->status); |
988 | 988 | ||
@@ -998,7 +998,7 @@ static void hci_cc_user_passkey_neg_reply(struct hci_dev *hdev, | |||
998 | 998 | ||
999 | hci_dev_lock(hdev); | 999 | hci_dev_lock(hdev); |
1000 | 1000 | ||
1001 | if (test_bit(HCI_MGMT, &hdev->flags)) | 1001 | if (test_bit(HCI_MGMT, &hdev->dev_flags)) |
1002 | mgmt_user_passkey_neg_reply_complete(hdev, &rp->bdaddr, | 1002 | mgmt_user_passkey_neg_reply_complete(hdev, &rp->bdaddr, |
1003 | rp->status); | 1003 | rp->status); |
1004 | 1004 | ||
@@ -1110,7 +1110,7 @@ static inline void hci_cs_inquiry(struct hci_dev *hdev, __u8 status) | |||
1110 | hci_req_complete(hdev, HCI_OP_INQUIRY, status); | 1110 | hci_req_complete(hdev, HCI_OP_INQUIRY, status); |
1111 | hci_conn_check_pending(hdev); | 1111 | hci_conn_check_pending(hdev); |
1112 | hci_dev_lock(hdev); | 1112 | hci_dev_lock(hdev); |
1113 | if (test_bit(HCI_MGMT, &hdev->flags)) | 1113 | if (test_bit(HCI_MGMT, &hdev->dev_flags)) |
1114 | mgmt_start_discovery_failed(hdev, status); | 1114 | mgmt_start_discovery_failed(hdev, status); |
1115 | hci_dev_unlock(hdev); | 1115 | hci_dev_unlock(hdev); |
1116 | return; | 1116 | return; |
@@ -1333,7 +1333,7 @@ static void hci_cs_remote_name_req(struct hci_dev *hdev, __u8 status) | |||
1333 | 1333 | ||
1334 | hci_dev_lock(hdev); | 1334 | hci_dev_lock(hdev); |
1335 | 1335 | ||
1336 | if (test_bit(HCI_MGMT, &hdev->flags)) | 1336 | if (test_bit(HCI_MGMT, &hdev->dev_flags)) |
1337 | hci_resolve_next_name(hdev, &cp->bdaddr); | 1337 | hci_resolve_next_name(hdev, &cp->bdaddr); |
1338 | 1338 | ||
1339 | conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &cp->bdaddr); | 1339 | conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &cp->bdaddr); |
@@ -1555,7 +1555,7 @@ static inline void hci_inquiry_complete_evt(struct hci_dev *hdev, struct sk_buff | |||
1555 | if (!test_and_clear_bit(HCI_INQUIRY, &hdev->flags)) | 1555 | if (!test_and_clear_bit(HCI_INQUIRY, &hdev->flags)) |
1556 | return; | 1556 | return; |
1557 | 1557 | ||
1558 | if (!test_bit(HCI_MGMT, &hdev->flags)) | 1558 | if (!test_bit(HCI_MGMT, &hdev->dev_flags)) |
1559 | return; | 1559 | return; |
1560 | 1560 | ||
1561 | hci_dev_lock(hdev); | 1561 | hci_dev_lock(hdev); |
@@ -1876,7 +1876,7 @@ static inline void hci_remote_name_evt(struct hci_dev *hdev, struct sk_buff *skb | |||
1876 | 1876 | ||
1877 | hci_dev_lock(hdev); | 1877 | hci_dev_lock(hdev); |
1878 | 1878 | ||
1879 | if (test_bit(HCI_MGMT, &hdev->flags)) { | 1879 | if (test_bit(HCI_MGMT, &hdev->dev_flags)) { |
1880 | if (ev->status == 0) | 1880 | if (ev->status == 0) |
1881 | mgmt_remote_name(hdev, &ev->bdaddr, ev->name); | 1881 | mgmt_remote_name(hdev, &ev->bdaddr, ev->name); |
1882 | 1882 | ||
@@ -2505,10 +2505,10 @@ static inline void hci_pin_code_request_evt(struct hci_dev *hdev, struct sk_buff | |||
2505 | hci_conn_put(conn); | 2505 | hci_conn_put(conn); |
2506 | } | 2506 | } |
2507 | 2507 | ||
2508 | if (!test_bit(HCI_PAIRABLE, &hdev->flags)) | 2508 | if (!test_bit(HCI_PAIRABLE, &hdev->dev_flags)) |
2509 | hci_send_cmd(hdev, HCI_OP_PIN_CODE_NEG_REPLY, | 2509 | hci_send_cmd(hdev, HCI_OP_PIN_CODE_NEG_REPLY, |
2510 | sizeof(ev->bdaddr), &ev->bdaddr); | 2510 | sizeof(ev->bdaddr), &ev->bdaddr); |
2511 | else if (test_bit(HCI_MGMT, &hdev->flags)) { | 2511 | else if (test_bit(HCI_MGMT, &hdev->dev_flags)) { |
2512 | u8 secure; | 2512 | u8 secure; |
2513 | 2513 | ||
2514 | if (conn->pending_sec_level == BT_SECURITY_HIGH) | 2514 | if (conn->pending_sec_level == BT_SECURITY_HIGH) |
@@ -2532,7 +2532,7 @@ static inline void hci_link_key_request_evt(struct hci_dev *hdev, struct sk_buff | |||
2532 | 2532 | ||
2533 | BT_DBG("%s", hdev->name); | 2533 | BT_DBG("%s", hdev->name); |
2534 | 2534 | ||
2535 | if (!test_bit(HCI_LINK_KEYS, &hdev->flags)) | 2535 | if (!test_bit(HCI_LINK_KEYS, &hdev->dev_flags)) |
2536 | return; | 2536 | return; |
2537 | 2537 | ||
2538 | hci_dev_lock(hdev); | 2538 | hci_dev_lock(hdev); |
@@ -2547,7 +2547,7 @@ static inline void hci_link_key_request_evt(struct hci_dev *hdev, struct sk_buff | |||
2547 | BT_DBG("%s found key type %u for %s", hdev->name, key->type, | 2547 | BT_DBG("%s found key type %u for %s", hdev->name, key->type, |
2548 | batostr(&ev->bdaddr)); | 2548 | batostr(&ev->bdaddr)); |
2549 | 2549 | ||
2550 | if (!test_bit(HCI_DEBUG_KEYS, &hdev->flags) && | 2550 | if (!test_bit(HCI_DEBUG_KEYS, &hdev->dev_flags) && |
2551 | key->type == HCI_LK_DEBUG_COMBINATION) { | 2551 | key->type == HCI_LK_DEBUG_COMBINATION) { |
2552 | BT_DBG("%s ignoring debug key", hdev->name); | 2552 | BT_DBG("%s ignoring debug key", hdev->name); |
2553 | goto not_found; | 2553 | goto not_found; |
@@ -2609,7 +2609,7 @@ static inline void hci_link_key_notify_evt(struct hci_dev *hdev, struct sk_buff | |||
2609 | hci_conn_put(conn); | 2609 | hci_conn_put(conn); |
2610 | } | 2610 | } |
2611 | 2611 | ||
2612 | if (test_bit(HCI_LINK_KEYS, &hdev->flags)) | 2612 | if (test_bit(HCI_LINK_KEYS, &hdev->dev_flags)) |
2613 | hci_add_link_key(hdev, conn, 1, &ev->bdaddr, ev->link_key, | 2613 | hci_add_link_key(hdev, conn, 1, &ev->bdaddr, ev->link_key, |
2614 | ev->key_type, pin_len); | 2614 | ev->key_type, pin_len); |
2615 | 2615 | ||
@@ -2890,7 +2890,7 @@ static inline void hci_extended_inquiry_result_evt(struct hci_dev *hdev, struct | |||
2890 | data.rssi = info->rssi; | 2890 | data.rssi = info->rssi; |
2891 | data.ssp_mode = 0x01; | 2891 | data.ssp_mode = 0x01; |
2892 | 2892 | ||
2893 | if (test_bit(HCI_MGMT, &hdev->flags)) | 2893 | if (test_bit(HCI_MGMT, &hdev->dev_flags)) |
2894 | name_known = eir_has_complete_name(info->data, | 2894 | name_known = eir_has_complete_name(info->data, |
2895 | sizeof(info->data)); | 2895 | sizeof(info->data)); |
2896 | else | 2896 | else |
@@ -2939,10 +2939,10 @@ static inline void hci_io_capa_request_evt(struct hci_dev *hdev, struct sk_buff | |||
2939 | 2939 | ||
2940 | hci_conn_hold(conn); | 2940 | hci_conn_hold(conn); |
2941 | 2941 | ||
2942 | if (!test_bit(HCI_MGMT, &hdev->flags)) | 2942 | if (!test_bit(HCI_MGMT, &hdev->dev_flags)) |
2943 | goto unlock; | 2943 | goto unlock; |
2944 | 2944 | ||
2945 | if (test_bit(HCI_PAIRABLE, &hdev->flags) || | 2945 | if (test_bit(HCI_PAIRABLE, &hdev->dev_flags) || |
2946 | (conn->remote_auth & ~0x01) == HCI_AT_NO_BONDING) { | 2946 | (conn->remote_auth & ~0x01) == HCI_AT_NO_BONDING) { |
2947 | struct hci_cp_io_capability_reply cp; | 2947 | struct hci_cp_io_capability_reply cp; |
2948 | 2948 | ||
@@ -3005,7 +3005,7 @@ static inline void hci_user_confirm_request_evt(struct hci_dev *hdev, | |||
3005 | 3005 | ||
3006 | hci_dev_lock(hdev); | 3006 | hci_dev_lock(hdev); |
3007 | 3007 | ||
3008 | if (!test_bit(HCI_MGMT, &hdev->flags)) | 3008 | if (!test_bit(HCI_MGMT, &hdev->dev_flags)) |
3009 | goto unlock; | 3009 | goto unlock; |
3010 | 3010 | ||
3011 | conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); | 3011 | conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); |
@@ -3071,7 +3071,7 @@ static inline void hci_user_passkey_request_evt(struct hci_dev *hdev, | |||
3071 | 3071 | ||
3072 | hci_dev_lock(hdev); | 3072 | hci_dev_lock(hdev); |
3073 | 3073 | ||
3074 | if (test_bit(HCI_MGMT, &hdev->flags)) | 3074 | if (test_bit(HCI_MGMT, &hdev->dev_flags)) |
3075 | mgmt_user_passkey_request(hdev, &ev->bdaddr); | 3075 | mgmt_user_passkey_request(hdev, &ev->bdaddr); |
3076 | 3076 | ||
3077 | hci_dev_unlock(hdev); | 3077 | hci_dev_unlock(hdev); |
@@ -3130,7 +3130,7 @@ static inline void hci_remote_oob_data_request_evt(struct hci_dev *hdev, | |||
3130 | 3130 | ||
3131 | hci_dev_lock(hdev); | 3131 | hci_dev_lock(hdev); |
3132 | 3132 | ||
3133 | if (!test_bit(HCI_MGMT, &hdev->flags)) | 3133 | if (!test_bit(HCI_MGMT, &hdev->dev_flags)) |
3134 | goto unlock; | 3134 | goto unlock; |
3135 | 3135 | ||
3136 | data = hci_find_remote_oob_data(hdev, &ev->bdaddr); | 3136 | data = hci_find_remote_oob_data(hdev, &ev->bdaddr); |