func_to_io 865 drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c struct hinic_func_to_io *func_to_io = cmdqs_to_func_to_io(cmdqs); func_to_io 895 drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c hwdev = container_of(func_to_io, struct hinic_hwdev, func_to_io); func_to_io 902 drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c hinic_ceq_register_cb(&func_to_io->ceqs, HINIC_CEQ_CMDQ, cmdqs, func_to_io 924 drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c struct hinic_func_to_io *func_to_io = cmdqs_to_func_to_io(cmdqs); func_to_io 929 drivers/net/ethernet/huawei/hinic/hinic_hw_cmdq.c hinic_ceq_unregister_cb(&func_to_io->ceqs, HINIC_CEQ_CMDQ); func_to_io 471 drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c struct hinic_func_to_io *func_to_io = &hwdev->func_to_io; func_to_io 492 drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c err = hinic_io_init(func_to_io, hwif, nic_cap->max_qps, num_ceqs, func_to_io 503 drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c err = hinic_io_create_qps(func_to_io, base_qpn, num_qps, func_to_io 525 drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c hinic_io_destroy_qps(func_to_io, num_qps); func_to_io 528 drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c hinic_io_free(func_to_io); func_to_io 539 drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c struct hinic_func_to_io *func_to_io = &hwdev->func_to_io; func_to_io 544 drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c hinic_io_destroy_qps(func_to_io, nic_cap->num_qps); func_to_io 545 drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c hinic_io_free(func_to_io); func_to_io 857 drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c struct hinic_func_to_io *func_to_io = &hwdev->func_to_io; func_to_io 858 drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c struct hinic_qp *qp = &func_to_io->qps[i]; func_to_io 875 drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c struct hinic_func_to_io *func_to_io = &hwdev->func_to_io; func_to_io 876 drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c struct hinic_qp *qp = &func_to_io->qps[i]; func_to_io 227 drivers/net/ethernet/huawei/hinic/hinic_hw_dev.h struct hinic_func_to_io func_to_io; func_to_io 57 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c static void __iomem *get_db_area(struct hinic_func_to_io *func_to_io) func_to_io 59 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c struct hinic_free_db_area *free_db_area = &func_to_io->free_db_area; func_to_io 81 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c return func_to_io->db_base + idx * HINIC_DB_PAGE_SIZE; func_to_io 84 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c static void return_db_area(struct hinic_func_to_io *func_to_io, func_to_io 87 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c struct hinic_free_db_area *free_db_area = &func_to_io->free_db_area; func_to_io 88 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c int pos, idx = DB_IDX(db_base, func_to_io->db_base); func_to_io 102 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c static int write_sq_ctxts(struct hinic_func_to_io *func_to_io, u16 base_qpn, func_to_io 105 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c struct hinic_hwif *hwif = func_to_io->hwif; func_to_io 114 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c err = hinic_alloc_cmdq_buf(&func_to_io->cmdqs, &cmdq_buf); func_to_io 124 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c num_sqs, func_to_io->max_qps); func_to_io 126 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c qp = &func_to_io->qps[i]; func_to_io 134 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c err = hinic_cmdq_direct_resp(&func_to_io->cmdqs, HINIC_MOD_L2NIC, func_to_io 142 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c hinic_free_cmdq_buf(&func_to_io->cmdqs, &cmdq_buf); func_to_io 146 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c static int write_rq_ctxts(struct hinic_func_to_io *func_to_io, u16 base_qpn, func_to_io 149 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c struct hinic_hwif *hwif = func_to_io->hwif; func_to_io 158 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c err = hinic_alloc_cmdq_buf(&func_to_io->cmdqs, &cmdq_buf); func_to_io 168 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c num_rqs, func_to_io->max_qps); func_to_io 170 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c qp = &func_to_io->qps[i]; func_to_io 178 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c err = hinic_cmdq_direct_resp(&func_to_io->cmdqs, HINIC_MOD_L2NIC, func_to_io 186 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c hinic_free_cmdq_buf(&func_to_io->cmdqs, &cmdq_buf); func_to_io 198 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c static int write_qp_ctxts(struct hinic_func_to_io *func_to_io, u16 base_qpn, func_to_io 201 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c return (write_sq_ctxts(func_to_io, base_qpn, num_qps) || func_to_io 202 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c write_rq_ctxts(func_to_io, base_qpn, num_qps)); func_to_io 205 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c static int hinic_clean_queue_offload_ctxt(struct hinic_func_to_io *func_to_io, func_to_io 208 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c struct hinic_hwif *hwif = func_to_io->hwif; func_to_io 215 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c err = hinic_alloc_cmdq_buf(&func_to_io->cmdqs, &cmdq_buf); func_to_io 222 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c ctxt_block->cmdq_hdr.num_queues = func_to_io->max_qps; func_to_io 233 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c err = hinic_cmdq_direct_resp(&func_to_io->cmdqs, HINIC_MOD_L2NIC, func_to_io 244 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c hinic_free_cmdq_buf(&func_to_io->cmdqs, &cmdq_buf); func_to_io 249 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c static int hinic_clean_qp_offload_ctxt(struct hinic_func_to_io *func_to_io) func_to_io 252 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c return (hinic_clean_queue_offload_ctxt(func_to_io, func_to_io 254 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c hinic_clean_queue_offload_ctxt(func_to_io, func_to_io 268 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c static int init_qp(struct hinic_func_to_io *func_to_io, func_to_io 273 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c struct hinic_hwif *hwif = func_to_io->hwif; func_to_io 280 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c err = hinic_wq_allocate(&func_to_io->wqs, &func_to_io->sq_wq[q_id], func_to_io 288 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c err = hinic_wq_allocate(&func_to_io->wqs, &func_to_io->rq_wq[q_id], func_to_io 296 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c db_base = get_db_area(func_to_io); func_to_io 303 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c func_to_io->sq_db[q_id] = db_base; func_to_io 305 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c err = hinic_init_sq(&qp->sq, hwif, &func_to_io->sq_wq[q_id], func_to_io 307 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c CI_ADDR(func_to_io->ci_addr_base, q_id), func_to_io 308 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c CI_ADDR(func_to_io->ci_dma_base, q_id), db_base); func_to_io 314 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c err = hinic_init_rq(&qp->rq, hwif, &func_to_io->rq_wq[q_id], func_to_io 327 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c return_db_area(func_to_io, db_base); func_to_io 330 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c hinic_wq_free(&func_to_io->wqs, &func_to_io->rq_wq[q_id]); func_to_io 333 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c hinic_wq_free(&func_to_io->wqs, &func_to_io->sq_wq[q_id]); func_to_io 342 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c static void destroy_qp(struct hinic_func_to_io *func_to_io, func_to_io 350 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c return_db_area(func_to_io, func_to_io->sq_db[q_id]); func_to_io 352 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c hinic_wq_free(&func_to_io->wqs, &func_to_io->rq_wq[q_id]); func_to_io 353 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c hinic_wq_free(&func_to_io->wqs, &func_to_io->sq_wq[q_id]); func_to_io 366 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c int hinic_io_create_qps(struct hinic_func_to_io *func_to_io, func_to_io 371 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c struct hinic_hwif *hwif = func_to_io->hwif; func_to_io 377 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c qps_size = num_qps * sizeof(*func_to_io->qps); func_to_io 378 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c func_to_io->qps = devm_kzalloc(&pdev->dev, qps_size, GFP_KERNEL); func_to_io 379 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c if (!func_to_io->qps) func_to_io 382 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c wq_size = num_qps * sizeof(*func_to_io->sq_wq); func_to_io 383 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c func_to_io->sq_wq = devm_kzalloc(&pdev->dev, wq_size, GFP_KERNEL); func_to_io 384 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c if (!func_to_io->sq_wq) { func_to_io 389 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c wq_size = num_qps * sizeof(*func_to_io->rq_wq); func_to_io 390 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c func_to_io->rq_wq = devm_kzalloc(&pdev->dev, wq_size, GFP_KERNEL); func_to_io 391 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c if (!func_to_io->rq_wq) { func_to_io 396 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c db_size = num_qps * sizeof(*func_to_io->sq_db); func_to_io 397 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c func_to_io->sq_db = devm_kzalloc(&pdev->dev, db_size, GFP_KERNEL); func_to_io 398 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c if (!func_to_io->sq_db) { func_to_io 404 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c &func_to_io->ci_dma_base, func_to_io 412 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c func_to_io->ci_addr_base = ci_addr_base; func_to_io 415 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c err = init_qp(func_to_io, &func_to_io->qps[i], i, func_to_io 423 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c err = write_qp_ctxts(func_to_io, base_qpn, num_qps); func_to_io 429 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c err = hinic_clean_qp_offload_ctxt(func_to_io); func_to_io 440 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c destroy_qp(func_to_io, &func_to_io->qps[j]); func_to_io 443 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c func_to_io->ci_addr_base, func_to_io->ci_dma_base); func_to_io 446 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c devm_kfree(&pdev->dev, func_to_io->sq_db); func_to_io 449 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c devm_kfree(&pdev->dev, func_to_io->rq_wq); func_to_io 452 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c devm_kfree(&pdev->dev, func_to_io->sq_wq); func_to_io 455 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c devm_kfree(&pdev->dev, func_to_io->qps); func_to_io 464 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c void hinic_io_destroy_qps(struct hinic_func_to_io *func_to_io, int num_qps) func_to_io 466 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c struct hinic_hwif *hwif = func_to_io->hwif; func_to_io 474 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c destroy_qp(func_to_io, &func_to_io->qps[i]); func_to_io 476 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c dma_free_coherent(&pdev->dev, ci_table_size, func_to_io->ci_addr_base, func_to_io 477 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c func_to_io->ci_dma_base); func_to_io 479 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c devm_kfree(&pdev->dev, func_to_io->sq_db); func_to_io 481 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c devm_kfree(&pdev->dev, func_to_io->rq_wq); func_to_io 482 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c devm_kfree(&pdev->dev, func_to_io->sq_wq); func_to_io 484 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c devm_kfree(&pdev->dev, func_to_io->qps); func_to_io 497 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c int hinic_io_init(struct hinic_func_to_io *func_to_io, func_to_io 506 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c func_to_io->hwif = hwif; func_to_io 507 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c func_to_io->qps = NULL; func_to_io 508 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c func_to_io->max_qps = max_qps; func_to_io 510 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c err = hinic_ceqs_init(&func_to_io->ceqs, hwif, num_ceqs, func_to_io 518 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c err = hinic_wqs_alloc(&func_to_io->wqs, 2 * max_qps, hwif); func_to_io 524 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c func_to_io->db_base = pci_ioremap_bar(pdev, HINIC_PCI_DB_BAR); func_to_io 525 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c if (!func_to_io->db_base) { func_to_io 531 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c init_db_area_idx(&func_to_io->free_db_area); func_to_io 534 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c db_area = get_db_area(func_to_io); func_to_io 541 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c func_to_io->cmdq_db_area[cmdq] = db_area; func_to_io 544 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c err = hinic_init_cmdqs(&func_to_io->cmdqs, hwif, func_to_io 545 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c func_to_io->cmdq_db_area); func_to_io 556 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c return_db_area(func_to_io, func_to_io->cmdq_db_area[type]); func_to_io 558 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c iounmap(func_to_io->db_base); func_to_io 561 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c hinic_wqs_free(&func_to_io->wqs); func_to_io 564 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c hinic_ceqs_free(&func_to_io->ceqs); func_to_io 572 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c void hinic_io_free(struct hinic_func_to_io *func_to_io) func_to_io 576 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c hinic_free_cmdqs(&func_to_io->cmdqs); func_to_io 579 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c return_db_area(func_to_io, func_to_io->cmdq_db_area[cmdq]); func_to_io 581 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c iounmap(func_to_io->db_base); func_to_io 582 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c hinic_wqs_free(&func_to_io->wqs); func_to_io 583 drivers/net/ethernet/huawei/hinic/hinic_hw_io.c hinic_ceqs_free(&func_to_io->ceqs); func_to_io 74 drivers/net/ethernet/huawei/hinic/hinic_hw_io.h int hinic_io_create_qps(struct hinic_func_to_io *func_to_io, func_to_io 79 drivers/net/ethernet/huawei/hinic/hinic_hw_io.h void hinic_io_destroy_qps(struct hinic_func_to_io *func_to_io, func_to_io 82 drivers/net/ethernet/huawei/hinic/hinic_hw_io.h int hinic_io_init(struct hinic_func_to_io *func_to_io, func_to_io 86 drivers/net/ethernet/huawei/hinic/hinic_hw_io.h void hinic_io_free(struct hinic_func_to_io *func_to_io); func_to_io 582 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_func_to_io *func_to_io; func_to_io 593 drivers/net/ethernet/huawei/hinic/hinic_port.c func_to_io = &hwdev->func_to_io; func_to_io 597 drivers/net/ethernet/huawei/hinic/hinic_port.c err = hinic_alloc_cmdq_buf(&func_to_io->cmdqs, &cmd_buf); func_to_io 622 drivers/net/ethernet/huawei/hinic/hinic_port.c err = hinic_cmdq_direct_resp(&func_to_io->cmdqs, HINIC_MOD_L2NIC, func_to_io 635 drivers/net/ethernet/huawei/hinic/hinic_port.c err = hinic_cmdq_direct_resp(&func_to_io->cmdqs, HINIC_MOD_L2NIC, func_to_io 644 drivers/net/ethernet/huawei/hinic/hinic_port.c hinic_free_cmdq_buf(&func_to_io->cmdqs, &cmd_buf); func_to_io 683 drivers/net/ethernet/huawei/hinic/hinic_port.c struct hinic_func_to_io *func_to_io; func_to_io 693 drivers/net/ethernet/huawei/hinic/hinic_port.c func_to_io = &hwdev->func_to_io; func_to_io 697 drivers/net/ethernet/huawei/hinic/hinic_port.c err = hinic_alloc_cmdq_buf(&func_to_io->cmdqs, &cmd_buf); func_to_io 724 drivers/net/ethernet/huawei/hinic/hinic_port.c err = hinic_cmdq_direct_resp(&func_to_io->cmdqs, HINIC_MOD_L2NIC, func_to_io 728 drivers/net/ethernet/huawei/hinic/hinic_port.c hinic_free_cmdq_buf(&func_to_io->cmdqs, &cmd_buf);