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

Commit a82553a4 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Inline stack/acl/btm_acl::btm_pm_check_stored"

parents e6b09f6f 1a3149ba
Loading
Loading
Loading
Loading
+20 −24
Original line number Diff line number Diff line
@@ -604,29 +604,6 @@ static tBTM_STATUS btm_pm_snd_md_req(uint8_t pm_id, int link_ind,
  return BTM_CMD_STARTED;
}

/*******************************************************************************
 *
 * Function         btm_pm_check_stored
 *
 * Description      This function is called when an HCI command status event
 *                  occurs to check if there's any PM command issued while
 *                  waiting for HCI command status.
 *
 * Returns          none.
 *
 ******************************************************************************/
static void btm_pm_check_stored(void) {
  int xx;
  for (xx = 0; xx < MAX_L2CAP_LINKS; xx++) {
    if (btm_cb.acl_cb_.pm_mode_db[xx].state & BTM_PM_STORED_MASK) {
      btm_cb.acl_cb_.pm_mode_db[xx].state &= ~BTM_PM_STORED_MASK;
      BTM_TRACE_DEBUG("btm_pm_check_stored :%d", xx);
      btm_pm_snd_md_req(BTM_PM_SET_ONLY_ID, xx, NULL);
      break;
    }
  }
}

/*******************************************************************************
 *
 * Function         btm_pm_proc_cmd_status
@@ -674,7 +651,26 @@ void btm_pm_proc_cmd_status(uint8_t status) {
#endif  // BTM_PM_DEBUG
  btm_cb.acl_cb_.pm_pend_link = MAX_L2CAP_LINKS;

  btm_pm_check_stored();
  /*******************************************************************************
   *
   * Function         btm_pm_check_stored
   *
   * Description      This function is called when an HCI command status event
   *                  occurs to check if there's any PM command issued while
   *                  waiting for HCI command status.
   *
   * Returns          none.
   *
   ******************************************************************************/
  int xx;
  for (xx = 0; xx < MAX_L2CAP_LINKS; xx++) {
    if (btm_cb.acl_cb_.pm_mode_db[xx].state & BTM_PM_STORED_MASK) {
      btm_cb.acl_cb_.pm_mode_db[xx].state &= ~BTM_PM_STORED_MASK;
      BTM_TRACE_DEBUG("btm_pm_check_stored :%d", xx);
      btm_pm_snd_md_req(BTM_PM_SET_ONLY_ID, xx, NULL);
      break;
    }
  }
}

/*******************************************************************************