]> www.infradead.org Git - users/hch/misc.git/commitdiff
Bluetooth: HCI: Add definition of hci_rp_remote_name_req_cancel
authorWentao Guan <guanwentao@uniontech.com>
Mon, 17 Mar 2025 18:50:34 +0000 (02:50 +0800)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 25 Mar 2025 16:47:23 +0000 (12:47 -0400)
Return Parameters is not only status, also bdaddr:

BLUETOOTH CORE SPECIFICATION Version 5.4 | Vol 4, Part E
page 1870:
BLUETOOTH CORE SPECIFICATION Version 5.0 | Vol 2, Part E
page 802:

Return parameters:
  Status:
  Size: 1 octet
  BD_ADDR:
  Size: 6 octets

Note that it also fixes the warning:
"Bluetooth: hci0: unexpected cc 0x041a length: 7 > 1"

Fixes: c8992cffbe741 ("Bluetooth: hci_event: Use of a function table to handle Command Complete")
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
include/net/bluetooth/hci.h
net/bluetooth/hci_event.c

index 6da61c185c94984ae1566d245146d3fc3d935fa4..a8586c3058c7cd5eb3ff2472f07adfe8074a6e74 100644 (file)
@@ -879,6 +879,11 @@ struct hci_cp_remote_name_req_cancel {
        bdaddr_t bdaddr;
 } __packed;
 
+struct hci_rp_remote_name_req_cancel {
+       __u8     status;
+       bdaddr_t bdaddr;
+} __packed;
+
 #define HCI_OP_READ_REMOTE_FEATURES    0x041b
 struct hci_cp_read_remote_features {
        __le16   handle;
index 6d0138b778aa257272f29a0d2933ab3ad8ad295e..0df4a0e082c825f42f23cb0c48114b39a82ff21d 100644 (file)
@@ -151,7 +151,7 @@ static u8 hci_cc_exit_periodic_inq(struct hci_dev *hdev, void *data,
 static u8 hci_cc_remote_name_req_cancel(struct hci_dev *hdev, void *data,
                                        struct sk_buff *skb)
 {
-       struct hci_ev_status *rp = data;
+       struct hci_rp_remote_name_req_cancel *rp = data;
 
        bt_dev_dbg(hdev, "status 0x%2.2x", rp->status);
 
@@ -4015,8 +4015,8 @@ static const struct hci_cc {
        HCI_CC_STATUS(HCI_OP_INQUIRY_CANCEL, hci_cc_inquiry_cancel),
        HCI_CC_STATUS(HCI_OP_PERIODIC_INQ, hci_cc_periodic_inq),
        HCI_CC_STATUS(HCI_OP_EXIT_PERIODIC_INQ, hci_cc_exit_periodic_inq),
-       HCI_CC_STATUS(HCI_OP_REMOTE_NAME_REQ_CANCEL,
-                     hci_cc_remote_name_req_cancel),
+       HCI_CC(HCI_OP_REMOTE_NAME_REQ_CANCEL, hci_cc_remote_name_req_cancel,
+              sizeof(struct hci_rp_remote_name_req_cancel)),
        HCI_CC(HCI_OP_ROLE_DISCOVERY, hci_cc_role_discovery,
               sizeof(struct hci_rp_role_discovery)),
        HCI_CC(HCI_OP_READ_LINK_POLICY, hci_cc_read_link_policy,