Lines Matching refs:qmi

1719 	req.mem_cfg_mode = ab->qmi.target_mem_mode;  in ath11k_qmi_host_cap_send()
1737 req.cal_done = ab->qmi.cal_done; in ath11k_qmi_host_cap_send()
1760 ret = qmi_txn_init(&ab->qmi.handle, &txn, in ath11k_qmi_host_cap_send()
1765 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, in ath11k_qmi_host_cap_send()
1794 struct qmi_handle *handle = &ab->qmi.handle; in ath11k_qmi_fw_ind_register_send()
1838 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, in ath11k_qmi_fw_ind_register_send()
1890 ab->qmi.target_mem_delayed) { in ath11k_qmi_respond_fw_mem_request()
1893 ab->qmi.mem_seg_count); in ath11k_qmi_respond_fw_mem_request()
1897 req->mem_seg_len = ab->qmi.mem_seg_count; in ath11k_qmi_respond_fw_mem_request()
1900 req->mem_seg[i].addr = ab->qmi.target_mem[i].paddr; in ath11k_qmi_respond_fw_mem_request()
1901 req->mem_seg[i].size = ab->qmi.target_mem[i].size; in ath11k_qmi_respond_fw_mem_request()
1902 req->mem_seg[i].type = ab->qmi.target_mem[i].type; in ath11k_qmi_respond_fw_mem_request()
1905 &ab->qmi.target_mem[i].paddr, in ath11k_qmi_respond_fw_mem_request()
1906 ab->qmi.target_mem[i].size, in ath11k_qmi_respond_fw_mem_request()
1907 ab->qmi.target_mem[i].type); in ath11k_qmi_respond_fw_mem_request()
1911 ret = qmi_txn_init(&ab->qmi.handle, &txn, in ath11k_qmi_respond_fw_mem_request()
1919 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, in ath11k_qmi_respond_fw_mem_request()
1957 for (i = 0; i < ab->qmi.mem_seg_count; i++) { in ath11k_qmi_free_target_mem_chunk()
1960 ab->qmi.target_mem[i].iaddr) in ath11k_qmi_free_target_mem_chunk()
1961 iounmap(ab->qmi.target_mem[i].iaddr); in ath11k_qmi_free_target_mem_chunk()
1963 if (!ab->qmi.target_mem[i].vaddr) in ath11k_qmi_free_target_mem_chunk()
1967 ab->qmi.target_mem[i].size, in ath11k_qmi_free_target_mem_chunk()
1968 ab->qmi.target_mem[i].vaddr, in ath11k_qmi_free_target_mem_chunk()
1969 ab->qmi.target_mem[i].paddr); in ath11k_qmi_free_target_mem_chunk()
1970 ab->qmi.target_mem[i].vaddr = NULL; in ath11k_qmi_free_target_mem_chunk()
1979 ab->qmi.target_mem_delayed = false; in ath11k_qmi_alloc_target_mem_chunk()
1981 for (i = 0; i < ab->qmi.mem_seg_count; i++) { in ath11k_qmi_alloc_target_mem_chunk()
1982 chunk = &ab->qmi.target_mem[i]; in ath11k_qmi_alloc_target_mem_chunk()
2003 if (ab->qmi.mem_seg_count <= ATH11K_QMI_FW_MEM_REQ_SEGMENT_CNT) { in ath11k_qmi_alloc_target_mem_chunk()
2009 ab->qmi.target_mem_delayed = true; in ath11k_qmi_alloc_target_mem_chunk()
2033 for (i = 0, idx = 0; i < ab->qmi.mem_seg_count; i++) { in ath11k_qmi_assign_target_mem_chunk()
2034 switch (ab->qmi.target_mem[i].type) { in ath11k_qmi_assign_target_mem_chunk()
2051 if (res.end - res.start + 1 < ab->qmi.target_mem[i].size) { in ath11k_qmi_assign_target_mem_chunk()
2057 ab->qmi.target_mem[idx].paddr = res.start; in ath11k_qmi_assign_target_mem_chunk()
2058 ab->qmi.target_mem[idx].iaddr = in ath11k_qmi_assign_target_mem_chunk()
2059 ioremap(ab->qmi.target_mem[idx].paddr, in ath11k_qmi_assign_target_mem_chunk()
2060 ab->qmi.target_mem[i].size); in ath11k_qmi_assign_target_mem_chunk()
2061 ab->qmi.target_mem[idx].size = ab->qmi.target_mem[i].size; in ath11k_qmi_assign_target_mem_chunk()
2062 host_ddr_sz = ab->qmi.target_mem[i].size; in ath11k_qmi_assign_target_mem_chunk()
2063 ab->qmi.target_mem[idx].type = ab->qmi.target_mem[i].type; in ath11k_qmi_assign_target_mem_chunk()
2067 ab->qmi.target_mem[idx].paddr = ab->hw_params.bdf_addr; in ath11k_qmi_assign_target_mem_chunk()
2068 ab->qmi.target_mem[idx].vaddr = NULL; in ath11k_qmi_assign_target_mem_chunk()
2069 ab->qmi.target_mem[idx].size = ab->qmi.target_mem[i].size; in ath11k_qmi_assign_target_mem_chunk()
2070 ab->qmi.target_mem[idx].type = ab->qmi.target_mem[i].type; in ath11k_qmi_assign_target_mem_chunk()
2074 if (ab->qmi.target_mem[i].size > ATH11K_QMI_CALDB_SIZE) { in ath11k_qmi_assign_target_mem_chunk()
2081 ab->qmi.target_mem[idx].paddr = in ath11k_qmi_assign_target_mem_chunk()
2083 ab->qmi.target_mem[idx].iaddr = in ath11k_qmi_assign_target_mem_chunk()
2084 ioremap(ab->qmi.target_mem[idx].paddr, in ath11k_qmi_assign_target_mem_chunk()
2085 ab->qmi.target_mem[i].size); in ath11k_qmi_assign_target_mem_chunk()
2087 ab->qmi.target_mem[idx].paddr = in ath11k_qmi_assign_target_mem_chunk()
2091 ab->qmi.target_mem[idx].paddr = 0; in ath11k_qmi_assign_target_mem_chunk()
2092 ab->qmi.target_mem[idx].vaddr = NULL; in ath11k_qmi_assign_target_mem_chunk()
2094 ab->qmi.target_mem[idx].size = ab->qmi.target_mem[i].size; in ath11k_qmi_assign_target_mem_chunk()
2095 ab->qmi.target_mem[idx].type = ab->qmi.target_mem[i].type; in ath11k_qmi_assign_target_mem_chunk()
2100 ab->qmi.target_mem[i].type); in ath11k_qmi_assign_target_mem_chunk()
2104 ab->qmi.mem_seg_count = idx; in ath11k_qmi_assign_target_mem_chunk()
2121 ret = qmi_txn_init(&ab->qmi.handle, &txn, in ath11k_qmi_request_device_info()
2126 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, in ath11k_qmi_request_device_info()
2196 ret = qmi_txn_init(&ab->qmi.handle, &txn, qmi_wlanfw_cap_resp_msg_v01_ei, in ath11k_qmi_request_target_cap()
2203 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, in ath11k_qmi_request_target_cap()
2228 ab->qmi.target.chip_id = resp.chip_info.chip_id; in ath11k_qmi_request_target_cap()
2229 ab->qmi.target.chip_family = resp.chip_info.chip_family; in ath11k_qmi_request_target_cap()
2233 ab->qmi.target.board_id = resp.board_info.board_id; in ath11k_qmi_request_target_cap()
2235 ab->qmi.target.board_id = 0xFF; in ath11k_qmi_request_target_cap()
2238 ab->qmi.target.soc_id = resp.soc_info.soc_id; in ath11k_qmi_request_target_cap()
2241 ab->qmi.target.fw_version = resp.fw_version_info.fw_version; in ath11k_qmi_request_target_cap()
2242 strscpy(ab->qmi.target.fw_build_timestamp, in ath11k_qmi_request_target_cap()
2244 sizeof(ab->qmi.target.fw_build_timestamp)); in ath11k_qmi_request_target_cap()
2248 strscpy(ab->qmi.target.fw_build_id, resp.fw_build_id, in ath11k_qmi_request_target_cap()
2249 sizeof(ab->qmi.target.fw_build_id)); in ath11k_qmi_request_target_cap()
2252 ab->qmi.target.eeprom_caldata = in ath11k_qmi_request_target_cap()
2257 fw_build_id = ab->qmi.target.fw_build_id; in ath11k_qmi_request_target_cap()
2263 ab->qmi.target.chip_id, ab->qmi.target.chip_family, in ath11k_qmi_request_target_cap()
2264 ab->qmi.target.board_id, ab->qmi.target.soc_id); in ath11k_qmi_request_target_cap()
2267 ab->qmi.target.fw_version, in ath11k_qmi_request_target_cap()
2268 ab->qmi.target.fw_build_timestamp, in ath11k_qmi_request_target_cap()
2312 req->file_id = ab->qmi.target.board_id; in ath11k_qmi_load_file_target_mem()
2345 ret = qmi_txn_init(&ab->qmi.handle, &txn, in ath11k_qmi_load_file_target_mem()
2354 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, in ath11k_qmi_load_file_target_mem()
2444 if (ab->qmi.target.eeprom_caldata) { in ath11k_qmi_load_bdf_qmi()
2480 if (!ab->qmi.target.eeprom_caldata) in ath11k_qmi_load_bdf_qmi()
2491 struct m3_mem_region *m3_mem = &ab->qmi.m3_mem; in ath11k_qmi_m3_load()
2528 struct m3_mem_region *m3_mem = &ab->qmi.m3_mem; in ath11k_qmi_m3_free()
2541 struct m3_mem_region *m3_mem = &ab->qmi.m3_mem; in ath11k_qmi_wlanfw_m3_info_send()
2564 ret = qmi_txn_init(&ab->qmi.handle, &txn, in ath11k_qmi_wlanfw_m3_info_send()
2571 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, in ath11k_qmi_wlanfw_m3_info_send()
2613 ret = qmi_txn_init(&ab->qmi.handle, &txn, in ath11k_qmi_wlanfw_mode_send()
2620 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, in ath11k_qmi_wlanfw_mode_send()
2662 ce_cfg = (struct ce_pipe_config *)ab->qmi.ce_cfg.tgt_ce; in ath11k_qmi_wlanfw_wlan_cfg_send()
2663 svc_cfg = (struct service_to_pipe *)ab->qmi.ce_cfg.svc_to_ce_map; in ath11k_qmi_wlanfw_wlan_cfg_send()
2677 req->tgt_cfg_len = ab->qmi.ce_cfg.tgt_ce_len; in ath11k_qmi_wlanfw_wlan_cfg_send()
2688 req->svc_cfg_len = ab->qmi.ce_cfg.svc_to_ce_map_len; in ath11k_qmi_wlanfw_wlan_cfg_send()
2700 ab->qmi.ce_cfg.shadow_reg_v2_len, in ath11k_qmi_wlanfw_wlan_cfg_send()
2702 memcpy(&req->shadow_reg_v2, ab->qmi.ce_cfg.shadow_reg_v2, in ath11k_qmi_wlanfw_wlan_cfg_send()
2708 ret = qmi_txn_init(&ab->qmi.handle, &txn, in ath11k_qmi_wlanfw_wlan_cfg_send()
2715 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, in ath11k_qmi_wlanfw_wlan_cfg_send()
2754 ret = qmi_txn_init(&ab->qmi.handle, &txn, in ath11k_qmi_wlanfw_wlan_ini_send()
2759 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, in ath11k_qmi_wlanfw_wlan_ini_send()
2842 timeout = wait_event_timeout(ab->qmi.cold_boot_waitq, in ath11k_qmi_process_coldboot_calibration()
2843 (ab->qmi.cal_done == 1), in ath11k_qmi_process_coldboot_calibration()
2856 ath11k_qmi_driver_event_post(struct ath11k_qmi *qmi, in ath11k_qmi_driver_event_post() argument
2869 spin_lock(&qmi->event_lock); in ath11k_qmi_driver_event_post()
2870 list_add_tail(&event->list, &qmi->event_list); in ath11k_qmi_driver_event_post()
2871 spin_unlock(&qmi->event_lock); in ath11k_qmi_driver_event_post()
2873 queue_work(qmi->event_wq, &qmi->event_work); in ath11k_qmi_driver_event_post()
2878 static int ath11k_qmi_event_mem_request(struct ath11k_qmi *qmi) in ath11k_qmi_event_mem_request() argument
2880 struct ath11k_base *ab = qmi->ab; in ath11k_qmi_event_mem_request()
2892 static int ath11k_qmi_event_load_bdf(struct ath11k_qmi *qmi) in ath11k_qmi_event_load_bdf() argument
2894 struct ath11k_base *ab = qmi->ab; in ath11k_qmi_event_load_bdf()
2922 static int ath11k_qmi_event_server_arrive(struct ath11k_qmi *qmi) in ath11k_qmi_event_server_arrive() argument
2924 struct ath11k_base *ab = qmi->ab; in ath11k_qmi_event_server_arrive()
2943 ret = ath11k_qmi_event_load_bdf(qmi); in ath11k_qmi_event_server_arrive()
2957 struct ath11k_qmi *qmi = container_of(qmi_hdl, struct ath11k_qmi, handle); in ath11k_qmi_msg_mem_request_cb() local
2958 struct ath11k_base *ab = qmi->ab; in ath11k_qmi_msg_mem_request_cb()
2969 ab->qmi.mem_seg_count = msg->mem_seg_len; in ath11k_qmi_msg_mem_request_cb()
2971 for (i = 0; i < qmi->mem_seg_count ; i++) { in ath11k_qmi_msg_mem_request_cb()
2972 ab->qmi.target_mem[i].type = msg->mem_seg[i].type; in ath11k_qmi_msg_mem_request_cb()
2973 ab->qmi.target_mem[i].size = msg->mem_seg[i].size; in ath11k_qmi_msg_mem_request_cb()
2995 ath11k_qmi_driver_event_post(qmi, ATH11K_QMI_EVENT_REQUEST_MEM, NULL); in ath11k_qmi_msg_mem_request_cb()
3003 struct ath11k_qmi *qmi = container_of(qmi_hdl, struct ath11k_qmi, handle); in ath11k_qmi_msg_mem_ready_cb() local
3004 struct ath11k_base *ab = qmi->ab; in ath11k_qmi_msg_mem_ready_cb()
3007 ath11k_qmi_driver_event_post(qmi, ATH11K_QMI_EVENT_FW_MEM_READY, NULL); in ath11k_qmi_msg_mem_ready_cb()
3015 struct ath11k_qmi *qmi = container_of(qmi_hdl, struct ath11k_qmi, handle); in ath11k_qmi_msg_fw_ready_cb() local
3016 struct ath11k_base *ab = qmi->ab; in ath11k_qmi_msg_fw_ready_cb()
3020 if (!ab->qmi.cal_done) { in ath11k_qmi_msg_fw_ready_cb()
3021 ab->qmi.cal_done = 1; in ath11k_qmi_msg_fw_ready_cb()
3022 wake_up(&ab->qmi.cold_boot_waitq); in ath11k_qmi_msg_fw_ready_cb()
3025 ath11k_qmi_driver_event_post(qmi, ATH11K_QMI_EVENT_FW_READY, NULL); in ath11k_qmi_msg_fw_ready_cb()
3033 struct ath11k_qmi *qmi = container_of(qmi_hdl, in ath11k_qmi_msg_cold_boot_cal_done_cb() local
3035 struct ath11k_base *ab = qmi->ab; in ath11k_qmi_msg_cold_boot_cal_done_cb()
3037 ab->qmi.cal_done = 1; in ath11k_qmi_msg_cold_boot_cal_done_cb()
3038 wake_up(&ab->qmi.cold_boot_waitq); in ath11k_qmi_msg_cold_boot_cal_done_cb()
3047 struct ath11k_qmi *qmi = container_of(qmi_hdl, in ath11k_qmi_msg_fw_init_done_cb() local
3049 struct ath11k_base *ab = qmi->ab; in ath11k_qmi_msg_fw_init_done_cb()
3051 ath11k_qmi_driver_event_post(qmi, ATH11K_QMI_EVENT_FW_INIT_DONE, NULL); in ath11k_qmi_msg_fw_init_done_cb()
3101 struct ath11k_qmi *qmi = container_of(qmi_hdl, struct ath11k_qmi, handle); in ath11k_qmi_ops_new_server() local
3102 struct ath11k_base *ab = qmi->ab; in ath11k_qmi_ops_new_server()
3103 struct sockaddr_qrtr *sq = &qmi->sq; in ath11k_qmi_ops_new_server()
3118 ath11k_qmi_driver_event_post(qmi, ATH11K_QMI_EVENT_SERVER_ARRIVE, NULL); in ath11k_qmi_ops_new_server()
3126 struct ath11k_qmi *qmi = container_of(qmi_hdl, struct ath11k_qmi, handle); in ath11k_qmi_ops_del_server() local
3127 struct ath11k_base *ab = qmi->ab; in ath11k_qmi_ops_del_server()
3130 ath11k_qmi_driver_event_post(qmi, ATH11K_QMI_EVENT_SERVER_EXIT, NULL); in ath11k_qmi_ops_del_server()
3140 struct ath11k_qmi *qmi = container_of(work, struct ath11k_qmi, in ath11k_qmi_driver_event_work() local
3143 struct ath11k_base *ab = qmi->ab; in ath11k_qmi_driver_event_work()
3146 spin_lock(&qmi->event_lock); in ath11k_qmi_driver_event_work()
3147 while (!list_empty(&qmi->event_list)) { in ath11k_qmi_driver_event_work()
3148 event = list_first_entry(&qmi->event_list, in ath11k_qmi_driver_event_work()
3151 spin_unlock(&qmi->event_lock); in ath11k_qmi_driver_event_work()
3160 ret = ath11k_qmi_event_server_arrive(qmi); in ath11k_qmi_driver_event_work()
3169 ret = ath11k_qmi_event_mem_request(qmi); in ath11k_qmi_driver_event_work()
3174 ret = ath11k_qmi_event_load_bdf(qmi); in ath11k_qmi_driver_event_work()
3196 if (ath11k_cold_boot_cal && ab->qmi.cal_done == 0 && in ath11k_qmi_driver_event_work()
3235 spin_lock(&qmi->event_lock); in ath11k_qmi_driver_event_work()
3237 spin_unlock(&qmi->event_lock); in ath11k_qmi_driver_event_work()
3244 memset(&ab->qmi.target, 0, sizeof(struct target_info)); in ath11k_qmi_init_service()
3245 memset(&ab->qmi.target_mem, 0, sizeof(struct target_mem_chunk)); in ath11k_qmi_init_service()
3246 ab->qmi.ab = ab; in ath11k_qmi_init_service()
3248 ab->qmi.target_mem_mode = ab->hw_params.fw_mem_mode; in ath11k_qmi_init_service()
3249 ret = qmi_handle_init(&ab->qmi.handle, ATH11K_QMI_RESP_LEN_MAX, in ath11k_qmi_init_service()
3256 ab->qmi.event_wq = alloc_workqueue("ath11k_qmi_driver_event", in ath11k_qmi_init_service()
3258 if (!ab->qmi.event_wq) { in ath11k_qmi_init_service()
3263 INIT_LIST_HEAD(&ab->qmi.event_list); in ath11k_qmi_init_service()
3264 spin_lock_init(&ab->qmi.event_lock); in ath11k_qmi_init_service()
3265 INIT_WORK(&ab->qmi.event_work, ath11k_qmi_driver_event_work); in ath11k_qmi_init_service()
3267 ret = qmi_add_lookup(&ab->qmi.handle, ATH11K_QMI_WLFW_SERVICE_ID_V01, in ath11k_qmi_init_service()
3269 ab->qmi.service_ins_id); in ath11k_qmi_init_service()
3272 destroy_workqueue(ab->qmi.event_wq); in ath11k_qmi_init_service()
3281 qmi_handle_release(&ab->qmi.handle); in ath11k_qmi_deinit_service()
3282 cancel_work_sync(&ab->qmi.event_work); in ath11k_qmi_deinit_service()
3283 destroy_workqueue(ab->qmi.event_wq); in ath11k_qmi_deinit_service()