Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 209198
b: refs/heads/master
c: ca315ac
h: refs/heads/master
v: v3
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Aug 10, 2010
1 parent a0ee760 commit b9e6751
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 00c7d9202a19091d1873954ba158375d2efd5a64
refs/heads/master: ca315ac22c1a91fc8047254b250599890d8a7b30
45 changes: 23 additions & 22 deletions trunk/drivers/net/qlcnic/qlcnic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,44 +477,45 @@ qlcnic_init_pci_info(struct qlcnic_adapter *adapter)
int i, ret = 0, err;
u8 pfn;

if (!adapter->npars)
adapter->npars = kzalloc(sizeof(struct qlcnic_npar_info) *
adapter->npars = kzalloc(sizeof(struct qlcnic_npar_info) *
QLCNIC_MAX_PCI_FUNC, GFP_KERNEL);
if (!adapter->npars)
return -ENOMEM;

if (!adapter->eswitch)
adapter->eswitch = kzalloc(sizeof(struct qlcnic_eswitch) *
adapter->eswitch = kzalloc(sizeof(struct qlcnic_eswitch) *
QLCNIC_NIU_MAX_XG_PORTS, GFP_KERNEL);
if (!adapter->eswitch) {
err = -ENOMEM;
goto err_eswitch;
goto err_npars;
}

ret = qlcnic_get_pci_info(adapter, pci_info);
if (!ret) {
for (i = 0; i < QLCNIC_MAX_PCI_FUNC; i++) {
pfn = pci_info[i].id;
if (pfn > QLCNIC_MAX_PCI_FUNC)
return QL_STATUS_INVALID_PARAM;
adapter->npars[pfn].active = pci_info[i].active;
adapter->npars[pfn].type = pci_info[i].type;
adapter->npars[pfn].phy_port = pci_info[i].default_port;
adapter->npars[pfn].mac_learning = DEFAULT_MAC_LEARN;
adapter->npars[pfn].min_bw = pci_info[i].tx_min_bw;
adapter->npars[pfn].max_bw = pci_info[i].tx_max_bw;
}

for (i = 0; i < QLCNIC_NIU_MAX_XG_PORTS; i++)
adapter->eswitch[i].flags |= QLCNIC_SWITCH_ENABLE;
if (ret)
goto err_eswitch;

return ret;
for (i = 0; i < QLCNIC_MAX_PCI_FUNC; i++) {
pfn = pci_info[i].id;
if (pfn > QLCNIC_MAX_PCI_FUNC)
return QL_STATUS_INVALID_PARAM;
adapter->npars[pfn].active = pci_info[i].active;
adapter->npars[pfn].type = pci_info[i].type;
adapter->npars[pfn].phy_port = pci_info[i].default_port;
adapter->npars[pfn].mac_learning = DEFAULT_MAC_LEARN;
adapter->npars[pfn].min_bw = pci_info[i].tx_min_bw;
adapter->npars[pfn].max_bw = pci_info[i].tx_max_bw;
}

for (i = 0; i < QLCNIC_NIU_MAX_XG_PORTS; i++)
adapter->eswitch[i].flags |= QLCNIC_SWITCH_ENABLE;

return 0;

err_eswitch:
kfree(adapter->eswitch);
adapter->eswitch = NULL;
err_eswitch:
err_npars:
kfree(adapter->npars);
adapter->npars = NULL;

return ret;
}
Expand Down

0 comments on commit b9e6751

Please sign in to comment.