Lines Matching refs:seg_info
16 struct ath10k_swap_code_seg_info *seg_info, in ath10k_swap_code_seg_fill() argument
19 u8 *virt_addr = seg_info->virt_address[0]; in ath10k_swap_code_seg_fill()
32 seg_info->target_addr = -1; in ath10k_swap_code_seg_fill()
50 seg_info->target_addr = in ath10k_swap_code_seg_fill()
63 if (seg_info->target_addr == -1) { in ath10k_swap_code_seg_fill()
67 seg_info->seg_hw_info.swap_size = __cpu_to_le32(total_payload_len); in ath10k_swap_code_seg_fill()
74 struct ath10k_swap_code_seg_info *seg_info) in ath10k_swap_code_seg_free() argument
78 if (!seg_info) in ath10k_swap_code_seg_free()
81 if (!seg_info->virt_address[0]) in ath10k_swap_code_seg_free()
84 seg_size = __le32_to_cpu(seg_info->seg_hw_info.size); in ath10k_swap_code_seg_free()
85 dma_free_coherent(ar->dev, seg_size, seg_info->virt_address[0], in ath10k_swap_code_seg_free()
86 seg_info->paddr[0]); in ath10k_swap_code_seg_free()
92 struct ath10k_swap_code_seg_info *seg_info; in ath10k_swap_code_seg_alloc() local
103 seg_info = devm_kzalloc(ar->dev, sizeof(*seg_info), GFP_KERNEL); in ath10k_swap_code_seg_alloc()
104 if (!seg_info) in ath10k_swap_code_seg_alloc()
112 seg_info->seg_hw_info.bus_addr[0] = __cpu_to_le32(paddr); in ath10k_swap_code_seg_alloc()
113 seg_info->seg_hw_info.size = __cpu_to_le32(swap_bin_len); in ath10k_swap_code_seg_alloc()
114 seg_info->seg_hw_info.swap_size = __cpu_to_le32(swap_bin_len); in ath10k_swap_code_seg_alloc()
115 seg_info->seg_hw_info.num_segs = in ath10k_swap_code_seg_alloc()
117 seg_info->seg_hw_info.size_log2 = __cpu_to_le32(ilog2(swap_bin_len)); in ath10k_swap_code_seg_alloc()
118 seg_info->virt_address[0] = virt_addr; in ath10k_swap_code_seg_alloc()
119 seg_info->paddr[0] = paddr; in ath10k_swap_code_seg_alloc()
121 return seg_info; in ath10k_swap_code_seg_alloc()
128 struct ath10k_swap_code_seg_info *seg_info = NULL; in ath10k_swap_code_seg_configure() local
135 seg_info = fw_file->firmware_swap_code_seg_info; in ath10k_swap_code_seg_configure()
137 ret = ath10k_bmi_write_memory(ar, seg_info->target_addr, in ath10k_swap_code_seg_configure()
138 &seg_info->seg_hw_info, in ath10k_swap_code_seg_configure()
139 sizeof(seg_info->seg_hw_info)); in ath10k_swap_code_seg_configure()
166 struct ath10k_swap_code_seg_info *seg_info; in ath10k_swap_code_seg_init() local
176 seg_info = ath10k_swap_code_seg_alloc(ar, codeswap_len); in ath10k_swap_code_seg_init()
177 if (!seg_info) { in ath10k_swap_code_seg_init()
182 ret = ath10k_swap_code_seg_fill(ar, seg_info, in ath10k_swap_code_seg_init()
188 ath10k_swap_code_seg_free(ar, seg_info); in ath10k_swap_code_seg_init()
192 fw_file->firmware_swap_code_seg_info = seg_info; in ath10k_swap_code_seg_init()