Home
last modified time | relevance | path

Searched refs:psm (Results 1 – 25 of 134) sorted by relevance

123456

/packages/modules/Bluetooth/system/stack/l2cap/
Dl2c_api.cc69 uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, bool enable_snoop, in L2CA_RegisterWithSecurity() argument
72 auto ret = L2CA_Register(psm, p_cb_info, enable_snoop, p_ertm_info, my_mtu, in L2CA_RegisterWithSecurity()
75 false, "", 0, sec_level, psm, 0, 0); in L2CA_RegisterWithSecurity()
116 uint16_t L2CA_Register(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, in L2CA_Register() argument
126 uint16_t vpsm = psm; in L2CA_Register()
137 psm, config_cfm_cb, config_ind_cb, data_ind_cb, disconnect_ind_cb); in L2CA_Register()
142 if (L2C_INVALID_PSM(psm)) { in L2CA_Register()
143 log::error("L2CAP - invalid PSM value, PSM: 0x{:04x}", psm); in L2CA_Register()
149 if ((psm >= 0x1001) && (p_cb_info.pL2CA_ConnectInd_Cb == NULL)) { in L2CA_Register()
155 log::debug("L2CAP - Real PSM: 0x{:04x} Virtual PSM: 0x{:04x}", psm, vpsm); in L2CA_Register()
[all …]
/packages/modules/Bluetooth/system/gd/l2cap/classic/internal/
Ddynamic_channel_service_manager_impl.cc30 void DynamicChannelServiceManagerImpl::Register(Psm psm, in Register() argument
32 if (!IsPsmValid(psm)) { in Register()
37 } else if (IsServiceRegistered(psm)) { in Register()
44 psm, in Register()
49 …std::unique_ptr<DynamicChannelService> user_service(new DynamicChannelService(psm, this, l2cap_lay… in Register()
55 void DynamicChannelServiceManagerImpl::Unregister(Psm psm, DynamicChannelService::OnUnregisteredCal… in Unregister() argument
56 if (IsServiceRegistered(psm)) { in Unregister()
57 service_map_.erase(psm); in Unregister()
60 log::error("service not registered psm:{}", psm); in Unregister()
64 bool DynamicChannelServiceManagerImpl::IsServiceRegistered(Psm psm) const { in IsServiceRegistered()
[all …]
Dlink.cc146 void Link::SendConnectionRequest(Psm psm, Cid local_cid) { in SendConnectionRequest() argument
147 signalling_manager_.SendConnectionRequest(psm, local_cid); in SendConnectionRequest()
150 void Link::SendConnectionRequest(Psm psm, Cid local_cid, in SendConnectionRequest() argument
155 pending_dynamic_psm_list_.push_back(psm); in SendConnectionRequest()
172 signalling_manager_.SendConnectionRequest(psm, local_cid); in SendConnectionRequest()
190 auto psm = pending_dynamic_psm_list_.begin(); in connect_to_pending_dynamic_channels() local
192 while (psm != pending_dynamic_psm_list_.end()) { in connect_to_pending_dynamic_channels()
193 SendConnectionRequest(*psm, ReserveDynamicChannel(), std::move(*callback)); in connect_to_pending_dynamic_channels()
194 psm++; in connect_to_pending_dynamic_channels()
230 std::shared_ptr<l2cap::internal::DynamicChannelImpl> Link::AllocateDynamicChannel(Psm psm, Cid remo… in AllocateDynamicChannel() argument
[all …]
Ddynamic_channel_service_manager_impl_mock.h34 …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));
/packages/modules/Bluetooth/system/gd/l2cap/le/internal/
Ddynamic_channel_service_manager_impl.cc31 void DynamicChannelServiceManagerImpl::Register(Psm psm, in Register() argument
33 if (IsServiceRegistered(psm)) { in Register()
40 psm, DynamicChannelServiceImpl(pending_registration.user_handler_, in Register()
43 …std::unique_ptr<DynamicChannelService> user_service(new DynamicChannelService(psm, this, l2cap_lay… in Register()
50 void DynamicChannelServiceManagerImpl::Unregister(Psm psm, DynamicChannelService::OnUnregisteredCal… in Unregister() argument
52 if (IsServiceRegistered(psm)) { in Unregister()
53 service_map_.erase(psm); in Unregister()
56 log::error("service not registered psm:{}", psm); in Unregister()
60 bool DynamicChannelServiceManagerImpl::IsServiceRegistered(Psm psm) const { in IsServiceRegistered()
61 return service_map_.find(psm) != service_map_.end(); in IsServiceRegistered()
[all …]
Ddynamic_channel_service_manager_test.cc82 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()
Dsignalling_manager.cc61 void LeSignallingManager::SendConnectionRequest(Psm psm, Cid local_cid, Mtu mtu) { in SendConnectionRequest() argument
64 dynamic_service_manager_->GetService(psm)->GetSecurityPolicy(), in SendConnectionRequest()
65 …handler_->BindOnceOn(this, &LeSignallingManager::on_security_result_for_outgoing, psm, local_cid, … in SendConnectionRequest()
68 void LeSignallingManager::on_security_result_for_outgoing(Psm psm, Cid local_cid, Mtu mtu, bool res… in on_security_result_for_outgoing() argument
75 next_signal_id_, psm, local_cid, mtu, link_->GetMps(), link_->GetInitialCredit()); in on_security_result_for_outgoing()
182 void LeSignallingManager::OnConnectionRequest(SignalId signal_id, Psm psm, Cid remote_cid, Mtu mtu,… in OnConnectionRequest() argument
185 log::warn("Invalid remote cid received from remote psm:{} remote_cid:{}", psm, remote_cid); in OnConnectionRequest()
191 if (channel_allocator_->IsPsmUsed(psm)) { in OnConnectionRequest()
198 if (!dynamic_service_manager_->IsServiceRegistered(psm)) { in OnConnectionRequest()
199 log::info("Service for this psm ({}) is not registered", psm); in OnConnectionRequest()
[all …]
Dsignalling_manager.h57 …static PendingCommand CreditBasedConnectionRequest(SignalId signal_id, Psm psm, Cid scid, Mtu mtu,… in CreditBasedConnectionRequest()
62 pending_command.psm_ = psm; in CreditBasedConnectionRequest()
106 void SendConnectionRequest(Psm psm, Cid local_cid, Mtu mtu);
118 void SendEnhancedConnectionRequest(Psm psm, std::vector<Cid> local_cid, Mtu mtu);
134 void OnConnectionRequest(SignalId signal_id, Psm psm, Cid remote_cid, Mtu mtu, uint16_t mps,
160 void on_security_result_for_incoming(Psm psm, PendingConnection request, bool result);
161 void on_security_result_for_outgoing(Psm psm, Cid local_cid, Mtu mtu, bool result);
/packages/modules/Bluetooth/system/test/mock/
Dmock_stack_l2cap_api.h55 std::function<uint16_t(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info,
63 uint16_t operator()(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, in operator()
67 return body(psm, p_cb_info, enable_snoop, p_ertm_info, my_mtu, in operator()
77 std::function<uint16_t(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info,
85 uint16_t operator()(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, in operator()
89 return body(psm, p_cb_info, enable_snoop, p_ertm_info, my_mtu, in operator()
99 void operator()(uint16_t psm) { body(psm); }; in operator()
115 void operator()(uint16_t psm) { body(psm); }; in operator()
122 std::function<uint16_t(uint16_t psm, const RawAddress& p_bd_addr,
126 uint16_t operator()(uint16_t psm, const RawAddress& p_bd_addr, in operator()
[all …]
Dmock_stack_l2cap_api.cc88 uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, bool enable_snoop, in L2CA_RegisterWithSecurity() argument
93 psm, p_cb_info, enable_snoop, p_ertm_info, my_mtu, required_remote_mtu, in L2CA_RegisterWithSecurity()
96 uint16_t L2CA_Register(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, in L2CA_Register() argument
102 psm, p_cb_info, enable_snoop, p_ertm_info, my_mtu, required_remote_mtu, in L2CA_Register()
105 void L2CA_Deregister(uint16_t psm) { in L2CA_Deregister() argument
107 test::mock::stack_l2cap_api::L2CA_Deregister(psm); in L2CA_Deregister()
113 void L2CA_FreeLePSM(uint16_t psm) { in L2CA_FreeLePSM() argument
115 test::mock::stack_l2cap_api::L2CA_FreeLePSM(psm); in L2CA_FreeLePSM()
117 uint16_t L2CA_ConnectReqWithSecurity(uint16_t psm, const RawAddress& p_bd_addr, in L2CA_ConnectReqWithSecurity() argument
121 psm, p_bd_addr, sec_level); in L2CA_ConnectReqWithSecurity()
[all …]
Dmock_main_shim_l2cap_api.h88 std::function<void(uint16_t psm)> body{[](uint16_t psm) {}};
89 void operator()(uint16_t psm) { body(psm); }; in operator()
96 std::function<uint16_t(uint16_t psm, const RawAddress& raw_address)> body{
97 [](uint16_t psm, const RawAddress& raw_address) { return 0; }};
98 uint16_t operator()(uint16_t psm, const RawAddress& raw_address) { in operator()
99 return body(psm, raw_address); in operator()
141 std::function<std::vector<uint16_t>(uint16_t psm, const RawAddress& p_bd_addr,
143 body{[this](uint16_t psm, const RawAddress& p_bd_addr,
145 std::vector<uint16_t> operator()(uint16_t psm, const RawAddress& p_bd_addr, in operator()
147 return body(psm, p_bd_addr, p_cfg); in operator()
[all …]
/packages/modules/Bluetooth/system/stack/test/common/
Dmock_l2cap_layer.cc37 uint16_t L2CA_Register(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, in L2CA_Register() argument
41 bluetooth::log::verbose("psm={}, enable_snoop={}", psm, enable_snoop); in L2CA_Register()
42 return l2cap_interface->Register(psm, p_cb_info, enable_snoop, p_ertm_info); in L2CA_Register()
45 uint16_t L2CA_ConnectReq(uint16_t psm, const RawAddress& bd_addr) { in L2CA_ConnectReq() argument
46 return l2cap_interface->ConnectRequest(psm, bd_addr); in L2CA_ConnectReq()
74 uint16_t L2CA_RegisterLECoc(uint16_t psm, const tL2CAP_APPL_INFO& cb_info, in L2CA_RegisterLECoc() argument
76 return l2cap_interface->RegisterLECoc(psm, cb_info, sec_level); in L2CA_RegisterLECoc()
79 void L2CA_DeregisterLECoc(uint16_t psm) { in L2CA_DeregisterLECoc() argument
80 return l2cap_interface->DeregisterLECoc(psm); in L2CA_DeregisterLECoc()
87 std::vector<uint16_t> L2CA_ConnectCreditBasedReq(uint16_t psm, in L2CA_ConnectCreditBasedReq() argument
[all …]
Dmock_l2cap_layer.h33 virtual uint16_t Register(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info,
36 virtual uint16_t ConnectRequest(uint16_t psm, const RawAddress& bd_addr) = 0;
45 …virtual uint16_t RegisterLECoc(uint16_t psm, const tL2CAP_APPL_INFO &cb_info, uint16_t sec_level) …
46 virtual void DeregisterLECoc(uint16_t psm) = 0;
51 virtual std::vector<uint16_t> ConnectCreditBasedReq(uint16_t psm,
64 uint16_t(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info,
67 uint16_t(uint16_t psm, const RawAddress& bd_addr));
77 uint16_t(uint16_t psm, const tL2CAP_APPL_INFO &cb_info, uint16_t sec_level));
78 MOCK_METHOD1(DeregisterLECoc, void(uint16_t psm));
86 std::vector<uint16_t> (uint16_t psm,
/packages/modules/Bluetooth/system/gd/l2cap/internal/
Ddynamic_channel_allocator_test.cc62 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()
Ddynamic_channel_allocator.cc33 std::shared_ptr<DynamicChannelImpl> DynamicChannelAllocator::AllocateChannel(Psm psm, Cid remote_ci… in AllocateChannel() argument
47 …channels_.try_emplace(cid, std::make_shared<DynamicChannelImpl>(psm, cid, remote_cid, link_, l2cap… in AllocateChannel()
51 psm, in AllocateChannel()
59 …ptr<DynamicChannelImpl> DynamicChannelAllocator::AllocateReservedChannel(Cid reserved_cid, Psm psm, in AllocateReservedChannel() argument
66 …reserved_cid, std::make_shared<DynamicChannelImpl>(psm, reserved_cid, remote_cid, link_, l2cap_han… in AllocateReservedChannel()
70 psm, in AllocateReservedChannel()
101 bool DynamicChannelAllocator::IsPsmUsed(Psm psm) const { in IsPsmUsed()
103 if (channel.second->GetPsm() == psm) { in IsPsmUsed()
/packages/modules/Bluetooth/system/stack/btm/
Dbtm_sec_cb.cc102 uint16_t psm) { in find_first_serv_rec() argument
106 if (is_originator && p_out_serv && p_out_serv->psm == psm) { in find_first_serv_rec()
115 (p_serv_rec->psm == psm)) in find_first_serv_rec()
214 uint16_t psm, uint32_t mx_proto_id, in AddService() argument
231 if (p_srec->psm == psm && p_srec->mx_proto_id == mx_proto_id && in AddService()
263 p_srec->psm = psm; in AddService()
322 index, service_id, is_originator, psm, mx_proto_id, mx_chan_id, in AddService()
336 (p_srec->psm != BT_PSM_SDP) && in RemoveServiceById()
346 uint8_t tBTM_SEC_CB::RemoveServiceByPsm(uint16_t psm) { in RemoveServiceByPsm() argument
353 if ((p_srec->security_flags & BTM_SEC_IN_USE) && (p_srec->psm == psm)) { in RemoveServiceByPsm()
[all …]
/packages/modules/Bluetooth/system/stack/include/
Dl2c_api.h107 #define L2C_INVALID_PSM(psm) (((psm)&0x0101) != 0x0001) argument
108 #define L2C_IS_VALID_PSM(psm) (((psm)&0x0101) == 0x0001) argument
109 #define L2C_IS_VALID_LE_PSM(psm) (((psm) > 0x0000) && ((psm) < 0x0100)) argument
293 uint16_t psm, uint16_t peer_mtu,
367 uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, bool enable_snoop,
386 uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, bool enable_snoop,
400 void L2CA_Deregister(uint16_t psm);
423 void L2CA_FreeLePSM(uint16_t psm);
425 [[nodiscard]] uint16_t L2CA_ConnectReqWithSecurity(uint16_t psm,
441 [[nodiscard]] uint16_t L2CA_ConnectReq(uint16_t psm,
[all …]
/packages/modules/Bluetooth/system/stack/gap/
Dgap_conn.cc60 uint16_t psm; member
91 uint16_t psm, uint8_t l2cap_id);
169 bool is_server, const RawAddress* p_rem_bda, uint16_t psm, in GAP_ConnOpen() argument
243 p_ccb->psm = L2CA_RegisterWithSecurity( in GAP_ConnOpen()
244 psm, conn.reg_info, false /* enable_snoop */, &p_ccb->ertm_info, in GAP_ConnOpen()
246 if (p_ccb->psm == 0) { in GAP_ConnOpen()
247 log::error("Failure registering PSM 0x{:04x}", psm); in GAP_ConnOpen()
254 p_ccb->psm = in GAP_ConnOpen()
255 L2CA_RegisterLECoc(psm, conn.reg_info, security, p_ccb->local_coc_cfg); in GAP_ConnOpen()
256 if (p_ccb->psm == 0) { in GAP_ConnOpen()
[all …]
/packages/modules/Bluetooth/system/main/shim/
Dl2c_api.h44 uint16_t L2CA_Register(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info,
59 void L2CA_Deregister(uint16_t psm);
82 void L2CA_FreeLePSM(uint16_t psm);
97 uint16_t L2CA_ConnectReq(uint16_t psm, const RawAddress& p_bd_addr);
113 uint16_t L2CA_RegisterLECoc(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info,
126 void L2CA_DeregisterLECoc(uint16_t psm);
140 uint16_t L2CA_ConnectLECocReq(uint16_t psm, const RawAddress& p_bd_addr,
183 uint16_t psm, const RawAddress& p_bd_addr, tL2CAP_LE_CFG_INFO* p_cfg);
/packages/modules/Bluetooth/system/gd/l2cap/classic/
Dfacade.cc74 if (dynamic_channel_helper_map_.find(request->psm()) == dynamic_channel_helper_map_.end()) { in SendDynamicChannelPacket()
78 if (!dynamic_channel_helper_map_[request->psm()]->SendPacket(packet)) { in SendDynamicChannelPacket()
88 auto service_helper = dynamic_channel_helper_map_.find(request->psm()); in OpenChannel()
96 dynamic_channel_helper_map_[request->psm()]->Connect(peer); in OpenChannel()
104 auto psm = request->psm(); in CloseChannel() local
105 if (dynamic_channel_helper_map_.find(request->psm()) == dynamic_channel_helper_map_.end()) { in CloseChannel()
108 dynamic_channel_helper_map_[psm]->Disconnect(); in CloseChannel()
126 …request->psm(), std::make_unique<L2capDynamicChannelHelper>(this, l2cap_layer_, facade_handler_, r… in SetDynamicChannel()
135 auto psm = request->psm(); in SetTrafficPaused() local
136 if (dynamic_channel_helper_map_.find(request->psm()) == dynamic_channel_helper_map_.end()) { in SetTrafficPaused()
[all …]
/packages/modules/Bluetooth/system/blueberry/facade/l2cap/le/
Dfacade.proto22 uint32 psm = 1; field
29 uint32 psm = 1; field
35 uint32 psm = 2; field
44 uint32 psm = 2; field
56 uint32 psm = 1; field
63 uint32 psm = 2; field
/packages/modules/Bluetooth/system/stack/fuzzers/
Davrc_fuzzer.cc72 [](uint16_t psm, const RawAddress& p_bd_addr, uint16_t sec_level) { in FakeBtStack() argument
78 [](uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, bool enable_snoop, in FakeBtStack()
82 psm == AVCT_PSM || psm == AVCT_BR_PSM, in FakeBtStack()
84 if (psm == AVCT_PSM) { in FakeBtStack()
86 } else if (psm == AVCT_BR_PSM) { in FakeBtStack()
89 return psm; in FakeBtStack()
91 test::mock::stack_l2cap_api::L2CA_Deregister.body = [](uint16_t psm) {}; in FakeBtStack() argument
/packages/modules/Bluetooth/system/gd/rust/linux/stack/src/
Dsocket_manager.rs66 pub psm: Option<i32>, field
84 psm: None, in new()
99 psm: Some(DYNAMIC_PSM_NO_SDP), in make_l2cap_channel()
116 psm: None, in make_rfcomm_channel()
128 psm: None, in make_default_rfcomm_channel()
169 match (self.psm, self.channel) { in fmt()
170 (Some(psm), Some(cn)) => format!("psm {} | cn {}", psm, cn), in fmt()
172 (Some(psm), None) => format!("psm {}", psm), in fmt()
220 fn make_l2cap_channel(flags: i32, device: BluetoothDevice, psm: i32, is_le: bool) -> Self { in make_l2cap_channel()
230 port: psm, in make_l2cap_channel()
[all …]
/packages/modules/Bluetooth/system/bta/jv/
Dbta_jv_act.cc402 p_cb->psm = 0; in bta_jv_free_l2c_cb()
586 bool bta_jv_check_psm(uint16_t psm) { in bta_jv_check_psm() argument
589 if (L2C_IS_VALID_PSM(psm)) { in bta_jv_check_psm()
590 if (psm < 0x1001) { in bta_jv_check_psm()
592 switch (psm) { in bta_jv_check_psm()
660 uint16_t psm = bta_jv_cb.free_psm_list[i]; in bta_jv_get_free_psm() local
661 if (psm != 0) { in bta_jv_get_free_psm()
662 log::verbose("Reusing PSM=0x{:x}", psm); in bta_jv_get_free_psm()
664 return psm; in bta_jv_get_free_psm()
670 static void bta_jv_set_free_psm(uint16_t psm) { in bta_jv_set_free_psm() argument
[all …]
/packages/modules/Bluetooth/floss/hcidoc/src/groups/
Dinformational.rs264 psm: Psm, in report_l2cap_conn_req()
270 self.host_cids.insert(cid, CidState::Pending(psm)); in report_l2cap_conn_req()
272 self.peer_cids.insert(cid, CidState::Pending(psm)); in report_l2cap_conn_req()
294 CidState::Pending(psm) => Some(*psm), in report_l2cap_conn_rsp()
300 if let Some(psm) = psm_option { in report_l2cap_conn_rsp()
301 let profile_option = ProfileType::from_psm(psm); in report_l2cap_conn_rsp()
304 self.host_cids.insert(host_cid, CidState::Connected(peer_cid, psm)); in report_l2cap_conn_rsp()
305 self.peer_cids.insert(peer_cid, CidState::Connected(host_cid, psm)); in report_l2cap_conn_rsp()
331 CidState::Connected(_peer_cid, psm) => Some(psm), in report_l2cap_disconn_rsp()
341 CidState::Connected(_host_cid, psm) => Some(psm), in report_l2cap_disconn_rsp()
[all …]

123456