Loading system/bta/jv/bta_jv_act.cc +14 −14 Original line number Diff line number Diff line Loading @@ -174,33 +174,33 @@ static void bta_jv_free_sec_id(uint8_t* p_sec_id) { * or BTA_JV_L2CAP_REASON_UNKNOWN if reason isn't defined yet. * ******************************************************************************/ static tBTA_JV_L2CAP_REASON bta_jv_from_gap_l2cap_err(uint16_t l2cap_result) { static tBTA_JV_L2CAP_REASON bta_jv_from_gap_l2cap_err(const tL2CAP_CONN& l2cap_result) { switch (l2cap_result) { case L2CAP_CONN_ACL_CONNECTION_FAILED: case tL2CAP_CONN::L2CAP_CONN_ACL_CONNECTION_FAILED: return BTA_JV_L2CAP_REASON_ACL_FAILURE; case L2CAP_CONN_CLIENT_SECURITY_CLEARANCE_FAILED: case tL2CAP_CONN::L2CAP_CONN_CLIENT_SECURITY_CLEARANCE_FAILED: return BTA_JV_L2CAP_REASON_CL_SEC_FAILURE; case L2CAP_CONN_INSUFFICIENT_AUTHENTICATION: case tL2CAP_CONN::L2CAP_CONN_INSUFFICIENT_AUTHENTICATION: return BTA_JV_L2CAP_REASON_INSUFFICIENT_AUTHENTICATION; case L2CAP_CONN_INSUFFICIENT_AUTHORIZATION: case tL2CAP_CONN::L2CAP_CONN_INSUFFICIENT_AUTHORIZATION: return BTA_JV_L2CAP_REASON_INSUFFICIENT_AUTHORIZATION; case L2CAP_CONN_INSUFFICIENT_ENCRYP_KEY_SIZE: case tL2CAP_CONN::L2CAP_CONN_INSUFFICIENT_ENCRYP_KEY_SIZE: return BTA_JV_L2CAP_REASON_INSUFFICIENT_ENCRYP_KEY_SIZE; case L2CAP_CONN_INSUFFICIENT_ENCRYP: case tL2CAP_CONN::L2CAP_CONN_INSUFFICIENT_ENCRYP: return BTA_JV_L2CAP_REASON_INSUFFICIENT_ENCRYP; case L2CAP_CONN_INVALID_SOURCE_CID: case tL2CAP_CONN::L2CAP_CONN_INVALID_SOURCE_CID: return BTA_JV_L2CAP_REASON_INVALID_SOURCE_CID; case L2CAP_CONN_SOURCE_CID_ALREADY_ALLOCATED: case tL2CAP_CONN::L2CAP_CONN_SOURCE_CID_ALREADY_ALLOCATED: return BTA_JV_L2CAP_REASON_SOURCE_CID_ALREADY_ALLOCATED; case L2CAP_CONN_UNACCEPTABLE_PARAMETERS: case tL2CAP_CONN::L2CAP_CONN_UNACCEPTABLE_PARAMETERS: return BTA_JV_L2CAP_REASON_UNACCEPTABLE_PARAMETERS; case L2CAP_CONN_INVALID_PARAMETERS: case tL2CAP_CONN::L2CAP_CONN_INVALID_PARAMETERS: return BTA_JV_L2CAP_REASON_INVALID_PARAMETERS; case L2CAP_CONN_NO_RESOURCES: case tL2CAP_CONN::L2CAP_CONN_NO_RESOURCES: return BTA_JV_L2CAP_REASON_NO_RESOURCES; case L2CAP_CONN_NO_PSM: case tL2CAP_CONN::L2CAP_CONN_NO_PSM: return BTA_JV_L2CAP_REASON_NO_PSM; case L2CAP_CONN_TIMEOUT: case tL2CAP_CONN::L2CAP_CONN_TIMEOUT: return BTA_JV_L2CAP_REASON_TIMEOUT; default: return BTA_JV_L2CAP_REASON_UNKNOWN; Loading system/stack/avct/avct_l2c.cc +9 −10 Original line number Diff line number Diff line Loading @@ -32,7 +32,6 @@ #include "l2c_api.h" #include "l2cdefs.h" #include "osi/include/allocator.h" #include "osi/include/osi.h" #include "stack/include/bt_hdr.h" #include "types/raw_address.h" Loading @@ -40,7 +39,7 @@ using namespace bluetooth; /* callback function declarations */ void avct_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16_t psm, uint8_t id); void avct_l2c_connect_cfm_cback(uint16_t lcid, uint16_t result); void avct_l2c_connect_cfm_cback(uint16_t lcid, tL2CAP_CONN result); void avct_l2c_config_cfm_cback(uint16_t lcid, uint16_t result, tL2CAP_CFG_INFO* p_cfg); void avct_l2c_config_ind_cback(uint16_t lcid, tL2CAP_CFG_INFO* p_cfg); void avct_l2c_disconnect_ind_cback(uint16_t lcid, bool ack_needed); Loading Loading @@ -106,7 +105,7 @@ static bool avct_l2c_is_passive(tAVCT_LCB* p_lcb) { void avct_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16_t /* psm */, uint8_t /* id */) { tAVCT_LCB* p_lcb; uint16_t result = L2CAP_CONN_OK; tL2CAP_CONN result = tL2CAP_CONN::L2CAP_CONN_OK; /* do we already have a channel for this peer? */ p_lcb = avct_lcb_by_bd(bd_addr); Loading @@ -115,14 +114,14 @@ void avct_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16 p_lcb = avct_lcb_alloc(bd_addr); if (p_lcb == NULL) { /* no ccb available, reject L2CAP connection */ result = L2CAP_CONN_NO_RESOURCES; result = tL2CAP_CONN::L2CAP_CONN_NO_RESOURCES; } } /* else we already have a channel for this peer */ else { if (!avct_l2c_is_passive(p_lcb) || (p_lcb->ch_state == AVCT_CH_OPEN)) { /* this LCB included CT role - reject */ result = L2CAP_CONN_NO_RESOURCES; result = tL2CAP_CONN::L2CAP_CONN_NO_RESOURCES; } else { /* TG role only - accept the connection from CT. move the channel ID to * the conflict list */ Loading @@ -137,14 +136,14 @@ void avct_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16 } /* If we reject the connection, send DisconnectReq */ if (result != L2CAP_CONN_OK) { if (result != tL2CAP_CONN::L2CAP_CONN_OK) { if (!L2CA_DisconnectReq(lcid)) { log::warn("Unable to send L2CAP disconnect request peer:{} cid:{}", bd_addr, lcid); } } /* if result ok, proceed with connection */ if (result == L2CAP_CONN_OK) { if (result == tL2CAP_CONN::L2CAP_CONN_OK) { if (btif_av_src_sink_coexist_enabled()) { tAVCT_CCB* p_ccb = &avct_cb.ccb[0]; for (int i = 0; i < AVCT_NUM_CONN; i++, p_ccb++) { Loading Loading @@ -203,7 +202,7 @@ static void avct_on_l2cap_error(uint16_t lcid, uint16_t result) { * Returns void * ******************************************************************************/ void avct_l2c_connect_cfm_cback(uint16_t lcid, uint16_t result) { void avct_l2c_connect_cfm_cback(uint16_t lcid, tL2CAP_CONN result) { tAVCT_LCB* p_lcb; /* look up lcb for this channel */ Loading @@ -216,7 +215,7 @@ void avct_l2c_connect_cfm_cback(uint16_t lcid, uint16_t result) { /* if in correct state */ if (p_lcb->ch_state == AVCT_CH_CONN) { /* if result successful */ if (result == L2CAP_CONN_OK) { if (result == tL2CAP_CONN::L2CAP_CONN_OK) { /* set channel state */ p_lcb->ch_state = AVCT_CH_CFG; } Loading @@ -228,7 +227,7 @@ void avct_l2c_connect_cfm_cback(uint16_t lcid, uint16_t result) { /* we must be in AVCT_CH_CFG state for the ch_lcid channel */ log::verbose("avct_l2c_connect_cfm_cback ch_state: {}, conflict_lcid:0x{:x}", p_lcb->ch_state, p_lcb->conflict_lcid); if (result == L2CAP_CONN_OK) { if (result == tL2CAP_CONN::L2CAP_CONN_OK) { /* just in case the peer also accepts our connection - Send L2CAP * disconnect req */ if (!L2CA_DisconnectReq(lcid)) { Loading system/stack/avct/avct_l2c_br.cc +10 −11 Original line number Diff line number Diff line Loading @@ -34,7 +34,6 @@ #include "l2c_api.h" #include "l2cdefs.h" #include "osi/include/allocator.h" #include "osi/include/osi.h" #include "stack/include/bt_hdr.h" #include "types/raw_address.h" Loading @@ -43,7 +42,7 @@ using namespace bluetooth; /* callback function declarations */ void avct_l2c_br_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16_t psm, uint8_t id); void avct_l2c_br_connect_cfm_cback(uint16_t lcid, uint16_t result); void avct_l2c_br_connect_cfm_cback(uint16_t lcid, tL2CAP_CONN result); void avct_l2c_br_config_cfm_cback(uint16_t lcid, uint16_t result, tL2CAP_CFG_INFO* p_cfg); void avct_l2c_br_config_ind_cback(uint16_t lcid, tL2CAP_CFG_INFO* p_cfg); void avct_l2c_br_disconnect_ind_cback(uint16_t lcid, bool ack_needed); Loading Loading @@ -109,7 +108,7 @@ static bool avct_l2c_br_is_passive(tAVCT_BCB* p_bcb) { void avct_l2c_br_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16_t /* psm */, uint8_t /* id */) { tAVCT_LCB* p_lcb; uint16_t result = L2CAP_CONN_NO_RESOURCES; tL2CAP_CONN result = tL2CAP_CONN::L2CAP_CONN_NO_RESOURCES; tAVCT_BCB* p_bcb; tL2CAP_ERTM_INFO ertm_info; Loading @@ -125,15 +124,15 @@ void avct_l2c_br_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uin * - accept connection */ p_bcb->allocated = p_lcb->allocated; /* copy the index from lcb */ result = L2CAP_CONN_OK; result = tL2CAP_CONN::L2CAP_CONN_OK; } else { if (!avct_l2c_br_is_passive(p_bcb) || (p_bcb->ch_state == AVCT_CH_OPEN)) { /* this BCB included CT role - reject */ result = L2CAP_CONN_NO_RESOURCES; result = tL2CAP_CONN::L2CAP_CONN_NO_RESOURCES; } else { /* add channel ID to conflict ID */ p_bcb->conflict_lcid = p_bcb->ch_lcid; result = L2CAP_CONN_OK; result = tL2CAP_CONN::L2CAP_CONN_OK; log::verbose("Detected conflict_lcid:0x{:x}", p_bcb->conflict_lcid); } } Loading @@ -144,7 +143,7 @@ void avct_l2c_br_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uin ertm_info.preferred_mode = L2CAP_FCR_ERTM_MODE; /* If we reject the connection, send DisconnectReq */ if (result != L2CAP_CONN_OK) { if (result != tL2CAP_CONN::L2CAP_CONN_OK) { log::verbose("Connection rejected to lcid:0x{:x}", lcid); if (!L2CA_DisconnectReq(lcid)) { log::warn("Unable to send L2CAP disconnect request cid:{}", lcid); Loading @@ -152,7 +151,7 @@ void avct_l2c_br_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uin } /* if result ok, proceed with connection */ if (result == L2CAP_CONN_OK) { if (result == tL2CAP_CONN::L2CAP_CONN_OK) { /* store LCID */ p_bcb->ch_lcid = lcid; Loading Loading @@ -189,7 +188,7 @@ void avct_br_on_l2cap_error(uint16_t lcid, uint16_t result) { * Returns void * ******************************************************************************/ void avct_l2c_br_connect_cfm_cback(uint16_t lcid, uint16_t result) { void avct_l2c_br_connect_cfm_cback(uint16_t lcid, tL2CAP_CONN result) { tAVCT_BCB* p_bcb; /* look up bcb for this channel */ Loading @@ -201,7 +200,7 @@ void avct_l2c_br_connect_cfm_cback(uint16_t lcid, uint16_t result) { /* if in correct state */ if (p_bcb->ch_state == AVCT_CH_CONN) { /* if result successful */ if (result == L2CAP_CONN_OK) { if (result == tL2CAP_CONN::L2CAP_CONN_OK) { /* set channel state */ p_bcb->ch_state = AVCT_CH_CFG; } Loading @@ -211,7 +210,7 @@ void avct_l2c_br_connect_cfm_cback(uint16_t lcid, uint16_t result) { } } else if (p_bcb->conflict_lcid == lcid) { /* we must be in AVCT_CH_CFG state for the ch_lcid channel */ if (result == L2CAP_CONN_OK) { if (result == tL2CAP_CONN::L2CAP_CONN_OK) { /* just in case the peer also accepts our connection - Send L2CAP * disconnect req */ log::verbose("Disconnect conflict_lcid:0x{:x}", p_bcb->conflict_lcid); Loading system/stack/avdt/avdt_l2c.cc +14 −14 Original line number Diff line number Diff line Loading @@ -32,7 +32,6 @@ #include "l2c_api.h" #include "l2cdefs.h" #include "osi/include/allocator.h" #include "osi/include/osi.h" #include "stack/include/acl_api.h" #include "stack/include/bt_hdr.h" #include "stack/include/btm_status.h" Loading @@ -42,7 +41,7 @@ using namespace bluetooth; /* callback function declarations */ void avdt_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16_t psm, uint8_t id); void avdt_l2c_connect_cfm_cback(uint16_t lcid, uint16_t result); void avdt_l2c_connect_cfm_cback(uint16_t lcid, tL2CAP_CONN result); void avdt_l2c_config_cfm_cback(uint16_t lcid, uint16_t result, tL2CAP_CFG_INFO* p_cfg); void avdt_l2c_config_ind_cback(uint16_t lcid, tL2CAP_CFG_INFO* p_cfg); void avdt_l2c_disconnect_ind_cback(uint16_t lcid, bool ack_needed); Loading Loading @@ -142,7 +141,7 @@ void avdt_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16 uint8_t /* id */) { AvdtpCcb* p_ccb; AvdtpTransportChannel* p_tbl = NULL; uint16_t result; tL2CAP_CONN result; /* do we already have a control channel for this peer? */ p_ccb = avdt_ccb_by_bd(bd_addr); Loading @@ -157,7 +156,7 @@ void avdt_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16 } if (p_ccb == NULL) { /* no ccb available, reject L2CAP connection */ result = L2CAP_CONN_NO_RESOURCES; result = tL2CAP_CONN::L2CAP_CONN_NO_RESOURCES; } else { /* allocate and set up entry; first channel is always signaling */ p_tbl = avdt_ad_tc_tbl_alloc(p_ccb); Loading @@ -182,7 +181,7 @@ void avdt_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16 p_tbl = avdt_ad_tc_tbl_by_st(AVDT_CHAN_SIG, p_ccb, AVDT_AD_ST_CONN); if (p_tbl != NULL) { /* reject their connection */ result = L2CAP_CONN_NO_RESOURCES; result = tL2CAP_CONN::L2CAP_CONN_NO_RESOURCES; } else { /* This must be a traffic channel; are we accepting a traffic channel * for this ccb? Loading @@ -190,7 +189,7 @@ void avdt_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16 p_tbl = avdt_ad_tc_tbl_by_st(AVDT_CHAN_MEDIA, p_ccb, AVDT_AD_ST_ACP); if (p_tbl != NULL) { /* yes; proceed with connection */ result = L2CAP_CONN_OK; result = tL2CAP_CONN::L2CAP_CONN_OK; } else { /* this must be a reporting channel; are we accepting a reporting * channel for this ccb? Loading @@ -198,17 +197,17 @@ void avdt_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16 p_tbl = avdt_ad_tc_tbl_by_st(AVDT_CHAN_REPORT, p_ccb, AVDT_AD_ST_ACP); if (p_tbl != NULL) { /* yes; proceed with connection */ result = L2CAP_CONN_OK; result = tL2CAP_CONN::L2CAP_CONN_OK; } else { /* else we're not listening for traffic channel; reject */ result = L2CAP_CONN_NO_PSM; result = tL2CAP_CONN::L2CAP_CONN_NO_PSM; } } } } /* If we reject the connection, send DisconnectReq */ if (result != L2CAP_CONN_OK) { if (result != tL2CAP_CONN::L2CAP_CONN_OK) { if (!L2CA_DisconnectReq(lcid)) { log::warn("Unable to disconnect L2CAP cid:{}", lcid); } Loading Loading @@ -236,25 +235,26 @@ static void avdt_on_l2cap_error(uint16_t lcid, uint16_t /* result */) { avdt_l2c * Returns void * ******************************************************************************/ void avdt_l2c_connect_cfm_cback(uint16_t lcid, uint16_t result) { void avdt_l2c_connect_cfm_cback(uint16_t lcid, tL2CAP_CONN result) { AvdtpTransportChannel* p_tbl; AvdtpCcb* p_ccb; log::verbose("avdt_l2c_connect_cfm_cback lcid: {}, result: {}", lcid, result); log::verbose("avdt_l2c_connect_cfm_cback lcid: {}, result: {}", lcid, l2cap_result_code_text(result)); /* look up info for this channel */ p_tbl = avdt_ad_tc_tbl_by_lcid(lcid); if (p_tbl != NULL) { /* if in correct state */ if (p_tbl->state == AVDT_AD_ST_CONN) { /* if result successful */ if (result == L2CAP_CONN_OK) { if (result == tL2CAP_CONN::L2CAP_CONN_OK) { if (p_tbl->tcid != AVDT_CHAN_SIG) { /* set channel state */ p_tbl->state = AVDT_AD_ST_CFG; } else { p_ccb = avdt_ccb_by_idx(p_tbl->ccb_idx); if (p_ccb == NULL) { result = L2CAP_CONN_NO_RESOURCES; result = tL2CAP_CONN::L2CAP_CONN_NO_RESOURCES; } else { /* set channel state */ p_tbl->state = AVDT_AD_ST_SEC_INT; Loading @@ -277,7 +277,7 @@ void avdt_l2c_connect_cfm_cback(uint16_t lcid, uint16_t result) { } /* failure; notify adaption that channel closed */ if (result != L2CAP_CONN_OK) { if (result != tL2CAP_CONN::L2CAP_CONN_OK) { log::error("invoked with non OK status"); } } Loading system/stack/bnep/bnep_main.cc +3 −3 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ const uint16_t bnep_frame_hdr_sizes[] = {14, 1, 2, 8, 8}; /******************************************************************************/ static void bnep_connect_ind(const RawAddress& bd_addr, uint16_t l2cap_cid, uint16_t psm, uint8_t l2cap_id); static void bnep_connect_cfm(uint16_t l2cap_cid, uint16_t result); static void bnep_connect_cfm(uint16_t l2cap_cid, tL2CAP_CONN result); static void bnep_config_cfm(uint16_t l2cap_cid, uint16_t result, tL2CAP_CFG_INFO* p_cfg); static void bnep_disconnect_ind(uint16_t l2cap_cid, bool ack_needed); static void bnep_data_ind(uint16_t l2cap_cid, BT_HDR* p_msg); Loading Loading @@ -163,7 +163,7 @@ static void bnep_on_l2cap_error(uint16_t l2cap_cid, uint16_t /* result */) { * Returns void * ******************************************************************************/ static void bnep_connect_cfm(uint16_t l2cap_cid, uint16_t result) { static void bnep_connect_cfm(uint16_t l2cap_cid, tL2CAP_CONN result) { tBNEP_CONN* p_bcb; /* Find CCB based on CID */ Loading @@ -175,7 +175,7 @@ static void bnep_connect_cfm(uint16_t l2cap_cid, uint16_t result) { /* If the connection response contains success status, then */ /* Transition to the next state and startup the timer. */ if ((result == L2CAP_CONN_OK) && (p_bcb->con_state == BNEP_STATE_CONN_START)) { if ((result == tL2CAP_CONN::L2CAP_CONN_OK) && (p_bcb->con_state == BNEP_STATE_CONN_START)) { p_bcb->con_state = BNEP_STATE_CFG_SETUP; /* Start timer waiting for config results */ Loading Loading
system/bta/jv/bta_jv_act.cc +14 −14 Original line number Diff line number Diff line Loading @@ -174,33 +174,33 @@ static void bta_jv_free_sec_id(uint8_t* p_sec_id) { * or BTA_JV_L2CAP_REASON_UNKNOWN if reason isn't defined yet. * ******************************************************************************/ static tBTA_JV_L2CAP_REASON bta_jv_from_gap_l2cap_err(uint16_t l2cap_result) { static tBTA_JV_L2CAP_REASON bta_jv_from_gap_l2cap_err(const tL2CAP_CONN& l2cap_result) { switch (l2cap_result) { case L2CAP_CONN_ACL_CONNECTION_FAILED: case tL2CAP_CONN::L2CAP_CONN_ACL_CONNECTION_FAILED: return BTA_JV_L2CAP_REASON_ACL_FAILURE; case L2CAP_CONN_CLIENT_SECURITY_CLEARANCE_FAILED: case tL2CAP_CONN::L2CAP_CONN_CLIENT_SECURITY_CLEARANCE_FAILED: return BTA_JV_L2CAP_REASON_CL_SEC_FAILURE; case L2CAP_CONN_INSUFFICIENT_AUTHENTICATION: case tL2CAP_CONN::L2CAP_CONN_INSUFFICIENT_AUTHENTICATION: return BTA_JV_L2CAP_REASON_INSUFFICIENT_AUTHENTICATION; case L2CAP_CONN_INSUFFICIENT_AUTHORIZATION: case tL2CAP_CONN::L2CAP_CONN_INSUFFICIENT_AUTHORIZATION: return BTA_JV_L2CAP_REASON_INSUFFICIENT_AUTHORIZATION; case L2CAP_CONN_INSUFFICIENT_ENCRYP_KEY_SIZE: case tL2CAP_CONN::L2CAP_CONN_INSUFFICIENT_ENCRYP_KEY_SIZE: return BTA_JV_L2CAP_REASON_INSUFFICIENT_ENCRYP_KEY_SIZE; case L2CAP_CONN_INSUFFICIENT_ENCRYP: case tL2CAP_CONN::L2CAP_CONN_INSUFFICIENT_ENCRYP: return BTA_JV_L2CAP_REASON_INSUFFICIENT_ENCRYP; case L2CAP_CONN_INVALID_SOURCE_CID: case tL2CAP_CONN::L2CAP_CONN_INVALID_SOURCE_CID: return BTA_JV_L2CAP_REASON_INVALID_SOURCE_CID; case L2CAP_CONN_SOURCE_CID_ALREADY_ALLOCATED: case tL2CAP_CONN::L2CAP_CONN_SOURCE_CID_ALREADY_ALLOCATED: return BTA_JV_L2CAP_REASON_SOURCE_CID_ALREADY_ALLOCATED; case L2CAP_CONN_UNACCEPTABLE_PARAMETERS: case tL2CAP_CONN::L2CAP_CONN_UNACCEPTABLE_PARAMETERS: return BTA_JV_L2CAP_REASON_UNACCEPTABLE_PARAMETERS; case L2CAP_CONN_INVALID_PARAMETERS: case tL2CAP_CONN::L2CAP_CONN_INVALID_PARAMETERS: return BTA_JV_L2CAP_REASON_INVALID_PARAMETERS; case L2CAP_CONN_NO_RESOURCES: case tL2CAP_CONN::L2CAP_CONN_NO_RESOURCES: return BTA_JV_L2CAP_REASON_NO_RESOURCES; case L2CAP_CONN_NO_PSM: case tL2CAP_CONN::L2CAP_CONN_NO_PSM: return BTA_JV_L2CAP_REASON_NO_PSM; case L2CAP_CONN_TIMEOUT: case tL2CAP_CONN::L2CAP_CONN_TIMEOUT: return BTA_JV_L2CAP_REASON_TIMEOUT; default: return BTA_JV_L2CAP_REASON_UNKNOWN; Loading
system/stack/avct/avct_l2c.cc +9 −10 Original line number Diff line number Diff line Loading @@ -32,7 +32,6 @@ #include "l2c_api.h" #include "l2cdefs.h" #include "osi/include/allocator.h" #include "osi/include/osi.h" #include "stack/include/bt_hdr.h" #include "types/raw_address.h" Loading @@ -40,7 +39,7 @@ using namespace bluetooth; /* callback function declarations */ void avct_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16_t psm, uint8_t id); void avct_l2c_connect_cfm_cback(uint16_t lcid, uint16_t result); void avct_l2c_connect_cfm_cback(uint16_t lcid, tL2CAP_CONN result); void avct_l2c_config_cfm_cback(uint16_t lcid, uint16_t result, tL2CAP_CFG_INFO* p_cfg); void avct_l2c_config_ind_cback(uint16_t lcid, tL2CAP_CFG_INFO* p_cfg); void avct_l2c_disconnect_ind_cback(uint16_t lcid, bool ack_needed); Loading Loading @@ -106,7 +105,7 @@ static bool avct_l2c_is_passive(tAVCT_LCB* p_lcb) { void avct_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16_t /* psm */, uint8_t /* id */) { tAVCT_LCB* p_lcb; uint16_t result = L2CAP_CONN_OK; tL2CAP_CONN result = tL2CAP_CONN::L2CAP_CONN_OK; /* do we already have a channel for this peer? */ p_lcb = avct_lcb_by_bd(bd_addr); Loading @@ -115,14 +114,14 @@ void avct_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16 p_lcb = avct_lcb_alloc(bd_addr); if (p_lcb == NULL) { /* no ccb available, reject L2CAP connection */ result = L2CAP_CONN_NO_RESOURCES; result = tL2CAP_CONN::L2CAP_CONN_NO_RESOURCES; } } /* else we already have a channel for this peer */ else { if (!avct_l2c_is_passive(p_lcb) || (p_lcb->ch_state == AVCT_CH_OPEN)) { /* this LCB included CT role - reject */ result = L2CAP_CONN_NO_RESOURCES; result = tL2CAP_CONN::L2CAP_CONN_NO_RESOURCES; } else { /* TG role only - accept the connection from CT. move the channel ID to * the conflict list */ Loading @@ -137,14 +136,14 @@ void avct_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16 } /* If we reject the connection, send DisconnectReq */ if (result != L2CAP_CONN_OK) { if (result != tL2CAP_CONN::L2CAP_CONN_OK) { if (!L2CA_DisconnectReq(lcid)) { log::warn("Unable to send L2CAP disconnect request peer:{} cid:{}", bd_addr, lcid); } } /* if result ok, proceed with connection */ if (result == L2CAP_CONN_OK) { if (result == tL2CAP_CONN::L2CAP_CONN_OK) { if (btif_av_src_sink_coexist_enabled()) { tAVCT_CCB* p_ccb = &avct_cb.ccb[0]; for (int i = 0; i < AVCT_NUM_CONN; i++, p_ccb++) { Loading Loading @@ -203,7 +202,7 @@ static void avct_on_l2cap_error(uint16_t lcid, uint16_t result) { * Returns void * ******************************************************************************/ void avct_l2c_connect_cfm_cback(uint16_t lcid, uint16_t result) { void avct_l2c_connect_cfm_cback(uint16_t lcid, tL2CAP_CONN result) { tAVCT_LCB* p_lcb; /* look up lcb for this channel */ Loading @@ -216,7 +215,7 @@ void avct_l2c_connect_cfm_cback(uint16_t lcid, uint16_t result) { /* if in correct state */ if (p_lcb->ch_state == AVCT_CH_CONN) { /* if result successful */ if (result == L2CAP_CONN_OK) { if (result == tL2CAP_CONN::L2CAP_CONN_OK) { /* set channel state */ p_lcb->ch_state = AVCT_CH_CFG; } Loading @@ -228,7 +227,7 @@ void avct_l2c_connect_cfm_cback(uint16_t lcid, uint16_t result) { /* we must be in AVCT_CH_CFG state for the ch_lcid channel */ log::verbose("avct_l2c_connect_cfm_cback ch_state: {}, conflict_lcid:0x{:x}", p_lcb->ch_state, p_lcb->conflict_lcid); if (result == L2CAP_CONN_OK) { if (result == tL2CAP_CONN::L2CAP_CONN_OK) { /* just in case the peer also accepts our connection - Send L2CAP * disconnect req */ if (!L2CA_DisconnectReq(lcid)) { Loading
system/stack/avct/avct_l2c_br.cc +10 −11 Original line number Diff line number Diff line Loading @@ -34,7 +34,6 @@ #include "l2c_api.h" #include "l2cdefs.h" #include "osi/include/allocator.h" #include "osi/include/osi.h" #include "stack/include/bt_hdr.h" #include "types/raw_address.h" Loading @@ -43,7 +42,7 @@ using namespace bluetooth; /* callback function declarations */ void avct_l2c_br_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16_t psm, uint8_t id); void avct_l2c_br_connect_cfm_cback(uint16_t lcid, uint16_t result); void avct_l2c_br_connect_cfm_cback(uint16_t lcid, tL2CAP_CONN result); void avct_l2c_br_config_cfm_cback(uint16_t lcid, uint16_t result, tL2CAP_CFG_INFO* p_cfg); void avct_l2c_br_config_ind_cback(uint16_t lcid, tL2CAP_CFG_INFO* p_cfg); void avct_l2c_br_disconnect_ind_cback(uint16_t lcid, bool ack_needed); Loading Loading @@ -109,7 +108,7 @@ static bool avct_l2c_br_is_passive(tAVCT_BCB* p_bcb) { void avct_l2c_br_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16_t /* psm */, uint8_t /* id */) { tAVCT_LCB* p_lcb; uint16_t result = L2CAP_CONN_NO_RESOURCES; tL2CAP_CONN result = tL2CAP_CONN::L2CAP_CONN_NO_RESOURCES; tAVCT_BCB* p_bcb; tL2CAP_ERTM_INFO ertm_info; Loading @@ -125,15 +124,15 @@ void avct_l2c_br_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uin * - accept connection */ p_bcb->allocated = p_lcb->allocated; /* copy the index from lcb */ result = L2CAP_CONN_OK; result = tL2CAP_CONN::L2CAP_CONN_OK; } else { if (!avct_l2c_br_is_passive(p_bcb) || (p_bcb->ch_state == AVCT_CH_OPEN)) { /* this BCB included CT role - reject */ result = L2CAP_CONN_NO_RESOURCES; result = tL2CAP_CONN::L2CAP_CONN_NO_RESOURCES; } else { /* add channel ID to conflict ID */ p_bcb->conflict_lcid = p_bcb->ch_lcid; result = L2CAP_CONN_OK; result = tL2CAP_CONN::L2CAP_CONN_OK; log::verbose("Detected conflict_lcid:0x{:x}", p_bcb->conflict_lcid); } } Loading @@ -144,7 +143,7 @@ void avct_l2c_br_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uin ertm_info.preferred_mode = L2CAP_FCR_ERTM_MODE; /* If we reject the connection, send DisconnectReq */ if (result != L2CAP_CONN_OK) { if (result != tL2CAP_CONN::L2CAP_CONN_OK) { log::verbose("Connection rejected to lcid:0x{:x}", lcid); if (!L2CA_DisconnectReq(lcid)) { log::warn("Unable to send L2CAP disconnect request cid:{}", lcid); Loading @@ -152,7 +151,7 @@ void avct_l2c_br_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uin } /* if result ok, proceed with connection */ if (result == L2CAP_CONN_OK) { if (result == tL2CAP_CONN::L2CAP_CONN_OK) { /* store LCID */ p_bcb->ch_lcid = lcid; Loading Loading @@ -189,7 +188,7 @@ void avct_br_on_l2cap_error(uint16_t lcid, uint16_t result) { * Returns void * ******************************************************************************/ void avct_l2c_br_connect_cfm_cback(uint16_t lcid, uint16_t result) { void avct_l2c_br_connect_cfm_cback(uint16_t lcid, tL2CAP_CONN result) { tAVCT_BCB* p_bcb; /* look up bcb for this channel */ Loading @@ -201,7 +200,7 @@ void avct_l2c_br_connect_cfm_cback(uint16_t lcid, uint16_t result) { /* if in correct state */ if (p_bcb->ch_state == AVCT_CH_CONN) { /* if result successful */ if (result == L2CAP_CONN_OK) { if (result == tL2CAP_CONN::L2CAP_CONN_OK) { /* set channel state */ p_bcb->ch_state = AVCT_CH_CFG; } Loading @@ -211,7 +210,7 @@ void avct_l2c_br_connect_cfm_cback(uint16_t lcid, uint16_t result) { } } else if (p_bcb->conflict_lcid == lcid) { /* we must be in AVCT_CH_CFG state for the ch_lcid channel */ if (result == L2CAP_CONN_OK) { if (result == tL2CAP_CONN::L2CAP_CONN_OK) { /* just in case the peer also accepts our connection - Send L2CAP * disconnect req */ log::verbose("Disconnect conflict_lcid:0x{:x}", p_bcb->conflict_lcid); Loading
system/stack/avdt/avdt_l2c.cc +14 −14 Original line number Diff line number Diff line Loading @@ -32,7 +32,6 @@ #include "l2c_api.h" #include "l2cdefs.h" #include "osi/include/allocator.h" #include "osi/include/osi.h" #include "stack/include/acl_api.h" #include "stack/include/bt_hdr.h" #include "stack/include/btm_status.h" Loading @@ -42,7 +41,7 @@ using namespace bluetooth; /* callback function declarations */ void avdt_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16_t psm, uint8_t id); void avdt_l2c_connect_cfm_cback(uint16_t lcid, uint16_t result); void avdt_l2c_connect_cfm_cback(uint16_t lcid, tL2CAP_CONN result); void avdt_l2c_config_cfm_cback(uint16_t lcid, uint16_t result, tL2CAP_CFG_INFO* p_cfg); void avdt_l2c_config_ind_cback(uint16_t lcid, tL2CAP_CFG_INFO* p_cfg); void avdt_l2c_disconnect_ind_cback(uint16_t lcid, bool ack_needed); Loading Loading @@ -142,7 +141,7 @@ void avdt_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16 uint8_t /* id */) { AvdtpCcb* p_ccb; AvdtpTransportChannel* p_tbl = NULL; uint16_t result; tL2CAP_CONN result; /* do we already have a control channel for this peer? */ p_ccb = avdt_ccb_by_bd(bd_addr); Loading @@ -157,7 +156,7 @@ void avdt_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16 } if (p_ccb == NULL) { /* no ccb available, reject L2CAP connection */ result = L2CAP_CONN_NO_RESOURCES; result = tL2CAP_CONN::L2CAP_CONN_NO_RESOURCES; } else { /* allocate and set up entry; first channel is always signaling */ p_tbl = avdt_ad_tc_tbl_alloc(p_ccb); Loading @@ -182,7 +181,7 @@ void avdt_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16 p_tbl = avdt_ad_tc_tbl_by_st(AVDT_CHAN_SIG, p_ccb, AVDT_AD_ST_CONN); if (p_tbl != NULL) { /* reject their connection */ result = L2CAP_CONN_NO_RESOURCES; result = tL2CAP_CONN::L2CAP_CONN_NO_RESOURCES; } else { /* This must be a traffic channel; are we accepting a traffic channel * for this ccb? Loading @@ -190,7 +189,7 @@ void avdt_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16 p_tbl = avdt_ad_tc_tbl_by_st(AVDT_CHAN_MEDIA, p_ccb, AVDT_AD_ST_ACP); if (p_tbl != NULL) { /* yes; proceed with connection */ result = L2CAP_CONN_OK; result = tL2CAP_CONN::L2CAP_CONN_OK; } else { /* this must be a reporting channel; are we accepting a reporting * channel for this ccb? Loading @@ -198,17 +197,17 @@ void avdt_l2c_connect_ind_cback(const RawAddress& bd_addr, uint16_t lcid, uint16 p_tbl = avdt_ad_tc_tbl_by_st(AVDT_CHAN_REPORT, p_ccb, AVDT_AD_ST_ACP); if (p_tbl != NULL) { /* yes; proceed with connection */ result = L2CAP_CONN_OK; result = tL2CAP_CONN::L2CAP_CONN_OK; } else { /* else we're not listening for traffic channel; reject */ result = L2CAP_CONN_NO_PSM; result = tL2CAP_CONN::L2CAP_CONN_NO_PSM; } } } } /* If we reject the connection, send DisconnectReq */ if (result != L2CAP_CONN_OK) { if (result != tL2CAP_CONN::L2CAP_CONN_OK) { if (!L2CA_DisconnectReq(lcid)) { log::warn("Unable to disconnect L2CAP cid:{}", lcid); } Loading Loading @@ -236,25 +235,26 @@ static void avdt_on_l2cap_error(uint16_t lcid, uint16_t /* result */) { avdt_l2c * Returns void * ******************************************************************************/ void avdt_l2c_connect_cfm_cback(uint16_t lcid, uint16_t result) { void avdt_l2c_connect_cfm_cback(uint16_t lcid, tL2CAP_CONN result) { AvdtpTransportChannel* p_tbl; AvdtpCcb* p_ccb; log::verbose("avdt_l2c_connect_cfm_cback lcid: {}, result: {}", lcid, result); log::verbose("avdt_l2c_connect_cfm_cback lcid: {}, result: {}", lcid, l2cap_result_code_text(result)); /* look up info for this channel */ p_tbl = avdt_ad_tc_tbl_by_lcid(lcid); if (p_tbl != NULL) { /* if in correct state */ if (p_tbl->state == AVDT_AD_ST_CONN) { /* if result successful */ if (result == L2CAP_CONN_OK) { if (result == tL2CAP_CONN::L2CAP_CONN_OK) { if (p_tbl->tcid != AVDT_CHAN_SIG) { /* set channel state */ p_tbl->state = AVDT_AD_ST_CFG; } else { p_ccb = avdt_ccb_by_idx(p_tbl->ccb_idx); if (p_ccb == NULL) { result = L2CAP_CONN_NO_RESOURCES; result = tL2CAP_CONN::L2CAP_CONN_NO_RESOURCES; } else { /* set channel state */ p_tbl->state = AVDT_AD_ST_SEC_INT; Loading @@ -277,7 +277,7 @@ void avdt_l2c_connect_cfm_cback(uint16_t lcid, uint16_t result) { } /* failure; notify adaption that channel closed */ if (result != L2CAP_CONN_OK) { if (result != tL2CAP_CONN::L2CAP_CONN_OK) { log::error("invoked with non OK status"); } } Loading
system/stack/bnep/bnep_main.cc +3 −3 Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ const uint16_t bnep_frame_hdr_sizes[] = {14, 1, 2, 8, 8}; /******************************************************************************/ static void bnep_connect_ind(const RawAddress& bd_addr, uint16_t l2cap_cid, uint16_t psm, uint8_t l2cap_id); static void bnep_connect_cfm(uint16_t l2cap_cid, uint16_t result); static void bnep_connect_cfm(uint16_t l2cap_cid, tL2CAP_CONN result); static void bnep_config_cfm(uint16_t l2cap_cid, uint16_t result, tL2CAP_CFG_INFO* p_cfg); static void bnep_disconnect_ind(uint16_t l2cap_cid, bool ack_needed); static void bnep_data_ind(uint16_t l2cap_cid, BT_HDR* p_msg); Loading Loading @@ -163,7 +163,7 @@ static void bnep_on_l2cap_error(uint16_t l2cap_cid, uint16_t /* result */) { * Returns void * ******************************************************************************/ static void bnep_connect_cfm(uint16_t l2cap_cid, uint16_t result) { static void bnep_connect_cfm(uint16_t l2cap_cid, tL2CAP_CONN result) { tBNEP_CONN* p_bcb; /* Find CCB based on CID */ Loading @@ -175,7 +175,7 @@ static void bnep_connect_cfm(uint16_t l2cap_cid, uint16_t result) { /* If the connection response contains success status, then */ /* Transition to the next state and startup the timer. */ if ((result == L2CAP_CONN_OK) && (p_bcb->con_state == BNEP_STATE_CONN_START)) { if ((result == tL2CAP_CONN::L2CAP_CONN_OK) && (p_bcb->con_state == BNEP_STATE_CONN_START)) { p_bcb->con_state = BNEP_STATE_CFG_SETUP; /* Start timer waiting for config results */ Loading