Lines Matching refs:psm
60 uint16_t L2CA_RegisterWithSecurity(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, in L2CA_RegisterWithSecurity() argument
64 auto ret = L2CA_Register(psm, p_cb_info, enable_snoop, p_ertm_info, my_mtu, required_remote_mtu, in L2CA_RegisterWithSecurity()
66 get_btm_client_interface().security.BTM_SetSecurityLevel(false, "", 0, sec_level, psm, 0, 0); in L2CA_RegisterWithSecurity()
105 uint16_t L2CA_Register(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, bool enable_snoop, in L2CA_Register() argument
114 uint16_t vpsm = psm; in L2CA_Register()
125 psm, config_cfm_cb, config_ind_cb, data_ind_cb, disconnect_ind_cb); in L2CA_Register()
130 if (L2C_INVALID_PSM(psm)) { in L2CA_Register()
131 log::error("L2CAP - invalid PSM value, PSM: 0x{:04x}", psm); in L2CA_Register()
137 if ((psm >= 0x1001) && (p_cb_info.pL2CA_ConnectInd_Cb == NULL)) { in L2CA_Register()
145 log::debug("L2CAP - Real PSM: 0x{:04x} Virtual PSM: 0x{:04x}", psm, vpsm); in L2CA_Register()
153 log::warn("L2CAP - no RCB available, PSM: 0x{:04x} vPSM: 0x{:04x}", psm, vpsm); in L2CA_Register()
158 log::info("L2CAP Registered service classic PSM: 0x{:04x}", psm); in L2CA_Register()
161 p_rcb->real_psm = psm; in L2CA_Register()
179 void L2CA_Deregister(uint16_t psm) { in L2CA_Deregister() argument
184 log::verbose("L2CAP - L2CA_Deregister() called for PSM: 0x{:04x}", psm); in L2CA_Deregister()
186 p_rcb = l2cu_find_rcb_by_psm(psm); in L2CA_Deregister()
208 log::warn("L2CAP - PSM: 0x{:04x} not found for deregistration", psm); in L2CA_Deregister()
223 uint16_t psm = l2cb.le_dyn_psm; in L2CA_AllocateLePSM() local
226 log::verbose("last psm={}", psm); in L2CA_AllocateLePSM()
234 psm++; in L2CA_AllocateLePSM()
235 if (psm > LE_DYNAMIC_PSM_END) { in L2CA_AllocateLePSM()
236 psm = LE_DYNAMIC_PSM_START; in L2CA_AllocateLePSM()
239 if (!l2cb.le_dyn_psm_assigned[psm - LE_DYNAMIC_PSM_START]) { in L2CA_AllocateLePSM()
241 if (l2cu_find_ble_rcb_by_psm(psm)) { in L2CA_AllocateLePSM()
242 log::warn("supposedly-free PSM={} have allocated rcb!", psm); in L2CA_AllocateLePSM()
246 l2cb.le_dyn_psm_assigned[psm - LE_DYNAMIC_PSM_START] = true; in L2CA_AllocateLePSM()
247 log::verbose("assigned PSM={}", psm); in L2CA_AllocateLePSM()
252 l2cb.le_dyn_psm = psm; in L2CA_AllocateLePSM()
254 return psm; in L2CA_AllocateLePSM()
266 void L2CA_FreeLePSM(uint16_t psm) { in L2CA_FreeLePSM() argument
267 log::verbose("to free psm={}", psm); in L2CA_FreeLePSM()
269 if ((psm < LE_DYNAMIC_PSM_START) || (psm > LE_DYNAMIC_PSM_END)) { in L2CA_FreeLePSM()
270 log::error("Invalid PSM={} value!", psm); in L2CA_FreeLePSM()
274 if (!l2cb.le_dyn_psm_assigned[psm - LE_DYNAMIC_PSM_START]) { in L2CA_FreeLePSM()
275 log::warn("PSM={} was not allocated!", psm); in L2CA_FreeLePSM()
277 l2cb.le_dyn_psm_assigned[psm - LE_DYNAMIC_PSM_START] = false; in L2CA_FreeLePSM()
280 uint16_t L2CA_ConnectReqWithSecurity(uint16_t psm, const RawAddress& p_bd_addr, in L2CA_ConnectReqWithSecurity() argument
282 get_btm_client_interface().security.BTM_SetSecurityLevel(true, "", 0, sec_level, psm, 0, 0); in L2CA_ConnectReqWithSecurity()
283 return L2CA_ConnectReq(psm, p_bd_addr); in L2CA_ConnectReqWithSecurity()
299 uint16_t L2CA_ConnectReq(uint16_t psm, const RawAddress& p_bd_addr) { in L2CA_ConnectReq() argument
300 log::verbose("BDA {} PSM: 0x{:04x}", p_bd_addr, psm); in L2CA_ConnectReq()
308 tL2C_RCB* p_rcb = l2cu_find_rcb_by_psm(psm); in L2CA_ConnectReq()
310 log::warn("no RCB, PSM=0x{:x}", psm); in L2CA_ConnectReq()
322 log::warn("connection not started for PSM=0x{:x}, p_lcb={}", psm, std::format_ptr(p_lcb)); in L2CA_ConnectReq()
331 log::warn("no CCB, PSM=0x{:x}", psm); in L2CA_ConnectReq()
356 log::verbose("L2CAP - L2CA_conn_req(psm: 0x{:04x}) returned CID: 0x{:04x}", psm, in L2CA_ConnectReq()
377 uint16_t L2CA_RegisterLECoc(uint16_t psm, const tL2CAP_APPL_INFO& p_cb_info, uint16_t sec_level, in L2CA_RegisterLECoc() argument
379 if (p_cb_info.pL2CA_ConnectInd_Cb != nullptr || psm < LE_DYNAMIC_PSM_START) { in L2CA_RegisterLECoc()
382 get_btm_client_interface().security.BTM_SetSecurityLevel(false, "", 0, sec_level, psm, 0, 0); in L2CA_RegisterLECoc()
391 log::error("No cb registering BLE PSM: 0x{:04x}", psm); in L2CA_RegisterLECoc()
396 if (!L2C_IS_VALID_LE_PSM(psm)) { in L2CA_RegisterLECoc()
397 log::error("Invalid BLE PSM value, PSM: 0x{:04x}", psm); in L2CA_RegisterLECoc()
402 uint16_t vpsm = psm; in L2CA_RegisterLECoc()
406 if ((psm >= LE_DYNAMIC_PSM_START) && (p_cb_info.pL2CA_ConnectInd_Cb == NULL)) { in L2CA_RegisterLECoc()
413 log::debug("Real PSM: 0x{:04x} Virtual PSM: 0x{:04x}", psm, vpsm); in L2CA_RegisterLECoc()
422 log::warn("No BLE RCB available, PSM: 0x{:04x} vPSM: 0x{:04x}", psm, vpsm); in L2CA_RegisterLECoc()
427 log::info("Registered service LE COC PSM: 0x{:04x}", psm); in L2CA_RegisterLECoc()
429 p_rcb->real_psm = psm; in L2CA_RegisterLECoc()
445 void L2CA_DeregisterLECoc(uint16_t psm) { in L2CA_DeregisterLECoc() argument
446 log::verbose("called for PSM: 0x{:04x}", psm); in L2CA_DeregisterLECoc()
448 tL2C_RCB* p_rcb = l2cu_find_ble_rcb_by_psm(psm); in L2CA_DeregisterLECoc()
450 log::warn("PSM: 0x{:04x} not found for deregistration", psm); in L2CA_DeregisterLECoc()
495 uint16_t L2CA_ConnectLECocReq(uint16_t psm, const RawAddress& p_bd_addr, tL2CAP_LE_CFG_INFO* p_cfg, in L2CA_ConnectLECocReq() argument
497 get_btm_client_interface().security.BTM_SetSecurityLevel(true, "", 0, sec_level, psm, 0, 0); in L2CA_ConnectLECocReq()
499 log::verbose("BDA: {} PSM: 0x{:04x}", p_bd_addr, psm); in L2CA_ConnectLECocReq()
508 tL2C_RCB* p_rcb = l2cu_find_ble_rcb_by_psm(psm); in L2CA_ConnectLECocReq()
510 log::warn("No BLE RCB, PSM: 0x{:04x}", psm); in L2CA_ConnectLECocReq()
522 log::warn("conn not started for PSM: 0x{:04x} p_lcb: 0x{}", psm, std::format_ptr(p_lcb)); in L2CA_ConnectLECocReq()
530 log::warn("no CCB, PSM: 0x{:04x}", psm); in L2CA_ConnectLECocReq()
566 log::verbose("(psm: 0x{:04x}) returned CID: 0x{:04x}", psm, p_ccb->local_cid); in L2CA_ConnectLECocReq()
689 .psm{}, in L2CA_ConnectCreditBasedRsp()
719 std::vector<uint16_t> L2CA_ConnectCreditBasedReq(uint16_t psm, const RawAddress& p_bd_addr, in L2CA_ConnectCreditBasedReq() argument
721 log::verbose("BDA: {} PSM: 0x{:04x}", p_bd_addr, psm); in L2CA_ConnectCreditBasedReq()
737 tL2C_RCB* p_rcb = l2cu_find_ble_rcb_by_psm(psm); in L2CA_ConnectCreditBasedReq()
739 log::warn("No BLE RCB, PSM: 0x{:04x}", psm); in L2CA_ConnectCreditBasedReq()
759 log::warn("There is ongoing connection request, PSM: 0x{:04x}", psm); in L2CA_ConnectCreditBasedReq()
772 tL2C_CCB* p_ccb = l2cu_allocate_ccb(p_lcb, 0, psm == BT_PSM_EATT /* is_eatt */); in L2CA_ConnectCreditBasedReq()
775 log::warn("no CCB, PSM: 0x{:04x}", psm); in L2CA_ConnectCreditBasedReq()
808 log::verbose("(psm: 0x{:04x}) returned CID: 0x{:04x}", psm, p_ccb_primary->local_cid); in L2CA_ConnectCreditBasedReq()