You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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
...
This commit is contained in:
@@ -1,15 +1,19 @@
|
||||
|
||||
menu "Fusion MPT device support"
|
||||
menuconfig FUSION
|
||||
bool "Fusion MPT device support"
|
||||
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.
|
||||
|
||||
config FUSION
|
||||
bool
|
||||
default n
|
||||
If you say N, all options in this submenu will be skipped and disabled.
|
||||
|
||||
if FUSION
|
||||
|
||||
config FUSION_SPI
|
||||
tristate "Fusion MPT ScsiHost drivers for SPI"
|
||||
depends on PCI && SCSI
|
||||
select FUSION
|
||||
select SCSI_SPI_ATTRS
|
||||
---help---
|
||||
SCSI HOST support for a parallel SCSI host adapters.
|
||||
@@ -20,11 +24,11 @@ config FUSION_SPI
|
||||
LSI53C1020A
|
||||
LSI53C1030
|
||||
LSI53C1035
|
||||
ATTO UL4D
|
||||
|
||||
config FUSION_FC
|
||||
tristate "Fusion MPT ScsiHost drivers for FC"
|
||||
depends on PCI && SCSI
|
||||
select FUSION
|
||||
select SCSI_FC_ATTRS
|
||||
---help---
|
||||
SCSI HOST support for a Fiber Channel host adapters.
|
||||
@@ -37,12 +41,13 @@ config FUSION_FC
|
||||
LSIFC929
|
||||
LSIFC929X
|
||||
LSIFC929XL
|
||||
LSIFC949X
|
||||
LSIFC949E
|
||||
Brocade FC 410/420
|
||||
|
||||
config FUSION_SAS
|
||||
tristate "Fusion MPT ScsiHost drivers for SAS"
|
||||
depends on PCI && SCSI
|
||||
select FUSION
|
||||
select SCSI_SAS_ATTRS
|
||||
---help---
|
||||
SCSI HOST support for a SAS host adapters.
|
||||
@@ -53,10 +58,10 @@ config FUSION_SAS
|
||||
LSISAS1068
|
||||
LSISAS1064E
|
||||
LSISAS1068E
|
||||
LSISAS1078
|
||||
|
||||
config FUSION_MAX_SGE
|
||||
int "Maximum number of scatter gather entries (16 - 128)"
|
||||
depends on FUSION
|
||||
default "128"
|
||||
range 16 128
|
||||
help
|
||||
@@ -104,7 +109,6 @@ config FUSION_LAN
|
||||
|
||||
config FUSION_LOGGING
|
||||
bool "Fusion MPT logging facility"
|
||||
depends on FUSION
|
||||
---help---
|
||||
This turns on a logging facility that can be used to debug a number
|
||||
of Fusion MPT related problems.
|
||||
@@ -113,7 +117,7 @@ config FUSION_LOGGING
|
||||
|
||||
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
|
||||
|
||||
endmenu
|
||||
endif # FUSION
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000-2007 LSI Logic Corporation.
|
||||
* Copyright (c) 2000-2007 LSI Corporation.
|
||||
*
|
||||
*
|
||||
* Name: mpi.h
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000-2007 LSI Logic Corporation.
|
||||
* Copyright (c) 2000-2007 LSI Corporation.
|
||||
*
|
||||
*
|
||||
* Name: mpi_cnfg.h
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000-2004 LSI Logic Corporation.
|
||||
* Copyright (c) 2000-2004 LSI Corporation.
|
||||
*
|
||||
*
|
||||
* Name: mpi_fc.h
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000-2007 LSI Logic Corporation.
|
||||
* Copyright (c) 2000-2007 LSI Corporation.
|
||||
*
|
||||
*
|
||||
* Name: mpi_init.h
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000-2007 LSI Logic Corporation.
|
||||
* Copyright (c) 2000-2007 LSI Corporation.
|
||||
*
|
||||
*
|
||||
* Name: mpi_ioc.h
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000-2004 LSI Logic Corporation.
|
||||
* Copyright (c) 2000-2004 LSI Corporation.
|
||||
*
|
||||
*
|
||||
* Name: mpi_lan.h
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000-2001 LSI Logic Corporation. All rights reserved.
|
||||
* Copyright (c) 2000-2001 LSI Corporation. All rights reserved.
|
||||
*
|
||||
* NAME: fc_log.h
|
||||
* SUMMARY: MPI IocLogInfo definitions for the SYMFC9xx chips
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Copyright 2003 LSI Logic Corporation. All rights reserved. *
|
||||
* Copyright 2003 LSI Corporation. All rights reserved. *
|
||||
* *
|
||||
* Description *
|
||||
* ------------ *
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2007 LSI Logic Corporation.
|
||||
* Copyright (c) 2001-2007 LSI Corporation.
|
||||
*
|
||||
*
|
||||
* Name: mpi_raid.h
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2004-2006 LSI Logic Corporation.
|
||||
* Copyright (c) 2004-2006 LSI Corporation.
|
||||
*
|
||||
*
|
||||
* Name: mpi_sas.h
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000-2004 LSI Logic Corporation.
|
||||
* Copyright (c) 2000-2004 LSI Corporation.
|
||||
*
|
||||
*
|
||||
* Name: mpi_targ.h
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001-2005 LSI Logic Corporation.
|
||||
* Copyright (c) 2001-2005 LSI Corporation.
|
||||
*
|
||||
*
|
||||
* Name: mpi_tool.h
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000-2004 LSI Logic Corporation.
|
||||
* Copyright (c) 2000-2004 LSI Corporation.
|
||||
*
|
||||
*
|
||||
* Name: mpi_type.h
|
||||
|
||||
+345
-259
File diff suppressed because it is too large
Load Diff
@@ -3,9 +3,9 @@
|
||||
* High performance SCSI + LAN / Fibre Channel device drivers.
|
||||
* For use with PCI chip/adapter(s):
|
||||
* 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)
|
||||
*
|
||||
*/
|
||||
@@ -68,15 +68,15 @@
|
||||
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
|
||||
|
||||
#ifndef MODULEAUTHOR
|
||||
#define MODULEAUTHOR "LSI Logic Corporation"
|
||||
#define MODULEAUTHOR "LSI Corporation"
|
||||
#endif
|
||||
|
||||
#ifndef COPYRIGHT
|
||||
#define COPYRIGHT "Copyright (c) 1999-2007 " MODULEAUTHOR
|
||||
#endif
|
||||
|
||||
#define MPT_LINUX_VERSION_COMMON "3.04.05"
|
||||
#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.04.05"
|
||||
#define MPT_LINUX_VERSION_COMMON "3.04.06"
|
||||
#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.04.06"
|
||||
#define WHAT_MAGIC_STRING "@" "(" "#" ")"
|
||||
|
||||
#define show_mptmod_ver(s,ver) \
|
||||
@@ -186,12 +186,42 @@
|
||||
* MPT drivers. NOTE: Users of these macro defs must
|
||||
* themselves define their own MYNAM.
|
||||
*/
|
||||
#define MYIOC_s_FMT MYNAM ": %s: "
|
||||
#define MYIOC_s_DEBUG_FMT KERN_DEBUG MYNAM ": %s: "
|
||||
#define MYIOC_s_INFO_FMT KERN_INFO MYNAM ": %s: "
|
||||
#define MYIOC_s_NOTE_FMT KERN_NOTICE MYNAM ": %s: "
|
||||
#define MYIOC_s_WARN_FMT KERN_WARNING MYNAM ": %s: WARNING - "
|
||||
#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...
|
||||
@@ -307,7 +337,8 @@ typedef struct _SYSIF_REGS
|
||||
u32 Reserved2[2]; /* 38-3F reserved for future use */
|
||||
u32 RequestFifo; /* 40 Request 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 Reserved4[15]; /* 54-8F */
|
||||
u32 Fubar; /* 90 For Fubar usage */
|
||||
@@ -649,9 +680,9 @@ typedef struct _MPT_ADAPTER
|
||||
u8 reload_fw; /* Force a FW Reload on next reset */
|
||||
u8 NBShiftFactor; /* NB Shift Factor based on Block Size (Facts) */
|
||||
u8 pad1[4];
|
||||
int DoneCtx;
|
||||
int TaskCtx;
|
||||
int InternalCtx;
|
||||
u8 DoneCtx;
|
||||
u8 TaskCtx;
|
||||
u8 InternalCtx;
|
||||
spinlock_t initializing_hba_lock;
|
||||
int initializing_hba_lock_flag;
|
||||
struct list_head list;
|
||||
@@ -668,10 +699,14 @@ typedef struct _MPT_ADAPTER
|
||||
|
||||
struct work_struct fc_setup_reset_work;
|
||||
struct list_head fc_rports;
|
||||
struct work_struct fc_lsc_work;
|
||||
u8 fc_link_speed[2];
|
||||
spinlock_t fc_rescan_work_lock;
|
||||
struct work_struct fc_rescan_work;
|
||||
char fc_rescan_work_q_name[KOBJ_NAME_LEN];
|
||||
struct workqueue_struct *fc_rescan_work_q;
|
||||
struct scsi_cmnd **ScsiLookup;
|
||||
spinlock_t scsi_lookup_lock;
|
||||
} MPT_ADAPTER;
|
||||
|
||||
/*
|
||||
@@ -785,7 +820,6 @@ typedef struct _MPT_SCSI_HOST {
|
||||
MPT_ADAPTER *ioc;
|
||||
int port;
|
||||
u32 pad0;
|
||||
struct scsi_cmnd **ScsiLookup;
|
||||
MPT_LOCAL_REPLY *pLocal; /* used for internal commands */
|
||||
struct timer_list timer;
|
||||
/* Pool of memory for holding SCpnts before doing
|
||||
@@ -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_resume(struct pci_dev *pdev);
|
||||
#endif
|
||||
extern int mpt_register(MPT_CALLBACK cbfunc, MPT_DRIVER_CLASS dclass);
|
||||
extern void mpt_deregister(int cb_idx);
|
||||
extern int mpt_event_register(int cb_idx, MPT_EVHANDLER ev_cbfunc);
|
||||
extern void mpt_event_deregister(int cb_idx);
|
||||
extern int mpt_reset_register(int cb_idx, MPT_RESETHANDLER reset_func);
|
||||
extern void mpt_reset_deregister(int cb_idx);
|
||||
extern int mpt_device_driver_register(struct mpt_pci_driver * dd_cbfunc, int cb_idx);
|
||||
extern void mpt_device_driver_deregister(int cb_idx);
|
||||
extern MPT_FRAME_HDR *mpt_get_msg_frame(int handle, MPT_ADAPTER *ioc);
|
||||
extern u8 mpt_register(MPT_CALLBACK cbfunc, MPT_DRIVER_CLASS dclass);
|
||||
extern void mpt_deregister(u8 cb_idx);
|
||||
extern int mpt_event_register(u8 cb_idx, MPT_EVHANDLER ev_cbfunc);
|
||||
extern void mpt_event_deregister(u8 cb_idx);
|
||||
extern int mpt_reset_register(u8 cb_idx, MPT_RESETHANDLER reset_func);
|
||||
extern void mpt_reset_deregister(u8 cb_idx);
|
||||
extern int mpt_device_driver_register(struct mpt_pci_driver * dd_cbfunc, u8 cb_idx);
|
||||
extern void mpt_device_driver_deregister(u8 cb_idx);
|
||||
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_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 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 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);
|
||||
@@ -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 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__ */
|
||||
|
||||
|
||||
+182
-182
File diff suppressed because it is too large
Load Diff
@@ -3,9 +3,9 @@
|
||||
* Fusion MPT misc device (ioctl) driver.
|
||||
* For use with PCI chip/adapter(s):
|
||||
* 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)
|
||||
*
|
||||
*/
|
||||
|
||||
+108
-41
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* linux/drivers/message/fusion/mptfc.c
|
||||
* For use with LSI Logic PCI chip/adapter(s)
|
||||
* running LSI Logic Fusion MPT (Message Passing Technology) firmware.
|
||||
* For use with LSI PCI chip/adapter(s)
|
||||
* 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)
|
||||
*
|
||||
*/
|
||||
@@ -90,9 +90,9 @@ static int max_lun = MPTFC_MAX_LUN;
|
||||
module_param(max_lun, int, 0);
|
||||
MODULE_PARM_DESC(max_lun, " max lun, default=16895 ");
|
||||
|
||||
static int mptfcDoneCtx = -1;
|
||||
static int mptfcTaskCtx = -1;
|
||||
static int mptfcInternalCtx = -1; /* Used only for internal commands */
|
||||
static u8 mptfcDoneCtx = MPT_MAX_PROTOCOL_DRIVERS;
|
||||
static u8 mptfcTaskCtx = MPT_MAX_PROTOCOL_DRIVERS;
|
||||
static u8 mptfcInternalCtx = MPT_MAX_PROTOCOL_DRIVERS;
|
||||
|
||||
static int mptfc_target_alloc(struct scsi_target *starget);
|
||||
static int mptfc_slave_alloc(struct scsi_device *sdev);
|
||||
@@ -194,37 +194,36 @@ mptfc_block_error_handler(struct scsi_cmnd *SCpnt,
|
||||
struct fc_rport *rport = starget_to_rport(scsi_target(sdev));
|
||||
unsigned long flags;
|
||||
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);
|
||||
while ((ready = fc_remote_port_chkready(rport) >> 16) == DID_IMM_RETRY) {
|
||||
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 "
|
||||
"DID_IMM_RETRY, deferring %s recovery.\n",
|
||||
((MPT_SCSI_HOST *) shost->hostdata)->ioc->name,
|
||||
((MPT_SCSI_HOST *) shost->hostdata)->ioc->sh->host_no,
|
||||
SCpnt->device->id,SCpnt->device->lun,caller));
|
||||
ioc->name, ioc->sh->host_no,
|
||||
SCpnt->device->id, SCpnt->device->lun, caller));
|
||||
msleep(1000);
|
||||
spin_lock_irqsave(shost->host_lock, flags);
|
||||
}
|
||||
spin_unlock_irqrestore(shost->host_lock, flags);
|
||||
|
||||
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, "
|
||||
"port state %d, vdev %p.\n", caller,
|
||||
((MPT_SCSI_HOST *) shost->hostdata)->ioc->name,
|
||||
((MPT_SCSI_HOST *) shost->hostdata)->ioc->sh->host_no,
|
||||
SCpnt->device->id,SCpnt->device->lun,ready,
|
||||
"port state %d, vdevice %p.\n", caller,
|
||||
ioc->name, ioc->sh->host_no,
|
||||
SCpnt->device->id, SCpnt->device->lun, ready,
|
||||
SCpnt->device->hostdata));
|
||||
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,
|
||||
((MPT_SCSI_HOST *) shost->hostdata)->ioc->name,
|
||||
((MPT_SCSI_HOST *) shost->hostdata)->ioc->sh->host_no,
|
||||
SCpnt->device->id,SCpnt->device->lun));
|
||||
ioc->name, ioc->sh->host_no,
|
||||
SCpnt->device->id, SCpnt->device->lun));
|
||||
return (*func)(SCpnt);
|
||||
}
|
||||
|
||||
@@ -470,7 +469,7 @@ mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0)
|
||||
/*
|
||||
* if already mapped, remap here. If not mapped,
|
||||
* 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) {
|
||||
vtarget = ri->starget->hostdata;
|
||||
@@ -602,10 +601,10 @@ mptfc_slave_alloc(struct scsi_device *sdev)
|
||||
{
|
||||
MPT_SCSI_HOST *hd;
|
||||
VirtTarget *vtarget;
|
||||
VirtDevice *vdev;
|
||||
VirtDevice *vdevice;
|
||||
struct scsi_target *starget;
|
||||
struct fc_rport *rport;
|
||||
|
||||
MPT_ADAPTER *ioc;
|
||||
|
||||
starget = scsi_target(sdev);
|
||||
rport = starget_to_rport(starget);
|
||||
@@ -613,31 +612,32 @@ mptfc_slave_alloc(struct scsi_device *sdev)
|
||||
if (!rport || fc_remote_port_chkready(rport))
|
||||
return -ENXIO;
|
||||
|
||||
hd = (MPT_SCSI_HOST *)sdev->host->hostdata;
|
||||
hd = shost_priv(sdev->host);
|
||||
ioc = hd->ioc;
|
||||
|
||||
vdev = kzalloc(sizeof(VirtDevice), GFP_KERNEL);
|
||||
if (!vdev) {
|
||||
vdevice = kzalloc(sizeof(VirtDevice), GFP_KERNEL);
|
||||
if (!vdevice) {
|
||||
printk(MYIOC_s_ERR_FMT "slave_alloc kmalloc(%zd) FAILED!\n",
|
||||
hd->ioc->name, sizeof(VirtDevice));
|
||||
ioc->name, sizeof(VirtDevice));
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
||||
sdev->hostdata = vdev;
|
||||
sdev->hostdata = vdevice;
|
||||
vtarget = starget->hostdata;
|
||||
|
||||
if (vtarget->num_luns == 0) {
|
||||
vtarget->ioc_id = hd->ioc->id;
|
||||
vtarget->ioc_id = ioc->id;
|
||||
vtarget->tflags = MPT_TARGET_FLAGS_Q_YES;
|
||||
}
|
||||
|
||||
vdev->vtarget = vtarget;
|
||||
vdev->lun = sdev->lun;
|
||||
vdevice->vtarget = vtarget;
|
||||
vdevice->lun = sdev->lun;
|
||||
|
||||
vtarget->num_luns++;
|
||||
|
||||
|
||||
mptfc_dump_lun_info(hd->ioc, rport, sdev, vtarget);
|
||||
mptfc_dump_lun_info(ioc, rport, sdev, vtarget);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -648,9 +648,9 @@ mptfc_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
|
||||
struct mptfc_rport_info *ri;
|
||||
struct fc_rport *rport = starget_to_rport(scsi_target(SCpnt->device));
|
||||
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;
|
||||
done(SCpnt);
|
||||
return 0;
|
||||
@@ -674,6 +674,50 @@ mptfc_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
|
||||
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.
|
||||
* @ioc: Pointer to MPT_ADAPTER structure
|
||||
@@ -773,6 +817,7 @@ mptfc_GetFcPortPage0(MPT_ADAPTER *ioc, int portnum)
|
||||
" complete.\n",
|
||||
ioc->name);
|
||||
}
|
||||
mptfc_display_port_link_speed(ioc, portnum, pp0dest);
|
||||
}
|
||||
|
||||
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)
|
||||
|
||||
}
|
||||
|
||||
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
|
||||
mptfc_setup_reset(struct work_struct *work)
|
||||
{
|
||||
@@ -1163,6 +1220,7 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
spin_lock_init(&ioc->fc_rescan_work_lock);
|
||||
INIT_WORK(&ioc->fc_rescan_work, mptfc_rescan_devices);
|
||||
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);
|
||||
|
||||
@@ -1218,20 +1276,21 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
|
||||
spin_unlock_irqrestore(&ioc->FreeQlock, flags);
|
||||
|
||||
hd = (MPT_SCSI_HOST *) sh->hostdata;
|
||||
hd = shost_priv(sh);
|
||||
hd->ioc = ioc;
|
||||
|
||||
/* SCSI needs scsi_cmnd lookup table!
|
||||
* (with size equal to req_depth*PtrSz!)
|
||||
*/
|
||||
hd->ScsiLookup = kcalloc(ioc->req_depth, sizeof(void *), GFP_ATOMIC);
|
||||
if (!hd->ScsiLookup) {
|
||||
ioc->ScsiLookup = kcalloc(ioc->req_depth, sizeof(void *), GFP_ATOMIC);
|
||||
if (!ioc->ScsiLookup) {
|
||||
error = -ENOMEM;
|
||||
goto out_mptfc_probe;
|
||||
}
|
||||
spin_lock_init(&ioc->scsi_lookup_lock);
|
||||
|
||||
dprintk(ioc, printk(MYIOC_s_DEBUG_FMT "ScsiLookup @ %p\n",
|
||||
ioc->name, hd->ScsiLookup));
|
||||
ioc->name, ioc->ScsiLookup));
|
||||
|
||||
/* Clear the TM flags
|
||||
*/
|
||||
@@ -1262,8 +1321,8 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
sh->transportt = mptfc_transport_template;
|
||||
error = scsi_add_host (sh, &ioc->pcidev->dev);
|
||||
if(error) {
|
||||
dprintk(ioc, printk(KERN_ERR MYNAM
|
||||
"scsi_add_host failed\n"));
|
||||
dprintk(ioc, printk(MYIOC_s_ERR_FMT
|
||||
"scsi_add_host failed\n", ioc->name));
|
||||
goto out_mptfc_probe;
|
||||
}
|
||||
|
||||
@@ -1325,7 +1384,7 @@ mptfc_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply)
|
||||
ioc->name, event));
|
||||
|
||||
if (ioc->sh == NULL ||
|
||||
((hd = (MPT_SCSI_HOST *)ioc->sh->hostdata) == NULL))
|
||||
((hd = shost_priv(ioc->sh)) == NULL))
|
||||
return 1;
|
||||
|
||||
switch (event) {
|
||||
@@ -1337,6 +1396,14 @@ mptfc_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply)
|
||||
}
|
||||
spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags);
|
||||
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:
|
||||
rc = mptscsih_event_process(ioc,pEvReply);
|
||||
break;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user