p_lcb->peer_mtu = L2CAP_DEFAULT_MTU;
}
- /* send L2CAP configure response */
- memset(p_cfg, 0, sizeof(tL2CAP_CFG_INFO));
- p_cfg->result = L2CAP_CFG_OK;
- L2CA_ConfigRsp(lcid, p_cfg);
-
/* if first config ind */
if ((p_lcb->ch_flags & AVCT_L2C_CFG_IND_DONE) == 0) {
/* update flags */
tAVCT_BCB* p_lcb;
uint16_t max_mtu = BT_DEFAULT_BUFFER_SIZE - L2CAP_MIN_OFFSET - BT_HDR_SIZE;
- /* Don't include QoS nor flush timeout in the response since we
- currently always accept these values. Note: fcr_present is left
- untouched since l2cap negotiates this internally
- */
- p_cfg->flush_to_present = false;
- p_cfg->qos_present = false;
-
/* look up lcb for this channel */
p_lcb = avct_bcb_by_lcid(lcid);
if (p_lcb == NULL) return;
}
if (p_lcb->peer_mtu > max_mtu) {
- p_lcb->peer_mtu = p_cfg->mtu = max_mtu;
-
- /* Must tell the peer what the adjusted value is */
- p_cfg->mtu_present = true;
- } else /* Don't include in the response */
- p_cfg->mtu_present = false;
+ p_lcb->peer_mtu = max_mtu;
+ }
AVCT_TRACE_DEBUG("%s peer_mtu:%d use:%d", __func__, p_lcb->peer_mtu, max_mtu);
- p_cfg->result = L2CAP_CFG_OK;
-
- /* send L2CAP configure response */
- L2CA_ConfigRsp(lcid, p_cfg);
-
/* if first config ind */
if ((p_lcb->ch_flags & AVCT_L2C_CFG_IND_DONE) == 0) {
/* update flags */
AVDT_TRACE_DEBUG("%s: peer_mtu: %d, lcid: %d", __func__, p_tbl->peer_mtu,
lcid);
- /* send L2CAP configure response */
- memset(p_cfg, 0, sizeof(tL2CAP_CFG_INFO));
- p_cfg->result = L2CAP_CFG_OK;
- L2CA_ConfigRsp(lcid, p_cfg);
-
/* if first config ind */
if ((p_tbl->cfg_flags & AVDT_L2C_CFG_IND_DONE) == 0) {
/* update cfg_flags */
BNEP_TRACE_EVENT("BNEP - Rcvd cfg ind, CID: 0x%x", l2cap_cid);
- /* For now, always accept configuration from the other side */
- p_cfg->flush_to_present = false;
- p_cfg->mtu_present = false;
- p_cfg->result = L2CAP_CFG_OK;
-
- L2CA_ConfigRsp(l2cap_cid, p_cfg);
-
p_bcb->con_flags |= BNEP_FLAGS_HIS_CFG_DONE;
if (p_bcb->con_flags & BNEP_FLAGS_MY_CFG_DONE) {
} else
p_ccb->rem_mtu_size = p_cfg->mtu;
- /* For now, always accept configuration from the other side */
- p_cfg->flush_to_present = false;
- p_cfg->mtu_present = false;
- p_cfg->result = L2CAP_CFG_OK;
- p_cfg->fcs_present = false;
-
- L2CA_ConfigRsp(l2cap_cid, p_cfg);
-
p_ccb->con_flags |= GAP_CCB_FLAGS_HIS_CFG_DONE;
gap_checks_con_flags(p_ccb);
else
p_tcb->payload_size = L2CAP_DEFAULT_MTU;
- /* send L2CAP configure response */
- memset(p_cfg, 0, sizeof(tL2CAP_CFG_INFO));
- p_cfg->result = L2CAP_CFG_OK;
- L2CA_ConfigRsp(lcid, p_cfg);
-
/* if not first config ind */
if ((p_tcb->ch_flags & GATT_L2C_CFG_IND_DONE)) return;
else
p_hcon->rem_mtu_size = p_cfg->mtu;
- // accept without changes
- p_cfg->flush_to_present = FALSE;
- p_cfg->mtu_present = FALSE;
- p_cfg->result = L2CAP_CFG_OK;
-
- if (cid == p_hcon->intr_cid && hd_cb.use_in_qos && !p_cfg->qos_present) {
- p_cfg->qos_present = TRUE;
- memcpy(&p_cfg->qos, &hd_cb.in_qos, sizeof(FLOW_SPEC));
- }
-
- L2CA_ConfigRsp(cid, p_cfg);
-
// update flags
if (cid == p_hcon->ctrl_cid) {
p_hcon->conn_flags |= HID_CONN_FLAGS_HIS_CTRL_CFG_DONE;
else
p_hcon->rem_mtu_size = p_cfg->mtu;
- /* For now, always accept configuration from the other side */
- p_cfg->flush_to_present = false;
- p_cfg->mtu_present = false;
- p_cfg->result = L2CAP_CFG_OK;
-
- L2CA_ConfigRsp(l2cap_cid, p_cfg);
-
if (l2cap_cid == p_hcon->ctrl_cid) {
p_hcon->conn_flags |= HID_CONN_FLAGS_HIS_CTRL_CFG_DONE;
if ((p_hcon->conn_flags & HID_CONN_FLAGS_IS_ORIG) &&
"L2CAP - Calling Config_Req_Cb(), CID: 0x%04x, C-bit %d",
p_ccb->local_cid, (p_cfg->flags & L2CAP_CFG_FLAGS_MASK_CONT));
(*p_ccb->p_rcb->api.pL2CA_ConfigInd_Cb)(p_ccb->local_cid, p_cfg);
+ tL2CAP_CFG_INFO response = {};
+ response.result = L2CAP_CFG_OK;
+ L2CA_ConfigRsp(p_ccb->local_cid, &response);
} else if (cfg_result == L2CAP_PEER_CFG_DISCONNECT) {
/* Disconnect if channels are incompatible */
L2CAP_TRACE_EVENT("L2CAP - incompatible configurations disconnect");
cfg_result = l2cu_process_peer_cfg_req(p_ccb, p_cfg);
if (cfg_result == L2CAP_PEER_CFG_OK) {
(*p_ccb->p_rcb->api.pL2CA_ConfigInd_Cb)(p_ccb->local_cid, p_cfg);
+ tL2CAP_CFG_INFO response = {};
+ response.result = L2CAP_CFG_OK;
+ L2CA_ConfigRsp(p_ccb->local_cid, &response);
}
/* Error in config parameters: reset state and config flag */
p_mcb->peer_l2cap_mtu = L2CAP_DEFAULT_MTU - RFCOMM_MIN_OFFSET - 1;
}
- p_cfg->mtu_present = false;
- p_cfg->flush_to_present = false;
- p_cfg->qos_present = false;
-
- p_cfg->result = L2CAP_CFG_OK;
-
- L2CA_ConfigRsp(p_mcb->lcid, p_cfg);
-
p_mcb->peer_cfg_rcvd = true;
if ((p_mcb->state == RFC_MX_STATE_CONFIGURE) && p_mcb->local_cfg_sent) {
if (p_mcb->is_initiator) {
p_ccb->rem_mtu_size = p_cfg->mtu;
}
- /* For now, always accept configuration from the other side */
- p_cfg->flush_to_present = false;
- p_cfg->mtu_present = false;
- p_cfg->result = L2CAP_CFG_OK;
-
- L2CA_ConfigRsp(l2cap_cid, p_cfg);
-
SDP_TRACE_EVENT("SDP - Rcvd cfg ind, sent cfg cfm, CID: 0x%x", l2cap_cid);
p_ccb->con_flags |= SDP_FLAGS_HIS_CFG_DONE;