0001
0002
0003
0004 #ifndef _QED_FCOE_IF_H
0005 #define _QED_FCOE_IF_H
0006 #include <linux/types.h>
0007 #include <linux/qed/qed_if.h>
0008 struct qed_fcoe_stats {
0009 u64 fcoe_rx_byte_cnt;
0010 u64 fcoe_rx_data_pkt_cnt;
0011 u64 fcoe_rx_xfer_pkt_cnt;
0012 u64 fcoe_rx_other_pkt_cnt;
0013 u32 fcoe_silent_drop_pkt_cmdq_full_cnt;
0014 u32 fcoe_silent_drop_pkt_rq_full_cnt;
0015 u32 fcoe_silent_drop_pkt_crc_error_cnt;
0016 u32 fcoe_silent_drop_pkt_task_invalid_cnt;
0017 u32 fcoe_silent_drop_total_pkt_cnt;
0018
0019 u64 fcoe_tx_byte_cnt;
0020 u64 fcoe_tx_data_pkt_cnt;
0021 u64 fcoe_tx_xfer_pkt_cnt;
0022 u64 fcoe_tx_other_pkt_cnt;
0023 };
0024
0025 struct qed_dev_fcoe_info {
0026 struct qed_dev_info common;
0027
0028 void __iomem *primary_dbq_rq_addr;
0029 void __iomem *secondary_bdq_rq_addr;
0030
0031 u64 wwpn;
0032 u64 wwnn;
0033
0034 u8 num_cqs;
0035 };
0036
0037 struct qed_fcoe_params_offload {
0038 dma_addr_t sq_pbl_addr;
0039 dma_addr_t sq_curr_page_addr;
0040 dma_addr_t sq_next_page_addr;
0041
0042 u8 src_mac[ETH_ALEN];
0043 u8 dst_mac[ETH_ALEN];
0044
0045 u16 tx_max_fc_pay_len;
0046 u16 e_d_tov_timer_val;
0047 u16 rec_tov_timer_val;
0048 u16 rx_max_fc_pay_len;
0049 u16 vlan_tag;
0050
0051 struct fc_addr_nw s_id;
0052 u8 max_conc_seqs_c3;
0053 struct fc_addr_nw d_id;
0054 u8 flags;
0055 u8 def_q_idx;
0056 };
0057
0058 #define MAX_TID_BLOCKS_FCOE (512)
0059 struct qed_fcoe_tid {
0060 u32 size;
0061 u32 num_tids_per_block;
0062 u8 *blocks[MAX_TID_BLOCKS_FCOE];
0063 };
0064
0065 struct qed_fcoe_cb_ops {
0066 struct qed_common_cb_ops common;
0067 u32 (*get_login_failures)(void *cookie);
0068 };
0069
0070 void qed_fcoe_set_pf_params(struct qed_dev *cdev,
0071 struct qed_fcoe_pf_params *params);
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120
0121 struct qed_fcoe_ops {
0122 const struct qed_common_ops *common;
0123
0124 int (*fill_dev_info)(struct qed_dev *cdev,
0125 struct qed_dev_fcoe_info *info);
0126
0127 void (*register_ops)(struct qed_dev *cdev,
0128 struct qed_fcoe_cb_ops *ops, void *cookie);
0129
0130 const struct qed_ll2_ops *ll2;
0131
0132 int (*start)(struct qed_dev *cdev, struct qed_fcoe_tid *tasks);
0133
0134 int (*stop)(struct qed_dev *cdev);
0135
0136 int (*acquire_conn)(struct qed_dev *cdev,
0137 u32 *handle,
0138 u32 *fw_cid, void __iomem **p_doorbell);
0139
0140 int (*release_conn)(struct qed_dev *cdev, u32 handle);
0141
0142 int (*offload_conn)(struct qed_dev *cdev,
0143 u32 handle,
0144 struct qed_fcoe_params_offload *conn_info);
0145 int (*destroy_conn)(struct qed_dev *cdev,
0146 u32 handle, dma_addr_t terminate_params);
0147
0148 int (*get_stats)(struct qed_dev *cdev, struct qed_fcoe_stats *stats);
0149 };
0150
0151 const struct qed_fcoe_ops *qed_get_fcoe_ops(void);
0152 void qed_put_fcoe_ops(void);
0153 #endif