diff options
author | Saurav Kashyap <saurav.kashyap@cavium.com> | 2018-07-05 10:01:33 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-07-10 22:25:23 -0400 |
commit | 6ac174756dfc9884f08b23af840ca911155f5578 (patch) | |
tree | 9417b22e0cd46080b398316d852ef79be44a720c /drivers/scsi/qedf | |
parent | 01d0e789a14aa735ddcfddd468ef06d4f917e06d (diff) |
scsi: qedf: Send the driver state to MFW
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>
Diffstat (limited to 'drivers/scsi/qedf')
-rw-r--r-- | drivers/scsi/qedf/qedf_main.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index 90394cef0f41..0a5dd5595dd3 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c | |||
@@ -3295,6 +3295,11 @@ static int __qedf_probe(struct pci_dev *pdev, int mode) | |||
3295 | 3295 | ||
3296 | init_completion(&qedf->flogi_compl); | 3296 | init_completion(&qedf->flogi_compl); |
3297 | 3297 | ||
3298 | status = qed_ops->common->update_drv_state(qedf->cdev, true); | ||
3299 | if (status) | ||
3300 | QEDF_ERR(&(qedf->dbg_ctx), | ||
3301 | "Failed to send drv state to MFW.\n"); | ||
3302 | |||
3298 | memset(&link_params, 0, sizeof(struct qed_link_params)); | 3303 | memset(&link_params, 0, sizeof(struct qed_link_params)); |
3299 | link_params.link_up = true; | 3304 | link_params.link_up = true; |
3300 | status = qed_ops->common->set_link(qedf->cdev, &link_params); | 3305 | 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 | static void __qedf_remove(struct pci_dev *pdev, int mode) | 3348 | static void __qedf_remove(struct pci_dev *pdev, int mode) |
3344 | { | 3349 | { |
3345 | struct qedf_ctx *qedf; | 3350 | struct qedf_ctx *qedf; |
3351 | int rc; | ||
3346 | 3352 | ||
3347 | if (!pdev) { | 3353 | if (!pdev) { |
3348 | QEDF_ERR(NULL, "pdev is NULL.\n"); | 3354 | QEDF_ERR(NULL, "pdev is NULL.\n"); |
@@ -3437,6 +3443,12 @@ static void __qedf_remove(struct pci_dev *pdev, int mode) | |||
3437 | qed_ops->common->set_power_state(qedf->cdev, PCI_D0); | 3443 | qed_ops->common->set_power_state(qedf->cdev, PCI_D0); |
3438 | pci_set_drvdata(pdev, NULL); | 3444 | pci_set_drvdata(pdev, NULL); |
3439 | } | 3445 | } |
3446 | |||
3447 | rc = qed_ops->common->update_drv_state(qedf->cdev, false); | ||
3448 | if (rc) | ||
3449 | QEDF_ERR(&(qedf->dbg_ctx), | ||
3450 | "Failed to send drv state to MFW.\n"); | ||
3451 | |||
3440 | qed_ops->common->slowpath_stop(qedf->cdev); | 3452 | qed_ops->common->slowpath_stop(qedf->cdev); |
3441 | qed_ops->common->remove(qedf->cdev); | 3453 | qed_ops->common->remove(qedf->cdev); |
3442 | 3454 | ||