diff options
author | Roopa Prabhu <roprabhu@cisco.com> | 2011-09-21 23:44:38 -0400 |
---|---|---|
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_dev.h | |
parent | 8749b427f213e14303dfef4c1b9770f05f67916d (diff) |
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 @@ | |||
19 | #ifndef _ENIC_DEV_H_ | 19 | #ifndef _ENIC_DEV_H_ |
20 | #define _ENIC_DEV_H_ | 20 | #define _ENIC_DEV_H_ |
21 | 21 | ||
22 | #include "vnic_dev.h" | ||
23 | |||
24 | /* | ||
25 | * Calls the devcmd function given by argument vnicdevcmdfn. | ||
26 | * If vf argument is valid, it proxies the devcmd | ||
27 | */ | ||
28 | #define ENIC_DEVCMD_PROXY_BY_INDEX(vf, err, enic, vnicdevcmdfn, ...) \ | ||
29 | do { \ | ||
30 | spin_lock(&enic->devcmd_lock); \ | ||
31 | if (enic_is_valid_vf(enic, vf)) { \ | ||
32 | vnic_dev_cmd_proxy_by_index_start(enic->vdev, vf); \ | ||
33 | err = vnicdevcmdfn(enic->vdev, ##__VA_ARGS__); \ | ||
34 | vnic_dev_cmd_proxy_end(enic->vdev); \ | ||
35 | } else { \ | ||
36 | err = vnicdevcmdfn(enic->vdev, ##__VA_ARGS__); \ | ||
37 | } \ | ||
38 | spin_unlock(&enic->devcmd_lock); \ | ||
39 | } while (0) | ||
40 | |||
22 | int enic_dev_fw_info(struct enic *enic, struct vnic_devcmd_fw_info **fw_info); | 41 | int enic_dev_fw_info(struct enic *enic, struct vnic_devcmd_fw_info **fw_info); |
23 | int enic_dev_stats_dump(struct enic *enic, struct vnic_stats **vstats); | 42 | int enic_dev_stats_dump(struct enic *enic, struct vnic_stats **vstats); |
24 | int enic_dev_add_station_addr(struct enic *enic); | 43 | int enic_dev_add_station_addr(struct enic *enic); |