qla1280.c patch against 2.6.9 to allow settings of Initiator ID
PATCH 1/1 qla1280.c patch against 2.6.9 to allow settings of Initiator ID
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
usr/src/linux-2.6.9/drivers/scsi/qla1280.c renamed from usr/src/linux-2.6.9/drivers/scsi/qla1280.c.orig +19 -0
@@ -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. */
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Graham" == linux <[email protected]> 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
Quoted 1 line · Jes Sorensen
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.
Quoted 1 line
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