Message ID | 20220701233658.966972-1-luiz.dentz@gmail.com |
---|---|
State | Superseded |
Headers | show |
Series | [v5,1/7] Bluetooth: hci_core: Introduce hci_recv_event_data | expand |
This is automated email and please do not reply to this email! Dear submitter, Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series: PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=655961 ---Test result--- Test Summary: CheckPatch FAIL 12.27 seconds GitLint PASS 3.08 seconds SubjectPrefix PASS 2.14 seconds BuildKernel PASS 38.92 seconds BuildKernel32 PASS 34.65 seconds Incremental Build with patchesPASS 192.84 seconds TestRunner: Setup PASS 566.86 seconds TestRunner: l2cap-tester PASS 18.75 seconds TestRunner: bnep-tester PASS 6.52 seconds TestRunner: mgmt-tester FAIL 115.33 seconds TestRunner: rfcomm-tester PASS 10.37 seconds TestRunner: sco-tester PASS 10.34 seconds TestRunner: smp-tester PASS 10.34 seconds TestRunner: userchan-tester PASS 6.83 seconds Details ############################## Test: CheckPatch - FAIL - 12.27 seconds Run checkpatch.pl script with rule in .checkpatch.conf [v5,3/7] Bluetooth: Add BTPROTO_ISO socket type\Traceback (most recent call last): File "scripts/spdxcheck.py", line 6, in <module> from ply import lex, yacc ModuleNotFoundError: No module named 'ply' Traceback (most recent call last): File "scripts/spdxcheck.py", line 6, in <module> from ply import lex, yacc ModuleNotFoundError: No module named 'ply' WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #176: new file mode 100644 total: 0 errors, 1 warnings, 0 checks, 1718 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. /github/workspace/src/12903848.patch has style problems, please review. NOTE: Ignored message types: UNKNOWN_COMMIT_ID NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. [v5,4/7] Bluetooth: Add initial implementation of BIS connections\WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line #848: FILE: net/bluetooth/hci_conn.c:817: + * */ WARNING:LINE_SPACING: Missing a blank line after declarations #1878: FILE: net/bluetooth/hci_sync.c:1031: + struct adv_info *adv = hci_find_adv_instance(hdev, instance); + if (!adv || !adv->periodic) total: 0 errors, 2 warnings, 0 checks, 1874 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. /github/workspace/src/12903852.patch has style problems, please review. NOTE: Ignored message types: UNKNOWN_COMMIT_ID NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. ############################## Test: TestRunner: mgmt-tester - FAIL - 115.33 seconds Run test-runner with mgmt-tester Total: 494, Passed: 492 (99.6%), Failed: 2, Not Run: 0 Failed Test Cases Read Exp Feature - Success Failed 0.104 seconds Read Exp Feature - Success (Index None) Failed 0.118 seconds --- Regards, Linux Bluetooth
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 15237ee5f761..0ce57e1856e5 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h @@ -530,6 +530,7 @@ struct hci_dev { struct sk_buff_head cmd_q; struct sk_buff *sent_cmd; + struct sk_buff *recv_event; struct mutex req_lock; wait_queue_head_t req_wait_q; @@ -1755,6 +1756,7 @@ void hci_send_acl(struct hci_chan *chan, struct sk_buff *skb, __u16 flags); void hci_send_sco(struct hci_conn *conn, struct sk_buff *skb); void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode); +void *hci_recv_event_data(struct hci_dev *hdev, __u8 event); u32 hci_conn_get_phy(struct hci_conn *conn); diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 05c13f639b94..1ff2c284e867 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -2739,6 +2739,7 @@ void hci_release_dev(struct hci_dev *hdev) ida_simple_remove(&hci_index_ida, hdev->id); kfree_skb(hdev->sent_cmd); + kfree_skb(hdev->recv_event); kfree(hdev); } EXPORT_SYMBOL(hci_release_dev); @@ -3045,6 +3046,37 @@ void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode) return hdev->sent_cmd->data + HCI_COMMAND_HDR_SIZE; } +/* Get data from last received event */ +void *hci_recv_event_data(struct hci_dev *hdev, __u8 event) +{ + struct hci_event_hdr *hdr; + int offset; + + if (!hdev->recv_event) + return NULL; + + hdr = (void *)hdev->recv_event->data; + offset = sizeof(*hdr); + + if (hdr->evt != event) { + /* In case of LE metaevent check the subevent match */ + if (hdr->evt == HCI_EV_LE_META) { + struct hci_ev_le_meta *ev; + + ev = (void *)hdev->recv_event->data + offset; + offset += sizeof(*ev); + if (ev->subevent == event) + goto found; + } + return NULL; + } + +found: + bt_dev_dbg(hdev, "event 0x%2.2x", event); + + return hdev->recv_event->data + offset; +} + /* Send ACL data */ static void hci_add_acl_hdr(struct sk_buff *skb, __u16 handle, __u16 flags) { diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 34bec7446d00..2440275a143c 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -6936,6 +6936,9 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb) goto done; } + kfree_skb(hdev->recv_event); + hdev->recv_event = skb_clone(skb, GFP_KERNEL); + event = hdr->evt; if (!event) { bt_dev_warn(hdev, "Received unexpected HCI Event 0x%2.2x",