diff options
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_ct.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_ct.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c index c004fa9a681e..d9edfd90d7ff 100644 --- a/drivers/scsi/lpfc/lpfc_ct.c +++ b/drivers/scsi/lpfc/lpfc_ct.c | |||
@@ -1738,6 +1738,55 @@ fdmi_cmd_exit: | |||
1738 | return 1; | 1738 | return 1; |
1739 | } | 1739 | } |
1740 | 1740 | ||
1741 | /** | ||
1742 | * lpfc_delayed_disc_tmo - Timeout handler for delayed discovery timer. | ||
1743 | * @ptr - Context object of the timer. | ||
1744 | * | ||
1745 | * This function set the WORKER_DELAYED_DISC_TMO flag and wake up | ||
1746 | * the worker thread. | ||
1747 | **/ | ||
1748 | void | ||
1749 | lpfc_delayed_disc_tmo(unsigned long ptr) | ||
1750 | { | ||
1751 | struct lpfc_vport *vport = (struct lpfc_vport *)ptr; | ||
1752 | struct lpfc_hba *phba = vport->phba; | ||
1753 | uint32_t tmo_posted; | ||
1754 | unsigned long iflag; | ||
1755 | |||
1756 | spin_lock_irqsave(&vport->work_port_lock, iflag); | ||
1757 | tmo_posted = vport->work_port_events & WORKER_DELAYED_DISC_TMO; | ||
1758 | if (!tmo_posted) | ||
1759 | vport->work_port_events |= WORKER_DELAYED_DISC_TMO; | ||
1760 | spin_unlock_irqrestore(&vport->work_port_lock, iflag); | ||
1761 | |||
1762 | if (!tmo_posted) | ||
1763 | lpfc_worker_wake_up(phba); | ||
1764 | return; | ||
1765 | } | ||
1766 | |||
1767 | /** | ||
1768 | * lpfc_delayed_disc_timeout_handler - Function called by worker thread to | ||
1769 | * handle delayed discovery. | ||
1770 | * @vport: pointer to a host virtual N_Port data structure. | ||
1771 | * | ||
1772 | * This function start nport discovery of the vport. | ||
1773 | **/ | ||
1774 | void | ||
1775 | lpfc_delayed_disc_timeout_handler(struct lpfc_vport *vport) | ||
1776 | { | ||
1777 | struct Scsi_Host *shost = lpfc_shost_from_vport(vport); | ||
1778 | |||
1779 | spin_lock_irq(shost->host_lock); | ||
1780 | if (!(vport->fc_flag & FC_DISC_DELAYED)) { | ||
1781 | spin_unlock_irq(shost->host_lock); | ||
1782 | return; | ||
1783 | } | ||
1784 | vport->fc_flag &= ~FC_DISC_DELAYED; | ||
1785 | spin_unlock_irq(shost->host_lock); | ||
1786 | |||
1787 | lpfc_do_scr_ns_plogi(vport->phba, vport); | ||
1788 | } | ||
1789 | |||
1741 | void | 1790 | void |
1742 | lpfc_fdmi_tmo(unsigned long ptr) | 1791 | lpfc_fdmi_tmo(unsigned long ptr) |
1743 | { | 1792 | { |