Commit c65762fc authored by Sucheta Chakraborty's avatar Sucheta Chakraborty Committed by David S. Miller

qlcnic: Add driver logs in error path.

Signed-off-by: default avatarSucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 868e9144
...@@ -879,6 +879,9 @@ int qlcnic_83xx_alloc_mbx_args(struct qlcnic_cmd_args *mbx, ...@@ -879,6 +879,9 @@ int qlcnic_83xx_alloc_mbx_args(struct qlcnic_cmd_args *mbx,
return 0; return 0;
} }
} }
dev_err(&adapter->pdev->dev, "%s: Invalid mailbox command opcode 0x%x\n",
__func__, type);
return -EINVAL; return -EINVAL;
} }
......
...@@ -2181,6 +2181,8 @@ int qlcnic_83xx_configure_opmode(struct qlcnic_adapter *adapter) ...@@ -2181,6 +2181,8 @@ int qlcnic_83xx_configure_opmode(struct qlcnic_adapter *adapter)
max_sds_rings = QLCNIC_MAX_SDS_RINGS; max_sds_rings = QLCNIC_MAX_SDS_RINGS;
max_tx_rings = QLCNIC_MAX_TX_RINGS; max_tx_rings = QLCNIC_MAX_TX_RINGS;
} else { } else {
dev_err(&adapter->pdev->dev, "%s: Invalid opmode %d\n",
__func__, ret);
return -EIO; return -EIO;
} }
......
...@@ -1027,8 +1027,11 @@ int qlcnic_config_port_mirroring(struct qlcnic_adapter *adapter, u8 id, ...@@ -1027,8 +1027,11 @@ int qlcnic_config_port_mirroring(struct qlcnic_adapter *adapter, u8 id,
u32 arg1; u32 arg1;
if (adapter->ahw->op_mode != QLCNIC_MGMT_FUNC || if (adapter->ahw->op_mode != QLCNIC_MGMT_FUNC ||
!(adapter->eswitch[id].flags & QLCNIC_SWITCH_ENABLE)) !(adapter->eswitch[id].flags & QLCNIC_SWITCH_ENABLE)) {
dev_err(&adapter->pdev->dev, "%s: Not a management function\n",
__func__);
return err; return err;
}
arg1 = id | (enable_mirroring ? BIT_4 : 0); arg1 = id | (enable_mirroring ? BIT_4 : 0);
arg1 |= pci_func << 8; arg1 |= pci_func << 8;
...@@ -1318,8 +1321,12 @@ int qlcnic_config_switch_port(struct qlcnic_adapter *adapter, ...@@ -1318,8 +1321,12 @@ int qlcnic_config_switch_port(struct qlcnic_adapter *adapter,
u32 arg1, arg2 = 0; u32 arg1, arg2 = 0;
u8 pci_func; u8 pci_func;
if (adapter->ahw->op_mode != QLCNIC_MGMT_FUNC) if (adapter->ahw->op_mode != QLCNIC_MGMT_FUNC) {
dev_err(&adapter->pdev->dev, "%s: Not a management function\n",
__func__);
return err; return err;
}
pci_func = esw_cfg->pci_func; pci_func = esw_cfg->pci_func;
index = qlcnic_is_valid_nic_func(adapter, pci_func); index = qlcnic_is_valid_nic_func(adapter, pci_func);
if (index < 0) if (index < 0)
...@@ -1363,6 +1370,8 @@ int qlcnic_config_switch_port(struct qlcnic_adapter *adapter, ...@@ -1363,6 +1370,8 @@ int qlcnic_config_switch_port(struct qlcnic_adapter *adapter,
arg1 &= ~(0x0ffff << 16); arg1 &= ~(0x0ffff << 16);
break; break;
default: default:
dev_err(&adapter->pdev->dev, "%s: Invalid opmode 0x%x\n",
__func__, esw_cfg->op_mode);
return err; return err;
} }
......
...@@ -1014,6 +1014,8 @@ int qlcnic_init_pci_info(struct qlcnic_adapter *adapter) ...@@ -1014,6 +1014,8 @@ int qlcnic_init_pci_info(struct qlcnic_adapter *adapter)
if (pfn >= ahw->max_vnic_func) { if (pfn >= ahw->max_vnic_func) {
ret = QL_STATUS_INVALID_PARAM; ret = QL_STATUS_INVALID_PARAM;
dev_err(&adapter->pdev->dev, "%s: Invalid function 0x%x, max 0x%x\n",
__func__, pfn, ahw->max_vnic_func);
goto err_eswitch; goto err_eswitch;
} }
...@@ -2531,8 +2533,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -2531,8 +2533,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
dev_err(&pdev->dev, "Adapter initialization failed. Please reboot\n"); dev_err(&pdev->dev, "Adapter initialization failed. Please reboot\n");
goto err_out_free_hw; goto err_out_free_hw;
default: default:
dev_err(&pdev->dev, "Adapter initialization failed. A reboot may be required to recover from this failure\n"); dev_err(&pdev->dev, "Adapter initialization failed. Driver will load in maintenance mode to recover the adapter using the application\n");
dev_err(&pdev->dev, "If reboot does not help to recover from this failure, try a flash update of the adapter\n");
goto err_out_maintenance_mode; goto err_out_maintenance_mode;
} }
} }
......
...@@ -362,6 +362,8 @@ int qlcnic_is_valid_nic_func(struct qlcnic_adapter *adapter, u8 pci_func) ...@@ -362,6 +362,8 @@ int qlcnic_is_valid_nic_func(struct qlcnic_adapter *adapter, u8 pci_func)
if (adapter->npars[i].pci_func == pci_func) if (adapter->npars[i].pci_func == pci_func)
return i; return i;
} }
dev_err(&adapter->pdev->dev, "%s: Invalid nic function\n", __func__);
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment