1
0
Fork 0

scsi: qedf: Send the driver state to MFW

[ Upstream commit 6ac174756d ]

Need to notify firmware when driver is loaded and unloaded.

Signed-off-by: Saurav Kashyap <saurav.kashyap@cavium.com>
Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
pull/10/head
Saurav Kashyap 2018-07-05 07:01:33 -07:00 committed by Greg Kroah-Hartman
parent fdf578210a
commit a38adc3e10
1 changed files with 12 additions and 0 deletions

View File

@ -3240,6 +3240,11 @@ static int __qedf_probe(struct pci_dev *pdev, int mode)
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));
link_params.link_up = true;
status = qed_ops->common->set_link(qedf->cdev, &link_params);
@ -3288,6 +3293,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)
{
struct qedf_ctx *qedf;
int rc;
if (!pdev) {
QEDF_ERR(NULL, "pdev is NULL.\n");
@ -3382,6 +3388,12 @@ static void __qedf_remove(struct pci_dev *pdev, int mode)
qed_ops->common->set_power_state(qedf->cdev, PCI_D0);
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->remove(qedf->cdev);