18c2ecf20Sopenharmony_ci/* Broadcom NetXtreme-C/E network driver.
28c2ecf20Sopenharmony_ci *
38c2ecf20Sopenharmony_ci * Copyright (c) 2014-2016 Broadcom Corporation
48c2ecf20Sopenharmony_ci * Copyright (c) 2016-2018 Broadcom Limited
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * This program is free software; you can redistribute it and/or modify
78c2ecf20Sopenharmony_ci * it under the terms of the GNU General Public License as published by
88c2ecf20Sopenharmony_ci * the Free Software Foundation.
98c2ecf20Sopenharmony_ci */
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#ifndef BNXT_SRIOV_H
128c2ecf20Sopenharmony_ci#define BNXT_SRIOV_H
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#define BNXT_FWD_RESP_SIZE_ERR(n)					\
158c2ecf20Sopenharmony_ci	((offsetof(struct hwrm_fwd_resp_input, encap_resp) + n) >	\
168c2ecf20Sopenharmony_ci	 sizeof(struct hwrm_fwd_resp_input))
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci#define BNXT_EXEC_FWD_RESP_SIZE_ERR(n)					\
198c2ecf20Sopenharmony_ci	((offsetof(struct hwrm_exec_fwd_resp_input, encap_request) + n) >\
208c2ecf20Sopenharmony_ci	 offsetof(struct hwrm_exec_fwd_resp_input, encap_resp_target_id))
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci#define BNXT_REJ_FWD_RESP_SIZE_ERR(n)					\
238c2ecf20Sopenharmony_ci	((offsetof(struct hwrm_reject_fwd_resp_input, encap_request) + n) >\
248c2ecf20Sopenharmony_ci	 offsetof(struct hwrm_reject_fwd_resp_input, encap_resp_target_id))
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci#define BNXT_VF_MIN_RSS_CTX	1
278c2ecf20Sopenharmony_ci#define BNXT_VF_MAX_RSS_CTX	1
288c2ecf20Sopenharmony_ci#define BNXT_VF_MIN_L2_CTX	1
298c2ecf20Sopenharmony_ci#define BNXT_VF_MAX_L2_CTX	4
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ciint bnxt_get_vf_config(struct net_device *, int, struct ifla_vf_info *);
328c2ecf20Sopenharmony_ciint bnxt_set_vf_mac(struct net_device *, int, u8 *);
338c2ecf20Sopenharmony_ciint bnxt_set_vf_vlan(struct net_device *, int, u16, u8, __be16);
348c2ecf20Sopenharmony_ciint bnxt_set_vf_bw(struct net_device *, int, int, int);
358c2ecf20Sopenharmony_ciint bnxt_set_vf_link_state(struct net_device *, int, int);
368c2ecf20Sopenharmony_ciint bnxt_set_vf_spoofchk(struct net_device *, int, bool);
378c2ecf20Sopenharmony_ciint bnxt_set_vf_trust(struct net_device *dev, int vf_id, bool trust);
388c2ecf20Sopenharmony_ciint bnxt_sriov_configure(struct pci_dev *pdev, int num_vfs);
398c2ecf20Sopenharmony_ciint bnxt_cfg_hw_sriov(struct bnxt *bp, int *num_vfs, bool reset);
408c2ecf20Sopenharmony_civoid bnxt_sriov_disable(struct bnxt *);
418c2ecf20Sopenharmony_civoid bnxt_hwrm_exec_fwd_req(struct bnxt *);
428c2ecf20Sopenharmony_civoid bnxt_update_vf_mac(struct bnxt *);
438c2ecf20Sopenharmony_ciint bnxt_approve_mac(struct bnxt *, u8 *, bool);
448c2ecf20Sopenharmony_ci#endif
45