aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/mgmt.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2012-02-09 08:56:11 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2012-02-13 10:01:36 -0500
commit88c1fe4ba55c7245ad2f3c81689f854287875121 (patch)
tree69447c418d6f4560df19bc1a69a98a49cda0d4c9 /net/bluetooth/mgmt.c
parent664ce4cc293cd6c76236617f78689d0e03e69287 (diff)
Bluetooth: Add address type to mgmt blacklist messages
This patch updates the implmentation for mgmt_block_device and mgmt_unblock_device and their corresponding events to match the latest API specification. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r--net/bluetooth/mgmt.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 763a447b2532..413a0b97c533 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -2114,7 +2114,7 @@ static int block_device(struct sock *sk, u16 index, void *data, u16 len)
2114 2114
2115 hci_dev_lock(hdev); 2115 hci_dev_lock(hdev);
2116 2116
2117 err = hci_blacklist_add(hdev, &cp->bdaddr); 2117 err = hci_blacklist_add(hdev, &cp->addr.bdaddr, cp->addr.type);
2118 if (err < 0) 2118 if (err < 0)
2119 err = cmd_status(sk, index, MGMT_OP_BLOCK_DEVICE, 2119 err = cmd_status(sk, index, MGMT_OP_BLOCK_DEVICE,
2120 MGMT_STATUS_FAILED); 2120 MGMT_STATUS_FAILED);
@@ -2147,7 +2147,7 @@ static int unblock_device(struct sock *sk, u16 index, void *data, u16 len)
2147 2147
2148 hci_dev_lock(hdev); 2148 hci_dev_lock(hdev);
2149 2149
2150 err = hci_blacklist_del(hdev, &cp->bdaddr); 2150 err = hci_blacklist_del(hdev, &cp->addr.bdaddr, cp->addr.type);
2151 2151
2152 if (err < 0) 2152 if (err < 0)
2153 err = cmd_status(sk, index, MGMT_OP_UNBLOCK_DEVICE, 2153 err = cmd_status(sk, index, MGMT_OP_UNBLOCK_DEVICE,
@@ -3026,27 +3026,29 @@ int mgmt_discovering(struct hci_dev *hdev, u8 discovering)
3026 sizeof(discovering), NULL); 3026 sizeof(discovering), NULL);
3027} 3027}
3028 3028
3029int mgmt_device_blocked(struct hci_dev *hdev, bdaddr_t *bdaddr) 3029int mgmt_device_blocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type)
3030{ 3030{
3031 struct pending_cmd *cmd; 3031 struct pending_cmd *cmd;
3032 struct mgmt_ev_device_blocked ev; 3032 struct mgmt_ev_device_blocked ev;
3033 3033
3034 cmd = mgmt_pending_find(MGMT_OP_BLOCK_DEVICE, hdev); 3034 cmd = mgmt_pending_find(MGMT_OP_BLOCK_DEVICE, hdev);
3035 3035
3036 bacpy(&ev.bdaddr, bdaddr); 3036 bacpy(&ev.addr.bdaddr, bdaddr);
3037 ev.addr.type = type;
3037 3038
3038 return mgmt_event(MGMT_EV_DEVICE_BLOCKED, hdev, &ev, sizeof(ev), 3039 return mgmt_event(MGMT_EV_DEVICE_BLOCKED, hdev, &ev, sizeof(ev),
3039 cmd ? cmd->sk : NULL); 3040 cmd ? cmd->sk : NULL);
3040} 3041}
3041 3042
3042int mgmt_device_unblocked(struct hci_dev *hdev, bdaddr_t *bdaddr) 3043int mgmt_device_unblocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type)
3043{ 3044{
3044 struct pending_cmd *cmd; 3045 struct pending_cmd *cmd;
3045 struct mgmt_ev_device_unblocked ev; 3046 struct mgmt_ev_device_unblocked ev;
3046 3047
3047 cmd = mgmt_pending_find(MGMT_OP_UNBLOCK_DEVICE, hdev); 3048 cmd = mgmt_pending_find(MGMT_OP_UNBLOCK_DEVICE, hdev);
3048 3049
3049 bacpy(&ev.bdaddr, bdaddr); 3050 bacpy(&ev.addr.bdaddr, bdaddr);
3051 ev.addr.type = type;
3050 3052
3051 return mgmt_event(MGMT_EV_DEVICE_UNBLOCKED, hdev, &ev, sizeof(ev), 3053 return mgmt_event(MGMT_EV_DEVICE_UNBLOCKED, hdev, &ev, sizeof(ev),
3052 cmd ? cmd->sk : NULL); 3054 cmd ? cmd->sk : NULL);