• Home
  • Raw
  • Download

Lines Matching refs:ar

474 static void ath10k_snoc_write32(struct ath10k *ar, u32 offset, u32 value)  in ath10k_snoc_write32()  argument
476 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_write32()
481 static u32 ath10k_snoc_read32(struct ath10k *ar, u32 offset) in ath10k_snoc_read32() argument
483 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_read32()
494 struct ath10k *ar = pipe->hif_ce_state; in __ath10k_snoc_rx_post_buf() local
495 struct ath10k_ce *ce = ath10k_ce_priv(ar); in __ath10k_snoc_rx_post_buf()
506 paddr = dma_map_single(ar->dev, skb->data, in __ath10k_snoc_rx_post_buf()
509 if (unlikely(dma_mapping_error(ar->dev, paddr))) { in __ath10k_snoc_rx_post_buf()
510 ath10k_warn(ar, "failed to dma map snoc rx buf\n"); in __ath10k_snoc_rx_post_buf()
521 dma_unmap_single(ar->dev, paddr, skb->len + skb_tailroom(skb), in __ath10k_snoc_rx_post_buf()
532 struct ath10k *ar = pipe->hif_ce_state; in ath10k_snoc_rx_post_pipe() local
533 struct ath10k_ce *ce = ath10k_ce_priv(ar); in ath10k_snoc_rx_post_pipe()
534 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_rx_post_pipe()
552 ath10k_warn(ar, "failed to post rx buf: %d\n", ret); in ath10k_snoc_rx_post_pipe()
560 static void ath10k_snoc_rx_post(struct ath10k *ar) in ath10k_snoc_rx_post() argument
562 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_rx_post()
570 void (*callback)(struct ath10k *ar, in ath10k_snoc_process_rx_cb() argument
573 struct ath10k *ar = ce_state->ar; in ath10k_snoc_process_rx_cb() local
574 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_process_rx_cb()
586 dma_unmap_single(ar->dev, ATH10K_SKB_RXCB(skb)->paddr, in ath10k_snoc_process_rx_cb()
590 ath10k_warn(ar, "rxed more than expected (nbytes %d, max %d)\n", in ath10k_snoc_process_rx_cb()
601 ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc rx ce pipe %d len %d\n", in ath10k_snoc_process_rx_cb()
604 callback(ar, skb); in ath10k_snoc_process_rx_cb()
620 ath10k_ce_per_engine_service(ce_state->ar, CE_POLL_PIPE); in ath10k_snoc_htt_htc_rx_cb()
633 static void ath10k_snoc_htt_rx_deliver(struct ath10k *ar, struct sk_buff *skb) in ath10k_snoc_htt_rx_deliver() argument
636 ath10k_htt_t2h_msg_handler(ar, skb); in ath10k_snoc_htt_rx_deliver()
641 ath10k_ce_per_engine_service(ce_state->ar, CE_POLL_PIPE); in ath10k_snoc_htt_rx_cb()
648 struct ath10k *ar = ar_snoc->ar; in ath10k_snoc_rx_replenish_retry() local
650 ath10k_snoc_rx_post(ar); in ath10k_snoc_rx_replenish_retry()
655 struct ath10k *ar = ce_state->ar; in ath10k_snoc_htc_tx_cb() local
668 ath10k_htc_tx_completion_handler(ar, skb); in ath10k_snoc_htc_tx_cb()
673 struct ath10k *ar = ce_state->ar; in ath10k_snoc_htt_tx_cb() local
680 dma_unmap_single(ar->dev, ATH10K_SKB_CB(skb)->paddr, in ath10k_snoc_htt_tx_cb()
682 ath10k_htt_hif_tx_complete(ar, skb); in ath10k_snoc_htt_tx_cb()
686 static int ath10k_snoc_hif_tx_sg(struct ath10k *ar, u8 pipe_id, in ath10k_snoc_hif_tx_sg() argument
689 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_hif_tx_sg()
690 struct ath10k_ce *ce = ath10k_ce_priv(ar); in ath10k_snoc_hif_tx_sg()
700 ath10k_dbg(ar, ATH10K_DBG_SNOC, in ath10k_snoc_hif_tx_sg()
714 ath10k_dbg(ar, ATH10K_DBG_SNOC, in ath10k_snoc_hif_tx_sg()
739 static int ath10k_snoc_hif_get_target_info(struct ath10k *ar, in ath10k_snoc_hif_get_target_info() argument
748 static u16 ath10k_snoc_hif_get_free_queue_number(struct ath10k *ar, u8 pipe) in ath10k_snoc_hif_get_free_queue_number() argument
750 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_hif_get_free_queue_number()
752 ath10k_dbg(ar, ATH10K_DBG_SNOC, "hif get free queue number\n"); in ath10k_snoc_hif_get_free_queue_number()
757 static void ath10k_snoc_hif_send_complete_check(struct ath10k *ar, u8 pipe, in ath10k_snoc_hif_send_complete_check() argument
762 ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc hif send complete check\n"); in ath10k_snoc_hif_send_complete_check()
765 resources = ath10k_snoc_hif_get_free_queue_number(ar, pipe); in ath10k_snoc_hif_send_complete_check()
770 ath10k_ce_per_engine_service(ar, pipe); in ath10k_snoc_hif_send_complete_check()
773 static int ath10k_snoc_hif_map_service_to_pipe(struct ath10k *ar, in ath10k_snoc_hif_map_service_to_pipe() argument
781 ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc hif map service\n"); in ath10k_snoc_hif_map_service_to_pipe()
819 static void ath10k_snoc_hif_get_default_pipe(struct ath10k *ar, in ath10k_snoc_hif_get_default_pipe() argument
822 ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc hif get default pipe\n"); in ath10k_snoc_hif_get_default_pipe()
824 (void)ath10k_snoc_hif_map_service_to_pipe(ar, in ath10k_snoc_hif_get_default_pipe()
829 static inline void ath10k_snoc_irq_disable(struct ath10k *ar) in ath10k_snoc_irq_disable() argument
831 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_irq_disable()
838 static inline void ath10k_snoc_irq_enable(struct ath10k *ar) in ath10k_snoc_irq_enable() argument
840 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_irq_enable()
852 struct ath10k *ar; in ath10k_snoc_rx_pipe_cleanup() local
855 ar = snoc_pipe->hif_ce_state; in ath10k_snoc_rx_pipe_cleanup()
872 dma_unmap_single(ar->dev, ATH10K_SKB_RXCB(skb)->paddr, in ath10k_snoc_rx_pipe_cleanup()
884 struct ath10k *ar; in ath10k_snoc_tx_pipe_cleanup() local
887 ar = snoc_pipe->hif_ce_state; in ath10k_snoc_tx_pipe_cleanup()
904 ath10k_htc_tx_completion_handler(ar, skb); in ath10k_snoc_tx_pipe_cleanup()
908 static void ath10k_snoc_buffer_cleanup(struct ath10k *ar) in ath10k_snoc_buffer_cleanup() argument
910 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_buffer_cleanup()
922 static void ath10k_snoc_hif_stop(struct ath10k *ar) in ath10k_snoc_hif_stop() argument
924 if (!test_bit(ATH10K_FLAG_CRASH_FLUSH, &ar->dev_flags)) in ath10k_snoc_hif_stop()
925 ath10k_snoc_irq_disable(ar); in ath10k_snoc_hif_stop()
927 ath10k_core_napi_sync_disable(ar); in ath10k_snoc_hif_stop()
928 ath10k_snoc_buffer_cleanup(ar); in ath10k_snoc_hif_stop()
929 ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot hif stop\n"); in ath10k_snoc_hif_stop()
932 static int ath10k_snoc_hif_start(struct ath10k *ar) in ath10k_snoc_hif_start() argument
934 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_hif_start()
938 ath10k_core_napi_enable(ar); in ath10k_snoc_hif_start()
939 ath10k_snoc_irq_enable(ar); in ath10k_snoc_hif_start()
940 ath10k_snoc_rx_post(ar); in ath10k_snoc_hif_start()
944 ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot hif start\n"); in ath10k_snoc_hif_start()
949 static int ath10k_snoc_init_pipes(struct ath10k *ar) in ath10k_snoc_init_pipes() argument
954 ret = ath10k_ce_init_pipe(ar, i, &host_ce_config_wlan[i]); in ath10k_snoc_init_pipes()
956 ath10k_err(ar, "failed to initialize copy engine pipe %d: %d\n", in ath10k_snoc_init_pipes()
965 static int ath10k_snoc_wlan_enable(struct ath10k *ar, in ath10k_snoc_wlan_enable() argument
1007 ath10k_err(ar, "invalid firmware mode %d\n", fw_mode); in ath10k_snoc_wlan_enable()
1011 return ath10k_qmi_wlan_enable(ar, &cfg, mode, in ath10k_snoc_wlan_enable()
1015 static int ath10k_hw_power_on(struct ath10k *ar) in ath10k_hw_power_on() argument
1017 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_hw_power_on()
1020 ath10k_dbg(ar, ATH10K_DBG_SNOC, "soc power on\n"); in ath10k_hw_power_on()
1037 static int ath10k_hw_power_off(struct ath10k *ar) in ath10k_hw_power_off() argument
1039 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_hw_power_off()
1041 ath10k_dbg(ar, ATH10K_DBG_SNOC, "soc power off\n"); in ath10k_hw_power_off()
1048 static void ath10k_snoc_wlan_disable(struct ath10k *ar) in ath10k_snoc_wlan_disable() argument
1050 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_wlan_disable()
1058 if (!test_bit(ATH10K_FLAG_CRASH_FLUSH, &ar->dev_flags) || in ath10k_snoc_wlan_disable()
1060 ath10k_qmi_wlan_disable(ar); in ath10k_snoc_wlan_disable()
1063 static void ath10k_snoc_hif_power_down(struct ath10k *ar) in ath10k_snoc_hif_power_down() argument
1065 ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot hif power down\n"); in ath10k_snoc_hif_power_down()
1067 ath10k_snoc_wlan_disable(ar); in ath10k_snoc_hif_power_down()
1068 ath10k_ce_free_rri(ar); in ath10k_snoc_hif_power_down()
1069 ath10k_hw_power_off(ar); in ath10k_snoc_hif_power_down()
1072 static int ath10k_snoc_hif_power_up(struct ath10k *ar, in ath10k_snoc_hif_power_up() argument
1077 ath10k_dbg(ar, ATH10K_DBG_SNOC, "%s:WCN3990 driver state = %d\n", in ath10k_snoc_hif_power_up()
1078 __func__, ar->state); in ath10k_snoc_hif_power_up()
1080 ret = ath10k_hw_power_on(ar); in ath10k_snoc_hif_power_up()
1082 ath10k_err(ar, "failed to power on device: %d\n", ret); in ath10k_snoc_hif_power_up()
1086 ret = ath10k_snoc_wlan_enable(ar, fw_mode); in ath10k_snoc_hif_power_up()
1088 ath10k_err(ar, "failed to enable wcn3990: %d\n", ret); in ath10k_snoc_hif_power_up()
1092 ath10k_ce_alloc_rri(ar); in ath10k_snoc_hif_power_up()
1094 ret = ath10k_snoc_init_pipes(ar); in ath10k_snoc_hif_power_up()
1096 ath10k_err(ar, "failed to initialize CE: %d\n", ret); in ath10k_snoc_hif_power_up()
1100 ath10k_ce_enable_interrupts(ar); in ath10k_snoc_hif_power_up()
1105 ath10k_ce_free_rri(ar); in ath10k_snoc_hif_power_up()
1106 ath10k_snoc_wlan_disable(ar); in ath10k_snoc_hif_power_up()
1109 ath10k_hw_power_off(ar); in ath10k_snoc_hif_power_up()
1114 static int ath10k_snoc_hif_set_target_log_mode(struct ath10k *ar, in ath10k_snoc_hif_set_target_log_mode() argument
1124 return ath10k_qmi_set_fw_log_mode(ar, fw_dbg_mode); in ath10k_snoc_hif_set_target_log_mode()
1128 static int ath10k_snoc_hif_suspend(struct ath10k *ar) in ath10k_snoc_hif_suspend() argument
1130 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_hif_suspend()
1133 if (!device_may_wakeup(ar->dev)) in ath10k_snoc_hif_suspend()
1138 ath10k_err(ar, "failed to enable wakeup irq :%d\n", ret); in ath10k_snoc_hif_suspend()
1142 ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc device suspended\n"); in ath10k_snoc_hif_suspend()
1147 static int ath10k_snoc_hif_resume(struct ath10k *ar) in ath10k_snoc_hif_resume() argument
1149 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_hif_resume()
1152 if (!device_may_wakeup(ar->dev)) in ath10k_snoc_hif_resume()
1157 ath10k_err(ar, "failed to disable wakeup irq: %d\n", ret); in ath10k_snoc_hif_resume()
1161 ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc device resumed\n"); in ath10k_snoc_hif_resume()
1193 static int ath10k_snoc_get_ce_id_from_irq(struct ath10k *ar, int irq) in ath10k_snoc_get_ce_id_from_irq() argument
1195 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_get_ce_id_from_irq()
1202 ath10k_err(ar, "No matching CE id for irq %d\n", irq); in ath10k_snoc_get_ce_id_from_irq()
1209 struct ath10k *ar = arg; in ath10k_snoc_per_engine_handler() local
1210 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_per_engine_handler()
1211 int ce_id = ath10k_snoc_get_ce_id_from_irq(ar, irq); in ath10k_snoc_per_engine_handler()
1214 ath10k_warn(ar, "unexpected/invalid irq %d ce_id %d\n", irq, in ath10k_snoc_per_engine_handler()
1219 ath10k_ce_disable_interrupt(ar, ce_id); in ath10k_snoc_per_engine_handler()
1222 napi_schedule(&ar->napi); in ath10k_snoc_per_engine_handler()
1229 struct ath10k *ar = container_of(ctx, struct ath10k, napi); in ath10k_snoc_napi_poll() local
1230 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_napi_poll()
1234 if (test_bit(ATH10K_FLAG_CRASH_FLUSH, &ar->dev_flags)) { in ath10k_snoc_napi_poll()
1241 ath10k_ce_per_engine_service(ar, ce_id); in ath10k_snoc_napi_poll()
1242 ath10k_ce_enable_interrupt(ar, ce_id); in ath10k_snoc_napi_poll()
1245 done = ath10k_htt_txrx_compl_task(ar, budget); in ath10k_snoc_napi_poll()
1253 static void ath10k_snoc_init_napi(struct ath10k *ar) in ath10k_snoc_init_napi() argument
1255 netif_napi_add(&ar->napi_dev, &ar->napi, ath10k_snoc_napi_poll, in ath10k_snoc_init_napi()
1259 static int ath10k_snoc_request_irq(struct ath10k *ar) in ath10k_snoc_request_irq() argument
1261 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_request_irq()
1267 IRQF_NO_AUTOEN, ce_name[id], ar); in ath10k_snoc_request_irq()
1269 ath10k_err(ar, in ath10k_snoc_request_irq()
1280 free_irq(ar_snoc->ce_irqs[id].irq_line, ar); in ath10k_snoc_request_irq()
1285 static void ath10k_snoc_free_irq(struct ath10k *ar) in ath10k_snoc_free_irq() argument
1287 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_free_irq()
1291 free_irq(ar_snoc->ce_irqs[id].irq_line, ar); in ath10k_snoc_free_irq()
1294 static int ath10k_snoc_resource_init(struct ath10k *ar) in ath10k_snoc_resource_init() argument
1296 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_resource_init()
1304 ath10k_err(ar, "Memory base not found in DT\n"); in ath10k_snoc_resource_init()
1312 ath10k_err(ar, "Memory base ioremap failed with physical address %pa\n", in ath10k_snoc_resource_init()
1320 ath10k_err(ar, "failed to get IRQ%d\n", i); in ath10k_snoc_resource_init()
1329 ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc xo-cal-data return %d\n", ret); in ath10k_snoc_resource_init()
1332 ath10k_dbg(ar, ATH10K_DBG_SNOC, "xo cal data %x\n", in ath10k_snoc_resource_init()
1341 static void ath10k_snoc_quirks_init(struct ath10k *ar) in ath10k_snoc_quirks_init() argument
1343 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_quirks_init()
1350 int ath10k_snoc_fw_indication(struct ath10k *ar, u64 type) in ath10k_snoc_fw_indication() argument
1352 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_fw_indication()
1362 ath10k_core_start_recovery(ar); in ath10k_snoc_fw_indication()
1368 ret = ath10k_core_register(ar, &bus_params); in ath10k_snoc_fw_indication()
1370 ath10k_err(ar, "Failed to register driver core: %d\n", in ath10k_snoc_fw_indication()
1378 set_bit(ATH10K_FLAG_CRASH_FLUSH, &ar->dev_flags); in ath10k_snoc_fw_indication()
1381 ath10k_err(ar, "invalid fw indication: %llx\n", type); in ath10k_snoc_fw_indication()
1388 static int ath10k_snoc_setup_resource(struct ath10k *ar) in ath10k_snoc_setup_resource() argument
1390 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_setup_resource()
1391 struct ath10k_ce *ce = ath10k_ce_priv(ar); in ath10k_snoc_setup_resource()
1401 pipe->hif_ce_state = ar; in ath10k_snoc_setup_resource()
1403 ret = ath10k_ce_alloc_pipe(ar, i, &host_ce_config_wlan[i]); in ath10k_snoc_setup_resource()
1405 ath10k_err(ar, "failed to allocate copy engine pipe %d: %d\n", in ath10k_snoc_setup_resource()
1412 ath10k_snoc_init_napi(ar); in ath10k_snoc_setup_resource()
1417 static void ath10k_snoc_release_resource(struct ath10k *ar) in ath10k_snoc_release_resource() argument
1421 netif_napi_del(&ar->napi); in ath10k_snoc_release_resource()
1423 ath10k_ce_free_pipe(ar, i); in ath10k_snoc_release_resource()
1426 static void ath10k_msa_dump_memory(struct ath10k *ar, in ath10k_msa_dump_memory() argument
1438 mem_layout = ath10k_coredump_get_mem_layout(ar); in ath10k_msa_dump_memory()
1454 hdr->start = cpu_to_le32((unsigned long)ar->msa.vaddr); in ath10k_msa_dump_memory()
1455 hdr->length = cpu_to_le32(ar->msa.mem_size); in ath10k_msa_dump_memory()
1457 if (current_region->len < ar->msa.mem_size) { in ath10k_msa_dump_memory()
1458 memcpy(buf, ar->msa.vaddr, current_region->len); in ath10k_msa_dump_memory()
1459 ath10k_warn(ar, "msa dump length is less than msa size %x, %x\n", in ath10k_msa_dump_memory()
1460 current_region->len, ar->msa.mem_size); in ath10k_msa_dump_memory()
1462 memcpy(buf, ar->msa.vaddr, ar->msa.mem_size); in ath10k_msa_dump_memory()
1466 void ath10k_snoc_fw_crashed_dump(struct ath10k *ar) in ath10k_snoc_fw_crashed_dump() argument
1471 mutex_lock(&ar->dump_mutex); in ath10k_snoc_fw_crashed_dump()
1473 spin_lock_bh(&ar->data_lock); in ath10k_snoc_fw_crashed_dump()
1474 ar->stats.fw_crash_counter++; in ath10k_snoc_fw_crashed_dump()
1475 spin_unlock_bh(&ar->data_lock); in ath10k_snoc_fw_crashed_dump()
1477 crash_data = ath10k_coredump_new(ar); in ath10k_snoc_fw_crashed_dump()
1484 ath10k_err(ar, "firmware crashed! (guid %s)\n", guid); in ath10k_snoc_fw_crashed_dump()
1485 ath10k_print_driver_info(ar); in ath10k_snoc_fw_crashed_dump()
1486 ath10k_msa_dump_memory(ar, crash_data); in ath10k_snoc_fw_crashed_dump()
1487 mutex_unlock(&ar->dump_mutex); in ath10k_snoc_fw_crashed_dump()
1494 struct ath10k *ar = ar_snoc->ar; in ath10k_snoc_modem_notify() local
1499 ath10k_dbg(ar, ATH10K_DBG_SNOC, "received modem starting event\n"); in ath10k_snoc_modem_notify()
1504 ath10k_dbg(ar, ATH10K_DBG_SNOC, "received modem running event\n"); in ath10k_snoc_modem_notify()
1508 ath10k_dbg(ar, ATH10K_DBG_SNOC, "received modem %s event\n", in ath10k_snoc_modem_notify()
1517 ath10k_dbg(ar, ATH10K_DBG_SNOC, "received modem offline event\n"); in ath10k_snoc_modem_notify()
1521 ath10k_err(ar, "received unrecognized event %lu\n", action); in ath10k_snoc_modem_notify()
1528 static int ath10k_modem_init(struct ath10k *ar) in ath10k_modem_init() argument
1530 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_modem_init()
1539 ath10k_err(ar, "failed to initialize modem notifier: %d\n", ret); in ath10k_modem_init()
1548 static void ath10k_modem_deinit(struct ath10k *ar) in ath10k_modem_deinit() argument
1551 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_modem_deinit()
1555 ath10k_err(ar, "error %d unregistering notifier\n", ret); in ath10k_modem_deinit()
1558 static int ath10k_setup_msa_resources(struct ath10k *ar, u32 msa_size) in ath10k_setup_msa_resources() argument
1560 struct device *dev = ar->dev; in ath10k_setup_msa_resources()
1574 ar->msa.paddr = r.start; in ath10k_setup_msa_resources()
1575 ar->msa.mem_size = resource_size(&r); in ath10k_setup_msa_resources()
1576 ar->msa.vaddr = devm_memremap(dev, ar->msa.paddr, in ath10k_setup_msa_resources()
1577 ar->msa.mem_size, in ath10k_setup_msa_resources()
1579 if (IS_ERR(ar->msa.vaddr)) { in ath10k_setup_msa_resources()
1582 return PTR_ERR(ar->msa.vaddr); in ath10k_setup_msa_resources()
1585 ar->msa.vaddr = dmam_alloc_coherent(dev, msa_size, in ath10k_setup_msa_resources()
1586 &ar->msa.paddr, in ath10k_setup_msa_resources()
1588 if (!ar->msa.vaddr) { in ath10k_setup_msa_resources()
1589 ath10k_err(ar, "failed to allocate dma memory for msa region\n"); in ath10k_setup_msa_resources()
1592 ar->msa.mem_size = msa_size; in ath10k_setup_msa_resources()
1595 ath10k_dbg(ar, ATH10K_DBG_QMI, "qmi msa.paddr: %pad , msa.vaddr: 0x%p\n", in ath10k_setup_msa_resources()
1596 &ar->msa.paddr, in ath10k_setup_msa_resources()
1597 ar->msa.vaddr); in ath10k_setup_msa_resources()
1602 static int ath10k_fw_init(struct ath10k *ar) in ath10k_fw_init() argument
1604 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_fw_init()
1634 ath10k_err(ar, "dma configure fail: %d\n", ret); in ath10k_fw_init()
1642 ath10k_err(ar, "failed to allocate iommu domain\n"); in ath10k_fw_init()
1649 ath10k_err(ar, "could not attach device: %d\n", ret); in ath10k_fw_init()
1654 ar_snoc->fw.fw_start_addr = ar->msa.paddr; in ath10k_fw_init()
1657 ar->msa.paddr, ar->msa.mem_size, in ath10k_fw_init()
1660 ath10k_err(ar, "failed to map firmware region: %d\n", ret); in ath10k_fw_init()
1681 static int ath10k_fw_deinit(struct ath10k *ar) in ath10k_fw_deinit() argument
1683 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_fw_deinit()
1696 ath10k_err(ar, "failed to unmap firmware: %zu\n", in ath10k_fw_deinit()
1720 struct ath10k *ar; in ath10k_snoc_probe() local
1738 ar = ath10k_core_create(sizeof(*ar_snoc), dev, ATH10K_BUS_SNOC, in ath10k_snoc_probe()
1740 if (!ar) { in ath10k_snoc_probe()
1745 ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_probe()
1747 platform_set_drvdata(pdev, ar); in ath10k_snoc_probe()
1748 ar_snoc->ar = ar; in ath10k_snoc_probe()
1750 ar->ce_priv = &ar_snoc->ce; in ath10k_snoc_probe()
1753 ath10k_snoc_quirks_init(ar); in ath10k_snoc_probe()
1755 ret = ath10k_snoc_resource_init(ar); in ath10k_snoc_probe()
1757 ath10k_warn(ar, "failed to initialize resource: %d\n", ret); in ath10k_snoc_probe()
1761 ret = ath10k_snoc_setup_resource(ar); in ath10k_snoc_probe()
1763 ath10k_warn(ar, "failed to setup resource: %d\n", ret); in ath10k_snoc_probe()
1766 ret = ath10k_snoc_request_irq(ar); in ath10k_snoc_probe()
1768 ath10k_warn(ar, "failed to request irqs: %d\n", ret); in ath10k_snoc_probe()
1803 ret = ath10k_setup_msa_resources(ar, msa_size); in ath10k_snoc_probe()
1805 ath10k_warn(ar, "failed to setup msa resources: %d\n", ret); in ath10k_snoc_probe()
1809 ret = ath10k_fw_init(ar); in ath10k_snoc_probe()
1811 ath10k_err(ar, "failed to initialize firmware: %d\n", ret); in ath10k_snoc_probe()
1815 ret = ath10k_qmi_init(ar, msa_size); in ath10k_snoc_probe()
1817 ath10k_warn(ar, "failed to register wlfw qmi client: %d\n", ret); in ath10k_snoc_probe()
1821 ret = ath10k_modem_init(ar); in ath10k_snoc_probe()
1825 ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc probe\n"); in ath10k_snoc_probe()
1830 ath10k_qmi_deinit(ar); in ath10k_snoc_probe()
1833 ath10k_fw_deinit(ar); in ath10k_snoc_probe()
1836 ath10k_snoc_free_irq(ar); in ath10k_snoc_probe()
1839 ath10k_snoc_release_resource(ar); in ath10k_snoc_probe()
1842 ath10k_core_destroy(ar); in ath10k_snoc_probe()
1847 static int ath10k_snoc_free_resources(struct ath10k *ar) in ath10k_snoc_free_resources() argument
1849 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_free_resources()
1851 ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc free resources\n"); in ath10k_snoc_free_resources()
1855 ath10k_core_unregister(ar); in ath10k_snoc_free_resources()
1856 ath10k_fw_deinit(ar); in ath10k_snoc_free_resources()
1857 ath10k_snoc_free_irq(ar); in ath10k_snoc_free_resources()
1858 ath10k_snoc_release_resource(ar); in ath10k_snoc_free_resources()
1859 ath10k_modem_deinit(ar); in ath10k_snoc_free_resources()
1860 ath10k_qmi_deinit(ar); in ath10k_snoc_free_resources()
1861 ath10k_core_destroy(ar); in ath10k_snoc_free_resources()
1868 struct ath10k *ar = platform_get_drvdata(pdev); in ath10k_snoc_remove() local
1869 struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); in ath10k_snoc_remove()
1871 ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc remove\n"); in ath10k_snoc_remove()
1873 reinit_completion(&ar->driver_recovery); in ath10k_snoc_remove()
1876 wait_for_completion_timeout(&ar->driver_recovery, 3 * HZ); in ath10k_snoc_remove()
1878 ath10k_snoc_free_resources(ar); in ath10k_snoc_remove()
1885 struct ath10k *ar = platform_get_drvdata(pdev); in ath10k_snoc_shutdown() local
1887 ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc shutdown\n"); in ath10k_snoc_shutdown()
1888 ath10k_snoc_free_resources(ar); in ath10k_snoc_shutdown()