Commit df3d80f5 authored by Linus Torvalds's avatar Linus Torvalds

Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (207 commits)
  [SCSI] gdth: fix CONFIG_ISA build failure
  [SCSI] esp_scsi: remove __dev{init,exit}
  [SCSI] gdth: !use_sg cleanup and use of scsi accessors
  [SCSI] gdth: Move members from SCp to gdth_cmndinfo, stage 2
  [SCSI] gdth: Setup proper per-command private data
  [SCSI] gdth: Remove gdth_ctr_tab[]
  [SCSI] gdth: switch to modern scsi host registration
  [SCSI] gdth: gdth_interrupt() gdth_get_status() & gdth_wait() fixes
  [SCSI] gdth: clean up host private data
  [SCSI] gdth: Remove virt hosts
  [SCSI] gdth: Reorder scsi_host_template intitializers
  [SCSI] gdth: kill gdth_{read,write}[bwl] wrappers
  [SCSI] gdth: Remove 2.4.x support, in-kernel changelog
  [SCSI] gdth: split out pci probing
  [SCSI] gdth: split out eisa probing
  [SCSI] gdth: split out isa probing
  gdth: Make one abuse of scsi_cmnd less obvious
  [SCSI] NCR5380: Use scsi_eh API for REQUEST_SENSE invocation
  [SCSI] usb storage: use scsi_eh API in REQUEST_SENSE execution
  [SCSI] scsi_error: Refactoring scsi_error to facilitate in synchronous REQUEST_SENSE
  ...
parents 3d06f7a5 c8e91b0a
...@@ -2,14 +2,20 @@ ...@@ -2,14 +2,20 @@
- this file - this file
53c700.txt 53c700.txt
- info on driver for 53c700 based adapters - info on driver for 53c700 based adapters
AM53C974.txt
- info on driver for AM53c974 based adapters
BusLogic.txt BusLogic.txt
- info on driver for adapters with BusLogic chips - info on driver for adapters with BusLogic chips
ChangeLog ChangeLog.1992-1997
- Changes to scsi files, if not listed elsewhere - Changes to scsi files, if not listed elsewhere
ChangeLog.arcmsr
- Changes to driver for ARECA's SATA RAID controller cards
ChangeLog.ips ChangeLog.ips
- IBM ServeRAID driver Changelog - IBM ServeRAID driver Changelog
ChangeLog.lpfc
- Changes to lpfc driver
ChangeLog.megaraid
- Changes to LSI megaraid controller.
ChangeLog.megaraid_sas
- Changes to serial attached scsi version of LSI megaraid controller.
ChangeLog.ncr53c8xx ChangeLog.ncr53c8xx
- Changes to ncr53c8xx driver - Changes to ncr53c8xx driver
ChangeLog.sym53c8xx ChangeLog.sym53c8xx
...@@ -20,26 +26,44 @@ FlashPoint.txt ...@@ -20,26 +26,44 @@ FlashPoint.txt
- info on driver for BusLogic FlashPoint adapters - info on driver for BusLogic FlashPoint adapters
LICENSE.FlashPoint LICENSE.FlashPoint
- Licence of the Flashpoint driver - Licence of the Flashpoint driver
LICENSE.qla2xxx
- License for QLogic Linux Fibre Channel HBA Driver firmware.
Mylex.txt Mylex.txt
- info on driver for Mylex adapters - info on driver for Mylex adapters
NinjaSCSI.txt NinjaSCSI.txt
- info on WorkBiT NinjaSCSI-32/32Bi driver - info on WorkBiT NinjaSCSI-32/32Bi driver
aacraid.txt
- Driver supporting Adaptec RAID controllers
aha152x.txt aha152x.txt
- info on driver for Adaptec AHA152x based adapters - info on driver for Adaptec AHA152x based adapters
aic79xx.txt
- Adaptec Ultra320 SCSI host adapters
aic7xxx.txt aic7xxx.txt
- info on driver for Adaptec controllers - info on driver for Adaptec controllers
aic7xxx_old.txt aic7xxx_old.txt
- info on driver for Adaptec controllers, old generation - info on driver for Adaptec controllers, old generation
arcmsr_spec.txt
- ARECA FIRMWARE SPEC (for IOP331 adapter)
dc395x.txt
- README file for the dc395x SCSI driver
dpti.txt dpti.txt
- info on driver for DPT SmartRAID and Adaptec I2O RAID based adapters - info on driver for DPT SmartRAID and Adaptec I2O RAID based adapters
dtc3x80.txt dtc3x80.txt
- info on driver for DTC 2x80 based adapters - info on driver for DTC 2x80 based adapters
g_NCR5380.txt g_NCR5380.txt
- info on driver for NCR5380 and NCR53c400 based adapters - info on driver for NCR5380 and NCR53c400 based adapters
hptiop.txt
- HIGHPOINT ROCKETRAID 3xxx RAID DRIVER
ibmmca.txt ibmmca.txt
- info on driver for IBM adapters with MCA bus - info on driver for IBM adapters with MCA bus
in2000.txt in2000.txt
- info on in2000 driver - info on in2000 driver
libsas.txt
- Serial Attached SCSI management layer.
lpfc.txt
- LPFC driver release notes
megaraid.txt
- Common Management Module, shared code handling ioctls for LSI drivers
ncr53c7xx.txt ncr53c7xx.txt
- info on driver for NCR53c7xx based adapters - info on driver for NCR53c7xx based adapters
ncr53c8xx.txt ncr53c8xx.txt
...@@ -50,6 +74,8 @@ ppa.txt ...@@ -50,6 +74,8 @@ ppa.txt
- info on driver for IOmega zip drive - info on driver for IOmega zip drive
qlogicfas.txt qlogicfas.txt
- info on driver for QLogic FASxxx based adapters - info on driver for QLogic FASxxx based adapters
scsi-changer.txt
- README for the SCSI media changer driver
scsi-generic.txt scsi-generic.txt
- info on the sg driver for generic (non-disk/CD/tape) SCSI devices. - info on the sg driver for generic (non-disk/CD/tape) SCSI devices.
scsi.txt scsi.txt
...@@ -58,6 +84,8 @@ scsi_mid_low_api.txt ...@@ -58,6 +84,8 @@ scsi_mid_low_api.txt
- info on API between SCSI layer and low level drivers - info on API between SCSI layer and low level drivers
scsi_eh.txt scsi_eh.txt
- info on SCSI midlayer error handling infrastructure - info on SCSI midlayer error handling infrastructure
scsi_fc_transport.txt
- SCSI Fiber Channel Tansport
st.txt st.txt
- info on scsi tape driver - info on scsi tape driver
sym53c500_cs.txt sym53c500_cs.txt
......
...@@ -53,4 +53,19 @@ ...@@ -53,4 +53,19 @@
** for linux standard list ** for linux standard list
** enable usage of pci message signal interrupt ** enable usage of pci message signal interrupt
** follow Randy.Danlup kindness suggestion cleanup this code ** follow Randy.Danlup kindness suggestion cleanup this code
** 1.20.00.14 05/02/2007 Erich Chen & Nick Cheng
** 1.implement PCI-Express error recovery function and AER capability
** 2.implement the selection of ARCMSR_MAX_XFER_SECTORS_B=4096
** if firmware version is newer than 1.42
** 3.modify arcmsr_iop_reset to improve the ability
** 4.modify the ISR, arcmsr_interrupt routine,to prevent the
** inconsistency with sg_mod driver if application directly calls
** the arcmsr driver w/o passing through scsi mid layer
** specially thanks to Yanmin Zhang's openhanded help about AER
** 1.20.00.15 08/30/2007 Erich Chen & Nick Cheng
** 1. support ARC1200/1201/1202 SATA RAID adapter, which is named
** ACB_ADAPTER_TYPE_B
** 2. modify the arcmsr_pci_slot_reset function
** 3. modify the arcmsr_pci_ers_disconnect_forepart function
** 4. modify the arcmsr_pci_ers_need_reset_forepart function
************************************************************************** **************************************************************************
...@@ -38,10 +38,8 @@ Supported Cards/Chipsets ...@@ -38,10 +38,8 @@ Supported Cards/Chipsets
9005:0286:9005:02ac Adaptec 1800 (Typhoon44) 9005:0286:9005:02ac Adaptec 1800 (Typhoon44)
9005:0285:9005:02b5 Adaptec 5445 (Voodoo44) 9005:0285:9005:02b5 Adaptec 5445 (Voodoo44)
9005:0285:15d9:02b5 SMC AOC-USAS-S4i 9005:0285:15d9:02b5 SMC AOC-USAS-S4i
9005:0285:15d9:02c9 SMC AOC-USAS-S4iR
9005:0285:9005:02b6 Adaptec 5805 (Voodoo80) 9005:0285:9005:02b6 Adaptec 5805 (Voodoo80)
9005:0285:15d9:02b6 SMC AOC-USAS-S8i 9005:0285:15d9:02b6 SMC AOC-USAS-S8i
9005:0285:15d9:02ca SMC AOC-USAS-S8iR
9005:0285:9005:02b7 Adaptec 5085 (Voodoo08) 9005:0285:9005:02b7 Adaptec 5085 (Voodoo08)
9005:0285:9005:02bb Adaptec 3405 (Marauder40LP) 9005:0285:9005:02bb Adaptec 3405 (Marauder40LP)
9005:0285:9005:02bc Adaptec 3805 (Marauder80LP) 9005:0285:9005:02bc Adaptec 3805 (Marauder80LP)
...@@ -50,9 +48,14 @@ Supported Cards/Chipsets ...@@ -50,9 +48,14 @@ Supported Cards/Chipsets
9005:0285:9005:02be Adaptec 31605 (Marauder160) 9005:0285:9005:02be Adaptec 31605 (Marauder160)
9005:0285:9005:02c3 Adaptec 51205 (Voodoo120) 9005:0285:9005:02c3 Adaptec 51205 (Voodoo120)
9005:0285:9005:02c4 Adaptec 51605 (Voodoo160) 9005:0285:9005:02c4 Adaptec 51605 (Voodoo160)
9005:0285:15d9:02c9 SMC AOC-USAS-S4iR
9005:0285:15d9:02ca SMC AOC-USAS-S8iR
9005:0285:9005:02ce Adaptec 51245 (Voodoo124) 9005:0285:9005:02ce Adaptec 51245 (Voodoo124)
9005:0285:9005:02cf Adaptec 51645 (Voodoo164) 9005:0285:9005:02cf Adaptec 51645 (Voodoo164)
9005:0285:9005:02d0 Adaptec 52445 (Voodoo244) 9005:0285:9005:02d0 Adaptec 52445 (Voodoo244)
9005:0285:9005:02d1 Adaptec 5405 (Voodoo40)
9005:0285:15d9:02d2 SMC AOC-USAS-S8i-LP
9005:0285:15d9:02d3 SMC AOC-USAS-S8iR-LP
1011:0046:9005:0364 Adaptec 5400S (Mustang) 1011:0046:9005:0364 Adaptec 5400S (Mustang)
9005:0287:9005:0800 Adaptec Themisto (Jupiter) 9005:0287:9005:0800 Adaptec Themisto (Jupiter)
9005:0200:9005:0200 Adaptec Themisto (Jupiter) 9005:0200:9005:0200 Adaptec Themisto (Jupiter)
...@@ -103,6 +106,7 @@ Supported Cards/Chipsets ...@@ -103,6 +106,7 @@ Supported Cards/Chipsets
9005:0285:108e:7aac SUN STK RAID REM (Voodoo44 Coyote) 9005:0285:108e:7aac SUN STK RAID REM (Voodoo44 Coyote)
9005:0285:108e:0286 SUN STK RAID INT (Cougar) 9005:0285:108e:0286 SUN STK RAID INT (Cougar)
9005:0285:108e:0287 SUN STK RAID EXT (Prometheus) 9005:0285:108e:0287 SUN STK RAID EXT (Prometheus)
9005:0285:108e:7aae SUN STK RAID EM (Narvi)
People People
------------------------- -------------------------
......
AdvanSys (Advanced System Products, Inc.) manufactures the following
RISC-based, Bus-Mastering, Fast (10 Mhz) and Ultra (20 Mhz) Narrow
(8-bit transfer) SCSI Host Adapters for the ISA, EISA, VL, and PCI
buses and RISC-based, Bus-Mastering, Ultra (20 Mhz) Wide (16-bit
transfer) SCSI Host Adapters for the PCI bus.
The CDB counts below indicate the number of SCSI CDB (Command
Descriptor Block) requests that can be stored in the RISC chip
cache and board LRAM. A CDB is a single SCSI command. The driver
detect routine will display the number of CDBs available for each
adapter detected. The number of CDBs used by the driver can be
lowered in the BIOS by changing the 'Host Queue Size' adapter setting.
Laptop Products:
ABP-480 - Bus-Master CardBus (16 CDB)
Connectivity Products:
ABP510/5150 - Bus-Master ISA (240 CDB)
ABP5140 - Bus-Master ISA PnP (16 CDB)
ABP5142 - Bus-Master ISA PnP with floppy (16 CDB)
ABP902/3902 - Bus-Master PCI (16 CDB)
ABP3905 - Bus-Master PCI (16 CDB)
ABP915 - Bus-Master PCI (16 CDB)
ABP920 - Bus-Master PCI (16 CDB)
ABP3922 - Bus-Master PCI (16 CDB)
ABP3925 - Bus-Master PCI (16 CDB)
ABP930 - Bus-Master PCI (16 CDB)
ABP930U - Bus-Master PCI Ultra (16 CDB)
ABP930UA - Bus-Master PCI Ultra (16 CDB)
ABP960 - Bus-Master PCI MAC/PC (16 CDB)
ABP960U - Bus-Master PCI MAC/PC Ultra (16 CDB)
Single Channel Products:
ABP542 - Bus-Master ISA with floppy (240 CDB)
ABP742 - Bus-Master EISA (240 CDB)
ABP842 - Bus-Master VL (240 CDB)
ABP940 - Bus-Master PCI (240 CDB)
ABP940U - Bus-Master PCI Ultra (240 CDB)
ABP940UA/3940UA - Bus-Master PCI Ultra (240 CDB)
ABP970 - Bus-Master PCI MAC/PC (240 CDB)
ABP970U - Bus-Master PCI MAC/PC Ultra (240 CDB)
ABP3960UA - Bus-Master PCI MAC/PC Ultra (240 CDB)
ABP940UW/3940UW - Bus-Master PCI Ultra-Wide (253 CDB)
ABP970UW - Bus-Master PCI MAC/PC Ultra-Wide (253 CDB)
ABP3940U2W - Bus-Master PCI LVD/Ultra2-Wide (253 CDB)
Multi-Channel Products:
ABP752 - Dual Channel Bus-Master EISA (240 CDB Per Channel)
ABP852 - Dual Channel Bus-Master VL (240 CDB Per Channel)
ABP950 - Dual Channel Bus-Master PCI (240 CDB Per Channel)
ABP950UW - Dual Channel Bus-Master PCI Ultra-Wide (253 CDB Per Channel)
ABP980 - Four Channel Bus-Master PCI (240 CDB Per Channel)
ABP980U - Four Channel Bus-Master PCI Ultra (240 CDB Per Channel)
ABP980UA/3980UA - Four Channel Bus-Master PCI Ultra (16 CDB Per Chan.)
ABP3950U2W - Bus-Master PCI LVD/Ultra2-Wide and Ultra-Wide (253 CDB)
ABP3950U3W - Bus-Master PCI Dual LVD2/Ultra3-Wide (253 CDB)
Driver Compile Time Options and Debugging
The following constants can be defined in the source file.
1. ADVANSYS_ASSERT - Enable driver assertions (Def: Enabled)
Enabling this option adds assertion logic statements to the
driver. If an assertion fails a message will be displayed to
the console, but the system will continue to operate. Any
assertions encountered should be reported to the person
responsible for the driver. Assertion statements may proactively
detect problems with the driver and facilitate fixing these
problems. Enabling assertions will add a small overhead to the
execution of the driver.
2. ADVANSYS_DEBUG - Enable driver debugging (Def: Disabled)
Enabling this option adds tracing functions to the driver and the
ability to set a driver tracing level at boot time. This option is
very useful for debugging the driver, but it will add to the size
of the driver execution image and add overhead to the execution of
the driver.
The amount of debugging output can be controlled with the global
variable 'asc_dbglvl'. The higher the number the more output. By
default the debug level is 0.
If the driver is loaded at boot time and the LILO Driver Option
is included in the system, the debug level can be changed by
specifying a 5th (ASC_NUM_IOPORT_PROBE + 1) I/O Port. The
first three hex digits of the pseudo I/O Port must be set to
'deb' and the fourth hex digit specifies the debug level: 0 - F.
The following command line will look for an adapter at 0x330
and set the debug level to 2.
linux advansys=0x330,0,0,0,0xdeb2
If the driver is built as a loadable module this variable can be
defined when the driver is loaded. The following insmod command
will set the debug level to one.
insmod advansys.o asc_dbglvl=1
Debugging Message Levels:
0: Errors Only
1: High-Level Tracing
2-N: Verbose Tracing
To enable debug output to console, please make sure that:
a. System and kernel logging is enabled (syslogd, klogd running).
b. Kernel messages are routed to console output. Check
/etc/syslog.conf for an entry similar to this:
kern.* /dev/console
c. klogd is started with the appropriate -c parameter
(e.g. klogd -c 8)
This will cause printk() messages to be be displayed on the
current console. Refer to the klogd(8) and syslogd(8) man pages
for details.
Alternatively you can enable printk() to console with this
program. However, this is not the 'official' way to do this.
Debug output is logged in /var/log/messages.
main()
{
syscall(103, 7, 0, 0);
}
Increasing LOG_BUF_LEN in kernel/printk.c to something like
40960 allows more debug messages to be buffered in the kernel
and written to the console or log file.
3. ADVANSYS_STATS - Enable statistics (Def: Enabled)
Enabling this option adds statistics collection and display
through /proc to the driver. The information is useful for
monitoring driver and device performance. It will add to the
size of the driver execution image and add minor overhead to
the execution of the driver.
Statistics are maintained on a per adapter basis. Driver entry
point call counts and transfer size counts are maintained.
Statistics are only available for kernels greater than or equal
to v1.3.0 with the CONFIG_PROC_FS (/proc) file system configured.
AdvanSys SCSI adapter files have the following path name format:
/proc/scsi/advansys/{0,1,2,3,...}
This information can be displayed with cat. For example:
cat /proc/scsi/advansys/0
When ADVANSYS_STATS is not defined the AdvanSys /proc files only
contain adapter and device configuration information.
Driver LILO Option
If init/main.c is modified as described in the 'Directions for Adding
the AdvanSys Driver to Linux' section (B.4.) above, the driver will
recognize the 'advansys' LILO command line and /etc/lilo.conf option.
This option can be used to either disable I/O port scanning or to limit
scanning to 1 - 4 I/O ports. Regardless of the option setting EISA and
PCI boards will still be searched for and detected. This option only
affects searching for ISA and VL boards.
Examples:
1. Eliminate I/O port scanning:
boot: linux advansys=
or
boot: linux advansys=0x0
2. Limit I/O port scanning to one I/O port:
boot: linux advansys=0x110
3. Limit I/O port scanning to four I/O ports:
boot: linux advansys=0x110,0x210,0x230,0x330
For a loadable module the same effect can be achieved by setting
the 'asc_iopflag' variable and 'asc_ioport' array when loading
the driver, e.g.
insmod advansys.o asc_iopflag=1 asc_ioport=0x110,0x330
If ADVANSYS_DEBUG is defined a 5th (ASC_NUM_IOPORT_PROBE + 1)
I/O Port may be added to specify the driver debug level. Refer to
the 'Driver Compile Time Options and Debugging' section above for
more information.
Credits (Chronological Order)
Bob Frey <bfrey@turbolinux.com.cn> wrote the AdvanSys SCSI driver
and maintained it up to 3.3F. He continues to answer questions
and help maintain the driver.
Nathan Hartwell <mage@cdc3.cdc.net> provided the directions and
basis for the Linux v1.3.X changes which were included in the
1.2 release.
Thomas E Zerucha <zerucha@shell.portal.com> pointed out a bug
in advansys_biosparam() which was fixed in the 1.3 release.
Erik Ratcliffe <erik@caldera.com> has done testing of the
AdvanSys driver in the Caldera releases.
Rik van Riel <H.H.vanRiel@fys.ruu.nl> provided a patch to
AscWaitTixISRDone() which he found necessary to make the
driver work with a SCSI-1 disk.
Mark Moran <mmoran@mmoran.com> has helped test Ultra-Wide
support in the 3.1A driver.
Doug Gilbert <dgilbert@interlog.com> has made changes and
suggestions to improve the driver and done a lot of testing.
Ken Mort <ken@mort.net> reported a DEBUG compile bug fixed
in 3.2K.
Tom Rini <trini@kernel.crashing.org> provided the CONFIG_ISA
patch and helped with PowerPC wide and narrow board support.
Philip Blundell <philb@gnu.org> provided an
advansys_interrupts_enabled patch.
Dave Jones <dave@denial.force9.co.uk> reported the compiler
warnings generated when CONFIG_PROC_FS was not defined in
the 3.2M driver.
Jerry Quinn <jlquinn@us.ibm.com> fixed PowerPC support (endian
problems) for wide cards.
Bryan Henderson <bryanh@giraffe-data.com> helped debug narrow
card error handling.
Manuel Veloso <veloso@pobox.com> worked hard on PowerPC narrow
board support and fixed a bug in AscGetEEPConfig().
Arnaldo Carvalho de Melo <acme@conectiva.com.br> made
save_flags/restore_flags changes.
Andy Kellner <AKellner@connectcom.net> continued the Advansys SCSI
driver development for ConnectCom (Version > 3.3F).
Ken Witherow for extensive testing during the development of version 3.4.
...@@ -297,6 +297,12 @@ P: Colin Leroy ...@@ -297,6 +297,12 @@ P: Colin Leroy
M: colin@colino.net M: colin@colino.net
S: Maintained S: Maintained
ADVANSYS SCSI DRIVER
P: Matthew Wilcox
M: matthew@wil.cx
L: linux-scsi@vger.kernel.org
S: Maintained
AEDSP16 DRIVER AEDSP16 DRIVER
P: Riccardo Facchetti P: Riccardo Facchetti
M: fizban@tin.it M: fizban@tin.it
...@@ -1889,6 +1895,11 @@ M: Gadi Oxman <gadio@netvision.net.il> ...@@ -1889,6 +1895,11 @@ M: Gadi Oxman <gadio@netvision.net.il>
L: linux-kernel@vger.kernel.org L: linux-kernel@vger.kernel.org
S: Maintained S: Maintained
IDE-SCSI DRIVER
L: linux-ide@vger.kernel.org
L: linux-scsi@vger.kernel.org
S: Orphan
IEEE 1394 SUBSYSTEM IEEE 1394 SUBSYSTEM
P: Ben Collins P: Ben Collins
M: ben.collins@ubuntu.com M: ben.collins@ubuntu.com
...@@ -2404,7 +2415,7 @@ LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI) ...@@ -2404,7 +2415,7 @@ LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI)
P: Eric Moore P: Eric Moore
M: Eric.Moore@lsi.com M: Eric.Moore@lsi.com
M: support@lsi.com M: support@lsi.com
L: mpt_linux_developer@lsi.com L: DL-MPTFusionLinux@lsi.com
L: linux-scsi@vger.kernel.org L: linux-scsi@vger.kernel.org
W: http://www.lsilogic.com/support W: http://www.lsilogic.com/support
S: Supported S: Supported
......
...@@ -372,8 +372,13 @@ simscsi_init(void) ...@@ -372,8 +372,13 @@ simscsi_init(void)
return -ENOMEM; return -ENOMEM;
error = scsi_add_host(host, NULL); error = scsi_add_host(host, NULL);
if (!error) if (error)
goto free_host;
scsi_scan_host(host); scsi_scan_host(host);
return 0;
free_host:
scsi_host_put(host);
return error; return error;
} }
......
...@@ -427,15 +427,10 @@ static inline void fcp_scsi_receive(fc_channel *fc, int token, int status, fc_hd ...@@ -427,15 +427,10 @@ static inline void fcp_scsi_receive(fc_channel *fc, int token, int status, fc_hd
memcpy(SCpnt->sense_buffer, ((char *)(rsp+1)), sense_len); memcpy(SCpnt->sense_buffer, ((char *)(rsp+1)), sense_len);
} }
if (fcmd->data) { if (fcmd->data)
if (SCpnt->use_sg) dma_unmap_sg(fc->dev, scsi_sglist(SCpnt),
dma_unmap_sg(fc->dev, (struct scatterlist *)SCpnt->request_buffer, scsi_sg_count(SCpnt),
SCpnt->use_sg,
SCpnt->sc_data_direction); SCpnt->sc_data_direction);
else
dma_unmap_single(fc->dev, fcmd->data, SCpnt->request_bufflen,
SCpnt->sc_data_direction);
}
break; break;
default: default:
host_status=DID_ERROR; /* FIXME */ host_status=DID_ERROR; /* FIXME */
...@@ -793,10 +788,14 @@ static int fcp_scsi_queue_it(fc_channel *fc, struct scsi_cmnd *SCpnt, ...@@ -793,10 +788,14 @@ static int fcp_scsi_queue_it(fc_channel *fc, struct scsi_cmnd *SCpnt,
fcp_cntl = FCP_CNTL_QTYPE_SIMPLE; fcp_cntl = FCP_CNTL_QTYPE_SIMPLE;
} else } else
fcp_cntl = FCP_CNTL_QTYPE_UNTAGGED; fcp_cntl = FCP_CNTL_QTYPE_UNTAGGED;
if (!SCpnt->request_bufflen && !SCpnt->use_sg) {
if (!scsi_bufflen(SCpnt)) {
cmd->fcp_cntl = fcp_cntl; cmd->fcp_cntl = fcp_cntl;
fcmd->data = (dma_addr_t)NULL; fcmd->data = (dma_addr_t)NULL;
} else { } else {
struct scatterlist *sg;
int nents;
switch (SCpnt->cmnd[0]) { switch (SCpnt->cmnd[0]) {
case WRITE_6: case WRITE_6:
case WRITE_10: case WRITE_10:
...@@ -805,23 +804,13 @@ static int fcp_scsi_queue_it(fc_channel *fc, struct scsi_cmnd *SCpnt, ...@@ -805,23 +804,13 @@ static int fcp_scsi_queue_it(fc_channel *fc, struct scsi_cmnd *SCpnt,
default: default:
cmd->fcp_cntl = (FCP_CNTL_READ | fcp_cntl); break; cmd->fcp_cntl = (FCP_CNTL_READ | fcp_cntl); break;
} }
if (!SCpnt->use_sg) {
cmd->fcp_data_len = SCpnt->request_bufflen;
fcmd->data = dma_map_single (fc->dev, (char *)SCpnt->request_buffer,
SCpnt->request_bufflen,
SCpnt->sc_data_direction);
} else {
struct scatterlist *sg = (struct scatterlist *)SCpnt->request_buffer;
int nents;
FCD(("XXX: Use_sg %d %d\n", SCpnt->use_sg, sg->length)) sg = scsi_sglist(SCpnt);
nents = dma_map_sg (fc->dev, sg, SCpnt->use_sg, nents = dma_map_sg(fc->dev, sg, scsi_sg_count(SCpnt),
SCpnt->sc_data_direction); SCpnt->sc_data_direction);
if (nents > 1) printk ("%s: SG for nents %d (use_sg %d) not handled yet\n", fc->name, nents, SCpnt->use_sg);
fcmd->data = sg_dma_address(sg); fcmd->data = sg_dma_address(sg);
cmd->fcp_data_len = sg_dma_len(sg); cmd->fcp_data_len = sg_dma_len(sg);
} }
}
memcpy (cmd->fcp_cdb, SCpnt->cmnd, SCpnt->cmd_len); memcpy (cmd->fcp_cdb, SCpnt->cmnd, SCpnt->cmd_len);
memset (cmd->fcp_cdb+SCpnt->cmd_len, 0, sizeof(cmd->fcp_cdb)-SCpnt->cmd_len); memset (cmd->fcp_cdb+SCpnt->cmd_len, 0, sizeof(cmd->fcp_cdb)-SCpnt->cmd_len);
FCD(("XXX: %04x.%04x.%04x.%04x - %08x%08x%08x\n", cmd->fcp_addr[0], cmd->fcp_addr[1], cmd->fcp_addr[2], cmd->fcp_addr[3], *(u32 *)SCpnt->cmnd, *(u32 *)(SCpnt->cmnd+4), *(u32 *)(SCpnt->cmnd+8))) FCD(("XXX: %04x.%04x.%04x.%04x - %08x%08x%08x\n", cmd->fcp_addr[0], cmd->fcp_addr[1], cmd->fcp_addr[2], cmd->fcp_addr[3], *(u32 *)SCpnt->cmnd, *(u32 *)(SCpnt->cmnd+4), *(u32 *)(SCpnt->cmnd+8)))
......
config INFINIBAND_SRP config INFINIBAND_SRP
tristate "InfiniBand SCSI RDMA Protocol" tristate "InfiniBand SCSI RDMA Protocol"
depends on SCSI depends on SCSI
select SCSI_SRP_ATTRS
---help--- ---help---
Support for the SCSI RDMA Protocol over InfiniBand. This Support for the SCSI RDMA Protocol over InfiniBand. This
allows you to access storage devices that speak SRP over allows you to access storage devices that speak SRP over
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include <scsi/scsi_device.h> #include <scsi/scsi_device.h>
#include <scsi/scsi_dbg.h> #include <scsi/scsi_dbg.h>
#include <scsi/srp.h> #include <scsi/srp.h>
#include <scsi/scsi_transport_srp.h>
#include <rdma/ib_cache.h> #include <rdma/ib_cache.h>
...@@ -86,6 +87,8 @@ static void srp_remove_one(struct ib_device *device); ...@@ -86,6 +87,8 @@ static void srp_remove_one(struct ib_device *device);
static void srp_completion(struct ib_cq *cq, void *target_ptr); static void srp_completion(struct ib_cq *cq, void *target_ptr);
static int srp_cm_handler(struct ib_cm_id *cm_id, struct ib_cm_event *event); static int srp_cm_handler(struct ib_cm_id *cm_id, struct ib_cm_event *event);
static struct scsi_transport_template *ib_srp_transport_template;
static struct ib_client srp_client = { static struct ib_client srp_client = {
.name = "srp", .name = "srp",
.add = srp_add_one, .add = srp_add_one,
...@@ -420,6 +423,7 @@ static void srp_remove_work(struct work_struct *work) ...@@ -420,6 +423,7 @@ static void srp_remove_work(struct work_struct *work)
list_del(&target->list); list_del(&target->list);
spin_unlock(&target->srp_host->target_lock); spin_unlock(&target->srp_host->target_lock);
srp_remove_host(target->scsi_host);
scsi_remove_host(target->scsi_host); scsi_remove_host(target->scsi_host);
ib_destroy_cm_id(target->cm_id); ib_destroy_cm_id(target->cm_id);
srp_free_target_ib(target); srp_free_target_ib(target);
...@@ -1544,12 +1548,24 @@ static struct scsi_host_template srp_template = { ...@@ -1544,12 +1548,24 @@ static struct scsi_host_template srp_template = {
static int srp_add_target(struct srp_host *host, struct srp_target_port *target) static int srp_add_target(struct srp_host *host, struct srp_target_port *target)
{ {
struct srp_rport_identifiers ids;
struct srp_rport *rport;
sprintf(target->target_name, "SRP.T10:%016llX", sprintf(target->target_name, "SRP.T10:%016llX",
(unsigned long long) be64_to_cpu(target->id_ext)); (unsigned long long) be64_to_cpu(target->id_ext));
if (scsi_add_host(target->scsi_host, host->dev->dev->dma_device)) if (scsi_add_host(target->scsi_host, host->dev->dev->dma_device))
return -ENODEV; return -ENODEV;
memcpy(ids.port_id, &target->id_ext, 8);
memcpy(ids.port_id + 8, &target->ioc_guid, 8);
ids.roles = SRP_RPORT_ROLE_TARGET;
rport = srp_rport_add(target->scsi_host, &ids);
if (IS_ERR(rport)) {
scsi_remove_host(target->scsi_host);
return PTR_ERR(rport);
}
spin_lock(&host->target_lock); spin_lock(&host->target_lock);
list_add_tail(&target->list, &host->target_list); list_add_tail(&target->list, &host->target_list);
spin_unlock(&host->target_lock); spin_unlock(&host->target_lock);
...@@ -1775,6 +1791,7 @@ static ssize_t srp_create_target(struct class_device *class_dev, ...@@ -1775,6 +1791,7 @@ static ssize_t srp_create_target(struct class_device *class_dev,
if (!target_host) if (!target_host)
return -ENOMEM; return -ENOMEM;
target_host->transportt = ib_srp_transport_template;
target_host->max_lun = SRP_MAX_LUN; target_host->max_lun = SRP_MAX_LUN;
target_host->max_cmd_len = sizeof ((struct srp_cmd *) (void *) 0L)->cdb; target_host->max_cmd_len = sizeof ((struct srp_cmd *) (void *) 0L)->cdb;
...@@ -2054,10 +2071,18 @@ static void srp_remove_one(struct ib_device *device) ...@@ -2054,10 +2071,18 @@ static void srp_remove_one(struct ib_device *device)
kfree(srp_dev); kfree(srp_dev);
} }
static struct srp_function_template ib_srp_transport_functions = {
};
static int __init srp_init_module(void) static int __init srp_init_module(void)
{ {
int ret; int ret;
ib_srp_transport_template =
srp_attach_transport(&ib_srp_transport_functions);
if (!ib_srp_transport_template)
return -ENOMEM;
srp_template.sg_tablesize = srp_sg_tablesize; srp_template.sg_tablesize = srp_sg_tablesize;
srp_max_iu_len = (sizeof (struct srp_cmd) + srp_max_iu_len = (sizeof (struct srp_cmd) +
sizeof (struct srp_indirect_buf) + sizeof (struct srp_indirect_buf) +
...@@ -2066,6 +2091,7 @@ static int __init srp_init_module(void) ...@@ -2066,6 +2091,7 @@ static int __init srp_init_module(void)
ret = class_register(&srp_class); ret = class_register(&srp_class);
if (ret) { if (ret) {
printk(KERN_ERR PFX "couldn't register class infiniband_srp\n"); printk(KERN_ERR PFX "couldn't register class infiniband_srp\n");
srp_release_transport(ib_srp_transport_template);
return ret; return ret;
} }
...@@ -2074,6 +2100,7 @@ static int __init srp_init_module(void) ...@@ -2074,6 +2100,7 @@ static int __init srp_init_module(void)
ret = ib_register_client(&srp_client); ret = ib_register_client(&srp_client);
if (ret) { if (ret) {
printk(KERN_ERR PFX "couldn't register IB client\n"); printk(KERN_ERR PFX "couldn't register IB client\n");
srp_release_transport(ib_srp_transport_template);
ib_sa_unregister_client(&srp_sa_client); ib_sa_unregister_client(&srp_sa_client);
class_unregister(&srp_class); class_unregister(&srp_class);
return ret; return ret;
...@@ -2087,6 +2114,7 @@ static void __exit srp_cleanup_module(void) ...@@ -2087,6 +2114,7 @@ static void __exit srp_cleanup_module(void)
ib_unregister_client(&srp_client); ib_unregister_client(&srp_client);
ib_sa_unregister_client(&srp_sa_client); ib_sa_unregister_client(&srp_sa_client);
class_unregister(&srp_class); class_unregister(&srp_class);
srp_release_transport(ib_srp_transport_template);
} }
module_init(srp_init_module); module_init(srp_init_module);
......
menu "Fusion MPT device support" menuconfig FUSION
bool "Fusion MPT device support"
depends on PCI depends on PCI
---help---
Say Y here to get to see options for Fusion Message
Passing Technology (MPT) drivers.
This option alone does not add any kernel code.
If you say N, all options in this submenu will be skipped and disabled.
config FUSION if FUSION
bool
default n
config FUSION_SPI config FUSION_SPI
tristate "Fusion MPT ScsiHost drivers for SPI" tristate "Fusion MPT ScsiHost drivers for SPI"
depends on PCI && SCSI depends on PCI && SCSI
select FUSION
select SCSI_SPI_ATTRS select SCSI_SPI_ATTRS
---help--- ---help---
SCSI HOST support for a parallel SCSI host adapters. SCSI HOST support for a parallel SCSI host adapters.
...@@ -20,11 +24,11 @@ config FUSION_SPI ...@@ -20,11 +24,11 @@ config FUSION_SPI
LSI53C1020A LSI53C1020A
LSI53C1030 LSI53C1030
LSI53C1035 LSI53C1035
ATTO UL4D
config FUSION_FC config FUSION_FC
tristate "Fusion MPT ScsiHost drivers for FC" tristate "Fusion MPT ScsiHost drivers for FC"
depends on PCI && SCSI depends on PCI && SCSI
select FUSION
select SCSI_FC_ATTRS select SCSI_FC_ATTRS
---help--- ---help---
SCSI HOST support for a Fiber Channel host adapters. SCSI HOST support for a Fiber Channel host adapters.
...@@ -37,12 +41,13 @@ config FUSION_FC ...@@ -37,12 +41,13 @@ config FUSION_FC
LSIFC929 LSIFC929
LSIFC929X LSIFC929X
LSIFC929XL LSIFC929XL
LSIFC949X
LSIFC949E
Brocade FC 410/420 Brocade FC 410/420
config FUSION_SAS config FUSION_SAS
tristate "Fusion MPT ScsiHost drivers for SAS" tristate "Fusion MPT ScsiHost drivers for SAS"
depends on PCI && SCSI depends on PCI && SCSI
select FUSION
select SCSI_SAS_ATTRS select SCSI_SAS_ATTRS
---help--- ---help---
SCSI HOST support for a SAS host adapters. SCSI HOST support for a SAS host adapters.
...@@ -53,10 +58,10 @@ config FUSION_SAS ...@@ -53,10 +58,10 @@ config FUSION_SAS
LSISAS1068 LSISAS1068
LSISAS1064E LSISAS1064E
LSISAS1068E LSISAS1068E
LSISAS1078
config FUSION_MAX_SGE config FUSION_MAX_SGE
int "Maximum number of scatter gather entries (16 - 128)" int "Maximum number of scatter gather entries (16 - 128)"
depends on FUSION
default "128" default "128"
range 16 128 range 16 128
help help
...@@ -104,7 +109,6 @@ config FUSION_LAN ...@@ -104,7 +109,6 @@ config FUSION_LAN
config FUSION_LOGGING config FUSION_LOGGING
bool "Fusion MPT logging facility" bool "Fusion MPT logging facility"
depends on FUSION
---help--- ---help---
This turns on a logging facility that can be used to debug a number This turns on a logging facility that can be used to debug a number
of Fusion MPT related problems. of Fusion MPT related problems.
...@@ -113,7 +117,7 @@ config FUSION_LOGGING ...@@ -113,7 +117,7 @@ config FUSION_LOGGING
echo [level] > /sys/class/scsi_host/host#/debug_level echo [level] > /sys/class/scsi_host/host#/debug_level
There are various debug levels that an be found in the source: There are various debug levels that can be found in the source:
file:drivers/message/fusion/mptdebug.h file:drivers/message/fusion/mptdebug.h
endmenu endif # FUSION
/* /*
* Copyright (c) 2000-2007 LSI Logic Corporation. * Copyright (c) 2000-2007 LSI Corporation.
* *
* *
* Name: mpi.h * Name: mpi.h
......
/* /*
* Copyright (c) 2000-2007 LSI Logic Corporation. * Copyright (c) 2000-2007 LSI Corporation.
* *
* *
* Name: mpi_cnfg.h * Name: mpi_cnfg.h
......
/* /*
* Copyright (c) 2000-2004 LSI Logic Corporation. * Copyright (c) 2000-2004 LSI Corporation.
* *
* *
* Name: mpi_fc.h * Name: mpi_fc.h
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
MPI Header File Change History MPI Header File Change History
============================== ==============================
Copyright (c) 2000-2007 LSI Logic Corporation. Copyright (c) 2000-2007 LSI Corporation.
--------------------------------------- ---------------------------------------
Header Set Release Version: 01.05.16 Header Set Release Version: 01.05.16
......
/* /*
* Copyright (c) 2000-2007 LSI Logic Corporation. * Copyright (c) 2000-2007 LSI Corporation.
* *
* *
* Name: mpi_init.h * Name: mpi_init.h
......
/* /*
* Copyright (c) 2000-2007 LSI Logic Corporation. * Copyright (c) 2000-2007 LSI Corporation.
* *
* *
* Name: mpi_ioc.h * Name: mpi_ioc.h
......
/* /*
* Copyright (c) 2000-2004 LSI Logic Corporation. * Copyright (c) 2000-2004 LSI Corporation.
* *
* *
* Name: mpi_lan.h * Name: mpi_lan.h
......
/* /*
* Copyright (c) 2000-2001 LSI Logic Corporation. All rights reserved. * Copyright (c) 2000-2001 LSI Corporation. All rights reserved.
* *
* NAME: fc_log.h * NAME: fc_log.h
* SUMMARY: MPI IocLogInfo definitions for the SYMFC9xx chips * SUMMARY: MPI IocLogInfo definitions for the SYMFC9xx chips
......
/*************************************************************************** /***************************************************************************
* * * *
* Copyright 2003 LSI Logic Corporation. All rights reserved. * * Copyright 2003 LSI Corporation. All rights reserved. *
* * * *
* Description * * Description *
* ------------ * * ------------ *
......
/* /*
* Copyright (c) 2001-2007 LSI Logic Corporation. * Copyright (c) 2001-2007 LSI Corporation.
* *
* *
* Name: mpi_raid.h * Name: mpi_raid.h
......
/* /*
* Copyright (c) 2004-2006 LSI Logic Corporation. * Copyright (c) 2004-2006 LSI Corporation.
* *
* *
* Name: mpi_sas.h * Name: mpi_sas.h
......
/* /*
* Copyright (c) 2000-2004 LSI Logic Corporation. * Copyright (c) 2000-2004 LSI Corporation.
* *
* *
* Name: mpi_targ.h * Name: mpi_targ.h
......
/* /*
* Copyright (c) 2001-2005 LSI Logic Corporation. * Copyright (c) 2001-2005 LSI Corporation.
* *
* *
* Name: mpi_tool.h * Name: mpi_tool.h
......
/* /*
* Copyright (c) 2000-2004 LSI Logic Corporation. * Copyright (c) 2000-2004 LSI Corporation.
* *
* *
* Name: mpi_type.h * Name: mpi_type.h
......
This diff is collapsed.
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
* High performance SCSI + LAN / Fibre Channel device drivers. * High performance SCSI + LAN / Fibre Channel device drivers.
* For use with PCI chip/adapter(s): * For use with PCI chip/adapter(s):
* LSIFC9xx/LSI409xx Fibre Channel * LSIFC9xx/LSI409xx Fibre Channel
* running LSI Logic Fusion MPT (Message Passing Technology) firmware. * running LSI Fusion MPT (Message Passing Technology) firmware.
* *
* Copyright (c) 1999-2007 LSI Logic Corporation * Copyright (c) 1999-2007 LSI Corporation
* (mailto:DL-MPTFusionLinux@lsi.com) * (mailto:DL-MPTFusionLinux@lsi.com)
* *
*/ */
...@@ -68,15 +68,15 @@ ...@@ -68,15 +68,15 @@
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
#ifndef MODULEAUTHOR #ifndef MODULEAUTHOR
#define MODULEAUTHOR "LSI Logic Corporation" #define MODULEAUTHOR "LSI Corporation"
#endif #endif
#ifndef COPYRIGHT #ifndef COPYRIGHT
#define COPYRIGHT "Copyright (c) 1999-2007 " MODULEAUTHOR #define COPYRIGHT "Copyright (c) 1999-2007 " MODULEAUTHOR
#endif #endif
#define MPT_LINUX_VERSION_COMMON "3.04.05" #define MPT_LINUX_VERSION_COMMON "3.04.06"
#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.04.05" #define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.04.06"
#define WHAT_MAGIC_STRING "@" "(" "#" ")" #define WHAT_MAGIC_STRING "@" "(" "#" ")"
#define show_mptmod_ver(s,ver) \ #define show_mptmod_ver(s,ver) \
...@@ -186,12 +186,42 @@ ...@@ -186,12 +186,42 @@
* MPT drivers. NOTE: Users of these macro defs must * MPT drivers. NOTE: Users of these macro defs must
* themselves define their own MYNAM. * themselves define their own MYNAM.
*/ */
#define MYIOC_s_FMT MYNAM ": %s: "
#define MYIOC_s_DEBUG_FMT KERN_DEBUG MYNAM ": %s: " #define MYIOC_s_DEBUG_FMT KERN_DEBUG MYNAM ": %s: "
#define MYIOC_s_INFO_FMT KERN_INFO MYNAM ": %s: " #define MYIOC_s_INFO_FMT KERN_INFO MYNAM ": %s: "
#define MYIOC_s_NOTE_FMT KERN_NOTICE MYNAM ": %s: " #define MYIOC_s_NOTE_FMT KERN_NOTICE MYNAM ": %s: "
#define MYIOC_s_WARN_FMT KERN_WARNING MYNAM ": %s: WARNING - " #define MYIOC_s_WARN_FMT KERN_WARNING MYNAM ": %s: WARNING - "
#define MYIOC_s_ERR_FMT KERN_ERR MYNAM ": %s: ERROR - " #define MYIOC_s_ERR_FMT KERN_ERR MYNAM ": %s: ERROR - "
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*
* ATTO UL4D associated structures and defines
*/
#define ATTOFLAG_DISC 0x0001
#define ATTOFLAG_TAGGED 0x0002
#define ATTOFLAG_WIDE_ENB 0x0008
#define ATTOFLAG_ID_ENB 0x0010
#define ATTOFLAG_LUN_ENB 0x0060
typedef struct _ATTO_DEVICE_INFO
{
u8 Offset; /* 00h */
u8 Period; /* 01h */
u16 ATTOFlags; /* 02h */
} ATTO_DEVICE_INFO, MPI_POINTER PTR_ATTO_DEVICE_INFO,
ATTODeviceInfo_t, MPI_POINTER pATTODeviceInfo_t;
typedef struct _ATTO_CONFIG_PAGE_SCSI_PORT_2
{
CONFIG_PAGE_HEADER Header; /* 00h */
u16 PortFlags; /* 04h */
u16 Unused1; /* 06h */
u32 Unused2; /* 08h */
ATTO_DEVICE_INFO DeviceSettings[16]; /* 0Ch */
} fATTO_CONFIG_PAGE_SCSI_PORT_2, MPI_POINTER PTR_ATTO_CONFIG_PAGE_SCSI_PORT_2,
ATTO_SCSIPortPage2_t, MPI_POINTER pATTO_SCSIPortPage2_t;
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/* /*
* MPT protocol driver defs... * MPT protocol driver defs...
...@@ -307,7 +337,8 @@ typedef struct _SYSIF_REGS ...@@ -307,7 +337,8 @@ typedef struct _SYSIF_REGS
u32 Reserved2[2]; /* 38-3F reserved for future use */ u32 Reserved2[2]; /* 38-3F reserved for future use */
u32 RequestFifo; /* 40 Request Post/Free FIFO */ u32 RequestFifo; /* 40 Request Post/Free FIFO */
u32 ReplyFifo; /* 44 Reply Post/Free FIFO */ u32 ReplyFifo; /* 44 Reply Post/Free FIFO */
u32 Reserved3[2]; /* 48-4F reserved for future use */ u32 RequestHiPriFifo; /* 48 Hi Priority Request FIFO */
u32 Reserved3; /* 4C-4F reserved for future use */
u32 HostIndex; /* 50 Host Index register */ u32 HostIndex; /* 50 Host Index register */
u32 Reserved4[15]; /* 54-8F */ u32 Reserved4[15]; /* 54-8F */
u32 Fubar; /* 90 For Fubar usage */ u32 Fubar; /* 90 For Fubar usage */
...@@ -649,9 +680,9 @@ typedef struct _MPT_ADAPTER ...@@ -649,9 +680,9 @@ typedef struct _MPT_ADAPTER
u8 reload_fw; /* Force a FW Reload on next reset */ u8 reload_fw; /* Force a FW Reload on next reset */
u8 NBShiftFactor; /* NB Shift Factor based on Block Size (Facts) */ u8 NBShiftFactor; /* NB Shift Factor based on Block Size (Facts) */
u8 pad1[4]; u8 pad1[4];
int DoneCtx; u8 DoneCtx;
int TaskCtx; u8 TaskCtx;
int InternalCtx; u8 InternalCtx;
spinlock_t initializing_hba_lock; spinlock_t initializing_hba_lock;
int initializing_hba_lock_flag; int initializing_hba_lock_flag;
struct list_head list; struct list_head list;
...@@ -668,10 +699,14 @@ typedef struct _MPT_ADAPTER ...@@ -668,10 +699,14 @@ typedef struct _MPT_ADAPTER
struct work_struct fc_setup_reset_work; struct work_struct fc_setup_reset_work;
struct list_head fc_rports; struct list_head fc_rports;
struct work_struct fc_lsc_work;
u8 fc_link_speed[2];
spinlock_t fc_rescan_work_lock; spinlock_t fc_rescan_work_lock;
struct work_struct fc_rescan_work; struct work_struct fc_rescan_work;
char fc_rescan_work_q_name[KOBJ_NAME_LEN]; char fc_rescan_work_q_name[KOBJ_NAME_LEN];
struct workqueue_struct *fc_rescan_work_q; struct workqueue_struct *fc_rescan_work_q;
struct scsi_cmnd **ScsiLookup;
spinlock_t scsi_lookup_lock;
} MPT_ADAPTER; } MPT_ADAPTER;
/* /*
...@@ -785,7 +820,6 @@ typedef struct _MPT_SCSI_HOST { ...@@ -785,7 +820,6 @@ typedef struct _MPT_SCSI_HOST {
MPT_ADAPTER *ioc; MPT_ADAPTER *ioc;
int port; int port;
u32 pad0; u32 pad0;
struct scsi_cmnd **ScsiLookup;
MPT_LOCAL_REPLY *pLocal; /* used for internal commands */ MPT_LOCAL_REPLY *pLocal; /* used for internal commands */
struct timer_list timer; struct timer_list timer;
/* Pool of memory for holding SCpnts before doing /* Pool of memory for holding SCpnts before doing
...@@ -853,20 +887,21 @@ extern void mpt_detach(struct pci_dev *pdev); ...@@ -853,20 +887,21 @@ extern void mpt_detach(struct pci_dev *pdev);
extern int mpt_suspend(struct pci_dev *pdev, pm_message_t state); extern int mpt_suspend(struct pci_dev *pdev, pm_message_t state);
extern int mpt_resume(struct pci_dev *pdev); extern int mpt_resume(struct pci_dev *pdev);
#endif #endif
extern int mpt_register(MPT_CALLBACK cbfunc, MPT_DRIVER_CLASS dclass); extern u8 mpt_register(MPT_CALLBACK cbfunc, MPT_DRIVER_CLASS dclass);
extern void mpt_deregister(int cb_idx); extern void mpt_deregister(u8 cb_idx);
extern int mpt_event_register(int cb_idx, MPT_EVHANDLER ev_cbfunc); extern int mpt_event_register(u8 cb_idx, MPT_EVHANDLER ev_cbfunc);
extern void mpt_event_deregister(int cb_idx); extern void mpt_event_deregister(u8 cb_idx);
extern int mpt_reset_register(int cb_idx, MPT_RESETHANDLER reset_func); extern int mpt_reset_register(u8 cb_idx, MPT_RESETHANDLER reset_func);
extern void mpt_reset_deregister(int cb_idx); extern void mpt_reset_deregister(u8 cb_idx);
extern int mpt_device_driver_register(struct mpt_pci_driver * dd_cbfunc, int cb_idx); extern int mpt_device_driver_register(struct mpt_pci_driver * dd_cbfunc, u8 cb_idx);
extern void mpt_device_driver_deregister(int cb_idx); extern void mpt_device_driver_deregister(u8 cb_idx);
extern MPT_FRAME_HDR *mpt_get_msg_frame(int handle, MPT_ADAPTER *ioc); extern MPT_FRAME_HDR *mpt_get_msg_frame(u8 cb_idx, MPT_ADAPTER *ioc);
extern void mpt_free_msg_frame(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf); extern void mpt_free_msg_frame(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf);
extern void mpt_put_msg_frame(int handle, MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf); extern void mpt_put_msg_frame(u8 cb_idx, MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf);
extern void mpt_put_msg_frame_hi_pri(u8 cb_idx, MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf);
extern void mpt_add_sge(char *pAddr, u32 flagslength, dma_addr_t dma_addr); extern void mpt_add_sge(char *pAddr, u32 flagslength, dma_addr_t dma_addr);
extern int mpt_send_handshake_request(int handle, MPT_ADAPTER *ioc, int reqBytes, u32 *req, int sleepFlag); extern int mpt_send_handshake_request(u8 cb_idx, MPT_ADAPTER *ioc, int reqBytes, u32 *req, int sleepFlag);
extern int mpt_verify_adapter(int iocid, MPT_ADAPTER **iocpp); extern int mpt_verify_adapter(int iocid, MPT_ADAPTER **iocpp);
extern u32 mpt_GetIocState(MPT_ADAPTER *ioc, int cooked); extern u32 mpt_GetIocState(MPT_ADAPTER *ioc, int cooked);
extern void mpt_print_ioc_summary(MPT_ADAPTER *ioc, char *buf, int *size, int len, int showlan); extern void mpt_print_ioc_summary(MPT_ADAPTER *ioc, char *buf, int *size, int len, int showlan);
...@@ -884,9 +919,6 @@ extern int mpt_raid_phys_disk_pg0(MPT_ADAPTER *ioc, u8 phys_disk_num, pRaidPhys ...@@ -884,9 +919,6 @@ extern int mpt_raid_phys_disk_pg0(MPT_ADAPTER *ioc, u8 phys_disk_num, pRaidPhys
extern struct list_head ioc_list; extern struct list_head ioc_list;
extern struct proc_dir_entry *mpt_proc_root_dir; extern struct proc_dir_entry *mpt_proc_root_dir;
extern int mpt_lan_index; /* needed by mptlan.c */
extern int mpt_stm_index; /* needed by mptstm.c */
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
#endif /* } __KERNEL__ */ #endif /* } __KERNEL__ */
......
This diff is collapsed.
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
* Fusion MPT misc device (ioctl) driver. * Fusion MPT misc device (ioctl) driver.
* For use with PCI chip/adapter(s): * For use with PCI chip/adapter(s):
* LSIFC9xx/LSI409xx Fibre Channel * LSIFC9xx/LSI409xx Fibre Channel
* running LSI Logic Fusion MPT (Message Passing Technology) firmware. * running LSI Fusion MPT (Message Passing Technology) firmware.
* *
* Copyright (c) 1999-2007 LSI Logic Corporation * Copyright (c) 1999-2007 LSI Corporation
* (mailto:DL-MPTFusionLinux@lsi.com) * (mailto:DL-MPTFusionLinux@lsi.com)
* *
*/ */
......
/* /*
* linux/drivers/message/fusion/mptfc.c * linux/drivers/message/fusion/mptfc.c
* For use with LSI Logic PCI chip/adapter(s) * For use with LSI PCI chip/adapter(s)
* running LSI Logic Fusion MPT (Message Passing Technology) firmware. * running LSI Fusion MPT (Message Passing Technology) firmware.
* *
* Copyright (c) 1999-2007 LSI Logic Corporation * Copyright (c) 1999-2007 LSI Corporation
* (mailto:DL-MPTFusionLinux@lsi.com) * (mailto:DL-MPTFusionLinux@lsi.com)
* *
*/ */
...@@ -90,9 +90,9 @@ static int max_lun = MPTFC_MAX_LUN; ...@@ -90,9 +90,9 @@ static int max_lun = MPTFC_MAX_LUN;
module_param(max_lun, int, 0); module_param(max_lun, int, 0);
MODULE_PARM_DESC(max_lun, " max lun, default=16895 "); MODULE_PARM_DESC(max_lun, " max lun, default=16895 ");
static int mptfcDoneCtx = -1; static u8 mptfcDoneCtx = MPT_MAX_PROTOCOL_DRIVERS;
static int mptfcTaskCtx = -1; static u8 mptfcTaskCtx = MPT_MAX_PROTOCOL_DRIVERS;
static int mptfcInternalCtx = -1; /* Used only for internal commands */ static u8 mptfcInternalCtx = MPT_MAX_PROTOCOL_DRIVERS;
static int mptfc_target_alloc(struct scsi_target *starget); static int mptfc_target_alloc(struct scsi_target *starget);
static int mptfc_slave_alloc(struct scsi_device *sdev); static int mptfc_slave_alloc(struct scsi_device *sdev);
...@@ -194,37 +194,36 @@ mptfc_block_error_handler(struct scsi_cmnd *SCpnt, ...@@ -194,37 +194,36 @@ mptfc_block_error_handler(struct scsi_cmnd *SCpnt,
struct fc_rport *rport = starget_to_rport(scsi_target(sdev)); struct fc_rport *rport = starget_to_rport(scsi_target(sdev));
unsigned long flags; unsigned long flags;
int ready; int ready;
MPT_ADAPTER *ioc;
hd = (MPT_SCSI_HOST *) SCpnt->device->host->hostdata; hd = shost_priv(SCpnt->device->host);
ioc = hd->ioc;
spin_lock_irqsave(shost->host_lock, flags); spin_lock_irqsave(shost->host_lock, flags);
while ((ready = fc_remote_port_chkready(rport) >> 16) == DID_IMM_RETRY) { while ((ready = fc_remote_port_chkready(rport) >> 16) == DID_IMM_RETRY) {
spin_unlock_irqrestore(shost->host_lock, flags); spin_unlock_irqrestore(shost->host_lock, flags);
dfcprintk (hd->ioc, printk(MYIOC_s_DEBUG_FMT dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT
"mptfc_block_error_handler.%d: %d:%d, port status is " "mptfc_block_error_handler.%d: %d:%d, port status is "
"DID_IMM_RETRY, deferring %s recovery.\n", "DID_IMM_RETRY, deferring %s recovery.\n",
((MPT_SCSI_HOST *) shost->hostdata)->ioc->name, ioc->name, ioc->sh->host_no,
((MPT_SCSI_HOST *) shost->hostdata)->ioc->sh->host_no, SCpnt->device->id, SCpnt->device->lun, caller));
SCpnt->device->id,SCpnt->device->lun,caller));
msleep(1000); msleep(1000);
spin_lock_irqsave(shost->host_lock, flags); spin_lock_irqsave(shost->host_lock, flags);
} }
spin_unlock_irqrestore(shost->host_lock, flags); spin_unlock_irqrestore(shost->host_lock, flags);
if (ready == DID_NO_CONNECT || !SCpnt->device->hostdata) { if (ready == DID_NO_CONNECT || !SCpnt->device->hostdata) {
dfcprintk (hd->ioc, printk(MYIOC_s_DEBUG_FMT dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT
"%s.%d: %d:%d, failing recovery, " "%s.%d: %d:%d, failing recovery, "
"port state %d, vdev %p.\n", caller, "port state %d, vdevice %p.\n", caller,
((MPT_SCSI_HOST *) shost->hostdata)->ioc->name, ioc->name, ioc->sh->host_no,
((MPT_SCSI_HOST *) shost->hostdata)->ioc->sh->host_no, SCpnt->device->id, SCpnt->device->lun, ready,
SCpnt->device->id,SCpnt->device->lun,ready,
SCpnt->device->hostdata)); SCpnt->device->hostdata));
return FAILED; return FAILED;
} }
dfcprintk (hd->ioc, printk(MYIOC_s_DEBUG_FMT dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT
"%s.%d: %d:%d, executing recovery.\n", caller, "%s.%d: %d:%d, executing recovery.\n", caller,
((MPT_SCSI_HOST *) shost->hostdata)->ioc->name, ioc->name, ioc->sh->host_no,
((MPT_SCSI_HOST *) shost->hostdata)->ioc->sh->host_no, SCpnt->device->id, SCpnt->device->lun));
SCpnt->device->id,SCpnt->device->lun));
return (*func)(SCpnt); return (*func)(SCpnt);
} }
...@@ -470,7 +469,7 @@ mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0) ...@@ -470,7 +469,7 @@ mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0)
/* /*
* if already mapped, remap here. If not mapped, * if already mapped, remap here. If not mapped,
* target_alloc will allocate vtarget and map, * target_alloc will allocate vtarget and map,
* slave_alloc will fill in vdev from vtarget. * slave_alloc will fill in vdevice from vtarget.
*/ */
if (ri->starget) { if (ri->starget) {
vtarget = ri->starget->hostdata; vtarget = ri->starget->hostdata;
...@@ -602,10 +601,10 @@ mptfc_slave_alloc(struct scsi_device *sdev) ...@@ -602,10 +601,10 @@ mptfc_slave_alloc(struct scsi_device *sdev)
{ {
MPT_SCSI_HOST *hd; MPT_SCSI_HOST *hd;
VirtTarget *vtarget; VirtTarget *vtarget;
VirtDevice *vdev; VirtDevice *vdevice;
struct scsi_target *starget; struct scsi_target *starget;
struct fc_rport *rport; struct fc_rport *rport;
MPT_ADAPTER *ioc;
starget = scsi_target(sdev); starget = scsi_target(sdev);
rport = starget_to_rport(starget); rport = starget_to_rport(starget);
...@@ -613,31 +612,32 @@ mptfc_slave_alloc(struct scsi_device *sdev) ...@@ -613,31 +612,32 @@ mptfc_slave_alloc(struct scsi_device *sdev)
if (!rport || fc_remote_port_chkready(rport)) if (!rport || fc_remote_port_chkready(rport))
return -ENXIO; return -ENXIO;
hd = (MPT_SCSI_HOST *)sdev->host->hostdata; hd = shost_priv(sdev->host);
ioc = hd->ioc;
vdev = kzalloc(sizeof(VirtDevice), GFP_KERNEL); vdevice = kzalloc(sizeof(VirtDevice), GFP_KERNEL);
if (!vdev) { if (!vdevice) {
printk(MYIOC_s_ERR_FMT "slave_alloc kmalloc(%zd) FAILED!\n", printk(MYIOC_s_ERR_FMT "slave_alloc kmalloc(%zd) FAILED!\n",
hd->ioc->name, sizeof(VirtDevice)); ioc->name, sizeof(VirtDevice));
return -ENOMEM; return -ENOMEM;
} }
sdev->hostdata = vdev; sdev->hostdata = vdevice;
vtarget = starget->hostdata; vtarget = starget->hostdata;
if (vtarget->num_luns == 0) { if (vtarget->num_luns == 0) {
vtarget->ioc_id = hd->ioc->id; vtarget->ioc_id = ioc->id;
vtarget->tflags = MPT_TARGET_FLAGS_Q_YES; vtarget->tflags = MPT_TARGET_FLAGS_Q_YES;
} }
vdev->vtarget = vtarget; vdevice->vtarget = vtarget;
vdev->lun = sdev->lun; vdevice->lun = sdev->lun;
vtarget->num_luns++; vtarget->num_luns++;
mptfc_dump_lun_info(hd->ioc, rport, sdev, vtarget); mptfc_dump_lun_info(ioc, rport, sdev, vtarget);
return 0; return 0;
} }
...@@ -648,9 +648,9 @@ mptfc_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) ...@@ -648,9 +648,9 @@ mptfc_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
struct mptfc_rport_info *ri; struct mptfc_rport_info *ri;
struct fc_rport *rport = starget_to_rport(scsi_target(SCpnt->device)); struct fc_rport *rport = starget_to_rport(scsi_target(SCpnt->device));
int err; int err;
VirtDevice *vdev = SCpnt->device->hostdata; VirtDevice *vdevice = SCpnt->device->hostdata;
if (!vdev || !vdev->vtarget) { if (!vdevice || !vdevice->vtarget) {
SCpnt->result = DID_NO_CONNECT << 16; SCpnt->result = DID_NO_CONNECT << 16;
done(SCpnt); done(SCpnt);
return 0; return 0;
...@@ -674,6 +674,50 @@ mptfc_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) ...@@ -674,6 +674,50 @@ mptfc_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
return mptscsih_qcmd(SCpnt,done); return mptscsih_qcmd(SCpnt,done);
} }
/*
* mptfc_display_port_link_speed - displaying link speed
* @ioc: Pointer to MPT_ADAPTER structure
* @portnum: IOC Port number
* @pp0dest: port page0 data payload
*
*/
static void
mptfc_display_port_link_speed(MPT_ADAPTER *ioc, int portnum, FCPortPage0_t *pp0dest)
{
u8 old_speed, new_speed, state;
char *old, *new;
if (portnum >= 2)
return;
old_speed = ioc->fc_link_speed[portnum];
new_speed = pp0dest->CurrentSpeed;
state = pp0dest->PortState;
if (state != MPI_FCPORTPAGE0_PORTSTATE_OFFLINE &&
new_speed != MPI_FCPORTPAGE0_CURRENT_SPEED_UKNOWN) {
old = old_speed == MPI_FCPORTPAGE0_CURRENT_SPEED_1GBIT ? "1 Gbps" :
old_speed == MPI_FCPORTPAGE0_CURRENT_SPEED_2GBIT ? "2 Gbps" :
old_speed == MPI_FCPORTPAGE0_CURRENT_SPEED_4GBIT ? "4 Gbps" :
"Unknown";
new = new_speed == MPI_FCPORTPAGE0_CURRENT_SPEED_1GBIT ? "1 Gbps" :
new_speed == MPI_FCPORTPAGE0_CURRENT_SPEED_2GBIT ? "2 Gbps" :
new_speed == MPI_FCPORTPAGE0_CURRENT_SPEED_4GBIT ? "4 Gbps" :
"Unknown";
if (old_speed == 0)
printk(MYIOC_s_NOTE_FMT
"FC Link Established, Speed = %s\n",
ioc->name, new);
else if (old_speed != new_speed)
printk(MYIOC_s_WARN_FMT
"FC Link Speed Change, Old Speed = %s, New Speed = %s\n",
ioc->name, old, new);
ioc->fc_link_speed[portnum] = new_speed;
}
}
/* /*
* mptfc_GetFcPortPage0 - Fetch FCPort config Page0. * mptfc_GetFcPortPage0 - Fetch FCPort config Page0.
* @ioc: Pointer to MPT_ADAPTER structure * @ioc: Pointer to MPT_ADAPTER structure
...@@ -773,6 +817,7 @@ mptfc_GetFcPortPage0(MPT_ADAPTER *ioc, int portnum) ...@@ -773,6 +817,7 @@ mptfc_GetFcPortPage0(MPT_ADAPTER *ioc, int portnum)
" complete.\n", " complete.\n",
ioc->name); ioc->name);
} }
mptfc_display_port_link_speed(ioc, portnum, pp0dest);
} }
pci_free_consistent(ioc->pcidev, data_sz, (u8 *) ppage0_alloc, page0_dma); pci_free_consistent(ioc->pcidev, data_sz, (u8 *) ppage0_alloc, page0_dma);
...@@ -1022,6 +1067,18 @@ mptfc_init_host_attr(MPT_ADAPTER *ioc,int portnum) ...@@ -1022,6 +1067,18 @@ mptfc_init_host_attr(MPT_ADAPTER *ioc,int portnum)
} }
static void
mptfc_link_status_change(struct work_struct *work)
{
MPT_ADAPTER *ioc =
container_of(work, MPT_ADAPTER, fc_rescan_work);
int ii;
for (ii=0; ii < ioc->facts.NumberOfPorts; ii++)
(void) mptfc_GetFcPortPage0(ioc, ii);
}
static void static void
mptfc_setup_reset(struct work_struct *work) mptfc_setup_reset(struct work_struct *work)
{ {
...@@ -1163,6 +1220,7 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -1163,6 +1220,7 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
spin_lock_init(&ioc->fc_rescan_work_lock); spin_lock_init(&ioc->fc_rescan_work_lock);
INIT_WORK(&ioc->fc_rescan_work, mptfc_rescan_devices); INIT_WORK(&ioc->fc_rescan_work, mptfc_rescan_devices);
INIT_WORK(&ioc->fc_setup_reset_work, mptfc_setup_reset); INIT_WORK(&ioc->fc_setup_reset_work, mptfc_setup_reset);
INIT_WORK(&ioc->fc_lsc_work, mptfc_link_status_change);
spin_lock_irqsave(&ioc->FreeQlock, flags); spin_lock_irqsave(&ioc->FreeQlock, flags);
...@@ -1218,20 +1276,21 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -1218,20 +1276,21 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
spin_unlock_irqrestore(&ioc->FreeQlock, flags); spin_unlock_irqrestore(&ioc->FreeQlock, flags);
hd = (MPT_SCSI_HOST *) sh->hostdata; hd = shost_priv(sh);
hd->ioc = ioc; hd->ioc = ioc;
/* SCSI needs scsi_cmnd lookup table! /* SCSI needs scsi_cmnd lookup table!
* (with size equal to req_depth*PtrSz!) * (with size equal to req_depth*PtrSz!)
*/ */
hd->ScsiLookup = kcalloc(ioc->req_depth, sizeof(void *), GFP_ATOMIC); ioc->ScsiLookup = kcalloc(ioc->req_depth, sizeof(void *), GFP_ATOMIC);
if (!hd->ScsiLookup) { if (!ioc->ScsiLookup) {
error = -ENOMEM; error = -ENOMEM;
goto out_mptfc_probe; goto out_mptfc_probe;
} }
spin_lock_init(&ioc->scsi_lookup_lock);
dprintk(ioc, printk(MYIOC_s_DEBUG_FMT "ScsiLookup @ %p\n", dprintk(ioc, printk(MYIOC_s_DEBUG_FMT "ScsiLookup @ %p\n",
ioc->name, hd->ScsiLookup)); ioc->name, ioc->ScsiLookup));
/* Clear the TM flags /* Clear the TM flags
*/ */
...@@ -1262,8 +1321,8 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -1262,8 +1321,8 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
sh->transportt = mptfc_transport_template; sh->transportt = mptfc_transport_template;
error = scsi_add_host (sh, &ioc->pcidev->dev); error = scsi_add_host (sh, &ioc->pcidev->dev);
if(error) { if(error) {
dprintk(ioc, printk(KERN_ERR MYNAM dprintk(ioc, printk(MYIOC_s_ERR_FMT
"scsi_add_host failed\n")); "scsi_add_host failed\n", ioc->name));
goto out_mptfc_probe; goto out_mptfc_probe;
} }
...@@ -1325,7 +1384,7 @@ mptfc_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply) ...@@ -1325,7 +1384,7 @@ mptfc_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply)
ioc->name, event)); ioc->name, event));
if (ioc->sh == NULL || if (ioc->sh == NULL ||
((hd = (MPT_SCSI_HOST *)ioc->sh->hostdata) == NULL)) ((hd = shost_priv(ioc->sh)) == NULL))
return 1; return 1;
switch (event) { switch (event) {
...@@ -1337,6 +1396,14 @@ mptfc_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply) ...@@ -1337,6 +1396,14 @@ mptfc_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply)
} }
spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags); spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags);
break; break;
case MPI_EVENT_LINK_STATUS_CHANGE:
spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags);
if (ioc->fc_rescan_work_q) {
queue_work(ioc->fc_rescan_work_q,
&ioc->fc_lsc_work);
}
spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags);
break;
default: default:
rc = mptscsih_event_process(ioc,pEvReply); rc = mptscsih_event_process(ioc,pEvReply);
break; break;
......
/* /*
* linux/drivers/message/fusion/mptlan.c * linux/drivers/message/fusion/mptlan.c
* IP Over Fibre Channel device driver. * IP Over Fibre Channel device driver.
* For use with LSI Logic Fibre Channel PCI chip/adapters * For use with LSI Fibre Channel PCI chip/adapters
* running LSI Logic Fusion MPT (Message Passing Technology) firmware. * running LSI Fusion MPT (Message Passing Technology) firmware.
* *
* Copyright (c) 2000-2007 LSI Logic Corporation * Copyright (c) 2000-2007 LSI Corporation
* (mailto:DL-MPTFusionLinux@lsi.com) * (mailto:DL-MPTFusionLinux@lsi.com)
* *
*/ */
...@@ -154,7 +154,7 @@ static unsigned short mpt_lan_type_trans(struct sk_buff *skb, ...@@ -154,7 +154,7 @@ static unsigned short mpt_lan_type_trans(struct sk_buff *skb,
/* /*
* Fusion MPT LAN private data * Fusion MPT LAN private data
*/ */
static int LanCtx = -1; static u8 LanCtx = MPT_MAX_PROTOCOL_DRIVERS;
static u32 max_buckets_out = 127; static u32 max_buckets_out = 127;
static u32 tx_max_out_p = 127 - 16; static u32 tx_max_out_p = 127 - 16;
...@@ -164,12 +164,6 @@ static struct NAA_Hosed *mpt_bad_naa = NULL; ...@@ -164,12 +164,6 @@ static struct NAA_Hosed *mpt_bad_naa = NULL;
DEFINE_RWLOCK(bad_naa_lock); DEFINE_RWLOCK(bad_naa_lock);
#endif #endif
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*
* Fusion MPT LAN external data
*/
extern int mpt_lan_index;
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/** /**
* lan_reply - Handle all data sent from the hardware. * lan_reply - Handle all data sent from the hardware.
...@@ -1230,6 +1224,8 @@ mpt_lan_post_receive_buckets(struct mpt_lan_priv *priv) ...@@ -1230,6 +1224,8 @@ mpt_lan_post_receive_buckets(struct mpt_lan_priv *priv)
} }
pRecvReq = (LANReceivePostRequest_t *) mf; pRecvReq = (LANReceivePostRequest_t *) mf;
i = le16_to_cpu(mf->u.frame.hwhdr.msgctxu.fld.req_idx);
mpt_dev->RequestNB[i] = 0;
count = buckets; count = buckets;
if (count > max) if (count > max)
count = max; count = max;
...@@ -1351,10 +1347,11 @@ mpt_lan_post_receive_buckets_work(struct work_struct *work) ...@@ -1351,10 +1347,11 @@ mpt_lan_post_receive_buckets_work(struct work_struct *work)
static struct net_device * static struct net_device *
mpt_register_lan_device (MPT_ADAPTER *mpt_dev, int pnum) mpt_register_lan_device (MPT_ADAPTER *mpt_dev, int pnum)
{ {
struct net_device *dev = alloc_fcdev(sizeof(struct mpt_lan_priv)); struct net_device *dev;
struct mpt_lan_priv *priv = NULL; struct mpt_lan_priv *priv;
u8 HWaddr[FC_ALEN], *a; u8 HWaddr[FC_ALEN], *a;
dev = alloc_fcdev(sizeof(struct mpt_lan_priv));
if (!dev) if (!dev)
return NULL; return NULL;
...@@ -1366,7 +1363,6 @@ mpt_register_lan_device (MPT_ADAPTER *mpt_dev, int pnum) ...@@ -1366,7 +1363,6 @@ mpt_register_lan_device (MPT_ADAPTER *mpt_dev, int pnum)
priv->mpt_dev = mpt_dev; priv->mpt_dev = mpt_dev;
priv->pnum = pnum; priv->pnum = pnum;
memset(&priv->post_buckets_task, 0, sizeof(priv->post_buckets_task));
INIT_DELAYED_WORK(&priv->post_buckets_task, INIT_DELAYED_WORK(&priv->post_buckets_task,
mpt_lan_post_receive_buckets_work); mpt_lan_post_receive_buckets_work);
priv->post_buckets_active = 0; priv->post_buckets_active = 0;
...@@ -1391,8 +1387,6 @@ mpt_register_lan_device (MPT_ADAPTER *mpt_dev, int pnum) ...@@ -1391,8 +1387,6 @@ mpt_register_lan_device (MPT_ADAPTER *mpt_dev, int pnum)
spin_lock_init(&priv->txfidx_lock); spin_lock_init(&priv->txfidx_lock);
spin_lock_init(&priv->rxfidx_lock); spin_lock_init(&priv->rxfidx_lock);
memset(&priv->stats, 0, sizeof(priv->stats));
/* Grab pre-fetched LANPage1 stuff. :-) */ /* Grab pre-fetched LANPage1 stuff. :-) */
a = (u8 *) &mpt_dev->lan_cnfg_page1.HardwareAddressLow; a = (u8 *) &mpt_dev->lan_cnfg_page1.HardwareAddressLow;
...@@ -1508,9 +1502,6 @@ static int __init mpt_lan_init (void) ...@@ -1508,9 +1502,6 @@ static int __init mpt_lan_init (void)
return -EBUSY; return -EBUSY;
} }
/* Set the callback index to be used by driver core for turbo replies */
mpt_lan_index = LanCtx;
dlprintk((KERN_INFO MYNAM ": assigned context of %d\n", LanCtx)); dlprintk((KERN_INFO MYNAM ": assigned context of %d\n", LanCtx));
if (mpt_reset_register(LanCtx, mpt_lan_ioc_reset)) { if (mpt_reset_register(LanCtx, mpt_lan_ioc_reset)) {
...@@ -1531,10 +1522,9 @@ static void __exit mpt_lan_exit(void) ...@@ -1531,10 +1522,9 @@ static void __exit mpt_lan_exit(void)
mpt_device_driver_deregister(MPTLAN_DRIVER); mpt_device_driver_deregister(MPTLAN_DRIVER);
mpt_reset_deregister(LanCtx); mpt_reset_deregister(LanCtx);
if (LanCtx >= 0) { if (LanCtx) {
mpt_deregister(LanCtx); mpt_deregister(LanCtx);
LanCtx = -1; LanCtx = MPT_MAX_PROTOCOL_DRIVERS;
mpt_lan_index = 0;
} }
} }
......
/* /*
* linux/drivers/message/fusion/mptlan.h * linux/drivers/message/fusion/mptlan.h
* IP Over Fibre Channel device driver. * IP Over Fibre Channel device driver.
* For use with LSI Logic Fibre Channel PCI chip/adapters * For use with LSI Fibre Channel PCI chip/adapters
* running LSI Logic Fusion MPT (Message Passing Technology) firmware. * running LSI Fusion MPT (Message Passing Technology) firmware.
* *
* Copyright (c) 2000-2007 LSI Logic Corporation * Copyright (c) 2000-2007 LSI Corporation
* (mailto:DL-MPTFusionLinux@lsi.com) * (mailto:DL-MPTFusionLinux@lsi.com)
* *
*/ */
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
#include <asm/io.h> #include <asm/io.h>
/* Override mptbase.h by pre-defining these! */ /* Override mptbase.h by pre-defining these! */
#define MODULEAUTHOR "LSI Logic Corporation" #define MODULEAUTHOR "LSI Corporation"
#include "mptbase.h" #include "mptbase.h"
......
This diff is collapsed.
/*
* linux/drivers/message/fusion/mptsas.h
* High performance SCSI + LAN / Fibre Channel device drivers.
* For use with PCI chip/adapter(s):
* LSIFC9xx/LSI409xx Fibre Channel
* running LSI MPT (Message Passing Technology) firmware.
*
* Copyright (c) 1999-2007 LSI Corporation
* (mailto:DL-MPTFusionLinux@lsi.com)
*
*/
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
NO WARRANTY
THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
solely responsible for determining the appropriateness of using and
distributing the Program and assumes all risks associated with its
exercise of rights under this Agreement, including but not limited to
the risks and costs of program errors, damage to or loss of data,
programs or equipment, and unavailability or interruption of operations.
DISCLAIMER OF LIABILITY
NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef MPTSAS_H_INCLUDED
#define MPTSAS_H_INCLUDED
/*{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
struct mptsas_target_reset_event {
struct list_head list;
EVENT_DATA_SAS_DEVICE_STATUS_CHANGE sas_event_data;
u8 target_reset_issued;
};
enum mptsas_hotplug_action {
MPTSAS_ADD_DEVICE,
MPTSAS_DEL_DEVICE,
MPTSAS_ADD_RAID,
MPTSAS_DEL_RAID,
MPTSAS_ADD_INACTIVE_VOLUME,
MPTSAS_IGNORE_EVENT,
};
struct mptsas_hotplug_event {
struct work_struct work;
MPT_ADAPTER *ioc;
enum mptsas_hotplug_action event_type;
u64 sas_address;
u8 channel;
u8 id;
u32 device_info;
u16 handle;
u16 parent_handle;
u8 phy_id;
u8 phys_disk_num_valid; /* hrc (hidden raid component) */
u8 phys_disk_num; /* hrc - unique index*/
u8 hidden_raid_component; /* hrc - don't expose*/
};
struct mptsas_discovery_event {
struct work_struct work;
MPT_ADAPTER *ioc;
};
/*
* SAS topology structures
*
* The MPT Fusion firmware interface spreads information about the
* SAS topology over many manufacture pages, thus we need some data
* structure to collect it and process it for the SAS transport class.
*/
struct mptsas_devinfo {
u16 handle; /* unique id to address this device */
u16 handle_parent; /* unique id to address parent device */
u16 handle_enclosure; /* enclosure identifier of the enclosure */
u16 slot; /* physical slot in enclosure */
u8 phy_id; /* phy number of parent device */
u8 port_id; /* sas physical port this device
is assoc'd with */
u8 id; /* logical target id of this device */
u32 phys_disk_num; /* phys disk id, for csmi-ioctls */
u8 channel; /* logical bus number of this device */
u64 sas_address; /* WWN of this device,
SATA is assigned by HBA,expander */
u32 device_info; /* bitfield detailed info about this device */
};
/*
* Specific details on ports, wide/narrow
*/
struct mptsas_portinfo_details{
u16 num_phys; /* number of phys belong to this port */
u64 phy_bitmask; /* TODO, extend support for 255 phys */
struct sas_rphy *rphy; /* transport layer rphy object */
struct sas_port *port; /* transport layer port object */
struct scsi_target *starget;
struct mptsas_portinfo *port_info;
};
struct mptsas_phyinfo {
u16 handle; /* unique id to address this */
u8 phy_id; /* phy index */
u8 port_id; /* firmware port identifier */
u8 negotiated_link_rate; /* nego'd link rate for this phy */
u8 hw_link_rate; /* hardware max/min phys link rate */
u8 programmed_link_rate; /* programmed max/min phy link rate */
u8 sas_port_add_phy; /* flag to request sas_port_add_phy*/
struct mptsas_devinfo identify; /* point to phy device info */
struct mptsas_devinfo attached; /* point to attached device info */
struct sas_phy *phy; /* transport layer phy object */
struct mptsas_portinfo *portinfo;
struct mptsas_portinfo_details * port_details;
};
struct mptsas_portinfo {
struct list_head list;
u16 num_phys; /* number of phys */
struct mptsas_phyinfo *phy_info;
};
struct mptsas_enclosure {
u64 enclosure_logical_id; /* The WWN for the enclosure */
u16 enclosure_handle; /* unique id to address this */
u16 flags; /* details enclosure management */
u16 num_slot; /* num slots */
u16 start_slot; /* first slot */
u8 start_id; /* starting logical target id */
u8 start_channel; /* starting logical channel id */
u8 sep_id; /* SEP device logical target id */
u8 sep_channel; /* SEP channel logical channel id */
};
/*}-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
#endif
This diff is collapsed.
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
* High performance SCSI / Fibre Channel SCSI Host device driver. * High performance SCSI / Fibre Channel SCSI Host device driver.
* For use with PCI chip/adapter(s): * For use with PCI chip/adapter(s):
* LSIFC9xx/LSI409xx Fibre Channel * LSIFC9xx/LSI409xx Fibre Channel
* running LSI Logic Fusion MPT (Message Passing Technology) firmware. * running LSI Fusion MPT (Message Passing Technology) firmware.
* *
* Copyright (c) 1999-2007 LSI Logic Corporation * Copyright (c) 1999-2007 LSI Corporation
* (mailto:DL-MPTFusionLinux@lsi.com) * (mailto:DL-MPTFusionLinux@lsi.com)
* *
*/ */
......
This diff is collapsed.
...@@ -1038,6 +1038,10 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device) ...@@ -1038,6 +1038,10 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device)
spin_lock_init(&adapter->san_dbf_lock); spin_lock_init(&adapter->san_dbf_lock);
spin_lock_init(&adapter->scsi_dbf_lock); spin_lock_init(&adapter->scsi_dbf_lock);
retval = zfcp_adapter_debug_register(adapter);
if (retval)
goto debug_register_failed;
/* initialize error recovery stuff */ /* initialize error recovery stuff */
rwlock_init(&adapter->erp_lock); rwlock_init(&adapter->erp_lock);
...@@ -1058,7 +1062,6 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device) ...@@ -1058,7 +1062,6 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device)
/* mark adapter unusable as long as sysfs registration is not complete */ /* mark adapter unusable as long as sysfs registration is not complete */
atomic_set_mask(ZFCP_STATUS_COMMON_REMOVE, &adapter->status); atomic_set_mask(ZFCP_STATUS_COMMON_REMOVE, &adapter->status);
adapter->ccw_device = ccw_device;
dev_set_drvdata(&ccw_device->dev, adapter); dev_set_drvdata(&ccw_device->dev, adapter);
if (zfcp_sysfs_adapter_create_files(&ccw_device->dev)) if (zfcp_sysfs_adapter_create_files(&ccw_device->dev))
...@@ -1085,6 +1088,8 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device) ...@@ -1085,6 +1088,8 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device)
generic_services_failed: generic_services_failed:
zfcp_sysfs_adapter_remove_files(&adapter->ccw_device->dev); zfcp_sysfs_adapter_remove_files(&adapter->ccw_device->dev);
sysfs_failed: sysfs_failed:
zfcp_adapter_debug_unregister(adapter);
debug_register_failed:
dev_set_drvdata(&ccw_device->dev, NULL); dev_set_drvdata(&ccw_device->dev, NULL);
zfcp_reqlist_free(adapter); zfcp_reqlist_free(adapter);
failed_low_mem_buffers: failed_low_mem_buffers:
...@@ -1130,6 +1135,8 @@ zfcp_adapter_dequeue(struct zfcp_adapter *adapter) ...@@ -1130,6 +1135,8 @@ zfcp_adapter_dequeue(struct zfcp_adapter *adapter)
goto out; goto out;
} }
zfcp_adapter_debug_unregister(adapter);
/* remove specified adapter data structure from list */ /* remove specified adapter data structure from list */
write_lock_irq(&zfcp_data.config_lock); write_lock_irq(&zfcp_data.config_lock);
list_del(&adapter->list); list_del(&adapter->list);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment