aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/scsi/BusLogic.txt
blob: d7fbc9488b9859f334e6ef41f193272f2355421d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
	   BusLogic MultiMaster and FlashPoint SCSI Driver for Linux

			 Version 2.0.15 for Linux 2.0
			 Version 2.1.15 for Linux 2.1

			      PRODUCTION RELEASE

				17 August 1998

			       Leonard N. Zubkoff
			       Dandelion Digital
			       lnz@dandelion.com

	 Copyright 1995-1998 by Leonard N. Zubkoff <lnz@dandelion.com>


				 INTRODUCTION

BusLogic, Inc. designed and manufactured a variety of high performance SCSI
host adapters which share a common programming interface across a diverse
collection of bus architectures by virtue of their MultiMaster ASIC technology.
BusLogic was acquired by Mylex Corporation in February 1996, but the products
supported by this driver originated under the BusLogic name and so that name is
retained in the source code and documentation.

This driver supports all present BusLogic MultiMaster Host Adapters, and should
support any future MultiMaster designs with little or no modification.  More
recently, BusLogic introduced the FlashPoint Host Adapters, which are less
costly and rely on the host CPU, rather than including an onboard processor.
Despite not having an onboard CPU, the FlashPoint Host Adapters perform very
well and have very low command latency.  BusLogic has recently provided me with
the FlashPoint Driver Developer's Kit, which comprises documentation and freely
redistributable source code for the FlashPoint SCCB Manager.  The SCCB Manager
is the library of code that runs on the host CPU and performs functions
analogous to the firmware on the MultiMaster Host Adapters.  Thanks to their
having provided the SCCB Manager, this driver now supports the FlashPoint Host
Adapters as well.

My primary goals in writing this completely new BusLogic driver for Linux are
to achieve the full performance that BusLogic SCSI Host Adapters and modern
SCSI peripherals are capable of, and to provide a highly robust driver that can
be depended upon for high performance mission critical applications.  All of
the major performance features can be configured from the Linux kernel command
line or at module initialization time, allowing individual installations to
tune driver performance and error recovery to their particular needs.

The latest information on Linux support for BusLogic SCSI Host Adapters, as
well as the most recent release of this driver and the latest firmware for the
BT-948/958/958D, will always be available from my Linux Home Page at URL
"http://sourceforge.net/projects/dandelion/".

Bug reports should be sent via electronic mail to "lnz@dandelion.com".  Please
include with the bug report the complete configuration messages reported by the
driver and SCSI subsystem at startup, along with any subsequent system messages
relevant to SCSI operations, and a detailed description of your system's
hardware configuration.

Mylex has been an excellent company to work with and I highly recommend their
products to the Linux community.  In November 1995, I was offered the
opportunity to become a beta test site for their latest MultiMaster product,
the BT-948 PCI Ultra SCSI Host Adapter, and then again for the BT-958 PCI Wide
Ultra SCSI Host Adapter in January 1996.  This was mutually beneficial since
Mylex received a degree and kind of testing that their own testing group cannot
readily achieve, and the Linux community has available high performance host
adapters that have been well tested with Linux even before being brought to
market.  This relationship has also given me the opportunity to interact
directly with their technical staff, to understand more about the internal
workings of their products, and in turn to educate them about the needs and
potential of the Linux community.

More recently, Mylex has reaffirmed the company's interest in supporting the
Linux community, and I am now working on a Linux driver for the DAC960 PCI RAID
Controllers.  Mylex's interest and support is greatly appreciated.

Unlike some other vendors, if you contact Mylex Technical Support with a
problem and are running Linux, they will not tell you that your use of their
products is unsupported.  Their latest product marketing literature even states
"Mylex SCSI host adapters are compatible with all major operating systems
including: ... Linux ...".

Mylex Corporation is located at 34551 Ardenwood Blvd., Fremont, California
94555, USA and can be reached at 510/796-6100 or on the World Wide Web at
http://www.mylex.com.  Mylex HBA Technical Support can be reached by electronic
mail at techsup@mylex.com, by Voice at 510/608-2400, or by FAX at 510/745-7715.
Contact information for offices in Europe and Japan is available on the Web
site.


				DRIVER FEATURES

o Configuration Reporting and Testing

  During system initialization, the driver reports extensively on the host
  adapter hardware configuration, including the synchronous transfer parameters
  requested and negotiated with each target device.  AutoSCSI settings for
  Synchronous Negotiation, Wide Negotiation, and Disconnect/Reconnect are
  reported for each target device, as well as the status of Tagged Queuing.
  If the same setting is in effect for all target devices, then a single word
  or phrase is used; otherwise, a letter is provided for each target device to
  indicate the individual status.  The following examples
  should clarify this reporting format:

    Synchronous Negotiation: Ultra

      Synchronous negotiation is enabled for all target devices and the host
      adapter will attempt to negotiate for 20.0 mega-transfers/second.

    Synchronous Negotiation: Fast

      Synchronous negotiation is enabled for all target devices and the host
      adapter will attempt to negotiate for 10.0 mega-transfers/second.

    Synchronous Negotiation: Slow

      Synchronous negotiation is enabled for all target devices and the host
      adapter will attempt to negotiate for 5.0 mega-transfers/second.

    Synchronous Negotiation: Disabled

      Synchronous negotiation is disabled and all target devices are limited to
      asynchronous operation.

    Synchronous Negotiation: UFSNUUU#UUUUUUUU

      Synchronous negotiation to Ultra speed is enabled for target devices 0
      and 4 through 15, to Fast speed for target device 1, to Slow speed for
      target device 2, and is not permitted to target device 3.  The host
      adapter's SCSI ID is represented by the "#".

    The status of Wide Negotiation, Disconnect/Reconnect, and Tagged Queuing
    are reported as "Enabled", Disabled", or a sequence of "Y" and "N" letters.

o Performance Features

  BusLogic SCSI Host Adapters directly implement SCSI-2 Tagged Queuing, and so
  support has been included in the driver to utilize tagged queuing with any
  target devices that report having the tagged queuing capability.  Tagged
  queuing allows for multiple outstanding commands to be issued to each target
  device or logical unit, and can improve I/O performance substantially.  In
  addition, BusLogic's Strict Round Robin Mode is used to optimize host adapter
  performance, and scatter/gather I/O can support as many segments as can be
  effectively utilized by the Linux I/O subsystem.  Control over the use of
  tagged queuing for each target device as well as individual selection of the
  tagged queue depth is available through driver options provided on the kernel
  command line or at module initialization time.  By default, the queue depth
  is determined automatically based on the host adapter's total queue depth and
  the number, type, speed, and capabilities of the target devices found.  In
  addition, tagged queuing is automatically disabled whenever the host adapter
  firmware version is known not to implement it correctly, or whenever a tagged
  queue depth of 1 is selected.  Tagged queuing is also disabled for individual
  target devices if disconnect/reconnect is disabled for that device.

o Robustness Features

  The driver implements extensive error recovery procedures.  When the higher
  level parts of the SCSI subsystem request that a timed out command be reset,
  a selection is made between a full host adapter hard reset and SCSI bus reset
  versus sending a bus device reset message to the individual target device
  based on the recommendation of the SCSI subsystem.  Error recovery strategies
  are selectable through driver options individually for each target device,
  and also include sending a bus device reset to the specific target device
  associated with the command being reset, as well as suppressing error
  recovery entirely to avoid perturbing an improperly functioning device.  If
  the bus device reset error recovery strategy is selected and sending a bus
  device reset does not restore correct operation, the next command that is
  reset will force a full host adapter hard reset and SCSI bus reset.  SCSI bus
  resets caused by other devices and detected by the host adapter are also
  handled by issuing a soft reset to the host adapter and re-initialization.
  Finally, if tagged queuing is active and more than one command reset occurs
  in a 10 minute interval, or if a command reset occurs within the first 10
  minutes of operation, then tagged queuing will be disabled for that target
  device.  These error recovery options improve overall system robustness by
  preventing individual errant devices from causing the system as a whole to
  lock up or crash, and thereby allowing a clean shutdown and restart after the
  offending component is removed.

o PCI Configuration Support

  On PCI systems running kernels compiled with PCI BIOS support enabled, this
  driver will interrogate the PCI configuration space and use the I/O port
  addresses assigned by the system BIOS, rather than the ISA compatible I/O
  port addresses.  The ISA compatible I/O port address is then disabled by the
  driver.  On PCI systems it is also recommended that the AutoSCSI utility be
  used to disable the ISA compatible I/O port entirely as it is not necessary.
  The ISA compatible I/O port is disabled by default on the BT-948/958/958D.

o /proc File System Support

  Copies of the host adapter configuration information together with updated
  data transfer and error recovery statistics are available through the
  /proc/scsi/BusLogic/<N> interface.

o Shared Interrupts Support

  On systems that support shared interrupts, any number of BusLogic Host
  Adapters may share the same interrupt request channel.


			    SUPPORTED HOST ADAPTERS

The following list comprises the supported BusLogic SCSI Host Adapters as of
the date of this document.  It is recommended that anyone purchasing a BusLogic
Host Adapter not in the following table contact the author beforehand to verify
that it is or will be supported.

FlashPoint Series PCI Host Adapters:

FlashPoint LT (BT-930)	Ultra SCSI-3
FlashPoint LT (BT-930R)	Ultra SCSI-3 with RAIDPlus
FlashPoint LT (BT-920)	Ultra SCSI-3 (BT-930 without BIOS)
FlashPoint DL (BT-932)	Dual Channel Ultra SCSI-3
FlashPoint DL (BT-932R)	Dual Channel Ultra SCSI-3 with RAIDPlus
FlashPoint LW (BT-950)	Wide Ultra SCSI-3
FlashPoint LW (BT-950R)	Wide Ultra SCSI-3 with RAIDPlus
FlashPoint DW (BT-952)	Dual Channel Wide Ultra SCSI-3
FlashPoint DW (BT-952R)	Dual Channel Wide Ultra SCSI-3 with RAIDPlus

MultiMaster "W" Series Host Adapters:

BT-948	    PCI		Ultra SCSI-3
BT-958	    PCI		Wide Ultra SCSI-3
BT-958D	    PCI		Wide Differential Ultra SCSI-3

MultiMaster "C" Series Host Adapters:

BT-946C	    PCI		Fast SCSI-2
BT-956C	    PCI		Wide Fast SCSI-2
BT-956CD    PCI		Wide Differential Fast SCSI-2
BT-445C	    VLB		Fast SCSI-2
BT-747C	    EISA	Fast SCSI-2
BT-757C	    EISA	Wide Fast SCSI-2
BT-757CD    EISA	Wide Differential Fast SCSI-2
BT-545C	    ISA		Fast SCSI-2
BT-540CF    ISA		Fast SCSI-2

MultiMaster "S" Series Host Adapters:

BT-445S	    VLB		Fast SCSI-2
BT-747S	    EISA	Fast SCSI-2
BT-747D	    EISA	Differential Fast SCSI-2
BT-757S	    EISA	Wide Fast SCSI-2
BT-757D	    EISA	Wide Differential Fast SCSI-2
BT-545S	    ISA		Fast SCSI-2
BT-542D	    ISA		Differential Fast SCSI-2
BT-742A	    EISA	SCSI-2 (742A revision H)
BT-542B	    ISA		SCSI-2 (542B revision H)

MultiMaster "A" Series Host Adapters:

BT-742A	    EISA	SCSI-2 (742A revisions A - G)
BT-542B	    ISA		SCSI-2 (542B revisions A - G)

AMI FastDisk Host Adapters that are true BusLogic MultiMaster clones are also
supported by this driver.

BusLogic SCSI Host Adapters are available packaged both as bare boards and as
retail kits.  The BT- model numbers above refer to the bare board packaging.
The retail kit model numbers are found by replacing BT- with KT- in the above
list.  The retail kit includes the bare board and manual as well as cabling and
driver media and documentation that are not provided with bare boards.


			 FLASHPOINT INSTALLATION NOTES

o RAIDPlus Support

  FlashPoint Host Adapters now include RAIDPlus, Mylex's bootable software
  RAID.  RAIDPlus is not supported on Linux, and there are no plans to support
  it.  The MD driver in Linux 2.0 provides for concatenation (LINEAR) and
  striping (RAID-0), and support for mirroring (RAID-1), fixed parity (RAID-4),
  and distributed parity (RAID-5) is available separately.  The built-in Linux
  RAID support is generally more flexible and is expected to perform better
  than RAIDPlus, so there is little impetus to include RAIDPlus support in the
  BusLogic driver.

o Enabling UltraSCSI Transfers

  FlashPoint Host Adapters ship with their configuration set to "Factory
  Default" settings that are conservative and do not allow for UltraSCSI speed
  to be negotiated.  This results in fewer problems when these host adapters
  are installed in systems with cabling or termination that is not sufficient
  for UltraSCSI operation, or where existing SCSI devices do not properly
  respond to synchronous transfer negotiation for UltraSCSI speed.  AutoSCSI
  may be used to load "Optimum Performance" settings which allow UltraSCSI
  speed to be negotiated with all devices, or UltraSCSI speed can be enabled on
  an individual basis.  It is recommended that SCAM be manually disabled after
  the "Optimum Performance" settings are loaded.


		      BT-948/958/958D INSTALLATION NOTES

The BT-948/958/958D PCI Ultra SCSI Host Adapters have some features which may
require attention in some circumstances when installing Linux.

o PCI I/O Port Assignments

  When configured to factory default settings, the BT-948/958/958D will only
  recognize the PCI I/O port assignments made by the motherboard's PCI BIOS.
  The BT-948/958/958D will not respond to any of the ISA compatible I/O ports
  that previous BusLogic SCSI Host Adapters respond to.  This driver supports
  the PCI I/O port assignments, so this is the preferred configuration.
  However, if the obsolete BusLogic driver must be used for any reason, such as
  a Linux distribution that does not yet use this driver in its boot kernel,
  BusLogic has provided an AutoSCSI configuration option to enable a legacy ISA
  compatible I/O port.

  To enable this backward compatibility option, invoke the AutoSCSI utility via
  Ctrl-B at system startup and select "Adapter Configuration", "View/Modify
  Configuration", and then change the "ISA Compatible Port" setting from
  "Disable" to "Primary" or "Alternate".  Once this driver has been installed,
  the "ISA Compatible Port" option should be set back to "Disable" to avoid
  possible future I/O port conflicts.  The older BT-946C/956C/956CD also have
  this configuration option, but the factory default setting is "Primary".

o PCI Slot Scanning Order

  In systems with multiple BusLogic PCI Host Adapters, the order in which the
  PCI slots are scanned may appear reversed with the BT-948/958/958D as
  compared to the BT-946C/956C/956CD.  For booting from a SCSI disk to work
  correctly, it is necessary that the host adapter's BIOS and the kernel agree
  on which disk is the boot device, which requires that they recognize the PCI
  host adapters in the same order.  The motherboard's PCI BIOS provides a
  standard way of enumerating the PCI host adapters, which is used by the Linux
  kernel.  Some PCI BIOS implementations enumerate the PCI slots in order of
  increasing bus number and device number, while others do so in the opposite
  direction.

  Unfortunately, Microsoft decided that Windows 95 would always enumerate the
  PCI slots in order of increasing bus number and device number regardless of
  the PCI BIOS enumeration, and requires that their scheme be supported by the
  host adapter's BIOS to receive Windows 95 certification.  Therefore, the
  factory default settings of the BT-948/958/958D enumerate the host adapters
  by increasing bus number and device number.  To disable this feature, invoke
  the AutoSCSI utility via Ctrl-B at system startup and select "Adapter
  Configuration", "View/Modify Configuration", press Ctrl-F10, and then change
  the "Use Bus And Device # For PCI Scanning Seq." option to OFF.

  This driver will interrogate the setting of the PCI Scanning Sequence option
  so as to recognize the host adapters in the same order as they are enumerated
  by the host adapter's BIOS.

o Enabling UltraSCSI Transfers

  The BT-948/958/958D ship with their configuration set to "Factory Default"
  settings that are conservative and do not allow for UltraSCSI speed to be
  negotiated.  This results in fewer problems when these host adapters are
  installed in systems with cabling or termination that is not sufficient for
  UltraSCSI operation, or where existing SCSI devices do not properly respond
  to synchronous transfer negotiation for UltraSCSI speed.  AutoSCSI may be
  used to load "Optimum Performance" settings which allow UltraSCSI speed to be
  negotiated with all devices, or UltraSCSI speed can be enabled on an
  individual basis.  It is recommended that SCAM be manually disabled after the
  "Optimum Performance" settings are loaded.


				DRIVER OPTIONS

BusLogic Driver Options may be specified either via the Linux Kernel Command
Line or via the Loadable Kernel Module Installation Facility.  Driver Options
for multiple host adapters may be specified either by separating the option
strings by a semicolon, or by specifying multiple "BusLogic=" strings on the
command line.  Individual option specifications for a single host adapter are
separated by commas.  The Probing and Debugging Options apply to all host
adapters whereas the remaining options apply individually only to the
selected host adapter.

The BusLogic Driver Probing Options comprise the following:

IO:<integer>

  The "IO:" option specifies an ISA I/O Address to be probed for a non-PCI
  MultiMaster Host Adapter.  If neither "IO:" nor "NoProbeISA" options are
  specified, then the standard list of BusLogic MultiMaster ISA I/O Addresses
  will be probed (0x330, 0x334, 0x230, 0x234, 0x130, and 0x134).  Multiple
  "IO:" options may be specified to precisely determine the I/O Addresses to
  be probed, but the probe order will always follow the standard list.

NoProbe

  The "NoProbe" option disables all probing and therefore no BusLogic Host
  Adapters will be detected.

NoProbeISA

  The "NoProbeISA" option disables probing of the standard BusLogic ISA I/O
  Addresses and therefore only PCI MultiMaster and FlashPoint Host Adapters
  will be detected.

NoProbePCI

  The "NoProbePCI" options disables the interrogation of PCI Configuration
  Space and therefore only ISA Multimaster Host Adapters will be detected, as
  well as PCI Multimaster Host Adapters that have their ISA Compatible I/O
  Port set to "Primary" or "Alternate".

NoSortPCI

  The "NoSortPCI" option forces PCI MultiMaster Host Adapters to be
  enumerated in the order provided by the PCI BIOS, ignoring any setting of
  the AutoSCSI "Use Bus And Device # For PCI Scanning Seq." option.

MultiMasterFirst

  The "MultiMasterFirst" option forces MultiMaster Host Adapters to be probed
  before FlashPoint Host Adapters.  By default, if both FlashPoint and PCI
  MultiMaster Host Adapters are present, this driver will probe for
  FlashPoint Host Adapters first unless the BIOS primary disk is controlled
  by the first PCI MultiMaster Host Adapter, in which case MultiMaster Host
  Adapters will be probed first.

FlashPointFirst

  The "FlashPointFirst" option forces FlashPoint Host Adapters to be probed
  before MultiMaster Host Adapters.

The BusLogic Driver Tagged Queuing Options allow for explicitly specifying
the Queue Depth and whether Tagged Queuing is permitted for each Target
Device (assuming that the Target Device supports Tagged Queuing).  The Queue
Depth is the number of SCSI Commands that are allowed to be concurrently
presented for execution (either to the Host Adapter or Target Device).  Note
that explicitly enabling Tagged Queuing may lead to problems; the option to
enable or disable Tagged Queuing is provided primarily to allow disabling
Tagged Queuing on Target Devices that do not implement it correctly.  The
following options are available:

QueueDepth:<integer>

  The "QueueDepth:" or QD:" option specifies the Queue Depth to use for all
  Target Devices that support Tagged Queuing, as well as the maximum Queue
  Depth for devices that do not support Tagged Queuing.  If no Queue Depth
  option is provided, the Queue Depth will be determined automatically based
  on the Host Adapter's Total Queue Depth and the number, type, speed, and
  capabilities of the detected Target Devices.  For Host Adapters that
  require ISA Bounce Buffers, the Queue Depth is automatically set by default
  to BusLogic_TaggedQueueDepthBB or BusLogic_UntaggedQueueDepthBB to avoid
  excessive preallocation of DMA Bounce Buffer memory.  Target Devices that
  do not support Tagged Queuing always have their Queue Depth set to
  BusLogic_UntaggedQueueDepth or BusLogic_UntaggedQueueDepthBB, unless a
  lower Queue Depth option is provided.  A Queue Depth of 1 automatically
  disables Tagged Queuing.

QueueDepth:[<integer>,<integer>...]

  The "QueueDepth:[...]" or "QD:[...]" option specifies the Queue Depth
  individually for each Target Device.  If an <integer> is omitted, the
  associated Target Device will have its Queue Depth selected automatically.

TaggedQueuing:Default

  The "TaggedQueuing:Default" or "TQ:Default" option permits Tagged Queuing
  based on the firmware version of the BusLogic Host Adapter and based on
  whether the Queue Depth allows queuing multiple commands.

TaggedQueuing:Enable

  The "TaggedQueuing:Enable" or "TQ:Enable" option enables Tagged Queuing for
  all Target Devices on this Host Adapter, overriding any limitation that
  would otherwise be imposed based on the Host Adapter firmware version.

TaggedQueuing:Disable

  The "TaggedQueuing:Disable" or "TQ:Disable" option disables Tagged Queuing
  for all Target Devices on this Host Adapter.

TaggedQueuing:<Target-Spec>

  The "TaggedQueuing:<Target-Spec>" or "TQ:<Target-Spec>" option controls
  Tagged Queuing individually for each Target Device.  <Target-Spec> is a
  sequence of "Y", "N", and "X" characters.  "Y" enables Tagged Queuing, "N"
  disables Tagged Queuing, and "X" accepts the default based on the firmware
  version.  The first character refers to Target Device 0, the second to
  Target Device 1, and so on; if the sequence of "Y", "N", and "X" characters
  does not cover all the Target Devices, unspecified characters are assumed
  to be "X".

The BusLogic Driver Miscellaneous Options comprise the following:

BusSettleTime:<seconds>

  The "BusSettleTime:" or "BST:" option specifies the Bus Settle Time in
  seconds.  The Bus Settle Time is the amount of time to wait between a Host
  Adapter Hard Reset which initiates a SCSI Bus Reset and issuing any SCSI
  Commands.  If unspecified, it defaults to BusLogic_DefaultBusSettleTime.

InhibitTargetInquiry

  The "InhibitTargetInquiry" option inhibits the execution of an Inquire
  Target Devices or Inquire Installed Devices command on MultiMaster Host
  Adapters.  This may be necessary with some older Target Devices that do not
  respond correctly when Logical Units above 0 are addressed.

The BusLogic Driver Debugging Options comprise the following:

TraceProbe

  The "TraceProbe" option enables tracing of Host Adapter Probing.

TraceHardwareReset

  The "TraceHardwareReset" option enables tracing of Host Adapter Hardware
  Reset.

TraceConfiguration

  The "TraceConfiguration" option enables tracing of Host Adapter
  Configuration.

TraceErrors

  The "TraceErrors" option enables tracing of SCSI Commands that return an
  error from the Target Device.  The CDB and Sense Data will be printed for
  each SCSI Command that fails.

Debug

  The "Debug" option enables all debugging options.

The following examples demonstrate setting the Queue Depth for Target Devices
1 and 2 on the first host adapter to 7 and 15, the Queue Depth for all Target
Devices on the second host adapter to 31, and the Bus Settle Time on the
second host adapter to 30 seconds.

Linux Kernel Command Line:

  linux BusLogic=QueueDepth:[,7,15];QueueDepth:31,BusSettleTime:30

LILO Linux Boot Loader (in /etc/lilo.conf):

  append = "BusLogic=QueueDepth:[,7,15];QueueDepth:31,BusSettleTime:30"

INSMOD Loadable Kernel Module Installation Facility:

  insmod BusLogic.o \
      '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.


			      DRIVER INSTALLATION

This distribution was prepared for Linux kernel version 2.0.35, but should be
compatible with 2.0.4 or any later 2.0 series kernel.

To install the new BusLogic SCSI driver, you may use the following commands,
replacing "/usr/src" with wherever you keep your Linux kernel source tree:

  cd /usr/src
  tar -xvzf BusLogic-2.0.15.tar.gz
  mv README.* LICENSE.* BusLogic.[ch] FlashPoint.c linux/drivers/scsi
  patch -p0 < BusLogic.patch (only for 2.0.33 and below)
  cd linux
  make config
  make zImage

Then install "arch/i386/boot/zImage" as your standard kernel, run lilo if
appropriate, and reboot.


		      BUSLOGIC ANNOUNCEMENTS MAILING LIST

The BusLogic Announcements Mailing List provides a forum for informing Linux
users of new driver releases and other announcements regarding Linux support
for BusLogic SCSI Host Adapters.  To join the mailing list, send a message to
"buslogic-announce-request@dandelion.com" with the line "subscribe" in the
message body.
="hl opt">*dev); void tms380tr_wait(unsigned long time); #define TMS380TR_MAX_ADAPTERS 7 #define SEND_TIMEOUT 10*HZ #define TR_RCF_LONGEST_FRAME_MASK 0x0070 #define TR_RCF_FRAME4K 0x0030 /*------------------------------------------------------------------*/ /* Bit order for adapter communication with DMA */ /* -------------------------------------------------------------- */ /* Bit 8 | 9| 10| 11|| 12| 13| 14| 15|| 0| 1| 2| 3|| 4| 5| 6| 7| */ /* -------------------------------------------------------------- */ /* The bytes in a word must be byte swapped. Also, if a double */ /* word is used for storage, then the words, as well as the bytes, */ /* must be swapped. */ /* Bit order for adapter communication with DIO */ /* -------------------------------------------------------------- */ /* Bit 0 | 1| 2| 3|| 4| 5| 6| 7|| 8| 9| 10| 11|| 12| 13| 14| 15| */ /* -------------------------------------------------------------- */ /*------------------------------------------------------------------*/ /* Swap words of a long. */ #define SWAPW(x) (((x) << 16) | ((x) >> 16)) /* Get the low byte of a word. */ #define LOBYTE(w) ((unsigned char)(w)) /* Get the high byte of a word. */ #define HIBYTE(w) ((unsigned char)((unsigned short)(w) >> 8)) /* Get the low word of a long. */ #define LOWORD(l) ((unsigned short)(l)) /* Get the high word of a long. */ #define HIWORD(l) ((unsigned short)((unsigned long)(l) >> 16)) /* Token ring adapter I/O addresses for normal mode. */ /* * The SIF registers. Common to all adapters. */ /* Basic SIF (SRSX = 0) */ #define SIFDAT 0x00 /* SIF/DMA data. */ #define SIFINC 0x02 /* IO Word data with auto increment. */ #define SIFINH 0x03 /* IO Byte data with auto increment. */ #define SIFADR 0x04 /* SIF/DMA Address. */ #define SIFCMD 0x06 /* SIF Command. */ #define SIFSTS 0x06 /* SIF Status. */ /* "Extended" SIF (SRSX = 1) */ #define SIFACL 0x08 /* SIF Adapter Control Register. */ #define SIFADD 0x0a /* SIF/DMA Address. -- 0x0a */ #define SIFADX 0x0c /* 0x0c */ #define DMALEN 0x0e /* SIF DMA length. -- 0x0e */ /* * POS Registers. Only for ISA Adapters. */ #define POSREG 0x10 /* Adapter Program Option Select (POS) * Register: base IO address + 16 byte. */ #define POSREG_2 24L /* only for TR4/16+ adapter * base IO address + 24 byte. -- 0x18 */ /* SIFCMD command codes (high-low) */ #define CMD_INTERRUPT_ADAPTER 0x8000 /* Cause internal adapter interrupt */ #define CMD_ADAPTER_RESET 0x4000 /* Hardware reset of adapter */ #define CMD_SSB_CLEAR 0x2000 /* Acknowledge to adapter to * system interrupts. */ #define CMD_EXECUTE 0x1000 /* Execute SCB command */ #define CMD_SCB_REQUEST 0x0800 /* Request adapter to interrupt * system when SCB is available for * another command. */ #define CMD_RX_CONTINUE 0x0400 /* Continue receive after odd pointer * stop. (odd pointer receive method) */ #define CMD_RX_VALID 0x0200 /* Now actual RPL is valid. */ #define CMD_TX_VALID 0x0100 /* Now actual TPL is valid. (valid * bit receive/transmit method) */ #define CMD_SYSTEM_IRQ 0x0080 /* Adapter-to-attached-system * interrupt is reset. */ #define CMD_CLEAR_SYSTEM_IRQ 0x0080 /* Clear SYSTEM_INTERRUPT bit. * (write: 1=ignore, 0=reset) */ #define EXEC_SOFT_RESET 0xFF00 /* adapter soft reset. (restart * adapter after hardware reset) */ /* ACL commands (high-low) */ #define ACL_SWHLDA 0x0800 /* Software hold acknowledge. */ #define ACL_SWDDIR 0x0400 /* Data transfer direction. */ #define ACL_SWHRQ 0x0200 /* Pseudo DMA operation. */ #define ACL_PSDMAEN 0x0100 /* Enable pseudo system DMA. */ #define ACL_ARESET 0x0080 /* Adapter hardware reset command. * (held in reset condition as * long as bit is set) */ #define ACL_CPHALT 0x0040 /* Communication processor halt. * (can only be set while ACL_ARESET * bit is set; prevents adapter * processor from executing code while * downloading firmware) */ #define ACL_BOOT 0x0020 #define ACL_SINTEN 0x0008 /* System interrupt enable/disable * (1/0): can be written if ACL_ARESET * is zero. */ #define ACL_PEN 0x0004 #define ACL_NSELOUT0 0x0002 #define ACL_NSELOUT1 0x0001 /* NSELOUTx have a card-specific * meaning for setting ring speed. */ #define PS_DMA_MASK (ACL_SWHRQ | ACL_PSDMAEN) /* SIFSTS register return codes (high-low) */ #define STS_SYSTEM_IRQ 0x0080 /* Adapter-to-attached-system * interrupt is valid. */ #define STS_INITIALIZE 0x0040 /* INITIALIZE status. (ready to * initialize) */ #define STS_TEST 0x0020 /* TEST status. (BUD not completed) */ #define STS_ERROR 0x0010 /* ERROR status. (unrecoverable * HW error occurred) */ #define STS_MASK 0x00F0 /* Mask interesting status bits. */ #define STS_ERROR_MASK 0x000F /* Get Error Code by masking the * interrupt code bits. */ #define ADAPTER_INT_PTRS 0x0A00 /* Address offset of adapter internal * pointers 01:0a00 (high-low) have to * be read after init and before open. */ /* Interrupt Codes (only MAC IRQs) */ #define STS_IRQ_ADAPTER_CHECK 0x0000 /* unrecoverable hardware or * software error. */ #define STS_IRQ_RING_STATUS 0x0004 /* SSB is updated with ring status. */ #define STS_IRQ_LLC_STATUS 0x0005 /* Not used in MAC-only microcode */ #define STS_IRQ_SCB_CLEAR 0x0006 /* SCB clear, following an * SCB_REQUEST IRQ. */ #define STS_IRQ_TIMER 0x0007 /* Not normally used in MAC ucode */ #define STS_IRQ_COMMAND_STATUS 0x0008 /* SSB is updated with command * status. */ #define STS_IRQ_RECEIVE_STATUS 0x000A /* SSB is updated with receive * status. */ #define STS_IRQ_TRANSMIT_STATUS 0x000C /* SSB is updated with transmit * status */ #define STS_IRQ_RECEIVE_PENDING 0x000E /* Not used in MAC-only microcode */ #define STS_IRQ_MASK 0x000F /* = STS_ERROR_MASK. */ /* TRANSMIT_STATUS completion code: (SSB.Parm[0]) */ #define COMMAND_COMPLETE 0x0080 /* TRANSMIT command completed * (avoid this!) issue another transmit * to send additional frames. */ #define FRAME_COMPLETE 0x0040 /* Frame has been transmitted; * INTERRUPT_FRAME bit was set in the * CSTAT request; indication of possibly * more than one frame transmissions! * SSB.Parm[0-1]: 32 bit pointer to * TPL of last frame. */ #define LIST_ERROR 0x0020 /* Error in one of the TPLs that * compose the frame; TRANSMIT * terminated; Parm[1-2]: 32bit pointer * to TPL which starts the error * frame; error details in bits 8-13. * (14?) */ #define FRAME_SIZE_ERROR 0x8000 /* FRAME_SIZE does not equal the sum of * the valid DATA_COUNT fields; * FRAME_SIZE less than header plus * information field. (15 bytes + * routing field) Or if FRAME_SIZE * was specified as zero in one list. */ #define TX_THRESHOLD 0x4000 /* FRAME_SIZE greater than (BUFFER_SIZE * - 9) * TX_BUF_MAX. */ #define ODD_ADDRESS 0x2000 /* Odd forward pointer value is * read on a list without END_FRAME * indication. */ #define FRAME_ERROR 0x1000 /* START_FRAME bit (not) anticipated, * but (not) set. */ #define ACCESS_PRIORITY_ERROR 0x0800 /* Access priority requested has not * been allowed. */ #define UNENABLED_MAC_FRAME 0x0400 /* MAC frame has source class of zero * or MAC frame PCF ATTN field is * greater than one. */ #define ILLEGAL_FRAME_FORMAT 0x0200 /* Bit 0 or FC field was set to one. */ /* * Since we need to support some functions even if the adapter is in a * CLOSED state, we have a (pseudo-) command queue which holds commands * that are outstandig to be executed. * * Each time a command completes, an interrupt occurs and the next * command is executed. The command queue is actually a simple word with * a bit for each outstandig command. Therefore the commands will not be * executed in the order they have been queued. * * The following defines the command code bits and the command queue: */ #define OC_OPEN 0x0001 /* OPEN command */ #define OC_TRANSMIT 0x0002 /* TRANSMIT command */ #define OC_TRANSMIT_HALT 0x0004 /* TRANSMIT_HALT command */ #define OC_RECEIVE 0x0008 /* RECEIVE command */ #define OC_CLOSE 0x0010 /* CLOSE command */ #define OC_SET_GROUP_ADDR 0x0020 /* SET_GROUP_ADDR command */ #define OC_SET_FUNCT_ADDR 0x0040 /* SET_FUNCT_ADDR command */ #define OC_READ_ERROR_LOG 0x0080 /* READ_ERROR_LOG command */ #define OC_READ_ADAPTER 0x0100 /* READ_ADAPTER command */ #define OC_MODIFY_OPEN_PARMS 0x0400 /* MODIFY_OPEN_PARMS command */ #define OC_RESTORE_OPEN_PARMS 0x0800 /* RESTORE_OPEN_PARMS command */ #define OC_SET_FIRST_16_GROUP 0x1000 /* SET_FIRST_16_GROUP command */ #define OC_SET_BRIDGE_PARMS 0x2000 /* SET_BRIDGE_PARMS command */ #define OC_CONFIG_BRIDGE_PARMS 0x4000 /* CONFIG_BRIDGE_PARMS command */ #define OPEN 0x0300 /* C: open command. S: completion. */ #define TRANSMIT 0x0400 /* C: transmit command. S: completion * status. (reject: COMMAND_REJECT if * adapter not opened, TRANSMIT already * issued or address passed in the SCB * not word aligned) */ #define TRANSMIT_HALT 0x0500 /* C: interrupt TX TPL chain; if no * TRANSMIT command issued, the command * is ignored (completion with TRANSMIT * status (0x0400)!) */ #define RECEIVE 0x0600 /* C: receive command. S: completion * status. (reject: COMMAND_REJECT if * adapter not opened, RECEIVE already * issued or address passed in the SCB * not word aligned) */ #define CLOSE 0x0700 /* C: close adapter. S: completion. * (COMMAND_REJECT if adapter not open) */ #define SET_GROUP_ADDR 0x0800 /* C: alter adapter group address after * OPEN. S: completion. (COMMAND_REJECT * if adapter not open) */ #define SET_FUNCT_ADDR 0x0900 /* C: alter adapter functional address * after OPEN. S: completion. * (COMMAND_REJECT if adapter not open) */ #define READ_ERROR_LOG 0x0A00 /* C: read adapter error counters. * S: completion. (command ignored * if adapter not open!) */ #define READ_ADAPTER 0x0B00 /* C: read data from adapter memory. * (important: after init and before * open!) S: completion. (ADAPTER_CHECK * interrupt if undefined storage area * read) */ #define MODIFY_OPEN_PARMS 0x0D00 /* C: modify some adapter operational * parameters. (bit correspondend to * WRAP_INTERFACE is ignored) * S: completion. (reject: * COMMAND_REJECT) */ #define RESTORE_OPEN_PARMS 0x0E00 /* C: modify some adapter operational * parameters. (bit correspondend * to WRAP_INTERFACE is ignored) * S: completion. (reject: * COMMAND_REJECT) */ #define SET_FIRST_16_GROUP 0x0F00 /* C: alter the first two bytes in * adapter group address. * S: completion. (reject: * COMMAND_REJECT) */ #define SET_BRIDGE_PARMS 0x1000 /* C: values and conditions for the * adapter hardware to use when frames * are copied for forwarding. * S: completion. (reject: * COMMAND_REJECT) */ #define CONFIG_BRIDGE_PARMS 0x1100 /* C: .. * S: completion. (reject: * COMMAND_REJECT) */ #define SPEED_4 4 #define SPEED_16 16 /* Default transmission speed */ /* Initialization Parameter Block (IPB); word alignment necessary! */ #define BURST_SIZE 0x0018 /* Default burst size */ #define BURST_MODE 0x9F00 /* Burst mode enable */ #define DMA_RETRIES 0x0505 /* Magic DMA retry number... */ #define CYCLE_TIME 3 /* Default AT-bus cycle time: 500 ns * (later adapter version: fix cycle time!) */ #define LINE_SPEED_BIT 0x80 /* Macro definition for the wait function. */ #define ONE_SECOND_TICKS 1000000 #define HALF_SECOND (ONE_SECOND_TICKS / 2) #define ONE_SECOND (ONE_SECOND_TICKS) #define TWO_SECONDS (ONE_SECOND_TICKS * 2) #define THREE_SECONDS (ONE_SECOND_TICKS * 3) #define FOUR_SECONDS (ONE_SECOND_TICKS * 4) #define FIVE_SECONDS (ONE_SECOND_TICKS * 5) #define BUFFER_SIZE 2048 /* Buffers on Adapter */ #pragma pack(1) typedef struct { unsigned short Init_Options; /* Initialize with burst mode; * LLC disabled. (MAC only) */ /* Interrupt vectors the adapter places on attached system bus. */ u_int8_t CMD_Status_IV; /* Interrupt vector: command status. */ u_int8_t TX_IV; /* Interrupt vector: transmit. */ u_int8_t RX_IV; /* Interrupt vector: receive. */ u_int8_t Ring_Status_IV; /* Interrupt vector: ring status. */ u_int8_t SCB_Clear_IV; /* Interrupt vector: SCB clear. */ u_int8_t Adapter_CHK_IV; /* Interrupt vector: adapter check. */ u_int16_t RX_Burst_Size; /* Max. number of transfer cycles. */ u_int16_t TX_Burst_Size; /* During DMA burst; even value! */ u_int16_t DMA_Abort_Thrhld; /* Number of DMA retries. */ u_int32_t SCB_Addr; /* SCB address: even, word aligned, high-low */ u_int32_t SSB_Addr; /* SSB address: even, word aligned, high-low */ } IPB, *IPB_Ptr; #pragma pack() /* * OPEN Command Parameter List (OCPL) (can be reused, if the adapter has to * be reopened) */ #define BUFFER_SIZE 2048 /* Buffers on Adapter. */ #define TPL_SIZE 8+6*TX_FRAG_NUM /* Depending on fragments per TPL. */ #define RPL_SIZE 14 /* (with TI firmware v2.26 handling * up to nine fragments possible) */ #define TX_BUF_MIN 20 /* ??? (Stephan: calculation with */ #define TX_BUF_MAX 40 /* BUFFER_SIZE and MAX_FRAME_SIZE) ??? */ #define DISABLE_EARLY_TOKEN_RELEASE 0x1000 /* OPEN Options (high-low) */ #define WRAP_INTERFACE 0x0080 /* Inserting omitted for test * purposes; transmit data appears * as receive data. (useful for * testing; change: CLOSE necessary) */ #define DISABLE_HARD_ERROR 0x0040 /* On HARD_ERROR & TRANSMIT_BEACON * no RING.STATUS interrupt. */ #define DISABLE_SOFT_ERROR 0x0020 /* On SOFT_ERROR, no RING.STATUS * interrupt. */ #define PASS_ADAPTER_MAC_FRAMES 0x0010 /* Passing unsupported MAC frames * to system. */ #define PASS_ATTENTION_FRAMES 0x0008 /* All changed attention MAC frames are * passed to the system. */ #define PAD_ROUTING_FIELD 0x0004 /* Routing field is padded to 18 * bytes. */ #define FRAME_HOLD 0x0002 /*Adapter waits for entire frame before * initiating DMA transfer; otherwise: * DMA transfer initiation if internal * buffer filled. */ #define CONTENDER 0x0001 /* Adapter participates in the monitor * contention process. */ #define PASS_BEACON_MAC_FRAMES 0x8000 /* Adapter passes beacon MAC frames * to the system. */ #define EARLY_TOKEN_RELEASE 0x1000 /* Only valid in 16 Mbps operation; * 0 = ETR. (no effect in 4 Mbps * operation) */ #define COPY_ALL_MAC_FRAMES 0x0400 /* All MAC frames are copied to * the system. (after OPEN: duplicate * address test (DAT) MAC frame is * first received frame copied to the * system) */ #define COPY_ALL_NON_MAC_FRAMES 0x0200 /* All non MAC frames are copied to * the system. */ #define PASS_FIRST_BUF_ONLY 0x0100 /* Passes only first internal buffer * of each received frame; FrameSize * of RPLs must contain internal * BUFFER_SIZE bits for promiscous mode. */ #define ENABLE_FULL_DUPLEX_SELECTION 0x2000 /* Enable the use of full-duplex * settings with bits in byte 22 in * ocpl. (new feature in firmware * version 3.09) */ /* Full-duplex settings */ #define OPEN_FULL_DUPLEX_OFF 0x0000 #define OPEN_FULL_DUPLEX_ON 0x00c0 #define OPEN_FULL_DUPLEX_AUTO 0x0080 #define PROD_ID_SIZE 18 /* Length of product ID. */ #define TX_FRAG_NUM 3 /* Number of fragments used in one TPL. */ #define TX_MORE_FRAGMENTS 0x8000 /* Bit set in DataCount to indicate more * fragments following. */ /* XXX is there some better way to do this? */ #define ISA_MAX_ADDRESS 0x00ffffff #define PCI_MAX_ADDRESS 0xffffffff #pragma pack(1) typedef struct { u_int16_t OPENOptions; u_int8_t NodeAddr[6]; /* Adapter node address; use ROM * address */ u_int32_t GroupAddr; /* Multicast: high order * bytes = 0xC000 */ u_int32_t FunctAddr; /* High order bytes = 0xC000 */ __be16 RxListSize; /* RPL size: 0 (=26), 14, 20 or * 26 bytes read by the adapter. * (Depending on the number of * fragments/list) */ __be16 TxListSize; /* TPL size */ __be16 BufSize; /* Is automatically rounded up to the * nearest nK boundary. */ u_int16_t FullDuplex; u_int16_t Reserved; u_int8_t TXBufMin; /* Number of adapter buffers reserved * for transmission a minimum of 2 * buffers must be allocated. */ u_int8_t TXBufMax; /* Maximum number of adapter buffers * for transmit; a minimum of 2 buffers * must be available for receive. * Default: 6 */ u_int16_t ProdIDAddr[2];/* Pointer to product ID. */ } OPB, *OPB_Ptr; #pragma pack() /* * SCB: adapter commands enabled by the host system started by writing * CMD_INTERRUPT_ADAPTER | CMD_EXECUTE (|SCB_REQUEST) to the SIFCMD IO * register. (special case: | CMD_SYSTEM_IRQ for initialization) */ #pragma pack(1) typedef struct { u_int16_t CMD; /* Command code */ u_int16_t Parm[2]; /* Pointer to Command Parameter Block */ } SCB; /* System Command Block (32 bit physical address; big endian)*/ #pragma pack() /* * SSB: adapter command return status can be evaluated after COMMAND_STATUS * adapter to system interrupt after reading SSB, the availability of the SSB * has to be told the adapter by writing CMD_INTERRUPT_ADAPTER | CMD_SSB_CLEAR * in the SIFCMD IO register. */ #pragma pack(1) typedef struct { u_int16_t STS; /* Status code */ u_int16_t Parm[3]; /* Parameter or pointer to Status Parameter * Block. */ } SSB; /* System Status Block (big endian - physical address) */ #pragma pack() typedef struct { unsigned short BurnedInAddrPtr; /* Pointer to adapter burned in * address. (BIA) */ unsigned short SoftwareLevelPtr;/* Pointer to software level data. */ unsigned short AdapterAddrPtr; /* Pointer to adapter addresses. */ unsigned short AdapterParmsPtr; /* Pointer to adapter parameters. */ unsigned short MACBufferPtr; /* Pointer to MAC buffer. (internal) */ unsigned short LLCCountersPtr; /* Pointer to LLC counters. */ unsigned short SpeedFlagPtr; /* Pointer to data rate flag. * (4/16 Mbps) */ unsigned short AdapterRAMPtr; /* Pointer to adapter RAM found. (KB) */ } INTPTRS; /* Adapter internal pointers */ #pragma pack(1) typedef struct { u_int8_t Line_Error; /* Line error: code violation in * frame or in a token, or FCS error. */ u_int8_t Internal_Error; /* IBM specific. (Reserved_1) */ u_int8_t Burst_Error; u_int8_t ARI_FCI_Error; /* ARI/FCI bit zero in AMP or * SMP MAC frame. */ u_int8_t AbortDelimeters; /* IBM specific. (Reserved_2) */ u_int8_t Reserved_3; u_int8_t Lost_Frame_Error; /* Receive of end of transmitted * frame failed. */ u_int8_t Rx_Congest_Error; /* Adapter in repeat mode has not * enough buffer space to copy incoming * frame. */ u_int8_t Frame_Copied_Error; /* ARI bit not zero in frame * addressed to adapter. */ u_int8_t Frequency_Error; /* IBM specific. (Reserved_4) */ u_int8_t Token_Error; /* (active only in monitor station) */ u_int8_t Reserved_5; u_int8_t DMA_Bus_Error; /* DMA bus errors not exceeding the * abort thresholds. */ u_int8_t DMA_Parity_Error; /* DMA parity errors not exceeding * the abort thresholds. */ } ERRORTAB; /* Adapter error counters */ #pragma pack() /*--------------------- Send and Receive definitions -------------------*/ #pragma pack(1) typedef struct { __be16 DataCount; /* Value 0, even and odd values are * permitted; value is unaltered most * significant bit set: following * fragments last fragment: most * significant bit is not evaluated. * (???) */ __be32 DataAddr; /* Pointer to frame data fragment; * even or odd. */ } Fragment; #pragma pack() #define MAX_FRAG_NUMBERS 9 /* Maximal number of fragments possible to use * in one RPL/TPL. (depending on TI firmware * version) */ /* * AC (1), FC (1), Dst (6), Src (6), RIF (18), Data (4472) = 4504 * The packet size can be one of the follows: 548, 1502, 2084, 4504, 8176, * 11439, 17832. Refer to TMS380 Second Generation Token Ring User's Guide * Page 2-27. */ #define HEADER_SIZE (1 + 1 + 6 + 6) #define SRC_SIZE 18 #define MIN_DATA_SIZE 516 #define DEFAULT_DATA_SIZE 4472 #define MAX_DATA_SIZE 17800 #define DEFAULT_PACKET_SIZE (HEADER_SIZE + SRC_SIZE + DEFAULT_DATA_SIZE) #define MIN_PACKET_SIZE (HEADER_SIZE + SRC_SIZE + MIN_DATA_SIZE) #define MAX_PACKET_SIZE (HEADER_SIZE + SRC_SIZE + MAX_DATA_SIZE) /* * Macros to deal with the frame status field. */ #define AC_NOT_RECOGNIZED 0x00 #define GROUP_BIT 0x80 #define GET_TRANSMIT_STATUS_HIGH_BYTE(Ts) ((unsigned char)((Ts) >> 8)) #define GET_FRAME_STATUS_HIGH_AC(Fs) ((unsigned char)(((Fs) & 0xC0) >> 6)) #define GET_FRAME_STATUS_LOW_AC(Fs) ((unsigned char)(((Fs) & 0x0C) >> 2)) #define DIRECTED_FRAME(Context) (!((Context)->MData[2] & GROUP_BIT)) /*--------------------- Send Functions ---------------------------------*/ /* define TX_CSTAT _REQUEST (R) and _COMPLETE (C) values (high-low) */ #define TX_VALID 0x0080 /* R: set via TRANSMIT.VALID interrupt. * C: always reset to zero! */ #define TX_FRAME_COMPLETE 0x0040 /* R: must be reset to zero. * C: set to one. */ #define TX_START_FRAME 0x0020 /* R: start of a frame: 1 * C: unchanged. */ #define TX_END_FRAME 0x0010 /* R: end of a frame: 1 * C: unchanged. */ #define TX_FRAME_IRQ 0x0008 /* R: request interrupt generation * after transmission. * C: unchanged. */ #define TX_ERROR 0x0004 /* R: reserved. * C: set to one if Error occurred. */ #define TX_INTERFRAME_WAIT 0x0004 #define TX_PASS_CRC 0x0002 /* R: set if CRC value is already * calculated. (valid only in * FRAME_START TPL) * C: unchanged. */ #define TX_PASS_SRC_ADDR 0x0001 /* R: adapter uses explicit frame * source address and does not overwrite * with the adapter node address. * (valid only in FRAME_START TPL) * * C: unchanged. */ #define TX_STRIP_FS 0xFF00 /* R: reserved. * C: if no Transmission Error, * field contains copy of FS byte after * stripping of frame. */ /* * Structure of Transmit Parameter Lists (TPLs) (only one frame every TPL, * but possibly multiple TPLs for one frame) the length of the TPLs has to be * initialized in the OPL. (OPEN parameter list) */ #define TPL_NUM 3 /* Number of Transmit Parameter Lists. * !! MUST BE >= 3 !! */ #pragma pack(1) typedef struct s_TPL TPL; struct s_TPL { /* Transmit Parameter List (align on even word boundaries) */ __be32 NextTPLAddr; /* Pointer to next TPL in chain; if * pointer is odd: this is the last * TPL. Pointing to itself can cause * problems! */ volatile u_int16_t Status; /* Initialized by the adapter: * CSTAT_REQUEST important: update least * significant bit first! Set by the * adapter: CSTAT_COMPLETE status. */ __be16 FrameSize; /* Number of bytes to be transmitted * as a frame including AC/FC, * Destination, Source, Routing field * not including CRC, FS, End Delimiter * (valid only if START_FRAME bit in * CSTAT nonzero) must not be zero in * any list; maximum value: (BUFFER_SIZE * - 8) * TX_BUF_MAX sum of DataCount * values in FragmentList must equal * Frame_Size value in START_FRAME TPL! * frame data fragment list. */ /* TPL/RPL size in OPEN parameter list depending on maximal * numbers of fragments used in one parameter list. */ Fragment FragList[TX_FRAG_NUM]; /* Maximum: nine frame fragments in one * TPL actual version of firmware: 9 * fragments possible. */ #pragma pack() /* Special proprietary data and precalculations */ TPL *NextTPLPtr; /* Pointer to next TPL in chain. */ unsigned char *MData; struct sk_buff *Skb; unsigned char TPLIndex; volatile unsigned char BusyFlag;/* Flag: TPL busy? */ dma_addr_t DMABuff; /* DMA IO bus address from dma_map */ }; /* ---------------------Receive Functions-------------------------------* * define RECEIVE_CSTAT_REQUEST (R) and RECEIVE_CSTAT_COMPLETE (C) values. * (high-low) */ #define RX_VALID 0x0080 /* R: set; tell adapter with * RECEIVE.VALID interrupt. * C: reset to zero. */ #define RX_FRAME_COMPLETE 0x0040 /* R: must be reset to zero, * C: set to one. */ #define RX_START_FRAME 0x0020 /* R: must be reset to zero. * C: set to one on the list. */ #define RX_END_FRAME 0x0010 /* R: must be reset to zero. * C: set to one on the list * that ends the frame. */ #define RX_FRAME_IRQ 0x0008 /* R: request interrupt generation * after receive. * C: unchanged. */ #define RX_INTERFRAME_WAIT 0x0004 /* R: after receiving a frame: * interrupt and wait for a * RECEIVE.CONTINUE. * C: unchanged. */ #define RX_PASS_CRC 0x0002 /* R: if set, the adapter includes * the CRC in data passed. (last four * bytes; valid only if FRAME_START is * set) * C: set, if CRC is included in * received data. */ #define RX_PASS_SRC_ADDR 0x0001 /* R: adapter uses explicit frame * source address and does not * overwrite with the adapter node * address. (valid only if FRAME_START * is set) * C: unchanged. */ #define RX_RECEIVE_FS 0xFC00 /* R: reserved; must be reset to zero. * C: on lists with START_FRAME, field * contains frame status field from * received frame; otherwise cleared. */ #define RX_ADDR_MATCH 0x0300 /* R: reserved; must be reset to zero. * C: address match code mask. */ #define RX_STATUS_MASK 0x00FF /* Mask for receive status bits. */ #define RX_INTERN_ADDR_MATCH 0x0100 /* C: internally address match. */ #define RX_EXTERN_ADDR_MATCH 0x0200 /* C: externally matched via * XMATCH/XFAIL interface. */ #define RX_INTEXT_ADDR_MATCH 0x0300 /* C: internally and externally * matched. */ #define RX_READY (RX_VALID | RX_FRAME_IRQ) /* Ready for receive. */ /* Constants for Command Status Interrupt. * COMMAND_REJECT status field bit functions (SSB.Parm[0]) */ #define ILLEGAL_COMMAND 0x0080 /* Set if an unknown command * is issued to the adapter */ #define ADDRESS_ERROR 0x0040 /* Set if any address field in * the SCB is odd. (not word aligned) */ #define ADAPTER_OPEN 0x0020 /* Command issued illegal with * open adapter. */ #define ADAPTER_CLOSE 0x0010 /* Command issued illegal with * closed adapter. */ #define SAME_COMMAND 0x0008 /* Command issued with same command * already executing. */ /* OPEN_COMPLETION values (SSB.Parm[0], MSB) */ #define NODE_ADDR_ERROR 0x0040 /* Wrong address or BIA read * zero address. */ #define LIST_SIZE_ERROR 0x0020 /* If List_Size value not in 0, * 14, 20, 26. */ #define BUF_SIZE_ERROR 0x0010 /* Not enough available memory for * two buffers. */ #define TX_BUF_COUNT_ERROR 0x0004 /* Remaining receive buffers less than * two. */ #define OPEN_ERROR 0x0002 /* Error during ring insertion; more * information in bits 8-15. */ /* Standard return codes */ #define GOOD_COMPLETION 0x0080 /* =OPEN_SUCCESSFULL */ #define INVALID_OPEN_OPTION 0x0001 /* OPEN options are not supported by * the adapter. */ /* OPEN phases; details of OPEN_ERROR (SSB.Parm[0], LSB) */ #define OPEN_PHASES_MASK 0xF000 /* Check only the bits 8-11. */ #define LOBE_MEDIA_TEST 0x1000 #define PHYSICAL_INSERTION 0x2000 #define ADDRESS_VERIFICATION 0x3000 #define PARTICIPATION_IN_RING_POLL 0x4000 #define REQUEST_INITIALISATION 0x5000 #define FULLDUPLEX_CHECK 0x6000 /* OPEN error codes; details of OPEN_ERROR (SSB.Parm[0], LSB) */ #define OPEN_ERROR_CODES_MASK 0x0F00 /* Check only the bits 12-15. */ #define OPEN_FUNCTION_FAILURE 0x0100 /* Unable to transmit to itself or * frames received before insertion. */ #define OPEN_SIGNAL_LOSS 0x0200 /* Signal loss condition detected at * receiver. */ #define OPEN_TIMEOUT 0x0500 /* Insertion timer expired before * logical insertion. */ #define OPEN_RING_FAILURE 0x0600 /* Unable to receive own ring purge * MAC frames. */ #define OPEN_RING_BEACONING 0x0700 /* Beacon MAC frame received after * ring insertion. */ #define OPEN_DUPLICATE_NODEADDR 0x0800 /* Other station in ring found * with the same address. */ #define OPEN_REQUEST_INIT 0x0900 /* RPS present but does not respond. */ #define OPEN_REMOVE_RECEIVED 0x0A00 /* Adapter received a remove adapter * MAC frame. */ #define OPEN_FULLDUPLEX_SET 0x0D00 /* Got this with full duplex on when * trying to connect to a normal ring. */ /* SET_BRIDGE_PARMS return codes: */ #define BRIDGE_INVALID_MAX_LEN 0x4000 /* MAX_ROUTING_FIELD_LENGTH odd, * less than 6 or > 30. */ #define BRIDGE_INVALID_SRC_RING 0x2000 /* SOURCE_RING number zero, too large * or = TARGET_RING. */ #define BRIDGE_INVALID_TRG_RING 0x1000 /* TARGET_RING number zero, too large * or = SOURCE_RING. */ #define BRIDGE_INVALID_BRDGE_NO 0x0800 /* BRIDGE_NUMBER too large. */ #define BRIDGE_INVALID_OPTIONS 0x0400 /* Invalid bridge options. */ #define BRIDGE_DIAGS_FAILED 0x0200 /* Diagnostics of TMS380SRA failed. */ #define BRIDGE_NO_SRA 0x0100 /* The TMS380SRA does not exist in HW * configuration. */ /* * Bring Up Diagnostics error codes. */ #define BUD_INITIAL_ERROR 0x0 #define BUD_CHECKSUM_ERROR 0x1 #define BUD_ADAPTER_RAM_ERROR 0x2 #define BUD_INSTRUCTION_ERROR 0x3 #define BUD_CONTEXT_ERROR 0x4 #define BUD_PROTOCOL_ERROR 0x5 #define BUD_INTERFACE_ERROR 0x6 /* BUD constants */ #define BUD_MAX_RETRIES 3 #define BUD_MAX_LOOPCNT 6 #define BUD_TIMEOUT 3000 /* Initialization constants */ #define INIT_MAX_RETRIES 3 /* Maximum three retries. */ #define INIT_MAX_LOOPCNT 22 /* Maximum loop counts. */ /* RING STATUS field values (high/low) */ #define SIGNAL_LOSS 0x0080 /* Loss of signal on the ring * detected. */ #define HARD_ERROR 0x0040 /* Transmitting or receiving beacon * frames. */ #define SOFT_ERROR 0x0020 /* Report error MAC frame * transmitted. */ #define TRANSMIT_BEACON 0x0010 /* Transmitting beacon frames on the * ring. */ #define LOBE_WIRE_FAULT 0x0008 /* Open or short circuit in the * cable to concentrator; adapter * closed. */ #define AUTO_REMOVAL_ERROR 0x0004 /* Lobe wrap test failed, deinserted; * adapter closed. */ #define REMOVE_RECEIVED 0x0001 /* Received a remove ring station MAC * MAC frame request; adapter closed. */ #define COUNTER_OVERFLOW 0x8000 /* Overflow of one of the adapters * error counters; READ.ERROR.LOG. */ #define SINGLE_STATION 0x4000 /* Adapter is the only station on the * ring. */ #define RING_RECOVERY 0x2000 /* Claim token MAC frames on the ring; * reset after ring purge frame. */ #define ADAPTER_CLOSED (LOBE_WIRE_FAULT | AUTO_REMOVAL_ERROR |\ REMOVE_RECEIVED) /* Adapter_check_block.Status field bit assignments: */ #define DIO_PARITY 0x8000 /* Adapter detects bad parity * through direct I/O access. */ #define DMA_READ_ABORT 0x4000 /* Aborting DMA read operation * from system Parm[0]: 0=timeout, * 1=parity error, 2=bus error; * Parm[1]: 32 bit pointer to host * system address at failure. */ #define DMA_WRITE_ABORT 0x2000 /* Aborting DMA write operation * to system. (parameters analogous to * DMA_READ_ABORT) */ #define ILLEGAL_OP_CODE 0x1000 /* Illegal operation code in the * the adapters firmware Parm[0]-2: * communications processor registers * R13-R15. */ #define PARITY_ERRORS 0x0800 /* Adapter detects internal bus * parity error. */ #define RAM_DATA_ERROR 0x0080 /* Valid only during RAM testing; * RAM data error Parm[0-1]: 32 bit * pointer to RAM location. */ #define RAM_PARITY_ERROR 0x0040 /* Valid only during RAM testing; * RAM parity error Parm[0-1]: 32 bit * pointer to RAM location. */ #define RING_UNDERRUN 0x0020 /* Internal DMA underrun when * transmitting onto ring. */ #define INVALID_IRQ 0x0008 /* Unrecognized interrupt generated * internal to adapter Parm[0-2]: * adapter register R13-R15. */ #define INVALID_ERROR_IRQ 0x0004 /* Unrecognized error interrupt * generated Parm[0-2]: adapter register * R13-R15. */ #define INVALID_XOP 0x0002 /* Unrecognized XOP request in * communication processor Parm[0-2]: * adapter register R13-R15. */ #define CHECKADDR 0x05E0 /* Adapter check status information * address offset. */ #define ROM_PAGE_0 0x0000 /* Adapter ROM page 0. */ /* * RECEIVE.STATUS interrupt result SSB values: (high-low) * (RECEIVE_COMPLETE field bit definitions in SSB.Parm[0]) */ #define RX_COMPLETE 0x0080 /* SSB.Parm[0]; SSB.Parm[1]: 32 * bit pointer to last RPL. */ #define RX_SUSPENDED 0x0040 /* SSB.Parm[0]; SSB.Parm[1]: 32 * bit pointer to RPL with odd * forward pointer. */ /* Valid receive CSTAT: */ #define RX_FRAME_CONTROL_BITS (RX_VALID | RX_START_FRAME | RX_END_FRAME | \ RX_FRAME_COMPLETE) #define VALID_SINGLE_BUFFER_FRAME (RX_START_FRAME | RX_END_FRAME | \ RX_FRAME_COMPLETE) typedef enum SKB_STAT SKB_STAT; enum SKB_STAT { SKB_UNAVAILABLE, SKB_DMA_DIRECT, SKB_DATA_COPY }; /* Receive Parameter List (RPL) The length of the RPLs has to be initialized * in the OPL. (OPEN parameter list) */ #define RPL_NUM 3 #define RX_FRAG_NUM 1 /* Maximal number of used fragments in one RPL. * (up to firmware v2.24: 3, now: up to 9) */ #pragma pack(1) typedef struct s_RPL RPL; struct s_RPL { /* Receive Parameter List */ __be32 NextRPLAddr; /* Pointer to next RPL in chain * (normalized = physical 32 bit * address) if pointer is odd: this * is last RPL. Pointing to itself can * cause problems! */ volatile u_int16_t Status; /* Set by creation of Receive Parameter * List RECEIVE_CSTAT_COMPLETE set by * adapter in lists that start or end * a frame. */ volatile __be16 FrameSize; /* Number of bytes received as a * frame including AC/FC, Destination, * Source, Routing field not including * CRC, FS (Frame Status), End Delimiter * (valid only if START_FRAME bit in * CSTAT nonzero) must not be zero in * any list; maximum value: (BUFFER_SIZE * - 8) * TX_BUF_MAX sum of DataCount * values in FragmentList must equal * Frame_Size value in START_FRAME TPL! * frame data fragment list */ /* TPL/RPL size in OPEN parameter list depending on maximal numbers * of fragments used in one parameter list. */ Fragment FragList[RX_FRAG_NUM]; /* Maximum: nine frame fragments in * one TPL. Actual version of firmware: * 9 fragments possible. */ #pragma pack() /* Special proprietary data and precalculations. */ RPL *NextRPLPtr; /* Logical pointer to next RPL in chain. */ unsigned char *MData; struct sk_buff *Skb; SKB_STAT SkbStat; int RPLIndex; dma_addr_t DMABuff; /* DMA IO bus address from dma_map */ }; /* Information that need to be kept for each board. */ typedef struct net_local { #pragma pack(1) IPB ipb; /* Initialization Parameter Block. */ SCB scb; /* System Command Block: system to adapter * communication. */ SSB ssb; /* System Status Block: adapter to system * communication. */ OPB ocpl; /* Open Options Parameter Block. */ ERRORTAB errorlogtable; /* Adapter statistic error counters. * (read from adapter memory) */ unsigned char ProductID[PROD_ID_SIZE + 1]; /* Product ID */ #pragma pack() TPL Tpl[TPL_NUM]; TPL *TplFree; TPL *TplBusy; unsigned char LocalTxBuffers[TPL_NUM][DEFAULT_PACKET_SIZE]; RPL Rpl[RPL_NUM]; RPL *RplHead; RPL *RplTail; unsigned char LocalRxBuffers[RPL_NUM][DEFAULT_PACKET_SIZE]; struct device *pdev; int DataRate; unsigned char ScbInUse; unsigned short CMDqueue; unsigned long AdapterOpenFlag:1; unsigned long AdapterVirtOpenFlag:1; unsigned long OpenCommandIssued:1; unsigned long TransmitCommandActive:1; unsigned long TransmitHaltScheduled:1; unsigned long HaltInProgress:1; unsigned long LobeWireFaultLogged:1; unsigned long ReOpenInProgress:1; unsigned long Sleeping:1; unsigned long LastOpenStatus; unsigned short CurrentRingStatus; unsigned long MaxPacketSize; unsigned long StartTime; unsigned long LastSendTime; struct tr_statistics MacStat; /* MAC statistics structure */ unsigned long dmalimit; /* the max DMA address (ie, ISA) */ dma_addr_t dmabuffer; /* the DMA bus address corresponding to priv. Might be different from virt_to_bus() for architectures with IO MMU (Alpha) */ struct timer_list timer; wait_queue_head_t wait_for_tok_int; INTPTRS intptrs; /* Internal adapter pointer. Must be read * before OPEN command. */ unsigned short (*setnselout)(struct net_device *); unsigned short (*sifreadb)(struct net_device *, unsigned short); void (*sifwriteb)(struct net_device *, unsigned short, unsigned short); unsigned short (*sifreadw)(struct net_device *, unsigned short); void (*sifwritew)(struct net_device *, unsigned short, unsigned short); spinlock_t lock; /* SMP protection */ void *tmspriv; } NET_LOCAL; #endif /* __KERNEL__ */ #endif /* __LINUX_TMS380TR_H */