qmi 26 drivers/net/wireless/ath/ath10k/qmi.c static int ath10k_qmi_map_msa_permission(struct ath10k_qmi *qmi, qmi 30 drivers/net/wireless/ath/ath10k/qmi.c struct ath10k *ar = qmi->ar; qmi 58 drivers/net/wireless/ath/ath10k/qmi.c static int ath10k_qmi_unmap_msa_permission(struct ath10k_qmi *qmi, qmi 62 drivers/net/wireless/ath/ath10k/qmi.c struct ath10k *ar = qmi->ar; qmi 82 drivers/net/wireless/ath/ath10k/qmi.c static int ath10k_qmi_setup_msa_permissions(struct ath10k_qmi *qmi) qmi 87 drivers/net/wireless/ath/ath10k/qmi.c for (i = 0; i < qmi->nr_mem_region; i++) { qmi 88 drivers/net/wireless/ath/ath10k/qmi.c ret = ath10k_qmi_map_msa_permission(qmi, &qmi->mem_region[i]); qmi 97 drivers/net/wireless/ath/ath10k/qmi.c ath10k_qmi_unmap_msa_permission(qmi, &qmi->mem_region[i]); qmi 101 drivers/net/wireless/ath/ath10k/qmi.c static void ath10k_qmi_remove_msa_permission(struct ath10k_qmi *qmi) qmi 105 drivers/net/wireless/ath/ath10k/qmi.c for (i = 0; i < qmi->nr_mem_region; i++) qmi 106 drivers/net/wireless/ath/ath10k/qmi.c ath10k_qmi_unmap_msa_permission(qmi, &qmi->mem_region[i]); qmi 109 drivers/net/wireless/ath/ath10k/qmi.c static int ath10k_qmi_msa_mem_info_send_sync_msg(struct ath10k_qmi *qmi) qmi 113 drivers/net/wireless/ath/ath10k/qmi.c struct ath10k *ar = qmi->ar; qmi 118 drivers/net/wireless/ath/ath10k/qmi.c req.msa_addr = qmi->msa_pa; qmi 119 drivers/net/wireless/ath/ath10k/qmi.c req.size = qmi->msa_mem_size; qmi 121 drivers/net/wireless/ath/ath10k/qmi.c ret = qmi_txn_init(&qmi->qmi_hdl, &txn, qmi 126 drivers/net/wireless/ath/ath10k/qmi.c ret = qmi_send_request(&qmi->qmi_hdl, NULL, &txn, qmi 153 drivers/net/wireless/ath/ath10k/qmi.c qmi->nr_mem_region = resp.mem_region_info_len; qmi 155 drivers/net/wireless/ath/ath10k/qmi.c qmi->mem_region[i].addr = resp.mem_region_info[i].region_addr; qmi 156 drivers/net/wireless/ath/ath10k/qmi.c qmi->mem_region[i].size = resp.mem_region_info[i].size; qmi 157 drivers/net/wireless/ath/ath10k/qmi.c qmi->mem_region[i].secure = resp.mem_region_info[i].secure_flag; qmi 160 drivers/net/wireless/ath/ath10k/qmi.c i, &qmi->mem_region[i].addr, qmi 161 drivers/net/wireless/ath/ath10k/qmi.c qmi->mem_region[i].size, qmi 162 drivers/net/wireless/ath/ath10k/qmi.c qmi->mem_region[i].secure); qmi 172 drivers/net/wireless/ath/ath10k/qmi.c static int ath10k_qmi_msa_ready_send_sync_msg(struct ath10k_qmi *qmi) qmi 176 drivers/net/wireless/ath/ath10k/qmi.c struct ath10k *ar = qmi->ar; qmi 180 drivers/net/wireless/ath/ath10k/qmi.c ret = qmi_txn_init(&qmi->qmi_hdl, &txn, qmi 185 drivers/net/wireless/ath/ath10k/qmi.c ret = qmi_send_request(&qmi->qmi_hdl, NULL, &txn, qmi 211 drivers/net/wireless/ath/ath10k/qmi.c static int ath10k_qmi_bdf_dnld_send_sync(struct ath10k_qmi *qmi) qmi 215 drivers/net/wireless/ath/ath10k/qmi.c struct ath10k *ar = qmi->ar; qmi 247 drivers/net/wireless/ath/ath10k/qmi.c ret = qmi_txn_init(&qmi->qmi_hdl, &txn, qmi 253 drivers/net/wireless/ath/ath10k/qmi.c ret = qmi_send_request(&qmi->qmi_hdl, NULL, &txn, qmi 289 drivers/net/wireless/ath/ath10k/qmi.c static int ath10k_qmi_send_cal_report_req(struct ath10k_qmi *qmi) qmi 293 drivers/net/wireless/ath/ath10k/qmi.c struct ath10k *ar = qmi->ar; qmi 298 drivers/net/wireless/ath/ath10k/qmi.c ret = qmi_txn_init(&qmi->qmi_hdl, &txn, wlfw_cal_report_resp_msg_v01_ei, qmi 304 drivers/net/wireless/ath/ath10k/qmi.c if (qmi->cal_data[i].total_size && qmi 305 drivers/net/wireless/ath/ath10k/qmi.c qmi->cal_data[i].data) { qmi 306 drivers/net/wireless/ath/ath10k/qmi.c req.meta_data[j] = qmi->cal_data[i].cal_id; qmi 312 drivers/net/wireless/ath/ath10k/qmi.c ret = qmi_send_request(&qmi->qmi_hdl, NULL, &txn, qmi 343 drivers/net/wireless/ath/ath10k/qmi.c struct ath10k_qmi *qmi = ar_snoc->qmi; qmi 349 drivers/net/wireless/ath/ath10k/qmi.c ret = qmi_txn_init(&qmi->qmi_hdl, &txn, qmi 359 drivers/net/wireless/ath/ath10k/qmi.c ret = qmi_send_request(&qmi->qmi_hdl, NULL, &txn, qmi 392 drivers/net/wireless/ath/ath10k/qmi.c struct ath10k_qmi *qmi = ar_snoc->qmi; qmi 403 drivers/net/wireless/ath/ath10k/qmi.c ret = qmi_txn_init(&qmi->qmi_hdl, &txn, qmi 445 drivers/net/wireless/ath/ath10k/qmi.c ret = qmi_send_request(&qmi->qmi_hdl, NULL, &txn, qmi 504 drivers/net/wireless/ath/ath10k/qmi.c static int ath10k_qmi_cap_send_sync_msg(struct ath10k_qmi *qmi) qmi 508 drivers/net/wireless/ath/ath10k/qmi.c struct ath10k *ar = qmi->ar; qmi 517 drivers/net/wireless/ath/ath10k/qmi.c ret = qmi_txn_init(&qmi->qmi_hdl, &txn, wlfw_cap_resp_msg_v01_ei, resp); qmi 521 drivers/net/wireless/ath/ath10k/qmi.c ret = qmi_send_request(&qmi->qmi_hdl, NULL, &txn, qmi 542 drivers/net/wireless/ath/ath10k/qmi.c qmi->chip_info.chip_id = resp->chip_info.chip_id; qmi 543 drivers/net/wireless/ath/ath10k/qmi.c qmi->chip_info.chip_family = resp->chip_info.chip_family; qmi 547 drivers/net/wireless/ath/ath10k/qmi.c qmi->board_info.board_id = resp->board_info.board_id; qmi 549 drivers/net/wireless/ath/ath10k/qmi.c qmi->board_info.board_id = 0xFF; qmi 552 drivers/net/wireless/ath/ath10k/qmi.c qmi->soc_info.soc_id = resp->soc_info.soc_id; qmi 555 drivers/net/wireless/ath/ath10k/qmi.c qmi->fw_version = resp->fw_version_info.fw_version; qmi 556 drivers/net/wireless/ath/ath10k/qmi.c strlcpy(qmi->fw_build_timestamp, resp->fw_version_info.fw_build_timestamp, qmi 557 drivers/net/wireless/ath/ath10k/qmi.c sizeof(qmi->fw_build_timestamp)); qmi 561 drivers/net/wireless/ath/ath10k/qmi.c strlcpy(qmi->fw_build_id, resp->fw_build_id, qmi 566 drivers/net/wireless/ath/ath10k/qmi.c qmi->chip_info.chip_id, qmi->chip_info.chip_family, qmi 567 drivers/net/wireless/ath/ath10k/qmi.c qmi->board_info.board_id, qmi->soc_info.soc_id); qmi 569 drivers/net/wireless/ath/ath10k/qmi.c qmi->fw_version, qmi->fw_build_timestamp, qmi->fw_build_id); qmi 580 drivers/net/wireless/ath/ath10k/qmi.c static int ath10k_qmi_host_cap_send_sync(struct ath10k_qmi *qmi) qmi 585 drivers/net/wireless/ath/ath10k/qmi.c struct ath10k *ar = qmi->ar; qmi 593 drivers/net/wireless/ath/ath10k/qmi.c ret = qmi_txn_init(&qmi->qmi_hdl, &txn, wlfw_host_cap_resp_msg_v01_ei, qmi 603 drivers/net/wireless/ath/ath10k/qmi.c ret = qmi_send_request(&qmi->qmi_hdl, NULL, &txn, qmi 634 drivers/net/wireless/ath/ath10k/qmi.c struct ath10k_qmi *qmi = ar_snoc->qmi; qmi 642 drivers/net/wireless/ath/ath10k/qmi.c ret = qmi_txn_init(&qmi->qmi_hdl, &txn, wlfw_ini_resp_msg_v01_ei, qmi 647 drivers/net/wireless/ath/ath10k/qmi.c ret = qmi_send_request(&qmi->qmi_hdl, NULL, &txn, qmi 676 drivers/net/wireless/ath/ath10k/qmi.c ath10k_qmi_ind_register_send_sync_msg(struct ath10k_qmi *qmi) qmi 680 drivers/net/wireless/ath/ath10k/qmi.c struct ath10k *ar = qmi->ar; qmi 691 drivers/net/wireless/ath/ath10k/qmi.c ret = qmi_txn_init(&qmi->qmi_hdl, &txn, qmi 696 drivers/net/wireless/ath/ath10k/qmi.c ret = qmi_send_request(&qmi->qmi_hdl, NULL, &txn, qmi 718 drivers/net/wireless/ath/ath10k/qmi.c qmi->fw_ready = true; qmi 727 drivers/net/wireless/ath/ath10k/qmi.c static void ath10k_qmi_event_server_arrive(struct ath10k_qmi *qmi) qmi 729 drivers/net/wireless/ath/ath10k/qmi.c struct ath10k *ar = qmi->ar; qmi 732 drivers/net/wireless/ath/ath10k/qmi.c ret = ath10k_qmi_ind_register_send_sync_msg(qmi); qmi 736 drivers/net/wireless/ath/ath10k/qmi.c if (qmi->fw_ready) { qmi 741 drivers/net/wireless/ath/ath10k/qmi.c ret = ath10k_qmi_host_cap_send_sync(qmi); qmi 745 drivers/net/wireless/ath/ath10k/qmi.c ret = ath10k_qmi_msa_mem_info_send_sync_msg(qmi); qmi 749 drivers/net/wireless/ath/ath10k/qmi.c ret = ath10k_qmi_setup_msa_permissions(qmi); qmi 753 drivers/net/wireless/ath/ath10k/qmi.c ret = ath10k_qmi_msa_ready_send_sync_msg(qmi); qmi 757 drivers/net/wireless/ath/ath10k/qmi.c ret = ath10k_qmi_cap_send_sync_msg(qmi); qmi 764 drivers/net/wireless/ath/ath10k/qmi.c ath10k_qmi_remove_msa_permission(qmi); qmi 767 drivers/net/wireless/ath/ath10k/qmi.c static int ath10k_qmi_fetch_board_file(struct ath10k_qmi *qmi) qmi 769 drivers/net/wireless/ath/ath10k/qmi.c struct ath10k *ar = qmi->ar; qmi 773 drivers/net/wireless/ath/ath10k/qmi.c ar->id.qmi_board_id = qmi->board_info.board_id; qmi 776 drivers/net/wireless/ath/ath10k/qmi.c return ath10k_core_fetch_board_file(qmi->ar, ATH10K_BD_IE_BOARD); qmi 780 drivers/net/wireless/ath/ath10k/qmi.c ath10k_qmi_driver_event_post(struct ath10k_qmi *qmi, qmi 793 drivers/net/wireless/ath/ath10k/qmi.c spin_lock(&qmi->event_lock); qmi 794 drivers/net/wireless/ath/ath10k/qmi.c list_add_tail(&event->list, &qmi->event_list); qmi 795 drivers/net/wireless/ath/ath10k/qmi.c spin_unlock(&qmi->event_lock); qmi 797 drivers/net/wireless/ath/ath10k/qmi.c queue_work(qmi->event_wq, &qmi->event_work); qmi 802 drivers/net/wireless/ath/ath10k/qmi.c static void ath10k_qmi_event_server_exit(struct ath10k_qmi *qmi) qmi 804 drivers/net/wireless/ath/ath10k/qmi.c struct ath10k *ar = qmi->ar; qmi 806 drivers/net/wireless/ath/ath10k/qmi.c ath10k_qmi_remove_msa_permission(qmi); qmi 812 drivers/net/wireless/ath/ath10k/qmi.c static void ath10k_qmi_event_msa_ready(struct ath10k_qmi *qmi) qmi 816 drivers/net/wireless/ath/ath10k/qmi.c ret = ath10k_qmi_fetch_board_file(qmi); qmi 820 drivers/net/wireless/ath/ath10k/qmi.c ret = ath10k_qmi_bdf_dnld_send_sync(qmi); qmi 824 drivers/net/wireless/ath/ath10k/qmi.c ret = ath10k_qmi_send_cal_report_req(qmi); qmi 830 drivers/net/wireless/ath/ath10k/qmi.c static int ath10k_qmi_event_fw_ready_ind(struct ath10k_qmi *qmi) qmi 832 drivers/net/wireless/ath/ath10k/qmi.c struct ath10k *ar = qmi->ar; qmi 844 drivers/net/wireless/ath/ath10k/qmi.c struct ath10k_qmi *qmi = container_of(qmi_hdl, struct ath10k_qmi, qmi_hdl); qmi 846 drivers/net/wireless/ath/ath10k/qmi.c ath10k_qmi_driver_event_post(qmi, ATH10K_QMI_EVENT_FW_READY_IND, NULL); qmi 853 drivers/net/wireless/ath/ath10k/qmi.c struct ath10k_qmi *qmi = container_of(qmi_hdl, struct ath10k_qmi, qmi_hdl); qmi 855 drivers/net/wireless/ath/ath10k/qmi.c ath10k_qmi_driver_event_post(qmi, ATH10K_QMI_EVENT_MSA_READY_IND, NULL); qmi 879 drivers/net/wireless/ath/ath10k/qmi.c struct ath10k_qmi *qmi = container_of(qmi_hdl, struct ath10k_qmi, qmi_hdl); qmi 880 drivers/net/wireless/ath/ath10k/qmi.c struct sockaddr_qrtr *sq = &qmi->sq; qmi 881 drivers/net/wireless/ath/ath10k/qmi.c struct ath10k *ar = qmi->ar; qmi 890 drivers/net/wireless/ath/ath10k/qmi.c ret = kernel_connect(qmi_hdl->sock, (struct sockaddr *)&qmi->sq, qmi 891 drivers/net/wireless/ath/ath10k/qmi.c sizeof(qmi->sq), 0); qmi 898 drivers/net/wireless/ath/ath10k/qmi.c ath10k_qmi_driver_event_post(qmi, ATH10K_QMI_EVENT_SERVER_ARRIVE, NULL); qmi 906 drivers/net/wireless/ath/ath10k/qmi.c struct ath10k_qmi *qmi = qmi 909 drivers/net/wireless/ath/ath10k/qmi.c qmi->fw_ready = false; qmi 910 drivers/net/wireless/ath/ath10k/qmi.c ath10k_qmi_driver_event_post(qmi, ATH10K_QMI_EVENT_SERVER_EXIT, NULL); qmi 920 drivers/net/wireless/ath/ath10k/qmi.c struct ath10k_qmi *qmi = container_of(work, struct ath10k_qmi, qmi 923 drivers/net/wireless/ath/ath10k/qmi.c struct ath10k *ar = qmi->ar; qmi 925 drivers/net/wireless/ath/ath10k/qmi.c spin_lock(&qmi->event_lock); qmi 926 drivers/net/wireless/ath/ath10k/qmi.c while (!list_empty(&qmi->event_list)) { qmi 927 drivers/net/wireless/ath/ath10k/qmi.c event = list_first_entry(&qmi->event_list, qmi 930 drivers/net/wireless/ath/ath10k/qmi.c spin_unlock(&qmi->event_lock); qmi 934 drivers/net/wireless/ath/ath10k/qmi.c ath10k_qmi_event_server_arrive(qmi); qmi 937 drivers/net/wireless/ath/ath10k/qmi.c ath10k_qmi_event_server_exit(qmi); qmi 940 drivers/net/wireless/ath/ath10k/qmi.c ath10k_qmi_event_fw_ready_ind(qmi); qmi 943 drivers/net/wireless/ath/ath10k/qmi.c ath10k_qmi_event_msa_ready(qmi); qmi 950 drivers/net/wireless/ath/ath10k/qmi.c spin_lock(&qmi->event_lock); qmi 952 drivers/net/wireless/ath/ath10k/qmi.c spin_unlock(&qmi->event_lock); qmi 955 drivers/net/wireless/ath/ath10k/qmi.c static int ath10k_qmi_setup_msa_resources(struct ath10k_qmi *qmi, u32 msa_size) qmi 957 drivers/net/wireless/ath/ath10k/qmi.c struct ath10k *ar = qmi->ar; qmi 972 drivers/net/wireless/ath/ath10k/qmi.c qmi->msa_pa = r.start; qmi 973 drivers/net/wireless/ath/ath10k/qmi.c qmi->msa_mem_size = resource_size(&r); qmi 974 drivers/net/wireless/ath/ath10k/qmi.c qmi->msa_va = devm_memremap(dev, qmi->msa_pa, qmi->msa_mem_size, qmi 976 drivers/net/wireless/ath/ath10k/qmi.c if (IS_ERR(qmi->msa_va)) { qmi 978 drivers/net/wireless/ath/ath10k/qmi.c return PTR_ERR(qmi->msa_va); qmi 981 drivers/net/wireless/ath/ath10k/qmi.c qmi->msa_va = dmam_alloc_coherent(dev, msa_size, qmi 982 drivers/net/wireless/ath/ath10k/qmi.c &qmi->msa_pa, GFP_KERNEL); qmi 983 drivers/net/wireless/ath/ath10k/qmi.c if (!qmi->msa_va) { qmi 987 drivers/net/wireless/ath/ath10k/qmi.c qmi->msa_mem_size = msa_size; qmi 991 drivers/net/wireless/ath/ath10k/qmi.c &qmi->msa_pa, qmi 992 drivers/net/wireless/ath/ath10k/qmi.c qmi->msa_va); qmi 1000 drivers/net/wireless/ath/ath10k/qmi.c struct ath10k_qmi *qmi; qmi 1003 drivers/net/wireless/ath/ath10k/qmi.c qmi = kzalloc(sizeof(*qmi), GFP_KERNEL); qmi 1004 drivers/net/wireless/ath/ath10k/qmi.c if (!qmi) qmi 1007 drivers/net/wireless/ath/ath10k/qmi.c qmi->ar = ar; qmi 1008 drivers/net/wireless/ath/ath10k/qmi.c ar_snoc->qmi = qmi; qmi 1010 drivers/net/wireless/ath/ath10k/qmi.c ret = ath10k_qmi_setup_msa_resources(qmi, msa_size); qmi 1014 drivers/net/wireless/ath/ath10k/qmi.c ret = qmi_handle_init(&qmi->qmi_hdl, qmi 1020 drivers/net/wireless/ath/ath10k/qmi.c qmi->event_wq = alloc_workqueue("ath10k_qmi_driver_event", qmi 1022 drivers/net/wireless/ath/ath10k/qmi.c if (!qmi->event_wq) { qmi 1028 drivers/net/wireless/ath/ath10k/qmi.c INIT_LIST_HEAD(&qmi->event_list); qmi 1029 drivers/net/wireless/ath/ath10k/qmi.c spin_lock_init(&qmi->event_lock); qmi 1030 drivers/net/wireless/ath/ath10k/qmi.c INIT_WORK(&qmi->event_work, ath10k_qmi_driver_event_work); qmi 1032 drivers/net/wireless/ath/ath10k/qmi.c ret = qmi_add_lookup(&qmi->qmi_hdl, WLFW_SERVICE_ID_V01, qmi 1040 drivers/net/wireless/ath/ath10k/qmi.c destroy_workqueue(qmi->event_wq); qmi 1043 drivers/net/wireless/ath/ath10k/qmi.c qmi_handle_release(&qmi->qmi_hdl); qmi 1046 drivers/net/wireless/ath/ath10k/qmi.c kfree(qmi); qmi 1053 drivers/net/wireless/ath/ath10k/qmi.c struct ath10k_qmi *qmi = ar_snoc->qmi; qmi 1055 drivers/net/wireless/ath/ath10k/qmi.c qmi_handle_release(&qmi->qmi_hdl); qmi 1056 drivers/net/wireless/ath/ath10k/qmi.c cancel_work_sync(&qmi->event_work); qmi 1057 drivers/net/wireless/ath/ath10k/qmi.c destroy_workqueue(qmi->event_wq); qmi 1058 drivers/net/wireless/ath/ath10k/qmi.c kfree(qmi); qmi 1059 drivers/net/wireless/ath/ath10k/qmi.c ar_snoc->qmi = NULL; qmi 82 drivers/net/wireless/ath/ath10k/snoc.h struct ath10k_qmi *qmi; qmi 45 drivers/remoteproc/qcom_sysmon.c struct qmi_handle qmi; qmi 264 drivers/remoteproc/qcom_sysmon.c static void sysmon_ind_cb(struct qmi_handle *qmi, struct sockaddr_qrtr *sq, qmi 267 drivers/remoteproc/qcom_sysmon.c struct qcom_sysmon *sysmon = container_of(qmi, struct qcom_sysmon, qmi); qmi 295 drivers/remoteproc/qcom_sysmon.c ret = qmi_txn_init(&sysmon->qmi, &txn, ssctl_shutdown_resp_ei, &resp); qmi 301 drivers/remoteproc/qcom_sysmon.c ret = qmi_send_request(&sysmon->qmi, &sysmon->ssctl, &txn, qmi 342 drivers/remoteproc/qcom_sysmon.c ret = qmi_txn_init(&sysmon->qmi, &txn, ssctl_subsys_event_resp_ei, &resp); qmi 355 drivers/remoteproc/qcom_sysmon.c ret = qmi_send_request(&sysmon->qmi, &sysmon->ssctl, &txn, qmi 380 drivers/remoteproc/qcom_sysmon.c static int ssctl_new_server(struct qmi_handle *qmi, struct qmi_service *svc) qmi 382 drivers/remoteproc/qcom_sysmon.c struct qcom_sysmon *sysmon = container_of(qmi, struct qcom_sysmon, qmi); qmi 415 drivers/remoteproc/qcom_sysmon.c static void ssctl_del_server(struct qmi_handle *qmi, struct qmi_service *svc) qmi 536 drivers/remoteproc/qcom_sysmon.c ret = qmi_handle_init(&sysmon->qmi, SSCTL_MAX_MSG_LEN, &ssctl_ops, qmi 544 drivers/remoteproc/qcom_sysmon.c qmi_add_lookup(&sysmon->qmi, 43, 0, 0); qmi 579 drivers/remoteproc/qcom_sysmon.c qmi_handle_release(&sysmon->qmi); qmi 119 drivers/slimbus/qcom-ngd-ctrl.c struct qmi_handle qmi; qmi 148 drivers/slimbus/qcom-ngd-ctrl.c struct qcom_slim_ngd_qmi qmi; qmi 344 drivers/slimbus/qcom-ngd-ctrl.c rc = qmi_txn_init(ctrl->qmi.handle, &txn, qmi 351 drivers/slimbus/qcom-ngd-ctrl.c rc = qmi_send_request(ctrl->qmi.handle, NULL, &txn, qmi 397 drivers/slimbus/qcom-ngd-ctrl.c rc = qmi_txn_init(ctrl->qmi.handle, &txn, qmi 400 drivers/slimbus/qcom-ngd-ctrl.c rc = qmi_send_request(ctrl->qmi.handle, NULL, &txn, qmi 456 drivers/slimbus/qcom-ngd-ctrl.c (struct sockaddr *)&ctrl->qmi.svc_info, qmi 457 drivers/slimbus/qcom-ngd-ctrl.c sizeof(ctrl->qmi.svc_info), 0); qmi 473 drivers/slimbus/qcom-ngd-ctrl.c ctrl->qmi.handle = handle; qmi 484 drivers/slimbus/qcom-ngd-ctrl.c ctrl->qmi.handle = NULL; qmi 494 drivers/slimbus/qcom-ngd-ctrl.c if (!ctrl->qmi.handle) qmi 497 drivers/slimbus/qcom-ngd-ctrl.c qmi_handle_release(ctrl->qmi.handle); qmi 498 drivers/slimbus/qcom-ngd-ctrl.c devm_kfree(ctrl->dev, ctrl->qmi.handle); qmi 499 drivers/slimbus/qcom-ngd-ctrl.c ctrl->qmi.handle = NULL; qmi 1086 drivers/slimbus/qcom-ngd-ctrl.c timeout = wait_for_completion_timeout(&ctrl->qmi.qmi_comp, HZ); qmi 1230 drivers/slimbus/qcom-ngd-ctrl.c complete(&ctrl->qmi.qmi_comp); qmi 1257 drivers/slimbus/qcom-ngd-ctrl.c struct qcom_slim_ngd_qmi *qmi = qmi 1260 drivers/slimbus/qcom-ngd-ctrl.c container_of(qmi, struct qcom_slim_ngd_ctrl, qmi); qmi 1262 drivers/slimbus/qcom-ngd-ctrl.c qmi->svc_info.sq_family = AF_QIPCRTR; qmi 1263 drivers/slimbus/qcom-ngd-ctrl.c qmi->svc_info.sq_node = service->node; qmi 1264 drivers/slimbus/qcom-ngd-ctrl.c qmi->svc_info.sq_port = service->port; qmi 1274 drivers/slimbus/qcom-ngd-ctrl.c struct qcom_slim_ngd_qmi *qmi = qmi 1277 drivers/slimbus/qcom-ngd-ctrl.c qmi->svc_info.sq_node = 0; qmi 1278 drivers/slimbus/qcom-ngd-ctrl.c qmi->svc_info.sq_port = 0; qmi 1288 drivers/slimbus/qcom-ngd-ctrl.c struct qcom_slim_ngd_qmi *qmi = &ctrl->qmi; qmi 1291 drivers/slimbus/qcom-ngd-ctrl.c ret = qmi_handle_init(&qmi->svc_event_hdl, 0, qmi 1298 drivers/slimbus/qcom-ngd-ctrl.c ret = qmi_add_lookup(&qmi->svc_event_hdl, SLIMBUS_QMI_SVC_ID, qmi 1302 drivers/slimbus/qcom-ngd-ctrl.c qmi_handle_release(&qmi->svc_event_hdl); qmi 1307 drivers/slimbus/qcom-ngd-ctrl.c static void qcom_slim_ngd_qmi_svc_event_deinit(struct qcom_slim_ngd_qmi *qmi) qmi 1309 drivers/slimbus/qcom-ngd-ctrl.c qmi_handle_release(&qmi->svc_event_hdl); qmi 1399 drivers/slimbus/qcom-ngd-ctrl.c qcom_slim_ngd_qmi_svc_event_deinit(&ctrl->qmi); qmi 1452 drivers/slimbus/qcom-ngd-ctrl.c init_completion(&ctrl->qmi.qmi_comp); qmi 1472 drivers/slimbus/qcom-ngd-ctrl.c qcom_slim_ngd_qmi_svc_event_deinit(&ctrl->qmi); qmi 17 drivers/soc/qcom/qmi_interface.c static struct socket *qmi_sock_create(struct qmi_handle *qmi, qmi 31 drivers/soc/qcom/qmi_interface.c static void qmi_recv_new_server(struct qmi_handle *qmi, qmi 35 drivers/soc/qcom/qmi_interface.c struct qmi_ops *ops = &qmi->ops; qmi 56 drivers/soc/qcom/qmi_interface.c ret = ops->new_server(qmi, svc); qmi 60 drivers/soc/qcom/qmi_interface.c list_add(&svc->list_node, &qmi->lookup_results); qmi 72 drivers/soc/qcom/qmi_interface.c static void qmi_recv_del_server(struct qmi_handle *qmi, qmi 75 drivers/soc/qcom/qmi_interface.c struct qmi_ops *ops = &qmi->ops; qmi 79 drivers/soc/qcom/qmi_interface.c list_for_each_entry_safe(svc, tmp, &qmi->lookup_results, list_node) { qmi 86 drivers/soc/qcom/qmi_interface.c ops->del_server(qmi, svc); qmi 102 drivers/soc/qcom/qmi_interface.c static void qmi_recv_bye(struct qmi_handle *qmi, qmi 105 drivers/soc/qcom/qmi_interface.c struct qmi_ops *ops = &qmi->ops; qmi 107 drivers/soc/qcom/qmi_interface.c qmi_recv_del_server(qmi, node, -1); qmi 110 drivers/soc/qcom/qmi_interface.c ops->bye(qmi, node); qmi 121 drivers/soc/qcom/qmi_interface.c static void qmi_recv_del_client(struct qmi_handle *qmi, qmi 124 drivers/soc/qcom/qmi_interface.c struct qmi_ops *ops = &qmi->ops; qmi 127 drivers/soc/qcom/qmi_interface.c ops->del_client(qmi, node, port); qmi 130 drivers/soc/qcom/qmi_interface.c static void qmi_recv_ctrl_pkt(struct qmi_handle *qmi, qmi 142 drivers/soc/qcom/qmi_interface.c qmi_recv_bye(qmi, le32_to_cpu(pkt->client.node)); qmi 145 drivers/soc/qcom/qmi_interface.c qmi_recv_new_server(qmi, qmi 152 drivers/soc/qcom/qmi_interface.c qmi_recv_del_server(qmi, qmi 157 drivers/soc/qcom/qmi_interface.c qmi_recv_del_client(qmi, qmi 164 drivers/soc/qcom/qmi_interface.c static void qmi_send_new_lookup(struct qmi_handle *qmi, struct qmi_service *svc) qmi 177 drivers/soc/qcom/qmi_interface.c sq.sq_family = qmi->sq.sq_family; qmi 178 drivers/soc/qcom/qmi_interface.c sq.sq_node = qmi->sq.sq_node; qmi 184 drivers/soc/qcom/qmi_interface.c mutex_lock(&qmi->sock_lock); qmi 185 drivers/soc/qcom/qmi_interface.c if (qmi->sock) { qmi 186 drivers/soc/qcom/qmi_interface.c ret = kernel_sendmsg(qmi->sock, &msg, &iv, 1, sizeof(pkt)); qmi 190 drivers/soc/qcom/qmi_interface.c mutex_unlock(&qmi->sock_lock); qmi 206 drivers/soc/qcom/qmi_interface.c int qmi_add_lookup(struct qmi_handle *qmi, unsigned int service, qmi 219 drivers/soc/qcom/qmi_interface.c list_add(&svc->list_node, &qmi->lookups); qmi 221 drivers/soc/qcom/qmi_interface.c qmi_send_new_lookup(qmi, svc); qmi 227 drivers/soc/qcom/qmi_interface.c static void qmi_send_new_server(struct qmi_handle *qmi, struct qmi_service *svc) qmi 239 drivers/soc/qcom/qmi_interface.c pkt.server.node = cpu_to_le32(qmi->sq.sq_node); qmi 240 drivers/soc/qcom/qmi_interface.c pkt.server.port = cpu_to_le32(qmi->sq.sq_port); qmi 242 drivers/soc/qcom/qmi_interface.c sq.sq_family = qmi->sq.sq_family; qmi 243 drivers/soc/qcom/qmi_interface.c sq.sq_node = qmi->sq.sq_node; qmi 249 drivers/soc/qcom/qmi_interface.c mutex_lock(&qmi->sock_lock); qmi 250 drivers/soc/qcom/qmi_interface.c if (qmi->sock) { qmi 251 drivers/soc/qcom/qmi_interface.c ret = kernel_sendmsg(qmi->sock, &msg, &iv, 1, sizeof(pkt)); qmi 255 drivers/soc/qcom/qmi_interface.c mutex_unlock(&qmi->sock_lock); qmi 270 drivers/soc/qcom/qmi_interface.c int qmi_add_server(struct qmi_handle *qmi, unsigned int service, qmi 283 drivers/soc/qcom/qmi_interface.c list_add(&svc->list_node, &qmi->services); qmi 285 drivers/soc/qcom/qmi_interface.c qmi_send_new_server(qmi, svc); qmi 307 drivers/soc/qcom/qmi_interface.c int qmi_txn_init(struct qmi_handle *qmi, struct qmi_txn *txn, qmi 316 drivers/soc/qcom/qmi_interface.c txn->qmi = qmi; qmi 320 drivers/soc/qcom/qmi_interface.c mutex_lock(&qmi->txn_lock); qmi 321 drivers/soc/qcom/qmi_interface.c ret = idr_alloc_cyclic(&qmi->txns, txn, 0, U16_MAX, GFP_KERNEL); qmi 326 drivers/soc/qcom/qmi_interface.c mutex_unlock(&qmi->txn_lock); qmi 345 drivers/soc/qcom/qmi_interface.c struct qmi_handle *qmi = txn->qmi; qmi 350 drivers/soc/qcom/qmi_interface.c mutex_lock(&qmi->txn_lock); qmi 352 drivers/soc/qcom/qmi_interface.c idr_remove(&qmi->txns, txn->id); qmi 354 drivers/soc/qcom/qmi_interface.c mutex_unlock(&qmi->txn_lock); qmi 369 drivers/soc/qcom/qmi_interface.c struct qmi_handle *qmi = txn->qmi; qmi 371 drivers/soc/qcom/qmi_interface.c mutex_lock(&qmi->txn_lock); qmi 373 drivers/soc/qcom/qmi_interface.c idr_remove(&qmi->txns, txn->id); qmi 375 drivers/soc/qcom/qmi_interface.c mutex_unlock(&qmi->txn_lock); qmi 389 drivers/soc/qcom/qmi_interface.c static void qmi_invoke_handler(struct qmi_handle *qmi, struct sockaddr_qrtr *sq, qmi 397 drivers/soc/qcom/qmi_interface.c if (!qmi->handlers) qmi 400 drivers/soc/qcom/qmi_interface.c for (handler = qmi->handlers; handler->fn; handler++) { qmi 417 drivers/soc/qcom/qmi_interface.c handler->fn(qmi, sq, txn, dest); qmi 439 drivers/soc/qcom/qmi_interface.c static void qmi_handle_net_reset(struct qmi_handle *qmi) qmi 445 drivers/soc/qcom/qmi_interface.c sock = qmi_sock_create(qmi, &sq); qmi 449 drivers/soc/qcom/qmi_interface.c mutex_lock(&qmi->sock_lock); qmi 450 drivers/soc/qcom/qmi_interface.c sock_release(qmi->sock); qmi 451 drivers/soc/qcom/qmi_interface.c qmi->sock = NULL; qmi 452 drivers/soc/qcom/qmi_interface.c mutex_unlock(&qmi->sock_lock); qmi 454 drivers/soc/qcom/qmi_interface.c qmi_recv_del_server(qmi, -1, -1); qmi 456 drivers/soc/qcom/qmi_interface.c if (qmi->ops.net_reset) qmi 457 drivers/soc/qcom/qmi_interface.c qmi->ops.net_reset(qmi); qmi 459 drivers/soc/qcom/qmi_interface.c mutex_lock(&qmi->sock_lock); qmi 460 drivers/soc/qcom/qmi_interface.c qmi->sock = sock; qmi 461 drivers/soc/qcom/qmi_interface.c qmi->sq = sq; qmi 462 drivers/soc/qcom/qmi_interface.c mutex_unlock(&qmi->sock_lock); qmi 464 drivers/soc/qcom/qmi_interface.c list_for_each_entry(svc, &qmi->lookups, list_node) qmi 465 drivers/soc/qcom/qmi_interface.c qmi_send_new_lookup(qmi, svc); qmi 467 drivers/soc/qcom/qmi_interface.c list_for_each_entry(svc, &qmi->services, list_node) qmi 468 drivers/soc/qcom/qmi_interface.c qmi_send_new_server(qmi, svc); qmi 471 drivers/soc/qcom/qmi_interface.c static void qmi_handle_message(struct qmi_handle *qmi, qmi 489 drivers/soc/qcom/qmi_interface.c mutex_lock(&qmi->txn_lock); qmi 490 drivers/soc/qcom/qmi_interface.c txn = idr_find(&qmi->txns, hdr->txn_id); qmi 494 drivers/soc/qcom/qmi_interface.c mutex_unlock(&qmi->txn_lock); qmi 499 drivers/soc/qcom/qmi_interface.c mutex_unlock(&qmi->txn_lock); qmi 509 drivers/soc/qcom/qmi_interface.c qmi_invoke_handler(qmi, sq, txn, buf, len); qmi 518 drivers/soc/qcom/qmi_interface.c qmi_invoke_handler(qmi, sq, &tmp_txn, buf, len); qmi 524 drivers/soc/qcom/qmi_interface.c struct qmi_handle *qmi = container_of(work, struct qmi_handle, work); qmi 525 drivers/soc/qcom/qmi_interface.c struct qmi_ops *ops = &qmi->ops; qmi 532 drivers/soc/qcom/qmi_interface.c iv.iov_base = qmi->recv_buf; qmi 533 drivers/soc/qcom/qmi_interface.c iv.iov_len = qmi->recv_buf_size; qmi 535 drivers/soc/qcom/qmi_interface.c mutex_lock(&qmi->sock_lock); qmi 536 drivers/soc/qcom/qmi_interface.c if (qmi->sock) qmi 537 drivers/soc/qcom/qmi_interface.c msglen = kernel_recvmsg(qmi->sock, &msg, &iv, 1, qmi 541 drivers/soc/qcom/qmi_interface.c mutex_unlock(&qmi->sock_lock); qmi 546 drivers/soc/qcom/qmi_interface.c qmi_handle_net_reset(qmi); qmi 557 drivers/soc/qcom/qmi_interface.c if (sq.sq_node == qmi->sq.sq_node && qmi 559 drivers/soc/qcom/qmi_interface.c qmi_recv_ctrl_pkt(qmi, qmi->recv_buf, msglen); qmi 561 drivers/soc/qcom/qmi_interface.c ops->msg_handler(qmi, &sq, qmi->recv_buf, msglen); qmi 563 drivers/soc/qcom/qmi_interface.c qmi_handle_message(qmi, &sq, qmi->recv_buf, msglen); qmi 570 drivers/soc/qcom/qmi_interface.c struct qmi_handle *qmi = sk->sk_user_data; qmi 576 drivers/soc/qcom/qmi_interface.c if (!qmi) qmi 579 drivers/soc/qcom/qmi_interface.c queue_work(qmi->wq, &qmi->work); qmi 582 drivers/soc/qcom/qmi_interface.c static struct socket *qmi_sock_create(struct qmi_handle *qmi, qmi 599 drivers/soc/qcom/qmi_interface.c sock->sk->sk_user_data = qmi; qmi 618 drivers/soc/qcom/qmi_interface.c int qmi_handle_init(struct qmi_handle *qmi, size_t recv_buf_size, qmi 624 drivers/soc/qcom/qmi_interface.c mutex_init(&qmi->txn_lock); qmi 625 drivers/soc/qcom/qmi_interface.c mutex_init(&qmi->sock_lock); qmi 627 drivers/soc/qcom/qmi_interface.c idr_init(&qmi->txns); qmi 629 drivers/soc/qcom/qmi_interface.c INIT_LIST_HEAD(&qmi->lookups); qmi 630 drivers/soc/qcom/qmi_interface.c INIT_LIST_HEAD(&qmi->lookup_results); qmi 631 drivers/soc/qcom/qmi_interface.c INIT_LIST_HEAD(&qmi->services); qmi 633 drivers/soc/qcom/qmi_interface.c INIT_WORK(&qmi->work, qmi_data_ready_work); qmi 635 drivers/soc/qcom/qmi_interface.c qmi->handlers = handlers; qmi 637 drivers/soc/qcom/qmi_interface.c qmi->ops = *ops; qmi 645 drivers/soc/qcom/qmi_interface.c qmi->recv_buf_size = recv_buf_size; qmi 646 drivers/soc/qcom/qmi_interface.c qmi->recv_buf = kzalloc(recv_buf_size, GFP_KERNEL); qmi 647 drivers/soc/qcom/qmi_interface.c if (!qmi->recv_buf) qmi 650 drivers/soc/qcom/qmi_interface.c qmi->wq = alloc_workqueue("qmi_msg_handler", WQ_UNBOUND, 1); qmi 651 drivers/soc/qcom/qmi_interface.c if (!qmi->wq) { qmi 656 drivers/soc/qcom/qmi_interface.c qmi->sock = qmi_sock_create(qmi, &qmi->sq); qmi 657 drivers/soc/qcom/qmi_interface.c if (IS_ERR(qmi->sock)) { qmi 659 drivers/soc/qcom/qmi_interface.c ret = PTR_ERR(qmi->sock); qmi 666 drivers/soc/qcom/qmi_interface.c destroy_workqueue(qmi->wq); qmi 668 drivers/soc/qcom/qmi_interface.c kfree(qmi->recv_buf); qmi 680 drivers/soc/qcom/qmi_interface.c void qmi_handle_release(struct qmi_handle *qmi) qmi 682 drivers/soc/qcom/qmi_interface.c struct socket *sock = qmi->sock; qmi 686 drivers/soc/qcom/qmi_interface.c cancel_work_sync(&qmi->work); qmi 688 drivers/soc/qcom/qmi_interface.c qmi_recv_del_server(qmi, -1, -1); qmi 690 drivers/soc/qcom/qmi_interface.c mutex_lock(&qmi->sock_lock); qmi 692 drivers/soc/qcom/qmi_interface.c qmi->sock = NULL; qmi 693 drivers/soc/qcom/qmi_interface.c mutex_unlock(&qmi->sock_lock); qmi 695 drivers/soc/qcom/qmi_interface.c destroy_workqueue(qmi->wq); qmi 697 drivers/soc/qcom/qmi_interface.c idr_destroy(&qmi->txns); qmi 699 drivers/soc/qcom/qmi_interface.c kfree(qmi->recv_buf); qmi 702 drivers/soc/qcom/qmi_interface.c list_for_each_entry_safe(svc, tmp, &qmi->lookups, list_node) { qmi 708 drivers/soc/qcom/qmi_interface.c list_for_each_entry_safe(svc, tmp, &qmi->services, list_node) { qmi 732 drivers/soc/qcom/qmi_interface.c static ssize_t qmi_send_message(struct qmi_handle *qmi, qmi 757 drivers/soc/qcom/qmi_interface.c mutex_lock(&qmi->sock_lock); qmi 758 drivers/soc/qcom/qmi_interface.c if (qmi->sock) { qmi 759 drivers/soc/qcom/qmi_interface.c ret = kernel_sendmsg(qmi->sock, &msghdr, &iv, 1, len); qmi 765 drivers/soc/qcom/qmi_interface.c mutex_unlock(&qmi->sock_lock); qmi 784 drivers/soc/qcom/qmi_interface.c ssize_t qmi_send_request(struct qmi_handle *qmi, struct sockaddr_qrtr *sq, qmi 788 drivers/soc/qcom/qmi_interface.c return qmi_send_message(qmi, sq, txn, QMI_REQUEST, msg_id, len, ei, qmi 805 drivers/soc/qcom/qmi_interface.c ssize_t qmi_send_response(struct qmi_handle *qmi, struct sockaddr_qrtr *sq, qmi 809 drivers/soc/qcom/qmi_interface.c return qmi_send_message(qmi, sq, txn, QMI_RESPONSE, msg_id, len, ei, qmi 825 drivers/soc/qcom/qmi_interface.c ssize_t qmi_send_indication(struct qmi_handle *qmi, struct sockaddr_qrtr *sq, qmi 833 drivers/soc/qcom/qmi_interface.c ret = qmi_txn_init(qmi, &txn, NULL, NULL); qmi 837 drivers/soc/qcom/qmi_interface.c rval = qmi_send_message(qmi, sq, &txn, QMI_INDICATION, msg_id, len, ei, qmi 146 include/linux/soc/qcom/qmi.h int (*new_server)(struct qmi_handle *qmi, struct qmi_service *svc); qmi 147 include/linux/soc/qcom/qmi.h void (*del_server)(struct qmi_handle *qmi, struct qmi_service *svc); qmi 148 include/linux/soc/qcom/qmi.h void (*net_reset)(struct qmi_handle *qmi); qmi 149 include/linux/soc/qcom/qmi.h void (*msg_handler)(struct qmi_handle *qmi, struct sockaddr_qrtr *sq, qmi 151 include/linux/soc/qcom/qmi.h void (*bye)(struct qmi_handle *qmi, unsigned int node); qmi 152 include/linux/soc/qcom/qmi.h void (*del_client)(struct qmi_handle *qmi, qmi 167 include/linux/soc/qcom/qmi.h struct qmi_handle *qmi; qmi 194 include/linux/soc/qcom/qmi.h void (*fn)(struct qmi_handle *qmi, struct sockaddr_qrtr *sq, qmi 239 include/linux/soc/qcom/qmi.h int qmi_add_lookup(struct qmi_handle *qmi, unsigned int service, qmi 241 include/linux/soc/qcom/qmi.h int qmi_add_server(struct qmi_handle *qmi, unsigned int service, qmi 244 include/linux/soc/qcom/qmi.h int qmi_handle_init(struct qmi_handle *qmi, size_t max_msg_len, qmi 247 include/linux/soc/qcom/qmi.h void qmi_handle_release(struct qmi_handle *qmi); qmi 249 include/linux/soc/qcom/qmi.h ssize_t qmi_send_request(struct qmi_handle *qmi, struct sockaddr_qrtr *sq, qmi 252 include/linux/soc/qcom/qmi.h ssize_t qmi_send_response(struct qmi_handle *qmi, struct sockaddr_qrtr *sq, qmi 255 include/linux/soc/qcom/qmi.h ssize_t qmi_send_indication(struct qmi_handle *qmi, struct sockaddr_qrtr *sq, qmi 266 include/linux/soc/qcom/qmi.h int qmi_txn_init(struct qmi_handle *qmi, struct qmi_txn *txn, qmi 304 samples/qmi/qmi_sample_client.c struct qmi_handle *qmi = file->private_data; qmi 311 samples/qmi/qmi_sample_client.c ret = qmi_txn_init(qmi, &txn, NULL, NULL); qmi 315 samples/qmi/qmi_sample_client.c ret = qmi_send_request(qmi, NULL, &txn, qmi 336 samples/qmi/qmi_sample_client.c static void ping_pong_cb(struct qmi_handle *qmi, struct sockaddr_qrtr *sq, qmi 372 samples/qmi/qmi_sample_client.c struct qmi_handle *qmi = file->private_data; qmi 394 samples/qmi/qmi_sample_client.c ret = qmi_txn_init(qmi, &txn, test_data_resp_msg_v01_ei, resp); qmi 398 samples/qmi/qmi_sample_client.c ret = qmi_send_request(qmi, NULL, &txn, qmi 444 samples/qmi/qmi_sample_client.c struct qmi_handle qmi; qmi 464 samples/qmi/qmi_sample_client.c ret = qmi_handle_init(&sample->qmi, TEST_DATA_REQ_MAX_MSG_LEN_V01, qmi 471 samples/qmi/qmi_sample_client.c ret = kernel_connect(sample->qmi.sock, (struct sockaddr *)sq, qmi 509 samples/qmi/qmi_sample_client.c qmi_handle_release(&sample->qmi); qmi 522 samples/qmi/qmi_sample_client.c qmi_handle_release(&sample->qmi); qmi 535 samples/qmi/qmi_sample_client.c static int qmi_sample_new_server(struct qmi_handle *qmi, qmi 564 samples/qmi/qmi_sample_client.c static void qmi_sample_del_server(struct qmi_handle *qmi,