diff options
author | Andre Guedes <andre.guedes@openbossa.org> | 2012-04-24 20:02:50 -0400 |
---|---|---|
committer | Gustavo Padovan <gustavo@padovan.org> | 2012-05-09 00:40:43 -0400 |
commit | 57c1477c2c6b6c73ca40e4b23a80e3ecdfd9b684 (patch) | |
tree | e971ee8e3259c7b8c573b846026525d1ea7e4b93 /net | |
parent | 591f47f31ba4e89fc0cce2ad90da80945ce8bf94 (diff) |
Bluetooth: Rename link_to_mgmt to link_to_bdaddr
Since address type macros are not only related to Management
Interface anymore, it makes sense to rename the helper function
link_to_mgmt to link_to_bdaddr.
Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Acked-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/mgmt.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index d064ca9fa006..632d43d0980b 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -1625,7 +1625,7 @@ failed: | |||
1625 | return err; | 1625 | return err; |
1626 | } | 1626 | } |
1627 | 1627 | ||
1628 | static u8 link_to_mgmt(u8 link_type, u8 addr_type) | 1628 | static u8 link_to_bdaddr(u8 link_type, u8 addr_type) |
1629 | { | 1629 | { |
1630 | switch (link_type) { | 1630 | switch (link_type) { |
1631 | case LE_LINK: | 1631 | case LE_LINK: |
@@ -1693,7 +1693,7 @@ static int get_connections(struct sock *sk, struct hci_dev *hdev, void *data, | |||
1693 | if (!test_bit(HCI_CONN_MGMT_CONNECTED, &c->flags)) | 1693 | if (!test_bit(HCI_CONN_MGMT_CONNECTED, &c->flags)) |
1694 | continue; | 1694 | continue; |
1695 | bacpy(&rp->addr[i].bdaddr, &c->dst); | 1695 | bacpy(&rp->addr[i].bdaddr, &c->dst); |
1696 | rp->addr[i].type = link_to_mgmt(c->type, c->dst_type); | 1696 | rp->addr[i].type = link_to_bdaddr(c->type, c->dst_type); |
1697 | if (c->type == SCO_LINK || c->type == ESCO_LINK) | 1697 | if (c->type == SCO_LINK || c->type == ESCO_LINK) |
1698 | continue; | 1698 | continue; |
1699 | i++; | 1699 | i++; |
@@ -1860,7 +1860,7 @@ static void pairing_complete(struct pending_cmd *cmd, u8 status) | |||
1860 | struct hci_conn *conn = cmd->user_data; | 1860 | struct hci_conn *conn = cmd->user_data; |
1861 | 1861 | ||
1862 | bacpy(&rp.addr.bdaddr, &conn->dst); | 1862 | bacpy(&rp.addr.bdaddr, &conn->dst); |
1863 | rp.addr.type = link_to_mgmt(conn->type, conn->dst_type); | 1863 | rp.addr.type = link_to_bdaddr(conn->type, conn->dst_type); |
1864 | 1864 | ||
1865 | cmd_complete(cmd->sk, cmd->index, MGMT_OP_PAIR_DEVICE, status, | 1865 | cmd_complete(cmd->sk, cmd->index, MGMT_OP_PAIR_DEVICE, status, |
1866 | &rp, sizeof(rp)); | 1866 | &rp, sizeof(rp)); |
@@ -2983,7 +2983,7 @@ int mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, u8 persistent) | |||
2983 | 2983 | ||
2984 | ev.store_hint = persistent; | 2984 | ev.store_hint = persistent; |
2985 | bacpy(&ev.key.addr.bdaddr, &key->bdaddr); | 2985 | bacpy(&ev.key.addr.bdaddr, &key->bdaddr); |
2986 | ev.key.addr.type = link_to_mgmt(LE_LINK, key->bdaddr_type); | 2986 | ev.key.addr.type = link_to_bdaddr(LE_LINK, key->bdaddr_type); |
2987 | ev.key.authenticated = key->authenticated; | 2987 | ev.key.authenticated = key->authenticated; |
2988 | ev.key.enc_size = key->enc_size; | 2988 | ev.key.enc_size = key->enc_size; |
2989 | ev.key.ediv = key->ediv; | 2989 | ev.key.ediv = key->ediv; |
@@ -3007,7 +3007,7 @@ int mgmt_device_connected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | |||
3007 | u16 eir_len = 0; | 3007 | u16 eir_len = 0; |
3008 | 3008 | ||
3009 | bacpy(&ev->addr.bdaddr, bdaddr); | 3009 | bacpy(&ev->addr.bdaddr, bdaddr); |
3010 | ev->addr.type = link_to_mgmt(link_type, addr_type); | 3010 | ev->addr.type = link_to_bdaddr(link_type, addr_type); |
3011 | 3011 | ||
3012 | ev->flags = __cpu_to_le32(flags); | 3012 | ev->flags = __cpu_to_le32(flags); |
3013 | 3013 | ||
@@ -3070,7 +3070,7 @@ int mgmt_device_disconnected(struct hci_dev *hdev, bdaddr_t *bdaddr, | |||
3070 | mgmt_pending_foreach(MGMT_OP_DISCONNECT, hdev, disconnect_rsp, &sk); | 3070 | mgmt_pending_foreach(MGMT_OP_DISCONNECT, hdev, disconnect_rsp, &sk); |
3071 | 3071 | ||
3072 | bacpy(&ev.bdaddr, bdaddr); | 3072 | bacpy(&ev.bdaddr, bdaddr); |
3073 | ev.type = link_to_mgmt(link_type, addr_type); | 3073 | ev.type = link_to_bdaddr(link_type, addr_type); |
3074 | 3074 | ||
3075 | err = mgmt_event(MGMT_EV_DEVICE_DISCONNECTED, hdev, &ev, sizeof(ev), | 3075 | err = mgmt_event(MGMT_EV_DEVICE_DISCONNECTED, hdev, &ev, sizeof(ev), |
3076 | sk); | 3076 | sk); |
@@ -3096,7 +3096,7 @@ int mgmt_disconnect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, | |||
3096 | return -ENOENT; | 3096 | return -ENOENT; |
3097 | 3097 | ||
3098 | bacpy(&rp.addr.bdaddr, bdaddr); | 3098 | bacpy(&rp.addr.bdaddr, bdaddr); |
3099 | rp.addr.type = link_to_mgmt(link_type, addr_type); | 3099 | rp.addr.type = link_to_bdaddr(link_type, addr_type); |
3100 | 3100 | ||
3101 | err = cmd_complete(cmd->sk, cmd->index, MGMT_OP_DISCONNECT, | 3101 | err = cmd_complete(cmd->sk, cmd->index, MGMT_OP_DISCONNECT, |
3102 | mgmt_status(status), &rp, sizeof(rp)); | 3102 | mgmt_status(status), &rp, sizeof(rp)); |
@@ -3114,7 +3114,7 @@ int mgmt_connect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | |||
3114 | struct mgmt_ev_connect_failed ev; | 3114 | struct mgmt_ev_connect_failed ev; |
3115 | 3115 | ||
3116 | bacpy(&ev.addr.bdaddr, bdaddr); | 3116 | bacpy(&ev.addr.bdaddr, bdaddr); |
3117 | ev.addr.type = link_to_mgmt(link_type, addr_type); | 3117 | ev.addr.type = link_to_bdaddr(link_type, addr_type); |
3118 | ev.status = mgmt_status(status); | 3118 | ev.status = mgmt_status(status); |
3119 | 3119 | ||
3120 | return mgmt_event(MGMT_EV_CONNECT_FAILED, hdev, &ev, sizeof(ev), NULL); | 3120 | return mgmt_event(MGMT_EV_CONNECT_FAILED, hdev, &ev, sizeof(ev), NULL); |
@@ -3185,7 +3185,7 @@ int mgmt_user_confirm_request(struct hci_dev *hdev, bdaddr_t *bdaddr, | |||
3185 | BT_DBG("%s", hdev->name); | 3185 | BT_DBG("%s", hdev->name); |
3186 | 3186 | ||
3187 | bacpy(&ev.addr.bdaddr, bdaddr); | 3187 | bacpy(&ev.addr.bdaddr, bdaddr); |
3188 | ev.addr.type = link_to_mgmt(link_type, addr_type); | 3188 | ev.addr.type = link_to_bdaddr(link_type, addr_type); |
3189 | ev.confirm_hint = confirm_hint; | 3189 | ev.confirm_hint = confirm_hint; |
3190 | ev.value = value; | 3190 | ev.value = value; |
3191 | 3191 | ||
@@ -3201,7 +3201,7 @@ int mgmt_user_passkey_request(struct hci_dev *hdev, bdaddr_t *bdaddr, | |||
3201 | BT_DBG("%s", hdev->name); | 3201 | BT_DBG("%s", hdev->name); |
3202 | 3202 | ||
3203 | bacpy(&ev.addr.bdaddr, bdaddr); | 3203 | bacpy(&ev.addr.bdaddr, bdaddr); |
3204 | ev.addr.type = link_to_mgmt(link_type, addr_type); | 3204 | ev.addr.type = link_to_bdaddr(link_type, addr_type); |
3205 | 3205 | ||
3206 | return mgmt_event(MGMT_EV_USER_PASSKEY_REQUEST, hdev, &ev, sizeof(ev), | 3206 | return mgmt_event(MGMT_EV_USER_PASSKEY_REQUEST, hdev, &ev, sizeof(ev), |
3207 | NULL); | 3207 | NULL); |
@@ -3220,7 +3220,7 @@ static int user_pairing_resp_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, | |||
3220 | return -ENOENT; | 3220 | return -ENOENT; |
3221 | 3221 | ||
3222 | bacpy(&rp.addr.bdaddr, bdaddr); | 3222 | bacpy(&rp.addr.bdaddr, bdaddr); |
3223 | rp.addr.type = link_to_mgmt(link_type, addr_type); | 3223 | rp.addr.type = link_to_bdaddr(link_type, addr_type); |
3224 | err = cmd_complete(cmd->sk, hdev->id, opcode, mgmt_status(status), | 3224 | err = cmd_complete(cmd->sk, hdev->id, opcode, mgmt_status(status), |
3225 | &rp, sizeof(rp)); | 3225 | &rp, sizeof(rp)); |
3226 | 3226 | ||
@@ -3263,7 +3263,7 @@ int mgmt_auth_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | |||
3263 | struct mgmt_ev_auth_failed ev; | 3263 | struct mgmt_ev_auth_failed ev; |
3264 | 3264 | ||
3265 | bacpy(&ev.addr.bdaddr, bdaddr); | 3265 | bacpy(&ev.addr.bdaddr, bdaddr); |
3266 | ev.addr.type = link_to_mgmt(link_type, addr_type); | 3266 | ev.addr.type = link_to_bdaddr(link_type, addr_type); |
3267 | ev.status = mgmt_status(status); | 3267 | ev.status = mgmt_status(status); |
3268 | 3268 | ||
3269 | return mgmt_event(MGMT_EV_AUTH_FAILED, hdev, &ev, sizeof(ev), NULL); | 3269 | return mgmt_event(MGMT_EV_AUTH_FAILED, hdev, &ev, sizeof(ev), NULL); |
@@ -3530,7 +3530,7 @@ int mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | |||
3530 | memset(buf, 0, sizeof(buf)); | 3530 | memset(buf, 0, sizeof(buf)); |
3531 | 3531 | ||
3532 | bacpy(&ev->addr.bdaddr, bdaddr); | 3532 | bacpy(&ev->addr.bdaddr, bdaddr); |
3533 | ev->addr.type = link_to_mgmt(link_type, addr_type); | 3533 | ev->addr.type = link_to_bdaddr(link_type, addr_type); |
3534 | ev->rssi = rssi; | 3534 | ev->rssi = rssi; |
3535 | if (cfm_name) | 3535 | if (cfm_name) |
3536 | ev->flags[0] |= MGMT_DEV_FOUND_CONFIRM_NAME; | 3536 | ev->flags[0] |= MGMT_DEV_FOUND_CONFIRM_NAME; |
@@ -3563,7 +3563,7 @@ int mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | |||
3563 | memset(buf, 0, sizeof(buf)); | 3563 | memset(buf, 0, sizeof(buf)); |
3564 | 3564 | ||
3565 | bacpy(&ev->addr.bdaddr, bdaddr); | 3565 | bacpy(&ev->addr.bdaddr, bdaddr); |
3566 | ev->addr.type = link_to_mgmt(link_type, addr_type); | 3566 | ev->addr.type = link_to_bdaddr(link_type, addr_type); |
3567 | ev->rssi = rssi; | 3567 | ev->rssi = rssi; |
3568 | 3568 | ||
3569 | eir_len = eir_append_data(ev->eir, 0, EIR_NAME_COMPLETE, name, | 3569 | eir_len = eir_append_data(ev->eir, 0, EIR_NAME_COMPLETE, name, |