diff options
Diffstat (limited to 'drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c')
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c index 660c3f5b2237..c6165d05cc13 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c | |||
@@ -465,8 +465,14 @@ static ssize_t qlcnic_sysfs_read_pm_config(struct file *filp, | |||
465 | memset(&pm_cfg, 0, | 465 | memset(&pm_cfg, 0, |
466 | sizeof(struct qlcnic_pm_func_cfg) * QLCNIC_MAX_PCI_FUNC); | 466 | sizeof(struct qlcnic_pm_func_cfg) * QLCNIC_MAX_PCI_FUNC); |
467 | 467 | ||
468 | for (i = 0; i < adapter->ahw->act_pci_func; i++) { | 468 | for (i = 0; i < QLCNIC_MAX_PCI_FUNC; i++) { |
469 | pci_func = adapter->npars[i].pci_func; | 469 | pci_func = adapter->npars[i].pci_func; |
470 | if (!adapter->npars[i].active) | ||
471 | continue; | ||
472 | |||
473 | if (!adapter->npars[i].eswitch_status) | ||
474 | continue; | ||
475 | |||
470 | pm_cfg[pci_func].action = adapter->npars[i].enable_pm; | 476 | pm_cfg[pci_func].action = adapter->npars[i].enable_pm; |
471 | pm_cfg[pci_func].dest_npar = 0; | 477 | pm_cfg[pci_func].dest_npar = 0; |
472 | pm_cfg[pci_func].pci_func = i; | 478 | pm_cfg[pci_func].pci_func = i; |
@@ -632,8 +638,14 @@ static ssize_t qlcnic_sysfs_read_esw_config(struct file *file, | |||
632 | memset(&esw_cfg, 0, | 638 | memset(&esw_cfg, 0, |
633 | sizeof(struct qlcnic_esw_func_cfg) * QLCNIC_MAX_PCI_FUNC); | 639 | sizeof(struct qlcnic_esw_func_cfg) * QLCNIC_MAX_PCI_FUNC); |
634 | 640 | ||
635 | for (i = 0; i < adapter->ahw->act_pci_func; i++) { | 641 | for (i = 0; i < QLCNIC_MAX_PCI_FUNC; i++) { |
636 | pci_func = adapter->npars[i].pci_func; | 642 | pci_func = adapter->npars[i].pci_func; |
643 | if (!adapter->npars[i].active) | ||
644 | continue; | ||
645 | |||
646 | if (!adapter->npars[i].eswitch_status) | ||
647 | continue; | ||
648 | |||
637 | esw_cfg[pci_func].pci_func = pci_func; | 649 | esw_cfg[pci_func].pci_func = pci_func; |
638 | if (qlcnic_get_eswitch_port_config(adapter, &esw_cfg[pci_func])) | 650 | if (qlcnic_get_eswitch_port_config(adapter, &esw_cfg[pci_func])) |
639 | return QL_STATUS_INVALID_PARAM; | 651 | return QL_STATUS_INVALID_PARAM; |
@@ -732,6 +744,9 @@ static ssize_t qlcnic_sysfs_read_npar_config(struct file *file, | |||
732 | if (ret) | 744 | if (ret) |
733 | return ret; | 745 | return ret; |
734 | 746 | ||
747 | if (!adapter->npars[i].eswitch_status) | ||
748 | continue; | ||
749 | |||
735 | np_cfg[i].pci_func = i; | 750 | np_cfg[i].pci_func = i; |
736 | np_cfg[i].op_mode = (u8)nic_info.op_mode; | 751 | np_cfg[i].op_mode = (u8)nic_info.op_mode; |
737 | np_cfg[i].port_num = nic_info.phys_port; | 752 | np_cfg[i].port_num = nic_info.phys_port; |