diff options
Diffstat (limited to 'drivers/scsi/bfa/bfad_bsg.c')
-rw-r--r-- | drivers/scsi/bfa/bfad_bsg.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/drivers/scsi/bfa/bfad_bsg.c b/drivers/scsi/bfa/bfad_bsg.c index 06fc00caeb41..530de2b1200a 100644 --- a/drivers/scsi/bfa/bfad_bsg.c +++ b/drivers/scsi/bfa/bfad_bsg.c | |||
@@ -2394,6 +2394,21 @@ out: | |||
2394 | return 0; | 2394 | return 0; |
2395 | } | 2395 | } |
2396 | 2396 | ||
2397 | /* Function to reset the LUN SCAN mode */ | ||
2398 | static void | ||
2399 | bfad_iocmd_lunmask_reset_lunscan_mode(struct bfad_s *bfad, int lunmask_cfg) | ||
2400 | { | ||
2401 | struct bfad_im_port_s *pport_im = bfad->pport.im_port; | ||
2402 | struct bfad_vport_s *vport = NULL; | ||
2403 | |||
2404 | /* Set the scsi device LUN SCAN flags for base port */ | ||
2405 | bfad_reset_sdev_bflags(pport_im, lunmask_cfg); | ||
2406 | |||
2407 | /* Set the scsi device LUN SCAN flags for the vports */ | ||
2408 | list_for_each_entry(vport, &bfad->vport_list, list_entry) | ||
2409 | bfad_reset_sdev_bflags(vport->drv_port.im_port, lunmask_cfg); | ||
2410 | } | ||
2411 | |||
2397 | int | 2412 | int |
2398 | bfad_iocmd_lunmask(struct bfad_s *bfad, void *pcmd, unsigned int v_cmd) | 2413 | bfad_iocmd_lunmask(struct bfad_s *bfad, void *pcmd, unsigned int v_cmd) |
2399 | { | 2414 | { |
@@ -2401,11 +2416,17 @@ bfad_iocmd_lunmask(struct bfad_s *bfad, void *pcmd, unsigned int v_cmd) | |||
2401 | unsigned long flags; | 2416 | unsigned long flags; |
2402 | 2417 | ||
2403 | spin_lock_irqsave(&bfad->bfad_lock, flags); | 2418 | spin_lock_irqsave(&bfad->bfad_lock, flags); |
2404 | if (v_cmd == IOCMD_FCPIM_LUNMASK_ENABLE) | 2419 | if (v_cmd == IOCMD_FCPIM_LUNMASK_ENABLE) { |
2405 | iocmd->status = bfa_fcpim_lunmask_update(&bfad->bfa, BFA_TRUE); | 2420 | iocmd->status = bfa_fcpim_lunmask_update(&bfad->bfa, BFA_TRUE); |
2406 | else if (v_cmd == IOCMD_FCPIM_LUNMASK_DISABLE) | 2421 | /* Set the LUN Scanning mode to be Sequential scan */ |
2422 | if (iocmd->status == BFA_STATUS_OK) | ||
2423 | bfad_iocmd_lunmask_reset_lunscan_mode(bfad, BFA_TRUE); | ||
2424 | } else if (v_cmd == IOCMD_FCPIM_LUNMASK_DISABLE) { | ||
2407 | iocmd->status = bfa_fcpim_lunmask_update(&bfad->bfa, BFA_FALSE); | 2425 | iocmd->status = bfa_fcpim_lunmask_update(&bfad->bfa, BFA_FALSE); |
2408 | else if (v_cmd == IOCMD_FCPIM_LUNMASK_CLEAR) | 2426 | /* Set the LUN Scanning mode to default REPORT_LUNS scan */ |
2427 | if (iocmd->status == BFA_STATUS_OK) | ||
2428 | bfad_iocmd_lunmask_reset_lunscan_mode(bfad, BFA_FALSE); | ||
2429 | } else if (v_cmd == IOCMD_FCPIM_LUNMASK_CLEAR) | ||
2409 | iocmd->status = bfa_fcpim_lunmask_clear(&bfad->bfa); | 2430 | iocmd->status = bfa_fcpim_lunmask_clear(&bfad->bfa); |
2410 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | 2431 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); |
2411 | return 0; | 2432 | return 0; |