Commit 6ac17475 authored by Saurav Kashyap's avatar Saurav Kashyap Committed by Martin K. Petersen

scsi: qedf: Send the driver state to MFW

Need to notify firmware when driver is loaded and unloaded.
Signed-off-by: default avatarSaurav Kashyap <saurav.kashyap@cavium.com>
Signed-off-by: default avatarChad Dupuis <chad.dupuis@cavium.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 01d0e789
...@@ -3295,6 +3295,11 @@ static int __qedf_probe(struct pci_dev *pdev, int mode) ...@@ -3295,6 +3295,11 @@ static int __qedf_probe(struct pci_dev *pdev, int mode)
init_completion(&qedf->flogi_compl); init_completion(&qedf->flogi_compl);
status = qed_ops->common->update_drv_state(qedf->cdev, true);
if (status)
QEDF_ERR(&(qedf->dbg_ctx),
"Failed to send drv state to MFW.\n");
memset(&link_params, 0, sizeof(struct qed_link_params)); memset(&link_params, 0, sizeof(struct qed_link_params));
link_params.link_up = true; link_params.link_up = true;
status = qed_ops->common->set_link(qedf->cdev, &link_params); status = qed_ops->common->set_link(qedf->cdev, &link_params);
...@@ -3343,6 +3348,7 @@ static int qedf_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -3343,6 +3348,7 @@ static int qedf_probe(struct pci_dev *pdev, const struct pci_device_id *id)
static void __qedf_remove(struct pci_dev *pdev, int mode) static void __qedf_remove(struct pci_dev *pdev, int mode)
{ {
struct qedf_ctx *qedf; struct qedf_ctx *qedf;
int rc;
if (!pdev) { if (!pdev) {
QEDF_ERR(NULL, "pdev is NULL.\n"); QEDF_ERR(NULL, "pdev is NULL.\n");
...@@ -3437,6 +3443,12 @@ static void __qedf_remove(struct pci_dev *pdev, int mode) ...@@ -3437,6 +3443,12 @@ static void __qedf_remove(struct pci_dev *pdev, int mode)
qed_ops->common->set_power_state(qedf->cdev, PCI_D0); qed_ops->common->set_power_state(qedf->cdev, PCI_D0);
pci_set_drvdata(pdev, NULL); pci_set_drvdata(pdev, NULL);
} }
rc = qed_ops->common->update_drv_state(qedf->cdev, false);
if (rc)
QEDF_ERR(&(qedf->dbg_ctx),
"Failed to send drv state to MFW.\n");
qed_ops->common->slowpath_stop(qedf->cdev); qed_ops->common->slowpath_stop(qedf->cdev);
qed_ops->common->remove(qedf->cdev); qed_ops->common->remove(qedf->cdev);
......
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