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

Commit 13c4276a authored by Hansong Zhang's avatar Hansong Zhang
Browse files

l2c_csm: Use pL2CA_Error_Cb on error

Note that we only have two result codes, because the user only needs to
know whether it's during ConnectRsp or ConfigRsp (except for HIDH
retry), which we need further research.

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I24aa7bf8487c9b2b69fc455cfdb52a7ec758b90b
parent c8117f1b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -188,7 +188,7 @@ void avct_l2c_connect_cfm_cback(uint16_t lcid, uint16_t result) {
      }
      /* else failure */
      else {
        avct_on_l2cap_error(lcid, result);
        LOG(ERROR) << __func__ << ": invoked with non OK status";
      }
    } else if (p_lcb->conflict_lcid == lcid) {
      /* we must be in AVCT_CH_CFG state for the ch_lcid channel */
@@ -233,7 +233,7 @@ void avct_l2c_config_cfm_cback(uint16_t lcid, uint16_t result) {
      }
      /* else failure */
      else {
        avct_on_l2cap_error(lcid, result);
        LOG(ERROR) << __func__ << ": invoked with non OK status";
      }
    }
    AVCT_TRACE_DEBUG("ch_state cfc: %d ", p_lcb->ch_state);
+2 −2
Original line number Diff line number Diff line
@@ -129,7 +129,7 @@ void avct_l2c_br_connect_cfm_cback(uint16_t lcid, uint16_t result) {
  if ((p_lcb == NULL) || (p_lcb->ch_state != AVCT_CH_CONN)) return;

  if (result != L2CAP_CONN_OK) {
    avct_br_on_l2cap_error(lcid, result);
    LOG(ERROR) << __func__ << ": invoked with non OK status";
    return;
  }

@@ -162,7 +162,7 @@ void avct_l2c_br_config_cfm_cback(uint16_t lcid, uint16_t result) {
  }
  /* else failure */
  else {
    avct_br_on_l2cap_error(lcid, result);
    LOG(ERROR) << __func__ << ": invoked with non OK status";
  }
}

+2 −2
Original line number Diff line number Diff line
@@ -281,7 +281,7 @@ void avdt_l2c_connect_cfm_cback(uint16_t lcid, uint16_t result) {

      /* failure; notify adaption that channel closed */
      if (result != L2CAP_CONN_OK) {
        avdt_on_l2cap_error(lcid, result);
        LOG(ERROR) << __func__ << ": invoked with non OK status";
      }
    }
  }
@@ -315,7 +315,7 @@ void avdt_l2c_config_cfm_cback(uint16_t lcid, uint16_t result) {
      }
      /* else failure */
      else {
        avdt_on_l2cap_error(lcid, result);
        LOG(ERROR) << __func__ << ": invoked with non OK status";
      }
    }
  }
+2 −2
Original line number Diff line number Diff line
@@ -183,7 +183,7 @@ static void bnep_connect_cfm(uint16_t l2cap_cid, uint16_t result) {
    BNEP_TRACE_EVENT("BNEP - got conn cnf, sent cfg req, CID: 0x%x",
                     p_bcb->l2cap_cid);
  } else {
    bnep_on_l2cap_error(l2cap_cid, result);
    LOG(ERROR) << __func__ << ": invoked with non OK status";
  }
}

@@ -238,7 +238,7 @@ static void bnep_config_cfm(uint16_t l2cap_cid, uint16_t result) {
                              BTM_SUCCESS);
    }
  } else {
    bnep_on_l2cap_error(l2cap_cid, result);
    LOG(ERROR) << __func__ << ": invoked with non OK status";
  }
}

+0 −4
Original line number Diff line number Diff line
@@ -739,8 +739,6 @@ static void gap_connect_cfm(uint16_t l2cap_cid, uint16_t result) {
      p_ccb->con_flags |= GAP_CCB_FLAGS_SEC_DONE;
      gap_checks_con_flags(p_ccb);
    }
  } else {
    gap_on_l2cap_error(l2cap_cid, result);
  }
}

@@ -796,8 +794,6 @@ static void gap_config_cfm(uint16_t l2cap_cid, uint16_t result) {
    p_ccb->con_flags |= GAP_CCB_FLAGS_MY_CFG_DONE;
    p_ccb->con_flags |= GAP_CCB_FLAGS_HIS_CFG_DONE;
    gap_checks_con_flags(p_ccb);
  } else {
    gap_on_l2cap_error(l2cap_cid, result);
  }
}

Loading