Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be8b33ec authored by Archie Pusaka's avatar Archie Pusaka
Browse files

floss: hcidoc: consider NOCP packets with multiple packet count

NOCP packets have the field |count| that is used if the packet is used
to report acknowledgement for multiple ACL packets. We need to process
this value in order to avoid wrong NOCP issues.

Bug: 311245795
Test: m -j
Test: verify logs in b/311245795 isn't categorized as NOCP issue
Flag: EXEMPT floss only changes
Change-Id: Id45987b1fae10ed756538e6ab9a0331e13009001
parent e5e42b74
Loading
Loading
Loading
Loading
+19 −16
Original line number Diff line number Diff line
@@ -525,11 +525,13 @@ impl OddDisconnectionsRule {
        let ts = &packet.ts;
        for completed_packet in nocp.get_completed_packets() {
            let handle = completed_packet.connection_handle;
            let num = completed_packet.host_num_of_completed_packets;
            if !self.nocp_by_handle.contains_key(&handle) {
                self.nocp_by_handle.insert(handle, NocpData::new());
            }

            if let Some(nocp_data) = self.nocp_by_handle.get_mut(&handle) {
                for _i in 0..num {
                    if let Some(acl_front_ts) = nocp_data.inflight_acl_ts.pop_front() {
                        let duration_since_acl = ts.signed_duration_since(acl_front_ts);
                        if duration_since_acl.num_milliseconds() > TIMEOUT_TOLERANCE_TIME_MS {
@@ -551,6 +553,7 @@ impl OddDisconnectionsRule {
                }
            }
        }
    }

    fn process_apte(&mut self, apte: &AuthenticatedPayloadTimeoutExpired, _packet: &Packet) {
        let handle = apte.get_connection_handle();