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

Commit 10ccef0b authored by Archie Pusaka's avatar Archie Pusaka Committed by Gerrit Code Review
Browse files

Merge changes Id45987b1,If0de7b21 into main

* changes:
  floss: hcidoc: consider NOCP packets with multiple packet count
  floss: hcidoc: Remove associated CID when L2CAP is disconnected
parents d96b50a4 be8b33ec
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();
+3 −3
Original line number Diff line number Diff line
@@ -324,7 +324,7 @@ impl AclInformation {
        _initiator: InitiatorType,
        ts: NaiveDateTime,
    ) {
        let host_cid_state_option = self.host_cids.get(&host_cid);
        let host_cid_state_option = self.host_cids.remove(&host_cid);
        let host_psm = match host_cid_state_option {
            Some(cid_state) => match cid_state {
                // TODO: assert that the peer cids match.
@@ -334,7 +334,7 @@ impl AclInformation {
            None => None,
        };

        let peer_cid_state_option = self.peer_cids.get(&peer_cid);
        let peer_cid_state_option = self.peer_cids.remove(&peer_cid);
        let peer_psm = match peer_cid_state_option {
            Some(cid_state) => match cid_state {
                // TODO: assert that the host cids match.
@@ -351,7 +351,7 @@ impl AclInformation {
            );
        }
        let psm = match host_psm.or(peer_psm) {
            Some(psm) => *psm,
            Some(psm) => psm,
            None => return, // No recorded PSM, no need to report.
        };