patch-2.3.35 linux/drivers/scsi/BusLogic.c
Next file: linux/drivers/scsi/BusLogic.h
Previous file: linux/drivers/sbus/sbus.c
Back to the patch index
Back to the overall index
- Lines: 165
- Date:
Tue Dec 21 10:17:32 1999
- Orig file:
v2.3.34/linux/drivers/scsi/BusLogic.c
- Orig date:
Thu Nov 11 20:11:43 1999
diff -u --recursive --new-file v2.3.34/linux/drivers/scsi/BusLogic.c linux/drivers/scsi/BusLogic.c
@@ -75,13 +75,13 @@
/*
- BusLogic_Options can be assigned a string by the Loadable Kernel Module
- Installation Facility to be parsed for BusLogic Driver Options
- specifications.
+ BusLogic can be assigned a string by insmod.
*/
-static char
- *BusLogic_Options = NULL;
+#ifdef MODULE
+static char *BusLogic = NULL;
+MODULE_PARM(BusLogic, "s");
+#endif
/*
@@ -2724,8 +2724,10 @@
return 0;
}
memset(PrototypeHostAdapter, 0, sizeof(BusLogic_HostAdapter_T));
- if (BusLogic_Options != NULL)
- BusLogic_ParseDriverOptions(BusLogic_Options);
+#ifdef MODULE
+ if (BusLogic != NULL)
+ BusLogic_Setup(BusLogic);
+#endif
BusLogic_InitializeProbeInfoList(PrototypeHostAdapter);
for (ProbeIndex = 0; ProbeIndex < BusLogic_ProbeInfoCount; ProbeIndex++)
{
@@ -4655,14 +4657,14 @@
INSMOD Loadable Kernel Module Installation Facility:
insmod BusLogic.o \
- 'BusLogic_Options="QueueDepth:[,7,15];QueueDepth:31,BusSettleTime:30"'
+ 'BusLogic="QueueDepth:[,7,15];QueueDepth:31,BusSettleTime:30"'
NOTE: Module Utilities 2.1.71 or later is required for correct parsing
of driver options containing commas.
*/
-static void BusLogic_ParseDriverOptions(char *OptionsString)
+static int __init BusLogic_ParseDriverOptions(char *OptionsString)
{
while (true)
{
@@ -4705,7 +4707,7 @@
BusLogic_Error("BusLogic: Invalid Driver Options "
"(illegal I/O Address 0x%X)\n",
NULL, IO_Address);
- return;
+ return 0;
}
}
else if (BusLogic_ParseKeyword(&OptionsString, "NoProbeISA"))
@@ -4735,7 +4737,7 @@
BusLogic_Error("BusLogic: Invalid Driver Options "
"(illegal Queue Depth %d)\n",
NULL, QueueDepth);
- return;
+ return 0;
}
DriverOptions->QueueDepth[TargetID] = QueueDepth;
if (*OptionsString == ',')
@@ -4747,7 +4749,7 @@
BusLogic_Error("BusLogic: Invalid Driver Options "
"(',' or ']' expected at '%s')\n",
NULL, OptionsString);
- return;
+ return 0;
}
}
if (*OptionsString != ']')
@@ -4755,7 +4757,7 @@
BusLogic_Error("BusLogic: Invalid Driver Options "
"(']' expected at '%s')\n",
NULL, OptionsString);
- return;
+ return 0;
}
else OptionsString++;
}
@@ -4769,7 +4771,7 @@
BusLogic_Error("BusLogic: Invalid Driver Options "
"(illegal Queue Depth %d)\n",
NULL, QueueDepth);
- return;
+ return 0;
}
DriverOptions->CommonQueueDepth = QueueDepth;
for (TargetID = 0;
@@ -4887,7 +4889,7 @@
BusLogic_Error("BusLogic: Invalid Driver Options "
"(illegal Bus Settle Time %d)\n",
NULL, BusSettleTime);
- return;
+ return 0;
}
DriverOptions->BusSettleTime = BusSettleTime;
}
@@ -4925,7 +4927,7 @@
{
BusLogic_Error("BusLogic: Invalid Driver Options "
"(all or no I/O Addresses must be specified)\n", NULL);
- return;
+ return 0;
}
/*
Tagged Queuing is disabled when the Queue Depth is 1 since queuing
@@ -4939,8 +4941,9 @@
DriverOptions->TaggedQueuingPermittedMask |= TargetBit;
}
if (*OptionsString == ';') OptionsString++;
- if (*OptionsString == '\0') return;
+ if (*OptionsString == '\0') return 0;
}
+ return 1;
}
@@ -4948,26 +4951,30 @@
BusLogic_Setup handles processing of Kernel Command Line Arguments.
*/
-void BusLogic_Setup(char *CommandLineString, int *CommandLineIntegers)
+static int __init
+BusLogic_Setup(char *str)
{
- if (CommandLineIntegers[0] != 0)
- {
- BusLogic_Error("BusLogic: Obsolete Command Line Entry "
- "Format Ignored\n", NULL);
- return;
- }
- if (CommandLineString == NULL || *CommandLineString == '\0') return;
- BusLogic_ParseDriverOptions(CommandLineString);
+ int ints[3];
+
+ (void)get_options(str, ARRAY_SIZE(ints), ints);
+
+ if (ints[0] != 0) {
+ BusLogic_Error("BusLogic: Obsolete Command Line Entry "
+ "Format Ignored\n", NULL);
+ return 0;
+ }
+ if (str == NULL || *str == '\0')
+ return 0;
+ return BusLogic_ParseDriverOptions(str);
}
+__setup("BusLogic=", BusLogic_Setup);
/*
Include Module support if requested.
*/
#ifdef MODULE
-
-MODULE_PARM(BusLogic_Options, "s");
SCSI_Host_Template_T driver_template = BUSLOGIC;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)