Lines Matching refs:ar

26 static int ath10k_swap_code_seg_fill(struct ath10k *ar,  in ath10k_swap_code_seg_fill()  argument
50 ath10k_err(ar, "refusing to parse invalid tlv length %d\n", in ath10k_swap_code_seg_fill()
58 ath10k_err(ar, "refusing an invalid swap file\n"); in ath10k_swap_code_seg_fill()
75 ath10k_err(ar, "failed to parse invalid swap file\n"); in ath10k_swap_code_seg_fill()
84 ath10k_swap_code_seg_free(struct ath10k *ar, in ath10k_swap_code_seg_free() argument
96 dma_free_coherent(ar->dev, seg_size, seg_info->virt_address[0], in ath10k_swap_code_seg_free()
101 ath10k_swap_code_seg_alloc(struct ath10k *ar, size_t swap_bin_len) in ath10k_swap_code_seg_alloc() argument
109 ath10k_err(ar, "refusing code swap bin because it is too big %zu > %d\n", in ath10k_swap_code_seg_alloc()
114 seg_info = devm_kzalloc(ar->dev, sizeof(*seg_info), GFP_KERNEL); in ath10k_swap_code_seg_alloc()
118 virt_addr = dma_alloc_coherent(ar->dev, swap_bin_len, &paddr, in ath10k_swap_code_seg_alloc()
121 ath10k_err(ar, "failed to allocate dma coherent memory\n"); in ath10k_swap_code_seg_alloc()
137 int ath10k_swap_code_seg_configure(struct ath10k *ar, in ath10k_swap_code_seg_configure() argument
145 if (!ar->swap.firmware_swap_code_seg_info) in ath10k_swap_code_seg_configure()
148 ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot found firmware code swap binary\n"); in ath10k_swap_code_seg_configure()
149 seg_info = ar->swap.firmware_swap_code_seg_info; in ath10k_swap_code_seg_configure()
154 ath10k_warn(ar, "ignoring unknown code swap binary type %d\n", in ath10k_swap_code_seg_configure()
159 ret = ath10k_bmi_write_memory(ar, seg_info->target_addr, in ath10k_swap_code_seg_configure()
163 ath10k_err(ar, "failed to write Code swap segment information (%d)\n", in ath10k_swap_code_seg_configure()
171 void ath10k_swap_code_seg_release(struct ath10k *ar) in ath10k_swap_code_seg_release() argument
173 ath10k_swap_code_seg_free(ar, ar->swap.firmware_swap_code_seg_info); in ath10k_swap_code_seg_release()
174 ar->swap.firmware_codeswap_data = NULL; in ath10k_swap_code_seg_release()
175 ar->swap.firmware_codeswap_len = 0; in ath10k_swap_code_seg_release()
176 ar->swap.firmware_swap_code_seg_info = NULL; in ath10k_swap_code_seg_release()
179 int ath10k_swap_code_seg_init(struct ath10k *ar) in ath10k_swap_code_seg_init() argument
184 if (!ar->swap.firmware_codeswap_len || !ar->swap.firmware_codeswap_data) in ath10k_swap_code_seg_init()
187 seg_info = ath10k_swap_code_seg_alloc(ar, in ath10k_swap_code_seg_init()
188 ar->swap.firmware_codeswap_len); in ath10k_swap_code_seg_init()
190 ath10k_err(ar, "failed to allocate fw code swap segment\n"); in ath10k_swap_code_seg_init()
194 ret = ath10k_swap_code_seg_fill(ar, seg_info, in ath10k_swap_code_seg_init()
195 ar->swap.firmware_codeswap_data, in ath10k_swap_code_seg_init()
196 ar->swap.firmware_codeswap_len); in ath10k_swap_code_seg_init()
199 ath10k_warn(ar, "failed to initialize fw code swap segment: %d\n", in ath10k_swap_code_seg_init()
201 ath10k_swap_code_seg_free(ar, seg_info); in ath10k_swap_code_seg_init()
205 ar->swap.firmware_swap_code_seg_info = seg_info; in ath10k_swap_code_seg_init()