void diag_send_diag_flush(struct diag_smd_info *smd_info) { struct diag_ctrl_msg_diag_flush diag_flush; if (!smd_info || smd_info->type != SMD_CNTL_TYPE) { pr_err("diag: In %s, invalid channel info, smd_info: %p type: %d\n", __func__, smd_info, ((smd_info) ? smd_info->type : -1)); return; } if (smd_info->peripheral < MODEM_DATA || smd_info->peripheral > WCNSS_DATA) { pr_err("diag: In %s, invalid peripheral %d\n", __func__, smd_info->peripheral); return; } pr_debug("diag: In %s, sending diag_flush msg\n", __func__); mutex_lock(&driver->diag_cntl_mutex); diag_flush.ctrl_pkt_id = DIAG_CTRL_MSG_DIAG_FLUSH; diag_flush.ctrl_pkt_data_len = 0; diag_send_ctrl_msg(smd_info, &diag_flush, sizeof(diag_flush)); mutex_unlock(&driver->diag_cntl_mutex); pr_debug("diag: Exiting %s\n", __func__); }
void diag_send_diag_flush(struct diag_smd_info *smd_info) { struct diag_ctrl_msg_diag_flush diag_flush; /* For now only allow the modem to receive the message */ if (!smd_info || smd_info->peripheral != MODEM_DATA || smd_info->type != SMD_CNTL_TYPE) { pr_err("diag: returning early smd_info->peripheral: %d," " smd_info->type: %d\n", smd_info->peripheral, smd_info->type); return; } pr_debug("diag: In %s, sending diag_flush msg\n", __func__); mutex_lock(&driver->diag_cntl_mutex); diag_flush.ctrl_pkt_id = DIAG_CTRL_MSG_DIAG_FLUSH; diag_flush.ctrl_pkt_data_len = 0; diag_send_ctrl_msg(smd_info, &diag_flush, sizeof(diag_flush)); mutex_unlock(&driver->diag_cntl_mutex); pr_debug("diag: Exiting %s\n", __func__); }