2017-07-25 00:34:27 +08:00
|
|
|
/* Broadcom NetXtreme-C/E network driver.
|
|
|
|
*
|
|
|
|
* Copyright (c) 2016-2017 Broadcom Limited
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef BNXT_VFR_H
|
|
|
|
#define BNXT_VFR_H
|
|
|
|
|
2017-07-26 01:28:39 +08:00
|
|
|
#ifdef CONFIG_BNXT_SRIOV
|
|
|
|
|
2017-07-25 00:34:27 +08:00
|
|
|
#define MAX_CFA_CODE 65536
|
|
|
|
|
|
|
|
void bnxt_vf_reps_destroy(struct bnxt *bp);
|
2017-07-25 00:34:28 +08:00
|
|
|
void bnxt_vf_reps_close(struct bnxt *bp);
|
|
|
|
void bnxt_vf_reps_open(struct bnxt *bp);
|
|
|
|
void bnxt_vf_rep_rx(struct bnxt *bp, struct sk_buff *skb);
|
|
|
|
struct net_device *bnxt_get_vf_rep(struct bnxt *bp, u16 cfa_code);
|
2017-07-25 00:34:27 +08:00
|
|
|
|
2017-08-29 01:40:33 +08:00
|
|
|
static inline u16 bnxt_vf_rep_get_fid(struct net_device *dev)
|
|
|
|
{
|
|
|
|
struct bnxt_vf_rep *vf_rep = netdev_priv(dev);
|
|
|
|
struct bnxt *bp = vf_rep->bp;
|
|
|
|
|
|
|
|
return bp->pf.vf[vf_rep->vf_idx].fw_fid;
|
|
|
|
}
|
|
|
|
|
2017-10-19 22:45:56 +08:00
|
|
|
int bnxt_dl_eswitch_mode_get(struct devlink *devlink, u16 *mode);
|
|
|
|
int bnxt_dl_eswitch_mode_set(struct devlink *devlink, u16 mode);
|
2017-07-26 01:28:39 +08:00
|
|
|
|
2017-10-19 22:45:56 +08:00
|
|
|
#else
|
2017-07-26 01:28:39 +08:00
|
|
|
|
|
|
|
static inline void bnxt_vf_reps_close(struct bnxt *bp)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void bnxt_vf_reps_open(struct bnxt *bp)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void bnxt_vf_rep_rx(struct bnxt *bp, struct sk_buff *skb)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline struct net_device *bnxt_get_vf_rep(struct bnxt *bp, u16 cfa_code)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
2017-08-29 14:15:03 +08:00
|
|
|
|
|
|
|
static inline u16 bnxt_vf_rep_get_fid(struct net_device *dev)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2017-07-26 01:28:39 +08:00
|
|
|
#endif /* CONFIG_BNXT_SRIOV */
|
2017-07-25 00:34:27 +08:00
|
|
|
#endif /* BNXT_VFR_H */
|