Lines Matching +full:fw +full:- +full:gpios
1 // SPDX-License-Identifier: BSD-3-Clause-Clear
3 * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
4 * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
134 gpios),
1906 req->mlo_capable_valid = 1; in ath12k_host_cap_parse_mlo()
1907 req->mlo_capable = 1; in ath12k_host_cap_parse_mlo()
1908 req->mlo_chip_id_valid = 1; in ath12k_host_cap_parse_mlo()
1909 req->mlo_chip_id = 0; in ath12k_host_cap_parse_mlo()
1910 req->mlo_group_id_valid = 1; in ath12k_host_cap_parse_mlo()
1911 req->mlo_group_id = 0; in ath12k_host_cap_parse_mlo()
1912 req->max_mlo_peer_valid = 1; in ath12k_host_cap_parse_mlo()
1916 req->max_mlo_peer = 32; in ath12k_host_cap_parse_mlo()
1917 req->mlo_num_chips_valid = 1; in ath12k_host_cap_parse_mlo()
1918 req->mlo_num_chips = 1; in ath12k_host_cap_parse_mlo()
1919 req->mlo_chip_info_valid = 1; in ath12k_host_cap_parse_mlo()
1920 req->mlo_chip_info[0].chip_id = 0; in ath12k_host_cap_parse_mlo()
1921 req->mlo_chip_info[0].num_local_links = 2; in ath12k_host_cap_parse_mlo()
1922 req->mlo_chip_info[0].hw_link_id[0] = 0; in ath12k_host_cap_parse_mlo()
1923 req->mlo_chip_info[0].hw_link_id[1] = 1; in ath12k_host_cap_parse_mlo()
1924 req->mlo_chip_info[0].valid_mlo_link_id[0] = 1; in ath12k_host_cap_parse_mlo()
1925 req->mlo_chip_info[0].valid_mlo_link_id[1] = 1; in ath12k_host_cap_parse_mlo()
1940 req.mem_cfg_mode = ab->qmi.target_mem_mode; in ath12k_qmi_host_cap_send()
1951 req.cal_done = ab->qmi.cal_done; in ath12k_qmi_host_cap_send()
1953 if (ab->hw_params->qmi_cnss_feature_bitmap) { in ath12k_qmi_host_cap_send()
1955 req.feature_list = ab->hw_params->qmi_cnss_feature_bitmap; in ath12k_qmi_host_cap_send()
1961 if (ab->hw_params->internal_sleep_clock) { in ath12k_qmi_host_cap_send()
1964 /* Notify firmware that this is non-qualcomm platform. */ in ath12k_qmi_host_cap_send()
1969 * non-qualcomm platforms should select internal sleep in ath12k_qmi_host_cap_send()
1978 ret = qmi_txn_init(&ab->qmi.handle, &txn, in ath12k_qmi_host_cap_send()
1983 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, in ath12k_qmi_host_cap_send()
1999 ret = -EINVAL; in ath12k_qmi_host_cap_send()
2011 struct qmi_handle *handle = &ab->qmi.handle; in ath12k_qmi_fw_ind_register_send()
2017 return -ENOMEM; in ath12k_qmi_fw_ind_register_send()
2021 ret = -ENOMEM; in ath12k_qmi_fw_ind_register_send()
2025 req->client_id_valid = 1; in ath12k_qmi_fw_ind_register_send()
2026 req->client_id = QMI_WLANFW_CLIENT_ID; in ath12k_qmi_fw_ind_register_send()
2027 req->fw_ready_enable_valid = 1; in ath12k_qmi_fw_ind_register_send()
2028 req->fw_ready_enable = 1; in ath12k_qmi_fw_ind_register_send()
2029 req->request_mem_enable_valid = 1; in ath12k_qmi_fw_ind_register_send()
2030 req->request_mem_enable = 1; in ath12k_qmi_fw_ind_register_send()
2031 req->fw_mem_ready_enable_valid = 1; in ath12k_qmi_fw_ind_register_send()
2032 req->fw_mem_ready_enable = 1; in ath12k_qmi_fw_ind_register_send()
2033 req->cal_done_enable_valid = 1; in ath12k_qmi_fw_ind_register_send()
2034 req->cal_done_enable = 1; in ath12k_qmi_fw_ind_register_send()
2035 req->fw_init_done_enable_valid = 1; in ath12k_qmi_fw_ind_register_send()
2036 req->fw_init_done_enable = 1; in ath12k_qmi_fw_ind_register_send()
2038 req->pin_connect_result_enable_valid = 0; in ath12k_qmi_fw_ind_register_send()
2039 req->pin_connect_result_enable = 0; in ath12k_qmi_fw_ind_register_send()
2046 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, in ath12k_qmi_fw_ind_register_send()
2058 ath12k_warn(ab, "failed to register fw indication %d\n", ret); in ath12k_qmi_fw_ind_register_send()
2062 if (resp->resp.result != QMI_RESULT_SUCCESS_V01) { in ath12k_qmi_fw_ind_register_send()
2063 ath12k_warn(ab, "FW Ind register request failed, result: %d, err: %d\n", in ath12k_qmi_fw_ind_register_send()
2064 resp->resp.result, resp->resp.error); in ath12k_qmi_fw_ind_register_send()
2065 ret = -EINVAL; in ath12k_qmi_fw_ind_register_send()
2086 return -ENOMEM; in ath12k_qmi_respond_fw_mem_request()
2095 if (ab->qmi.target_mem_delayed) { in ath12k_qmi_respond_fw_mem_request()
2098 ab->qmi.mem_seg_count); in ath12k_qmi_respond_fw_mem_request()
2102 req->mem_seg_len = ab->qmi.mem_seg_count; in ath12k_qmi_respond_fw_mem_request()
2103 for (i = 0; i < req->mem_seg_len ; i++) { in ath12k_qmi_respond_fw_mem_request()
2104 req->mem_seg[i].addr = ab->qmi.target_mem[i].paddr; in ath12k_qmi_respond_fw_mem_request()
2105 req->mem_seg[i].size = ab->qmi.target_mem[i].size; in ath12k_qmi_respond_fw_mem_request()
2106 req->mem_seg[i].type = ab->qmi.target_mem[i].type; in ath12k_qmi_respond_fw_mem_request()
2109 &ab->qmi.target_mem[i].paddr, in ath12k_qmi_respond_fw_mem_request()
2110 ab->qmi.target_mem[i].size, in ath12k_qmi_respond_fw_mem_request()
2111 ab->qmi.target_mem[i].type); in ath12k_qmi_respond_fw_mem_request()
2115 ret = qmi_txn_init(&ab->qmi.handle, &txn, in ath12k_qmi_respond_fw_mem_request()
2120 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, in ath12k_qmi_respond_fw_mem_request()
2145 ret = -EINVAL; in ath12k_qmi_respond_fw_mem_request()
2157 for (i = 0; i < ab->qmi.mem_seg_count; i++) { in ath12k_qmi_free_target_mem_chunk()
2158 if (!ab->qmi.target_mem[i].v.addr) in ath12k_qmi_free_target_mem_chunk()
2160 dma_free_coherent(ab->dev, in ath12k_qmi_free_target_mem_chunk()
2161 ab->qmi.target_mem[i].size, in ath12k_qmi_free_target_mem_chunk()
2162 ab->qmi.target_mem[i].v.addr, in ath12k_qmi_free_target_mem_chunk()
2163 ab->qmi.target_mem[i].paddr); in ath12k_qmi_free_target_mem_chunk()
2164 ab->qmi.target_mem[i].v.addr = NULL; in ath12k_qmi_free_target_mem_chunk()
2173 ab->qmi.target_mem_delayed = false; in ath12k_qmi_alloc_target_mem_chunk()
2175 for (i = 0; i < ab->qmi.mem_seg_count; i++) { in ath12k_qmi_alloc_target_mem_chunk()
2176 chunk = &ab->qmi.target_mem[i]; in ath12k_qmi_alloc_target_mem_chunk()
2179 * on the host. For the non-supported memory region, host does not in ath12k_qmi_alloc_target_mem_chunk()
2180 * allocate memory, assigns NULL and FW will handle this without crashing. in ath12k_qmi_alloc_target_mem_chunk()
2182 switch (chunk->type) { in ath12k_qmi_alloc_target_mem_chunk()
2187 chunk->v.addr = dma_alloc_coherent(ab->dev, in ath12k_qmi_alloc_target_mem_chunk()
2188 chunk->size, in ath12k_qmi_alloc_target_mem_chunk()
2189 &chunk->paddr, in ath12k_qmi_alloc_target_mem_chunk()
2191 if (!chunk->v.addr) { in ath12k_qmi_alloc_target_mem_chunk()
2192 if (chunk->size > ATH12K_QMI_MAX_CHUNK_SIZE) { in ath12k_qmi_alloc_target_mem_chunk()
2193 ab->qmi.target_mem_delayed = true; in ath12k_qmi_alloc_target_mem_chunk()
2196 chunk->size, in ath12k_qmi_alloc_target_mem_chunk()
2197 chunk->type); in ath12k_qmi_alloc_target_mem_chunk()
2202 chunk->type, chunk->size); in ath12k_qmi_alloc_target_mem_chunk()
2203 return -ENOMEM; in ath12k_qmi_alloc_target_mem_chunk()
2208 chunk->type); in ath12k_qmi_alloc_target_mem_chunk()
2209 chunk->paddr = 0; in ath12k_qmi_alloc_target_mem_chunk()
2210 chunk->v.addr = NULL; in ath12k_qmi_alloc_target_mem_chunk()
2229 ret = qmi_txn_init(&ab->qmi.handle, &txn, in ath12k_qmi_request_target_cap()
2234 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, in ath12k_qmi_request_target_cap()
2253 ret = -EINVAL; in ath12k_qmi_request_target_cap()
2258 ab->qmi.target.chip_id = resp.chip_info.chip_id; in ath12k_qmi_request_target_cap()
2259 ab->qmi.target.chip_family = resp.chip_info.chip_family; in ath12k_qmi_request_target_cap()
2263 ab->qmi.target.board_id = resp.board_info.board_id; in ath12k_qmi_request_target_cap()
2265 ab->qmi.target.board_id = board_id; in ath12k_qmi_request_target_cap()
2268 ab->qmi.target.soc_id = resp.soc_info.soc_id; in ath12k_qmi_request_target_cap()
2271 ab->qmi.target.fw_version = resp.fw_version_info.fw_version; in ath12k_qmi_request_target_cap()
2272 strscpy(ab->qmi.target.fw_build_timestamp, in ath12k_qmi_request_target_cap()
2274 sizeof(ab->qmi.target.fw_build_timestamp)); in ath12k_qmi_request_target_cap()
2278 strscpy(ab->qmi.target.fw_build_id, resp.fw_build_id, in ath12k_qmi_request_target_cap()
2279 sizeof(ab->qmi.target.fw_build_id)); in ath12k_qmi_request_target_cap()
2283 ab->qmi.dev_mem[i].start = in ath12k_qmi_request_target_cap()
2285 ab->qmi.dev_mem[i].size = in ath12k_qmi_request_target_cap()
2290 ab->qmi.dev_mem[i].start, in ath12k_qmi_request_target_cap()
2291 ab->qmi.dev_mem[i].size); in ath12k_qmi_request_target_cap()
2294 (uintmax_t)ab->qmi.dev_mem[i].start, in ath12k_qmi_request_target_cap()
2295 (uintmax_t)ab->qmi.dev_mem[i].size); in ath12k_qmi_request_target_cap()
2301 ab->qmi.target.eeprom_caldata = resp.eeprom_caldata_read_timeout; in ath12k_qmi_request_target_cap()
2306 ab->qmi.target.chip_id, ab->qmi.target.chip_family, in ath12k_qmi_request_target_cap()
2307 ab->qmi.target.board_id, ab->qmi.target.soc_id); in ath12k_qmi_request_target_cap()
2310 ab->qmi.target.fw_version, in ath12k_qmi_request_target_cap()
2311 ab->qmi.target.fw_build_timestamp, in ath12k_qmi_request_target_cap()
2312 ab->qmi.target.fw_build_id); in ath12k_qmi_request_target_cap()
2330 return -ENOMEM; in ath12k_qmi_load_file_target_mem()
2334 req->valid = 1; in ath12k_qmi_load_file_target_mem()
2335 req->file_id_valid = 1; in ath12k_qmi_load_file_target_mem()
2336 req->file_id = ab->qmi.target.board_id; in ath12k_qmi_load_file_target_mem()
2337 req->total_size_valid = 1; in ath12k_qmi_load_file_target_mem()
2338 req->total_size = remaining; in ath12k_qmi_load_file_target_mem()
2339 req->seg_id_valid = 1; in ath12k_qmi_load_file_target_mem()
2340 req->data_valid = 1; in ath12k_qmi_load_file_target_mem()
2341 req->bdf_type = type; in ath12k_qmi_load_file_target_mem()
2342 req->bdf_type_valid = 1; in ath12k_qmi_load_file_target_mem()
2343 req->end_valid = 1; in ath12k_qmi_load_file_target_mem()
2344 req->end = 0; in ath12k_qmi_load_file_target_mem()
2347 req->data_len = QMI_WLANFW_MAX_DATA_SIZE_V01; in ath12k_qmi_load_file_target_mem()
2349 req->data_len = remaining; in ath12k_qmi_load_file_target_mem()
2350 req->end = 1; in ath12k_qmi_load_file_target_mem()
2354 req->data_valid = 0; in ath12k_qmi_load_file_target_mem()
2355 req->end = 1; in ath12k_qmi_load_file_target_mem()
2356 req->data_len = ATH12K_QMI_MAX_BDF_FILE_NAME_SIZE; in ath12k_qmi_load_file_target_mem()
2358 memcpy(req->data, temp, req->data_len); in ath12k_qmi_load_file_target_mem()
2361 ret = qmi_txn_init(&ab->qmi.handle, &txn, in ath12k_qmi_load_file_target_mem()
2370 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, in ath12k_qmi_load_file_target_mem()
2386 ret = -EINVAL; in ath12k_qmi_load_file_target_mem()
2393 remaining -= req->data_len; in ath12k_qmi_load_file_target_mem()
2394 temp += req->data_len; in ath12k_qmi_load_file_target_mem()
2395 req->seg_id++; in ath12k_qmi_load_file_target_mem()
2410 struct device *dev = ab->dev; in ath12k_qmi_load_bdf_qmi()
2444 if (ab->qmi.target.eeprom_caldata) { in ath12k_qmi_load_bdf_qmi()
2451 /* cal-<bus>-<id>.bin */ in ath12k_qmi_load_bdf_qmi()
2452 snprintf(filename, sizeof(filename), "cal-%s-%s.bin", in ath12k_qmi_load_bdf_qmi()
2453 ath12k_bus_str(ab->hif.bus), dev_name(dev)); in ath12k_qmi_load_bdf_qmi()
2469 fw_size = min_t(u32, ab->hw_params->fw.board_size, in ath12k_qmi_load_bdf_qmi()
2470 fw_entry->size); in ath12k_qmi_load_bdf_qmi()
2471 tmp = fw_entry->data; in ath12k_qmi_load_bdf_qmi()
2483 if (!ab->qmi.target.eeprom_caldata) in ath12k_qmi_load_bdf_qmi()
2493 fw_size = min_t(u32, ab->hw_params->fw.board_size, bd.len); in ath12k_qmi_load_bdf_qmi()
2508 struct m3_mem_region *m3_mem = &ab->qmi.m3_mem; in ath12k_qmi_m3_load()
2509 const struct firmware *fw; in ath12k_qmi_m3_load() local
2513 if (m3_mem->vaddr || m3_mem->size) in ath12k_qmi_m3_load()
2516 fw = ath12k_core_firmware_request(ab, ATH12K_M3_FILE); in ath12k_qmi_m3_load()
2517 if (IS_ERR(fw)) { in ath12k_qmi_m3_load()
2518 ret = PTR_ERR(fw); in ath12k_qmi_m3_load()
2525 m3_mem->vaddr = dma_alloc_coherent(ab->dev, in ath12k_qmi_m3_load()
2526 fw->size, &m3_mem->paddr, in ath12k_qmi_m3_load()
2528 if (!m3_mem->vaddr) { in ath12k_qmi_m3_load()
2530 fw->size); in ath12k_qmi_m3_load()
2531 release_firmware(fw); in ath12k_qmi_m3_load()
2532 return -ENOMEM; in ath12k_qmi_m3_load()
2535 memcpy(m3_mem->vaddr, fw->data, fw->size); in ath12k_qmi_m3_load()
2536 m3_mem->size = fw->size; in ath12k_qmi_m3_load()
2537 release_firmware(fw); in ath12k_qmi_m3_load()
2544 struct m3_mem_region *m3_mem = &ab->qmi.m3_mem; in ath12k_qmi_m3_free()
2546 if (!m3_mem->vaddr) in ath12k_qmi_m3_free()
2549 dma_free_coherent(ab->dev, m3_mem->size, in ath12k_qmi_m3_free()
2550 m3_mem->vaddr, m3_mem->paddr); in ath12k_qmi_m3_free()
2551 m3_mem->vaddr = NULL; in ath12k_qmi_m3_free()
2556 struct m3_mem_region *m3_mem = &ab->qmi.m3_mem; in ath12k_qmi_wlanfw_m3_info_send()
2571 req.addr = m3_mem->paddr; in ath12k_qmi_wlanfw_m3_info_send()
2572 req.size = m3_mem->size; in ath12k_qmi_wlanfw_m3_info_send()
2574 ret = qmi_txn_init(&ab->qmi.handle, &txn, in ath12k_qmi_wlanfw_m3_info_send()
2579 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, in ath12k_qmi_wlanfw_m3_info_send()
2598 ret = -EINVAL; in ath12k_qmi_wlanfw_m3_info_send()
2620 ret = qmi_txn_init(&ab->qmi.handle, &txn, in ath12k_qmi_wlanfw_mode_send()
2625 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, in ath12k_qmi_wlanfw_mode_send()
2637 if (mode == ATH12K_FIRMWARE_MODE_OFF && ret == -ENETRESET) { in ath12k_qmi_wlanfw_mode_send()
2638 ath12k_warn(ab, "WLFW service is dis-connected\n"); in ath12k_qmi_wlanfw_mode_send()
2649 ret = -EINVAL; in ath12k_qmi_wlanfw_mode_send()
2672 ce_cfg = (struct ce_pipe_config *)ab->qmi.ce_cfg.tgt_ce; in ath12k_qmi_wlanfw_wlan_cfg_send()
2673 svc_cfg = (struct service_to_pipe *)ab->qmi.ce_cfg.svc_to_ce_map; in ath12k_qmi_wlanfw_wlan_cfg_send()
2675 ce_cfg = ab->qmi.ce_cfg.tgt_ce; in ath12k_qmi_wlanfw_wlan_cfg_send()
2676 svc_cfg = ab->qmi.ce_cfg.svc_to_ce_map; in ath12k_qmi_wlanfw_wlan_cfg_send()
2681 return -ENOMEM; in ath12k_qmi_wlanfw_wlan_cfg_send()
2685 req->host_version_valid = 1; in ath12k_qmi_wlanfw_wlan_cfg_send()
2686 strscpy(req->host_version, ATH12K_HOST_VERSION_STRING, in ath12k_qmi_wlanfw_wlan_cfg_send()
2687 sizeof(req->host_version)); in ath12k_qmi_wlanfw_wlan_cfg_send()
2689 req->tgt_cfg_valid = 1; in ath12k_qmi_wlanfw_wlan_cfg_send()
2691 req->tgt_cfg_len = ab->qmi.ce_cfg.tgt_ce_len; in ath12k_qmi_wlanfw_wlan_cfg_send()
2692 for (pipe_num = 0; pipe_num < req->tgt_cfg_len ; pipe_num++) { in ath12k_qmi_wlanfw_wlan_cfg_send()
2693 req->tgt_cfg[pipe_num].pipe_num = ce_cfg[pipe_num].pipenum; in ath12k_qmi_wlanfw_wlan_cfg_send()
2694 req->tgt_cfg[pipe_num].pipe_dir = ce_cfg[pipe_num].pipedir; in ath12k_qmi_wlanfw_wlan_cfg_send()
2695 req->tgt_cfg[pipe_num].nentries = ce_cfg[pipe_num].nentries; in ath12k_qmi_wlanfw_wlan_cfg_send()
2696 req->tgt_cfg[pipe_num].nbytes_max = ce_cfg[pipe_num].nbytes_max; in ath12k_qmi_wlanfw_wlan_cfg_send()
2697 req->tgt_cfg[pipe_num].flags = ce_cfg[pipe_num].flags; in ath12k_qmi_wlanfw_wlan_cfg_send()
2700 req->svc_cfg_valid = 1; in ath12k_qmi_wlanfw_wlan_cfg_send()
2702 req->svc_cfg_len = ab->qmi.ce_cfg.svc_to_ce_map_len; in ath12k_qmi_wlanfw_wlan_cfg_send()
2703 for (pipe_num = 0; pipe_num < req->svc_cfg_len; pipe_num++) { in ath12k_qmi_wlanfw_wlan_cfg_send()
2704 req->svc_cfg[pipe_num].service_id = svc_cfg[pipe_num].service_id; in ath12k_qmi_wlanfw_wlan_cfg_send()
2705 req->svc_cfg[pipe_num].pipe_dir = svc_cfg[pipe_num].pipedir; in ath12k_qmi_wlanfw_wlan_cfg_send()
2706 req->svc_cfg[pipe_num].pipe_num = svc_cfg[pipe_num].pipenum; in ath12k_qmi_wlanfw_wlan_cfg_send()
2710 if (ab->hw_params->supports_shadow_regs) { in ath12k_qmi_wlanfw_wlan_cfg_send()
2711 req->shadow_reg_v3_valid = 1; in ath12k_qmi_wlanfw_wlan_cfg_send()
2712 req->shadow_reg_v3_len = min_t(u32, in ath12k_qmi_wlanfw_wlan_cfg_send()
2713 ab->qmi.ce_cfg.shadow_reg_v3_len, in ath12k_qmi_wlanfw_wlan_cfg_send()
2715 memcpy(&req->shadow_reg_v3, ab->qmi.ce_cfg.shadow_reg_v3, in ath12k_qmi_wlanfw_wlan_cfg_send()
2716 sizeof(u32) * req->shadow_reg_v3_len); in ath12k_qmi_wlanfw_wlan_cfg_send()
2718 req->shadow_reg_v3_valid = 0; in ath12k_qmi_wlanfw_wlan_cfg_send()
2721 ret = qmi_txn_init(&ab->qmi.handle, &txn, in ath12k_qmi_wlanfw_wlan_cfg_send()
2726 ret = qmi_send_request(&ab->qmi.handle, NULL, &txn, in ath12k_qmi_wlanfw_wlan_cfg_send()
2745 ret = -EINVAL; in ath12k_qmi_wlanfw_wlan_cfg_send()
2778 ath12k_warn(ab, "qmi failed to send wlan fw mode:%d\n", ret); in ath12k_qmi_firmware_start()
2794 return -ENOMEM; in ath12k_qmi_driver_event_post()
2796 event->type = type; in ath12k_qmi_driver_event_post()
2797 event->data = data; in ath12k_qmi_driver_event_post()
2799 spin_lock(&qmi->event_lock); in ath12k_qmi_driver_event_post()
2800 list_add_tail(&event->list, &qmi->event_list); in ath12k_qmi_driver_event_post()
2801 spin_unlock(&qmi->event_lock); in ath12k_qmi_driver_event_post()
2803 queue_work(qmi->event_wq, &qmi->event_work); in ath12k_qmi_driver_event_post()
2810 struct ath12k_base *ab = qmi->ab; in ath12k_qmi_event_server_arrive()
2815 ath12k_warn(ab, "qmi failed to send FW indication QMI:%d\n", ret); in ath12k_qmi_event_server_arrive()
2830 struct ath12k_base *ab = qmi->ab; in ath12k_qmi_event_mem_request()
2835 ath12k_warn(ab, "qmi failed to respond fw mem req:%d\n", ret); in ath12k_qmi_event_mem_request()
2844 struct ath12k_base *ab = qmi->ab; in ath12k_qmi_event_load_bdf()
2865 if (ab->hw_params->download_calib) { in ath12k_qmi_event_load_bdf()
2886 struct ath12k_base *ab = qmi->ab; in ath12k_qmi_msg_mem_request_cb()
2892 if (msg->mem_seg_len == 0 || in ath12k_qmi_msg_mem_request_cb()
2893 msg->mem_seg_len > ATH12K_QMI_WLANFW_MAX_NUM_MEM_SEG_V01) in ath12k_qmi_msg_mem_request_cb()
2895 msg->mem_seg_len); in ath12k_qmi_msg_mem_request_cb()
2897 ab->qmi.mem_seg_count = msg->mem_seg_len; in ath12k_qmi_msg_mem_request_cb()
2899 for (i = 0; i < qmi->mem_seg_count ; i++) { in ath12k_qmi_msg_mem_request_cb()
2900 ab->qmi.target_mem[i].type = msg->mem_seg[i].type; in ath12k_qmi_msg_mem_request_cb()
2901 ab->qmi.target_mem[i].size = msg->mem_seg[i].size; in ath12k_qmi_msg_mem_request_cb()
2903 msg->mem_seg[i].type, msg->mem_seg[i].size); in ath12k_qmi_msg_mem_request_cb()
2922 struct ath12k_base *ab = qmi->ab; in ath12k_qmi_msg_mem_ready_cb()
2934 struct ath12k_base *ab = qmi->ab; in ath12k_qmi_msg_fw_ready_cb()
2968 struct ath12k_base *ab = qmi->ab; in ath12k_qmi_ops_new_server()
2969 struct sockaddr_qrtr *sq = &qmi->sq; in ath12k_qmi_ops_new_server()
2972 sq->sq_family = AF_QIPCRTR; in ath12k_qmi_ops_new_server()
2973 sq->sq_node = service->node; in ath12k_qmi_ops_new_server()
2974 sq->sq_port = service->port; in ath12k_qmi_ops_new_server()
2976 ret = kernel_connect(qmi_hdl->sock, (struct sockaddr *)sq, in ath12k_qmi_ops_new_server()
2983 ath12k_dbg(ab, ATH12K_DBG_QMI, "qmi wifi fw qmi service connected\n"); in ath12k_qmi_ops_new_server()
2993 struct ath12k_base *ab = qmi->ab; in ath12k_qmi_ops_del_server()
2995 ath12k_dbg(ab, ATH12K_DBG_QMI, "qmi wifi fw del server\n"); in ath12k_qmi_ops_del_server()
3009 struct ath12k_base *ab = qmi->ab; in ath12k_qmi_driver_event_work()
3012 spin_lock(&qmi->event_lock); in ath12k_qmi_driver_event_work()
3013 while (!list_empty(&qmi->event_list)) { in ath12k_qmi_driver_event_work()
3014 event = list_first_entry(&qmi->event_list, in ath12k_qmi_driver_event_work()
3016 list_del(&event->list); in ath12k_qmi_driver_event_work()
3017 spin_unlock(&qmi->event_lock); in ath12k_qmi_driver_event_work()
3019 if (test_bit(ATH12K_FLAG_UNREGISTERING, &ab->dev_flags)) in ath12k_qmi_driver_event_work()
3022 switch (event->type) { in ath12k_qmi_driver_event_work()
3026 set_bit(ATH12K_FLAG_QMI_FAIL, &ab->dev_flags); in ath12k_qmi_driver_event_work()
3029 set_bit(ATH12K_FLAG_CRASH_FLUSH, &ab->dev_flags); in ath12k_qmi_driver_event_work()
3030 set_bit(ATH12K_FLAG_RECOVERY, &ab->dev_flags); in ath12k_qmi_driver_event_work()
3035 set_bit(ATH12K_FLAG_QMI_FAIL, &ab->dev_flags); in ath12k_qmi_driver_event_work()
3040 set_bit(ATH12K_FLAG_QMI_FAIL, &ab->dev_flags); in ath12k_qmi_driver_event_work()
3043 clear_bit(ATH12K_FLAG_QMI_FAIL, &ab->dev_flags); in ath12k_qmi_driver_event_work()
3044 if (test_bit(ATH12K_FLAG_REGISTERED, &ab->dev_flags)) { in ath12k_qmi_driver_event_work()
3046 queue_work(ab->workqueue, &ab->restart_work); in ath12k_qmi_driver_event_work()
3051 &ab->dev_flags); in ath12k_qmi_driver_event_work()
3052 clear_bit(ATH12K_FLAG_RECOVERY, &ab->dev_flags); in ath12k_qmi_driver_event_work()
3054 set_bit(ATH12K_FLAG_REGISTERED, &ab->dev_flags); in ath12k_qmi_driver_event_work()
3058 ath12k_warn(ab, "invalid event type: %d", event->type); in ath12k_qmi_driver_event_work()
3064 spin_lock(&qmi->event_lock); in ath12k_qmi_driver_event_work()
3066 spin_unlock(&qmi->event_lock); in ath12k_qmi_driver_event_work()
3073 memset(&ab->qmi.target, 0, sizeof(struct target_info)); in ath12k_qmi_init_service()
3074 memset(&ab->qmi.target_mem, 0, sizeof(struct target_mem_chunk)); in ath12k_qmi_init_service()
3075 ab->qmi.ab = ab; in ath12k_qmi_init_service()
3077 ab->qmi.target_mem_mode = ATH12K_QMI_TARGET_MEM_MODE_DEFAULT; in ath12k_qmi_init_service()
3078 ret = qmi_handle_init(&ab->qmi.handle, ATH12K_QMI_RESP_LEN_MAX, in ath12k_qmi_init_service()
3085 ab->qmi.event_wq = alloc_ordered_workqueue("ath12k_qmi_driver_event", 0); in ath12k_qmi_init_service()
3086 if (!ab->qmi.event_wq) { in ath12k_qmi_init_service()
3088 return -EFAULT; in ath12k_qmi_init_service()
3091 INIT_LIST_HEAD(&ab->qmi.event_list); in ath12k_qmi_init_service()
3092 spin_lock_init(&ab->qmi.event_lock); in ath12k_qmi_init_service()
3093 INIT_WORK(&ab->qmi.event_work, ath12k_qmi_driver_event_work); in ath12k_qmi_init_service()
3095 ret = qmi_add_lookup(&ab->qmi.handle, ATH12K_QMI_WLFW_SERVICE_ID_V01, in ath12k_qmi_init_service()
3097 ab->qmi.service_ins_id); in ath12k_qmi_init_service()
3100 destroy_workqueue(ab->qmi.event_wq); in ath12k_qmi_init_service()
3109 qmi_handle_release(&ab->qmi.handle); in ath12k_qmi_deinit_service()
3110 cancel_work_sync(&ab->qmi.event_work); in ath12k_qmi_deinit_service()
3111 destroy_workqueue(ab->qmi.event_wq); in ath12k_qmi_deinit_service()