mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-12 08:48:48 +00:00
enic: Add wrapper routines for new fw devcmds for port profile handling
This patch adds wrapper routines to new port profile related fw devcmds and removes the old ones Signed-off-by: Roopa Prabhu <roprabhu@cisco.com> Signed-off-by: David Wang <dwang2@cisco.com> Signed-off-by: Christian Benvenuti <benve@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
9085fd0985
commit
18714ff8de
@ -177,24 +177,24 @@ int enic_vnic_dev_deinit(struct enic *enic)
|
||||
return err;
|
||||
}
|
||||
|
||||
int enic_dev_init_prov(struct enic *enic, struct vic_provinfo *vp)
|
||||
int enic_dev_init_prov2(struct enic *enic, struct vic_provinfo *vp)
|
||||
{
|
||||
int err;
|
||||
|
||||
spin_lock(&enic->devcmd_lock);
|
||||
err = vnic_dev_init_prov(enic->vdev,
|
||||
err = vnic_dev_init_prov2(enic->vdev,
|
||||
(u8 *)vp, vic_provinfo_size(vp));
|
||||
spin_unlock(&enic->devcmd_lock);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
int enic_dev_init_done(struct enic *enic, int *done, int *error)
|
||||
int enic_dev_deinit_done(struct enic *enic, int *status)
|
||||
{
|
||||
int err;
|
||||
|
||||
spin_lock(&enic->devcmd_lock);
|
||||
err = vnic_dev_init_done(enic->vdev, done, error);
|
||||
err = vnic_dev_deinit_done(enic->vdev, status);
|
||||
spin_unlock(&enic->devcmd_lock);
|
||||
|
||||
return err;
|
||||
@ -219,3 +219,57 @@ void enic_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
|
||||
enic_del_vlan(enic, vid);
|
||||
spin_unlock(&enic->devcmd_lock);
|
||||
}
|
||||
|
||||
int enic_dev_enable2(struct enic *enic, int active)
|
||||
{
|
||||
int err;
|
||||
|
||||
spin_lock(&enic->devcmd_lock);
|
||||
err = vnic_dev_enable2(enic->vdev, active);
|
||||
spin_unlock(&enic->devcmd_lock);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
int enic_dev_enable2_done(struct enic *enic, int *status)
|
||||
{
|
||||
int err;
|
||||
|
||||
spin_lock(&enic->devcmd_lock);
|
||||
err = vnic_dev_enable2_done(enic->vdev, status);
|
||||
spin_unlock(&enic->devcmd_lock);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
int enic_dev_status_to_errno(int devcmd_status)
|
||||
{
|
||||
switch (devcmd_status) {
|
||||
case ERR_SUCCESS:
|
||||
return 0;
|
||||
case ERR_EINVAL:
|
||||
return -EINVAL;
|
||||
case ERR_EFAULT:
|
||||
return -EFAULT;
|
||||
case ERR_EPERM:
|
||||
return -EPERM;
|
||||
case ERR_EBUSY:
|
||||
return -EBUSY;
|
||||
case ERR_ECMDUNKNOWN:
|
||||
case ERR_ENOTSUPPORTED:
|
||||
return -EOPNOTSUPP;
|
||||
case ERR_EBADSTATE:
|
||||
return -EINVAL;
|
||||
case ERR_ENOMEM:
|
||||
return -ENOMEM;
|
||||
case ERR_ETIMEDOUT:
|
||||
return -ETIMEDOUT;
|
||||
case ERR_ELINKDOWN:
|
||||
return -ENETDOWN;
|
||||
case ERR_EINPROGRESS:
|
||||
return -EINPROGRESS;
|
||||
case ERR_EMAXRES:
|
||||
default:
|
||||
return (devcmd_status < 0) ? devcmd_status : -1;
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,10 @@ int enic_dev_set_ig_vlan_rewrite_mode(struct enic *enic);
|
||||
int enic_dev_enable(struct enic *enic);
|
||||
int enic_dev_disable(struct enic *enic);
|
||||
int enic_vnic_dev_deinit(struct enic *enic);
|
||||
int enic_dev_init_prov(struct enic *enic, struct vic_provinfo *vp);
|
||||
int enic_dev_init_done(struct enic *enic, int *done, int *error);
|
||||
int enic_dev_init_prov2(struct enic *enic, struct vic_provinfo *vp);
|
||||
int enic_dev_deinit_done(struct enic *enic, int *status);
|
||||
int enic_dev_enable2(struct enic *enic, int arg);
|
||||
int enic_dev_enable2_done(struct enic *enic, int *status);
|
||||
int enic_dev_status_to_errno(int devcmd_status);
|
||||
|
||||
#endif /* _ENIC_DEV_H_ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user