1#ifndef _QED_FCOE_IF_H
2#define _QED_FCOE_IF_H
3#include <linux/types.h>
4#include <linux/qed/qed_if.h>
5struct qed_fcoe_stats {
6 u64 fcoe_rx_byte_cnt;
7 u64 fcoe_rx_data_pkt_cnt;
8 u64 fcoe_rx_xfer_pkt_cnt;
9 u64 fcoe_rx_other_pkt_cnt;
10 u32 fcoe_silent_drop_pkt_cmdq_full_cnt;
11 u32 fcoe_silent_drop_pkt_rq_full_cnt;
12 u32 fcoe_silent_drop_pkt_crc_error_cnt;
13 u32 fcoe_silent_drop_pkt_task_invalid_cnt;
14 u32 fcoe_silent_drop_total_pkt_cnt;
15
16 u64 fcoe_tx_byte_cnt;
17 u64 fcoe_tx_data_pkt_cnt;
18 u64 fcoe_tx_xfer_pkt_cnt;
19 u64 fcoe_tx_other_pkt_cnt;
20};
21
22struct qed_dev_fcoe_info {
23 struct qed_dev_info common;
24
25 void __iomem *primary_dbq_rq_addr;
26 void __iomem *secondary_bdq_rq_addr;
27
28 u64 wwpn;
29 u64 wwnn;
30
31 u8 num_cqs;
32};
33
34struct qed_fcoe_params_offload {
35 dma_addr_t sq_pbl_addr;
36 dma_addr_t sq_curr_page_addr;
37 dma_addr_t sq_next_page_addr;
38
39 u8 src_mac[ETH_ALEN];
40 u8 dst_mac[ETH_ALEN];
41
42 u16 tx_max_fc_pay_len;
43 u16 e_d_tov_timer_val;
44 u16 rec_tov_timer_val;
45 u16 rx_max_fc_pay_len;
46 u16 vlan_tag;
47
48 struct fc_addr_nw s_id;
49 u8 max_conc_seqs_c3;
50 struct fc_addr_nw d_id;
51 u8 flags;
52 u8 def_q_idx;
53};
54
55#define MAX_TID_BLOCKS_FCOE (512)
56struct qed_fcoe_tid {
57 u32 size;
58 u32 num_tids_per_block;
59 u8 *blocks[MAX_TID_BLOCKS_FCOE];
60};
61
62struct qed_fcoe_cb_ops {
63 struct qed_common_cb_ops common;
64 u32 (*get_login_failures)(void *cookie);
65};
66
67void qed_fcoe_set_pf_params(struct qed_dev *cdev,
68 struct qed_fcoe_pf_params *params);
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118struct qed_fcoe_ops {
119 const struct qed_common_ops *common;
120
121 int (*fill_dev_info)(struct qed_dev *cdev,
122 struct qed_dev_fcoe_info *info);
123
124 void (*register_ops)(struct qed_dev *cdev,
125 struct qed_fcoe_cb_ops *ops, void *cookie);
126
127 const struct qed_ll2_ops *ll2;
128
129 int (*start)(struct qed_dev *cdev, struct qed_fcoe_tid *tasks);
130
131 int (*stop)(struct qed_dev *cdev);
132
133 int (*acquire_conn)(struct qed_dev *cdev,
134 u32 *handle,
135 u32 *fw_cid, void __iomem **p_doorbell);
136
137 int (*release_conn)(struct qed_dev *cdev, u32 handle);
138
139 int (*offload_conn)(struct qed_dev *cdev,
140 u32 handle,
141 struct qed_fcoe_params_offload *conn_info);
142 int (*destroy_conn)(struct qed_dev *cdev,
143 u32 handle, dma_addr_t terminate_params);
144
145 int (*get_stats)(struct qed_dev *cdev, struct qed_fcoe_stats *stats);
146};
147
148const struct qed_fcoe_ops *qed_get_fcoe_ops(void);
149void qed_put_fcoe_ops(void);
150#endif
151