do_in_main_thread(
FROM_HERE,
base::Bind(classic_.Callbacks(CidToPsm(cid)).pL2CA_ConfigCfm_Cb, cid,
- base::Unretained(&cfg_info)));
+ L2CAP_CFG_OK));
});
return true;
}
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_config_cfm_cback(uint16_t lcid, tL2CAP_CFG_INFO* p_cfg);
+void avct_l2c_config_cfm_cback(uint16_t lcid, uint16_t result);
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);
void avct_l2c_congestion_ind_cback(uint16_t lcid, bool is_congested);
* Returns void
*
******************************************************************************/
-void avct_l2c_config_cfm_cback(uint16_t lcid, tL2CAP_CFG_INFO* p_cfg) {
+void avct_l2c_config_cfm_cback(uint16_t lcid, uint16_t result) {
tAVCT_LCB* p_lcb;
/* look up lcb for this channel */
p_lcb = avct_lcb_by_lcid(lcid);
if (p_lcb != NULL) {
AVCT_TRACE_DEBUG("avct_l2c_config_cfm_cback: 0x%x, ch_state: %d, res: %d",
- lcid, p_lcb->ch_state, p_cfg->result);
+ lcid, p_lcb->ch_state, result);
/* if in correct state */
if (p_lcb->ch_state == AVCT_CH_CFG) {
/* if result successful */
- if (p_cfg->result == L2CAP_CFG_OK) {
+ if (result == L2CAP_CFG_OK) {
/* update flags */
p_lcb->ch_flags |= AVCT_L2C_CFG_CFM_DONE;
"ERROR avct_l2c_config_cfm_cback L2CA_DisconnectReq %d ",
p_lcb->ch_state);
/* store result value */
- p_lcb->ch_result = p_cfg->result;
+ p_lcb->ch_result = result;
/* Send L2CAP disconnect req */
L2CA_DisconnectReq(lcid);
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_config_cfm_cback(uint16_t lcid, tL2CAP_CFG_INFO* p_cfg);
+void avct_l2c_br_config_cfm_cback(uint16_t lcid, uint16_t result);
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);
void avct_l2c_br_congestion_ind_cback(uint16_t lcid, bool is_congested);
* Returns void
*
******************************************************************************/
-void avct_l2c_br_config_cfm_cback(uint16_t lcid, tL2CAP_CFG_INFO* p_cfg) {
+void avct_l2c_br_config_cfm_cback(uint16_t lcid, uint16_t result) {
tAVCT_BCB* p_lcb;
/* look up lcb for this channel */
if ((p_lcb == NULL) || (p_lcb->ch_state != AVCT_CH_CFG)) return;
/* if result successful */
- if (p_cfg->result == L2CAP_CFG_OK) {
+ if (result == L2CAP_CFG_OK) {
/* update flags */
p_lcb->ch_flags |= AVCT_L2C_CFG_CFM_DONE;
/* else failure */
else {
/* store result value */
- p_lcb->ch_result = p_cfg->result;
+ p_lcb->ch_result = result;
/* Send L2CAP disconnect req */
avct_l2c_br_disconnect(lcid, 0);
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_config_cfm_cback(uint16_t lcid, tL2CAP_CFG_INFO* p_cfg);
+void avdt_l2c_config_cfm_cback(uint16_t lcid, uint16_t result);
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);
void avdt_l2c_congestion_ind_cback(uint16_t lcid, bool is_congested);
* Returns void
*
******************************************************************************/
-void avdt_l2c_config_cfm_cback(uint16_t lcid, tL2CAP_CFG_INFO* p_cfg) {
+void avdt_l2c_config_cfm_cback(uint16_t lcid, uint16_t result) {
AvdtpTransportChannel* p_tbl;
AVDT_TRACE_DEBUG("%s: lcid: %d", __func__, lcid);
/* if in correct state */
if (p_tbl->state == AVDT_AD_ST_CFG) {
/* if result successful */
- if (p_cfg->result == L2CAP_CONN_OK) {
+ if (result == L2CAP_CONN_OK) {
/* update cfg_flags */
p_tbl->cfg_flags |= AVDT_L2C_CFG_CFM_DONE;
uint16_t psm, uint8_t l2cap_id);
static void bnep_connect_cfm(uint16_t l2cap_cid, uint16_t result);
static void bnep_config_ind(uint16_t l2cap_cid, tL2CAP_CFG_INFO* p_cfg);
-static void bnep_config_cfm(uint16_t l2cap_cid, tL2CAP_CFG_INFO* p_cfg);
+static void bnep_config_cfm(uint16_t l2cap_cid, uint16_t result);
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);
static void bnep_congestion_ind(uint16_t lcid, bool is_congested);
* Returns void
*
******************************************************************************/
-static void bnep_config_cfm(uint16_t l2cap_cid, tL2CAP_CFG_INFO* p_cfg) {
+static void bnep_config_cfm(uint16_t l2cap_cid, uint16_t result) {
tBNEP_CONN* p_bcb;
BNEP_TRACE_EVENT("BNEP - Rcvd cfg cfm, CID: 0x%x Result: %d", l2cap_cid,
- p_cfg->result);
+ result);
/* Find CCB based on CID */
p_bcb = bnepu_find_bcb_by_cid(l2cap_cid);
}
/* For now, always accept configuration from the other side */
- if (p_cfg->result == L2CAP_CFG_OK) {
+ if (result == L2CAP_CFG_OK) {
p_bcb->con_flags |= BNEP_FLAGS_MY_CFG_DONE;
if (p_bcb->con_flags & BNEP_FLAGS_HIS_CFG_DONE) {
uint16_t psm, uint8_t l2cap_id);
static void gap_connect_cfm(uint16_t l2cap_cid, uint16_t result);
static void gap_config_ind(uint16_t l2cap_cid, tL2CAP_CFG_INFO* p_cfg);
-static void gap_config_cfm(uint16_t l2cap_cid, tL2CAP_CFG_INFO* p_cfg);
+static void gap_config_cfm(uint16_t l2cap_cid, uint16_t result);
static void gap_disconnect_ind(uint16_t l2cap_cid, bool ack_needed);
static void gap_data_ind(uint16_t l2cap_cid, BT_HDR* p_msg);
static void gap_congestion_ind(uint16_t lcid, bool is_congested);
* Returns void
*
******************************************************************************/
-static void gap_config_cfm(uint16_t l2cap_cid, tL2CAP_CFG_INFO* p_cfg) {
+static void gap_config_cfm(uint16_t l2cap_cid, uint16_t result) {
tGAP_CCB* p_ccb;
/* Find CCB based on CID */
p_ccb = gap_find_ccb_by_cid(l2cap_cid);
if (p_ccb == NULL) return;
- if (p_cfg->result == L2CAP_CFG_OK) {
+ if (result == L2CAP_CFG_OK) {
p_ccb->con_flags |= GAP_CCB_FLAGS_MY_CFG_DONE;
- if (p_ccb->cfg.fcr_present)
- p_ccb->cfg.fcr.mode = p_cfg->fcr.mode;
- else
- p_ccb->cfg.fcr.mode = L2CAP_FCR_BASIC_MODE;
-
gap_checks_con_flags(p_ccb);
} else {
p_ccb->p_callback(p_ccb->gap_handle, GAP_EVT_CONN_CLOSED, nullptr);
static void gatt_l2cif_connect_cfm_cback(uint16_t l2cap_cid, uint16_t result);
static void gatt_l2cif_config_ind_cback(uint16_t l2cap_cid,
tL2CAP_CFG_INFO* p_cfg);
-static void gatt_l2cif_config_cfm_cback(uint16_t l2cap_cid,
- tL2CAP_CFG_INFO* p_cfg);
+static void gatt_l2cif_config_cfm_cback(uint16_t lcid, uint16_t result);
static void gatt_l2cif_disconnect_ind_cback(uint16_t l2cap_cid,
bool ack_needed);
static void gatt_l2cif_disconnect(uint16_t l2cap_cid);
}
/** This is the L2CAP config confirm callback function */
-void gatt_l2cif_config_cfm_cback(uint16_t lcid, tL2CAP_CFG_INFO* p_cfg) {
-
+void gatt_l2cif_config_cfm_cback(uint16_t lcid, uint16_t result) {
/* look up clcb for this channel */
tGATT_TCB* p_tcb = gatt_find_tcb_by_cid(lcid);
if (!p_tcb) return;
if (gatt_get_ch_state(p_tcb) != GATT_CH_CFG) return;
/* if result not successful */
- if (p_cfg->result != L2CAP_CFG_OK) {
+ if (result != L2CAP_CFG_OK) {
/* Send L2CAP disconnect req */
gatt_l2cif_disconnect(lcid);
return;
uint16_t psm, uint8_t id);
static void hidd_l2cif_connect_cfm(uint16_t cid, uint16_t result);
static void hidd_l2cif_config_ind(uint16_t cid, tL2CAP_CFG_INFO* p_cfg);
-static void hidd_l2cif_config_cfm(uint16_t cid, tL2CAP_CFG_INFO* p_cfg);
+static void hidd_l2cif_config_cfm(uint16_t cid, uint16_t result);
static void hidd_l2cif_disconnect_ind(uint16_t cid, bool ack_needed);
static void hidd_l2cif_disconnect(uint16_t cid);
static void hidd_l2cif_data_ind(uint16_t cid, BT_HDR* p_msg);
* Returns void
*
******************************************************************************/
-static void hidd_l2cif_config_cfm(uint16_t cid, tL2CAP_CFG_INFO* p_cfg) {
+static void hidd_l2cif_config_cfm(uint16_t cid, uint16_t result) {
tHID_CONN* p_hcon;
uint32_t reason;
- HIDD_TRACE_EVENT("%s: cid=%04x pcfg->result=%d", __func__, cid,
- p_cfg->result);
+ HIDD_TRACE_EVENT("%s: cid=%04x pcfg->result=%d", __func__, cid, result);
p_hcon = &hd_cb.device.conn;
return;
}
- if (p_cfg->result != L2CAP_CFG_OK) {
+ if (result != L2CAP_CFG_OK) {
HIDD_TRACE_WARNING("%s: config failed, disconnecting", __func__);
hidd_conn_disconnect();
- reason = HID_L2CAP_CFG_FAIL | (uint32_t)p_cfg->result;
+ reason = HID_L2CAP_CFG_FAIL | (uint32_t)result;
hd_cb.callback(hd_cb.device.addr, HID_DHOST_EVT_CLOSE, reason, NULL);
return;
uint8_t l2cap_id);
static void hidh_l2cif_connect_cfm(uint16_t l2cap_cid, uint16_t result);
static void hidh_l2cif_config_ind(uint16_t l2cap_cid, tL2CAP_CFG_INFO* p_cfg);
-static void hidh_l2cif_config_cfm(uint16_t l2cap_cid, tL2CAP_CFG_INFO* p_cfg);
+static void hidh_l2cif_config_cfm(uint16_t l2cap_cid, uint16_t result);
static void hidh_l2cif_disconnect_ind(uint16_t l2cap_cid, bool ack_needed);
static void hidh_l2cif_data_ind(uint16_t l2cap_cid, BT_HDR* p_msg);
static void hidh_l2cif_disconnect(uint16_t l2cap_cid);
* Returns void
*
******************************************************************************/
-static void hidh_l2cif_config_cfm(uint16_t l2cap_cid, tL2CAP_CFG_INFO* p_cfg) {
+static void hidh_l2cif_config_cfm(uint16_t l2cap_cid, uint16_t result) {
uint8_t dhandle;
tHID_CONN* p_hcon = NULL;
uint32_t reason;
HIDH_TRACE_EVENT("HID-Host Rcvd cfg cfm, CID: 0x%x Result: %d", l2cap_cid,
- p_cfg->result);
+ result);
/* Find CCB based on CID */
dhandle = find_conn_by_cid(l2cap_cid);
}
/* If configuration failed, disconnect the channel(s) */
- if (p_cfg->result != L2CAP_CFG_OK) {
+ if (result != L2CAP_CFG_OK) {
hidh_conn_disconnect(dhandle);
- reason = HID_L2CAP_CFG_FAIL | (uint32_t)p_cfg->result;
+ reason = HID_L2CAP_CFG_FAIL | (uint32_t)result;
hh_cb.callback(dhandle, hh_cb.devices[dhandle].addr, HID_HDEV_EVT_CLOSE,
reason, NULL);
return;
/* Configuration confirm callback prototype. Parameters are
* Local CID assigned to the connection
- * Pointer to configuration info
+ * Config result (L2CA_CONN_OK, ...)
*/
-typedef void(tL2CA_CONFIG_CFM_CB)(uint16_t, tL2CAP_CFG_INFO*);
+typedef void(tL2CA_CONFIG_CFM_CB)(uint16_t, uint16_t);
/* Disconnect indication callback prototype. Parameters are
* Local CID
L2CAP_TRACE_API("L2CAP - Calling Config_Rsp_Cb(), CID: 0x%04x",
p_ccb->local_cid);
- (*p_ccb->p_rcb->api.pL2CA_ConfigCfm_Cb)(p_ccb->local_cid, p_cfg);
+ (*p_ccb->p_rcb->api.pL2CA_ConfigCfm_Cb)(p_ccb->local_cid, p_cfg->result);
break;
case L2CEVT_L2CAP_CONFIG_RSP_NEG: /* Peer config error rsp */
L2CAP_TRACE_API(
"L2CAP - Calling Config_Rsp_Cb(), CID: 0x%04x, Failure: %d",
p_ccb->local_cid, p_cfg->result);
- (*p_ccb->p_rcb->api.pL2CA_ConfigCfm_Cb)(p_ccb->local_cid, p_cfg);
+ (*p_ccb->p_rcb->api.pL2CA_ConfigCfm_Cb)(p_ccb->local_cid,
+ p_cfg->result);
}
break;
uint16_t psm, uint8_t id);
static void RFCOMM_ConnectCnf(uint16_t lcid, uint16_t err);
static void RFCOMM_ConfigInd(uint16_t lcid, tL2CAP_CFG_INFO* p_cfg);
-static void RFCOMM_ConfigCnf(uint16_t lcid, tL2CAP_CFG_INFO* p_cfg);
+static void RFCOMM_ConfigCnf(uint16_t lcid, uint16_t result);
static void RFCOMM_DisconnectInd(uint16_t lcid, bool is_clear);
static void RFCOMM_BufDataInd(uint16_t lcid, BT_HDR* p_buf);
static void RFCOMM_CongestionStatusInd(uint16_t lcid, bool is_congested);
* event to the FSM.
*
******************************************************************************/
-void RFCOMM_ConfigCnf(uint16_t lcid, tL2CAP_CFG_INFO* p_cfg) {
+void RFCOMM_ConfigCnf(uint16_t lcid, uint16_t result) {
tRFC_MCB* p_mcb = rfc_find_lcid_mcb(lcid);
if (!p_mcb) {
RFCOMM_TRACE_ERROR("RFCOMM_ConfigCnf no MCB LCID:0x%x", lcid);
return;
}
-
- rfc_mx_sm_execute(p_mcb, RFC_MX_EVENT_CONF_CNF, (void*)p_cfg);
+ uintptr_t result_as_ptr = result;
+ rfc_mx_sm_execute(p_mcb, RFC_MX_EVENT_CONF_CNF, (void*)result_as_ptr);
}
/*******************************************************************************
static void rfc_mx_send_config_req(tRFC_MCB* p_mcb);
static void rfc_mx_conf_ind(tRFC_MCB* p_mcb, tL2CAP_CFG_INFO* p_cfg);
-static void rfc_mx_conf_cnf(tRFC_MCB* p_mcb, tL2CAP_CFG_INFO* p_cfg);
+static void rfc_mx_conf_cnf(tRFC_MCB* p_mcb, uint16_t result);
/*******************************************************************************
*
return;
case RFC_MX_EVENT_CONF_CNF:
- rfc_mx_conf_cnf(p_mcb, (tL2CAP_CFG_INFO*)p_data);
+ rfc_mx_conf_cnf(p_mcb, (uintptr_t)p_data);
return;
case RFC_MX_EVENT_DISC_IND:
* on DLCI 0. T1 is still running.
*
******************************************************************************/
-static void rfc_mx_conf_cnf(tRFC_MCB* p_mcb, tL2CAP_CFG_INFO* p_cfg) {
- RFCOMM_TRACE_EVENT("rfc_mx_conf_cnf p_cfg:%08x result:%d ", p_cfg,
- (p_cfg) ? p_cfg->result : 0);
+static void rfc_mx_conf_cnf(tRFC_MCB* p_mcb, uint16_t result) {
+ RFCOMM_TRACE_EVENT("rfc_mx_conf_cnf result:%d ", result);
- if (p_cfg->result != L2CAP_CFG_OK) {
+ if (result != L2CAP_CFG_OK) {
LOG(ERROR) << __func__ << ": failed to configure L2CAP for "
<< p_mcb->bd_addr;
if (p_mcb->is_initiator) {
LOG(ERROR) << __func__ << ": disconnect L2CAP due to config failure for "
<< p_mcb->bd_addr;
- PORT_StartCnf(p_mcb, p_cfg->result);
+ PORT_StartCnf(p_mcb, result);
L2CA_DisconnectReq(p_mcb->lcid);
}
rfc_release_multiplexer_channel(p_mcb);
static void sdp_connect_ind(const RawAddress& bd_addr, uint16_t l2cap_cid,
UNUSED_ATTR uint16_t psm, uint8_t l2cap_id);
static void sdp_config_ind(uint16_t l2cap_cid, tL2CAP_CFG_INFO* p_cfg);
-static void sdp_config_cfm(uint16_t l2cap_cid, tL2CAP_CFG_INFO* p_cfg);
+static void sdp_config_cfm(uint16_t l2cap_cid, uint16_t result);
static void sdp_disconnect_ind(uint16_t l2cap_cid, bool ack_needed);
static void sdp_data_ind(uint16_t l2cap_cid, BT_HDR* p_msg);
* Returns void
*
******************************************************************************/
-static void sdp_config_cfm(uint16_t l2cap_cid, tL2CAP_CFG_INFO* p_cfg) {
+static void sdp_config_cfm(uint16_t l2cap_cid, uint16_t result) {
tCONN_CB* p_ccb;
SDP_TRACE_EVENT("SDP - Rcvd cfg cfm, CID: 0x%x Result: %d", l2cap_cid,
- p_cfg->result);
+ result);
/* Find CCB based on CID */
p_ccb = sdpu_find_ccb_by_cid(l2cap_cid);
}
/* For now, always accept configuration from the other side */
- if (p_cfg->result == L2CAP_CFG_OK) {
+ if (result == L2CAP_CFG_OK) {
p_ccb->con_flags |= SDP_FLAGS_MY_CFG_DONE;
if (p_ccb->con_flags & SDP_FLAGS_HIS_CFG_DONE) {
VLOG(1) << "Step 2";
// MTU configuration is done
cfg_req.mtu_present = false;
- l2cap_appl_info_.pL2CA_ConfigCfm_Cb(lcid, &cfg_req);
+ l2cap_appl_info_.pL2CA_ConfigCfm_Cb(lcid, L2CAP_CFG_OK);
VLOG(1) << "Step 3";
// Remote device also ask to configure MTU size
VLOG(1) << "Step 2";
// Remote device confirms our configuration request
cfg_req.mtu_present = false;
- l2cap_appl_info_.pL2CA_ConfigCfm_Cb(lcid, &cfg_req);
+ l2cap_appl_info_.pL2CA_ConfigCfm_Cb(lcid, L2CAP_CFG_OK);
VLOG(1) << "Step 3";
// Remote device also asks to configure MTU
VLOG(1) << "Step 6";
// Remote device accepted our MTU size
- tL2CAP_CFG_INFO peer_cfg_rsp = {.mtu_present = true, .mtu = L2CAP_MTU_SIZE};
- l2cap_appl_info_.pL2CA_ConfigCfm_Cb(new_lcid, &peer_cfg_rsp);
+ l2cap_appl_info_.pL2CA_ConfigCfm_Cb(new_lcid, L2CAP_CFG_OK);
// L2CAP collision and connection setup done