162306a36Sopenharmony_ci/* Broadcom NetXtreme-C/E network driver.
262306a36Sopenharmony_ci *
362306a36Sopenharmony_ci * Copyright (c) 2014-2016 Broadcom Corporation
462306a36Sopenharmony_ci * Copyright (c) 2016-2018 Broadcom Limited
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci * This program is free software; you can redistribute it and/or modify
762306a36Sopenharmony_ci * it under the terms of the GNU General Public License as published by
862306a36Sopenharmony_ci * the Free Software Foundation.
962306a36Sopenharmony_ci */
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ci#ifndef BNXT_SRIOV_H
1262306a36Sopenharmony_ci#define BNXT_SRIOV_H
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci#define BNXT_FWD_RESP_SIZE_ERR(n)					\
1562306a36Sopenharmony_ci	((offsetof(struct hwrm_fwd_resp_input, encap_resp) + n) >	\
1662306a36Sopenharmony_ci	 sizeof(struct hwrm_fwd_resp_input))
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci#define BNXT_EXEC_FWD_RESP_SIZE_ERR(n)					\
1962306a36Sopenharmony_ci	((offsetof(struct hwrm_exec_fwd_resp_input, encap_request) + n) >\
2062306a36Sopenharmony_ci	 offsetof(struct hwrm_exec_fwd_resp_input, encap_resp_target_id))
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ci#define BNXT_REJ_FWD_RESP_SIZE_ERR(n)					\
2362306a36Sopenharmony_ci	((offsetof(struct hwrm_reject_fwd_resp_input, encap_request) + n) >\
2462306a36Sopenharmony_ci	 offsetof(struct hwrm_reject_fwd_resp_input, encap_resp_target_id))
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ci#define BNXT_VF_MIN_RSS_CTX	1
2762306a36Sopenharmony_ci#define BNXT_VF_MAX_RSS_CTX	1
2862306a36Sopenharmony_ci#define BNXT_VF_MIN_L2_CTX	1
2962306a36Sopenharmony_ci#define BNXT_VF_MAX_L2_CTX	4
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ciint bnxt_get_vf_config(struct net_device *, int, struct ifla_vf_info *);
3262306a36Sopenharmony_ciint bnxt_set_vf_mac(struct net_device *, int, u8 *);
3362306a36Sopenharmony_ciint bnxt_set_vf_vlan(struct net_device *, int, u16, u8, __be16);
3462306a36Sopenharmony_ciint bnxt_set_vf_bw(struct net_device *, int, int, int);
3562306a36Sopenharmony_ciint bnxt_set_vf_link_state(struct net_device *, int, int);
3662306a36Sopenharmony_ciint bnxt_set_vf_spoofchk(struct net_device *, int, bool);
3762306a36Sopenharmony_cibool bnxt_is_trusted_vf(struct bnxt *bp, struct bnxt_vf_info *vf);
3862306a36Sopenharmony_ciint bnxt_set_vf_trust(struct net_device *dev, int vf_id, bool trust);
3962306a36Sopenharmony_ciint bnxt_sriov_configure(struct pci_dev *pdev, int num_vfs);
4062306a36Sopenharmony_ciint bnxt_cfg_hw_sriov(struct bnxt *bp, int *num_vfs, bool reset);
4162306a36Sopenharmony_civoid bnxt_sriov_disable(struct bnxt *);
4262306a36Sopenharmony_civoid bnxt_hwrm_exec_fwd_req(struct bnxt *);
4362306a36Sopenharmony_civoid bnxt_update_vf_mac(struct bnxt *);
4462306a36Sopenharmony_ciint bnxt_approve_mac(struct bnxt *, const u8 *, bool);
4562306a36Sopenharmony_ci#endif
46