/aosp12/system/bt/gd/l2cap/classic/cert/ |
H A D | pts_l2cap_test.py | 71 psm = 1 81 psm = 1 94 psm = 1 106 psm = 1 119 psm = 1 132 psm = 1 146 psm = 1 166 psm = 1 179 psm = 1 195 psm = 1 [all …]
|
/aosp12/system/bt/stack/l2cap/ |
H A D | l2c_api.cc | 91 uint16_t vpsm = psm; in L2CA_Register() 107 if (L2C_INVALID_PSM(psm)) { in L2CA_Register() 137 p_rcb->real_psm = psm; in L2CA_Register() 194 psm); in L2CA_Deregister() 224 psm++; in L2CA_AllocateLePSM() 243 l2cb.le_dyn_psm = psm; in L2CA_AllocateLePSM() 245 return (psm); in L2CA_AllocateLePSM() 264 if ((psm < LE_DYNAMIC_PSM_START) || (psm > LE_DYNAMIC_PSM_END)) { in L2CA_FreeLePSM() 408 uint16_t vpsm = psm; in L2CA_RegisterLECoc() 436 p_rcb->real_psm = psm; in L2CA_RegisterLECoc() [all …]
|
/aosp12/system/bt/gd/cert/ |
H A D | py_l2cap.py | 37 def __init__(self, device, psm, l2cap_stream): argument 39 self._psm = psm 67 self._psm = psm 93 l2cap_facade_pb2.SetEnableDynamicChannelRequest(psm=psm, retransmission_mode=mode)) 101 self.register_dynamic_channel(psm, mode) 103 l2cap_facade_pb2.OpenChannelRequest(psm=psm, remote=self._cert_address, mode=mode)) 183 self._psm = psm 210 self._psm = psm 238 …l2cap_le_facade_pb2.SetEnableDynamicChannelRequest(psm=psm, enable=True, security_level=security_l… 245 self.register_coc(cert_address, psm) [all …]
|
/aosp12/system/bt/test/mock/ |
H A D | mock_stack_l2cap_api.h | 114 std::function<void(uint16_t psm)> body{[](uint16_t psm) {}}; 115 void operator()(uint16_t psm) { body(psm); }; in operator() 130 std::function<void(uint16_t psm)> body{[](uint16_t psm) {}}; 131 void operator()(uint16_t psm) { body(psm); }; in operator() 145 return body(psm, p_bd_addr, sec_level); in operator() 156 return body(psm, p_bd_addr); in operator() 170 return body(psm, p_cb_info, sec_level, cfg); in operator() 178 std::function<void(uint16_t psm)> body{[](uint16_t psm) {}}; 179 void operator()(uint16_t psm) { body(psm); }; in operator() 192 return body(psm, p_bd_addr, p_cfg, sec_level); in operator() [all …]
|
H A D | mock_stack_l2cap_api.cc | 124 void L2CA_Deregister(uint16_t psm) { in L2CA_Deregister() argument 126 test::mock::stack_l2cap_api::L2CA_Deregister(psm); in L2CA_Deregister() 132 void L2CA_FreeLePSM(uint16_t psm) { in L2CA_FreeLePSM() argument 134 test::mock::stack_l2cap_api::L2CA_FreeLePSM(psm); in L2CA_FreeLePSM() 136 uint16_t L2CA_ConnectReq2(uint16_t psm, const RawAddress& p_bd_addr, in L2CA_ConnectReq2() argument 139 return test::mock::stack_l2cap_api::L2CA_ConnectReq2(psm, p_bd_addr, in L2CA_ConnectReq2() 142 uint16_t L2CA_ConnectReq(uint16_t psm, const RawAddress& p_bd_addr) { in L2CA_ConnectReq() argument 144 return test::mock::stack_l2cap_api::L2CA_ConnectReq(psm, p_bd_addr); in L2CA_ConnectReq() 152 void L2CA_DeregisterLECoc(uint16_t psm) { in L2CA_DeregisterLECoc() argument 154 test::mock::stack_l2cap_api::L2CA_DeregisterLECoc(psm); in L2CA_DeregisterLECoc() [all …]
|
H A D | mock_main_shim_l2cap_api.h | 130 std::function<void(uint16_t psm)> body{[](uint16_t psm) {}}; 131 void operator()(uint16_t psm) { body(psm); }; in operator() 141 return body(psm, raw_address); in operator() 189 return body(psm, p_bd_addr, p_cfg); in operator() 506 std::function<void(uint16_t psm)> body{[](uint16_t psm) {}}; 507 void operator()(uint16_t psm) { body(psm); }; in operator() 520 return body(psm, callbacks, sec_level, cfg); in operator() 528 std::function<void(uint16_t psm)> body{[](uint16_t psm) {}}; 529 void operator()(uint16_t psm) { body(psm); }; in operator() 538 body{[](uint16_t psm, const RawAddress& p_bd_addr, [all …]
|
H A D | mock_main_shim_l2cap_api.cc | 122 void bluetooth::shim::L2CA_Deregister(uint16_t psm) { in L2CA_Deregister() argument 124 test::mock::main_shim_l2cap_api::L2CA_Deregister(psm); in L2CA_Deregister() 126 uint16_t bluetooth::shim::L2CA_ConnectReq(uint16_t psm, in L2CA_ConnectReq() argument 147 uint16_t psm, const RawAddress& p_bd_addr, tL2CAP_LE_CFG_INFO* p_cfg) { in L2CA_ConnectCreditBasedReq() argument 150 psm, p_bd_addr, p_cfg); in L2CA_ConnectCreditBasedReq() 301 void bluetooth::shim::L2CA_FreeLePSM(uint16_t psm) { in L2CA_FreeLePSM() argument 303 test::mock::main_shim_l2cap_api::L2CA_FreeLePSM(psm); in L2CA_FreeLePSM() 305 uint16_t bluetooth::shim::L2CA_RegisterLECoc(uint16_t psm, in L2CA_RegisterLECoc() argument 313 void bluetooth::shim::L2CA_DeregisterLECoc(uint16_t psm) { in L2CA_DeregisterLECoc() argument 315 test::mock::main_shim_l2cap_api::L2CA_DeregisterLECoc(psm); in L2CA_DeregisterLECoc() [all …]
|
/aosp12/system/bt/gd/l2cap/classic/internal/ |
H A D | dynamic_channel_service_manager_impl.cc | 28 void DynamicChannelServiceManagerImpl::Register(Psm psm, in Register() argument 30 if (!IsPsmValid(psm)) { in Register() 34 } else if (IsServiceRegistered(psm)) { in Register() 40 psm, in Register() 52 if (IsServiceRegistered(psm)) { in Unregister() 53 service_map_.erase(psm); in Unregister() 56 LOG_ERROR("service not registered psm:%d", psm); in Unregister() 60 bool DynamicChannelServiceManagerImpl::IsServiceRegistered(Psm psm) const { in IsServiceRegistered() 61 return service_map_.find(psm) != service_map_.end(); in IsServiceRegistered() 65 ASSERT(IsServiceRegistered(psm)); in GetService() [all …]
|
H A D | link.cc | 144 void Link::SendConnectionRequest(Psm psm, Cid local_cid) { in SendConnectionRequest() argument 145 signalling_manager_.SendConnectionRequest(psm, local_cid); in SendConnectionRequest() 148 void Link::SendConnectionRequest(Psm psm, Cid local_cid, in SendConnectionRequest() argument 153 pending_dynamic_psm_list_.push_back(psm); in SendConnectionRequest() 170 signalling_manager_.SendConnectionRequest(psm, local_cid); in SendConnectionRequest() 186 auto psm = pending_dynamic_psm_list_.begin(); in connect_to_pending_dynamic_channels() local 188 while (psm != pending_dynamic_psm_list_.end()) { in connect_to_pending_dynamic_channels() 189 SendConnectionRequest(*psm, ReserveDynamicChannel(), std::move(*callback)); in connect_to_pending_dynamic_channels() 190 psm++; in connect_to_pending_dynamic_channels() 227 auto channel = dynamic_channel_allocator_.AllocateChannel(psm, remote_cid); in AllocateDynamicChannel() [all …]
|
H A D | dynamic_channel_service_manager_impl_mock.h | 34 …MOCK_METHOD(void, Register, (Psm psm, DynamicChannelServiceImpl::PendingRegistration pending_regis… 36 …MOCK_METHOD(void, Unregister, (Psm psm, DynamicChannelService::OnUnregisteredCallback callback), (… 37 MOCK_METHOD(bool, IsServiceRegistered, (Psm psm), (const, override)); 38 MOCK_METHOD(DynamicChannelServiceImpl*, GetService, (Psm psm), (override));
|
/aosp12/system/bt/gd/l2cap/le/internal/ |
H A D | dynamic_channel_service_manager_impl.cc | 29 void DynamicChannelServiceManagerImpl::Register(Psm psm, in Register() argument 31 if (IsServiceRegistered(psm)) { in Register() 38 psm, DynamicChannelServiceImpl(pending_registration.user_handler_, in Register() 50 if (IsServiceRegistered(psm)) { in Unregister() 51 service_map_.erase(psm); in Unregister() 54 LOG_ERROR("service not registered psm:%d", psm); in Unregister() 58 bool DynamicChannelServiceManagerImpl::IsServiceRegistered(Psm psm) const { in IsServiceRegistered() 59 return service_map_.find(psm) != service_map_.end(); in IsServiceRegistered() 62 DynamicChannelServiceImpl* DynamicChannelServiceManagerImpl::GetService(Psm psm) { in GetService() argument 63 ASSERT(IsServiceRegistered(psm)); in GetService() [all …]
|
H A D | dynamic_channel_service_manager_test.cc | 82 Psm psm = 0x41; in TEST_F() local 83 EXPECT_FALSE(manager_->IsServiceRegistered(psm)); in TEST_F() 84 manager_->Register(psm, std::move(pending_registration)); in TEST_F() 85 EXPECT_TRUE(manager_->IsServiceRegistered(psm)); in TEST_F() 88 manager_->Unregister(psm, common::BindOnce([] {}), user_handler_); in TEST_F() 89 EXPECT_FALSE(manager_->IsServiceRegistered(psm)); in TEST_F() 98 Psm psm = 0x0100; in TEST_F() local 99 EXPECT_FALSE(manager_->IsServiceRegistered(psm)); in TEST_F() 100 manager_->Register(psm, std::move(pending_registration)); in TEST_F() 101 EXPECT_TRUE(manager_->IsServiceRegistered(psm)); in TEST_F()
|
H A D | signalling_manager.cc | 59 void LeSignallingManager::SendConnectionRequest(Psm psm, Cid local_cid, Mtu mtu) { in SendConnectionRequest() argument 62 dynamic_service_manager_->GetService(psm)->GetSecurityPolicy(), in SendConnectionRequest() 73 next_signal_id_, psm, local_cid, mtu, link_->GetMps(), link_->GetInitialCredit()); in on_security_result_for_outgoing() 181 LOG_WARN("Invalid remote cid received from remote psm:%d remote_cid:%d", psm, remote_cid); in OnConnectionRequest() 187 if (channel_allocator_->IsPsmUsed(psm)) { in OnConnectionRequest() 194 if (!dynamic_service_manager_->IsServiceRegistered(psm)) { in OnConnectionRequest() 195 LOG_INFO("Service for this psm (%d) is not registered", psm); in OnConnectionRequest() 210 dynamic_service_manager_->GetService(psm)->GetSecurityPolicy(), in OnConnectionRequest() 216 auto* service = dynamic_service_manager_->GetService(psm); in on_security_result_for_incoming() 246 auto new_channel = link_->AllocateDynamicChannel(psm, request.remote_cid); in on_security_result_for_incoming() [all …]
|
/aosp12/system/bt/gd/l2cap/le/cert/ |
H A D | le_l2cap_test.py | 91 psm=0x33, argument 110 response_future = self.dut_l2cap.connect_coc_to_cert(self.cert_address, psm) 119 dut_channel = self.dut_l2cap.register_coc(self.cert_address, psm) 124 def _open_channel_from_dut(self, psm=0x33): argument 125 response_future = self.dut_l2cap.connect_coc_to_cert(self.cert_address, psm) 314 self.cert_l2cap.verify_and_reject_open_channel_from_remote(psm=0x33) 435 psm = 0x33 459 psm = 0x33 462 psm, LeCreditBasedConnectionResponseResult.INSUFFICIENT_AUTHORIZATION) 487 psm = 0x33 [all …]
|
H A D | dual_l2cap_test.py | 100 def _open_le_coc_from_dut(self, psm=0x33, our_scid=None): argument 101 response_future = self.dut_le_l2cap.connect_coc_to_cert(self.cert_address, psm) 102 …cert_channel = self.cert_le_l2cap.verify_and_respond_open_channel_from_remote(psm=psm, our_scid=ou… 106 def _open_channel_from_dut(self, psm=0x33, our_scid=None): argument 107 dut_channel_future = self.dut_l2cap.connect_dynamic_channel_to_cert(psm) 108 … cert_channel = self.cert_l2cap.verify_and_respond_open_channel_from_remote(psm=psm, scid=our_scid) 117 def _open_unconfigured_channel_from_cert(self, signal_id=1, scid=0x0101, psm=0x33): argument 119 dut_channel = self.dut_l2cap.register_dynamic_channel(psm) 120 cert_channel = self.cert_l2cap.open_channel(signal_id, psm, scid) 124 def _open_channel_from_cert(self, signal_id=1, scid=0x0101, psm=0x33): argument [all …]
|
/aosp12/system/bt/stack/test/common/ |
H A D | mock_l2cap_layer.cc | 27 uint16_t L2CA_Register(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, in L2CA_Register() argument 31 VLOG(1) << __func__ << ": psm=" << psm << ", enable_snoop=" << enable_snoop; in L2CA_Register() 32 return l2cap_interface->Register(psm, p_cb_info, enable_snoop, p_ertm_info); in L2CA_Register() 35 uint16_t L2CA_ConnectReq(uint16_t psm, const RawAddress& bd_addr) { in L2CA_ConnectReq() argument 36 return l2cap_interface->ConnectRequest(psm, bd_addr); in L2CA_ConnectReq() 64 uint16_t L2CA_RegisterLECoc(uint16_t psm, const tL2CAP_APPL_INFO& cb_info, in L2CA_RegisterLECoc() argument 66 return l2cap_interface->RegisterLECoc(psm, cb_info, sec_level); in L2CA_RegisterLECoc() 69 void L2CA_DeregisterLECoc(uint16_t psm) { in L2CA_DeregisterLECoc() argument 70 return l2cap_interface->DeregisterLECoc(psm); in L2CA_DeregisterLECoc() 77 std::vector<uint16_t> L2CA_ConnectCreditBasedReq(uint16_t psm, in L2CA_ConnectCreditBasedReq() argument [all …]
|
H A D | mock_l2cap_layer.h | 29 virtual uint16_t Register(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, 32 virtual uint16_t ConnectRequest(uint16_t psm, const RawAddress& bd_addr) = 0; 41 …virtual uint16_t RegisterLECoc(uint16_t psm, const tL2CAP_APPL_INFO &cb_info, uint16_t sec_level) … 42 virtual void DeregisterLECoc(uint16_t psm) = 0; 47 virtual std::vector<uint16_t> ConnectCreditBasedReq(uint16_t psm, 58 uint16_t(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, 61 uint16_t(uint16_t psm, const RawAddress& bd_addr)); 71 uint16_t(uint16_t psm, const tL2CAP_APPL_INFO &cb_info, uint16_t sec_level)); 72 MOCK_METHOD1(DeregisterLECoc, void(uint16_t psm)); 80 std::vector<uint16_t> (uint16_t psm,
|
/aosp12/system/bt/stack/include/ |
H A D | l2c_api.h | 96 #define L2C_INVALID_PSM(psm) (((psm)&0x0101) != 0x0001) argument 97 #define L2C_IS_VALID_PSM(psm) (((psm)&0x0101) == 0x0001) argument 98 #define L2C_IS_VALID_LE_PSM(psm) (((psm) > 0x0000) && ((psm) < 0x0100)) argument 336 uint16_t L2CA_Register2(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, 370 extern void L2CA_Deregister(uint16_t psm); 393 extern void L2CA_FreeLePSM(uint16_t psm); 395 extern uint16_t L2CA_ConnectReq2(uint16_t psm, const RawAddress& p_bd_addr, 410 extern uint16_t L2CA_ConnectReq(uint16_t psm, const RawAddress& p_bd_addr); 426 extern uint16_t L2CA_RegisterLECoc(uint16_t psm, 440 extern void L2CA_DeregisterLECoc(uint16_t psm); [all …]
|
/aosp12/system/bt/gd/l2cap/internal/ |
H A D | dynamic_channel_allocator_test.cc | 62 Psm psm = 0x03; in TEST_F() local 63 EXPECT_FALSE(channel_allocator_->IsPsmUsed(psm)); in TEST_F() 67 Psm psm = 0x03; in TEST_F() local 69 auto channel = channel_allocator_->AllocateChannel(psm, remote_cid); in TEST_F() 71 EXPECT_TRUE(channel_allocator_->IsPsmUsed(psm)); in TEST_F() 74 EXPECT_FALSE(channel_allocator_->IsPsmUsed(psm)); in TEST_F() 78 Psm psm = 0x03; in TEST_F() local 81 auto channel = channel_allocator_->AllocateReservedChannel(reserved, psm, remote_cid); in TEST_F() 84 EXPECT_TRUE(channel_allocator_->IsPsmUsed(psm)); in TEST_F() 87 EXPECT_FALSE(channel_allocator_->IsPsmUsed(psm)); in TEST_F()
|
H A D | dynamic_channel_allocator.cc | 30 std::shared_ptr<DynamicChannelImpl> DynamicChannelAllocator::AllocateChannel(Psm psm, Cid remote_ci… in AllocateChannel() argument 44 …channels_.try_emplace(cid, std::make_shared<DynamicChannelImpl>(psm, cid, remote_cid, link_, l2cap… in AllocateChannel() 45 ASSERT_LOG(elem.second, "Failed to create channel for psm 0x%x device %s", psm, in AllocateChannel() 53 …ptr<DynamicChannelImpl> DynamicChannelAllocator::AllocateReservedChannel(Cid reserved_cid, Psm psm, in AllocateReservedChannel() argument 60 …reserved_cid, std::make_shared<DynamicChannelImpl>(psm, reserved_cid, remote_cid, link_, l2cap_han… in AllocateReservedChannel() 61 ASSERT_LOG(elem.second, "Failed to create channel for psm 0x%x device %s", psm, in AllocateReservedChannel() 92 bool DynamicChannelAllocator::IsPsmUsed(Psm psm) const { in IsPsmUsed() 94 if (channel.second->GetPsm() == psm) { in IsPsmUsed()
|
/aosp12/system/bt/main/shim/ |
H A D | l2c_api.cc | 70 uint16_t add_classic_cid_token_entry(uint16_t psm) { in add_classic_cid_token_entry() argument 745 void L2CA_Deregister(uint16_t psm) { in L2CA_Deregister() argument 1256 uint16_t add_le_cid_token_entry(uint16_t psm) { in add_le_cid_token_entry() argument 1463 le_dynamic_channel_helper_map_.erase(psm); in remove_le_dynamic_channel_helper() 1490 void L2CA_FreeLePSM(uint16_t psm) { assigned_dynamic_le_psm_.erase(psm); } in L2CA_FreeLePSM() argument 1507 le_dynamic_channel_helper_map_[psm] = in L2CA_RegisterLECoc() 1510 return psm; in L2CA_RegisterLECoc() 1513 void L2CA_DeregisterLECoc(uint16_t psm) { in L2CA_DeregisterLECoc() argument 1543 auto psm = le_cid_token_to_channel_map_[cid]; in L2CA_GetPeerLECocConfig() local 1558 auto psm = le_cid_token_to_channel_map_[cid]; in L2CA_DisconnectLECocReq() local [all …]
|
H A D | l2c_api.h | 43 uint16_t L2CA_Register(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, 58 void L2CA_Deregister(uint16_t psm); 81 void L2CA_FreeLePSM(uint16_t psm); 96 uint16_t L2CA_ConnectReq(uint16_t psm, const RawAddress& p_bd_addr); 112 uint16_t L2CA_RegisterLECoc(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, 125 void L2CA_DeregisterLECoc(uint16_t psm); 139 uint16_t L2CA_ConnectLECocReq(uint16_t psm, const RawAddress& p_bd_addr, 182 uint16_t psm, const RawAddress& p_bd_addr, tL2CAP_LE_CFG_INFO* p_cfg);
|
/aosp12/system/bt/stack/gap/ |
H A D | gap_conn.cc | 54 uint16_t psm; member 85 uint16_t psm, uint8_t l2cap_id); 239 p_ccb->psm = in GAP_ConnOpen() 242 if (p_ccb->psm == 0) { in GAP_ConnOpen() 244 psm); in GAP_ConnOpen() 251 p_ccb->psm = in GAP_ConnOpen() 253 if (p_ccb->psm == 0) { in GAP_ConnOpen() 255 psm); in GAP_ConnOpen() 605 if ((p_ccb->con_state == GAP_CCB_STATE_LISTENING) && (p_ccb->psm == psm) && in gap_connect_ind() 989 (p_ccb_local->psm == p_ccb->psm)) { in gap_release_ccb() [all …]
|
/aosp12/system/bt/gd/l2cap/le/ |
H A D | facade.proto | 22 uint32 psm = 1; 29 uint32 psm = 1; 35 uint32 psm = 2; 44 uint32 psm = 2; 56 uint32 psm = 1; 63 uint32 psm = 2;
|
/aosp12/system/bt/gd/l2cap/classic/ |
H A D | facade.cc | 63 if (dynamic_channel_helper_map_.find(request->psm()) == dynamic_channel_helper_map_.end()) { in SendDynamicChannelPacket() 67 if (!dynamic_channel_helper_map_[request->psm()]->SendPacket(packet)) { in SendDynamicChannelPacket() 76 auto service_helper = dynamic_channel_helper_map_.find(request->psm()); in OpenChannel() 82 dynamic_channel_helper_map_[request->psm()]->Connect(peer); in OpenChannel() 89 auto psm = request->psm(); in CloseChannel() local 93 dynamic_channel_helper_map_[psm]->Disconnect(); in CloseChannel() 107 …request->psm(), std::make_unique<L2capDynamicChannelHelper>(this, l2cap_layer_, facade_handler_, r… in SetDynamicChannel() 114 auto psm = request->psm(); in SetTrafficPaused() local 119 dynamic_channel_helper_map_[psm]->SuspendDequeue(); in SetTrafficPaused() 121 dynamic_channel_helper_map_[psm]->ResumeDequeue(); in SetTrafficPaused() [all …]
|