Lines Matching refs:seg_info
27 struct ath10k_swap_code_seg_info *seg_info, in ath10k_swap_code_seg_fill() argument
30 u8 *virt_addr = seg_info->virt_address[0]; in ath10k_swap_code_seg_fill()
43 seg_info->target_addr = -1; in ath10k_swap_code_seg_fill()
61 seg_info->target_addr = in ath10k_swap_code_seg_fill()
74 if (seg_info->target_addr == -1) { in ath10k_swap_code_seg_fill()
78 seg_info->seg_hw_info.swap_size = __cpu_to_le32(total_payload_len); in ath10k_swap_code_seg_fill()
85 struct ath10k_swap_code_seg_info *seg_info) in ath10k_swap_code_seg_free() argument
89 if (!seg_info) in ath10k_swap_code_seg_free()
92 if (!seg_info->virt_address[0]) in ath10k_swap_code_seg_free()
95 seg_size = __le32_to_cpu(seg_info->seg_hw_info.size); in ath10k_swap_code_seg_free()
96 dma_free_coherent(ar->dev, seg_size, seg_info->virt_address[0], in ath10k_swap_code_seg_free()
97 seg_info->paddr[0]); in ath10k_swap_code_seg_free()
103 struct ath10k_swap_code_seg_info *seg_info; in ath10k_swap_code_seg_alloc() local
114 seg_info = devm_kzalloc(ar->dev, sizeof(*seg_info), GFP_KERNEL); in ath10k_swap_code_seg_alloc()
115 if (!seg_info) in ath10k_swap_code_seg_alloc()
125 seg_info->seg_hw_info.bus_addr[0] = __cpu_to_le32(paddr); in ath10k_swap_code_seg_alloc()
126 seg_info->seg_hw_info.size = __cpu_to_le32(swap_bin_len); in ath10k_swap_code_seg_alloc()
127 seg_info->seg_hw_info.swap_size = __cpu_to_le32(swap_bin_len); in ath10k_swap_code_seg_alloc()
128 seg_info->seg_hw_info.num_segs = in ath10k_swap_code_seg_alloc()
130 seg_info->seg_hw_info.size_log2 = __cpu_to_le32(ilog2(swap_bin_len)); in ath10k_swap_code_seg_alloc()
131 seg_info->virt_address[0] = virt_addr; in ath10k_swap_code_seg_alloc()
132 seg_info->paddr[0] = paddr; in ath10k_swap_code_seg_alloc()
134 return seg_info; in ath10k_swap_code_seg_alloc()
141 struct ath10k_swap_code_seg_info *seg_info = NULL; in ath10k_swap_code_seg_configure() local
149 seg_info = ar->swap.firmware_swap_code_seg_info; in ath10k_swap_code_seg_configure()
159 ret = ath10k_bmi_write_memory(ar, seg_info->target_addr, in ath10k_swap_code_seg_configure()
160 &seg_info->seg_hw_info, in ath10k_swap_code_seg_configure()
161 sizeof(seg_info->seg_hw_info)); in ath10k_swap_code_seg_configure()
182 struct ath10k_swap_code_seg_info *seg_info; in ath10k_swap_code_seg_init() local
187 seg_info = ath10k_swap_code_seg_alloc(ar, in ath10k_swap_code_seg_init()
189 if (!seg_info) { in ath10k_swap_code_seg_init()
194 ret = ath10k_swap_code_seg_fill(ar, seg_info, 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()