aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet/be_main.c
diff options
context:
space:
mode:
authorMammatha Edhala <mammatha.edhala@emulex.com>2011-05-17 23:26:22 -0400
committerDavid S. Miller <davem@davemloft.net>2011-05-18 17:30:56 -0400
commit12f4d0a8770ab26639091d0b2509b19681daad69 (patch)
tree91db0c4c7ac2735261e653b5a3a1903825e45f86 /drivers/net/benet/be_main.c
parent0be6bc62cdd5e1bed75b2122ba7d26fc245b534b (diff)
be2net: Enable SR-IOV for Lancer
Enable SR-IOV for Lancer Signed-off-by: Mammatha Edhala <mammatha.edhala@emulex.com> Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet/be_main.c')
-rw-r--r--drivers/net/benet/be_main.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 7322a511e936..ce6edac007a7 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -42,6 +42,7 @@ static DEFINE_PCI_DEVICE_TABLE(be_dev_ids) = {
42 { PCI_DEVICE(BE_VENDOR_ID, OC_DEVICE_ID1) }, 42 { PCI_DEVICE(BE_VENDOR_ID, OC_DEVICE_ID1) },
43 { PCI_DEVICE(BE_VENDOR_ID, OC_DEVICE_ID2) }, 43 { PCI_DEVICE(BE_VENDOR_ID, OC_DEVICE_ID2) },
44 { PCI_DEVICE(EMULEX_VENDOR_ID, OC_DEVICE_ID3)}, 44 { PCI_DEVICE(EMULEX_VENDOR_ID, OC_DEVICE_ID3)},
45 { PCI_DEVICE(EMULEX_VENDOR_ID, OC_DEVICE_ID4)},
45 { 0 } 46 { 0 }
46}; 47};
47MODULE_DEVICE_TABLE(pci, be_dev_ids); 48MODULE_DEVICE_TABLE(pci, be_dev_ids);
@@ -3161,7 +3162,8 @@ static int be_get_config(struct be_adapter *adapter)
3161 3162
3162 memset(mac, 0, ETH_ALEN); 3163 memset(mac, 0, ETH_ALEN);
3163 3164
3164 if (be_physfn(adapter)) { 3165 /* A default permanent address is given to each VF for Lancer*/
3166 if (be_physfn(adapter) || lancer_chip(adapter)) {
3165 status = be_cmd_mac_addr_query(adapter, mac, 3167 status = be_cmd_mac_addr_query(adapter, mac,
3166 MAC_ADDRESS_TYPE_NETWORK, true /*permanent */, 0); 3168 MAC_ADDRESS_TYPE_NETWORK, true /*permanent */, 0);
3167 3169
@@ -3203,6 +3205,7 @@ static int be_dev_family_check(struct be_adapter *adapter)
3203 adapter->generation = BE_GEN3; 3205 adapter->generation = BE_GEN3;
3204 break; 3206 break;
3205 case OC_DEVICE_ID3: 3207 case OC_DEVICE_ID3:
3208 case OC_DEVICE_ID4:
3206 pci_read_config_dword(pdev, SLI_INTF_REG_OFFSET, &sli_intf); 3209 pci_read_config_dword(pdev, SLI_INTF_REG_OFFSET, &sli_intf);
3207 if_type = (sli_intf & SLI_INTF_IF_TYPE_MASK) >> 3210 if_type = (sli_intf & SLI_INTF_IF_TYPE_MASK) >>
3208 SLI_INTF_IF_TYPE_SHIFT; 3211 SLI_INTF_IF_TYPE_SHIFT;
@@ -3212,10 +3215,6 @@ static int be_dev_family_check(struct be_adapter *adapter)
3212 dev_err(&pdev->dev, "SLI_INTF reg val is not valid\n"); 3215 dev_err(&pdev->dev, "SLI_INTF reg val is not valid\n");
3213 return -EINVAL; 3216 return -EINVAL;
3214 } 3217 }
3215 if (num_vfs > 0) {
3216 dev_err(&pdev->dev, "VFs not supported\n");
3217 return -EINVAL;
3218 }
3219 adapter->sli_family = ((sli_intf & SLI_INTF_FAMILY_MASK) >> 3218 adapter->sli_family = ((sli_intf & SLI_INTF_FAMILY_MASK) >>
3220 SLI_INTF_FAMILY_SHIFT); 3219 SLI_INTF_FAMILY_SHIFT);
3221 adapter->generation = BE_GEN3; 3220 adapter->generation = BE_GEN3;
@@ -3381,9 +3380,11 @@ static int __devinit be_probe(struct pci_dev *pdev,
3381 bool link_up; 3380 bool link_up;
3382 u16 vf, lnk_speed; 3381 u16 vf, lnk_speed;
3383 3382
3384 status = be_vf_eth_addr_config(adapter); 3383 if (!lancer_chip(adapter)) {
3385 if (status) 3384 status = be_vf_eth_addr_config(adapter);
3386 goto unreg_netdev; 3385 if (status)
3386 goto unreg_netdev;
3387 }
3387 3388
3388 for (vf = 0; vf < num_vfs; vf++) { 3389 for (vf = 0; vf < num_vfs; vf++) {
3389 status = be_cmd_link_status_query(adapter, &link_up, 3390 status = be_cmd_link_status_query(adapter, &link_up,