Skip to content

Commit

Permalink
Bluetooth: Move bdaddr_to_le to hci_core
Browse files Browse the repository at this point in the history
This patch moves the helper function bdaddr_to_le to hci_core, so it
can be used in mgmt.c and hci_conn.c.

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>
  • Loading branch information
Andre Guedes authored and Gustavo Padovan committed May 9, 2012
1 parent 378b5b7 commit 31f7956
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 2 additions & 0 deletions include/net/bluetooth/hci_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -1073,4 +1073,6 @@ int hci_le_scan(struct hci_dev *hdev, u8 type, u16 interval, u16 window,
int timeout);
int hci_cancel_le_scan(struct hci_dev *hdev);

u8 bdaddr_to_le(u8 bdaddr_type);

#endif /* __HCI_CORE_H */
12 changes: 12 additions & 0 deletions net/bluetooth/hci_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2946,3 +2946,15 @@ int hci_cancel_inquiry(struct hci_dev *hdev)

return hci_send_cmd(hdev, HCI_OP_INQUIRY_CANCEL, 0, NULL);
}

u8 bdaddr_to_le(u8 bdaddr_type)
{
switch (bdaddr_type) {
case BDADDR_LE_PUBLIC:
return ADDR_LE_DEV_PUBLIC;

default:
/* Fallback to LE Random address type */
return ADDR_LE_DEV_RANDOM;
}
}
12 changes: 0 additions & 12 deletions net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1644,18 +1644,6 @@ static u8 link_to_bdaddr(u8 link_type, u8 addr_type)
}
}

static u8 bdaddr_to_le(u8 bdaddr_type)
{
switch (bdaddr_type) {
case BDADDR_LE_PUBLIC:
return ADDR_LE_DEV_PUBLIC;

default:
/* Fallback to LE Random address type */
return ADDR_LE_DEV_RANDOM;
}
}

static int get_connections(struct sock *sk, struct hci_dev *hdev, void *data,
u16 data_len)
{
Expand Down

0 comments on commit 31f7956

Please sign in to comment.