Commit 18c57c74 authored by Kalesh AP's avatar Kalesh AP Committed by David S. Miller

be2net: use be_virtfn() instead of !be_physfn()

Use be_virtfn() to determine a VF instead of !be_physfn() for better
readability.
Signed-off-by: default avatarSathya Perla <sathya.perla@avagotech.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a6e6ff6e
...@@ -1458,7 +1458,7 @@ int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags, u32 en_flags, ...@@ -1458,7 +1458,7 @@ int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags, u32 en_flags,
*if_handle = le32_to_cpu(resp->interface_id); *if_handle = le32_to_cpu(resp->interface_id);
/* Hack to retrieve VF's pmac-id on BE3 */ /* Hack to retrieve VF's pmac-id on BE3 */
if (BE3_chip(adapter) && !be_physfn(adapter)) if (BE3_chip(adapter) && be_virtfn(adapter))
adapter->pmac_id[0] = le32_to_cpu(resp->pmac_id); adapter->pmac_id[0] = le32_to_cpu(resp->pmac_id);
} }
return status; return status;
...@@ -3271,7 +3271,7 @@ static bool be_is_wol_excluded(struct be_adapter *adapter) ...@@ -3271,7 +3271,7 @@ static bool be_is_wol_excluded(struct be_adapter *adapter)
{ {
struct pci_dev *pdev = adapter->pdev; struct pci_dev *pdev = adapter->pdev;
if (!be_physfn(adapter)) if (be_virtfn(adapter))
return true; return true;
switch (pdev->subsystem_device) { switch (pdev->subsystem_device) {
......
...@@ -3112,7 +3112,7 @@ static int be_msix_enable(struct be_adapter *adapter) ...@@ -3112,7 +3112,7 @@ static int be_msix_enable(struct be_adapter *adapter)
dev_warn(dev, "MSIx enable failed\n"); dev_warn(dev, "MSIx enable failed\n");
/* INTx is not supported in VFs, so fail probe if enable_msix fails */ /* INTx is not supported in VFs, so fail probe if enable_msix fails */
if (!be_physfn(adapter)) if (be_virtfn(adapter))
return num_vec; return num_vec;
return 0; return 0;
} }
...@@ -3159,7 +3159,7 @@ static int be_irq_register(struct be_adapter *adapter) ...@@ -3159,7 +3159,7 @@ static int be_irq_register(struct be_adapter *adapter)
if (status == 0) if (status == 0)
goto done; goto done;
/* INTx is not supported for VF */ /* INTx is not supported for VF */
if (!be_physfn(adapter)) if (be_virtfn(adapter))
return status; return status;
} }
...@@ -3840,8 +3840,9 @@ static void BEx_get_resources(struct be_adapter *adapter, ...@@ -3840,8 +3840,9 @@ static void BEx_get_resources(struct be_adapter *adapter,
* *only* if it is RSS-capable. * *only* if it is RSS-capable.
*/ */
if (BE2_chip(adapter) || use_sriov || (adapter->port_num > 1) || if (BE2_chip(adapter) || use_sriov || (adapter->port_num > 1) ||
!be_physfn(adapter) || (be_is_mc(adapter) && be_virtfn(adapter) ||
!(adapter->function_caps & BE_FUNCTION_CAPS_RSS))) { (be_is_mc(adapter) &&
!(adapter->function_caps & BE_FUNCTION_CAPS_RSS))) {
res->max_tx_qs = 1; res->max_tx_qs = 1;
} else if (adapter->function_caps & BE_FUNCTION_CAPS_SUPER_NIC) { } else if (adapter->function_caps & BE_FUNCTION_CAPS_SUPER_NIC) {
struct be_resources super_nic_res = {0}; struct be_resources super_nic_res = {0};
...@@ -5289,7 +5290,7 @@ static void be_unmap_pci_bars(struct be_adapter *adapter) ...@@ -5289,7 +5290,7 @@ static void be_unmap_pci_bars(struct be_adapter *adapter)
static int db_bar(struct be_adapter *adapter) static int db_bar(struct be_adapter *adapter)
{ {
if (lancer_chip(adapter) || !be_physfn(adapter)) if (lancer_chip(adapter) || be_virtfn(adapter))
return 0; return 0;
else else
return 4; return 4;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment