📄 ibmmca.txt
字号:
and luns, but it all seemed to work. The latest development, which is implemented from the driver version 3.0 and later, realizes the device recognition in the following way: The physical SCSI-devices on the SCSI-bus are probed via immediate_assign- and device_inquiry-commands, that is all implemented in a completely new made check_devices() subroutine. This delivers an exact map of the physical SCSI-world that is now stored in the get_scsi[][]-array. This means, that the once hidden pun,lun assignment is now known to this driver. It no longer believes in default-settings of the subsystem and maps all ldns to existing pun,lun "by foot". This assures full control of the ldn mapping and allows dynamical remapping of ldns to different pun,lun, if there are more SCSI-devices installed than ldns available (n>15). The ldns from 0 to 6 get 'hardwired' by this driver to puns 0 to 7 at lun=0, excluding the pun of the subsystem. This assures, that at least simple SCSI-installations have optimum access-speed and are not touched by dynamical remapping. The ldns 7 to 14 are put to existing devices with lun>0 or to non-existing devices, in order to satisfy the subsystem, if there are less than 15 SCSI-devices connected. In the case of more than 15 devices, the dynamical mapping goes active. If the get_scsi[][] reports a device to be existent, but it has no ldn assigned, it gets an ldn out of 7 to 14. The numbers are assigned in cyclic order, therefore it takes 8 dynamical reassignments on the SCSI-devices until a certain device loses its ldn again. This assures that dynamical remapping is avoided during intense I/O between up to 15 SCSI-devices (means pun,lun combinations). A further advantage of this method is that people who build their kernel without probing on all luns will get what they expect, because the driver just won't assign everything with lun>0 when multiple lun probing is inactive. 2.4 SCSI-Device Order --------------------- Because of the now correct recognition of physical pun,lun, and their report to mid-level- and higher-level-drivers, the new reported puns can be different from the old, faked puns. Therefore, Linux will eventually change /dev/sdXXX assignments and prompt you for corrupted superblock repair on boottime. In this case DO NOT PANIC, YOUR DISKS ARE STILL OK!!! You have to reboot (CTRL-D) with an old kernel and set the /etc/fstab-file entries right. After that, the system should come up as errorfree as before. If your boot-partition is not coming up, also edit the /etc/lilo.conf-file in a Linux session booted on old kernel and run lilo before reboot. Check lilo.conf anyway to get boot on other partitions with foreign OSes right again. But there exists a feature of this driver that allows you to change the assignment order of the SCSI-devices by flipping the PUN-assignment. See the next paragraph for a description. The problem for this is, that Linux does not assign the SCSI-devices in the way as described in the ANSI-SCSI-standard. Linux assigns /dev/sda to the device with at minimum id 0. But the first drive should be at id 6, because for historical reasons, drive at id 6 has, by hardware, the highest priority and a drive at id 0 the lowest. IBM was one of the rare producers, where the BIOS assigns drives belonging to the ANSI-SCSI-standard. Most other producers' BIOS does not (I think even Adaptec-BIOS). The IBMMCA_SCSI_ORDER_STANDARD flag, which you set while configuring the kernel enables to choose the preferred way of SCSI-device-assignment. Defining this flag would result in Linux determining the devices in the same order as DOS and OS/2 does on your MCA-machine. This is also standard on most industrial computers and OSes, like e.g. OS-9. Leaving this flag undefined will get your devices ordered in the default way of Linux. See also the remarks of Chris Beauregard from Dec 15, 1997 and the followups in section 3. 2.5 Regular SCSI-Command-Processing ----------------------------------- Only three functions get involved: ibmmca_queuecommand(), issue_cmd(), and interrupt_handler(). The upper layer issues a scsi command by calling function ibmmca_queuecommand(). This function fills a "subsystem control block" (scb) and calls a local function issue_cmd(), which writes a scb command into subsystem I/O ports. Once the scb command is carried out, the interrupt_handler() is invoked. If a device is determined to be existant and it has not assigned any ldn, it gets one dynamically. For this, the whole stuff is done in ibmmca_queuecommand(). 2.6 Abort & Reset Commands -------------------------- These are implemented with busy waiting for interrupt to arrive. ibmmca_reset() and ibmmca_abort() do not work sufficiently well up to now and need still a lot of development work. This seems to be a problem with other low-level SCSI drivers too, however this should be no excuse. 2.7 Disk Geometry ----------------- The ibmmca_biosparams() function should return the same disk geometry as the bios. This is needed for fdisk, etc. The returned geometry is certainly correct for disks smaller than 1 gigabyte. In the meantime, it has been proved, that this works fine even with disks larger than 1 gigabyte. 2.8 Kernel Boot Option ---------------------- The function ibmmca_scsi_setup() is called if option ibmmcascsi=n is passed to the kernel. See file linux/init/main.c for details. 2.9 Driver Module Support ------------------------- Is implemented and tested by K. Kudielka. This could probably not work on kernels <2.1.0. 2.10 Multiple Hostadapter Support --------------------------------- This driver supports up to eight interfaces of type IBM-SCSI-Subsystem. Integrated-, and MCA-adapters are automatically recognized. Unrecognizable IBM-SCSI-Subsystem interfaces can be specified as kernel-parameters. 2.11 /proc/scsi-Filesystem Information -------------------------------------- Information about the driver condition is given in /proc/scsi/ibmmca/<host_no>. ibmmca_proc_info() provides this information. This table is quite informative for interested users. It shows the load of commands on the subsystem and whether you are running the bypassed (software) or integrated (hardware) SCSI-command set (see below). The amount of accesses is shown. Read, write, modeselect is shown separately in order to help debugging problems with CD-ROMs or tapedrives. The following table shows the list of 15 logical device numbers, that are used by the SCSI-subsystem. The load on each ldn is shown in the table, again, read and write commands are split. The last column shows the amount of reassignments, that have been applied to the ldns, if you have more than 15 pun/lun combinations available on the SCSI-bus. The last two tables show the pun/lun map and the positions of the ldns on this pun/lun map. This may change during operation, when a ldn is reassigned to another pun/lun combination. If the necessity for dynamical assignments is set to 'no', the ldn structure keeps static. 2.12 /proc/mca-Filesystem Information ------------------------------------- The slot-file contains all default entries and in addition chip and I/O- address information of the SCSI-subsystem. This information is provided by ibmmca_getinfo(). 2.13 Supported IBM SCSI-Subsystems ---------------------------------- The following IBM SCSI-subsystems are supported by this driver: - IBM Fast/Wide SCSI-2 Adapter - IBM 7568 Industrial Computer SCSI Adapter w/Cache - IBM Expansion Unit SCSI Controller - IBM SCSI Adapter w/Cache - IBM SCSI Adapter - IBM Integrated SCSI Controller - All clones, 100% compatible with the chipset and subsystem command system of IBM SCSI-adapters (forced detection) 2.14 Linux Kernel Versions -------------------------- The IBM SCSI-subsystem low level driver is prepared to be used with all versions of Linux between 2.0.x and 2.4.x. The compatibility checks are fully implemented up from version 3.1e of the driver. This means, that you just need the latest ibmmca.h and ibmmca.c file and copy it in the linux/drivers/scsi directory. The code is automatically adapted during kernel compilation. This is different from kernel 2.4.0! Here version 4.0 or later of the driver must be used for kernel 2.4.0 or later. Version 4.0 or later does not work together with older kernels! Driver versions older than 4.0 do not work together with kernel 2.4.0 or later. They work on all older kernels. 3 Code History -------------- Jan 15 1996: First public release. - Martin Kolinek Jan 23 1996: Scrapped code which reassigned scsi devices to logical device numbers. Instead, the existing assignment (created when the machine is powered-up or rebooted) is used. A side effect is that the upper layer of Linux SCSI device driver gets bogus scsi ids (this is benign), and also the hard disks are ordered under Linux the same way as they are under dos (i.e., C: disk is sda, D: disk is sdb, etc.). - Martin Kolinek I think that the CD-ROM is now detected only if a CD is inside CD_ROM while Linux boots. This can be fixed later, once the driver works on all types of PS/2's. - Martin Kolinek Feb 7 1996: Modified biosparam function. Fixed the CD-ROM detection. For now, devices other than harddisk and CD_ROM are ignored. Temporarily modified abort() function to behave like reset(). - Martin Kolinek Mar 31 1996: The integrated scsi subsystem is correctly found in PS/2 models 56,57, but not in model 76. Therefore the ibmmca_scsi_setup() function has been added today. This function allows the user to force detection of scsi subsystem. The kernel option has format ibmmcascsi=n where n is the scsi_id (pun) of the subsystem. Most likely, n is 7. - Martin Kolinek Aug 21 1996: Modified the code which maps ldns to (pun,0). It was insufficient for those of us with CD-ROM changers. - Chris Beauregard Dec 14 1996: More improvements to the ldn mapping. See check_devices for details. Did more fiddling with the integrated SCSI detection, but I think it's ultimately hopeless without actually testing the model of the machine. The 56, 57, 76 and 95 (ultimedia) all have different integrated SCSI register configurations. However, the 56 and 57 are the only ones that have problems with forced detection. - Chris Beauregard Mar 8-16 1997: Modified driver to run as a module and to support multiple adapters. A structure, called ibmmca_hostdata, is now present, containing all the variables, that were once only available for one single adapter. The find_subsystem-routine has vanished. The hardware recognition is now done in ibmmca_detect directly. This routine checks for presence of MCA-bus, checks the interrupt level and continues with checking the installed hardware. Certain PS/2-models do not recognize a SCSI-subsystem automatically. Hence, the setup defined by command-line-parameters is checked first. Thereafter, the routine probes for an integrated SCSI-subsystem. Finally, adapters are checked. This method has the advantage to cover all possible combinations of multiple SCSI-subsystems on one MCA-board. Up to eight SCSI-subsystems can be recognized and announced to the upper-level drivers with this improvement. A set of defines made changes to other routines as small as possible. - Klaus Kudielka May 30 1997: (v1.5b) 1) SCSI-command capability enlarged by the recognition of MODE_SELECT. This needs the RD-Bit to be disabled on IM_OTHER_SCSI_CMD_CMD which allows data to be written from the system to the device. It is a necessary step to be allowed to set blocksize of SCSI-tape-drives and the tape-speed, without confusing the SCSI-Subsystem. 2) The recognition of a tape is included in the check_devices routine. This is done by checking for TYPE_TAPE, that is already defined in
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -