Lines Matching refs:ar
13 void ath10k_bmi_start(struct ath10k *ar) in ath10k_bmi_start() argument
15 ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi start\n"); in ath10k_bmi_start()
17 ar->bmi.done_sent = false; in ath10k_bmi_start()
21 int ath10k_bmi_done(struct ath10k *ar) in ath10k_bmi_done() argument
27 ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi done\n"); in ath10k_bmi_done()
29 if (ar->bmi.done_sent) { in ath10k_bmi_done()
30 ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi skipped\n"); in ath10k_bmi_done()
34 ar->bmi.done_sent = true; in ath10k_bmi_done()
37 ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, NULL, NULL); in ath10k_bmi_done()
39 ath10k_warn(ar, "unable to write to the device: %d\n", ret); in ath10k_bmi_done()
46 int ath10k_bmi_get_target_info(struct ath10k *ar, in ath10k_bmi_get_target_info() argument
55 ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi get target info\n"); in ath10k_bmi_get_target_info()
57 if (ar->bmi.done_sent) { in ath10k_bmi_get_target_info()
58 ath10k_warn(ar, "BMI Get Target Info Command disallowed\n"); in ath10k_bmi_get_target_info()
64 ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, &resp, &resplen); in ath10k_bmi_get_target_info()
66 ath10k_warn(ar, "unable to get target info from device\n"); in ath10k_bmi_get_target_info()
71 ath10k_warn(ar, "invalid get_target_info response length (%d)\n", in ath10k_bmi_get_target_info()
84 int ath10k_bmi_get_target_info_sdio(struct ath10k *ar, in ath10k_bmi_get_target_info_sdio() argument
94 ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi get target info SDIO\n"); in ath10k_bmi_get_target_info_sdio()
96 if (ar->bmi.done_sent) { in ath10k_bmi_get_target_info_sdio()
97 ath10k_warn(ar, "BMI Get Target Info Command disallowed\n"); in ath10k_bmi_get_target_info_sdio()
108 ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, &tmp, &resplen); in ath10k_bmi_get_target_info_sdio()
110 ath10k_warn(ar, "unable to read from device\n"); in ath10k_bmi_get_target_info_sdio()
120 ret = ath10k_hif_exchange_bmi_msg(ar, NULL, 0, &tmp, in ath10k_bmi_get_target_info_sdio()
123 ath10k_warn(ar, "unable to read from device\n"); in ath10k_bmi_get_target_info_sdio()
132 ath10k_warn(ar, "Unexpected target info len: %u. Expected: %zu\n", in ath10k_bmi_get_target_info_sdio()
139 ret = ath10k_hif_exchange_bmi_msg(ar, NULL, 0, in ath10k_bmi_get_target_info_sdio()
143 ath10k_warn(ar, "unable to read from device\n"); in ath10k_bmi_get_target_info_sdio()
153 int ath10k_bmi_read_memory(struct ath10k *ar, in ath10k_bmi_read_memory() argument
166 ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi read address 0x%x length %d\n", in ath10k_bmi_read_memory()
169 if (ar->bmi.done_sent) { in ath10k_bmi_read_memory()
170 ath10k_warn(ar, "command disallowed\n"); in ath10k_bmi_read_memory()
181 ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, in ath10k_bmi_read_memory()
184 ath10k_warn(ar, "unable to read from the device (%d)\n", in ath10k_bmi_read_memory()
199 int ath10k_bmi_write_soc_reg(struct ath10k *ar, u32 address, u32 reg_val) in ath10k_bmi_write_soc_reg() argument
205 ath10k_dbg(ar, ATH10K_DBG_BMI, in ath10k_bmi_write_soc_reg()
209 if (ar->bmi.done_sent) { in ath10k_bmi_write_soc_reg()
210 ath10k_warn(ar, "bmi write soc register command in progress\n"); in ath10k_bmi_write_soc_reg()
218 ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, NULL, NULL); in ath10k_bmi_write_soc_reg()
220 ath10k_warn(ar, "Unable to write soc register to device: %d\n", in ath10k_bmi_write_soc_reg()
228 int ath10k_bmi_read_soc_reg(struct ath10k *ar, u32 address, u32 *reg_val) in ath10k_bmi_read_soc_reg() argument
236 ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi read soc register 0x%08x\n", in ath10k_bmi_read_soc_reg()
239 if (ar->bmi.done_sent) { in ath10k_bmi_read_soc_reg()
240 ath10k_warn(ar, "bmi read soc register command in progress\n"); in ath10k_bmi_read_soc_reg()
247 ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, &resp, &resplen); in ath10k_bmi_read_soc_reg()
249 ath10k_warn(ar, "Unable to read soc register from device: %d\n", in ath10k_bmi_read_soc_reg()
256 ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi read soc register value 0x%08x\n", in ath10k_bmi_read_soc_reg()
262 int ath10k_bmi_write_memory(struct ath10k *ar, in ath10k_bmi_write_memory() argument
274 ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi write address 0x%x length %d\n", in ath10k_bmi_write_memory()
277 if (ar->bmi.done_sent) { in ath10k_bmi_write_memory()
278 ath10k_warn(ar, "command disallowed\n"); in ath10k_bmi_write_memory()
293 ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, hdrlen + txlen, in ath10k_bmi_write_memory()
296 ath10k_warn(ar, "unable to write to the device (%d)\n", in ath10k_bmi_write_memory()
312 int ath10k_bmi_execute(struct ath10k *ar, u32 address, u32 param, u32 *result) in ath10k_bmi_execute() argument
320 ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi execute address 0x%x param 0x%x\n", in ath10k_bmi_execute()
323 if (ar->bmi.done_sent) { in ath10k_bmi_execute()
324 ath10k_warn(ar, "command disallowed\n"); in ath10k_bmi_execute()
332 ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, &resp, &resplen); in ath10k_bmi_execute()
334 ath10k_warn(ar, "unable to read from the device\n"); in ath10k_bmi_execute()
339 ath10k_warn(ar, "invalid execute response length (%d)\n", in ath10k_bmi_execute()
346 ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi execute result 0x%x\n", *result); in ath10k_bmi_execute()
352 static int ath10k_bmi_lz_data_large(struct ath10k *ar, const void *buffer, u32 length) in ath10k_bmi_lz_data_large() argument
354 static int ath10k_bmi_lz_data_large(struct ath10k *ar, const u8 *buffer, u32 length) in ath10k_bmi_lz_data_large()
363 ath10k_dbg(ar, ATH10K_DBG_BMI, "large bmi lz data buffer 0x%pK length %d\n", in ath10k_bmi_lz_data_large()
366 if (ar->bmi.done_sent) { in ath10k_bmi_lz_data_large()
367 ath10k_warn(ar, "command disallowed\n"); in ath10k_bmi_lz_data_large()
385 ret = ath10k_hif_exchange_bmi_msg(ar, cmd, hdrlen + txlen, in ath10k_bmi_lz_data_large()
388 ath10k_warn(ar, "unable to write to the device\n"); in ath10k_bmi_lz_data_large()
403 int ath10k_bmi_lz_data(struct ath10k *ar, const void *buffer, u32 length) in ath10k_bmi_lz_data() argument
406 int ath10k_bmi_lz_data(struct ath10k *ar, const u8 *buffer, u32 length) in ath10k_bmi_lz_data()
414 ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi lz data buffer 0x%pK length %d\n", in ath10k_bmi_lz_data()
417 if (ar->bmi.done_sent) { in ath10k_bmi_lz_data()
418 ath10k_warn(ar, "command disallowed\n"); in ath10k_bmi_lz_data()
431 ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, hdrlen + txlen, in ath10k_bmi_lz_data()
434 ath10k_warn(ar, "unable to write to the device\n"); in ath10k_bmi_lz_data()
445 int ath10k_bmi_lz_stream_start(struct ath10k *ar, u32 address) in ath10k_bmi_lz_stream_start() argument
451 ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi lz stream start address 0x%x\n", in ath10k_bmi_lz_stream_start()
454 if (ar->bmi.done_sent) { in ath10k_bmi_lz_stream_start()
455 ath10k_warn(ar, "command disallowed\n"); in ath10k_bmi_lz_stream_start()
462 ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, NULL, NULL); in ath10k_bmi_lz_stream_start()
464 ath10k_warn(ar, "unable to Start LZ Stream to the device\n"); in ath10k_bmi_lz_stream_start()
471 int ath10k_bmi_fast_download(struct ath10k *ar, in ath10k_bmi_fast_download() argument
479 ath10k_dbg(ar, ATH10K_DBG_BMI, in ath10k_bmi_fast_download()
483 ret = ath10k_bmi_lz_stream_start(ar, address); in ath10k_bmi_fast_download()
495 if (ar->hw_params.bmi_large_size_download) in ath10k_bmi_fast_download()
496 ret = ath10k_bmi_lz_data_large(ar, buffer, head_len); in ath10k_bmi_fast_download()
498 ret = ath10k_bmi_lz_data(ar, buffer, head_len); in ath10k_bmi_fast_download()
504 ret = ath10k_bmi_lz_data(ar, trailer, 4); in ath10k_bmi_fast_download()
513 ret = ath10k_bmi_lz_stream_start(ar, 0x00); in ath10k_bmi_fast_download()
518 int ath10k_bmi_set_start(struct ath10k *ar, u32 address) in ath10k_bmi_set_start() argument
524 if (ar->bmi.done_sent) { in ath10k_bmi_set_start()
525 ath10k_warn(ar, "bmi set start command disallowed\n"); in ath10k_bmi_set_start()
532 ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, NULL, NULL); in ath10k_bmi_set_start()
534 ath10k_warn(ar, "unable to set start to the device:%d\n", ret); in ath10k_bmi_set_start()