aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/device_handler
diff options
context:
space:
mode:
authorMoger, Babu <Babu.Moger@lsi.com>2011-04-08 13:38:33 -0400
committerJames Bottomley <James.Bottomley@suse.de>2011-05-01 11:46:57 -0400
commit1c3afc423460035a6c2d0e4f01217e953bad3fd7 (patch)
tree32580cf437d56d7d473ee1928766bd3bf517b07c /drivers/scsi/device_handler
parenteebe9b96dda9018cc68a2855ca506ec26a1e449e (diff)
[SCSI] scsi_dh_rdac : Detect the different RDAC operating modes
This patch detects different operating RDAC modes during the discovery. It also collects the information about the preferred path. Signed-off-by: Babu Moger <babu.moger@lsi.com> Reviewed-by: Yanling Qi <yanling.qi@lsi.com> Reviewed-by: Sudhir Dachepalli <Sudhir.Dachepalli@lis.com> Reviewed-by: Somasundaram Krishnasamy <Somasundaram.Krishnasamy@lsi.com> Reviewed-by: Bob Stankey <Robert.Stankey@lsi.com> Reviewed-by: Vijay Chauhan <Vijay.Chauhan@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/device_handler')
-rw-r--r--drivers/scsi/device_handler/scsi_dh_rdac.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/drivers/scsi/device_handler/scsi_dh_rdac.c b/drivers/scsi/device_handler/scsi_dh_rdac.c
index afb2fb1a5186..4efe638036f6 100644
--- a/drivers/scsi/device_handler/scsi_dh_rdac.c
+++ b/drivers/scsi/device_handler/scsi_dh_rdac.c
@@ -194,7 +194,6 @@ struct rdac_dh_data {
194 194
195#define RDAC_LUN_UNOWNED 0 195#define RDAC_LUN_UNOWNED 0
196#define RDAC_LUN_OWNED 1 196#define RDAC_LUN_OWNED 1
197#define RDAC_LUN_AVT 2
198 char lun_state; 197 char lun_state;
199 198
200#define RDAC_PREFERRED 0 199#define RDAC_PREFERRED 0
@@ -473,25 +472,33 @@ static int check_ownership(struct scsi_device *sdev, struct rdac_dh_data *h)
473 int err; 472 int err;
474 struct c9_inquiry *inqp; 473 struct c9_inquiry *inqp;
475 474
476 h->lun_state = RDAC_LUN_UNOWNED;
477 h->state = RDAC_STATE_ACTIVE; 475 h->state = RDAC_STATE_ACTIVE;
478 err = submit_inquiry(sdev, 0xC9, sizeof(struct c9_inquiry), h); 476 err = submit_inquiry(sdev, 0xC9, sizeof(struct c9_inquiry), h);
479 if (err == SCSI_DH_OK) { 477 if (err == SCSI_DH_OK) {
480 inqp = &h->inq.c9; 478 inqp = &h->inq.c9;
481 if ((inqp->avte_cvp >> 7) == 0x1) { 479 /* detect the operating mode */
482 /* LUN in AVT mode */ 480 if ((inqp->avte_cvp >> 5) & 0x1)
483 sdev_printk(KERN_NOTICE, sdev, 481 h->mode = RDAC_MODE_IOSHIP; /* LUN in IOSHIP mode */
484 "%s: AVT mode detected\n", 482 else if (inqp->avte_cvp >> 7)
485 RDAC_NAME); 483 h->mode = RDAC_MODE_AVT; /* LUN in AVT mode */
486 h->lun_state = RDAC_LUN_AVT; 484 else
487 } else if ((inqp->avte_cvp & 0x1) != 0) { 485 h->mode = RDAC_MODE; /* LUN in RDAC mode */
488 /* LUN was owned by the controller */ 486
487 /* Update ownership */
488 if (inqp->avte_cvp & 0x1)
489 h->lun_state = RDAC_LUN_OWNED; 489 h->lun_state = RDAC_LUN_OWNED;
490 else {
491 h->lun_state = RDAC_LUN_UNOWNED;
492 if (h->mode == RDAC_MODE)
493 h->state = RDAC_STATE_PASSIVE;
490 } 494 }
491 }
492 495
493 if (h->lun_state == RDAC_LUN_UNOWNED) 496 /* Update path prio*/
494 h->state = RDAC_STATE_PASSIVE; 497 if (inqp->path_prio & 0x1)
498 h->preferred = RDAC_PREFERRED;
499 else
500 h->preferred = RDAC_NON_PREFERRED;
501 }
495 502
496 return err; 503 return err;
497} 504}