Lines Matching refs:ar
473 static void ath10k_snoc_write32(struct ath10k *ar, u32 offset, u32 value) in ath10k_snoc_write32() argument
475 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_write32()
480 static u32 ath10k_snoc_read32(struct ath10k *ar, u32 offset) in ath10k_snoc_read32() argument
482 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_read32()
493 struct ath10k *ar = pipe->hif_ce_state; in __ath10k_snoc_rx_post_buf() local
494 struct ath10k_ce *ce = ath10k_ce_priv(ar); in __ath10k_snoc_rx_post_buf()
505 paddr = dma_map_single(ar->dev, skb->data, in __ath10k_snoc_rx_post_buf()
508 if (unlikely(dma_mapping_error(ar->dev, paddr))) { in __ath10k_snoc_rx_post_buf()
509 ath10k_warn(ar, "failed to dma map snoc rx buf\n"); in __ath10k_snoc_rx_post_buf()
520 dma_unmap_single(ar->dev, paddr, skb->len + skb_tailroom(skb), in __ath10k_snoc_rx_post_buf()
531 struct ath10k *ar = pipe->hif_ce_state; in ath10k_snoc_rx_post_pipe() local
532 struct ath10k_ce *ce = ath10k_ce_priv(ar); in ath10k_snoc_rx_post_pipe()
533 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_rx_post_pipe()
551 ath10k_warn(ar, "failed to post rx buf: %d\n", ret); in ath10k_snoc_rx_post_pipe()
559 static void ath10k_snoc_rx_post(struct ath10k *ar) in ath10k_snoc_rx_post() argument
561 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_rx_post()
569 void (*callback)(struct ath10k *ar, in ath10k_snoc_process_rx_cb() argument
572 struct ath10k *ar = ce_state->ar; in ath10k_snoc_process_rx_cb() local
573 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_process_rx_cb()
585 dma_unmap_single(ar->dev, ATH10K_SKB_RXCB(skb)->paddr, in ath10k_snoc_process_rx_cb()
589 ath10k_warn(ar, "rxed more than expected (nbytes %d, max %d)\n", in ath10k_snoc_process_rx_cb()
600 ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc rx ce pipe %d len %d\n", in ath10k_snoc_process_rx_cb()
603 callback(ar, skb); in ath10k_snoc_process_rx_cb()
619 ath10k_ce_per_engine_service(ce_state->ar, CE_POLL_PIPE); in ath10k_snoc_htt_htc_rx_cb()
632 static void ath10k_snoc_htt_rx_deliver(struct ath10k *ar, struct sk_buff *skb) in ath10k_snoc_htt_rx_deliver() argument
635 ath10k_htt_t2h_msg_handler(ar, skb); in ath10k_snoc_htt_rx_deliver()
640 ath10k_ce_per_engine_service(ce_state->ar, CE_POLL_PIPE); in ath10k_snoc_htt_rx_cb()
647 struct ath10k *ar = ar_snoc->ar; in ath10k_snoc_rx_replenish_retry() local
649 ath10k_snoc_rx_post(ar); in ath10k_snoc_rx_replenish_retry()
654 struct ath10k *ar = ce_state->ar; in ath10k_snoc_htc_tx_cb() local
667 ath10k_htc_tx_completion_handler(ar, skb); in ath10k_snoc_htc_tx_cb()
672 struct ath10k *ar = ce_state->ar; in ath10k_snoc_htt_tx_cb() local
679 dma_unmap_single(ar->dev, ATH10K_SKB_CB(skb)->paddr, in ath10k_snoc_htt_tx_cb()
681 ath10k_htt_hif_tx_complete(ar, skb); in ath10k_snoc_htt_tx_cb()
685 static int ath10k_snoc_hif_tx_sg(struct ath10k *ar, u8 pipe_id, in ath10k_snoc_hif_tx_sg() argument
688 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_hif_tx_sg()
689 struct ath10k_ce *ce = ath10k_ce_priv(ar); in ath10k_snoc_hif_tx_sg()
699 ath10k_dbg(ar, ATH10K_DBG_SNOC, in ath10k_snoc_hif_tx_sg()
713 ath10k_dbg(ar, ATH10K_DBG_SNOC, in ath10k_snoc_hif_tx_sg()
738 static int ath10k_snoc_hif_get_target_info(struct ath10k *ar, in ath10k_snoc_hif_get_target_info() argument
747 static u16 ath10k_snoc_hif_get_free_queue_number(struct ath10k *ar, u8 pipe) in ath10k_snoc_hif_get_free_queue_number() argument
749 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_hif_get_free_queue_number()
751 ath10k_dbg(ar, ATH10K_DBG_SNOC, "hif get free queue number\n"); in ath10k_snoc_hif_get_free_queue_number()
756 static void ath10k_snoc_hif_send_complete_check(struct ath10k *ar, u8 pipe, in ath10k_snoc_hif_send_complete_check() argument
761 ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc hif send complete check\n"); in ath10k_snoc_hif_send_complete_check()
764 resources = ath10k_snoc_hif_get_free_queue_number(ar, pipe); in ath10k_snoc_hif_send_complete_check()
769 ath10k_ce_per_engine_service(ar, pipe); in ath10k_snoc_hif_send_complete_check()
772 static int ath10k_snoc_hif_map_service_to_pipe(struct ath10k *ar, in ath10k_snoc_hif_map_service_to_pipe() argument
780 ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc hif map service\n"); in ath10k_snoc_hif_map_service_to_pipe()
818 static void ath10k_snoc_hif_get_default_pipe(struct ath10k *ar, in ath10k_snoc_hif_get_default_pipe() argument
821 ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc hif get default pipe\n"); in ath10k_snoc_hif_get_default_pipe()
823 (void)ath10k_snoc_hif_map_service_to_pipe(ar, in ath10k_snoc_hif_get_default_pipe()
828 static inline void ath10k_snoc_irq_disable(struct ath10k *ar) in ath10k_snoc_irq_disable() argument
830 ath10k_ce_disable_interrupts(ar); in ath10k_snoc_irq_disable()
833 static inline void ath10k_snoc_irq_enable(struct ath10k *ar) in ath10k_snoc_irq_enable() argument
835 ath10k_ce_enable_interrupts(ar); in ath10k_snoc_irq_enable()
843 struct ath10k *ar; in ath10k_snoc_rx_pipe_cleanup() local
846 ar = snoc_pipe->hif_ce_state; in ath10k_snoc_rx_pipe_cleanup()
863 dma_unmap_single(ar->dev, ATH10K_SKB_RXCB(skb)->paddr, in ath10k_snoc_rx_pipe_cleanup()
875 struct ath10k *ar; in ath10k_snoc_tx_pipe_cleanup() local
878 ar = snoc_pipe->hif_ce_state; in ath10k_snoc_tx_pipe_cleanup()
895 ath10k_htc_tx_completion_handler(ar, skb); in ath10k_snoc_tx_pipe_cleanup()
899 static void ath10k_snoc_buffer_cleanup(struct ath10k *ar) in ath10k_snoc_buffer_cleanup() argument
901 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_buffer_cleanup()
913 static void ath10k_snoc_hif_stop(struct ath10k *ar) in ath10k_snoc_hif_stop() argument
915 if (!test_bit(ATH10K_FLAG_CRASH_FLUSH, &ar->dev_flags)) in ath10k_snoc_hif_stop()
916 ath10k_snoc_irq_disable(ar); in ath10k_snoc_hif_stop()
918 napi_synchronize(&ar->napi); in ath10k_snoc_hif_stop()
919 napi_disable(&ar->napi); in ath10k_snoc_hif_stop()
920 ath10k_snoc_buffer_cleanup(ar); in ath10k_snoc_hif_stop()
921 ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot hif stop\n"); in ath10k_snoc_hif_stop()
924 static int ath10k_snoc_hif_start(struct ath10k *ar) in ath10k_snoc_hif_start() argument
926 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_hif_start()
929 napi_enable(&ar->napi); in ath10k_snoc_hif_start()
930 ath10k_snoc_irq_enable(ar); in ath10k_snoc_hif_start()
931 ath10k_snoc_rx_post(ar); in ath10k_snoc_hif_start()
935 ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot hif start\n"); in ath10k_snoc_hif_start()
940 static int ath10k_snoc_init_pipes(struct ath10k *ar) in ath10k_snoc_init_pipes() argument
945 ret = ath10k_ce_init_pipe(ar, i, &host_ce_config_wlan[i]); in ath10k_snoc_init_pipes()
947 ath10k_err(ar, "failed to initialize copy engine pipe %d: %d\n", in ath10k_snoc_init_pipes()
956 static int ath10k_snoc_wlan_enable(struct ath10k *ar, in ath10k_snoc_wlan_enable() argument
998 ath10k_err(ar, "invalid firmware mode %d\n", fw_mode); in ath10k_snoc_wlan_enable()
1002 return ath10k_qmi_wlan_enable(ar, &cfg, mode, in ath10k_snoc_wlan_enable()
1006 static void ath10k_snoc_wlan_disable(struct ath10k *ar) in ath10k_snoc_wlan_disable() argument
1008 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_wlan_disable()
1016 if (!test_bit(ATH10K_FLAG_CRASH_FLUSH, &ar->dev_flags) || in ath10k_snoc_wlan_disable()
1018 ath10k_qmi_wlan_disable(ar); in ath10k_snoc_wlan_disable()
1021 static void ath10k_snoc_hif_power_down(struct ath10k *ar) in ath10k_snoc_hif_power_down() argument
1023 ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot hif power down\n"); in ath10k_snoc_hif_power_down()
1025 ath10k_snoc_wlan_disable(ar); in ath10k_snoc_hif_power_down()
1026 ath10k_ce_free_rri(ar); in ath10k_snoc_hif_power_down()
1029 static int ath10k_snoc_hif_power_up(struct ath10k *ar, in ath10k_snoc_hif_power_up() argument
1034 ath10k_dbg(ar, ATH10K_DBG_SNOC, "%s:WCN3990 driver state = %d\n", in ath10k_snoc_hif_power_up()
1035 __func__, ar->state); in ath10k_snoc_hif_power_up()
1037 ret = ath10k_snoc_wlan_enable(ar, fw_mode); in ath10k_snoc_hif_power_up()
1039 ath10k_err(ar, "failed to enable wcn3990: %d\n", ret); in ath10k_snoc_hif_power_up()
1043 ath10k_ce_alloc_rri(ar); in ath10k_snoc_hif_power_up()
1045 ret = ath10k_snoc_init_pipes(ar); in ath10k_snoc_hif_power_up()
1047 ath10k_err(ar, "failed to initialize CE: %d\n", ret); in ath10k_snoc_hif_power_up()
1054 ath10k_ce_free_rri(ar); in ath10k_snoc_hif_power_up()
1055 ath10k_snoc_wlan_disable(ar); in ath10k_snoc_hif_power_up()
1060 static int ath10k_snoc_hif_set_target_log_mode(struct ath10k *ar, in ath10k_snoc_hif_set_target_log_mode() argument
1070 return ath10k_qmi_set_fw_log_mode(ar, fw_dbg_mode); in ath10k_snoc_hif_set_target_log_mode()
1074 static int ath10k_snoc_hif_suspend(struct ath10k *ar) in ath10k_snoc_hif_suspend() argument
1076 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_hif_suspend()
1079 if (!device_may_wakeup(ar->dev)) in ath10k_snoc_hif_suspend()
1084 ath10k_err(ar, "failed to enable wakeup irq :%d\n", ret); in ath10k_snoc_hif_suspend()
1088 ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc device suspended\n"); in ath10k_snoc_hif_suspend()
1093 static int ath10k_snoc_hif_resume(struct ath10k *ar) in ath10k_snoc_hif_resume() argument
1095 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_hif_resume()
1098 if (!device_may_wakeup(ar->dev)) in ath10k_snoc_hif_resume()
1103 ath10k_err(ar, "failed to disable wakeup irq: %d\n", ret); in ath10k_snoc_hif_resume()
1107 ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc device resumed\n"); in ath10k_snoc_hif_resume()
1139 static int ath10k_snoc_get_ce_id_from_irq(struct ath10k *ar, int irq) in ath10k_snoc_get_ce_id_from_irq() argument
1141 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_get_ce_id_from_irq()
1148 ath10k_err(ar, "No matching CE id for irq %d\n", irq); in ath10k_snoc_get_ce_id_from_irq()
1155 struct ath10k *ar = arg; in ath10k_snoc_per_engine_handler() local
1156 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_per_engine_handler()
1157 int ce_id = ath10k_snoc_get_ce_id_from_irq(ar, irq); in ath10k_snoc_per_engine_handler()
1160 ath10k_warn(ar, "unexpected/invalid irq %d ce_id %d\n", irq, in ath10k_snoc_per_engine_handler()
1165 ath10k_ce_disable_interrupt(ar, ce_id); in ath10k_snoc_per_engine_handler()
1168 napi_schedule(&ar->napi); in ath10k_snoc_per_engine_handler()
1175 struct ath10k *ar = container_of(ctx, struct ath10k, napi); in ath10k_snoc_napi_poll() local
1176 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_napi_poll()
1180 if (test_bit(ATH10K_FLAG_CRASH_FLUSH, &ar->dev_flags)) { in ath10k_snoc_napi_poll()
1187 ath10k_ce_per_engine_service(ar, ce_id); in ath10k_snoc_napi_poll()
1188 ath10k_ce_enable_interrupt(ar, ce_id); in ath10k_snoc_napi_poll()
1191 done = ath10k_htt_txrx_compl_task(ar, budget); in ath10k_snoc_napi_poll()
1199 static void ath10k_snoc_init_napi(struct ath10k *ar) in ath10k_snoc_init_napi() argument
1201 netif_napi_add(&ar->napi_dev, &ar->napi, ath10k_snoc_napi_poll, in ath10k_snoc_init_napi()
1205 static int ath10k_snoc_request_irq(struct ath10k *ar) in ath10k_snoc_request_irq() argument
1207 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_request_irq()
1213 ce_name[id], ar); in ath10k_snoc_request_irq()
1215 ath10k_err(ar, in ath10k_snoc_request_irq()
1226 free_irq(ar_snoc->ce_irqs[id].irq_line, ar); in ath10k_snoc_request_irq()
1231 static void ath10k_snoc_free_irq(struct ath10k *ar) in ath10k_snoc_free_irq() argument
1233 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_free_irq()
1237 free_irq(ar_snoc->ce_irqs[id].irq_line, ar); in ath10k_snoc_free_irq()
1240 static int ath10k_snoc_resource_init(struct ath10k *ar) in ath10k_snoc_resource_init() argument
1242 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_resource_init()
1250 ath10k_err(ar, "Memory base not found in DT\n"); in ath10k_snoc_resource_init()
1258 ath10k_err(ar, "Memory base ioremap failed with physical address %pa\n", in ath10k_snoc_resource_init()
1266 ath10k_err(ar, "failed to get IRQ%d\n", i); in ath10k_snoc_resource_init()
1275 ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc xo-cal-data return %d\n", ret); in ath10k_snoc_resource_init()
1278 ath10k_dbg(ar, ATH10K_DBG_SNOC, "xo cal data %x\n", in ath10k_snoc_resource_init()
1287 static void ath10k_snoc_quirks_init(struct ath10k *ar) in ath10k_snoc_quirks_init() argument
1289 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_quirks_init()
1296 int ath10k_snoc_fw_indication(struct ath10k *ar, u64 type) in ath10k_snoc_fw_indication() argument
1298 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_fw_indication()
1308 queue_work(ar->workqueue, &ar->restart_work); in ath10k_snoc_fw_indication()
1314 ret = ath10k_core_register(ar, &bus_params); in ath10k_snoc_fw_indication()
1316 ath10k_err(ar, "Failed to register driver core: %d\n", in ath10k_snoc_fw_indication()
1324 set_bit(ATH10K_FLAG_CRASH_FLUSH, &ar->dev_flags); in ath10k_snoc_fw_indication()
1327 ath10k_err(ar, "invalid fw indication: %llx\n", type); in ath10k_snoc_fw_indication()
1334 static int ath10k_snoc_setup_resource(struct ath10k *ar) in ath10k_snoc_setup_resource() argument
1336 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_setup_resource()
1337 struct ath10k_ce *ce = ath10k_ce_priv(ar); in ath10k_snoc_setup_resource()
1347 pipe->hif_ce_state = ar; in ath10k_snoc_setup_resource()
1349 ret = ath10k_ce_alloc_pipe(ar, i, &host_ce_config_wlan[i]); in ath10k_snoc_setup_resource()
1351 ath10k_err(ar, "failed to allocate copy engine pipe %d: %d\n", in ath10k_snoc_setup_resource()
1358 ath10k_snoc_init_napi(ar); in ath10k_snoc_setup_resource()
1363 static void ath10k_snoc_release_resource(struct ath10k *ar) in ath10k_snoc_release_resource() argument
1367 netif_napi_del(&ar->napi); in ath10k_snoc_release_resource()
1369 ath10k_ce_free_pipe(ar, i); in ath10k_snoc_release_resource()
1372 static int ath10k_hw_power_on(struct ath10k *ar) in ath10k_hw_power_on() argument
1374 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_hw_power_on()
1377 ath10k_dbg(ar, ATH10K_DBG_SNOC, "soc power on\n"); in ath10k_hw_power_on()
1394 static int ath10k_hw_power_off(struct ath10k *ar) in ath10k_hw_power_off() argument
1396 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_hw_power_off()
1398 ath10k_dbg(ar, ATH10K_DBG_SNOC, "soc power off\n"); in ath10k_hw_power_off()
1405 static void ath10k_msa_dump_memory(struct ath10k *ar, in ath10k_msa_dump_memory() argument
1417 mem_layout = ath10k_coredump_get_mem_layout(ar); in ath10k_msa_dump_memory()
1433 hdr->start = cpu_to_le32((unsigned long)ar->msa.vaddr); in ath10k_msa_dump_memory()
1434 hdr->length = cpu_to_le32(ar->msa.mem_size); in ath10k_msa_dump_memory()
1436 if (current_region->len < ar->msa.mem_size) { in ath10k_msa_dump_memory()
1437 memcpy(buf, ar->msa.vaddr, current_region->len); in ath10k_msa_dump_memory()
1438 ath10k_warn(ar, "msa dump length is less than msa size %x, %x\n", in ath10k_msa_dump_memory()
1439 current_region->len, ar->msa.mem_size); in ath10k_msa_dump_memory()
1441 memcpy(buf, ar->msa.vaddr, ar->msa.mem_size); in ath10k_msa_dump_memory()
1445 void ath10k_snoc_fw_crashed_dump(struct ath10k *ar) in ath10k_snoc_fw_crashed_dump() argument
1450 mutex_lock(&ar->dump_mutex); in ath10k_snoc_fw_crashed_dump()
1452 spin_lock_bh(&ar->data_lock); in ath10k_snoc_fw_crashed_dump()
1453 ar->stats.fw_crash_counter++; in ath10k_snoc_fw_crashed_dump()
1454 spin_unlock_bh(&ar->data_lock); in ath10k_snoc_fw_crashed_dump()
1456 crash_data = ath10k_coredump_new(ar); in ath10k_snoc_fw_crashed_dump()
1463 ath10k_err(ar, "firmware crashed! (guid %s)\n", guid); in ath10k_snoc_fw_crashed_dump()
1464 ath10k_print_driver_info(ar); in ath10k_snoc_fw_crashed_dump()
1465 ath10k_msa_dump_memory(ar, crash_data); in ath10k_snoc_fw_crashed_dump()
1466 mutex_unlock(&ar->dump_mutex); in ath10k_snoc_fw_crashed_dump()
1469 static int ath10k_setup_msa_resources(struct ath10k *ar, u32 msa_size) in ath10k_setup_msa_resources() argument
1471 struct device *dev = ar->dev; in ath10k_setup_msa_resources()
1485 ar->msa.paddr = r.start; in ath10k_setup_msa_resources()
1486 ar->msa.mem_size = resource_size(&r); in ath10k_setup_msa_resources()
1487 ar->msa.vaddr = devm_memremap(dev, ar->msa.paddr, in ath10k_setup_msa_resources()
1488 ar->msa.mem_size, in ath10k_setup_msa_resources()
1490 if (IS_ERR(ar->msa.vaddr)) { in ath10k_setup_msa_resources()
1493 return PTR_ERR(ar->msa.vaddr); in ath10k_setup_msa_resources()
1496 ar->msa.vaddr = dmam_alloc_coherent(dev, msa_size, in ath10k_setup_msa_resources()
1497 &ar->msa.paddr, in ath10k_setup_msa_resources()
1499 if (!ar->msa.vaddr) { in ath10k_setup_msa_resources()
1500 ath10k_err(ar, "failed to allocate dma memory for msa region\n"); in ath10k_setup_msa_resources()
1503 ar->msa.mem_size = msa_size; in ath10k_setup_msa_resources()
1506 ath10k_dbg(ar, ATH10K_DBG_QMI, "qmi msa.paddr: %pad , msa.vaddr: 0x%p\n", in ath10k_setup_msa_resources()
1507 &ar->msa.paddr, in ath10k_setup_msa_resources()
1508 ar->msa.vaddr); in ath10k_setup_msa_resources()
1513 static int ath10k_fw_init(struct ath10k *ar) in ath10k_fw_init() argument
1515 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_fw_init()
1545 ath10k_err(ar, "dma configure fail: %d\n", ret); in ath10k_fw_init()
1553 ath10k_err(ar, "failed to allocate iommu domain\n"); in ath10k_fw_init()
1560 ath10k_err(ar, "could not attach device: %d\n", ret); in ath10k_fw_init()
1565 ar_snoc->fw.fw_start_addr = ar->msa.paddr; in ath10k_fw_init()
1568 ar->msa.paddr, ar->msa.mem_size, in ath10k_fw_init()
1571 ath10k_err(ar, "failed to map firmware region: %d\n", ret); in ath10k_fw_init()
1592 static int ath10k_fw_deinit(struct ath10k *ar) in ath10k_fw_deinit() argument
1594 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_fw_deinit()
1607 ath10k_err(ar, "failed to unmap firmware: %zu\n", in ath10k_fw_deinit()
1631 struct ath10k *ar; in ath10k_snoc_probe() local
1649 ar = ath10k_core_create(sizeof(*ar_snoc), dev, ATH10K_BUS_SNOC, in ath10k_snoc_probe()
1651 if (!ar) { in ath10k_snoc_probe()
1656 ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_probe()
1658 platform_set_drvdata(pdev, ar); in ath10k_snoc_probe()
1659 ar_snoc->ar = ar; in ath10k_snoc_probe()
1661 ar->ce_priv = &ar_snoc->ce; in ath10k_snoc_probe()
1664 ath10k_snoc_quirks_init(ar); in ath10k_snoc_probe()
1666 ret = ath10k_snoc_resource_init(ar); in ath10k_snoc_probe()
1668 ath10k_warn(ar, "failed to initialize resource: %d\n", ret); in ath10k_snoc_probe()
1672 ret = ath10k_snoc_setup_resource(ar); in ath10k_snoc_probe()
1674 ath10k_warn(ar, "failed to setup resource: %d\n", ret); in ath10k_snoc_probe()
1677 ret = ath10k_snoc_request_irq(ar); in ath10k_snoc_probe()
1679 ath10k_warn(ar, "failed to request irqs: %d\n", ret); in ath10k_snoc_probe()
1714 ret = ath10k_hw_power_on(ar); in ath10k_snoc_probe()
1716 ath10k_err(ar, "failed to power on device: %d\n", ret); in ath10k_snoc_probe()
1720 ret = ath10k_setup_msa_resources(ar, msa_size); in ath10k_snoc_probe()
1722 ath10k_warn(ar, "failed to setup msa resources: %d\n", ret); in ath10k_snoc_probe()
1726 ret = ath10k_fw_init(ar); in ath10k_snoc_probe()
1728 ath10k_err(ar, "failed to initialize firmware: %d\n", ret); in ath10k_snoc_probe()
1732 ret = ath10k_qmi_init(ar, msa_size); in ath10k_snoc_probe()
1734 ath10k_warn(ar, "failed to register wlfw qmi client: %d\n", ret); in ath10k_snoc_probe()
1738 ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc probe\n"); in ath10k_snoc_probe()
1743 ath10k_fw_deinit(ar); in ath10k_snoc_probe()
1746 ath10k_hw_power_off(ar); in ath10k_snoc_probe()
1749 ath10k_snoc_free_irq(ar); in ath10k_snoc_probe()
1752 ath10k_snoc_release_resource(ar); in ath10k_snoc_probe()
1755 ath10k_core_destroy(ar); in ath10k_snoc_probe()
1762 struct ath10k *ar = platform_get_drvdata(pdev); in ath10k_snoc_remove() local
1763 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_remove()
1765 ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc remove\n"); in ath10k_snoc_remove()
1767 reinit_completion(&ar->driver_recovery); in ath10k_snoc_remove()
1770 wait_for_completion_timeout(&ar->driver_recovery, 3 * HZ); in ath10k_snoc_remove()
1774 ath10k_core_unregister(ar); in ath10k_snoc_remove()
1775 ath10k_hw_power_off(ar); in ath10k_snoc_remove()
1776 ath10k_fw_deinit(ar); in ath10k_snoc_remove()
1777 ath10k_snoc_free_irq(ar); in ath10k_snoc_remove()
1778 ath10k_snoc_release_resource(ar); in ath10k_snoc_remove()
1779 ath10k_qmi_deinit(ar); in ath10k_snoc_remove()
1780 ath10k_core_destroy(ar); in ath10k_snoc_remove()
1787 struct ath10k *ar = platform_get_drvdata(pdev); in ath10k_snoc_shutdown() local
1789 ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc shutdown\n"); in ath10k_snoc_shutdown()