qlcnic: Print informational messages only once during driver load.
authorSucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Fri, 18 Oct 2013 16:22:28 +0000 (12:22 -0400)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Oct 2013 17:42:19 +0000 (13:42 -0400)
Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_vnic.c
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c

index 81bf83604c4fb1c04aa0a5dfe361d1ffaefd160d..a3c4379d78f8cd78e5c194ed04f911c809720e5b 100644 (file)
@@ -1199,6 +1199,7 @@ struct qlcnic_npar_info {
        u8      promisc_mode;
        u8      offload_flags;
        u8      pci_func;
+       u8      mac[ETH_ALEN];
 };
 
 struct qlcnic_eswitch {
index 3ca00e05f23d2ade287d6c1d9047410eeac43114..66e94dc845f95b1cc1ef57fc2e55c57986e821b5 100644 (file)
@@ -2321,19 +2321,7 @@ int qlcnic_83xx_get_pci_info(struct qlcnic_adapter *adapter,
                        i++;
                        memcpy(pci_info->mac + sizeof(u32), &cmd.rsp.arg[i], 2);
                        i = i + 3;
-                       if (ahw->op_mode == QLCNIC_MGMT_FUNC)
-                               dev_info(dev, "id = %d active = %d type = %d\n"
-                                        "\tport = %d min bw = %d max bw = %d\n"
-                                        "\tmac_addr =  %pM\n", pci_info->id,
-                                        pci_info->active, pci_info->type,
-                                        pci_info->default_port,
-                                        pci_info->tx_min_bw,
-                                        pci_info->tx_max_bw, pci_info->mac);
                }
-               if (ahw->op_mode == QLCNIC_MGMT_FUNC)
-                       dev_info(dev, "Max functions = %d, active functions = %d\n",
-                                ahw->max_pci_func, ahw->act_pci_func);
-
        } else {
                dev_err(dev, "Failed to get PCI Info, error = %d\n", err);
                err = -EIO;
index 0248a4c2f5dd15fb1f12827b90bf1af0b1e73ba1..60a477f10f419e63a8dd3f6435aa61cf585369d2 100644 (file)
@@ -94,13 +94,29 @@ qlcnic_83xx_config_vnic_buff_descriptors(struct qlcnic_adapter *adapter)
  **/
 static int qlcnic_83xx_init_mgmt_vnic(struct qlcnic_adapter *adapter)
 {
-       int err = -EIO;
+       struct qlcnic_hardware_context *ahw = adapter->ahw;
+       struct device *dev = &adapter->pdev->dev;
+       struct qlcnic_npar_info *npar;
+       int i, err = -EIO;
 
        qlcnic_83xx_get_minidump_template(adapter);
+
        if (!(adapter->flags & QLCNIC_ADAPTER_INITIALIZED)) {
                if (qlcnic_init_pci_info(adapter))
                        return err;
 
+               npar = adapter->npars;
+
+               for (i = 0; i < ahw->act_pci_func; i++, npar++) {
+                       dev_info(dev, "id:%d active:%d type:%d port:%d min_bw:%d max_bw:%d mac_addr:%pM\n",
+                                npar->pci_func, npar->active, npar->type,
+                                npar->phy_port, npar->min_bw, npar->max_bw,
+                                npar->mac);
+               }
+
+               dev_info(dev, "Max functions = %d, active functions = %d\n",
+                        ahw->max_pci_func, ahw->act_pci_func);
+
                if (qlcnic_83xx_set_vnic_opmode(adapter))
                        return err;
 
@@ -115,12 +131,12 @@ static int qlcnic_83xx_init_mgmt_vnic(struct qlcnic_adapter *adapter)
                return err;
 
        qlcnic_83xx_config_vnic_buff_descriptors(adapter);
-       adapter->ahw->msix_supported = !!qlcnic_use_msi_x;
+       ahw->msix_supported = qlcnic_use_msi_x ? 1 : 0;
        adapter->flags |= QLCNIC_ADAPTER_INITIALIZED;
        qlcnic_83xx_enable_vnic_mode(adapter, 1);
 
-       dev_info(&adapter->pdev->dev, "HAL Version: %d, Management function\n",
-                adapter->ahw->fw_hal_version);
+       dev_info(dev, "HAL Version: %d, Management function\n",
+                ahw->fw_hal_version);
 
        return 0;
 }
index f07f2b0fefa005148aa543bd612faaba93ab49f7..55e8b23502414139855c0e2449ba29dba61a97a2 100644 (file)
@@ -875,6 +875,7 @@ int qlcnic_init_pci_info(struct qlcnic_adapter *adapter)
                adapter->npars[j].min_bw = pci_info[i].tx_min_bw;
                adapter->npars[j].max_bw = pci_info[i].tx_max_bw;
 
+               memcpy(&adapter->npars[j].mac, &pci_info[i].mac, ETH_ALEN);
                j++;
        }