0001
0002
0003
0004
0005
0006 #ifndef _QED_VF_H
0007 #define _QED_VF_H
0008
0009 #include "qed_l2.h"
0010 #include "qed_mcp.h"
0011
0012 #define T_ETH_INDIRECTION_TABLE_SIZE 128
0013 #define T_ETH_RSS_KEY_SIZE 10
0014
0015 struct vf_pf_resc_request {
0016 u8 num_rxqs;
0017 u8 num_txqs;
0018 u8 num_sbs;
0019 u8 num_mac_filters;
0020 u8 num_vlan_filters;
0021 u8 num_mc_filters;
0022 u8 num_cids;
0023 u8 padding;
0024 };
0025
0026 struct hw_sb_info {
0027 u16 hw_sb_id;
0028 u8 sb_qid;
0029 u8 padding[5];
0030 };
0031
0032 #define TLV_BUFFER_SIZE 1024
0033
0034 enum {
0035 PFVF_STATUS_WAITING,
0036 PFVF_STATUS_SUCCESS,
0037 PFVF_STATUS_FAILURE,
0038 PFVF_STATUS_NOT_SUPPORTED,
0039 PFVF_STATUS_NO_RESOURCE,
0040 PFVF_STATUS_FORCED,
0041 PFVF_STATUS_MALICIOUS,
0042 };
0043
0044
0045
0046 struct channel_tlv {
0047 u16 type;
0048 u16 length;
0049 };
0050
0051
0052
0053
0054 struct vfpf_first_tlv {
0055 struct channel_tlv tl;
0056 u32 padding;
0057 u64 reply_address;
0058 };
0059
0060
0061 struct pfvf_tlv {
0062 struct channel_tlv tl;
0063 u8 status;
0064 u8 padding[3];
0065 };
0066
0067
0068 struct pfvf_def_resp_tlv {
0069 struct pfvf_tlv hdr;
0070 };
0071
0072
0073 struct channel_list_end_tlv {
0074 struct channel_tlv tl;
0075 u8 padding[4];
0076 };
0077
0078 #define VFPF_ACQUIRE_OS_LINUX (0)
0079 #define VFPF_ACQUIRE_OS_WINDOWS (1)
0080 #define VFPF_ACQUIRE_OS_ESX (2)
0081 #define VFPF_ACQUIRE_OS_SOLARIS (3)
0082 #define VFPF_ACQUIRE_OS_LINUX_USERSPACE (4)
0083
0084 struct vfpf_acquire_tlv {
0085 struct vfpf_first_tlv first_tlv;
0086
0087 struct vf_pf_vfdev_info {
0088 #define VFPF_ACQUIRE_CAP_PRE_FP_HSI BIT(0)
0089 #define VFPF_ACQUIRE_CAP_100G BIT(1)
0090
0091
0092
0093
0094 #define VFPF_ACQUIRE_CAP_QUEUE_QIDS BIT(2)
0095
0096
0097
0098
0099
0100 #define VFPF_ACQUIRE_CAP_PHYSICAL_BAR BIT(3)
0101 u64 capabilities;
0102 u8 fw_major;
0103 u8 fw_minor;
0104 u8 fw_revision;
0105 u8 fw_engineering;
0106 u32 driver_version;
0107 u16 opaque_fid;
0108 u8 os_type;
0109 u8 eth_fp_hsi_major;
0110 u8 eth_fp_hsi_minor;
0111 u8 padding[3];
0112 } vfdev_info;
0113
0114 struct vf_pf_resc_request resc_request;
0115
0116 u64 bulletin_addr;
0117 u32 bulletin_size;
0118 u32 padding;
0119 };
0120
0121
0122 struct vfpf_vport_update_rss_tlv {
0123 struct channel_tlv tl;
0124
0125 u8 update_rss_flags;
0126 #define VFPF_UPDATE_RSS_CONFIG_FLAG BIT(0)
0127 #define VFPF_UPDATE_RSS_CAPS_FLAG BIT(1)
0128 #define VFPF_UPDATE_RSS_IND_TABLE_FLAG BIT(2)
0129 #define VFPF_UPDATE_RSS_KEY_FLAG BIT(3)
0130
0131 u8 rss_enable;
0132 u8 rss_caps;
0133 u8 rss_table_size_log;
0134 u16 rss_ind_table[T_ETH_INDIRECTION_TABLE_SIZE];
0135 u32 rss_key[T_ETH_RSS_KEY_SIZE];
0136 };
0137
0138 struct pfvf_storm_stats {
0139 u32 address;
0140 u32 len;
0141 };
0142
0143 struct pfvf_stats_info {
0144 struct pfvf_storm_stats mstats;
0145 struct pfvf_storm_stats pstats;
0146 struct pfvf_storm_stats tstats;
0147 struct pfvf_storm_stats ustats;
0148 };
0149
0150 struct pfvf_acquire_resp_tlv {
0151 struct pfvf_tlv hdr;
0152
0153 struct pf_vf_pfdev_info {
0154 u32 chip_num;
0155 u32 mfw_ver;
0156
0157 u16 fw_major;
0158 u16 fw_minor;
0159 u16 fw_rev;
0160 u16 fw_eng;
0161
0162 u64 capabilities;
0163 #define PFVF_ACQUIRE_CAP_DEFAULT_UNTAGGED BIT(0)
0164 #define PFVF_ACQUIRE_CAP_100G BIT(1)
0165
0166
0167
0168
0169
0170
0171 #define PFVF_ACQUIRE_CAP_POST_FW_OVERRIDE BIT(2)
0172
0173
0174 #define PFVF_ACQUIRE_CAP_QUEUE_QIDS BIT(3)
0175
0176 u16 db_size;
0177 u8 indices_per_sb;
0178 u8 os_type;
0179
0180
0181 u16 chip_rev;
0182 u8 dev_type;
0183
0184
0185 u8 bar_size;
0186
0187 struct pfvf_stats_info stats_info;
0188
0189 u8 port_mac[ETH_ALEN];
0190
0191
0192
0193
0194
0195
0196 u8 major_fp_hsi;
0197 u8 minor_fp_hsi;
0198 } pfdev_info;
0199
0200 struct pf_vf_resc {
0201 #define PFVF_MAX_QUEUES_PER_VF 16
0202 #define PFVF_MAX_SBS_PER_VF 16
0203 struct hw_sb_info hw_sbs[PFVF_MAX_SBS_PER_VF];
0204 u8 hw_qid[PFVF_MAX_QUEUES_PER_VF];
0205 u8 cid[PFVF_MAX_QUEUES_PER_VF];
0206
0207 u8 num_rxqs;
0208 u8 num_txqs;
0209 u8 num_sbs;
0210 u8 num_mac_filters;
0211 u8 num_vlan_filters;
0212 u8 num_mc_filters;
0213 u8 num_cids;
0214 u8 padding;
0215 } resc;
0216
0217 u32 bulletin_size;
0218 u32 padding;
0219 };
0220
0221 struct pfvf_start_queue_resp_tlv {
0222 struct pfvf_tlv hdr;
0223 u32 offset;
0224 u8 padding[4];
0225 };
0226
0227
0228
0229
0230
0231 struct vfpf_qid_tlv {
0232 struct channel_tlv tl;
0233 u8 qid;
0234 u8 padding[3];
0235 };
0236
0237
0238 struct vfpf_start_rxq_tlv {
0239 struct vfpf_first_tlv first_tlv;
0240
0241
0242 u64 rxq_addr;
0243 u64 deprecated_sge_addr;
0244 u64 cqe_pbl_addr;
0245
0246 u16 cqe_pbl_size;
0247 u16 hw_sb;
0248 u16 rx_qid;
0249 u16 hc_rate;
0250
0251 u16 bd_max_bytes;
0252 u16 stat_id;
0253 u8 sb_index;
0254 u8 padding[3];
0255 };
0256
0257 struct vfpf_start_txq_tlv {
0258 struct vfpf_first_tlv first_tlv;
0259
0260
0261 u64 pbl_addr;
0262 u16 pbl_size;
0263 u16 stat_id;
0264 u16 tx_qid;
0265 u16 hw_sb;
0266
0267 u32 flags;
0268 u16 hc_rate;
0269 u8 sb_index;
0270 u8 padding[3];
0271 };
0272
0273
0274 struct vfpf_stop_rxqs_tlv {
0275 struct vfpf_first_tlv first_tlv;
0276
0277 u16 rx_qid;
0278
0279
0280 u8 num_rxqs;
0281 u8 cqe_completion;
0282 u8 padding[4];
0283 };
0284
0285
0286 struct vfpf_stop_txqs_tlv {
0287 struct vfpf_first_tlv first_tlv;
0288
0289 u16 tx_qid;
0290
0291
0292 u8 num_txqs;
0293 u8 padding[5];
0294 };
0295
0296 struct vfpf_update_rxq_tlv {
0297 struct vfpf_first_tlv first_tlv;
0298
0299 u64 deprecated_sge_addr[PFVF_MAX_QUEUES_PER_VF];
0300
0301 u16 rx_qid;
0302 u8 num_rxqs;
0303 u8 flags;
0304 #define VFPF_RXQ_UPD_INIT_SGE_DEPRECATE_FLAG BIT(0)
0305 #define VFPF_RXQ_UPD_COMPLETE_CQE_FLAG BIT(1)
0306 #define VFPF_RXQ_UPD_COMPLETE_EVENT_FLAG BIT(2)
0307
0308 u8 padding[4];
0309 };
0310
0311
0312 struct vfpf_q_mac_vlan_filter {
0313 u32 flags;
0314 #define VFPF_Q_FILTER_DEST_MAC_VALID 0x01
0315 #define VFPF_Q_FILTER_VLAN_TAG_VALID 0x02
0316 #define VFPF_Q_FILTER_SET_MAC 0x100
0317
0318 u8 mac[ETH_ALEN];
0319 u16 vlan_tag;
0320
0321 u8 padding[4];
0322 };
0323
0324
0325 struct vfpf_vport_start_tlv {
0326 struct vfpf_first_tlv first_tlv;
0327
0328 u64 sb_addr[PFVF_MAX_SBS_PER_VF];
0329
0330 u32 tpa_mode;
0331 u16 dep1;
0332 u16 mtu;
0333
0334 u8 vport_id;
0335 u8 inner_vlan_removal;
0336
0337 u8 only_untagged;
0338 u8 max_buffers_per_cqe;
0339
0340 u8 padding[4];
0341 };
0342
0343
0344 struct vfpf_vport_update_activate_tlv {
0345 struct channel_tlv tl;
0346 u8 update_rx;
0347 u8 update_tx;
0348 u8 active_rx;
0349 u8 active_tx;
0350 };
0351
0352 struct vfpf_vport_update_tx_switch_tlv {
0353 struct channel_tlv tl;
0354 u8 tx_switching;
0355 u8 padding[3];
0356 };
0357
0358 struct vfpf_vport_update_vlan_strip_tlv {
0359 struct channel_tlv tl;
0360 u8 remove_vlan;
0361 u8 padding[3];
0362 };
0363
0364 struct vfpf_vport_update_mcast_bin_tlv {
0365 struct channel_tlv tl;
0366 u8 padding[4];
0367
0368
0369
0370
0371
0372 u64 bins[4];
0373 u64 obsolete_bins[4];
0374 };
0375
0376 struct vfpf_vport_update_accept_param_tlv {
0377 struct channel_tlv tl;
0378 u8 update_rx_mode;
0379 u8 update_tx_mode;
0380 u8 rx_accept_filter;
0381 u8 tx_accept_filter;
0382 };
0383
0384 struct vfpf_vport_update_accept_any_vlan_tlv {
0385 struct channel_tlv tl;
0386 u8 update_accept_any_vlan_flg;
0387 u8 accept_any_vlan;
0388
0389 u8 padding[2];
0390 };
0391
0392 struct vfpf_vport_update_sge_tpa_tlv {
0393 struct channel_tlv tl;
0394
0395 u16 sge_tpa_flags;
0396 #define VFPF_TPA_IPV4_EN_FLAG BIT(0)
0397 #define VFPF_TPA_IPV6_EN_FLAG BIT(1)
0398 #define VFPF_TPA_PKT_SPLIT_FLAG BIT(2)
0399 #define VFPF_TPA_HDR_DATA_SPLIT_FLAG BIT(3)
0400 #define VFPF_TPA_GRO_CONSIST_FLAG BIT(4)
0401
0402 u8 update_sge_tpa_flags;
0403 #define VFPF_UPDATE_SGE_DEPRECATED_FLAG BIT(0)
0404 #define VFPF_UPDATE_TPA_EN_FLAG BIT(1)
0405 #define VFPF_UPDATE_TPA_PARAM_FLAG BIT(2)
0406
0407 u8 max_buffers_per_cqe;
0408
0409 u16 deprecated_sge_buff_size;
0410 u16 tpa_max_size;
0411 u16 tpa_min_size_to_start;
0412 u16 tpa_min_size_to_cont;
0413
0414 u8 tpa_max_aggs_num;
0415 u8 padding[7];
0416 };
0417
0418
0419
0420
0421 struct vfpf_vport_update_tlv {
0422 struct vfpf_first_tlv first_tlv;
0423 };
0424
0425 struct vfpf_ucast_filter_tlv {
0426 struct vfpf_first_tlv first_tlv;
0427
0428 u8 opcode;
0429 u8 type;
0430
0431 u8 mac[ETH_ALEN];
0432
0433 u16 vlan;
0434 u16 padding[3];
0435 };
0436
0437
0438 struct vfpf_update_tunn_param_tlv {
0439 struct vfpf_first_tlv first_tlv;
0440
0441 u8 tun_mode_update_mask;
0442 u8 tunn_mode;
0443 u8 update_tun_cls;
0444 u8 vxlan_clss;
0445 u8 l2gre_clss;
0446 u8 ipgre_clss;
0447 u8 l2geneve_clss;
0448 u8 ipgeneve_clss;
0449 u8 update_geneve_port;
0450 u8 update_vxlan_port;
0451 u16 geneve_port;
0452 u16 vxlan_port;
0453 u8 padding[2];
0454 };
0455
0456 struct pfvf_update_tunn_param_tlv {
0457 struct pfvf_tlv hdr;
0458
0459 u16 tunn_feature_mask;
0460 u8 vxlan_mode;
0461 u8 l2geneve_mode;
0462 u8 ipgeneve_mode;
0463 u8 l2gre_mode;
0464 u8 ipgre_mode;
0465 u8 vxlan_clss;
0466 u8 l2gre_clss;
0467 u8 ipgre_clss;
0468 u8 l2geneve_clss;
0469 u8 ipgeneve_clss;
0470 u16 vxlan_udp_port;
0471 u16 geneve_udp_port;
0472 };
0473
0474 struct tlv_buffer_size {
0475 u8 tlv_buffer[TLV_BUFFER_SIZE];
0476 };
0477
0478 struct vfpf_update_coalesce {
0479 struct vfpf_first_tlv first_tlv;
0480 u16 rx_coal;
0481 u16 tx_coal;
0482 u16 qid;
0483 u8 padding[2];
0484 };
0485
0486 struct vfpf_read_coal_req_tlv {
0487 struct vfpf_first_tlv first_tlv;
0488 u16 qid;
0489 u8 is_rx;
0490 u8 padding[5];
0491 };
0492
0493 struct pfvf_read_coal_resp_tlv {
0494 struct pfvf_tlv hdr;
0495 u16 coal;
0496 u8 padding[6];
0497 };
0498
0499 struct vfpf_bulletin_update_mac_tlv {
0500 struct vfpf_first_tlv first_tlv;
0501 u8 mac[ETH_ALEN];
0502 u8 padding[2];
0503 };
0504
0505 union vfpf_tlvs {
0506 struct vfpf_first_tlv first_tlv;
0507 struct vfpf_acquire_tlv acquire;
0508 struct vfpf_start_rxq_tlv start_rxq;
0509 struct vfpf_start_txq_tlv start_txq;
0510 struct vfpf_stop_rxqs_tlv stop_rxqs;
0511 struct vfpf_stop_txqs_tlv stop_txqs;
0512 struct vfpf_update_rxq_tlv update_rxq;
0513 struct vfpf_vport_start_tlv start_vport;
0514 struct vfpf_vport_update_tlv vport_update;
0515 struct vfpf_ucast_filter_tlv ucast_filter;
0516 struct vfpf_update_tunn_param_tlv tunn_param_update;
0517 struct vfpf_update_coalesce update_coalesce;
0518 struct vfpf_read_coal_req_tlv read_coal_req;
0519 struct vfpf_bulletin_update_mac_tlv bulletin_update_mac;
0520 struct tlv_buffer_size tlv_buf_size;
0521 };
0522
0523 union pfvf_tlvs {
0524 struct pfvf_def_resp_tlv default_resp;
0525 struct pfvf_acquire_resp_tlv acquire_resp;
0526 struct tlv_buffer_size tlv_buf_size;
0527 struct pfvf_start_queue_resp_tlv queue_start;
0528 struct pfvf_update_tunn_param_tlv tunn_param_resp;
0529 struct pfvf_read_coal_resp_tlv read_coal_resp;
0530 };
0531
0532 enum qed_bulletin_bit {
0533
0534 MAC_ADDR_FORCED = 0,
0535
0536 VLAN_ADDR_FORCED = 2,
0537
0538
0539 VFPF_BULLETIN_UNTAGGED_DEFAULT = 3,
0540 VFPF_BULLETIN_UNTAGGED_DEFAULT_FORCED = 4,
0541
0542
0543
0544
0545 VFPF_BULLETIN_MAC_ADDR = 5
0546 };
0547
0548 struct qed_bulletin_content {
0549
0550 u32 crc;
0551
0552 u32 version;
0553
0554
0555 u64 valid_bitmap;
0556
0557
0558 u8 mac[ETH_ALEN];
0559
0560
0561 u8 default_only_untagged;
0562 u8 padding;
0563
0564
0565
0566
0567
0568
0569 u8 req_autoneg;
0570 u8 req_autoneg_pause;
0571 u8 req_forced_rx;
0572 u8 req_forced_tx;
0573 u8 padding2[4];
0574
0575 u32 req_adv_speed;
0576 u32 req_forced_speed;
0577 u32 req_loopback;
0578 u32 padding3;
0579
0580 u8 link_up;
0581 u8 full_duplex;
0582 u8 autoneg;
0583 u8 autoneg_complete;
0584 u8 parallel_detection;
0585 u8 pfc_enabled;
0586 u8 partner_tx_flow_ctrl_en;
0587 u8 partner_rx_flow_ctrl_en;
0588 u8 partner_adv_pause;
0589 u8 sfp_tx_fault;
0590 u16 vxlan_udp_port;
0591 u16 geneve_udp_port;
0592 u8 padding4[2];
0593
0594 u32 speed;
0595 u32 partner_adv_speed;
0596
0597 u32 capability_speed;
0598
0599
0600 u16 pvid;
0601 u16 padding5;
0602 };
0603
0604 struct qed_bulletin {
0605 dma_addr_t phys;
0606 struct qed_bulletin_content *p_virt;
0607 u32 size;
0608 };
0609
0610 enum {
0611 CHANNEL_TLV_NONE,
0612 CHANNEL_TLV_ACQUIRE,
0613 CHANNEL_TLV_VPORT_START,
0614 CHANNEL_TLV_VPORT_UPDATE,
0615 CHANNEL_TLV_VPORT_TEARDOWN,
0616 CHANNEL_TLV_START_RXQ,
0617 CHANNEL_TLV_START_TXQ,
0618 CHANNEL_TLV_STOP_RXQS,
0619 CHANNEL_TLV_STOP_TXQS,
0620 CHANNEL_TLV_UPDATE_RXQ,
0621 CHANNEL_TLV_INT_CLEANUP,
0622 CHANNEL_TLV_CLOSE,
0623 CHANNEL_TLV_RELEASE,
0624 CHANNEL_TLV_LIST_END,
0625 CHANNEL_TLV_UCAST_FILTER,
0626 CHANNEL_TLV_VPORT_UPDATE_ACTIVATE,
0627 CHANNEL_TLV_VPORT_UPDATE_TX_SWITCH,
0628 CHANNEL_TLV_VPORT_UPDATE_VLAN_STRIP,
0629 CHANNEL_TLV_VPORT_UPDATE_MCAST,
0630 CHANNEL_TLV_VPORT_UPDATE_ACCEPT_PARAM,
0631 CHANNEL_TLV_VPORT_UPDATE_RSS,
0632 CHANNEL_TLV_VPORT_UPDATE_ACCEPT_ANY_VLAN,
0633 CHANNEL_TLV_VPORT_UPDATE_SGE_TPA,
0634 CHANNEL_TLV_UPDATE_TUNN_PARAM,
0635 CHANNEL_TLV_COALESCE_UPDATE,
0636 CHANNEL_TLV_QID,
0637 CHANNEL_TLV_COALESCE_READ,
0638 CHANNEL_TLV_BULLETIN_UPDATE_MAC,
0639 CHANNEL_TLV_MAX,
0640
0641
0642
0643
0644 CHANNEL_TLV_VPORT_UPDATE_MAX = CHANNEL_TLV_VPORT_UPDATE_SGE_TPA + 1,
0645 };
0646
0647
0648
0649
0650 #define QED_ETH_VF_DEFAULT_NUM_CIDS (32)
0651 #define QED_ETH_VF_MAX_NUM_CIDS (250)
0652
0653
0654 struct qed_vf_iov {
0655 union vfpf_tlvs *vf2pf_request;
0656 dma_addr_t vf2pf_request_phys;
0657 union pfvf_tlvs *pf2vf_reply;
0658 dma_addr_t pf2vf_reply_phys;
0659
0660
0661 struct mutex mutex;
0662 u8 *offset;
0663
0664
0665 struct qed_bulletin bulletin;
0666 struct qed_bulletin_content bulletin_shadow;
0667
0668
0669 struct pfvf_acquire_resp_tlv acquire_resp;
0670
0671
0672
0673
0674 bool b_pre_fp_hsi;
0675
0676
0677
0678
0679
0680
0681
0682 struct qed_sb_info *sbs_info[PFVF_MAX_SBS_PER_VF];
0683
0684
0685
0686
0687 bool b_doorbell_bar;
0688 };
0689
0690
0691
0692
0693
0694
0695
0696
0697
0698
0699
0700
0701
0702
0703 int qed_vf_pf_set_coalesce(struct qed_hwfn *p_hwfn,
0704 u16 rx_coal,
0705 u16 tx_coal, struct qed_queue_cid *p_cid);
0706
0707
0708
0709
0710
0711
0712
0713
0714
0715
0716 int qed_vf_pf_get_coalesce(struct qed_hwfn *p_hwfn,
0717 u16 *p_coal, struct qed_queue_cid *p_cid);
0718
0719 #ifdef CONFIG_QED_SRIOV
0720
0721
0722
0723
0724
0725
0726
0727
0728 int qed_vf_read_bulletin(struct qed_hwfn *p_hwfn, u8 *p_change);
0729
0730
0731
0732
0733
0734
0735
0736
0737
0738 void qed_vf_get_link_params(struct qed_hwfn *p_hwfn,
0739 struct qed_mcp_link_params *params);
0740
0741
0742
0743
0744
0745
0746
0747
0748
0749 void qed_vf_get_link_state(struct qed_hwfn *p_hwfn,
0750 struct qed_mcp_link_state *link);
0751
0752
0753
0754
0755
0756
0757
0758
0759
0760 void qed_vf_get_link_caps(struct qed_hwfn *p_hwfn,
0761 struct qed_mcp_link_capabilities *p_link_caps);
0762
0763
0764
0765
0766
0767
0768
0769
0770
0771 void qed_vf_get_num_rxqs(struct qed_hwfn *p_hwfn, u8 *num_rxqs);
0772
0773
0774
0775
0776
0777
0778
0779
0780
0781 void qed_vf_get_num_txqs(struct qed_hwfn *p_hwfn, u8 *num_txqs);
0782
0783
0784
0785
0786
0787
0788
0789
0790
0791
0792 void qed_vf_get_num_cids(struct qed_hwfn *p_hwfn, u8 *num_cids);
0793
0794
0795
0796
0797
0798
0799
0800
0801
0802 void qed_vf_get_port_mac(struct qed_hwfn *p_hwfn, u8 *port_mac);
0803
0804
0805
0806
0807
0808
0809
0810
0811
0812
0813 void qed_vf_get_num_vlan_filters(struct qed_hwfn *p_hwfn,
0814 u8 *num_vlan_filters);
0815
0816
0817
0818
0819
0820
0821
0822
0823
0824
0825 void qed_vf_get_num_mac_filters(struct qed_hwfn *p_hwfn, u8 *num_mac_filters);
0826
0827
0828
0829
0830
0831
0832
0833
0834
0835 bool qed_vf_check_mac(struct qed_hwfn *p_hwfn, u8 *mac);
0836
0837
0838
0839
0840
0841
0842
0843
0844
0845
0846
0847
0848
0849 void qed_vf_get_fw_version(struct qed_hwfn *p_hwfn,
0850 u16 *fw_major, u16 *fw_minor,
0851 u16 *fw_rev, u16 *fw_eng);
0852
0853
0854
0855
0856
0857
0858
0859
0860 int qed_vf_hw_prepare(struct qed_hwfn *p_hwfn);
0861
0862
0863
0864
0865
0866
0867
0868
0869
0870
0871
0872
0873
0874
0875 int qed_vf_pf_rxq_start(struct qed_hwfn *p_hwfn,
0876 struct qed_queue_cid *p_cid,
0877 u16 bd_max_bytes,
0878 dma_addr_t bd_chain_phys_addr,
0879 dma_addr_t cqe_pbl_addr,
0880 u16 cqe_pbl_size, void __iomem **pp_prod);
0881
0882
0883
0884
0885
0886
0887
0888
0889
0890
0891
0892
0893
0894 int
0895 qed_vf_pf_txq_start(struct qed_hwfn *p_hwfn,
0896 struct qed_queue_cid *p_cid,
0897 dma_addr_t pbl_addr,
0898 u16 pbl_size, void __iomem **pp_doorbell);
0899
0900
0901
0902
0903
0904
0905
0906
0907
0908
0909 int qed_vf_pf_rxq_stop(struct qed_hwfn *p_hwfn,
0910 struct qed_queue_cid *p_cid, bool cqe_completion);
0911
0912
0913
0914
0915
0916
0917
0918
0919
0920 int qed_vf_pf_txq_stop(struct qed_hwfn *p_hwfn, struct qed_queue_cid *p_cid);
0921
0922
0923
0924
0925
0926
0927
0928
0929
0930 int qed_vf_pf_vport_update(struct qed_hwfn *p_hwfn,
0931 struct qed_sp_vport_update_params *p_params);
0932
0933
0934
0935
0936
0937
0938
0939
0940 int qed_vf_pf_reset(struct qed_hwfn *p_hwfn);
0941
0942
0943
0944
0945
0946
0947
0948
0949 int qed_vf_pf_release(struct qed_hwfn *p_hwfn);
0950
0951
0952
0953
0954
0955
0956
0957
0958
0959
0960 u16 qed_vf_get_igu_sb_id(struct qed_hwfn *p_hwfn, u16 sb_id);
0961
0962
0963
0964
0965
0966
0967
0968
0969
0970
0971 void qed_vf_set_sb_info(struct qed_hwfn *p_hwfn,
0972 u16 sb_id, struct qed_sb_info *p_sb);
0973
0974
0975
0976
0977
0978
0979
0980
0981
0982
0983
0984
0985
0986
0987 int qed_vf_pf_vport_start(struct qed_hwfn *p_hwfn,
0988 u8 vport_id,
0989 u16 mtu,
0990 u8 inner_vlan_removal,
0991 enum qed_tpa_mode tpa_mode,
0992 u8 max_buffers_per_cqe, u8 only_untagged);
0993
0994
0995
0996
0997
0998
0999
1000
1001 int qed_vf_pf_vport_stop(struct qed_hwfn *p_hwfn);
1002
1003 int qed_vf_pf_filter_ucast(struct qed_hwfn *p_hwfn,
1004 struct qed_filter_ucast *p_param);
1005
1006 void qed_vf_pf_filter_mcast(struct qed_hwfn *p_hwfn,
1007 struct qed_filter_mcast *p_filter_cmd);
1008
1009
1010
1011
1012
1013
1014
1015
1016 int qed_vf_pf_int_cleanup(struct qed_hwfn *p_hwfn);
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027 void __qed_vf_get_link_params(struct qed_hwfn *p_hwfn,
1028 struct qed_mcp_link_params *p_params,
1029 struct qed_bulletin_content *p_bulletin);
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040 void __qed_vf_get_link_state(struct qed_hwfn *p_hwfn,
1041 struct qed_mcp_link_state *p_link,
1042 struct qed_bulletin_content *p_bulletin);
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054 void __qed_vf_get_link_caps(struct qed_hwfn *p_hwfn,
1055 struct qed_mcp_link_capabilities *p_link_caps,
1056 struct qed_bulletin_content *p_bulletin);
1057
1058 void qed_iov_vf_task(struct work_struct *work);
1059 void qed_vf_set_vf_start_tunn_update_param(struct qed_tunnel_info *p_tun);
1060 int qed_vf_pf_tunnel_param_update(struct qed_hwfn *p_hwfn,
1061 struct qed_tunnel_info *p_tunn);
1062
1063 u32 qed_vf_hw_bar_size(struct qed_hwfn *p_hwfn, enum BAR_ID bar_id);
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073 int qed_vf_pf_bulletin_update_mac(struct qed_hwfn *p_hwfn, const u8 *p_mac);
1074
1075 #else
1076 static inline void qed_vf_get_link_params(struct qed_hwfn *p_hwfn,
1077 struct qed_mcp_link_params *params)
1078 {
1079 }
1080
1081 static inline void qed_vf_get_link_state(struct qed_hwfn *p_hwfn,
1082 struct qed_mcp_link_state *link)
1083 {
1084 }
1085
1086 static inline void
1087 qed_vf_get_link_caps(struct qed_hwfn *p_hwfn,
1088 struct qed_mcp_link_capabilities *p_link_caps)
1089 {
1090 }
1091
1092 static inline void qed_vf_get_num_rxqs(struct qed_hwfn *p_hwfn, u8 *num_rxqs)
1093 {
1094 }
1095
1096 static inline void qed_vf_get_num_txqs(struct qed_hwfn *p_hwfn, u8 *num_txqs)
1097 {
1098 }
1099
1100 static inline void qed_vf_get_num_cids(struct qed_hwfn *p_hwfn, u8 *num_cids)
1101 {
1102 }
1103
1104 static inline void qed_vf_get_port_mac(struct qed_hwfn *p_hwfn, u8 *port_mac)
1105 {
1106 }
1107
1108 static inline void qed_vf_get_num_vlan_filters(struct qed_hwfn *p_hwfn,
1109 u8 *num_vlan_filters)
1110 {
1111 }
1112
1113 static inline void qed_vf_get_num_mac_filters(struct qed_hwfn *p_hwfn,
1114 u8 *num_mac_filters)
1115 {
1116 }
1117
1118 static inline bool qed_vf_check_mac(struct qed_hwfn *p_hwfn, u8 *mac)
1119 {
1120 return false;
1121 }
1122
1123 static inline void qed_vf_get_fw_version(struct qed_hwfn *p_hwfn,
1124 u16 *fw_major, u16 *fw_minor,
1125 u16 *fw_rev, u16 *fw_eng)
1126 {
1127 }
1128
1129 static inline int qed_vf_hw_prepare(struct qed_hwfn *p_hwfn)
1130 {
1131 return -EINVAL;
1132 }
1133
1134 static inline int qed_vf_pf_rxq_start(struct qed_hwfn *p_hwfn,
1135 struct qed_queue_cid *p_cid,
1136 u16 bd_max_bytes,
1137 dma_addr_t bd_chain_phys_adr,
1138 dma_addr_t cqe_pbl_addr,
1139 u16 cqe_pbl_size, void __iomem **pp_prod)
1140 {
1141 return -EINVAL;
1142 }
1143
1144 static inline int qed_vf_pf_txq_start(struct qed_hwfn *p_hwfn,
1145 struct qed_queue_cid *p_cid,
1146 dma_addr_t pbl_addr,
1147 u16 pbl_size, void __iomem **pp_doorbell)
1148 {
1149 return -EINVAL;
1150 }
1151
1152 static inline int qed_vf_pf_rxq_stop(struct qed_hwfn *p_hwfn,
1153 struct qed_queue_cid *p_cid,
1154 bool cqe_completion)
1155 {
1156 return -EINVAL;
1157 }
1158
1159 static inline int qed_vf_pf_txq_stop(struct qed_hwfn *p_hwfn,
1160 struct qed_queue_cid *p_cid)
1161 {
1162 return -EINVAL;
1163 }
1164
1165 static inline int
1166 qed_vf_pf_vport_update(struct qed_hwfn *p_hwfn,
1167 struct qed_sp_vport_update_params *p_params)
1168 {
1169 return -EINVAL;
1170 }
1171
1172 static inline int qed_vf_pf_reset(struct qed_hwfn *p_hwfn)
1173 {
1174 return -EINVAL;
1175 }
1176
1177 static inline int qed_vf_pf_release(struct qed_hwfn *p_hwfn)
1178 {
1179 return -EINVAL;
1180 }
1181
1182 static inline u16 qed_vf_get_igu_sb_id(struct qed_hwfn *p_hwfn, u16 sb_id)
1183 {
1184 return 0;
1185 }
1186
1187 static inline void qed_vf_set_sb_info(struct qed_hwfn *p_hwfn, u16 sb_id,
1188 struct qed_sb_info *p_sb)
1189 {
1190 }
1191
1192 static inline int qed_vf_pf_vport_start(struct qed_hwfn *p_hwfn,
1193 u8 vport_id,
1194 u16 mtu,
1195 u8 inner_vlan_removal,
1196 enum qed_tpa_mode tpa_mode,
1197 u8 max_buffers_per_cqe,
1198 u8 only_untagged)
1199 {
1200 return -EINVAL;
1201 }
1202
1203 static inline int qed_vf_pf_vport_stop(struct qed_hwfn *p_hwfn)
1204 {
1205 return -EINVAL;
1206 }
1207
1208 static inline int qed_vf_pf_filter_ucast(struct qed_hwfn *p_hwfn,
1209 struct qed_filter_ucast *p_param)
1210 {
1211 return -EINVAL;
1212 }
1213
1214 static inline void qed_vf_pf_filter_mcast(struct qed_hwfn *p_hwfn,
1215 struct qed_filter_mcast *p_filter_cmd)
1216 {
1217 }
1218
1219 static inline int qed_vf_pf_int_cleanup(struct qed_hwfn *p_hwfn)
1220 {
1221 return -EINVAL;
1222 }
1223
1224 static inline void __qed_vf_get_link_params(struct qed_hwfn *p_hwfn,
1225 struct qed_mcp_link_params
1226 *p_params,
1227 struct qed_bulletin_content
1228 *p_bulletin)
1229 {
1230 }
1231
1232 static inline void __qed_vf_get_link_state(struct qed_hwfn *p_hwfn,
1233 struct qed_mcp_link_state *p_link,
1234 struct qed_bulletin_content
1235 *p_bulletin)
1236 {
1237 }
1238
1239 static inline void
1240 __qed_vf_get_link_caps(struct qed_hwfn *p_hwfn,
1241 struct qed_mcp_link_capabilities *p_link_caps,
1242 struct qed_bulletin_content *p_bulletin)
1243 {
1244 }
1245
1246 static inline void qed_iov_vf_task(struct work_struct *work)
1247 {
1248 }
1249
1250 static inline void
1251 qed_vf_set_vf_start_tunn_update_param(struct qed_tunnel_info *p_tun)
1252 {
1253 }
1254
1255 static inline int qed_vf_pf_tunnel_param_update(struct qed_hwfn *p_hwfn,
1256 struct qed_tunnel_info *p_tunn)
1257 {
1258 return -EINVAL;
1259 }
1260
1261 static inline int qed_vf_pf_bulletin_update_mac(struct qed_hwfn *p_hwfn,
1262 const u8 *p_mac)
1263 {
1264 return -EINVAL;
1265 }
1266
1267 static inline u32
1268 qed_vf_hw_bar_size(struct qed_hwfn *p_hwfn,
1269 enum BAR_ID bar_id)
1270 {
1271 return 0;
1272 }
1273 #endif
1274
1275 #endif