|
@@ -3046,6 +3046,26 @@ static int efx_pci_probe(struct pci_dev *pci_dev,
|
|
return rc;
|
|
return rc;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/* efx_pci_sriov_configure returns the actual number of Virtual Functions
|
|
|
|
+ * enabled on success
|
|
|
|
+ */
|
|
|
|
+#ifdef CONFIG_SFC_SRIOV
|
|
|
|
+static int efx_pci_sriov_configure(struct pci_dev *dev, int num_vfs)
|
|
|
|
+{
|
|
|
|
+ int rc;
|
|
|
|
+ struct efx_nic *efx = pci_get_drvdata(dev);
|
|
|
|
+
|
|
|
|
+ if (efx->type->sriov_configure) {
|
|
|
|
+ rc = efx->type->sriov_configure(efx, num_vfs);
|
|
|
|
+ if (rc)
|
|
|
|
+ return rc;
|
|
|
|
+ else
|
|
|
|
+ return num_vfs;
|
|
|
|
+ } else
|
|
|
|
+ return -EOPNOTSUPP;
|
|
|
|
+}
|
|
|
|
+#endif
|
|
|
|
+
|
|
static int efx_pm_freeze(struct device *dev)
|
|
static int efx_pm_freeze(struct device *dev)
|
|
{
|
|
{
|
|
struct efx_nic *efx = pci_get_drvdata(to_pci_dev(dev));
|
|
struct efx_nic *efx = pci_get_drvdata(to_pci_dev(dev));
|
|
@@ -3268,6 +3288,9 @@ static struct pci_driver efx_pci_driver = {
|
|
.remove = efx_pci_remove,
|
|
.remove = efx_pci_remove,
|
|
.driver.pm = &efx_pm_ops,
|
|
.driver.pm = &efx_pm_ops,
|
|
.err_handler = &efx_err_handlers,
|
|
.err_handler = &efx_err_handlers,
|
|
|
|
+#ifdef CONFIG_SFC_SRIOV
|
|
|
|
+ .sriov_configure = efx_pci_sriov_configure,
|
|
|
|
+#endif
|
|
};
|
|
};
|
|
|
|
|
|
/**************************************************************************
|
|
/**************************************************************************
|