18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
28c2ecf20Sopenharmony_ci/* QLogic qed NIC Driver
38c2ecf20Sopenharmony_ci * Copyright (c) 2015-2017  QLogic Corporation
48c2ecf20Sopenharmony_ci */
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci#ifndef _QED_VF_H
78c2ecf20Sopenharmony_ci#define _QED_VF_H
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#include "qed_l2.h"
108c2ecf20Sopenharmony_ci#include "qed_mcp.h"
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#define T_ETH_INDIRECTION_TABLE_SIZE 128
138c2ecf20Sopenharmony_ci#define T_ETH_RSS_KEY_SIZE 10
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_cistruct vf_pf_resc_request {
168c2ecf20Sopenharmony_ci	u8 num_rxqs;
178c2ecf20Sopenharmony_ci	u8 num_txqs;
188c2ecf20Sopenharmony_ci	u8 num_sbs;
198c2ecf20Sopenharmony_ci	u8 num_mac_filters;
208c2ecf20Sopenharmony_ci	u8 num_vlan_filters;
218c2ecf20Sopenharmony_ci	u8 num_mc_filters;
228c2ecf20Sopenharmony_ci	u8 num_cids;
238c2ecf20Sopenharmony_ci	u8 padding;
248c2ecf20Sopenharmony_ci};
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_cistruct hw_sb_info {
278c2ecf20Sopenharmony_ci	u16 hw_sb_id;
288c2ecf20Sopenharmony_ci	u8 sb_qid;
298c2ecf20Sopenharmony_ci	u8 padding[5];
308c2ecf20Sopenharmony_ci};
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci#define TLV_BUFFER_SIZE                 1024
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_cienum {
358c2ecf20Sopenharmony_ci	PFVF_STATUS_WAITING,
368c2ecf20Sopenharmony_ci	PFVF_STATUS_SUCCESS,
378c2ecf20Sopenharmony_ci	PFVF_STATUS_FAILURE,
388c2ecf20Sopenharmony_ci	PFVF_STATUS_NOT_SUPPORTED,
398c2ecf20Sopenharmony_ci	PFVF_STATUS_NO_RESOURCE,
408c2ecf20Sopenharmony_ci	PFVF_STATUS_FORCED,
418c2ecf20Sopenharmony_ci	PFVF_STATUS_MALICIOUS,
428c2ecf20Sopenharmony_ci};
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci/* vf pf channel tlvs */
458c2ecf20Sopenharmony_ci/* general tlv header (used for both vf->pf request and pf->vf response) */
468c2ecf20Sopenharmony_cistruct channel_tlv {
478c2ecf20Sopenharmony_ci	u16 type;
488c2ecf20Sopenharmony_ci	u16 length;
498c2ecf20Sopenharmony_ci};
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ci/* header of first vf->pf tlv carries the offset used to calculate reponse
528c2ecf20Sopenharmony_ci * buffer address
538c2ecf20Sopenharmony_ci */
548c2ecf20Sopenharmony_cistruct vfpf_first_tlv {
558c2ecf20Sopenharmony_ci	struct channel_tlv tl;
568c2ecf20Sopenharmony_ci	u32 padding;
578c2ecf20Sopenharmony_ci	u64 reply_address;
588c2ecf20Sopenharmony_ci};
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci/* header of pf->vf tlvs, carries the status of handling the request */
618c2ecf20Sopenharmony_cistruct pfvf_tlv {
628c2ecf20Sopenharmony_ci	struct channel_tlv tl;
638c2ecf20Sopenharmony_ci	u8 status;
648c2ecf20Sopenharmony_ci	u8 padding[3];
658c2ecf20Sopenharmony_ci};
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci/* response tlv used for most tlvs */
688c2ecf20Sopenharmony_cistruct pfvf_def_resp_tlv {
698c2ecf20Sopenharmony_ci	struct pfvf_tlv hdr;
708c2ecf20Sopenharmony_ci};
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ci/* used to terminate and pad a tlv list */
738c2ecf20Sopenharmony_cistruct channel_list_end_tlv {
748c2ecf20Sopenharmony_ci	struct channel_tlv tl;
758c2ecf20Sopenharmony_ci	u8 padding[4];
768c2ecf20Sopenharmony_ci};
778c2ecf20Sopenharmony_ci
788c2ecf20Sopenharmony_ci#define VFPF_ACQUIRE_OS_LINUX (0)
798c2ecf20Sopenharmony_ci#define VFPF_ACQUIRE_OS_WINDOWS (1)
808c2ecf20Sopenharmony_ci#define VFPF_ACQUIRE_OS_ESX (2)
818c2ecf20Sopenharmony_ci#define VFPF_ACQUIRE_OS_SOLARIS (3)
828c2ecf20Sopenharmony_ci#define VFPF_ACQUIRE_OS_LINUX_USERSPACE (4)
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_cistruct vfpf_acquire_tlv {
858c2ecf20Sopenharmony_ci	struct vfpf_first_tlv first_tlv;
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_ci	struct vf_pf_vfdev_info {
888c2ecf20Sopenharmony_ci#define VFPF_ACQUIRE_CAP_PRE_FP_HSI     (1 << 0) /* VF pre-FP hsi version */
898c2ecf20Sopenharmony_ci#define VFPF_ACQUIRE_CAP_100G		(1 << 1) /* VF can support 100g */
908c2ecf20Sopenharmony_ci	/* A requirement for supporting multi-Tx queues on a single queue-zone,
918c2ecf20Sopenharmony_ci	 * VF would pass qids as additional information whenever passing queue
928c2ecf20Sopenharmony_ci	 * references.
938c2ecf20Sopenharmony_ci	 */
948c2ecf20Sopenharmony_ci#define VFPF_ACQUIRE_CAP_QUEUE_QIDS     BIT(2)
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci	/* The VF is using the physical bar. While this is mostly internal
978c2ecf20Sopenharmony_ci	 * to the VF, might affect the number of CIDs supported assuming
988c2ecf20Sopenharmony_ci	 * QUEUE_QIDS is set.
998c2ecf20Sopenharmony_ci	 */
1008c2ecf20Sopenharmony_ci#define VFPF_ACQUIRE_CAP_PHYSICAL_BAR   BIT(3)
1018c2ecf20Sopenharmony_ci		u64 capabilities;
1028c2ecf20Sopenharmony_ci		u8 fw_major;
1038c2ecf20Sopenharmony_ci		u8 fw_minor;
1048c2ecf20Sopenharmony_ci		u8 fw_revision;
1058c2ecf20Sopenharmony_ci		u8 fw_engineering;
1068c2ecf20Sopenharmony_ci		u32 driver_version;
1078c2ecf20Sopenharmony_ci		u16 opaque_fid;	/* ME register value */
1088c2ecf20Sopenharmony_ci		u8 os_type;	/* VFPF_ACQUIRE_OS_* value */
1098c2ecf20Sopenharmony_ci		u8 eth_fp_hsi_major;
1108c2ecf20Sopenharmony_ci		u8 eth_fp_hsi_minor;
1118c2ecf20Sopenharmony_ci		u8 padding[3];
1128c2ecf20Sopenharmony_ci	} vfdev_info;
1138c2ecf20Sopenharmony_ci
1148c2ecf20Sopenharmony_ci	struct vf_pf_resc_request resc_request;
1158c2ecf20Sopenharmony_ci
1168c2ecf20Sopenharmony_ci	u64 bulletin_addr;
1178c2ecf20Sopenharmony_ci	u32 bulletin_size;
1188c2ecf20Sopenharmony_ci	u32 padding;
1198c2ecf20Sopenharmony_ci};
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_ci/* receive side scaling tlv */
1228c2ecf20Sopenharmony_cistruct vfpf_vport_update_rss_tlv {
1238c2ecf20Sopenharmony_ci	struct channel_tlv tl;
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci	u8 update_rss_flags;
1268c2ecf20Sopenharmony_ci#define VFPF_UPDATE_RSS_CONFIG_FLAG       BIT(0)
1278c2ecf20Sopenharmony_ci#define VFPF_UPDATE_RSS_CAPS_FLAG         BIT(1)
1288c2ecf20Sopenharmony_ci#define VFPF_UPDATE_RSS_IND_TABLE_FLAG    BIT(2)
1298c2ecf20Sopenharmony_ci#define VFPF_UPDATE_RSS_KEY_FLAG          BIT(3)
1308c2ecf20Sopenharmony_ci
1318c2ecf20Sopenharmony_ci	u8 rss_enable;
1328c2ecf20Sopenharmony_ci	u8 rss_caps;
1338c2ecf20Sopenharmony_ci	u8 rss_table_size_log;	/* The table size is 2 ^ rss_table_size_log */
1348c2ecf20Sopenharmony_ci	u16 rss_ind_table[T_ETH_INDIRECTION_TABLE_SIZE];
1358c2ecf20Sopenharmony_ci	u32 rss_key[T_ETH_RSS_KEY_SIZE];
1368c2ecf20Sopenharmony_ci};
1378c2ecf20Sopenharmony_ci
1388c2ecf20Sopenharmony_cistruct pfvf_storm_stats {
1398c2ecf20Sopenharmony_ci	u32 address;
1408c2ecf20Sopenharmony_ci	u32 len;
1418c2ecf20Sopenharmony_ci};
1428c2ecf20Sopenharmony_ci
1438c2ecf20Sopenharmony_cistruct pfvf_stats_info {
1448c2ecf20Sopenharmony_ci	struct pfvf_storm_stats mstats;
1458c2ecf20Sopenharmony_ci	struct pfvf_storm_stats pstats;
1468c2ecf20Sopenharmony_ci	struct pfvf_storm_stats tstats;
1478c2ecf20Sopenharmony_ci	struct pfvf_storm_stats ustats;
1488c2ecf20Sopenharmony_ci};
1498c2ecf20Sopenharmony_ci
1508c2ecf20Sopenharmony_cistruct pfvf_acquire_resp_tlv {
1518c2ecf20Sopenharmony_ci	struct pfvf_tlv hdr;
1528c2ecf20Sopenharmony_ci
1538c2ecf20Sopenharmony_ci	struct pf_vf_pfdev_info {
1548c2ecf20Sopenharmony_ci		u32 chip_num;
1558c2ecf20Sopenharmony_ci		u32 mfw_ver;
1568c2ecf20Sopenharmony_ci
1578c2ecf20Sopenharmony_ci		u16 fw_major;
1588c2ecf20Sopenharmony_ci		u16 fw_minor;
1598c2ecf20Sopenharmony_ci		u16 fw_rev;
1608c2ecf20Sopenharmony_ci		u16 fw_eng;
1618c2ecf20Sopenharmony_ci
1628c2ecf20Sopenharmony_ci		u64 capabilities;
1638c2ecf20Sopenharmony_ci#define PFVF_ACQUIRE_CAP_DEFAULT_UNTAGGED	BIT(0)
1648c2ecf20Sopenharmony_ci#define PFVF_ACQUIRE_CAP_100G			BIT(1)	/* If set, 100g PF */
1658c2ecf20Sopenharmony_ci/* There are old PF versions where the PF might mistakenly override the sanity
1668c2ecf20Sopenharmony_ci * mechanism [version-based] and allow a VF that can't be supported to pass
1678c2ecf20Sopenharmony_ci * the acquisition phase.
1688c2ecf20Sopenharmony_ci * To overcome this, PFs now indicate that they're past that point and the new
1698c2ecf20Sopenharmony_ci * VFs would fail probe on the older PFs that fail to do so.
1708c2ecf20Sopenharmony_ci */
1718c2ecf20Sopenharmony_ci#define PFVF_ACQUIRE_CAP_POST_FW_OVERRIDE	BIT(2)
1728c2ecf20Sopenharmony_ci
1738c2ecf20Sopenharmony_ci	/* PF expects queues to be received with additional qids */
1748c2ecf20Sopenharmony_ci#define PFVF_ACQUIRE_CAP_QUEUE_QIDS             BIT(3)
1758c2ecf20Sopenharmony_ci
1768c2ecf20Sopenharmony_ci		u16 db_size;
1778c2ecf20Sopenharmony_ci		u8 indices_per_sb;
1788c2ecf20Sopenharmony_ci		u8 os_type;
1798c2ecf20Sopenharmony_ci
1808c2ecf20Sopenharmony_ci		/* These should match the PF's qed_dev values */
1818c2ecf20Sopenharmony_ci		u16 chip_rev;
1828c2ecf20Sopenharmony_ci		u8 dev_type;
1838c2ecf20Sopenharmony_ci
1848c2ecf20Sopenharmony_ci		/* Doorbell bar size configured in HW: log(size) or 0 */
1858c2ecf20Sopenharmony_ci		u8 bar_size;
1868c2ecf20Sopenharmony_ci
1878c2ecf20Sopenharmony_ci		struct pfvf_stats_info stats_info;
1888c2ecf20Sopenharmony_ci
1898c2ecf20Sopenharmony_ci		u8 port_mac[ETH_ALEN];
1908c2ecf20Sopenharmony_ci
1918c2ecf20Sopenharmony_ci		/* It's possible PF had to configure an older fastpath HSI
1928c2ecf20Sopenharmony_ci		 * [in case VF is newer than PF]. This is communicated back
1938c2ecf20Sopenharmony_ci		 * to the VF. It can also be used in case of error due to
1948c2ecf20Sopenharmony_ci		 * non-matching versions to shed light in VF about failure.
1958c2ecf20Sopenharmony_ci		 */
1968c2ecf20Sopenharmony_ci		u8 major_fp_hsi;
1978c2ecf20Sopenharmony_ci		u8 minor_fp_hsi;
1988c2ecf20Sopenharmony_ci	} pfdev_info;
1998c2ecf20Sopenharmony_ci
2008c2ecf20Sopenharmony_ci	struct pf_vf_resc {
2018c2ecf20Sopenharmony_ci#define PFVF_MAX_QUEUES_PER_VF		16
2028c2ecf20Sopenharmony_ci#define PFVF_MAX_SBS_PER_VF		16
2038c2ecf20Sopenharmony_ci		struct hw_sb_info hw_sbs[PFVF_MAX_SBS_PER_VF];
2048c2ecf20Sopenharmony_ci		u8 hw_qid[PFVF_MAX_QUEUES_PER_VF];
2058c2ecf20Sopenharmony_ci		u8 cid[PFVF_MAX_QUEUES_PER_VF];
2068c2ecf20Sopenharmony_ci
2078c2ecf20Sopenharmony_ci		u8 num_rxqs;
2088c2ecf20Sopenharmony_ci		u8 num_txqs;
2098c2ecf20Sopenharmony_ci		u8 num_sbs;
2108c2ecf20Sopenharmony_ci		u8 num_mac_filters;
2118c2ecf20Sopenharmony_ci		u8 num_vlan_filters;
2128c2ecf20Sopenharmony_ci		u8 num_mc_filters;
2138c2ecf20Sopenharmony_ci		u8 num_cids;
2148c2ecf20Sopenharmony_ci		u8 padding;
2158c2ecf20Sopenharmony_ci	} resc;
2168c2ecf20Sopenharmony_ci
2178c2ecf20Sopenharmony_ci	u32 bulletin_size;
2188c2ecf20Sopenharmony_ci	u32 padding;
2198c2ecf20Sopenharmony_ci};
2208c2ecf20Sopenharmony_ci
2218c2ecf20Sopenharmony_cistruct pfvf_start_queue_resp_tlv {
2228c2ecf20Sopenharmony_ci	struct pfvf_tlv hdr;
2238c2ecf20Sopenharmony_ci	u32 offset;		/* offset to consumer/producer of queue */
2248c2ecf20Sopenharmony_ci	u8 padding[4];
2258c2ecf20Sopenharmony_ci};
2268c2ecf20Sopenharmony_ci
2278c2ecf20Sopenharmony_ci/* Extended queue information - additional index for reference inside qzone.
2288c2ecf20Sopenharmony_ci * If commmunicated between VF/PF, each TLV relating to queues should be
2298c2ecf20Sopenharmony_ci * extended by one such [or have a future base TLV that already contains info].
2308c2ecf20Sopenharmony_ci */
2318c2ecf20Sopenharmony_cistruct vfpf_qid_tlv {
2328c2ecf20Sopenharmony_ci	struct channel_tlv tl;
2338c2ecf20Sopenharmony_ci	u8 qid;
2348c2ecf20Sopenharmony_ci	u8 padding[3];
2358c2ecf20Sopenharmony_ci};
2368c2ecf20Sopenharmony_ci
2378c2ecf20Sopenharmony_ci/* Setup Queue */
2388c2ecf20Sopenharmony_cistruct vfpf_start_rxq_tlv {
2398c2ecf20Sopenharmony_ci	struct vfpf_first_tlv first_tlv;
2408c2ecf20Sopenharmony_ci
2418c2ecf20Sopenharmony_ci	/* physical addresses */
2428c2ecf20Sopenharmony_ci	u64 rxq_addr;
2438c2ecf20Sopenharmony_ci	u64 deprecated_sge_addr;
2448c2ecf20Sopenharmony_ci	u64 cqe_pbl_addr;
2458c2ecf20Sopenharmony_ci
2468c2ecf20Sopenharmony_ci	u16 cqe_pbl_size;
2478c2ecf20Sopenharmony_ci	u16 hw_sb;
2488c2ecf20Sopenharmony_ci	u16 rx_qid;
2498c2ecf20Sopenharmony_ci	u16 hc_rate;		/* desired interrupts per sec. */
2508c2ecf20Sopenharmony_ci
2518c2ecf20Sopenharmony_ci	u16 bd_max_bytes;
2528c2ecf20Sopenharmony_ci	u16 stat_id;
2538c2ecf20Sopenharmony_ci	u8 sb_index;
2548c2ecf20Sopenharmony_ci	u8 padding[3];
2558c2ecf20Sopenharmony_ci};
2568c2ecf20Sopenharmony_ci
2578c2ecf20Sopenharmony_cistruct vfpf_start_txq_tlv {
2588c2ecf20Sopenharmony_ci	struct vfpf_first_tlv first_tlv;
2598c2ecf20Sopenharmony_ci
2608c2ecf20Sopenharmony_ci	/* physical addresses */
2618c2ecf20Sopenharmony_ci	u64 pbl_addr;
2628c2ecf20Sopenharmony_ci	u16 pbl_size;
2638c2ecf20Sopenharmony_ci	u16 stat_id;
2648c2ecf20Sopenharmony_ci	u16 tx_qid;
2658c2ecf20Sopenharmony_ci	u16 hw_sb;
2668c2ecf20Sopenharmony_ci
2678c2ecf20Sopenharmony_ci	u32 flags;		/* VFPF_QUEUE_FLG_X flags */
2688c2ecf20Sopenharmony_ci	u16 hc_rate;		/* desired interrupts per sec. */
2698c2ecf20Sopenharmony_ci	u8 sb_index;
2708c2ecf20Sopenharmony_ci	u8 padding[3];
2718c2ecf20Sopenharmony_ci};
2728c2ecf20Sopenharmony_ci
2738c2ecf20Sopenharmony_ci/* Stop RX Queue */
2748c2ecf20Sopenharmony_cistruct vfpf_stop_rxqs_tlv {
2758c2ecf20Sopenharmony_ci	struct vfpf_first_tlv first_tlv;
2768c2ecf20Sopenharmony_ci
2778c2ecf20Sopenharmony_ci	u16 rx_qid;
2788c2ecf20Sopenharmony_ci
2798c2ecf20Sopenharmony_ci	/* this field is deprecated and should *always* be set to '1' */
2808c2ecf20Sopenharmony_ci	u8 num_rxqs;
2818c2ecf20Sopenharmony_ci	u8 cqe_completion;
2828c2ecf20Sopenharmony_ci	u8 padding[4];
2838c2ecf20Sopenharmony_ci};
2848c2ecf20Sopenharmony_ci
2858c2ecf20Sopenharmony_ci/* Stop TX Queues */
2868c2ecf20Sopenharmony_cistruct vfpf_stop_txqs_tlv {
2878c2ecf20Sopenharmony_ci	struct vfpf_first_tlv first_tlv;
2888c2ecf20Sopenharmony_ci
2898c2ecf20Sopenharmony_ci	u16 tx_qid;
2908c2ecf20Sopenharmony_ci
2918c2ecf20Sopenharmony_ci	/* this field is deprecated and should *always* be set to '1' */
2928c2ecf20Sopenharmony_ci	u8 num_txqs;
2938c2ecf20Sopenharmony_ci	u8 padding[5];
2948c2ecf20Sopenharmony_ci};
2958c2ecf20Sopenharmony_ci
2968c2ecf20Sopenharmony_cistruct vfpf_update_rxq_tlv {
2978c2ecf20Sopenharmony_ci	struct vfpf_first_tlv first_tlv;
2988c2ecf20Sopenharmony_ci
2998c2ecf20Sopenharmony_ci	u64 deprecated_sge_addr[PFVF_MAX_QUEUES_PER_VF];
3008c2ecf20Sopenharmony_ci
3018c2ecf20Sopenharmony_ci	u16 rx_qid;
3028c2ecf20Sopenharmony_ci	u8 num_rxqs;
3038c2ecf20Sopenharmony_ci	u8 flags;
3048c2ecf20Sopenharmony_ci#define VFPF_RXQ_UPD_INIT_SGE_DEPRECATE_FLAG    BIT(0)
3058c2ecf20Sopenharmony_ci#define VFPF_RXQ_UPD_COMPLETE_CQE_FLAG          BIT(1)
3068c2ecf20Sopenharmony_ci#define VFPF_RXQ_UPD_COMPLETE_EVENT_FLAG        BIT(2)
3078c2ecf20Sopenharmony_ci
3088c2ecf20Sopenharmony_ci	u8 padding[4];
3098c2ecf20Sopenharmony_ci};
3108c2ecf20Sopenharmony_ci
3118c2ecf20Sopenharmony_ci/* Set Queue Filters */
3128c2ecf20Sopenharmony_cistruct vfpf_q_mac_vlan_filter {
3138c2ecf20Sopenharmony_ci	u32 flags;
3148c2ecf20Sopenharmony_ci#define VFPF_Q_FILTER_DEST_MAC_VALID    0x01
3158c2ecf20Sopenharmony_ci#define VFPF_Q_FILTER_VLAN_TAG_VALID    0x02
3168c2ecf20Sopenharmony_ci#define VFPF_Q_FILTER_SET_MAC           0x100	/* set/clear */
3178c2ecf20Sopenharmony_ci
3188c2ecf20Sopenharmony_ci	u8 mac[ETH_ALEN];
3198c2ecf20Sopenharmony_ci	u16 vlan_tag;
3208c2ecf20Sopenharmony_ci
3218c2ecf20Sopenharmony_ci	u8 padding[4];
3228c2ecf20Sopenharmony_ci};
3238c2ecf20Sopenharmony_ci
3248c2ecf20Sopenharmony_ci/* Start a vport */
3258c2ecf20Sopenharmony_cistruct vfpf_vport_start_tlv {
3268c2ecf20Sopenharmony_ci	struct vfpf_first_tlv first_tlv;
3278c2ecf20Sopenharmony_ci
3288c2ecf20Sopenharmony_ci	u64 sb_addr[PFVF_MAX_SBS_PER_VF];
3298c2ecf20Sopenharmony_ci
3308c2ecf20Sopenharmony_ci	u32 tpa_mode;
3318c2ecf20Sopenharmony_ci	u16 dep1;
3328c2ecf20Sopenharmony_ci	u16 mtu;
3338c2ecf20Sopenharmony_ci
3348c2ecf20Sopenharmony_ci	u8 vport_id;
3358c2ecf20Sopenharmony_ci	u8 inner_vlan_removal;
3368c2ecf20Sopenharmony_ci
3378c2ecf20Sopenharmony_ci	u8 only_untagged;
3388c2ecf20Sopenharmony_ci	u8 max_buffers_per_cqe;
3398c2ecf20Sopenharmony_ci
3408c2ecf20Sopenharmony_ci	u8 padding[4];
3418c2ecf20Sopenharmony_ci};
3428c2ecf20Sopenharmony_ci
3438c2ecf20Sopenharmony_ci/* Extended tlvs - need to add rss, mcast, accept mode tlvs */
3448c2ecf20Sopenharmony_cistruct vfpf_vport_update_activate_tlv {
3458c2ecf20Sopenharmony_ci	struct channel_tlv tl;
3468c2ecf20Sopenharmony_ci	u8 update_rx;
3478c2ecf20Sopenharmony_ci	u8 update_tx;
3488c2ecf20Sopenharmony_ci	u8 active_rx;
3498c2ecf20Sopenharmony_ci	u8 active_tx;
3508c2ecf20Sopenharmony_ci};
3518c2ecf20Sopenharmony_ci
3528c2ecf20Sopenharmony_cistruct vfpf_vport_update_tx_switch_tlv {
3538c2ecf20Sopenharmony_ci	struct channel_tlv tl;
3548c2ecf20Sopenharmony_ci	u8 tx_switching;
3558c2ecf20Sopenharmony_ci	u8 padding[3];
3568c2ecf20Sopenharmony_ci};
3578c2ecf20Sopenharmony_ci
3588c2ecf20Sopenharmony_cistruct vfpf_vport_update_vlan_strip_tlv {
3598c2ecf20Sopenharmony_ci	struct channel_tlv tl;
3608c2ecf20Sopenharmony_ci	u8 remove_vlan;
3618c2ecf20Sopenharmony_ci	u8 padding[3];
3628c2ecf20Sopenharmony_ci};
3638c2ecf20Sopenharmony_ci
3648c2ecf20Sopenharmony_cistruct vfpf_vport_update_mcast_bin_tlv {
3658c2ecf20Sopenharmony_ci	struct channel_tlv tl;
3668c2ecf20Sopenharmony_ci	u8 padding[4];
3678c2ecf20Sopenharmony_ci
3688c2ecf20Sopenharmony_ci	/* There are only 256 approx bins, and in HSI they're divided into
3698c2ecf20Sopenharmony_ci	 * 32-bit values. As old VFs used to set-bit to the values on its side,
3708c2ecf20Sopenharmony_ci	 * the upper half of the array is never expected to contain any data.
3718c2ecf20Sopenharmony_ci	 */
3728c2ecf20Sopenharmony_ci	u64 bins[4];
3738c2ecf20Sopenharmony_ci	u64 obsolete_bins[4];
3748c2ecf20Sopenharmony_ci};
3758c2ecf20Sopenharmony_ci
3768c2ecf20Sopenharmony_cistruct vfpf_vport_update_accept_param_tlv {
3778c2ecf20Sopenharmony_ci	struct channel_tlv tl;
3788c2ecf20Sopenharmony_ci	u8 update_rx_mode;
3798c2ecf20Sopenharmony_ci	u8 update_tx_mode;
3808c2ecf20Sopenharmony_ci	u8 rx_accept_filter;
3818c2ecf20Sopenharmony_ci	u8 tx_accept_filter;
3828c2ecf20Sopenharmony_ci};
3838c2ecf20Sopenharmony_ci
3848c2ecf20Sopenharmony_cistruct vfpf_vport_update_accept_any_vlan_tlv {
3858c2ecf20Sopenharmony_ci	struct channel_tlv tl;
3868c2ecf20Sopenharmony_ci	u8 update_accept_any_vlan_flg;
3878c2ecf20Sopenharmony_ci	u8 accept_any_vlan;
3888c2ecf20Sopenharmony_ci
3898c2ecf20Sopenharmony_ci	u8 padding[2];
3908c2ecf20Sopenharmony_ci};
3918c2ecf20Sopenharmony_ci
3928c2ecf20Sopenharmony_cistruct vfpf_vport_update_sge_tpa_tlv {
3938c2ecf20Sopenharmony_ci	struct channel_tlv tl;
3948c2ecf20Sopenharmony_ci
3958c2ecf20Sopenharmony_ci	u16 sge_tpa_flags;
3968c2ecf20Sopenharmony_ci#define VFPF_TPA_IPV4_EN_FLAG		BIT(0)
3978c2ecf20Sopenharmony_ci#define VFPF_TPA_IPV6_EN_FLAG		BIT(1)
3988c2ecf20Sopenharmony_ci#define VFPF_TPA_PKT_SPLIT_FLAG		BIT(2)
3998c2ecf20Sopenharmony_ci#define VFPF_TPA_HDR_DATA_SPLIT_FLAG	BIT(3)
4008c2ecf20Sopenharmony_ci#define VFPF_TPA_GRO_CONSIST_FLAG	BIT(4)
4018c2ecf20Sopenharmony_ci
4028c2ecf20Sopenharmony_ci	u8 update_sge_tpa_flags;
4038c2ecf20Sopenharmony_ci#define VFPF_UPDATE_SGE_DEPRECATED_FLAG	BIT(0)
4048c2ecf20Sopenharmony_ci#define VFPF_UPDATE_TPA_EN_FLAG		BIT(1)
4058c2ecf20Sopenharmony_ci#define VFPF_UPDATE_TPA_PARAM_FLAG	BIT(2)
4068c2ecf20Sopenharmony_ci
4078c2ecf20Sopenharmony_ci	u8 max_buffers_per_cqe;
4088c2ecf20Sopenharmony_ci
4098c2ecf20Sopenharmony_ci	u16 deprecated_sge_buff_size;
4108c2ecf20Sopenharmony_ci	u16 tpa_max_size;
4118c2ecf20Sopenharmony_ci	u16 tpa_min_size_to_start;
4128c2ecf20Sopenharmony_ci	u16 tpa_min_size_to_cont;
4138c2ecf20Sopenharmony_ci
4148c2ecf20Sopenharmony_ci	u8 tpa_max_aggs_num;
4158c2ecf20Sopenharmony_ci	u8 padding[7];
4168c2ecf20Sopenharmony_ci};
4178c2ecf20Sopenharmony_ci
4188c2ecf20Sopenharmony_ci/* Primary tlv as a header for various extended tlvs for
4198c2ecf20Sopenharmony_ci * various functionalities in vport update ramrod.
4208c2ecf20Sopenharmony_ci */
4218c2ecf20Sopenharmony_cistruct vfpf_vport_update_tlv {
4228c2ecf20Sopenharmony_ci	struct vfpf_first_tlv first_tlv;
4238c2ecf20Sopenharmony_ci};
4248c2ecf20Sopenharmony_ci
4258c2ecf20Sopenharmony_cistruct vfpf_ucast_filter_tlv {
4268c2ecf20Sopenharmony_ci	struct vfpf_first_tlv first_tlv;
4278c2ecf20Sopenharmony_ci
4288c2ecf20Sopenharmony_ci	u8 opcode;
4298c2ecf20Sopenharmony_ci	u8 type;
4308c2ecf20Sopenharmony_ci
4318c2ecf20Sopenharmony_ci	u8 mac[ETH_ALEN];
4328c2ecf20Sopenharmony_ci
4338c2ecf20Sopenharmony_ci	u16 vlan;
4348c2ecf20Sopenharmony_ci	u16 padding[3];
4358c2ecf20Sopenharmony_ci};
4368c2ecf20Sopenharmony_ci
4378c2ecf20Sopenharmony_ci/* tunnel update param tlv */
4388c2ecf20Sopenharmony_cistruct vfpf_update_tunn_param_tlv {
4398c2ecf20Sopenharmony_ci	struct vfpf_first_tlv first_tlv;
4408c2ecf20Sopenharmony_ci
4418c2ecf20Sopenharmony_ci	u8 tun_mode_update_mask;
4428c2ecf20Sopenharmony_ci	u8 tunn_mode;
4438c2ecf20Sopenharmony_ci	u8 update_tun_cls;
4448c2ecf20Sopenharmony_ci	u8 vxlan_clss;
4458c2ecf20Sopenharmony_ci	u8 l2gre_clss;
4468c2ecf20Sopenharmony_ci	u8 ipgre_clss;
4478c2ecf20Sopenharmony_ci	u8 l2geneve_clss;
4488c2ecf20Sopenharmony_ci	u8 ipgeneve_clss;
4498c2ecf20Sopenharmony_ci	u8 update_geneve_port;
4508c2ecf20Sopenharmony_ci	u8 update_vxlan_port;
4518c2ecf20Sopenharmony_ci	u16 geneve_port;
4528c2ecf20Sopenharmony_ci	u16 vxlan_port;
4538c2ecf20Sopenharmony_ci	u8 padding[2];
4548c2ecf20Sopenharmony_ci};
4558c2ecf20Sopenharmony_ci
4568c2ecf20Sopenharmony_cistruct pfvf_update_tunn_param_tlv {
4578c2ecf20Sopenharmony_ci	struct pfvf_tlv hdr;
4588c2ecf20Sopenharmony_ci
4598c2ecf20Sopenharmony_ci	u16 tunn_feature_mask;
4608c2ecf20Sopenharmony_ci	u8 vxlan_mode;
4618c2ecf20Sopenharmony_ci	u8 l2geneve_mode;
4628c2ecf20Sopenharmony_ci	u8 ipgeneve_mode;
4638c2ecf20Sopenharmony_ci	u8 l2gre_mode;
4648c2ecf20Sopenharmony_ci	u8 ipgre_mode;
4658c2ecf20Sopenharmony_ci	u8 vxlan_clss;
4668c2ecf20Sopenharmony_ci	u8 l2gre_clss;
4678c2ecf20Sopenharmony_ci	u8 ipgre_clss;
4688c2ecf20Sopenharmony_ci	u8 l2geneve_clss;
4698c2ecf20Sopenharmony_ci	u8 ipgeneve_clss;
4708c2ecf20Sopenharmony_ci	u16 vxlan_udp_port;
4718c2ecf20Sopenharmony_ci	u16 geneve_udp_port;
4728c2ecf20Sopenharmony_ci};
4738c2ecf20Sopenharmony_ci
4748c2ecf20Sopenharmony_cistruct tlv_buffer_size {
4758c2ecf20Sopenharmony_ci	u8 tlv_buffer[TLV_BUFFER_SIZE];
4768c2ecf20Sopenharmony_ci};
4778c2ecf20Sopenharmony_ci
4788c2ecf20Sopenharmony_cistruct vfpf_update_coalesce {
4798c2ecf20Sopenharmony_ci	struct vfpf_first_tlv first_tlv;
4808c2ecf20Sopenharmony_ci	u16 rx_coal;
4818c2ecf20Sopenharmony_ci	u16 tx_coal;
4828c2ecf20Sopenharmony_ci	u16 qid;
4838c2ecf20Sopenharmony_ci	u8 padding[2];
4848c2ecf20Sopenharmony_ci};
4858c2ecf20Sopenharmony_ci
4868c2ecf20Sopenharmony_cistruct vfpf_read_coal_req_tlv {
4878c2ecf20Sopenharmony_ci	struct vfpf_first_tlv first_tlv;
4888c2ecf20Sopenharmony_ci	u16 qid;
4898c2ecf20Sopenharmony_ci	u8 is_rx;
4908c2ecf20Sopenharmony_ci	u8 padding[5];
4918c2ecf20Sopenharmony_ci};
4928c2ecf20Sopenharmony_ci
4938c2ecf20Sopenharmony_cistruct pfvf_read_coal_resp_tlv {
4948c2ecf20Sopenharmony_ci	struct pfvf_tlv hdr;
4958c2ecf20Sopenharmony_ci	u16 coal;
4968c2ecf20Sopenharmony_ci	u8 padding[6];
4978c2ecf20Sopenharmony_ci};
4988c2ecf20Sopenharmony_ci
4998c2ecf20Sopenharmony_cistruct vfpf_bulletin_update_mac_tlv {
5008c2ecf20Sopenharmony_ci	struct vfpf_first_tlv first_tlv;
5018c2ecf20Sopenharmony_ci	u8 mac[ETH_ALEN];
5028c2ecf20Sopenharmony_ci	u8 padding[2];
5038c2ecf20Sopenharmony_ci};
5048c2ecf20Sopenharmony_ci
5058c2ecf20Sopenharmony_ciunion vfpf_tlvs {
5068c2ecf20Sopenharmony_ci	struct vfpf_first_tlv first_tlv;
5078c2ecf20Sopenharmony_ci	struct vfpf_acquire_tlv acquire;
5088c2ecf20Sopenharmony_ci	struct vfpf_start_rxq_tlv start_rxq;
5098c2ecf20Sopenharmony_ci	struct vfpf_start_txq_tlv start_txq;
5108c2ecf20Sopenharmony_ci	struct vfpf_stop_rxqs_tlv stop_rxqs;
5118c2ecf20Sopenharmony_ci	struct vfpf_stop_txqs_tlv stop_txqs;
5128c2ecf20Sopenharmony_ci	struct vfpf_update_rxq_tlv update_rxq;
5138c2ecf20Sopenharmony_ci	struct vfpf_vport_start_tlv start_vport;
5148c2ecf20Sopenharmony_ci	struct vfpf_vport_update_tlv vport_update;
5158c2ecf20Sopenharmony_ci	struct vfpf_ucast_filter_tlv ucast_filter;
5168c2ecf20Sopenharmony_ci	struct vfpf_update_tunn_param_tlv tunn_param_update;
5178c2ecf20Sopenharmony_ci	struct vfpf_update_coalesce update_coalesce;
5188c2ecf20Sopenharmony_ci	struct vfpf_read_coal_req_tlv read_coal_req;
5198c2ecf20Sopenharmony_ci	struct vfpf_bulletin_update_mac_tlv bulletin_update_mac;
5208c2ecf20Sopenharmony_ci	struct tlv_buffer_size tlv_buf_size;
5218c2ecf20Sopenharmony_ci};
5228c2ecf20Sopenharmony_ci
5238c2ecf20Sopenharmony_ciunion pfvf_tlvs {
5248c2ecf20Sopenharmony_ci	struct pfvf_def_resp_tlv default_resp;
5258c2ecf20Sopenharmony_ci	struct pfvf_acquire_resp_tlv acquire_resp;
5268c2ecf20Sopenharmony_ci	struct tlv_buffer_size tlv_buf_size;
5278c2ecf20Sopenharmony_ci	struct pfvf_start_queue_resp_tlv queue_start;
5288c2ecf20Sopenharmony_ci	struct pfvf_update_tunn_param_tlv tunn_param_resp;
5298c2ecf20Sopenharmony_ci	struct pfvf_read_coal_resp_tlv read_coal_resp;
5308c2ecf20Sopenharmony_ci};
5318c2ecf20Sopenharmony_ci
5328c2ecf20Sopenharmony_cienum qed_bulletin_bit {
5338c2ecf20Sopenharmony_ci	/* Alert the VF that a forced MAC was set by the PF */
5348c2ecf20Sopenharmony_ci	MAC_ADDR_FORCED = 0,
5358c2ecf20Sopenharmony_ci	/* Alert the VF that a forced VLAN was set by the PF */
5368c2ecf20Sopenharmony_ci	VLAN_ADDR_FORCED = 2,
5378c2ecf20Sopenharmony_ci
5388c2ecf20Sopenharmony_ci	/* Indicate that `default_only_untagged' contains actual data */
5398c2ecf20Sopenharmony_ci	VFPF_BULLETIN_UNTAGGED_DEFAULT = 3,
5408c2ecf20Sopenharmony_ci	VFPF_BULLETIN_UNTAGGED_DEFAULT_FORCED = 4,
5418c2ecf20Sopenharmony_ci
5428c2ecf20Sopenharmony_ci	/* Alert the VF that suggested mac was sent by the PF.
5438c2ecf20Sopenharmony_ci	 * MAC_ADDR will be disabled in case MAC_ADDR_FORCED is set.
5448c2ecf20Sopenharmony_ci	 */
5458c2ecf20Sopenharmony_ci	VFPF_BULLETIN_MAC_ADDR = 5
5468c2ecf20Sopenharmony_ci};
5478c2ecf20Sopenharmony_ci
5488c2ecf20Sopenharmony_cistruct qed_bulletin_content {
5498c2ecf20Sopenharmony_ci	/* crc of structure to ensure is not in mid-update */
5508c2ecf20Sopenharmony_ci	u32 crc;
5518c2ecf20Sopenharmony_ci
5528c2ecf20Sopenharmony_ci	u32 version;
5538c2ecf20Sopenharmony_ci
5548c2ecf20Sopenharmony_ci	/* bitmap indicating which fields hold valid values */
5558c2ecf20Sopenharmony_ci	u64 valid_bitmap;
5568c2ecf20Sopenharmony_ci
5578c2ecf20Sopenharmony_ci	/* used for MAC_ADDR or MAC_ADDR_FORCED */
5588c2ecf20Sopenharmony_ci	u8 mac[ETH_ALEN];
5598c2ecf20Sopenharmony_ci
5608c2ecf20Sopenharmony_ci	/* If valid, 1 => only untagged Rx if no vlan is configured */
5618c2ecf20Sopenharmony_ci	u8 default_only_untagged;
5628c2ecf20Sopenharmony_ci	u8 padding;
5638c2ecf20Sopenharmony_ci
5648c2ecf20Sopenharmony_ci	/* The following is a 'copy' of qed_mcp_link_state,
5658c2ecf20Sopenharmony_ci	 * qed_mcp_link_params and qed_mcp_link_capabilities. Since it's
5668c2ecf20Sopenharmony_ci	 * possible the structs will increase further along the road we cannot
5678c2ecf20Sopenharmony_ci	 * have it here; Instead we need to have all of its fields.
5688c2ecf20Sopenharmony_ci	 */
5698c2ecf20Sopenharmony_ci	u8 req_autoneg;
5708c2ecf20Sopenharmony_ci	u8 req_autoneg_pause;
5718c2ecf20Sopenharmony_ci	u8 req_forced_rx;
5728c2ecf20Sopenharmony_ci	u8 req_forced_tx;
5738c2ecf20Sopenharmony_ci	u8 padding2[4];
5748c2ecf20Sopenharmony_ci
5758c2ecf20Sopenharmony_ci	u32 req_adv_speed;
5768c2ecf20Sopenharmony_ci	u32 req_forced_speed;
5778c2ecf20Sopenharmony_ci	u32 req_loopback;
5788c2ecf20Sopenharmony_ci	u32 padding3;
5798c2ecf20Sopenharmony_ci
5808c2ecf20Sopenharmony_ci	u8 link_up;
5818c2ecf20Sopenharmony_ci	u8 full_duplex;
5828c2ecf20Sopenharmony_ci	u8 autoneg;
5838c2ecf20Sopenharmony_ci	u8 autoneg_complete;
5848c2ecf20Sopenharmony_ci	u8 parallel_detection;
5858c2ecf20Sopenharmony_ci	u8 pfc_enabled;
5868c2ecf20Sopenharmony_ci	u8 partner_tx_flow_ctrl_en;
5878c2ecf20Sopenharmony_ci	u8 partner_rx_flow_ctrl_en;
5888c2ecf20Sopenharmony_ci	u8 partner_adv_pause;
5898c2ecf20Sopenharmony_ci	u8 sfp_tx_fault;
5908c2ecf20Sopenharmony_ci	u16 vxlan_udp_port;
5918c2ecf20Sopenharmony_ci	u16 geneve_udp_port;
5928c2ecf20Sopenharmony_ci	u8 padding4[2];
5938c2ecf20Sopenharmony_ci
5948c2ecf20Sopenharmony_ci	u32 speed;
5958c2ecf20Sopenharmony_ci	u32 partner_adv_speed;
5968c2ecf20Sopenharmony_ci
5978c2ecf20Sopenharmony_ci	u32 capability_speed;
5988c2ecf20Sopenharmony_ci
5998c2ecf20Sopenharmony_ci	/* Forced vlan */
6008c2ecf20Sopenharmony_ci	u16 pvid;
6018c2ecf20Sopenharmony_ci	u16 padding5;
6028c2ecf20Sopenharmony_ci};
6038c2ecf20Sopenharmony_ci
6048c2ecf20Sopenharmony_cistruct qed_bulletin {
6058c2ecf20Sopenharmony_ci	dma_addr_t phys;
6068c2ecf20Sopenharmony_ci	struct qed_bulletin_content *p_virt;
6078c2ecf20Sopenharmony_ci	u32 size;
6088c2ecf20Sopenharmony_ci};
6098c2ecf20Sopenharmony_ci
6108c2ecf20Sopenharmony_cienum {
6118c2ecf20Sopenharmony_ci	CHANNEL_TLV_NONE,	/* ends tlv sequence */
6128c2ecf20Sopenharmony_ci	CHANNEL_TLV_ACQUIRE,
6138c2ecf20Sopenharmony_ci	CHANNEL_TLV_VPORT_START,
6148c2ecf20Sopenharmony_ci	CHANNEL_TLV_VPORT_UPDATE,
6158c2ecf20Sopenharmony_ci	CHANNEL_TLV_VPORT_TEARDOWN,
6168c2ecf20Sopenharmony_ci	CHANNEL_TLV_START_RXQ,
6178c2ecf20Sopenharmony_ci	CHANNEL_TLV_START_TXQ,
6188c2ecf20Sopenharmony_ci	CHANNEL_TLV_STOP_RXQS,
6198c2ecf20Sopenharmony_ci	CHANNEL_TLV_STOP_TXQS,
6208c2ecf20Sopenharmony_ci	CHANNEL_TLV_UPDATE_RXQ,
6218c2ecf20Sopenharmony_ci	CHANNEL_TLV_INT_CLEANUP,
6228c2ecf20Sopenharmony_ci	CHANNEL_TLV_CLOSE,
6238c2ecf20Sopenharmony_ci	CHANNEL_TLV_RELEASE,
6248c2ecf20Sopenharmony_ci	CHANNEL_TLV_LIST_END,
6258c2ecf20Sopenharmony_ci	CHANNEL_TLV_UCAST_FILTER,
6268c2ecf20Sopenharmony_ci	CHANNEL_TLV_VPORT_UPDATE_ACTIVATE,
6278c2ecf20Sopenharmony_ci	CHANNEL_TLV_VPORT_UPDATE_TX_SWITCH,
6288c2ecf20Sopenharmony_ci	CHANNEL_TLV_VPORT_UPDATE_VLAN_STRIP,
6298c2ecf20Sopenharmony_ci	CHANNEL_TLV_VPORT_UPDATE_MCAST,
6308c2ecf20Sopenharmony_ci	CHANNEL_TLV_VPORT_UPDATE_ACCEPT_PARAM,
6318c2ecf20Sopenharmony_ci	CHANNEL_TLV_VPORT_UPDATE_RSS,
6328c2ecf20Sopenharmony_ci	CHANNEL_TLV_VPORT_UPDATE_ACCEPT_ANY_VLAN,
6338c2ecf20Sopenharmony_ci	CHANNEL_TLV_VPORT_UPDATE_SGE_TPA,
6348c2ecf20Sopenharmony_ci	CHANNEL_TLV_UPDATE_TUNN_PARAM,
6358c2ecf20Sopenharmony_ci	CHANNEL_TLV_COALESCE_UPDATE,
6368c2ecf20Sopenharmony_ci	CHANNEL_TLV_QID,
6378c2ecf20Sopenharmony_ci	CHANNEL_TLV_COALESCE_READ,
6388c2ecf20Sopenharmony_ci	CHANNEL_TLV_BULLETIN_UPDATE_MAC,
6398c2ecf20Sopenharmony_ci	CHANNEL_TLV_MAX,
6408c2ecf20Sopenharmony_ci
6418c2ecf20Sopenharmony_ci	/* Required for iterating over vport-update tlvs.
6428c2ecf20Sopenharmony_ci	 * Will break in case non-sequential vport-update tlvs.
6438c2ecf20Sopenharmony_ci	 */
6448c2ecf20Sopenharmony_ci	CHANNEL_TLV_VPORT_UPDATE_MAX = CHANNEL_TLV_VPORT_UPDATE_SGE_TPA + 1,
6458c2ecf20Sopenharmony_ci};
6468c2ecf20Sopenharmony_ci
6478c2ecf20Sopenharmony_ci/* Default number of CIDs [total of both Rx and Tx] to be requested
6488c2ecf20Sopenharmony_ci * by default, and maximum possible number.
6498c2ecf20Sopenharmony_ci */
6508c2ecf20Sopenharmony_ci#define QED_ETH_VF_DEFAULT_NUM_CIDS (32)
6518c2ecf20Sopenharmony_ci#define QED_ETH_VF_MAX_NUM_CIDS (250)
6528c2ecf20Sopenharmony_ci
6538c2ecf20Sopenharmony_ci/* This data is held in the qed_hwfn structure for VFs only. */
6548c2ecf20Sopenharmony_cistruct qed_vf_iov {
6558c2ecf20Sopenharmony_ci	union vfpf_tlvs *vf2pf_request;
6568c2ecf20Sopenharmony_ci	dma_addr_t vf2pf_request_phys;
6578c2ecf20Sopenharmony_ci	union pfvf_tlvs *pf2vf_reply;
6588c2ecf20Sopenharmony_ci	dma_addr_t pf2vf_reply_phys;
6598c2ecf20Sopenharmony_ci
6608c2ecf20Sopenharmony_ci	/* Should be taken whenever the mailbox buffers are accessed */
6618c2ecf20Sopenharmony_ci	struct mutex mutex;
6628c2ecf20Sopenharmony_ci	u8 *offset;
6638c2ecf20Sopenharmony_ci
6648c2ecf20Sopenharmony_ci	/* Bulletin Board */
6658c2ecf20Sopenharmony_ci	struct qed_bulletin bulletin;
6668c2ecf20Sopenharmony_ci	struct qed_bulletin_content bulletin_shadow;
6678c2ecf20Sopenharmony_ci
6688c2ecf20Sopenharmony_ci	/* we set aside a copy of the acquire response */
6698c2ecf20Sopenharmony_ci	struct pfvf_acquire_resp_tlv acquire_resp;
6708c2ecf20Sopenharmony_ci
6718c2ecf20Sopenharmony_ci	/* In case PF originates prior to the fp-hsi version comparison,
6728c2ecf20Sopenharmony_ci	 * this has to be propagated as it affects the fastpath.
6738c2ecf20Sopenharmony_ci	 */
6748c2ecf20Sopenharmony_ci	bool b_pre_fp_hsi;
6758c2ecf20Sopenharmony_ci
6768c2ecf20Sopenharmony_ci	/* Current day VFs are passing the SBs physical address on vport
6778c2ecf20Sopenharmony_ci	 * start, and as they lack an IGU mapping they need to store the
6788c2ecf20Sopenharmony_ci	 * addresses of previously registered SBs.
6798c2ecf20Sopenharmony_ci	 * Even if we were to change configuration flow, due to backward
6808c2ecf20Sopenharmony_ci	 * compatibility [with older PFs] we'd still need to store these.
6818c2ecf20Sopenharmony_ci	 */
6828c2ecf20Sopenharmony_ci	struct qed_sb_info *sbs_info[PFVF_MAX_SBS_PER_VF];
6838c2ecf20Sopenharmony_ci
6848c2ecf20Sopenharmony_ci	/* Determines whether VF utilizes doorbells via limited register
6858c2ecf20Sopenharmony_ci	 * bar or via the doorbell bar.
6868c2ecf20Sopenharmony_ci	 */
6878c2ecf20Sopenharmony_ci	bool b_doorbell_bar;
6888c2ecf20Sopenharmony_ci};
6898c2ecf20Sopenharmony_ci
6908c2ecf20Sopenharmony_ci/**
6918c2ecf20Sopenharmony_ci * @brief VF - Set Rx/Tx coalesce per VF's relative queue.
6928c2ecf20Sopenharmony_ci *             Coalesce value '0' will omit the configuration.
6938c2ecf20Sopenharmony_ci *
6948c2ecf20Sopenharmony_ci * @param p_hwfn
6958c2ecf20Sopenharmony_ci * @param rx_coal - coalesce value in micro second for rx queue
6968c2ecf20Sopenharmony_ci * @param tx_coal - coalesce value in micro second for tx queue
6978c2ecf20Sopenharmony_ci * @param p_cid   - queue cid
6988c2ecf20Sopenharmony_ci *
6998c2ecf20Sopenharmony_ci **/
7008c2ecf20Sopenharmony_ciint qed_vf_pf_set_coalesce(struct qed_hwfn *p_hwfn,
7018c2ecf20Sopenharmony_ci			   u16 rx_coal,
7028c2ecf20Sopenharmony_ci			   u16 tx_coal, struct qed_queue_cid *p_cid);
7038c2ecf20Sopenharmony_ci
7048c2ecf20Sopenharmony_ci/**
7058c2ecf20Sopenharmony_ci * @brief VF - Get coalesce per VF's relative queue.
7068c2ecf20Sopenharmony_ci *
7078c2ecf20Sopenharmony_ci * @param p_hwfn
7088c2ecf20Sopenharmony_ci * @param p_coal - coalesce value in micro second for VF queues.
7098c2ecf20Sopenharmony_ci * @param p_cid  - queue cid
7108c2ecf20Sopenharmony_ci *
7118c2ecf20Sopenharmony_ci **/
7128c2ecf20Sopenharmony_ciint qed_vf_pf_get_coalesce(struct qed_hwfn *p_hwfn,
7138c2ecf20Sopenharmony_ci			   u16 *p_coal, struct qed_queue_cid *p_cid);
7148c2ecf20Sopenharmony_ci
7158c2ecf20Sopenharmony_ci#ifdef CONFIG_QED_SRIOV
7168c2ecf20Sopenharmony_ci/**
7178c2ecf20Sopenharmony_ci * @brief Read the VF bulletin and act on it if needed
7188c2ecf20Sopenharmony_ci *
7198c2ecf20Sopenharmony_ci * @param p_hwfn
7208c2ecf20Sopenharmony_ci * @param p_change - qed fills 1 iff bulletin board has changed, 0 otherwise.
7218c2ecf20Sopenharmony_ci *
7228c2ecf20Sopenharmony_ci * @return enum _qed_status
7238c2ecf20Sopenharmony_ci */
7248c2ecf20Sopenharmony_ciint qed_vf_read_bulletin(struct qed_hwfn *p_hwfn, u8 *p_change);
7258c2ecf20Sopenharmony_ci
7268c2ecf20Sopenharmony_ci/**
7278c2ecf20Sopenharmony_ci * @brief Get link paramters for VF from qed
7288c2ecf20Sopenharmony_ci *
7298c2ecf20Sopenharmony_ci * @param p_hwfn
7308c2ecf20Sopenharmony_ci * @param params - the link params structure to be filled for the VF
7318c2ecf20Sopenharmony_ci */
7328c2ecf20Sopenharmony_civoid qed_vf_get_link_params(struct qed_hwfn *p_hwfn,
7338c2ecf20Sopenharmony_ci			    struct qed_mcp_link_params *params);
7348c2ecf20Sopenharmony_ci
7358c2ecf20Sopenharmony_ci/**
7368c2ecf20Sopenharmony_ci * @brief Get link state for VF from qed
7378c2ecf20Sopenharmony_ci *
7388c2ecf20Sopenharmony_ci * @param p_hwfn
7398c2ecf20Sopenharmony_ci * @param link - the link state structure to be filled for the VF
7408c2ecf20Sopenharmony_ci */
7418c2ecf20Sopenharmony_civoid qed_vf_get_link_state(struct qed_hwfn *p_hwfn,
7428c2ecf20Sopenharmony_ci			   struct qed_mcp_link_state *link);
7438c2ecf20Sopenharmony_ci
7448c2ecf20Sopenharmony_ci/**
7458c2ecf20Sopenharmony_ci * @brief Get link capabilities for VF from qed
7468c2ecf20Sopenharmony_ci *
7478c2ecf20Sopenharmony_ci * @param p_hwfn
7488c2ecf20Sopenharmony_ci * @param p_link_caps - the link capabilities structure to be filled for the VF
7498c2ecf20Sopenharmony_ci */
7508c2ecf20Sopenharmony_civoid qed_vf_get_link_caps(struct qed_hwfn *p_hwfn,
7518c2ecf20Sopenharmony_ci			  struct qed_mcp_link_capabilities *p_link_caps);
7528c2ecf20Sopenharmony_ci
7538c2ecf20Sopenharmony_ci/**
7548c2ecf20Sopenharmony_ci * @brief Get number of Rx queues allocated for VF by qed
7558c2ecf20Sopenharmony_ci *
7568c2ecf20Sopenharmony_ci *  @param p_hwfn
7578c2ecf20Sopenharmony_ci *  @param num_rxqs - allocated RX queues
7588c2ecf20Sopenharmony_ci */
7598c2ecf20Sopenharmony_civoid qed_vf_get_num_rxqs(struct qed_hwfn *p_hwfn, u8 *num_rxqs);
7608c2ecf20Sopenharmony_ci
7618c2ecf20Sopenharmony_ci/**
7628c2ecf20Sopenharmony_ci * @brief Get number of Rx queues allocated for VF by qed
7638c2ecf20Sopenharmony_ci *
7648c2ecf20Sopenharmony_ci *  @param p_hwfn
7658c2ecf20Sopenharmony_ci *  @param num_txqs - allocated RX queues
7668c2ecf20Sopenharmony_ci */
7678c2ecf20Sopenharmony_civoid qed_vf_get_num_txqs(struct qed_hwfn *p_hwfn, u8 *num_txqs);
7688c2ecf20Sopenharmony_ci
7698c2ecf20Sopenharmony_ci/**
7708c2ecf20Sopenharmony_ci * @brief Get number of available connections [both Rx and Tx] for VF
7718c2ecf20Sopenharmony_ci *
7728c2ecf20Sopenharmony_ci * @param p_hwfn
7738c2ecf20Sopenharmony_ci * @param num_cids - allocated number of connections
7748c2ecf20Sopenharmony_ci */
7758c2ecf20Sopenharmony_civoid qed_vf_get_num_cids(struct qed_hwfn *p_hwfn, u8 *num_cids);
7768c2ecf20Sopenharmony_ci
7778c2ecf20Sopenharmony_ci/**
7788c2ecf20Sopenharmony_ci * @brief Get port mac address for VF
7798c2ecf20Sopenharmony_ci *
7808c2ecf20Sopenharmony_ci * @param p_hwfn
7818c2ecf20Sopenharmony_ci * @param port_mac - destination location for port mac
7828c2ecf20Sopenharmony_ci */
7838c2ecf20Sopenharmony_civoid qed_vf_get_port_mac(struct qed_hwfn *p_hwfn, u8 *port_mac);
7848c2ecf20Sopenharmony_ci
7858c2ecf20Sopenharmony_ci/**
7868c2ecf20Sopenharmony_ci * @brief Get number of VLAN filters allocated for VF by qed
7878c2ecf20Sopenharmony_ci *
7888c2ecf20Sopenharmony_ci *  @param p_hwfn
7898c2ecf20Sopenharmony_ci *  @param num_rxqs - allocated VLAN filters
7908c2ecf20Sopenharmony_ci */
7918c2ecf20Sopenharmony_civoid qed_vf_get_num_vlan_filters(struct qed_hwfn *p_hwfn,
7928c2ecf20Sopenharmony_ci				 u8 *num_vlan_filters);
7938c2ecf20Sopenharmony_ci
7948c2ecf20Sopenharmony_ci/**
7958c2ecf20Sopenharmony_ci * @brief Get number of MAC filters allocated for VF by qed
7968c2ecf20Sopenharmony_ci *
7978c2ecf20Sopenharmony_ci *  @param p_hwfn
7988c2ecf20Sopenharmony_ci *  @param num_rxqs - allocated MAC filters
7998c2ecf20Sopenharmony_ci */
8008c2ecf20Sopenharmony_civoid qed_vf_get_num_mac_filters(struct qed_hwfn *p_hwfn, u8 *num_mac_filters);
8018c2ecf20Sopenharmony_ci
8028c2ecf20Sopenharmony_ci/**
8038c2ecf20Sopenharmony_ci * @brief Check if VF can set a MAC address
8048c2ecf20Sopenharmony_ci *
8058c2ecf20Sopenharmony_ci * @param p_hwfn
8068c2ecf20Sopenharmony_ci * @param mac
8078c2ecf20Sopenharmony_ci *
8088c2ecf20Sopenharmony_ci * @return bool
8098c2ecf20Sopenharmony_ci */
8108c2ecf20Sopenharmony_cibool qed_vf_check_mac(struct qed_hwfn *p_hwfn, u8 *mac);
8118c2ecf20Sopenharmony_ci
8128c2ecf20Sopenharmony_ci/**
8138c2ecf20Sopenharmony_ci * @brief Set firmware version information in dev_info from VFs acquire response tlv
8148c2ecf20Sopenharmony_ci *
8158c2ecf20Sopenharmony_ci * @param p_hwfn
8168c2ecf20Sopenharmony_ci * @param fw_major
8178c2ecf20Sopenharmony_ci * @param fw_minor
8188c2ecf20Sopenharmony_ci * @param fw_rev
8198c2ecf20Sopenharmony_ci * @param fw_eng
8208c2ecf20Sopenharmony_ci */
8218c2ecf20Sopenharmony_civoid qed_vf_get_fw_version(struct qed_hwfn *p_hwfn,
8228c2ecf20Sopenharmony_ci			   u16 *fw_major, u16 *fw_minor,
8238c2ecf20Sopenharmony_ci			   u16 *fw_rev, u16 *fw_eng);
8248c2ecf20Sopenharmony_ci
8258c2ecf20Sopenharmony_ci/**
8268c2ecf20Sopenharmony_ci * @brief hw preparation for VF
8278c2ecf20Sopenharmony_ci *      sends ACQUIRE message
8288c2ecf20Sopenharmony_ci *
8298c2ecf20Sopenharmony_ci * @param p_hwfn
8308c2ecf20Sopenharmony_ci *
8318c2ecf20Sopenharmony_ci * @return int
8328c2ecf20Sopenharmony_ci */
8338c2ecf20Sopenharmony_ciint qed_vf_hw_prepare(struct qed_hwfn *p_hwfn);
8348c2ecf20Sopenharmony_ci
8358c2ecf20Sopenharmony_ci/**
8368c2ecf20Sopenharmony_ci * @brief VF - start the RX Queue by sending a message to the PF
8378c2ecf20Sopenharmony_ci * @param p_hwfn
8388c2ecf20Sopenharmony_ci * @param p_cid			- Only relative fields are relevant
8398c2ecf20Sopenharmony_ci * @param bd_max_bytes          - maximum number of bytes per bd
8408c2ecf20Sopenharmony_ci * @param bd_chain_phys_addr    - physical address of bd chain
8418c2ecf20Sopenharmony_ci * @param cqe_pbl_addr          - physical address of pbl
8428c2ecf20Sopenharmony_ci * @param cqe_pbl_size          - pbl size
8438c2ecf20Sopenharmony_ci * @param pp_prod               - pointer to the producer to be
8448c2ecf20Sopenharmony_ci *				  used in fastpath
8458c2ecf20Sopenharmony_ci *
8468c2ecf20Sopenharmony_ci * @return int
8478c2ecf20Sopenharmony_ci */
8488c2ecf20Sopenharmony_ciint qed_vf_pf_rxq_start(struct qed_hwfn *p_hwfn,
8498c2ecf20Sopenharmony_ci			struct qed_queue_cid *p_cid,
8508c2ecf20Sopenharmony_ci			u16 bd_max_bytes,
8518c2ecf20Sopenharmony_ci			dma_addr_t bd_chain_phys_addr,
8528c2ecf20Sopenharmony_ci			dma_addr_t cqe_pbl_addr,
8538c2ecf20Sopenharmony_ci			u16 cqe_pbl_size, void __iomem **pp_prod);
8548c2ecf20Sopenharmony_ci
8558c2ecf20Sopenharmony_ci/**
8568c2ecf20Sopenharmony_ci * @brief VF - start the TX queue by sending a message to the
8578c2ecf20Sopenharmony_ci *        PF.
8588c2ecf20Sopenharmony_ci *
8598c2ecf20Sopenharmony_ci * @param p_hwfn
8608c2ecf20Sopenharmony_ci * @param tx_queue_id           - zero based within the VF
8618c2ecf20Sopenharmony_ci * @param sb                    - status block for this queue
8628c2ecf20Sopenharmony_ci * @param sb_index              - index within the status block
8638c2ecf20Sopenharmony_ci * @param bd_chain_phys_addr    - physical address of tx chain
8648c2ecf20Sopenharmony_ci * @param pp_doorbell           - pointer to address to which to
8658c2ecf20Sopenharmony_ci *                      write the doorbell too..
8668c2ecf20Sopenharmony_ci *
8678c2ecf20Sopenharmony_ci * @return int
8688c2ecf20Sopenharmony_ci */
8698c2ecf20Sopenharmony_ciint
8708c2ecf20Sopenharmony_ciqed_vf_pf_txq_start(struct qed_hwfn *p_hwfn,
8718c2ecf20Sopenharmony_ci		    struct qed_queue_cid *p_cid,
8728c2ecf20Sopenharmony_ci		    dma_addr_t pbl_addr,
8738c2ecf20Sopenharmony_ci		    u16 pbl_size, void __iomem **pp_doorbell);
8748c2ecf20Sopenharmony_ci
8758c2ecf20Sopenharmony_ci/**
8768c2ecf20Sopenharmony_ci * @brief VF - stop the RX queue by sending a message to the PF
8778c2ecf20Sopenharmony_ci *
8788c2ecf20Sopenharmony_ci * @param p_hwfn
8798c2ecf20Sopenharmony_ci * @param p_cid
8808c2ecf20Sopenharmony_ci * @param cqe_completion
8818c2ecf20Sopenharmony_ci *
8828c2ecf20Sopenharmony_ci * @return int
8838c2ecf20Sopenharmony_ci */
8848c2ecf20Sopenharmony_ciint qed_vf_pf_rxq_stop(struct qed_hwfn *p_hwfn,
8858c2ecf20Sopenharmony_ci		       struct qed_queue_cid *p_cid, bool cqe_completion);
8868c2ecf20Sopenharmony_ci
8878c2ecf20Sopenharmony_ci/**
8888c2ecf20Sopenharmony_ci * @brief VF - stop the TX queue by sending a message to the PF
8898c2ecf20Sopenharmony_ci *
8908c2ecf20Sopenharmony_ci * @param p_hwfn
8918c2ecf20Sopenharmony_ci * @param tx_qid
8928c2ecf20Sopenharmony_ci *
8938c2ecf20Sopenharmony_ci * @return int
8948c2ecf20Sopenharmony_ci */
8958c2ecf20Sopenharmony_ciint qed_vf_pf_txq_stop(struct qed_hwfn *p_hwfn, struct qed_queue_cid *p_cid);
8968c2ecf20Sopenharmony_ci
8978c2ecf20Sopenharmony_ci/**
8988c2ecf20Sopenharmony_ci * @brief VF - send a vport update command
8998c2ecf20Sopenharmony_ci *
9008c2ecf20Sopenharmony_ci * @param p_hwfn
9018c2ecf20Sopenharmony_ci * @param params
9028c2ecf20Sopenharmony_ci *
9038c2ecf20Sopenharmony_ci * @return int
9048c2ecf20Sopenharmony_ci */
9058c2ecf20Sopenharmony_ciint qed_vf_pf_vport_update(struct qed_hwfn *p_hwfn,
9068c2ecf20Sopenharmony_ci			   struct qed_sp_vport_update_params *p_params);
9078c2ecf20Sopenharmony_ci
9088c2ecf20Sopenharmony_ci/**
9098c2ecf20Sopenharmony_ci *
9108c2ecf20Sopenharmony_ci * @brief VF - send a close message to PF
9118c2ecf20Sopenharmony_ci *
9128c2ecf20Sopenharmony_ci * @param p_hwfn
9138c2ecf20Sopenharmony_ci *
9148c2ecf20Sopenharmony_ci * @return enum _qed_status
9158c2ecf20Sopenharmony_ci */
9168c2ecf20Sopenharmony_ciint qed_vf_pf_reset(struct qed_hwfn *p_hwfn);
9178c2ecf20Sopenharmony_ci
9188c2ecf20Sopenharmony_ci/**
9198c2ecf20Sopenharmony_ci * @brief VF - free vf`s memories
9208c2ecf20Sopenharmony_ci *
9218c2ecf20Sopenharmony_ci * @param p_hwfn
9228c2ecf20Sopenharmony_ci *
9238c2ecf20Sopenharmony_ci * @return enum _qed_status
9248c2ecf20Sopenharmony_ci */
9258c2ecf20Sopenharmony_ciint qed_vf_pf_release(struct qed_hwfn *p_hwfn);
9268c2ecf20Sopenharmony_ci
9278c2ecf20Sopenharmony_ci/**
9288c2ecf20Sopenharmony_ci * @brief qed_vf_get_igu_sb_id - Get the IGU SB ID for a given
9298c2ecf20Sopenharmony_ci *        sb_id. For VFs igu sbs don't have to be contiguous
9308c2ecf20Sopenharmony_ci *
9318c2ecf20Sopenharmony_ci * @param p_hwfn
9328c2ecf20Sopenharmony_ci * @param sb_id
9338c2ecf20Sopenharmony_ci *
9348c2ecf20Sopenharmony_ci * @return INLINE u16
9358c2ecf20Sopenharmony_ci */
9368c2ecf20Sopenharmony_ciu16 qed_vf_get_igu_sb_id(struct qed_hwfn *p_hwfn, u16 sb_id);
9378c2ecf20Sopenharmony_ci
9388c2ecf20Sopenharmony_ci/**
9398c2ecf20Sopenharmony_ci * @brief Stores [or removes] a configured sb_info.
9408c2ecf20Sopenharmony_ci *
9418c2ecf20Sopenharmony_ci * @param p_hwfn
9428c2ecf20Sopenharmony_ci * @param sb_id - zero-based SB index [for fastpath]
9438c2ecf20Sopenharmony_ci * @param sb_info - may be NULL [during removal].
9448c2ecf20Sopenharmony_ci */
9458c2ecf20Sopenharmony_civoid qed_vf_set_sb_info(struct qed_hwfn *p_hwfn,
9468c2ecf20Sopenharmony_ci			u16 sb_id, struct qed_sb_info *p_sb);
9478c2ecf20Sopenharmony_ci
9488c2ecf20Sopenharmony_ci/**
9498c2ecf20Sopenharmony_ci * @brief qed_vf_pf_vport_start - perform vport start for VF.
9508c2ecf20Sopenharmony_ci *
9518c2ecf20Sopenharmony_ci * @param p_hwfn
9528c2ecf20Sopenharmony_ci * @param vport_id
9538c2ecf20Sopenharmony_ci * @param mtu
9548c2ecf20Sopenharmony_ci * @param inner_vlan_removal
9558c2ecf20Sopenharmony_ci * @param tpa_mode
9568c2ecf20Sopenharmony_ci * @param max_buffers_per_cqe,
9578c2ecf20Sopenharmony_ci * @param only_untagged - default behavior regarding vlan acceptance
9588c2ecf20Sopenharmony_ci *
9598c2ecf20Sopenharmony_ci * @return enum _qed_status
9608c2ecf20Sopenharmony_ci */
9618c2ecf20Sopenharmony_ciint qed_vf_pf_vport_start(struct qed_hwfn *p_hwfn,
9628c2ecf20Sopenharmony_ci			  u8 vport_id,
9638c2ecf20Sopenharmony_ci			  u16 mtu,
9648c2ecf20Sopenharmony_ci			  u8 inner_vlan_removal,
9658c2ecf20Sopenharmony_ci			  enum qed_tpa_mode tpa_mode,
9668c2ecf20Sopenharmony_ci			  u8 max_buffers_per_cqe, u8 only_untagged);
9678c2ecf20Sopenharmony_ci
9688c2ecf20Sopenharmony_ci/**
9698c2ecf20Sopenharmony_ci * @brief qed_vf_pf_vport_stop - stop the VF's vport
9708c2ecf20Sopenharmony_ci *
9718c2ecf20Sopenharmony_ci * @param p_hwfn
9728c2ecf20Sopenharmony_ci *
9738c2ecf20Sopenharmony_ci * @return enum _qed_status
9748c2ecf20Sopenharmony_ci */
9758c2ecf20Sopenharmony_ciint qed_vf_pf_vport_stop(struct qed_hwfn *p_hwfn);
9768c2ecf20Sopenharmony_ci
9778c2ecf20Sopenharmony_ciint qed_vf_pf_filter_ucast(struct qed_hwfn *p_hwfn,
9788c2ecf20Sopenharmony_ci			   struct qed_filter_ucast *p_param);
9798c2ecf20Sopenharmony_ci
9808c2ecf20Sopenharmony_civoid qed_vf_pf_filter_mcast(struct qed_hwfn *p_hwfn,
9818c2ecf20Sopenharmony_ci			    struct qed_filter_mcast *p_filter_cmd);
9828c2ecf20Sopenharmony_ci
9838c2ecf20Sopenharmony_ci/**
9848c2ecf20Sopenharmony_ci * @brief qed_vf_pf_int_cleanup - clean the SB of the VF
9858c2ecf20Sopenharmony_ci *
9868c2ecf20Sopenharmony_ci * @param p_hwfn
9878c2ecf20Sopenharmony_ci *
9888c2ecf20Sopenharmony_ci * @return enum _qed_status
9898c2ecf20Sopenharmony_ci */
9908c2ecf20Sopenharmony_ciint qed_vf_pf_int_cleanup(struct qed_hwfn *p_hwfn);
9918c2ecf20Sopenharmony_ci
9928c2ecf20Sopenharmony_ci/**
9938c2ecf20Sopenharmony_ci * @brief - return the link params in a given bulletin board
9948c2ecf20Sopenharmony_ci *
9958c2ecf20Sopenharmony_ci * @param p_hwfn
9968c2ecf20Sopenharmony_ci * @param p_params - pointer to a struct to fill with link params
9978c2ecf20Sopenharmony_ci * @param p_bulletin
9988c2ecf20Sopenharmony_ci */
9998c2ecf20Sopenharmony_civoid __qed_vf_get_link_params(struct qed_hwfn *p_hwfn,
10008c2ecf20Sopenharmony_ci			      struct qed_mcp_link_params *p_params,
10018c2ecf20Sopenharmony_ci			      struct qed_bulletin_content *p_bulletin);
10028c2ecf20Sopenharmony_ci
10038c2ecf20Sopenharmony_ci/**
10048c2ecf20Sopenharmony_ci * @brief - return the link state in a given bulletin board
10058c2ecf20Sopenharmony_ci *
10068c2ecf20Sopenharmony_ci * @param p_hwfn
10078c2ecf20Sopenharmony_ci * @param p_link - pointer to a struct to fill with link state
10088c2ecf20Sopenharmony_ci * @param p_bulletin
10098c2ecf20Sopenharmony_ci */
10108c2ecf20Sopenharmony_civoid __qed_vf_get_link_state(struct qed_hwfn *p_hwfn,
10118c2ecf20Sopenharmony_ci			     struct qed_mcp_link_state *p_link,
10128c2ecf20Sopenharmony_ci			     struct qed_bulletin_content *p_bulletin);
10138c2ecf20Sopenharmony_ci
10148c2ecf20Sopenharmony_ci/**
10158c2ecf20Sopenharmony_ci * @brief - return the link capabilities in a given bulletin board
10168c2ecf20Sopenharmony_ci *
10178c2ecf20Sopenharmony_ci * @param p_hwfn
10188c2ecf20Sopenharmony_ci * @param p_link - pointer to a struct to fill with link capabilities
10198c2ecf20Sopenharmony_ci * @param p_bulletin
10208c2ecf20Sopenharmony_ci */
10218c2ecf20Sopenharmony_civoid __qed_vf_get_link_caps(struct qed_hwfn *p_hwfn,
10228c2ecf20Sopenharmony_ci			    struct qed_mcp_link_capabilities *p_link_caps,
10238c2ecf20Sopenharmony_ci			    struct qed_bulletin_content *p_bulletin);
10248c2ecf20Sopenharmony_ci
10258c2ecf20Sopenharmony_civoid qed_iov_vf_task(struct work_struct *work);
10268c2ecf20Sopenharmony_civoid qed_vf_set_vf_start_tunn_update_param(struct qed_tunnel_info *p_tun);
10278c2ecf20Sopenharmony_ciint qed_vf_pf_tunnel_param_update(struct qed_hwfn *p_hwfn,
10288c2ecf20Sopenharmony_ci				  struct qed_tunnel_info *p_tunn);
10298c2ecf20Sopenharmony_ci
10308c2ecf20Sopenharmony_ciu32 qed_vf_hw_bar_size(struct qed_hwfn *p_hwfn, enum BAR_ID bar_id);
10318c2ecf20Sopenharmony_ci/**
10328c2ecf20Sopenharmony_ci * @brief - Ask PF to update the MAC address in it's bulletin board
10338c2ecf20Sopenharmony_ci *
10348c2ecf20Sopenharmony_ci * @param p_mac - mac address to be updated in bulletin board
10358c2ecf20Sopenharmony_ci */
10368c2ecf20Sopenharmony_ciint qed_vf_pf_bulletin_update_mac(struct qed_hwfn *p_hwfn, u8 *p_mac);
10378c2ecf20Sopenharmony_ci
10388c2ecf20Sopenharmony_ci#else
10398c2ecf20Sopenharmony_cistatic inline void qed_vf_get_link_params(struct qed_hwfn *p_hwfn,
10408c2ecf20Sopenharmony_ci					  struct qed_mcp_link_params *params)
10418c2ecf20Sopenharmony_ci{
10428c2ecf20Sopenharmony_ci}
10438c2ecf20Sopenharmony_ci
10448c2ecf20Sopenharmony_cistatic inline void qed_vf_get_link_state(struct qed_hwfn *p_hwfn,
10458c2ecf20Sopenharmony_ci					 struct qed_mcp_link_state *link)
10468c2ecf20Sopenharmony_ci{
10478c2ecf20Sopenharmony_ci}
10488c2ecf20Sopenharmony_ci
10498c2ecf20Sopenharmony_cistatic inline void
10508c2ecf20Sopenharmony_ciqed_vf_get_link_caps(struct qed_hwfn *p_hwfn,
10518c2ecf20Sopenharmony_ci		     struct qed_mcp_link_capabilities *p_link_caps)
10528c2ecf20Sopenharmony_ci{
10538c2ecf20Sopenharmony_ci}
10548c2ecf20Sopenharmony_ci
10558c2ecf20Sopenharmony_cistatic inline void qed_vf_get_num_rxqs(struct qed_hwfn *p_hwfn, u8 *num_rxqs)
10568c2ecf20Sopenharmony_ci{
10578c2ecf20Sopenharmony_ci}
10588c2ecf20Sopenharmony_ci
10598c2ecf20Sopenharmony_cistatic inline void qed_vf_get_num_txqs(struct qed_hwfn *p_hwfn, u8 *num_txqs)
10608c2ecf20Sopenharmony_ci{
10618c2ecf20Sopenharmony_ci}
10628c2ecf20Sopenharmony_ci
10638c2ecf20Sopenharmony_cistatic inline void qed_vf_get_num_cids(struct qed_hwfn *p_hwfn, u8 *num_cids)
10648c2ecf20Sopenharmony_ci{
10658c2ecf20Sopenharmony_ci}
10668c2ecf20Sopenharmony_ci
10678c2ecf20Sopenharmony_cistatic inline void qed_vf_get_port_mac(struct qed_hwfn *p_hwfn, u8 *port_mac)
10688c2ecf20Sopenharmony_ci{
10698c2ecf20Sopenharmony_ci}
10708c2ecf20Sopenharmony_ci
10718c2ecf20Sopenharmony_cistatic inline void qed_vf_get_num_vlan_filters(struct qed_hwfn *p_hwfn,
10728c2ecf20Sopenharmony_ci					       u8 *num_vlan_filters)
10738c2ecf20Sopenharmony_ci{
10748c2ecf20Sopenharmony_ci}
10758c2ecf20Sopenharmony_ci
10768c2ecf20Sopenharmony_cistatic inline void qed_vf_get_num_mac_filters(struct qed_hwfn *p_hwfn,
10778c2ecf20Sopenharmony_ci					      u8 *num_mac_filters)
10788c2ecf20Sopenharmony_ci{
10798c2ecf20Sopenharmony_ci}
10808c2ecf20Sopenharmony_ci
10818c2ecf20Sopenharmony_cistatic inline bool qed_vf_check_mac(struct qed_hwfn *p_hwfn, u8 *mac)
10828c2ecf20Sopenharmony_ci{
10838c2ecf20Sopenharmony_ci	return false;
10848c2ecf20Sopenharmony_ci}
10858c2ecf20Sopenharmony_ci
10868c2ecf20Sopenharmony_cistatic inline void qed_vf_get_fw_version(struct qed_hwfn *p_hwfn,
10878c2ecf20Sopenharmony_ci					 u16 *fw_major, u16 *fw_minor,
10888c2ecf20Sopenharmony_ci					 u16 *fw_rev, u16 *fw_eng)
10898c2ecf20Sopenharmony_ci{
10908c2ecf20Sopenharmony_ci}
10918c2ecf20Sopenharmony_ci
10928c2ecf20Sopenharmony_cistatic inline int qed_vf_hw_prepare(struct qed_hwfn *p_hwfn)
10938c2ecf20Sopenharmony_ci{
10948c2ecf20Sopenharmony_ci	return -EINVAL;
10958c2ecf20Sopenharmony_ci}
10968c2ecf20Sopenharmony_ci
10978c2ecf20Sopenharmony_cistatic inline int qed_vf_pf_rxq_start(struct qed_hwfn *p_hwfn,
10988c2ecf20Sopenharmony_ci				      struct qed_queue_cid *p_cid,
10998c2ecf20Sopenharmony_ci				      u16 bd_max_bytes,
11008c2ecf20Sopenharmony_ci				      dma_addr_t bd_chain_phys_adr,
11018c2ecf20Sopenharmony_ci				      dma_addr_t cqe_pbl_addr,
11028c2ecf20Sopenharmony_ci				      u16 cqe_pbl_size, void __iomem **pp_prod)
11038c2ecf20Sopenharmony_ci{
11048c2ecf20Sopenharmony_ci	return -EINVAL;
11058c2ecf20Sopenharmony_ci}
11068c2ecf20Sopenharmony_ci
11078c2ecf20Sopenharmony_cistatic inline int qed_vf_pf_txq_start(struct qed_hwfn *p_hwfn,
11088c2ecf20Sopenharmony_ci				      struct qed_queue_cid *p_cid,
11098c2ecf20Sopenharmony_ci				      dma_addr_t pbl_addr,
11108c2ecf20Sopenharmony_ci				      u16 pbl_size, void __iomem **pp_doorbell)
11118c2ecf20Sopenharmony_ci{
11128c2ecf20Sopenharmony_ci	return -EINVAL;
11138c2ecf20Sopenharmony_ci}
11148c2ecf20Sopenharmony_ci
11158c2ecf20Sopenharmony_cistatic inline int qed_vf_pf_rxq_stop(struct qed_hwfn *p_hwfn,
11168c2ecf20Sopenharmony_ci				     struct qed_queue_cid *p_cid,
11178c2ecf20Sopenharmony_ci				     bool cqe_completion)
11188c2ecf20Sopenharmony_ci{
11198c2ecf20Sopenharmony_ci	return -EINVAL;
11208c2ecf20Sopenharmony_ci}
11218c2ecf20Sopenharmony_ci
11228c2ecf20Sopenharmony_cistatic inline int qed_vf_pf_txq_stop(struct qed_hwfn *p_hwfn,
11238c2ecf20Sopenharmony_ci				     struct qed_queue_cid *p_cid)
11248c2ecf20Sopenharmony_ci{
11258c2ecf20Sopenharmony_ci	return -EINVAL;
11268c2ecf20Sopenharmony_ci}
11278c2ecf20Sopenharmony_ci
11288c2ecf20Sopenharmony_cistatic inline int
11298c2ecf20Sopenharmony_ciqed_vf_pf_vport_update(struct qed_hwfn *p_hwfn,
11308c2ecf20Sopenharmony_ci		       struct qed_sp_vport_update_params *p_params)
11318c2ecf20Sopenharmony_ci{
11328c2ecf20Sopenharmony_ci	return -EINVAL;
11338c2ecf20Sopenharmony_ci}
11348c2ecf20Sopenharmony_ci
11358c2ecf20Sopenharmony_cistatic inline int qed_vf_pf_reset(struct qed_hwfn *p_hwfn)
11368c2ecf20Sopenharmony_ci{
11378c2ecf20Sopenharmony_ci	return -EINVAL;
11388c2ecf20Sopenharmony_ci}
11398c2ecf20Sopenharmony_ci
11408c2ecf20Sopenharmony_cistatic inline int qed_vf_pf_release(struct qed_hwfn *p_hwfn)
11418c2ecf20Sopenharmony_ci{
11428c2ecf20Sopenharmony_ci	return -EINVAL;
11438c2ecf20Sopenharmony_ci}
11448c2ecf20Sopenharmony_ci
11458c2ecf20Sopenharmony_cistatic inline u16 qed_vf_get_igu_sb_id(struct qed_hwfn *p_hwfn, u16 sb_id)
11468c2ecf20Sopenharmony_ci{
11478c2ecf20Sopenharmony_ci	return 0;
11488c2ecf20Sopenharmony_ci}
11498c2ecf20Sopenharmony_ci
11508c2ecf20Sopenharmony_cistatic inline void qed_vf_set_sb_info(struct qed_hwfn *p_hwfn, u16 sb_id,
11518c2ecf20Sopenharmony_ci				      struct qed_sb_info *p_sb)
11528c2ecf20Sopenharmony_ci{
11538c2ecf20Sopenharmony_ci}
11548c2ecf20Sopenharmony_ci
11558c2ecf20Sopenharmony_cistatic inline int qed_vf_pf_vport_start(struct qed_hwfn *p_hwfn,
11568c2ecf20Sopenharmony_ci					u8 vport_id,
11578c2ecf20Sopenharmony_ci					u16 mtu,
11588c2ecf20Sopenharmony_ci					u8 inner_vlan_removal,
11598c2ecf20Sopenharmony_ci					enum qed_tpa_mode tpa_mode,
11608c2ecf20Sopenharmony_ci					u8 max_buffers_per_cqe,
11618c2ecf20Sopenharmony_ci					u8 only_untagged)
11628c2ecf20Sopenharmony_ci{
11638c2ecf20Sopenharmony_ci	return -EINVAL;
11648c2ecf20Sopenharmony_ci}
11658c2ecf20Sopenharmony_ci
11668c2ecf20Sopenharmony_cistatic inline int qed_vf_pf_vport_stop(struct qed_hwfn *p_hwfn)
11678c2ecf20Sopenharmony_ci{
11688c2ecf20Sopenharmony_ci	return -EINVAL;
11698c2ecf20Sopenharmony_ci}
11708c2ecf20Sopenharmony_ci
11718c2ecf20Sopenharmony_cistatic inline int qed_vf_pf_filter_ucast(struct qed_hwfn *p_hwfn,
11728c2ecf20Sopenharmony_ci					 struct qed_filter_ucast *p_param)
11738c2ecf20Sopenharmony_ci{
11748c2ecf20Sopenharmony_ci	return -EINVAL;
11758c2ecf20Sopenharmony_ci}
11768c2ecf20Sopenharmony_ci
11778c2ecf20Sopenharmony_cistatic inline void qed_vf_pf_filter_mcast(struct qed_hwfn *p_hwfn,
11788c2ecf20Sopenharmony_ci					  struct qed_filter_mcast *p_filter_cmd)
11798c2ecf20Sopenharmony_ci{
11808c2ecf20Sopenharmony_ci}
11818c2ecf20Sopenharmony_ci
11828c2ecf20Sopenharmony_cistatic inline int qed_vf_pf_int_cleanup(struct qed_hwfn *p_hwfn)
11838c2ecf20Sopenharmony_ci{
11848c2ecf20Sopenharmony_ci	return -EINVAL;
11858c2ecf20Sopenharmony_ci}
11868c2ecf20Sopenharmony_ci
11878c2ecf20Sopenharmony_cistatic inline void __qed_vf_get_link_params(struct qed_hwfn *p_hwfn,
11888c2ecf20Sopenharmony_ci					    struct qed_mcp_link_params
11898c2ecf20Sopenharmony_ci					    *p_params,
11908c2ecf20Sopenharmony_ci					    struct qed_bulletin_content
11918c2ecf20Sopenharmony_ci					    *p_bulletin)
11928c2ecf20Sopenharmony_ci{
11938c2ecf20Sopenharmony_ci}
11948c2ecf20Sopenharmony_ci
11958c2ecf20Sopenharmony_cistatic inline void __qed_vf_get_link_state(struct qed_hwfn *p_hwfn,
11968c2ecf20Sopenharmony_ci					   struct qed_mcp_link_state *p_link,
11978c2ecf20Sopenharmony_ci					   struct qed_bulletin_content
11988c2ecf20Sopenharmony_ci					   *p_bulletin)
11998c2ecf20Sopenharmony_ci{
12008c2ecf20Sopenharmony_ci}
12018c2ecf20Sopenharmony_ci
12028c2ecf20Sopenharmony_cistatic inline void
12038c2ecf20Sopenharmony_ci__qed_vf_get_link_caps(struct qed_hwfn *p_hwfn,
12048c2ecf20Sopenharmony_ci		       struct qed_mcp_link_capabilities *p_link_caps,
12058c2ecf20Sopenharmony_ci		       struct qed_bulletin_content *p_bulletin)
12068c2ecf20Sopenharmony_ci{
12078c2ecf20Sopenharmony_ci}
12088c2ecf20Sopenharmony_ci
12098c2ecf20Sopenharmony_cistatic inline void qed_iov_vf_task(struct work_struct *work)
12108c2ecf20Sopenharmony_ci{
12118c2ecf20Sopenharmony_ci}
12128c2ecf20Sopenharmony_ci
12138c2ecf20Sopenharmony_cistatic inline void
12148c2ecf20Sopenharmony_ciqed_vf_set_vf_start_tunn_update_param(struct qed_tunnel_info *p_tun)
12158c2ecf20Sopenharmony_ci{
12168c2ecf20Sopenharmony_ci}
12178c2ecf20Sopenharmony_ci
12188c2ecf20Sopenharmony_cistatic inline int qed_vf_pf_tunnel_param_update(struct qed_hwfn *p_hwfn,
12198c2ecf20Sopenharmony_ci						struct qed_tunnel_info *p_tunn)
12208c2ecf20Sopenharmony_ci{
12218c2ecf20Sopenharmony_ci	return -EINVAL;
12228c2ecf20Sopenharmony_ci}
12238c2ecf20Sopenharmony_ci
12248c2ecf20Sopenharmony_cistatic inline int qed_vf_pf_bulletin_update_mac(struct qed_hwfn *p_hwfn,
12258c2ecf20Sopenharmony_ci						u8 *p_mac)
12268c2ecf20Sopenharmony_ci{
12278c2ecf20Sopenharmony_ci	return -EINVAL;
12288c2ecf20Sopenharmony_ci}
12298c2ecf20Sopenharmony_ci
12308c2ecf20Sopenharmony_cistatic inline u32
12318c2ecf20Sopenharmony_ciqed_vf_hw_bar_size(struct qed_hwfn  *p_hwfn,
12328c2ecf20Sopenharmony_ci		   enum BAR_ID bar_id)
12338c2ecf20Sopenharmony_ci{
12348c2ecf20Sopenharmony_ci	return 0;
12358c2ecf20Sopenharmony_ci}
12368c2ecf20Sopenharmony_ci#endif
12378c2ecf20Sopenharmony_ci
12388c2ecf20Sopenharmony_ci#endif
1239