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>
This commit is contained in:
Mammatha Edhala 2011-05-18 03:26:22 +00:00 committed by David S. Miller
parent 0be6bc62cd
commit 12f4d0a877
2 changed files with 13 additions and 9 deletions

View File

@ -49,6 +49,7 @@
#define OC_DEVICE_ID1 0x700 /* Device Id for BE2 cards */
#define OC_DEVICE_ID2 0x710 /* Device Id for BE3 cards */
#define OC_DEVICE_ID3 0xe220 /* Device id for Lancer cards */
#define OC_DEVICE_ID4 0xe228 /* Device id for VF in Lancer */
static inline char *nic_name(struct pci_dev *pdev)
{
@ -58,6 +59,7 @@ static inline char *nic_name(struct pci_dev *pdev)
case OC_DEVICE_ID2:
return OC_NAME_BE;
case OC_DEVICE_ID3:
case OC_DEVICE_ID4:
return OC_NAME_LANCER;
case BE_DEVICE_ID2:
return BE3_NAME;
@ -383,7 +385,8 @@ struct be_adapter {
#define BE_GEN2 2
#define BE_GEN3 3
#define lancer_chip(adapter) (adapter->pdev->device == OC_DEVICE_ID3)
#define lancer_chip(adapter) ((adapter->pdev->device == OC_DEVICE_ID3) || \
(adapter->pdev->device == OC_DEVICE_ID4))
extern const struct ethtool_ops be_ethtool_ops;

View File

@ -42,6 +42,7 @@ static DEFINE_PCI_DEVICE_TABLE(be_dev_ids) = {
{ PCI_DEVICE(BE_VENDOR_ID, OC_DEVICE_ID1) },
{ PCI_DEVICE(BE_VENDOR_ID, OC_DEVICE_ID2) },
{ PCI_DEVICE(EMULEX_VENDOR_ID, OC_DEVICE_ID3)},
{ PCI_DEVICE(EMULEX_VENDOR_ID, OC_DEVICE_ID4)},
{ 0 }
};
MODULE_DEVICE_TABLE(pci, be_dev_ids);
@ -3161,7 +3162,8 @@ static int be_get_config(struct be_adapter *adapter)
memset(mac, 0, ETH_ALEN);
if (be_physfn(adapter)) {
/* A default permanent address is given to each VF for Lancer*/
if (be_physfn(adapter) || lancer_chip(adapter)) {
status = be_cmd_mac_addr_query(adapter, mac,
MAC_ADDRESS_TYPE_NETWORK, true /*permanent */, 0);
@ -3203,6 +3205,7 @@ static int be_dev_family_check(struct be_adapter *adapter)
adapter->generation = BE_GEN3;
break;
case OC_DEVICE_ID3:
case OC_DEVICE_ID4:
pci_read_config_dword(pdev, SLI_INTF_REG_OFFSET, &sli_intf);
if_type = (sli_intf & SLI_INTF_IF_TYPE_MASK) >>
SLI_INTF_IF_TYPE_SHIFT;
@ -3212,10 +3215,6 @@ static int be_dev_family_check(struct be_adapter *adapter)
dev_err(&pdev->dev, "SLI_INTF reg val is not valid\n");
return -EINVAL;
}
if (num_vfs > 0) {
dev_err(&pdev->dev, "VFs not supported\n");
return -EINVAL;
}
adapter->sli_family = ((sli_intf & SLI_INTF_FAMILY_MASK) >>
SLI_INTF_FAMILY_SHIFT);
adapter->generation = BE_GEN3;
@ -3381,9 +3380,11 @@ static int __devinit be_probe(struct pci_dev *pdev,
bool link_up;
u16 vf, lnk_speed;
status = be_vf_eth_addr_config(adapter);
if (status)
goto unreg_netdev;
if (!lancer_chip(adapter)) {
status = be_vf_eth_addr_config(adapter);
if (status)
goto unreg_netdev;
}
for (vf = 0; vf < num_vfs; vf++) {
status = be_cmd_link_status_query(adapter, &link_up,