qed.h (27fd38c5226ed0f1712d071880fa8e739eb78650) qed.h (39651abd28146fff2bfac63d68a7a56250a4aead)
1/* QLogic qed NIC Driver
2 * Copyright (c) 2015 QLogic Corporation
3 *
4 * This software is available under the terms of the GNU General Public License
5 * (GPL) Version 2, available from the file COPYING in the main directory of
6 * this source tree.
7 */
8

--- 12 unchanged lines hidden (view full) ---

21#include <linux/string.h>
22#include <linux/workqueue.h>
23#include <linux/zlib.h>
24#include <linux/hashtable.h>
25#include <linux/qed/qed_if.h>
26#include "qed_hsi.h"
27
28extern const struct qed_common_ops qed_common_ops_pass;
1/* QLogic qed NIC Driver
2 * Copyright (c) 2015 QLogic Corporation
3 *
4 * This software is available under the terms of the GNU General Public License
5 * (GPL) Version 2, available from the file COPYING in the main directory of
6 * this source tree.
7 */
8

--- 12 unchanged lines hidden (view full) ---

21#include <linux/string.h>
22#include <linux/workqueue.h>
23#include <linux/zlib.h>
24#include <linux/hashtable.h>
25#include <linux/qed/qed_if.h>
26#include "qed_hsi.h"
27
28extern const struct qed_common_ops qed_common_ops_pass;
29#define DRV_MODULE_VERSION "8.7.0.0"
29#define DRV_MODULE_VERSION "8.7.1.20"
30
31#define MAX_HWFNS_PER_DEVICE (4)
32#define NAME_SIZE 16
33#define VER_SIZE 16
34
30
31#define MAX_HWFNS_PER_DEVICE (4)
32#define NAME_SIZE 16
33#define VER_SIZE 16
34
35#define QED_WFQ_UNIT 100
36
35/* cau states */
36enum qed_coalescing_mode {
37 QED_COAL_MODE_DISABLE,
38 QED_COAL_MODE_ENABLE
39};
40
41struct qed_eth_cb_ops;
42struct qed_dev_info;

--- 26 unchanged lines hidden (view full) ---

69struct qed_sb_sp_info;
70struct qed_mcp_info;
71
72struct qed_rt_data {
73 u32 *init_val;
74 bool *b_valid;
75};
76
37/* cau states */
38enum qed_coalescing_mode {
39 QED_COAL_MODE_DISABLE,
40 QED_COAL_MODE_ENABLE
41};
42
43struct qed_eth_cb_ops;
44struct qed_dev_info;

--- 26 unchanged lines hidden (view full) ---

71struct qed_sb_sp_info;
72struct qed_mcp_info;
73
74struct qed_rt_data {
75 u32 *init_val;
76 bool *b_valid;
77};
78
79enum qed_tunn_mode {
80 QED_MODE_L2GENEVE_TUNN,
81 QED_MODE_IPGENEVE_TUNN,
82 QED_MODE_L2GRE_TUNN,
83 QED_MODE_IPGRE_TUNN,
84 QED_MODE_VXLAN_TUNN,
85};
86
87enum qed_tunn_clss {
88 QED_TUNN_CLSS_MAC_VLAN,
89 QED_TUNN_CLSS_MAC_VNI,
90 QED_TUNN_CLSS_INNER_MAC_VLAN,
91 QED_TUNN_CLSS_INNER_MAC_VNI,
92 MAX_QED_TUNN_CLSS,
93};
94
95struct qed_tunn_start_params {
96 unsigned long tunn_mode;
97 u16 vxlan_udp_port;
98 u16 geneve_udp_port;
99 u8 update_vxlan_udp_port;
100 u8 update_geneve_udp_port;
101 u8 tunn_clss_vxlan;
102 u8 tunn_clss_l2geneve;
103 u8 tunn_clss_ipgeneve;
104 u8 tunn_clss_l2gre;
105 u8 tunn_clss_ipgre;
106};
107
108struct qed_tunn_update_params {
109 unsigned long tunn_mode_update_mask;
110 unsigned long tunn_mode;
111 u16 vxlan_udp_port;
112 u16 geneve_udp_port;
113 u8 update_rx_pf_clss;
114 u8 update_tx_pf_clss;
115 u8 update_vxlan_udp_port;
116 u8 update_geneve_udp_port;
117 u8 tunn_clss_vxlan;
118 u8 tunn_clss_l2geneve;
119 u8 tunn_clss_ipgeneve;
120 u8 tunn_clss_l2gre;
121 u8 tunn_clss_ipgre;
122};
123
77/* The PCI personality is not quite synonymous to protocol ID:
78 * 1. All personalities need CORE connections
79 * 2. The Ethernet personality may support also the RoCE protocol
80 */
81enum qed_pci_personality {
82 QED_PCI_ETH,
83 QED_PCI_DEFAULT /* default in shmem */
84};

--- 15 unchanged lines hidden (view full) ---

100 QED_MAC,
101 QED_VLAN,
102 QED_ILT,
103 QED_MAX_RESC,
104};
105
106enum QED_FEATURE {
107 QED_PF_L2_QUE,
124/* The PCI personality is not quite synonymous to protocol ID:
125 * 1. All personalities need CORE connections
126 * 2. The Ethernet personality may support also the RoCE protocol
127 */
128enum qed_pci_personality {
129 QED_PCI_ETH,
130 QED_PCI_DEFAULT /* default in shmem */
131};

--- 15 unchanged lines hidden (view full) ---

147 QED_MAC,
148 QED_VLAN,
149 QED_ILT,
150 QED_MAX_RESC,
151};
152
153enum QED_FEATURE {
154 QED_PF_L2_QUE,
155 QED_VF,
108 QED_MAX_FEATURES,
109};
110
111enum QED_PORT_MODE {
112 QED_PORT_MODE_DE_2X40G,
113 QED_PORT_MODE_DE_2X50G,
114 QED_PORT_MODE_DE_1X100G,
115 QED_PORT_MODE_DE_4X10G_F,

--- 71 unchanged lines hidden (view full) ---

187 * memcpy'd to/from the virtual address
188 */
189 u32 *p_intermediate_buffer;
190
191 dma_addr_t dmae_cmd_phys_addr;
192 struct dmae_cmd *p_dmae_cmd;
193};
194
156 QED_MAX_FEATURES,
157};
158
159enum QED_PORT_MODE {
160 QED_PORT_MODE_DE_2X40G,
161 QED_PORT_MODE_DE_2X50G,
162 QED_PORT_MODE_DE_1X100G,
163 QED_PORT_MODE_DE_4X10G_F,

--- 71 unchanged lines hidden (view full) ---

235 * memcpy'd to/from the virtual address
236 */
237 u32 *p_intermediate_buffer;
238
239 dma_addr_t dmae_cmd_phys_addr;
240 struct dmae_cmd *p_dmae_cmd;
241};
242
243struct qed_wfq_data {
244 /* when feature is configured for at least 1 vport */
245 u32 min_speed;
246 bool configured;
247};
248
195struct qed_qm_info {
196 struct init_qm_pq_params *qm_pq_params;
197 struct init_qm_vport_params *qm_vport_params;
198 struct init_qm_port_params *qm_port_params;
199 u16 start_pq;
200 u8 start_vport;
201 u8 pure_lb_pq;
202 u8 offload_pq;

--- 4 unchanged lines hidden (view full) ---

207 u8 num_vports;
208 u8 max_phys_tcs_per_port;
209 bool pf_rl_en;
210 bool pf_wfq_en;
211 bool vport_rl_en;
212 bool vport_wfq_en;
213 u8 pf_wfq;
214 u32 pf_rl;
249struct qed_qm_info {
250 struct init_qm_pq_params *qm_pq_params;
251 struct init_qm_vport_params *qm_vport_params;
252 struct init_qm_port_params *qm_port_params;
253 u16 start_pq;
254 u8 start_vport;
255 u8 pure_lb_pq;
256 u8 offload_pq;

--- 4 unchanged lines hidden (view full) ---

261 u8 num_vports;
262 u8 max_phys_tcs_per_port;
263 bool pf_rl_en;
264 bool pf_wfq_en;
265 bool vport_rl_en;
266 bool vport_wfq_en;
267 u8 pf_wfq;
268 u32 pf_rl;
269 struct qed_wfq_data *wfq_data;
215};
216
217struct storm_stats {
218 u32 address;
219 u32 len;
220};
221
222struct qed_storm_stats {

--- 28 unchanged lines hidden (view full) ---

251
252 u32 dp_module;
253 u8 dp_level;
254 char name[NAME_SIZE];
255
256 bool first_on_engine;
257 bool hw_init_done;
258
270};
271
272struct storm_stats {
273 u32 address;
274 u32 len;
275};
276
277struct qed_storm_stats {

--- 28 unchanged lines hidden (view full) ---

306
307 u32 dp_module;
308 u8 dp_level;
309 char name[NAME_SIZE];
310
311 bool first_on_engine;
312 bool hw_init_done;
313
314 u8 num_funcs_on_engine;
315
259 /* BAR access */
260 void __iomem *regview;
261 void __iomem *doorbells;
262 u64 db_phys_addr;
263 unsigned long db_size;
264
265 /* PTT pool */
266 struct qed_ptt_pool *p_ptt_pool;

--- 34 unchanged lines hidden (view full) ---

301
302 /* Flag indicating whether interrupts are enabled or not*/
303 bool b_int_enabled;
304 bool b_int_requested;
305
306 /* True if the driver requests for the link */
307 bool b_drv_link_init;
308
316 /* BAR access */
317 void __iomem *regview;
318 void __iomem *doorbells;
319 u64 db_phys_addr;
320 unsigned long db_size;
321
322 /* PTT pool */
323 struct qed_ptt_pool *p_ptt_pool;

--- 34 unchanged lines hidden (view full) ---

358
359 /* Flag indicating whether interrupts are enabled or not*/
360 bool b_int_enabled;
361 bool b_int_requested;
362
363 /* True if the driver requests for the link */
364 bool b_drv_link_init;
365
366 struct qed_vf_iov *vf_iov_info;
367 struct qed_pf_iov *pf_iov_info;
309 struct qed_mcp_info *mcp_info;
310
368 struct qed_mcp_info *mcp_info;
369
370 struct qed_dcbx_info *p_dcbx_info;
371
311 struct qed_hw_cid_data *p_tx_cids;
312 struct qed_hw_cid_data *p_rx_cids;
313
314 struct qed_dmae_info dmae_info;
315
316 /* QM init */
317 struct qed_qm_info qm_info;
318 struct qed_storm_stats storm_stats;
319
320 /* Buffer for unzipping firmware data */
321 void *unzip_buf;
322
323 struct qed_simd_fp_handler simd_proto_handler[64];
324
372 struct qed_hw_cid_data *p_tx_cids;
373 struct qed_hw_cid_data *p_rx_cids;
374
375 struct qed_dmae_info dmae_info;
376
377 /* QM init */
378 struct qed_qm_info qm_info;
379 struct qed_storm_stats storm_stats;
380
381 /* Buffer for unzipping firmware data */
382 void *unzip_buf;
383
384 struct qed_simd_fp_handler simd_proto_handler[64];
385
386#ifdef CONFIG_QED_SRIOV
387 struct workqueue_struct *iov_wq;
388 struct delayed_work iov_task;
389 unsigned long iov_task_flags;
390#endif
391
325 struct z_stream_s *stream;
326};
327
328struct pci_params {
329 int pm_cap;
330
331 unsigned long mem_start;
332 unsigned long mem_end;

--- 92 unchanged lines hidden (view full) ---

425 /* Init */
426 const struct iro *iro_arr;
427#define IRO (p_hwfn->cdev->iro_arr)
428
429 /* HW functions */
430 u8 num_hwfns;
431 struct qed_hwfn hwfns[MAX_HWFNS_PER_DEVICE];
432
392 struct z_stream_s *stream;
393};
394
395struct pci_params {
396 int pm_cap;
397
398 unsigned long mem_start;
399 unsigned long mem_end;

--- 92 unchanged lines hidden (view full) ---

492 /* Init */
493 const struct iro *iro_arr;
494#define IRO (p_hwfn->cdev->iro_arr)
495
496 /* HW functions */
497 u8 num_hwfns;
498 struct qed_hwfn hwfns[MAX_HWFNS_PER_DEVICE];
499
500 /* SRIOV */
501 struct qed_hw_sriov_info *p_iov_info;
502#define IS_QED_SRIOV(cdev) (!!(cdev)->p_iov_info)
503
504 unsigned long tunn_mode;
505
506 bool b_is_vf;
433 u32 drv_type;
434
435 struct qed_eth_stats *reset_stats;
436 struct qed_fw_data *fw_data;
437
438 u32 mcp_nvm_resp;
439
440 /* Linux specific here */

--- 13 unchanged lines hidden (view full) ---

454 struct qed_common_cb_ops *common;
455 struct qed_eth_cb_ops *eth;
456 } protocol_ops;
457 void *ops_cookie;
458
459 const struct firmware *firmware;
460};
461
507 u32 drv_type;
508
509 struct qed_eth_stats *reset_stats;
510 struct qed_fw_data *fw_data;
511
512 u32 mcp_nvm_resp;
513
514 /* Linux specific here */

--- 13 unchanged lines hidden (view full) ---

528 struct qed_common_cb_ops *common;
529 struct qed_eth_cb_ops *eth;
530 } protocol_ops;
531 void *ops_cookie;
532
533 const struct firmware *firmware;
534};
535
536#define NUM_OF_VFS(dev) MAX_NUM_VFS_BB
537#define NUM_OF_L2_QUEUES(dev) MAX_NUM_L2_QUEUES_BB
462#define NUM_OF_SBS(dev) MAX_SB_PER_PATH_BB
463#define NUM_OF_ENG_PFS(dev) MAX_NUM_PFS_BB
464
465/**
466 * @brief qed_concrete_to_sw_fid - get the sw function id from
467 * the concrete value.
468 *
469 * @param concrete_fid

--- 5 unchanged lines hidden (view full) ---

475{
476 u8 pfid = GET_FIELD(concrete_fid, PXP_CONCRETE_FID_PFID);
477
478 return pfid;
479}
480
481#define PURE_LB_TC 8
482
538#define NUM_OF_SBS(dev) MAX_SB_PER_PATH_BB
539#define NUM_OF_ENG_PFS(dev) MAX_NUM_PFS_BB
540
541/**
542 * @brief qed_concrete_to_sw_fid - get the sw function id from
543 * the concrete value.
544 *
545 * @param concrete_fid

--- 5 unchanged lines hidden (view full) ---

551{
552 u8 pfid = GET_FIELD(concrete_fid, PXP_CONCRETE_FID_PFID);
553
554 return pfid;
555}
556
557#define PURE_LB_TC 8
558
559int qed_configure_vport_wfq(struct qed_dev *cdev, u16 vp_id, u32 rate);
560void qed_configure_vp_wfq_on_link_change(struct qed_dev *cdev, u32 min_pf_rate);
561
562void qed_clean_wfq_db(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt);
483#define QED_LEADING_HWFN(dev) (&dev->hwfns[0])
484
485/* Other Linux specific common definitions */
486#define DP_NAME(cdev) ((cdev)->name)
487
488#define REG_ADDR(cdev, offset) (void __iomem *)((u8 __iomem *)\
489 (cdev->regview) + \
490 (offset))

--- 11 unchanged lines hidden (view full) ---

502 struct qed_dev_info *dev_info);
503void qed_link_update(struct qed_hwfn *hwfn);
504u32 qed_unzip_data(struct qed_hwfn *p_hwfn,
505 u32 input_len, u8 *input_buf,
506 u32 max_size, u8 *unzip_buf);
507
508int qed_slowpath_irq_req(struct qed_hwfn *hwfn);
509
563#define QED_LEADING_HWFN(dev) (&dev->hwfns[0])
564
565/* Other Linux specific common definitions */
566#define DP_NAME(cdev) ((cdev)->name)
567
568#define REG_ADDR(cdev, offset) (void __iomem *)((u8 __iomem *)\
569 (cdev->regview) + \
570 (offset))

--- 11 unchanged lines hidden (view full) ---

582 struct qed_dev_info *dev_info);
583void qed_link_update(struct qed_hwfn *hwfn);
584u32 qed_unzip_data(struct qed_hwfn *p_hwfn,
585 u32 input_len, u8 *input_buf,
586 u32 max_size, u8 *unzip_buf);
587
588int qed_slowpath_irq_req(struct qed_hwfn *hwfn);
589
510#define QED_ETH_INTERFACE_VERSION 300
511
512#endif /* _QED_H */
590#endif /* _QED_H */