diff options
author | Roopa Prabhu <roprabhu@cisco.com> | 2011-09-22 03:44:38 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-09-27 01:10:24 -0400 |
commit | 889d13f53cf9d741398637b6e8e578c65bb792e8 (patch) | |
tree | 9e87db0a201131d272cd18f5bfd24743eddb90de /drivers/net/ethernet/cisco/enic/enic_main.c | |
parent | 8749b427f213e14303dfef4c1b9770f05f67916d (diff) | |
download | linux-889d13f53cf9d741398637b6e8e578c65bb792e8.tar.bz2 |
enic: Helper code for SRIOV proxy commands
This patch adds helper functions to use PF as proxy for SRIOV VF firmware
commands.
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: Sujith Sankar <ssujith@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
Signed-off-by: David Wang <dwang2@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cisco/enic/enic_main.c')
-rw-r--r-- | drivers/net/ethernet/cisco/enic/enic_main.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c index eced800c3429..59ba590c0526 100644 --- a/drivers/net/ethernet/cisco/enic/enic_main.c +++ b/drivers/net/ethernet/cisco/enic/enic_main.c @@ -132,6 +132,15 @@ int enic_sriov_enabled(struct enic *enic) return (enic->priv_flags & ENIC_SRIOV_ENABLED) ? 1 : 0; } +int enic_is_valid_vf(struct enic *enic, int vf) +{ +#ifdef CONFIG_PCI_IOV + return vf >= 0 && vf < enic->num_vfs; +#else + return 0; +#endif +} + static inline unsigned int enic_cq_rq(struct enic *enic, unsigned int rq) { return rq; |