From patchwork Fri Apr 8 17:37:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: babu moger X-Patchwork-Id: 695311 Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p38HdDws018811 for ; Fri, 8 Apr 2011 17:39:34 GMT Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p38HbOjG030089; Fri, 8 Apr 2011 13:37:24 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p38HaXxI026503 for ; Fri, 8 Apr 2011 13:36:33 -0400 Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.19]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p38HaSHS018287 for ; Fri, 8 Apr 2011 13:36:28 -0400 Received: from na3sys009aog115.obsmtp.com (na3sys009aog115.obsmtp.com [74.125.149.238]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p38HaO7b014492 for ; Fri, 8 Apr 2011 13:36:24 -0400 Received: from cosedge01.lsi.com ([192.19.220.66]) (using TLSv1) by na3sys009aob115.postini.com ([74.125.148.12]) with SMTP ID DSNKTZ9Hl1VqZdoigtmfafAXp4Yq7a1uT7+5@postini.com; Fri, 08 Apr 2011 10:36:24 PDT Received: from coshub01.lsi.com (135.142.2.64) by COSEDGE01.lsi.com (192.19.220.66) with Microsoft SMTP Server (TLS) id 8.3.137.0; Fri, 8 Apr 2011 11:35:31 -0600 Received: from cosmail01.lsi.com ([172.21.36.24]) by coshub01.lsi.com ([135.142.2.64]) with mapi; Fri, 8 Apr 2011 11:37:45 -0600 From: "Moger, Babu" To: "linux-scsi@vger.kernel.org" , "device-mapper development" Date: Fri, 8 Apr 2011 11:37:40 -0600 Thread-Topic: [PATCH 1/3] scsi_dh_rdac : Add definitions for different RDAC operating modes Thread-Index: Acv2E6jkqJ4yd2o0TkyAebIHPJur1A== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 X-RedHat-Spam-Score: -2.3 (RCVD_IN_DNSWL_MED) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.19 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id p38HaXxI026503 X-loop: dm-devel@redhat.com Cc: "Krishnasamy, Somasundaram" , "Stankey, Robert" Subject: [dm-devel] [PATCH 1/3] scsi_dh_rdac : Add definitions for different RDAC operating modes X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 08 Apr 2011 17:39:53 +0000 (UTC) This patch adds definitions to support for different operating modes for LSI rdac storage. Currently, rdac support 3 operation modes. 1. RDAC mode(legacy) 2. AVT mode 3. IOSHIP mode These definitions are used while activating the path(rdac_activate). Signed-off-by: Babu Moger Reviewed-by: Yanling Qi Reviewed-by: Sudhir Dachepalli Reviewed-by: Somasundaram Krishnasamy Reviewed-by: Bob Stankey Reviewed-by: Vijay Chauhan --- -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel --- linux-2.6.38/drivers/scsi/device_handler/scsi_dh_rdac.c.orig 2011-03-17 16:31:53.000000000 -0500 +++ linux-2.6.38/drivers/scsi/device_handler/scsi_dh_rdac.c 2011-03-17 16:47:52.000000000 -0500 @@ -182,6 +182,12 @@ struct rdac_dh_data { struct rdac_controller *ctlr; #define UNINITIALIZED_LUN (1 << 8) unsigned lun; + +#define RDAC_MODE 0 +#define RDAC_MODE_AVT 1 +#define RDAC_MODE_IOSHIP 2 + unsigned char mode; + #define RDAC_STATE_ACTIVE 0 #define RDAC_STATE_PASSIVE 1 unsigned char state; @@ -190,6 +196,11 @@ struct rdac_dh_data { #define RDAC_LUN_OWNED 1 #define RDAC_LUN_AVT 2 char lun_state; + +#define RDAC_PREFERRED 0 +#define RDAC_NON_PREFERRED 1 + char preferred; + unsigned char sense[SCSI_SENSE_BUFFERSIZE]; union { struct c2_inquiry c2; @@ -199,11 +210,15 @@ struct rdac_dh_data { } inq; }; +static const char *mode[] = { + "RDAC", + "AVT", + "IOSHIP", +}; static const char *lun_state[] = { "unowned", "owned", - "owned (AVT mode)", }; struct rdac_queue_data { @@ -836,8 +851,9 @@ static int rdac_bus_attach(struct scsi_d spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags); sdev_printk(KERN_NOTICE, sdev, - "%s: LUN %d (%s)\n", - RDAC_NAME, h->lun, lun_state[(int)h->lun_state]); + "%s: LUN %d (%s) (%s)\n", + RDAC_NAME, h->lun, mode[(int)h->mode], + lun_state[(int)h->lun_state]); return 0;