Lines Matching refs:pfhwdev

94 static int get_capability(struct hinic_pfhwdev *pfhwdev)  in get_capability()  argument
96 struct hinic_hwdev *hwdev = &pfhwdev->hwdev; in get_capability()
105 err = hinic_msg_to_mgmt(&pfhwdev->pf_to_mgmt, HINIC_MOD_CFGM, in get_capability()
126 struct hinic_pfhwdev *pfhwdev; in get_dev_cap() local
133 pfhwdev = container_of(hwdev, struct hinic_pfhwdev, hwdev); in get_dev_cap()
134 err = get_capability(pfhwdev); in get_dev_cap()
211 struct hinic_pfhwdev *pfhwdev; in hinic_port_msg_cmd() local
213 pfhwdev = container_of(hwdev, struct hinic_pfhwdev, hwdev); in hinic_port_msg_cmd()
215 return hinic_msg_to_mgmt(&pfhwdev->pf_to_mgmt, HINIC_MOD_L2NIC, cmd, in hinic_port_msg_cmd()
224 struct hinic_pfhwdev *pfhwdev; in hinic_hilink_msg_cmd() local
226 pfhwdev = container_of(hwdev, struct hinic_pfhwdev, hwdev); in hinic_hilink_msg_cmd()
228 return hinic_msg_to_mgmt(&pfhwdev->pf_to_mgmt, HINIC_MOD_HILINK, cmd, in hinic_hilink_msg_cmd()
275 struct hinic_pfhwdev *pfhwdev; in set_hw_ioctxt() local
291 pfhwdev = container_of(hwdev, struct hinic_pfhwdev, hwdev); in set_hw_ioctxt()
293 return hinic_msg_to_mgmt(&pfhwdev->pf_to_mgmt, HINIC_MOD_COMM, in set_hw_ioctxt()
352 struct hinic_pfhwdev *pfhwdev; in clear_io_resources() local
360 pfhwdev = container_of(hwdev, struct hinic_pfhwdev, hwdev); in clear_io_resources()
362 err = hinic_msg_to_mgmt(&pfhwdev->pf_to_mgmt, HINIC_MOD_COMM, in clear_io_resources()
386 struct hinic_pfhwdev *pfhwdev; in set_resources_state() local
391 pfhwdev = container_of(hwdev, struct hinic_pfhwdev, hwdev); in set_resources_state()
393 return hinic_msg_to_mgmt(&pfhwdev->pf_to_mgmt, in set_resources_state()
534 struct hinic_pfhwdev *pfhwdev; in hinic_hwdev_cb_register() local
538 pfhwdev = container_of(hwdev, struct hinic_pfhwdev, hwdev); in hinic_hwdev_cb_register()
541 nic_cb = &pfhwdev->nic_cb[cmd_cb]; in hinic_hwdev_cb_register()
557 struct hinic_pfhwdev *pfhwdev; in hinic_hwdev_cb_unregister() local
564 pfhwdev = container_of(hwdev, struct hinic_pfhwdev, hwdev); in hinic_hwdev_cb_unregister()
567 nic_cb = &pfhwdev->nic_cb[cmd_cb]; in hinic_hwdev_cb_unregister()
589 struct hinic_pfhwdev *pfhwdev = handle; in nic_mgmt_msg_handler() local
597 hwdev = &pfhwdev->hwdev; in nic_mgmt_msg_handler()
609 nic_cb = &pfhwdev->nic_cb[cmd_cb]; in nic_mgmt_msg_handler()
624 static void hinic_comm_recv_mgmt_self_cmd_reg(struct hinic_pfhwdev *pfhwdev, in hinic_comm_recv_mgmt_self_cmd_reg() argument
630 cmd_idx = pfhwdev->proc.cmd_num; in hinic_comm_recv_mgmt_self_cmd_reg()
632 dev_err(&pfhwdev->hwdev.hwif->pdev->dev, in hinic_comm_recv_mgmt_self_cmd_reg()
637 pfhwdev->proc.info[cmd_idx].cmd = cmd; in hinic_comm_recv_mgmt_self_cmd_reg()
638 pfhwdev->proc.info[cmd_idx].proc = proc; in hinic_comm_recv_mgmt_self_cmd_reg()
639 pfhwdev->proc.cmd_num++; in hinic_comm_recv_mgmt_self_cmd_reg()
642 static void hinic_comm_recv_mgmt_self_cmd_unreg(struct hinic_pfhwdev *pfhwdev, in hinic_comm_recv_mgmt_self_cmd_unreg() argument
647 cmd_idx = pfhwdev->proc.cmd_num; in hinic_comm_recv_mgmt_self_cmd_unreg()
649 dev_err(&pfhwdev->hwdev.hwif->pdev->dev, "Unregister recv mgmt process failed, cmd: 0x%x\n", in hinic_comm_recv_mgmt_self_cmd_unreg()
655 if (cmd == pfhwdev->proc.info[cmd_idx].cmd) { in hinic_comm_recv_mgmt_self_cmd_unreg()
656 pfhwdev->proc.info[cmd_idx].cmd = 0; in hinic_comm_recv_mgmt_self_cmd_unreg()
657 pfhwdev->proc.info[cmd_idx].proc = NULL; in hinic_comm_recv_mgmt_self_cmd_unreg()
658 pfhwdev->proc.cmd_num--; in hinic_comm_recv_mgmt_self_cmd_unreg()
666 struct hinic_pfhwdev *pfhwdev = handle; in comm_mgmt_msg_handler() local
669 for (cmd_idx = 0; cmd_idx < pfhwdev->proc.cmd_num; cmd_idx++) { in comm_mgmt_msg_handler()
670 if (cmd == pfhwdev->proc.info[cmd_idx].cmd) { in comm_mgmt_msg_handler()
671 if (!pfhwdev->proc.info[cmd_idx].proc) { in comm_mgmt_msg_handler()
672 dev_warn(&pfhwdev->hwdev.hwif->pdev->dev, in comm_mgmt_msg_handler()
676 pfhwdev->proc.info[cmd_idx].proc in comm_mgmt_msg_handler()
677 (&pfhwdev->hwdev, buf_in, in_size, in comm_mgmt_msg_handler()
685 dev_warn(&pfhwdev->hwdev.hwif->pdev->dev, "Received unknown mgmt cpu event: 0x%x\n", in comm_mgmt_msg_handler()
737 static int init_pfhwdev(struct hinic_pfhwdev *pfhwdev) in init_pfhwdev() argument
739 struct hinic_hwdev *hwdev = &pfhwdev->hwdev; in init_pfhwdev()
744 err = hinic_pf_to_mgmt_init(&pfhwdev->pf_to_mgmt, hwif); in init_pfhwdev()
753 hinic_pf_to_mgmt_free(&pfhwdev->pf_to_mgmt); in init_pfhwdev()
758 hinic_register_mgmt_msg_cb(&pfhwdev->pf_to_mgmt, in init_pfhwdev()
759 HINIC_MOD_L2NIC, pfhwdev, in init_pfhwdev()
761 hinic_register_mgmt_msg_cb(&pfhwdev->pf_to_mgmt, HINIC_MOD_COMM, in init_pfhwdev()
762 pfhwdev, comm_mgmt_msg_handler); in init_pfhwdev()
763 hinic_comm_recv_mgmt_self_cmd_reg(pfhwdev, in init_pfhwdev()
767 (pfhwdev, HINIC_COMM_CMD_WATCHDOG_INFO, in init_pfhwdev()
783 static void free_pfhwdev(struct hinic_pfhwdev *pfhwdev) in free_pfhwdev() argument
785 struct hinic_hwdev *hwdev = &pfhwdev->hwdev; in free_pfhwdev()
791 hinic_comm_recv_mgmt_self_cmd_unreg(pfhwdev, in free_pfhwdev()
793 hinic_comm_recv_mgmt_self_cmd_unreg(pfhwdev, in free_pfhwdev()
795 hinic_unregister_mgmt_msg_cb(&pfhwdev->pf_to_mgmt, in free_pfhwdev()
797 hinic_unregister_mgmt_msg_cb(&pfhwdev->pf_to_mgmt, in free_pfhwdev()
805 hinic_pf_to_mgmt_free(&pfhwdev->pf_to_mgmt); in free_pfhwdev()
812 struct hinic_pfhwdev *pfhwdev; in hinic_l2nic_reset() local
815 pfhwdev = container_of(hwdev, struct hinic_pfhwdev, hwdev); in hinic_l2nic_reset()
821 err = hinic_msg_to_mgmt(&pfhwdev->pf_to_mgmt, HINIC_MOD_COMM, in hinic_l2nic_reset()
838 struct hinic_pfhwdev *pfhwdev; in hinic_get_interrupt_cfg() local
844 pfhwdev = container_of(hwdev, struct hinic_pfhwdev, hwdev); in hinic_get_interrupt_cfg()
848 err = hinic_msg_to_mgmt(&pfhwdev->pf_to_mgmt, HINIC_MOD_COMM, in hinic_get_interrupt_cfg()
866 struct hinic_pfhwdev *pfhwdev; in hinic_set_interrupt_cfg() local
872 pfhwdev = container_of(hwdev, struct hinic_pfhwdev, hwdev); in hinic_set_interrupt_cfg()
883 err = hinic_msg_to_mgmt(&pfhwdev->pf_to_mgmt, HINIC_MOD_COMM, in hinic_set_interrupt_cfg()
907 struct hinic_pfhwdev *pfhwdev; in hinic_init_hwdev() local
922 pfhwdev = devm_kzalloc(&pdev->dev, sizeof(*pfhwdev), GFP_KERNEL); in hinic_init_hwdev()
923 if (!pfhwdev) { in hinic_init_hwdev()
928 hwdev = &pfhwdev->hwdev; in hinic_init_hwdev()
955 err = init_pfhwdev(pfhwdev); in hinic_init_hwdev()
999 free_pfhwdev(pfhwdev); in hinic_init_hwdev()
1021 struct hinic_pfhwdev *pfhwdev = container_of(hwdev, in hinic_free_hwdev() local
1029 free_pfhwdev(pfhwdev); in hinic_free_hwdev()
1136 struct hinic_pfhwdev *pfhwdev; in hinic_hwdev_hw_ci_addr_set() local
1152 pfhwdev = container_of(hwdev, struct hinic_pfhwdev, hwdev); in hinic_hwdev_hw_ci_addr_set()
1153 return hinic_msg_to_mgmt(&pfhwdev->pf_to_mgmt, in hinic_hwdev_hw_ci_addr_set()
1177 struct hinic_pfhwdev *pfhwdev; in hinic_get_board_info() local
1183 pfhwdev = container_of(hwdev, struct hinic_pfhwdev, hwdev); in hinic_get_board_info()
1185 err = hinic_msg_to_mgmt(&pfhwdev->pf_to_mgmt, HINIC_MOD_COMM, in hinic_get_board_info()