* [PATCH 1/3] scsi_dh_rdac: Adding more debug options for scsi rdac handler
@ 2009-08-25 0:11 Moger, Babu
2009-08-25 23:50 ` Chandra Seetharaman
0 siblings, 1 reply; 2+ messages in thread
From: Moger, Babu @ 2009-08-25 0:11 UTC (permalink / raw)
To: Linux SCSI Mailing list
Cc: device-mapper development, Chauhan, Vijay, Stankey, Robert
Adding the code to read the debug information during activate. This patch collects the information about storage and controllers during rdac_activate.
Signed-off-by: Babu Moger <babu.moger@lsi.com>
---
--- linux-2.6.31-rc5/drivers/scsi/device_handler/scsi_dh_rdac.c.orig 2009-08-24 11:54:41.000000000 -0500
+++ linux-2.6.31-rc5/drivers/scsi/device_handler/scsi_dh_rdac.c 2009-08-24 12:08:33.000000000 -0500
@@ -112,6 +112,7 @@ struct c9_inquiry {
#define SUBSYS_ID_LEN 16
#define SLOT_ID_LEN 2
+#define ARRAY_LABEL_LEN 31
struct c4_inquiry {
u8 peripheral_info;
@@ -135,6 +136,8 @@ struct rdac_controller {
struct rdac_pg_legacy legacy;
struct rdac_pg_expanded expanded;
} mode_select;
+ u8 index;
+ u8 array_name[ARRAY_LABEL_LEN];
};
struct c8_inquiry {
u8 peripheral_info;
@@ -324,6 +327,13 @@ static struct rdac_controller *get_contr
/* initialize fields of controller */
memcpy(ctlr->subsys_id, subsys_id, SUBSYS_ID_LEN);
memcpy(ctlr->slot_id, slot_id, SLOT_ID_LEN);
+
+ /* update the controller index */
+ if (slot_id[1] == 0x31)
+ ctlr->index = 0;
+ else
+ ctlr->index = 1;
+
kref_init(&ctlr->kref);
ctlr->use_ms10 = -1;
list_add(&ctlr->node, &ctlr_list);
@@ -381,6 +391,26 @@ static int get_lun(struct scsi_device *s
return err;
}
+static int get_array_name(struct scsi_device *sdev, struct rdac_dh_data *h)
+{
+ int err, i;
+ struct c8_inquiry *inqp;
+
+ err = submit_inquiry(sdev, 0xC8, sizeof(struct c8_inquiry), h);
+ if (err == SCSI_DH_OK) {
+ inqp = &h->inq.c8;
+ if (inqp->page_code != 0xc8)
+ return SCSI_DH_NOSYS;
+
+ for(i=0; i<30; ++i)
+ h->ctlr->array_name[i] = inqp->array_user_label[(2*i)+1];
+
+ h->ctlr->array_name[30] = '\0';
+ }
+
+ return err;
+}
+
static int check_ownership(struct scsi_device *sdev, struct rdac_dh_data *h)
{
int err;
@@ -529,6 +559,10 @@ static int rdac_activate(struct scsi_dev
err = initialize_controller(sdev, h);
if (err != SCSI_DH_OK)
goto done;
+
+ err = get_array_name(sdev, h);
+ if (err != SCSI_DH_OK)
+ goto done;
}
if (h->ctlr->use_ms10 == -1) {
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 1/3] scsi_dh_rdac: Adding more debug options for scsi rdac handler
2009-08-25 0:11 [PATCH 1/3] scsi_dh_rdac: Adding more debug options for scsi rdac handler Moger, Babu
@ 2009-08-25 23:50 ` Chandra Seetharaman
0 siblings, 0 replies; 2+ messages in thread
From: Chandra Seetharaman @ 2009-08-25 23:50 UTC (permalink / raw)
To: Moger, Babu
Cc: Linux SCSI Mailing list, Chauhan, Vijay, Stankey, Robert,
device-mapper development
On Mon, 2009-08-24 at 18:11 -0600, Moger, Babu wrote:
> Adding the code to read the debug information during activate. This patch collects
> the information about storage and controllers during rdac_activate.
>
> Signed-off-by: Babu Moger <babu.moger@lsi.com>
>
> ---
> --- linux-2.6.31-rc5/drivers/scsi/device_handler/scsi_dh_rdac.c.orig 2009-08-24 11:54:41.000000000 -0500
> +++ linux-2.6.31-rc5/drivers/scsi/device_handler/scsi_dh_rdac.c 2009-08-24 12:08:33.000000000 -0500
> @@ -112,6 +112,7 @@ struct c9_inquiry {
>
> #define SUBSYS_ID_LEN 16
> #define SLOT_ID_LEN 2
> +#define ARRAY_LABEL_LEN 31
>
> struct c4_inquiry {
> u8 peripheral_info;
> @@ -135,6 +136,8 @@ struct rdac_controller {
> struct rdac_pg_legacy legacy;
> struct rdac_pg_expanded expanded;
> } mode_select;
> + u8 index;
> + u8 array_name[ARRAY_LABEL_LEN];
cosmetic... align with the above code (peripheral_info)
> };
> struct c8_inquiry {
> u8 peripheral_info;
> @@ -324,6 +327,13 @@ static struct rdac_controller *get_contr
> /* initialize fields of controller */
> memcpy(ctlr->subsys_id, subsys_id, SUBSYS_ID_LEN);
> memcpy(ctlr->slot_id, slot_id, SLOT_ID_LEN);
> +
> + /* update the controller index */
> + if (slot_id[1] == 0x31)
> + ctlr->index = 0;
> + else
> + ctlr->index = 1;
> +
> kref_init(&ctlr->kref);
> ctlr->use_ms10 = -1;
> list_add(&ctlr->node, &ctlr_list);
> @@ -381,6 +391,26 @@ static int get_lun(struct scsi_device *s
> return err;
> }
>
> +static int get_array_name(struct scsi_device *sdev, struct rdac_dh_data *h)
> +{
> + int err, i;
> + struct c8_inquiry *inqp;
> +
> + err = submit_inquiry(sdev, 0xC8, sizeof(struct c8_inquiry), h);
> + if (err == SCSI_DH_OK) {
> + inqp = &h->inq.c8;
> + if (inqp->page_code != 0xc8)
> + return SCSI_DH_NOSYS;
> +
> + for(i=0; i<30; ++i)
Use the macro name above instead of literal "30"
> + h->ctlr->array_name[i] = inqp->array_user_label[(2*i)+1];
> +
> + h->ctlr->array_name[30] = '\0';
Use the macro name above instead of literal "30"
> + }
> +
> + return err;
> +}
> +
> static int check_ownership(struct scsi_device *sdev, struct rdac_dh_data *h)
> {
> int err;
> @@ -529,6 +559,10 @@ static int rdac_activate(struct scsi_dev
> err = initialize_controller(sdev, h);
> if (err != SCSI_DH_OK)
> goto done;
> +
> + err = get_array_name(sdev, h);
> + if (err != SCSI_DH_OK)
> + goto done;
> }
>
> if (h->ctlr->use_ms10 == -1) {
>
>
> �NrybXǧv^){.n+{"{ay\x1dʇڙ,j\afhz\x1ew\fj:+vwjm\azZ+ݢj"!
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-08-25 23:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-25 0:11 [PATCH 1/3] scsi_dh_rdac: Adding more debug options for scsi rdac handler Moger, Babu
2009-08-25 23:50 ` Chandra Seetharaman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox