diff options
author | 2025-03-13 17:41:21 +0000 | |
---|---|---|
committer | 2025-03-13 17:43:51 +0000 | |
commit | 6e9209f3ee661aa20948208d58a3203a98454ac0 (patch) | |
tree | d58363c9fe6d49d70638dc22ae02c6f82fc7a92a /offload | |
parent | 0bbbac4b68b37c6f2a47ff6e3ab62258a877e8a0 (diff) |
LE-Audio Software Offload: Allow Setup/Remove ISO Data Path on non
existing connection
Bug: 396350294
Flag: EXEMPT, enabled by vendor
Test: atest libbluetooth_offload_leaudio_hci_test
Change-Id: I3e10ef8aef070991ab43695cfd7ec001484c01bc
Diffstat (limited to 'offload')
-rw-r--r-- | offload/leaudio/hci/proxy.rs | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/offload/leaudio/hci/proxy.rs b/offload/leaudio/hci/proxy.rs index 933389d315..adc2dbd34d 100644 --- a/offload/leaudio/hci/proxy.rs +++ b/offload/leaudio/hci/proxy.rs @@ -195,10 +195,16 @@ impl Module for LeAudioModule { ); } - Ok(Command::LeSetupIsoDataPath(ref c)) if c.data_path_id == DATA_PATH_ID_SOFTWARE => { + Ok(Command::LeSetupIsoDataPath(ref c)) if c.data_path_id == DATA_PATH_ID_SOFTWARE => 'command: { assert_eq!(c.data_path_direction, hci::LeDataPathDirection::Input); let mut state = self.state.lock().unwrap(); - let stream = state.stream.get_mut(&c.connection_handle).unwrap(); + let Some(stream) = state.stream.get_mut(&c.connection_handle) else { + log::warn!( + "Setup ISO Data Path on non existing BIS/CIS handle: 0x{:03x}", + c.connection_handle + ); + break 'command; + }; stream.state = StreamState::Enabling; // Phase 1 limitation: The controller does not implement HCI Link Feedback event, @@ -209,6 +215,16 @@ impl Module for LeAudioModule { return; } + Ok(Command::LeRemoveIsoDataPath(ref c)) => { + let mut state = self.state.lock().unwrap(); + if state.stream.get_mut(&c.connection_handle).is_none() { + log::warn!( + "Remove ISO Data Path on non existing BIS/CIS handle: 0x{:03x}", + c.connection_handle + ); + } + } + _ => (), } @@ -250,7 +266,9 @@ impl Module for LeAudioModule { ReturnParameters::LeSetupIsoDataPath(ref ret) => 'event: { let mut state = self.state.lock().unwrap(); - let stream = state.stream.get_mut(&ret.connection_handle).unwrap(); + let Some(stream) = state.stream.get_mut(&ret.connection_handle) else { + break 'event; + }; stream.state = if stream.state == StreamState::Enabling && ret.status == Status::Success { StreamState::Enabled @@ -278,9 +296,11 @@ impl Module for LeAudioModule { ); } - ReturnParameters::LeRemoveIsoDataPath(ref ret) if ret.status == Status::Success => { + ReturnParameters::LeRemoveIsoDataPath(ref ret) if ret.status == Status::Success => 'event: { let mut state = self.state.lock().unwrap(); - let stream = state.stream.get_mut(&ret.connection_handle).unwrap(); + let Some(stream) = state.stream.get_mut(&ret.connection_handle) else { + break 'event; + }; if stream.state == StreamState::Enabled { Service::stop_stream(ret.connection_handle); } |