All of lore.kernel.org
 help / color / mirror / Atom feed
From: linux@dragonhold.org
To: James.Bottomley@SteelEye.com
Cc: linux-scsi@vger.kernel.org
Subject: [PATCH] qla1280.c patch against 2.6.9 to allow settings of Initiator ID
Date: Fri, 5 Nov 2004 01:18:30 +0000	[thread overview]
Message-ID: <20041105011830.GG8974@dragonhold.org> (raw)

Possible Patch
==============

I've attached a patch to allow the SCSI Initiator ID in NVRAM to be over-ridden for these
controllers.  It is a single ID passed when loaded as a module, allowing you to set all the
controllers attached to your machine to the same specified SCSI ID.  I've tested it on my
machine, but know of no-one else using these cards that is running linux.

I'm also not sure if this is the sort of thing that anyone other than me would be interested
in, and I can't find a maintainer specifically for the qla1280 driver.  So please accept my
apologies if this shouldn't have been sent to you.

It's the first I've done, so I'm more than willing to listen to suggestions on how to
improve the style and/or code.


Thanks,

Graham


Signed-off-by:  Graham Wood <linux@dragonhold.org>


--- /usr/src/linux-2.6.9/drivers/scsi/qla1280.c.orig	2004-11-04 23:36:21.000000000 +0000
+++ /usr/src/linux-2.6.9/drivers/scsi/qla1280.c	2004-11-05 01:01:18.000000000 +0000
@@ -586,9 +586,12 @@ static void __qla1280_dump_buffer(char *
  */
 #ifdef MODULE
 static char *qla1280;
+int adapter_id=-1;
 
 /* insmod qla1280 options=verbose" */
 MODULE_PARM(qla1280, "s");
+MODULE_PARM(adapter_id, "i");
+MODULE_PARM_DESC(adapter_id, "SCSI Initiator ID: -1 use NVRAM, 0-15 set)");
 #else
 __setup("qla1280=", qla1280_setup);
 #endif
@@ -2494,8 +2497,24 @@ qla1280_config_bus(struct scsi_qla_host 
 	/* Initiator ID. */
 	ha->bus_settings[bus].id = nv->bus[bus].config_1.initiator_id;
 	mb[0] = MBC_SET_INITIATOR_ID;
+#ifdef MODULE
+	if (adapter_id <0 || adapter_id>15) {
+		if (adapter_id != -1) {
+			printk(KERN_WARNING
+				"qla1280 provided illegal adapter_id."
+				"  Using NVRAM default\n");
+		}
+		mb[1] = bus ? ha->bus_settings[bus].id | BIT_7 :
+			ha->bus_settings[bus].id;
+	} else {
+		mb[1] = bus ? adapter_id | BIT_7 :
+			adapter_id;
+	}
+#else
 	mb[1] = bus ? ha->bus_settings[bus].id | BIT_7 :
 		ha->bus_settings[bus].id;
+#endif
+
 	status = qla1280_mailbox_command(ha, BIT_1 | BIT_0, &mb[0]);
 
 	/* Reset Delay. */

             reply	other threads:[~2004-11-05  1:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-05  1:18 linux [this message]
2004-11-30 10:19 ` [PATCH] qla1280.c patch against 2.6.9 to allow settings of Initiator ID Jes Sorensen
2004-11-30 10:36   ` Graham Wood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041105011830.GG8974@dragonhold.org \
    --to=linux@dragonhold.org \
    --cc=James.Bottomley@SteelEye.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.