Link: https://lore.kernel.org/r/20260217200002.683975158@linuxfoundation.org Tested-by: Florian Fainelli <florian.fainelli@broadcom.com> Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com> Tested-by: Peter Schneider <pschneider1968@googlemail.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Salvatore Bonaccorso <carnil@debian.org> Tested-by: Brett A C Sheffield <bacs@librecast.net> Tested-by: Mark Brown <broonie@kernel.org> Tested-by: Luna Jernberg <droidbittin@gmail.com> Tested-by: Ronald Warsow <rwarsow@gmx.de> Tested-by: Justin M. Forbes <jforbes@fedoraproject.org> Tested-by: Ron Economos <re@w6rz.net> Tested-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
40 lines
940 B
C
40 lines
940 B
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
// Copyright 2013 Cisco Systems, Inc. All rights reserved.
|
|
|
|
#include <linux/netdevice.h>
|
|
#include <linux/spinlock.h>
|
|
|
|
#include "vnic_dev.h"
|
|
#include "vnic_devcmd.h"
|
|
|
|
#include "enic_res.h"
|
|
#include "enic.h"
|
|
#include "enic_api.h"
|
|
|
|
int enic_api_devcmd_proxy_by_index(struct net_device *netdev, int vf,
|
|
enum vnic_devcmd_cmd cmd, u64 *a0, u64 *a1, int wait)
|
|
{
|
|
int err;
|
|
struct enic *enic = netdev_priv(netdev);
|
|
struct vnic_dev *vdev = enic->vdev;
|
|
|
|
spin_lock(&enic->enic_api_lock);
|
|
while (enic->enic_api_busy) {
|
|
spin_unlock(&enic->enic_api_lock);
|
|
cpu_relax();
|
|
spin_lock(&enic->enic_api_lock);
|
|
}
|
|
|
|
spin_lock_bh(&enic->devcmd_lock);
|
|
|
|
vnic_dev_cmd_proxy_by_index_start(vdev, vf);
|
|
err = vnic_dev_cmd(vdev, cmd, a0, a1, wait);
|
|
vnic_dev_cmd_proxy_end(vdev);
|
|
|
|
spin_unlock_bh(&enic->devcmd_lock);
|
|
spin_unlock(&enic->enic_api_lock);
|
|
|
|
return err;
|
|
}
|
|
EXPORT_SYMBOL(enic_api_devcmd_proxy_by_index);
|