hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/net/ethernet/huawei/hinic/hinic_hw_io.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_IO_H
....@@ -29,6 +20,8 @@
2920
3021 #define HINIC_DB_PAGE_SIZE SZ_4K
3122 #define HINIC_DB_SIZE SZ_4M
23
+#define HINIC_HW_WQ_PAGE_SIZE SZ_4K
24
+#define HINIC_DEFAULT_WQ_PAGE_SIZE SZ_256K
3225
3326 #define HINIC_DB_MAX_AREAS (HINIC_DB_SIZE / HINIC_DB_PAGE_SIZE)
3427
....@@ -54,9 +47,19 @@
5447 struct semaphore idx_lock;
5548 };
5649
50
+struct hinic_nic_cfg {
51
+ /* lock for getting nic cfg */
52
+ struct mutex cfg_mutex;
53
+ bool pause_set;
54
+ u32 auto_neg;
55
+ u32 rx_pause;
56
+ u32 tx_pause;
57
+};
58
+
5759 struct hinic_func_to_io {
5860 struct hinic_hwif *hwif;
59
-
61
+ struct hinic_hwdev *hwdev;
62
+ u16 global_qpn;
6063 struct hinic_ceqs ceqs;
6164
6265 struct hinic_wqs wqs;
....@@ -66,6 +69,9 @@
6669
6770 struct hinic_qp *qps;
6871 u16 max_qps;
72
+
73
+ u16 sq_depth;
74
+ u16 rq_depth;
6975
7076 void __iomem **sq_db;
7177 void __iomem *db_base;
....@@ -78,8 +84,28 @@
7884 void __iomem *cmdq_db_area[HINIC_MAX_CMDQ_TYPES];
7985
8086 struct hinic_cmdqs cmdqs;
87
+
88
+ u16 max_vfs;
89
+ struct vf_data_storage *vf_infos;
90
+ u8 link_status;
91
+ struct hinic_nic_cfg nic_cfg;
8192 };
8293
94
+struct hinic_wq_page_size {
95
+ u8 status;
96
+ u8 version;
97
+ u8 rsvd0[6];
98
+
99
+ u16 func_idx;
100
+ u8 ppf_idx;
101
+ u8 page_size;
102
+
103
+ u32 rsvd1;
104
+};
105
+
106
+int hinic_set_wq_page_size(struct hinic_hwdev *hwdev, u16 func_idx,
107
+ u32 page_size);
108
+
83109 int hinic_io_create_qps(struct hinic_func_to_io *func_to_io,
84110 u16 base_qpn, int num_qps,
85111 struct msix_entry *sq_msix_entries,