diff options
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_scsi.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_scsi.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index b73968b2b8b4..3606b7098fc1 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c | |||
@@ -183,6 +183,35 @@ lpfc_ramp_up_queue_handler(struct lpfc_hba *phba) | |||
183 | atomic_set(&phba->num_cmd_success, 0); | 183 | atomic_set(&phba->num_cmd_success, 0); |
184 | } | 184 | } |
185 | 185 | ||
186 | /** | ||
187 | * lpfc_scsi_dev_block: set all scsi hosts to block state. | ||
188 | * @phba: Pointer to HBA context object. | ||
189 | * | ||
190 | * This function walks vport list and set each SCSI host to block state | ||
191 | * by invoking fc_remote_port_delete() routine. This function is invoked | ||
192 | * with EEH when device's PCI slot has been permanently disabled. | ||
193 | **/ | ||
194 | void | ||
195 | lpfc_scsi_dev_block(struct lpfc_hba *phba) | ||
196 | { | ||
197 | struct lpfc_vport **vports; | ||
198 | struct Scsi_Host *shost; | ||
199 | struct scsi_device *sdev; | ||
200 | struct fc_rport *rport; | ||
201 | int i; | ||
202 | |||
203 | vports = lpfc_create_vport_work_array(phba); | ||
204 | if (vports != NULL) | ||
205 | for (i = 0; i <= phba->max_vpi && vports[i] != NULL; i++) { | ||
206 | shost = lpfc_shost_from_vport(vports[i]); | ||
207 | shost_for_each_device(sdev, shost) { | ||
208 | rport = starget_to_rport(scsi_target(sdev)); | ||
209 | fc_remote_port_delete(rport); | ||
210 | } | ||
211 | } | ||
212 | lpfc_destroy_vport_work_array(phba, vports); | ||
213 | } | ||
214 | |||
186 | /* | 215 | /* |
187 | * This routine allocates a scsi buffer, which contains all the necessary | 216 | * This routine allocates a scsi buffer, which contains all the necessary |
188 | * information needed to initiate a SCSI I/O. The non-DMAable buffer region | 217 | * information needed to initiate a SCSI I/O. The non-DMAable buffer region |