bnxt_vfr.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* Broadcom NetXtreme-C/E network driver.
  2. *
  3. * Copyright (c) 2016-2017 Broadcom Limited
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation.
  8. */
  9. #ifndef BNXT_VFR_H
  10. #define BNXT_VFR_H
  11. #ifdef CONFIG_BNXT_SRIOV
  12. #define MAX_CFA_CODE 65536
  13. void bnxt_vf_reps_destroy(struct bnxt *bp);
  14. void bnxt_vf_reps_close(struct bnxt *bp);
  15. void bnxt_vf_reps_open(struct bnxt *bp);
  16. void bnxt_vf_rep_rx(struct bnxt *bp, struct sk_buff *skb);
  17. struct net_device *bnxt_get_vf_rep(struct bnxt *bp, u16 cfa_code);
  18. static inline u16 bnxt_vf_rep_get_fid(struct net_device *dev)
  19. {
  20. struct bnxt_vf_rep *vf_rep = netdev_priv(dev);
  21. struct bnxt *bp = vf_rep->bp;
  22. return bp->pf.vf[vf_rep->vf_idx].fw_fid;
  23. }
  24. bool bnxt_dev_is_vf_rep(struct net_device *dev);
  25. int bnxt_dl_eswitch_mode_get(struct devlink *devlink, u16 *mode);
  26. int bnxt_dl_eswitch_mode_set(struct devlink *devlink, u16 mode);
  27. #else
  28. static inline void bnxt_vf_reps_close(struct bnxt *bp)
  29. {
  30. }
  31. static inline void bnxt_vf_reps_open(struct bnxt *bp)
  32. {
  33. }
  34. static inline void bnxt_vf_rep_rx(struct bnxt *bp, struct sk_buff *skb)
  35. {
  36. }
  37. static inline struct net_device *bnxt_get_vf_rep(struct bnxt *bp, u16 cfa_code)
  38. {
  39. return NULL;
  40. }
  41. static inline u16 bnxt_vf_rep_get_fid(struct net_device *dev)
  42. {
  43. return 0;
  44. }
  45. static inline bool bnxt_dev_is_vf_rep(struct net_device *dev)
  46. {
  47. return false;
  48. }
  49. #endif /* CONFIG_BNXT_SRIOV */
  50. #endif /* BNXT_VFR_H */