bnxt_sriov.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* Broadcom NetXtreme-C/E network driver.
  2. *
  3. * Copyright (c) 2014-2016 Broadcom Corporation
  4. * Copyright (c) 2016-2018 Broadcom Limited
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation.
  9. */
  10. #ifndef BNXT_SRIOV_H
  11. #define BNXT_SRIOV_H
  12. #define BNXT_FWD_RESP_SIZE_ERR(n) \
  13. ((offsetof(struct hwrm_fwd_resp_input, encap_resp) + n) > \
  14. sizeof(struct hwrm_fwd_resp_input))
  15. #define BNXT_EXEC_FWD_RESP_SIZE_ERR(n) \
  16. ((offsetof(struct hwrm_exec_fwd_resp_input, encap_request) + n) >\
  17. offsetof(struct hwrm_exec_fwd_resp_input, encap_resp_target_id))
  18. #define BNXT_REJ_FWD_RESP_SIZE_ERR(n) \
  19. ((offsetof(struct hwrm_reject_fwd_resp_input, encap_request) + n) >\
  20. offsetof(struct hwrm_reject_fwd_resp_input, encap_resp_target_id))
  21. #define BNXT_VF_MIN_RSS_CTX 1
  22. #define BNXT_VF_MAX_RSS_CTX 1
  23. #define BNXT_VF_MIN_L2_CTX 1
  24. #define BNXT_VF_MAX_L2_CTX 4
  25. int bnxt_get_vf_config(struct net_device *, int, struct ifla_vf_info *);
  26. int bnxt_set_vf_mac(struct net_device *, int, u8 *);
  27. int bnxt_set_vf_vlan(struct net_device *, int, u16, u8, __be16);
  28. int bnxt_set_vf_bw(struct net_device *, int, int, int);
  29. int bnxt_set_vf_link_state(struct net_device *, int, int);
  30. int bnxt_set_vf_spoofchk(struct net_device *, int, bool);
  31. int bnxt_set_vf_trust(struct net_device *dev, int vf_id, bool trust);
  32. int bnxt_sriov_configure(struct pci_dev *pdev, int num_vfs);
  33. void bnxt_sriov_disable(struct bnxt *);
  34. void bnxt_hwrm_exec_fwd_req(struct bnxt *);
  35. void bnxt_update_vf_mac(struct bnxt *);
  36. int bnxt_approve_mac(struct bnxt *, u8 *, bool);
  37. #endif