diff options
author | Roopa Prabhu <roprabhu@cisco.com> | 2011-09-22 07:44:38 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-09-27 09:10:24 +0400 |
commit | 889d13f53cf9d741398637b6e8e578c65bb792e8 (patch) | |
tree | 9e87db0a201131d272cd18f5bfd24743eddb90de /drivers/net/ethernet/cisco/enic/enic_dev.h | |
parent | 8749b427f213e14303dfef4c1b9770f05f67916d (diff) | |
download | linux-889d13f53cf9d741398637b6e8e578c65bb792e8.tar.xz |
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_dev.h')
-rw-r--r-- | drivers/net/ethernet/cisco/enic/enic_dev.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/ethernet/cisco/enic/enic_dev.h b/drivers/net/ethernet/cisco/enic/enic_dev.h index ff8e87fdfc1d..1f83a4747ba0 100644 --- a/drivers/net/ethernet/cisco/enic/enic_dev.h +++ b/drivers/net/ethernet/cisco/enic/enic_dev.h @@ -19,6 +19,25 @@ #ifndef _ENIC_DEV_H_ #define _ENIC_DEV_H_ +#include "vnic_dev.h" + +/* + * Calls the devcmd function given by argument vnicdevcmdfn. + * If vf argument is valid, it proxies the devcmd + */ +#define ENIC_DEVCMD_PROXY_BY_INDEX(vf, err, enic, vnicdevcmdfn, ...) \ + do { \ + spin_lock(&enic->devcmd_lock); \ + if (enic_is_valid_vf(enic, vf)) { \ + vnic_dev_cmd_proxy_by_index_start(enic->vdev, vf); \ + err = vnicdevcmdfn(enic->vdev, ##__VA_ARGS__); \ + vnic_dev_cmd_proxy_end(enic->vdev); \ + } else { \ + err = vnicdevcmdfn(enic->vdev, ##__VA_ARGS__); \ + } \ + spin_unlock(&enic->devcmd_lock); \ + } while (0) + int enic_dev_fw_info(struct enic *enic, struct vnic_devcmd_fw_info **fw_info); int enic_dev_stats_dump(struct enic *enic, struct vnic_stats **vstats); int enic_dev_add_station_addr(struct enic *enic); |