Skip to content

Commit

Permalink
Bluetooth: HCI: Fix definition of hci_rp_read_stored_link_key
Browse files Browse the repository at this point in the history
Both max_num_keys and num_key are 2 octects:

BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 4, Part E
page 1985:

  Max_Num_Keys:
  Size: 2 octets
  Range: 0x0000 to 0xFFFF

  Num_Keys_Read:
  Size: 2 octets
  Range: 0x0000 to 0xFFFF

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Luiz Augusto von Dentz authored and Marcel Holtmann committed Nov 25, 2021
1 parent 899663b commit e88422b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions include/net/bluetooth/hci.h
Original file line number Diff line number Diff line change
Expand Up @@ -1047,8 +1047,8 @@ struct hci_cp_read_stored_link_key {
} __packed;
struct hci_rp_read_stored_link_key {
__u8 status;
__u8 max_keys;
__u8 num_keys;
__le16 max_keys;
__le16 num_keys;
} __packed;

#define HCI_OP_DELETE_STORED_LINK_KEY 0x0c12
Expand Down
4 changes: 2 additions & 2 deletions include/net/bluetooth/hci_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,8 @@ struct hci_dev {
__u16 lmp_subver;
__u16 voice_setting;
__u8 num_iac;
__u8 stored_max_keys;
__u8 stored_num_keys;
__u16 stored_max_keys;
__u16 stored_num_keys;
__u8 io_capability;
__s8 inq_tx_power;
__u8 err_data_reporting;
Expand Down
4 changes: 2 additions & 2 deletions net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ static void hci_cc_read_stored_link_key(struct hci_dev *hdev,
return;

if (!rp->status && sent->read_all == 0x01) {
hdev->stored_max_keys = rp->max_keys;
hdev->stored_num_keys = rp->num_keys;
hdev->stored_max_keys = le16_to_cpu(rp->max_keys);
hdev->stored_num_keys = le16_to_cpu(rp->num_keys);
}
}

Expand Down

0 comments on commit e88422b

Please sign in to comment.