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>
This commit is contained in:
Roopa Prabhu
2011-09-22 03:44:38 +00:00
committed by David S. Miller
parent 8749b427f2
commit 889d13f53c
5 changed files with 54 additions and 5 deletions

View File

@@ -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);