* [PATCH] Bluetooth: HCI: Fix definition of bt_hci_rsp_read_stored_link_key
@ 2021-11-24 2:17 Luiz Augusto von Dentz
2021-11-24 14:51 ` Marcel Holtmann
0 siblings, 1 reply; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2021-11-24 2:17 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
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>
---
include/net/bluetooth/hci.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 84db6b275231..5f95de7367d5 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -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;
+ __u16 max_keys;
+ __u16 num_keys;
} __packed;
#define HCI_OP_DELETE_STORED_LINK_KEY 0x0c12
--
2.33.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Bluetooth: HCI: Fix definition of bt_hci_rsp_read_stored_link_key
2021-11-24 2:17 [PATCH] Bluetooth: HCI: Fix definition of bt_hci_rsp_read_stored_link_key Luiz Augusto von Dentz
@ 2021-11-24 14:51 ` Marcel Holtmann
0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2021-11-24 14:51 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
Hi Luiz,
> 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>
> ---
> include/net/bluetooth/hci.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
> index 84db6b275231..5f95de7367d5 100644
> --- a/include/net/bluetooth/hci.h
> +++ b/include/net/bluetooth/hci.h
> @@ -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;
> + __u16 max_keys;
> + __u16 num_keys;
> } __packed;
>
> #define HCI_OP_DELETE_STORED_LINK_KEY 0x0c12
I have no idea on how this could be wrong all these years. I added this back in 2015 :(
However, you also need to touch the user of it
if (!rp->status && sent->read_all == 0x01) {
hdev->stored_max_keys = rp->max_keys;
hdev->stored_num_keys = rp->num_keys;
}
Regards
Marcel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-11-24 14:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-24 2:17 [PATCH] Bluetooth: HCI: Fix definition of bt_hci_rsp_read_stored_link_key Luiz Augusto von Dentz
2021-11-24 14:51 ` Marcel Holtmann
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.