Lines Matching +full:device +full:- +full:version
1 // SPDX-License-Identifier: ISC
3 * Copyright (c) 2005-2011 Atheros Communications Inc.
4 * Copyright (c) 2011-2014,2016-2017 Qualcomm Atheros, Inc.
17 ar->bmi.done_sent = false; in ath10k_bmi_start()
29 if (ar->bmi.done_sent) { in ath10k_bmi_done()
34 ar->bmi.done_sent = true; in ath10k_bmi_done()
39 ath10k_warn(ar, "unable to write to the device: %d\n", ret); in ath10k_bmi_done()
57 if (ar->bmi.done_sent) { in ath10k_bmi_get_target_info()
59 return -EBUSY; in ath10k_bmi_get_target_info()
66 ath10k_warn(ar, "unable to get target info from device\n"); in ath10k_bmi_get_target_info()
73 return -EIO; in ath10k_bmi_get_target_info()
76 target_info->version = __le32_to_cpu(resp.get_target_info.version); in ath10k_bmi_get_target_info()
77 target_info->type = __le32_to_cpu(resp.get_target_info.type); in ath10k_bmi_get_target_info()
96 if (ar->bmi.done_sent) { in ath10k_bmi_get_target_info_sdio()
98 return -EBUSY; in ath10k_bmi_get_target_info_sdio()
104 * the special sentinel version word or the first word in the in ath10k_bmi_get_target_info_sdio()
105 * version response. in ath10k_bmi_get_target_info_sdio()
110 ath10k_warn(ar, "unable to read from device\n"); in ath10k_bmi_get_target_info_sdio()
115 * version response. in ath10k_bmi_get_target_info_sdio()
118 /* Step 1b: Read the version length */ in ath10k_bmi_get_target_info_sdio()
123 ath10k_warn(ar, "unable to read from device\n"); in ath10k_bmi_get_target_info_sdio()
134 return -EINVAL; in ath10k_bmi_get_target_info_sdio()
137 /* Step 3: Read the rest of the version response */ in ath10k_bmi_get_target_info_sdio()
138 resplen = sizeof(resp.get_target_info) - sizeof(u32); in ath10k_bmi_get_target_info_sdio()
140 &resp.get_target_info.version, in ath10k_bmi_get_target_info_sdio()
143 ath10k_warn(ar, "unable to read from device\n"); in ath10k_bmi_get_target_info_sdio()
147 target_info->version = __le32_to_cpu(resp.get_target_info.version); in ath10k_bmi_get_target_info_sdio()
148 target_info->type = __le32_to_cpu(resp.get_target_info.type); in ath10k_bmi_get_target_info_sdio()
169 if (ar->bmi.done_sent) { in ath10k_bmi_read_memory()
171 return -EBUSY; in ath10k_bmi_read_memory()
184 ath10k_warn(ar, "unable to read from the device (%d)\n", in ath10k_bmi_read_memory()
192 length -= rxlen; in ath10k_bmi_read_memory()
209 if (ar->bmi.done_sent) { in ath10k_bmi_write_soc_reg()
211 return -EBUSY; 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()
239 if (ar->bmi.done_sent) { in ath10k_bmi_read_soc_reg()
241 return -EBUSY; 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()
277 if (ar->bmi.done_sent) { in ath10k_bmi_write_memory()
279 return -EBUSY; in ath10k_bmi_write_memory()
283 txlen = min(length, BMI_MAX_DATA_SIZE - hdrlen); in ath10k_bmi_write_memory()
296 ath10k_warn(ar, "unable to write to the device (%d)\n", in ath10k_bmi_write_memory()
306 length -= txlen; in ath10k_bmi_write_memory()
323 if (ar->bmi.done_sent) { in ath10k_bmi_execute()
325 return -EBUSY; in ath10k_bmi_execute()
334 ath10k_warn(ar, "unable to read from the device\n"); in ath10k_bmi_execute()
341 return -EIO; in ath10k_bmi_execute()
358 u32 hdrlen = sizeof(cmd->id) + sizeof(cmd->lz_data); in ath10k_bmi_lz_data_large()
366 if (ar->bmi.done_sent) { in ath10k_bmi_lz_data_large()
368 return -EBUSY; in ath10k_bmi_lz_data_large()
371 buf_len = sizeof(*cmd) + BMI_MAX_LARGE_DATA_SIZE - BMI_MAX_DATA_SIZE; in ath10k_bmi_lz_data_large()
374 return -ENOMEM; in ath10k_bmi_lz_data_large()
377 txlen = min(length, BMI_MAX_LARGE_DATA_SIZE - hdrlen); in ath10k_bmi_lz_data_large()
381 cmd->id = __cpu_to_le32(BMI_LZ_DATA); in ath10k_bmi_lz_data_large()
382 cmd->lz_data.len = __cpu_to_le32(txlen); in ath10k_bmi_lz_data_large()
383 memcpy(cmd->lz_data.payload, buffer, txlen); in ath10k_bmi_lz_data_large()
388 ath10k_warn(ar, "unable to write to the device\n"); in ath10k_bmi_lz_data_large()
394 length -= txlen; in ath10k_bmi_lz_data_large()
417 if (ar->bmi.done_sent) { in ath10k_bmi_lz_data()
419 return -EBUSY; in ath10k_bmi_lz_data()
423 txlen = min(length, BMI_MAX_DATA_SIZE - hdrlen); in ath10k_bmi_lz_data()
434 ath10k_warn(ar, "unable to write to the device\n"); in ath10k_bmi_lz_data()
439 length -= txlen; in ath10k_bmi_lz_data()
454 if (ar->bmi.done_sent) { in ath10k_bmi_lz_stream_start()
456 return -EBUSY; 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()
476 u32 trailer_len = length - head_len; in ath10k_bmi_fast_download()
495 if (ar->hw_params.bmi_large_size_download) in ath10k_bmi_fast_download()
524 if (ar->bmi.done_sent) { in ath10k_bmi_set_start()
526 return -EBUSY; in ath10k_bmi_set_start()
534 ath10k_warn(ar, "unable to set start to the device:%d\n", ret); in ath10k_bmi_set_start()