diff options
Diffstat (limited to 'drivers/scsi/qedf')
-rw-r--r-- | drivers/scsi/qedf/qedf.h | 1 | ||||
-rw-r--r-- | drivers/scsi/qedf/qedf_main.c | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/drivers/scsi/qedf/qedf.h b/drivers/scsi/qedf/qedf.h index 0583b0707354..ba94413fe2ea 100644 --- a/drivers/scsi/qedf/qedf.h +++ b/drivers/scsi/qedf/qedf.h @@ -333,6 +333,7 @@ struct qedf_ctx { unsigned int curr_conn_id; struct workqueue_struct *ll2_recv_wq; struct workqueue_struct *link_update_wq; + struct devlink *devlink; struct delayed_work link_update; struct delayed_work link_recovery; struct completion flogi_compl; diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index cec27f2ef70d..b8d016914eee 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -3408,6 +3408,14 @@ retry_probe: goto err2; } + if (mode != QEDF_MODE_RECOVERY) { + qedf->devlink = qed_ops->common->devlink_register(qedf->cdev); + if (IS_ERR(qedf->devlink)) { + QEDF_ERR(&qedf->dbg_ctx, "Cannot register devlink\n"); + qedf->devlink = NULL; + } + } + /* Record BDQ producer doorbell addresses */ qedf->bdq_primary_prod = qedf->dev_info.primary_dbq_rq_addr; qedf->bdq_secondary_prod = qedf->dev_info.secondary_bdq_rq_addr; @@ -3789,6 +3797,11 @@ static void __qedf_remove(struct pci_dev *pdev, int mode) QEDF_ERR(&(qedf->dbg_ctx), "Failed to send drv state to MFW.\n"); + if (mode != QEDF_MODE_RECOVERY && qedf->devlink) { + qed_ops->common->devlink_unregister(qedf->devlink); + qedf->devlink = NULL; + } + qed_ops->common->slowpath_stop(qedf->cdev); qed_ops->common->remove(qedf->cdev); |