• Home
  • Raw
  • Download

Lines Matching full:qmi

9 #include "qmi.h"
1932 req.mem_cfg_mode = ab->qmi.target_mem_mode; in ath12k_qmi_host_cap_send()
1943 req.cal_done = ab->qmi.cal_done; in ath12k_qmi_host_cap_send()
1970 ret = qmi_txn_init(&ab->qmi.handle, &txn, in ath12k_qmi_host_cap_send()
1975 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, in ath12k_qmi_host_cap_send()
2004 struct qmi_handle *handle = &ab->qmi.handle; in ath12k_qmi_fw_ind_register_send()
2039 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, in ath12k_qmi_fw_ind_register_send()
2089 if (ab->qmi.target_mem_delayed) { in ath12k_qmi_respond_fw_mem_request()
2091 ath12k_dbg(ab, ATH12K_DBG_QMI, "qmi delays mem_request %d\n", in ath12k_qmi_respond_fw_mem_request()
2092 ab->qmi.mem_seg_count); in ath12k_qmi_respond_fw_mem_request()
2096 req->mem_seg_len = ab->qmi.mem_seg_count; in ath12k_qmi_respond_fw_mem_request()
2098 req->mem_seg[i].addr = ab->qmi.target_mem[i].paddr; in ath12k_qmi_respond_fw_mem_request()
2099 req->mem_seg[i].size = ab->qmi.target_mem[i].size; in ath12k_qmi_respond_fw_mem_request()
2100 req->mem_seg[i].type = ab->qmi.target_mem[i].type; in ath12k_qmi_respond_fw_mem_request()
2102 "qmi req mem_seg[%d] %pad %u %u\n", i, in ath12k_qmi_respond_fw_mem_request()
2103 &ab->qmi.target_mem[i].paddr, in ath12k_qmi_respond_fw_mem_request()
2104 ab->qmi.target_mem[i].size, in ath12k_qmi_respond_fw_mem_request()
2105 ab->qmi.target_mem[i].type); in ath12k_qmi_respond_fw_mem_request()
2109 ret = qmi_txn_init(&ab->qmi.handle, &txn, in ath12k_qmi_respond_fw_mem_request()
2114 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, in ath12k_qmi_respond_fw_mem_request()
2120 ath12k_warn(ab, "qmi failed to respond memory request, err = %d\n", in ath12k_qmi_respond_fw_mem_request()
2127 ath12k_warn(ab, "qmi failed memory request, err = %d\n", ret); in ath12k_qmi_respond_fw_mem_request()
2152 for (i = 0; i < ab->qmi.mem_seg_count; i++) { in ath12k_qmi_free_target_mem_chunk()
2153 if (!ab->qmi.target_mem[i].v.addr) in ath12k_qmi_free_target_mem_chunk()
2156 ab->qmi.target_mem[i].size, in ath12k_qmi_free_target_mem_chunk()
2157 ab->qmi.target_mem[i].v.addr, in ath12k_qmi_free_target_mem_chunk()
2158 ab->qmi.target_mem[i].paddr); in ath12k_qmi_free_target_mem_chunk()
2159 ab->qmi.target_mem[i].v.addr = NULL; in ath12k_qmi_free_target_mem_chunk()
2168 ab->qmi.target_mem_delayed = false; in ath12k_qmi_alloc_target_mem_chunk()
2170 for (i = 0; i < ab->qmi.mem_seg_count; i++) { in ath12k_qmi_alloc_target_mem_chunk()
2171 chunk = &ab->qmi.target_mem[i]; in ath12k_qmi_alloc_target_mem_chunk()
2188 ab->qmi.target_mem_delayed = true; in ath12k_qmi_alloc_target_mem_chunk()
2190 "qmi dma allocation failed (%d B type %u), will try later with small size\n", in ath12k_qmi_alloc_target_mem_chunk()
2224 ret = qmi_txn_init(&ab->qmi.handle, &txn, in ath12k_qmi_request_target_cap()
2229 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, in ath12k_qmi_request_target_cap()
2235 ath12k_warn(ab, "qmi failed to send target cap request, err = %d\n", in ath12k_qmi_request_target_cap()
2242 ath12k_warn(ab, "qmi failed target cap request %d\n", ret); in ath12k_qmi_request_target_cap()
2247 ath12k_warn(ab, "qmi targetcap req failed, result: %d, err: %d\n", in ath12k_qmi_request_target_cap()
2254 ab->qmi.target.chip_id = resp.chip_info.chip_id; in ath12k_qmi_request_target_cap()
2255 ab->qmi.target.chip_family = resp.chip_info.chip_family; in ath12k_qmi_request_target_cap()
2259 ab->qmi.target.board_id = resp.board_info.board_id; in ath12k_qmi_request_target_cap()
2261 ab->qmi.target.board_id = board_id; in ath12k_qmi_request_target_cap()
2264 ab->qmi.target.soc_id = resp.soc_info.soc_id; in ath12k_qmi_request_target_cap()
2267 ab->qmi.target.fw_version = resp.fw_version_info.fw_version; in ath12k_qmi_request_target_cap()
2268 strscpy(ab->qmi.target.fw_build_timestamp, in ath12k_qmi_request_target_cap()
2270 sizeof(ab->qmi.target.fw_build_timestamp)); in ath12k_qmi_request_target_cap()
2274 strscpy(ab->qmi.target.fw_build_id, resp.fw_build_id, in ath12k_qmi_request_target_cap()
2275 sizeof(ab->qmi.target.fw_build_id)); in ath12k_qmi_request_target_cap()
2279 ab->qmi.dev_mem[i].start = in ath12k_qmi_request_target_cap()
2281 ab->qmi.dev_mem[i].size = in ath12k_qmi_request_target_cap()
2285 ab->qmi.dev_mem[i].start, in ath12k_qmi_request_target_cap()
2286 ab->qmi.dev_mem[i].size); in ath12k_qmi_request_target_cap()
2291 ab->qmi.target.eeprom_caldata = resp.eeprom_caldata_read_timeout; in ath12k_qmi_request_target_cap()
2292 ath12k_dbg(ab, ATH12K_DBG_QMI, "qmi cal data supported from eeprom\n"); in ath12k_qmi_request_target_cap()
2296 ab->qmi.target.chip_id, ab->qmi.target.chip_family, in ath12k_qmi_request_target_cap()
2297 ab->qmi.target.board_id, ab->qmi.target.soc_id); in ath12k_qmi_request_target_cap()
2300 ab->qmi.target.fw_version, in ath12k_qmi_request_target_cap()
2301 ab->qmi.target.fw_build_timestamp, in ath12k_qmi_request_target_cap()
2302 ab->qmi.target.fw_build_id); in ath12k_qmi_request_target_cap()
2326 req->file_id = ab->qmi.target.board_id; in ath12k_qmi_load_file_target_mem()
2351 ret = qmi_txn_init(&ab->qmi.handle, &txn, in ath12k_qmi_load_file_target_mem()
2357 ath12k_dbg(ab, ATH12K_DBG_QMI, "qmi bdf download req fixed addr type %d\n", in ath12k_qmi_load_file_target_mem()
2360 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, in ath12k_qmi_load_file_target_mem()
2374 ath12k_warn(ab, "qmi BDF download failed, result: %d, err: %d\n", in ath12k_qmi_load_file_target_mem()
2387 "qmi bdf download request remaining %i\n", in ath12k_qmi_load_file_target_mem()
2414 ath12k_warn(ab, "qmi failed to load bdf:\n"); in ath12k_qmi_load_bdf_qmi()
2428 ath12k_warn(ab, "qmi failed to load regdb bin:\n"); in ath12k_qmi_load_bdf_qmi()
2434 if (ab->qmi.target.eeprom_caldata) { in ath12k_qmi_load_bdf_qmi()
2453 "qmi failed to load CAL data file:%s\n", in ath12k_qmi_load_bdf_qmi()
2465 ath12k_warn(ab, "qmi failed to load caldata\n"); in ath12k_qmi_load_bdf_qmi()
2469 ath12k_dbg(ab, ATH12K_DBG_QMI, "qmi caldata downloaded: type: %u\n", in ath12k_qmi_load_bdf_qmi()
2473 if (!ab->qmi.target.eeprom_caldata) in ath12k_qmi_load_bdf_qmi()
2481 ath12k_dbg(ab, ATH12K_DBG_QMI, "qmi bdf_type %d\n", type); in ath12k_qmi_load_bdf_qmi()
2487 ath12k_warn(ab, "qmi failed to load bdf file\n"); in ath12k_qmi_load_bdf_qmi()
2491 ath12k_dbg(ab, ATH12K_DBG_QMI, "qmi BDF download sequence completed\n"); in ath12k_qmi_load_bdf_qmi()
2498 struct m3_mem_region *m3_mem = &ab->qmi.m3_mem; in ath12k_qmi_m3_load()
2534 struct m3_mem_region *m3_mem = &ab->qmi.m3_mem; in ath12k_qmi_m3_free()
2546 struct m3_mem_region *m3_mem = &ab->qmi.m3_mem; in ath12k_qmi_wlanfw_m3_info_send()
2564 ret = qmi_txn_init(&ab->qmi.handle, &txn, in ath12k_qmi_wlanfw_m3_info_send()
2569 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, in ath12k_qmi_wlanfw_m3_info_send()
2575 ath12k_warn(ab, "qmi failed to send M3 information request, err = %d\n", in ath12k_qmi_wlanfw_m3_info_send()
2582 ath12k_warn(ab, "qmi failed M3 information request %d\n", ret); in ath12k_qmi_wlanfw_m3_info_send()
2587 ath12k_warn(ab, "qmi M3 info request failed, result: %d, err: %d\n", in ath12k_qmi_wlanfw_m3_info_send()
2611 ret = qmi_txn_init(&ab->qmi.handle, &txn, in ath12k_qmi_wlanfw_mode_send()
2616 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, in ath12k_qmi_wlanfw_mode_send()
2622 ath12k_warn(ab, "qmi failed to send mode request, mode: %d, err = %d\n", in ath12k_qmi_wlanfw_mode_send()
2633 ath12k_warn(ab, "qmi failed set mode request, mode: %d, err = %d\n", in ath12k_qmi_wlanfw_mode_send()
2658 ce_cfg = (struct ce_pipe_config *)ab->qmi.ce_cfg.tgt_ce; in ath12k_qmi_wlanfw_wlan_cfg_send()
2659 svc_cfg = (struct service_to_pipe *)ab->qmi.ce_cfg.svc_to_ce_map; in ath12k_qmi_wlanfw_wlan_cfg_send()
2673 req->tgt_cfg_len = ab->qmi.ce_cfg.tgt_ce_len; in ath12k_qmi_wlanfw_wlan_cfg_send()
2684 req->svc_cfg_len = ab->qmi.ce_cfg.svc_to_ce_map_len; in ath12k_qmi_wlanfw_wlan_cfg_send()
2695 ab->qmi.ce_cfg.shadow_reg_v3_len, in ath12k_qmi_wlanfw_wlan_cfg_send()
2697 memcpy(&req->shadow_reg_v3, ab->qmi.ce_cfg.shadow_reg_v3, in ath12k_qmi_wlanfw_wlan_cfg_send()
2703 ret = qmi_txn_init(&ab->qmi.handle, &txn, in ath12k_qmi_wlanfw_wlan_cfg_send()
2708 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, in ath12k_qmi_wlanfw_wlan_cfg_send()
2714 ath12k_warn(ab, "qmi failed to send wlan config request, err = %d\n", in ath12k_qmi_wlanfw_wlan_cfg_send()
2721 ath12k_warn(ab, "qmi failed wlan config request, err = %d\n", ret); in ath12k_qmi_wlanfw_wlan_cfg_send()
2726 ath12k_warn(ab, "qmi wlan config request failed, result: %d, err: %d\n", in ath12k_qmi_wlanfw_wlan_cfg_send()
2743 ath12k_warn(ab, "qmi failed to send wlan mode off\n"); in ath12k_qmi_firmware_stop()
2755 ath12k_warn(ab, "qmi failed to send wlan cfg:%d\n", ret); in ath12k_qmi_firmware_start()
2761 ath12k_warn(ab, "qmi failed to send wlan fw mode:%d\n", ret); in ath12k_qmi_firmware_start()
2769 ath12k_qmi_driver_event_post(struct ath12k_qmi *qmi, in ath12k_qmi_driver_event_post() argument
2782 spin_lock(&qmi->event_lock); in ath12k_qmi_driver_event_post()
2783 list_add_tail(&event->list, &qmi->event_list); in ath12k_qmi_driver_event_post()
2784 spin_unlock(&qmi->event_lock); in ath12k_qmi_driver_event_post()
2786 queue_work(qmi->event_wq, &qmi->event_work); in ath12k_qmi_driver_event_post()
2791 static int ath12k_qmi_event_server_arrive(struct ath12k_qmi *qmi) in ath12k_qmi_event_server_arrive() argument
2793 struct ath12k_base *ab = qmi->ab; in ath12k_qmi_event_server_arrive()
2798 ath12k_warn(ab, "qmi failed to send FW indication QMI:%d\n", ret); in ath12k_qmi_event_server_arrive()
2804 ath12k_warn(ab, "qmi failed to send host cap QMI:%d\n", ret); in ath12k_qmi_event_server_arrive()
2811 static int ath12k_qmi_event_mem_request(struct ath12k_qmi *qmi) in ath12k_qmi_event_mem_request() argument
2813 struct ath12k_base *ab = qmi->ab; in ath12k_qmi_event_mem_request()
2818 ath12k_warn(ab, "qmi failed to respond fw mem req:%d\n", ret); in ath12k_qmi_event_mem_request()
2825 static int ath12k_qmi_event_load_bdf(struct ath12k_qmi *qmi) in ath12k_qmi_event_load_bdf() argument
2827 struct ath12k_base *ab = qmi->ab; in ath12k_qmi_event_load_bdf()
2832 ath12k_warn(ab, "qmi failed to req target capabilities:%d\n", ret); in ath12k_qmi_event_load_bdf()
2838 ath12k_warn(ab, "qmi failed to load regdb file:%d\n", ret); in ath12k_qmi_event_load_bdf()
2844 ath12k_warn(ab, "qmi failed to load board data file:%d\n", ret); in ath12k_qmi_event_load_bdf()
2851 ath12k_warn(ab, "qmi failed to load calibrated data :%d\n", ret); in ath12k_qmi_event_load_bdf()
2856 ath12k_warn(ab, "qmi failed to send m3 info req:%d\n", ret); in ath12k_qmi_event_load_bdf()
2868 struct ath12k_qmi *qmi = container_of(qmi_hdl, struct ath12k_qmi, handle); in ath12k_qmi_msg_mem_request_cb() local
2869 struct ath12k_base *ab = qmi->ab; in ath12k_qmi_msg_mem_request_cb()
2873 ath12k_dbg(ab, ATH12K_DBG_QMI, "qmi firmware request memory request\n"); in ath12k_qmi_msg_mem_request_cb()
2880 ab->qmi.mem_seg_count = msg->mem_seg_len; in ath12k_qmi_msg_mem_request_cb()
2882 for (i = 0; i < qmi->mem_seg_count ; i++) { in ath12k_qmi_msg_mem_request_cb()
2883 ab->qmi.target_mem[i].type = msg->mem_seg[i].type; in ath12k_qmi_msg_mem_request_cb()
2884 ab->qmi.target_mem[i].size = msg->mem_seg[i].size; in ath12k_qmi_msg_mem_request_cb()
2885 ath12k_dbg(ab, ATH12K_DBG_QMI, "qmi mem seg type %d size %d\n", in ath12k_qmi_msg_mem_request_cb()
2891 ath12k_warn(ab, "qmi failed to alloc target memory: %d\n", in ath12k_qmi_msg_mem_request_cb()
2896 ath12k_qmi_driver_event_post(qmi, ATH12K_QMI_EVENT_REQUEST_MEM, NULL); in ath12k_qmi_msg_mem_request_cb()
2904 struct ath12k_qmi *qmi = container_of(qmi_hdl, struct ath12k_qmi, handle); in ath12k_qmi_msg_mem_ready_cb() local
2905 struct ath12k_base *ab = qmi->ab; in ath12k_qmi_msg_mem_ready_cb()
2907 ath12k_dbg(ab, ATH12K_DBG_QMI, "qmi firmware memory ready indication\n"); in ath12k_qmi_msg_mem_ready_cb()
2908 ath12k_qmi_driver_event_post(qmi, ATH12K_QMI_EVENT_FW_MEM_READY, NULL); in ath12k_qmi_msg_mem_ready_cb()
2916 struct ath12k_qmi *qmi = container_of(qmi_hdl, struct ath12k_qmi, handle); in ath12k_qmi_msg_fw_ready_cb() local
2917 struct ath12k_base *ab = qmi->ab; in ath12k_qmi_msg_fw_ready_cb()
2919 ath12k_dbg(ab, ATH12K_DBG_QMI, "qmi firmware ready\n"); in ath12k_qmi_msg_fw_ready_cb()
2920 ath12k_qmi_driver_event_post(qmi, ATH12K_QMI_EVENT_FW_READY, NULL); in ath12k_qmi_msg_fw_ready_cb()
2953 struct ath12k_qmi *qmi = container_of(qmi_hdl, struct ath12k_qmi, handle); in ath12k_qmi_ops_new_server() local
2954 struct ath12k_base *ab = qmi->ab; in ath12k_qmi_ops_new_server()
2955 struct sockaddr_qrtr *sq = &qmi->sq; in ath12k_qmi_ops_new_server()
2965 ath12k_warn(ab, "qmi failed to connect to remote service %d\n", ret); in ath12k_qmi_ops_new_server()
2969 ath12k_dbg(ab, ATH12K_DBG_QMI, "qmi wifi fw qmi service connected\n"); in ath12k_qmi_ops_new_server()
2970 ath12k_qmi_driver_event_post(qmi, ATH12K_QMI_EVENT_SERVER_ARRIVE, NULL); in ath12k_qmi_ops_new_server()
2978 struct ath12k_qmi *qmi = container_of(qmi_hdl, struct ath12k_qmi, handle); in ath12k_qmi_ops_del_server() local
2979 struct ath12k_base *ab = qmi->ab; in ath12k_qmi_ops_del_server()
2981 ath12k_dbg(ab, ATH12K_DBG_QMI, "qmi wifi fw del server\n"); in ath12k_qmi_ops_del_server()
2982 ath12k_qmi_driver_event_post(qmi, ATH12K_QMI_EVENT_SERVER_EXIT, NULL); in ath12k_qmi_ops_del_server()
2992 struct ath12k_qmi *qmi = container_of(work, struct ath12k_qmi, in ath12k_qmi_driver_event_work() local
2995 struct ath12k_base *ab = qmi->ab; in ath12k_qmi_driver_event_work()
2998 spin_lock(&qmi->event_lock); in ath12k_qmi_driver_event_work()
2999 while (!list_empty(&qmi->event_list)) { in ath12k_qmi_driver_event_work()
3000 event = list_first_entry(&qmi->event_list, in ath12k_qmi_driver_event_work()
3003 spin_unlock(&qmi->event_lock); in ath12k_qmi_driver_event_work()
3010 ret = ath12k_qmi_event_server_arrive(qmi); in ath12k_qmi_driver_event_work()
3019 ret = ath12k_qmi_event_mem_request(qmi); in ath12k_qmi_driver_event_work()
3024 ret = ath12k_qmi_event_load_bdf(qmi); in ath12k_qmi_driver_event_work()
3050 spin_lock(&qmi->event_lock); in ath12k_qmi_driver_event_work()
3052 spin_unlock(&qmi->event_lock); in ath12k_qmi_driver_event_work()
3059 memset(&ab->qmi.target, 0, sizeof(struct target_info)); in ath12k_qmi_init_service()
3060 memset(&ab->qmi.target_mem, 0, sizeof(struct target_mem_chunk)); in ath12k_qmi_init_service()
3061 ab->qmi.ab = ab; in ath12k_qmi_init_service()
3063 ab->qmi.target_mem_mode = ATH12K_QMI_TARGET_MEM_MODE_DEFAULT; in ath12k_qmi_init_service()
3064 ret = qmi_handle_init(&ab->qmi.handle, ATH12K_QMI_RESP_LEN_MAX, in ath12k_qmi_init_service()
3067 ath12k_warn(ab, "failed to initialize qmi handle\n"); in ath12k_qmi_init_service()
3071 ab->qmi.event_wq = alloc_ordered_workqueue("ath12k_qmi_driver_event", 0); in ath12k_qmi_init_service()
3072 if (!ab->qmi.event_wq) { in ath12k_qmi_init_service()
3077 INIT_LIST_HEAD(&ab->qmi.event_list); in ath12k_qmi_init_service()
3078 spin_lock_init(&ab->qmi.event_lock); in ath12k_qmi_init_service()
3079 INIT_WORK(&ab->qmi.event_work, ath12k_qmi_driver_event_work); in ath12k_qmi_init_service()
3081 ret = qmi_add_lookup(&ab->qmi.handle, ATH12K_QMI_WLFW_SERVICE_ID_V01, in ath12k_qmi_init_service()
3083 ab->qmi.service_ins_id); in ath12k_qmi_init_service()
3085 ath12k_warn(ab, "failed to add qmi lookup\n"); in ath12k_qmi_init_service()
3086 destroy_workqueue(ab->qmi.event_wq); in ath12k_qmi_init_service()
3095 qmi_handle_release(&ab->qmi.handle); in ath12k_qmi_deinit_service()
3096 cancel_work_sync(&ab->qmi.event_work); in ath12k_qmi_deinit_service()
3097 destroy_workqueue(ab->qmi.event_wq); in ath12k_qmi_deinit_service()