diff options
| author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
|---|---|---|
| committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
| commit | fcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch) | |
| tree | a57612d1888735a2ec7972891b68c1ac5ec8faea /drivers/scsi | |
| parent | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff) | |
Diffstat (limited to 'drivers/scsi')
| -rw-r--r-- | drivers/scsi/fd_mcs.c | 1355 | ||||
| -rw-r--r-- | drivers/scsi/ibmmca.c | 2380 | ||||
| -rw-r--r-- | drivers/scsi/ibmvscsi/iseries_vscsi.c | 173 | ||||
| -rw-r--r-- | drivers/scsi/ibmvscsi/rpa_vscsi.c | 368 | ||||
| -rw-r--r-- | drivers/scsi/isci/firmware/Makefile | 19 | ||||
| -rw-r--r-- | drivers/scsi/isci/firmware/README | 36 | ||||
| -rw-r--r-- | drivers/scsi/isci/firmware/create_fw.c | 99 | ||||
| -rw-r--r-- | drivers/scsi/isci/firmware/create_fw.h | 77 | ||||
| -rw-r--r-- | drivers/scsi/scsi_wait_scan.c | 42 |
9 files changed, 4549 insertions, 0 deletions
diff --git a/drivers/scsi/fd_mcs.c b/drivers/scsi/fd_mcs.c new file mode 100644 index 00000000000..a2c6135d337 --- /dev/null +++ b/drivers/scsi/fd_mcs.c | |||
| @@ -0,0 +1,1355 @@ | |||
| 1 | /* fd_mcs.c -- Future Domain MCS 600/700 (or IBM OEM) driver | ||
| 2 | * | ||
| 3 | * FutureDomain MCS-600/700 v0.2 03/11/1998 by ZP Gu (zpg@castle.net) | ||
| 4 | * | ||
| 5 | * This driver is cloned from fdomain.* to specifically support | ||
| 6 | * the Future Domain MCS 600/700 MCA SCSI adapters. Some PS/2s | ||
| 7 | * also equipped with IBM Fast SCSI Adapter/A which is an OEM | ||
| 8 | * of MCS 700. | ||
| 9 | * | ||
| 10 | * This driver also supports Reply SB16/SCSI card (the SCSI part). | ||
| 11 | * | ||
| 12 | * What makes this driver different is that this driver is MCA only | ||
| 13 | * and it supports multiple adapters in the same system, IRQ | ||
| 14 | * sharing, some driver statistics, and maps highest SCSI id to sda. | ||
| 15 | * All cards are auto-detected. | ||
| 16 | * | ||
| 17 | * Assumptions: TMC-1800/18C50/18C30, BIOS >= 3.4 | ||
| 18 | * | ||
| 19 | * LILO command-line options: | ||
| 20 | * fd_mcs=<FIFO_COUNT>[,<FIFO_SIZE>] | ||
| 21 | * | ||
| 22 | * ******************************************************** | ||
| 23 | * Please see Copyrights/Comments in fdomain.* for credits. | ||
| 24 | * Following is from fdomain.c for acknowledgement: | ||
| 25 | * | ||
| 26 | * Created: Sun May 3 18:53:19 1992 by faith@cs.unc.edu | ||
| 27 | * Revised: Wed Oct 2 11:10:55 1996 by r.faith@ieee.org | ||
| 28 | * Author: Rickard E. Faith, faith@cs.unc.edu | ||
| 29 | * Copyright 1992, 1993, 1994, 1995, 1996 Rickard E. Faith | ||
| 30 | * | ||
| 31 | * $Id: fdomain.c,v 5.45 1996/10/02 15:13:06 root Exp $ | ||
| 32 | |||
| 33 | * This program is free software; you can redistribute it and/or modify it | ||
| 34 | * under the terms of the GNU General Public License as published by the | ||
| 35 | * Free Software Foundation; either version 2, or (at your option) any | ||
| 36 | * later version. | ||
| 37 | |||
| 38 | * This program is distributed in the hope that it will be useful, but | ||
| 39 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 40 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 41 | * General Public License for more details. | ||
| 42 | |||
| 43 | * You should have received a copy of the GNU General Public License along | ||
| 44 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 45 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 46 | |||
| 47 | ************************************************************************** | ||
| 48 | |||
| 49 | NOTES ON USER DEFINABLE OPTIONS: | ||
| 50 | |||
| 51 | DEBUG: This turns on the printing of various debug information. | ||
| 52 | |||
| 53 | ENABLE_PARITY: This turns on SCSI parity checking. With the current | ||
| 54 | driver, all attached devices must support SCSI parity. If none of your | ||
| 55 | devices support parity, then you can probably get the driver to work by | ||
| 56 | turning this option off. I have no way of testing this, however, and it | ||
| 57 | would appear that no one ever uses this option. | ||
| 58 | |||
| 59 | FIFO_COUNT: The host adapter has an 8K cache (host adapters based on the | ||
| 60 | 18C30 chip have a 2k cache). When this many 512 byte blocks are filled by | ||
| 61 | the SCSI device, an interrupt will be raised. Therefore, this could be as | ||
| 62 | low as 0, or as high as 16. Note, however, that values which are too high | ||
| 63 | or too low seem to prevent any interrupts from occurring, and thereby lock | ||
| 64 | up the machine. I have found that 2 is a good number, but throughput may | ||
| 65 | be increased by changing this value to values which are close to 2. | ||
| 66 | Please let me know if you try any different values. | ||
| 67 | [*****Now a runtime option*****] | ||
| 68 | |||
| 69 | RESELECTION: This is no longer an option, since I gave up trying to | ||
| 70 | implement it in version 4.x of this driver. It did not improve | ||
| 71 | performance at all and made the driver unstable (because I never found one | ||
| 72 | of the two race conditions which were introduced by the multiple | ||
| 73 | outstanding command code). The instability seems a very high price to pay | ||
| 74 | just so that you don't have to wait for the tape to rewind. If you want | ||
| 75 | this feature implemented, send me patches. I'll be happy to send a copy | ||
| 76 | of my (broken) driver to anyone who would like to see a copy. | ||
| 77 | |||
| 78 | **************************************************************************/ | ||
| 79 | |||
| 80 | #include <linux/module.h> | ||
| 81 | #include <linux/init.h> | ||
| 82 | #include <linux/interrupt.h> | ||
| 83 | #include <linux/blkdev.h> | ||
| 84 | #include <linux/errno.h> | ||
| 85 | #include <linux/string.h> | ||
| 86 | #include <linux/ioport.h> | ||
| 87 | #include <linux/proc_fs.h> | ||
| 88 | #include <linux/delay.h> | ||
| 89 | #include <linux/mca.h> | ||
| 90 | #include <linux/spinlock.h> | ||
| 91 | #include <linux/slab.h> | ||
| 92 | #include <scsi/scsicam.h> | ||
| 93 | #include <linux/mca-legacy.h> | ||
| 94 | |||
| 95 | #include <asm/io.h> | ||
| 96 | #include <asm/system.h> | ||
| 97 | |||
| 98 | #include "scsi.h" | ||
| 99 | #include <scsi/scsi_host.h> | ||
| 100 | |||
| 101 | #define DRIVER_VERSION "v0.2 by ZP Gu<zpg@castle.net>" | ||
| 102 | |||
| 103 | /* START OF USER DEFINABLE OPTIONS */ | ||
| 104 | |||
| 105 | #define DEBUG 0 /* Enable debugging output */ | ||
| 106 | #define ENABLE_PARITY 1 /* Enable SCSI Parity */ | ||
| 107 | |||
| 108 | /* END OF USER DEFINABLE OPTIONS */ | ||
| 109 | |||
| 110 | #if DEBUG | ||
| 111 | #define EVERY_ACCESS 0 /* Write a line on every scsi access */ | ||
| 112 | #define ERRORS_ONLY 1 /* Only write a line if there is an error */ | ||
| 113 | #define DEBUG_MESSAGES 1 /* Debug MESSAGE IN phase */ | ||
| 114 | #define DEBUG_ABORT 1 /* Debug abort() routine */ | ||
| 115 | #define DEBUG_RESET 1 /* Debug reset() routine */ | ||
| 116 | #define DEBUG_RACE 1 /* Debug interrupt-driven race condition */ | ||
| 117 | #else | ||
| 118 | #define EVERY_ACCESS 0 /* LEAVE THESE ALONE--CHANGE THE ONES ABOVE */ | ||
| 119 | #define ERRORS_ONLY 0 | ||
| 120 | #define DEBUG_MESSAGES 0 | ||
| 121 | #define DEBUG_ABORT 0 | ||
| 122 | #define DEBUG_RESET 0 | ||
| 123 | #define DEBUG_RACE 0 | ||
| 124 | #endif | ||
| 125 | |||
| 126 | /* Errors are reported on the line, so we don't need to report them again */ | ||
| 127 | #if EVERY_ACCESS | ||
| 128 | #undef ERRORS_ONLY | ||
| 129 | #define ERRORS_ONLY 0 | ||
| 130 | #endif | ||
| 131 | |||
| 132 | #if ENABLE_PARITY | ||
| 133 | #define PARITY_MASK 0x08 | ||
| 134 | #else | ||
| 135 | #define PARITY_MASK 0x00 | ||
| 136 | #endif | ||
| 137 | |||
| 138 | enum chip_type { | ||
| 139 | unknown = 0x00, | ||
| 140 | tmc1800 = 0x01, | ||
| 141 | tmc18c50 = 0x02, | ||
| 142 | tmc18c30 = 0x03, | ||
| 143 | }; | ||
| 144 | |||
| 145 | enum { | ||
| 146 | in_arbitration = 0x02, | ||
| 147 | in_selection = 0x04, | ||
| 148 | in_other = 0x08, | ||
| 149 | disconnect = 0x10, | ||
| 150 | aborted = 0x20, | ||
| 151 | sent_ident = 0x40, | ||
| 152 | }; | ||
| 153 | |||
| 154 | enum in_port_type { | ||
| 155 | Read_SCSI_Data = 0, | ||
| 156 | SCSI_Status = 1, | ||
| 157 | TMC_Status = 2, | ||
| 158 | FIFO_Status = 3, /* tmc18c50/tmc18c30 only */ | ||
| 159 | Interrupt_Cond = 4, /* tmc18c50/tmc18c30 only */ | ||
| 160 | LSB_ID_Code = 5, | ||
| 161 | MSB_ID_Code = 6, | ||
| 162 | Read_Loopback = 7, | ||
| 163 | SCSI_Data_NoACK = 8, | ||
| 164 | Interrupt_Status = 9, | ||
| 165 | Configuration1 = 10, | ||
| 166 | Configuration2 = 11, /* tmc18c50/tmc18c30 only */ | ||
| 167 | Read_FIFO = 12, | ||
| 168 | FIFO_Data_Count = 14 | ||
| 169 | }; | ||
| 170 | |||
| 171 | enum out_port_type { | ||
| 172 | Write_SCSI_Data = 0, | ||
| 173 | SCSI_Cntl = 1, | ||
| 174 | Interrupt_Cntl = 2, | ||
| 175 | SCSI_Mode_Cntl = 3, | ||
| 176 | TMC_Cntl = 4, | ||
| 177 | Memory_Cntl = 5, /* tmc18c50/tmc18c30 only */ | ||
| 178 | Write_Loopback = 7, | ||
| 179 | IO_Control = 11, /* tmc18c30 only */ | ||
| 180 | Write_FIFO = 12 | ||
| 181 | }; | ||
| 182 | |||
| 183 | struct fd_hostdata { | ||
| 184 | unsigned long _bios_base; | ||
| 185 | int _bios_major; | ||
| 186 | int _bios_minor; | ||
| 187 | volatile int _in_command; | ||
| 188 | Scsi_Cmnd *_current_SC; | ||
| 189 | enum chip_type _chip; | ||
| 190 | int _adapter_mask; | ||
| 191 | int _fifo_count; /* Number of 512 byte blocks before INTR */ | ||
| 192 | |||
| 193 | char _adapter_name[64]; | ||
| 194 | #if DEBUG_RACE | ||
| 195 | volatile int _in_interrupt_flag; | ||
| 196 | #endif | ||
| 197 | |||
| 198 | int _SCSI_Mode_Cntl_port; | ||
| 199 | int _FIFO_Data_Count_port; | ||
| 200 | int _Interrupt_Cntl_port; | ||
| 201 | int _Interrupt_Status_port; | ||
| 202 | int _Interrupt_Cond_port; | ||
| 203 | int _Read_FIFO_port; | ||
| 204 | int _Read_SCSI_Data_port; | ||
| 205 | int _SCSI_Cntl_port; | ||
| 206 | int _SCSI_Data_NoACK_port; | ||
| 207 | int _SCSI_Status_port; | ||
