Linux 2.4.0-test7pre1
[davej-history.git] / drivers / scsi / README.ibmmca
blob313690c26bee5095c2597bf3db1f9c1634770f8f
3                -=< The IBM Microchannel SCSI-Subsystem >=-
4                
5                          for the IBM PS/2 series
6                  
7                    Low Level Software-Driver for Linux
8                  
9      Copyright (c) 1995 Strom Systems, Inc. under the terms of the GNU 
10   General Public License. Originally written by Martin Kolinek, December 1995.
11          Officially maintained by Michael Lang since January 1999.
12            
13                                Version 3.2
14         
15         
16    Last update: 29 July 2000
19    Authors of this Driver
20    ----------------------
21     - Chris Beauregard (improvement of the SCSI-device mapping by the driver)
22     - Martin Kolinek (origin, first release of this driver)
23     - Klaus Kudielka (multiple SCSI-host management/detection, adaption to
24                       Linux Kernel 2.1.x, module support)
25     - Michael Lang (assigning original pun,lun mapping, dynamical ldn 
26                     assignment, this file, patch, official driver maintenance
27                     and subsequent pains related with the driver :-))
29    Table of Contents
30    -----------------
31    1 Abstract
32    2 Driver Description
33      2.1  IBM SCSI-Subsystem Detection
34      2.2  Physical Units, Logical Units, and Logical Devices
35      2.3  SCSI-Device Recognition and dynamical ldn Assignment
36      2.4  SCSI-Device Order
37      2.5  Regular SCSI-Command-Processing
38      2.6  Abort & Reset Commands
39      2.7  Disk Geometry
40      2.8  Kernel Boot Option
41      2.9  Driver Module Support
42      2.10 Multiple Hostadapter Support
43      2.11 /proc/scsi-Filesystem Information
44      2.12 /proc/mca-Filesystem Information
45      2.13 Supported IBM SCSI-Subsystems
46      2.14 Linux Kernel Versions
47    3 Code History
48    4 To do
49    5 Users' Manual
50      5.1 Commandline Parameters
51      5.2 Troubleshooting
52      5.3 Bugreports
53      5.4 Support WWW-page
54    6 References
55    7 Credits to
56      7.1 People
57      7.2 Sponsors & Supporters
58    8 Trademarks
59    9 Disclaimer
61                               * * *
63    1 Abstract
64    ----------
65    This README-file describes the IBM SCSI-subsystem low level driver for 
66    Linux. The descriptions which were formerly kept in the source-code have 
67    been taken out to this file to easify the codes' readability. The driver 
68    description has been updated, as most of the former description was already
69    quite outdated. The history of the driver development is also kept inside 
70    here. Multiple historical developments have been summarized to shorten the 
71    textsize a bit. At the end of this file you can find a small manual for 
72    this driver and hints to get it running on your machine.
74    2 Driver Description
75    --------------------
76    2.1 IBM SCSI-Subsystem Detection
77    --------------------------------
78    This is done in the ibmmca_detect() function. It first checks, if the
79    Microchannel-bus support is enabled, as the IBM SCSI-subsystem needs the
80    Microchannel. In a next step, a free interrupt is chosen and the main
81    interrupt handler is connected to it to handle answers of the SCSI-
82    subsystem(s). If the F/W SCSI-adapter is forced by the BIOS to use IRQ11
83    instead of IRQ14, IRQ11 is used for the IBM SCSI-2 F/W adapter. In a 
84    further step it is checked, if the adapter gets detected by force from
85    the kernel commandline, where the I/O port and the SCSI-subsystem id can 
86    be specified. The next step checks if there is an integrated SCSI-subsystem
87    installed. This register area is fixed through all IBM PS/2 MCA-machines 
88    and appears as something like a virtual slot 10 of the MCA-bus. On most
89    PS/2 machines, the POS registers of slot 10 are set to 0xff or 0x00 if not
90    integrated SCSI-controller is available. But on certain PS/2s, like model 
91    9595, this slot 10 is used to store other information which at earlier
92    stage confused the driver and resulted in the detection of some ghost-SCSI. 
93    If POS-register 2 and 3 are not 0x00 and not 0xff, but all other POS
94    registers are either 0xff or 0x00, there must be an integrated SCSI-
95    subsystem present and it will be registered as IBM Integrated SCSI-
96    Subsystem. The next step checks, if there is a slot-adapter installed on 
97    the MCA-bus. To get this, the first two POS-registers, that represent the 
98    adapter ID are checked. If they fit to one of the ids, stored in the 
99    adapter list, a SCSI-subsystem is assumed to be found in a slot and will be 
100    registered. This check is done through all possible MCA-bus slots to allow 
101    more than one SCSI-adapter to be present in the PS/2-system and this is 
102    already the first point of problems. Looking into the technical reference 
103    manual for the IBM PS/2 common interfaces, the POS2 register must have 
104    different interpretation of its single bits to avoid overlapping I/O
105    regions. While one can assume, that the integrated subsystem has a fix 
106    I/O-address at 0x3540 - 0x3547, further installed IBM SCSI-adapters must 
107    use a different I/O-address. This is expressed by bit 1 to 3 of POS2 
108    (multiplied by 8 + 0x3540). Bits 2 and 3 are reserved for the integrated 
109    subsystem, but not for the adapters! The following list shows, how the 
110    bits of POS2 and POS3 should be interpreted.
111    
112    The POS2-register of all PS/2 models' integrated SCSI-subsystems has the 
113    following interpretation of bits:
114                            Bit 7 - 4 : Chip Revision ID (Release)
115                            Bit 3 - 2 : Reserved
116                            Bit 1     : 8k NVRAM Disabled
117                            Bit 0     : Chip Enable (EN-Signal)
118    The POS3-register is interpreted as follows (for most IBM SCSI-subsys.):
119                            Bit 7 - 5 : SCSI ID
120                            Bit 4 - 0 : Reserved = 0
121    The slot-adapters have different interpretation of these bits. The IBM SCSI
122    adapter (w/Cache) and the IBM SCSI-2 F/W adapter use the following
123    interpretation of the POS2 register:
124                            Bit 7 - 4 : ROM Segment Address Select
125                            Bit 3 - 1 : Adapter I/O Address Select (*8+0x3540)
126                            Bit 0     : Adapter Enable (EN-Signal)
127    and for the POS3 register:
128                            Bit 7 - 5 : SCSI ID 
129                            Bit 4     : Fairness Enable (SCSI ID3 f. F/W)
130                            Bit 3 - 0 : Arbitration Level
131    The most modern product of the series is the IBM SCSI-2 F/W adapter, it 
132    allows dual-bus SCSI and SCSI-wide addressing, which means, PUNs may be
133    between 0 and 15. Here, Bit 4 is the high-order bit of the 4-bit wide
134    adapter PUN expression. In short words, this means, that IBM PS/2 machines 
135    can only support 1 single integrated subsystem by default. Additional
136    slot-adapters get ports assigned by the automatic configuration tool.
138    One day I found a patch in ibmmca_detect(), forcing the I/O-address to be 
139    0x3540 for integrated SCSI-subsystems, there was a remark placed, that on 
140    integrated IBM SCSI-subsystems of model 56, the POS2 register was showing 5.
141    This means, that really for these models, POS2 has to be interpreted
142    sticking to the technical reference guide. In this case, the bit 2 (4) is 
143    a reserved bit and may not be interpreted. These differences between the 
144    adapters and the integrated controllers are taken into account by the 
145    detection routine of the driver on from version >3.0g. 
147    Every time, a SCSI-subsystem is discovered, the ibmmca_register() function
148    is called. This function checks first, if the requested area for the I/O-
149    address of this SCSI-subsystem is still available and assigns this I/O-
150    area to the SCSI-subsystem. There are always 8 sequential I/O-addresses
151    taken for each individual SCSI-subsystem found, which are:
152    
153      Offset            Type                  Permissions
154        0     Command Interface Register 1    Read/Write
155        1     Command Interface Register 2    Read/Write
156        2     Command Interface Register 3    Read/Write
157        3     Command Interface Register 4    Read/Write
158        4     Attention Register              Read/Write
159        5     Basic Control Register          Read/Write
160        6     Interrupt Status Register       Read
161        7     Basic Status Register           Read
162    
163    After the I/O-address range is assigned, the host-adapter is assigned
164    to a local structure which keeps all adapter information needed for the
165    driver itself and the mid- and higher-level SCSI-drivers. The SCSI pun/lun
166    and the adapters' ldn tables are initialized and get probed afterwards by
167    the check_devices() function. If no further adapters are found, 
168    ibmmca_detect() quits.
169    
170    2.2 Physical Units, Logical Units, and Logical Devices
171    ------------------------------------------------------
172    There can be up to 56 devices on the SCSI bus (besides the adapter):
173    there are up to 7 "physical units" (each identified by physical unit 
174    number or pun, also called the scsi id, this is the number you select
175    with hardware jumpers), and each physical unit can have up to 8 
176    "logical units" (each identified by logical unit number, or lun, 
177    between 0 and 7). The IBM SCSI-2 F/W adapter offers this on up to two
178    busses and provides support for 30 logical devices at the same time, where
179    in wide-addressing mode you can have 16 puns with 32 luns on each device.
180    This section dexribes you the handling of devices on non-F/W adapters.
181    Just imagine, that you can have 16 * 32 = 512 devices on a F/W adapter
182    which means a lot of possible devices for such a small machine.
184    Typically the adapter has pun=7, so puns of other physical units
185    are between 0 and 6(15). On a wide-adapter a pun higher than 7 is
186    possible, but is normally not used. Almost all physical units have only 
187    one logical unit, with lun=0. A CD-ROM jukebox would be an example of a 
188    physical unit with more than one logical unit.
190    The embedded microprocessor of the IBM SCSI-subsystem hides the complex
191    two-dimensional (pun,lun) organization from the operating system.
192    When the machine is powered-up (or rebooted), the embedded microprocessor 
193    checks, on its own, all 56 possible (pun,lun) combinations, and the first 
194    15 devices found are assigned into a one-dimensional array of so-called 
195    "logical devices", identified by "logical device numbers" or ldn. The last 
196    ldn=15 is reserved for the subsystem itself. Wide adapters may have 
197    to check up to 15 * 8 = 120 pun/lun combinations.
198    
199    2.3 SCSI-Device Recognition and dynamical ldn Assignment
200    --------------------------------------------------------
201    One consequence of information hiding is that the real (pun,lun)    
202    numbers are also hidden. The two possibilities to get around this problem
203    is to offer fake pun/lun combinations to the operating system or to 
204    delete the whole mapping of the adapter and to reassign the ldns, using
205    the immediate assign command of the SCSI-subsystem for probing through
206    all possible pun/lun combinations. a ldn is a "logical device number"
207    which is used by IBM SCSI-subsystems to access some valid SCSI-device.
208    At the beginning of the development of this driver, the following approach 
209    was used:
210    
211    First, the driver checked the ldn's (0 to 6) to find out which ldn's
212    have devices assigned. This was done by the functions check_devices() and
213    device_exists(). The interrupt handler has a special paragraph of code
214    (see local_checking_phase_flag) to assist in the checking. Assume, for
215    example, that three logical devices were found assigned at ldn 0, 1, 2.
216    These are presented to the upper layer of Linux SCSI driver
217    as devices with bogus (pun, lun) equal to (0,0), (1,0), (2,0). 
218    On the other hand, if the upper layer issues a command to device
219    say (4,0), this driver returns DID_NO_CONNECT error.
221    In a second step of the driver development, the following improvement has
222    been applied: The first approach limited the number of devices to 7, far
223    fewer than the 15 that it could usem then it just maped ldn -> 
224    (ldn/8,ldn%8) for pun,lun.  We ended up with a real mishmash of puns
225    and luns, but it all seemed to work.
227    The latest development, which is implemented from the driver version 3.0
228    and later, realizes the device recognition in the following way:
229    The physical SCSI-devices on the SCSI-bus are probed via immediate_assign- 
230    and device_inquiry-commands, that is all implemented in a completely new
231    made check_devices() subroutine. This delivers an exact map of the physical
232    SCSI-world that is now stored in the get_scsi[][]-array. This means,
233    that the once hidden pun,lun assignment is now known to this driver.
234    It no longer believes in default-settings of the subsystem and maps all
235    ldns to existing pun,lun "by foot". This assures full control of the ldn
236    mapping and allows dynamical remapping of ldns to different pun,lun, if
237    there are more SCSI-devices installed than ldns available (n>15). The
238    ldns from 0 to 6 get 'hardwired' by this driver to puns 0 to 7 at lun=0,
239    excluding the pun of the subsystem. This assures, that at least simple 
240    SCSI-installations have optimum access-speed and are not touched by
241    dynamical remapping. The ldns 7 to 14 are put to existing devices with 
242    lun>0 or to non-existing devices, in order to satisfy the subsystem, if 
243    there are less than 15 SCSI-devices connected. In the case of more than 15 
244    devices, the dynamical mapping goes active. If the get_scsi[][] reports a 
245    device to be existant, but it has no ldn assigned, it gets a ldn out of 7 
246    to 14. The numbers are assigned in cyclic order. Therefore it takes 8 
247    dynamical reassignments on the SCSI-devices, until a certain device 
248    looses its ldn again. This assures, that dynamical remapping is avoided 
249    during intense I/O between up to 15 SCSI-devices (means pun,lun 
250    combinations). A further advantage of this method is, that people who
251    build their kernel without probing on all luns will get what they expect,
252    because the driver just won't assign everything with lun>0 when 
253    multpile lun probing is inactive.
255    2.4 SCSI-Device Order
256    ---------------------
257    Because of the now correct recognition of physical pun,lun, and 
258    their report to mid-level- and higher-level-drivers, the new reported puns
259    can be different from the old, faked puns. Therefore, Linux will eventually
260    change /dev/sdXXX assignments and prompt you for corrupted superblock
261    repair on boottime. In this case DO NOT PANIC, YOUR DISKS ARE STILL OK!!!
262    You have to reboot (CTRL-D) with an old kernel and set the /etc/fstab-file
263    entries right. After that, the system should come up as errorfree as before.
264    If your boot-partition is not coming up, also edit the /etc/lilo.conf-file
265    in a Linux session booted on old kernel and run lilo before reboot. Check
266    lilo.conf anyway to get boot on other partitions with foreign OSes right
267    again. But there exists a feature of this driver that allows you to change
268    the assignment order of the SCSI-devices by flipping the PUN-assignment.
269    See the next paragraph for a description.
271    The problem for this is, that Linux does not assign the SCSI-devices in the
272    way as described in the ANSI-SCSI-standard. Linux assigns /dev/sda to 
273    the device with at minimum id 0. But the first drive should be at id 6,
274    because for historical reasons, drive at id 6 has, by hardware, the highest
275    priority and a drive at id 0 the lowest. IBM was one of the rare producers,
276    where the BIOS assigns drives belonging to the ANSI-SCSI-standard. Most 
277    other producers' BIOS does not (I think even Adaptec-BIOS). The 
278    IBMMCA_SCSI_ORDER_STANDARD flag, which you set while configuring the
279    kernel enables to choose the preferred way of SCSI-device-assignment. 
280    Defining this flag would result in Linux determining the devices in the 
281    same order as DOS and OS/2 does on your MCA-machine. This is also standard 
282    on most industrial computers and OSes, like e.g. OS-9. Leaving this flag 
283    undefined will get your devices ordered in the default way of Linux. See 
284    also the remarks of Chris Beauregard from Dec 15, 1997 and the followups 
285    in section 3.
286    
287    2.5 Regular SCSI-Command-Processing
288    -----------------------------------
289    Only three functions get involved: ibmmca_queuecommand(), issue_cmd(),
290    and interrupt_handler().
292    The upper layer issues a scsi command by calling function 
293    ibmmca_queuecommand(). This function fills a "subsystem control block"
294    (scb) and calls a local function issue_cmd(), which writes a scb 
295    command into subsystem I/O ports. Once the scb command is carried out, 
296    the interrupt_handler() is invoked. If a device is determined to be 
297    existant and it has not assigned any ldn, it gets one dynamically.
298    For this, the whole stuff is done in ibmmca_queuecommand().
300    2.6 Abort & Reset Commands
301    --------------------------
302    These are implemented with busy waiting for interrupt to arrive.
303    ibmmca_reset() and ibmmca_abort() do not work sufficently well
304    up to now and need still a lot of development work. But, this seems
305    to be even a problem with other SCSI-low level drivers, too. However,
306    this should be no excuse.
308    2.7 Disk Geometry
309    -----------------
310    The ibmmca_biosparams() function should return the same disk geometry 
311    as the bios. This is needed for fdisk, etc. The returned geometry is 
312    certainly correct for disks smaller than 1 gigabyte. In the meantime,
313    it has been proved, that this works fine even with disks larger than
314    1 gigabyte.
316    2.8 Kernel Boot Option
317    ----------------------
318    The function ibmmca_scsi_setup() is called if option ibmmcascsi=n 
319    is passed to the kernel. See file linux/init/main.c for details.
320    
321    2.9 Driver Module Support
322    -------------------------
323    Is implemented and tested by K. Kudielka. This could probably not work
324    on kernels <2.1.0.
325   
326    2.10 Multiple Hostadapter Support
327    ---------------------------------
328    This driver supports up to eight interfaces of type IBM-SCSI-Subsystem. 
329    Integrated-, and MCA-adapters are automatically recognized. Unrecognizable
330    IBM-SCSI-Subsystem interfaces can be specified as kernel-parameters.
332    2.11 /proc/scsi-Filesystem Information
333    --------------------------------------
334    Information about the driver condition is given in 
335    /proc/scsi/ibmmca/<host_no>. ibmmca_proc_info() provides this information.
336    
337    This table is quite informative for interested users. It shows the load
338    of commands on the subsystem and wether you are running the bypassed 
339    (software) or integrated (hardware) SCSI-command set (see below). The
340    amount of accesses is shown. Read, write, modeselect is shown seperately
341    in order to help debugging problems with CD-ROMs or tapedrives.
342    
343    The following table shows the list of 15 logical device numbers, that are
344    used by the SCSI-subsystem. The load on each ldn is shown in the table,
345    again, read and write commands are split. The last column shows the amount
346    of reassignments, that have been applied to the ldns, if you have more than
347    15 pun/lun combinations available on the SCSI-bus.
348    
349    The last two tables show the pun/lun map and the positions of the ldns
350    on this pun/lun map. This may change during operation, when a ldn is
351    reassigned to another pun/lun combination. If the necessity for dynamical
352    assignments is set to 'no', the ldn structure keeps static.
353    
354    2.12 /proc/mca-Filesystem Information
355    -------------------------------------
356    The slot-file contains all default entries and in addition chip and I/O-
357    address information of the SCSI-subsystem. This information is provided
358    by ibmmca_getinfo().
359    
360    2.13 Supported IBM SCSI-Subsystems
361    ----------------------------------
362    The following IBM SCSI-subsystems are supported by this driver:
363    
364      - IBM Fast/Wide SCSI-2 Adapter
365      - IBM 7568 Industrial Computer SCSI Adapter w/cache
366      - IBM Expansion Unit SCSI Controller
367      - IBM SCSI Adapter w/Cache
368      - IBM SCSI Adapter
369      - IBM Integrated SCSI Controller
370      - All clones, 100% compatible with the chipset and subsystem command
371        system of IBM SCSI-adapters (forced detection)
372      
373    2.14 Linux Kernel Versions
374    --------------------------
375    The IBM SCSI-subsystem low level driver is prepared to be used with
376    all versions of Linux between 2.0.x and 2.4.x. The compatibility checks
377    are fully implemented up from version 3.1e of the driver. This means, that
378    you just need the latest ibmmca.h and ibmmca.c file and copy it in the
379    linux/drivers/scsi directory. The code is automatically adapted during 
380    kernel compilation.
382    3 Code History
383    --------------
384    Jan 15 1996:  First public release.
385    - Martin Kolinek
387    Jan 23 1996:  Scrapped code which reassigned scsi devices to logical
388    device numbers. Instead, the existing assignment (created
389    when the machine is powered-up or rebooted) is used. 
390    A side effect is that the upper layer of Linux SCSI 
391    device driver gets bogus scsi ids (this is benign), 
392    and also the hard disks are ordered under Linux the 
393    same way as they are under dos (i.e., C: disk is sda, 
394    D: disk is sdb, etc.).
395    - Martin Kolinek
397    I think that the CD-ROM is now detected only if a CD is 
398    inside CD_ROM while Linux boots. This can be fixed later,
399    once the driver works on all types of PS/2's.
400    - Martin Kolinek
402    Feb 7 1996:   Modified biosparam function. Fixed the CD-ROM detection. 
403    For now, devices other than harddisk and CD_ROM are 
404    ignored. Temporarily modified abort() function 
405    to behave like reset().
406    - Martin Kolinek
408    Mar 31 1996:  The integrated scsi subsystem is correctly found
409    in PS/2 models 56,57, but not in model 76. Therefore
410    the ibmmca_scsi_setup() function has been added today.
411    This function allows the user to force detection of
412    scsi subsystem. The kernel option has format
413    ibmmcascsi=n
414    where n is the scsi_id (pun) of the subsystem. Most likely, n is 7.
415    - Martin Kolinek
417    Aug 21 1996:  Modified the code which maps ldns to (pun,0).  It was
418    insufficient for those of us with CD-ROM changers.
419    - Chris Beauregard
421    Dec 14 1996: More improvements to the ldn mapping.  See check_devices
422    for details.  Did more fiddling with the integrated SCSI detection,
423    but I think it's ultimately hopeless without actually testing the
424    model of the machine.  The 56, 57, 76 and 95 (ultimedia) all have
425    different integrated SCSI register configurations.  However, the 56
426    and 57 are the only ones that have problems with forced detection.
427    - Chris Beauregard
429    Mar 8-16 1997: Modified driver to run as a module and to support 
430    multiple adapters. A structure, called ibmmca_hostdata, is now
431    present, containing all the variables, that were once only
432    available for one single adapter. The find_subsystem-routine has vanished.
433    The hardware recognition is now done in ibmmca_detect directly.
434    This routine checks for presence of MCA-bus, checks the interrupt
435    level and continues with checking the installed hardware.
436    Certain PS/2-models do not recognize a SCSI-subsystem automatically.
437    Hence, the setup defined by command-line-parameters is checked first.
438    Thereafter, the routine probes for an integrated SCSI-subsystem.
439    Finally, adapters are checked. This method has the advantage to cover all
440    possible combinations of multiple SCSI-subsystems on one MCA-board. Up to
441    eight SCSI-subsystems can be recognized and announced to the upper-level
442    drivers with this improvement. A set of defines made changes to other
443    routines as small as possible.
444    - Klaus Kudielka
445    
446    May 30 1997: (v1.5b)
447    1) SCSI-command capability enlarged by the recognition of MODE_SELECT.
448       This needs the RD-Bit to be disabled on IM_OTHER_SCSI_CMD_CMD which 
449       allows data to be written from the system to the device. It is a
450       necessary step to be allowed to set blocksize of SCSI-tape-drives and 
451       the tape-speed, whithout confusing the SCSI-Subsystem.
452    2) The recognition of a tape is included in the check_devices routine.
453       This is done by checking for TYPE_TAPE, that is already defined in
454       the kernel-scsi-environment. The markup of a tape is done in the 
455       global ldn_is_tape[] array. If the entry on index ldn 
456       is 1, there is a tapedrive connected.
457    3) The ldn_is_tape[] array is necessary to distinguish between tape- and 
458       other devices. Fixed blocklength devices should not cause a problem
459       with the SCB-command for read and write in the ibmmca_queuecommand
460       subroutine. Therefore, I only derivate the READ_XX, WRITE_XX for
461       the tape-devices, as recommended by IBM in this Technical Reference,
462       mentioned below. (IBM recommends to avoid using the read/write of the
463       subsystem, but the fact was, that read/write causes a command error from
464       the subsystem and this causes kernel-panic.)
465    4) In addition, I propose to use the ldn instead of a fix char for the
466       display of PS2_DISK_LED_ON(). On 95, one can distinguish between the
467       devices that are accessed. It shows activity and easyfies debugging.   
468    The tape-support has been tested with a SONY SDT-5200 and a HP DDS-2
469    (I do not know yet the type). Optimization and CD-ROM audio-support, 
470    I am working on ...
471    - Michael Lang
472    
473    June 19 1997: (v1.6b)
474    1) Submitting the extra-array ldn_is_tape[] -> to the local ld[]
475       device-array. 
476    2) CD-ROM Audio-Play seems to work now.
477    3) When using DDS-2 (120M) DAT-Tapes, mtst shows still density-code
478       0x13 for ordinary DDS (61000 BPM) instead 0x24 for DDS-2. This appears 
479       also on Adaptec 2940 adaptor in a PCI-System. Therefore, I assume that 
480       the problem is independent of the low-level-driver/bus-architecture.
481    4) Hexadecimal ldn on PS/2-95 LED-display.
482    5) Fixing of the PS/2-LED on/off that it works right with tapedrives and
483       does not confuse the disk_rw_in_progress counter.
484    - Michael Lang
485   
486    June 21 1997: (v1.7b)
487    1) Adding of a proc_info routine to inform in /proc/scsi/ibmmca/<host> the
488       outer-world about operational load statistics on the different ldns,
489       seen by the driver. Everybody that has more than one IBM-SCSI should
490       test this, because I only have one and cannot see what happens with more
491       than one IBM-SCSI hosts.
492    2) Definition of a driver version-number to have a better recognition of 
493       the source when there are existing too much releases that may confuse
494       the user, when reading about release-specific problems. Up to know,
495       I calculated the version-number to be 1.7. Because we are in BETA-test
496       yet, it is today 1.7b.
497    3) Sorry for the heavy bug I programmed on June 19 1997! After that, the
498       CD-ROM did not work any more! The C7-command was a fake impression
499       I got while programming. Now, the READ and WRITE commands for CD-ROM are
500       no longer running over the subsystem, but just over 
501       IM_OTHER_SCSI_CMD_CMD. On my observations (PS/2-95), now CD-ROM mounts
502       much faster(!) and hopefully all fancy multimedia-functions, like direct
503       digital recording from audio-CDs also work. (I tried it with cdda2wav
504       from the cdwtools-package and it filled up the harddisk immediately :-).)
505       To easify boolean logics, a further local device-type in ld[], called
506       is_cdrom has been included.
507    4) If one uses a SCSI-device of unsupported type/commands, one
508       immediately runs into a kernel-panic caused by Command Error. To better
509       understand which SCSI-command caused the problem, I extended this
510       specific panic-message slightly.
511    - Michael Lang
513    June 25 1997: (v1.8b)
514    1) Some cosmetical changes for the handling of SCSI-device-types.
515       Now, also CD-Burners / WORMs and SCSI-scanners should work. For
516       MO-drives I have no experience, therefore not yet supported.
517       In logical_devices I changed from different type-variables to one
518       called 'device_type' where the values, corresponding to scsi.h,
519       of a SCSI-device are stored.
520    2) There existed a small bug, that maps a device, coming after a SCSI-tape
521       wrong. Therefore, e.g. a CD-ROM changer would have been mapped wrong
522       -> problem removed.
523    3) Extension of the logical_device structure. Now it contains also device,
524       vendor and revision-level of a SCSI-device for internal usage.
525    - Michael Lang
527    June 26-29 1997: (v2.0b)
528    1) The release number 2.0b is necessary because of the completely new done
529       recognition and handling of SCSI-devices with the adapter. As I got
530       from Chris the hint, that the subsystem can reassign ldns dynamically,
531       I remembered this immediate_assign-command, I found once in the handbook.
532       Now, the driver first kills all ldn assignments that are set by default
533       on the SCSI-subsystem. After that, it probes on all puns and luns for
534       devices by going through all combinations with immediate_assign and
535       probing for devices, using device_inquiry. The found physical(!) pun,lun
536       structure is stored in get_scsi[][] as device types. This is followed
537       by the assignment of all ldns to existing SCSI-devices. If more ldns
538       than devices are available, they are assigned to non existing pun,lun
539       combinations to satisfy the adapter. With this, the dynamical mapping
540       was possible to implement. (For further info see the text in the 
541       source-code and in the description below. Read the description
542       below BEFORE installing this driver on your system!)
543    2) Changed the name IBMMCA_DRIVER_VERSION to IBMMCA_SCSI_DRIVER_VERSION.
544    3) The LED-display shows on PS/2-95 no longer the ldn, but the SCSI-ID
545       (pun) of the accessed SCSI-device. This is now senseful, because the 
546       pun known within the driver is exactly the pun of the physical device
547       and no longer a fake one.
548    4) The /proc/scsi/ibmmca/<host_no> consists now of the first part, where
549       hit-statistics of ldns is shown and a second part, where the maps of 
550       physical and logical SCSI-devices are displayed. This could be very 
551       interesting, when one is using more than 15 SCSI-devices in order to 
552       follow the dynamical remapping of ldns.
553    - Michael Lang
555    June 26-29 1997: (v2.0b-1)
556    1) I forgot to switch the local_checking_phase_flag to 1 and back to 0
557       in the dynamical remapping part in ibmmca_queuecommand for the 
558       device_exist routine. Sorry.
559    - Michael Lang
561    July 1-13 1997: (v3.0b,c)
562    1) Merging of the driver-developments of Klaus Kudielka and Michael Lang 
563       in order to get a optimum and unified driver-release for the 
564       IBM-SCSI-Subsystem-Adapter(s).
565          For people, using the Kernel-release >=2.1.0, module-support should 
566       be no problem. For users, running under <2.1.0, module-support may not 
567       work, because the methods have changed between 2.0.x and 2.1.x.
568    2) Added some more effective statistics for /proc-output.
569    3) Change typecasting at necessary points from (unsigned long) to
570       virt_to_bus().
571    4) Included #if... at special points to have specific adaption of the
572       driver to kernel 2.0.x and 2.1.x. It should therefore also run with 
573       later releases.
574    5) Magneto-Optical drives and medium-changers are also recognized, now.
575       Therefore, we have a completely gapfree recognition of all SCSI-
576       device-types, that are known by Linux up to kernel 2.1.31.
577    6) The flag SCSI_IBMMCA_DEV_RESET has been inserted. If it is set within
578       the configuration, each connected SCSI-device will get a reset command
579       during boottime. This can be necessary for some special SCSI-devices.
580       This flag should be included in Config.in.
581       (See also the new Config.in file.)
582    Probable next improvement: bad disk handler.
583    - Michael Lang
585    Sept 14 1997: (v3.0c)
586    1) Some debugging and speed optimization applied.
587    - Michael Lang
589    Dec 15, 1997
590     - chrisb@truespectra.com
591     - made the front panel display thingy optional, specified from the
592     command-line via ibmmcascsi=display.  Along the lines of the /LED
593     option for the OS/2 driver.
594     - fixed small bug in the LED display that would hang some machines.
595     - reversed ordering of the drives (using the
596     IBMMCA_SCSI_ORDER_STANDARD define).  This is necessary for two main
597     reasons:
598         - users who've already installed Linux won't be screwed.  Keep
599         in mind that not everyone is a kernel hacker.
600         - be consistent with the BIOS ordering of the drives.  In the
601         BIOS, id 6 is C:, id 0 might be D:.  With this scheme, they'd be
602         backwards.  This confuses the crap out of those heathens who've
603         got a impure Linux installation (which, <wince>, I'm one of).
604     This whole problem arises because IBM is actually non-standard with
605     the id to BIOS mappings.  You'll find, in fdomain.c, a similar
606     comment about a few FD BIOS revisions.  The Linux (and apparently
607     industry) standard is that C: maps to scsi id (0,0).  Let's stick
608     with that standard.
609     - Since this is technically a branch of my own, I changed the
610     version number to 3.0e-cpb.
612    Jan 17, 1998: (v3.0f)
613    1) Addition of some statistical info for /proc in proc_info.
614    2) Taking care of the SCSI-assignment problem, dealed by Chris at Dec 15
615       1997. In fact, IBM is right, concerning the assignment of SCSI-devices 
616       to driveletters. It is conform to the ANSI-definition of the SCSI-
617       standard to assign drive C: to SCSI-id 6, because it is the highest
618       hardware priority after the hostadapter (that has still today by
619       default everywhere id 7). Also realtime-operating systems that I use, 
620       like LynxOS and OS9, which are quite industrial systems use top-down
621       numbering of the harddisks, that is also starting at id 6. Now, one
622       sits a bit between two chairs. On one hand side, using the define
623       IBMMCA_SCSI_ORDER_STANDARD makes Linux assigning disks conform to
624       the IBM- and ANSI-SCSI-standard and keeps this driver downward
625       compatible to older releases, on the other hand side, people is quite
626       habituated in believing that C: is assigned to (0,0) and much other
627       SCSI-BIOS do so. Therefore, I moved the IBMMCA_SCSI_ORDER_STANDARD 
628       define out of the driver and put it into Config.in as subitem of 
629       'IBM SCSI support'. A help, added to Documentation/Configure.help 
630       explains the differences between saying 'y' or 'n' to the user, when 
631       IBMMCA_SCSI_ORDER_STANDARD prompts, so the ordinary user is enabled to 
632       choose the way of assignment, depending on his own situation and gusto.
633    3) Adapted SCSI_IBMMCA_DEV_RESET to the local naming convention, so it is
634       now called IBMMCA_SCSI_DEV_RESET.
635    4) Optimization of proc_info and its subroutines.
636    5) Added more in-source-comments and extended the driver description by
637       some explanation about the SCSI-device-assignment problem.
638    - Michael Lang
639    
640    Jan 18, 1998: (v3.0g)
641    1) Correcting names to be absolutely conform to the later 2.1.x releases.
642       This is necessary for 
643             IBMMCA_SCSI_DEV_RESET -> CONFIG_IBMMCA_SCSI_DEV_RESET
644             IBMMCA_SCSI_ORDER_STANDARD -> CONFIG_IBMMCA_SCSI_ORDER_STANDARD
645    - Michael Lang
647    Jan 18, 1999: (v3.1 MCA-team internal)
648    1) The multiple hosts structure is accessed from every subroutine, so there
649       is no longer the address of the device structure passed from function
650       to function, but only the hostindex. A call by value, nothing more. This
651       should really be understood by the compiler and the subsystem should get
652       the right values and addresses.
653    2) The SCSI-subsystem detection was not complete and quite hugely buggy up
654       to now, compared to the technical manual. The interpretation of the pos2
655       register is not as assumed by people before, therefore, I dropped a note
656       in the ibmmca_detect function to show the registers' interpretation.
657       The pos-registers of integrated SCSI-subsystems do not contain any 
658       information concerning the IO-port offset, really. Instead, they contain
659       some info about the adapter, the chip, the NVRAM .... The I/O-port is
660       fixed to 0x3540 - 0x3547. There can be more than one adapters in the 
661       slots and they get an offset for the I/O area in order to get their own
662       I/O-address area. See chapter 2 for detailed description. At least, the 
663       detection should now work right, even on models other than 95. The 95ers
664       came happily around the bug, as their pos2 register contains always 0 
665       in the critical area. Reserved bits are not allowed to be interpreted, 
666       therefore, IBM is allowed to set those bits as they like and they may 
667       really vary between different PS/2 models. So, now, no interpretation 
668       of reserved bits - hopefully no trouble here anymore.
669    3) The command error, which you may get on models 55, 56, 57, 70, 77 and
670       P70 may have been caused by the fact, that adapters of older design do
671       not like sending commands to non-existing SCSI-devices and will react
672       with a command error as a sign of protest. While this error is not
673       present on IBM SCSI Adapter w/cache, it appears on IBM Integrated SCSI
674       Adapters. Therefore, I implemented a workarround to forgive those 
675       adapters their protests, but it is marked up in the statisctis, so
676       after a successful boot, you can see in /proc/scsi/ibmmca/<host_number>
677       how often the command errors have been forgiven to the SCSI-subsystem.
678       If the number is bigger than 0, you have a SCSI subsystem of older
679       design, what should no longer matter.
680    4) ibmmca_getinfo() has been adapted very carefully, so it shows in the 
681       slotn file really, what is senseful to be presented.
682    5) ibmmca_register() has been extended in its parameter list in order to
683       pass the right name of the SCSI-adapter to Linux.
684    - Michael Lang
686    Feb 6, 1999: (v3.1)
687    1) Finally, after some 3.1Beta-releases, the 3.1 release. Sorry, for 
688       the delayed release, but it was not finished with the release of 
689       Kernel 2.2.0.
690    - Michael Lang
691    
692    Feb 10, 1999 (v3.1)
693    1) Added a new commandline parameter called 'bypass' in order to bypass
694       every integrated subsystem SCSI-command consequently in case of
695       troubles.
696    2) Concatenated read_capacity requests to the harddisks. It gave a lot
697       of troubles with some controllers and after I wanted to apply some
698       extensions, it jumped out in the same situation, on my w/cache, as like 
699       on D. Weinehalls' Model 56, having integrated SCSI. This gave me the 
700       descissive hint to move the code-part out and declare it global. Now,
701       it seems to work by far much better an more stable. Let us see, what
702       the world thinks of it...
703    3) By the way, only Sony DAT-drives seem to show density code 0x13. A
704       test with a HP drive gave right results, so the problem is vendor-
705       specific and not a problem of the OS or the driver.
706    - Michael Lang
707    
708    Feb 18, 1999 (v3.1d)
709    1) The abort command and the reset function have been checked for 
710       inconsistencies. From the logical point of thinking, they work
711       at their optimum, now, but as the subsystem does not answer with an
712       interrupt, abort never finishes, sigh...
713    2) Everything, that is accessed by a busmaster request from the adapter
714       is now declared as global variable, even the return-buffer in the
715       local checking phase. This assures, that no accesses to undefined memory
716       areas are performed.
717    3) In ibmmca.h, the line unchecked_isa_dma is added with 1 in order to
718       avoid memory-pointers for the areas higher than 16MByte in order to
719       be sure, it also works on 16-Bit Microchannel bus systems.
720    4) A lot of small things have been found, but nothing that endangered the
721       driver operations. Just it should be more stable, now.
722    - Michael Lang
723       
724    Feb 20, 1999 (v3.1e)
725    1) I took the warning from the Linux Kernel Hackers Guide serious and 
726       checked the cmd->result return value to the done-function very carefuly.
727       It is obvious, that the IBM SCSI only delivers the tsb.dev_status, if
728       some error appeared, else it is undefined. Now, this is fixed. Before
729       any SCB command gets queued, the tsb.dev_status is set to 0, so the 
730       cmd->result won't screw up Linux higher level drivers.
731    2) The reset-function has slightly improved. This is still planed for 
732       abort. During the abort and the reset function, no interrupts are 
733       allowed. This is however quite hard to cope with, so the INT-status
734       register is read. When the interrupt gets queued, one can find its
735       status immediately on that register and is enabled to continue in the
736       reset function. I had no chance to test this really, only in a bogus 
737       situation, I got this function running, but the situation was too much
738       worse for Linux :-(, so tests will continue.
739    3) Buffers got now consistent. No open address mapping, as before and
740       therefore no further troubles with the unassigned memory segmentation
741       faults that scrambled probes on 95XX series and even on 85XX series,
742       when the kernel is done in a not so perfectly fitting way.
743    4) Spontaneous interrupts from the subsystem, appearing without any
744       command previously queued are answered with a DID_BAD_INTR result.
745    5) Taken into account ZP Gus' proposals to reverse the SCSI-device
746       scan order. As it does not work on Kernel 2.1.x or 2.2.x, as proposed
747       by him, I implemented it in a slightly derived way, which offers in 
748       addition more flexibility.
749    - Michael Lang
751    Apr 23, 2000 (v3.2pre1)
752    1) During a very long time, I collected a huge amount of bugreports from
753       various people, trying really quite different things on their SCSI-
754       PS/2s. Today, all these bugreports are taken into account and should be
755       mostly solved. The major topics were:
756       - Driver crashes during boottime by no obvious reason.
757       - Driver panics while the midlevel-SCSI-driver is trying to inquire
758         the SCSI-device properties, even though hardware is in perfect state.
759       - Displayed info for the various slot-cards is interpreted wrong.
760       The main reasons for the crashes were two:
761       1) The commands to check for device information like INQUIRY, 
762          TEST_UNIT_READY, REQUEST_SENSE and MODE_SENSE cause the devices
763          to deliver information of up to 255 bytes. Midlevel drivers offer
764          1024 bytes of space for the answer, but the IBM-SCSI-adapters do
765          not accept this, as they stick quite near to ANSI-SCSI and report
766          a COMMAND_ERROR message which causes the driver to panic. The main
767          problem was located around the INQUIRY command. Now, for all the
768          mentioned commands, the buffersize, sent to the adapter is at 
769          maximum 255 which seems to be a quite reasonable solution. 
770          TEST_UNIT_READY gets a buffersize of 0 to make sure, that no 
771          data is transferred in order to avoid any possible command failure.
772       2) On unsuccessful TEST_UNIT_READY, the midlevel-driver has to send
773          a REQUEST_SENSE in order to see, where the problem is located. This
774          REQUEST_SENSE may have various length in its answer-buffer. IBM
775          SCSI-subsystems report a command failure, if the returned buffersize
776          is different from the sent buffersize, but this can be supressed by
777          a special bit, which is now done and problems seem to be solved.
778    2) Code adaption to all kernel-releases. Now, the 3.2 code compiles on 
779       2.0.x, 2.1.x, 2.2.x and 2.3.x kernel releases without any code-changes.
780    3) Commandline-parameters are recognized again, even under Kernel 2.3.x or
781       higher.
782    - Michael Lang   
784    April 27, 2000 (v3.2pre2)
785    1) Bypassed commands get read by the adapter by one cycle instead of two.
786       This increases SCSI-performance.
787    2) Synchronous datatransfer is provided for sure to be 5 MHz on older
788       SCSI and 10 MHz on internal F/W SCSI-adapter.
789    3) New commandline parameters allow to force the adapter to slow down while
790       in synchronous transfer. Could be helpful for very old devices.
791    - Michael Lang
792    
793    June 2, 2000 (v3.2pre5)
794    1) Added Jim Shorney's contribution to make the activity indicator
795       flashing in addition to the LED-alphanumeric display-panel on
796       models 95A. To be enabled to choose this feature freely, a new
797       commandline parameter is added, called 'activity'.
798    2) Added the READ_CONTROL bit for test_unit_ready SCSI-command.
799    3) Added some suppress_exception bits to read_device_capacity and
800       all device_inquiry occurences in the driver code.
801    4) Complaints about the various KERNEL_VERSION implementations are
802       taken into account. Every local_LinuxKernelVersion occurence is
803       now replaced by KERNEL_VERSION, defined in linux/version.h. 
804       Corresponding changes were applied to ibmmca.h, too. This was a
805       contribution to all kernel-parts by Philipp Hahn.
806    - Michael Lang
807    
808    July 17, 2000 (v3.2pre8)
809    A long period of collecting bugreports from all corners of the world
810    now lead to the following corrections to the code:
811    1) SCSI-2 F/W support crashed with a COMMAND ERROR. The reason for this 
812       was, that it is possible to disbale Fast-SCSI for the external bus.
813       The feature-control command, where this crash appeared regularly tried
814       to set the maximum speed of 10MHz synchronous transfer speed and that
815       reports a COMMAND ERROR, if external bus Fast-SCSI is disabled. Now,
816       the feature-command probes down from maximum speed until the adapter 
817       stops to complain, which is at the same time the maximum possible
818       speed selected in the reference program. So, F/W external can run at
819       5 MHz (slow-) or 10 MHz (fast-SCSI). During feature probing, the 
820       COMMAND ERROR message is used to detect if the adapter does not complain.
821    2) Up to now, only combined busmode is supported, if you use external
822       SCSI-devices, attached to the F/W-controller. If dual bus is selected,
823       only the internal SCSI-devices get accessed by Linux. For most 
824       applications, this should do fine. 
825    3) Wide-SCSI-addressing (16-Bit) is now possible for the internal F/W
826       bus on the F/W adapter. If F/W adapter is detected, the driver
827       automatically uses the extended PUN/LUN <-> LDN mapping tables, which
828       are now new from 3.2pre8. This allows PUNs between 0 and 15 and should
829       provide more fun with the F/W adapter.
830    4) Several machines use the SCSI: POS registers for internal/undocumented
831       storage of system relevant info. This confused the driver, mainly on
832       models 9595, as it expected no onboard SCSI only, if all POS in
833       the integrated SCSI-area are set to 0x00 or 0xff. Now, the mechanism
834       to check for integrated SCSI is much more restrictive and these problems
835       should be history.
836    - Michael Lang          
838    July 18, 2000 (v3.2pre9)
839    This develop rather quickly at the moment. Two major things were still
840    missing in 3.2pre8:
841    1) The adapter PUN for F/W adapters has 4-bits, while all other adapters
842       have 3-bits. This is now taken into account for F/W.
843    2) When you select CONFIG_IBMMCA_SCSI_ORDER_STANDARD, you should 
844       normally get the inverse probing order of your devices on the SCSI-bus.
845       The ANSI device order gets scrambled in version 3.2pre8!! Now, a new
846       and tested algorithm inverts the device-order on the SCSI-bus and
847       automatically avoids accidental access to whatever SCSI PUN the adapter 
848       is set and works with SCSI- and Wide-SCSI-addressing.
849    - Michael Lang
851    July 23, 2000 (v3.2pre10 unpublished) 
852    1) LED panel display supports wide-addressing in ibmmca=display mode.
853    2) Adapter-information and autoadaption to address-space is done.
854    3) Auto-probing for maximum synchronous SCSI transfer rate is working.
855    4) Optimization to some embedded function calls is applied.
856    5) Added some comment for the user to wait for SCSI-devices beeing probed.
857    6) Finished version 3.2 for Kernel 2.4.0. It least, I thought it is but...
858    - Michael Lang
859    
860    July 26, 2000 (v3.2pre11)
861    1) I passed a horrible weekend getting mad with NMIs on kernel 2.2.14 and
862       a model 9595. Asking around in the community, nobody except of me has
863       seen such errors. Weired, but I am trying to recompile everything on
864       the model 9595. Maybe, as I use a specially modified gcc, that could
865       cause problems. But, it was not the reason. The true background was,
866       that the kernel was compiled for i386 and the 9595 has a 486DX-2. 
867       Normally, no troubles should appear, but for this special machine,
868       only the right processor support is working fine!
869    2) Previous problems with synchronous speed, slowing down from one adapter 
870       to the next during probing are corrected. Now, local variables store
871       the synchronous bitmask for every single adapter found on the MCA bus.
872    3) LED alphanumeric panel support for XX95 systems is now showing some
873       alive rotator during boottime. This makes sense, when no monitor is 
874       connected to the system. You can get rid of all display activity, if
875       you do not use any parameter or just ibmmcascsi=activity, for the 
876       harddrive activity LED, existant on all PS/2, except models 8595-XXX.
877       If no monitor is available, please use ibmmcascsi=display, which works
878       fine together with the linuxinfo utility for the LED-panel.
879    - Michael Lang
880    
881    July 29, 2000 (v3.2)
882    1) Submission of this driver for kernel 2.4test-XX and 2.2.17.
883    - Michael Lang
884    
885    4 To do
886    -------
887         - IBM SCSI-2 F/W external SCSI bus support in seperate mode.
888         - It seems that the handling of bad disks is really bad -
889           non-existent, in fact.
890         - More testing of the full driver-controlled dynamical ldn 
891           (re)mapping for up to 56 SCSI-devices. I guess, it won't work
892           at the moment, but nobody ever really tried it.
893         - Abort and Reset functions still slightly buggy.
895    5 Users' Manual
896    ---------------
897    5.1 Commandline Parameters
898    --------------------------
899    There exist several features for the IBM SCSI-subsystem driver.
900    The commandline parameter format is:
901    
902          ibmmcascsi=<command1>,<command2>,<command3>,...
903          
904    where commandN can be one of the following:
905    
906          display    Owners of a model 95 or other PS/2 systems with an
907                     alphanumeric LED display may set this to have their
908                     display showing the following output of the 8 digits:
909                       
910                                 ------DA
911                                 
912                     where '-' stays dark, 'D' shows the SCSI-device id
913                     and 'A' shows the SCSI hostindex, beeing currently 
914                     accessed. During boottime, this will give the message
915                     
916                                 SCSIini*
917                                 
918                     on the LED-panel, where the * represents a rotator, 
919                     showing the activity during the probing phase of the
920                     driver which can take up to two minutes per SCSI-adapter.
921          adisplay   This works like display, but gives more optical overview 
922                     of the activities on the SCSI-bus. The display will have
923                     the following output:
924                     
925                                 6543210A
926                                 
927                     where the numbers 0 to 6 light up at the shown position,
928                     when the SCSI-device is accessed. A shows again the SCSI
929                     hostindex. If display nor adisplay is set, the internal
930                     PS/2 harddisk LED is used for media-activities. So, if
931                     you really do not have a system with a LED-display, you
932                     should not set display or adisplay. Keep in mind, that
933                     display and adisplay can only be used alternatively. It
934                     is not recommended to use this option, if you have some
935                     wide-addressed devices e.g. at the SCSI-2 F/W adapter in
936                     your system. In addition, the usage of the display for
937                     other tasks in parallel, like the linuxinfo-utility makes 
938                     no sense with this option.
939          activity   This enables the PS/2 harddisk LED activity indicator.
940                     Most PS/2 have no alphanumeric LED display, but some
941                     indicator. So you should use this parameter to activate it.
942                     If you own model 9595 (Server95), you can have both, the 
943                     LED panel and the activity indicator in parallel. However,
944                     some PS/2s, like the 8595 do not have any harddisk LED 
945                     activity indicator, which means, that you must use the
946                     alphanumeric LED display if you want to monitor SCSI-
947                     activity.
948          bypass     This commandline parameter forces the driver never to use
949                     SCSI-subsystems' integrated SCSI-command set. Except of
950                     the immediate assign, which is of vital importance for
951                     every IBM SCSI-subsystem to set its ldns right. Instead,
952                     the ordinary ANSI-SCSI-commands are used and passed by the
953                     controller to the SCSI-devices, therefore 'bypass'. The
954                     effort, done by the subsystem is quite bogus and at a
955                     minimum and therefore it should work everywhere. This
956                     could maybe solve troubles with old or integrated SCSI-
957                     controllers and nasty harddisks. Keep in mind, that using 
958                     this flag will slow-down SCSI-accesses slightly, as the 
959                     software generated commands are always slower than the 
960                     hardware. Non-harddisk devices always get read/write-
961                     commands in bypass mode. On the most recent releases of 
962                     the Linux IBM-SCSI-driver, the bypass command should be
963                     no longer a necessary thing, if you are sure about your
964                     SCSI-hardware!
965          normal     This is the parameter, introduced on the 2.0.x development
966                     rail by ZP Gu. This parameter defines the SCSI-device
967                     scan order in the new industry standard. This means, that
968                     the first SCSI-device is the one with the lowest pun.
969                     E.g. harddisk at pun=0 is scanned before harddisk at
970                     pun=6, which means, that harddisk at pun=0 gets sda
971                     and the one at pun=6 gets sdb.
972          ansi       The ANSI-standard for the right scan order, as done by
973                     IBM, Microware and Microsoft, scans SCSI-devices starting
974                     at the highest pun, which means, that e.g. harddisk at
975                     pun=6 gets sda and a harddisk at pun=0 gets sdb. If you
976                     like to have the same SCSI-device order, as in DOS, OS-9
977                     or OS/2, just use this parameter.
978          fast       SCSI-I/O in synchronous mode is done at 5 MHz for IBM-
979                     SCSI-devices. SCSI-2 Fast/Wide Adapter/A external bus
980                     should then run at 10 MHz if Fast-SCSI is enabled,
981                     and at 5 MHz if Fast-SCSI is disabled on the external
982                     bus. This is the default setting when nothing is 
983                     specified here.
984          medium     Synchronous rate is at 50% approximately, which means
985                     2.5 MHz for IBM SCSI-adapters and 5.0 MHz for F/W ext.
986                     SCSI-bus (when Fast-SCSI speed enabled on external bus).
987          slow       The slowest possible synchronous transfer rate is set. 
988                     This means 1.82 MHz for IBM SCSI-adapters and 2.0 MHz
989                     for F/W external bus at Fast-SCSI speed on the external
990                     bus.
991                     
992    A further option is that you can force the SCSI-driver to accept a SCSI-
993    subsystem at a certain I/O-address with a predefined adapter PUN. This
994    is done by entering 
996                   commandN   = I/O-base
997                   commandN+1 = adapter PUN
998                   
999    e.g. ibmmcascsi=0x3540,7 will force the driver to detect a SCSI-subsystem 
1000    at I/O-address 0x3540 with adapter PUN 7.
1001    
1002    Examples:
1003    
1004         ibmmcascsi=adisplay,bypass
1005         
1006    This will use the advanced display mode for the model 95 LED display and
1007    every SCSI-command passed to an attached device will get bypassed in order
1008    not to use any of the subsystem built-in commands.
1009    
1010         ibmmcascsi=display,0x3558,7
1011         
1012    This will activate the default display mode for the model 95 LED display
1013    and will force the driver to accept a SCSI-subsystem at I/O-base 0x3558
1014    with adapter PUN 7.
1015    
1016    5.2 Troubleshooting
1017    -------------------
1018    The following FAQs should help you to solve some major problems with this
1019    driver.
1020    
1021      Q: "Reset SCSI-devices at boottime" halts the system at boottime, why?
1022      A: This is only tested with the IBM SCSI Adapter w/cache. It is not
1023         yet prooved to run on other adapters, however you may be lucky.
1024         In version 3.1d this has been hugely improved and should work better,
1025         now. Normally you really won't need to activate this flag in the
1026         kernel configuration, as all post 1989 SCSI-devices should accept
1027         the reset-signal, when the computer is switched on. The SCSI-
1028         subsystem generates this reset while beeing initialized. This flag
1029         is really reserved for users with very old, very strange or self-made
1030         SCSI-devices.
1031      Q: Why is the SCSI-order of my drives mirrored to the device-order
1032         seen from OS/2 or DOS ?
1033      A: It depends on the operating system, if it looks at the devices in
1034         ANSI-SCSI-standard (starting from pun 6 and going down to pun 0) or
1035         if it just starts at pun 0 and counts up. If you want to be conform
1036         with OS/2 and DOS, you have to activate this flag in the kernel
1037         configuration or you should set 'ansi' as parameter for the kernel.
1038         The parameter 'normal' sets the new industry standard, starting
1039         from pun 0, scanning up to pun 6. This allows you to change your 
1040         opinion still after having already compiled the kernel.
1041      Q: Why I cannot find the IBM MCA SCSI support in the config menue?
1042      A: You have to activate MCA bus support, first.
1043      Q: Where can I find the latest info about this driver?
1044      A: See the file MAINTAINERS for the current WWW-address, which offers
1045         updates, info and Q/A lists. At this files' origin, the webaddress
1046         was: http://www.uni-mainz.de/~langm000/linux.html
1047      Q: My SCSI-adapter is not recognized by the driver, what can I do?
1048      A: Just force it to be recognized by kernel parameters. See section 5.1.
1049      Q: The driver screws up, if it starts to probe SCSI-devices, is there
1050         some way out of it?
1051      A: Yes, that was some recognition problem of the correct SCSI-adapter
1052         and its I/O base addresses. Upgrade your driver to the latest release
1053         and it should be fine again.
1054      Q: I get a message: panic IBM MCA SCSI: command error .... , what can
1055         I do against this?
1056      A: Previously, I followed the way by ignoring command errors by using
1057         ibmmcascsi=forgiveall, but this command no longer exists and is
1058         obsolete. If such a problem appears, it is caused by some segmentation
1059         fault of the driver, which maps to some unallowed area. The latest 
1060         version of the driver should be ok, as most bugs have been solved.
1061      Q: There are still kernel panics, even after having set 
1062         ibmmcascsi=forgiveall. Are there other possibilities to prevent
1063         such panics?
1064      A: No, get just the latest release of the driver and it should work 
1065         better and better with increasing version number. Forget about this
1066         ibmmcascsi=forgiveall, as also ignorecmd are obsolete.!
1067      Q: Linux panics or stops without any comment, but it is probable, that my
1068         harddisk(s) have bad blocks.
1069      A: Sorry, the bad-block handling is still a feeble point of this driver,
1070         but is on the schedule for development in the near future.
1071      Q: Linux panics while dynamically assigning SCSI-ids or ldns.
1072      A: If you disconnect a SCSI-device from the machine, while Linux is up
1073         and the driver uses dynamical reassignment of logical device numbers
1074         (ldn), it really gets "angry" if it won't find devices, that were still
1075         present at boottime and stops Linux.
1076      Q: The system does not recover after an abort-command has been generated.
1077      A: This is regrettably true, as it is not yet understood, why the 
1078         SCSI-adapter does really NOT generate any interrupt at the end of
1079         the abort-command. As no interrupt is generated, the abort command
1080         cannot get finished and the system hangs, sorry, but checks are 
1081         running to hunt down this problem. If there is a real pending command,
1082         the interrupt MUST get generated after abort. In this case, it
1083         should finish well.
1084      Q: The system gets in bad shape after a SCSI-reset, is this known?
1085      A: Yes, as there are a lot of prescriptions (see the Linux Hackers'
1086         Guide) what has to be done for reset, we still share the bad shape of
1087         the reset functions with all other low level SCSI-drivers. 
1088         Astonishingly, reset works in most cases quite ok, but the harddisks
1089         won't run in synchonous mode anymore after a reset, until you reboot.
1090      Q: Why does my XXX w/Cache adapter not use read-prefetch?
1091      A: Ok, that is not completely possible. If a cache is present, the 
1092         adapter tries to use it internally. Explicitly, one can use the cache
1093         with a read prefetch command, maybe in future, but this requires
1094         some major overhead of SCSI-commands that risks the performance to
1095         go down more than it gets improved. Tests with that are running.
1096      Q: I have a IBM SCSI-2 Fast/Wide adapter, it boots in some way and hangs.
1097      A: Yes, that is understood, as for sure, your SCSI-2 Fast/Wide adapter
1098         was in such a case recognized as integrated SCSI-adapter or something 
1099         else, but not as the correct adapter. As the I/O-ports get assigned 
1100         wrongly by that reason, the system should crash in most cases. You 
1101         should upgrade to the latest release of the SCSI-driver. The 
1102         recommended version is 3.2 or later. Here, the F/W support is in
1103         a stable and reliable condition. Wide-addressing is in addition 
1104         supported.
1105      Q: I get a Ooops message and something like "killing interrupt".
1106      A: The reason for this is that the IBM SCSI-subsystem only sends a 
1107         termination status back, if some error appeared. In former releases
1108         of the driver, it was not checked, if the termination status block
1109         is NULL. From version 3.2, it is taken care of this.
1110      Q: I have a F/W adapter and the driver sees my internal SCSI-devices,
1111         but ignores the external ones.
1112      A: Select combined busmode in the config-program and check for that
1113         no SCSI-id on the external devices appears on internal devices.
1114         Reboot afterwards. Dual busmode is supported, but works only for the
1115         internal bus, yet. External bus is still ignored. Take care for your
1116         SCSI-ids. If combined bus-mode is activated, on some adapters, 
1117         the wide-addressing is not possible, so devices with ids between 8 
1118         and 15 get ignored by the driver & adapter!
1119      Q: I have a 9595 and I get a NMI during heavy SCSI I/O e.g. during fsck.
1120         A COMMAND ERROR is reported and characters on the screen are missing.
1121         Warm reboot is not possible. Things look like quite weired.
1122      A: Check the processor type of your 9595. If you have an 80486 or 486DX-2
1123         processor complex on your mainboard and you compiled a kernel that
1124         supports 80386 processors, it is possible, that the kernel cannot
1125         keep track of the PS/2 interrupt handling and stops on an NMI. Just
1126         compile a kernel for the correct processor type of your PS/2 and
1127         everything should be fine. This is necessary even if one assumes,
1128         that some 80486 system should be downward compatible to 80386
1129         software.
1130         
1131    5.3 Bugreports
1132    --------------
1133    If you really find bugs in the sourcecode or the driver will successfully
1134    refuse to work on your machine, you should send a bug report to me. The
1135    best for this is to follow the instructions on the WWW-page for this
1136    driver. Fill out the bug-report form, placed on the WWW-page and ship it,
1137    so the bugs can be taken into account with maximum efforts. But, please
1138    do not send bug reports about this driver to Linus Torvalds or Leonard
1139    Zubkoff, as Linus is burried in E-Mail and Leonard is supervising all
1140    SCSI-drivers and won't have the time left to look inside every single
1141    driver to fix a bug and especially DO NOT send modified code to Linus
1142    Torvalds or Alan J. Cox which has not been checked here!!! They are both
1143    quite burried in E-mail (as me, sometimes, too) and one should first check
1144    for problems on my local teststand. Recently, I got a lot of 
1145    bugreports for errors in the ibmmca.c code, which I could not imagine, but
1146    a look inside some Linux-distribution showed me quite often some modified
1147    code, which did no longer work on most other machines than the one of the
1148    modifier. Ok, so now that there is maintenance service available for this
1149    driver, please use this address first in order to keep the level of
1150    confusion low. Thank you!
1151    
1152    When you get a SCSI-error message that panics your system, a list of
1153    register-entries of the SCSI-subsystem is shown (from Version 3.1d). With 
1154    this list, it is very easy for the maintainer to localize the problem in 
1155    the driver or in the configuration of the user. Please write down all the 
1156    values from this report and send them to the maintainer. This would really 
1157    help a lot and makes life easier concerning misunderstandings.
1158    
1159    Use the bug-report form (see 5.4 for its address) to send all the bug-
1160    stuff to the maintainer or write e-mail with the values from the table. 
1161    
1162    5.4 Support WWW-page
1163    --------------------
1164    The address of the IBM SCSI-subsystem supporting WWW-page is:
1165    
1166         http://www.uni-mainz.de/~langm000/linux.html
1167         
1168    Here you can find info about the background of this driver, patches,
1169    troubleshooting support, news and a bugreport form. Please check that
1170    WWW-page regularly for latest hints.
1171    
1172    For the bugreport, please fill out the formular on the corresponding
1173    WWW-page. Read the dedicated instructions and write as much as you
1174    know about your problem. If you do not like such formulars, please send
1175    some e-mail directly, but at least with the same information as required by
1176    the formular.
1177    
1178    If you have extensive bugreports, including Ooops messages and 
1179    screen-shots, please feel free to send it directly to the address
1180    of the maintainer, too. The current address of the maintainer is:
1181    
1182             Michael Lang <langa2@kph.uni-mainz.de>
1183    
1184    6 References
1185    ------------
1186    IBM Corp., "Update for the PS/2 Hardware Interface Technical Reference, 
1187    Common Interfaces", Armonk, September 1991, PN 04G3281, 
1188    (available in the U.S. for $21.75 at 1-800-IBM-PCTB or in Germany for
1189    around 40,-DM at "Hallo IBM").
1190   
1191    IBM Corp., "Personal System/2 Micro Channel SCSI
1192    Adapter with Cache Technical Reference", Armonk, March 1990, PN 68X2365.
1194    IBM Corp., "Personal System/2 Micro Channel SCSI
1195    Adapter Technical Reference", Armonk, March 1990, PN 68X2397.
1197    IBM Corp., "SCSI-2 Fast/Wide Adapter/A Technical Reference - Dual Bus",
1198    Armonk, March 1994, PN 83G7545.
1200    Friedhelm Schmidt, "SCSI-Bus und IDE-Schnittstelle - Moderne Peripherie-
1201    Schnittstellen: Hardware, Protokollbeschreibung und Anwendung", 2. Aufl.
1202    Addison Wesley, 1996.
1203    
1204    Michael K. Johnson, "The Linux Kernel Hackers' Guide", Version 0.6, Chapel
1205    Hill - North Carolina, 1995
1206    
1207    Andreas Kaiser, "SCSI TAPE BACKUP for OS/2 2.0", Version 2.12, Stuttgart
1208    1993
1209    
1210    Helmut Rompel, "IBM Computerwelt GUIDE", What is what bei IBM., Systeme *
1211    Programme * Begriffe, IWT-Verlag GmbH - Muenchen, 1988
1212    
1213    7 Credits to
1214    ------------
1215    7.1 People
1216    ----------
1217    Klaus Grimm
1218                 who already a long time ago gave me the old code from the
1219                 SCSI-driver in order to get it running for some old machine
1220                 in our institute.
1221    Martin Kolinek
1222                 who wrote the first release of the IBM SCSI-subsystem driver.
1223    Chris Beauregard
1224                 who for a long time maintained MCA-Linux and the SCSI-driver
1225                 in the beginning. Chris, wherever you are: Cheers to you!
1226    Klaus Kudielka
1227                 with whom in the 2.1.x times, I had a quite fruitful
1228                 cooperation to get the driver running as a module and to get
1229                 it running with multiple SCSI-adapters.
1230    David Weinehall
1231                 for his excellent maintenance of the MCA-stuff and the quite 
1232                 detailed bug reports and ideas for this driver (and his 
1233                 patience ;-)).
1234    Alan J. Cox  
1235                 for his bugreports and his bold activities in cross-checking
1236                 the driver-code with his teststand.
1237                 
1238    7.2 Sponsors & Supporters
1239    -------------------------
1240    "Hallo IBM",
1241    IBM-Deutschland GmbH
1242                 the service of IBM-Deutschland for customers. Their E-Mail
1243                 service is unbeatable. Whatever old stuff I asked for, I 
1244                 always got some helpful answers.
1245    Karl-Otto Reimers,
1246    IBM Klub - Sparte IBM Geschichte, Sindelfingen
1247                 for sending me a copy of the w/Cache manual from the 
1248                 IBM-Deutschland archives.
1249    Harald Staiger
1250                 for his extensive hardware donations which allows me today
1251                 still to test the driver in various constellations.
1252    Erich Fritscher
1253                 for his very kind sponsoring.
1254    Louis Ohland,
1255    Charles Lasitter
1256                 for support by shipping me an IBM SCSI-2 Fast/Wide manual.
1257                 In addition, the contribution of various hardware is quite 
1258                 decessive and will make it possible to add FWSR (RAID)
1259                 adapter support to the driver in the near future! So,
1260                 complaints about no RAID support won't remain forever.
1261                 Yes, folks, that is no joke, RAID support is going to rise!
1262    Erik Weber
1263                 for the great deal we made about a model 9595 and the nice
1264                 surrounding equipment and the cool trip to Mannheim
1265                 second-hand computer market.
1266    Anthony Hogbin
1267                 for his direct shipment of a SCSI F/W adapter, which allowed
1268                 me immediately on the first stage to try it on model 8557
1269                 together with onboard SCSI adapter and some SCSI w/Cache.
1270    Andreas Hotz
1271                 for his support by memory and an IBM SCSI-adapter. Collecting
1272                 all this together now allows me to try really things with
1273                 the driver at maximum load and variety on various models in
1274                 a very quick and efficient way.
1275    Peter Jennewein
1276                 for his model 30, which serves me as part of my teststand
1277                 and his cool remark about how you make an ordinary diskette
1278                 drive working and how to connect it to an IBM-diskette port.
1279    Johannes Gutenberg-University, Mainz &
1280    Institut fuer Kernphysik, MAMI
1281                 for the offered space, the link, placed on the central
1282                 homepage and the space to store and offer the driver and 
1283                 related material and the free working times, which allow
1284                 me to answer all your e-mail.
1285                    
1286    8 Trademarks
1287    ------------
1288    IBM, PS/2, OS/2, Microchannel are registered trademarks of International 
1289    Business Machines Corporation
1290    
1291    MS-DOS is a registered trademark of Microsoft Corporation
1292    
1293    Microware, OS-9 are registered trademarks of Microware Systems
1294    
1295    9 Disclaimer
1296    ------------
1297    Beside the GNU public license and the dependant disclaimers and disclaimers
1298    concerning the Linux-kernel in special, this SCSI-driver comes without any
1299    warranty. Its functionality is tested as good as possible on certain 
1300    machines and combinations of computer hardware, which does not exclude,
1301    that dataloss or severe damage of hardware is possible while using this
1302    part of software on some arbitrary computer hardware or in combination 
1303    with other software packages. It is highly recommended to make backup
1304    copies of your data before using this software.
1305    
1306    This driver supports hardware, produced by International Business Machines
1307    Corporation (IBM).
1308    
1309 ------
1310 Michael Lang 
1311 (langa2@kph.uni-mainz.de)