Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1c097bd0 authored by Hansong Zhang's avatar Hansong Zhang
Browse files

We always send pL2CA_ConfigCfm_Cb with status OK

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I4865330b4c48fe507bd6df72a5e362a616744ef4
parent 3c87668d
Loading
Loading
Loading
Loading
+4 −11
Original line number Original line Diff line number Diff line
@@ -222,20 +222,13 @@ void avct_l2c_config_cfm_cback(uint16_t lcid, uint16_t result) {
  /* look up lcb for this channel */
  /* look up lcb for this channel */
  p_lcb = avct_lcb_by_lcid(lcid);
  p_lcb = avct_lcb_by_lcid(lcid);
  if (p_lcb != NULL) {
  if (p_lcb != NULL) {
    AVCT_TRACE_DEBUG("avct_l2c_config_cfm_cback: 0x%x, ch_state: %d, res: %d",
    AVCT_TRACE_DEBUG("avct_l2c_config_cfm_cback: 0x%x, ch_state: %d,", lcid,
                     lcid, p_lcb->ch_state, result);
                     p_lcb->ch_state);
    /* if in correct state */
    /* if in correct state */
    if (p_lcb->ch_state == AVCT_CH_CFG) {
    if (p_lcb->ch_state == AVCT_CH_CFG) {
      /* if result successful */
      if (result == L2CAP_CFG_OK) {
      p_lcb->ch_state = AVCT_CH_OPEN;
      p_lcb->ch_state = AVCT_CH_OPEN;
      avct_lcb_event(p_lcb, AVCT_LCB_LL_OPEN_EVT, NULL);
      avct_lcb_event(p_lcb, AVCT_LCB_LL_OPEN_EVT, NULL);
    }
    }
      /* else failure */
      else {
        LOG(ERROR) << __func__ << ": invoked with non OK status";
      }
    }
    AVCT_TRACE_DEBUG("ch_state cfc: %d ", p_lcb->ch_state);
    AVCT_TRACE_DEBUG("ch_state cfc: %d ", p_lcb->ch_state);
  }
  }
}
}
+2 −9
Original line number Original line Diff line number Diff line
@@ -155,16 +155,9 @@ void avct_l2c_br_config_cfm_cback(uint16_t lcid, uint16_t result) {
  p_lcb = avct_bcb_by_lcid(lcid);
  p_lcb = avct_bcb_by_lcid(lcid);
  if ((p_lcb == NULL) || (p_lcb->ch_state != AVCT_CH_CFG)) return;
  if ((p_lcb == NULL) || (p_lcb->ch_state != AVCT_CH_CFG)) return;


  /* if result successful */
  if (result == L2CAP_CFG_OK) {
  p_lcb->ch_state = AVCT_CH_OPEN;
  p_lcb->ch_state = AVCT_CH_OPEN;
  avct_bcb_event(p_lcb, AVCT_LCB_LL_OPEN_EVT, NULL);
  avct_bcb_event(p_lcb, AVCT_LCB_LL_OPEN_EVT, NULL);
}
}
  /* else failure */
  else {
    LOG(ERROR) << __func__ << ": invoked with non OK status";
  }
}


/*******************************************************************************
/*******************************************************************************
 *
 *
+1 −8
Original line number Original line Diff line number Diff line
@@ -301,15 +301,8 @@ void avdt_l2c_config_cfm_cback(uint16_t lcid, uint16_t result) {


    /* if in correct state */
    /* if in correct state */
    if (p_tbl->state == AVDT_AD_ST_CFG) {
    if (p_tbl->state == AVDT_AD_ST_CFG) {
      /* if result successful */
      if (result == L2CAP_CONN_OK) {
      avdt_ad_tc_open_ind(p_tbl);
      avdt_ad_tc_open_ind(p_tbl);
    }
    }
      /* else failure */
      else {
        LOG(ERROR) << __func__ << ": invoked with non OK status";
      }
    }
  }
  }
}
}


+7 −12
Original line number Original line Diff line number Diff line
@@ -214,8 +214,7 @@ static void bnep_config_ind(uint16_t l2cap_cid, tL2CAP_CFG_INFO* p_cfg) {
static void bnep_config_cfm(uint16_t l2cap_cid, uint16_t result) {
static void bnep_config_cfm(uint16_t l2cap_cid, uint16_t result) {
  tBNEP_CONN* p_bcb;
  tBNEP_CONN* p_bcb;


  BNEP_TRACE_EVENT("BNEP - Rcvd cfg cfm, CID: 0x%x  Result: %d", l2cap_cid,
  BNEP_TRACE_EVENT("BNEP - Rcvd cfg cfm, CID: 0x%x", l2cap_cid);
                   result);


  /* Find CCB based on CID */
  /* Find CCB based on CID */
  p_bcb = bnepu_find_bcb_by_cid(l2cap_cid);
  p_bcb = bnepu_find_bcb_by_cid(l2cap_cid);
@@ -226,7 +225,6 @@ static void bnep_config_cfm(uint16_t l2cap_cid, uint16_t result) {
  }
  }


  /* For now, always accept configuration from the other side */
  /* For now, always accept configuration from the other side */
  if (result == L2CAP_CFG_OK) {
  p_bcb->con_state = BNEP_STATE_SEC_CHECKING;
  p_bcb->con_state = BNEP_STATE_SEC_CHECKING;


  /* Start timer waiting for setup or response */
  /* Start timer waiting for setup or response */
@@ -236,9 +234,6 @@ static void bnep_config_cfm(uint16_t l2cap_cid, uint16_t result) {
  if (p_bcb->con_flags & BNEP_FLAGS_IS_ORIG) {
  if (p_bcb->con_flags & BNEP_FLAGS_IS_ORIG) {
    bnep_sec_check_complete(&p_bcb->rem_bda, BT_TRANSPORT_BR_EDR, p_bcb);
    bnep_sec_check_complete(&p_bcb->rem_bda, BT_TRANSPORT_BR_EDR, p_bcb);
  }
  }
  } else {
    LOG(ERROR) << __func__ << ": invoked with non OK status";
  }
}
}


/*******************************************************************************
/*******************************************************************************
+3 −5
Original line number Original line Diff line number Diff line
@@ -790,12 +790,10 @@ static void gap_config_cfm(uint16_t l2cap_cid, uint16_t result) {
  p_ccb = gap_find_ccb_by_cid(l2cap_cid);
  p_ccb = gap_find_ccb_by_cid(l2cap_cid);
  if (p_ccb == NULL) return;
  if (p_ccb == NULL) return;


  if (result == L2CAP_CFG_OK) {
  p_ccb->con_flags |= GAP_CCB_FLAGS_MY_CFG_DONE;
  p_ccb->con_flags |= GAP_CCB_FLAGS_MY_CFG_DONE;
  p_ccb->con_flags |= GAP_CCB_FLAGS_HIS_CFG_DONE;
  p_ccb->con_flags |= GAP_CCB_FLAGS_HIS_CFG_DONE;
  gap_checks_con_flags(p_ccb);
  gap_checks_con_flags(p_ccb);
}
}
}


/*******************************************************************************
/*******************************************************************************
 *
 *
Loading