hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/net/ethernet/huawei/hinic/hinic_hw_mgmt.h
....@@ -1,16 +1,7 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Huawei HiNIC PCI Express Linux driver
34 * 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
- *
145 */
156
167 #ifndef HINIC_HW_MGMT_H
....@@ -69,7 +60,9 @@
6960 };
7061
7162 enum hinic_comm_cmd {
63
+ HINIC_COMM_CMD_START_FLR = 0x1,
7264 HINIC_COMM_CMD_IO_STATUS_GET = 0x3,
65
+ HINIC_COMM_CMD_DMA_ATTR_SET = 0x4,
7366
7467 HINIC_COMM_CMD_CMDQ_CTXT_SET = 0x10,
7568 HINIC_COMM_CMD_CMDQ_CTXT_GET = 0x11,
....@@ -83,7 +76,26 @@
8376
8477 HINIC_COMM_CMD_IO_RES_CLEAR = 0x29,
8578
86
- HINIC_COMM_CMD_MAX = 0x32,
79
+ HINIC_COMM_CMD_CEQ_CTRL_REG_WR_BY_UP = 0x33,
80
+
81
+ HINIC_COMM_CMD_MSI_CTRL_REG_WR_BY_UP,
82
+ HINIC_COMM_CMD_MSI_CTRL_REG_RD_BY_UP,
83
+
84
+ HINIC_COMM_CMD_FAULT_REPORT = 0x37,
85
+
86
+ HINIC_COMM_CMD_SET_LED_STATUS = 0x4a,
87
+
88
+ HINIC_COMM_CMD_L2NIC_RESET = 0x4b,
89
+
90
+ HINIC_COMM_CMD_PAGESIZE_SET = 0x50,
91
+
92
+ HINIC_COMM_CMD_GET_BOARD_INFO = 0x52,
93
+
94
+ HINIC_COMM_CMD_WATCHDOG_INFO = 0x56,
95
+
96
+ HINIC_MGMT_CMD_SET_VF_RANDOM_ID = 0x61,
97
+
98
+ HINIC_COMM_CMD_MAX,
8799 };
88100
89101 enum hinic_mgmt_cb_state {
....@@ -116,10 +128,11 @@
116128
117129 struct hinic_pf_to_mgmt {
118130 struct hinic_hwif *hwif;
119
-
131
+ struct hinic_hwdev *hwdev;
120132 struct semaphore sync_msg_lock;
121133 u16 sync_msg_id;
122134 u8 *sync_msg_buf;
135
+ void *mgmt_ack_buf;
123136
124137 struct hinic_recv_msg recv_resp_msg_from_mgmt;
125138 struct hinic_recv_msg recv_msg_from_mgmt;
....@@ -127,6 +140,21 @@
127140 struct hinic_api_cmd_chain *cmd_chain[HINIC_API_CMD_MAX];
128141
129142 struct hinic_mgmt_cb mgmt_cb[HINIC_MOD_MAX];
143
+
144
+ struct workqueue_struct *workq;
145
+};
146
+
147
+struct hinic_mgmt_msg_handle_work {
148
+ struct work_struct work;
149
+ struct hinic_pf_to_mgmt *pf_to_mgmt;
150
+
151
+ void *msg;
152
+ u16 msg_len;
153
+
154
+ enum hinic_mod_type mod;
155
+ u8 cmd;
156
+ u16 msg_id;
157
+ int async_mgmt_to_pf;
130158 };
131159
132160 void hinic_register_mgmt_msg_cb(struct hinic_pf_to_mgmt *pf_to_mgmt,