Lines Matching full:dp
28 /* TODO: Any other peer specific DP cleanup */ in ath12k_dp_peer_cleanup()
52 reo_dest = ar->dp.mac_id + 1; in ath12k_dp_peer_setup()
185 ret = ath12k_hif_get_user_msi_vector(ab, "DP", in ath12k_dp_srng_msi_setup()
297 ath12k_warn(ab, "Not a valid ring type in dp :%d\n", type); in ath12k_dp_srng_setup()
353 struct ath12k_dp *dp) in ath12k_dp_tx_get_bank_profile() argument
363 spin_lock_bh(&dp->tx_bank_lock); in ath12k_dp_tx_get_bank_profile()
365 for (i = 0; i < dp->num_bank_profiles; i++) { in ath12k_dp_tx_get_bank_profile()
366 if (dp->bank_profiles[i].is_configured && in ath12k_dp_tx_get_bank_profile()
367 (dp->bank_profiles[i].bank_config ^ bank_config) == 0) { in ath12k_dp_tx_get_bank_profile()
371 if (!dp->bank_profiles[i].is_configured || in ath12k_dp_tx_get_bank_profile()
372 !dp->bank_profiles[i].num_users) { in ath12k_dp_tx_get_bank_profile()
379 spin_unlock_bh(&dp->tx_bank_lock); in ath12k_dp_tx_get_bank_profile()
385 dp->bank_profiles[bank_id].is_configured = true; in ath12k_dp_tx_get_bank_profile()
386 dp->bank_profiles[bank_id].bank_config = bank_config; in ath12k_dp_tx_get_bank_profile()
389 dp->bank_profiles[bank_id].num_users++; in ath12k_dp_tx_get_bank_profile()
390 spin_unlock_bh(&dp->tx_bank_lock); in ath12k_dp_tx_get_bank_profile()
396 bank_id, bank_config, dp->bank_profiles[bank_id].bank_config, in ath12k_dp_tx_get_bank_profile()
397 dp->bank_profiles[bank_id].num_users); in ath12k_dp_tx_get_bank_profile()
402 void ath12k_dp_tx_put_bank_profile(struct ath12k_dp *dp, u8 bank_id) in ath12k_dp_tx_put_bank_profile() argument
404 spin_lock_bh(&dp->tx_bank_lock); in ath12k_dp_tx_put_bank_profile()
405 dp->bank_profiles[bank_id].num_users--; in ath12k_dp_tx_put_bank_profile()
406 spin_unlock_bh(&dp->tx_bank_lock); in ath12k_dp_tx_put_bank_profile()
411 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_deinit_bank_profiles() local
413 kfree(dp->bank_profiles); in ath12k_dp_deinit_bank_profiles()
414 dp->bank_profiles = NULL; in ath12k_dp_deinit_bank_profiles()
419 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_init_bank_profiles() local
423 dp->num_bank_profiles = num_tcl_banks; in ath12k_dp_init_bank_profiles()
424 dp->bank_profiles = kmalloc_array(num_tcl_banks, in ath12k_dp_init_bank_profiles()
427 if (!dp->bank_profiles) in ath12k_dp_init_bank_profiles()
430 spin_lock_init(&dp->tx_bank_lock); in ath12k_dp_init_bank_profiles()
433 dp->bank_profiles[i].is_configured = false; in ath12k_dp_init_bank_profiles()
434 dp->bank_profiles[i].num_users = 0; in ath12k_dp_init_bank_profiles()
442 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_srng_common_cleanup() local
445 ath12k_dp_srng_cleanup(ab, &dp->reo_status_ring); in ath12k_dp_srng_common_cleanup()
446 ath12k_dp_srng_cleanup(ab, &dp->reo_cmd_ring); in ath12k_dp_srng_common_cleanup()
447 ath12k_dp_srng_cleanup(ab, &dp->reo_except_ring); in ath12k_dp_srng_common_cleanup()
448 ath12k_dp_srng_cleanup(ab, &dp->rx_rel_ring); in ath12k_dp_srng_common_cleanup()
449 ath12k_dp_srng_cleanup(ab, &dp->reo_reinject_ring); in ath12k_dp_srng_common_cleanup()
451 ath12k_dp_srng_cleanup(ab, &dp->tx_ring[i].tcl_comp_ring); in ath12k_dp_srng_common_cleanup()
452 ath12k_dp_srng_cleanup(ab, &dp->tx_ring[i].tcl_data_ring); in ath12k_dp_srng_common_cleanup()
454 ath12k_dp_srng_cleanup(ab, &dp->tcl_status_ring); in ath12k_dp_srng_common_cleanup()
455 ath12k_dp_srng_cleanup(ab, &dp->tcl_cmd_ring); in ath12k_dp_srng_common_cleanup()
456 ath12k_dp_srng_cleanup(ab, &dp->wbm_desc_rel_ring); in ath12k_dp_srng_common_cleanup()
461 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_srng_common_setup() local
467 ret = ath12k_dp_srng_setup(ab, &dp->wbm_desc_rel_ring, in ath12k_dp_srng_common_setup()
476 ret = ath12k_dp_srng_setup(ab, &dp->tcl_cmd_ring, HAL_TCL_CMD, 0, 0, in ath12k_dp_srng_common_setup()
483 ret = ath12k_dp_srng_setup(ab, &dp->tcl_status_ring, HAL_TCL_STATUS, in ath12k_dp_srng_common_setup()
494 ret = ath12k_dp_srng_setup(ab, &dp->tx_ring[i].tcl_data_ring, in ath12k_dp_srng_common_setup()
503 ret = ath12k_dp_srng_setup(ab, &dp->tx_ring[i].tcl_comp_ring, in ath12k_dp_srng_common_setup()
513 ret = ath12k_dp_srng_setup(ab, &dp->reo_reinject_ring, HAL_REO_REINJECT, in ath12k_dp_srng_common_setup()
521 ret = ath12k_dp_srng_setup(ab, &dp->rx_rel_ring, HAL_WBM2SW_RELEASE, in ath12k_dp_srng_common_setup()
529 ret = ath12k_dp_srng_setup(ab, &dp->reo_except_ring, HAL_REO_EXCEPTION, in ath12k_dp_srng_common_setup()
537 ret = ath12k_dp_srng_setup(ab, &dp->reo_cmd_ring, HAL_REO_CMD, in ath12k_dp_srng_common_setup()
544 srng = &ab->hal.srng_list[dp->reo_cmd_ring.ring_id]; in ath12k_dp_srng_common_setup()
547 ret = ath12k_dp_srng_setup(ab, &dp->reo_status_ring, HAL_REO_STATUS, in ath12k_dp_srng_common_setup()
581 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_scatter_idle_link_desc_cleanup() local
582 struct hal_wbm_idle_scatter_list *slist = dp->scatter_list; in ath12k_dp_scatter_idle_link_desc_cleanup()
601 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_scatter_idle_link_desc_setup() local
602 struct dp_link_desc_bank *link_desc_banks = dp->link_desc_banks; in ath12k_dp_scatter_idle_link_desc_setup()
603 struct hal_wbm_idle_scatter_list *slist = dp->scatter_list; in ath12k_dp_scatter_idle_link_desc_setup()
698 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_link_desc_bank_alloc() local
727 ath12k_dp_link_desc_bank_free(ab, dp->link_desc_banks); in ath12k_dp_link_desc_bank_alloc()
746 struct ath12k_dp *dp = &ab->dp; in ath12k_wbm_idle_ring_setup() local
771 ret = ath12k_dp_srng_setup(ab, &dp->wbm_idle_ring, in ath12k_wbm_idle_ring_setup()
970 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_service_srng() local
971 struct dp_rxdma_ring *rx_ring = &dp->rx_refill_buf_ring; in ath12k_dp_service_srng()
997 struct ath12k_pdev_dp *dp; in ath12k_dp_pdev_pre_alloc() local
1002 dp = &ar->dp; in ath12k_dp_pdev_pre_alloc()
1003 dp->mac_id = i; in ath12k_dp_pdev_pre_alloc()
1004 atomic_set(&dp->num_tx_pending, 0); in ath12k_dp_pdev_pre_alloc()
1005 init_waitqueue_head(&dp->tx_empty_waitq); in ath12k_dp_pdev_pre_alloc()
1067 int ath12k_dp_htt_connect(struct ath12k_dp *dp) in ath12k_dp_htt_connect() argument
1079 status = ath12k_htc_connect_service(&dp->ab->htc, &conn_req, in ath12k_dp_htt_connect()
1085 dp->eid = conn_resp.eid; in ath12k_dp_htt_connect()
1126 arvif->bank_id = ath12k_dp_tx_get_bank_profile(ab, arvif, &ab->dp); in ath12k_dp_vdev_tx_attach()
1130 ath12k_err(ar->ab, "Failed to initialize DP TX Banks"); in ath12k_dp_vdev_tx_attach()
1139 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_cc_cleanup() local
1143 if (!dp->spt_info) in ath12k_dp_cc_cleanup()
1147 spin_lock_bh(&dp->rx_desc_lock); in ath12k_dp_cc_cleanup()
1149 list_for_each_entry_safe(desc_info, tmp, &dp->rx_desc_used_list, list) { in ath12k_dp_cc_cleanup()
1161 spin_unlock_bh(&dp->rx_desc_lock); in ath12k_dp_cc_cleanup()
1165 spin_lock_bh(&dp->tx_desc_lock[i]); in ath12k_dp_cc_cleanup()
1167 list_for_each_entry_safe(tx_desc_info, tmp1, &dp->tx_desc_used_list[i], in ath12k_dp_cc_cleanup()
1180 spin_unlock_bh(&dp->tx_desc_lock[i]); in ath12k_dp_cc_cleanup()
1184 for (i = 0; i < dp->num_spt_pages; i++) { in ath12k_dp_cc_cleanup()
1185 if (!dp->spt_info[i].vaddr) in ath12k_dp_cc_cleanup()
1189 dp->spt_info[i].vaddr, dp->spt_info[i].paddr); in ath12k_dp_cc_cleanup()
1190 dp->spt_info[i].vaddr = NULL; in ath12k_dp_cc_cleanup()
1193 kfree(dp->spt_info); in ath12k_dp_cc_cleanup()
1198 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_reoq_lut_cleanup() local
1203 if (!dp->reoq_lut.vaddr) in ath12k_dp_reoq_lut_cleanup()
1207 dp->reoq_lut.vaddr, dp->reoq_lut.paddr); in ath12k_dp_reoq_lut_cleanup()
1208 dp->reoq_lut.vaddr = NULL; in ath12k_dp_reoq_lut_cleanup()
1216 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_free() local
1219 ath12k_dp_link_desc_cleanup(ab, dp->link_desc_banks, in ath12k_dp_free()
1220 HAL_WBM_IDLE_LINK, &dp->wbm_idle_ring); in ath12k_dp_free()
1230 kfree(dp->tx_ring[i].tx_status); in ath12k_dp_free()
1294 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_cc_get_desc_addr_ptr() local
1296 return dp->spt_info[ppt_idx].vaddr + spt_idx; in ath12k_dp_cc_get_desc_addr_ptr()
1327 ppt_idx > ab->dp.num_spt_pages || in ath12k_dp_get_tx_desc()
1338 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_cc_desc_init() local
1344 spin_lock_bh(&dp->rx_desc_lock); in ath12k_dp_cc_desc_init()
1352 spin_unlock_bh(&dp->rx_desc_lock); in ath12k_dp_cc_desc_init()
1359 list_add_tail(&rx_descs[j].list, &dp->rx_desc_free_list); in ath12k_dp_cc_desc_init()
1367 spin_unlock_bh(&dp->rx_desc_lock); in ath12k_dp_cc_desc_init()
1370 spin_lock_bh(&dp->tx_desc_lock[pool_id]); in ath12k_dp_cc_desc_init()
1376 spin_unlock_bh(&dp->tx_desc_lock[pool_id]); in ath12k_dp_cc_desc_init()
1387 &dp->tx_desc_free_list[pool_id]); in ath12k_dp_cc_desc_init()
1395 spin_unlock_bh(&dp->tx_desc_lock[pool_id]); in ath12k_dp_cc_desc_init()
1402 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_cc_init() local
1406 INIT_LIST_HEAD(&dp->rx_desc_free_list); in ath12k_dp_cc_init()
1407 INIT_LIST_HEAD(&dp->rx_desc_used_list); in ath12k_dp_cc_init()
1408 spin_lock_init(&dp->rx_desc_lock); in ath12k_dp_cc_init()
1411 INIT_LIST_HEAD(&dp->tx_desc_free_list[i]); in ath12k_dp_cc_init()
1412 INIT_LIST_HEAD(&dp->tx_desc_used_list[i]); in ath12k_dp_cc_init()
1413 spin_lock_init(&dp->tx_desc_lock[i]); in ath12k_dp_cc_init()
1416 dp->num_spt_pages = ATH12K_NUM_SPT_PAGES; in ath12k_dp_cc_init()
1417 if (dp->num_spt_pages > ATH12K_MAX_PPT_ENTRIES) in ath12k_dp_cc_init()
1418 dp->num_spt_pages = ATH12K_MAX_PPT_ENTRIES; in ath12k_dp_cc_init()
1420 dp->spt_info = kcalloc(dp->num_spt_pages, sizeof(struct ath12k_spt_info), in ath12k_dp_cc_init()
1423 if (!dp->spt_info) { in ath12k_dp_cc_init()
1430 for (i = 0; i < dp->num_spt_pages; i++) { in ath12k_dp_cc_init()
1431 dp->spt_info[i].vaddr = dma_alloc_coherent(ab->dev, in ath12k_dp_cc_init()
1433 &dp->spt_info[i].paddr, in ath12k_dp_cc_init()
1436 if (!dp->spt_info[i].vaddr) { in ath12k_dp_cc_init()
1441 if (dp->spt_info[i].paddr & ATH12K_SPT_4K_ALIGN_CHECK) { in ath12k_dp_cc_init()
1449 dp->spt_info[i].paddr >> ATH12K_SPT_4K_ALIGN_OFFSET); in ath12k_dp_cc_init()
1466 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_reoq_lut_setup() local
1471 dp->reoq_lut.vaddr = dma_alloc_coherent(ab->dev, in ath12k_dp_reoq_lut_setup()
1473 &dp->reoq_lut.paddr, in ath12k_dp_reoq_lut_setup()
1475 if (!dp->reoq_lut.vaddr) { in ath12k_dp_reoq_lut_setup()
1481 dp->reoq_lut.paddr); in ath12k_dp_reoq_lut_setup()
1487 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_alloc() local
1494 dp->ab = ab; in ath12k_dp_alloc()
1496 INIT_LIST_HEAD(&dp->reo_cmd_list); in ath12k_dp_alloc()
1497 INIT_LIST_HEAD(&dp->reo_cmd_cache_flush_list); in ath12k_dp_alloc()
1498 spin_lock_init(&dp->reo_cmd_lock); in ath12k_dp_alloc()
1500 dp->reo_cmd_cache_flush_count = 0; in ath12k_dp_alloc()
1508 srng = &ab->hal.srng_list[dp->wbm_idle_ring.ring_id]; in ath12k_dp_alloc()
1510 ret = ath12k_dp_link_desc_setup(ab, dp->link_desc_banks, in ath12k_dp_alloc()
1542 dp->tx_ring[i].tcl_data_ring_id = i; in ath12k_dp_alloc()
1544 dp->tx_ring[i].tx_status_head = 0; in ath12k_dp_alloc()
1545 dp->tx_ring[i].tx_status_tail = DP_TX_COMP_RING_SIZE - 1; in ath12k_dp_alloc()
1546 dp->tx_ring[i].tx_status = kmalloc(size, GFP_KERNEL); in ath12k_dp_alloc()
1547 if (!dp->tx_ring[i].tx_status) { in ath12k_dp_alloc()
1563 /* Init any SOC level resource for DP */ in ath12k_dp_alloc()
1583 ath12k_dp_link_desc_cleanup(ab, dp->link_desc_banks, in ath12k_dp_alloc()
1584 HAL_WBM_IDLE_LINK, &dp->wbm_idle_ring); in ath12k_dp_alloc()