• Home
  • Raw
  • Download

Lines Matching full:qmi

26 static int ath10k_qmi_map_msa_permission(struct ath10k_qmi *qmi,  in ath10k_qmi_map_msa_permission()  argument
30 struct ath10k *ar = qmi->ar; in ath10k_qmi_map_msa_permission()
58 static int ath10k_qmi_unmap_msa_permission(struct ath10k_qmi *qmi, in ath10k_qmi_unmap_msa_permission() argument
62 struct ath10k *ar = qmi->ar; in ath10k_qmi_unmap_msa_permission()
82 static int ath10k_qmi_setup_msa_permissions(struct ath10k_qmi *qmi) in ath10k_qmi_setup_msa_permissions() argument
87 if (qmi->msa_fixed_perm) in ath10k_qmi_setup_msa_permissions()
90 for (i = 0; i < qmi->nr_mem_region; i++) { in ath10k_qmi_setup_msa_permissions()
91 ret = ath10k_qmi_map_msa_permission(qmi, &qmi->mem_region[i]); in ath10k_qmi_setup_msa_permissions()
100 ath10k_qmi_unmap_msa_permission(qmi, &qmi->mem_region[i]); in ath10k_qmi_setup_msa_permissions()
104 static void ath10k_qmi_remove_msa_permission(struct ath10k_qmi *qmi) in ath10k_qmi_remove_msa_permission() argument
108 if (qmi->msa_fixed_perm) in ath10k_qmi_remove_msa_permission()
111 for (i = 0; i < qmi->nr_mem_region; i++) in ath10k_qmi_remove_msa_permission()
112 ath10k_qmi_unmap_msa_permission(qmi, &qmi->mem_region[i]); in ath10k_qmi_remove_msa_permission()
115 static int ath10k_qmi_msa_mem_info_send_sync_msg(struct ath10k_qmi *qmi) in ath10k_qmi_msa_mem_info_send_sync_msg() argument
119 struct ath10k *ar = qmi->ar; in ath10k_qmi_msa_mem_info_send_sync_msg()
128 ret = qmi_txn_init(&qmi->qmi_hdl, &txn, in ath10k_qmi_msa_mem_info_send_sync_msg()
133 ret = qmi_send_request(&qmi->qmi_hdl, NULL, &txn, in ath10k_qmi_msa_mem_info_send_sync_msg()
161 qmi->nr_mem_region = resp.mem_region_info_len; in ath10k_qmi_msa_mem_info_send_sync_msg()
174 qmi->mem_region[i].addr = resp.mem_region_info[i].region_addr; in ath10k_qmi_msa_mem_info_send_sync_msg()
175 qmi->mem_region[i].size = resp.mem_region_info[i].size; in ath10k_qmi_msa_mem_info_send_sync_msg()
176 qmi->mem_region[i].secure = resp.mem_region_info[i].secure_flag; in ath10k_qmi_msa_mem_info_send_sync_msg()
178 "qmi msa mem region %d addr 0x%pa size 0x%x flag 0x%08x\n", in ath10k_qmi_msa_mem_info_send_sync_msg()
179 i, &qmi->mem_region[i].addr, in ath10k_qmi_msa_mem_info_send_sync_msg()
180 qmi->mem_region[i].size, in ath10k_qmi_msa_mem_info_send_sync_msg()
181 qmi->mem_region[i].secure); in ath10k_qmi_msa_mem_info_send_sync_msg()
184 ath10k_dbg(ar, ATH10K_DBG_QMI, "qmi msa mem info request completed\n"); in ath10k_qmi_msa_mem_info_send_sync_msg()
188 memset(&qmi->mem_region[0], 0, sizeof(qmi->mem_region[0]) * i); in ath10k_qmi_msa_mem_info_send_sync_msg()
193 static int ath10k_qmi_msa_ready_send_sync_msg(struct ath10k_qmi *qmi) in ath10k_qmi_msa_ready_send_sync_msg() argument
197 struct ath10k *ar = qmi->ar; in ath10k_qmi_msa_ready_send_sync_msg()
201 ret = qmi_txn_init(&qmi->qmi_hdl, &txn, in ath10k_qmi_msa_ready_send_sync_msg()
206 ret = qmi_send_request(&qmi->qmi_hdl, NULL, &txn, in ath10k_qmi_msa_ready_send_sync_msg()
225 ath10k_dbg(ar, ATH10K_DBG_QMI, "qmi msa mem ready request completed\n"); in ath10k_qmi_msa_ready_send_sync_msg()
232 static int ath10k_qmi_bdf_dnld_send_sync(struct ath10k_qmi *qmi) in ath10k_qmi_bdf_dnld_send_sync() argument
236 struct ath10k *ar = qmi->ar; in ath10k_qmi_bdf_dnld_send_sync()
268 ret = qmi_txn_init(&qmi->qmi_hdl, &txn, in ath10k_qmi_bdf_dnld_send_sync()
274 ret = qmi_send_request(&qmi->qmi_hdl, NULL, &txn, in ath10k_qmi_bdf_dnld_send_sync()
308 ath10k_dbg(ar, ATH10K_DBG_QMI, "qmi bdf download request completed\n"); in ath10k_qmi_bdf_dnld_send_sync()
318 static int ath10k_qmi_send_cal_report_req(struct ath10k_qmi *qmi) in ath10k_qmi_send_cal_report_req() argument
322 struct ath10k *ar = qmi->ar; in ath10k_qmi_send_cal_report_req()
333 ret = qmi_txn_init(&qmi->qmi_hdl, &txn, wlfw_cal_report_resp_msg_v01_ei, in ath10k_qmi_send_cal_report_req()
339 if (qmi->cal_data[i].total_size && in ath10k_qmi_send_cal_report_req()
340 qmi->cal_data[i].data) { in ath10k_qmi_send_cal_report_req()
341 req.meta_data[j] = qmi->cal_data[i].cal_id; in ath10k_qmi_send_cal_report_req()
347 ret = qmi_send_request(&qmi->qmi_hdl, NULL, &txn, in ath10k_qmi_send_cal_report_req()
367 ath10k_dbg(ar, ATH10K_DBG_QMI, "qmi cal report request completed\n"); in ath10k_qmi_send_cal_report_req()
378 struct ath10k_qmi *qmi = ar_snoc->qmi; in ath10k_qmi_mode_send_sync_msg() local
384 ret = qmi_txn_init(&qmi->qmi_hdl, &txn, in ath10k_qmi_mode_send_sync_msg()
394 ret = qmi_send_request(&qmi->qmi_hdl, NULL, &txn, in ath10k_qmi_mode_send_sync_msg()
414 ath10k_dbg(ar, ATH10K_DBG_QMI, "qmi wlan mode req completed: %d\n", mode); in ath10k_qmi_mode_send_sync_msg()
427 struct ath10k_qmi *qmi = ar_snoc->qmi; in ath10k_qmi_cfg_send_sync_msg() local
438 ret = qmi_txn_init(&qmi->qmi_hdl, &txn, in ath10k_qmi_cfg_send_sync_msg()
480 ret = qmi_send_request(&qmi->qmi_hdl, NULL, &txn, in ath10k_qmi_cfg_send_sync_msg()
500 ath10k_dbg(ar, ATH10K_DBG_QMI, "qmi config request completed\n"); in ath10k_qmi_cfg_send_sync_msg()
516 ath10k_dbg(ar, ATH10K_DBG_QMI, "qmi mode %d config %p\n", in ath10k_qmi_wlan_enable()
521 ath10k_err(ar, "failed to send qmi config: %d\n", ret); in ath10k_qmi_wlan_enable()
527 ath10k_err(ar, "failed to send qmi mode: %d\n", ret); in ath10k_qmi_wlan_enable()
539 static int ath10k_qmi_cap_send_sync_msg(struct ath10k_qmi *qmi) in ath10k_qmi_cap_send_sync_msg() argument
543 struct ath10k *ar = qmi->ar; in ath10k_qmi_cap_send_sync_msg()
552 ret = qmi_txn_init(&qmi->qmi_hdl, &txn, wlfw_cap_resp_msg_v01_ei, resp); in ath10k_qmi_cap_send_sync_msg()
556 ret = qmi_send_request(&qmi->qmi_hdl, NULL, &txn, in ath10k_qmi_cap_send_sync_msg()
577 qmi->chip_info.chip_id = resp->chip_info.chip_id; in ath10k_qmi_cap_send_sync_msg()
578 qmi->chip_info.chip_family = resp->chip_info.chip_family; in ath10k_qmi_cap_send_sync_msg()
580 qmi->chip_info.chip_id = 0xFF; in ath10k_qmi_cap_send_sync_msg()
584 qmi->board_info.board_id = resp->board_info.board_id; in ath10k_qmi_cap_send_sync_msg()
586 qmi->board_info.board_id = 0xFF; in ath10k_qmi_cap_send_sync_msg()
589 qmi->soc_info.soc_id = resp->soc_info.soc_id; in ath10k_qmi_cap_send_sync_msg()
592 qmi->fw_version = resp->fw_version_info.fw_version; in ath10k_qmi_cap_send_sync_msg()
593 strlcpy(qmi->fw_build_timestamp, resp->fw_version_info.fw_build_timestamp, in ath10k_qmi_cap_send_sync_msg()
594 sizeof(qmi->fw_build_timestamp)); in ath10k_qmi_cap_send_sync_msg()
598 strlcpy(qmi->fw_build_id, resp->fw_build_id, in ath10k_qmi_cap_send_sync_msg()
602 ath10k_info(ar, "qmi chip_id 0x%x chip_family 0x%x board_id 0x%x soc_id 0x%x", in ath10k_qmi_cap_send_sync_msg()
603 qmi->chip_info.chip_id, qmi->chip_info.chip_family, in ath10k_qmi_cap_send_sync_msg()
604 qmi->board_info.board_id, qmi->soc_info.soc_id); in ath10k_qmi_cap_send_sync_msg()
605 ath10k_info(ar, "qmi fw_version 0x%x fw_build_timestamp %s fw_build_id %s", in ath10k_qmi_cap_send_sync_msg()
606 qmi->fw_version, qmi->fw_build_timestamp, qmi->fw_build_id); in ath10k_qmi_cap_send_sync_msg()
617 static int ath10k_qmi_host_cap_send_sync(struct ath10k_qmi *qmi) in ath10k_qmi_host_cap_send_sync() argument
622 struct ath10k *ar = qmi->ar; in ath10k_qmi_host_cap_send_sync()
630 ret = qmi_txn_init(&qmi->qmi_hdl, &txn, wlfw_host_cap_resp_msg_v01_ei, in ath10k_qmi_host_cap_send_sync()
640 ret = qmi_send_request(&qmi->qmi_hdl, NULL, &txn, in ath10k_qmi_host_cap_send_sync()
662 ath10k_dbg(ar, ATH10K_DBG_QMI, "qmi host capability request completed\n"); in ath10k_qmi_host_cap_send_sync()
673 struct ath10k_qmi *qmi = ar_snoc->qmi; in ath10k_qmi_set_fw_log_mode() local
681 ret = qmi_txn_init(&qmi->qmi_hdl, &txn, wlfw_ini_resp_msg_v01_ei, in ath10k_qmi_set_fw_log_mode()
686 ret = qmi_send_request(&qmi->qmi_hdl, NULL, &txn, in ath10k_qmi_set_fw_log_mode()
706 ath10k_dbg(ar, ATH10K_DBG_QMI, "qmi fw log request completed, mode: %d\n", in ath10k_qmi_set_fw_log_mode()
715 ath10k_qmi_ind_register_send_sync_msg(struct ath10k_qmi *qmi) in ath10k_qmi_ind_register_send_sync_msg() argument
719 struct ath10k *ar = qmi->ar; in ath10k_qmi_ind_register_send_sync_msg()
736 ret = qmi_txn_init(&qmi->qmi_hdl, &txn, in ath10k_qmi_ind_register_send_sync_msg()
741 ret = qmi_send_request(&qmi->qmi_hdl, NULL, &txn, in ath10k_qmi_ind_register_send_sync_msg()
763 qmi->fw_ready = true; in ath10k_qmi_ind_register_send_sync_msg()
765 ath10k_dbg(ar, ATH10K_DBG_QMI, "qmi indication register request completed\n"); in ath10k_qmi_ind_register_send_sync_msg()
772 static void ath10k_qmi_event_server_arrive(struct ath10k_qmi *qmi) in ath10k_qmi_event_server_arrive() argument
774 struct ath10k *ar = qmi->ar; in ath10k_qmi_event_server_arrive()
777 ret = ath10k_qmi_ind_register_send_sync_msg(qmi); in ath10k_qmi_event_server_arrive()
781 if (qmi->fw_ready) { in ath10k_qmi_event_server_arrive()
786 ret = ath10k_qmi_host_cap_send_sync(qmi); in ath10k_qmi_event_server_arrive()
790 ret = ath10k_qmi_msa_mem_info_send_sync_msg(qmi); in ath10k_qmi_event_server_arrive()
801 ret = ath10k_qmi_setup_msa_permissions(qmi); in ath10k_qmi_event_server_arrive()
805 ret = ath10k_qmi_msa_ready_send_sync_msg(qmi); in ath10k_qmi_event_server_arrive()
809 ret = ath10k_qmi_cap_send_sync_msg(qmi); in ath10k_qmi_event_server_arrive()
816 ath10k_qmi_remove_msa_permission(qmi); in ath10k_qmi_event_server_arrive()
819 static int ath10k_qmi_fetch_board_file(struct ath10k_qmi *qmi) in ath10k_qmi_fetch_board_file() argument
821 struct ath10k *ar = qmi->ar; in ath10k_qmi_fetch_board_file()
826 ar->id.qmi_board_id = qmi->board_info.board_id; in ath10k_qmi_fetch_board_file()
827 ar->id.qmi_chip_id = qmi->chip_info.chip_id; in ath10k_qmi_fetch_board_file()
834 return ath10k_core_fetch_board_file(qmi->ar, ATH10K_BD_IE_BOARD); in ath10k_qmi_fetch_board_file()
838 ath10k_qmi_driver_event_post(struct ath10k_qmi *qmi, in ath10k_qmi_driver_event_post() argument
851 spin_lock(&qmi->event_lock); in ath10k_qmi_driver_event_post()
852 list_add_tail(&event->list, &qmi->event_list); in ath10k_qmi_driver_event_post()
853 spin_unlock(&qmi->event_lock); in ath10k_qmi_driver_event_post()
855 queue_work(qmi->event_wq, &qmi->event_work); in ath10k_qmi_driver_event_post()
860 static void ath10k_qmi_event_server_exit(struct ath10k_qmi *qmi) in ath10k_qmi_event_server_exit() argument
862 struct ath10k *ar = qmi->ar; in ath10k_qmi_event_server_exit()
865 ath10k_qmi_remove_msa_permission(qmi); in ath10k_qmi_event_server_exit()
871 ath10k_dbg(ar, ATH10K_DBG_QMI, "wifi fw qmi service disconnected\n"); in ath10k_qmi_event_server_exit()
874 static void ath10k_qmi_event_msa_ready(struct ath10k_qmi *qmi) in ath10k_qmi_event_msa_ready() argument
878 ret = ath10k_qmi_fetch_board_file(qmi); in ath10k_qmi_event_msa_ready()
882 ret = ath10k_qmi_bdf_dnld_send_sync(qmi); in ath10k_qmi_event_msa_ready()
886 ret = ath10k_qmi_send_cal_report_req(qmi); in ath10k_qmi_event_msa_ready()
892 static int ath10k_qmi_event_fw_ready_ind(struct ath10k_qmi *qmi) in ath10k_qmi_event_fw_ready_ind() argument
894 struct ath10k *ar = qmi->ar; in ath10k_qmi_event_fw_ready_ind()
906 struct ath10k_qmi *qmi = container_of(qmi_hdl, struct ath10k_qmi, qmi_hdl); in ath10k_qmi_fw_ready_ind() local
908 ath10k_qmi_driver_event_post(qmi, ATH10K_QMI_EVENT_FW_READY_IND, NULL); in ath10k_qmi_fw_ready_ind()
915 struct ath10k_qmi *qmi = container_of(qmi_hdl, struct ath10k_qmi, qmi_hdl); in ath10k_qmi_msa_ready_ind() local
917 ath10k_qmi_driver_event_post(qmi, ATH10K_QMI_EVENT_MSA_READY_IND, NULL); in ath10k_qmi_msa_ready_ind()
941 struct ath10k_qmi *qmi = container_of(qmi_hdl, struct ath10k_qmi, qmi_hdl); in ath10k_qmi_new_server() local
942 struct sockaddr_qrtr *sq = &qmi->sq; in ath10k_qmi_new_server()
943 struct ath10k *ar = qmi->ar; in ath10k_qmi_new_server()
950 ath10k_dbg(ar, ATH10K_DBG_QMI, "wifi fw qmi service found\n"); in ath10k_qmi_new_server()
952 ret = kernel_connect(qmi_hdl->sock, (struct sockaddr *)&qmi->sq, in ath10k_qmi_new_server()
953 sizeof(qmi->sq), 0); in ath10k_qmi_new_server()
955 ath10k_err(ar, "failed to connect to a remote QMI service port\n"); in ath10k_qmi_new_server()
959 ath10k_dbg(ar, ATH10K_DBG_QMI, "qmi wifi fw qmi service connected\n"); in ath10k_qmi_new_server()
960 ath10k_qmi_driver_event_post(qmi, ATH10K_QMI_EVENT_SERVER_ARRIVE, NULL); in ath10k_qmi_new_server()
968 struct ath10k_qmi *qmi = in ath10k_qmi_del_server() local
971 qmi->fw_ready = false; in ath10k_qmi_del_server()
975 * the qmi server. The qmi infrastructure sends del_server, when in ath10k_qmi_del_server()
976 * any client releases the qmi handle. In this case do not process in ath10k_qmi_del_server()
979 if (qmi->state == ATH10K_QMI_STATE_INIT_DONE) in ath10k_qmi_del_server()
980 ath10k_qmi_driver_event_post(qmi, ATH10K_QMI_EVENT_SERVER_EXIT, in ath10k_qmi_del_server()
991 struct ath10k_qmi *qmi = container_of(work, struct ath10k_qmi, in ath10k_qmi_driver_event_work() local
994 struct ath10k *ar = qmi->ar; in ath10k_qmi_driver_event_work()
996 spin_lock(&qmi->event_lock); in ath10k_qmi_driver_event_work()
997 while (!list_empty(&qmi->event_list)) { in ath10k_qmi_driver_event_work()
998 event = list_first_entry(&qmi->event_list, in ath10k_qmi_driver_event_work()
1001 spin_unlock(&qmi->event_lock); in ath10k_qmi_driver_event_work()
1005 ath10k_qmi_event_server_arrive(qmi); in ath10k_qmi_driver_event_work()
1008 ath10k_qmi_event_server_exit(qmi); in ath10k_qmi_driver_event_work()
1011 ath10k_qmi_event_fw_ready_ind(qmi); in ath10k_qmi_driver_event_work()
1014 ath10k_qmi_event_msa_ready(qmi); in ath10k_qmi_driver_event_work()
1021 spin_lock(&qmi->event_lock); in ath10k_qmi_driver_event_work()
1023 spin_unlock(&qmi->event_lock); in ath10k_qmi_driver_event_work()
1030 struct ath10k_qmi *qmi; in ath10k_qmi_init() local
1033 qmi = kzalloc(sizeof(*qmi), GFP_KERNEL); in ath10k_qmi_init()
1034 if (!qmi) in ath10k_qmi_init()
1037 qmi->ar = ar; in ath10k_qmi_init()
1038 ar_snoc->qmi = qmi; in ath10k_qmi_init()
1041 qmi->msa_fixed_perm = true; in ath10k_qmi_init()
1043 ret = qmi_handle_init(&qmi->qmi_hdl, in ath10k_qmi_init()
1049 qmi->event_wq = alloc_workqueue("ath10k_qmi_driver_event", in ath10k_qmi_init()
1051 if (!qmi->event_wq) { in ath10k_qmi_init()
1057 INIT_LIST_HEAD(&qmi->event_list); in ath10k_qmi_init()
1058 spin_lock_init(&qmi->event_lock); in ath10k_qmi_init()
1059 INIT_WORK(&qmi->event_work, ath10k_qmi_driver_event_work); in ath10k_qmi_init()
1061 ret = qmi_add_lookup(&qmi->qmi_hdl, WLFW_SERVICE_ID_V01, in ath10k_qmi_init()
1066 qmi->state = ATH10K_QMI_STATE_INIT_DONE; in ath10k_qmi_init()
1070 destroy_workqueue(qmi->event_wq); in ath10k_qmi_init()
1073 qmi_handle_release(&qmi->qmi_hdl); in ath10k_qmi_init()
1076 kfree(qmi); in ath10k_qmi_init()
1083 struct ath10k_qmi *qmi = ar_snoc->qmi; in ath10k_qmi_deinit() local
1085 qmi->state = ATH10K_QMI_STATE_DEINIT; in ath10k_qmi_deinit()
1086 qmi_handle_release(&qmi->qmi_hdl); in ath10k_qmi_deinit()
1087 cancel_work_sync(&qmi->event_work); in ath10k_qmi_deinit()
1088 destroy_workqueue(qmi->event_wq); in ath10k_qmi_deinit()
1089 kfree(qmi); in ath10k_qmi_deinit()
1090 ar_snoc->qmi = NULL; in ath10k_qmi_deinit()