* [PATCH] qla1280.c patch against 2.6.9 to allow settings of Initiator ID
@ 2004-11-05 1:18 linux
2004-11-30 10:19 ` Jes Sorensen
0 siblings, 1 reply; 3+ messages in thread
From: linux @ 2004-11-05 1:18 UTC (permalink / raw)
To: James.Bottomley; +Cc: linux-scsi
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. */
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] qla1280.c patch against 2.6.9 to allow settings of Initiator ID
2004-11-05 1:18 [PATCH] qla1280.c patch against 2.6.9 to allow settings of Initiator ID linux
@ 2004-11-30 10:19 ` Jes Sorensen
2004-11-30 10:36 ` Graham Wood
0 siblings, 1 reply; 3+ messages in thread
From: Jes Sorensen @ 2004-11-30 10:19 UTC (permalink / raw)
To: linux; +Cc: James.Bottomley, linux-scsi
>>>>> "Graham" == linux <linux@dragonhold.org> writes:
Graham> I'm also not sure if this is the sort of thing that anyone
Graham> other than me would be interested in, and I can't find a
Graham> maintainer specifically for the qla1280 driver. So please
Graham> accept my apologies if this shouldn't have been sent to you.
Graham> It's the first I've done, so I'm more than willing to listen
Graham> to suggestions on how to improve the style and/or code.
Graham,
What would be the reasoning for this patch? If this was something that
should supported by drivers, it ought to be set using an API at a
higher level rather than by the individual drivers IMHO.
Cheers,
Jes
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] qla1280.c patch against 2.6.9 to allow settings of Initiator ID
2004-11-30 10:19 ` Jes Sorensen
@ 2004-11-30 10:36 ` Graham Wood
0 siblings, 0 replies; 3+ messages in thread
From: Graham Wood @ 2004-11-30 10:36 UTC (permalink / raw)
To: Jes Sorensen; +Cc: linux-scsi
On Tue, Nov 30, 2004 at 05:19:39AM -0500, Jes Sorensen wrote:
> What would be the reasoning for this patch?
I've got a pair of dual 10160 controller cards that I've salvaged and don't have a PC BIOS on them - which means I've got no way to set the SCSI ID other than through the driver. They both default to ID7, which causes a problem when I attempt to dual-attach storage.
I couldn't find any way to do that, so I patched the driver. Since I wasn't sure if this would help other people, I thought I'd offer it as a patch. It also seemed a simple enough change to be a good place to start, since I want to get a better understanding of the stuff I'm running as well.
> higher level rather than by the individual drivers IMHO.
Definitely - it would be better if there was a standard way to specify the SCSI ID, but since this gets set during the module initialisation, I'm not sure what sort of higher level API would make sense.
AFAIK, without unloading & reloading the driver, I don't think there's a sane way to change the ID on these cards, or indeed probably any card - since it involves a complete reset of the card (again, AFAIK).
There are similar options on a couple of the drivers, which is why I thought just adding it here would be the simplest way to do it.
Graham
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-11-30 10:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-05 1:18 [PATCH] qla1280.c patch against 2.6.9 to allow settings of Initiator ID linux
2004-11-30 10:19 ` Jes Sorensen
2004-11-30 10:36 ` Graham Wood
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.