1 /****************************************************************************
2 * Driver for Solarflare network controllers and boards
3 * Copyright 2014-2015 Solarflare Communications Inc.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published
7 * by the Free Software Foundation, incorporated herein by reference.
9 #include <linux/module.h>
10 #include "net_driver.h"
14 int efx_sriov_set_vf_mac(struct net_device *net_dev, int vf_i, u8 *mac)
16 struct efx_nic *efx = netdev_priv(net_dev);
18 if (efx->type->sriov_set_vf_mac)
19 return efx->type->sriov_set_vf_mac(efx, vf_i, mac);
24 int efx_sriov_set_vf_vlan(struct net_device *net_dev, int vf_i, u16 vlan,
27 struct efx_nic *efx = netdev_priv(net_dev);
29 if (efx->type->sriov_set_vf_vlan) {
30 if ((vlan & ~VLAN_VID_MASK) ||
31 (qos & ~(VLAN_PRIO_MASK >> VLAN_PRIO_SHIFT)))
34 return efx->type->sriov_set_vf_vlan(efx, vf_i, vlan, qos);
40 int efx_sriov_set_vf_spoofchk(struct net_device *net_dev, int vf_i,
43 struct efx_nic *efx = netdev_priv(net_dev);
45 if (efx->type->sriov_set_vf_spoofchk)
46 return efx->type->sriov_set_vf_spoofchk(efx, vf_i, spoofchk);
51 int efx_sriov_get_vf_config(struct net_device *net_dev, int vf_i,
52 struct ifla_vf_info *ivi)
54 struct efx_nic *efx = netdev_priv(net_dev);
56 if (efx->type->sriov_get_vf_config)
57 return efx->type->sriov_get_vf_config(efx, vf_i, ivi);
62 int efx_sriov_set_vf_link_state(struct net_device *net_dev, int vf_i,
65 struct efx_nic *efx = netdev_priv(net_dev);
67 if (efx->type->sriov_set_vf_link_state)
68 return efx->type->sriov_set_vf_link_state(efx, vf_i,
74 int efx_sriov_get_phys_port_id(struct net_device *net_dev,
75 struct netdev_phys_item_id *ppid)
77 struct efx_nic *efx = netdev_priv(net_dev);
79 if (efx->type->sriov_get_phys_port_id)
80 return efx->type->sriov_get_phys_port_id(efx, ppid);