linux/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.h
<<
>>
Prefs
   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
  10#ifndef BNXT_VFR_H
  11#define BNXT_VFR_H
  12
  13#ifdef CONFIG_BNXT_SRIOV
  14
  15#define MAX_CFA_CODE                    65536
  16
  17void bnxt_vf_reps_destroy(struct bnxt *bp);
  18void bnxt_vf_reps_close(struct bnxt *bp);
  19void bnxt_vf_reps_open(struct bnxt *bp);
  20void bnxt_vf_rep_rx(struct bnxt *bp, struct sk_buff *skb);
  21struct net_device *bnxt_get_vf_rep(struct bnxt *bp, u16 cfa_code);
  22int bnxt_vf_reps_alloc(struct bnxt *bp);
  23void bnxt_vf_reps_free(struct bnxt *bp);
  24
  25static inline u16 bnxt_vf_rep_get_fid(struct net_device *dev)
  26{
  27        struct bnxt_vf_rep *vf_rep = netdev_priv(dev);
  28        struct bnxt *bp = vf_rep->bp;
  29
  30        return bp->pf.vf[vf_rep->vf_idx].fw_fid;
  31}
  32
  33bool bnxt_dev_is_vf_rep(struct net_device *dev);
  34int bnxt_dl_eswitch_mode_get(struct devlink *devlink, u16 *mode);
  35int bnxt_dl_eswitch_mode_set(struct devlink *devlink, u16 mode,
  36                             struct netlink_ext_ack *extack);
  37
  38#else
  39
  40static inline void bnxt_vf_reps_close(struct bnxt *bp)
  41{
  42}
  43
  44static inline void bnxt_vf_reps_open(struct bnxt *bp)
  45{
  46}
  47
  48static inline void bnxt_vf_rep_rx(struct bnxt *bp, struct sk_buff *skb)
  49{
  50}
  51
  52static inline struct net_device *bnxt_get_vf_rep(struct bnxt *bp, u16 cfa_code)
  53{
  54        return NULL;
  55}
  56
  57static inline u16 bnxt_vf_rep_get_fid(struct net_device *dev)
  58{
  59        return 0;
  60}
  61
  62static inline bool bnxt_dev_is_vf_rep(struct net_device *dev)
  63{
  64        return false;
  65}
  66
  67static inline int bnxt_vf_reps_alloc(struct bnxt *bp)
  68{
  69        return 0;
  70}
  71
  72static inline void bnxt_vf_reps_free(struct bnxt *bp)
  73{
  74}
  75
  76#endif /* CONFIG_BNXT_SRIOV */
  77#endif /* BNXT_VFR_H */
  78