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 #include "hinic_hw_api_cmd.h"
23 
24 enum hinic_mgmt_msg_type {
25 	HINIC_MGMT_MSG_SYNC = 1,
26 };
27 
28 enum hinic_cfg_cmd {
29 	HINIC_CFG_NIC_CAP = 0,
30 };
31 
32 struct hinic_pf_to_mgmt {
33 	struct hinic_hwif               *hwif;
34 
35 	struct hinic_api_cmd_chain      *cmd_chain[HINIC_API_CMD_MAX];
36 };
37 
38 int hinic_msg_to_mgmt(struct hinic_pf_to_mgmt *pf_to_mgmt,
39 		      enum hinic_mod_type mod, u8 cmd,
40 		      void *buf_in, u16 in_size, void *buf_out, u16 *out_size,
41 		      enum hinic_mgmt_msg_type sync);
42 
43 int hinic_pf_to_mgmt_init(struct hinic_pf_to_mgmt *pf_to_mgmt,
44 			  struct hinic_hwif *hwif);
45 
46 void hinic_pf_to_mgmt_free(struct hinic_pf_to_mgmt *pf_to_mgmt);
47 
48 #endif
49