1 /* 2 * Huawei HiNIC PCI Express Linux driver 3 * Copyright(c) 2017 Huawei Technologies Co., Ltd 4 * 5 * This program is free software; you can redistribute it and/or modify it 6 * under the terms and conditions of the GNU General Public License, 7 * version 2, as published by the Free Software Foundation. 8 * 9 * This program is distributed in the hope it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * for more details. 13 * 14 */ 15 16 #ifndef HINIC_HW_MGMT_H 17 #define HINIC_HW_MGMT_H 18 19 #include <linux/types.h> 20 21 #include "hinic_hw_if.h" 22 23 enum hinic_mgmt_msg_type { 24 HINIC_MGMT_MSG_SYNC = 1, 25 }; 26 27 enum hinic_cfg_cmd { 28 HINIC_CFG_NIC_CAP = 0, 29 }; 30 31 struct hinic_pf_to_mgmt { 32 struct hinic_hwif *hwif; 33 }; 34 35 int hinic_msg_to_mgmt(struct hinic_pf_to_mgmt *pf_to_mgmt, 36 enum hinic_mod_type mod, u8 cmd, 37 void *buf_in, u16 in_size, void *buf_out, u16 *out_size, 38 enum hinic_mgmt_msg_type sync); 39 40 int hinic_pf_to_mgmt_init(struct hinic_pf_to_mgmt *pf_to_mgmt, 41 struct hinic_hwif *hwif); 42 43 void hinic_pf_to_mgmt_free(struct hinic_pf_to_mgmt *pf_to_mgmt); 44 45 #endif 46