summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoger, Babu <Babu.Moger@lsi.com>2011-04-08 17:38:33 (GMT)
committerJames Bottomley <James.Bottomley@suse.de>2011-05-01 15:46:57 (GMT)
commit1c3afc423460035a6c2d0e4f01217e953bad3fd7 (patch)
tree32580cf437d56d7d473ee1928766bd3bf517b07c
parenteebe9b96dda9018cc68a2855ca506ec26a1e449e (diff)
downloadlinux-1c3afc423460035a6c2d0e4f01217e953bad3fd7.tar.xz
[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>
-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 afb2fb1..4efe638 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 {
#define RDAC_LUN_UNOWNED 0
#define RDAC_LUN_OWNED 1
-#define RDAC_LUN_AVT 2
char lun_state;
#define RDAC_PREFERRED 0
@@ -473,25 +472,33 @@ static int check_ownership(struct scsi_device *sdev, struct rdac_dh_data *h)
int err;
struct c9_inquiry *inqp;
- h->lun_state = RDAC_LUN_UNOWNED;
h->state = RDAC_STATE_ACTIVE;
err = submit_inquiry(sdev, 0xC9, sizeof(struct c9_inquiry), h);
if (err == SCSI_DH_OK) {
inqp = &h->inq.c9;
- if ((inqp->avte_cvp >> 7) == 0x1) {
- /* LUN in AVT mode */
- sdev_printk(KERN_NOTICE, sdev,
- "%s: AVT mode detected\n",
- RDAC_NAME);
- h->lun_state = RDAC_LUN_AVT;
- } else if ((inqp->avte_cvp & 0x1) != 0) {
- /* LUN was owned by the controller */
+ /* detect the operating mode */
+ if ((inqp->avte_cvp >> 5) & 0x1)
+ h->mode = RDAC_MODE_IOSHIP; /* LUN in IOSHIP mode */
+ else if (inqp->avte_cvp >> 7)
+ h->mode = RDAC_MODE_AVT; /* LUN in AVT mode */
+ else
+ h->mode = RDAC_MODE; /* LUN in RDAC mode */
+
+ /* Update ownership */
+ if (inqp->avte_cvp & 0x1)
h->lun_state = RDAC_LUN_OWNED;
+ else {
+ h->lun_state = RDAC_LUN_UNOWNED;
+ if (h->mode == RDAC_MODE)
+ h->state = RDAC_STATE_PASSIVE;
}
- }
- if (h->lun_state == RDAC_LUN_UNOWNED)
- h->state = RDAC_STATE_PASSIVE;
+ /* Update path prio*/
+ if (inqp->path_prio & 0x1)
+ h->preferred = RDAC_PREFERRED;
+ else
+ h->preferred = RDAC_NON_PREFERRED;
+ }
return err;
}